You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Tutorials/src/mcHistograms.cxx
+5-33Lines changed: 5 additions & 33 deletions
Original file line number
Diff line number
Diff line change
@@ -90,10 +90,12 @@ struct AccessMcTruth {
90
90
91
91
// Loop over MCColisions and get corresponding collisions (there can be more than one)
92
92
// For each of them get the corresponding tracks
93
-
// NOTE This does not work with the Run 3 data model at present. You will receive an exception about an unsorted index. Please use the next tutorial example.
93
+
// Note the use of "SmallGroups" template, that allows to handle both Run 2, where
94
+
// we have exactly 1-to-1 correspondence between collisions and mc collisions, and
95
+
// Run 3, where we can have 0, 1, or more collisions for a given mc collision
auto collisions = allCollisions.select(aod::mccollisionlabel::mcCollisionId == mcCollision.globalIndex());
124
-
auto mcParticles = allMcParticles.sliceBy(aod::mcparticle::mcCollisionId, mcCollision.globalIndex());
125
-
126
-
// access MC truth information with mcCollision() and mcParticle() methods
127
-
LOGF(info, "MC collision at vtx-z = %f with %d mc particles and %d reconstructed collisions", mcCollision.posZ(), mcParticles.size(), collisions.size());
128
-
for (auto& collision : collisions) {
129
-
LOGF(info, " Reconstructed collision at vtx-z = %f", collision.posZ());
130
-
131
-
// NOTE this will be replaced by a improved grouping in the future
132
-
auto groupedTracks = tracks.sliceBy(aod::track::collisionId, collision.globalIndex());
133
-
LOGF(info, " which has %d tracks", groupedTracks.size());
0 commit comments