From abfc15b5a4d4dc222b3d82d63745ea6a24cd0716 Mon Sep 17 00:00:00 2001 From: sweta29singh Date: Wed, 8 Oct 2025 13:29:15 +0530 Subject: [PATCH 1/8] Mean pT Fluctuations --- .../EbyEFluctuations/Tasks/eventMeanPtId.cxx | 589 ++++++++++++------ 1 file changed, 387 insertions(+), 202 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx index 7ef12c2b69f..f36087eed7c 100644 --- a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx @@ -39,6 +39,7 @@ #include "Framework/runDataProcessing.h" #include +#include "TF1.h" #include #include @@ -56,33 +57,72 @@ using namespace o2::framework::expressions; using namespace std; using o2::constants::physics::Pdg; -namespace o2::aod -{ -using MyCollisions = soa::Join; -using MyTracks = soa::Join NAME{#NAME, DEFAULT, HELP}; + + O2_DEFINE_CONFIGURABLE(cfgEvSelMultCorrelation, bool, true, "Multiplicity correlation cut") + struct : ConfigurableGroup { + + O2_DEFINE_CONFIGURABLE(cfgMultPVFT0CCutEnabled, bool, true, "Enable PV multiplicity vs FT0C centrality cut") + O2_DEFINE_CONFIGURABLE(cfgMultGlobalFT0CCutEnabled, bool, true, "Enable globalTracks vs FT0C centrality cut") + O2_DEFINE_CONFIGURABLE(cfgMultGlobalPVCutEnabled, bool, true, "Enable globalTracks vs PV multiplicity cut") + + Configurable> cfgMultPVFT0CCutPars{"cfgMultPVFT0CCutPars", + std::vector{3303.11, -121.316, 1.90207, -0.0152644, 5.10121e-05, 190.633, -4.32972, 0.0340001, -5.83261e-05, -3.19566e-07}, + "PV multiplicity vs T0C centrality cut parameter values"}; + + Configurable> cfgMultGlobalFT0CCutPars{"cfgMultGlobalFT0CCutPars", + std::vector{1893.97, -61.3423, 0.790664, -0.00507208, 1.41683e-05, 167.997, -5.29125, 0.0840145, -0.000748102, 2.75743e-06}, + "globalTracks vs FT0C cut parameter values"}; + + Configurable> cfgMultGlobalPVCutPars{"cfgMultGlobalPVCutPars", + std::vector{65.0322, 0.557725, -0.772828, 0.059224, -1.96379e-05, 4.46295e-09}, + "globalTracks vs PV cut parameter values"}; + + std::vector multPVFT0CCutPars; + std::vector multGlobalFT0CPars; + std::vector multGlobalPVCutPars; + + TF1* fMultPVFT0CCutLow = nullptr; + TF1* fMultPVFT0CCutHigh = nullptr; + TF1* fMultGlobalFT0CCutLow = nullptr; + TF1* fMultGlobalFT0CCutHigh = nullptr; + TF1* fMultGlobalPVCutLow = nullptr; + TF1* fMultGlobalPVCutHigh = nullptr; + + } cfgFunCoeff; + + + Service ccdb; + Service pdg; + + Filter collisionFilter = nabs(aod::collision::posZ) <= cVtxZcut; + Filter trackFilter = (nabs(aod::track::eta) < cEtacut) && (aod::track::pt > ptMin) && (aod::track::pt < ptMax) && (requireGlobalTrackInFilter()); + +using MyCollisions = soa::Filtered>; +using MyCollision = MyCollisions::iterator; + +using MyTracks = soa::Filtered; + aod::pidTOFFullKa, aod::pidTOFFullPr, aod::pidTOFFullDe, aod::pidTOFbeta, aod::TOFSignal, aod::TracksExtra, aod::TracksIU, aod::TracksDCA, aod::TrackSelection>>; +using MyTrack = MyTracks::iterator; -using MyMCRecoCollisions = soa::Join; + +using MyMCRecoCollisions = soa::Filtered>; using MyMCRecoCollision = MyMCRecoCollisions::iterator; -using MyMCRecoTracks = soa::Join; + aod::pidTOFFullKa, aod::pidTOFFullPr, aod::pidTOFFullDe, aod::pidTOFbeta, aod::TOFSignal, aod::TracksExtra, aod::TracksIU, aod::TracksDCA, aod::TrackSelection, aod::McTrackLabels>>; using MyMCRecoTrack = MyMCRecoTracks::iterator; using EventCandidatesMC = soa::Join; -using MyCollision = MyCollisions::iterator; -using MyTrack = MyTracks::iterator; -} // namespace o2::aod -struct EventMeanPtId { - Service ccdb; - Service pdg; Configurable ccdbNoLaterThan{"ccdbNoLaterThan", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; Configurable cfgUrlCCDB{"cfgUrlCCDB", "http://alice-ccdb.cern.ch", "url of ccdb"}; @@ -97,6 +137,7 @@ struct EventMeanPtId { Configurable> ptBins{"ptBins", {0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50, 0.55, 0.60, 0.65, 0.70, 0.75, 0.80, 0.85, 0.90, 0.95, 1.00, 1.05, 1.10, 1.15, 1.20, 1.25, 1.30, 1.35, 1.40, 1.45, 1.50, 1.55, 1.60, 1.65, 1.70, 1.75, 1.80, 1.85, 1.90, 1.95, 2.00}, "p_{T} bins"}; Configurable piluprejection{"piluprejection", false, "Pileup rejection"}; + void init(o2::framework::InitContext&) { if (cfgLoadEff) { @@ -109,14 +150,14 @@ struct EventMeanPtId { TList* lst = ccdb->getForTimeStamp(cfgPathCCDB.value, -1); ptHistogramAllchargeRec = reinterpret_cast(lst->FindObject("hPtEta_rec")); - } + } std::vector ptBinning = {0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0}; // AxisSpec ptAxis = {ptBinning, "#it{p}_{T} (GeV/#it{c})"}; AxisSpec vtxZAxis = {100, -20.0, 20.0, "Z (cm)"}; AxisSpec dcaAxis = {1002, -5.01, 5.01, "DCA_{xy} (cm)"}; AxisSpec dcazAxis = {1002, -5.01, 5.01, "DCA_{z} (cm)"}; - AxisSpec ptAxis = {600, 0.0, 6.0, "#it{p}_{T} (GeV/#it{c})"}; + AxisSpec ptAxis = {600, 0.0, 6.0, "#it{p}_{T} (GeV/#it{c})"};// 600,0,6 AxisSpec pAxis = {400, 0.0, 4.0, "#it{p} (GeV/#it{c})"}; AxisSpec betaAxis = {200, 0.0, 2.0, "TOF_{#beta} (GeV/#it{c})"}; AxisSpec dEdxAxis = {2000, 0.0, 200.0, "dE/dx (GeV/#it{c})"}; @@ -126,12 +167,13 @@ struct EventMeanPtId { AxisSpec nSigmaTOFAxispid = {170, -8.5, 8.5, "n#sigma_{TOF}"}; AxisSpec centAxis = {100, 0., 100., "centrality"}; AxisSpec subAxis = {30, 0., 30., "sample"}; - // AxisSpec nchAxis = {4000, 0., 4000., "nch"}; + AxisSpec tnchAxis = {40, 0., 4000., "nch"}; AxisSpec nchAxis = {nchBins, nchMin, nchMax, "nch"}; AxisSpec varAxis1 = {400, 0., 4., "var1"}; AxisSpec varAxis2 = {400, 0., 4., "var2"}; - AxisSpec chi2Axis = {100, 0., 100., "Chi2"}; - AxisSpec crossedRowTpcAxis = {600, 0., 600., "TPC Crossed rows"}; + AxisSpec tpcchi2Axis = {700, 0., 7., "tpc Chi2"}; + AxisSpec itschi2Axis = {400, 0., 40., "its Chi2"}; + AxisSpec crossedRowTpcAxis = {1600, 0., 160., "TPC Crossed rows"}; AxisSpec counter = {10, 0., 10., "events"}; // QA Plots @@ -163,6 +205,7 @@ struct EventMeanPtId { histos.add("Data/hP", "hP", kTH1D, {pAxis}); histos.add("Data/hEta", ";hEta", kTH1D, {etaAxis}); histos.add("Data/hPt", ";#it{p}_{T} (GeV/#it{c})", kTH1D, {ptAxis}); + histos.add("Data/hPtvar", ";#it{p}_{T} (GeV/#it{c})", kTH1D, {ptAxis}); histos.add("Data/hNsigmaTPC", "hNsigmaTPC", kTH2D, {pAxis, nSigmaTPCAxis}); histos.add("Data/hDCAxy", "hDCAxy", kTH1D, {dcaAxis}); histos.add("Data/hDCAz", "hDCAz", kTH1D, {dcazAxis}); @@ -211,6 +254,9 @@ struct EventMeanPtId { histos.add("Data/hVar1x", "hVar1x", kTH2D, {subAxis, nchAxis}); histos.add("Data/hVar2x", "hVar2x", kTH2D, {subAxis, nchAxis}); histos.add("Data/hVarx", "hVarx", kTH2D, {subAxis, nchAxis}); + histos.add("Data/hdiffVar1x", "hdiffVar1x", kTH2D, {subAxis, nchAxis}); + histos.add("Data/hdiffVar2x", "hdiffVar2x", kTH2D, {subAxis, nchAxis}); + histos.add("Data/hdiffVarx", "hdiffVarx", kTH2D, {subAxis, nchAxis}); histos.add("Data/hVar2meanptx", "hVar2meanptx", kTH2D, {nchAxis, varAxis2}); histos.add("Data/hVar1pix", "hVar1pix", kTH2D, {subAxis, nchAxis}); histos.add("Data/hVar2pix", "hVar2pix", kTH2D, {subAxis, nchAxis}); @@ -236,17 +282,29 @@ struct EventMeanPtId { histos.add("Data/hdEdx_afterselection", "hdEdx_afterselection", kTH2D, {pAxis, dEdxAxis}); histos.add("Data/hTOFbeta_afterselection1", "hTOFbeta_afterselection1", kTH2D, {pAxis, betaAxis}); histos.add("Data/hdEdx_afterselection1", "hdEdx_afterselection1", kTH2D, {pAxis, dEdxAxis}); - histos.add("Data/hTPCchi2perCluster_before", "TPC #Chi^{2}/Cluster", kTH1D, {chi2Axis}); - histos.add("Data/hITSchi2perCluster_before", "ITS #Chi^{2}/Cluster", kTH1D, {chi2Axis}); + histos.add("Data/hTPCchi2perCluster_before", "TPC #Chi^{2}/Cluster", kTH1D, {tpcchi2Axis}); + histos.add("Data/hITSchi2perCluster_before", "ITS #Chi^{2}/Cluster", kTH1D, {itschi2Axis}); histos.add("Data/hTPCCrossedrows_before", "Crossed TPC rows", kTH1D, {crossedRowTpcAxis}); - histos.add("Data/hTPCchi2perCluster_after", "TPC #Chi^{2}/Cluster", kTH1D, {chi2Axis}); - histos.add("Data/hITSchi2perCluster_after", "ITS #Chi^{2}/Cluster", kTH1D, {chi2Axis}); + histos.add("Data/hTPCchi2perCluster_after", "TPC #Chi^{2}/Cluster", kTH1D, {tpcchi2Axis}); + histos.add("Data/hITSchi2perCluster_after", "ITS #Chi^{2}/Cluster", kTH1D, {itschi2Axis}); histos.add("Data/hTPCCrossedrows_after", "Crossed TPC rows", kTH1D, {crossedRowTpcAxis}); histos.add("Data/hcent_nacc", "hcent_nacc", kTH2D, {centAxis, nchAxis}); - + histos.add("Data/hcentFT0A_nacc", "hcentFT0A_nacc", kTH2D, {centAxis, nchAxis}); + histos.add("Data/hcentFT0M_nacc", "hcentFT0M_nacc", kTH2D, {centAxis, nchAxis}); + histos.add("Data/hcentFV0A_nacc", "hcentFV0A_nacc", kTH2D, {centAxis, nchAxis}); + histos.add("Data/hNchPV_NchGlobal_before", "hNchPV_NchGlobal_before", kTH2D, {nchAxis, nchAxis}); + histos.add("Data/hcentFT0C_GlobalNch_before", "hcentFT0C_GlobalNch_before", kTH2D, {centAxis, nchAxis}); + histos.add("Data/hcentFT0C_NchPV_before", "hcentFT0C_NchPV_before", kTH2D, {centAxis, nchAxis}); + histos.add("Data/hNchPV_NchGlobal_after", "hNchPV_NchGlobal_after", kTH2D, {nchAxis, nchAxis}); + histos.add("Data/hcentFT0C_GlobalNch_after", "hcentFT0C_GlobalNch_after", kTH2D, {centAxis, nchAxis}); + histos.add("Data/hcentFT0C_NchPV_after", "hcentFT0C_NchPV_after", kTH2D, {centAxis, nchAxis}); + histos.add("Data/hNchPV_NchGlobal_after3", "hNchPV_NchGlobal_after3", kTH2D, {nchAxis, nchAxis}); + histos.add("Data/hNchPV_NchGlobal_after4", "hNchPV_NchGlobal_after4", kTH2D, {nchAxis, nchAxis}); + histos.add("Data/hNchPV_NchGlobal_after5", "hNchPV_NchGlobal_after5", kTH2D, {nchAxis, nchAxis}); + histos.addClone("Data/", "Rec/"); // rec histograms - histos.add("hcent_nacc_corr", "hcent_nacc_corr", kTH2D, {centAxis, nchAxis}); + histos.add("hcent_nacc_corr", "hcent_nacc_corr", kTH2D, {centAxis, nchAxis}); histos.add("NSigamaTPCpion_rec", "NSigamaTPCpion_rec", kTH2D, {pAxis, nSigmaTPCAxispid}); histos.add("NSigamaTPCkaon_rec", "NSigamaTPCkaon_rec", kTH2D, {pAxis, nSigmaTPCAxispid}); histos.add("NSigamaTPCproton_rec", "NSigamaTPCproton_rec", kTH2D, {pAxis, nSigmaTPCAxispid}); @@ -297,17 +355,21 @@ struct EventMeanPtId { histos.add("ptHistogramKaon", "ptHistogramKaon", kTH1D, {ptAxis}); histos.add("ptHistogramProton", "ptHistogramProton", kTH1D, {ptAxis}); histos.add("hnch_gen_all", ";hnch_gen_all", kTH1D, {nchAxis}); - histos.add("hnch_gen_true", ";hnch_gen_true", kTH1D, {nchAxis}); - histos.add("hnch1", ";hnch1", kTH1D, {nchAxis}); - histos.add("hnch2", ";hnch2", kTH1D, {nchAxis}); - histos.add("hnch3", ";hnch3", kTH1D, {nchAxis}); + histos.add("hnch_gen_after_etacut", ";hnch_gen_after_etacut", kTH1D, {nchAxis}); + histos.add("hnch_afterPhysPrimary", ";hnch_afterPhysPrimary", kTH1D, {nchAxis}); histos.add("hnch_pi", ";hnch_pi", kTH1D, {nchAxis}); histos.add("hnch_ka", ";hnch_ka", kTH1D, {nchAxis}); histos.add("hnch_pr", ";hnch_pr", kTH1D, {nchAxis}); - + histos.add("hnch_gen", ";hnch_gen", kTH1D, {nchAxis}); + histos.add("hPtvar_gen", ";#it{p}_{T} (GeV/#it{c})", kTH1D, {ptAxis}); + histos.add("hVar1x_gen", "hVar1x_gen", kTH2D, {subAxis, nchAxis}); histos.add("hVar2x_gen", "hVar2x_gen", kTH2D, {subAxis, nchAxis}); histos.add("hVarx_gen", "hVarx_gen", kTH2D, {subAxis, nchAxis}); + histos.add("hdiffVar1x_gen", "hdiffVar1x_gen", kTH2D, {subAxis, nchAxis}); + histos.add("hdiffVar2x_gen", "hdiffVar2x_gen", kTH2D, {subAxis, nchAxis}); + histos.add("hdiffVarx_gen", "hdiffVarx_gen", kTH2D, {subAxis, nchAxis}); + histos.add("hVar2meanptx_gen", "hVar2meanptx_gen", kTH2D, {nchAxis, varAxis2}); histos.add("hVar1pix_gen", "hVar1pix_gen", kTH2D, {subAxis, nchAxis}); histos.add("hVar2pix_gen", "hVar2pix_gen", kTH2D, {subAxis, nchAxis}); @@ -341,7 +403,8 @@ struct EventMeanPtId { histos.add("hPty_pi_gen", "hPty_pi_gen", kTH2D, {ptAxis, etaAxis}); histos.add("hPty_ka_gen", "hPty_ka_gen", kTH2D, {ptAxis, etaAxis}); histos.add("hPty_pr_gen", "hPty_pr_gen", kTH2D, {ptAxis, etaAxis}); - histos.add("hNch_vs_corr", "hNch_vs_corr", kTH1D, {nchAxis}); + histos.add("hNch_vs_corr", "hNch_vs_corr", kTH2D, {subAxis, nchAxis}); + histos.add("hNch_vs_Nch", "hNch_vs_Nch", kTH2D, {subAxis, nchAxis}); histos.add("hVar1_gen", "hVar1_gen", kTH2D, {subAxis, centAxis}); histos.add("hVar2_gen", "hVar2_gen", kTH2D, {subAxis, centAxis}); histos.add("hVarc_gen", "hVarc_gen", kTH2D, {subAxis, centAxis}); @@ -361,15 +424,67 @@ struct EventMeanPtId { histos.add("hEffVar2x_data", "hEffVar2x_data", kTH2D, {subAxis, nchAxis}); histos.add("hEffVarx_data", "hEffVarx_data", kTH2D, {subAxis, nchAxis}); histos.add("hEffVar2Meanptx_data", "hEffVar2Meanptx_data", kTH2D, {nchAxis, varAxis2}); - } - - // Configurables - Configurable cVtxZcut{"cVtxZcut", 10.f, "Vertex Z"}; - Configurable cEtacut{"cEtacut", 0.8, "Eta cut"}; - Configurable cPtmincut{"cPtmincut", 0.2, "Pt min cut"}; - Configurable cPtmaxcut{"cPtmaxcut", 2.0, "Pt max cut"}; - Configurable cDcaXYcut{"cDcaXYcut", 0.12, "DCA XY cut"}; - Configurable cDcaZcut{"cDcaZcut", 2.0, "DCA Z cut"}; + histos.add("hterm1", "hterm1", kTProfile, {tnchAxis}); + histos.add("hterm2", "hterm2", kTProfile, {tnchAxis}); + histos.add("hterm1_gen", "hterm1_gen", kTProfile, {tnchAxis}); + histos.add("hterm2_gen", "hterm2_gen", kTProfile, {tnchAxis}); + histos.add("hCentrality_rec_before", "hCentrality_rec_before", kTH1D, {centAxis}); + histos.add("hEta1", ";hEta1", kTH1D, {etaAxis}); + + cfgFunCoeff.multPVFT0CCutPars = cfgFunCoeff.cfgMultPVFT0CCutPars; + cfgFunCoeff.multGlobalFT0CPars = cfgFunCoeff.cfgMultGlobalFT0CCutPars; + cfgFunCoeff.multGlobalPVCutPars = cfgFunCoeff.cfgMultGlobalPVCutPars; + + Configurable cSigmaLowHighcut{"cSigmaLowHighcut", 3.0f, "lower and upper sigma cut"}; + + + cfgFunCoeff.fMultPVFT0CCutLow = + new TF1("fMultPVFT0CCutLow", + "[0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x - 3.0*([5]+[6]*x+[7]*x*x+[8]*x*x*x+[9]*x*x*x*x)", + 0, 100); + cfgFunCoeff.fMultPVFT0CCutLow->SetParameters(&(cfgFunCoeff.multPVFT0CCutPars[0])); + + cfgFunCoeff.fMultPVFT0CCutHigh = + new TF1("fMultPVFT0CCutHigh", + "[0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x + 3.0*([5]+[6]*x+[7]*x*x+[8]*x*x*x+[9]*x*x*x*x)", + 0, 100); + cfgFunCoeff.fMultPVFT0CCutHigh->SetParameters(&(cfgFunCoeff.multPVFT0CCutPars[0])); + + cfgFunCoeff.fMultGlobalFT0CCutLow = + new TF1("fMultGlobalFT0CCutLow", + "[0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x - 3.0*([5]+[6]*x+[7]*x*x+[8]*x*x*x+[9]*x*x*x*x)", + 0, 100); + cfgFunCoeff.fMultGlobalFT0CCutLow->SetParameters(&(cfgFunCoeff.multGlobalFT0CPars[0])); + + cfgFunCoeff.fMultGlobalFT0CCutHigh = + new TF1("fMultGlobalFT0CCutHigh", + "[0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x + 3.0*([5]+[6]*x+[7]*x*x+[8]*x*x*x+[9]*x*x*x*x)", + 0, 100); + cfgFunCoeff.fMultGlobalFT0CCutHigh->SetParameters(&(cfgFunCoeff.multGlobalFT0CPars[0])); + + cfgFunCoeff.fMultGlobalPVCutLow = + new TF1("fMultGlobalPVCutLow", + "[0] + [1]*x - 3.0*([2] + [3]*x + [4]*x*x + [5]*x*x*x)", + 0, 100); + cfgFunCoeff.fMultGlobalPVCutLow->SetParameters(&(cfgFunCoeff.multGlobalPVCutPars[0])); + + cfgFunCoeff.fMultGlobalPVCutHigh = + new TF1("fMultGlobalPVCutHigh", + "[0] + [1]*x + 3.0*([2] + [3]*x + [4]*x*x + [5]*x*x*x)", + 0, 100); + cfgFunCoeff.fMultGlobalPVCutHigh->SetParameters(&(cfgFunCoeff.multGlobalPVCutPars[0])); + + } + + // Configurables + Configurable cVtxZcut{"cVtxZcut", 10.0f, "Vertex Z"}; + Configurable cEtacut{"cEtacut", 0.8f, "Eta cut"}; + Configurable cPtmincut{"cPtmincut", 0.15f, "Pt min cut"}; + Configurable cPtmaxcut{"cPtmaxcut", 2.0f, "Pt max cut"}; + Configurable cPtmincut1{"cPtmincut1", 0.15f, " Pt min cut"}; + Configurable cPtmaxcut1{"cPtmaxcut1", 2.0f, " Pt max cut"}; + Configurable cDcaXYcut{"cDcaXYcut", 0.3f, "DCA XY cut"}; + Configurable cDcaZcut{"cDcaZcut", 2.0f, "DCA Z cut"}; Configurable cCentmincut{"cCentmincut", 0.0, "Min cent cut"}; Configurable cCentmaxcut{"cCentmaxcut", 90.0, "Max cent cut"}; Configurable cTPCcrosscut{"cTPCcrosscut", 70, "TPC crossrows cut"}; @@ -393,11 +508,18 @@ struct EventMeanPtId { Configurable cdata{"cdata", false, "Enable histogram filling for processData"}; Configurable citsNCluster{"citsNCluster", false, "Enable Number of ITS clusters"}; Configurable ctpcNClusterFound{"ctpcNClusterFound", false, "Enable Number of TPC clusters"}; + Configurable cPVContributor{"cPVContributor", false, "Enable Primary Vertex Contributor"}; + Configurable cDCAxy{"cDCAxy", true, "DCAxy cut"}; + Configurable cDCAz{"cDCAz", true, "DCAz cut"}; + Configurable cTPCcr{"cTPCcr", true, "tpc crossed rows"}; + Configurable cITSchi{"cITSchi", true, "ITS chi2"}; + Configurable cTPCchi{"cTPCchi", true, "TPC chi2"}; + Configurable ccentFT0C{"ccentFT0C", true, "Use FT0C centraity"}; // PID selection configurables - Configurable cPionPmincut{"cPionPmincut", 0.2, "pion min cut of pion"}; - Configurable cKaonPmincut{"cKaonPmincut", 0.2, "kaon min cut of kaon"}; - Configurable cProtonPmincut{"cProtonPmincut", 0.2, "proton min cut of proton"}; + Configurable cPionPmincut{"cPionPmincut", 0.15, "pion min cut of pion"}; + Configurable cKaonPmincut{"cKaonPmincut", 0.15, "kaon min cut of kaon"}; + Configurable cProtonPmincut{"cProtonPmincut", 0.15, "proton min cut of proton"}; Configurable cPionPmaxcut{"cPionPmaxcut", 2.0, "pion min cut of pion"}; Configurable cKaonPmaxcut{"cKaonPmaxcut", 2.0, "kaon min cut of kaon"}; Configurable cProtonPmaxcut{"cProtonPmaxcut", 2.0, "proton min cut of proton"}; @@ -414,16 +536,50 @@ struct EventMeanPtId { Configurable nchMin{"nchMin", 0.0, "Minimum value for nch axis"}; Configurable nchMax{"nchMax", 4000.0, "Maximum value for nch axis"}; +bool eventSelected(const float& globalNch, const float& pvTrack, const float& centrality) + { + if (cfgFunCoeff.cfgMultPVFT0CCutEnabled) { + + if (pvTrack < cfgFunCoeff.fMultPVFT0CCutLow->Eval(centrality)) + return false; + if (pvTrack > cfgFunCoeff.fMultPVFT0CCutHigh->Eval(centrality)) + return false; + } + + if (cfgFunCoeff.cfgMultGlobalFT0CCutEnabled) { + + if (globalNch < cfgFunCoeff.fMultGlobalFT0CCutLow->Eval(centrality)) + return false; + if (globalNch > cfgFunCoeff.fMultGlobalFT0CCutHigh->Eval(centrality)) + return false; + } + + if (cfgFunCoeff.cfgMultGlobalPVCutEnabled) { + + if (globalNch < cfgFunCoeff.fMultGlobalPVCutLow->Eval(pvTrack)) + return false; + if (globalNch > cfgFunCoeff.fMultGlobalPVCutHigh->Eval(pvTrack)) + return false; + } + + return true; + } + template - bool selCollision(C const& coll) + bool selCollision(C const& coll, float& cent) { - if (std::abs(coll.posZ()) > cVtxZcut) { + if (std::abs(coll.posZ()) >= cVtxZcut) { return false; } // Reject the collisions with large vertex-z histos.fill(HIST("hEventcounter"), 2.); - // cent = coll.centFT0M(); //centrality for run3 + if(ccentFT0C) { + cent = coll.centFT0C(); //centrality from FT0C + } else { + cent = coll.centFT0M(); //centrality from FT0M + } + if (cSel8Trig && !coll.sel8()) { return false; } // require min bias trigger @@ -451,8 +607,8 @@ struct EventMeanPtId { return false; } histos.fill(HIST("trackSelRec"), 7); - - // if (cItslayerall && !coll.selection_bit(aod::evsel::kIsGoodITSLayersAll)) {return false;} + + // if (cItslayerall && !coll.selection_bit(aod::evsel::kIsGoodITSLayersAll)) {return false;} histos.fill(HIST("trackSelRec"), 8); if (cvtxtofmatched && !coll.selection_bit(aod::evsel::kIsVertexTOFmatched)) { @@ -471,57 +627,41 @@ struct EventMeanPtId { } // accept only global tracks histos.fill(HIST("tracksel"), 2); - // if (std::fabs(track.dcaXY()) > cDcaXYcut) {return false;} + if (cDCAxy && std::fabs(track.dcaXY()) > cDcaXYcut) {return false;} histos.fill(HIST("tracksel"), 3); - if (std::fabs(track.dcaZ()) > cDcaZcut) { - return false; - } + if (cDCAz && std::fabs(track.dcaZ()) > cDcaZcut) {return false;} histos.fill(HIST("tracksel"), 4); if (std::fabs(track.eta()) >= cEtacut) { return false; } histos.fill(HIST("tracksel"), 5); - - if (track.pt() < cPtmincut) { - return false; - } - if (track.pt() > cPtmaxcut) { - return false; - } + + if (cTPCcr && track.tpcNClsCrossedRows() < cTPCcrosscut) {return false;} histos.fill(HIST("tracksel"), 6); - if (track.tpcNClsCrossedRows() < cTPCcrosscut) { - return false; - } + if (cITSchi && track.itsChi2NCl() >= cItsChiCut) {return false;} histos.fill(HIST("tracksel"), 7); - if (track.itsChi2NCl() > cItsChiCut) { - return false; - } + if (cTPCchi && track.tpcChi2NCl() >= cTpcChiCut) {return false;} histos.fill(HIST("tracksel"), 8); - if (track.tpcChi2NCl() > cTpcChiCut) { - return false; - } - histos.fill(HIST("tracksel"), 9); + if (track.sign() == 0) {return false;} - if (track.sign() == 0) - return false; + if(cPVContributor) + { if (!(track.isPVContributor())) {return false;} + histos.fill(HIST("tracksel"), 9); + } if (citsNCluster) { - if (track.itsNCls() < cnITSClustersCut) { - return false; - } - histos.fill(HIST("tracksel"), 10); + if (track.itsNCls() < cnITSClustersCut) { return false; } + histos.fill(HIST("tracksel"), 10); } - if (ctpcNClusterFound) { - if (track.tpcNClsFound() < ctpcNClsCut) { - return false; - } - histos.fill(HIST("tracksel"), 11); + if(ctpcNClusterFound) { + if (track.tpcNClsFound() < ctpcNClsCut) {return false;} + histos.fill(HIST("tracksel"), 11); } return true; // if all checks pass, accept the collision @@ -617,43 +757,60 @@ struct EventMeanPtId { return false; } - double getEfficiency(double pt, double eta, TH2D* ptHistogramAllchargeRec) + double getEfficiency(double pt, double eta, TH2D* ptHistogramAllchargeRec) { - int xbin = ptHistogramAllchargeRec->GetXaxis()->FindBin(pt); - int ybin = ptHistogramAllchargeRec->GetYaxis()->FindBin(eta); + int xbin = ptHistogramAllchargeRec->GetXaxis()->FindBin(pt); + int ybin = ptHistogramAllchargeRec->GetYaxis()->FindBin(eta); - if (xbin < 1 || xbin > ptHistogramAllchargeRec->GetNbinsX() || ybin < 1 || ybin > ptHistogramAllchargeRec->GetNbinsY()) { + if(xbin < 1 || xbin > ptHistogramAllchargeRec->GetNbinsX() || ybin < 1 || ybin > ptHistogramAllchargeRec->GetNbinsY()) { LOGF(warn, "pt or eta out of histograms bounds : %f, eta = %f", pt, eta); return 1e-6; - } - double eff = ptHistogramAllchargeRec->GetBinContent(xbin, ybin); - return (eff > 0) ? eff : 1e-6; // Avoid division by zero + } + double eff = ptHistogramAllchargeRec->GetBinContent(xbin, ybin); + return (eff > 0) ? eff : 1e-6; // Avoid division by zero } - //++++++++++++++++++++++++++++++++++++DATA CALCULATION +++++++++++++++++++++++++++++++++++++++++++++++++++++// - void processData(aod::MyCollision const& coll, aod::MyTracks const& inputTracks) - { + //++++++++++++++++++++++++++++++++++++DATA CALCULATION +++++++++++++++++++++++++++++++++++++++++++++++++++++// + void processData(MyCollision const& coll, MyTracks const& inputTracks) + + { float cent = -1; histos.fill(HIST("hEventcounter"), 1.); histos.fill(HIST("Data/hZvtx_before_sel"), coll.posZ()); - if (!selCollision(coll)) + if (!selCollision(coll,cent)) return; { histos.fill(HIST("Data/hZvtx_after_sel8"), coll.posZ()); - } + } - const auto cent = coll.centFT0C(); histos.fill(HIST("Data/hCentrality"), cent); - double nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0., nch = 0., nchPi = 0., nchKa = 0., nchPr = 0.; + float globalNch = inputTracks.size(); + float pvTrack = coll.multNTracksPV(); + + histos.fill(HIST("Data/hNchPV_NchGlobal_before"), pvTrack, globalNch); + histos.fill(HIST("Data/hcentFT0C_GlobalNch_before"),coll.centFT0C(), globalNch); + histos.fill(HIST("Data/hcentFT0C_NchPV_before"), coll.centFT0C(), pvTrack); + + + if (cfgEvSelMultCorrelation && !eventSelected(globalNch, pvTrack, cent)) { + return; + } + + histos.fill(HIST("Data/hNchPV_NchGlobal_after"), pvTrack, globalNch); + histos.fill(HIST("Data/hcentFT0C_GlobalNch_after"),coll.centFT0C(), globalNch); + histos.fill(HIST("Data/hcentFT0C_NchPV_after"), coll.centFT0C(), pvTrack); + + double nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0., nch = 0., nchPi = 0., nchKa = 0., nchPr = 0.; double q1 = 0., q2 = 0., var1 = 0., var2 = 0.; double sumPtWeight = 0., sumWeight = 0., sumPtPtWeight = 0., var1Eff = 0., var2Eff = 0.; double q1Pi = 0., q2Pi = 0., var1Pi = 0., var2Pi = 0.; - double q1Ka = 0., q2Ka = 0., var1Ka = 0., var2Ka = 0.; + double q1Ka = 0., q2Ka = 0., var1Ka = 0., var2Ka = 0.; double q1Pr = 0., q2Pr = 0., var1Pr = 0., var2Pr = 0.; int sample = histos.get(HIST("Data/hZvtx_after_sel8"))->GetEntries(); - sample = sample % 30; // subsample error estimation + sample = sample % 30; + for (const auto& track : inputTracks) { nchAllBfCut += 1.; histos.fill(HIST("Data/hnchAll_bf_cut"), nchAllBfCut); @@ -662,7 +819,7 @@ struct EventMeanPtId { histos.fill(HIST("Data/hTPCchi2perCluster_before"), track.tpcChi2NCl()); histos.fill(HIST("Data/hITSchi2perCluster_before"), track.itsChi2NCl()); histos.fill(HIST("Data/hTPCCrossedrows_before"), track.tpcNClsCrossedRows()); - + if (std::fabs(track.eta()) <= cEtacut) { nchEta++; histos.fill(HIST("Data/hnchTrue"), nchEta); @@ -671,11 +828,16 @@ struct EventMeanPtId { nchPt += 1.; histos.fill(HIST("Data/hnchTrue_pt"), nchPt); } - if (track.sign() == 0) - continue; - if (!selTrack(track)) - continue; - + if (!selTrack(track)) continue; + + if (track.pt() >= cPtmincut1 && track.pt() <= cPtmaxcut1) + { nch += 1.; + histos.fill(HIST("Data/hnch"), nch); + histos.fill(HIST("Data/hPtvar"), track.pt()); + } + + if (track.pt() < cPtmincut || track.pt() > cPtmaxcut) continue; + nchAll += 1.; q1 += track.pt(); q2 += (track.pt() * track.pt()); @@ -695,19 +857,13 @@ struct EventMeanPtId { histos.fill(HIST("Data/hPEta"), track.p(), track.eta()); histos.fill(HIST("Data/hNsigmaTPC"), track.p(), track.tpcNSigmaPr()); - double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); + double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); if (eff < threshold) - continue; - double weight = 1. / eff; + continue; + double weight = 1./eff; sumPtWeight += track.pt() / eff; sumPtPtWeight += (track.pt() * track.pt()) / (eff * eff); - sumWeight += weight; - - if (track.pt() >= cPtmincut || track.pt() <= cPtmaxcut) // do not change this (it is for different pt work) - { - nch += 1.; - histos.fill(HIST("Data/hnch"), nch); - } + sumWeight += weight; // only TPC tracks: Pion, Kaon, Proton if (track.hasTPC() && std::abs(track.tpcNSigmaPi()) < cNSigCut3) @@ -791,19 +947,22 @@ struct EventMeanPtId { histos.fill(HIST("Data/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Data/hTOFbeta_afterselection1"), track.p(), track.beta()); } - + } // Track loop ends! + histos.fill(HIST("Data/hcentFV0A_nacc"), coll.multFV0A(), nchAll); + histos.fill(HIST("Data/hcentFT0A_nacc"), coll.multFT0A(), nchAll); + histos.fill(HIST("Data/hcentFT0M_nacc"), coll.centFT0M(), nchAll); histos.fill(HIST("Data/hcent_nacc"), cent, nchAll); - if (nchAll < cTwoPtlCut2) + if (nchAll < cTwoPtlCut2) return; var1 = (q1 * q1 - q2) / (nchAll * (nchAll - 1)); var2 = (q1 / nchAll); - - //------------------ Efficiency corrected histograms --------------- + + //------------------ Efficiency corrected histograms --------------- var1Eff = (sumPtWeight * sumPtWeight - sumPtPtWeight) / (sumWeight * (sumWeight - 1)); var2Eff = (sumPtWeight / sumWeight); - + //---------------------- pions ---------------------------------------- if (nchPi >= cTwoPtlCut2) { var1Pi = (q1Pi * q1Pi - q2Pi) / (nchPi * (nchPi - 1)); @@ -819,8 +978,8 @@ struct EventMeanPtId { var1Pr = (q1Pr * q1Pr - q2Pr) / (nchPr * (nchPr - 1)); var2Pr = (q1Pr / nchPr); } - - //------------------ all charges------------------------------------- + + //------------------ all charges------------------------------------- histos.fill(HIST("Data/hVar1"), sample, cent, var1); histos.fill(HIST("Data/hVar2"), sample, cent, var2); histos.fill(HIST("Data/hVarc"), sample, cent); @@ -840,7 +999,10 @@ struct EventMeanPtId { histos.fill(HIST("Data/hVar2x"), sample, nchAll, var2); histos.fill(HIST("Data/hVarx"), sample, nchAll); histos.fill(HIST("Data/hVar2meanptx"), nchAll, var2); - + histos.fill(HIST("Data/hdiffVar1x"), sample, nch, var1); + histos.fill(HIST("Data/hdiffVar2x"), sample, nch, var2); + histos.fill(HIST("Data/hdiffVarx"), sample, nch); + histos.fill(HIST("hEffVar1x_data"), sample, nchAll, var1Eff); histos.fill(HIST("hEffVar2x_data"), sample, nchAll, var2Eff); histos.fill(HIST("hEffVarx_data"), sample, nchAll); @@ -871,27 +1033,39 @@ struct EventMeanPtId { histos.fill(HIST("Data/hVar2meanptpx"), nchAll, var2Pr); } // event loop ends! - PROCESS_SWITCH(EventMeanPtId, processData, "process real data information", false); - + PROCESS_SWITCH(EventMeanPtId, processData, "process real data information", true); + //++++++++++++++++++++++++++++++++++++MC Reconstructed +++++++++++++++++++++++++++++++++++++++++++++++++++++// - - SliceCache cache; - Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; - void processMcReco(aod::MyMCRecoCollision const& coll, aod::MyMCRecoTracks const& inputTracks, aod::McCollisions const& mcCollisions, aod::McParticles const& mcParticles) - { + SliceCache cache; + Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; + void processMcReco(MyMCRecoCollision const& coll, MyMCRecoTracks const& inputTracks, aod::McCollisions const& mcCollisions, aod::McParticles const& mcParticles) + { float cent = -1; (void)mcCollisions; - if (!coll.has_mcCollision()) { - return; - } + if (!coll.has_mcCollision()) {return;} + histos.fill(HIST("Rec/hZvtx_before_sel"), coll.posZ()); histos.fill(HIST("hVtxZ_before_gen"), coll.mcCollision().posZ()); + histos.fill(HIST("hCentrality_rec_before"), cent); - if (!selCollision(coll)) // add - return; + if (!selCollision(coll,cent)) return; - float cent = coll.centFT0C(); histos.fill(HIST("Rec/hZvtx_after_sel8"), coll.posZ()); - histos.fill(HIST("Rec/hCentrality"), cent); + histos.fill(HIST("Rec/hCentrality"), cent); + + float globalNch = inputTracks.size(); + float pvTrack = coll.multNTracksPV(); + + histos.fill(HIST("Rec/hNchPV_NchGlobal_before"), pvTrack, globalNch); + histos.fill(HIST("Rec/hcentFT0C_GlobalNch_before"),coll.centFT0C(), globalNch); + histos.fill(HIST("Rec/hcentFT0C_NchPV_before"), coll.centFT0C(), pvTrack); + + if (cfgEvSelMultCorrelation && !eventSelected(globalNch, pvTrack, cent)) { + return; + } + + histos.fill(HIST("Rec/hNchPV_NchGlobal_after"), pvTrack, globalNch); + histos.fill(HIST("Rec/hcentFT0C_GlobalNch_after"),coll.centFT0C(), globalNch); + histos.fill(HIST("Rec/hcentFT0C_NchPV_after"), coll.centFT0C(), pvTrack); double nch = 0., nchPi = 0., nchKa = 0., nchPr = 0., nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0.; double q1 = 0., q2 = 0.; @@ -899,7 +1073,7 @@ struct EventMeanPtId { double var1 = 0., var2 = 0.; double var1Pi = 0., var2Pi = 0., var1Ka = 0., var2Ka = 0., var1Pr = 0., var2Pr = 0.; double sumPtWeight = 0., sumWeight = 0., sumPtPtWeight = 0., var1Eff = 0., var2Eff = 0.; - + int sample = histos.get(HIST("Rec/hZvtx_after_sel8"))->GetEntries(); sample = sample % 30; @@ -910,33 +1084,43 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hITSchi2perCluster_before"), track.itsChi2NCl()); histos.fill(HIST("Rec/hTPCCrossedrows_before"), track.tpcNClsCrossedRows()); - if (std::fabs(track.eta()) <= cEtacut) { - nchEta++; + if (std::fabs(track.eta()) <= cEtacut) + { nchEta++; histos.fill(HIST("Rec/hnchTrue"), nchEta); } - if (track.pt() >= cPtmincut && track.pt() <= cPtmaxcut) { - nchPt += 1.; + if (track.pt() >= cPtmincut && track.pt() <= cPtmaxcut) + { nchPt += 1.; histos.fill(HIST("Rec/hnchTrue_pt"), nchPt); } - if (!selTrack(track)) - continue; - // if (std::fabs(track.y()) > 0.5) continue; + + if (!selTrack(track)) continue; + + if (track.pt() >= cPtmincut1 && track.pt() <= cPtmaxcut1) + { nch += 1.; + histos.fill(HIST("Rec/hnch"), nch); + histos.fill(HIST("Rec/hPtvar"), track.pt()); + } + if (track.pt() < cPtmincut || track.pt() > cPtmaxcut) continue; + + // if (std::fabs(track.y()) > 0.5) continue; histos.fill(HIST("hPt_rec"), track.pt()); histos.fill(HIST("hEta_rec"), track.eta()); double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); - if (eff < threshold) - continue; + if (eff < threshold) continue; double weight = 1.0 / eff; sumPtWeight += track.pt() * weight; sumPtPtWeight += (track.pt() * track.pt() * weight * weight); sumWeight += weight; - - histos.fill(HIST("hPt_rec_corr"), track.pt(), weight); - histos.fill(HIST("hEta_rec_corr"), track.eta(), weight); + + histos.fill(HIST("hPt_rec_corr"), track.pt() , weight); + histos.fill(HIST("hEta_rec_corr"), track.eta() , weight); auto mcParticle = track.mcParticle(); nchAll += 1.; + q1 += track.pt(); + q2 += (track.pt() * track.pt()); + histos.fill(HIST("Rec/hnchAll"), nchAll); histos.fill(HIST("ptHistogramAllchargeRec"), track.pt()); histos.fill(HIST("Rec/hDCAxy"), track.dcaXY()); @@ -953,15 +1137,7 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hPEta"), track.p(), track.eta()); histos.fill(HIST("Rec/hNsigmaTPC"), track.p(), track.tpcNSigmaPr()); histos.fill(HIST("hPtEta_rec"), track.pt(), track.eta()); - - if (track.pt() >= cPtmincut || track.pt() <= cPtmaxcut) // do not change this (it is for different pt work) - { - nch += 1.; - histos.fill(HIST("Rec/hnch"), nch); - } - q1 += track.pt(); - q2 += (track.pt() * track.pt()); - + if (std::abs(mcParticle.pdgCode()) == PDG_t::kPiPlus) histos.fill(HIST("ptHistogramPionrec_pdg"), track.pt()); if (std::abs(mcParticle.pdgCode()) == PDG_t::kKPlus) @@ -1003,12 +1179,10 @@ struct EventMeanPtId { } if (selPion(track)) { - if (std::fabs(track.y()) > cRapidityCut05) - continue; - if (track.beta() > 1) - continue; + if (std::fabs(track.y()) > cRapidityCut05) continue; + if (track.beta() > 1) continue; histos.fill(HIST("ptHistogramPionrec"), track.pt()); - histos.fill(HIST("hPtEta_pi_rec"), track.pt(), track.eta()); + histos.fill(HIST("hPtEta_pi_rec"), track.pt(), track.eta()); histos.fill(HIST("Rec/hPtPion"), track.pt()); histos.fill(HIST("Rec/hEtaPion"), track.eta()); histos.fill(HIST("Rec/hyPion"), track.rapidity(massPi)); @@ -1019,14 +1193,14 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Rec/hTOFbeta_afterselection1"), track.p(), track.beta()); if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kPiPlus) { - histos.fill(HIST("ptHistogramPionrec_purity"), track.pt()); + histos.fill(HIST("ptHistogramPionrec_purity"), track.pt()); } nchPi += 1.; q1Pi += track.pt(); q2Pi += (track.pt() * track.pt()); - histos.fill(HIST("hPyPion_rec"), track.p(), track.rapidity(massPi)); - histos.fill(HIST("hPtyPion_rec"), track.pt(), track.rapidity(massPi)); + histos.fill(HIST("hPyPion_rec"), track.p(), track.rapidity(massPi)); + histos.fill(HIST("hPtyPion_rec"), track.pt(), track.rapidity(massPi)); } //===========================kaon=============================================================== @@ -1038,12 +1212,10 @@ struct EventMeanPtId { } if (selKaon(track)) { - if (std::fabs(track.y()) > cRapidityCut05) - continue; - if (track.beta() > 1) - continue; + if (std::fabs(track.y()) > cRapidityCut05) continue; + if (track.beta() > 1) continue; histos.fill(HIST("ptHistogramKaonrec"), track.pt()); - histos.fill(HIST("hPtEta_ka_rec"), track.pt(), track.eta()); + histos.fill(HIST("hPtEta_ka_rec"), track.pt(), track.eta()); histos.fill(HIST("Rec/hPtKaon"), track.pt()); histos.fill(HIST("Rec/hEtaKaon"), track.eta()); histos.fill(HIST("Rec/hyKaon"), track.rapidity(massKa)); @@ -1054,7 +1226,7 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Rec/hTOFbeta_afterselection1"), track.p(), track.beta()); if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kKPlus) { - histos.fill(HIST("ptHistogramKaonrec_purity"), track.pt()); + histos.fill(HIST("ptHistogramKaonrec_purity"), track.pt()); } nchKa += 1.; q1Ka += track.pt(); @@ -1073,12 +1245,10 @@ struct EventMeanPtId { } if (selProton(track)) { - if (std::fabs(track.y()) > cRapidityCut05) - continue; - if (track.beta() > 1) - continue; + if (std::fabs(track.y()) > cRapidityCut05) continue; + if (track.beta() > 1) continue; histos.fill(HIST("ptHistogramProtonrec"), track.pt()); - histos.fill(HIST("hPtEta_pr_rec"), track.pt(), track.eta()); + histos.fill(HIST("hPtEta_pr_rec"), track.pt(), track.eta()); histos.fill(HIST("Rec/hPtProton"), track.pt()); histos.fill(HIST("Rec/hEtaProton"), track.eta()); histos.fill(HIST("Rec/hyProton"), track.rapidity(massPr)); @@ -1089,7 +1259,7 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Rec/hTOFbeta_afterselection1"), track.p(), track.beta()); if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kProton) { - histos.fill(HIST("ptHistogramProtonrec_purity"), track.pt()); + histos.fill(HIST("ptHistogramProtonrec_purity"), track.pt()); } nchPr += 1.; q1Pr += track.pt(); @@ -1102,7 +1272,8 @@ struct EventMeanPtId { } // loop over tracks histos.fill(HIST("Rec/hcent_nacc"), cent, nchAll); histos.fill(HIST("hcent_nacc_corr"), cent, sumWeight); - histos.fill(HIST("hNch_vs_corr"), nchAll, sumWeight); + histos.fill(HIST("hNch_vs_corr"), sample, nchAll, sumWeight); + histos.fill(HIST("hNch_vs_Nch"), sample, nchAll, nchAll); if (nchAll < cTwoPtlCut2) return; @@ -1110,6 +1281,8 @@ struct EventMeanPtId { var2 = (q1 / nchAll); //------------------ Efficiency corrected histograms --------------- + histos.fill(HIST("hterm1"), nchAll, var1); + histos.fill(HIST("hterm2"), nchAll, var2); var1Eff = (sumPtWeight * sumPtWeight - sumPtPtWeight) / (sumWeight * (sumWeight - 1)); var2Eff = (sumPtWeight / sumWeight); @@ -1118,7 +1291,7 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hVar2"), sample, cent, var2); histos.fill(HIST("Rec/hVarc"), sample, cent); histos.fill(HIST("Rec/hVar2meanpt"), cent, var2); - + //---------------------- pions ---------------------------------------- if (nchPi >= cTwoPtlCut2) { var1Pi = (q1Pi * q1Pi - q2Pi) / (nchPi * (nchPi - 1)); @@ -1128,7 +1301,8 @@ struct EventMeanPtId { if (nchKa >= cTwoPtlCut2) { var1Ka = (q1Ka * q1Ka - q2Ka) / (nchKa * (nchKa - 1)); var2Ka = (q1Ka / nchKa); - } + + } //---------------------------- protons ---------------------------------- if (nchPr >= cTwoPtlCut2) { var1Pr = (q1Pr * q1Pr - q2Pr) / (nchPr * (nchPr - 1)); @@ -1150,6 +1324,10 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hVar1x"), sample, nchAll, var1); histos.fill(HIST("Rec/hVar2x"), sample, nchAll, var2); histos.fill(HIST("Rec/hVarx"), sample, nchAll); + histos.fill(HIST("Rec/hdiffVar1x"), sample, nch, var1); + histos.fill(HIST("Rec/hdiffVar2x"), sample, nch, var2); + histos.fill(HIST("Rec/hdiffVarx"), sample, nch); + histos.fill(HIST("Rec/hVar2meanptx"), nchAll, var2); histos.fill(HIST("Rec/hVar1pix"), sample, nchAll, var1Pi); histos.fill(HIST("Rec/hVar2pix"), sample, nchAll, var2Pi); @@ -1174,7 +1352,7 @@ struct EventMeanPtId { histos.fill(HIST("hEffVar1x_Naccorr_xaxis_rec"), sample, sumWeight, var1); histos.fill(HIST("hEffVar2x_Naccorr_xaxis_rec"), sample, sumWeight, var2); histos.fill(HIST("hEffVarx_Naccorr_xaxis_rec"), sample, sumWeight); - + //================= generated level============================== const auto& mccolgen = coll.mcCollision_as(); @@ -1184,9 +1362,8 @@ struct EventMeanPtId { const auto& mcpartgen = mcParticles.sliceByCached(aod::mcparticle::mcCollisionId, mccolgen.globalIndex(), cache); histos.fill(HIST("hVtxZ_after_gensim"), mccolgen.posZ()); - double nchGenAll = 0., nchGenTrue = 0.; + double nchGenAll = 0., nchGenTrue = 0., nch1 = 0., nchgen = 0.; double nchPiGen = 0., nchKaGen = 0., nchPrGen = 0.; - double nch1 = 0., nch2 = 0., nch3 = 0.; double q1AllGen = 0, q2AllGen = 0.; double q1PiGen = 0, q2PiGen = 0, q1KaGen = 0, q2KaGen = 0, q1PrGen = 0, q2PrGen = 0; double var1AllGen = 0, var2AllGen = 0.; @@ -1201,12 +1378,8 @@ struct EventMeanPtId { continue; } nch1++; - histos.fill(HIST("hnch1"), nch1); - nch2++; - histos.fill(HIST("hnch2"), nch2); - nch3++; - histos.fill(HIST("hnch3"), nch3); - + histos.fill(HIST("hnch_afterPhysPrimary"), nch1); + int pid = mcpart.pdgCode(); auto sign = 0; auto* pd = pdg->GetParticle(pid); @@ -1217,12 +1390,17 @@ struct EventMeanPtId { continue; } // histos.fill(HIST("gen_hSign"), sign); - if (std::fabs(mcpart.eta()) > cEtacut) - continue; + if (std::fabs(mcpart.eta()) > cEtacut) continue; nchGenTrue++; - histos.fill(HIST("hnch_gen_true"), nchGenTrue); - if ((mcpart.pt() <= cPtmincut) || (mcpart.pt() >= cPtmaxcut)) - continue; + histos.fill(HIST("hnch_gen_after_etacut"), nchGenTrue); + + if (mcpart.pt() >= cPtmincut1 && mcpart.pt() <= cPtmaxcut1) + { nchgen += 1.; + histos.fill(HIST("hnch_gen"), nchgen); + histos.fill(HIST("hPtvar_gen"), mcpart.pt()); + } + + if ((mcpart.pt() < cPtmincut) || (mcpart.pt() > cPtmaxcut)) continue; histos.fill(HIST("hPt_gen"), mcpart.pt()); histos.fill(HIST("hEta_gen"), mcpart.eta()); histos.fill(HIST("ptHistogram_allcharge_gen"), mcpart.pt()); @@ -1236,7 +1414,7 @@ struct EventMeanPtId { if (mcpart.pdgCode() == PDG_t::kPiPlus || mcpart.pdgCode() == PDG_t::kPiMinus) { histos.fill(HIST("ptHistogramPion"), mcpart.pt()); - histos.fill(HIST("hPtEta_pi_gen"), mcpart.pt(), mcpart.eta()); + histos.fill(HIST("hPtEta_pi_gen"), mcpart.pt(), mcpart.eta()); histos.fill(HIST("hPty_pi_gen"), mcpart.pt(), mcpart.y()); nchPiGen += 1.; q1PiGen += mcpart.pt(); @@ -1246,8 +1424,8 @@ struct EventMeanPtId { if (mcpart.pdgCode() == PDG_t::kKPlus || mcpart.pdgCode() == PDG_t::kKMinus) { histos.fill(HIST("ptHistogramKaon"), mcpart.pt()); - histos.fill(HIST("hPtEta_ka_gen"), mcpart.pt(), mcpart.eta()); - histos.fill(HIST("hPty_ka_gen"), mcpart.pt(), mcpart.y()); + histos.fill(HIST("hPtEta_ka_gen"), mcpart.pt(), mcpart.eta()); + histos.fill(HIST("hPty_ka_gen"), mcpart.pt(), mcpart.y()); nchKaGen += 1.; q1KaGen += mcpart.pt(); q2KaGen += (mcpart.pt() * mcpart.pt()); @@ -1256,8 +1434,8 @@ struct EventMeanPtId { if (mcpart.pdgCode() == PDG_t::kProton || mcpart.pdgCode() == PDG_t::kProtonBar) { histos.fill(HIST("ptHistogramProton"), mcpart.pt()); - histos.fill(HIST("hPtEta_pr_gen"), mcpart.pt(), mcpart.eta()); - histos.fill(HIST("hPty_pr_gen"), mcpart.pt(), mcpart.y()); + histos.fill(HIST("hPtEta_pr_gen"), mcpart.pt(), mcpart.eta()); + histos.fill(HIST("hPty_pr_gen"), mcpart.pt(), mcpart.y()); nchPrGen += 1.; q1PrGen += mcpart.pt(); q2PrGen += (mcpart.pt() * mcpart.pt()); @@ -1266,7 +1444,7 @@ struct EventMeanPtId { } //|y| < 0.5 cut ends! - } // particle + } // track loop ends! histos.fill(HIST("hcent_nacc_gen"), cent, nchGenAll); if (nchGenAll < cTwoPtlCut2) @@ -1278,7 +1456,9 @@ struct EventMeanPtId { histos.fill(HIST("hVar2_gen"), sampleGen, cent, var2AllGen); histos.fill(HIST("hVarc_gen"), sampleGen, cent); - //--------------------------Pions------------------------------------------- + histos.fill(HIST("hterm1_gen"), nchGenAll, var1AllGen); + histos.fill(HIST("hterm2_gen"), nchGenAll, var2AllGen); +//--------------------------Pions------------------------------------------- if (nchPiGen >= cTwoPtlCut2) { var1PiGen = (q1PiGen * q1PiGen - q2PiGen) / (nchPiGen * (nchPiGen - 1)); var2PiGen = (q1PiGen / nchPiGen); @@ -1297,6 +1477,10 @@ struct EventMeanPtId { histos.fill(HIST("hVar1x_gen"), sampleGen, nchGenAll, var1AllGen); histos.fill(HIST("hVar2x_gen"), sampleGen, nchGenAll, var2AllGen); histos.fill(HIST("hVarx_gen"), sampleGen, nchGenAll); + histos.fill(HIST("hdiffVar1x_gen"), sampleGen, nchgen, var1AllGen); + histos.fill(HIST("hdiffVar2x_gen"), sampleGen, nchgen, var2AllGen); + histos.fill(HIST("hdiffVarx_gen"), sampleGen, nchgen); + histos.fill(HIST("hVar2meanptx_gen"), nchGenAll, var2AllGen); histos.fill(HIST("hVar1pix_gen"), sampleGen, nchGenAll, var1PiGen); histos.fill(HIST("hVar2pix_gen"), sampleGen, nchGenAll, var2PiGen); @@ -1312,8 +1496,9 @@ struct EventMeanPtId { histos.fill(HIST("hVar2meanptpx_gen"), nchGenAll, var2PrGen); } // void process - PROCESS_SWITCH(EventMeanPtId, processMcReco, "Process reconstructed", true); -}; + PROCESS_SWITCH(EventMeanPtId, processMcReco, "Process reconstructed", false); + + }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { From 83acce870109ccfcc002527674e4c0b18a0780a5 Mon Sep 17 00:00:00 2001 From: sweta29singh Date: Wed, 8 Oct 2025 13:32:17 +0530 Subject: [PATCH 2/8] Mean pT Fluctuations --- .../EbyEFluctuations/Tasks/eventMeanPtId.cxx | 381 ++++++++++-------- 1 file changed, 204 insertions(+), 177 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx index f36087eed7c..bf93bf8bc89 100644 --- a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx @@ -38,8 +38,8 @@ #include "Framework/RunningWorkflowInfo.h" #include "Framework/runDataProcessing.h" -#include #include "TF1.h" +#include #include #include @@ -69,8 +69,8 @@ struct EventMeanPtId { O2_DEFINE_CONFIGURABLE(cfgMultGlobalPVCutEnabled, bool, true, "Enable globalTracks vs PV multiplicity cut") Configurable> cfgMultPVFT0CCutPars{"cfgMultPVFT0CCutPars", - std::vector{3303.11, -121.316, 1.90207, -0.0152644, 5.10121e-05, 190.633, -4.32972, 0.0340001, -5.83261e-05, -3.19566e-07}, - "PV multiplicity vs T0C centrality cut parameter values"}; + std::vector{3303.11, -121.316, 1.90207, -0.0152644, 5.10121e-05, 190.633, -4.32972, 0.0340001, -5.83261e-05, -3.19566e-07}, + "PV multiplicity vs T0C centrality cut parameter values"}; Configurable> cfgMultGlobalFT0CCutPars{"cfgMultGlobalFT0CCutPars", std::vector{1893.97, -61.3423, 0.790664, -0.00507208, 1.41683e-05, 167.997, -5.29125, 0.0840145, -0.000748102, 2.75743e-06}, @@ -92,37 +92,34 @@ struct EventMeanPtId { TF1* fMultGlobalPVCutHigh = nullptr; } cfgFunCoeff; - Service ccdb; Service pdg; - Filter collisionFilter = nabs(aod::collision::posZ) <= cVtxZcut; - Filter trackFilter = (nabs(aod::track::eta) < cEtacut) && (aod::track::pt > ptMin) && (aod::track::pt < ptMax) && (requireGlobalTrackInFilter()); - -using MyCollisions = soa::Filtered>; -using MyCollision = MyCollisions::iterator; - -using MyTracks = soa::Filtered>; -using MyTrack = MyTracks::iterator; + Filter collisionFilter = nabs(aod::collision::posZ) <= cVtxZcut; + Filter trackFilter = (nabs(aod::track::eta) < cEtacut) && (aod::track::pt > ptMin) && (aod::track::pt < ptMax) && (requireGlobalTrackInFilter()); + using MyCollisions = soa::Filtered>; + using MyCollision = MyCollisions::iterator; -using MyMCRecoCollisions = soa::Filtered>; -using MyMCRecoCollision = MyMCRecoCollisions::iterator; + using MyTracks = soa::Filtered>; + using MyTrack = MyTracks::iterator; -using MyMCRecoTracks = soa::Filtered>; -using MyMCRecoTrack = MyMCRecoTracks::iterator; + using MyMCRecoCollisions = soa::Filtered>; + using MyMCRecoCollision = MyMCRecoCollisions::iterator; -using EventCandidatesMC = soa::Join; + using MyMCRecoTracks = soa::Filtered>; + using MyMCRecoTrack = MyMCRecoTracks::iterator; + using EventCandidatesMC = soa::Join; Configurable ccdbNoLaterThan{"ccdbNoLaterThan", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; Configurable cfgUrlCCDB{"cfgUrlCCDB", "http://alice-ccdb.cern.ch", "url of ccdb"}; @@ -137,7 +134,6 @@ using EventCandidatesMC = soa::Join> ptBins{"ptBins", {0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50, 0.55, 0.60, 0.65, 0.70, 0.75, 0.80, 0.85, 0.90, 0.95, 1.00, 1.05, 1.10, 1.15, 1.20, 1.25, 1.30, 1.35, 1.40, 1.45, 1.50, 1.55, 1.60, 1.65, 1.70, 1.75, 1.80, 1.85, 1.90, 1.95, 2.00}, "p_{T} bins"}; Configurable piluprejection{"piluprejection", false, "Pileup rejection"}; - void init(o2::framework::InitContext&) { if (cfgLoadEff) { @@ -150,14 +146,14 @@ using EventCandidatesMC = soa::JoingetForTimeStamp(cfgPathCCDB.value, -1); ptHistogramAllchargeRec = reinterpret_cast(lst->FindObject("hPtEta_rec")); - } + } std::vector ptBinning = {0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0}; // AxisSpec ptAxis = {ptBinning, "#it{p}_{T} (GeV/#it{c})"}; AxisSpec vtxZAxis = {100, -20.0, 20.0, "Z (cm)"}; AxisSpec dcaAxis = {1002, -5.01, 5.01, "DCA_{xy} (cm)"}; AxisSpec dcazAxis = {1002, -5.01, 5.01, "DCA_{z} (cm)"}; - AxisSpec ptAxis = {600, 0.0, 6.0, "#it{p}_{T} (GeV/#it{c})"};// 600,0,6 + AxisSpec ptAxis = {600, 0.0, 6.0, "#it{p}_{T} (GeV/#it{c})"}; // 600,0,6 AxisSpec pAxis = {400, 0.0, 4.0, "#it{p} (GeV/#it{c})"}; AxisSpec betaAxis = {200, 0.0, 2.0, "TOF_{#beta} (GeV/#it{c})"}; AxisSpec dEdxAxis = {2000, 0.0, 200.0, "dE/dx (GeV/#it{c})"}; @@ -301,10 +297,10 @@ using EventCandidatesMC = soa::Join cSigmaLowHighcut{"cSigmaLowHighcut", 3.0f, "lower and upper sigma cut"}; - cfgFunCoeff.fMultPVFT0CCutLow = new TF1("fMultPVFT0CCutLow", @@ -473,10 +468,9 @@ using EventCandidatesMC = soa::JoinSetParameters(&(cfgFunCoeff.multGlobalPVCutPars[0])); + } - } - - // Configurables + // Configurables Configurable cVtxZcut{"cVtxZcut", 10.0f, "Vertex Z"}; Configurable cEtacut{"cEtacut", 0.8f, "Eta cut"}; Configurable cPtmincut{"cPtmincut", 0.15f, "Pt min cut"}; @@ -536,7 +530,7 @@ using EventCandidatesMC = soa::Join nchMin{"nchMin", 0.0, "Minimum value for nch axis"}; Configurable nchMax{"nchMax", 4000.0, "Maximum value for nch axis"}; -bool eventSelected(const float& globalNch, const float& pvTrack, const float& centrality) + bool eventSelected(const float& globalNch, const float& pvTrack, const float& centrality) { if (cfgFunCoeff.cfgMultPVFT0CCutEnabled) { @@ -574,12 +568,12 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce } // Reject the collisions with large vertex-z histos.fill(HIST("hEventcounter"), 2.); - if(ccentFT0C) { - cent = coll.centFT0C(); //centrality from FT0C + if (ccentFT0C) { + cent = coll.centFT0C(); // centrality from FT0C } else { - cent = coll.centFT0M(); //centrality from FT0M - } - + cent = coll.centFT0M(); // centrality from FT0M + } + if (cSel8Trig && !coll.sel8()) { return false; } // require min bias trigger @@ -607,7 +601,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce return false; } histos.fill(HIST("trackSelRec"), 7); - + // if (cItslayerall && !coll.selection_bit(aod::evsel::kIsGoodITSLayersAll)) {return false;} histos.fill(HIST("trackSelRec"), 8); @@ -627,41 +621,59 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce } // accept only global tracks histos.fill(HIST("tracksel"), 2); - if (cDCAxy && std::fabs(track.dcaXY()) > cDcaXYcut) {return false;} + if (cDCAxy && std::fabs(track.dcaXY()) > cDcaXYcut) { + return false; + } histos.fill(HIST("tracksel"), 3); - if (cDCAz && std::fabs(track.dcaZ()) > cDcaZcut) {return false;} + if (cDCAz && std::fabs(track.dcaZ()) > cDcaZcut) { + return false; + } histos.fill(HIST("tracksel"), 4); if (std::fabs(track.eta()) >= cEtacut) { return false; } histos.fill(HIST("tracksel"), 5); - - if (cTPCcr && track.tpcNClsCrossedRows() < cTPCcrosscut) {return false;} + + if (cTPCcr && track.tpcNClsCrossedRows() < cTPCcrosscut) { + return false; + } histos.fill(HIST("tracksel"), 6); - if (cITSchi && track.itsChi2NCl() >= cItsChiCut) {return false;} + if (cITSchi && track.itsChi2NCl() >= cItsChiCut) { + return false; + } histos.fill(HIST("tracksel"), 7); - if (cTPCchi && track.tpcChi2NCl() >= cTpcChiCut) {return false;} + if (cTPCchi && track.tpcChi2NCl() >= cTpcChiCut) { + return false; + } histos.fill(HIST("tracksel"), 8); - if (track.sign() == 0) {return false;} + if (track.sign() == 0) { + return false; + } - if(cPVContributor) - { if (!(track.isPVContributor())) {return false;} - histos.fill(HIST("tracksel"), 9); + if (cPVContributor) { + if (!(track.isPVContributor())) { + return false; + } + histos.fill(HIST("tracksel"), 9); } if (citsNCluster) { - if (track.itsNCls() < cnITSClustersCut) { return false; } - histos.fill(HIST("tracksel"), 10); + if (track.itsNCls() < cnITSClustersCut) { + return false; + } + histos.fill(HIST("tracksel"), 10); } - if(ctpcNClusterFound) { - if (track.tpcNClsFound() < ctpcNClsCut) {return false;} - histos.fill(HIST("tracksel"), 11); + if (ctpcNClusterFound) { + if (track.tpcNClsFound() < ctpcNClsCut) { + return false; + } + histos.fill(HIST("tracksel"), 11); } return true; // if all checks pass, accept the collision @@ -757,60 +769,60 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce return false; } - double getEfficiency(double pt, double eta, TH2D* ptHistogramAllchargeRec) + double getEfficiency(double pt, double eta, TH2D* ptHistogramAllchargeRec) { - int xbin = ptHistogramAllchargeRec->GetXaxis()->FindBin(pt); - int ybin = ptHistogramAllchargeRec->GetYaxis()->FindBin(eta); + int xbin = ptHistogramAllchargeRec->GetXaxis()->FindBin(pt); + int ybin = ptHistogramAllchargeRec->GetYaxis()->FindBin(eta); - if(xbin < 1 || xbin > ptHistogramAllchargeRec->GetNbinsX() || ybin < 1 || ybin > ptHistogramAllchargeRec->GetNbinsY()) { + if (xbin < 1 || xbin > ptHistogramAllchargeRec->GetNbinsX() || ybin < 1 || ybin > ptHistogramAllchargeRec->GetNbinsY()) { LOGF(warn, "pt or eta out of histograms bounds : %f, eta = %f", pt, eta); return 1e-6; - } - double eff = ptHistogramAllchargeRec->GetBinContent(xbin, ybin); - return (eff > 0) ? eff : 1e-6; // Avoid division by zero + } + double eff = ptHistogramAllchargeRec->GetBinContent(xbin, ybin); + return (eff > 0) ? eff : 1e-6; // Avoid division by zero } - //++++++++++++++++++++++++++++++++++++DATA CALCULATION +++++++++++++++++++++++++++++++++++++++++++++++++++++// - void processData(MyCollision const& coll, MyTracks const& inputTracks) + //++++++++++++++++++++++++++++++++++++DATA CALCULATION +++++++++++++++++++++++++++++++++++++++++++++++++++++// + void processData(MyCollision const& coll, MyTracks const& inputTracks) - { float cent = -1; + { + float cent = -1; histos.fill(HIST("hEventcounter"), 1.); histos.fill(HIST("Data/hZvtx_before_sel"), coll.posZ()); - if (!selCollision(coll,cent)) + if (!selCollision(coll, cent)) return; { histos.fill(HIST("Data/hZvtx_after_sel8"), coll.posZ()); - } + } histos.fill(HIST("Data/hCentrality"), cent); - float globalNch = inputTracks.size(); - float pvTrack = coll.multNTracksPV(); + float globalNch = inputTracks.size(); + float pvTrack = coll.multNTracksPV(); - histos.fill(HIST("Data/hNchPV_NchGlobal_before"), pvTrack, globalNch); - histos.fill(HIST("Data/hcentFT0C_GlobalNch_before"),coll.centFT0C(), globalNch); - histos.fill(HIST("Data/hcentFT0C_NchPV_before"), coll.centFT0C(), pvTrack); + histos.fill(HIST("Data/hNchPV_NchGlobal_before"), pvTrack, globalNch); + histos.fill(HIST("Data/hcentFT0C_GlobalNch_before"), coll.centFT0C(), globalNch); + histos.fill(HIST("Data/hcentFT0C_NchPV_before"), coll.centFT0C(), pvTrack); - - if (cfgEvSelMultCorrelation && !eventSelected(globalNch, pvTrack, cent)) { + if (cfgEvSelMultCorrelation && !eventSelected(globalNch, pvTrack, cent)) { return; - } + } + + histos.fill(HIST("Data/hNchPV_NchGlobal_after"), pvTrack, globalNch); + histos.fill(HIST("Data/hcentFT0C_GlobalNch_after"), coll.centFT0C(), globalNch); + histos.fill(HIST("Data/hcentFT0C_NchPV_after"), coll.centFT0C(), pvTrack); - histos.fill(HIST("Data/hNchPV_NchGlobal_after"), pvTrack, globalNch); - histos.fill(HIST("Data/hcentFT0C_GlobalNch_after"),coll.centFT0C(), globalNch); - histos.fill(HIST("Data/hcentFT0C_NchPV_after"), coll.centFT0C(), pvTrack); - - double nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0., nch = 0., nchPi = 0., nchKa = 0., nchPr = 0.; + double nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0., nch = 0., nchPi = 0., nchKa = 0., nchPr = 0.; double q1 = 0., q2 = 0., var1 = 0., var2 = 0.; double sumPtWeight = 0., sumWeight = 0., sumPtPtWeight = 0., var1Eff = 0., var2Eff = 0.; double q1Pi = 0., q2Pi = 0., var1Pi = 0., var2Pi = 0.; - double q1Ka = 0., q2Ka = 0., var1Ka = 0., var2Ka = 0.; + double q1Ka = 0., q2Ka = 0., var1Ka = 0., var2Ka = 0.; double q1Pr = 0., q2Pr = 0., var1Pr = 0., var2Pr = 0.; int sample = histos.get(HIST("Data/hZvtx_after_sel8"))->GetEntries(); - sample = sample % 30; - + sample = sample % 30; + for (const auto& track : inputTracks) { nchAllBfCut += 1.; histos.fill(HIST("Data/hnchAll_bf_cut"), nchAllBfCut); @@ -819,7 +831,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Data/hTPCchi2perCluster_before"), track.tpcChi2NCl()); histos.fill(HIST("Data/hITSchi2perCluster_before"), track.itsChi2NCl()); histos.fill(HIST("Data/hTPCCrossedrows_before"), track.tpcNClsCrossedRows()); - + if (std::fabs(track.eta()) <= cEtacut) { nchEta++; histos.fill(HIST("Data/hnchTrue"), nchEta); @@ -828,16 +840,18 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce nchPt += 1.; histos.fill(HIST("Data/hnchTrue_pt"), nchPt); } - if (!selTrack(track)) continue; - - if (track.pt() >= cPtmincut1 && track.pt() <= cPtmaxcut1) - { nch += 1.; + if (!selTrack(track)) + continue; + + if (track.pt() >= cPtmincut1 && track.pt() <= cPtmaxcut1) { + nch += 1.; histos.fill(HIST("Data/hnch"), nch); - histos.fill(HIST("Data/hPtvar"), track.pt()); + histos.fill(HIST("Data/hPtvar"), track.pt()); } - - if (track.pt() < cPtmincut || track.pt() > cPtmaxcut) continue; - + + if (track.pt() < cPtmincut || track.pt() > cPtmaxcut) + continue; + nchAll += 1.; q1 += track.pt(); q2 += (track.pt() * track.pt()); @@ -857,13 +871,13 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Data/hPEta"), track.p(), track.eta()); histos.fill(HIST("Data/hNsigmaTPC"), track.p(), track.tpcNSigmaPr()); - double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); + double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); if (eff < threshold) - continue; - double weight = 1./eff; + continue; + double weight = 1. / eff; sumPtWeight += track.pt() / eff; sumPtPtWeight += (track.pt() * track.pt()) / (eff * eff); - sumWeight += weight; + sumWeight += weight; // only TPC tracks: Pion, Kaon, Proton if (track.hasTPC() && std::abs(track.tpcNSigmaPi()) < cNSigCut3) @@ -947,22 +961,22 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Data/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Data/hTOFbeta_afterselection1"), track.p(), track.beta()); } - + } // Track loop ends! histos.fill(HIST("Data/hcentFV0A_nacc"), coll.multFV0A(), nchAll); histos.fill(HIST("Data/hcentFT0A_nacc"), coll.multFT0A(), nchAll); histos.fill(HIST("Data/hcentFT0M_nacc"), coll.centFT0M(), nchAll); histos.fill(HIST("Data/hcent_nacc"), cent, nchAll); - if (nchAll < cTwoPtlCut2) + if (nchAll < cTwoPtlCut2) return; var1 = (q1 * q1 - q2) / (nchAll * (nchAll - 1)); var2 = (q1 / nchAll); - - //------------------ Efficiency corrected histograms --------------- + + //------------------ Efficiency corrected histograms --------------- var1Eff = (sumPtWeight * sumPtWeight - sumPtPtWeight) / (sumWeight * (sumWeight - 1)); var2Eff = (sumPtWeight / sumWeight); - + //---------------------- pions ---------------------------------------- if (nchPi >= cTwoPtlCut2) { var1Pi = (q1Pi * q1Pi - q2Pi) / (nchPi * (nchPi - 1)); @@ -978,8 +992,8 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce var1Pr = (q1Pr * q1Pr - q2Pr) / (nchPr * (nchPr - 1)); var2Pr = (q1Pr / nchPr); } - - //------------------ all charges------------------------------------- + + //------------------ all charges------------------------------------- histos.fill(HIST("Data/hVar1"), sample, cent, var1); histos.fill(HIST("Data/hVar2"), sample, cent, var2); histos.fill(HIST("Data/hVarc"), sample, cent); @@ -1002,7 +1016,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Data/hdiffVar1x"), sample, nch, var1); histos.fill(HIST("Data/hdiffVar2x"), sample, nch, var2); histos.fill(HIST("Data/hdiffVarx"), sample, nch); - + histos.fill(HIST("hEffVar1x_data"), sample, nchAll, var1Eff); histos.fill(HIST("hEffVar2x_data"), sample, nchAll, var2Eff); histos.fill(HIST("hEffVarx_data"), sample, nchAll); @@ -1034,38 +1048,42 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce } // event loop ends! PROCESS_SWITCH(EventMeanPtId, processData, "process real data information", true); - + //++++++++++++++++++++++++++++++++++++MC Reconstructed +++++++++++++++++++++++++++++++++++++++++++++++++++++// - SliceCache cache; - Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; - void processMcReco(MyMCRecoCollision const& coll, MyMCRecoTracks const& inputTracks, aod::McCollisions const& mcCollisions, aod::McParticles const& mcParticles) - { float cent = -1; + SliceCache cache; + Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; + void processMcReco(MyMCRecoCollision const& coll, MyMCRecoTracks const& inputTracks, aod::McCollisions const& mcCollisions, aod::McParticles const& mcParticles) + { + float cent = -1; (void)mcCollisions; - if (!coll.has_mcCollision()) {return;} - + if (!coll.has_mcCollision()) { + return; + } + histos.fill(HIST("Rec/hZvtx_before_sel"), coll.posZ()); histos.fill(HIST("hVtxZ_before_gen"), coll.mcCollision().posZ()); - histos.fill(HIST("hCentrality_rec_before"), cent); + histos.fill(HIST("hCentrality_rec_before"), cent); - if (!selCollision(coll,cent)) return; + if (!selCollision(coll, cent)) + return; histos.fill(HIST("Rec/hZvtx_after_sel8"), coll.posZ()); - histos.fill(HIST("Rec/hCentrality"), cent); + histos.fill(HIST("Rec/hCentrality"), cent); float globalNch = inputTracks.size(); - float pvTrack = coll.multNTracksPV(); + float pvTrack = coll.multNTracksPV(); - histos.fill(HIST("Rec/hNchPV_NchGlobal_before"), pvTrack, globalNch); - histos.fill(HIST("Rec/hcentFT0C_GlobalNch_before"),coll.centFT0C(), globalNch); - histos.fill(HIST("Rec/hcentFT0C_NchPV_before"), coll.centFT0C(), pvTrack); - - if (cfgEvSelMultCorrelation && !eventSelected(globalNch, pvTrack, cent)) { + histos.fill(HIST("Rec/hNchPV_NchGlobal_before"), pvTrack, globalNch); + histos.fill(HIST("Rec/hcentFT0C_GlobalNch_before"), coll.centFT0C(), globalNch); + histos.fill(HIST("Rec/hcentFT0C_NchPV_before"), coll.centFT0C(), pvTrack); + + if (cfgEvSelMultCorrelation && !eventSelected(globalNch, pvTrack, cent)) { return; - } + } - histos.fill(HIST("Rec/hNchPV_NchGlobal_after"), pvTrack, globalNch); - histos.fill(HIST("Rec/hcentFT0C_GlobalNch_after"),coll.centFT0C(), globalNch); - histos.fill(HIST("Rec/hcentFT0C_NchPV_after"), coll.centFT0C(), pvTrack); + histos.fill(HIST("Rec/hNchPV_NchGlobal_after"), pvTrack, globalNch); + histos.fill(HIST("Rec/hcentFT0C_GlobalNch_after"), coll.centFT0C(), globalNch); + histos.fill(HIST("Rec/hcentFT0C_NchPV_after"), coll.centFT0C(), pvTrack); double nch = 0., nchPi = 0., nchKa = 0., nchPr = 0., nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0.; double q1 = 0., q2 = 0.; @@ -1073,7 +1091,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce double var1 = 0., var2 = 0.; double var1Pi = 0., var2Pi = 0., var1Ka = 0., var2Ka = 0., var1Pr = 0., var2Pr = 0.; double sumPtWeight = 0., sumWeight = 0., sumPtPtWeight = 0., var1Eff = 0., var2Eff = 0.; - + int sample = histos.get(HIST("Rec/hZvtx_after_sel8"))->GetEntries(); sample = sample % 30; @@ -1084,37 +1102,40 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Rec/hITSchi2perCluster_before"), track.itsChi2NCl()); histos.fill(HIST("Rec/hTPCCrossedrows_before"), track.tpcNClsCrossedRows()); - if (std::fabs(track.eta()) <= cEtacut) - { nchEta++; + if (std::fabs(track.eta()) <= cEtacut) { + nchEta++; histos.fill(HIST("Rec/hnchTrue"), nchEta); } - if (track.pt() >= cPtmincut && track.pt() <= cPtmaxcut) - { nchPt += 1.; + if (track.pt() >= cPtmincut && track.pt() <= cPtmaxcut) { + nchPt += 1.; histos.fill(HIST("Rec/hnchTrue_pt"), nchPt); } - - if (!selTrack(track)) continue; - - if (track.pt() >= cPtmincut1 && track.pt() <= cPtmaxcut1) - { nch += 1.; + + if (!selTrack(track)) + continue; + + if (track.pt() >= cPtmincut1 && track.pt() <= cPtmaxcut1) { + nch += 1.; histos.fill(HIST("Rec/hnch"), nch); - histos.fill(HIST("Rec/hPtvar"), track.pt()); + histos.fill(HIST("Rec/hPtvar"), track.pt()); } - if (track.pt() < cPtmincut || track.pt() > cPtmaxcut) continue; - + if (track.pt() < cPtmincut || track.pt() > cPtmaxcut) + continue; + // if (std::fabs(track.y()) > 0.5) continue; histos.fill(HIST("hPt_rec"), track.pt()); histos.fill(HIST("hEta_rec"), track.eta()); double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); - if (eff < threshold) continue; + if (eff < threshold) + continue; double weight = 1.0 / eff; sumPtWeight += track.pt() * weight; sumPtPtWeight += (track.pt() * track.pt() * weight * weight); sumWeight += weight; - - histos.fill(HIST("hPt_rec_corr"), track.pt() , weight); - histos.fill(HIST("hEta_rec_corr"), track.eta() , weight); + + histos.fill(HIST("hPt_rec_corr"), track.pt(), weight); + histos.fill(HIST("hEta_rec_corr"), track.eta(), weight); auto mcParticle = track.mcParticle(); nchAll += 1.; @@ -1137,7 +1158,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Rec/hPEta"), track.p(), track.eta()); histos.fill(HIST("Rec/hNsigmaTPC"), track.p(), track.tpcNSigmaPr()); histos.fill(HIST("hPtEta_rec"), track.pt(), track.eta()); - + if (std::abs(mcParticle.pdgCode()) == PDG_t::kPiPlus) histos.fill(HIST("ptHistogramPionrec_pdg"), track.pt()); if (std::abs(mcParticle.pdgCode()) == PDG_t::kKPlus) @@ -1179,10 +1200,12 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce } if (selPion(track)) { - if (std::fabs(track.y()) > cRapidityCut05) continue; - if (track.beta() > 1) continue; + if (std::fabs(track.y()) > cRapidityCut05) + continue; + if (track.beta() > 1) + continue; histos.fill(HIST("ptHistogramPionrec"), track.pt()); - histos.fill(HIST("hPtEta_pi_rec"), track.pt(), track.eta()); + histos.fill(HIST("hPtEta_pi_rec"), track.pt(), track.eta()); histos.fill(HIST("Rec/hPtPion"), track.pt()); histos.fill(HIST("Rec/hEtaPion"), track.eta()); histos.fill(HIST("Rec/hyPion"), track.rapidity(massPi)); @@ -1193,14 +1216,14 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Rec/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Rec/hTOFbeta_afterselection1"), track.p(), track.beta()); if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kPiPlus) { - histos.fill(HIST("ptHistogramPionrec_purity"), track.pt()); + histos.fill(HIST("ptHistogramPionrec_purity"), track.pt()); } nchPi += 1.; q1Pi += track.pt(); q2Pi += (track.pt() * track.pt()); - histos.fill(HIST("hPyPion_rec"), track.p(), track.rapidity(massPi)); - histos.fill(HIST("hPtyPion_rec"), track.pt(), track.rapidity(massPi)); + histos.fill(HIST("hPyPion_rec"), track.p(), track.rapidity(massPi)); + histos.fill(HIST("hPtyPion_rec"), track.pt(), track.rapidity(massPi)); } //===========================kaon=============================================================== @@ -1212,10 +1235,12 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce } if (selKaon(track)) { - if (std::fabs(track.y()) > cRapidityCut05) continue; - if (track.beta() > 1) continue; + if (std::fabs(track.y()) > cRapidityCut05) + continue; + if (track.beta() > 1) + continue; histos.fill(HIST("ptHistogramKaonrec"), track.pt()); - histos.fill(HIST("hPtEta_ka_rec"), track.pt(), track.eta()); + histos.fill(HIST("hPtEta_ka_rec"), track.pt(), track.eta()); histos.fill(HIST("Rec/hPtKaon"), track.pt()); histos.fill(HIST("Rec/hEtaKaon"), track.eta()); histos.fill(HIST("Rec/hyKaon"), track.rapidity(massKa)); @@ -1226,7 +1251,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Rec/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Rec/hTOFbeta_afterselection1"), track.p(), track.beta()); if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kKPlus) { - histos.fill(HIST("ptHistogramKaonrec_purity"), track.pt()); + histos.fill(HIST("ptHistogramKaonrec_purity"), track.pt()); } nchKa += 1.; q1Ka += track.pt(); @@ -1245,10 +1270,12 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce } if (selProton(track)) { - if (std::fabs(track.y()) > cRapidityCut05) continue; - if (track.beta() > 1) continue; + if (std::fabs(track.y()) > cRapidityCut05) + continue; + if (track.beta() > 1) + continue; histos.fill(HIST("ptHistogramProtonrec"), track.pt()); - histos.fill(HIST("hPtEta_pr_rec"), track.pt(), track.eta()); + histos.fill(HIST("hPtEta_pr_rec"), track.pt(), track.eta()); histos.fill(HIST("Rec/hPtProton"), track.pt()); histos.fill(HIST("Rec/hEtaProton"), track.eta()); histos.fill(HIST("Rec/hyProton"), track.rapidity(massPr)); @@ -1259,7 +1286,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Rec/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Rec/hTOFbeta_afterselection1"), track.p(), track.beta()); if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kProton) { - histos.fill(HIST("ptHistogramProtonrec_purity"), track.pt()); + histos.fill(HIST("ptHistogramProtonrec_purity"), track.pt()); } nchPr += 1.; q1Pr += track.pt(); @@ -1291,7 +1318,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Rec/hVar2"), sample, cent, var2); histos.fill(HIST("Rec/hVarc"), sample, cent); histos.fill(HIST("Rec/hVar2meanpt"), cent, var2); - + //---------------------- pions ---------------------------------------- if (nchPi >= cTwoPtlCut2) { var1Pi = (q1Pi * q1Pi - q2Pi) / (nchPi * (nchPi - 1)); @@ -1301,8 +1328,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce if (nchKa >= cTwoPtlCut2) { var1Ka = (q1Ka * q1Ka - q2Ka) / (nchKa * (nchKa - 1)); var2Ka = (q1Ka / nchKa); - - } + } //---------------------------- protons ---------------------------------- if (nchPr >= cTwoPtlCut2) { var1Pr = (q1Pr * q1Pr - q2Pr) / (nchPr * (nchPr - 1)); @@ -1352,7 +1378,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("hEffVar1x_Naccorr_xaxis_rec"), sample, sumWeight, var1); histos.fill(HIST("hEffVar2x_Naccorr_xaxis_rec"), sample, sumWeight, var2); histos.fill(HIST("hEffVarx_Naccorr_xaxis_rec"), sample, sumWeight); - + //================= generated level============================== const auto& mccolgen = coll.mcCollision_as(); @@ -1379,7 +1405,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce } nch1++; histos.fill(HIST("hnch_afterPhysPrimary"), nch1); - + int pid = mcpart.pdgCode(); auto sign = 0; auto* pd = pdg->GetParticle(pid); @@ -1390,17 +1416,19 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce continue; } // histos.fill(HIST("gen_hSign"), sign); - if (std::fabs(mcpart.eta()) > cEtacut) continue; + if (std::fabs(mcpart.eta()) > cEtacut) + continue; nchGenTrue++; histos.fill(HIST("hnch_gen_after_etacut"), nchGenTrue); - if (mcpart.pt() >= cPtmincut1 && mcpart.pt() <= cPtmaxcut1) - { nchgen += 1.; + if (mcpart.pt() >= cPtmincut1 && mcpart.pt() <= cPtmaxcut1) { + nchgen += 1.; histos.fill(HIST("hnch_gen"), nchgen); - histos.fill(HIST("hPtvar_gen"), mcpart.pt()); + histos.fill(HIST("hPtvar_gen"), mcpart.pt()); } - if ((mcpart.pt() < cPtmincut) || (mcpart.pt() > cPtmaxcut)) continue; + if ((mcpart.pt() < cPtmincut) || (mcpart.pt() > cPtmaxcut)) + continue; histos.fill(HIST("hPt_gen"), mcpart.pt()); histos.fill(HIST("hEta_gen"), mcpart.eta()); histos.fill(HIST("ptHistogram_allcharge_gen"), mcpart.pt()); @@ -1414,7 +1442,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce if (mcpart.pdgCode() == PDG_t::kPiPlus || mcpart.pdgCode() == PDG_t::kPiMinus) { histos.fill(HIST("ptHistogramPion"), mcpart.pt()); - histos.fill(HIST("hPtEta_pi_gen"), mcpart.pt(), mcpart.eta()); + histos.fill(HIST("hPtEta_pi_gen"), mcpart.pt(), mcpart.eta()); histos.fill(HIST("hPty_pi_gen"), mcpart.pt(), mcpart.y()); nchPiGen += 1.; q1PiGen += mcpart.pt(); @@ -1424,8 +1452,8 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce if (mcpart.pdgCode() == PDG_t::kKPlus || mcpart.pdgCode() == PDG_t::kKMinus) { histos.fill(HIST("ptHistogramKaon"), mcpart.pt()); - histos.fill(HIST("hPtEta_ka_gen"), mcpart.pt(), mcpart.eta()); - histos.fill(HIST("hPty_ka_gen"), mcpart.pt(), mcpart.y()); + histos.fill(HIST("hPtEta_ka_gen"), mcpart.pt(), mcpart.eta()); + histos.fill(HIST("hPty_ka_gen"), mcpart.pt(), mcpart.y()); nchKaGen += 1.; q1KaGen += mcpart.pt(); q2KaGen += (mcpart.pt() * mcpart.pt()); @@ -1434,8 +1462,8 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce if (mcpart.pdgCode() == PDG_t::kProton || mcpart.pdgCode() == PDG_t::kProtonBar) { histos.fill(HIST("ptHistogramProton"), mcpart.pt()); - histos.fill(HIST("hPtEta_pr_gen"), mcpart.pt(), mcpart.eta()); - histos.fill(HIST("hPty_pr_gen"), mcpart.pt(), mcpart.y()); + histos.fill(HIST("hPtEta_pr_gen"), mcpart.pt(), mcpart.eta()); + histos.fill(HIST("hPty_pr_gen"), mcpart.pt(), mcpart.y()); nchPrGen += 1.; q1PrGen += mcpart.pt(); q2PrGen += (mcpart.pt() * mcpart.pt()); @@ -1458,7 +1486,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("hterm1_gen"), nchGenAll, var1AllGen); histos.fill(HIST("hterm2_gen"), nchGenAll, var2AllGen); -//--------------------------Pions------------------------------------------- + //--------------------------Pions------------------------------------------- if (nchPiGen >= cTwoPtlCut2) { var1PiGen = (q1PiGen * q1PiGen - q2PiGen) / (nchPiGen * (nchPiGen - 1)); var2PiGen = (q1PiGen / nchPiGen); @@ -1497,8 +1525,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce } // void process PROCESS_SWITCH(EventMeanPtId, processMcReco, "Process reconstructed", false); - - }; +}; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { From 5fce87b807ea2f9c8aebe8c19a5f475b3eca5ac1 Mon Sep 17 00:00:00 2001 From: sweta29singh Date: Wed, 8 Oct 2025 14:17:38 +0530 Subject: [PATCH 3/8] Mean pT Fluctuations --- .../EbyEFluctuations/Tasks/eventMeanPtId.cxx | 381 ++++++++---------- 1 file changed, 177 insertions(+), 204 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx index bf93bf8bc89..f36087eed7c 100644 --- a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx @@ -38,8 +38,8 @@ #include "Framework/RunningWorkflowInfo.h" #include "Framework/runDataProcessing.h" -#include "TF1.h" #include +#include "TF1.h" #include #include @@ -69,8 +69,8 @@ struct EventMeanPtId { O2_DEFINE_CONFIGURABLE(cfgMultGlobalPVCutEnabled, bool, true, "Enable globalTracks vs PV multiplicity cut") Configurable> cfgMultPVFT0CCutPars{"cfgMultPVFT0CCutPars", - std::vector{3303.11, -121.316, 1.90207, -0.0152644, 5.10121e-05, 190.633, -4.32972, 0.0340001, -5.83261e-05, -3.19566e-07}, - "PV multiplicity vs T0C centrality cut parameter values"}; + std::vector{3303.11, -121.316, 1.90207, -0.0152644, 5.10121e-05, 190.633, -4.32972, 0.0340001, -5.83261e-05, -3.19566e-07}, + "PV multiplicity vs T0C centrality cut parameter values"}; Configurable> cfgMultGlobalFT0CCutPars{"cfgMultGlobalFT0CCutPars", std::vector{1893.97, -61.3423, 0.790664, -0.00507208, 1.41683e-05, 167.997, -5.29125, 0.0840145, -0.000748102, 2.75743e-06}, @@ -92,34 +92,37 @@ struct EventMeanPtId { TF1* fMultGlobalPVCutHigh = nullptr; } cfgFunCoeff; + Service ccdb; Service pdg; - Filter collisionFilter = nabs(aod::collision::posZ) <= cVtxZcut; - Filter trackFilter = (nabs(aod::track::eta) < cEtacut) && (aod::track::pt > ptMin) && (aod::track::pt < ptMax) && (requireGlobalTrackInFilter()); + Filter collisionFilter = nabs(aod::collision::posZ) <= cVtxZcut; + Filter trackFilter = (nabs(aod::track::eta) < cEtacut) && (aod::track::pt > ptMin) && (aod::track::pt < ptMax) && (requireGlobalTrackInFilter()); + +using MyCollisions = soa::Filtered>; +using MyCollision = MyCollisions::iterator; + +using MyTracks = soa::Filtered>; +using MyTrack = MyTracks::iterator; - using MyCollisions = soa::Filtered>; - using MyCollision = MyCollisions::iterator; - using MyTracks = soa::Filtered>; - using MyTrack = MyTracks::iterator; +using MyMCRecoCollisions = soa::Filtered>; +using MyMCRecoCollision = MyMCRecoCollisions::iterator; - using MyMCRecoCollisions = soa::Filtered>; - using MyMCRecoCollision = MyMCRecoCollisions::iterator; +using MyMCRecoTracks = soa::Filtered>; +using MyMCRecoTrack = MyMCRecoTracks::iterator; - using MyMCRecoTracks = soa::Filtered>; - using MyMCRecoTrack = MyMCRecoTracks::iterator; +using EventCandidatesMC = soa::Join; - using EventCandidatesMC = soa::Join; Configurable ccdbNoLaterThan{"ccdbNoLaterThan", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; Configurable cfgUrlCCDB{"cfgUrlCCDB", "http://alice-ccdb.cern.ch", "url of ccdb"}; @@ -134,6 +137,7 @@ struct EventMeanPtId { Configurable> ptBins{"ptBins", {0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50, 0.55, 0.60, 0.65, 0.70, 0.75, 0.80, 0.85, 0.90, 0.95, 1.00, 1.05, 1.10, 1.15, 1.20, 1.25, 1.30, 1.35, 1.40, 1.45, 1.50, 1.55, 1.60, 1.65, 1.70, 1.75, 1.80, 1.85, 1.90, 1.95, 2.00}, "p_{T} bins"}; Configurable piluprejection{"piluprejection", false, "Pileup rejection"}; + void init(o2::framework::InitContext&) { if (cfgLoadEff) { @@ -146,14 +150,14 @@ struct EventMeanPtId { TList* lst = ccdb->getForTimeStamp(cfgPathCCDB.value, -1); ptHistogramAllchargeRec = reinterpret_cast(lst->FindObject("hPtEta_rec")); - } + } std::vector ptBinning = {0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0}; // AxisSpec ptAxis = {ptBinning, "#it{p}_{T} (GeV/#it{c})"}; AxisSpec vtxZAxis = {100, -20.0, 20.0, "Z (cm)"}; AxisSpec dcaAxis = {1002, -5.01, 5.01, "DCA_{xy} (cm)"}; AxisSpec dcazAxis = {1002, -5.01, 5.01, "DCA_{z} (cm)"}; - AxisSpec ptAxis = {600, 0.0, 6.0, "#it{p}_{T} (GeV/#it{c})"}; // 600,0,6 + AxisSpec ptAxis = {600, 0.0, 6.0, "#it{p}_{T} (GeV/#it{c})"};// 600,0,6 AxisSpec pAxis = {400, 0.0, 4.0, "#it{p} (GeV/#it{c})"}; AxisSpec betaAxis = {200, 0.0, 2.0, "TOF_{#beta} (GeV/#it{c})"}; AxisSpec dEdxAxis = {2000, 0.0, 200.0, "dE/dx (GeV/#it{c})"}; @@ -297,10 +301,10 @@ struct EventMeanPtId { histos.add("Data/hNchPV_NchGlobal_after3", "hNchPV_NchGlobal_after3", kTH2D, {nchAxis, nchAxis}); histos.add("Data/hNchPV_NchGlobal_after4", "hNchPV_NchGlobal_after4", kTH2D, {nchAxis, nchAxis}); histos.add("Data/hNchPV_NchGlobal_after5", "hNchPV_NchGlobal_after5", kTH2D, {nchAxis, nchAxis}); - + histos.addClone("Data/", "Rec/"); // rec histograms - histos.add("hcent_nacc_corr", "hcent_nacc_corr", kTH2D, {centAxis, nchAxis}); + histos.add("hcent_nacc_corr", "hcent_nacc_corr", kTH2D, {centAxis, nchAxis}); histos.add("NSigamaTPCpion_rec", "NSigamaTPCpion_rec", kTH2D, {pAxis, nSigmaTPCAxispid}); histos.add("NSigamaTPCkaon_rec", "NSigamaTPCkaon_rec", kTH2D, {pAxis, nSigmaTPCAxispid}); histos.add("NSigamaTPCproton_rec", "NSigamaTPCproton_rec", kTH2D, {pAxis, nSigmaTPCAxispid}); @@ -358,7 +362,7 @@ struct EventMeanPtId { histos.add("hnch_pr", ";hnch_pr", kTH1D, {nchAxis}); histos.add("hnch_gen", ";hnch_gen", kTH1D, {nchAxis}); histos.add("hPtvar_gen", ";#it{p}_{T} (GeV/#it{c})", kTH1D, {ptAxis}); - + histos.add("hVar1x_gen", "hVar1x_gen", kTH2D, {subAxis, nchAxis}); histos.add("hVar2x_gen", "hVar2x_gen", kTH2D, {subAxis, nchAxis}); histos.add("hVarx_gen", "hVarx_gen", kTH2D, {subAxis, nchAxis}); @@ -426,12 +430,13 @@ struct EventMeanPtId { histos.add("hterm2_gen", "hterm2_gen", kTProfile, {tnchAxis}); histos.add("hCentrality_rec_before", "hCentrality_rec_before", kTH1D, {centAxis}); histos.add("hEta1", ";hEta1", kTH1D, {etaAxis}); - + cfgFunCoeff.multPVFT0CCutPars = cfgFunCoeff.cfgMultPVFT0CCutPars; cfgFunCoeff.multGlobalFT0CPars = cfgFunCoeff.cfgMultGlobalFT0CCutPars; cfgFunCoeff.multGlobalPVCutPars = cfgFunCoeff.cfgMultGlobalPVCutPars; Configurable cSigmaLowHighcut{"cSigmaLowHighcut", 3.0f, "lower and upper sigma cut"}; + cfgFunCoeff.fMultPVFT0CCutLow = new TF1("fMultPVFT0CCutLow", @@ -468,9 +473,10 @@ struct EventMeanPtId { "[0] + [1]*x + 3.0*([2] + [3]*x + [4]*x*x + [5]*x*x*x)", 0, 100); cfgFunCoeff.fMultGlobalPVCutHigh->SetParameters(&(cfgFunCoeff.multGlobalPVCutPars[0])); - } - // Configurables + } + + // Configurables Configurable cVtxZcut{"cVtxZcut", 10.0f, "Vertex Z"}; Configurable cEtacut{"cEtacut", 0.8f, "Eta cut"}; Configurable cPtmincut{"cPtmincut", 0.15f, "Pt min cut"}; @@ -530,7 +536,7 @@ struct EventMeanPtId { Configurable nchMin{"nchMin", 0.0, "Minimum value for nch axis"}; Configurable nchMax{"nchMax", 4000.0, "Maximum value for nch axis"}; - bool eventSelected(const float& globalNch, const float& pvTrack, const float& centrality) +bool eventSelected(const float& globalNch, const float& pvTrack, const float& centrality) { if (cfgFunCoeff.cfgMultPVFT0CCutEnabled) { @@ -568,12 +574,12 @@ struct EventMeanPtId { } // Reject the collisions with large vertex-z histos.fill(HIST("hEventcounter"), 2.); - if (ccentFT0C) { - cent = coll.centFT0C(); // centrality from FT0C + if(ccentFT0C) { + cent = coll.centFT0C(); //centrality from FT0C } else { - cent = coll.centFT0M(); // centrality from FT0M - } - + cent = coll.centFT0M(); //centrality from FT0M + } + if (cSel8Trig && !coll.sel8()) { return false; } // require min bias trigger @@ -601,7 +607,7 @@ struct EventMeanPtId { return false; } histos.fill(HIST("trackSelRec"), 7); - + // if (cItslayerall && !coll.selection_bit(aod::evsel::kIsGoodITSLayersAll)) {return false;} histos.fill(HIST("trackSelRec"), 8); @@ -621,59 +627,41 @@ struct EventMeanPtId { } // accept only global tracks histos.fill(HIST("tracksel"), 2); - if (cDCAxy && std::fabs(track.dcaXY()) > cDcaXYcut) { - return false; - } + if (cDCAxy && std::fabs(track.dcaXY()) > cDcaXYcut) {return false;} histos.fill(HIST("tracksel"), 3); - if (cDCAz && std::fabs(track.dcaZ()) > cDcaZcut) { - return false; - } + if (cDCAz && std::fabs(track.dcaZ()) > cDcaZcut) {return false;} histos.fill(HIST("tracksel"), 4); if (std::fabs(track.eta()) >= cEtacut) { return false; } histos.fill(HIST("tracksel"), 5); - - if (cTPCcr && track.tpcNClsCrossedRows() < cTPCcrosscut) { - return false; - } + + if (cTPCcr && track.tpcNClsCrossedRows() < cTPCcrosscut) {return false;} histos.fill(HIST("tracksel"), 6); - if (cITSchi && track.itsChi2NCl() >= cItsChiCut) { - return false; - } + if (cITSchi && track.itsChi2NCl() >= cItsChiCut) {return false;} histos.fill(HIST("tracksel"), 7); - if (cTPCchi && track.tpcChi2NCl() >= cTpcChiCut) { - return false; - } + if (cTPCchi && track.tpcChi2NCl() >= cTpcChiCut) {return false;} histos.fill(HIST("tracksel"), 8); - if (track.sign() == 0) { - return false; - } + if (track.sign() == 0) {return false;} - if (cPVContributor) { - if (!(track.isPVContributor())) { - return false; - } - histos.fill(HIST("tracksel"), 9); + if(cPVContributor) + { if (!(track.isPVContributor())) {return false;} + histos.fill(HIST("tracksel"), 9); } if (citsNCluster) { - if (track.itsNCls() < cnITSClustersCut) { - return false; - } - histos.fill(HIST("tracksel"), 10); + if (track.itsNCls() < cnITSClustersCut) { return false; } + histos.fill(HIST("tracksel"), 10); } - if (ctpcNClusterFound) { - if (track.tpcNClsFound() < ctpcNClsCut) { - return false; - } - histos.fill(HIST("tracksel"), 11); + if(ctpcNClusterFound) { + if (track.tpcNClsFound() < ctpcNClsCut) {return false;} + histos.fill(HIST("tracksel"), 11); } return true; // if all checks pass, accept the collision @@ -769,60 +757,60 @@ struct EventMeanPtId { return false; } - double getEfficiency(double pt, double eta, TH2D* ptHistogramAllchargeRec) + double getEfficiency(double pt, double eta, TH2D* ptHistogramAllchargeRec) { - int xbin = ptHistogramAllchargeRec->GetXaxis()->FindBin(pt); - int ybin = ptHistogramAllchargeRec->GetYaxis()->FindBin(eta); + int xbin = ptHistogramAllchargeRec->GetXaxis()->FindBin(pt); + int ybin = ptHistogramAllchargeRec->GetYaxis()->FindBin(eta); - if (xbin < 1 || xbin > ptHistogramAllchargeRec->GetNbinsX() || ybin < 1 || ybin > ptHistogramAllchargeRec->GetNbinsY()) { + if(xbin < 1 || xbin > ptHistogramAllchargeRec->GetNbinsX() || ybin < 1 || ybin > ptHistogramAllchargeRec->GetNbinsY()) { LOGF(warn, "pt or eta out of histograms bounds : %f, eta = %f", pt, eta); return 1e-6; - } - double eff = ptHistogramAllchargeRec->GetBinContent(xbin, ybin); - return (eff > 0) ? eff : 1e-6; // Avoid division by zero + } + double eff = ptHistogramAllchargeRec->GetBinContent(xbin, ybin); + return (eff > 0) ? eff : 1e-6; // Avoid division by zero } - //++++++++++++++++++++++++++++++++++++DATA CALCULATION +++++++++++++++++++++++++++++++++++++++++++++++++++++// - void processData(MyCollision const& coll, MyTracks const& inputTracks) + //++++++++++++++++++++++++++++++++++++DATA CALCULATION +++++++++++++++++++++++++++++++++++++++++++++++++++++// + void processData(MyCollision const& coll, MyTracks const& inputTracks) - { - float cent = -1; + { float cent = -1; histos.fill(HIST("hEventcounter"), 1.); histos.fill(HIST("Data/hZvtx_before_sel"), coll.posZ()); - if (!selCollision(coll, cent)) + if (!selCollision(coll,cent)) return; { histos.fill(HIST("Data/hZvtx_after_sel8"), coll.posZ()); - } + } histos.fill(HIST("Data/hCentrality"), cent); - float globalNch = inputTracks.size(); - float pvTrack = coll.multNTracksPV(); + float globalNch = inputTracks.size(); + float pvTrack = coll.multNTracksPV(); - histos.fill(HIST("Data/hNchPV_NchGlobal_before"), pvTrack, globalNch); - histos.fill(HIST("Data/hcentFT0C_GlobalNch_before"), coll.centFT0C(), globalNch); - histos.fill(HIST("Data/hcentFT0C_NchPV_before"), coll.centFT0C(), pvTrack); + histos.fill(HIST("Data/hNchPV_NchGlobal_before"), pvTrack, globalNch); + histos.fill(HIST("Data/hcentFT0C_GlobalNch_before"),coll.centFT0C(), globalNch); + histos.fill(HIST("Data/hcentFT0C_NchPV_before"), coll.centFT0C(), pvTrack); - if (cfgEvSelMultCorrelation && !eventSelected(globalNch, pvTrack, cent)) { + + if (cfgEvSelMultCorrelation && !eventSelected(globalNch, pvTrack, cent)) { return; - } - - histos.fill(HIST("Data/hNchPV_NchGlobal_after"), pvTrack, globalNch); - histos.fill(HIST("Data/hcentFT0C_GlobalNch_after"), coll.centFT0C(), globalNch); - histos.fill(HIST("Data/hcentFT0C_NchPV_after"), coll.centFT0C(), pvTrack); + } - double nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0., nch = 0., nchPi = 0., nchKa = 0., nchPr = 0.; + histos.fill(HIST("Data/hNchPV_NchGlobal_after"), pvTrack, globalNch); + histos.fill(HIST("Data/hcentFT0C_GlobalNch_after"),coll.centFT0C(), globalNch); + histos.fill(HIST("Data/hcentFT0C_NchPV_after"), coll.centFT0C(), pvTrack); + + double nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0., nch = 0., nchPi = 0., nchKa = 0., nchPr = 0.; double q1 = 0., q2 = 0., var1 = 0., var2 = 0.; double sumPtWeight = 0., sumWeight = 0., sumPtPtWeight = 0., var1Eff = 0., var2Eff = 0.; double q1Pi = 0., q2Pi = 0., var1Pi = 0., var2Pi = 0.; - double q1Ka = 0., q2Ka = 0., var1Ka = 0., var2Ka = 0.; + double q1Ka = 0., q2Ka = 0., var1Ka = 0., var2Ka = 0.; double q1Pr = 0., q2Pr = 0., var1Pr = 0., var2Pr = 0.; int sample = histos.get(HIST("Data/hZvtx_after_sel8"))->GetEntries(); - sample = sample % 30; - + sample = sample % 30; + for (const auto& track : inputTracks) { nchAllBfCut += 1.; histos.fill(HIST("Data/hnchAll_bf_cut"), nchAllBfCut); @@ -831,7 +819,7 @@ struct EventMeanPtId { histos.fill(HIST("Data/hTPCchi2perCluster_before"), track.tpcChi2NCl()); histos.fill(HIST("Data/hITSchi2perCluster_before"), track.itsChi2NCl()); histos.fill(HIST("Data/hTPCCrossedrows_before"), track.tpcNClsCrossedRows()); - + if (std::fabs(track.eta()) <= cEtacut) { nchEta++; histos.fill(HIST("Data/hnchTrue"), nchEta); @@ -840,18 +828,16 @@ struct EventMeanPtId { nchPt += 1.; histos.fill(HIST("Data/hnchTrue_pt"), nchPt); } - if (!selTrack(track)) - continue; - - if (track.pt() >= cPtmincut1 && track.pt() <= cPtmaxcut1) { - nch += 1.; + if (!selTrack(track)) continue; + + if (track.pt() >= cPtmincut1 && track.pt() <= cPtmaxcut1) + { nch += 1.; histos.fill(HIST("Data/hnch"), nch); - histos.fill(HIST("Data/hPtvar"), track.pt()); + histos.fill(HIST("Data/hPtvar"), track.pt()); } - - if (track.pt() < cPtmincut || track.pt() > cPtmaxcut) - continue; - + + if (track.pt() < cPtmincut || track.pt() > cPtmaxcut) continue; + nchAll += 1.; q1 += track.pt(); q2 += (track.pt() * track.pt()); @@ -871,13 +857,13 @@ struct EventMeanPtId { histos.fill(HIST("Data/hPEta"), track.p(), track.eta()); histos.fill(HIST("Data/hNsigmaTPC"), track.p(), track.tpcNSigmaPr()); - double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); + double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); if (eff < threshold) - continue; - double weight = 1. / eff; + continue; + double weight = 1./eff; sumPtWeight += track.pt() / eff; sumPtPtWeight += (track.pt() * track.pt()) / (eff * eff); - sumWeight += weight; + sumWeight += weight; // only TPC tracks: Pion, Kaon, Proton if (track.hasTPC() && std::abs(track.tpcNSigmaPi()) < cNSigCut3) @@ -961,22 +947,22 @@ struct EventMeanPtId { histos.fill(HIST("Data/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Data/hTOFbeta_afterselection1"), track.p(), track.beta()); } - + } // Track loop ends! histos.fill(HIST("Data/hcentFV0A_nacc"), coll.multFV0A(), nchAll); histos.fill(HIST("Data/hcentFT0A_nacc"), coll.multFT0A(), nchAll); histos.fill(HIST("Data/hcentFT0M_nacc"), coll.centFT0M(), nchAll); histos.fill(HIST("Data/hcent_nacc"), cent, nchAll); - if (nchAll < cTwoPtlCut2) + if (nchAll < cTwoPtlCut2) return; var1 = (q1 * q1 - q2) / (nchAll * (nchAll - 1)); var2 = (q1 / nchAll); - - //------------------ Efficiency corrected histograms --------------- + + //------------------ Efficiency corrected histograms --------------- var1Eff = (sumPtWeight * sumPtWeight - sumPtPtWeight) / (sumWeight * (sumWeight - 1)); var2Eff = (sumPtWeight / sumWeight); - + //---------------------- pions ---------------------------------------- if (nchPi >= cTwoPtlCut2) { var1Pi = (q1Pi * q1Pi - q2Pi) / (nchPi * (nchPi - 1)); @@ -992,8 +978,8 @@ struct EventMeanPtId { var1Pr = (q1Pr * q1Pr - q2Pr) / (nchPr * (nchPr - 1)); var2Pr = (q1Pr / nchPr); } - - //------------------ all charges------------------------------------- + + //------------------ all charges------------------------------------- histos.fill(HIST("Data/hVar1"), sample, cent, var1); histos.fill(HIST("Data/hVar2"), sample, cent, var2); histos.fill(HIST("Data/hVarc"), sample, cent); @@ -1016,7 +1002,7 @@ struct EventMeanPtId { histos.fill(HIST("Data/hdiffVar1x"), sample, nch, var1); histos.fill(HIST("Data/hdiffVar2x"), sample, nch, var2); histos.fill(HIST("Data/hdiffVarx"), sample, nch); - + histos.fill(HIST("hEffVar1x_data"), sample, nchAll, var1Eff); histos.fill(HIST("hEffVar2x_data"), sample, nchAll, var2Eff); histos.fill(HIST("hEffVarx_data"), sample, nchAll); @@ -1048,42 +1034,38 @@ struct EventMeanPtId { } // event loop ends! PROCESS_SWITCH(EventMeanPtId, processData, "process real data information", true); - + //++++++++++++++++++++++++++++++++++++MC Reconstructed +++++++++++++++++++++++++++++++++++++++++++++++++++++// - SliceCache cache; - Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; - void processMcReco(MyMCRecoCollision const& coll, MyMCRecoTracks const& inputTracks, aod::McCollisions const& mcCollisions, aod::McParticles const& mcParticles) - { - float cent = -1; + SliceCache cache; + Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; + void processMcReco(MyMCRecoCollision const& coll, MyMCRecoTracks const& inputTracks, aod::McCollisions const& mcCollisions, aod::McParticles const& mcParticles) + { float cent = -1; (void)mcCollisions; - if (!coll.has_mcCollision()) { - return; - } - + if (!coll.has_mcCollision()) {return;} + histos.fill(HIST("Rec/hZvtx_before_sel"), coll.posZ()); histos.fill(HIST("hVtxZ_before_gen"), coll.mcCollision().posZ()); - histos.fill(HIST("hCentrality_rec_before"), cent); + histos.fill(HIST("hCentrality_rec_before"), cent); - if (!selCollision(coll, cent)) - return; + if (!selCollision(coll,cent)) return; histos.fill(HIST("Rec/hZvtx_after_sel8"), coll.posZ()); - histos.fill(HIST("Rec/hCentrality"), cent); + histos.fill(HIST("Rec/hCentrality"), cent); float globalNch = inputTracks.size(); - float pvTrack = coll.multNTracksPV(); + float pvTrack = coll.multNTracksPV(); - histos.fill(HIST("Rec/hNchPV_NchGlobal_before"), pvTrack, globalNch); - histos.fill(HIST("Rec/hcentFT0C_GlobalNch_before"), coll.centFT0C(), globalNch); - histos.fill(HIST("Rec/hcentFT0C_NchPV_before"), coll.centFT0C(), pvTrack); - - if (cfgEvSelMultCorrelation && !eventSelected(globalNch, pvTrack, cent)) { + histos.fill(HIST("Rec/hNchPV_NchGlobal_before"), pvTrack, globalNch); + histos.fill(HIST("Rec/hcentFT0C_GlobalNch_before"),coll.centFT0C(), globalNch); + histos.fill(HIST("Rec/hcentFT0C_NchPV_before"), coll.centFT0C(), pvTrack); + + if (cfgEvSelMultCorrelation && !eventSelected(globalNch, pvTrack, cent)) { return; - } + } - histos.fill(HIST("Rec/hNchPV_NchGlobal_after"), pvTrack, globalNch); - histos.fill(HIST("Rec/hcentFT0C_GlobalNch_after"), coll.centFT0C(), globalNch); - histos.fill(HIST("Rec/hcentFT0C_NchPV_after"), coll.centFT0C(), pvTrack); + histos.fill(HIST("Rec/hNchPV_NchGlobal_after"), pvTrack, globalNch); + histos.fill(HIST("Rec/hcentFT0C_GlobalNch_after"),coll.centFT0C(), globalNch); + histos.fill(HIST("Rec/hcentFT0C_NchPV_after"), coll.centFT0C(), pvTrack); double nch = 0., nchPi = 0., nchKa = 0., nchPr = 0., nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0.; double q1 = 0., q2 = 0.; @@ -1091,7 +1073,7 @@ struct EventMeanPtId { double var1 = 0., var2 = 0.; double var1Pi = 0., var2Pi = 0., var1Ka = 0., var2Ka = 0., var1Pr = 0., var2Pr = 0.; double sumPtWeight = 0., sumWeight = 0., sumPtPtWeight = 0., var1Eff = 0., var2Eff = 0.; - + int sample = histos.get(HIST("Rec/hZvtx_after_sel8"))->GetEntries(); sample = sample % 30; @@ -1102,40 +1084,37 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hITSchi2perCluster_before"), track.itsChi2NCl()); histos.fill(HIST("Rec/hTPCCrossedrows_before"), track.tpcNClsCrossedRows()); - if (std::fabs(track.eta()) <= cEtacut) { - nchEta++; + if (std::fabs(track.eta()) <= cEtacut) + { nchEta++; histos.fill(HIST("Rec/hnchTrue"), nchEta); } - if (track.pt() >= cPtmincut && track.pt() <= cPtmaxcut) { - nchPt += 1.; + if (track.pt() >= cPtmincut && track.pt() <= cPtmaxcut) + { nchPt += 1.; histos.fill(HIST("Rec/hnchTrue_pt"), nchPt); } - - if (!selTrack(track)) - continue; - - if (track.pt() >= cPtmincut1 && track.pt() <= cPtmaxcut1) { - nch += 1.; + + if (!selTrack(track)) continue; + + if (track.pt() >= cPtmincut1 && track.pt() <= cPtmaxcut1) + { nch += 1.; histos.fill(HIST("Rec/hnch"), nch); - histos.fill(HIST("Rec/hPtvar"), track.pt()); + histos.fill(HIST("Rec/hPtvar"), track.pt()); } - if (track.pt() < cPtmincut || track.pt() > cPtmaxcut) - continue; - + if (track.pt() < cPtmincut || track.pt() > cPtmaxcut) continue; + // if (std::fabs(track.y()) > 0.5) continue; histos.fill(HIST("hPt_rec"), track.pt()); histos.fill(HIST("hEta_rec"), track.eta()); double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); - if (eff < threshold) - continue; + if (eff < threshold) continue; double weight = 1.0 / eff; sumPtWeight += track.pt() * weight; sumPtPtWeight += (track.pt() * track.pt() * weight * weight); sumWeight += weight; - - histos.fill(HIST("hPt_rec_corr"), track.pt(), weight); - histos.fill(HIST("hEta_rec_corr"), track.eta(), weight); + + histos.fill(HIST("hPt_rec_corr"), track.pt() , weight); + histos.fill(HIST("hEta_rec_corr"), track.eta() , weight); auto mcParticle = track.mcParticle(); nchAll += 1.; @@ -1158,7 +1137,7 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hPEta"), track.p(), track.eta()); histos.fill(HIST("Rec/hNsigmaTPC"), track.p(), track.tpcNSigmaPr()); histos.fill(HIST("hPtEta_rec"), track.pt(), track.eta()); - + if (std::abs(mcParticle.pdgCode()) == PDG_t::kPiPlus) histos.fill(HIST("ptHistogramPionrec_pdg"), track.pt()); if (std::abs(mcParticle.pdgCode()) == PDG_t::kKPlus) @@ -1200,12 +1179,10 @@ struct EventMeanPtId { } if (selPion(track)) { - if (std::fabs(track.y()) > cRapidityCut05) - continue; - if (track.beta() > 1) - continue; + if (std::fabs(track.y()) > cRapidityCut05) continue; + if (track.beta() > 1) continue; histos.fill(HIST("ptHistogramPionrec"), track.pt()); - histos.fill(HIST("hPtEta_pi_rec"), track.pt(), track.eta()); + histos.fill(HIST("hPtEta_pi_rec"), track.pt(), track.eta()); histos.fill(HIST("Rec/hPtPion"), track.pt()); histos.fill(HIST("Rec/hEtaPion"), track.eta()); histos.fill(HIST("Rec/hyPion"), track.rapidity(massPi)); @@ -1216,14 +1193,14 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Rec/hTOFbeta_afterselection1"), track.p(), track.beta()); if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kPiPlus) { - histos.fill(HIST("ptHistogramPionrec_purity"), track.pt()); + histos.fill(HIST("ptHistogramPionrec_purity"), track.pt()); } nchPi += 1.; q1Pi += track.pt(); q2Pi += (track.pt() * track.pt()); - histos.fill(HIST("hPyPion_rec"), track.p(), track.rapidity(massPi)); - histos.fill(HIST("hPtyPion_rec"), track.pt(), track.rapidity(massPi)); + histos.fill(HIST("hPyPion_rec"), track.p(), track.rapidity(massPi)); + histos.fill(HIST("hPtyPion_rec"), track.pt(), track.rapidity(massPi)); } //===========================kaon=============================================================== @@ -1235,12 +1212,10 @@ struct EventMeanPtId { } if (selKaon(track)) { - if (std::fabs(track.y()) > cRapidityCut05) - continue; - if (track.beta() > 1) - continue; + if (std::fabs(track.y()) > cRapidityCut05) continue; + if (track.beta() > 1) continue; histos.fill(HIST("ptHistogramKaonrec"), track.pt()); - histos.fill(HIST("hPtEta_ka_rec"), track.pt(), track.eta()); + histos.fill(HIST("hPtEta_ka_rec"), track.pt(), track.eta()); histos.fill(HIST("Rec/hPtKaon"), track.pt()); histos.fill(HIST("Rec/hEtaKaon"), track.eta()); histos.fill(HIST("Rec/hyKaon"), track.rapidity(massKa)); @@ -1251,7 +1226,7 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Rec/hTOFbeta_afterselection1"), track.p(), track.beta()); if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kKPlus) { - histos.fill(HIST("ptHistogramKaonrec_purity"), track.pt()); + histos.fill(HIST("ptHistogramKaonrec_purity"), track.pt()); } nchKa += 1.; q1Ka += track.pt(); @@ -1270,12 +1245,10 @@ struct EventMeanPtId { } if (selProton(track)) { - if (std::fabs(track.y()) > cRapidityCut05) - continue; - if (track.beta() > 1) - continue; + if (std::fabs(track.y()) > cRapidityCut05) continue; + if (track.beta() > 1) continue; histos.fill(HIST("ptHistogramProtonrec"), track.pt()); - histos.fill(HIST("hPtEta_pr_rec"), track.pt(), track.eta()); + histos.fill(HIST("hPtEta_pr_rec"), track.pt(), track.eta()); histos.fill(HIST("Rec/hPtProton"), track.pt()); histos.fill(HIST("Rec/hEtaProton"), track.eta()); histos.fill(HIST("Rec/hyProton"), track.rapidity(massPr)); @@ -1286,7 +1259,7 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Rec/hTOFbeta_afterselection1"), track.p(), track.beta()); if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kProton) { - histos.fill(HIST("ptHistogramProtonrec_purity"), track.pt()); + histos.fill(HIST("ptHistogramProtonrec_purity"), track.pt()); } nchPr += 1.; q1Pr += track.pt(); @@ -1318,7 +1291,7 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hVar2"), sample, cent, var2); histos.fill(HIST("Rec/hVarc"), sample, cent); histos.fill(HIST("Rec/hVar2meanpt"), cent, var2); - + //---------------------- pions ---------------------------------------- if (nchPi >= cTwoPtlCut2) { var1Pi = (q1Pi * q1Pi - q2Pi) / (nchPi * (nchPi - 1)); @@ -1328,7 +1301,8 @@ struct EventMeanPtId { if (nchKa >= cTwoPtlCut2) { var1Ka = (q1Ka * q1Ka - q2Ka) / (nchKa * (nchKa - 1)); var2Ka = (q1Ka / nchKa); - } + + } //---------------------------- protons ---------------------------------- if (nchPr >= cTwoPtlCut2) { var1Pr = (q1Pr * q1Pr - q2Pr) / (nchPr * (nchPr - 1)); @@ -1378,7 +1352,7 @@ struct EventMeanPtId { histos.fill(HIST("hEffVar1x_Naccorr_xaxis_rec"), sample, sumWeight, var1); histos.fill(HIST("hEffVar2x_Naccorr_xaxis_rec"), sample, sumWeight, var2); histos.fill(HIST("hEffVarx_Naccorr_xaxis_rec"), sample, sumWeight); - + //================= generated level============================== const auto& mccolgen = coll.mcCollision_as(); @@ -1405,7 +1379,7 @@ struct EventMeanPtId { } nch1++; histos.fill(HIST("hnch_afterPhysPrimary"), nch1); - + int pid = mcpart.pdgCode(); auto sign = 0; auto* pd = pdg->GetParticle(pid); @@ -1416,19 +1390,17 @@ struct EventMeanPtId { continue; } // histos.fill(HIST("gen_hSign"), sign); - if (std::fabs(mcpart.eta()) > cEtacut) - continue; + if (std::fabs(mcpart.eta()) > cEtacut) continue; nchGenTrue++; histos.fill(HIST("hnch_gen_after_etacut"), nchGenTrue); - if (mcpart.pt() >= cPtmincut1 && mcpart.pt() <= cPtmaxcut1) { - nchgen += 1.; + if (mcpart.pt() >= cPtmincut1 && mcpart.pt() <= cPtmaxcut1) + { nchgen += 1.; histos.fill(HIST("hnch_gen"), nchgen); - histos.fill(HIST("hPtvar_gen"), mcpart.pt()); + histos.fill(HIST("hPtvar_gen"), mcpart.pt()); } - if ((mcpart.pt() < cPtmincut) || (mcpart.pt() > cPtmaxcut)) - continue; + if ((mcpart.pt() < cPtmincut) || (mcpart.pt() > cPtmaxcut)) continue; histos.fill(HIST("hPt_gen"), mcpart.pt()); histos.fill(HIST("hEta_gen"), mcpart.eta()); histos.fill(HIST("ptHistogram_allcharge_gen"), mcpart.pt()); @@ -1442,7 +1414,7 @@ struct EventMeanPtId { if (mcpart.pdgCode() == PDG_t::kPiPlus || mcpart.pdgCode() == PDG_t::kPiMinus) { histos.fill(HIST("ptHistogramPion"), mcpart.pt()); - histos.fill(HIST("hPtEta_pi_gen"), mcpart.pt(), mcpart.eta()); + histos.fill(HIST("hPtEta_pi_gen"), mcpart.pt(), mcpart.eta()); histos.fill(HIST("hPty_pi_gen"), mcpart.pt(), mcpart.y()); nchPiGen += 1.; q1PiGen += mcpart.pt(); @@ -1452,8 +1424,8 @@ struct EventMeanPtId { if (mcpart.pdgCode() == PDG_t::kKPlus || mcpart.pdgCode() == PDG_t::kKMinus) { histos.fill(HIST("ptHistogramKaon"), mcpart.pt()); - histos.fill(HIST("hPtEta_ka_gen"), mcpart.pt(), mcpart.eta()); - histos.fill(HIST("hPty_ka_gen"), mcpart.pt(), mcpart.y()); + histos.fill(HIST("hPtEta_ka_gen"), mcpart.pt(), mcpart.eta()); + histos.fill(HIST("hPty_ka_gen"), mcpart.pt(), mcpart.y()); nchKaGen += 1.; q1KaGen += mcpart.pt(); q2KaGen += (mcpart.pt() * mcpart.pt()); @@ -1462,8 +1434,8 @@ struct EventMeanPtId { if (mcpart.pdgCode() == PDG_t::kProton || mcpart.pdgCode() == PDG_t::kProtonBar) { histos.fill(HIST("ptHistogramProton"), mcpart.pt()); - histos.fill(HIST("hPtEta_pr_gen"), mcpart.pt(), mcpart.eta()); - histos.fill(HIST("hPty_pr_gen"), mcpart.pt(), mcpart.y()); + histos.fill(HIST("hPtEta_pr_gen"), mcpart.pt(), mcpart.eta()); + histos.fill(HIST("hPty_pr_gen"), mcpart.pt(), mcpart.y()); nchPrGen += 1.; q1PrGen += mcpart.pt(); q2PrGen += (mcpart.pt() * mcpart.pt()); @@ -1486,7 +1458,7 @@ struct EventMeanPtId { histos.fill(HIST("hterm1_gen"), nchGenAll, var1AllGen); histos.fill(HIST("hterm2_gen"), nchGenAll, var2AllGen); - //--------------------------Pions------------------------------------------- +//--------------------------Pions------------------------------------------- if (nchPiGen >= cTwoPtlCut2) { var1PiGen = (q1PiGen * q1PiGen - q2PiGen) / (nchPiGen * (nchPiGen - 1)); var2PiGen = (q1PiGen / nchPiGen); @@ -1525,7 +1497,8 @@ struct EventMeanPtId { } // void process PROCESS_SWITCH(EventMeanPtId, processMcReco, "Process reconstructed", false); -}; + + }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { From fc4854f48b05b9503ea978c45853114858aa0bd1 Mon Sep 17 00:00:00 2001 From: sweta29singh Date: Wed, 8 Oct 2025 14:19:08 +0530 Subject: [PATCH 4/8] Mean pT Fluctuations --- .../EbyEFluctuations/Tasks/eventMeanPtId.cxx | 381 ++++++++++-------- 1 file changed, 204 insertions(+), 177 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx index f36087eed7c..bf93bf8bc89 100644 --- a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx @@ -38,8 +38,8 @@ #include "Framework/RunningWorkflowInfo.h" #include "Framework/runDataProcessing.h" -#include #include "TF1.h" +#include #include #include @@ -69,8 +69,8 @@ struct EventMeanPtId { O2_DEFINE_CONFIGURABLE(cfgMultGlobalPVCutEnabled, bool, true, "Enable globalTracks vs PV multiplicity cut") Configurable> cfgMultPVFT0CCutPars{"cfgMultPVFT0CCutPars", - std::vector{3303.11, -121.316, 1.90207, -0.0152644, 5.10121e-05, 190.633, -4.32972, 0.0340001, -5.83261e-05, -3.19566e-07}, - "PV multiplicity vs T0C centrality cut parameter values"}; + std::vector{3303.11, -121.316, 1.90207, -0.0152644, 5.10121e-05, 190.633, -4.32972, 0.0340001, -5.83261e-05, -3.19566e-07}, + "PV multiplicity vs T0C centrality cut parameter values"}; Configurable> cfgMultGlobalFT0CCutPars{"cfgMultGlobalFT0CCutPars", std::vector{1893.97, -61.3423, 0.790664, -0.00507208, 1.41683e-05, 167.997, -5.29125, 0.0840145, -0.000748102, 2.75743e-06}, @@ -92,37 +92,34 @@ struct EventMeanPtId { TF1* fMultGlobalPVCutHigh = nullptr; } cfgFunCoeff; - Service ccdb; Service pdg; - Filter collisionFilter = nabs(aod::collision::posZ) <= cVtxZcut; - Filter trackFilter = (nabs(aod::track::eta) < cEtacut) && (aod::track::pt > ptMin) && (aod::track::pt < ptMax) && (requireGlobalTrackInFilter()); - -using MyCollisions = soa::Filtered>; -using MyCollision = MyCollisions::iterator; - -using MyTracks = soa::Filtered>; -using MyTrack = MyTracks::iterator; + Filter collisionFilter = nabs(aod::collision::posZ) <= cVtxZcut; + Filter trackFilter = (nabs(aod::track::eta) < cEtacut) && (aod::track::pt > ptMin) && (aod::track::pt < ptMax) && (requireGlobalTrackInFilter()); + using MyCollisions = soa::Filtered>; + using MyCollision = MyCollisions::iterator; -using MyMCRecoCollisions = soa::Filtered>; -using MyMCRecoCollision = MyMCRecoCollisions::iterator; + using MyTracks = soa::Filtered>; + using MyTrack = MyTracks::iterator; -using MyMCRecoTracks = soa::Filtered>; -using MyMCRecoTrack = MyMCRecoTracks::iterator; + using MyMCRecoCollisions = soa::Filtered>; + using MyMCRecoCollision = MyMCRecoCollisions::iterator; -using EventCandidatesMC = soa::Join; + using MyMCRecoTracks = soa::Filtered>; + using MyMCRecoTrack = MyMCRecoTracks::iterator; + using EventCandidatesMC = soa::Join; Configurable ccdbNoLaterThan{"ccdbNoLaterThan", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; Configurable cfgUrlCCDB{"cfgUrlCCDB", "http://alice-ccdb.cern.ch", "url of ccdb"}; @@ -137,7 +134,6 @@ using EventCandidatesMC = soa::Join> ptBins{"ptBins", {0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50, 0.55, 0.60, 0.65, 0.70, 0.75, 0.80, 0.85, 0.90, 0.95, 1.00, 1.05, 1.10, 1.15, 1.20, 1.25, 1.30, 1.35, 1.40, 1.45, 1.50, 1.55, 1.60, 1.65, 1.70, 1.75, 1.80, 1.85, 1.90, 1.95, 2.00}, "p_{T} bins"}; Configurable piluprejection{"piluprejection", false, "Pileup rejection"}; - void init(o2::framework::InitContext&) { if (cfgLoadEff) { @@ -150,14 +146,14 @@ using EventCandidatesMC = soa::JoingetForTimeStamp(cfgPathCCDB.value, -1); ptHistogramAllchargeRec = reinterpret_cast(lst->FindObject("hPtEta_rec")); - } + } std::vector ptBinning = {0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0}; // AxisSpec ptAxis = {ptBinning, "#it{p}_{T} (GeV/#it{c})"}; AxisSpec vtxZAxis = {100, -20.0, 20.0, "Z (cm)"}; AxisSpec dcaAxis = {1002, -5.01, 5.01, "DCA_{xy} (cm)"}; AxisSpec dcazAxis = {1002, -5.01, 5.01, "DCA_{z} (cm)"}; - AxisSpec ptAxis = {600, 0.0, 6.0, "#it{p}_{T} (GeV/#it{c})"};// 600,0,6 + AxisSpec ptAxis = {600, 0.0, 6.0, "#it{p}_{T} (GeV/#it{c})"}; // 600,0,6 AxisSpec pAxis = {400, 0.0, 4.0, "#it{p} (GeV/#it{c})"}; AxisSpec betaAxis = {200, 0.0, 2.0, "TOF_{#beta} (GeV/#it{c})"}; AxisSpec dEdxAxis = {2000, 0.0, 200.0, "dE/dx (GeV/#it{c})"}; @@ -301,10 +297,10 @@ using EventCandidatesMC = soa::Join cSigmaLowHighcut{"cSigmaLowHighcut", 3.0f, "lower and upper sigma cut"}; - cfgFunCoeff.fMultPVFT0CCutLow = new TF1("fMultPVFT0CCutLow", @@ -473,10 +468,9 @@ using EventCandidatesMC = soa::JoinSetParameters(&(cfgFunCoeff.multGlobalPVCutPars[0])); + } - } - - // Configurables + // Configurables Configurable cVtxZcut{"cVtxZcut", 10.0f, "Vertex Z"}; Configurable cEtacut{"cEtacut", 0.8f, "Eta cut"}; Configurable cPtmincut{"cPtmincut", 0.15f, "Pt min cut"}; @@ -536,7 +530,7 @@ using EventCandidatesMC = soa::Join nchMin{"nchMin", 0.0, "Minimum value for nch axis"}; Configurable nchMax{"nchMax", 4000.0, "Maximum value for nch axis"}; -bool eventSelected(const float& globalNch, const float& pvTrack, const float& centrality) + bool eventSelected(const float& globalNch, const float& pvTrack, const float& centrality) { if (cfgFunCoeff.cfgMultPVFT0CCutEnabled) { @@ -574,12 +568,12 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce } // Reject the collisions with large vertex-z histos.fill(HIST("hEventcounter"), 2.); - if(ccentFT0C) { - cent = coll.centFT0C(); //centrality from FT0C + if (ccentFT0C) { + cent = coll.centFT0C(); // centrality from FT0C } else { - cent = coll.centFT0M(); //centrality from FT0M - } - + cent = coll.centFT0M(); // centrality from FT0M + } + if (cSel8Trig && !coll.sel8()) { return false; } // require min bias trigger @@ -607,7 +601,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce return false; } histos.fill(HIST("trackSelRec"), 7); - + // if (cItslayerall && !coll.selection_bit(aod::evsel::kIsGoodITSLayersAll)) {return false;} histos.fill(HIST("trackSelRec"), 8); @@ -627,41 +621,59 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce } // accept only global tracks histos.fill(HIST("tracksel"), 2); - if (cDCAxy && std::fabs(track.dcaXY()) > cDcaXYcut) {return false;} + if (cDCAxy && std::fabs(track.dcaXY()) > cDcaXYcut) { + return false; + } histos.fill(HIST("tracksel"), 3); - if (cDCAz && std::fabs(track.dcaZ()) > cDcaZcut) {return false;} + if (cDCAz && std::fabs(track.dcaZ()) > cDcaZcut) { + return false; + } histos.fill(HIST("tracksel"), 4); if (std::fabs(track.eta()) >= cEtacut) { return false; } histos.fill(HIST("tracksel"), 5); - - if (cTPCcr && track.tpcNClsCrossedRows() < cTPCcrosscut) {return false;} + + if (cTPCcr && track.tpcNClsCrossedRows() < cTPCcrosscut) { + return false; + } histos.fill(HIST("tracksel"), 6); - if (cITSchi && track.itsChi2NCl() >= cItsChiCut) {return false;} + if (cITSchi && track.itsChi2NCl() >= cItsChiCut) { + return false; + } histos.fill(HIST("tracksel"), 7); - if (cTPCchi && track.tpcChi2NCl() >= cTpcChiCut) {return false;} + if (cTPCchi && track.tpcChi2NCl() >= cTpcChiCut) { + return false; + } histos.fill(HIST("tracksel"), 8); - if (track.sign() == 0) {return false;} + if (track.sign() == 0) { + return false; + } - if(cPVContributor) - { if (!(track.isPVContributor())) {return false;} - histos.fill(HIST("tracksel"), 9); + if (cPVContributor) { + if (!(track.isPVContributor())) { + return false; + } + histos.fill(HIST("tracksel"), 9); } if (citsNCluster) { - if (track.itsNCls() < cnITSClustersCut) { return false; } - histos.fill(HIST("tracksel"), 10); + if (track.itsNCls() < cnITSClustersCut) { + return false; + } + histos.fill(HIST("tracksel"), 10); } - if(ctpcNClusterFound) { - if (track.tpcNClsFound() < ctpcNClsCut) {return false;} - histos.fill(HIST("tracksel"), 11); + if (ctpcNClusterFound) { + if (track.tpcNClsFound() < ctpcNClsCut) { + return false; + } + histos.fill(HIST("tracksel"), 11); } return true; // if all checks pass, accept the collision @@ -757,60 +769,60 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce return false; } - double getEfficiency(double pt, double eta, TH2D* ptHistogramAllchargeRec) + double getEfficiency(double pt, double eta, TH2D* ptHistogramAllchargeRec) { - int xbin = ptHistogramAllchargeRec->GetXaxis()->FindBin(pt); - int ybin = ptHistogramAllchargeRec->GetYaxis()->FindBin(eta); + int xbin = ptHistogramAllchargeRec->GetXaxis()->FindBin(pt); + int ybin = ptHistogramAllchargeRec->GetYaxis()->FindBin(eta); - if(xbin < 1 || xbin > ptHistogramAllchargeRec->GetNbinsX() || ybin < 1 || ybin > ptHistogramAllchargeRec->GetNbinsY()) { + if (xbin < 1 || xbin > ptHistogramAllchargeRec->GetNbinsX() || ybin < 1 || ybin > ptHistogramAllchargeRec->GetNbinsY()) { LOGF(warn, "pt or eta out of histograms bounds : %f, eta = %f", pt, eta); return 1e-6; - } - double eff = ptHistogramAllchargeRec->GetBinContent(xbin, ybin); - return (eff > 0) ? eff : 1e-6; // Avoid division by zero + } + double eff = ptHistogramAllchargeRec->GetBinContent(xbin, ybin); + return (eff > 0) ? eff : 1e-6; // Avoid division by zero } - //++++++++++++++++++++++++++++++++++++DATA CALCULATION +++++++++++++++++++++++++++++++++++++++++++++++++++++// - void processData(MyCollision const& coll, MyTracks const& inputTracks) + //++++++++++++++++++++++++++++++++++++DATA CALCULATION +++++++++++++++++++++++++++++++++++++++++++++++++++++// + void processData(MyCollision const& coll, MyTracks const& inputTracks) - { float cent = -1; + { + float cent = -1; histos.fill(HIST("hEventcounter"), 1.); histos.fill(HIST("Data/hZvtx_before_sel"), coll.posZ()); - if (!selCollision(coll,cent)) + if (!selCollision(coll, cent)) return; { histos.fill(HIST("Data/hZvtx_after_sel8"), coll.posZ()); - } + } histos.fill(HIST("Data/hCentrality"), cent); - float globalNch = inputTracks.size(); - float pvTrack = coll.multNTracksPV(); + float globalNch = inputTracks.size(); + float pvTrack = coll.multNTracksPV(); - histos.fill(HIST("Data/hNchPV_NchGlobal_before"), pvTrack, globalNch); - histos.fill(HIST("Data/hcentFT0C_GlobalNch_before"),coll.centFT0C(), globalNch); - histos.fill(HIST("Data/hcentFT0C_NchPV_before"), coll.centFT0C(), pvTrack); + histos.fill(HIST("Data/hNchPV_NchGlobal_before"), pvTrack, globalNch); + histos.fill(HIST("Data/hcentFT0C_GlobalNch_before"), coll.centFT0C(), globalNch); + histos.fill(HIST("Data/hcentFT0C_NchPV_before"), coll.centFT0C(), pvTrack); - - if (cfgEvSelMultCorrelation && !eventSelected(globalNch, pvTrack, cent)) { + if (cfgEvSelMultCorrelation && !eventSelected(globalNch, pvTrack, cent)) { return; - } + } + + histos.fill(HIST("Data/hNchPV_NchGlobal_after"), pvTrack, globalNch); + histos.fill(HIST("Data/hcentFT0C_GlobalNch_after"), coll.centFT0C(), globalNch); + histos.fill(HIST("Data/hcentFT0C_NchPV_after"), coll.centFT0C(), pvTrack); - histos.fill(HIST("Data/hNchPV_NchGlobal_after"), pvTrack, globalNch); - histos.fill(HIST("Data/hcentFT0C_GlobalNch_after"),coll.centFT0C(), globalNch); - histos.fill(HIST("Data/hcentFT0C_NchPV_after"), coll.centFT0C(), pvTrack); - - double nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0., nch = 0., nchPi = 0., nchKa = 0., nchPr = 0.; + double nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0., nch = 0., nchPi = 0., nchKa = 0., nchPr = 0.; double q1 = 0., q2 = 0., var1 = 0., var2 = 0.; double sumPtWeight = 0., sumWeight = 0., sumPtPtWeight = 0., var1Eff = 0., var2Eff = 0.; double q1Pi = 0., q2Pi = 0., var1Pi = 0., var2Pi = 0.; - double q1Ka = 0., q2Ka = 0., var1Ka = 0., var2Ka = 0.; + double q1Ka = 0., q2Ka = 0., var1Ka = 0., var2Ka = 0.; double q1Pr = 0., q2Pr = 0., var1Pr = 0., var2Pr = 0.; int sample = histos.get(HIST("Data/hZvtx_after_sel8"))->GetEntries(); - sample = sample % 30; - + sample = sample % 30; + for (const auto& track : inputTracks) { nchAllBfCut += 1.; histos.fill(HIST("Data/hnchAll_bf_cut"), nchAllBfCut); @@ -819,7 +831,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Data/hTPCchi2perCluster_before"), track.tpcChi2NCl()); histos.fill(HIST("Data/hITSchi2perCluster_before"), track.itsChi2NCl()); histos.fill(HIST("Data/hTPCCrossedrows_before"), track.tpcNClsCrossedRows()); - + if (std::fabs(track.eta()) <= cEtacut) { nchEta++; histos.fill(HIST("Data/hnchTrue"), nchEta); @@ -828,16 +840,18 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce nchPt += 1.; histos.fill(HIST("Data/hnchTrue_pt"), nchPt); } - if (!selTrack(track)) continue; - - if (track.pt() >= cPtmincut1 && track.pt() <= cPtmaxcut1) - { nch += 1.; + if (!selTrack(track)) + continue; + + if (track.pt() >= cPtmincut1 && track.pt() <= cPtmaxcut1) { + nch += 1.; histos.fill(HIST("Data/hnch"), nch); - histos.fill(HIST("Data/hPtvar"), track.pt()); + histos.fill(HIST("Data/hPtvar"), track.pt()); } - - if (track.pt() < cPtmincut || track.pt() > cPtmaxcut) continue; - + + if (track.pt() < cPtmincut || track.pt() > cPtmaxcut) + continue; + nchAll += 1.; q1 += track.pt(); q2 += (track.pt() * track.pt()); @@ -857,13 +871,13 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Data/hPEta"), track.p(), track.eta()); histos.fill(HIST("Data/hNsigmaTPC"), track.p(), track.tpcNSigmaPr()); - double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); + double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); if (eff < threshold) - continue; - double weight = 1./eff; + continue; + double weight = 1. / eff; sumPtWeight += track.pt() / eff; sumPtPtWeight += (track.pt() * track.pt()) / (eff * eff); - sumWeight += weight; + sumWeight += weight; // only TPC tracks: Pion, Kaon, Proton if (track.hasTPC() && std::abs(track.tpcNSigmaPi()) < cNSigCut3) @@ -947,22 +961,22 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Data/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Data/hTOFbeta_afterselection1"), track.p(), track.beta()); } - + } // Track loop ends! histos.fill(HIST("Data/hcentFV0A_nacc"), coll.multFV0A(), nchAll); histos.fill(HIST("Data/hcentFT0A_nacc"), coll.multFT0A(), nchAll); histos.fill(HIST("Data/hcentFT0M_nacc"), coll.centFT0M(), nchAll); histos.fill(HIST("Data/hcent_nacc"), cent, nchAll); - if (nchAll < cTwoPtlCut2) + if (nchAll < cTwoPtlCut2) return; var1 = (q1 * q1 - q2) / (nchAll * (nchAll - 1)); var2 = (q1 / nchAll); - - //------------------ Efficiency corrected histograms --------------- + + //------------------ Efficiency corrected histograms --------------- var1Eff = (sumPtWeight * sumPtWeight - sumPtPtWeight) / (sumWeight * (sumWeight - 1)); var2Eff = (sumPtWeight / sumWeight); - + //---------------------- pions ---------------------------------------- if (nchPi >= cTwoPtlCut2) { var1Pi = (q1Pi * q1Pi - q2Pi) / (nchPi * (nchPi - 1)); @@ -978,8 +992,8 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce var1Pr = (q1Pr * q1Pr - q2Pr) / (nchPr * (nchPr - 1)); var2Pr = (q1Pr / nchPr); } - - //------------------ all charges------------------------------------- + + //------------------ all charges------------------------------------- histos.fill(HIST("Data/hVar1"), sample, cent, var1); histos.fill(HIST("Data/hVar2"), sample, cent, var2); histos.fill(HIST("Data/hVarc"), sample, cent); @@ -1002,7 +1016,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Data/hdiffVar1x"), sample, nch, var1); histos.fill(HIST("Data/hdiffVar2x"), sample, nch, var2); histos.fill(HIST("Data/hdiffVarx"), sample, nch); - + histos.fill(HIST("hEffVar1x_data"), sample, nchAll, var1Eff); histos.fill(HIST("hEffVar2x_data"), sample, nchAll, var2Eff); histos.fill(HIST("hEffVarx_data"), sample, nchAll); @@ -1034,38 +1048,42 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce } // event loop ends! PROCESS_SWITCH(EventMeanPtId, processData, "process real data information", true); - + //++++++++++++++++++++++++++++++++++++MC Reconstructed +++++++++++++++++++++++++++++++++++++++++++++++++++++// - SliceCache cache; - Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; - void processMcReco(MyMCRecoCollision const& coll, MyMCRecoTracks const& inputTracks, aod::McCollisions const& mcCollisions, aod::McParticles const& mcParticles) - { float cent = -1; + SliceCache cache; + Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; + void processMcReco(MyMCRecoCollision const& coll, MyMCRecoTracks const& inputTracks, aod::McCollisions const& mcCollisions, aod::McParticles const& mcParticles) + { + float cent = -1; (void)mcCollisions; - if (!coll.has_mcCollision()) {return;} - + if (!coll.has_mcCollision()) { + return; + } + histos.fill(HIST("Rec/hZvtx_before_sel"), coll.posZ()); histos.fill(HIST("hVtxZ_before_gen"), coll.mcCollision().posZ()); - histos.fill(HIST("hCentrality_rec_before"), cent); + histos.fill(HIST("hCentrality_rec_before"), cent); - if (!selCollision(coll,cent)) return; + if (!selCollision(coll, cent)) + return; histos.fill(HIST("Rec/hZvtx_after_sel8"), coll.posZ()); - histos.fill(HIST("Rec/hCentrality"), cent); + histos.fill(HIST("Rec/hCentrality"), cent); float globalNch = inputTracks.size(); - float pvTrack = coll.multNTracksPV(); + float pvTrack = coll.multNTracksPV(); - histos.fill(HIST("Rec/hNchPV_NchGlobal_before"), pvTrack, globalNch); - histos.fill(HIST("Rec/hcentFT0C_GlobalNch_before"),coll.centFT0C(), globalNch); - histos.fill(HIST("Rec/hcentFT0C_NchPV_before"), coll.centFT0C(), pvTrack); - - if (cfgEvSelMultCorrelation && !eventSelected(globalNch, pvTrack, cent)) { + histos.fill(HIST("Rec/hNchPV_NchGlobal_before"), pvTrack, globalNch); + histos.fill(HIST("Rec/hcentFT0C_GlobalNch_before"), coll.centFT0C(), globalNch); + histos.fill(HIST("Rec/hcentFT0C_NchPV_before"), coll.centFT0C(), pvTrack); + + if (cfgEvSelMultCorrelation && !eventSelected(globalNch, pvTrack, cent)) { return; - } + } - histos.fill(HIST("Rec/hNchPV_NchGlobal_after"), pvTrack, globalNch); - histos.fill(HIST("Rec/hcentFT0C_GlobalNch_after"),coll.centFT0C(), globalNch); - histos.fill(HIST("Rec/hcentFT0C_NchPV_after"), coll.centFT0C(), pvTrack); + histos.fill(HIST("Rec/hNchPV_NchGlobal_after"), pvTrack, globalNch); + histos.fill(HIST("Rec/hcentFT0C_GlobalNch_after"), coll.centFT0C(), globalNch); + histos.fill(HIST("Rec/hcentFT0C_NchPV_after"), coll.centFT0C(), pvTrack); double nch = 0., nchPi = 0., nchKa = 0., nchPr = 0., nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0.; double q1 = 0., q2 = 0.; @@ -1073,7 +1091,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce double var1 = 0., var2 = 0.; double var1Pi = 0., var2Pi = 0., var1Ka = 0., var2Ka = 0., var1Pr = 0., var2Pr = 0.; double sumPtWeight = 0., sumWeight = 0., sumPtPtWeight = 0., var1Eff = 0., var2Eff = 0.; - + int sample = histos.get(HIST("Rec/hZvtx_after_sel8"))->GetEntries(); sample = sample % 30; @@ -1084,37 +1102,40 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Rec/hITSchi2perCluster_before"), track.itsChi2NCl()); histos.fill(HIST("Rec/hTPCCrossedrows_before"), track.tpcNClsCrossedRows()); - if (std::fabs(track.eta()) <= cEtacut) - { nchEta++; + if (std::fabs(track.eta()) <= cEtacut) { + nchEta++; histos.fill(HIST("Rec/hnchTrue"), nchEta); } - if (track.pt() >= cPtmincut && track.pt() <= cPtmaxcut) - { nchPt += 1.; + if (track.pt() >= cPtmincut && track.pt() <= cPtmaxcut) { + nchPt += 1.; histos.fill(HIST("Rec/hnchTrue_pt"), nchPt); } - - if (!selTrack(track)) continue; - - if (track.pt() >= cPtmincut1 && track.pt() <= cPtmaxcut1) - { nch += 1.; + + if (!selTrack(track)) + continue; + + if (track.pt() >= cPtmincut1 && track.pt() <= cPtmaxcut1) { + nch += 1.; histos.fill(HIST("Rec/hnch"), nch); - histos.fill(HIST("Rec/hPtvar"), track.pt()); + histos.fill(HIST("Rec/hPtvar"), track.pt()); } - if (track.pt() < cPtmincut || track.pt() > cPtmaxcut) continue; - + if (track.pt() < cPtmincut || track.pt() > cPtmaxcut) + continue; + // if (std::fabs(track.y()) > 0.5) continue; histos.fill(HIST("hPt_rec"), track.pt()); histos.fill(HIST("hEta_rec"), track.eta()); double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); - if (eff < threshold) continue; + if (eff < threshold) + continue; double weight = 1.0 / eff; sumPtWeight += track.pt() * weight; sumPtPtWeight += (track.pt() * track.pt() * weight * weight); sumWeight += weight; - - histos.fill(HIST("hPt_rec_corr"), track.pt() , weight); - histos.fill(HIST("hEta_rec_corr"), track.eta() , weight); + + histos.fill(HIST("hPt_rec_corr"), track.pt(), weight); + histos.fill(HIST("hEta_rec_corr"), track.eta(), weight); auto mcParticle = track.mcParticle(); nchAll += 1.; @@ -1137,7 +1158,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Rec/hPEta"), track.p(), track.eta()); histos.fill(HIST("Rec/hNsigmaTPC"), track.p(), track.tpcNSigmaPr()); histos.fill(HIST("hPtEta_rec"), track.pt(), track.eta()); - + if (std::abs(mcParticle.pdgCode()) == PDG_t::kPiPlus) histos.fill(HIST("ptHistogramPionrec_pdg"), track.pt()); if (std::abs(mcParticle.pdgCode()) == PDG_t::kKPlus) @@ -1179,10 +1200,12 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce } if (selPion(track)) { - if (std::fabs(track.y()) > cRapidityCut05) continue; - if (track.beta() > 1) continue; + if (std::fabs(track.y()) > cRapidityCut05) + continue; + if (track.beta() > 1) + continue; histos.fill(HIST("ptHistogramPionrec"), track.pt()); - histos.fill(HIST("hPtEta_pi_rec"), track.pt(), track.eta()); + histos.fill(HIST("hPtEta_pi_rec"), track.pt(), track.eta()); histos.fill(HIST("Rec/hPtPion"), track.pt()); histos.fill(HIST("Rec/hEtaPion"), track.eta()); histos.fill(HIST("Rec/hyPion"), track.rapidity(massPi)); @@ -1193,14 +1216,14 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Rec/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Rec/hTOFbeta_afterselection1"), track.p(), track.beta()); if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kPiPlus) { - histos.fill(HIST("ptHistogramPionrec_purity"), track.pt()); + histos.fill(HIST("ptHistogramPionrec_purity"), track.pt()); } nchPi += 1.; q1Pi += track.pt(); q2Pi += (track.pt() * track.pt()); - histos.fill(HIST("hPyPion_rec"), track.p(), track.rapidity(massPi)); - histos.fill(HIST("hPtyPion_rec"), track.pt(), track.rapidity(massPi)); + histos.fill(HIST("hPyPion_rec"), track.p(), track.rapidity(massPi)); + histos.fill(HIST("hPtyPion_rec"), track.pt(), track.rapidity(massPi)); } //===========================kaon=============================================================== @@ -1212,10 +1235,12 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce } if (selKaon(track)) { - if (std::fabs(track.y()) > cRapidityCut05) continue; - if (track.beta() > 1) continue; + if (std::fabs(track.y()) > cRapidityCut05) + continue; + if (track.beta() > 1) + continue; histos.fill(HIST("ptHistogramKaonrec"), track.pt()); - histos.fill(HIST("hPtEta_ka_rec"), track.pt(), track.eta()); + histos.fill(HIST("hPtEta_ka_rec"), track.pt(), track.eta()); histos.fill(HIST("Rec/hPtKaon"), track.pt()); histos.fill(HIST("Rec/hEtaKaon"), track.eta()); histos.fill(HIST("Rec/hyKaon"), track.rapidity(massKa)); @@ -1226,7 +1251,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Rec/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Rec/hTOFbeta_afterselection1"), track.p(), track.beta()); if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kKPlus) { - histos.fill(HIST("ptHistogramKaonrec_purity"), track.pt()); + histos.fill(HIST("ptHistogramKaonrec_purity"), track.pt()); } nchKa += 1.; q1Ka += track.pt(); @@ -1245,10 +1270,12 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce } if (selProton(track)) { - if (std::fabs(track.y()) > cRapidityCut05) continue; - if (track.beta() > 1) continue; + if (std::fabs(track.y()) > cRapidityCut05) + continue; + if (track.beta() > 1) + continue; histos.fill(HIST("ptHistogramProtonrec"), track.pt()); - histos.fill(HIST("hPtEta_pr_rec"), track.pt(), track.eta()); + histos.fill(HIST("hPtEta_pr_rec"), track.pt(), track.eta()); histos.fill(HIST("Rec/hPtProton"), track.pt()); histos.fill(HIST("Rec/hEtaProton"), track.eta()); histos.fill(HIST("Rec/hyProton"), track.rapidity(massPr)); @@ -1259,7 +1286,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Rec/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Rec/hTOFbeta_afterselection1"), track.p(), track.beta()); if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kProton) { - histos.fill(HIST("ptHistogramProtonrec_purity"), track.pt()); + histos.fill(HIST("ptHistogramProtonrec_purity"), track.pt()); } nchPr += 1.; q1Pr += track.pt(); @@ -1291,7 +1318,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Rec/hVar2"), sample, cent, var2); histos.fill(HIST("Rec/hVarc"), sample, cent); histos.fill(HIST("Rec/hVar2meanpt"), cent, var2); - + //---------------------- pions ---------------------------------------- if (nchPi >= cTwoPtlCut2) { var1Pi = (q1Pi * q1Pi - q2Pi) / (nchPi * (nchPi - 1)); @@ -1301,8 +1328,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce if (nchKa >= cTwoPtlCut2) { var1Ka = (q1Ka * q1Ka - q2Ka) / (nchKa * (nchKa - 1)); var2Ka = (q1Ka / nchKa); - - } + } //---------------------------- protons ---------------------------------- if (nchPr >= cTwoPtlCut2) { var1Pr = (q1Pr * q1Pr - q2Pr) / (nchPr * (nchPr - 1)); @@ -1352,7 +1378,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("hEffVar1x_Naccorr_xaxis_rec"), sample, sumWeight, var1); histos.fill(HIST("hEffVar2x_Naccorr_xaxis_rec"), sample, sumWeight, var2); histos.fill(HIST("hEffVarx_Naccorr_xaxis_rec"), sample, sumWeight); - + //================= generated level============================== const auto& mccolgen = coll.mcCollision_as(); @@ -1379,7 +1405,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce } nch1++; histos.fill(HIST("hnch_afterPhysPrimary"), nch1); - + int pid = mcpart.pdgCode(); auto sign = 0; auto* pd = pdg->GetParticle(pid); @@ -1390,17 +1416,19 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce continue; } // histos.fill(HIST("gen_hSign"), sign); - if (std::fabs(mcpart.eta()) > cEtacut) continue; + if (std::fabs(mcpart.eta()) > cEtacut) + continue; nchGenTrue++; histos.fill(HIST("hnch_gen_after_etacut"), nchGenTrue); - if (mcpart.pt() >= cPtmincut1 && mcpart.pt() <= cPtmaxcut1) - { nchgen += 1.; + if (mcpart.pt() >= cPtmincut1 && mcpart.pt() <= cPtmaxcut1) { + nchgen += 1.; histos.fill(HIST("hnch_gen"), nchgen); - histos.fill(HIST("hPtvar_gen"), mcpart.pt()); + histos.fill(HIST("hPtvar_gen"), mcpart.pt()); } - if ((mcpart.pt() < cPtmincut) || (mcpart.pt() > cPtmaxcut)) continue; + if ((mcpart.pt() < cPtmincut) || (mcpart.pt() > cPtmaxcut)) + continue; histos.fill(HIST("hPt_gen"), mcpart.pt()); histos.fill(HIST("hEta_gen"), mcpart.eta()); histos.fill(HIST("ptHistogram_allcharge_gen"), mcpart.pt()); @@ -1414,7 +1442,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce if (mcpart.pdgCode() == PDG_t::kPiPlus || mcpart.pdgCode() == PDG_t::kPiMinus) { histos.fill(HIST("ptHistogramPion"), mcpart.pt()); - histos.fill(HIST("hPtEta_pi_gen"), mcpart.pt(), mcpart.eta()); + histos.fill(HIST("hPtEta_pi_gen"), mcpart.pt(), mcpart.eta()); histos.fill(HIST("hPty_pi_gen"), mcpart.pt(), mcpart.y()); nchPiGen += 1.; q1PiGen += mcpart.pt(); @@ -1424,8 +1452,8 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce if (mcpart.pdgCode() == PDG_t::kKPlus || mcpart.pdgCode() == PDG_t::kKMinus) { histos.fill(HIST("ptHistogramKaon"), mcpart.pt()); - histos.fill(HIST("hPtEta_ka_gen"), mcpart.pt(), mcpart.eta()); - histos.fill(HIST("hPty_ka_gen"), mcpart.pt(), mcpart.y()); + histos.fill(HIST("hPtEta_ka_gen"), mcpart.pt(), mcpart.eta()); + histos.fill(HIST("hPty_ka_gen"), mcpart.pt(), mcpart.y()); nchKaGen += 1.; q1KaGen += mcpart.pt(); q2KaGen += (mcpart.pt() * mcpart.pt()); @@ -1434,8 +1462,8 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce if (mcpart.pdgCode() == PDG_t::kProton || mcpart.pdgCode() == PDG_t::kProtonBar) { histos.fill(HIST("ptHistogramProton"), mcpart.pt()); - histos.fill(HIST("hPtEta_pr_gen"), mcpart.pt(), mcpart.eta()); - histos.fill(HIST("hPty_pr_gen"), mcpart.pt(), mcpart.y()); + histos.fill(HIST("hPtEta_pr_gen"), mcpart.pt(), mcpart.eta()); + histos.fill(HIST("hPty_pr_gen"), mcpart.pt(), mcpart.y()); nchPrGen += 1.; q1PrGen += mcpart.pt(); q2PrGen += (mcpart.pt() * mcpart.pt()); @@ -1458,7 +1486,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("hterm1_gen"), nchGenAll, var1AllGen); histos.fill(HIST("hterm2_gen"), nchGenAll, var2AllGen); -//--------------------------Pions------------------------------------------- + //--------------------------Pions------------------------------------------- if (nchPiGen >= cTwoPtlCut2) { var1PiGen = (q1PiGen * q1PiGen - q2PiGen) / (nchPiGen * (nchPiGen - 1)); var2PiGen = (q1PiGen / nchPiGen); @@ -1497,8 +1525,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce } // void process PROCESS_SWITCH(EventMeanPtId, processMcReco, "Process reconstructed", false); - - }; +}; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { From fec0ebc8d34b72495a5c2d9d6ddb17f21864d0b1 Mon Sep 17 00:00:00 2001 From: sweta29singh Date: Wed, 8 Oct 2025 15:02:51 +0530 Subject: [PATCH 5/8] Mean pT Fluctuations --- .../EbyEFluctuations/Tasks/eventMeanPtId.cxx | 497 +++++++++--------- 1 file changed, 235 insertions(+), 262 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx index bf93bf8bc89..405620b4033 100644 --- a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx @@ -38,8 +38,8 @@ #include "Framework/RunningWorkflowInfo.h" #include "Framework/runDataProcessing.h" -#include "TF1.h" #include +#include "TF1.h" #include #include @@ -61,6 +61,66 @@ struct EventMeanPtId { #define O2_DEFINE_CONFIGURABLE(NAME, TYPE, DEFAULT, HELP) Configurable NAME{#NAME, DEFAULT, HELP}; + // Configurables + Configurable cVtxZcut{"cVtxZcut", 10.0f, "Vertex Z"}; + Configurable cEtacut{"cEtacut", 0.8f, "Eta cut"}; + Configurable cPtmincut{"cPtmincut", 0.15f, "Pt min cut"}; + Configurable cPtmaxcut{"cPtmaxcut", 2.0f, "Pt max cut"}; + Configurable cPtmincut1{"cPtmincut1", 0.15f, " Pt min cut"}; + Configurable cPtmaxcut1{"cPtmaxcut1", 2.0f, " Pt max cut"}; + Configurable cDcaXYcut{"cDcaXYcut", 0.3f, "DCA XY cut"}; + Configurable cDcaZcut{"cDcaZcut", 2.0f, "DCA Z cut"}; + Configurable cCentmincut{"cCentmincut", 0.0, "Min cent cut"}; + Configurable cCentmaxcut{"cCentmaxcut", 90.0, "Max cent cut"}; + Configurable cTPCcrosscut{"cTPCcrosscut", 70, "TPC crossrows cut"}; + Configurable cItsChiCut{"cItsChiCut", 36, "ITS chi2 cluster cut"}; + Configurable cTpcChiCut{"cTpcChiCut", 4, "TPC chi2 cluster cut"}; + Configurable cnITSClustersCut{"cnITSClustersCut", 5, "Number of ITS clusters cut"}; + Configurable ctpcNClsCut{"ctpcNClsCut", 80, "No. of TPC clusters cut"}; + Configurable threshold{"threshold", 1e-6, "Delta eta bin count"}; + + // Event selections + Configurable cSel8Trig{"cSel8Trig", true, "Sel8 (T0A + T0C) Selection Run3"}; + Configurable cTFBorder{"cTFBorder", true, "Timeframe Border Selection"}; + Configurable cNoItsROBorder{"cNoItsROBorder", true, "No ITSRO Border Cut"}; + Configurable cItsTpcVtx{"cItsTpcVtx", true, "ITS+TPC Vertex Selection"}; + Configurable cPileupReject{"cPileupReject", true, "Pileup rejection"}; + Configurable cZVtxTimeDiff{"cZVtxTimeDiff", true, "z-vtx time diff selection"}; + Configurable cIsGoodITSLayers{"cIsGoodITSLayers", true, "Good ITS Layers All"}; + Configurable cItslayerall{"cItslayerall", true, "dead staves of ITS removed"}; + Configurable cvtxtofmatched{"cvtxtofmatched", true, "TOF vertex matched"}; + Configurable cfgRejEl{"cfgRejEl", false, "Rejected electrons"}; + Configurable cdata{"cdata", false, "Enable histogram filling for processData"}; + Configurable citsNCluster{"citsNCluster", false, "Enable Number of ITS clusters"}; + Configurable ctpcNClusterFound{"ctpcNClusterFound", false, "Enable Number of TPC clusters"}; + Configurable cPVContributor{"cPVContributor", false, "Enable Primary Vertex Contributor"}; + Configurable cDCAxy{"cDCAxy", true, "DCAxy cut"}; + Configurable cDCAz{"cDCAz", true, "DCAz cut"}; + Configurable cTPCcr{"cTPCcr", true, "tpc crossed rows"}; + Configurable cITSchi{"cITSchi", true, "ITS chi2"}; + Configurable cTPCchi{"cTPCchi", true, "TPC chi2"}; + Configurable ccentFT0C{"ccentFT0C", true, "Use FT0C centraity"}; + + // PID selection configurables + Configurable cPionPmincut{"cPionPmincut", 0.15, "pion min cut of pion"}; + Configurable cKaonPmincut{"cKaonPmincut", 0.15, "kaon min cut of kaon"}; + Configurable cProtonPmincut{"cProtonPmincut", 0.15, "proton min cut of proton"}; + Configurable cPionPmaxcut{"cPionPmaxcut", 2.0, "pion min cut of pion"}; + Configurable cKaonPmaxcut{"cKaonPmaxcut", 2.0, "kaon min cut of kaon"}; + Configurable cProtonPmaxcut{"cProtonPmaxcut", 2.0, "proton min cut of proton"}; + Configurable cPionPthcut{"cPionPthcut", 0.65, "pion threshold cut of pion"}; + Configurable cKaonPthcut{"cKaonPthcut", 0.65, "kaon threshold cut of kaon"}; + Configurable cProtonPthcut{"cProtonPthcut", 1.0, "proton threshold cut of proton"}; + Configurable cNSigCut2{"cNSigCut2", 2.0, "nSigma cut (2)"}; + Configurable cNSigCut3{"cNSigCut3", 3.0, "nSigma cut (3)"}; + Configurable cElMinCut{"cElMinCut", -3.0, "electron min cut"}; + Configurable cElMaxCut{"cElMaxCut", 5.0, "electron max cut"}; + Configurable cTwoPtlCut2{"cTwoPtlCut2", 2.0, "n2ptl cut"}; + Configurable cRapidityCut05{"cRapidityCut05", 0.5, "rapidity cut"}; + Configurable nchBins{"nchBins", 4000, "Number of bins for nch axis"}; + Configurable nchMin{"nchMin", 0.0, "Minimum value for nch axis"}; + Configurable nchMax{"nchMax", 4000.0, "Maximum value for nch axis"}; + O2_DEFINE_CONFIGURABLE(cfgEvSelMultCorrelation, bool, true, "Multiplicity correlation cut") struct : ConfigurableGroup { @@ -69,8 +129,8 @@ struct EventMeanPtId { O2_DEFINE_CONFIGURABLE(cfgMultGlobalPVCutEnabled, bool, true, "Enable globalTracks vs PV multiplicity cut") Configurable> cfgMultPVFT0CCutPars{"cfgMultPVFT0CCutPars", - std::vector{3303.11, -121.316, 1.90207, -0.0152644, 5.10121e-05, 190.633, -4.32972, 0.0340001, -5.83261e-05, -3.19566e-07}, - "PV multiplicity vs T0C centrality cut parameter values"}; + std::vector{3303.11, -121.316, 1.90207, -0.0152644, 5.10121e-05, 190.633, -4.32972, 0.0340001, -5.83261e-05, -3.19566e-07}, + "PV multiplicity vs T0C centrality cut parameter values"}; Configurable> cfgMultGlobalFT0CCutPars{"cfgMultGlobalFT0CCutPars", std::vector{1893.97, -61.3423, 0.790664, -0.00507208, 1.41683e-05, 167.997, -5.29125, 0.0840145, -0.000748102, 2.75743e-06}, @@ -92,34 +152,37 @@ struct EventMeanPtId { TF1* fMultGlobalPVCutHigh = nullptr; } cfgFunCoeff; + Service ccdb; Service pdg; - Filter collisionFilter = nabs(aod::collision::posZ) <= cVtxZcut; - Filter trackFilter = (nabs(aod::track::eta) < cEtacut) && (aod::track::pt > ptMin) && (aod::track::pt < ptMax) && (requireGlobalTrackInFilter()); + Filter collisionFilter = nabs(aod::collision::posZ) <= cVtxZcut; + Filter trackFilter = (nabs(aod::track::eta) < cEtacut) && (aod::track::pt > ptMin) && (aod::track::pt < ptMax) && (requireGlobalTrackInFilter()); + +using MyCollisions = soa::Filtered>; +using MyCollision = MyCollisions::iterator; - using MyCollisions = soa::Filtered>; - using MyCollision = MyCollisions::iterator; +using MyTracks = soa::Filtered>; +using MyTrack = MyTracks::iterator; - using MyTracks = soa::Filtered>; - using MyTrack = MyTracks::iterator; - using MyMCRecoCollisions = soa::Filtered>; - using MyMCRecoCollision = MyMCRecoCollisions::iterator; +using MyMCRecoCollisions = soa::Filtered>; +using MyMCRecoCollision = MyMCRecoCollisions::iterator; - using MyMCRecoTracks = soa::Filtered>; - using MyMCRecoTrack = MyMCRecoTracks::iterator; +using MyMCRecoTracks = soa::Filtered>; +using MyMCRecoTrack = MyMCRecoTracks::iterator; + +using EventCandidatesMC = soa::Join; - using EventCandidatesMC = soa::Join; Configurable ccdbNoLaterThan{"ccdbNoLaterThan", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; Configurable cfgUrlCCDB{"cfgUrlCCDB", "http://alice-ccdb.cern.ch", "url of ccdb"}; @@ -134,6 +197,7 @@ struct EventMeanPtId { Configurable> ptBins{"ptBins", {0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50, 0.55, 0.60, 0.65, 0.70, 0.75, 0.80, 0.85, 0.90, 0.95, 1.00, 1.05, 1.10, 1.15, 1.20, 1.25, 1.30, 1.35, 1.40, 1.45, 1.50, 1.55, 1.60, 1.65, 1.70, 1.75, 1.80, 1.85, 1.90, 1.95, 2.00}, "p_{T} bins"}; Configurable piluprejection{"piluprejection", false, "Pileup rejection"}; + void init(o2::framework::InitContext&) { if (cfgLoadEff) { @@ -146,14 +210,14 @@ struct EventMeanPtId { TList* lst = ccdb->getForTimeStamp(cfgPathCCDB.value, -1); ptHistogramAllchargeRec = reinterpret_cast(lst->FindObject("hPtEta_rec")); - } + } std::vector ptBinning = {0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0}; // AxisSpec ptAxis = {ptBinning, "#it{p}_{T} (GeV/#it{c})"}; AxisSpec vtxZAxis = {100, -20.0, 20.0, "Z (cm)"}; AxisSpec dcaAxis = {1002, -5.01, 5.01, "DCA_{xy} (cm)"}; AxisSpec dcazAxis = {1002, -5.01, 5.01, "DCA_{z} (cm)"}; - AxisSpec ptAxis = {600, 0.0, 6.0, "#it{p}_{T} (GeV/#it{c})"}; // 600,0,6 + AxisSpec ptAxis = {600, 0.0, 6.0, "#it{p}_{T} (GeV/#it{c})"};// 600,0,6 AxisSpec pAxis = {400, 0.0, 4.0, "#it{p} (GeV/#it{c})"}; AxisSpec betaAxis = {200, 0.0, 2.0, "TOF_{#beta} (GeV/#it{c})"}; AxisSpec dEdxAxis = {2000, 0.0, 200.0, "dE/dx (GeV/#it{c})"}; @@ -297,10 +361,10 @@ struct EventMeanPtId { histos.add("Data/hNchPV_NchGlobal_after3", "hNchPV_NchGlobal_after3", kTH2D, {nchAxis, nchAxis}); histos.add("Data/hNchPV_NchGlobal_after4", "hNchPV_NchGlobal_after4", kTH2D, {nchAxis, nchAxis}); histos.add("Data/hNchPV_NchGlobal_after5", "hNchPV_NchGlobal_after5", kTH2D, {nchAxis, nchAxis}); - + histos.addClone("Data/", "Rec/"); // rec histograms - histos.add("hcent_nacc_corr", "hcent_nacc_corr", kTH2D, {centAxis, nchAxis}); + histos.add("hcent_nacc_corr", "hcent_nacc_corr", kTH2D, {centAxis, nchAxis}); histos.add("NSigamaTPCpion_rec", "NSigamaTPCpion_rec", kTH2D, {pAxis, nSigmaTPCAxispid}); histos.add("NSigamaTPCkaon_rec", "NSigamaTPCkaon_rec", kTH2D, {pAxis, nSigmaTPCAxispid}); histos.add("NSigamaTPCproton_rec", "NSigamaTPCproton_rec", kTH2D, {pAxis, nSigmaTPCAxispid}); @@ -358,7 +422,7 @@ struct EventMeanPtId { histos.add("hnch_pr", ";hnch_pr", kTH1D, {nchAxis}); histos.add("hnch_gen", ";hnch_gen", kTH1D, {nchAxis}); histos.add("hPtvar_gen", ";#it{p}_{T} (GeV/#it{c})", kTH1D, {ptAxis}); - + histos.add("hVar1x_gen", "hVar1x_gen", kTH2D, {subAxis, nchAxis}); histos.add("hVar2x_gen", "hVar2x_gen", kTH2D, {subAxis, nchAxis}); histos.add("hVarx_gen", "hVarx_gen", kTH2D, {subAxis, nchAxis}); @@ -426,12 +490,13 @@ struct EventMeanPtId { histos.add("hterm2_gen", "hterm2_gen", kTProfile, {tnchAxis}); histos.add("hCentrality_rec_before", "hCentrality_rec_before", kTH1D, {centAxis}); histos.add("hEta1", ";hEta1", kTH1D, {etaAxis}); - + cfgFunCoeff.multPVFT0CCutPars = cfgFunCoeff.cfgMultPVFT0CCutPars; cfgFunCoeff.multGlobalFT0CPars = cfgFunCoeff.cfgMultGlobalFT0CCutPars; cfgFunCoeff.multGlobalPVCutPars = cfgFunCoeff.cfgMultGlobalPVCutPars; Configurable cSigmaLowHighcut{"cSigmaLowHighcut", 3.0f, "lower and upper sigma cut"}; + cfgFunCoeff.fMultPVFT0CCutLow = new TF1("fMultPVFT0CCutLow", @@ -468,69 +533,10 @@ struct EventMeanPtId { "[0] + [1]*x + 3.0*([2] + [3]*x + [4]*x*x + [5]*x*x*x)", 0, 100); cfgFunCoeff.fMultGlobalPVCutHigh->SetParameters(&(cfgFunCoeff.multGlobalPVCutPars[0])); - } - // Configurables - Configurable cVtxZcut{"cVtxZcut", 10.0f, "Vertex Z"}; - Configurable cEtacut{"cEtacut", 0.8f, "Eta cut"}; - Configurable cPtmincut{"cPtmincut", 0.15f, "Pt min cut"}; - Configurable cPtmaxcut{"cPtmaxcut", 2.0f, "Pt max cut"}; - Configurable cPtmincut1{"cPtmincut1", 0.15f, " Pt min cut"}; - Configurable cPtmaxcut1{"cPtmaxcut1", 2.0f, " Pt max cut"}; - Configurable cDcaXYcut{"cDcaXYcut", 0.3f, "DCA XY cut"}; - Configurable cDcaZcut{"cDcaZcut", 2.0f, "DCA Z cut"}; - Configurable cCentmincut{"cCentmincut", 0.0, "Min cent cut"}; - Configurable cCentmaxcut{"cCentmaxcut", 90.0, "Max cent cut"}; - Configurable cTPCcrosscut{"cTPCcrosscut", 70, "TPC crossrows cut"}; - Configurable cItsChiCut{"cItsChiCut", 36, "ITS chi2 cluster cut"}; - Configurable cTpcChiCut{"cTpcChiCut", 4, "TPC chi2 cluster cut"}; - Configurable cnITSClustersCut{"cnITSClustersCut", 5, "Number of ITS clusters cut"}; - Configurable ctpcNClsCut{"ctpcNClsCut", 80, "No. of TPC clusters cut"}; - Configurable threshold{"threshold", 1e-6, "Delta eta bin count"}; + } - // Event selections - Configurable cSel8Trig{"cSel8Trig", true, "Sel8 (T0A + T0C) Selection Run3"}; - Configurable cTFBorder{"cTFBorder", true, "Timeframe Border Selection"}; - Configurable cNoItsROBorder{"cNoItsROBorder", true, "No ITSRO Border Cut"}; - Configurable cItsTpcVtx{"cItsTpcVtx", true, "ITS+TPC Vertex Selection"}; - Configurable cPileupReject{"cPileupReject", true, "Pileup rejection"}; - Configurable cZVtxTimeDiff{"cZVtxTimeDiff", true, "z-vtx time diff selection"}; - Configurable cIsGoodITSLayers{"cIsGoodITSLayers", true, "Good ITS Layers All"}; - Configurable cItslayerall{"cItslayerall", true, "dead staves of ITS removed"}; - Configurable cvtxtofmatched{"cvtxtofmatched", true, "TOF vertex matched"}; - Configurable cfgRejEl{"cfgRejEl", false, "Rejected electrons"}; - Configurable cdata{"cdata", false, "Enable histogram filling for processData"}; - Configurable citsNCluster{"citsNCluster", false, "Enable Number of ITS clusters"}; - Configurable ctpcNClusterFound{"ctpcNClusterFound", false, "Enable Number of TPC clusters"}; - Configurable cPVContributor{"cPVContributor", false, "Enable Primary Vertex Contributor"}; - Configurable cDCAxy{"cDCAxy", true, "DCAxy cut"}; - Configurable cDCAz{"cDCAz", true, "DCAz cut"}; - Configurable cTPCcr{"cTPCcr", true, "tpc crossed rows"}; - Configurable cITSchi{"cITSchi", true, "ITS chi2"}; - Configurable cTPCchi{"cTPCchi", true, "TPC chi2"}; - Configurable ccentFT0C{"ccentFT0C", true, "Use FT0C centraity"}; - - // PID selection configurables - Configurable cPionPmincut{"cPionPmincut", 0.15, "pion min cut of pion"}; - Configurable cKaonPmincut{"cKaonPmincut", 0.15, "kaon min cut of kaon"}; - Configurable cProtonPmincut{"cProtonPmincut", 0.15, "proton min cut of proton"}; - Configurable cPionPmaxcut{"cPionPmaxcut", 2.0, "pion min cut of pion"}; - Configurable cKaonPmaxcut{"cKaonPmaxcut", 2.0, "kaon min cut of kaon"}; - Configurable cProtonPmaxcut{"cProtonPmaxcut", 2.0, "proton min cut of proton"}; - Configurable cPionPthcut{"cPionPthcut", 0.65, "pion threshold cut of pion"}; - Configurable cKaonPthcut{"cKaonPthcut", 0.65, "kaon threshold cut of kaon"}; - Configurable cProtonPthcut{"cProtonPthcut", 1.0, "proton threshold cut of proton"}; - Configurable cNSigCut2{"cNSigCut2", 2.0, "nSigma cut (2)"}; - Configurable cNSigCut3{"cNSigCut3", 3.0, "nSigma cut (3)"}; - Configurable cElMinCut{"cElMinCut", -3.0, "electron min cut"}; - Configurable cElMaxCut{"cElMaxCut", 5.0, "electron max cut"}; - Configurable cTwoPtlCut2{"cTwoPtlCut2", 2.0, "n2ptl cut"}; - Configurable cRapidityCut05{"cRapidityCut05", 0.5, "rapidity cut"}; - Configurable nchBins{"nchBins", 4000, "Number of bins for nch axis"}; - Configurable nchMin{"nchMin", 0.0, "Minimum value for nch axis"}; - Configurable nchMax{"nchMax", 4000.0, "Maximum value for nch axis"}; - - bool eventSelected(const float& globalNch, const float& pvTrack, const float& centrality) +bool eventSelected(const float& globalNch, const float& pvTrack, const float& centrality) { if (cfgFunCoeff.cfgMultPVFT0CCutEnabled) { @@ -568,12 +574,12 @@ struct EventMeanPtId { } // Reject the collisions with large vertex-z histos.fill(HIST("hEventcounter"), 2.); - if (ccentFT0C) { - cent = coll.centFT0C(); // centrality from FT0C + if(ccentFT0C) { + cent = coll.centFT0C(); //centrality from FT0C } else { - cent = coll.centFT0M(); // centrality from FT0M - } - + cent = coll.centFT0M(); //centrality from FT0M + } + if (cSel8Trig && !coll.sel8()) { return false; } // require min bias trigger @@ -601,7 +607,7 @@ struct EventMeanPtId { return false; } histos.fill(HIST("trackSelRec"), 7); - + // if (cItslayerall && !coll.selection_bit(aod::evsel::kIsGoodITSLayersAll)) {return false;} histos.fill(HIST("trackSelRec"), 8); @@ -621,59 +627,41 @@ struct EventMeanPtId { } // accept only global tracks histos.fill(HIST("tracksel"), 2); - if (cDCAxy && std::fabs(track.dcaXY()) > cDcaXYcut) { - return false; - } + if (cDCAxy && std::fabs(track.dcaXY()) > cDcaXYcut) {return false;} histos.fill(HIST("tracksel"), 3); - if (cDCAz && std::fabs(track.dcaZ()) > cDcaZcut) { - return false; - } + if (cDCAz && std::fabs(track.dcaZ()) > cDcaZcut) {return false;} histos.fill(HIST("tracksel"), 4); if (std::fabs(track.eta()) >= cEtacut) { return false; } histos.fill(HIST("tracksel"), 5); - - if (cTPCcr && track.tpcNClsCrossedRows() < cTPCcrosscut) { - return false; - } + + if (cTPCcr && track.tpcNClsCrossedRows() < cTPCcrosscut) {return false;} histos.fill(HIST("tracksel"), 6); - if (cITSchi && track.itsChi2NCl() >= cItsChiCut) { - return false; - } + if (cITSchi && track.itsChi2NCl() >= cItsChiCut) {return false;} histos.fill(HIST("tracksel"), 7); - if (cTPCchi && track.tpcChi2NCl() >= cTpcChiCut) { - return false; - } + if (cTPCchi && track.tpcChi2NCl() >= cTpcChiCut) {return false;} histos.fill(HIST("tracksel"), 8); - if (track.sign() == 0) { - return false; - } + if (track.sign() == 0) {return false;} - if (cPVContributor) { - if (!(track.isPVContributor())) { - return false; - } - histos.fill(HIST("tracksel"), 9); + if(cPVContributor) + { if (!(track.isPVContributor())) {return false;} + histos.fill(HIST("tracksel"), 9); } if (citsNCluster) { - if (track.itsNCls() < cnITSClustersCut) { - return false; - } - histos.fill(HIST("tracksel"), 10); + if (track.itsNCls() < cnITSClustersCut) { return false; } + histos.fill(HIST("tracksel"), 10); } - if (ctpcNClusterFound) { - if (track.tpcNClsFound() < ctpcNClsCut) { - return false; - } - histos.fill(HIST("tracksel"), 11); + if(ctpcNClusterFound) { + if (track.tpcNClsFound() < ctpcNClsCut) {return false;} + histos.fill(HIST("tracksel"), 11); } return true; // if all checks pass, accept the collision @@ -769,60 +757,60 @@ struct EventMeanPtId { return false; } - double getEfficiency(double pt, double eta, TH2D* ptHistogramAllchargeRec) + double getEfficiency(double pt, double eta, TH2D* ptHistogramAllchargeRec) { - int xbin = ptHistogramAllchargeRec->GetXaxis()->FindBin(pt); - int ybin = ptHistogramAllchargeRec->GetYaxis()->FindBin(eta); + int xbin = ptHistogramAllchargeRec->GetXaxis()->FindBin(pt); + int ybin = ptHistogramAllchargeRec->GetYaxis()->FindBin(eta); - if (xbin < 1 || xbin > ptHistogramAllchargeRec->GetNbinsX() || ybin < 1 || ybin > ptHistogramAllchargeRec->GetNbinsY()) { + if(xbin < 1 || xbin > ptHistogramAllchargeRec->GetNbinsX() || ybin < 1 || ybin > ptHistogramAllchargeRec->GetNbinsY()) { LOGF(warn, "pt or eta out of histograms bounds : %f, eta = %f", pt, eta); return 1e-6; - } - double eff = ptHistogramAllchargeRec->GetBinContent(xbin, ybin); - return (eff > 0) ? eff : 1e-6; // Avoid division by zero + } + double eff = ptHistogramAllchargeRec->GetBinContent(xbin, ybin); + return (eff > 0) ? eff : 1e-6; // Avoid division by zero } - //++++++++++++++++++++++++++++++++++++DATA CALCULATION +++++++++++++++++++++++++++++++++++++++++++++++++++++// - void processData(MyCollision const& coll, MyTracks const& inputTracks) + //++++++++++++++++++++++++++++++++++++DATA CALCULATION +++++++++++++++++++++++++++++++++++++++++++++++++++++// + void processData(MyCollision const& coll, MyTracks const& inputTracks) - { - float cent = -1; + { float cent = -1; histos.fill(HIST("hEventcounter"), 1.); histos.fill(HIST("Data/hZvtx_before_sel"), coll.posZ()); - if (!selCollision(coll, cent)) + if (!selCollision(coll,cent)) return; { histos.fill(HIST("Data/hZvtx_after_sel8"), coll.posZ()); - } + } histos.fill(HIST("Data/hCentrality"), cent); - float globalNch = inputTracks.size(); - float pvTrack = coll.multNTracksPV(); + float globalNch = inputTracks.size(); + float pvTrack = coll.multNTracksPV(); - histos.fill(HIST("Data/hNchPV_NchGlobal_before"), pvTrack, globalNch); - histos.fill(HIST("Data/hcentFT0C_GlobalNch_before"), coll.centFT0C(), globalNch); - histos.fill(HIST("Data/hcentFT0C_NchPV_before"), coll.centFT0C(), pvTrack); + histos.fill(HIST("Data/hNchPV_NchGlobal_before"), pvTrack, globalNch); + histos.fill(HIST("Data/hcentFT0C_GlobalNch_before"),coll.centFT0C(), globalNch); + histos.fill(HIST("Data/hcentFT0C_NchPV_before"), coll.centFT0C(), pvTrack); - if (cfgEvSelMultCorrelation && !eventSelected(globalNch, pvTrack, cent)) { + + if (cfgEvSelMultCorrelation && !eventSelected(globalNch, pvTrack, cent)) { return; - } - - histos.fill(HIST("Data/hNchPV_NchGlobal_after"), pvTrack, globalNch); - histos.fill(HIST("Data/hcentFT0C_GlobalNch_after"), coll.centFT0C(), globalNch); - histos.fill(HIST("Data/hcentFT0C_NchPV_after"), coll.centFT0C(), pvTrack); + } - double nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0., nch = 0., nchPi = 0., nchKa = 0., nchPr = 0.; + histos.fill(HIST("Data/hNchPV_NchGlobal_after"), pvTrack, globalNch); + histos.fill(HIST("Data/hcentFT0C_GlobalNch_after"),coll.centFT0C(), globalNch); + histos.fill(HIST("Data/hcentFT0C_NchPV_after"), coll.centFT0C(), pvTrack); + + double nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0., nch = 0., nchPi = 0., nchKa = 0., nchPr = 0.; double q1 = 0., q2 = 0., var1 = 0., var2 = 0.; double sumPtWeight = 0., sumWeight = 0., sumPtPtWeight = 0., var1Eff = 0., var2Eff = 0.; double q1Pi = 0., q2Pi = 0., var1Pi = 0., var2Pi = 0.; - double q1Ka = 0., q2Ka = 0., var1Ka = 0., var2Ka = 0.; + double q1Ka = 0., q2Ka = 0., var1Ka = 0., var2Ka = 0.; double q1Pr = 0., q2Pr = 0., var1Pr = 0., var2Pr = 0.; int sample = histos.get(HIST("Data/hZvtx_after_sel8"))->GetEntries(); - sample = sample % 30; - + sample = sample % 30; + for (const auto& track : inputTracks) { nchAllBfCut += 1.; histos.fill(HIST("Data/hnchAll_bf_cut"), nchAllBfCut); @@ -831,7 +819,7 @@ struct EventMeanPtId { histos.fill(HIST("Data/hTPCchi2perCluster_before"), track.tpcChi2NCl()); histos.fill(HIST("Data/hITSchi2perCluster_before"), track.itsChi2NCl()); histos.fill(HIST("Data/hTPCCrossedrows_before"), track.tpcNClsCrossedRows()); - + if (std::fabs(track.eta()) <= cEtacut) { nchEta++; histos.fill(HIST("Data/hnchTrue"), nchEta); @@ -840,18 +828,16 @@ struct EventMeanPtId { nchPt += 1.; histos.fill(HIST("Data/hnchTrue_pt"), nchPt); } - if (!selTrack(track)) - continue; - - if (track.pt() >= cPtmincut1 && track.pt() <= cPtmaxcut1) { - nch += 1.; + if (!selTrack(track)) continue; + + if (track.pt() >= cPtmincut1 && track.pt() <= cPtmaxcut1) + { nch += 1.; histos.fill(HIST("Data/hnch"), nch); - histos.fill(HIST("Data/hPtvar"), track.pt()); + histos.fill(HIST("Data/hPtvar"), track.pt()); } - - if (track.pt() < cPtmincut || track.pt() > cPtmaxcut) - continue; - + + if (track.pt() < cPtmincut || track.pt() > cPtmaxcut) continue; + nchAll += 1.; q1 += track.pt(); q2 += (track.pt() * track.pt()); @@ -871,13 +857,13 @@ struct EventMeanPtId { histos.fill(HIST("Data/hPEta"), track.p(), track.eta()); histos.fill(HIST("Data/hNsigmaTPC"), track.p(), track.tpcNSigmaPr()); - double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); + double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); if (eff < threshold) - continue; - double weight = 1. / eff; + continue; + double weight = 1./eff; sumPtWeight += track.pt() / eff; sumPtPtWeight += (track.pt() * track.pt()) / (eff * eff); - sumWeight += weight; + sumWeight += weight; // only TPC tracks: Pion, Kaon, Proton if (track.hasTPC() && std::abs(track.tpcNSigmaPi()) < cNSigCut3) @@ -961,22 +947,22 @@ struct EventMeanPtId { histos.fill(HIST("Data/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Data/hTOFbeta_afterselection1"), track.p(), track.beta()); } - + } // Track loop ends! histos.fill(HIST("Data/hcentFV0A_nacc"), coll.multFV0A(), nchAll); histos.fill(HIST("Data/hcentFT0A_nacc"), coll.multFT0A(), nchAll); histos.fill(HIST("Data/hcentFT0M_nacc"), coll.centFT0M(), nchAll); histos.fill(HIST("Data/hcent_nacc"), cent, nchAll); - if (nchAll < cTwoPtlCut2) + if (nchAll < cTwoPtlCut2) return; var1 = (q1 * q1 - q2) / (nchAll * (nchAll - 1)); var2 = (q1 / nchAll); - - //------------------ Efficiency corrected histograms --------------- + + //------------------ Efficiency corrected histograms --------------- var1Eff = (sumPtWeight * sumPtWeight - sumPtPtWeight) / (sumWeight * (sumWeight - 1)); var2Eff = (sumPtWeight / sumWeight); - + //---------------------- pions ---------------------------------------- if (nchPi >= cTwoPtlCut2) { var1Pi = (q1Pi * q1Pi - q2Pi) / (nchPi * (nchPi - 1)); @@ -992,8 +978,8 @@ struct EventMeanPtId { var1Pr = (q1Pr * q1Pr - q2Pr) / (nchPr * (nchPr - 1)); var2Pr = (q1Pr / nchPr); } - - //------------------ all charges------------------------------------- + + //------------------ all charges------------------------------------- histos.fill(HIST("Data/hVar1"), sample, cent, var1); histos.fill(HIST("Data/hVar2"), sample, cent, var2); histos.fill(HIST("Data/hVarc"), sample, cent); @@ -1016,7 +1002,7 @@ struct EventMeanPtId { histos.fill(HIST("Data/hdiffVar1x"), sample, nch, var1); histos.fill(HIST("Data/hdiffVar2x"), sample, nch, var2); histos.fill(HIST("Data/hdiffVarx"), sample, nch); - + histos.fill(HIST("hEffVar1x_data"), sample, nchAll, var1Eff); histos.fill(HIST("hEffVar2x_data"), sample, nchAll, var2Eff); histos.fill(HIST("hEffVarx_data"), sample, nchAll); @@ -1048,42 +1034,38 @@ struct EventMeanPtId { } // event loop ends! PROCESS_SWITCH(EventMeanPtId, processData, "process real data information", true); - + //++++++++++++++++++++++++++++++++++++MC Reconstructed +++++++++++++++++++++++++++++++++++++++++++++++++++++// - SliceCache cache; - Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; - void processMcReco(MyMCRecoCollision const& coll, MyMCRecoTracks const& inputTracks, aod::McCollisions const& mcCollisions, aod::McParticles const& mcParticles) - { - float cent = -1; + SliceCache cache; + Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; + void processMcReco(MyMCRecoCollision const& coll, MyMCRecoTracks const& inputTracks, aod::McCollisions const& mcCollisions, aod::McParticles const& mcParticles) + { float cent = -1; (void)mcCollisions; - if (!coll.has_mcCollision()) { - return; - } - + if (!coll.has_mcCollision()) {return;} + histos.fill(HIST("Rec/hZvtx_before_sel"), coll.posZ()); histos.fill(HIST("hVtxZ_before_gen"), coll.mcCollision().posZ()); - histos.fill(HIST("hCentrality_rec_before"), cent); + histos.fill(HIST("hCentrality_rec_before"), cent); - if (!selCollision(coll, cent)) - return; + if (!selCollision(coll,cent)) return; histos.fill(HIST("Rec/hZvtx_after_sel8"), coll.posZ()); - histos.fill(HIST("Rec/hCentrality"), cent); + histos.fill(HIST("Rec/hCentrality"), cent); float globalNch = inputTracks.size(); - float pvTrack = coll.multNTracksPV(); - - histos.fill(HIST("Rec/hNchPV_NchGlobal_before"), pvTrack, globalNch); - histos.fill(HIST("Rec/hcentFT0C_GlobalNch_before"), coll.centFT0C(), globalNch); - histos.fill(HIST("Rec/hcentFT0C_NchPV_before"), coll.centFT0C(), pvTrack); + float pvTrack = coll.multNTracksPV(); - if (cfgEvSelMultCorrelation && !eventSelected(globalNch, pvTrack, cent)) { + histos.fill(HIST("Rec/hNchPV_NchGlobal_before"), pvTrack, globalNch); + histos.fill(HIST("Rec/hcentFT0C_GlobalNch_before"),coll.centFT0C(), globalNch); + histos.fill(HIST("Rec/hcentFT0C_NchPV_before"), coll.centFT0C(), pvTrack); + + if (cfgEvSelMultCorrelation && !eventSelected(globalNch, pvTrack, cent)) { return; - } + } - histos.fill(HIST("Rec/hNchPV_NchGlobal_after"), pvTrack, globalNch); - histos.fill(HIST("Rec/hcentFT0C_GlobalNch_after"), coll.centFT0C(), globalNch); - histos.fill(HIST("Rec/hcentFT0C_NchPV_after"), coll.centFT0C(), pvTrack); + histos.fill(HIST("Rec/hNchPV_NchGlobal_after"), pvTrack, globalNch); + histos.fill(HIST("Rec/hcentFT0C_GlobalNch_after"),coll.centFT0C(), globalNch); + histos.fill(HIST("Rec/hcentFT0C_NchPV_after"), coll.centFT0C(), pvTrack); double nch = 0., nchPi = 0., nchKa = 0., nchPr = 0., nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0.; double q1 = 0., q2 = 0.; @@ -1091,7 +1073,7 @@ struct EventMeanPtId { double var1 = 0., var2 = 0.; double var1Pi = 0., var2Pi = 0., var1Ka = 0., var2Ka = 0., var1Pr = 0., var2Pr = 0.; double sumPtWeight = 0., sumWeight = 0., sumPtPtWeight = 0., var1Eff = 0., var2Eff = 0.; - + int sample = histos.get(HIST("Rec/hZvtx_after_sel8"))->GetEntries(); sample = sample % 30; @@ -1102,40 +1084,37 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hITSchi2perCluster_before"), track.itsChi2NCl()); histos.fill(HIST("Rec/hTPCCrossedrows_before"), track.tpcNClsCrossedRows()); - if (std::fabs(track.eta()) <= cEtacut) { - nchEta++; + if (std::fabs(track.eta()) <= cEtacut) + { nchEta++; histos.fill(HIST("Rec/hnchTrue"), nchEta); } - if (track.pt() >= cPtmincut && track.pt() <= cPtmaxcut) { - nchPt += 1.; + if (track.pt() >= cPtmincut && track.pt() <= cPtmaxcut) + { nchPt += 1.; histos.fill(HIST("Rec/hnchTrue_pt"), nchPt); } - - if (!selTrack(track)) - continue; - - if (track.pt() >= cPtmincut1 && track.pt() <= cPtmaxcut1) { - nch += 1.; + + if (!selTrack(track)) continue; + + if (track.pt() >= cPtmincut1 && track.pt() <= cPtmaxcut1) + { nch += 1.; histos.fill(HIST("Rec/hnch"), nch); - histos.fill(HIST("Rec/hPtvar"), track.pt()); + histos.fill(HIST("Rec/hPtvar"), track.pt()); } - if (track.pt() < cPtmincut || track.pt() > cPtmaxcut) - continue; - + if (track.pt() < cPtmincut || track.pt() > cPtmaxcut) continue; + // if (std::fabs(track.y()) > 0.5) continue; histos.fill(HIST("hPt_rec"), track.pt()); histos.fill(HIST("hEta_rec"), track.eta()); double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); - if (eff < threshold) - continue; + if (eff < threshold) continue; double weight = 1.0 / eff; sumPtWeight += track.pt() * weight; sumPtPtWeight += (track.pt() * track.pt() * weight * weight); sumWeight += weight; - - histos.fill(HIST("hPt_rec_corr"), track.pt(), weight); - histos.fill(HIST("hEta_rec_corr"), track.eta(), weight); + + histos.fill(HIST("hPt_rec_corr"), track.pt() , weight); + histos.fill(HIST("hEta_rec_corr"), track.eta() , weight); auto mcParticle = track.mcParticle(); nchAll += 1.; @@ -1158,7 +1137,7 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hPEta"), track.p(), track.eta()); histos.fill(HIST("Rec/hNsigmaTPC"), track.p(), track.tpcNSigmaPr()); histos.fill(HIST("hPtEta_rec"), track.pt(), track.eta()); - + if (std::abs(mcParticle.pdgCode()) == PDG_t::kPiPlus) histos.fill(HIST("ptHistogramPionrec_pdg"), track.pt()); if (std::abs(mcParticle.pdgCode()) == PDG_t::kKPlus) @@ -1200,12 +1179,10 @@ struct EventMeanPtId { } if (selPion(track)) { - if (std::fabs(track.y()) > cRapidityCut05) - continue; - if (track.beta() > 1) - continue; + if (std::fabs(track.y()) > cRapidityCut05) continue; + if (track.beta() > 1) continue; histos.fill(HIST("ptHistogramPionrec"), track.pt()); - histos.fill(HIST("hPtEta_pi_rec"), track.pt(), track.eta()); + histos.fill(HIST("hPtEta_pi_rec"), track.pt(), track.eta()); histos.fill(HIST("Rec/hPtPion"), track.pt()); histos.fill(HIST("Rec/hEtaPion"), track.eta()); histos.fill(HIST("Rec/hyPion"), track.rapidity(massPi)); @@ -1216,14 +1193,14 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Rec/hTOFbeta_afterselection1"), track.p(), track.beta()); if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kPiPlus) { - histos.fill(HIST("ptHistogramPionrec_purity"), track.pt()); + histos.fill(HIST("ptHistogramPionrec_purity"), track.pt()); } nchPi += 1.; q1Pi += track.pt(); q2Pi += (track.pt() * track.pt()); - histos.fill(HIST("hPyPion_rec"), track.p(), track.rapidity(massPi)); - histos.fill(HIST("hPtyPion_rec"), track.pt(), track.rapidity(massPi)); + histos.fill(HIST("hPyPion_rec"), track.p(), track.rapidity(massPi)); + histos.fill(HIST("hPtyPion_rec"), track.pt(), track.rapidity(massPi)); } //===========================kaon=============================================================== @@ -1235,12 +1212,10 @@ struct EventMeanPtId { } if (selKaon(track)) { - if (std::fabs(track.y()) > cRapidityCut05) - continue; - if (track.beta() > 1) - continue; + if (std::fabs(track.y()) > cRapidityCut05) continue; + if (track.beta() > 1) continue; histos.fill(HIST("ptHistogramKaonrec"), track.pt()); - histos.fill(HIST("hPtEta_ka_rec"), track.pt(), track.eta()); + histos.fill(HIST("hPtEta_ka_rec"), track.pt(), track.eta()); histos.fill(HIST("Rec/hPtKaon"), track.pt()); histos.fill(HIST("Rec/hEtaKaon"), track.eta()); histos.fill(HIST("Rec/hyKaon"), track.rapidity(massKa)); @@ -1251,7 +1226,7 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Rec/hTOFbeta_afterselection1"), track.p(), track.beta()); if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kKPlus) { - histos.fill(HIST("ptHistogramKaonrec_purity"), track.pt()); + histos.fill(HIST("ptHistogramKaonrec_purity"), track.pt()); } nchKa += 1.; q1Ka += track.pt(); @@ -1270,12 +1245,10 @@ struct EventMeanPtId { } if (selProton(track)) { - if (std::fabs(track.y()) > cRapidityCut05) - continue; - if (track.beta() > 1) - continue; + if (std::fabs(track.y()) > cRapidityCut05) continue; + if (track.beta() > 1) continue; histos.fill(HIST("ptHistogramProtonrec"), track.pt()); - histos.fill(HIST("hPtEta_pr_rec"), track.pt(), track.eta()); + histos.fill(HIST("hPtEta_pr_rec"), track.pt(), track.eta()); histos.fill(HIST("Rec/hPtProton"), track.pt()); histos.fill(HIST("Rec/hEtaProton"), track.eta()); histos.fill(HIST("Rec/hyProton"), track.rapidity(massPr)); @@ -1286,7 +1259,7 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Rec/hTOFbeta_afterselection1"), track.p(), track.beta()); if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kProton) { - histos.fill(HIST("ptHistogramProtonrec_purity"), track.pt()); + histos.fill(HIST("ptHistogramProtonrec_purity"), track.pt()); } nchPr += 1.; q1Pr += track.pt(); @@ -1318,7 +1291,7 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hVar2"), sample, cent, var2); histos.fill(HIST("Rec/hVarc"), sample, cent); histos.fill(HIST("Rec/hVar2meanpt"), cent, var2); - + //---------------------- pions ---------------------------------------- if (nchPi >= cTwoPtlCut2) { var1Pi = (q1Pi * q1Pi - q2Pi) / (nchPi * (nchPi - 1)); @@ -1328,7 +1301,8 @@ struct EventMeanPtId { if (nchKa >= cTwoPtlCut2) { var1Ka = (q1Ka * q1Ka - q2Ka) / (nchKa * (nchKa - 1)); var2Ka = (q1Ka / nchKa); - } + + } //---------------------------- protons ---------------------------------- if (nchPr >= cTwoPtlCut2) { var1Pr = (q1Pr * q1Pr - q2Pr) / (nchPr * (nchPr - 1)); @@ -1378,7 +1352,7 @@ struct EventMeanPtId { histos.fill(HIST("hEffVar1x_Naccorr_xaxis_rec"), sample, sumWeight, var1); histos.fill(HIST("hEffVar2x_Naccorr_xaxis_rec"), sample, sumWeight, var2); histos.fill(HIST("hEffVarx_Naccorr_xaxis_rec"), sample, sumWeight); - + //================= generated level============================== const auto& mccolgen = coll.mcCollision_as(); @@ -1405,7 +1379,7 @@ struct EventMeanPtId { } nch1++; histos.fill(HIST("hnch_afterPhysPrimary"), nch1); - + int pid = mcpart.pdgCode(); auto sign = 0; auto* pd = pdg->GetParticle(pid); @@ -1416,19 +1390,17 @@ struct EventMeanPtId { continue; } // histos.fill(HIST("gen_hSign"), sign); - if (std::fabs(mcpart.eta()) > cEtacut) - continue; + if (std::fabs(mcpart.eta()) > cEtacut) continue; nchGenTrue++; histos.fill(HIST("hnch_gen_after_etacut"), nchGenTrue); - if (mcpart.pt() >= cPtmincut1 && mcpart.pt() <= cPtmaxcut1) { - nchgen += 1.; + if (mcpart.pt() >= cPtmincut1 && mcpart.pt() <= cPtmaxcut1) + { nchgen += 1.; histos.fill(HIST("hnch_gen"), nchgen); - histos.fill(HIST("hPtvar_gen"), mcpart.pt()); + histos.fill(HIST("hPtvar_gen"), mcpart.pt()); } - if ((mcpart.pt() < cPtmincut) || (mcpart.pt() > cPtmaxcut)) - continue; + if ((mcpart.pt() < cPtmincut) || (mcpart.pt() > cPtmaxcut)) continue; histos.fill(HIST("hPt_gen"), mcpart.pt()); histos.fill(HIST("hEta_gen"), mcpart.eta()); histos.fill(HIST("ptHistogram_allcharge_gen"), mcpart.pt()); @@ -1442,7 +1414,7 @@ struct EventMeanPtId { if (mcpart.pdgCode() == PDG_t::kPiPlus || mcpart.pdgCode() == PDG_t::kPiMinus) { histos.fill(HIST("ptHistogramPion"), mcpart.pt()); - histos.fill(HIST("hPtEta_pi_gen"), mcpart.pt(), mcpart.eta()); + histos.fill(HIST("hPtEta_pi_gen"), mcpart.pt(), mcpart.eta()); histos.fill(HIST("hPty_pi_gen"), mcpart.pt(), mcpart.y()); nchPiGen += 1.; q1PiGen += mcpart.pt(); @@ -1452,8 +1424,8 @@ struct EventMeanPtId { if (mcpart.pdgCode() == PDG_t::kKPlus || mcpart.pdgCode() == PDG_t::kKMinus) { histos.fill(HIST("ptHistogramKaon"), mcpart.pt()); - histos.fill(HIST("hPtEta_ka_gen"), mcpart.pt(), mcpart.eta()); - histos.fill(HIST("hPty_ka_gen"), mcpart.pt(), mcpart.y()); + histos.fill(HIST("hPtEta_ka_gen"), mcpart.pt(), mcpart.eta()); + histos.fill(HIST("hPty_ka_gen"), mcpart.pt(), mcpart.y()); nchKaGen += 1.; q1KaGen += mcpart.pt(); q2KaGen += (mcpart.pt() * mcpart.pt()); @@ -1462,8 +1434,8 @@ struct EventMeanPtId { if (mcpart.pdgCode() == PDG_t::kProton || mcpart.pdgCode() == PDG_t::kProtonBar) { histos.fill(HIST("ptHistogramProton"), mcpart.pt()); - histos.fill(HIST("hPtEta_pr_gen"), mcpart.pt(), mcpart.eta()); - histos.fill(HIST("hPty_pr_gen"), mcpart.pt(), mcpart.y()); + histos.fill(HIST("hPtEta_pr_gen"), mcpart.pt(), mcpart.eta()); + histos.fill(HIST("hPty_pr_gen"), mcpart.pt(), mcpart.y()); nchPrGen += 1.; q1PrGen += mcpart.pt(); q2PrGen += (mcpart.pt() * mcpart.pt()); @@ -1486,7 +1458,7 @@ struct EventMeanPtId { histos.fill(HIST("hterm1_gen"), nchGenAll, var1AllGen); histos.fill(HIST("hterm2_gen"), nchGenAll, var2AllGen); - //--------------------------Pions------------------------------------------- +//--------------------------Pions------------------------------------------- if (nchPiGen >= cTwoPtlCut2) { var1PiGen = (q1PiGen * q1PiGen - q2PiGen) / (nchPiGen * (nchPiGen - 1)); var2PiGen = (q1PiGen / nchPiGen); @@ -1525,7 +1497,8 @@ struct EventMeanPtId { } // void process PROCESS_SWITCH(EventMeanPtId, processMcReco, "Process reconstructed", false); -}; + + }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { From 132e46ee3c29e696f41554a80ce6afac9787d2ee Mon Sep 17 00:00:00 2001 From: sweta29singh Date: Wed, 8 Oct 2025 15:10:24 +0530 Subject: [PATCH 6/8] Mean pT Fluctuations --- .../EbyEFluctuations/Tasks/eventMeanPtId.cxx | 379 ++++++++++-------- 1 file changed, 203 insertions(+), 176 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx index 405620b4033..41d18570465 100644 --- a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx @@ -38,8 +38,8 @@ #include "Framework/RunningWorkflowInfo.h" #include "Framework/runDataProcessing.h" -#include #include "TF1.h" +#include #include #include @@ -129,8 +129,8 @@ struct EventMeanPtId { O2_DEFINE_CONFIGURABLE(cfgMultGlobalPVCutEnabled, bool, true, "Enable globalTracks vs PV multiplicity cut") Configurable> cfgMultPVFT0CCutPars{"cfgMultPVFT0CCutPars", - std::vector{3303.11, -121.316, 1.90207, -0.0152644, 5.10121e-05, 190.633, -4.32972, 0.0340001, -5.83261e-05, -3.19566e-07}, - "PV multiplicity vs T0C centrality cut parameter values"}; + std::vector{3303.11, -121.316, 1.90207, -0.0152644, 5.10121e-05, 190.633, -4.32972, 0.0340001, -5.83261e-05, -3.19566e-07}, + "PV multiplicity vs T0C centrality cut parameter values"}; Configurable> cfgMultGlobalFT0CCutPars{"cfgMultGlobalFT0CCutPars", std::vector{1893.97, -61.3423, 0.790664, -0.00507208, 1.41683e-05, 167.997, -5.29125, 0.0840145, -0.000748102, 2.75743e-06}, @@ -152,37 +152,34 @@ struct EventMeanPtId { TF1* fMultGlobalPVCutHigh = nullptr; } cfgFunCoeff; - Service ccdb; Service pdg; - Filter collisionFilter = nabs(aod::collision::posZ) <= cVtxZcut; - Filter trackFilter = (nabs(aod::track::eta) < cEtacut) && (aod::track::pt > ptMin) && (aod::track::pt < ptMax) && (requireGlobalTrackInFilter()); - -using MyCollisions = soa::Filtered>; -using MyCollision = MyCollisions::iterator; - -using MyTracks = soa::Filtered>; -using MyTrack = MyTracks::iterator; + Filter collisionFilter = nabs(aod::collision::posZ) <= cVtxZcut; + Filter trackFilter = (nabs(aod::track::eta) < cEtacut) && (aod::track::pt > ptMin) && (aod::track::pt < ptMax) && (requireGlobalTrackInFilter()); + using MyCollisions = soa::Filtered>; + using MyCollision = MyCollisions::iterator; -using MyMCRecoCollisions = soa::Filtered>; -using MyMCRecoCollision = MyMCRecoCollisions::iterator; + using MyTracks = soa::Filtered>; + using MyTrack = MyTracks::iterator; -using MyMCRecoTracks = soa::Filtered>; -using MyMCRecoTrack = MyMCRecoTracks::iterator; + using MyMCRecoCollisions = soa::Filtered>; + using MyMCRecoCollision = MyMCRecoCollisions::iterator; -using EventCandidatesMC = soa::Join; + using MyMCRecoTracks = soa::Filtered>; + using MyMCRecoTrack = MyMCRecoTracks::iterator; + using EventCandidatesMC = soa::Join; Configurable ccdbNoLaterThan{"ccdbNoLaterThan", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; Configurable cfgUrlCCDB{"cfgUrlCCDB", "http://alice-ccdb.cern.ch", "url of ccdb"}; @@ -197,7 +194,6 @@ using EventCandidatesMC = soa::Join> ptBins{"ptBins", {0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50, 0.55, 0.60, 0.65, 0.70, 0.75, 0.80, 0.85, 0.90, 0.95, 1.00, 1.05, 1.10, 1.15, 1.20, 1.25, 1.30, 1.35, 1.40, 1.45, 1.50, 1.55, 1.60, 1.65, 1.70, 1.75, 1.80, 1.85, 1.90, 1.95, 2.00}, "p_{T} bins"}; Configurable piluprejection{"piluprejection", false, "Pileup rejection"}; - void init(o2::framework::InitContext&) { if (cfgLoadEff) { @@ -210,14 +206,14 @@ using EventCandidatesMC = soa::JoingetForTimeStamp(cfgPathCCDB.value, -1); ptHistogramAllchargeRec = reinterpret_cast(lst->FindObject("hPtEta_rec")); - } + } std::vector ptBinning = {0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0}; // AxisSpec ptAxis = {ptBinning, "#it{p}_{T} (GeV/#it{c})"}; AxisSpec vtxZAxis = {100, -20.0, 20.0, "Z (cm)"}; AxisSpec dcaAxis = {1002, -5.01, 5.01, "DCA_{xy} (cm)"}; AxisSpec dcazAxis = {1002, -5.01, 5.01, "DCA_{z} (cm)"}; - AxisSpec ptAxis = {600, 0.0, 6.0, "#it{p}_{T} (GeV/#it{c})"};// 600,0,6 + AxisSpec ptAxis = {600, 0.0, 6.0, "#it{p}_{T} (GeV/#it{c})"}; // 600,0,6 AxisSpec pAxis = {400, 0.0, 4.0, "#it{p} (GeV/#it{c})"}; AxisSpec betaAxis = {200, 0.0, 2.0, "TOF_{#beta} (GeV/#it{c})"}; AxisSpec dEdxAxis = {2000, 0.0, 200.0, "dE/dx (GeV/#it{c})"}; @@ -361,10 +357,10 @@ using EventCandidatesMC = soa::Join cSigmaLowHighcut{"cSigmaLowHighcut", 3.0f, "lower and upper sigma cut"}; - cfgFunCoeff.fMultPVFT0CCutLow = new TF1("fMultPVFT0CCutLow", @@ -533,10 +528,9 @@ using EventCandidatesMC = soa::JoinSetParameters(&(cfgFunCoeff.multGlobalPVCutPars[0])); + } - } - -bool eventSelected(const float& globalNch, const float& pvTrack, const float& centrality) + bool eventSelected(const float& globalNch, const float& pvTrack, const float& centrality) { if (cfgFunCoeff.cfgMultPVFT0CCutEnabled) { @@ -574,12 +568,12 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce } // Reject the collisions with large vertex-z histos.fill(HIST("hEventcounter"), 2.); - if(ccentFT0C) { - cent = coll.centFT0C(); //centrality from FT0C + if (ccentFT0C) { + cent = coll.centFT0C(); // centrality from FT0C } else { - cent = coll.centFT0M(); //centrality from FT0M - } - + cent = coll.centFT0M(); // centrality from FT0M + } + if (cSel8Trig && !coll.sel8()) { return false; } // require min bias trigger @@ -607,7 +601,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce return false; } histos.fill(HIST("trackSelRec"), 7); - + // if (cItslayerall && !coll.selection_bit(aod::evsel::kIsGoodITSLayersAll)) {return false;} histos.fill(HIST("trackSelRec"), 8); @@ -627,41 +621,59 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce } // accept only global tracks histos.fill(HIST("tracksel"), 2); - if (cDCAxy && std::fabs(track.dcaXY()) > cDcaXYcut) {return false;} + if (cDCAxy && std::fabs(track.dcaXY()) > cDcaXYcut) { + return false; + } histos.fill(HIST("tracksel"), 3); - if (cDCAz && std::fabs(track.dcaZ()) > cDcaZcut) {return false;} + if (cDCAz && std::fabs(track.dcaZ()) > cDcaZcut) { + return false; + } histos.fill(HIST("tracksel"), 4); if (std::fabs(track.eta()) >= cEtacut) { return false; } histos.fill(HIST("tracksel"), 5); - - if (cTPCcr && track.tpcNClsCrossedRows() < cTPCcrosscut) {return false;} + + if (cTPCcr && track.tpcNClsCrossedRows() < cTPCcrosscut) { + return false; + } histos.fill(HIST("tracksel"), 6); - if (cITSchi && track.itsChi2NCl() >= cItsChiCut) {return false;} + if (cITSchi && track.itsChi2NCl() >= cItsChiCut) { + return false; + } histos.fill(HIST("tracksel"), 7); - if (cTPCchi && track.tpcChi2NCl() >= cTpcChiCut) {return false;} + if (cTPCchi && track.tpcChi2NCl() >= cTpcChiCut) { + return false; + } histos.fill(HIST("tracksel"), 8); - if (track.sign() == 0) {return false;} + if (track.sign() == 0) { + return false; + } - if(cPVContributor) - { if (!(track.isPVContributor())) {return false;} - histos.fill(HIST("tracksel"), 9); + if (cPVContributor) { + if (!(track.isPVContributor())) { + return false; + } + histos.fill(HIST("tracksel"), 9); } if (citsNCluster) { - if (track.itsNCls() < cnITSClustersCut) { return false; } - histos.fill(HIST("tracksel"), 10); + if (track.itsNCls() < cnITSClustersCut) { + return false; + } + histos.fill(HIST("tracksel"), 10); } - if(ctpcNClusterFound) { - if (track.tpcNClsFound() < ctpcNClsCut) {return false;} - histos.fill(HIST("tracksel"), 11); + if (ctpcNClusterFound) { + if (track.tpcNClsFound() < ctpcNClsCut) { + return false; + } + histos.fill(HIST("tracksel"), 11); } return true; // if all checks pass, accept the collision @@ -757,60 +769,60 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce return false; } - double getEfficiency(double pt, double eta, TH2D* ptHistogramAllchargeRec) + double getEfficiency(double pt, double eta, TH2D* ptHistogramAllchargeRec) { - int xbin = ptHistogramAllchargeRec->GetXaxis()->FindBin(pt); - int ybin = ptHistogramAllchargeRec->GetYaxis()->FindBin(eta); + int xbin = ptHistogramAllchargeRec->GetXaxis()->FindBin(pt); + int ybin = ptHistogramAllchargeRec->GetYaxis()->FindBin(eta); - if(xbin < 1 || xbin > ptHistogramAllchargeRec->GetNbinsX() || ybin < 1 || ybin > ptHistogramAllchargeRec->GetNbinsY()) { + if (xbin < 1 || xbin > ptHistogramAllchargeRec->GetNbinsX() || ybin < 1 || ybin > ptHistogramAllchargeRec->GetNbinsY()) { LOGF(warn, "pt or eta out of histograms bounds : %f, eta = %f", pt, eta); return 1e-6; - } - double eff = ptHistogramAllchargeRec->GetBinContent(xbin, ybin); - return (eff > 0) ? eff : 1e-6; // Avoid division by zero + } + double eff = ptHistogramAllchargeRec->GetBinContent(xbin, ybin); + return (eff > 0) ? eff : 1e-6; // Avoid division by zero } - //++++++++++++++++++++++++++++++++++++DATA CALCULATION +++++++++++++++++++++++++++++++++++++++++++++++++++++// - void processData(MyCollision const& coll, MyTracks const& inputTracks) + //++++++++++++++++++++++++++++++++++++DATA CALCULATION +++++++++++++++++++++++++++++++++++++++++++++++++++++// + void processData(MyCollision const& coll, MyTracks const& inputTracks) - { float cent = -1; + { + float cent = -1; histos.fill(HIST("hEventcounter"), 1.); histos.fill(HIST("Data/hZvtx_before_sel"), coll.posZ()); - if (!selCollision(coll,cent)) + if (!selCollision(coll, cent)) return; { histos.fill(HIST("Data/hZvtx_after_sel8"), coll.posZ()); - } + } histos.fill(HIST("Data/hCentrality"), cent); - float globalNch = inputTracks.size(); - float pvTrack = coll.multNTracksPV(); + float globalNch = inputTracks.size(); + float pvTrack = coll.multNTracksPV(); - histos.fill(HIST("Data/hNchPV_NchGlobal_before"), pvTrack, globalNch); - histos.fill(HIST("Data/hcentFT0C_GlobalNch_before"),coll.centFT0C(), globalNch); - histos.fill(HIST("Data/hcentFT0C_NchPV_before"), coll.centFT0C(), pvTrack); + histos.fill(HIST("Data/hNchPV_NchGlobal_before"), pvTrack, globalNch); + histos.fill(HIST("Data/hcentFT0C_GlobalNch_before"), coll.centFT0C(), globalNch); + histos.fill(HIST("Data/hcentFT0C_NchPV_before"), coll.centFT0C(), pvTrack); - - if (cfgEvSelMultCorrelation && !eventSelected(globalNch, pvTrack, cent)) { + if (cfgEvSelMultCorrelation && !eventSelected(globalNch, pvTrack, cent)) { return; - } + } + + histos.fill(HIST("Data/hNchPV_NchGlobal_after"), pvTrack, globalNch); + histos.fill(HIST("Data/hcentFT0C_GlobalNch_after"), coll.centFT0C(), globalNch); + histos.fill(HIST("Data/hcentFT0C_NchPV_after"), coll.centFT0C(), pvTrack); - histos.fill(HIST("Data/hNchPV_NchGlobal_after"), pvTrack, globalNch); - histos.fill(HIST("Data/hcentFT0C_GlobalNch_after"),coll.centFT0C(), globalNch); - histos.fill(HIST("Data/hcentFT0C_NchPV_after"), coll.centFT0C(), pvTrack); - - double nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0., nch = 0., nchPi = 0., nchKa = 0., nchPr = 0.; + double nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0., nch = 0., nchPi = 0., nchKa = 0., nchPr = 0.; double q1 = 0., q2 = 0., var1 = 0., var2 = 0.; double sumPtWeight = 0., sumWeight = 0., sumPtPtWeight = 0., var1Eff = 0., var2Eff = 0.; double q1Pi = 0., q2Pi = 0., var1Pi = 0., var2Pi = 0.; - double q1Ka = 0., q2Ka = 0., var1Ka = 0., var2Ka = 0.; + double q1Ka = 0., q2Ka = 0., var1Ka = 0., var2Ka = 0.; double q1Pr = 0., q2Pr = 0., var1Pr = 0., var2Pr = 0.; int sample = histos.get(HIST("Data/hZvtx_after_sel8"))->GetEntries(); - sample = sample % 30; - + sample = sample % 30; + for (const auto& track : inputTracks) { nchAllBfCut += 1.; histos.fill(HIST("Data/hnchAll_bf_cut"), nchAllBfCut); @@ -819,7 +831,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Data/hTPCchi2perCluster_before"), track.tpcChi2NCl()); histos.fill(HIST("Data/hITSchi2perCluster_before"), track.itsChi2NCl()); histos.fill(HIST("Data/hTPCCrossedrows_before"), track.tpcNClsCrossedRows()); - + if (std::fabs(track.eta()) <= cEtacut) { nchEta++; histos.fill(HIST("Data/hnchTrue"), nchEta); @@ -828,16 +840,18 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce nchPt += 1.; histos.fill(HIST("Data/hnchTrue_pt"), nchPt); } - if (!selTrack(track)) continue; - - if (track.pt() >= cPtmincut1 && track.pt() <= cPtmaxcut1) - { nch += 1.; + if (!selTrack(track)) + continue; + + if (track.pt() >= cPtmincut1 && track.pt() <= cPtmaxcut1) { + nch += 1.; histos.fill(HIST("Data/hnch"), nch); - histos.fill(HIST("Data/hPtvar"), track.pt()); + histos.fill(HIST("Data/hPtvar"), track.pt()); } - - if (track.pt() < cPtmincut || track.pt() > cPtmaxcut) continue; - + + if (track.pt() < cPtmincut || track.pt() > cPtmaxcut) + continue; + nchAll += 1.; q1 += track.pt(); q2 += (track.pt() * track.pt()); @@ -857,13 +871,13 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Data/hPEta"), track.p(), track.eta()); histos.fill(HIST("Data/hNsigmaTPC"), track.p(), track.tpcNSigmaPr()); - double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); + double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); if (eff < threshold) - continue; - double weight = 1./eff; + continue; + double weight = 1. / eff; sumPtWeight += track.pt() / eff; sumPtPtWeight += (track.pt() * track.pt()) / (eff * eff); - sumWeight += weight; + sumWeight += weight; // only TPC tracks: Pion, Kaon, Proton if (track.hasTPC() && std::abs(track.tpcNSigmaPi()) < cNSigCut3) @@ -947,22 +961,22 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Data/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Data/hTOFbeta_afterselection1"), track.p(), track.beta()); } - + } // Track loop ends! histos.fill(HIST("Data/hcentFV0A_nacc"), coll.multFV0A(), nchAll); histos.fill(HIST("Data/hcentFT0A_nacc"), coll.multFT0A(), nchAll); histos.fill(HIST("Data/hcentFT0M_nacc"), coll.centFT0M(), nchAll); histos.fill(HIST("Data/hcent_nacc"), cent, nchAll); - if (nchAll < cTwoPtlCut2) + if (nchAll < cTwoPtlCut2) return; var1 = (q1 * q1 - q2) / (nchAll * (nchAll - 1)); var2 = (q1 / nchAll); - - //------------------ Efficiency corrected histograms --------------- + + //------------------ Efficiency corrected histograms --------------- var1Eff = (sumPtWeight * sumPtWeight - sumPtPtWeight) / (sumWeight * (sumWeight - 1)); var2Eff = (sumPtWeight / sumWeight); - + //---------------------- pions ---------------------------------------- if (nchPi >= cTwoPtlCut2) { var1Pi = (q1Pi * q1Pi - q2Pi) / (nchPi * (nchPi - 1)); @@ -978,8 +992,8 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce var1Pr = (q1Pr * q1Pr - q2Pr) / (nchPr * (nchPr - 1)); var2Pr = (q1Pr / nchPr); } - - //------------------ all charges------------------------------------- + + //------------------ all charges------------------------------------- histos.fill(HIST("Data/hVar1"), sample, cent, var1); histos.fill(HIST("Data/hVar2"), sample, cent, var2); histos.fill(HIST("Data/hVarc"), sample, cent); @@ -1002,7 +1016,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Data/hdiffVar1x"), sample, nch, var1); histos.fill(HIST("Data/hdiffVar2x"), sample, nch, var2); histos.fill(HIST("Data/hdiffVarx"), sample, nch); - + histos.fill(HIST("hEffVar1x_data"), sample, nchAll, var1Eff); histos.fill(HIST("hEffVar2x_data"), sample, nchAll, var2Eff); histos.fill(HIST("hEffVarx_data"), sample, nchAll); @@ -1034,38 +1048,42 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce } // event loop ends! PROCESS_SWITCH(EventMeanPtId, processData, "process real data information", true); - + //++++++++++++++++++++++++++++++++++++MC Reconstructed +++++++++++++++++++++++++++++++++++++++++++++++++++++// - SliceCache cache; - Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; - void processMcReco(MyMCRecoCollision const& coll, MyMCRecoTracks const& inputTracks, aod::McCollisions const& mcCollisions, aod::McParticles const& mcParticles) - { float cent = -1; + SliceCache cache; + Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; + void processMcReco(MyMCRecoCollision const& coll, MyMCRecoTracks const& inputTracks, aod::McCollisions const& mcCollisions, aod::McParticles const& mcParticles) + { + float cent = -1; (void)mcCollisions; - if (!coll.has_mcCollision()) {return;} - + if (!coll.has_mcCollision()) { + return; + } + histos.fill(HIST("Rec/hZvtx_before_sel"), coll.posZ()); histos.fill(HIST("hVtxZ_before_gen"), coll.mcCollision().posZ()); - histos.fill(HIST("hCentrality_rec_before"), cent); + histos.fill(HIST("hCentrality_rec_before"), cent); - if (!selCollision(coll,cent)) return; + if (!selCollision(coll, cent)) + return; histos.fill(HIST("Rec/hZvtx_after_sel8"), coll.posZ()); - histos.fill(HIST("Rec/hCentrality"), cent); + histos.fill(HIST("Rec/hCentrality"), cent); float globalNch = inputTracks.size(); - float pvTrack = coll.multNTracksPV(); + float pvTrack = coll.multNTracksPV(); - histos.fill(HIST("Rec/hNchPV_NchGlobal_before"), pvTrack, globalNch); - histos.fill(HIST("Rec/hcentFT0C_GlobalNch_before"),coll.centFT0C(), globalNch); - histos.fill(HIST("Rec/hcentFT0C_NchPV_before"), coll.centFT0C(), pvTrack); - - if (cfgEvSelMultCorrelation && !eventSelected(globalNch, pvTrack, cent)) { + histos.fill(HIST("Rec/hNchPV_NchGlobal_before"), pvTrack, globalNch); + histos.fill(HIST("Rec/hcentFT0C_GlobalNch_before"), coll.centFT0C(), globalNch); + histos.fill(HIST("Rec/hcentFT0C_NchPV_before"), coll.centFT0C(), pvTrack); + + if (cfgEvSelMultCorrelation && !eventSelected(globalNch, pvTrack, cent)) { return; - } + } - histos.fill(HIST("Rec/hNchPV_NchGlobal_after"), pvTrack, globalNch); - histos.fill(HIST("Rec/hcentFT0C_GlobalNch_after"),coll.centFT0C(), globalNch); - histos.fill(HIST("Rec/hcentFT0C_NchPV_after"), coll.centFT0C(), pvTrack); + histos.fill(HIST("Rec/hNchPV_NchGlobal_after"), pvTrack, globalNch); + histos.fill(HIST("Rec/hcentFT0C_GlobalNch_after"), coll.centFT0C(), globalNch); + histos.fill(HIST("Rec/hcentFT0C_NchPV_after"), coll.centFT0C(), pvTrack); double nch = 0., nchPi = 0., nchKa = 0., nchPr = 0., nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0.; double q1 = 0., q2 = 0.; @@ -1073,7 +1091,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce double var1 = 0., var2 = 0.; double var1Pi = 0., var2Pi = 0., var1Ka = 0., var2Ka = 0., var1Pr = 0., var2Pr = 0.; double sumPtWeight = 0., sumWeight = 0., sumPtPtWeight = 0., var1Eff = 0., var2Eff = 0.; - + int sample = histos.get(HIST("Rec/hZvtx_after_sel8"))->GetEntries(); sample = sample % 30; @@ -1084,37 +1102,40 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Rec/hITSchi2perCluster_before"), track.itsChi2NCl()); histos.fill(HIST("Rec/hTPCCrossedrows_before"), track.tpcNClsCrossedRows()); - if (std::fabs(track.eta()) <= cEtacut) - { nchEta++; + if (std::fabs(track.eta()) <= cEtacut) { + nchEta++; histos.fill(HIST("Rec/hnchTrue"), nchEta); } - if (track.pt() >= cPtmincut && track.pt() <= cPtmaxcut) - { nchPt += 1.; + if (track.pt() >= cPtmincut && track.pt() <= cPtmaxcut) { + nchPt += 1.; histos.fill(HIST("Rec/hnchTrue_pt"), nchPt); } - - if (!selTrack(track)) continue; - - if (track.pt() >= cPtmincut1 && track.pt() <= cPtmaxcut1) - { nch += 1.; + + if (!selTrack(track)) + continue; + + if (track.pt() >= cPtmincut1 && track.pt() <= cPtmaxcut1) { + nch += 1.; histos.fill(HIST("Rec/hnch"), nch); - histos.fill(HIST("Rec/hPtvar"), track.pt()); + histos.fill(HIST("Rec/hPtvar"), track.pt()); } - if (track.pt() < cPtmincut || track.pt() > cPtmaxcut) continue; - + if (track.pt() < cPtmincut || track.pt() > cPtmaxcut) + continue; + // if (std::fabs(track.y()) > 0.5) continue; histos.fill(HIST("hPt_rec"), track.pt()); histos.fill(HIST("hEta_rec"), track.eta()); double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); - if (eff < threshold) continue; + if (eff < threshold) + continue; double weight = 1.0 / eff; sumPtWeight += track.pt() * weight; sumPtPtWeight += (track.pt() * track.pt() * weight * weight); sumWeight += weight; - - histos.fill(HIST("hPt_rec_corr"), track.pt() , weight); - histos.fill(HIST("hEta_rec_corr"), track.eta() , weight); + + histos.fill(HIST("hPt_rec_corr"), track.pt(), weight); + histos.fill(HIST("hEta_rec_corr"), track.eta(), weight); auto mcParticle = track.mcParticle(); nchAll += 1.; @@ -1137,7 +1158,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Rec/hPEta"), track.p(), track.eta()); histos.fill(HIST("Rec/hNsigmaTPC"), track.p(), track.tpcNSigmaPr()); histos.fill(HIST("hPtEta_rec"), track.pt(), track.eta()); - + if (std::abs(mcParticle.pdgCode()) == PDG_t::kPiPlus) histos.fill(HIST("ptHistogramPionrec_pdg"), track.pt()); if (std::abs(mcParticle.pdgCode()) == PDG_t::kKPlus) @@ -1179,10 +1200,12 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce } if (selPion(track)) { - if (std::fabs(track.y()) > cRapidityCut05) continue; - if (track.beta() > 1) continue; + if (std::fabs(track.y()) > cRapidityCut05) + continue; + if (track.beta() > 1) + continue; histos.fill(HIST("ptHistogramPionrec"), track.pt()); - histos.fill(HIST("hPtEta_pi_rec"), track.pt(), track.eta()); + histos.fill(HIST("hPtEta_pi_rec"), track.pt(), track.eta()); histos.fill(HIST("Rec/hPtPion"), track.pt()); histos.fill(HIST("Rec/hEtaPion"), track.eta()); histos.fill(HIST("Rec/hyPion"), track.rapidity(massPi)); @@ -1193,14 +1216,14 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Rec/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Rec/hTOFbeta_afterselection1"), track.p(), track.beta()); if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kPiPlus) { - histos.fill(HIST("ptHistogramPionrec_purity"), track.pt()); + histos.fill(HIST("ptHistogramPionrec_purity"), track.pt()); } nchPi += 1.; q1Pi += track.pt(); q2Pi += (track.pt() * track.pt()); - histos.fill(HIST("hPyPion_rec"), track.p(), track.rapidity(massPi)); - histos.fill(HIST("hPtyPion_rec"), track.pt(), track.rapidity(massPi)); + histos.fill(HIST("hPyPion_rec"), track.p(), track.rapidity(massPi)); + histos.fill(HIST("hPtyPion_rec"), track.pt(), track.rapidity(massPi)); } //===========================kaon=============================================================== @@ -1212,10 +1235,12 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce } if (selKaon(track)) { - if (std::fabs(track.y()) > cRapidityCut05) continue; - if (track.beta() > 1) continue; + if (std::fabs(track.y()) > cRapidityCut05) + continue; + if (track.beta() > 1) + continue; histos.fill(HIST("ptHistogramKaonrec"), track.pt()); - histos.fill(HIST("hPtEta_ka_rec"), track.pt(), track.eta()); + histos.fill(HIST("hPtEta_ka_rec"), track.pt(), track.eta()); histos.fill(HIST("Rec/hPtKaon"), track.pt()); histos.fill(HIST("Rec/hEtaKaon"), track.eta()); histos.fill(HIST("Rec/hyKaon"), track.rapidity(massKa)); @@ -1226,7 +1251,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Rec/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Rec/hTOFbeta_afterselection1"), track.p(), track.beta()); if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kKPlus) { - histos.fill(HIST("ptHistogramKaonrec_purity"), track.pt()); + histos.fill(HIST("ptHistogramKaonrec_purity"), track.pt()); } nchKa += 1.; q1Ka += track.pt(); @@ -1245,10 +1270,12 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce } if (selProton(track)) { - if (std::fabs(track.y()) > cRapidityCut05) continue; - if (track.beta() > 1) continue; + if (std::fabs(track.y()) > cRapidityCut05) + continue; + if (track.beta() > 1) + continue; histos.fill(HIST("ptHistogramProtonrec"), track.pt()); - histos.fill(HIST("hPtEta_pr_rec"), track.pt(), track.eta()); + histos.fill(HIST("hPtEta_pr_rec"), track.pt(), track.eta()); histos.fill(HIST("Rec/hPtProton"), track.pt()); histos.fill(HIST("Rec/hEtaProton"), track.eta()); histos.fill(HIST("Rec/hyProton"), track.rapidity(massPr)); @@ -1259,7 +1286,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Rec/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Rec/hTOFbeta_afterselection1"), track.p(), track.beta()); if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kProton) { - histos.fill(HIST("ptHistogramProtonrec_purity"), track.pt()); + histos.fill(HIST("ptHistogramProtonrec_purity"), track.pt()); } nchPr += 1.; q1Pr += track.pt(); @@ -1291,7 +1318,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Rec/hVar2"), sample, cent, var2); histos.fill(HIST("Rec/hVarc"), sample, cent); histos.fill(HIST("Rec/hVar2meanpt"), cent, var2); - + //---------------------- pions ---------------------------------------- if (nchPi >= cTwoPtlCut2) { var1Pi = (q1Pi * q1Pi - q2Pi) / (nchPi * (nchPi - 1)); @@ -1301,8 +1328,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce if (nchKa >= cTwoPtlCut2) { var1Ka = (q1Ka * q1Ka - q2Ka) / (nchKa * (nchKa - 1)); var2Ka = (q1Ka / nchKa); - - } + } //---------------------------- protons ---------------------------------- if (nchPr >= cTwoPtlCut2) { var1Pr = (q1Pr * q1Pr - q2Pr) / (nchPr * (nchPr - 1)); @@ -1352,7 +1378,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("hEffVar1x_Naccorr_xaxis_rec"), sample, sumWeight, var1); histos.fill(HIST("hEffVar2x_Naccorr_xaxis_rec"), sample, sumWeight, var2); histos.fill(HIST("hEffVarx_Naccorr_xaxis_rec"), sample, sumWeight); - + //================= generated level============================== const auto& mccolgen = coll.mcCollision_as(); @@ -1379,7 +1405,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce } nch1++; histos.fill(HIST("hnch_afterPhysPrimary"), nch1); - + int pid = mcpart.pdgCode(); auto sign = 0; auto* pd = pdg->GetParticle(pid); @@ -1390,17 +1416,19 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce continue; } // histos.fill(HIST("gen_hSign"), sign); - if (std::fabs(mcpart.eta()) > cEtacut) continue; + if (std::fabs(mcpart.eta()) > cEtacut) + continue; nchGenTrue++; histos.fill(HIST("hnch_gen_after_etacut"), nchGenTrue); - if (mcpart.pt() >= cPtmincut1 && mcpart.pt() <= cPtmaxcut1) - { nchgen += 1.; + if (mcpart.pt() >= cPtmincut1 && mcpart.pt() <= cPtmaxcut1) { + nchgen += 1.; histos.fill(HIST("hnch_gen"), nchgen); - histos.fill(HIST("hPtvar_gen"), mcpart.pt()); + histos.fill(HIST("hPtvar_gen"), mcpart.pt()); } - if ((mcpart.pt() < cPtmincut) || (mcpart.pt() > cPtmaxcut)) continue; + if ((mcpart.pt() < cPtmincut) || (mcpart.pt() > cPtmaxcut)) + continue; histos.fill(HIST("hPt_gen"), mcpart.pt()); histos.fill(HIST("hEta_gen"), mcpart.eta()); histos.fill(HIST("ptHistogram_allcharge_gen"), mcpart.pt()); @@ -1414,7 +1442,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce if (mcpart.pdgCode() == PDG_t::kPiPlus || mcpart.pdgCode() == PDG_t::kPiMinus) { histos.fill(HIST("ptHistogramPion"), mcpart.pt()); - histos.fill(HIST("hPtEta_pi_gen"), mcpart.pt(), mcpart.eta()); + histos.fill(HIST("hPtEta_pi_gen"), mcpart.pt(), mcpart.eta()); histos.fill(HIST("hPty_pi_gen"), mcpart.pt(), mcpart.y()); nchPiGen += 1.; q1PiGen += mcpart.pt(); @@ -1424,8 +1452,8 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce if (mcpart.pdgCode() == PDG_t::kKPlus || mcpart.pdgCode() == PDG_t::kKMinus) { histos.fill(HIST("ptHistogramKaon"), mcpart.pt()); - histos.fill(HIST("hPtEta_ka_gen"), mcpart.pt(), mcpart.eta()); - histos.fill(HIST("hPty_ka_gen"), mcpart.pt(), mcpart.y()); + histos.fill(HIST("hPtEta_ka_gen"), mcpart.pt(), mcpart.eta()); + histos.fill(HIST("hPty_ka_gen"), mcpart.pt(), mcpart.y()); nchKaGen += 1.; q1KaGen += mcpart.pt(); q2KaGen += (mcpart.pt() * mcpart.pt()); @@ -1434,8 +1462,8 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce if (mcpart.pdgCode() == PDG_t::kProton || mcpart.pdgCode() == PDG_t::kProtonBar) { histos.fill(HIST("ptHistogramProton"), mcpart.pt()); - histos.fill(HIST("hPtEta_pr_gen"), mcpart.pt(), mcpart.eta()); - histos.fill(HIST("hPty_pr_gen"), mcpart.pt(), mcpart.y()); + histos.fill(HIST("hPtEta_pr_gen"), mcpart.pt(), mcpart.eta()); + histos.fill(HIST("hPty_pr_gen"), mcpart.pt(), mcpart.y()); nchPrGen += 1.; q1PrGen += mcpart.pt(); q2PrGen += (mcpart.pt() * mcpart.pt()); @@ -1458,7 +1486,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("hterm1_gen"), nchGenAll, var1AllGen); histos.fill(HIST("hterm2_gen"), nchGenAll, var2AllGen); -//--------------------------Pions------------------------------------------- + //--------------------------Pions------------------------------------------- if (nchPiGen >= cTwoPtlCut2) { var1PiGen = (q1PiGen * q1PiGen - q2PiGen) / (nchPiGen * (nchPiGen - 1)); var2PiGen = (q1PiGen / nchPiGen); @@ -1497,8 +1525,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce } // void process PROCESS_SWITCH(EventMeanPtId, processMcReco, "Process reconstructed", false); - - }; +}; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { From f7e456a9f72fab754722d64ecb7796fc7594ba84 Mon Sep 17 00:00:00 2001 From: sweta29singh Date: Wed, 8 Oct 2025 16:49:09 +0530 Subject: [PATCH 7/8] Mean pT Fluctuations --- .../EbyEFluctuations/Tasks/eventMeanPtId.cxx | 387 ++++++++---------- 1 file changed, 179 insertions(+), 208 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx index 41d18570465..9763ef0f070 100644 --- a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx @@ -38,8 +38,8 @@ #include "Framework/RunningWorkflowInfo.h" #include "Framework/runDataProcessing.h" -#include "TF1.h" #include +#include "TF1.h" #include #include @@ -78,6 +78,10 @@ struct EventMeanPtId { Configurable cnITSClustersCut{"cnITSClustersCut", 5, "Number of ITS clusters cut"}; Configurable ctpcNClsCut{"ctpcNClsCut", 80, "No. of TPC clusters cut"}; Configurable threshold{"threshold", 1e-6, "Delta eta bin count"}; + Configurable ptMax{"ptMax", 2.0, "maximum pT"}; + Configurable ptMin{"ptMin", 0.15, "minimum pT"}; + Configurable> ptBins{"ptBins", {0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50, 0.55, 0.60, 0.65, 0.70, 0.75, 0.80, 0.85, 0.90, 0.95, 1.00, 1.05, 1.10, 1.15, 1.20, 1.25, 1.30, 1.35, 1.40, 1.45, 1.50, 1.55, 1.60, 1.65, 1.70, 1.75, 1.80, 1.85, 1.90, 1.95, 2.00}, "p_{T} bins"}; + Configurable piluprejection{"piluprejection", false, "Pileup rejection"}; // Event selections Configurable cSel8Trig{"cSel8Trig", true, "Sel8 (T0A + T0C) Selection Run3"}; @@ -129,8 +133,8 @@ struct EventMeanPtId { O2_DEFINE_CONFIGURABLE(cfgMultGlobalPVCutEnabled, bool, true, "Enable globalTracks vs PV multiplicity cut") Configurable> cfgMultPVFT0CCutPars{"cfgMultPVFT0CCutPars", - std::vector{3303.11, -121.316, 1.90207, -0.0152644, 5.10121e-05, 190.633, -4.32972, 0.0340001, -5.83261e-05, -3.19566e-07}, - "PV multiplicity vs T0C centrality cut parameter values"}; + std::vector{3303.11, -121.316, 1.90207, -0.0152644, 5.10121e-05, 190.633, -4.32972, 0.0340001, -5.83261e-05, -3.19566e-07}, + "PV multiplicity vs T0C centrality cut parameter values"}; Configurable> cfgMultGlobalFT0CCutPars{"cfgMultGlobalFT0CCutPars", std::vector{1893.97, -61.3423, 0.790664, -0.00507208, 1.41683e-05, 167.997, -5.29125, 0.0840145, -0.000748102, 2.75743e-06}, @@ -152,34 +156,37 @@ struct EventMeanPtId { TF1* fMultGlobalPVCutHigh = nullptr; } cfgFunCoeff; + Service ccdb; Service pdg; - Filter collisionFilter = nabs(aod::collision::posZ) <= cVtxZcut; - Filter trackFilter = (nabs(aod::track::eta) < cEtacut) && (aod::track::pt > ptMin) && (aod::track::pt < ptMax) && (requireGlobalTrackInFilter()); + Filter collisionFilter = nabs(aod::collision::posZ) <= cVtxZcut; + Filter trackFilter = (nabs(aod::track::eta) < cEtacut) && (aod::track::pt > ptMin) && (aod::track::pt < ptMax) && (requireGlobalTrackInFilter()); + +using MyCollisions = soa::Filtered>; +using MyCollision = MyCollisions::iterator; - using MyCollisions = soa::Filtered>; - using MyCollision = MyCollisions::iterator; +using MyTracks = soa::Filtered>; +using MyTrack = MyTracks::iterator; - using MyTracks = soa::Filtered>; - using MyTrack = MyTracks::iterator; - using MyMCRecoCollisions = soa::Filtered>; - using MyMCRecoCollision = MyMCRecoCollisions::iterator; +using MyMCRecoCollisions = soa::Filtered>; +using MyMCRecoCollision = MyMCRecoCollisions::iterator; - using MyMCRecoTracks = soa::Filtered>; - using MyMCRecoTrack = MyMCRecoTracks::iterator; +using MyMCRecoTracks = soa::Filtered>; +using MyMCRecoTrack = MyMCRecoTracks::iterator; + +using EventCandidatesMC = soa::Join; - using EventCandidatesMC = soa::Join; Configurable ccdbNoLaterThan{"ccdbNoLaterThan", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; Configurable cfgUrlCCDB{"cfgUrlCCDB", "http://alice-ccdb.cern.ch", "url of ccdb"}; @@ -189,11 +196,6 @@ struct EventMeanPtId { HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; TH2D* ptHistogramAllchargeRec = nullptr; - Configurable ptMax{"ptMax", 2.0, "maximum pT"}; - Configurable ptMin{"ptMin", 0.15, "minimum pT"}; - Configurable> ptBins{"ptBins", {0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50, 0.55, 0.60, 0.65, 0.70, 0.75, 0.80, 0.85, 0.90, 0.95, 1.00, 1.05, 1.10, 1.15, 1.20, 1.25, 1.30, 1.35, 1.40, 1.45, 1.50, 1.55, 1.60, 1.65, 1.70, 1.75, 1.80, 1.85, 1.90, 1.95, 2.00}, "p_{T} bins"}; - Configurable piluprejection{"piluprejection", false, "Pileup rejection"}; - void init(o2::framework::InitContext&) { if (cfgLoadEff) { @@ -206,14 +208,14 @@ struct EventMeanPtId { TList* lst = ccdb->getForTimeStamp(cfgPathCCDB.value, -1); ptHistogramAllchargeRec = reinterpret_cast(lst->FindObject("hPtEta_rec")); - } + } std::vector ptBinning = {0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0}; // AxisSpec ptAxis = {ptBinning, "#it{p}_{T} (GeV/#it{c})"}; AxisSpec vtxZAxis = {100, -20.0, 20.0, "Z (cm)"}; AxisSpec dcaAxis = {1002, -5.01, 5.01, "DCA_{xy} (cm)"}; AxisSpec dcazAxis = {1002, -5.01, 5.01, "DCA_{z} (cm)"}; - AxisSpec ptAxis = {600, 0.0, 6.0, "#it{p}_{T} (GeV/#it{c})"}; // 600,0,6 + AxisSpec ptAxis = {600, 0.0, 6.0, "#it{p}_{T} (GeV/#it{c})"};// 600,0,6 AxisSpec pAxis = {400, 0.0, 4.0, "#it{p} (GeV/#it{c})"}; AxisSpec betaAxis = {200, 0.0, 2.0, "TOF_{#beta} (GeV/#it{c})"}; AxisSpec dEdxAxis = {2000, 0.0, 200.0, "dE/dx (GeV/#it{c})"}; @@ -357,10 +359,10 @@ struct EventMeanPtId { histos.add("Data/hNchPV_NchGlobal_after3", "hNchPV_NchGlobal_after3", kTH2D, {nchAxis, nchAxis}); histos.add("Data/hNchPV_NchGlobal_after4", "hNchPV_NchGlobal_after4", kTH2D, {nchAxis, nchAxis}); histos.add("Data/hNchPV_NchGlobal_after5", "hNchPV_NchGlobal_after5", kTH2D, {nchAxis, nchAxis}); - + histos.addClone("Data/", "Rec/"); // rec histograms - histos.add("hcent_nacc_corr", "hcent_nacc_corr", kTH2D, {centAxis, nchAxis}); + histos.add("hcent_nacc_corr", "hcent_nacc_corr", kTH2D, {centAxis, nchAxis}); histos.add("NSigamaTPCpion_rec", "NSigamaTPCpion_rec", kTH2D, {pAxis, nSigmaTPCAxispid}); histos.add("NSigamaTPCkaon_rec", "NSigamaTPCkaon_rec", kTH2D, {pAxis, nSigmaTPCAxispid}); histos.add("NSigamaTPCproton_rec", "NSigamaTPCproton_rec", kTH2D, {pAxis, nSigmaTPCAxispid}); @@ -418,7 +420,7 @@ struct EventMeanPtId { histos.add("hnch_pr", ";hnch_pr", kTH1D, {nchAxis}); histos.add("hnch_gen", ";hnch_gen", kTH1D, {nchAxis}); histos.add("hPtvar_gen", ";#it{p}_{T} (GeV/#it{c})", kTH1D, {ptAxis}); - + histos.add("hVar1x_gen", "hVar1x_gen", kTH2D, {subAxis, nchAxis}); histos.add("hVar2x_gen", "hVar2x_gen", kTH2D, {subAxis, nchAxis}); histos.add("hVarx_gen", "hVarx_gen", kTH2D, {subAxis, nchAxis}); @@ -486,12 +488,13 @@ struct EventMeanPtId { histos.add("hterm2_gen", "hterm2_gen", kTProfile, {tnchAxis}); histos.add("hCentrality_rec_before", "hCentrality_rec_before", kTH1D, {centAxis}); histos.add("hEta1", ";hEta1", kTH1D, {etaAxis}); - + cfgFunCoeff.multPVFT0CCutPars = cfgFunCoeff.cfgMultPVFT0CCutPars; cfgFunCoeff.multGlobalFT0CPars = cfgFunCoeff.cfgMultGlobalFT0CCutPars; cfgFunCoeff.multGlobalPVCutPars = cfgFunCoeff.cfgMultGlobalPVCutPars; Configurable cSigmaLowHighcut{"cSigmaLowHighcut", 3.0f, "lower and upper sigma cut"}; + cfgFunCoeff.fMultPVFT0CCutLow = new TF1("fMultPVFT0CCutLow", @@ -528,9 +531,10 @@ struct EventMeanPtId { "[0] + [1]*x + 3.0*([2] + [3]*x + [4]*x*x + [5]*x*x*x)", 0, 100); cfgFunCoeff.fMultGlobalPVCutHigh->SetParameters(&(cfgFunCoeff.multGlobalPVCutPars[0])); - } - bool eventSelected(const float& globalNch, const float& pvTrack, const float& centrality) + } + +bool eventSelected(const float& globalNch, const float& pvTrack, const float& centrality) { if (cfgFunCoeff.cfgMultPVFT0CCutEnabled) { @@ -568,12 +572,12 @@ struct EventMeanPtId { } // Reject the collisions with large vertex-z histos.fill(HIST("hEventcounter"), 2.); - if (ccentFT0C) { - cent = coll.centFT0C(); // centrality from FT0C + if(ccentFT0C) { + cent = coll.centFT0C(); //centrality from FT0C } else { - cent = coll.centFT0M(); // centrality from FT0M - } - + cent = coll.centFT0M(); //centrality from FT0M + } + if (cSel8Trig && !coll.sel8()) { return false; } // require min bias trigger @@ -601,7 +605,7 @@ struct EventMeanPtId { return false; } histos.fill(HIST("trackSelRec"), 7); - + // if (cItslayerall && !coll.selection_bit(aod::evsel::kIsGoodITSLayersAll)) {return false;} histos.fill(HIST("trackSelRec"), 8); @@ -621,59 +625,41 @@ struct EventMeanPtId { } // accept only global tracks histos.fill(HIST("tracksel"), 2); - if (cDCAxy && std::fabs(track.dcaXY()) > cDcaXYcut) { - return false; - } + if (cDCAxy && std::fabs(track.dcaXY()) > cDcaXYcut) {return false;} histos.fill(HIST("tracksel"), 3); - if (cDCAz && std::fabs(track.dcaZ()) > cDcaZcut) { - return false; - } + if (cDCAz && std::fabs(track.dcaZ()) > cDcaZcut) {return false;} histos.fill(HIST("tracksel"), 4); if (std::fabs(track.eta()) >= cEtacut) { return false; } histos.fill(HIST("tracksel"), 5); - - if (cTPCcr && track.tpcNClsCrossedRows() < cTPCcrosscut) { - return false; - } + + if (cTPCcr && track.tpcNClsCrossedRows() < cTPCcrosscut) {return false;} histos.fill(HIST("tracksel"), 6); - if (cITSchi && track.itsChi2NCl() >= cItsChiCut) { - return false; - } + if (cITSchi && track.itsChi2NCl() >= cItsChiCut) {return false;} histos.fill(HIST("tracksel"), 7); - if (cTPCchi && track.tpcChi2NCl() >= cTpcChiCut) { - return false; - } + if (cTPCchi && track.tpcChi2NCl() >= cTpcChiCut) {return false;} histos.fill(HIST("tracksel"), 8); - if (track.sign() == 0) { - return false; - } + if (track.sign() == 0) {return false;} - if (cPVContributor) { - if (!(track.isPVContributor())) { - return false; - } - histos.fill(HIST("tracksel"), 9); + if(cPVContributor) + { if (!(track.isPVContributor())) {return false;} + histos.fill(HIST("tracksel"), 9); } if (citsNCluster) { - if (track.itsNCls() < cnITSClustersCut) { - return false; - } - histos.fill(HIST("tracksel"), 10); + if (track.itsNCls() < cnITSClustersCut) { return false; } + histos.fill(HIST("tracksel"), 10); } - if (ctpcNClusterFound) { - if (track.tpcNClsFound() < ctpcNClsCut) { - return false; - } - histos.fill(HIST("tracksel"), 11); + if(ctpcNClusterFound) { + if (track.tpcNClsFound() < ctpcNClsCut) {return false;} + histos.fill(HIST("tracksel"), 11); } return true; // if all checks pass, accept the collision @@ -769,60 +755,60 @@ struct EventMeanPtId { return false; } - double getEfficiency(double pt, double eta, TH2D* ptHistogramAllchargeRec) + double getEfficiency(double pt, double eta, TH2D* ptHistogramAllchargeRec) { - int xbin = ptHistogramAllchargeRec->GetXaxis()->FindBin(pt); - int ybin = ptHistogramAllchargeRec->GetYaxis()->FindBin(eta); + int xbin = ptHistogramAllchargeRec->GetXaxis()->FindBin(pt); + int ybin = ptHistogramAllchargeRec->GetYaxis()->FindBin(eta); - if (xbin < 1 || xbin > ptHistogramAllchargeRec->GetNbinsX() || ybin < 1 || ybin > ptHistogramAllchargeRec->GetNbinsY()) { + if(xbin < 1 || xbin > ptHistogramAllchargeRec->GetNbinsX() || ybin < 1 || ybin > ptHistogramAllchargeRec->GetNbinsY()) { LOGF(warn, "pt or eta out of histograms bounds : %f, eta = %f", pt, eta); return 1e-6; - } - double eff = ptHistogramAllchargeRec->GetBinContent(xbin, ybin); - return (eff > 0) ? eff : 1e-6; // Avoid division by zero + } + double eff = ptHistogramAllchargeRec->GetBinContent(xbin, ybin); + return (eff > 0) ? eff : 1e-6; // Avoid division by zero } - //++++++++++++++++++++++++++++++++++++DATA CALCULATION +++++++++++++++++++++++++++++++++++++++++++++++++++++// - void processData(MyCollision const& coll, MyTracks const& inputTracks) + //++++++++++++++++++++++++++++++++++++DATA CALCULATION +++++++++++++++++++++++++++++++++++++++++++++++++++++// + void processData(MyCollision const& coll, MyTracks const& inputTracks) - { - float cent = -1; + { float cent = -1; histos.fill(HIST("hEventcounter"), 1.); histos.fill(HIST("Data/hZvtx_before_sel"), coll.posZ()); - if (!selCollision(coll, cent)) + if (!selCollision(coll,cent)) return; { histos.fill(HIST("Data/hZvtx_after_sel8"), coll.posZ()); - } + } histos.fill(HIST("Data/hCentrality"), cent); - float globalNch = inputTracks.size(); - float pvTrack = coll.multNTracksPV(); + float globalNch = inputTracks.size(); + float pvTrack = coll.multNTracksPV(); - histos.fill(HIST("Data/hNchPV_NchGlobal_before"), pvTrack, globalNch); - histos.fill(HIST("Data/hcentFT0C_GlobalNch_before"), coll.centFT0C(), globalNch); - histos.fill(HIST("Data/hcentFT0C_NchPV_before"), coll.centFT0C(), pvTrack); + histos.fill(HIST("Data/hNchPV_NchGlobal_before"), pvTrack, globalNch); + histos.fill(HIST("Data/hcentFT0C_GlobalNch_before"),coll.centFT0C(), globalNch); + histos.fill(HIST("Data/hcentFT0C_NchPV_before"), coll.centFT0C(), pvTrack); - if (cfgEvSelMultCorrelation && !eventSelected(globalNch, pvTrack, cent)) { + + if (cfgEvSelMultCorrelation && !eventSelected(globalNch, pvTrack, cent)) { return; - } + } - histos.fill(HIST("Data/hNchPV_NchGlobal_after"), pvTrack, globalNch); - histos.fill(HIST("Data/hcentFT0C_GlobalNch_after"), coll.centFT0C(), globalNch); - histos.fill(HIST("Data/hcentFT0C_NchPV_after"), coll.centFT0C(), pvTrack); - - double nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0., nch = 0., nchPi = 0., nchKa = 0., nchPr = 0.; + histos.fill(HIST("Data/hNchPV_NchGlobal_after"), pvTrack, globalNch); + histos.fill(HIST("Data/hcentFT0C_GlobalNch_after"),coll.centFT0C(), globalNch); + histos.fill(HIST("Data/hcentFT0C_NchPV_after"), coll.centFT0C(), pvTrack); + + double nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0., nch = 0., nchPi = 0., nchKa = 0., nchPr = 0.; double q1 = 0., q2 = 0., var1 = 0., var2 = 0.; double sumPtWeight = 0., sumWeight = 0., sumPtPtWeight = 0., var1Eff = 0., var2Eff = 0.; double q1Pi = 0., q2Pi = 0., var1Pi = 0., var2Pi = 0.; - double q1Ka = 0., q2Ka = 0., var1Ka = 0., var2Ka = 0.; + double q1Ka = 0., q2Ka = 0., var1Ka = 0., var2Ka = 0.; double q1Pr = 0., q2Pr = 0., var1Pr = 0., var2Pr = 0.; int sample = histos.get(HIST("Data/hZvtx_after_sel8"))->GetEntries(); - sample = sample % 30; - + sample = sample % 30; + for (const auto& track : inputTracks) { nchAllBfCut += 1.; histos.fill(HIST("Data/hnchAll_bf_cut"), nchAllBfCut); @@ -831,7 +817,7 @@ struct EventMeanPtId { histos.fill(HIST("Data/hTPCchi2perCluster_before"), track.tpcChi2NCl()); histos.fill(HIST("Data/hITSchi2perCluster_before"), track.itsChi2NCl()); histos.fill(HIST("Data/hTPCCrossedrows_before"), track.tpcNClsCrossedRows()); - + if (std::fabs(track.eta()) <= cEtacut) { nchEta++; histos.fill(HIST("Data/hnchTrue"), nchEta); @@ -840,18 +826,16 @@ struct EventMeanPtId { nchPt += 1.; histos.fill(HIST("Data/hnchTrue_pt"), nchPt); } - if (!selTrack(track)) - continue; - - if (track.pt() >= cPtmincut1 && track.pt() <= cPtmaxcut1) { - nch += 1.; + if (!selTrack(track)) continue; + + if (track.pt() >= cPtmincut1 && track.pt() <= cPtmaxcut1) + { nch += 1.; histos.fill(HIST("Data/hnch"), nch); - histos.fill(HIST("Data/hPtvar"), track.pt()); + histos.fill(HIST("Data/hPtvar"), track.pt()); } - - if (track.pt() < cPtmincut || track.pt() > cPtmaxcut) - continue; - + + if (track.pt() < cPtmincut || track.pt() > cPtmaxcut) continue; + nchAll += 1.; q1 += track.pt(); q2 += (track.pt() * track.pt()); @@ -871,13 +855,13 @@ struct EventMeanPtId { histos.fill(HIST("Data/hPEta"), track.p(), track.eta()); histos.fill(HIST("Data/hNsigmaTPC"), track.p(), track.tpcNSigmaPr()); - double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); + double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); if (eff < threshold) - continue; - double weight = 1. / eff; + continue; + double weight = 1./eff; sumPtWeight += track.pt() / eff; sumPtPtWeight += (track.pt() * track.pt()) / (eff * eff); - sumWeight += weight; + sumWeight += weight; // only TPC tracks: Pion, Kaon, Proton if (track.hasTPC() && std::abs(track.tpcNSigmaPi()) < cNSigCut3) @@ -961,22 +945,22 @@ struct EventMeanPtId { histos.fill(HIST("Data/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Data/hTOFbeta_afterselection1"), track.p(), track.beta()); } - + } // Track loop ends! histos.fill(HIST("Data/hcentFV0A_nacc"), coll.multFV0A(), nchAll); histos.fill(HIST("Data/hcentFT0A_nacc"), coll.multFT0A(), nchAll); histos.fill(HIST("Data/hcentFT0M_nacc"), coll.centFT0M(), nchAll); histos.fill(HIST("Data/hcent_nacc"), cent, nchAll); - if (nchAll < cTwoPtlCut2) + if (nchAll < cTwoPtlCut2) return; var1 = (q1 * q1 - q2) / (nchAll * (nchAll - 1)); var2 = (q1 / nchAll); - - //------------------ Efficiency corrected histograms --------------- + + //------------------ Efficiency corrected histograms --------------- var1Eff = (sumPtWeight * sumPtWeight - sumPtPtWeight) / (sumWeight * (sumWeight - 1)); var2Eff = (sumPtWeight / sumWeight); - + //---------------------- pions ---------------------------------------- if (nchPi >= cTwoPtlCut2) { var1Pi = (q1Pi * q1Pi - q2Pi) / (nchPi * (nchPi - 1)); @@ -992,8 +976,8 @@ struct EventMeanPtId { var1Pr = (q1Pr * q1Pr - q2Pr) / (nchPr * (nchPr - 1)); var2Pr = (q1Pr / nchPr); } - - //------------------ all charges------------------------------------- + + //------------------ all charges------------------------------------- histos.fill(HIST("Data/hVar1"), sample, cent, var1); histos.fill(HIST("Data/hVar2"), sample, cent, var2); histos.fill(HIST("Data/hVarc"), sample, cent); @@ -1016,7 +1000,7 @@ struct EventMeanPtId { histos.fill(HIST("Data/hdiffVar1x"), sample, nch, var1); histos.fill(HIST("Data/hdiffVar2x"), sample, nch, var2); histos.fill(HIST("Data/hdiffVarx"), sample, nch); - + histos.fill(HIST("hEffVar1x_data"), sample, nchAll, var1Eff); histos.fill(HIST("hEffVar2x_data"), sample, nchAll, var2Eff); histos.fill(HIST("hEffVarx_data"), sample, nchAll); @@ -1048,42 +1032,38 @@ struct EventMeanPtId { } // event loop ends! PROCESS_SWITCH(EventMeanPtId, processData, "process real data information", true); - + //++++++++++++++++++++++++++++++++++++MC Reconstructed +++++++++++++++++++++++++++++++++++++++++++++++++++++// - SliceCache cache; - Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; - void processMcReco(MyMCRecoCollision const& coll, MyMCRecoTracks const& inputTracks, aod::McCollisions const& mcCollisions, aod::McParticles const& mcParticles) - { - float cent = -1; + SliceCache cache; + Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; + void processMcReco(MyMCRecoCollision const& coll, MyMCRecoTracks const& inputTracks, aod::McCollisions const& mcCollisions, aod::McParticles const& mcParticles) + { float cent = -1; (void)mcCollisions; - if (!coll.has_mcCollision()) { - return; - } - + if (!coll.has_mcCollision()) {return;} + histos.fill(HIST("Rec/hZvtx_before_sel"), coll.posZ()); histos.fill(HIST("hVtxZ_before_gen"), coll.mcCollision().posZ()); - histos.fill(HIST("hCentrality_rec_before"), cent); + histos.fill(HIST("hCentrality_rec_before"), cent); - if (!selCollision(coll, cent)) - return; + if (!selCollision(coll,cent)) return; histos.fill(HIST("Rec/hZvtx_after_sel8"), coll.posZ()); - histos.fill(HIST("Rec/hCentrality"), cent); + histos.fill(HIST("Rec/hCentrality"), cent); float globalNch = inputTracks.size(); - float pvTrack = coll.multNTracksPV(); - - histos.fill(HIST("Rec/hNchPV_NchGlobal_before"), pvTrack, globalNch); - histos.fill(HIST("Rec/hcentFT0C_GlobalNch_before"), coll.centFT0C(), globalNch); - histos.fill(HIST("Rec/hcentFT0C_NchPV_before"), coll.centFT0C(), pvTrack); + float pvTrack = coll.multNTracksPV(); - if (cfgEvSelMultCorrelation && !eventSelected(globalNch, pvTrack, cent)) { + histos.fill(HIST("Rec/hNchPV_NchGlobal_before"), pvTrack, globalNch); + histos.fill(HIST("Rec/hcentFT0C_GlobalNch_before"),coll.centFT0C(), globalNch); + histos.fill(HIST("Rec/hcentFT0C_NchPV_before"), coll.centFT0C(), pvTrack); + + if (cfgEvSelMultCorrelation && !eventSelected(globalNch, pvTrack, cent)) { return; - } + } - histos.fill(HIST("Rec/hNchPV_NchGlobal_after"), pvTrack, globalNch); - histos.fill(HIST("Rec/hcentFT0C_GlobalNch_after"), coll.centFT0C(), globalNch); - histos.fill(HIST("Rec/hcentFT0C_NchPV_after"), coll.centFT0C(), pvTrack); + histos.fill(HIST("Rec/hNchPV_NchGlobal_after"), pvTrack, globalNch); + histos.fill(HIST("Rec/hcentFT0C_GlobalNch_after"),coll.centFT0C(), globalNch); + histos.fill(HIST("Rec/hcentFT0C_NchPV_after"), coll.centFT0C(), pvTrack); double nch = 0., nchPi = 0., nchKa = 0., nchPr = 0., nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0.; double q1 = 0., q2 = 0.; @@ -1091,7 +1071,7 @@ struct EventMeanPtId { double var1 = 0., var2 = 0.; double var1Pi = 0., var2Pi = 0., var1Ka = 0., var2Ka = 0., var1Pr = 0., var2Pr = 0.; double sumPtWeight = 0., sumWeight = 0., sumPtPtWeight = 0., var1Eff = 0., var2Eff = 0.; - + int sample = histos.get(HIST("Rec/hZvtx_after_sel8"))->GetEntries(); sample = sample % 30; @@ -1102,40 +1082,37 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hITSchi2perCluster_before"), track.itsChi2NCl()); histos.fill(HIST("Rec/hTPCCrossedrows_before"), track.tpcNClsCrossedRows()); - if (std::fabs(track.eta()) <= cEtacut) { - nchEta++; + if (std::fabs(track.eta()) <= cEtacut) + { nchEta++; histos.fill(HIST("Rec/hnchTrue"), nchEta); } - if (track.pt() >= cPtmincut && track.pt() <= cPtmaxcut) { - nchPt += 1.; + if (track.pt() >= cPtmincut && track.pt() <= cPtmaxcut) + { nchPt += 1.; histos.fill(HIST("Rec/hnchTrue_pt"), nchPt); } - - if (!selTrack(track)) - continue; - - if (track.pt() >= cPtmincut1 && track.pt() <= cPtmaxcut1) { - nch += 1.; + + if (!selTrack(track)) continue; + + if (track.pt() >= cPtmincut1 && track.pt() <= cPtmaxcut1) + { nch += 1.; histos.fill(HIST("Rec/hnch"), nch); - histos.fill(HIST("Rec/hPtvar"), track.pt()); + histos.fill(HIST("Rec/hPtvar"), track.pt()); } - if (track.pt() < cPtmincut || track.pt() > cPtmaxcut) - continue; - + if (track.pt() < cPtmincut || track.pt() > cPtmaxcut) continue; + // if (std::fabs(track.y()) > 0.5) continue; histos.fill(HIST("hPt_rec"), track.pt()); histos.fill(HIST("hEta_rec"), track.eta()); double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); - if (eff < threshold) - continue; + if (eff < threshold) continue; double weight = 1.0 / eff; sumPtWeight += track.pt() * weight; sumPtPtWeight += (track.pt() * track.pt() * weight * weight); sumWeight += weight; - - histos.fill(HIST("hPt_rec_corr"), track.pt(), weight); - histos.fill(HIST("hEta_rec_corr"), track.eta(), weight); + + histos.fill(HIST("hPt_rec_corr"), track.pt() , weight); + histos.fill(HIST("hEta_rec_corr"), track.eta() , weight); auto mcParticle = track.mcParticle(); nchAll += 1.; @@ -1158,7 +1135,7 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hPEta"), track.p(), track.eta()); histos.fill(HIST("Rec/hNsigmaTPC"), track.p(), track.tpcNSigmaPr()); histos.fill(HIST("hPtEta_rec"), track.pt(), track.eta()); - + if (std::abs(mcParticle.pdgCode()) == PDG_t::kPiPlus) histos.fill(HIST("ptHistogramPionrec_pdg"), track.pt()); if (std::abs(mcParticle.pdgCode()) == PDG_t::kKPlus) @@ -1200,12 +1177,10 @@ struct EventMeanPtId { } if (selPion(track)) { - if (std::fabs(track.y()) > cRapidityCut05) - continue; - if (track.beta() > 1) - continue; + if (std::fabs(track.y()) > cRapidityCut05) continue; + if (track.beta() > 1) continue; histos.fill(HIST("ptHistogramPionrec"), track.pt()); - histos.fill(HIST("hPtEta_pi_rec"), track.pt(), track.eta()); + histos.fill(HIST("hPtEta_pi_rec"), track.pt(), track.eta()); histos.fill(HIST("Rec/hPtPion"), track.pt()); histos.fill(HIST("Rec/hEtaPion"), track.eta()); histos.fill(HIST("Rec/hyPion"), track.rapidity(massPi)); @@ -1216,14 +1191,14 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Rec/hTOFbeta_afterselection1"), track.p(), track.beta()); if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kPiPlus) { - histos.fill(HIST("ptHistogramPionrec_purity"), track.pt()); + histos.fill(HIST("ptHistogramPionrec_purity"), track.pt()); } nchPi += 1.; q1Pi += track.pt(); q2Pi += (track.pt() * track.pt()); - histos.fill(HIST("hPyPion_rec"), track.p(), track.rapidity(massPi)); - histos.fill(HIST("hPtyPion_rec"), track.pt(), track.rapidity(massPi)); + histos.fill(HIST("hPyPion_rec"), track.p(), track.rapidity(massPi)); + histos.fill(HIST("hPtyPion_rec"), track.pt(), track.rapidity(massPi)); } //===========================kaon=============================================================== @@ -1235,12 +1210,10 @@ struct EventMeanPtId { } if (selKaon(track)) { - if (std::fabs(track.y()) > cRapidityCut05) - continue; - if (track.beta() > 1) - continue; + if (std::fabs(track.y()) > cRapidityCut05) continue; + if (track.beta() > 1) continue; histos.fill(HIST("ptHistogramKaonrec"), track.pt()); - histos.fill(HIST("hPtEta_ka_rec"), track.pt(), track.eta()); + histos.fill(HIST("hPtEta_ka_rec"), track.pt(), track.eta()); histos.fill(HIST("Rec/hPtKaon"), track.pt()); histos.fill(HIST("Rec/hEtaKaon"), track.eta()); histos.fill(HIST("Rec/hyKaon"), track.rapidity(massKa)); @@ -1251,7 +1224,7 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Rec/hTOFbeta_afterselection1"), track.p(), track.beta()); if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kKPlus) { - histos.fill(HIST("ptHistogramKaonrec_purity"), track.pt()); + histos.fill(HIST("ptHistogramKaonrec_purity"), track.pt()); } nchKa += 1.; q1Ka += track.pt(); @@ -1270,12 +1243,10 @@ struct EventMeanPtId { } if (selProton(track)) { - if (std::fabs(track.y()) > cRapidityCut05) - continue; - if (track.beta() > 1) - continue; + if (std::fabs(track.y()) > cRapidityCut05) continue; + if (track.beta() > 1) continue; histos.fill(HIST("ptHistogramProtonrec"), track.pt()); - histos.fill(HIST("hPtEta_pr_rec"), track.pt(), track.eta()); + histos.fill(HIST("hPtEta_pr_rec"), track.pt(), track.eta()); histos.fill(HIST("Rec/hPtProton"), track.pt()); histos.fill(HIST("Rec/hEtaProton"), track.eta()); histos.fill(HIST("Rec/hyProton"), track.rapidity(massPr)); @@ -1286,7 +1257,7 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Rec/hTOFbeta_afterselection1"), track.p(), track.beta()); if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kProton) { - histos.fill(HIST("ptHistogramProtonrec_purity"), track.pt()); + histos.fill(HIST("ptHistogramProtonrec_purity"), track.pt()); } nchPr += 1.; q1Pr += track.pt(); @@ -1318,7 +1289,7 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hVar2"), sample, cent, var2); histos.fill(HIST("Rec/hVarc"), sample, cent); histos.fill(HIST("Rec/hVar2meanpt"), cent, var2); - + //---------------------- pions ---------------------------------------- if (nchPi >= cTwoPtlCut2) { var1Pi = (q1Pi * q1Pi - q2Pi) / (nchPi * (nchPi - 1)); @@ -1328,7 +1299,8 @@ struct EventMeanPtId { if (nchKa >= cTwoPtlCut2) { var1Ka = (q1Ka * q1Ka - q2Ka) / (nchKa * (nchKa - 1)); var2Ka = (q1Ka / nchKa); - } + + } //---------------------------- protons ---------------------------------- if (nchPr >= cTwoPtlCut2) { var1Pr = (q1Pr * q1Pr - q2Pr) / (nchPr * (nchPr - 1)); @@ -1378,7 +1350,7 @@ struct EventMeanPtId { histos.fill(HIST("hEffVar1x_Naccorr_xaxis_rec"), sample, sumWeight, var1); histos.fill(HIST("hEffVar2x_Naccorr_xaxis_rec"), sample, sumWeight, var2); histos.fill(HIST("hEffVarx_Naccorr_xaxis_rec"), sample, sumWeight); - + //================= generated level============================== const auto& mccolgen = coll.mcCollision_as(); @@ -1405,7 +1377,7 @@ struct EventMeanPtId { } nch1++; histos.fill(HIST("hnch_afterPhysPrimary"), nch1); - + int pid = mcpart.pdgCode(); auto sign = 0; auto* pd = pdg->GetParticle(pid); @@ -1416,19 +1388,17 @@ struct EventMeanPtId { continue; } // histos.fill(HIST("gen_hSign"), sign); - if (std::fabs(mcpart.eta()) > cEtacut) - continue; + if (std::fabs(mcpart.eta()) > cEtacut) continue; nchGenTrue++; histos.fill(HIST("hnch_gen_after_etacut"), nchGenTrue); - if (mcpart.pt() >= cPtmincut1 && mcpart.pt() <= cPtmaxcut1) { - nchgen += 1.; + if (mcpart.pt() >= cPtmincut1 && mcpart.pt() <= cPtmaxcut1) + { nchgen += 1.; histos.fill(HIST("hnch_gen"), nchgen); - histos.fill(HIST("hPtvar_gen"), mcpart.pt()); + histos.fill(HIST("hPtvar_gen"), mcpart.pt()); } - if ((mcpart.pt() < cPtmincut) || (mcpart.pt() > cPtmaxcut)) - continue; + if ((mcpart.pt() < cPtmincut) || (mcpart.pt() > cPtmaxcut)) continue; histos.fill(HIST("hPt_gen"), mcpart.pt()); histos.fill(HIST("hEta_gen"), mcpart.eta()); histos.fill(HIST("ptHistogram_allcharge_gen"), mcpart.pt()); @@ -1442,7 +1412,7 @@ struct EventMeanPtId { if (mcpart.pdgCode() == PDG_t::kPiPlus || mcpart.pdgCode() == PDG_t::kPiMinus) { histos.fill(HIST("ptHistogramPion"), mcpart.pt()); - histos.fill(HIST("hPtEta_pi_gen"), mcpart.pt(), mcpart.eta()); + histos.fill(HIST("hPtEta_pi_gen"), mcpart.pt(), mcpart.eta()); histos.fill(HIST("hPty_pi_gen"), mcpart.pt(), mcpart.y()); nchPiGen += 1.; q1PiGen += mcpart.pt(); @@ -1452,8 +1422,8 @@ struct EventMeanPtId { if (mcpart.pdgCode() == PDG_t::kKPlus || mcpart.pdgCode() == PDG_t::kKMinus) { histos.fill(HIST("ptHistogramKaon"), mcpart.pt()); - histos.fill(HIST("hPtEta_ka_gen"), mcpart.pt(), mcpart.eta()); - histos.fill(HIST("hPty_ka_gen"), mcpart.pt(), mcpart.y()); + histos.fill(HIST("hPtEta_ka_gen"), mcpart.pt(), mcpart.eta()); + histos.fill(HIST("hPty_ka_gen"), mcpart.pt(), mcpart.y()); nchKaGen += 1.; q1KaGen += mcpart.pt(); q2KaGen += (mcpart.pt() * mcpart.pt()); @@ -1462,8 +1432,8 @@ struct EventMeanPtId { if (mcpart.pdgCode() == PDG_t::kProton || mcpart.pdgCode() == PDG_t::kProtonBar) { histos.fill(HIST("ptHistogramProton"), mcpart.pt()); - histos.fill(HIST("hPtEta_pr_gen"), mcpart.pt(), mcpart.eta()); - histos.fill(HIST("hPty_pr_gen"), mcpart.pt(), mcpart.y()); + histos.fill(HIST("hPtEta_pr_gen"), mcpart.pt(), mcpart.eta()); + histos.fill(HIST("hPty_pr_gen"), mcpart.pt(), mcpart.y()); nchPrGen += 1.; q1PrGen += mcpart.pt(); q2PrGen += (mcpart.pt() * mcpart.pt()); @@ -1486,7 +1456,7 @@ struct EventMeanPtId { histos.fill(HIST("hterm1_gen"), nchGenAll, var1AllGen); histos.fill(HIST("hterm2_gen"), nchGenAll, var2AllGen); - //--------------------------Pions------------------------------------------- +//--------------------------Pions------------------------------------------- if (nchPiGen >= cTwoPtlCut2) { var1PiGen = (q1PiGen * q1PiGen - q2PiGen) / (nchPiGen * (nchPiGen - 1)); var2PiGen = (q1PiGen / nchPiGen); @@ -1525,7 +1495,8 @@ struct EventMeanPtId { } // void process PROCESS_SWITCH(EventMeanPtId, processMcReco, "Process reconstructed", false); -}; + + }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { From a2cf1a0806b77cfb2c398235337b0603a46b2029 Mon Sep 17 00:00:00 2001 From: sweta29singh Date: Wed, 8 Oct 2025 16:49:59 +0530 Subject: [PATCH 8/8] Mean pT Fluctuations --- .../EbyEFluctuations/Tasks/eventMeanPtId.cxx | 378 ++++++++++-------- 1 file changed, 203 insertions(+), 175 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx index 9763ef0f070..7f9797e493f 100644 --- a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx @@ -38,8 +38,8 @@ #include "Framework/RunningWorkflowInfo.h" #include "Framework/runDataProcessing.h" -#include #include "TF1.h" +#include #include #include @@ -133,8 +133,8 @@ struct EventMeanPtId { O2_DEFINE_CONFIGURABLE(cfgMultGlobalPVCutEnabled, bool, true, "Enable globalTracks vs PV multiplicity cut") Configurable> cfgMultPVFT0CCutPars{"cfgMultPVFT0CCutPars", - std::vector{3303.11, -121.316, 1.90207, -0.0152644, 5.10121e-05, 190.633, -4.32972, 0.0340001, -5.83261e-05, -3.19566e-07}, - "PV multiplicity vs T0C centrality cut parameter values"}; + std::vector{3303.11, -121.316, 1.90207, -0.0152644, 5.10121e-05, 190.633, -4.32972, 0.0340001, -5.83261e-05, -3.19566e-07}, + "PV multiplicity vs T0C centrality cut parameter values"}; Configurable> cfgMultGlobalFT0CCutPars{"cfgMultGlobalFT0CCutPars", std::vector{1893.97, -61.3423, 0.790664, -0.00507208, 1.41683e-05, 167.997, -5.29125, 0.0840145, -0.000748102, 2.75743e-06}, @@ -156,37 +156,34 @@ struct EventMeanPtId { TF1* fMultGlobalPVCutHigh = nullptr; } cfgFunCoeff; - Service ccdb; Service pdg; - Filter collisionFilter = nabs(aod::collision::posZ) <= cVtxZcut; - Filter trackFilter = (nabs(aod::track::eta) < cEtacut) && (aod::track::pt > ptMin) && (aod::track::pt < ptMax) && (requireGlobalTrackInFilter()); - -using MyCollisions = soa::Filtered>; -using MyCollision = MyCollisions::iterator; + Filter collisionFilter = nabs(aod::collision::posZ) <= cVtxZcut; + Filter trackFilter = (nabs(aod::track::eta) < cEtacut) && (aod::track::pt > ptMin) && (aod::track::pt < ptMax) && (requireGlobalTrackInFilter()); -using MyTracks = soa::Filtered>; -using MyTrack = MyTracks::iterator; + using MyCollisions = soa::Filtered>; + using MyCollision = MyCollisions::iterator; + using MyTracks = soa::Filtered>; + using MyTrack = MyTracks::iterator; -using MyMCRecoCollisions = soa::Filtered>; -using MyMCRecoCollision = MyMCRecoCollisions::iterator; + using MyMCRecoCollisions = soa::Filtered>; + using MyMCRecoCollision = MyMCRecoCollisions::iterator; -using MyMCRecoTracks = soa::Filtered>; -using MyMCRecoTrack = MyMCRecoTracks::iterator; - -using EventCandidatesMC = soa::Join; + using MyMCRecoTracks = soa::Filtered>; + using MyMCRecoTrack = MyMCRecoTracks::iterator; + using EventCandidatesMC = soa::Join; Configurable ccdbNoLaterThan{"ccdbNoLaterThan", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; Configurable cfgUrlCCDB{"cfgUrlCCDB", "http://alice-ccdb.cern.ch", "url of ccdb"}; @@ -208,14 +205,14 @@ using EventCandidatesMC = soa::JoingetForTimeStamp(cfgPathCCDB.value, -1); ptHistogramAllchargeRec = reinterpret_cast(lst->FindObject("hPtEta_rec")); - } + } std::vector ptBinning = {0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0}; // AxisSpec ptAxis = {ptBinning, "#it{p}_{T} (GeV/#it{c})"}; AxisSpec vtxZAxis = {100, -20.0, 20.0, "Z (cm)"}; AxisSpec dcaAxis = {1002, -5.01, 5.01, "DCA_{xy} (cm)"}; AxisSpec dcazAxis = {1002, -5.01, 5.01, "DCA_{z} (cm)"}; - AxisSpec ptAxis = {600, 0.0, 6.0, "#it{p}_{T} (GeV/#it{c})"};// 600,0,6 + AxisSpec ptAxis = {600, 0.0, 6.0, "#it{p}_{T} (GeV/#it{c})"}; // 600,0,6 AxisSpec pAxis = {400, 0.0, 4.0, "#it{p} (GeV/#it{c})"}; AxisSpec betaAxis = {200, 0.0, 2.0, "TOF_{#beta} (GeV/#it{c})"}; AxisSpec dEdxAxis = {2000, 0.0, 200.0, "dE/dx (GeV/#it{c})"}; @@ -359,10 +356,10 @@ using EventCandidatesMC = soa::Join cSigmaLowHighcut{"cSigmaLowHighcut", 3.0f, "lower and upper sigma cut"}; - cfgFunCoeff.fMultPVFT0CCutLow = new TF1("fMultPVFT0CCutLow", @@ -531,10 +527,9 @@ using EventCandidatesMC = soa::JoinSetParameters(&(cfgFunCoeff.multGlobalPVCutPars[0])); + } - } - -bool eventSelected(const float& globalNch, const float& pvTrack, const float& centrality) + bool eventSelected(const float& globalNch, const float& pvTrack, const float& centrality) { if (cfgFunCoeff.cfgMultPVFT0CCutEnabled) { @@ -572,12 +567,12 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce } // Reject the collisions with large vertex-z histos.fill(HIST("hEventcounter"), 2.); - if(ccentFT0C) { - cent = coll.centFT0C(); //centrality from FT0C + if (ccentFT0C) { + cent = coll.centFT0C(); // centrality from FT0C } else { - cent = coll.centFT0M(); //centrality from FT0M - } - + cent = coll.centFT0M(); // centrality from FT0M + } + if (cSel8Trig && !coll.sel8()) { return false; } // require min bias trigger @@ -605,7 +600,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce return false; } histos.fill(HIST("trackSelRec"), 7); - + // if (cItslayerall && !coll.selection_bit(aod::evsel::kIsGoodITSLayersAll)) {return false;} histos.fill(HIST("trackSelRec"), 8); @@ -625,41 +620,59 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce } // accept only global tracks histos.fill(HIST("tracksel"), 2); - if (cDCAxy && std::fabs(track.dcaXY()) > cDcaXYcut) {return false;} + if (cDCAxy && std::fabs(track.dcaXY()) > cDcaXYcut) { + return false; + } histos.fill(HIST("tracksel"), 3); - if (cDCAz && std::fabs(track.dcaZ()) > cDcaZcut) {return false;} + if (cDCAz && std::fabs(track.dcaZ()) > cDcaZcut) { + return false; + } histos.fill(HIST("tracksel"), 4); if (std::fabs(track.eta()) >= cEtacut) { return false; } histos.fill(HIST("tracksel"), 5); - - if (cTPCcr && track.tpcNClsCrossedRows() < cTPCcrosscut) {return false;} + + if (cTPCcr && track.tpcNClsCrossedRows() < cTPCcrosscut) { + return false; + } histos.fill(HIST("tracksel"), 6); - if (cITSchi && track.itsChi2NCl() >= cItsChiCut) {return false;} + if (cITSchi && track.itsChi2NCl() >= cItsChiCut) { + return false; + } histos.fill(HIST("tracksel"), 7); - if (cTPCchi && track.tpcChi2NCl() >= cTpcChiCut) {return false;} + if (cTPCchi && track.tpcChi2NCl() >= cTpcChiCut) { + return false; + } histos.fill(HIST("tracksel"), 8); - if (track.sign() == 0) {return false;} + if (track.sign() == 0) { + return false; + } - if(cPVContributor) - { if (!(track.isPVContributor())) {return false;} - histos.fill(HIST("tracksel"), 9); + if (cPVContributor) { + if (!(track.isPVContributor())) { + return false; + } + histos.fill(HIST("tracksel"), 9); } if (citsNCluster) { - if (track.itsNCls() < cnITSClustersCut) { return false; } - histos.fill(HIST("tracksel"), 10); + if (track.itsNCls() < cnITSClustersCut) { + return false; + } + histos.fill(HIST("tracksel"), 10); } - if(ctpcNClusterFound) { - if (track.tpcNClsFound() < ctpcNClsCut) {return false;} - histos.fill(HIST("tracksel"), 11); + if (ctpcNClusterFound) { + if (track.tpcNClsFound() < ctpcNClsCut) { + return false; + } + histos.fill(HIST("tracksel"), 11); } return true; // if all checks pass, accept the collision @@ -755,60 +768,60 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce return false; } - double getEfficiency(double pt, double eta, TH2D* ptHistogramAllchargeRec) + double getEfficiency(double pt, double eta, TH2D* ptHistogramAllchargeRec) { - int xbin = ptHistogramAllchargeRec->GetXaxis()->FindBin(pt); - int ybin = ptHistogramAllchargeRec->GetYaxis()->FindBin(eta); + int xbin = ptHistogramAllchargeRec->GetXaxis()->FindBin(pt); + int ybin = ptHistogramAllchargeRec->GetYaxis()->FindBin(eta); - if(xbin < 1 || xbin > ptHistogramAllchargeRec->GetNbinsX() || ybin < 1 || ybin > ptHistogramAllchargeRec->GetNbinsY()) { + if (xbin < 1 || xbin > ptHistogramAllchargeRec->GetNbinsX() || ybin < 1 || ybin > ptHistogramAllchargeRec->GetNbinsY()) { LOGF(warn, "pt or eta out of histograms bounds : %f, eta = %f", pt, eta); return 1e-6; - } - double eff = ptHistogramAllchargeRec->GetBinContent(xbin, ybin); - return (eff > 0) ? eff : 1e-6; // Avoid division by zero + } + double eff = ptHistogramAllchargeRec->GetBinContent(xbin, ybin); + return (eff > 0) ? eff : 1e-6; // Avoid division by zero } - //++++++++++++++++++++++++++++++++++++DATA CALCULATION +++++++++++++++++++++++++++++++++++++++++++++++++++++// - void processData(MyCollision const& coll, MyTracks const& inputTracks) + //++++++++++++++++++++++++++++++++++++DATA CALCULATION +++++++++++++++++++++++++++++++++++++++++++++++++++++// + void processData(MyCollision const& coll, MyTracks const& inputTracks) - { float cent = -1; + { + float cent = -1; histos.fill(HIST("hEventcounter"), 1.); histos.fill(HIST("Data/hZvtx_before_sel"), coll.posZ()); - if (!selCollision(coll,cent)) + if (!selCollision(coll, cent)) return; { histos.fill(HIST("Data/hZvtx_after_sel8"), coll.posZ()); - } + } histos.fill(HIST("Data/hCentrality"), cent); - float globalNch = inputTracks.size(); - float pvTrack = coll.multNTracksPV(); + float globalNch = inputTracks.size(); + float pvTrack = coll.multNTracksPV(); - histos.fill(HIST("Data/hNchPV_NchGlobal_before"), pvTrack, globalNch); - histos.fill(HIST("Data/hcentFT0C_GlobalNch_before"),coll.centFT0C(), globalNch); - histos.fill(HIST("Data/hcentFT0C_NchPV_before"), coll.centFT0C(), pvTrack); + histos.fill(HIST("Data/hNchPV_NchGlobal_before"), pvTrack, globalNch); + histos.fill(HIST("Data/hcentFT0C_GlobalNch_before"), coll.centFT0C(), globalNch); + histos.fill(HIST("Data/hcentFT0C_NchPV_before"), coll.centFT0C(), pvTrack); - - if (cfgEvSelMultCorrelation && !eventSelected(globalNch, pvTrack, cent)) { + if (cfgEvSelMultCorrelation && !eventSelected(globalNch, pvTrack, cent)) { return; - } + } + + histos.fill(HIST("Data/hNchPV_NchGlobal_after"), pvTrack, globalNch); + histos.fill(HIST("Data/hcentFT0C_GlobalNch_after"), coll.centFT0C(), globalNch); + histos.fill(HIST("Data/hcentFT0C_NchPV_after"), coll.centFT0C(), pvTrack); - histos.fill(HIST("Data/hNchPV_NchGlobal_after"), pvTrack, globalNch); - histos.fill(HIST("Data/hcentFT0C_GlobalNch_after"),coll.centFT0C(), globalNch); - histos.fill(HIST("Data/hcentFT0C_NchPV_after"), coll.centFT0C(), pvTrack); - - double nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0., nch = 0., nchPi = 0., nchKa = 0., nchPr = 0.; + double nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0., nch = 0., nchPi = 0., nchKa = 0., nchPr = 0.; double q1 = 0., q2 = 0., var1 = 0., var2 = 0.; double sumPtWeight = 0., sumWeight = 0., sumPtPtWeight = 0., var1Eff = 0., var2Eff = 0.; double q1Pi = 0., q2Pi = 0., var1Pi = 0., var2Pi = 0.; - double q1Ka = 0., q2Ka = 0., var1Ka = 0., var2Ka = 0.; + double q1Ka = 0., q2Ka = 0., var1Ka = 0., var2Ka = 0.; double q1Pr = 0., q2Pr = 0., var1Pr = 0., var2Pr = 0.; int sample = histos.get(HIST("Data/hZvtx_after_sel8"))->GetEntries(); - sample = sample % 30; - + sample = sample % 30; + for (const auto& track : inputTracks) { nchAllBfCut += 1.; histos.fill(HIST("Data/hnchAll_bf_cut"), nchAllBfCut); @@ -817,7 +830,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Data/hTPCchi2perCluster_before"), track.tpcChi2NCl()); histos.fill(HIST("Data/hITSchi2perCluster_before"), track.itsChi2NCl()); histos.fill(HIST("Data/hTPCCrossedrows_before"), track.tpcNClsCrossedRows()); - + if (std::fabs(track.eta()) <= cEtacut) { nchEta++; histos.fill(HIST("Data/hnchTrue"), nchEta); @@ -826,16 +839,18 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce nchPt += 1.; histos.fill(HIST("Data/hnchTrue_pt"), nchPt); } - if (!selTrack(track)) continue; - - if (track.pt() >= cPtmincut1 && track.pt() <= cPtmaxcut1) - { nch += 1.; + if (!selTrack(track)) + continue; + + if (track.pt() >= cPtmincut1 && track.pt() <= cPtmaxcut1) { + nch += 1.; histos.fill(HIST("Data/hnch"), nch); - histos.fill(HIST("Data/hPtvar"), track.pt()); + histos.fill(HIST("Data/hPtvar"), track.pt()); } - - if (track.pt() < cPtmincut || track.pt() > cPtmaxcut) continue; - + + if (track.pt() < cPtmincut || track.pt() > cPtmaxcut) + continue; + nchAll += 1.; q1 += track.pt(); q2 += (track.pt() * track.pt()); @@ -855,13 +870,13 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Data/hPEta"), track.p(), track.eta()); histos.fill(HIST("Data/hNsigmaTPC"), track.p(), track.tpcNSigmaPr()); - double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); + double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); if (eff < threshold) - continue; - double weight = 1./eff; + continue; + double weight = 1. / eff; sumPtWeight += track.pt() / eff; sumPtPtWeight += (track.pt() * track.pt()) / (eff * eff); - sumWeight += weight; + sumWeight += weight; // only TPC tracks: Pion, Kaon, Proton if (track.hasTPC() && std::abs(track.tpcNSigmaPi()) < cNSigCut3) @@ -945,22 +960,22 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Data/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Data/hTOFbeta_afterselection1"), track.p(), track.beta()); } - + } // Track loop ends! histos.fill(HIST("Data/hcentFV0A_nacc"), coll.multFV0A(), nchAll); histos.fill(HIST("Data/hcentFT0A_nacc"), coll.multFT0A(), nchAll); histos.fill(HIST("Data/hcentFT0M_nacc"), coll.centFT0M(), nchAll); histos.fill(HIST("Data/hcent_nacc"), cent, nchAll); - if (nchAll < cTwoPtlCut2) + if (nchAll < cTwoPtlCut2) return; var1 = (q1 * q1 - q2) / (nchAll * (nchAll - 1)); var2 = (q1 / nchAll); - - //------------------ Efficiency corrected histograms --------------- + + //------------------ Efficiency corrected histograms --------------- var1Eff = (sumPtWeight * sumPtWeight - sumPtPtWeight) / (sumWeight * (sumWeight - 1)); var2Eff = (sumPtWeight / sumWeight); - + //---------------------- pions ---------------------------------------- if (nchPi >= cTwoPtlCut2) { var1Pi = (q1Pi * q1Pi - q2Pi) / (nchPi * (nchPi - 1)); @@ -976,8 +991,8 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce var1Pr = (q1Pr * q1Pr - q2Pr) / (nchPr * (nchPr - 1)); var2Pr = (q1Pr / nchPr); } - - //------------------ all charges------------------------------------- + + //------------------ all charges------------------------------------- histos.fill(HIST("Data/hVar1"), sample, cent, var1); histos.fill(HIST("Data/hVar2"), sample, cent, var2); histos.fill(HIST("Data/hVarc"), sample, cent); @@ -1000,7 +1015,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Data/hdiffVar1x"), sample, nch, var1); histos.fill(HIST("Data/hdiffVar2x"), sample, nch, var2); histos.fill(HIST("Data/hdiffVarx"), sample, nch); - + histos.fill(HIST("hEffVar1x_data"), sample, nchAll, var1Eff); histos.fill(HIST("hEffVar2x_data"), sample, nchAll, var2Eff); histos.fill(HIST("hEffVarx_data"), sample, nchAll); @@ -1032,38 +1047,42 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce } // event loop ends! PROCESS_SWITCH(EventMeanPtId, processData, "process real data information", true); - + //++++++++++++++++++++++++++++++++++++MC Reconstructed +++++++++++++++++++++++++++++++++++++++++++++++++++++// - SliceCache cache; - Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; - void processMcReco(MyMCRecoCollision const& coll, MyMCRecoTracks const& inputTracks, aod::McCollisions const& mcCollisions, aod::McParticles const& mcParticles) - { float cent = -1; + SliceCache cache; + Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; + void processMcReco(MyMCRecoCollision const& coll, MyMCRecoTracks const& inputTracks, aod::McCollisions const& mcCollisions, aod::McParticles const& mcParticles) + { + float cent = -1; (void)mcCollisions; - if (!coll.has_mcCollision()) {return;} - + if (!coll.has_mcCollision()) { + return; + } + histos.fill(HIST("Rec/hZvtx_before_sel"), coll.posZ()); histos.fill(HIST("hVtxZ_before_gen"), coll.mcCollision().posZ()); - histos.fill(HIST("hCentrality_rec_before"), cent); + histos.fill(HIST("hCentrality_rec_before"), cent); - if (!selCollision(coll,cent)) return; + if (!selCollision(coll, cent)) + return; histos.fill(HIST("Rec/hZvtx_after_sel8"), coll.posZ()); - histos.fill(HIST("Rec/hCentrality"), cent); + histos.fill(HIST("Rec/hCentrality"), cent); float globalNch = inputTracks.size(); - float pvTrack = coll.multNTracksPV(); + float pvTrack = coll.multNTracksPV(); - histos.fill(HIST("Rec/hNchPV_NchGlobal_before"), pvTrack, globalNch); - histos.fill(HIST("Rec/hcentFT0C_GlobalNch_before"),coll.centFT0C(), globalNch); - histos.fill(HIST("Rec/hcentFT0C_NchPV_before"), coll.centFT0C(), pvTrack); - - if (cfgEvSelMultCorrelation && !eventSelected(globalNch, pvTrack, cent)) { + histos.fill(HIST("Rec/hNchPV_NchGlobal_before"), pvTrack, globalNch); + histos.fill(HIST("Rec/hcentFT0C_GlobalNch_before"), coll.centFT0C(), globalNch); + histos.fill(HIST("Rec/hcentFT0C_NchPV_before"), coll.centFT0C(), pvTrack); + + if (cfgEvSelMultCorrelation && !eventSelected(globalNch, pvTrack, cent)) { return; - } + } - histos.fill(HIST("Rec/hNchPV_NchGlobal_after"), pvTrack, globalNch); - histos.fill(HIST("Rec/hcentFT0C_GlobalNch_after"),coll.centFT0C(), globalNch); - histos.fill(HIST("Rec/hcentFT0C_NchPV_after"), coll.centFT0C(), pvTrack); + histos.fill(HIST("Rec/hNchPV_NchGlobal_after"), pvTrack, globalNch); + histos.fill(HIST("Rec/hcentFT0C_GlobalNch_after"), coll.centFT0C(), globalNch); + histos.fill(HIST("Rec/hcentFT0C_NchPV_after"), coll.centFT0C(), pvTrack); double nch = 0., nchPi = 0., nchKa = 0., nchPr = 0., nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0.; double q1 = 0., q2 = 0.; @@ -1071,7 +1090,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce double var1 = 0., var2 = 0.; double var1Pi = 0., var2Pi = 0., var1Ka = 0., var2Ka = 0., var1Pr = 0., var2Pr = 0.; double sumPtWeight = 0., sumWeight = 0., sumPtPtWeight = 0., var1Eff = 0., var2Eff = 0.; - + int sample = histos.get(HIST("Rec/hZvtx_after_sel8"))->GetEntries(); sample = sample % 30; @@ -1082,37 +1101,40 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Rec/hITSchi2perCluster_before"), track.itsChi2NCl()); histos.fill(HIST("Rec/hTPCCrossedrows_before"), track.tpcNClsCrossedRows()); - if (std::fabs(track.eta()) <= cEtacut) - { nchEta++; + if (std::fabs(track.eta()) <= cEtacut) { + nchEta++; histos.fill(HIST("Rec/hnchTrue"), nchEta); } - if (track.pt() >= cPtmincut && track.pt() <= cPtmaxcut) - { nchPt += 1.; + if (track.pt() >= cPtmincut && track.pt() <= cPtmaxcut) { + nchPt += 1.; histos.fill(HIST("Rec/hnchTrue_pt"), nchPt); } - - if (!selTrack(track)) continue; - - if (track.pt() >= cPtmincut1 && track.pt() <= cPtmaxcut1) - { nch += 1.; + + if (!selTrack(track)) + continue; + + if (track.pt() >= cPtmincut1 && track.pt() <= cPtmaxcut1) { + nch += 1.; histos.fill(HIST("Rec/hnch"), nch); - histos.fill(HIST("Rec/hPtvar"), track.pt()); + histos.fill(HIST("Rec/hPtvar"), track.pt()); } - if (track.pt() < cPtmincut || track.pt() > cPtmaxcut) continue; - + if (track.pt() < cPtmincut || track.pt() > cPtmaxcut) + continue; + // if (std::fabs(track.y()) > 0.5) continue; histos.fill(HIST("hPt_rec"), track.pt()); histos.fill(HIST("hEta_rec"), track.eta()); double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); - if (eff < threshold) continue; + if (eff < threshold) + continue; double weight = 1.0 / eff; sumPtWeight += track.pt() * weight; sumPtPtWeight += (track.pt() * track.pt() * weight * weight); sumWeight += weight; - - histos.fill(HIST("hPt_rec_corr"), track.pt() , weight); - histos.fill(HIST("hEta_rec_corr"), track.eta() , weight); + + histos.fill(HIST("hPt_rec_corr"), track.pt(), weight); + histos.fill(HIST("hEta_rec_corr"), track.eta(), weight); auto mcParticle = track.mcParticle(); nchAll += 1.; @@ -1135,7 +1157,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Rec/hPEta"), track.p(), track.eta()); histos.fill(HIST("Rec/hNsigmaTPC"), track.p(), track.tpcNSigmaPr()); histos.fill(HIST("hPtEta_rec"), track.pt(), track.eta()); - + if (std::abs(mcParticle.pdgCode()) == PDG_t::kPiPlus) histos.fill(HIST("ptHistogramPionrec_pdg"), track.pt()); if (std::abs(mcParticle.pdgCode()) == PDG_t::kKPlus) @@ -1177,10 +1199,12 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce } if (selPion(track)) { - if (std::fabs(track.y()) > cRapidityCut05) continue; - if (track.beta() > 1) continue; + if (std::fabs(track.y()) > cRapidityCut05) + continue; + if (track.beta() > 1) + continue; histos.fill(HIST("ptHistogramPionrec"), track.pt()); - histos.fill(HIST("hPtEta_pi_rec"), track.pt(), track.eta()); + histos.fill(HIST("hPtEta_pi_rec"), track.pt(), track.eta()); histos.fill(HIST("Rec/hPtPion"), track.pt()); histos.fill(HIST("Rec/hEtaPion"), track.eta()); histos.fill(HIST("Rec/hyPion"), track.rapidity(massPi)); @@ -1191,14 +1215,14 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Rec/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Rec/hTOFbeta_afterselection1"), track.p(), track.beta()); if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kPiPlus) { - histos.fill(HIST("ptHistogramPionrec_purity"), track.pt()); + histos.fill(HIST("ptHistogramPionrec_purity"), track.pt()); } nchPi += 1.; q1Pi += track.pt(); q2Pi += (track.pt() * track.pt()); - histos.fill(HIST("hPyPion_rec"), track.p(), track.rapidity(massPi)); - histos.fill(HIST("hPtyPion_rec"), track.pt(), track.rapidity(massPi)); + histos.fill(HIST("hPyPion_rec"), track.p(), track.rapidity(massPi)); + histos.fill(HIST("hPtyPion_rec"), track.pt(), track.rapidity(massPi)); } //===========================kaon=============================================================== @@ -1210,10 +1234,12 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce } if (selKaon(track)) { - if (std::fabs(track.y()) > cRapidityCut05) continue; - if (track.beta() > 1) continue; + if (std::fabs(track.y()) > cRapidityCut05) + continue; + if (track.beta() > 1) + continue; histos.fill(HIST("ptHistogramKaonrec"), track.pt()); - histos.fill(HIST("hPtEta_ka_rec"), track.pt(), track.eta()); + histos.fill(HIST("hPtEta_ka_rec"), track.pt(), track.eta()); histos.fill(HIST("Rec/hPtKaon"), track.pt()); histos.fill(HIST("Rec/hEtaKaon"), track.eta()); histos.fill(HIST("Rec/hyKaon"), track.rapidity(massKa)); @@ -1224,7 +1250,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Rec/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Rec/hTOFbeta_afterselection1"), track.p(), track.beta()); if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kKPlus) { - histos.fill(HIST("ptHistogramKaonrec_purity"), track.pt()); + histos.fill(HIST("ptHistogramKaonrec_purity"), track.pt()); } nchKa += 1.; q1Ka += track.pt(); @@ -1243,10 +1269,12 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce } if (selProton(track)) { - if (std::fabs(track.y()) > cRapidityCut05) continue; - if (track.beta() > 1) continue; + if (std::fabs(track.y()) > cRapidityCut05) + continue; + if (track.beta() > 1) + continue; histos.fill(HIST("ptHistogramProtonrec"), track.pt()); - histos.fill(HIST("hPtEta_pr_rec"), track.pt(), track.eta()); + histos.fill(HIST("hPtEta_pr_rec"), track.pt(), track.eta()); histos.fill(HIST("Rec/hPtProton"), track.pt()); histos.fill(HIST("Rec/hEtaProton"), track.eta()); histos.fill(HIST("Rec/hyProton"), track.rapidity(massPr)); @@ -1257,7 +1285,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Rec/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Rec/hTOFbeta_afterselection1"), track.p(), track.beta()); if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kProton) { - histos.fill(HIST("ptHistogramProtonrec_purity"), track.pt()); + histos.fill(HIST("ptHistogramProtonrec_purity"), track.pt()); } nchPr += 1.; q1Pr += track.pt(); @@ -1289,7 +1317,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Rec/hVar2"), sample, cent, var2); histos.fill(HIST("Rec/hVarc"), sample, cent); histos.fill(HIST("Rec/hVar2meanpt"), cent, var2); - + //---------------------- pions ---------------------------------------- if (nchPi >= cTwoPtlCut2) { var1Pi = (q1Pi * q1Pi - q2Pi) / (nchPi * (nchPi - 1)); @@ -1299,8 +1327,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce if (nchKa >= cTwoPtlCut2) { var1Ka = (q1Ka * q1Ka - q2Ka) / (nchKa * (nchKa - 1)); var2Ka = (q1Ka / nchKa); - - } + } //---------------------------- protons ---------------------------------- if (nchPr >= cTwoPtlCut2) { var1Pr = (q1Pr * q1Pr - q2Pr) / (nchPr * (nchPr - 1)); @@ -1350,7 +1377,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("hEffVar1x_Naccorr_xaxis_rec"), sample, sumWeight, var1); histos.fill(HIST("hEffVar2x_Naccorr_xaxis_rec"), sample, sumWeight, var2); histos.fill(HIST("hEffVarx_Naccorr_xaxis_rec"), sample, sumWeight); - + //================= generated level============================== const auto& mccolgen = coll.mcCollision_as(); @@ -1377,7 +1404,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce } nch1++; histos.fill(HIST("hnch_afterPhysPrimary"), nch1); - + int pid = mcpart.pdgCode(); auto sign = 0; auto* pd = pdg->GetParticle(pid); @@ -1388,17 +1415,19 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce continue; } // histos.fill(HIST("gen_hSign"), sign); - if (std::fabs(mcpart.eta()) > cEtacut) continue; + if (std::fabs(mcpart.eta()) > cEtacut) + continue; nchGenTrue++; histos.fill(HIST("hnch_gen_after_etacut"), nchGenTrue); - if (mcpart.pt() >= cPtmincut1 && mcpart.pt() <= cPtmaxcut1) - { nchgen += 1.; + if (mcpart.pt() >= cPtmincut1 && mcpart.pt() <= cPtmaxcut1) { + nchgen += 1.; histos.fill(HIST("hnch_gen"), nchgen); - histos.fill(HIST("hPtvar_gen"), mcpart.pt()); + histos.fill(HIST("hPtvar_gen"), mcpart.pt()); } - if ((mcpart.pt() < cPtmincut) || (mcpart.pt() > cPtmaxcut)) continue; + if ((mcpart.pt() < cPtmincut) || (mcpart.pt() > cPtmaxcut)) + continue; histos.fill(HIST("hPt_gen"), mcpart.pt()); histos.fill(HIST("hEta_gen"), mcpart.eta()); histos.fill(HIST("ptHistogram_allcharge_gen"), mcpart.pt()); @@ -1412,7 +1441,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce if (mcpart.pdgCode() == PDG_t::kPiPlus || mcpart.pdgCode() == PDG_t::kPiMinus) { histos.fill(HIST("ptHistogramPion"), mcpart.pt()); - histos.fill(HIST("hPtEta_pi_gen"), mcpart.pt(), mcpart.eta()); + histos.fill(HIST("hPtEta_pi_gen"), mcpart.pt(), mcpart.eta()); histos.fill(HIST("hPty_pi_gen"), mcpart.pt(), mcpart.y()); nchPiGen += 1.; q1PiGen += mcpart.pt(); @@ -1422,8 +1451,8 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce if (mcpart.pdgCode() == PDG_t::kKPlus || mcpart.pdgCode() == PDG_t::kKMinus) { histos.fill(HIST("ptHistogramKaon"), mcpart.pt()); - histos.fill(HIST("hPtEta_ka_gen"), mcpart.pt(), mcpart.eta()); - histos.fill(HIST("hPty_ka_gen"), mcpart.pt(), mcpart.y()); + histos.fill(HIST("hPtEta_ka_gen"), mcpart.pt(), mcpart.eta()); + histos.fill(HIST("hPty_ka_gen"), mcpart.pt(), mcpart.y()); nchKaGen += 1.; q1KaGen += mcpart.pt(); q2KaGen += (mcpart.pt() * mcpart.pt()); @@ -1432,8 +1461,8 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce if (mcpart.pdgCode() == PDG_t::kProton || mcpart.pdgCode() == PDG_t::kProtonBar) { histos.fill(HIST("ptHistogramProton"), mcpart.pt()); - histos.fill(HIST("hPtEta_pr_gen"), mcpart.pt(), mcpart.eta()); - histos.fill(HIST("hPty_pr_gen"), mcpart.pt(), mcpart.y()); + histos.fill(HIST("hPtEta_pr_gen"), mcpart.pt(), mcpart.eta()); + histos.fill(HIST("hPty_pr_gen"), mcpart.pt(), mcpart.y()); nchPrGen += 1.; q1PrGen += mcpart.pt(); q2PrGen += (mcpart.pt() * mcpart.pt()); @@ -1456,7 +1485,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("hterm1_gen"), nchGenAll, var1AllGen); histos.fill(HIST("hterm2_gen"), nchGenAll, var2AllGen); -//--------------------------Pions------------------------------------------- + //--------------------------Pions------------------------------------------- if (nchPiGen >= cTwoPtlCut2) { var1PiGen = (q1PiGen * q1PiGen - q2PiGen) / (nchPiGen * (nchPiGen - 1)); var2PiGen = (q1PiGen / nchPiGen); @@ -1495,8 +1524,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce } // void process PROCESS_SWITCH(EventMeanPtId, processMcReco, "Process reconstructed", false); - - }; +}; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) {