Skip to content

Commit 17b6c77

Browse files
committed
Fix of O2-6437
Second attempt and addition to db55f08
1 parent 57a66d1 commit 17b6c77

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

DataFormats/simulation/src/DigitizationContext.cxx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ void DigitizationContext::applyMaxCollisionFilter(std::vector<std::tuple<int, in
577577
if (indices_old_to_new.find(lastindex) != indices_old_to_new.end()) {
578578
std::get<1>(tf_indices) = indices_old_to_new[lastindex]; // end;
579579
} else {
580-
std::get<1>(tf_indices) = newrecords.size(); // end;
580+
std::get<1>(tf_indices) = newrecords.size() - 1; // end; -1 since index inclusif
581581
}
582582
if (indices_old_to_new.find(previndex) != indices_old_to_new.end()) {
583583
std::get<2>(tf_indices) = indices_old_to_new[previndex]; // previous or "early" index
@@ -591,11 +591,6 @@ void DigitizationContext::applyMaxCollisionFilter(std::vector<std::tuple<int, in
591591
std::vector<std::tuple<int, int, int>> DigitizationContext::calcTimeframeIndices(long startOrbit, long orbitsPerTF, double orbitsEarly) const
592592
{
593593
auto timeframeindices = getTimeFrameBoundaries(mEventRecords, startOrbit, orbitsPerTF, orbitsEarly);
594-
LOG(info) << "Fixed " << timeframeindices.size() << " timeframes ";
595-
for (auto p : timeframeindices) {
596-
LOG(info) << std::get<0>(p) << " " << std::get<1>(p) << " " << std::get<2>(p);
597-
}
598-
599594
return timeframeindices;
600595
}
601596

@@ -708,7 +703,7 @@ DigitizationContext DigitizationContext::extractSingleTimeframe(int timeframeid,
708703
auto tf_ranges = timeframeindices.at(timeframeid);
709704

710705
auto startindex = std::get<0>(tf_ranges);
711-
auto endindex = std::get<1>(tf_ranges);
706+
auto endindex = std::get<1>(tf_ranges) + 1;
712707
auto earlyindex = std::get<2>(tf_ranges);
713708

714709
if (earlyindex >= 0) {

Steer/src/CollisionContextTool.cxx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,9 +565,20 @@ int main(int argc, char* argv[])
565565
LOG(info) << "-------- DENSE CONTEXT ------->>";
566566

567567
auto timeframeindices = digicontext.calcTimeframeIndices(orbitstart, options.orbitsPerTF, options.orbitsEarly);
568+
LOG(info) << "Fixed " << timeframeindices.size() << " timeframes ";
569+
for (auto p : timeframeindices) {
570+
LOG(info) << std::get<0>(p) << " " << std::get<1>(p) << " " << std::get<2>(p);
571+
}
572+
568573
// apply max collision per timeframe filters + reindexing of event id (linearisation and compactification)
569574
digicontext.applyMaxCollisionFilter(timeframeindices, orbitstart, options.orbitsPerTF, options.maxCollsPerTF, options.orbitsEarly);
570575

576+
LOG(info) << "Timeframe indices after collision filter";
577+
LOG(info) << "Fixed " << timeframeindices.size() << " timeframes ";
578+
for (auto p : timeframeindices) {
579+
LOG(info) << std::get<0>(p) << " " << std::get<1>(p) << " " << std::get<2>(p);
580+
}
581+
571582
// <---- at this moment we have a dense collision context (not representing the final output we want)
572583
LOG(info) << "<<------ FILTERED CONTEXT ---------";
573584
if (options.printContext) {

0 commit comments

Comments
 (0)