@@ -112,10 +112,17 @@ void TrackerDPL::init(InitContext& ic)
112112 memParams.resize (1 );
113113 trackParams[0 ].MinTrackLength = 4 ;
114114 trackParams[0 ].TrackletMaxDeltaPhi = o2::its::constants::math::Pi * 0 .5f ;
115- trackParams[0 ].CellMaxDeltaTanLambda = 0.3 ;
116- trackParams[0 ].CellMaxDeltaPhi = 0.3 ;
115+ trackParams[0 ].CellMaxDeltaTanLambda *= 400 ;
116+ trackParams[0 ].CellMaxDeltaPhi = 1 . ;
117117 trackParams[0 ].PhiBins = 4 ;
118118 trackParams[0 ].ZBins = 16 ;
119+ trackParams[0 ].FitIterationMaxChi2 [0 ] = 1 .e28 ;
120+ trackParams[0 ].FitIterationMaxChi2 [1 ] = 1 .e28 ;
121+
122+ for (int iLayer = 0 ; iLayer < 4 ; ++iLayer) {
123+ trackParams[0 ].NeighbourMaxDeltaCurvature [iLayer] *= 400 ;
124+ trackParams[0 ].NeighbourMaxDeltaN [iLayer] *= 400 ;
125+ }
119126 for (int iLayer = 0 ; iLayer < o2::its::constants::its2::TrackletsPerRoad; iLayer++) {
120127 trackParams[0 ].TrackletMaxDeltaZ [iLayer] = o2::its::constants::its2::LayersZCoordinate ()[iLayer + 1 ];
121128 memParams[0 ].TrackletsMemoryCoefficients [iLayer] = 0 .5f ;
@@ -212,6 +219,9 @@ void TrackerDPL::run(ProcessingContext& pc)
212219 auto logger = [&](std::string s) { LOG (info) << s; };
213220 float vertexerElapsedTime{0 .f };
214221 int nclUsed = 0 ;
222+
223+ std::vector<bool > processingMask;
224+ int cutClusterMult{0 }, cutVertexMult{0 }, cutTotalMult{0 };
215225 for (auto & rof : rofspan) {
216226 nclUsed += ioutils::loadROFrameData (rof, event, compClusters, pattIt, mDict , labels);
217227 // prepare in advance output ROFRecords, even if this ROF to be rejected
@@ -222,14 +232,39 @@ void TrackerDPL::run(ProcessingContext& pc)
222232 vtxROF.setFirstEntry (vertices.size ()); // dedicated ROFRecord
223233 vtxROF.setNEntries (0 );
224234
235+ bool multCut = (multEstConf.cutMultClusLow <= 0 && multEstConf.cutMultClusHigh <= 0 ); // cut was requested
236+ if (!multCut) {
237+ float mult = multEst.process (rof.getROFData (compClusters));
238+ multCut = mult >= multEstConf.cutMultClusLow && mult <= multEstConf.cutMultClusHigh ;
239+ LOG (debug) << fmt::format (" ROF {} rejected by the cluster multiplicity selection [{},{}]" , processingMask.size (), multEstConf.cutMultClusLow , multEstConf.cutMultClusHigh );
240+ cutClusterMult += !multCut;
241+ }
242+
225243 std::vector<Vertex> vtxVecLoc;
226- if (mRunVertexer ) {
227- vertexerElapsedTime += mVertexer ->clustersToVertices (event, false , logger);
228- vtxVecLoc = mVertexer ->exportVertices ();
229- } else {
230- vtxVecLoc.emplace_back (Vertex ());
231- vtxVecLoc.back ().setNContributors (1 );
244+ if (multCut) {
245+ if (mRunVertexer ) {
246+ vertexerElapsedTime += mVertexer ->clustersToVertices (event, false , logger);
247+ auto allVerts = mVertexer ->exportVertices ();
248+ multCut = allVerts.size () == 0 ;
249+ for (const auto & vtx : allVerts) {
250+ if (vtx.getNContributors () < multEstConf.cutMultVtxLow || (multEstConf.cutMultVtxHigh > 0 && vtx.getNContributors () > multEstConf.cutMultVtxHigh )) {
251+ continue ; // skip vertex of unwanted multiplicity
252+ }
253+ multCut = true ; // At least one passes the selection
254+ vtxVecLoc.push_back (vtx);
255+ }
256+ } else {
257+ vtxVecLoc.emplace_back (Vertex ());
258+ vtxVecLoc.back ().setNContributors (1 );
259+ }
260+
261+ if (!multCut) {
262+ LOG (debug) << fmt::format (" ROF {} rejected by the vertex multiplicity selection [{},{}]" , processingMask.size (), multEstConf.cutMultVtxLow , multEstConf.cutMultVtxHigh );
263+ cutVertexMult++;
264+ }
232265 }
266+ cutTotalMult += !multCut;
267+ processingMask.push_back (multCut);
233268 mTimeFrame .addPrimaryVertices (vtxVecLoc);
234269
235270 vtxROF.setNEntries (vtxVecLoc.size ());
@@ -239,7 +274,13 @@ void TrackerDPL::run(ProcessingContext& pc)
239274 savedROF.push_back (roFrame);
240275 roFrame++;
241276 }
242- LOG (info) << " - Vertex seeding total elapsed time: " << vertexerElapsedTime << " ms for " << nclUsed << " clusters in " << rofspan.size () << " ROFs" ;
277+
278+ LOG (info) << fmt::format (" - In total, multiplicity selection rejected {}/{} ROFs" , cutTotalMult, rofspan.size ());
279+ LOG (info) << fmt::format (" \t - Cluster multiplicity selection rejected {}/{} ROFs" , cutClusterMult, rofspan.size ());
280+ LOG (info) << fmt::format (" \t - Vertex multiplicity selection rejected {}/{} ROFs" , cutVertexMult, rofspan.size ());
281+ LOG (info) << fmt::format (" - Vertex seeding total elapsed time: {} ms for {} clusters in {} ROFs" , vertexerElapsedTime, nclUsed, rofspan.size ());
282+
283+ mTimeFrame .setMultiplicityCutMask (processingMask);
243284 mTracker ->clustersToTracks (logger);
244285
245286 for (unsigned int iROF{0 }; iROF < rofs.size (); ++iROF) {
0 commit comments