Skip to content

Commit 8d26439

Browse files
committed
Fix SCD calib maxTracksPerCalibSlot=-1 option
When set to -1 (for unlimited number of tracks) it would currently just process 1 track per TF
1 parent 7eda069 commit 8d26439

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/src/TPCInterpolationSpec.cxx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,14 @@ void TPCInterpolationDPL::updateTimeDependentParams(ProcessingContext& pc)
6161
// other init-once stuff
6262
mInterpolation.init();
6363
int nTfs = mSlotLength / (o2::base::GRPGeomHelper::getNHBFPerTF() * o2::constants::lhc::LHCOrbitMUS * 1e-6);
64-
int nTracksPerTfMax = (nTfs > 0) ? SpacePointsCalibConfParam::Instance().maxTracksPerCalibSlot / nTfs : -1;
65-
if (nTracksPerTfMax >= 0) {
64+
bool limitTracks = (SpacePointsCalibConfParam::Instance().maxTracksPerCalibSlot < 0) ? true : false;
65+
int nTracksPerTfMax = (nTfs > 0 && !limitTracks) ? SpacePointsCalibConfParam::Instance().maxTracksPerCalibSlot / nTfs : -1;
66+
if (nTracksPerTfMax > 0) {
6667
LOGP(info, "We will stop processing tracks after validating {} tracks per TF", nTracksPerTfMax);
67-
} else {
68+
} else if (nTracksPerTfMax < 0) {
6869
LOG(info) << "The number of processed tracks per TF is not limited";
70+
} else {
71+
LOG(error) << "No tracks will be processed. maxTracksPerCalibSlot must be greater than slot length in TFs";
6972
}
7073
mInterpolation.setMaxTracksPerTF(nTracksPerTfMax);
7174
}

Detectors/TPC/calibration/SpacePoints/src/TrackInterpolation.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,15 @@ void TrackInterpolation::process(const o2::globaltracking::RecoContainer& inp, c
101101
std::shuffle(trackIndices.begin() + nTracks, trackIndices.begin() + nTracks + trkCounters.at(GTrackID::Source::ITSTPC), g);
102102

103103
for (int iSeed = 0; iSeed < nSeeds; ++iSeed) {
104+
if (mMaxTracksPerTF >= 0 && mTrackDataCompact.size() >= mMaxTracksPerTF) {
105+
LOG(info) << "Maximum number of tracks per TF reached. Skipping the remaining " << nSeeds - iSeed << " tracks.";
106+
break;
107+
}
104108
if (gids[trackIndices[iSeed]].includesDet(DetID::TRD) || gids[trackIndices[iSeed]].includesDet(DetID::TOF)) {
105109
interpolateTrack(trackIndices[iSeed]);
106110
} else {
107111
extrapolateTrack(trackIndices[iSeed]);
108112
}
109-
if (mMaxTracksPerTF >= 0 && mTrackDataCompact.size() >= mMaxTracksPerTF) {
110-
LOG(info) << "Maximum number of tracks per TF reached. Skipping the remaining " << nSeeds - iSeed << " tracks.";
111-
break;
112-
}
113113
}
114114

115115
LOG(info) << "Could process " << mTrackData.size() << " tracks successfully";

0 commit comments

Comments
 (0)