From 5cc126d184e76fbe8e32260dee92d7c3aa73e748 Mon Sep 17 00:00:00 2001 From: baasingh Date: Tue, 7 Apr 2026 14:47:40 +0530 Subject: [PATCH 1/2] PWGCF:FIX RUN3-MC PROCESS FUNCTION_INCLUDE SOME QA PLOTS AND UPDATE TRACKS SELECTION Signed-off-by: baasingh --- .../Tasks/FactorialMomentsTask.cxx | 59 +++++++++++-------- 1 file changed, 34 insertions(+), 25 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/FactorialMomentsTask.cxx b/PWGCF/EbyEFluctuations/Tasks/FactorialMomentsTask.cxx index 9ca0bbb7e3f..09282708834 100644 --- a/PWGCF/EbyEFluctuations/Tasks/FactorialMomentsTask.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/FactorialMomentsTask.cxx @@ -15,7 +15,6 @@ #include "TRandom.h" #include - // O2 includes #include "Common/Core/RecoDecay.h" #include "Common/Core/TrackSelection.h" @@ -34,7 +33,6 @@ #include #include - using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; @@ -43,7 +41,7 @@ TH1D* tmpFqErr[6][5][52]; struct FactorialMomentsTask { Configurable useITS{"useITS", false, "Select tracks with ITS"}; Configurable useTPC{"useTPC", false, "Select tracks with TPC"}; - Configurable useGlobal{"useGlobal", true, "Select global tracks"}; + Configurable useGlobal{"useGlobal", false, "Select global tracks"}; Configurable applyCheckPtForRec{"applyCheckPtForRec", false, "Apply checkpT for reconstructed tracks"}; Configurable applyCheckPtForMC{"applyCheckPtForMC", true, "Apply checkpT for MC-generated tracks"}; Configurable centralEta{"centralEta", 0.9, "eta limit for tracks"}; @@ -62,9 +60,6 @@ struct FactorialMomentsTask { Configurable isApplyVertexTRDmatched{"isApplyVertexTRDmatched", true, "Enable VertexTRDmatched cut"}; Configurable isApplyExtraCorrCut{"isApplyExtraCorrCut", false, "Enable extra NPVtracks vs FTOC correlation cut"}; Configurable isApplyExtraPhiCut{"isApplyExtraPhiCut", false, "Enable extra phi cut"}; - Configurable includeGlobalTracks{"includeGlobalTracks", false, "Enable Global Tracks"}; - Configurable includeTPCTracks{"includeTPCTracks", false, "TPC Tracks"}; - Configurable includeITSTracks{"includeITSTracks", false, "ITS Tracks"}; Configurable samplesize{"samplesize", 100, "Sample size"}; Configurable useMC{"useMC", false, "Use MC information"}; Configurable reduceOutput{"reduceOutput", 0, "Suppress info level output (0 = all output, 1 = per collision, 2 = none)"}; @@ -104,6 +99,8 @@ struct FactorialMomentsTask { HistogramRegistry histos{ "histos", { + {"mTPCdEdxVsP", "TPC dE/dx vs p; p (GeV/c); TPC dE/dx", {HistType::kTH2F, {{1000, 0.1, 10.0}, {1000, 0.0, 1000.0}}}}, + {"mImpactParameter", "Impact parameter;b (fm);entries", {HistType::kTH1F, {{100, 0.0, 20.0}}}}, {"mChargeBefore", "Charge before MC cuts;charge;entries", {HistType::kTH1F, {{7, -3.5, 3.5}}}}, {"mChargeAfter", "Charge after MC cuts;charge;entries", {HistType::kTH1F, {{7, -3.5, 3.5}}}}, {"mCollID", "collisionID", {HistType::kTH1I, {{1000, -10000, 10000}}}}, @@ -119,23 +116,25 @@ struct FactorialMomentsTask { {"mPhi", "#phi", {HistType::kTH1F, {{100, 0, o2::constants::math::TwoPI}}}}, {"mEvents", "events", {HistType::kTH1D, {{5, -0.5, 4.5}}}}, {"mNFindableClsTPC", "findable TPC clusters;findable clusters", {HistType::kTH1F, {{100, 0, 200}}}}, + {"mNFindableClsTPCb", "findable TPC clusters;findable clusters", {HistType::kTH1F, {{100, 0, 200}}}}, {"mNClsTPC", "number of clusters TPC; nClusters TPC", {HistType::kTH1F, {{100, 0, 200}}}}, - {"mNClsITS", "number of clusters ITS; nClusters ITS", {HistType::kTH1F, {{100, 0, 10}}}}, + {"mNClsITS", "number of clusters ITS; nClusters ITS", {HistType::kTH1F, {{100, 0, 50}}}}, {"mChi2TPC", "chi2 TPC", {HistType::kTH1F, {{100, 0, 10}}}}, {"mChi2ITS", "chi2 ITS", {HistType::kTH1F, {{100, 0, 10}}}}, {"mChi2TRD", "chi2 TRD", {HistType::kTH1F, {{100, 0, 100}}}}, {"mDCAxy", "DCA xy", {HistType::kTH1F, {{500, -0.8, 0.8}}}}, - {"mDCAx", "DCA z", {HistType::kTH1F, {{500, -2.0, 2.0}}}}, - {"mDCAxyPt", "DCA xy vs #pt;#pt;DCAxy", {HistType::kTH2F, {{100, 0, 20}, {500, -0.5, 0.5}}}}, + {"mDCAz", "DCA z", {HistType::kTH1F, {{500, -2.0, 2.0}}}}, + {"mDCAxyPt", "DCA xy vs #pt;#pt;DCAxy", {HistType::kTH2F, {{1000, 0, 6}, {500, -0.5, 0.5}}}}, {"mDCAxyPtbcut", "DCA xy vs #pt;#pt;DCAxycut", {HistType::kTH2F, {{100, 0, 20}, {500, -0.5, 0.5}}}}, {"mDCAzPtbcut", "DCA z vs #pt;#pt;DCAzcut", {HistType::kTH2F, {{100, 0, 20}, {100, -2.0, 2.0}}}}, - {"mDCAzPt", "DCA z vs #pt;#pt;DCAz", {HistType::kTH2F, {{100, 0, 20}, {100, -2.0, 2.0}}}}, + {"mDCAzPt", "DCA z vs #pt;#pt;DCAz", {HistType::kTH2F, {{1000, 0, 6}, {1000, -2.0, 2.0}}}}, {"mNSharedClsTPC", "shared clusters in TPC", {HistType::kTH1F, {{100, 0, 10}}}}, {"mCrossedRowsTPC", "crossedrows in TPC", {HistType::kTH1F, {{100, 0, 200}}}}, {"mNFinClsminusCRows", "findable cluster #minus crossed rows (TPC)", {HistType::kTH1F, {{100, 0, 200}}}}, {"mNFractionShClsTPC", "fraction of shared clusters in TPC", {HistType::kTH1F, {{100, 0, 2}}}}, {"mSharedClsvsPt", "shared cluster vs #pt", {HistType::kTH2F, {{100, 0, 50}, {100, 0, 10}}}}, - {"mSharedClsProbvsPt", "shared clusters ration vs #pt;#pt;sharedcls/ncrows", {HistType::kTH2F, {{100, 0, 50}, {100, 0, 5}}}}, + {"mCrossedRowsfindablesvsPt", "fraction of crossed rows in TPC and findables vs #pt;#pt;ncrows/fcls", {HistType::kTH2F, {{100, 0, 20.0}, {100, 0, 5.0}}}}, + {"mSharedClsProbvsPt", "shared clusters ration vs #pt;#pt;sharedcls/ncrows", {HistType::kTH2F, {{100, 0, 20}, {100, 0, 5}}}}, }, OutputObjHandlingPolicy::AnalysisObject, true}; @@ -179,8 +178,7 @@ struct FactorialMomentsTask { mEventSelected->GetXaxis()->SetBinLabel(5, "vertexITSTPC"); mEventSelected->GetXaxis()->SetBinLabel(6, "centrality"); mEventSelected->GetXaxis()->SetBinLabel(7, "final"); - auto mTrackSelected = std::get>(histos.add( - "mTrackSelected", "Track Selection Steps", HistType::kTH1D, {{5, 0.5, 5.5}})); + auto mTrackSelected = std::get>(histos.add("mTrackSelected", "Track Selection Steps", HistType::kTH1D, {{5, 0.5, 5.5}})); mTrackSelected->GetXaxis()->SetBinLabel(1, "all"); mTrackSelected->GetXaxis()->SetBinLabel(2, "charge"); mTrackSelected->GetXaxis()->SetBinLabel(3, "PIDs"); @@ -335,6 +333,7 @@ struct FactorialMomentsTask { binConEvent = {{{0, 0, 0, 0, 0}}}; for (auto const& track : tracks) { if (track.hasTPC()) { + histos.fill(HIST("mTPCdEdxVsP"), track.p(), track.tpcSignal()); histos.fill(HIST("mCollID"), track.collisionId()); histos.fill(HIST("mEta"), track.eta()); histos.fill(HIST("mPt"), track.pt()); @@ -346,7 +345,7 @@ struct FactorialMomentsTask { histos.fill(HIST("mChi2ITS"), track.itsChi2NCl()); histos.fill(HIST("mChi2TRD"), track.trdChi2()); histos.fill(HIST("mDCAxy"), track.dcaXY()); - histos.fill(HIST("mDCAx"), track.dcaZ()); + histos.fill(HIST("mDCAz"), track.dcaZ()); histos.fill(HIST("mDCAxyPt"), track.pt(), track.dcaXY()); histos.fill(HIST("mDCAzPt"), track.pt(), track.dcaZ()); histos.fill(HIST("mNSharedClsTPC"), track.tpcNClsShared()); @@ -355,6 +354,7 @@ struct FactorialMomentsTask { histos.fill(HIST("mNFractionShClsTPC"), track.tpcFractionSharedCls()); histos.fill(HIST("mSharedClsvsPt"), track.pt(), track.tpcNClsShared()); histos.fill(HIST("mSharedClsProbvsPt"), track.pt(), track.tpcFractionSharedCls() / track.tpcNClsCrossedRows()); + histos.fill(HIST("mCrossedRowsfindablesvsPt"), track.pt(), track.tpcNClsCrossedRows() / track.tpcNClsFindable()); checkpT(track); } } @@ -404,6 +404,7 @@ struct FactorialMomentsTask { countTracks = {0, 0, 0, 0, 0}; fqEvent = {{{{{0, 0, 0, 0, 0, 0}}}}}; binConEvent = {{{0, 0, 0, 0, 0}}}; + for (auto const& track : colltracks) { if (useITS && !track.hasITS()) continue; @@ -411,6 +412,10 @@ struct FactorialMomentsTask { continue; if (useGlobal && !track.isGlobalTrack()) continue; + if ((track.pt() < ptMin)) { + continue; + } + histos.fill(HIST("mTPCdEdxVsP"), track.p(), track.tpcSignal()); histos.fill(HIST("mCollID"), track.collisionId()); histos.fill(HIST("mEta"), track.eta()); histos.fill(HIST("mPt"), track.pt()); @@ -422,7 +427,7 @@ struct FactorialMomentsTask { histos.fill(HIST("mChi2ITS"), track.itsChi2NCl()); histos.fill(HIST("mChi2TRD"), track.trdChi2()); histos.fill(HIST("mDCAxy"), track.dcaXY()); - histos.fill(HIST("mDCAx"), track.dcaZ()); + histos.fill(HIST("mDCAz"), track.dcaZ()); histos.fill(HIST("mDCAxyPt"), track.pt(), track.dcaXY()); histos.fill(HIST("mDCAzPt"), track.pt(), track.dcaZ()); histos.fill(HIST("mNSharedClsTPC"), track.tpcNClsShared()); @@ -431,6 +436,7 @@ struct FactorialMomentsTask { histos.fill(HIST("mNFractionShClsTPC"), track.tpcFractionSharedCls()); histos.fill(HIST("mSharedClsvsPt"), track.pt(), track.tpcNClsShared()); histos.fill(HIST("mSharedClsProbvsPt"), track.pt(), track.tpcFractionSharedCls() / track.tpcNClsCrossedRows()); + histos.fill(HIST("mCrossedRowsfindablesvsPt"), track.pt(), track.tpcNClsCrossedRows() / track.tpcNClsFindable()); if (applyCheckPtForRec && !applyCheckPtForMC) { checkpT(track); } @@ -481,13 +487,16 @@ struct FactorialMomentsTask { if (!(bc.eventCuts() & BIT(aod::Run2EventCuts::kAliEventCutsAccepted))) { return; } - if (coll.centRun2V0M() < centLimits.value[0] || coll.centRun2V0M() > centLimits.value[1]) { + auto mcColl = coll.mcCollision(); + float imp = mcColl.impactParameter(); + histos.fill(HIST("mImpactParameter"), imp); + float bMax = 3.5; // adjust based on your MC + if (imp > bMax) { return; } histos.fill(HIST("mVertexX"), coll.posX()); histos.fill(HIST("mVertexY"), coll.posY()); histos.fill(HIST("mVertexZ"), coll.posZ()); - histos.fill(HIST("mCentFT0M"), coll.centRun2V0M()); for (auto const& h : mHistArrReset) { h->Reset(); } @@ -497,6 +506,7 @@ struct FactorialMomentsTask { for (auto const& track : tracks) { double recoCharge = (track.sign() != 0) ? track.sign() : 0.; if (std::abs(track.eta()) < centralEta && track.isGlobalTrack() && std::abs(recoCharge) >= kMinCharge) { + histos.fill(HIST("mTPCdEdxVsP"), track.p(), track.tpcSignal()); histos.fill(HIST("mCollID"), track.collisionId()); histos.fill(HIST("mNFindableClsTPC"), track.tpcNClsFindable()); histos.fill(HIST("mNClsTPC"), track.tpcNClsFound()); @@ -509,6 +519,7 @@ struct FactorialMomentsTask { histos.fill(HIST("mNFinClsminusCRows"), track.tpcNClsFindableMinusCrossedRows()); histos.fill(HIST("mNFractionShClsTPC"), track.tpcFractionSharedCls()); histos.fill(HIST("mSharedClsvsPt"), track.pt(), track.tpcNClsShared()); + histos.fill(HIST("mCrossedRowsfindablesvsPt"), track.pt(), track.tpcNClsCrossedRows() / track.tpcNClsFindable()); histos.fill(HIST("mSharedClsProbvsPt"), track.pt(), track.tpcFractionSharedCls() / track.tpcNClsCrossedRows()); if (applyCheckPtForRec && !applyCheckPtForMC) { checkpT(track); @@ -516,7 +527,7 @@ struct FactorialMomentsTask { } } auto mcParts = mcParticles.sliceBy(perMcCollision, coll.mcCollision().globalIndex()); - for (auto const& mc : mcParts) { + for (const auto& mc : mcParts) { int pdgCode = mc.pdgCode(); auto pdgInfo = pdg->GetParticle(pdgCode); if (!pdgInfo) { @@ -524,9 +535,7 @@ struct FactorialMomentsTask { } double charge = pdgInfo->Charge(); double physCharge = charge / 3.0; - histos.fill(HIST("mChargeBefore"), physCharge); - if (mc.isPhysicalPrimary() && std::abs(mc.eta()) < centralEta && std::abs(physCharge) >= kMinCharge) { - histos.fill(HIST("mChargeAfter"), physCharge); + if (mc.isPhysicalPrimary() && std::abs(mc.eta()) < 0.8 && std::abs(physCharge) >= kMinCharge) { histos.fill(HIST("mEta"), mc.eta()); histos.fill(HIST("mPt"), mc.pt()); histos.fill(HIST("mPhi"), mc.phi()); @@ -535,13 +544,11 @@ struct FactorialMomentsTask { } } } - for (int iPt = 0; iPt < numPt; ++iPt) { if (countTracks[iPt] > 0) { mHistArrQA[iPt * 4 + 3]->Fill(countTracks[iPt]); } } - calculateMoments(mHistArrReset); } @@ -569,6 +576,7 @@ struct FactorialMomentsTask { if ((track.pt() < ptMin) || (!track.isGlobalTrack()) || (track.tpcNClsFindable() < mintPCCls)) { continue; } + histos.fill(HIST("mTPCdEdxVsP"), track.p(), track.tpcSignal()); histos.fill(HIST("mCollID"), track.collisionId()); histos.fill(HIST("mEta"), track.eta()); histos.fill(HIST("mPt"), track.pt()); @@ -580,7 +588,7 @@ struct FactorialMomentsTask { histos.fill(HIST("mChi2ITS"), track.itsChi2NCl()); histos.fill(HIST("mChi2TRD"), track.trdChi2()); histos.fill(HIST("mDCAxy"), track.dcaXY()); - histos.fill(HIST("mDCAx"), track.dcaZ()); + histos.fill(HIST("mDCAz"), track.dcaZ()); histos.fill(HIST("mDCAxyPt"), track.pt(), track.dcaXY()); histos.fill(HIST("mDCAzPt"), track.pt(), track.dcaZ()); histos.fill(HIST("mNSharedClsTPC"), track.tpcNClsShared()); @@ -589,10 +597,11 @@ struct FactorialMomentsTask { histos.fill(HIST("mNFractionShClsTPC"), track.tpcFractionSharedCls()); histos.fill(HIST("mSharedClsvsPt"), track.pt(), track.tpcNClsShared()); histos.fill(HIST("mSharedClsProbvsPt"), track.pt(), track.tpcFractionSharedCls() / track.tpcNClsCrossedRows()); + histos.fill(HIST("mCrossedRowsfindablesvsPt"), track.pt(), track.tpcNClsCrossedRows() / track.tpcNClsFindable()); checkpT(track); } for (int iPt = 0; iPt < numPt; ++iPt) { - if (countTracks[iPt] > 0) { + if (countTracks[iPt] < 3705) { mHistArrQA[iPt * 4 + 3]->Fill(countTracks[iPt]); } } From c7a3f5f05ce64012095ed94a8fa23bc55e007040 Mon Sep 17 00:00:00 2001 From: baasingh Date: Wed, 8 Apr 2026 12:40:36 +0530 Subject: [PATCH 2/2] PWGCF:FIX RUN3-MC PROCESS FUNCTION_INCLUDE SOME QA PLOTS AND UPDATE TRACKS SELECTION Signed-off-by: baasingh --- PWGCF/EbyEFluctuations/Tasks/FactorialMomentsTask.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/FactorialMomentsTask.cxx b/PWGCF/EbyEFluctuations/Tasks/FactorialMomentsTask.cxx index 09282708834..7454a665773 100644 --- a/PWGCF/EbyEFluctuations/Tasks/FactorialMomentsTask.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/FactorialMomentsTask.cxx @@ -535,7 +535,7 @@ struct FactorialMomentsTask { } double charge = pdgInfo->Charge(); double physCharge = charge / 3.0; - if (mc.isPhysicalPrimary() && std::abs(mc.eta()) < 0.8 && std::abs(physCharge) >= kMinCharge) { + if (mc.isPhysicalPrimary() && std::abs(mc.eta()) < centralEta && std::abs(physCharge) >= kMinCharge) { histos.fill(HIST("mEta"), mc.eta()); histos.fill(HIST("mPt"), mc.pt()); histos.fill(HIST("mPhi"), mc.phi()); @@ -601,7 +601,7 @@ struct FactorialMomentsTask { checkpT(track); } for (int iPt = 0; iPt < numPt; ++iPt) { - if (countTracks[iPt] < 3705) { + if (countTracks[iPt] < 0) { mHistArrQA[iPt * 4 + 3]->Fill(countTracks[iPt]); } }