From 5cc126d184e76fbe8e32260dee92d7c3aa73e748 Mon Sep 17 00:00:00 2001 From: baasingh Date: Tue, 7 Apr 2026 14:47:40 +0530 Subject: [PATCH 1/7] 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/7] 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]); } } From 8722a9f0cf5b6a64c0ede3623aabc17359901c15 Mon Sep 17 00:00:00 2001 From: baasingh Date: Thu, 9 Apr 2026 09:36:24 +0530 Subject: [PATCH 3/7] PWGCF:FIX RUN3-MC PROCESS FUNCTION_INCLUDE QA PLOTS AND UPDATE TRACKS SELECTION --- PWGCF/EbyEFluctuations/Tasks/master | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 PWGCF/EbyEFluctuations/Tasks/master diff --git a/PWGCF/EbyEFluctuations/Tasks/master b/PWGCF/EbyEFluctuations/Tasks/master new file mode 100644 index 00000000000..e69de29bb2d From 58b214c44d790db45a046e5a526c9da542a8f830 Mon Sep 17 00:00:00 2001 From: baasingh Date: Thu, 9 Apr 2026 10:36:59 +0530 Subject: [PATCH 4/7] PWGCF:FIX RUN3-MC PROCESS FUNCTION_INCLUDE QA PLOTS AND UPDATE TRACKS SELECTION --- PWGCF/EbyEFluctuations/Tasks/FactorialMomentsTask.cxx | 3 --- 1 file changed, 3 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/FactorialMomentsTask.cxx b/PWGCF/EbyEFluctuations/Tasks/FactorialMomentsTask.cxx index 7454a665773..fc303f56eb7 100644 --- a/PWGCF/EbyEFluctuations/Tasks/FactorialMomentsTask.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/FactorialMomentsTask.cxx @@ -247,7 +247,6 @@ struct FactorialMomentsTask { compSample = kTRUE; countSamples = 0; } - // Calculate the normalized factorial moments for (int iPt = 0; iPt < numPt; ++iPt) { for (int iM = 0; iM < nBins; ++iM) { binContent = 0; @@ -462,7 +461,6 @@ struct FactorialMomentsTask { } } for (auto iPt = 0; iPt < numPt; ++iPt) { - // if (countTracks[iPt] > 0)countTracks = {0, 0, 0, 0, 0}; if (countTracks[iPt] > 0) { mHistArrQA[iPt * 4 + 3]->Fill(countTracks[iPt]); } @@ -605,7 +603,6 @@ struct FactorialMomentsTask { mHistArrQA[iPt * 4 + 3]->Fill(countTracks[iPt]); } } - // Calculate the normalized factorial moments calculateMoments(mHistArrReset); } PROCESS_SWITCH(FactorialMomentsTask, processRun2, "for RUN2", false); From 53c0f79c13b7615b1d30eff1c86bd15be09d33fb Mon Sep 17 00:00:00 2001 From: baasingh Date: Fri, 10 Apr 2026 11:11:14 +0530 Subject: [PATCH 5/7] dummy commit From db817c9a0a50b3c9238ed8b8f81f0e57536eb5ac Mon Sep 17 00:00:00 2001 From: baasingh Date: Fri, 17 Apr 2026 12:23:22 +0530 Subject: [PATCH 6/7] check and update the changes --- .../Tasks/FactorialMomentsTask.cxx | 109 +++++++++--------- 1 file changed, 53 insertions(+), 56 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/FactorialMomentsTask.cxx b/PWGCF/EbyEFluctuations/Tasks/FactorialMomentsTask.cxx index fc303f56eb7..bc76e91bad9 100644 --- a/PWGCF/EbyEFluctuations/Tasks/FactorialMomentsTask.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/FactorialMomentsTask.cxx @@ -15,6 +15,7 @@ #include "TRandom.h" #include + // O2 includes #include "Common/Core/RecoDecay.h" #include "Common/Core/TrackSelection.h" @@ -33,6 +34,7 @@ #include #include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; @@ -41,7 +43,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", false, "Select global tracks"}; + Configurable useGlobal{"useGlobal", true, "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"}; @@ -60,6 +62,9 @@ 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)"}; @@ -99,8 +104,6 @@ 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}}}}, @@ -116,25 +119,23 @@ 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, 50}}}}, + {"mNClsITS", "number of clusters ITS; nClusters ITS", {HistType::kTH1F, {{100, 0, 10}}}}, {"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}}}}, - {"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}}}}, + {"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}}}}, {"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, {{1000, 0, 6}, {1000, -2.0, 2.0}}}}, + {"mDCAzPt", "DCA z vs #pt;#pt;DCAz", {HistType::kTH2F, {{100, 0, 20}, {100, -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}}}}, - {"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}}}}, + {"mSharedClsProbvsPt", "shared clusters ration vs #pt;#pt;sharedcls/ncrows", {HistType::kTH2F, {{100, 0, 50}, {100, 0, 5}}}}, }, OutputObjHandlingPolicy::AnalysisObject, true}; @@ -178,7 +179,8 @@ 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"); @@ -247,6 +249,7 @@ struct FactorialMomentsTask { compSample = kTRUE; countSamples = 0; } + // Calculate the normalized factorial moments for (int iPt = 0; iPt < numPt; ++iPt) { for (int iM = 0; iM < nBins; ++iM) { binContent = 0; @@ -331,32 +334,35 @@ struct FactorialMomentsTask { fqEvent = {{{{{0, 0, 0, 0, 0, 0}}}}}; 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()); - histos.fill(HIST("mPhi"), track.phi()); - histos.fill(HIST("mNFindableClsTPC"), track.tpcNClsFindable()); - histos.fill(HIST("mNClsTPC"), track.tpcNClsFound()); - histos.fill(HIST("mNClsITS"), track.itsNCls()); - histos.fill(HIST("mChi2TPC"), track.tpcChi2NCl()); - histos.fill(HIST("mChi2ITS"), track.itsChi2NCl()); - histos.fill(HIST("mChi2TRD"), track.trdChi2()); - histos.fill(HIST("mDCAxy"), track.dcaXY()); - 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()); - histos.fill(HIST("mCrossedRowsTPC"), track.tpcNClsCrossedRows()); - histos.fill(HIST("mNFinClsminusCRows"), track.tpcNClsFindableMinusCrossedRows()); - 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); - } + if (useITS && !track.hasITS()) + continue; + if (useTPC && !track.hasTPC()) + continue; + if (useGlobal && !track.isGlobalTrack()) + continue; + histos.fill(HIST("mCollID"), track.collisionId()); + histos.fill(HIST("mEta"), track.eta()); + histos.fill(HIST("mPt"), track.pt()); + histos.fill(HIST("mPhi"), track.phi()); + histos.fill(HIST("mNFindableClsTPC"), track.tpcNClsFindable()); + histos.fill(HIST("mNClsTPC"), track.tpcNClsFound()); + histos.fill(HIST("mNClsITS"), track.itsNCls()); + histos.fill(HIST("mChi2TPC"), track.tpcChi2NCl()); + 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("mDCAxyPt"), track.pt(), track.dcaXY()); + histos.fill(HIST("mDCAzPt"), track.pt(), track.dcaZ()); + histos.fill(HIST("mNSharedClsTPC"), track.tpcNClsShared()); + histos.fill(HIST("mCrossedRowsTPC"), track.tpcNClsCrossedRows()); + histos.fill(HIST("mNFinClsminusCRows"), track.tpcNClsFindableMinusCrossedRows()); + histos.fill(HIST("mNFractionShClsTPC"), track.tpcFractionSharedCls()); + histos.fill(HIST("mSharedClsvsPt"), track.pt(), track.tpcNClsShared()); + histos.fill(HIST("mSharedClsProbvsPt"), track.pt(), track.tpcFractionSharedCls() / track.tpcNClsCrossedRows()); + checkpT(track); } + for (int iPt = 0; iPt < numPt; ++iPt) { if (countTracks[iPt] > 0) { mHistArrQA[iPt * 4 + 3]->Fill(countTracks[iPt]); @@ -403,7 +409,6 @@ 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,10 +416,6 @@ 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()); @@ -426,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("mDCAz"), track.dcaZ()); + histos.fill(HIST("mDCAx"), track.dcaZ()); histos.fill(HIST("mDCAxyPt"), track.pt(), track.dcaXY()); histos.fill(HIST("mDCAzPt"), track.pt(), track.dcaZ()); histos.fill(HIST("mNSharedClsTPC"), track.tpcNClsShared()); @@ -435,7 +436,6 @@ 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); } @@ -466,7 +466,6 @@ struct FactorialMomentsTask { } } histos.fill(HIST("mEventSelected"), 6); - // Calculate the normalized factorial moments calculateMoments(mHistArrReset); } PROCESS_SWITCH(FactorialMomentsTask, processMCRec, "main process function", false); @@ -485,16 +484,13 @@ struct FactorialMomentsTask { if (!(bc.eventCuts() & BIT(aod::Run2EventCuts::kAliEventCutsAccepted))) { return; } - 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) { + if (coll.centRun2V0M() < centLimits.value[0] || coll.centRun2V0M() > centLimits.value[1]) { 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(); } @@ -504,7 +500,6 @@ 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()); @@ -517,7 +512,6 @@ 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); @@ -525,7 +519,7 @@ struct FactorialMomentsTask { } } auto mcParts = mcParticles.sliceBy(perMcCollision, coll.mcCollision().globalIndex()); - for (const auto& mc : mcParts) { + for (auto const& mc : mcParts) { int pdgCode = mc.pdgCode(); auto pdgInfo = pdg->GetParticle(pdgCode); if (!pdgInfo) { @@ -533,7 +527,9 @@ 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); histos.fill(HIST("mEta"), mc.eta()); histos.fill(HIST("mPt"), mc.pt()); histos.fill(HIST("mPhi"), mc.phi()); @@ -542,11 +538,13 @@ struct FactorialMomentsTask { } } } + for (int iPt = 0; iPt < numPt; ++iPt) { if (countTracks[iPt] > 0) { mHistArrQA[iPt * 4 + 3]->Fill(countTracks[iPt]); } } + calculateMoments(mHistArrReset); } @@ -574,7 +572,6 @@ 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()); @@ -586,7 +583,7 @@ struct FactorialMomentsTask { histos.fill(HIST("mChi2ITS"), track.itsChi2NCl()); histos.fill(HIST("mChi2TRD"), track.trdChi2()); histos.fill(HIST("mDCAxy"), track.dcaXY()); - histos.fill(HIST("mDCAz"), track.dcaZ()); + histos.fill(HIST("mDCAx"), track.dcaZ()); histos.fill(HIST("mDCAxyPt"), track.pt(), track.dcaXY()); histos.fill(HIST("mDCAzPt"), track.pt(), track.dcaZ()); histos.fill(HIST("mNSharedClsTPC"), track.tpcNClsShared()); @@ -595,14 +592,14 @@ 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] > 0) { mHistArrQA[iPt * 4 + 3]->Fill(countTracks[iPt]); } } + // Calculate the normalized factorial moments calculateMoments(mHistArrReset); } PROCESS_SWITCH(FactorialMomentsTask, processRun2, "for RUN2", false); From 0824b88764f6a237f916c11e0ac925fb06af3009 Mon Sep 17 00:00:00 2001 From: baasingh Date: Sun, 17 May 2026 13:13:12 +0530 Subject: [PATCH 7/7] Add phi correction handling for multiplicity bins --- .../Tasks/FactorialMomentsTask.cxx | 191 ++++++++++++------ 1 file changed, 125 insertions(+), 66 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/FactorialMomentsTask.cxx b/PWGCF/EbyEFluctuations/Tasks/FactorialMomentsTask.cxx index bc76e91bad9..27ff442d04d 100644 --- a/PWGCF/EbyEFluctuations/Tasks/FactorialMomentsTask.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/FactorialMomentsTask.cxx @@ -31,6 +31,7 @@ #include "Framework/runDataProcessing.h" #include "ReconstructionDataFormats/GlobalTrackID.h" #include "ReconstructionDataFormats/Track.h" +#include #include #include @@ -39,24 +40,35 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; TH1D* tmpFqErr[6][5][52]; - +float collisionZ = 0.f; +TFile* f = TFile::Open("/home/salman/taskrun/o2running/PhiHistograms.root"); +TH3D* hBin1 = reinterpret_cast(f->Get("bin1_m3DVtxZetaPhi")); +TH3D* hBin2 = reinterpret_cast(f->Get("bin2_m3DVtxZetaPhi")); +TH3D* hBin3 = reinterpret_cast(f->Get("bin3_m3DVtxZetaPhi")); +TH3D* hBin4 = reinterpret_cast(f->Get("bin4_m3DVtxZetaPhi")); +TH3D* hBin5 = reinterpret_cast(f->Get("bin5_m3DVtxZetaPhi")); 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 applyCheckPtForRec{"applyCheckPtForRec", false, "Apply checkpT for reconstructed tracks"}; Configurable applyCheckPtForMC{"applyCheckPtForMC", true, "Apply checkpT for MC-generated tracks"}; + Configurable cfgEvSelkNoITSROFrameBorder{"cfgEvSelkNoITSROFrameBorder", true, "ITSROFrame border event selection cut"}; + Configurable cfgEvSelkNoTimeFrameBorder{"cfgEvSelkNoTimeFrameBorder", true, "TimeFrame border event selection cut"}; Configurable centralEta{"centralEta", 0.9, "eta limit for tracks"}; Configurable numPt{"numPt", 5, "number of pT bins"}; Configurable ptMin{"ptMin", 0.2f, "lower pT cut"}; - Configurable dcaXY{"dcaXY", 2.4f, "DCA xy cut"}; - Configurable dcaZ{"dcaZ", 2.0f, "DCA z cut"}; + Configurable dcaXY{"dcaXY", 0.1f, "DCA xy cut"}; + Configurable dcaZ{"dcaZ", 1.0f, "DCA z cut"}; + Configurable cfgCutTpcChi2NCl{"cfgCutTpcChi2NCl", 2.5f, "Maximum TPCchi2NCl"}; + Configurable cfgCutItsChi2NCl{"cfgCutItsChi2NCl", 40.0f, "Maximum ITSchi2NCl"}; Configurable mintPCCls{"mintPCCls", 70.0f, "minimum number of TPC clusters"}; Configurable> centLimits{"centLimits", {0, 5}, "centrality min and max"}; Configurable> vertexXYZ{"vertexXYZ", {0.3f, 0.4f, 10.0f}, "vertex cuts"}; Configurable> ptCuts{"ptCuts", {0.2f, 2.0f}, "pT cuts"}; Configurable isApplySameBunchPileup{"isApplySameBunchPileup", true, "Enable SameBunchPileup cut"}; Configurable isApplyGoodZvtxFT0vsPV{"isApplyGoodZvtxFT0vsPV", true, "Enable GoodZvtxFT0vsPV cut"}; + Configurable cfgUseGoodITSLayerAllCut{"cfgUseGoodITSLayerAllCut", true, "Remove time interval with dead ITS zone"}; Configurable isApplyVertexITSTPC{"isApplyVertexITSTPC", true, "Enable VertexITSTPC cut"}; Configurable isApplyVertexTOFmatched{"isApplyVertexTOFmatched", true, "Enable VertexTOFmatched cut"}; Configurable isApplyVertexTRDmatched{"isApplyVertexTRDmatched", true, "Enable VertexTRDmatched cut"}; @@ -67,14 +79,20 @@ struct FactorialMomentsTask { Configurable includeITSTracks{"includeITSTracks", false, "ITS Tracks"}; Configurable samplesize{"samplesize", 100, "Sample size"}; Configurable useMC{"useMC", false, "Use MC information"}; + + Configurable cfgITScluster{"cfgITScluster", 6, "Minimum Number of ITS cluster"}; + Configurable cfgTPCcluster{"cfgTPCcluster", 80, "Minimum Number of TPC cluster"}; + Configurable cfgTPCnCrossedRows{"cfgTPCnCrossedRows", 70, "Minimum Number of TPC crossed-rows"}; + Configurable cfgTPCnCrossedRowsOverFindableCls{"cfgTPCnCrossedRowsOverFindableCls", 0.8, "Minimum ratio of crossed rows over findable clusters TPC"}; Configurable reduceOutput{"reduceOutput", 0, "Suppress info level output (0 = all output, 1 = per collision, 2 = none)"}; - Filter filterTracks = (nabs(aod::track::eta) < centralEta) && (aod::track::pt >= ptMin) && (nabs(aod::track::dcaXY) < dcaXY) && (nabs(aod::track::dcaZ) < dcaZ); + Filter filterTracks = (nabs(aod::track::eta) < centralEta) && (aod::track::pt >= ptMin) && (requireGlobalTrackInFilter()); // && (aod::track::itsChi2NCl < cfgCutItsChi2NCl) && (aod::track::tpcChi2NCl < cfgCutTpcChi2NCl);// && (nabs(aod::track::dcaZ) < dcaZ) ; Filter filterCollisions = (nabs(aod::collision::posZ) < vertexXYZ.value[2]) && (nabs(aod::collision::posX) < vertexXYZ.value[0]) && (nabs(aod::collision::posY) < vertexXYZ.value[1]); Service pdg; // Histograms HistogramRegistry histos1{ "histos1", { + {"h3DVtxZetaPhi", "VtxZ vs #eta vs #phi;VtxZ;#eta;#phi", {HistType::kTH3F, {{20, -10, 10}, {16, -0.8, 0.8}, {100, 0., o2::constants::math::TwoPI}}}}, {"hRecoPtBefore", "Reco pT before cuts;pt (GeV/c);Counts", {HistType::kTH1F, {{1000, 0.0, 20.0}}}}, {"hGenPtBefore", "Gen pT before cuts;pt (GeV/c);Counts", {HistType::kTH1F, {{1000, 0.0, 20.0}}}}, {"hRecoPtAfter", "Reco pT after cuts;pt (GeV/c);Counts", {HistType::kTH1F, {{1000, 0.0, 20.0}}}}, @@ -104,6 +122,8 @@ struct FactorialMomentsTask { HistogramRegistry histos{ "histos", { + + {"mtpcsignalvspt", "tpcsignal vs #pt", {HistType::kTH2F, {{900, 0, 10}, {1400, 0, 1400}}}}, {"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}}}}, @@ -139,6 +159,10 @@ struct FactorialMomentsTask { }, OutputObjHandlingPolicy::AnalysisObject, true}; + const double dcaxyMaxTrackPar0 = 0.0105; + const double dcaxyMaxTrackPar1 = 0.035; + const double dcaxyMaxTrackPar2 = 1.1; + const double dcazMaxTrack = 2.0; static const int nBins = 52; double kMinCharge = 1e-6; static const int nfqOrder = 6; @@ -153,6 +177,7 @@ struct FactorialMomentsTask { std::array, 5>, 6> errorFq = {{{{{0, 0, 0, 0, 0}}}}}; std::vector> mHistArrReset; std::vector> mHistArrQA; + std::vector> mHistArrEff; std::vector> mFqBinFinal; std::vector> mBinConFinal; std::vector> mFqBinFinalSampled; @@ -171,14 +196,15 @@ struct FactorialMomentsTask { } } AxisSpec axisPt[5] = {{100, -0.01, 3 * ptCuts.value[1], ""}, {100, -0.01, 3 * ptCuts.value[3], ""}, {100, -0.01, 3 * ptCuts.value[5], ""}, {100, -0.01, 3 * ptCuts.value[7], ""}, {100, -0.01, 3 * ptCuts.value[9], ""}}; // pT axis - auto mEventSelected = std::get>(histos.add("mEventSelected", "eventSelected", HistType::kTH1D, {{8, 0.5, 8.5}})); - mEventSelected->GetXaxis()->SetBinLabel(1, "all"); - mEventSelected->GetXaxis()->SetBinLabel(2, "sel8"); - mEventSelected->GetXaxis()->SetBinLabel(3, "sameBunchPileup"); - mEventSelected->GetXaxis()->SetBinLabel(4, "goodZvtxFT0vsPV"); - mEventSelected->GetXaxis()->SetBinLabel(5, "vertexITSTPC"); - mEventSelected->GetXaxis()->SetBinLabel(6, "centrality"); - mEventSelected->GetXaxis()->SetBinLabel(7, "final"); + auto mEventSelected = std::get>(histos.add("mEventSelected", "eventSelected", HistType::kTH1D, {{7, 0.5, 8.5}})); + mEventSelected->GetXaxis()->SetBinLabel(0, "all"); + mEventSelected->GetXaxis()->SetBinLabel(1, "sel8"); + mEventSelected->GetXaxis()->SetBinLabel(2, "kNoITSROFrameBorder"); + mEventSelected->GetXaxis()->SetBinLabel(3, "kNoTimeFrameBorder"); + mEventSelected->GetXaxis()->SetBinLabel(4, "sameBunchPileup"); + mEventSelected->GetXaxis()->SetBinLabel(5, "kIsGoodITSLayersAll"); + mEventSelected->GetXaxis()->SetBinLabel(6, "kIsGoodZvtxFT0vsPV"); + mEventSelected->GetXaxis()->SetBinLabel(7, "FTOC"); auto mTrackSelected = std::get>(histos.add( "mTrackSelected", "Track Selection Steps", HistType::kTH1D, {{5, 0.5, 5.5}})); mTrackSelected->GetXaxis()->SetBinLabel(1, "all"); @@ -193,6 +219,7 @@ struct FactorialMomentsTask { binningM[iM] = 2 * (iM + 2); } for (int iPt = 0; iPt < numPt; ++iPt) { + mHistArrEff.push_back(std::get>(histos.add(Form("bin%i/m3DVtxZetaPhi", iPt + 1), Form("#eta #phi #vtxz for bin %.2f-%.2f;vz;#eta;#phi", ptCuts.value[2 * iPt], ptCuts.value[2 * iPt + 1]), HistType::kTH3F, {{20, -10, 10}, {16, -0.8, +0.8}, {100, 0., o2::constants::math::TwoPI}}))); mHistArrQA.push_back(std::get>(histos.add(Form("bin%i/mEta", iPt + 1), Form("#eta for bin %.2f-%.2f;#eta", ptCuts.value[2 * iPt], ptCuts.value[2 * iPt + 1]), HistType::kTH1F, {{1000, -2, 2}}))); mHistArrQA.push_back(std::get>(histos.add(Form("bin%i/mPt", iPt + 1), Form("pT for bin %.2f-%.2f;pT", ptCuts.value[2 * iPt], ptCuts.value[2 * iPt + 1]), HistType::kTH1F, {axisPt[iPt]}))); mHistArrQA.push_back(std::get>(histos.add(Form("bin%i/mPhi", iPt + 1), Form("#phi for bin %.2f-%.2f;#phi", ptCuts.value[2 * iPt], ptCuts.value[2 * iPt + 1]), HistType::kTH1F, {{1000, 0, o2::constants::math::TwoPI}}))); @@ -219,27 +246,39 @@ struct FactorialMomentsTask { } } } + + template + float getPhiWeight(const T& candidate, float vtxz) + { + int bin = hBin1->FindBin(vtxz, candidate.eta(), candidate.phi()); + float weight = hBin1->GetBinContent(bin); + if (!std::isfinite(weight) || weight <= 0) { + return 1.0; + } + return weight; + } + template void checkpT(const T& track) { - for (int iPt = 0; iPt < numPt; ++iPt) { + for (auto iPt = 0; iPt < numPt; ++iPt) { if (track.pt() > ptCuts.value[2 * iPt] && track.pt() < ptCuts.value[2 * iPt + 1]) { float iphi = track.phi(); iphi = gRandom->Gaus(iphi, o2::constants::math::TwoPI); - iphi = RecoDecay::constrainAngle(iphi); - + iphi = RecoDecay::constrainAngle(iphi, 0.); + double phiweight = 1.0; + phiweight = getPhiWeight(track, collisionZ); + mHistArrEff[iPt]->Fill(collisionZ, track.eta(), track.phi()); mHistArrQA[iPt * 4]->Fill(track.eta()); mHistArrQA[iPt * 4 + 1]->Fill(track.pt()); - mHistArrQA[iPt * 4 + 2]->Fill(track.phi()); + mHistArrQA[iPt * 4 + 2]->Fill(iphi, phiweight); countTracks[iPt]++; - - for (int iM = 0; iM < nBins; ++iM) { - mHistArrReset[iPt * nBins + iM]->Fill(track.eta(), track.phi()); + for (auto iM = 0; iM < nBins; ++iM) { + mHistArrReset[iPt * nBins + iM]->Fill(track.eta(), iphi); } } } } - void calculateMoments(std::vector> hist) { double binContent = 0; @@ -305,21 +344,36 @@ struct FactorialMomentsTask { void processRun3(soa::Filtered>::iterator const& coll, TracksFMs const& tracks) { // selection of events + histos.fill(HIST("mEventSelected"), 0); if (!coll.sel8()) { return; } + if (cfgEvSelkNoITSROFrameBorder && !(coll.selection_bit(o2::aod::evsel::kNoITSROFrameBorder))) { + return; + } + + histos.fill(HIST("mEventSelected"), 2); + if (cfgEvSelkNoTimeFrameBorder && !(coll.selection_bit(o2::aod::evsel::kNoTimeFrameBorder))) { + return; + } + histos.fill(HIST("mEventSelected"), 3); if (isApplySameBunchPileup && !coll.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { return; } - if (isApplyGoodZvtxFT0vsPV && !coll.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { + histos.fill(HIST("mEventSelected"), 4); + if (cfgUseGoodITSLayerAllCut && !(coll.selection_bit(o2::aod::evsel::kIsGoodITSLayersAll))) { return; } - if (isApplyVertexITSTPC && !coll.selection_bit(o2::aod::evsel::kIsVertexITSTPC)) { + histos.fill(HIST("mEventSelected"), 5); + if (isApplyGoodZvtxFT0vsPV && !coll.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { return; } + histos.fill(HIST("mEventSelected"), 6); if (coll.centFT0C() < centLimits.value[0] || coll.centFT0C() > centLimits.value[1]) { return; } + collisionZ = coll.posZ(); + histos.fill(HIST("mEventSelected"), 7); histos.fill(HIST("mVertexX"), coll.posX()); histos.fill(HIST("mVertexY"), coll.posY()); histos.fill(HIST("mVertexZ"), coll.posZ()); @@ -340,29 +394,31 @@ struct FactorialMomentsTask { continue; if (useGlobal && !track.isGlobalTrack()) continue; - histos.fill(HIST("mCollID"), track.collisionId()); - histos.fill(HIST("mEta"), track.eta()); - histos.fill(HIST("mPt"), track.pt()); - histos.fill(HIST("mPhi"), track.phi()); - histos.fill(HIST("mNFindableClsTPC"), track.tpcNClsFindable()); - histos.fill(HIST("mNClsTPC"), track.tpcNClsFound()); - histos.fill(HIST("mNClsITS"), track.itsNCls()); - histos.fill(HIST("mChi2TPC"), track.tpcChi2NCl()); - 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("mDCAxyPt"), track.pt(), track.dcaXY()); - histos.fill(HIST("mDCAzPt"), track.pt(), track.dcaZ()); - histos.fill(HIST("mNSharedClsTPC"), track.tpcNClsShared()); - histos.fill(HIST("mCrossedRowsTPC"), track.tpcNClsCrossedRows()); - histos.fill(HIST("mNFinClsminusCRows"), track.tpcNClsFindableMinusCrossedRows()); - histos.fill(HIST("mNFractionShClsTPC"), track.tpcFractionSharedCls()); - histos.fill(HIST("mSharedClsvsPt"), track.pt(), track.tpcNClsShared()); - histos.fill(HIST("mSharedClsProbvsPt"), track.pt(), track.tpcFractionSharedCls() / track.tpcNClsCrossedRows()); - checkpT(track); + if (std::fabs(track.dcaXY()) < (dcaxyMaxTrackPar0 + dcaxyMaxTrackPar1 / std::pow(track.pt(), dcaxyMaxTrackPar2))) { + histos.fill(HIST("mCollID"), track.collisionId()); + histos.fill(HIST("mEta"), track.eta()); + histos.fill(HIST("mPt"), track.pt()); + histos.fill(HIST("mPhi"), track.phi()); + histos.fill(HIST("mNFindableClsTPC"), track.tpcNClsFindable()); + histos.fill(HIST("mNClsTPC"), track.tpcNClsFound()); + histos.fill(HIST("mNClsITS"), track.itsNCls()); + histos.fill(HIST("mChi2TPC"), track.tpcChi2NCl()); + histos.fill(HIST("mChi2ITS"), track.itsChi2NCl()); + histos.fill(HIST("mChi2TRD"), track.trdChi2()); + histos.fill(HIST("mDCAxy"), track.dcaXY()); + histos.fill(HIST("mtpcsignalvspt"), track.pt(), track.tpcSignal()); + histos.fill(HIST("mDCAxyPt"), track.pt(), track.dcaXY()); + histos.fill(HIST("mDCAzPt"), track.pt(), track.dcaZ()); + histos.fill(HIST("mDCAzPt"), track.pt(), track.dcaZ()); + histos.fill(HIST("mNSharedClsTPC"), track.tpcNClsShared()); + histos.fill(HIST("mCrossedRowsTPC"), track.tpcNClsCrossedRows()); + histos.fill(HIST("mNFinClsminusCRows"), track.tpcNClsFindableMinusCrossedRows()); + histos.fill(HIST("mNFractionShClsTPC"), track.tpcFractionSharedCls()); + histos.fill(HIST("mSharedClsvsPt"), track.pt(), track.tpcNClsShared()); + histos.fill(HIST("mSharedClsProbvsPt"), track.pt(), track.tpcFractionSharedCls() / track.tpcNClsCrossedRows()); + checkpT(track); + } } - for (int iPt = 0; iPt < numPt; ++iPt) { if (countTracks[iPt] > 0) { mHistArrQA[iPt * 4 + 3]->Fill(countTracks[iPt]); @@ -398,6 +454,7 @@ struct FactorialMomentsTask { if (coll.centFT0C() < centLimits.value[0] || coll.centFT0C() > centLimits.value[1]) { return; } + histos.fill(HIST("mEventSelected"), 5); histos.fill(HIST("mVertexX"), coll.posX()); histos.fill(HIST("mVertexY"), coll.posY()); @@ -416,28 +473,30 @@ struct FactorialMomentsTask { continue; if (useGlobal && !track.isGlobalTrack()) continue; - histos.fill(HIST("mCollID"), track.collisionId()); - histos.fill(HIST("mEta"), track.eta()); - histos.fill(HIST("mPt"), track.pt()); - histos.fill(HIST("mPhi"), track.phi()); - histos.fill(HIST("mNFindableClsTPC"), track.tpcNClsFindable()); - histos.fill(HIST("mNClsTPC"), track.tpcNClsFound()); - histos.fill(HIST("mNClsITS"), track.itsNCls()); - histos.fill(HIST("mChi2TPC"), track.tpcChi2NCl()); - 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("mDCAxyPt"), track.pt(), track.dcaXY()); - histos.fill(HIST("mDCAzPt"), track.pt(), track.dcaZ()); - histos.fill(HIST("mNSharedClsTPC"), track.tpcNClsShared()); - histos.fill(HIST("mCrossedRowsTPC"), track.tpcNClsCrossedRows()); - histos.fill(HIST("mNFinClsminusCRows"), track.tpcNClsFindableMinusCrossedRows()); - histos.fill(HIST("mNFractionShClsTPC"), track.tpcFractionSharedCls()); - histos.fill(HIST("mSharedClsvsPt"), track.pt(), track.tpcNClsShared()); - histos.fill(HIST("mSharedClsProbvsPt"), track.pt(), track.tpcFractionSharedCls() / track.tpcNClsCrossedRows()); - if (applyCheckPtForRec && !applyCheckPtForMC) { - checkpT(track); + if (std::fabs(track.dcaXY()) < (dcaxyMaxTrackPar0 + dcaxyMaxTrackPar1 / std::pow(track.pt(), dcaxyMaxTrackPar2))) { + histos.fill(HIST("mCollID"), track.collisionId()); + histos.fill(HIST("mEta"), track.eta()); + histos.fill(HIST("mPt"), track.pt()); + histos.fill(HIST("mPhi"), track.phi()); + histos.fill(HIST("mNFindableClsTPC"), track.tpcNClsFindable()); + histos.fill(HIST("mNClsTPC"), track.tpcNClsFound()); + histos.fill(HIST("mNClsITS"), track.itsNCls()); + histos.fill(HIST("mChi2TPC"), track.tpcChi2NCl()); + 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("mDCAxyPt"), track.pt(), track.dcaXY()); + histos.fill(HIST("mDCAzPt"), track.pt(), track.dcaZ()); + histos.fill(HIST("mNSharedClsTPC"), track.tpcNClsShared()); + histos.fill(HIST("mCrossedRowsTPC"), track.tpcNClsCrossedRows()); + histos.fill(HIST("mNFinClsminusCRows"), track.tpcNClsFindableMinusCrossedRows()); + histos.fill(HIST("mNFractionShClsTPC"), track.tpcFractionSharedCls()); + histos.fill(HIST("mSharedClsvsPt"), track.pt(), track.tpcNClsShared()); + histos.fill(HIST("mSharedClsProbvsPt"), track.pt(), track.tpcFractionSharedCls() / track.tpcNClsCrossedRows()); + if (applyCheckPtForRec && !applyCheckPtForMC) { + checkpT(track); + } } } auto mcParts = mcParticles.sliceBy(perMcCollision, coll.mcCollision().globalIndex());