Skip to content

Commit 7c85dfb

Browse files
committed
Added Signal Loss and Event Loss
1 parent 46c62b1 commit 7c85dfb

File tree

1 file changed

+92
-23
lines changed

1 file changed

+92
-23
lines changed

PWGLF/Tasks/Resonances/kstarqa.cxx

Lines changed: 92 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -229,22 +229,27 @@ struct Kstarqa {
229229
rEventSelection.add("hVertexZRec", "hVertexZRec", {HistType::kTH1F, {vertexZAxis}});
230230
rEventSelection.add("hMultiplicity", "Multiplicity percentile", kTH1F, {{110, 0, 110}});
231231

232-
rEventSelection.add("hEventCut", "No. of event after cuts", kTH1I, {{20, 0, 20}});
232+
rEventSelection.add("hEventCut", "No. of event after cuts", kTH1D, {{20, 0, 20}});
233233
std::shared_ptr<TH1> hCutFlow = rEventSelection.get<TH1>(HIST("hEventCut"));
234-
hCutFlow->GetXaxis()->SetBinLabel(1, "All Events");
235-
hCutFlow->GetXaxis()->SetBinLabel(2, "|Vz| < cut");
236-
hCutFlow->GetXaxis()->SetBinLabel(3, "sel8");
237-
hCutFlow->GetXaxis()->SetBinLabel(4, "kNoTimeFrameBorder");
238-
hCutFlow->GetXaxis()->SetBinLabel(5, "kNoITSROFrameBorder");
239-
hCutFlow->GetXaxis()->SetBinLabel(6, "kNoSameBunchPileup");
240-
hCutFlow->GetXaxis()->SetBinLabel(7, "kIsGoodITSLayersAll");
241-
hCutFlow->GetXaxis()->SetBinLabel(8, "Occupancy Cut");
242-
hCutFlow->GetXaxis()->SetBinLabel(9, "rctChecker");
243-
hCutFlow->GetXaxis()->SetBinLabel(10, "kIsTriggerTVX");
244-
hCutFlow->GetXaxis()->SetBinLabel(11, "kIsGoodZvtxFT0vsPV");
245-
hCutFlow->GetXaxis()->SetBinLabel(12, "IsINELgt0");
246-
hCutFlow->GetXaxis()->SetBinLabel(13, "isVertexITSTPC");
247-
hCutFlow->GetXaxis()->SetBinLabel(14, "isVertexTOFMatched");
234+
std::vector<std::string> eveCutLabels = {
235+
"All Events",
236+
Form("|Vz| < %.1f", selectionConfig.cutzvertex.value),
237+
"sel8",
238+
"kNoTimeFrameBorder",
239+
"kNoITSROFrameBorder",
240+
"kNoSameBunchPileup",
241+
"kIsGoodITSLayersAll",
242+
Form("Occupancy < %.0f", selectionConfig.configOccCut.value),
243+
"rctChecker",
244+
"kIsTriggerTVX",
245+
"kIsGoodZvtxFT0vsPV",
246+
"IsINELgt0",
247+
"isVertexITSTPC",
248+
"isVertexTOFMatched"};
249+
// assign labels
250+
for (size_t i = 0; i < eveCutLabels.size(); ++i) {
251+
hCutFlow->GetXaxis()->SetBinLabel(i + 1, eveCutLabels[i].c_str());
252+
}
248253

249254
// for primary tracksbinsMultPlot
250255
if (cQAplots) {
@@ -322,21 +327,34 @@ struct Kstarqa {
322327
hInvMass.add("h1RecMult", "Multiplicity reconstructed", kTH1F, {multiplicityAxis});
323328
hInvMass.add("h1RecMult2", "Multiplicity reconstructed", kTH1F, {multiplicityAxis});
324329
hInvMass.add("h1KSRecsplit", "KS meson Rec split", kTH1F, {{100, 0.0f, 10.0f}});
325-
hInvMass.add("MCcorrections/hSignalLossDenominator", "Kstar generated before event selection", kTH2F, {{ptAxis}, {multiplicityAxis}});
326-
hInvMass.add("MCcorrections/hSignalLossNumerator", "Kstar generated after event selection", kTH2F, {{ptAxis}, {multiplicityAxis}});
327330
// hInvMass.add("hAllGenCollisionsImpact", "All generated collisions vs impact parameter", kTH1F, {multiplicityAxis});
328331
hInvMass.add("hAllGenCollisions", "All generated events", kTH1F, {multiplicityAxis});
329332
hInvMass.add("hAllGenCollisions1Rec", "All gen events with at least one rec event", kTH1F, {multiplicityAxis});
330333
hInvMass.add("hAllKstarGenCollisisons", "All generated Kstar in events with rapidity in 0.5", kTH2F, {{multiplicityAxis}, {ptAxis}});
331334
hInvMass.add("hAllKstarGenCollisisons1Rec", "All generated Kstar in events with at least one rec event in rapidity in 0.5", kTH2F, {{multiplicityAxis}, {ptAxis}});
332335
hInvMass.add("hAllRecCollisions", "All reconstructed events", kTH1F, {multiplicityAxis});
333336
hInvMass.add("hAllRecCollisionsCalib", "All reconstructed events", kTH1F, {multiplicityAxis});
334-
hInvMass.add("MCcorrections/hImpactParameterRec", "Impact parameter in reconstructed MC", kTH1F, {impactParAxis});
335-
hInvMass.add("MCcorrections/MultiplicityRec", "Multiplicity in generated MC with at least 1 reconstruction", kTH1F, {multiplicityAxis});
336-
hInvMass.add("MCcorrections/MultiplicityRec2", "Multiplicity in reconstructed MC", kTH1F, {multiplicityAxis});
337-
hInvMass.add("MCcorrections/hImpactParameterGen", "Impact parameter in generated MC", kTH1F, {impactParAxis});
338-
hInvMass.add("MCcorrections/MultiplicityGen", "Multiplicity in generated MC", kTH1F, {multiplicityAxis});
339-
hInvMass.add("MCcorrections/hImpactParametervsMultiplicity", "Impact parameter vs multiplicity in reconstructed MC", kTH2F, {{impactParAxis}, {multiplicityAxis}});
337+
338+
if (doprocessEvtLossSigLossMC || doprocessEvtLossSigLossMCPhi) {
339+
hInvMass.add("MCcorrections/hSignalLossDenominator", "Kstar generated before event selection", kTH2F, {{ptAxis}, {multiplicityAxis}});
340+
hInvMass.add("MCcorrections/hSignalLossNumerator", "Kstar generated after event selection", kTH2F, {{ptAxis}, {multiplicityAxis}});
341+
hInvMass.add("MCcorrections/hImpactParameterRec", "Impact parameter in reconstructed MC", kTH1F, {impactParAxis});
342+
hInvMass.add("MCcorrections/MultiplicityRec", "Multiplicity in generated MC with at least 1 reconstruction", kTH1F, {multiplicityAxis});
343+
hInvMass.add("MCcorrections/MultiplicityRec2", "Multiplicity in reconstructed MC", kTH1F, {multiplicityAxis});
344+
hInvMass.add("MCcorrections/hImpactParameterGen", "Impact parameter in generated MC", kTH1F, {impactParAxis});
345+
hInvMass.add("MCcorrections/MultiplicityGen", "Multiplicity in generated MC", kTH1F, {multiplicityAxis});
346+
hInvMass.add("MCcorrections/hImpactParametervsMultiplicity", "Impact parameter vs multiplicity in reconstructed MC", kTH2F, {{impactParAxis}, {multiplicityAxis}});
347+
}
348+
349+
// Signal Loss & Event Loss in Light Ion Collisions
350+
if (doprocessEvtLossSigLossLightIonMC) {
351+
hInvMass.add("MCcorrections/hImpactParameterGen", "Impact parameter of generated MC events", kTH1F, {impactParAxis});
352+
hInvMass.add("MCcorrections/hImpactParameterRec", "Impact parameter of selected MC events", kTH1F, {impactParAxis});
353+
hInvMass.add("MCcorrections/hImpactParvsCentrRec", "Impact parameter of selected MC events vs centrality", kTH2F, {{multiplicityAxis}, impactParAxis});
354+
hInvMass.add("MCcorrections/hKstarGenBeforeEvtSel", "K*0 before event selections", kTH2F, {ptAxis, impactParAxis});
355+
hInvMass.add("MCcorrections/hKstarGenAfterEvtSel", "K*0 after event selections", kTH2F, {ptAxis, impactParAxis});
356+
}
357+
340358
rEventSelection.add("tracksCheckData", "No. of events in the data", kTH1I, {{10, 0, 10}});
341359
rEventSelection.add("eventsCheckGen", "No. of events in the generated MC", kTH1I, {{10, 0, 10}});
342360
rEventSelection.add("recMCparticles", "No. of events in the reconstructed MC", kTH1I, {{20, 0, 20}});
@@ -2110,6 +2128,57 @@ struct Kstarqa {
21102128
}
21112129
PROCESS_SWITCH(Kstarqa, processEvtLossSigLossMC, "Process Signal Loss, Event Loss", false);
21122130

2131+
void processEvtLossSigLossLightIonMC(aod::McCollisions::iterator const& mcCollision, aod::McParticles const& mcParticles, const soa::SmallGroups<EventCandidatesMC>& recCollisions)
2132+
{
2133+
2134+
// Event loss estimation
2135+
auto impactPar = mcCollision.impactParameter();
2136+
hInvMass.fill(HIST("MCcorrections/hImpactParameterGen"), impactPar);
2137+
2138+
bool isSelectedEvent = false;
2139+
auto centrality = -999.;
2140+
for (const auto& RecCollision : recCollisions) {
2141+
if (!RecCollision.has_mcCollision())
2142+
continue;
2143+
if (!selectionEvent(RecCollision, false)) // don't fill event cut histogram
2144+
continue;
2145+
2146+
if (cSelectMultEstimator == kFT0M) {
2147+
centrality = RecCollision.centFT0M();
2148+
} else if (cSelectMultEstimator == kFT0A) {
2149+
centrality = RecCollision.centFT0A();
2150+
} else if (cSelectMultEstimator == kFT0C) {
2151+
centrality = RecCollision.centFT0C();
2152+
} else if (cSelectMultEstimator == kFV0A) {
2153+
centrality = RecCollision.centFV0A();
2154+
} else {
2155+
centrality = RecCollision.centFT0M(); // default
2156+
}
2157+
2158+
isSelectedEvent = true;
2159+
}
2160+
2161+
if (isSelectedEvent) {
2162+
hInvMass.fill(HIST("MCcorrections/hImpactParameterRec"), impactPar);
2163+
hInvMass.fill(HIST("MCcorrections/hImpactParvsCentrRec"), centrality, impactPar);
2164+
}
2165+
2166+
// Generated MC
2167+
for (const auto& mcPart : mcParticles) {
2168+
2169+
if (std::abs(mcPart.y()) >= selectionConfig.rapidityMotherData || std::abs(mcPart.pdgCode()) != o2::constants::physics::kK0Star892)
2170+
continue;
2171+
2172+
// signal loss estimation
2173+
hInvMass.fill(HIST("MCcorrections/hKstarGenBeforeEvtSel"), mcPart.pt(), impactPar);
2174+
if (isSelectedEvent) {
2175+
// signal loss estimation
2176+
hInvMass.fill(HIST("MCcorrections/hKstarGenAfterEvtSel"), mcPart.pt(), impactPar);
2177+
}
2178+
} // end loop on gen particles
2179+
}
2180+
PROCESS_SWITCH(Kstarqa, processEvtLossSigLossLightIonMC, "Process Signal Loss, Event Loss for Kstar in Light Ion", false);
2181+
21132182
void processEvtLossSigLossMCPhi(EventMCGenerated::iterator const& mcCollision, aod::McParticles const& mcParticles, const soa::SmallGroups<EventCandidatesMC>& recCollisions)
21142183
// void processEvtLossSigLossMCPhi(aod::McCollisions::iterator const& mcCollision, aod::McParticles const& mcParticles, const soa::SmallGroups<EventCandidatesMC>& recCollisions)
21152184
{

0 commit comments

Comments
 (0)