Skip to content

Commit

Permalink
skip digits produced before the beginning of the TF (#13589)
Browse files Browse the repository at this point in the history
  • Loading branch information
pillot authored Oct 14, 2024
1 parent b4ffc31 commit 260d9da
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions Detectors/MUON/MCH/Simulation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ o2_add_library(MCHSimulation
PUBLIC_LINK_LIBRARIES O2::DataFormatsMCH
O2::DetectorsBase
O2::DetectorsPassive
O2::DetectorsRaw
O2::MCHBase
O2::MCHGeometryCreator
O2::MCHMappingInterface
Expand Down
12 changes: 8 additions & 4 deletions Detectors/MUON/MCH/Simulation/src/Digitizer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#include "MCHSimulation/Digitizer.h"

#include "DetectorsRaw/HBFUtils.h"
#include "MCHSimulation/DigitizerParam.h"

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

// fill the external containers
// fill the external containers, skipping digits produced before the beginning of the TF
auto firstTFOrbit = o2::raw::HBFUtils::Instance().getFirstSampledTFIR().orbit;
for (const auto& [ir, digitsAndLabels] : irDigitsAndLabels) {
rofs.emplace_back(ROFRecord(ir, digits.size(), digitsAndLabels.first.size()));
digits.insert(digits.end(), digitsAndLabels.first.begin(), digitsAndLabels.first.end());
labels.mergeAtBack(digitsAndLabels.second);
if (ir.orbit >= firstTFOrbit) {
rofs.emplace_back(ROFRecord(ir, digits.size(), digitsAndLabels.first.size()));
digits.insert(digits.end(), digitsAndLabels.first.begin(), digitsAndLabels.first.end());
labels.mergeAtBack(digitsAndLabels.second);
}
}

return nPileup;
Expand Down

0 comments on commit 260d9da

Please sign in to comment.