Skip to content

Commit 11f1429

Browse files
committed
Fix process for tracking efficiency w/o collision association
1 parent b4f0592 commit 11f1429

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

DPG/Tasks/AOTTrack/qaEfficiency.cxx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,10 @@ struct QaEfficiency {
597597
LOG(fatal) << "Both processMC and processMCWithoutCollisions are set to true. Please set only one of them to true.";
598598
}
599599

600+
if (numSameCollision && doprocessMCWithoutCollisions) {
601+
LOG(fatal) << "Inconsistent configuration for process without MC collisions, but numSameCollision set to true. Please fix your configuration.";
602+
}
603+
600604
auto h = histos.add<TH1>("MC/trackSelection", "Track Selection", kTH1D, {axisSel});
601605
h->GetXaxis()->SetBinLabel(trkCutIdxTrkRead, "Tracks read");
602606
h->GetXaxis()->SetBinLabel(trkCutIdxHasMcPart, "Passed has MC part.");
@@ -1075,9 +1079,9 @@ struct QaEfficiency {
10751079
constexpr int histogramIndex = id + pdgSign * nSpecies;
10761080
LOG(debug) << "fillMCTrackHistograms for pdgSign '" << pdgSign << "' and id '" << static_cast<int>(id) << "' " << particleName(pdgSign, id) << " with index " << histogramIndex;
10771081
auto const& mcParticle = track.mcParticle();
1078-
auto const& collision = track.collision_as<Colls>();
10791082
float radius = std::sqrt(mcParticle.vx() * mcParticle.vx() + mcParticle.vy() * mcParticle.vy());
10801083
if (numSameCollision) {
1084+
auto const& collision = track.collision_as<Colls>();
10811085
if (!collision.has_mcCollision()) {
10821086
return;
10831087
}
@@ -2025,7 +2029,7 @@ struct QaEfficiency {
20252029

20262030
/// checking the PV z coordinate, if the track has been assigned to any collision
20272031
if (applyPvZCutInProcessMcWoColl && track.has_collision()) {
2028-
const auto collision = track.collision();
2032+
const auto collision = track.collision_as<CollisionsWithMcLabels>();
20292033
const float posZ = collision.posZ();
20302034
if (posZ < vertexZMin || posZ > vertexZMax) {
20312035
continue;

0 commit comments

Comments
 (0)