Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions DataFormats/simulation/src/DigitizationContext.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ void DigitizationContext::applyMaxCollisionFilter(std::vector<std::tuple<int, in
if (indices_old_to_new.find(lastindex) != indices_old_to_new.end()) {
std::get<1>(tf_indices) = indices_old_to_new[lastindex]; // end;
} else {
std::get<1>(tf_indices) = newrecords.size(); // end;
std::get<1>(tf_indices) = newrecords.size() - 1; // end; -1 since index inclusif
}
if (indices_old_to_new.find(previndex) != indices_old_to_new.end()) {
std::get<2>(tf_indices) = indices_old_to_new[previndex]; // previous or "early" index
Expand All @@ -591,11 +591,6 @@ void DigitizationContext::applyMaxCollisionFilter(std::vector<std::tuple<int, in
std::vector<std::tuple<int, int, int>> DigitizationContext::calcTimeframeIndices(long startOrbit, long orbitsPerTF, double orbitsEarly) const
{
auto timeframeindices = getTimeFrameBoundaries(mEventRecords, startOrbit, orbitsPerTF, orbitsEarly);
LOG(info) << "Fixed " << timeframeindices.size() << " timeframes ";
for (auto p : timeframeindices) {
LOG(info) << std::get<0>(p) << " " << std::get<1>(p) << " " << std::get<2>(p);
}

return timeframeindices;
}

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

auto startindex = std::get<0>(tf_ranges);
auto endindex = std::get<1>(tf_ranges);
auto endindex = std::get<1>(tf_ranges) + 1;
auto earlyindex = std::get<2>(tf_ranges);

if (earlyindex >= 0) {
Expand Down
11 changes: 11 additions & 0 deletions Steer/src/CollisionContextTool.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -565,9 +565,20 @@ int main(int argc, char* argv[])
LOG(info) << "-------- DENSE CONTEXT ------->>";

auto timeframeindices = digicontext.calcTimeframeIndices(orbitstart, options.orbitsPerTF, options.orbitsEarly);
LOG(info) << "Fixed " << timeframeindices.size() << " timeframes ";
for (auto p : timeframeindices) {
LOG(info) << std::get<0>(p) << " " << std::get<1>(p) << " " << std::get<2>(p);
}

// apply max collision per timeframe filters + reindexing of event id (linearisation and compactification)
digicontext.applyMaxCollisionFilter(timeframeindices, orbitstart, options.orbitsPerTF, options.maxCollsPerTF, options.orbitsEarly);

LOG(info) << "Timeframe indices after collision filter";
LOG(info) << "Fixed " << timeframeindices.size() << " timeframes ";
for (auto p : timeframeindices) {
LOG(info) << std::get<0>(p) << " " << std::get<1>(p) << " " << std::get<2>(p);
}

// <---- at this moment we have a dense collision context (not representing the final output we want)
LOG(info) << "<<------ FILTERED CONTEXT ---------";
if (options.printContext) {
Expand Down