Skip to content

Commit 028bae2

Browse files
committed
Add debug statements for specific events
1 parent 1053075 commit 028bae2

File tree

4 files changed

+37
-14
lines changed

4 files changed

+37
-14
lines changed

Examples/Algorithms/Fatras/src/FatrasSimulation.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ ActsExamples::ProcessCode ActsExamples::FatrasSimulation::execute(
213213
const AlgorithmContext &ctx) const {
214214
// read input containers
215215
const auto &inputParticles = m_inputParticles(ctx);
216+
const unsigned nInputParticles = inputParticles.size();
216217

217218
ACTS_DEBUG(inputParticles.size() << " input particles");
218219

@@ -285,6 +286,14 @@ ActsExamples::ProcessCode ActsExamples::FatrasSimulation::execute(
285286

286287
particlesSimulated.insert(particleSimulated);
287288
}
289+
const unsigned nOutputParticles = particlesSimulated.size();
290+
std::set<unsigned> interesting_events = {16, 374, 429, 813, 927};
291+
if ( (std::find(interesting_events.begin(), interesting_events.end(),
292+
ctx.eventNumber) != interesting_events.end() ) ) {
293+
ACTS_INFO("In FATRAS: event " << ctx.eventNumber << " simulated "
294+
<< nOutputParticles << " particles from "
295+
<< nInputParticles << " input particles.");
296+
}
288297

289298
// store ordered output containers
290299
m_outputParticles(ctx, std::move(particlesSimulated));

Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/ParticleSelector.cpp

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -212,13 +212,20 @@ ProcessCode ParticleSelector::execute(const AlgorithmContext& ctx) const {
212212
}
213213
outputParticles.shrink_to_fit();
214214

215-
ACTS_DEBUG("event " << ctx.eventNumber << " selected "
216-
<< outputParticles.size() << " from "
217-
<< inputParticles.size() << " particles");
218-
ACTS_DEBUG("filtered out because of charge: " << nInvalidCharge);
219-
ACTS_DEBUG("filtered out because of hit count: " << nInvalidHitCount);
220-
ACTS_DEBUG("filtered out because of measurement count: "
221-
<< nInvalidMeasurementCount);
215+
std::set<unsigned> interesting_events = {16, 374, 429, 813, 927};
216+
if ( (std::find(interesting_events.begin(), interesting_events.end(),
217+
ctx.eventNumber) != interesting_events.end() )
218+
&& m_cfg.rhoMax != std::numeric_limits<double>::infinity() ) {
219+
ACTS_INFO("event " << ctx.eventNumber << " selected "
220+
<< outputParticles.size() << " from "
221+
<< inputParticles.size() << " particles");
222+
ACTS_INFO("filtered out because of charge: " << nInvalidCharge);
223+
ACTS_INFO("filtered out because of hit count: " << nInvalidHitCount);
224+
ACTS_INFO("filtered out because of measurement count: "
225+
<< nInvalidMeasurementCount);
226+
ACTS_INFO("filtered out because of measurement region count: "
227+
<< nInvalidMeasurementRegionCount);
228+
}
222229

223230
m_outputParticles(ctx, std::move(outputParticles));
224231

Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/TrackTruthMatcher.cpp

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,13 @@ ActsExamples::ProcessCode TrackTruthMatcher::execute(
6767

6868
// For each particle within a track, how many hits did it contribute
6969
std::vector<ParticleHitCount> particleHitCounts;
70-
70+
std::set<unsigned> interesting_events = {16, 374, 429, 813, 927};
71+
if ( (std::find(interesting_events.begin(), interesting_events.end(),
72+
ctx.eventNumber) != interesting_events.end() ) ) {
73+
ACTS_INFO("event " << ctx.eventNumber << " has "
74+
<< particles.size() << " particles and "
75+
<< tracks.size() << " tracks");
76+
}
7177
for (const auto& track : tracks) {
7278
// Get the majority truth particle to this track
7379
identifyContributingParticles(hitParticlesMap, track, particleHitCounts);
@@ -136,11 +142,12 @@ ActsExamples::ProcessCode TrackTruthMatcher::execute(
136142
++particleTrackMatch.duplicates;
137143
}
138144
} else { // not matched, i.e. fake track
139-
ACTS_DEBUG("Track %u NOT MATCHED to particle %lu with %lu hits in event %lu.\
140-
Out of %lu track hits, %u were right.\n",
141-
track.tipIndex(), majorityParticleId.value(), ctx.eventNumber,
142-
particleTruthHitCount.at(majorityParticleId),
143-
nMajorityHits, track.nMeasurements());
145+
ACTS_DEBUG("Track " << track.tipIndex() << " in event " << ctx.eventNumber
146+
<< " NOT MATCHED to particle " << majorityParticleId.particle()
147+
<< " with " << particleTruthHitCount.at(majorityParticleId)
148+
<< " hits in event " << ctx.eventNumber << ". Out of "
149+
<< track.nMeasurements() << " track hits, "
150+
<< nMajorityHits << " were right.");
144151
trackParticleMatching[track.index()] = {TrackMatchClassification::Fake,
145152
std::nullopt, particleHitCounts};
146153

Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/TruthTrackFinder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ ProcessCode TruthTrackFinder::execute(const AlgorithmContext& ctx) const {
7070
ACTS_VERBOSE("Create prototracks for " << particles.size() << " particles");
7171
for (const auto& [i, particle] : Acts::enumerate(particles)) {
7272
str_to_print += std::format("\tParticle {} has {} hits.",
73-
particle.particleId().value(),
73+
particle.particleId().particle(),
7474
particle.numberOfHits());
7575
// find the corresponding hits for this particle
7676
const auto& measurements =

0 commit comments

Comments
 (0)