Skip to content

Commit 11a1287

Browse files
authored
[DPG] Plots for efficiency and mismatch studies vs contributors (#8741)
1 parent 2c68eb5 commit 11a1287

File tree

1 file changed

+53
-12
lines changed

1 file changed

+53
-12
lines changed

DPG/Tasks/AOTEvent/eventSelectionQa.cxx

Lines changed: 53 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ using BCsRun2 = soa::Join<aod::BCs, aod::Run2BCInfos, aod::Timestamps, aod::BcSe
3535
using BCsRun3 = soa::Join<aod::BCs, aod::Timestamps, aod::BcSels, aod::Run3MatchedToBCSparse>;
3636
using ColEvSels = soa::Join<aod::Collisions, aod::EvSels>;
3737
using FullTracksIU = soa::Join<aod::TracksIU, aod::TracksExtra>;
38+
using FullTracksIUwithLabels = soa::Join<aod::TracksIU, aod::TracksExtra, aod::McTrackLabels>;
3839

3940
struct EventSelectionQaTask {
4041
Configurable<bool> isMC{"isMC", 0, "0 - data, 1 - MC"};
@@ -306,6 +307,11 @@ struct EventSelectionQaTask {
306307
histos.add("hVertexXMC", "", kTH1F, {axisVtxXY});
307308
histos.add("hVertexYMC", "", kTH1F, {axisVtxXY});
308309
histos.add("hVertexZMC", "", kTH1F, {axisVtxZ});
310+
histos.add("hNcontribColFromMC", "", kTH1F, {axisNcontrib});
311+
histos.add("hNcontribAccFromMC", "", kTH1F, {axisNcontrib});
312+
histos.add("hNcontribMisFromMC", "", kTH1F, {axisNcontrib});
313+
histos.add("hNcontribColFromData", "", kTH1F, {axisNcontrib});
314+
histos.add("hNcontribAccFromData", "", kTH1F, {axisNcontrib});
309315

310316
for (int i = 0; i < kNsel; i++) {
311317
histos.get<TH1>(HIST("hSelCounter"))->GetXaxis()->SetBinLabel(i + 1, selectionLabels[i]);
@@ -1062,10 +1068,24 @@ struct EventSelectionQaTask {
10621068
histos.fill(HIST("hNcontribAcc"), nContributors);
10631069

10641070
} // collisions
1071+
1072+
// TVX efficiency after TF and ITS ROF border cuts
1073+
for (auto& col : cols) {
1074+
if (!col.selection_bit(kNoTimeFrameBorder) || !col.selection_bit(kNoITSROFrameBorder))
1075+
continue;
1076+
1077+
uint32_t nContrib = col.numContrib();
1078+
histos.fill(HIST("hNcontribColFromData"), nContrib);
1079+
if (!col.selection_bit(kIsTriggerTVX))
1080+
continue;
1081+
1082+
histos.fill(HIST("hNcontribAccFromData"), nContrib);
1083+
}
10651084
}
10661085
PROCESS_SWITCH(EventSelectionQaTask, processRun3, "Process Run3 event selection QA", false);
10671086

1068-
void processMCRun3(aod::McCollisions const& mcCols, soa::Join<aod::Collisions, aod::McCollisionLabels, aod::EvSels> const& cols, BCsRun3 const&, aod::FT0s const&)
1087+
Partition<FullTracksIUwithLabels> pvTracks = ((aod::track::flags & static_cast<uint32_t>(o2::aod::track::PVContributor)) == static_cast<uint32_t>(o2::aod::track::PVContributor));
1088+
void processMCRun3(aod::McCollisions const& mcCols, soa::Join<aod::Collisions, aod::McCollisionLabels, aod::EvSels> const& cols, FullTracksIUwithLabels const&, BCsRun3 const&, aod::FT0s const&, aod::McParticles const& mcParts)
10691089
{
10701090
for (const auto& mcCol : mcCols) {
10711091
auto bc = mcCol.bc_as<BCsRun3>();
@@ -1082,19 +1102,40 @@ struct EventSelectionQaTask {
10821102
histos.fill(HIST("hNcolMCVsBcInTF"), bcInTF);
10831103
}
10841104

1085-
// check fraction of collisions matched to wrong bcs
1086-
for (const auto& col : cols) {
1087-
if (!col.has_mcCollision()) {
1088-
continue;
1105+
for (auto& col : cols) {
1106+
int32_t mcColIdFromCollision = col.mcCollisionId();
1107+
// check if collision is built from tracks originating from different MC collisions
1108+
bool isCollisionAmbiguous = 0;
1109+
const auto& colPvTracks = pvTracks.sliceByCached(aod::track::collisionId, col.globalIndex(), cache);
1110+
for (auto& track : colPvTracks) {
1111+
int32_t mcPartId = track.mcParticleId();
1112+
int32_t mcColId = mcPartId >= 0 ? mcParts.iteratorAt(mcPartId).mcCollisionId() : -1;
1113+
if (mcColId < 0 || mcColIdFromCollision != mcColId) {
1114+
isCollisionAmbiguous = 1;
1115+
break;
1116+
}
10891117
}
1090-
uint64_t mcBC = col.mcCollision().bc_as<BCsRun3>().globalBC();
1091-
uint64_t rcBC = col.foundBC_as<BCsRun3>().globalBC();
1118+
1119+
// skip ambiguous collisions
1120+
if (isCollisionAmbiguous)
1121+
continue;
1122+
1123+
// skip collisions at the borders of TF and ITS ROF
1124+
if (!col.selection_bit(kNoTimeFrameBorder) || !col.selection_bit(kNoITSROFrameBorder))
1125+
continue;
1126+
1127+
uint32_t nContrib = col.numContrib();
1128+
histos.fill(HIST("hNcontribColFromMC"), nContrib);
1129+
if (!col.selection_bit(kIsTriggerTVX))
1130+
continue;
1131+
1132+
histos.fill(HIST("hNcontribAccFromMC"), nContrib);
1133+
1134+
int64_t rcBC = col.foundBC_as<BCsRun3>().globalBC();
1135+
int64_t mcBC = col.mcCollision().bc_as<BCsRun3>().globalBC();
1136+
10921137
if (mcBC != rcBC) {
1093-
histos.fill(HIST("hNcontribMis"), col.numContrib());
1094-
if (col.collisionTimeRes() < 12) {
1095-
// ~ wrong bcs for collisions with T0F-matched tracks
1096-
histos.fill(HIST("hNcontribMisTOF"), col.numContrib());
1097-
}
1138+
histos.fill(HIST("hNcontribMisFromMC"), nContrib);
10981139
}
10991140
}
11001141
}

0 commit comments

Comments
 (0)