@@ -45,15 +45,9 @@ void Tracker::clustersToTracks(const LogFunc& logger, const LogFunc& error)
4545{
4646 LogFunc evalLog = [](const std::string&) {};
4747
48- double total{0 };
4948 mTraits ->updateTrackingParameters (mTrkParams );
50- int maxNvertices{-1 };
51- if (mTrkParams [0 ].PerPrimaryVertexProcessing ) {
52- for (int iROF{0 }; iROF < mTimeFrame ->getNrof (); ++iROF) {
53- maxNvertices = std::max (maxNvertices, (int )mTimeFrame ->getPrimaryVertices (iROF).size ());
54- }
55- }
5649
50+ double total{0 };
5751 int iteration{0 }, iROFs{0 }, iVertex{0 };
5852 auto handleException = [&](const auto & err) {
5953 LOGP (error, " Too much memory used during {} in iteration {} in ROF span {}-{} iVtx={}: {:.2f} GB. Current limit is {:.2f} GB, check the detector status and/or the selections." ,
@@ -79,12 +73,12 @@ void Tracker::clustersToTracks(const LogFunc& logger, const LogFunc& error)
7973 double timeTracklets{0 .}, timeCells{0 .}, timeNeighbours{0 .}, timeRoads{0 .};
8074 int nTracklets{0 }, nCells{0 }, nNeighbours{0 }, nTracks{-static_cast <int >(mTimeFrame ->getNumberOfTracks ())};
8175 int nROFsIterations = mTrkParams [iteration].nROFsPerIterations > 0 ? mTimeFrame ->getNrof () / mTrkParams [iteration].nROFsPerIterations + bool (mTimeFrame ->getNrof () % mTrkParams [iteration].nROFsPerIterations ) : 1 ;
82- iVertex = std::min (maxNvertices, 0 );
8376 logger (std::format (" ==== ITS {} Tracking iteration {} summary ====" , mTraits ->getName (), iteration));
8477
8578 total += evaluateTask (&Tracker::initialiseTimeFrame, StateNames[mCurState = TFInit], iteration, logger, iteration);
86- do {
87- for (iROFs = 0 ; iROFs < nROFsIterations; ++iROFs) {
79+ for (iROFs = 0 ; iROFs < nROFsIterations; ++iROFs) {
80+ iVertex = (!mTrkParams [0 ].PerPrimaryVertexProcessing ) ? -1 : 0 ;
81+ do {
8882 timeTracklets += evaluateTask (&Tracker::computeTracklets, StateNames[mCurState = Trackleting], iteration, evalLog, iteration, iROFs, iVertex);
8983 nTracklets += mTraits ->getTFNumberOfTracklets ();
9084 float trackletsPerCluster = mTraits ->getTFNumberOfClusters () > 0 ? float (mTraits ->getTFNumberOfTracklets ()) / float (mTraits ->getTFNumberOfClusters ()) : 0 .f ;
@@ -104,8 +98,8 @@ void Tracker::clustersToTracks(const LogFunc& logger, const LogFunc& error)
10498 timeNeighbours += evaluateTask (&Tracker::findCellsNeighbours, StateNames[mCurState = Neighbouring], iteration, evalLog, iteration);
10599 nNeighbours += mTimeFrame ->getNumberOfNeighbours ();
106100 timeRoads += evaluateTask (&Tracker::findRoads, StateNames[mCurState = Roading], iteration, evalLog, iteration);
107- }
108- } while (++iVertex < maxNvertices);
101+ } while (iVertex >= 0 && ++iVertex < mTimeFrame -> getPrimaryVerticesNum (iROFs));
102+ }
109103 logger (std::format (" - Tracklet finding: {} tracklets found in {:.2f} ms" , nTracklets, timeTracklets));
110104 logger (std::format (" - Cell finding: {} cells found in {:.2f} ms" , nCells, timeCells));
111105 logger (std::format (" - Neighbours finding: {} neighbours found in {:.2f} ms" , nNeighbours, timeNeighbours));
0 commit comments