Skip to content

Commit 414e441

Browse files
[PWGDQ] Update tableMaker_withAssoc.cxx (#8312)
Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent 26812eb commit 414e441

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

PWGDQ/TableProducer/tableMaker_withAssoc.cxx

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,10 @@ struct TableMaker {
439439
histMuons->GetXaxis()->SetBinLabel(ib, (*cut).GetName());
440440
}
441441
fStatsList->Add(histMuons);
442+
TH1D* histOrphanTracks = new TH1D("histOrphanTracks", "Orphan Track statistics", 2, -1, 1);
443+
histOrphanTracks->GetXaxis()->SetBinLabel(1, "Track w/o collision ID");
444+
histOrphanTracks->GetXaxis()->SetBinLabel(2, "Track with +ve collision ID");
445+
fStatsList->Add(histOrphanTracks);
442446

443447
if (fConfigRunZorro) {
444448
TH2D* histZorroInfo = new TH2D("ZorroInfo", "Zorro information", 1, -0.5, 0.5, 1, -0.5, 0.5);
@@ -683,13 +687,25 @@ struct TableMaker {
683687
trackFilteringTag |= (uint64_t(1) << VarManager::kIsTPCPostcalibrated);
684688
}
685689
}
686-
687690
// write the track global index in the map for skimming (to make sure we have it just once)
688691
if (fTrackIndexMap.find(track.globalIndex()) == fTrackIndexMap.end()) {
689692
// NOTE: The collision ID that is written in the table is the one found in the first association for this track.
690693
// However, in data analysis one should loop over associations, so this one should not be used.
691694
// In the case of Run2-like analysis, there will be no associations, so this ID will be the one originally assigned in the AO2Ds (updated for the skims)
692-
uint32_t reducedEventIdx = fCollIndexMap[collision.globalIndex()];
695+
// reducedEventIdx = fCollIndexMap[collision.globalIndex()]; // This gives the first collision form the table
696+
697+
// Calculating the percentage of orphan tracks i.e., tracks which have no collisions associated to it
698+
if (!track.has_collision()) {
699+
(reinterpret_cast<TH1D*>(fStatsList->At(3)))->Fill(static_cast<float>(-1));
700+
} else {
701+
(reinterpret_cast<TH1D*>(fStatsList->At(3)))->Fill(0.9);
702+
}
703+
704+
// Protection against crash, where the original collision IDs of tracks were removed by pp-filter or zorro selection and hence the track is now orphaned
705+
if (fCollIndexMap.find(track.collisionId()) == fCollIndexMap.end()) {
706+
continue;
707+
}
708+
uint32_t reducedEventIdx = fCollIndexMap[track.collisionId()]; // This gives the original iD of the track
693709
// NOTE: trackBarrelInfo stores the index of the collision as in AO2D (for use in some cases where the analysis on skims is done
694710
// in workflows where the original AO2Ds are also present)
695711
trackBarrelInfo(collision.globalIndex(), collision.posX(), collision.posY(), collision.posZ(), track.globalIndex());

0 commit comments

Comments
 (0)