2424#include " SimulationDataFormat/MCCompLabel.h"
2525#include " SimulationDataFormat/MCTruthContainer.h"
2626#include " DataFormatsITSMFT/ROFRecord.h"
27+ #include " DataFormatsITSMFT/PhysTrigger.h"
2728
2829#include " ITStracking/ROframe.h"
2930#include " ITStracking/IOUtils.h"
@@ -138,7 +139,7 @@ void TrackerDPL::run(ProcessingContext& pc)
138139 updateTimeDependentParams (pc);
139140 auto compClusters = pc.inputs ().get <gsl::span<o2::itsmft::CompClusterExt>>(" compClusters" );
140141 gsl::span<const unsigned char > patterns = pc.inputs ().get <gsl::span<unsigned char >>(" patterns" );
141-
142+ auto physTriggers = pc. inputs (). get <gsl::span<o2::itsmft::PhysTrigger>>( " phystrig " );
142143 // code further down does assignment to the rofs and the altered object is used for output
143144 // we therefore need a copy of the vector rather than an object created directly on the input data,
144145 // the output vector however is created directly inside the message memory thus avoiding copy by
@@ -175,13 +176,11 @@ void TrackerDPL::run(ProcessingContext& pc)
175176
176177 bool continuous = o2::base::GRPGeomHelper::instance ().getGRPECS ()->isDetContinuousReadOut (o2::detectors::DetID::ITS);
177178 LOG (info) << " ITSTracker RO: continuous=" << continuous;
178- const auto & multEstConf = FastMultEstConfig::Instance (); // parameters for mult estimation and cuts
179- FastMultEst multEst; // mult estimator
180179 TimeFrame* timeFrame = mChainITS ->GetITSTimeframe ();
181180 mTracker ->adoptTimeFrame (*timeFrame);
181+
182182 mTracker ->setBz (o2::base::Propagator::Instance ()->getNominalBz ());
183183 mVertexer ->adoptTimeFrame (*timeFrame);
184-
185184 gsl::span<const unsigned char >::iterator pattIt = patterns.begin ();
186185
187186 gsl::span<itsmft::ROFRecord> rofspan (rofs);
@@ -191,31 +190,17 @@ void TrackerDPL::run(ProcessingContext& pc)
191190 auto logger = [&](std::string s) { LOG (info) << s; };
192191 auto errorLogger = [&](std::string s) { LOG (error) << s; };
193192
193+ FastMultEst multEst; // mult estimator
194194 std::vector<bool > processingMask;
195- int cutRandomMult{0 }, cutClusterMult{0 }, cutVertexMult{0 };
196- for (size_t iRof{0 }; iRof < rofspan.size (); ++iRof) {
197- auto & rof = rofspan[iRof];
198- bool selROF = multEstConf.isPassingRandomRejection ();
199- if (!selROF) {
200- cutRandomMult++;
201- } else if (multEstConf.isMultCutRequested ()) { // cut was requested
202- float mult = multEst.process (rof.getROFData (compClusters));
203- selROF = multEstConf.isPassingMultCut (mult);
204- if (!selROF) {
205- LOG (debug) << fmt::format (" ROF {} rejected by the cluster multiplicity selection [{},{}]" , processingMask.size (), multEstConf.cutMultClusLow , multEstConf.cutMultClusHigh );
206- }
207- cutClusterMult += !selROF;
208- }
209- processingMask.push_back (selROF);
210- }
195+ int cutVertexMult{0 }, cutRandomMult = multEst.selectROFs (rofs, compClusters, physTriggers, processingMask);
211196 timeFrame->setMultiplicityCutMask (processingMask);
212197
213198 float vertexerElapsedTime{0 .f };
214199 if (mRunVertexer ) {
215200 // Run seeding vertexer
216201 vertexerElapsedTime = mVertexer ->clustersToVertices (false , logger);
217202 }
218-
203+ const auto & multEstConf = FastMultEstConfig::Instance (); // parameters for mult estimation and cuts
219204 for (auto iRof{0 }; iRof < rofspan.size (); ++iRof) {
220205 std::vector<Vertex> vtxVecLoc;
221206 auto & vtxROF = vertROFvec.emplace_back (rofspan[iRof]);
@@ -249,7 +234,7 @@ void TrackerDPL::run(ProcessingContext& pc)
249234 timeFrame->addPrimaryVertices (vtxVecLoc);
250235 }
251236 }
252- LOG (info) << fmt::format (" - rejected {}/{} ROFs: random:{}, mult.sel:{}, vtx.sel:{}" , cutRandomMult + cutClusterMult + cutVertexMult, rofspan.size (), cutRandomMult, cutClusterMult , cutVertexMult);
237+ LOG (info) << fmt::format (" - rejected {}/{} ROFs: random/ mult.sel:{}, vtx.sel:{}" , cutRandomMult + cutVertexMult, rofspan.size (), cutRandomMult, cutVertexMult);
253238 LOG (info) << fmt::format (" - Vertex seeding total elapsed time: {} ms for {} vertices found in {} ROFs" , vertexerElapsedTime, timeFrame->getPrimaryVerticesNum (), rofspan.size ());
254239 LOG (info) << fmt::format (" - Beam position computed for the TF: {}, {}" , timeFrame->getBeamX (), timeFrame->getBeamY ());
255240
@@ -354,6 +339,8 @@ DataProcessorSpec getTrackerSpec(bool useMC, const std::string& trModeS, o2::gpu
354339 inputs.emplace_back (" compClusters" , " ITS" , " COMPCLUSTERS" , 0 , Lifetime::Timeframe);
355340 inputs.emplace_back (" patterns" , " ITS" , " PATTERNS" , 0 , Lifetime::Timeframe);
356341 inputs.emplace_back (" ROframes" , " ITS" , " CLUSTERSROF" , 0 , Lifetime::Timeframe);
342+ inputs.emplace_back (" phystrig" , " ITS" , " PHYSTRIG" , 0 , Lifetime::Timeframe);
343+
357344 inputs.emplace_back (" cldict" , " ITS" , " CLUSDICT" , 0 , Lifetime::Condition, ccdbParamSpec (" ITS/Calib/ClusterDictionary" ));
358345 inputs.emplace_back (" alppar" , " ITS" , " ALPIDEPARAM" , 0 , Lifetime::Condition, ccdbParamSpec (" ITS/Config/AlpideParam" ));
359346 auto ggRequest = std::make_shared<o2::base::GRPGeomRequest>(false , // orbitResetTime
0 commit comments