From 4202d0c7a989694bdc9e3f6624e9e24b8490f3e0 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Wed, 8 Oct 2025 07:05:23 +0000 Subject: [PATCH] Please consider the following formatting changes --- .../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) {