Skip to content

Commit acdb0c6

Browse files
pillotalcaliva
authored andcommitted
skip digits produced before the beginning of the TF (#13589)
1 parent 40e170d commit acdb0c6

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

Detectors/MUON/MCH/Simulation/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ o2_add_library(MCHSimulation
2121
PUBLIC_LINK_LIBRARIES O2::DataFormatsMCH
2222
O2::DetectorsBase
2323
O2::DetectorsPassive
24+
O2::DetectorsRaw
2425
O2::MCHBase
2526
O2::MCHGeometryCreator
2627
O2::MCHMappingInterface

Detectors/MUON/MCH/Simulation/src/Digitizer.cxx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
#include "MCHSimulation/Digitizer.h"
1313

14+
#include "DetectorsRaw/HBFUtils.h"
1415
#include "MCHSimulation/DigitizerParam.h"
1516

1617
namespace o2::mch
@@ -56,11 +57,14 @@ size_t Digitizer::digitize(std::vector<ROFRecord>& rofs,
5657
nPileup += d.second->digitize(irDigitsAndLabels);
5758
}
5859

59-
// fill the external containers
60+
// fill the external containers, skipping digits produced before the beginning of the TF
61+
auto firstTFOrbit = o2::raw::HBFUtils::Instance().getFirstSampledTFIR().orbit;
6062
for (const auto& [ir, digitsAndLabels] : irDigitsAndLabels) {
61-
rofs.emplace_back(ROFRecord(ir, digits.size(), digitsAndLabels.first.size()));
62-
digits.insert(digits.end(), digitsAndLabels.first.begin(), digitsAndLabels.first.end());
63-
labels.mergeAtBack(digitsAndLabels.second);
63+
if (ir.orbit >= firstTFOrbit) {
64+
rofs.emplace_back(ROFRecord(ir, digits.size(), digitsAndLabels.first.size()));
65+
digits.insert(digits.end(), digitsAndLabels.first.begin(), digitsAndLabels.first.end());
66+
labels.mergeAtBack(digitsAndLabels.second);
67+
}
6468
}
6569

6670
return nPileup;

0 commit comments

Comments
 (0)