Skip to content

Commit fa2bb15

Browse files
committed
cascades in pp upd
Use reconstructed event type for MC. Add QA hists, and label event-type axes
1 parent a930c3b commit fa2bb15

1 file changed

Lines changed: 45 additions & 17 deletions

File tree

PWGLF/TableProducer/Strangeness/cascqaanalysis.cxx

Lines changed: 45 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@
4444
#include <Framework/runDataProcessing.h>
4545

4646
#include <TH1.h>
47+
#include <TH2.h>
48+
#include <TH3.h>
4749
#include <TPDGCode.h>
4850
#include <TRandom2.h>
4951
#include <TString.h>
@@ -194,6 +196,15 @@ struct Cascqaanalysis {
194196
o2::constants::physics::MassOmegaMinus * decayLength * invMomentum};
195197
}
196198

199+
template <typename TAxisType>
200+
static void setEventTypeAxisLabels(TAxisType* axis)
201+
{
202+
const char* labels[3] = {"INEL", "INEL>0", "INEL>1"};
203+
for (int i = 0; i < 3; ++i) {
204+
axis->SetBinLabel(i + 1, labels[i]);
205+
}
206+
}
207+
197208
void init(InitContext const&)
198209
{
199210
TString hCandidateCounterLabels[4] = {"All candidates", "passed topo cuts", "has associated MC particle", "associated with Xi(Omega)"};
@@ -220,15 +231,25 @@ struct Cascqaanalysis {
220231
registry.get<TH1>(HIST("hNEventsMC"))->GetXaxis()->SetBinLabel(n, hNEventsMCLabels[n - 1]);
221232
}
222233
registry.add("hZCollisionGen", "hZCollisionGen", {HistType::kTH1D, {{200, -20.f, 20.f}}});
234+
registry.add("hZCollisionRecVsGen", "hZCollisionRecVsGen", {HistType::kTH2D, {{100, -10.f, 10.f, "z_{vtx}^{rec} (cm)"}, {100, -10.f, 10.f, "z_{vtx}^{gen} (cm)"}}});
235+
registry.add("hEventTypeRecVsGen", "hEventTypeRecVsGen", {HistType::kTH2D, {eventTypeAxis, eventTypeAxis}});
223236
registry.add("hNchFT0MNAssocMCCollisions", "hNchFT0MNAssocMCCollisions", {HistType::kTH3D, {nChargedFT0MGenAxis, nAssocCollAxis, eventTypeAxis}});
224237
registry.add("hNchFT0MNAssocMCCollisionsSameType", "hNchFT0MNAssocMCCollisionsSameType", {HistType::kTH3D, {nChargedFT0MGenAxis, nAssocCollAxis, eventTypeAxis}});
225238
registry.add("hNContributorsCorrelation", "hNContributorsCorrelation", {HistType::kTH2F, {{250, -0.5f, 249.5f, "Secondary Contributor"}, {250, -0.5f, 249.5f, "Main Contributor"}}});
226239
registry.add("hNchFT0MGenEvType", "hNchFT0MGenEvType", {HistType::kTH2D, {nChargedFT0MGenAxis, eventTypeAxis}});
227240
registry.add("hNchFV0AGenEvType", "hNchFV0AGenEvType", {HistType::kTH2D, {nChargedFV0AGenAxis, eventTypeAxis}});
228241
registry.add("hCentFT0M_genMC", "hCentFT0M_genMC", {HistType::kTH2D, {centFT0MAxis, eventTypeAxis}});
242+
setEventTypeAxisLabels(registry.get<TH2>(HIST("hEventTypeRecVsGen"))->GetXaxis());
243+
setEventTypeAxisLabels(registry.get<TH2>(HIST("hEventTypeRecVsGen"))->GetYaxis());
244+
setEventTypeAxisLabels(registry.get<TH3>(HIST("hNchFT0MNAssocMCCollisions"))->GetZaxis());
245+
setEventTypeAxisLabels(registry.get<TH3>(HIST("hNchFT0MNAssocMCCollisionsSameType"))->GetZaxis());
246+
setEventTypeAxisLabels(registry.get<TH2>(HIST("hNchFT0MGenEvType"))->GetYaxis());
247+
setEventTypeAxisLabels(registry.get<TH2>(HIST("hNchFV0AGenEvType"))->GetYaxis());
248+
setEventTypeAxisLabels(registry.get<TH2>(HIST("hCentFT0M_genMC"))->GetYaxis());
229249
}
230250

231251
registry.add("hCentFT0M_rec", "hCentFT0M_rec", {HistType::kTH2D, {centFT0MAxis, eventTypeAxis}});
252+
setEventTypeAxisLabels(registry.get<TH2>(HIST("hCentFT0M_rec"))->GetYaxis());
232253

233254
if (candidateQA) {
234255
registry.add("hNcandidates", "hNcandidates", {HistType::kTH3D, {nCandidates, centFT0MAxis, {2, -0.5f, 1.5f}}});
@@ -242,13 +263,21 @@ struct Cascqaanalysis {
242263
registry.add("hNchFT0Mglobal", "hNchFT0Mglobal", {HistType::kTH3D, {nChargedFT0MGenAxis, multNTracksAxis, eventTypeAxis}});
243264
registry.add("hNchFT0MPVContr", "hNchFT0MPVContr", {HistType::kTH3D, {nChargedFT0MGenAxis, multNTracksAxis, eventTypeAxis}});
244265
registry.add("hNchFV0APVContr", "hNchFV0APVContr", {HistType::kTH3D, {nChargedFV0AGenAxis, multNTracksAxis, eventTypeAxis}});
266+
setEventTypeAxisLabels(registry.get<TH3>(HIST("hNchFT0Mglobal"))->GetZaxis());
267+
setEventTypeAxisLabels(registry.get<TH3>(HIST("hNchFT0MPVContr"))->GetZaxis());
268+
setEventTypeAxisLabels(registry.get<TH3>(HIST("hNchFV0APVContr"))->GetZaxis());
245269
}
246270
registry.add("hFT0MpvContr", "hFT0MpvContr", {HistType::kTH3D, {centFT0MAxis, multNTracksAxis, eventTypeAxis}});
247271
registry.add("hFV0ApvContr", "hFV0ApvContr", {HistType::kTH3D, {centFV0AAxis, multNTracksAxis, eventTypeAxis}});
248272
registry.add("hFT0Mglobal", "hFT0Mglobal", {HistType::kTH3D, {centFT0MAxis, multNTracksAxis, eventTypeAxis}});
249273
registry.add("hFV0AFT0M", "hFV0AFT0M", {HistType::kTH3D, {centFV0AAxis, centFT0MAxis, eventTypeAxis}});
250274
registry.add("hFT0MFV0Asignal", "hFT0MFV0Asignal", {HistType::kTH2D, {signalFT0MAxis, signalFV0AAxis}});
251275
registry.add("hFT0MsignalPVContr", "hFT0MsignalPVContr", {HistType::kTH3D, {signalFT0MAxis, multNTracksAxis, eventTypeAxis}});
276+
setEventTypeAxisLabels(registry.get<TH3>(HIST("hFT0MpvContr"))->GetZaxis());
277+
setEventTypeAxisLabels(registry.get<TH3>(HIST("hFV0ApvContr"))->GetZaxis());
278+
setEventTypeAxisLabels(registry.get<TH3>(HIST("hFT0Mglobal"))->GetZaxis());
279+
setEventTypeAxisLabels(registry.get<TH3>(HIST("hFV0AFT0M"))->GetZaxis());
280+
setEventTypeAxisLabels(registry.get<TH3>(HIST("hFT0MsignalPVContr"))->GetZaxis());
252281
}
253282

254283
rctChecker.init(cfgEvtRCTFlagCheckerLabel, cfgEvtRCTFlagCheckerZDCCheck, cfgEvtRCTFlagCheckerLimitAcceptAsBad);
@@ -549,31 +578,30 @@ struct Cascqaanalysis {
549578
uint16_t nchFT0 = getGenNchInFT0Mregion(mcPartSlice);
550579
uint16_t nchFV0 = getGenNchInFV0Aregion(mcPartSlice);
551580

552-
int evType = 0;
553-
registry.fill(HIST("hNEvents"), 11.5); // INEL
554-
// Rec. collision associated with INEL>0 gen. one
581+
int genEvType = 0;
555582
if (pwglf::isINELgtNmc(mcPartSlice, 0, pdgDB)) {
556-
registry.fill(HIST("hNEvents"), 12.5); // INEL
557-
evType++;
583+
genEvType++;
558584
}
559-
// Rec. collision associated with INEL>1 gen. one
560585
if (pwglf::isINELgtNmc(mcPartSlice, 1, pdgDB)) {
561-
registry.fill(HIST("hNEvents"), 13.5); // INEL
562-
evType++;
586+
genEvType++;
563587
}
564588

565-
registry.fill(HIST("hCentFT0M_rec"), mcCollision.centFT0M(), evType);
589+
const int recoEvType = getEventTypeFlag(collision);
590+
591+
registry.fill(HIST("hCentFT0M_rec"), mcCollision.centFT0M(), recoEvType);
592+
registry.fill(HIST("hZCollisionRecVsGen"), collision.posZ(), mcCollision.posZ());
593+
registry.fill(HIST("hEventTypeRecVsGen"), recoEvType, genEvType);
566594

567595
if (multQA) {
568-
registry.fill(HIST("hNchFT0MPVContr"), nchFT0, nTracksPVcontr, evType);
569-
registry.fill(HIST("hNchFV0APVContr"), nchFV0, nTracksPVcontr, evType);
570-
registry.fill(HIST("hFT0MpvContr"), mcCollision.centFT0M(), nTracksPVcontr, evType);
571-
registry.fill(HIST("hFV0ApvContr"), 0, nTracksPVcontr, evType); // mcCollision.centFV0A() to be added
572-
registry.fill(HIST("hFT0Mglobal"), mcCollision.centFT0M(), nTracksGlobal, evType);
573-
registry.fill(HIST("hFV0AFT0M"), 0, mcCollision.centFT0M(), evType); // mcCollision.centFV0A() to be added
574-
registry.fill(HIST("hNchFT0Mglobal"), nchFT0, nTracksGlobal, evType);
596+
registry.fill(HIST("hNchFT0MPVContr"), nchFT0, nTracksPVcontr, recoEvType);
597+
registry.fill(HIST("hNchFV0APVContr"), nchFV0, nTracksPVcontr, recoEvType);
598+
registry.fill(HIST("hFT0MpvContr"), mcCollision.centFT0M(), nTracksPVcontr, recoEvType);
599+
registry.fill(HIST("hFV0ApvContr"), 0, nTracksPVcontr, recoEvType); // mcCollision.centFV0A() to be added
600+
registry.fill(HIST("hFT0Mglobal"), mcCollision.centFT0M(), nTracksGlobal, recoEvType);
601+
registry.fill(HIST("hFV0AFT0M"), 0, mcCollision.centFT0M(), recoEvType); // mcCollision.centFV0A() to be added
602+
registry.fill(HIST("hNchFT0Mglobal"), nchFT0, nTracksGlobal, recoEvType);
575603
registry.fill(HIST("hFT0MFV0Asignal"), collision.multFT0A() + collision.multFT0C(), collision.multFV0A());
576-
registry.fill(HIST("hFT0MsignalPVContr"), collision.multFT0A() + collision.multFT0C(), nTracksPVcontr, evType);
604+
registry.fill(HIST("hFT0MsignalPVContr"), collision.multFT0A() + collision.multFT0C(), nTracksPVcontr, recoEvType);
577605
}
578606

579607
float lEventScale = scalefactor;

0 commit comments

Comments
 (0)