File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,13 +28,20 @@ using namespace o2;
2828using namespace o2 ::framework;
2929
3030struct ExtendTable {
31- void process (aod::Collision const &, aod::Tracks const & tracks)
31+ void process (aod::Collisions const & collisions , aod::Tracks const & tracks)
3232 {
33+ // note that this needs to be done only once, as it is done for the whole table
34+ // the extension is temporary and is lost when the variable it is assigned to
35+ // goes out of scope
3336 auto table_extension = soa::Extend<aod::Tracks, aod::extension::P2 >(tracks);
34- for (auto & row : table_extension) {
35- if (row.trackType () != 3 ) {
36- if (row.index () % 100 == 0 ) {
37- LOGF (info, " P^2 = %.3f" , row.p2 ());
37+ for (auto & collision : collisions) {
38+ auto trackSlice = table_extension.sliceBy (aod::track::collisionId, collision.globalIndex ());
39+ LOGP (info, " Collision {}" , collision.globalIndex ());
40+ for (auto & row : trackSlice) {
41+ if (row.trackType () != 3 ) {
42+ if (row.index () % 100 == 0 ) {
43+ LOGP (info, " P^2 = {}" , row.p2 ());
44+ }
3845 }
3946 }
4047 }
You can’t perform that action at this time.
0 commit comments