From 4cc6a45c0945e17f6c648e9f9cb0144d7be7ed75 Mon Sep 17 00:00:00 2001 From: huinaibing Date: Mon, 2 Mar 2026 16:02:13 +0800 Subject: [PATCH 1/2] [PWGCF] Add pt spectra hist for QA --- PWGCF/Flow/Tasks/pidFlowPtCorr.cxx | 98 +++++++++++++++++++++++++++++- 1 file changed, 95 insertions(+), 3 deletions(-) diff --git a/PWGCF/Flow/Tasks/pidFlowPtCorr.cxx b/PWGCF/Flow/Tasks/pidFlowPtCorr.cxx index 6680d402942..37190b5b25b 100644 --- a/PWGCF/Flow/Tasks/pidFlowPtCorr.cxx +++ b/PWGCF/Flow/Tasks/pidFlowPtCorr.cxx @@ -137,6 +137,8 @@ struct PidFlowPtCorr { O2_DEFINE_CONFIGURABLE(cfgUsePtCentNUECorr, bool, true, "do NUA NUE, Using Eff(pt, cent) to do NUE") O2_DEFINE_CONFIGURABLE(cfgDebugMyCode, bool, false, "output some graph for code debug") + O2_DEFINE_CONFIGURABLE(cfgOutPutPtSpectra, bool, false, "output pt spectra for data, MC and RECO") + /** * @brief cfg for PID pt range * @details default datas are from run2, note that separate pi-k and k-p needs to use difference pt range @@ -182,7 +184,7 @@ struct PidFlowPtCorr { // filter and using // data Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex; - Filter trackFilter = (nabs(aod::track::eta) < trkQualityOpts.cfgCutEta.value) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true)); + Filter trackFilter = (nabs(aod::track::eta) < trkQualityOpts.cfgCutEta.value) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t)true)); using TracksPID = soa::Join; // data tracks filter @@ -197,7 +199,7 @@ struct PidFlowPtCorr { Filter particleFilter = (nabs(aod::mcparticle::eta) < trkQualityOpts.cfgCutEta.value); using FilteredMcParticles = soa::Filtered; - using FilteredTracksWithMCLabel = soa::Filtered>; + using FilteredTracksWithMCLabel = soa::Filtered>; using FilteredCollisionsWithMCLabel = soa::Filtered>; // end using and filter @@ -382,7 +384,7 @@ struct PidFlowPtCorr { TH1* hPhiRunByRunBefore = registry.add(Form("RunByRunQA%d/hPhiBefore", oneRun), "", {HistType::kTH1D, {cfgaxisPhi}}).get(); TH1* hPhiRunByRunAfter = registry.add(Form("RunByRunQA%d/hPhiAfter", oneRun), "", {HistType::kTH1D, {cfgaxisPhi}}).get(); - TH2* hITSnclsVsPhi = registry.add(Form("RunByRunQA%d/hITSnclsVsPhi", oneRun), "", {HistType::kTH2D, {cfgaxisPhi, {7, 0, 7}}}).get(); + TH2* hITSnclsVsPhi = registry.add(Form("RunByRunQA%d/hITSnclsVsPhi", oneRun), "", {HistType::kTH2D, {cfgaxisPhi, {8, 0, 8}}}).get(); TH2* hITSChi2VsPhi = registry.add(Form("RunByRunQA%d/hITSChi2VsPhi", oneRun), "", {HistType::kTH2D, {cfgaxisPhi, {100, 0, 10}}}).get(); qaHistVector.emplace_back(qaHist(hPhiRunByRunBefore, hPhiRunByRunAfter, hITSnclsVsPhi, hITSChi2VsPhi)); @@ -394,6 +396,16 @@ struct PidFlowPtCorr { // hist for NUE correction registry.add("correction/hPtCentMcRec", "", {HistType::kTH2D, {cfgaxisPt, axisMultiplicity}}); registry.add("correction/hPtCentMcGen", "", {HistType::kTH2D, {cfgaxisPt, axisMultiplicity}}); + + // hist for Pi eff + registry.add("correction/hPtCentMcRecPi", "", {HistType::kTH2D, {cfgaxisPt, axisMultiplicity}}); + registry.add("correction/hPtCentMcGenPi", "", {HistType::kTH2D, {cfgaxisPt, axisMultiplicity}}); + // hist for Ka eff + registry.add("correction/hPtCentMcRecKa", "", {HistType::kTH2D, {cfgaxisPt, axisMultiplicity}}); + registry.add("correction/hPtCentMcGenKa", "", {HistType::kTH2D, {cfgaxisPt, axisMultiplicity}}); + // hist for Pr eff + registry.add("correction/hPtCentMcRecPr", "", {HistType::kTH2D, {cfgaxisPt, axisMultiplicity}}); + registry.add("correction/hPtCentMcGenPr", "", {HistType::kTH2D, {cfgaxisPt, axisMultiplicity}}); } // cfgoutputMC // debug hists @@ -406,6 +418,26 @@ struct PidFlowPtCorr { } } // cfgdebugmycode + if (cfgOutPutPtSpectra) { + registry.add("ptSpectra/hPtCentData", "", {HistType::kTH2D, {cfgaxisPt, axisMultiplicity}}); + registry.add("ptSpectra/hCentEventCountData", "", {HistType::kTH1D, {axisMultiplicity}}); + registry.add("ptSpectra/hCentEventCountMcGen", "", {HistType::kTH1D, {axisMultiplicity}}); + registry.add("ptSpectra/hCentEventCountMcRec", "", {HistType::kTH1D, {axisMultiplicity}}); + + // (PosEta)(PosCh) + registry.add("ptSpectra/hPtCentDataPosEtaPosCh", "", {HistType::kTH2D, {cfgaxisPt, axisMultiplicity}}); + + // (PosEta)(NegCh) + registry.add("ptSpectra/hPtCentDataPosEtaNegCh", "", {HistType::kTH2D, {cfgaxisPt, axisMultiplicity}}); + + // (NegEta(PosCh) + registry.add("ptSpectra/hPtCentDataNegEtaPosCh", "", {HistType::kTH2D, {cfgaxisPt, axisMultiplicity}}); + + // (NegEta)(NegCh) + registry.add("ptSpectra/hPtCentDataNegEtaNegCh", "", {HistType::kTH2D, {cfgaxisPt, axisMultiplicity}}); + + } // cfgoutputptspectra + if (cfgOutputrunbyrun) { // hist for NUA registry.add("correction/hRunNumberPhiEtaVertex", "", {HistType::kTHnSparseF, {cfgaxisRun, cfgaxisPhi, cfgaxisEta, cfgaxisVertex}}); @@ -1262,6 +1294,11 @@ struct PidFlowPtCorr { return; // end collision cut + // pt spectra + if (cfgOutPutPtSpectra) { + registry.fill(HIST("ptSpectra/hCentEventCountData"), cent); + } // cfgOutPutPtSpectra + // correction loadCorrections(bc.timestamp()); float vtxz = collision.posZ(); @@ -1388,6 +1425,27 @@ struct PidFlowPtCorr { registry.fill(HIST("hPt"), track.pt()); // end fill QA hist + // pt spectra + if (cfgOutPutPtSpectra) { + registry.fill(HIST("ptSpectra/hPtCentData"), track.pt(), cent); + + // region 1 +eta +ch + if (track.eta() > 0.05 && track.sign() > 0) + registry.fill(HIST("ptSpectra/hPtCentDataPosEtaPosCh"), track.pt(), cent); + + // region 2 +eta -ch + if (track.eta() > 0.05 && track.sign() < 0) + registry.fill(HIST("ptSpectra/hPtCentDataPosEtaNegCh"), track.pt(), cent); + + // region 3 -eta +ch + if (track.eta() < -0.05 && track.sign() > 0) + registry.fill(HIST("ptSpectra/hPtCentDataNegEtaPosCh"), track.pt(), cent); + + // region 4 -eta -ch + if (track.eta() < -0.05 && track.sign() < 0) + registry.fill(HIST("ptSpectra/hPtCentDataNegEtaNegCh"), track.pt(), cent); + } + // track pt cut if (!((track.pt() > trkQualityOpts.cfgCutPtMin.value) && (track.pt() < trkQualityOpts.cfgCutPtMax.value))) continue; @@ -1694,6 +1752,10 @@ struct PidFlowPtCorr { return; // end init && cut + if (cfgOutPutPtSpectra) { + registry.fill(HIST("ptSpectra/hCentEventCountMcRec"), cent); + } // cfgoutputptspectra + // loop tracks for (const auto& track : tracks) { // track cut @@ -1706,7 +1768,20 @@ struct PidFlowPtCorr { auto mcParticle = track.mcParticle(); // fill graph if (particleSelected(mcParticle)) { + // graph for all particles registry.fill(HIST("correction/hPtCentMcRec"), track.pt(), cent); + + // identify particle and fill graph + if (isPion(track)) { + registry.fill(HIST("correction/hPtCentMcRecPi"), track.pt(), cent); + } + if (isKaon(track)) { + registry.fill(HIST("correction/hPtCentMcRecKa"), track.pt(), cent); + } + if (isProton(track)) { + registry.fill(HIST("correction/hPtCentMcRecPr"), track.pt(), cent); + } + // end identify particle and fill graph } // end fill graph } @@ -1755,11 +1830,28 @@ struct PidFlowPtCorr { continue; // end collision cut + if (cfgOutPutPtSpectra) { + registry.fill(HIST("ptSpectra/hCentEventCountMcGen"), cent); + } // cfgoutputptspectra + // loop mc particles for (const auto& mcParticle : mcParticles) { // fill graph if (particleSelected(mcParticle)) { + // graph for all particles registry.fill(HIST("correction/hPtCentMcGen"), mcParticle.pt(), cent); + + // identify particle and fill graph + if (std::abs(mcParticle.pdgCode()) == PDG_t::kPiPlus) { + registry.fill(HIST("correction/hPtCentMcGenPi"), mcParticle.pt(), cent); + } + if (std::abs(mcParticle.pdgCode()) == PDG_t::kKPlus) { + registry.fill(HIST("correction/hPtCentMcGenKa"), mcParticle.pt(), cent); + } + if (std::abs(mcParticle.pdgCode()) == PDG_t::kProton) { + registry.fill(HIST("correction/hPtCentMcGenPr"), mcParticle.pt(), cent); + } + // end identify particle and fill graph } // end fill graph } From 8a2e5bbf13ceee85d2bb88557b75b197397f1239 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Mon, 2 Mar 2026 08:09:18 +0000 Subject: [PATCH 2/2] Please consider the following formatting changes --- PWGCF/Flow/Tasks/pidFlowPtCorr.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGCF/Flow/Tasks/pidFlowPtCorr.cxx b/PWGCF/Flow/Tasks/pidFlowPtCorr.cxx index 37190b5b25b..ea938dd55a8 100644 --- a/PWGCF/Flow/Tasks/pidFlowPtCorr.cxx +++ b/PWGCF/Flow/Tasks/pidFlowPtCorr.cxx @@ -184,7 +184,7 @@ struct PidFlowPtCorr { // filter and using // data Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex; - Filter trackFilter = (nabs(aod::track::eta) < trkQualityOpts.cfgCutEta.value) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t)true)); + Filter trackFilter = (nabs(aod::track::eta) < trkQualityOpts.cfgCutEta.value) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true)); using TracksPID = soa::Join; // data tracks filter