Skip to content

Commit 5453589

Browse files
committed
ITS: move lookup table creation to proper place
Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch>
1 parent d423f9f commit 5453589

File tree

1 file changed

+18
-22
lines changed

1 file changed

+18
-22
lines changed

Detectors/ITSMFT/ITS/tracking/src/TrackingInterface.cxx

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -88,26 +88,6 @@ void ITSTrackingInterface::initialise()
8888
void ITSTrackingInterface::run(framework::ProcessingContext& pc)
8989
{
9090
const auto& par = o2::itsmft::DPLAlpideParam<o2::detectors::DetID::ITS>::Instance();
91-
if (static bool doneOnce{false}; !doneOnce) {
92-
doneOnce = true;
93-
94-
// prepare rof lookup table(s)
95-
// has to be done here to ensure we get the right number of HB per TF
96-
const int nOrbitsPerTF = o2::base::GRPGeomHelper::getNHBFPerTF();
97-
TimeFrameN::ROFOverlapTableN rofTable;
98-
TimeFrameN::ROFVertexLookupTableN vtxTable;
99-
const auto& trackParams = mTracker->getParameters();
100-
for (int iLayer = 0; iLayer < NLayers; ++iLayer) {
101-
const unsigned int nROFsPerOrbit = o2::constants::lhc::LHCMaxBunches / par.getROFLengthInBC(iLayer);
102-
const LayerTiming timing{.mNROFsTF = (nROFsPerOrbit * nOrbitsPerTF), .mROFLength = (uint32_t)par.getROFLengthInBC(iLayer), .mROFDelay = (uint32_t)par.getROFDelayInBC(iLayer), .mROFBias = (uint32_t)par.getROFBiasInBC(iLayer), .mROFAddTimeErr = trackParams[0].AddTimeError[iLayer]};
103-
rofTable.defineLayer(iLayer, timing);
104-
vtxTable.defineLayer(iLayer, timing);
105-
}
106-
rofTable.init();
107-
mTimeFrame->setROFOverlapTable(rofTable);
108-
vtxTable.init();
109-
mTimeFrame->setROFVertexLookupTable(vtxTable);
110-
}
11191

11292
// filter input and compose
11393
std::array<gsl::span<const itsmft::CompClusterExt>, NLayers> compClusters;
@@ -129,7 +109,7 @@ void ITSTrackingInterface::run(framework::ProcessingContext& pc)
129109
labels[dh->subSpecification] = pc.inputs().get<const dataformats::MCTruthContainer<MCCompLabel>*>(ref).release();
130110
}
131111
}
132-
const auto& alpParams = o2::itsmft::DPLAlpideParam<o2::detectors::DetID::ITS>::Instance();
112+
133113
for (int iLayer = 0; iLayer < ((mDoStaggering) ? NLayers : 1); ++iLayer) {
134114
LOGP(info, "ITSTracker{} pulled {} clusters, {} RO frames", ((mDoStaggering) ? std::format(":{}", iLayer) : ""), compClusters[iLayer].size(), rofsinput[iLayer].size());
135115
if (compClusters[iLayer].empty()) {
@@ -159,7 +139,6 @@ void ITSTrackingInterface::run(framework::ProcessingContext& pc)
159139
auto& irFrames = pc.outputs().make<std::vector<o2::dataformats::IRFrame>>(Output{"ITS", "IRFRAMES", 0});
160140

161141
irFrames.reserve(rofsinput.size());
162-
int nBCPerTF = alpParams.roFrameLengthInBC;
163142

164143
auto& allClusIdx = pc.outputs().make<std::vector<int>>(Output{"ITS", "TRACKCLSID", 0});
165144
auto& allTracks = pc.outputs().make<std::vector<o2::its::TrackITS>>(Output{"ITS", "TRACKS", 0});
@@ -417,6 +396,23 @@ void ITSTrackingInterface::updateTimeDependentParams(framework::ProcessingContex
417396
LOGP(info, "recoIter#{} : {}", it, par.asString());
418397
}
419398
}
399+
400+
// prepare rof lookup table(s)
401+
const auto& par = o2::itsmft::DPLAlpideParam<o2::detectors::DetID::ITS>::Instance();
402+
const int nOrbitsPerTF = o2::base::GRPGeomHelper::getNHBFPerTF();
403+
TimeFrameN::ROFOverlapTableN rofTable;
404+
TimeFrameN::ROFVertexLookupTableN vtxTable;
405+
const auto& trackParams = mTracker->getParameters();
406+
for (int iLayer = 0; iLayer < NLayers; ++iLayer) {
407+
const unsigned int nROFsPerOrbit = o2::constants::lhc::LHCMaxBunches / par.getROFLengthInBC(iLayer);
408+
const LayerTiming timing{.mNROFsTF = (nROFsPerOrbit * nOrbitsPerTF), .mROFLength = (uint32_t)par.getROFLengthInBC(iLayer), .mROFDelay = (uint32_t)par.getROFDelayInBC(iLayer), .mROFBias = (uint32_t)par.getROFBiasInBC(iLayer), .mROFAddTimeErr = trackParams[0].AddTimeError[iLayer]};
409+
rofTable.defineLayer(iLayer, timing);
410+
vtxTable.defineLayer(iLayer, timing);
411+
}
412+
rofTable.init();
413+
mTimeFrame->setROFOverlapTable(rofTable);
414+
vtxTable.init();
415+
mTimeFrame->setROFVertexLookupTable(vtxTable);
420416
}
421417
}
422418

0 commit comments

Comments
 (0)