Skip to content

Commit bcec346

Browse files
committed
CollisionContextTool: different QED printing
No longer print all QED interactions (may be too long). Rather, give a short summary of QED stats.
1 parent 37adc60 commit bcec346

File tree

2 files changed

+25
-4
lines changed

2 files changed

+25
-4
lines changed

DataFormats/simulation/src/DigitizationContext.cxx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,27 @@ void DigitizationContext::printCollisionSummary(bool withQED, int truncateOutput
4949
}
5050
} else {
5151
std::cout << "Number of Collisions " << mEventRecords.size() << "\n";
52+
if (mEventPartsWithQED.size() > 0) {
53+
auto num_qed_events = mEventPartsWithQED.size() - mEventRecords.size();
54+
if (num_qed_events > 0) {
55+
std::cout << "Number of QED events (but not shown) " << num_qed_events << "\n";
56+
// find first and last QED collision so that we can give the range in orbits where these
57+
// things are included
58+
auto firstQEDcoll_iter = std::find_if(mEventPartsWithQED.begin(), mEventPartsWithQED.end(),
59+
[](const std::vector<EventPart>& vec) {
60+
return std::find_if(vec.begin(), vec.end(), [](EventPart const& p) { return p.sourceID == 99; }) != vec.end();
61+
});
62+
63+
auto lastColl_iter = std::find_if(mEventPartsWithQED.rbegin(), mEventPartsWithQED.rend(),
64+
[](const std::vector<EventPart>& vec) {
65+
return std::find_if(vec.begin(), vec.end(), [](EventPart const& p) { return p.sourceID == 99; }) != vec.end();
66+
});
67+
68+
auto firstindex = std::distance(mEventPartsWithQED.begin(), firstQEDcoll_iter);
69+
auto lastindex = std::distance(mEventPartsWithQED.begin(), lastColl_iter.base()) - 1;
70+
std::cout << "QED from: " << mEventRecordsWithQED[firstindex] << " ---> " << mEventRecordsWithQED[lastindex] << "\n";
71+
}
72+
}
5273
for (int i = 0; i < mEventRecords.size(); ++i) {
5374
if (truncateOutputTo >= 0 && i > truncateOutputTo) {
5475
std::cout << "--- Output truncated to " << truncateOutputTo << " ---\n";

Steer/src/CollisionContextTool.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ int main(int argc, char* argv[])
456456
// <---- at this moment we have a dense collision context (not representing the final output we want)
457457
LOG(info) << "<<------ DENSE CONTEXT ---------";
458458
if (options.printContext) {
459-
digicontext.printCollisionSummary(options.qedInteraction.size() > 0);
459+
digicontext.printCollisionSummary();
460460
}
461461
LOG(info) << "-------- DENSE CONTEXT ------->>";
462462

@@ -467,7 +467,7 @@ int main(int argc, char* argv[])
467467
// <---- at this moment we have a dense collision context (not representing the final output we want)
468468
LOG(info) << "<<------ FILTERED CONTEXT ---------";
469469
if (options.printContext) {
470-
digicontext.printCollisionSummary(options.qedInteraction.size() > 0);
470+
digicontext.printCollisionSummary();
471471
}
472472
LOG(info) << "-------- FILTERED CONTEXT ------->>";
473473

@@ -510,7 +510,7 @@ int main(int argc, char* argv[])
510510
}
511511

512512
if (options.printContext) {
513-
digicontext.printCollisionSummary(options.qedInteraction.size() > 0);
513+
digicontext.printCollisionSummary();
514514
}
515515
digicontext.saveToFile(options.outfilename);
516516

@@ -578,7 +578,7 @@ int main(int argc, char* argv[])
578578
str << path_prefix << tf_output_counter++ << "/collisioncontext.root";
579579
copy.saveToFile(str.str());
580580
LOG(info) << "----";
581-
copy.printCollisionSummary(options.qedInteraction.size() > 0);
581+
copy.printCollisionSummary();
582582
}
583583
}
584584
}

0 commit comments

Comments
 (0)