Skip to content

Commit 55af72c

Browse files
huinaibingalibuild
andauthored
[PWGCF] Add pt spectra hist for QA (#15215)
Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent 1190e0a commit 55af72c

File tree

1 file changed

+94
-2
lines changed

1 file changed

+94
-2
lines changed

PWGCF/Flow/Tasks/pidFlowPtCorr.cxx

Lines changed: 94 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ struct PidFlowPtCorr {
137137
O2_DEFINE_CONFIGURABLE(cfgUsePtCentNUECorr, bool, true, "do NUA NUE, Using Eff(pt, cent) to do NUE")
138138
O2_DEFINE_CONFIGURABLE(cfgDebugMyCode, bool, false, "output some graph for code debug")
139139

140+
O2_DEFINE_CONFIGURABLE(cfgOutPutPtSpectra, bool, false, "output pt spectra for data, MC and RECO")
141+
140142
/**
141143
* @brief cfg for PID pt range
142144
* @details default datas are from run2, note that separate pi-k and k-p needs to use difference pt range
@@ -197,7 +199,7 @@ struct PidFlowPtCorr {
197199
Filter particleFilter = (nabs(aod::mcparticle::eta) < trkQualityOpts.cfgCutEta.value);
198200
using FilteredMcParticles = soa::Filtered<aod::McParticles>;
199201

200-
using FilteredTracksWithMCLabel = soa::Filtered<soa::Join<aod::Tracks, aod::TracksExtra, aod::TrackSelection, aod::TracksDCA, aod::McTrackLabels>>;
202+
using FilteredTracksWithMCLabel = soa::Filtered<soa::Join<aod::Tracks, aod::TracksExtra, aod::TrackSelection, aod::TracksDCA, aod::McTrackLabels, TracksPID>>;
201203
using FilteredCollisionsWithMCLabel = soa::Filtered<soa::Join<AodCollisions, aod::EvSels, aod::McCollisionLabels>>;
202204
// end using and filter
203205

@@ -382,7 +384,7 @@ struct PidFlowPtCorr {
382384
TH1* hPhiRunByRunBefore = registry.add<TH1>(Form("RunByRunQA%d/hPhiBefore", oneRun), "", {HistType::kTH1D, {cfgaxisPhi}}).get();
383385
TH1* hPhiRunByRunAfter = registry.add<TH1>(Form("RunByRunQA%d/hPhiAfter", oneRun), "", {HistType::kTH1D, {cfgaxisPhi}}).get();
384386

385-
TH2* hITSnclsVsPhi = registry.add<TH2>(Form("RunByRunQA%d/hITSnclsVsPhi", oneRun), "", {HistType::kTH2D, {cfgaxisPhi, {7, 0, 7}}}).get();
387+
TH2* hITSnclsVsPhi = registry.add<TH2>(Form("RunByRunQA%d/hITSnclsVsPhi", oneRun), "", {HistType::kTH2D, {cfgaxisPhi, {8, 0, 8}}}).get();
386388
TH2* hITSChi2VsPhi = registry.add<TH2>(Form("RunByRunQA%d/hITSChi2VsPhi", oneRun), "", {HistType::kTH2D, {cfgaxisPhi, {100, 0, 10}}}).get();
387389

388390
qaHistVector.emplace_back(qaHist(hPhiRunByRunBefore, hPhiRunByRunAfter, hITSnclsVsPhi, hITSChi2VsPhi));
@@ -394,6 +396,16 @@ struct PidFlowPtCorr {
394396
// hist for NUE correction
395397
registry.add("correction/hPtCentMcRec", "", {HistType::kTH2D, {cfgaxisPt, axisMultiplicity}});
396398
registry.add("correction/hPtCentMcGen", "", {HistType::kTH2D, {cfgaxisPt, axisMultiplicity}});
399+
400+
// hist for Pi eff
401+
registry.add("correction/hPtCentMcRecPi", "", {HistType::kTH2D, {cfgaxisPt, axisMultiplicity}});
402+
registry.add("correction/hPtCentMcGenPi", "", {HistType::kTH2D, {cfgaxisPt, axisMultiplicity}});
403+
// hist for Ka eff
404+
registry.add("correction/hPtCentMcRecKa", "", {HistType::kTH2D, {cfgaxisPt, axisMultiplicity}});
405+
registry.add("correction/hPtCentMcGenKa", "", {HistType::kTH2D, {cfgaxisPt, axisMultiplicity}});
406+
// hist for Pr eff
407+
registry.add("correction/hPtCentMcRecPr", "", {HistType::kTH2D, {cfgaxisPt, axisMultiplicity}});
408+
registry.add("correction/hPtCentMcGenPr", "", {HistType::kTH2D, {cfgaxisPt, axisMultiplicity}});
397409
} // cfgoutputMC
398410

399411
// debug hists
@@ -406,6 +418,26 @@ struct PidFlowPtCorr {
406418
}
407419
} // cfgdebugmycode
408420

421+
if (cfgOutPutPtSpectra) {
422+
registry.add("ptSpectra/hPtCentData", "", {HistType::kTH2D, {cfgaxisPt, axisMultiplicity}});
423+
registry.add("ptSpectra/hCentEventCountData", "", {HistType::kTH1D, {axisMultiplicity}});
424+
registry.add("ptSpectra/hCentEventCountMcGen", "", {HistType::kTH1D, {axisMultiplicity}});
425+
registry.add("ptSpectra/hCentEventCountMcRec", "", {HistType::kTH1D, {axisMultiplicity}});
426+
427+
// (PosEta)(PosCh)
428+
registry.add("ptSpectra/hPtCentDataPosEtaPosCh", "", {HistType::kTH2D, {cfgaxisPt, axisMultiplicity}});
429+
430+
// (PosEta)(NegCh)
431+
registry.add("ptSpectra/hPtCentDataPosEtaNegCh", "", {HistType::kTH2D, {cfgaxisPt, axisMultiplicity}});
432+
433+
// (NegEta(PosCh)
434+
registry.add("ptSpectra/hPtCentDataNegEtaPosCh", "", {HistType::kTH2D, {cfgaxisPt, axisMultiplicity}});
435+
436+
// (NegEta)(NegCh)
437+
registry.add("ptSpectra/hPtCentDataNegEtaNegCh", "", {HistType::kTH2D, {cfgaxisPt, axisMultiplicity}});
438+
439+
} // cfgoutputptspectra
440+
409441
if (cfgOutputrunbyrun) {
410442
// hist for NUA
411443
registry.add("correction/hRunNumberPhiEtaVertex", "", {HistType::kTHnSparseF, {cfgaxisRun, cfgaxisPhi, cfgaxisEta, cfgaxisVertex}});
@@ -1262,6 +1294,11 @@ struct PidFlowPtCorr {
12621294
return;
12631295
// end collision cut
12641296

1297+
// pt spectra
1298+
if (cfgOutPutPtSpectra) {
1299+
registry.fill(HIST("ptSpectra/hCentEventCountData"), cent);
1300+
} // cfgOutPutPtSpectra
1301+
12651302
// correction
12661303
loadCorrections(bc.timestamp());
12671304
float vtxz = collision.posZ();
@@ -1388,6 +1425,27 @@ struct PidFlowPtCorr {
13881425
registry.fill(HIST("hPt"), track.pt());
13891426
// end fill QA hist
13901427

1428+
// pt spectra
1429+
if (cfgOutPutPtSpectra) {
1430+
registry.fill(HIST("ptSpectra/hPtCentData"), track.pt(), cent);
1431+
1432+
// region 1 +eta +ch
1433+
if (track.eta() > 0.05 && track.sign() > 0)
1434+
registry.fill(HIST("ptSpectra/hPtCentDataPosEtaPosCh"), track.pt(), cent);
1435+
1436+
// region 2 +eta -ch
1437+
if (track.eta() > 0.05 && track.sign() < 0)
1438+
registry.fill(HIST("ptSpectra/hPtCentDataPosEtaNegCh"), track.pt(), cent);
1439+
1440+
// region 3 -eta +ch
1441+
if (track.eta() < -0.05 && track.sign() > 0)
1442+
registry.fill(HIST("ptSpectra/hPtCentDataNegEtaPosCh"), track.pt(), cent);
1443+
1444+
// region 4 -eta -ch
1445+
if (track.eta() < -0.05 && track.sign() < 0)
1446+
registry.fill(HIST("ptSpectra/hPtCentDataNegEtaNegCh"), track.pt(), cent);
1447+
}
1448+
13911449
// track pt cut
13921450
if (!((track.pt() > trkQualityOpts.cfgCutPtMin.value) && (track.pt() < trkQualityOpts.cfgCutPtMax.value)))
13931451
continue;
@@ -1694,6 +1752,10 @@ struct PidFlowPtCorr {
16941752
return;
16951753
// end init && cut
16961754

1755+
if (cfgOutPutPtSpectra) {
1756+
registry.fill(HIST("ptSpectra/hCentEventCountMcRec"), cent);
1757+
} // cfgoutputptspectra
1758+
16971759
// loop tracks
16981760
for (const auto& track : tracks) {
16991761
// track cut
@@ -1706,7 +1768,20 @@ struct PidFlowPtCorr {
17061768
auto mcParticle = track.mcParticle();
17071769
// fill graph
17081770
if (particleSelected(mcParticle)) {
1771+
// graph for all particles
17091772
registry.fill(HIST("correction/hPtCentMcRec"), track.pt(), cent);
1773+
1774+
// identify particle and fill graph
1775+
if (isPion(track)) {
1776+
registry.fill(HIST("correction/hPtCentMcRecPi"), track.pt(), cent);
1777+
}
1778+
if (isKaon(track)) {
1779+
registry.fill(HIST("correction/hPtCentMcRecKa"), track.pt(), cent);
1780+
}
1781+
if (isProton(track)) {
1782+
registry.fill(HIST("correction/hPtCentMcRecPr"), track.pt(), cent);
1783+
}
1784+
// end identify particle and fill graph
17101785
}
17111786
// end fill graph
17121787
}
@@ -1755,11 +1830,28 @@ struct PidFlowPtCorr {
17551830
continue;
17561831
// end collision cut
17571832

1833+
if (cfgOutPutPtSpectra) {
1834+
registry.fill(HIST("ptSpectra/hCentEventCountMcGen"), cent);
1835+
} // cfgoutputptspectra
1836+
17581837
// loop mc particles
17591838
for (const auto& mcParticle : mcParticles) {
17601839
// fill graph
17611840
if (particleSelected(mcParticle)) {
1841+
// graph for all particles
17621842
registry.fill(HIST("correction/hPtCentMcGen"), mcParticle.pt(), cent);
1843+
1844+
// identify particle and fill graph
1845+
if (std::abs(mcParticle.pdgCode()) == PDG_t::kPiPlus) {
1846+
registry.fill(HIST("correction/hPtCentMcGenPi"), mcParticle.pt(), cent);
1847+
}
1848+
if (std::abs(mcParticle.pdgCode()) == PDG_t::kKPlus) {
1849+
registry.fill(HIST("correction/hPtCentMcGenKa"), mcParticle.pt(), cent);
1850+
}
1851+
if (std::abs(mcParticle.pdgCode()) == PDG_t::kProton) {
1852+
registry.fill(HIST("correction/hPtCentMcGenPr"), mcParticle.pt(), cent);
1853+
}
1854+
// end identify particle and fill graph
17631855
}
17641856
// end fill graph
17651857
}

0 commit comments

Comments
 (0)