diff --git a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx index 84e20cb97dd..a8f7a7b691a 100644 --- a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx @@ -15,6 +15,7 @@ #include "PWGCF/Core/CorrelationContainer.h" #include "PWGCF/Core/PairCuts.h" + #include "Common/CCDB/EventSelectionParams.h" #include "Common/CCDB/TriggerAliases.h" #include "Common/Core/TrackSelection.h" @@ -25,6 +26,7 @@ #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponse.h" #include "Common/DataModel/TrackSelectionTables.h" + #include "CCDB/BasicCCDBManager.h" #include "CommonConstants/MathConstants.h" #include "CommonConstants/PhysicsConstants.h" @@ -35,8 +37,10 @@ #include "Framework/O2DatabasePDGPlugin.h" #include "Framework/RunningWorkflowInfo.h" #include "Framework/runDataProcessing.h" -#include + #include "TF1.h" +#include + #include #include #include @@ -121,27 +125,27 @@ struct EventMeanPtId { Configurable cSigmaLowHighcut{"cSigmaLowHighcut", 3.0f, "lower and upper sigma cut"}; 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", + 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", + 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; + 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; @@ -150,23 +154,23 @@ struct EventMeanPtId { 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 MyMCRecoCollisions = soa::Filtered>; -using MyMCRecoCollision = MyMCRecoCollisions::iterator; -using MyMCRecoTracks = soa::Filtered>; -using MyMCRecoTrack = MyMCRecoTracks::iterator; -using EventCandidatesMC = soa::Join; + 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 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"}; @@ -186,7 +190,7 @@ 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 vtxZAxis = {100, -20.0, 20.0, "Z (cm)"}; AxisSpec dcaAxis = {1002, -5.01, 5.01, "DCA_{xy} (cm)"}; @@ -275,8 +279,8 @@ using EventCandidatesMC = soa::JoinSetParameters(&(cfgFunCoeff.multPVFT0CCutPars[0])); cfgFunCoeff.fMultPVFT0CCutHigh = - new TF1("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])); @@ -463,24 +467,30 @@ using EventCandidatesMC = soa::JoinSetParameters(&(cfgFunCoeff.multGlobalPVCutPars[0])); + cfgFunCoeff.fMultGlobalPVCutHigh->SetParameters(&(cfgFunCoeff.multGlobalPVCutPars[0])); LOG(info) << "Printing Stored Registry Information"; histos.print(); - } + } -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){ - if (pvTrack < cfgFunCoeff.fMultPVFT0CCutLow->Eval(centrality)) return false; - if (pvTrack > cfgFunCoeff.fMultPVFT0CCutHigh->Eval(centrality)) return false; + 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.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; + if (cfgFunCoeff.cfgMultGlobalPVCutEnabled) { + if (globalNch < cfgFunCoeff.fMultGlobalPVCutLow->Eval(pvTrack)) + return false; + if (globalNch > cfgFunCoeff.fMultGlobalPVCutHigh->Eval(pvTrack)) + return false; } return true; } @@ -493,12 +503,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 @@ -526,7 +536,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce return false; } histos.fill(HIST("trackSelRec"), 7); - + // if (cpileupItslayerall && !coll.selection_bit(aod::evsel::kIsGoodITSLayersAll)) {return false;} histos.fill(HIST("trackSelRec"), 8); @@ -546,41 +556,59 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce } // accept only global tracks histos.fill(HIST("tracksel"), 2); - if (csyDCAxy && std::fabs(track.dcaXY()) > cDcaXYcut) {return false;} + if (csyDCAxy && std::fabs(track.dcaXY()) > cDcaXYcut) { + return false; + } histos.fill(HIST("tracksel"), 3); - if (csyDCAz && std::fabs(track.dcaZ()) > cDcaZcut) {return false;} + if (csyDCAz && 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 (csyTPCcr && track.tpcNClsCrossedRows() < csyTPCcrosscut) {return false;} + + if (csyTPCcr && track.tpcNClsCrossedRows() < csyTPCcrosscut) { + return false; + } histos.fill(HIST("tracksel"), 6); - if (csyITSchi && track.itsChi2NCl() >= csysItsChiCut) {return false;} + if (csyITSchi && track.itsChi2NCl() >= csysItsChiCut) { + return false; + } histos.fill(HIST("tracksel"), 7); - if (csyTPCchi && track.tpcChi2NCl() >= csysTpcChiCut) {return false;} + if (csyTPCchi && track.tpcChi2NCl() >= csysTpcChiCut) { + 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() < csysnITSClustersCut) { return false; } - histos.fill(HIST("tracksel"), 10); + if (track.itsNCls() < csysnITSClustersCut) { + return false; + } + histos.fill(HIST("tracksel"), 10); } - if(ctpcNClusterFound) { - if (track.tpcNClsFound() < csystpcNClsCut) {return false;} - histos.fill(HIST("tracksel"), 11); + if (ctpcNClusterFound) { + if (track.tpcNClsFound() < csystpcNClsCut) { + return false; + } + histos.fill(HIST("tracksel"), 11); } return true; // if all checks pass, accept the collision @@ -676,60 +704,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); @@ -738,7 +766,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); @@ -747,16 +775,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()); @@ -775,97 +805,99 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Data/hPtEta"), track.pt(), track.eta()); histos.fill(HIST("Data/hPEta"), track.p(), track.eta()); - if(effSwitch) { - double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); - if (eff < threshold) continue; - double weight = 1./eff; - sumPtWeight += track.pt() / eff; - sumPtPtWeight += (track.pt() * track.pt()) / (eff * eff); - sumWeight += weight; - } - - if(pidSwitch) { - // only TPC tracks: Pion, Kaon, Proton - if (track.hasTPC() && std::abs(track.tpcNSigmaPi()) < cNSigCut3) - histos.fill(HIST("Data/NSigamaTPCpion"), track.pt(), track.tpcNSigmaPi()); - if (track.hasTPC() && std::abs(track.tpcNSigmaKa()) < cNSigCut3) - histos.fill(HIST("Data/NSigamaTPCkaon"), track.pt(), track.tpcNSigmaKa()); - if (track.hasTPC() && std::abs(track.tpcNSigmaPr()) < cNSigCut3) - histos.fill(HIST("Data/NSigamaTPCproton"), track.pt(), track.tpcNSigmaPr()); - - // only TOF tracks: Pion, Kaon, Proton - if (track.hasTOF() && std::abs(track.tofNSigmaPi()) < cNSigCut3) - histos.fill(HIST("Data/NSigamaTOFpion"), track.pt(), track.tofNSigmaPi()); - if (track.hasTOF() && std::abs(track.tofNSigmaKa()) < cNSigCut3) - histos.fill(HIST("Data/NSigamaTOFkaon"), track.pt(), track.tofNSigmaKa()); - if (track.hasTOF() && std::abs(track.tofNSigmaPr()) < cNSigCut3) - histos.fill(HIST("Data/NSigamaTOFproton"), track.pt(), track.tofNSigmaPr()); - - if (track.hasTPC()) histos.fill(HIST("Data/hdEdx"), track.p(), track.tpcSignal()); - if (track.hasTOF()) histos.fill(HIST("Data/hTOFbeta"), track.p(), track.beta()); - - //===================================pion=========================================================== - // only TPC+TOF tracks: Pion, Kaon, Proton - if ((track.hasTPC() && std::abs(track.tpcNSigmaPi()) < cNSigCut3) && (track.hasTOF() && std::abs(track.tofNSigmaPi()) < cNSigCut3)) { - histos.fill(HIST("Data/NSigamaTPCTOFpion"), track.tpcNSigmaPi(), track.tofNSigmaPi()); - histos.fill(HIST("Data/hdEdx_afterselection"), track.p(), track.tpcSignal()); - histos.fill(HIST("Data/hTOFbeta_afterselection"), track.p(), track.beta()); - } - if (selPion(track)) { - histos.fill(HIST("Data/hPtPion"), track.pt()); - histos.fill(HIST("Data/hEtaPion"), track.eta()); - histos.fill(HIST("Data/hyPion"), track.rapidity(massPi)); - histos.fill(HIST("Data/hPtyPion"), track.pt(), track.rapidity(massPi)); - nchPi += 1.; - q1Pi += track.pt(); - q2Pi += (track.pt() * track.pt()); - if (track.beta() > 1) + if (effSwitch) { + double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); + if (eff < threshold) continue; - histos.fill(HIST("Data/hdEdx_afterselection1"), track.p(), track.tpcSignal()); - histos.fill(HIST("Data/hTOFbeta_afterselection1"), track.p(), track.beta()); + double weight = 1. / eff; + sumPtWeight += track.pt() / eff; + sumPtPtWeight += (track.pt() * track.pt()) / (eff * eff); + sumWeight += weight; } - //===========================kaon=============================================================== - if ((track.hasTPC() && std::abs(track.tpcNSigmaKa()) < cNSigCut3) && (track.hasTOF() && std::abs(track.tofNSigmaKa()) < cNSigCut3)) { - histos.fill(HIST("Data/NSigamaTPCTOFkaon"), track.tpcNSigmaKa(), track.tofNSigmaKa()); - histos.fill(HIST("Data/hdEdx_afterselection"), track.p(), track.tpcSignal()); - histos.fill(HIST("Data/hTOFbeta_afterselection"), track.p(), track.beta()); - } - if (selKaon(track)) { - histos.fill(HIST("Data/hPtKaon"), track.pt()); - histos.fill(HIST("Data/hEtaKaon"), track.eta()); - histos.fill(HIST("Data/hyKaon"), track.rapidity(massKa)); - histos.fill(HIST("Data/hPtyKaon"), track.pt(), track.rapidity(massKa)); - nchKa += 1.; - q1Ka += track.pt(); - q2Ka += (track.pt() * track.pt()); - if (track.beta() > 1) - continue; - histos.fill(HIST("Data/hdEdx_afterselection1"), track.p(), track.tpcSignal()); - histos.fill(HIST("Data/hTOFbeta_afterselection1"), track.p(), track.beta()); - } + if (pidSwitch) { + // only TPC tracks: Pion, Kaon, Proton + if (track.hasTPC() && std::abs(track.tpcNSigmaPi()) < cNSigCut3) + histos.fill(HIST("Data/NSigamaTPCpion"), track.pt(), track.tpcNSigmaPi()); + if (track.hasTPC() && std::abs(track.tpcNSigmaKa()) < cNSigCut3) + histos.fill(HIST("Data/NSigamaTPCkaon"), track.pt(), track.tpcNSigmaKa()); + if (track.hasTPC() && std::abs(track.tpcNSigmaPr()) < cNSigCut3) + histos.fill(HIST("Data/NSigamaTPCproton"), track.pt(), track.tpcNSigmaPr()); + + // only TOF tracks: Pion, Kaon, Proton + if (track.hasTOF() && std::abs(track.tofNSigmaPi()) < cNSigCut3) + histos.fill(HIST("Data/NSigamaTOFpion"), track.pt(), track.tofNSigmaPi()); + if (track.hasTOF() && std::abs(track.tofNSigmaKa()) < cNSigCut3) + histos.fill(HIST("Data/NSigamaTOFkaon"), track.pt(), track.tofNSigmaKa()); + if (track.hasTOF() && std::abs(track.tofNSigmaPr()) < cNSigCut3) + histos.fill(HIST("Data/NSigamaTOFproton"), track.pt(), track.tofNSigmaPr()); + + if (track.hasTPC()) + histos.fill(HIST("Data/hdEdx"), track.p(), track.tpcSignal()); + if (track.hasTOF()) + histos.fill(HIST("Data/hTOFbeta"), track.p(), track.beta()); + + //===================================pion=========================================================== + // only TPC+TOF tracks: Pion, Kaon, Proton + if ((track.hasTPC() && std::abs(track.tpcNSigmaPi()) < cNSigCut3) && (track.hasTOF() && std::abs(track.tofNSigmaPi()) < cNSigCut3)) { + histos.fill(HIST("Data/NSigamaTPCTOFpion"), track.tpcNSigmaPi(), track.tofNSigmaPi()); + histos.fill(HIST("Data/hdEdx_afterselection"), track.p(), track.tpcSignal()); + histos.fill(HIST("Data/hTOFbeta_afterselection"), track.p(), track.beta()); + } + if (selPion(track)) { + histos.fill(HIST("Data/hPtPion"), track.pt()); + histos.fill(HIST("Data/hEtaPion"), track.eta()); + histos.fill(HIST("Data/hyPion"), track.rapidity(massPi)); + histos.fill(HIST("Data/hPtyPion"), track.pt(), track.rapidity(massPi)); + nchPi += 1.; + q1Pi += track.pt(); + q2Pi += (track.pt() * track.pt()); + if (track.beta() > 1) + continue; + histos.fill(HIST("Data/hdEdx_afterselection1"), track.p(), track.tpcSignal()); + histos.fill(HIST("Data/hTOFbeta_afterselection1"), track.p(), track.beta()); + } - //============================proton=========================================================== - if ((track.hasTPC() && std::abs(track.tpcNSigmaPr()) < cNSigCut3) && (track.hasTOF() && std::abs(track.tofNSigmaPr()) < cNSigCut3)) { - histos.fill(HIST("Data/NSigamaTPCTOFproton"), track.tpcNSigmaPr(), track.tofNSigmaPr()); - histos.fill(HIST("Data/hdEdx_afterselection"), track.p(), track.tpcSignal()); - histos.fill(HIST("Data/hTOFbeta_afterselection"), track.p(), track.beta()); - } - if (selProton(track)) { - histos.fill(HIST("Data/hPtProton"), track.pt()); - histos.fill(HIST("Data/hEtaProton"), track.eta()); - histos.fill(HIST("Data/hyProton"), track.rapidity(massPr)); - histos.fill(HIST("Data/hPtyProton"), track.pt(), track.rapidity(massPr)); - nchPr += 1.; - q1Pr += track.pt(); - q2Pr += (track.pt() * track.pt()); - if (track.beta() > 1) - continue; - histos.fill(HIST("Data/hdEdx_afterselection1"), track.p(), track.tpcSignal()); - histos.fill(HIST("Data/hTOFbeta_afterselection1"), track.p(), track.beta()); - } + //===========================kaon=============================================================== + if ((track.hasTPC() && std::abs(track.tpcNSigmaKa()) < cNSigCut3) && (track.hasTOF() && std::abs(track.tofNSigmaKa()) < cNSigCut3)) { + histos.fill(HIST("Data/NSigamaTPCTOFkaon"), track.tpcNSigmaKa(), track.tofNSigmaKa()); + histos.fill(HIST("Data/hdEdx_afterselection"), track.p(), track.tpcSignal()); + histos.fill(HIST("Data/hTOFbeta_afterselection"), track.p(), track.beta()); + } + if (selKaon(track)) { + histos.fill(HIST("Data/hPtKaon"), track.pt()); + histos.fill(HIST("Data/hEtaKaon"), track.eta()); + histos.fill(HIST("Data/hyKaon"), track.rapidity(massKa)); + histos.fill(HIST("Data/hPtyKaon"), track.pt(), track.rapidity(massKa)); + nchKa += 1.; + q1Ka += track.pt(); + q2Ka += (track.pt() * track.pt()); + if (track.beta() > 1) + continue; + histos.fill(HIST("Data/hdEdx_afterselection1"), track.p(), track.tpcSignal()); + histos.fill(HIST("Data/hTOFbeta_afterselection1"), track.p(), track.beta()); + } + //============================proton=========================================================== + if ((track.hasTPC() && std::abs(track.tpcNSigmaPr()) < cNSigCut3) && (track.hasTOF() && std::abs(track.tofNSigmaPr()) < cNSigCut3)) { + histos.fill(HIST("Data/NSigamaTPCTOFproton"), track.tpcNSigmaPr(), track.tofNSigmaPr()); + histos.fill(HIST("Data/hdEdx_afterselection"), track.p(), track.tpcSignal()); + histos.fill(HIST("Data/hTOFbeta_afterselection"), track.p(), track.beta()); + } + if (selProton(track)) { + histos.fill(HIST("Data/hPtProton"), track.pt()); + histos.fill(HIST("Data/hEtaProton"), track.eta()); + histos.fill(HIST("Data/hyProton"), track.rapidity(massPr)); + histos.fill(HIST("Data/hPtyProton"), track.pt(), track.rapidity(massPr)); + nchPr += 1.; + q1Pr += track.pt(); + q2Pr += (track.pt() * track.pt()); + if (track.beta() > 1) + continue; + 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); @@ -873,11 +905,11 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce 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); - + //---------------------- pions ---------------------------------------- if (nchPi >= cTwoPtlCut2) { var1Pi = (q1Pi * q1Pi - q2Pi) / (nchPi * (nchPi - 1)); @@ -893,8 +925,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); @@ -909,81 +941,85 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Data/hdiffVar2x"), sample, nch, var2); histos.fill(HIST("Data/hdiffVarx"), sample, nch); - if(effSwitchHistoFill){ - //------------------ Efficiency corrected histograms --------------- - var1Eff = (sumPtWeight * sumPtWeight - sumPtPtWeight) / (sumWeight * (sumWeight - 1)); - var2Eff = (sumPtWeight / sumWeight); - - histos.fill(HIST("hEffVar1x_data"), sample, nchAll, var1Eff); - histos.fill(HIST("hEffVar2x_data"), sample, nchAll, var2Eff); - histos.fill(HIST("hEffVarx_data"), sample, nchAll); - histos.fill(HIST("hEffVar2Meanptx_data"), nchAll, var2Eff); - histos.fill(HIST("hEffVar1x_Naccorr_data"), sample, sumWeight, var1Eff); - histos.fill(HIST("hEffVar2x_Naccorr_data"), sample, sumWeight, var2Eff); - histos.fill(HIST("hEffVarx_Naccorr_data"), sample, sumWeight); - histos.fill(HIST("hEffVar1x_Naccorr_xaxis_data"), sample, sumWeight, var1); - histos.fill(HIST("hEffVar2x_Naccorr_xaxis_data"), sample, sumWeight, var2); + if (effSwitchHistoFill) { + //------------------ Efficiency corrected histograms --------------- + var1Eff = (sumPtWeight * sumPtWeight - sumPtPtWeight) / (sumWeight * (sumWeight - 1)); + var2Eff = (sumPtWeight / sumWeight); + + histos.fill(HIST("hEffVar1x_data"), sample, nchAll, var1Eff); + histos.fill(HIST("hEffVar2x_data"), sample, nchAll, var2Eff); + histos.fill(HIST("hEffVarx_data"), sample, nchAll); + histos.fill(HIST("hEffVar2Meanptx_data"), nchAll, var2Eff); + histos.fill(HIST("hEffVar1x_Naccorr_data"), sample, sumWeight, var1Eff); + histos.fill(HIST("hEffVar2x_Naccorr_data"), sample, sumWeight, var2Eff); + histos.fill(HIST("hEffVarx_Naccorr_data"), sample, sumWeight); + histos.fill(HIST("hEffVar1x_Naccorr_xaxis_data"), sample, sumWeight, var1); + histos.fill(HIST("hEffVar2x_Naccorr_xaxis_data"), sample, sumWeight, var2); } - if(pidSwitchHistoFill){ - histos.fill(HIST("Data/hVar1pi"), sample, cent, var1Pi); - histos.fill(HIST("Data/hVar2pi"), sample, cent, var2Pi); - histos.fill(HIST("Data/hVar2meanptpi"), cent, var2Pi); - histos.fill(HIST("Data/hVar1k"), sample, cent, var1Ka); - histos.fill(HIST("Data/hVar2k"), sample, cent, var2Ka); - histos.fill(HIST("Data/hVar2meanptk"), cent, var2Ka); - histos.fill(HIST("Data/hVar1p"), sample, cent, var1Pr); - histos.fill(HIST("Data/hVar2p"), sample, cent, var2Pr); - histos.fill(HIST("Data/hVar2meanptp"), cent, var2Pr); - histos.fill(HIST("Data/hVar1pix"), sample, nchAll, var1Pi); - histos.fill(HIST("Data/hVar2pix"), sample, nchAll, var2Pi); - histos.fill(HIST("Data/hVarpix"), sample, nchPi); - histos.fill(HIST("Data/hVar2meanptpix"), nchAll, var2Pi); - histos.fill(HIST("Data/hVar1kx"), sample, nchAll, var1Ka); - histos.fill(HIST("Data/hVar2kx"), sample, nchAll, var2Ka); - histos.fill(HIST("Data/hVarkx"), sample, nchKa); - histos.fill(HIST("Data/hVar2meanptkx"), nchAll, var2Ka); - histos.fill(HIST("Data/hVar1px"), sample, nchAll, var1Pr); - histos.fill(HIST("Data/hVar2px"), sample, nchAll, var2Pr); - histos.fill(HIST("Data/hVarpx"), sample, nchPr); - histos.fill(HIST("Data/hVar2meanptpx"), nchAll, var2Pr); + if (pidSwitchHistoFill) { + histos.fill(HIST("Data/hVar1pi"), sample, cent, var1Pi); + histos.fill(HIST("Data/hVar2pi"), sample, cent, var2Pi); + histos.fill(HIST("Data/hVar2meanptpi"), cent, var2Pi); + histos.fill(HIST("Data/hVar1k"), sample, cent, var1Ka); + histos.fill(HIST("Data/hVar2k"), sample, cent, var2Ka); + histos.fill(HIST("Data/hVar2meanptk"), cent, var2Ka); + histos.fill(HIST("Data/hVar1p"), sample, cent, var1Pr); + histos.fill(HIST("Data/hVar2p"), sample, cent, var2Pr); + histos.fill(HIST("Data/hVar2meanptp"), cent, var2Pr); + histos.fill(HIST("Data/hVar1pix"), sample, nchAll, var1Pi); + histos.fill(HIST("Data/hVar2pix"), sample, nchAll, var2Pi); + histos.fill(HIST("Data/hVarpix"), sample, nchPi); + histos.fill(HIST("Data/hVar2meanptpix"), nchAll, var2Pi); + histos.fill(HIST("Data/hVar1kx"), sample, nchAll, var1Ka); + histos.fill(HIST("Data/hVar2kx"), sample, nchAll, var2Ka); + histos.fill(HIST("Data/hVarkx"), sample, nchKa); + histos.fill(HIST("Data/hVar2meanptkx"), nchAll, var2Ka); + histos.fill(HIST("Data/hVar1px"), sample, nchAll, var1Pr); + histos.fill(HIST("Data/hVar2px"), sample, nchAll, var2Pr); + histos.fill(HIST("Data/hVarpx"), sample, nchPr); + histos.fill(HIST("Data/hVar2meanptpx"), nchAll, var2Pr); } } // 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("Data/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("Data/hZvtx_after_sel8"), coll.posZ()); - histos.fill(HIST("Data/hCentrality"), cent); + histos.fill(HIST("Data/hCentrality"), cent); float globalNch = inputTracks.size(); - float pvTrack = coll.multNTracksPV(); + 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 nch = 0., nchPi = 0., nchKa = 0., nchPr = 0., nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0.; double q1 = 0., q2 = 0.; @@ -991,7 +1027,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("Data/hZvtx_after_sel8"))->GetEntries(); sample = sample % 30; @@ -1002,38 +1038,41 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Data/hITSchi2perCluster_before"), track.itsChi2NCl()); histos.fill(HIST("Data/hTPCCrossedrows_before"), track.tpcNClsCrossedRows()); - if (std::fabs(track.eta()) <= cEtacut) - { nchEta++; + if (std::fabs(track.eta()) <= cEtacut) { + nchEta++; histos.fill(HIST("Data/hnchTrue"), nchEta); } - if (track.pt() >= cPtmincut && track.pt() <= cPtmaxcut) - { nchPt += 1.; + if (track.pt() >= cPtmincut && track.pt() <= cPtmaxcut) { + 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; + // if (std::fabs(track.y()) > 0.5) continue; histos.fill(HIST("hPt_rec"), track.pt()); histos.fill(HIST("hEta_rec"), track.eta()); - if(effSwitch) { - double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); - 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); + if (effSwitch) { + double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); + 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); } auto mcParticle = track.mcParticle(); @@ -1056,156 +1095,163 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Data/hPtEta"), track.pt(), track.eta()); histos.fill(HIST("Data/hPEta"), track.p(), track.eta()); histos.fill(HIST("hPtEta_rec"), track.pt(), track.eta()); - - if(pidSwitch) { - if (std::abs(mcParticle.pdgCode()) == PDG_t::kPiPlus) - histos.fill(HIST("ptHistogramPionrec_pdg"), track.pt()); - if (std::abs(mcParticle.pdgCode()) == PDG_t::kKPlus) - histos.fill(HIST("ptHistogramKaonrec_pdg"), track.pt()); - if (std::abs(mcParticle.pdgCode()) == PDG_t::kProton) - histos.fill(HIST("ptHistogramProtonrec_pdg"), track.pt()); - - // only TPC tracks: Pion, Kaon, Proton - if (track.hasTPC() && std::abs(track.tpcNSigmaPi()) < cNSigCut3) - histos.fill(HIST("Data/NSigamaTPCpion"), track.pt(), track.tpcNSigmaPi()); - if (track.hasTPC() && std::abs(track.tpcNSigmaKa()) < cNSigCut3) - histos.fill(HIST("Data/NSigamaTPCkaon"), track.pt(), track.tpcNSigmaKa()); - if (track.hasTPC() && std::abs(track.tpcNSigmaPr()) < cNSigCut3) - histos.fill(HIST("Data/NSigamaTPCproton"), track.pt(), track.tpcNSigmaPr()); - - // only TOF tracks: Pion, Kaon, Proton - if (track.hasTOF() && std::abs(track.tofNSigmaPi()) < cNSigCut3) - histos.fill(HIST("Data/NSigamaTOFpion"), track.pt(), track.tofNSigmaPi()); - if (track.hasTOF() && std::abs(track.tofNSigmaKa()) < cNSigCut3) - histos.fill(HIST("Data/NSigamaTOFkaon"), track.pt(), track.tofNSigmaKa()); - if (track.hasTOF() && std::abs(track.tofNSigmaPr()) < cNSigCut3) - histos.fill(HIST("Data/NSigamaTOFproton"), track.pt(), track.tofNSigmaPr()); - - if (track.hasTPC()) - histos.fill(HIST("Data/hdEdx"), track.p(), track.tpcSignal()); - if (track.hasTOF()) - histos.fill(HIST("Data/hTOFbeta"), track.p(), track.beta()); - if (track.hasTPC()) - histos.fill(HIST("hdEdx_afterselection_rec_beforepidcut"), track.p(), track.tpcSignal()); - if (track.hasTOF()) - histos.fill(HIST("hTOFbeta_afterselection_rec_beforepidcut"), track.p(), track.beta()); - - //===================================pion============================================================== - if ((track.hasTPC() && std::abs(track.tpcNSigmaPi()) < cNSigCut3) && (track.hasTOF() && std::abs(track.tofNSigmaPi()) < cNSigCut3)) { - histos.fill(HIST("Data/NSigamaTPCTOFpion"), track.tpcNSigmaPi(), track.tofNSigmaPi()); - - histos.fill(HIST("Data/hdEdx_afterselection"), track.p(), track.tpcSignal()); - histos.fill(HIST("Data/hTOFbeta_afterselection"), track.p(), track.beta()); - } - if (selPion(track)) { - 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("Data/hPtPion"), track.pt()); - histos.fill(HIST("Data/hEtaPion"), track.eta()); - histos.fill(HIST("Data/hyPion"), track.rapidity(massPi)); - histos.fill(HIST("Data/hPtyPion"), track.pt(), track.rapidity(massPi)); - histos.fill(HIST("NSigamaTPCpion_rec"), track.p(), track.tpcNSigmaPi()); - histos.fill(HIST("NSigamaTOFpion_rec"), track.p(), track.tofNSigmaPi()); - histos.fill(HIST("NSigamaTPCTOFpion_rec"), track.tpcNSigmaPi(), track.tofNSigmaPi()); - histos.fill(HIST("Data/hdEdx_afterselection1"), track.p(), track.tpcSignal()); - histos.fill(HIST("Data/hTOFbeta_afterselection1"), track.p(), track.beta()); - if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kPiPlus) { - histos.fill(HIST("ptHistogramPionrec_purity"), track.pt()); + if (pidSwitch) { + if (std::abs(mcParticle.pdgCode()) == PDG_t::kPiPlus) + histos.fill(HIST("ptHistogramPionrec_pdg"), track.pt()); + if (std::abs(mcParticle.pdgCode()) == PDG_t::kKPlus) + histos.fill(HIST("ptHistogramKaonrec_pdg"), track.pt()); + if (std::abs(mcParticle.pdgCode()) == PDG_t::kProton) + histos.fill(HIST("ptHistogramProtonrec_pdg"), track.pt()); + + // only TPC tracks: Pion, Kaon, Proton + if (track.hasTPC() && std::abs(track.tpcNSigmaPi()) < cNSigCut3) + histos.fill(HIST("Data/NSigamaTPCpion"), track.pt(), track.tpcNSigmaPi()); + if (track.hasTPC() && std::abs(track.tpcNSigmaKa()) < cNSigCut3) + histos.fill(HIST("Data/NSigamaTPCkaon"), track.pt(), track.tpcNSigmaKa()); + if (track.hasTPC() && std::abs(track.tpcNSigmaPr()) < cNSigCut3) + histos.fill(HIST("Data/NSigamaTPCproton"), track.pt(), track.tpcNSigmaPr()); + + // only TOF tracks: Pion, Kaon, Proton + if (track.hasTOF() && std::abs(track.tofNSigmaPi()) < cNSigCut3) + histos.fill(HIST("Data/NSigamaTOFpion"), track.pt(), track.tofNSigmaPi()); + if (track.hasTOF() && std::abs(track.tofNSigmaKa()) < cNSigCut3) + histos.fill(HIST("Data/NSigamaTOFkaon"), track.pt(), track.tofNSigmaKa()); + if (track.hasTOF() && std::abs(track.tofNSigmaPr()) < cNSigCut3) + histos.fill(HIST("Data/NSigamaTOFproton"), track.pt(), track.tofNSigmaPr()); + + if (track.hasTPC()) + histos.fill(HIST("Data/hdEdx"), track.p(), track.tpcSignal()); + if (track.hasTOF()) + histos.fill(HIST("Data/hTOFbeta"), track.p(), track.beta()); + if (track.hasTPC()) + histos.fill(HIST("hdEdx_afterselection_rec_beforepidcut"), track.p(), track.tpcSignal()); + if (track.hasTOF()) + histos.fill(HIST("hTOFbeta_afterselection_rec_beforepidcut"), track.p(), track.beta()); + + //===================================pion============================================================== + if ((track.hasTPC() && std::abs(track.tpcNSigmaPi()) < cNSigCut3) && (track.hasTOF() && std::abs(track.tofNSigmaPi()) < cNSigCut3)) { + histos.fill(HIST("Data/NSigamaTPCTOFpion"), track.tpcNSigmaPi(), track.tofNSigmaPi()); + + histos.fill(HIST("Data/hdEdx_afterselection"), track.p(), track.tpcSignal()); + histos.fill(HIST("Data/hTOFbeta_afterselection"), track.p(), track.beta()); } - 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)); - } - //===========================kaon=============================================================== + if (selPion(track)) { + 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("Data/hPtPion"), track.pt()); + histos.fill(HIST("Data/hEtaPion"), track.eta()); + histos.fill(HIST("Data/hyPion"), track.rapidity(massPi)); + histos.fill(HIST("Data/hPtyPion"), track.pt(), track.rapidity(massPi)); + histos.fill(HIST("NSigamaTPCpion_rec"), track.p(), track.tpcNSigmaPi()); + histos.fill(HIST("NSigamaTOFpion_rec"), track.p(), track.tofNSigmaPi()); + histos.fill(HIST("NSigamaTPCTOFpion_rec"), track.tpcNSigmaPi(), track.tofNSigmaPi()); + histos.fill(HIST("Data/hdEdx_afterselection1"), track.p(), track.tpcSignal()); + histos.fill(HIST("Data/hTOFbeta_afterselection1"), track.p(), track.beta()); + if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kPiPlus) { + 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)); + } - if ((track.hasTPC() && std::abs(track.tpcNSigmaKa()) < cNSigCut3) && (track.hasTOF() && std::abs(track.tofNSigmaKa()) < cNSigCut3)) { - histos.fill(HIST("Data/NSigamaTPCTOFkaon"), track.tpcNSigmaKa(), track.tofNSigmaKa()); - histos.fill(HIST("Data/hdEdx_afterselection"), track.p(), track.tpcSignal()); - histos.fill(HIST("Data/hTOFbeta_afterselection"), track.p(), track.beta()); - } + //===========================kaon=============================================================== - if (selKaon(track)) { - 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("Data/hPtKaon"), track.pt()); - histos.fill(HIST("Data/hEtaKaon"), track.eta()); - histos.fill(HIST("Data/hyKaon"), track.rapidity(massKa)); - histos.fill(HIST("Data/hPtyKaon"), track.pt(), track.rapidity(massKa)); - histos.fill(HIST("NSigamaTPCkaon_rec"), track.p(), track.tpcNSigmaKa()); - histos.fill(HIST("NSigamaTOFkaon_rec"), track.p(), track.tofNSigmaKa()); - histos.fill(HIST("NSigamaTPCTOFkaon_rec"), track.tpcNSigmaKa(), track.tofNSigmaKa()); - histos.fill(HIST("Data/hdEdx_afterselection1"), track.p(), track.tpcSignal()); - histos.fill(HIST("Data/hTOFbeta_afterselection1"), track.p(), track.beta()); - if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kKPlus) { - histos.fill(HIST("ptHistogramKaonrec_purity"), track.pt()); + if ((track.hasTPC() && std::abs(track.tpcNSigmaKa()) < cNSigCut3) && (track.hasTOF() && std::abs(track.tofNSigmaKa()) < cNSigCut3)) { + histos.fill(HIST("Data/NSigamaTPCTOFkaon"), track.tpcNSigmaKa(), track.tofNSigmaKa()); + histos.fill(HIST("Data/hdEdx_afterselection"), track.p(), track.tpcSignal()); + histos.fill(HIST("Data/hTOFbeta_afterselection"), track.p(), track.beta()); } - nchKa += 1.; - q1Ka += track.pt(); - q2Ka += (track.pt() * track.pt()); - - histos.fill(HIST("hPyKaon_rec"), track.p(), track.rapidity(massKa)); - histos.fill(HIST("hPtyKaon_rec"), track.pt(), track.rapidity(massKa)); - } - //============================proton=========================================================== + if (selKaon(track)) { + 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("Data/hPtKaon"), track.pt()); + histos.fill(HIST("Data/hEtaKaon"), track.eta()); + histos.fill(HIST("Data/hyKaon"), track.rapidity(massKa)); + histos.fill(HIST("Data/hPtyKaon"), track.pt(), track.rapidity(massKa)); + histos.fill(HIST("NSigamaTPCkaon_rec"), track.p(), track.tpcNSigmaKa()); + histos.fill(HIST("NSigamaTOFkaon_rec"), track.p(), track.tofNSigmaKa()); + histos.fill(HIST("NSigamaTPCTOFkaon_rec"), track.tpcNSigmaKa(), track.tofNSigmaKa()); + histos.fill(HIST("Data/hdEdx_afterselection1"), track.p(), track.tpcSignal()); + histos.fill(HIST("Data/hTOFbeta_afterselection1"), track.p(), track.beta()); + if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kKPlus) { + histos.fill(HIST("ptHistogramKaonrec_purity"), track.pt()); + } + nchKa += 1.; + q1Ka += track.pt(); + q2Ka += (track.pt() * track.pt()); + + histos.fill(HIST("hPyKaon_rec"), track.p(), track.rapidity(massKa)); + histos.fill(HIST("hPtyKaon_rec"), track.pt(), track.rapidity(massKa)); + } - if ((track.hasTPC() && std::abs(track.tpcNSigmaPr()) < cNSigCut3) && (track.hasTOF() && std::abs(track.tofNSigmaPr()) < cNSigCut3)) { - histos.fill(HIST("Data/NSigamaTPCTOFproton"), track.tpcNSigmaPr(), track.tofNSigmaPr()); - histos.fill(HIST("Data/hdEdx_afterselection"), track.p(), track.tpcSignal()); - histos.fill(HIST("Data/hTOFbeta_afterselection"), track.p(), track.beta()); - } + //============================proton=========================================================== - if (selProton(track)) { - 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("Data/hPtProton"), track.pt()); - histos.fill(HIST("Data/hEtaProton"), track.eta()); - histos.fill(HIST("Data/hyProton"), track.rapidity(massPr)); - histos.fill(HIST("Data/hPtyProton"), track.pt(), track.rapidity(massPr)); - histos.fill(HIST("NSigamaTPCproton_rec"), track.p(), track.tpcNSigmaPr()); - histos.fill(HIST("NSigamaTOFproton_rec"), track.p(), track.tofNSigmaPr()); - histos.fill(HIST("NSigamaTPCTOFproton_rec"), track.tpcNSigmaPr(), track.tofNSigmaPr()); - histos.fill(HIST("Data/hdEdx_afterselection1"), track.p(), track.tpcSignal()); - histos.fill(HIST("Data/hTOFbeta_afterselection1"), track.p(), track.beta()); - if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kProton) { - histos.fill(HIST("ptHistogramProtonrec_purity"), track.pt()); + if ((track.hasTPC() && std::abs(track.tpcNSigmaPr()) < cNSigCut3) && (track.hasTOF() && std::abs(track.tofNSigmaPr()) < cNSigCut3)) { + histos.fill(HIST("Data/NSigamaTPCTOFproton"), track.tpcNSigmaPr(), track.tofNSigmaPr()); + histos.fill(HIST("Data/hdEdx_afterselection"), track.p(), track.tpcSignal()); + histos.fill(HIST("Data/hTOFbeta_afterselection"), track.p(), track.beta()); } - nchPr += 1.; - q1Pr += track.pt(); - q2Pr += (track.pt() * track.pt()); - histos.fill(HIST("hPyProton_rec"), track.p(), track.rapidity(massPr)); - histos.fill(HIST("hPtyProton_rec"), track.pt(), track.rapidity(massPr)); + if (selProton(track)) { + 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("Data/hPtProton"), track.pt()); + histos.fill(HIST("Data/hEtaProton"), track.eta()); + histos.fill(HIST("Data/hyProton"), track.rapidity(massPr)); + histos.fill(HIST("Data/hPtyProton"), track.pt(), track.rapidity(massPr)); + histos.fill(HIST("NSigamaTPCproton_rec"), track.p(), track.tpcNSigmaPr()); + histos.fill(HIST("NSigamaTOFproton_rec"), track.p(), track.tofNSigmaPr()); + histos.fill(HIST("NSigamaTPCTOFproton_rec"), track.tpcNSigmaPr(), track.tofNSigmaPr()); + histos.fill(HIST("Data/hdEdx_afterselection1"), track.p(), track.tpcSignal()); + histos.fill(HIST("Data/hTOFbeta_afterselection1"), track.p(), track.beta()); + if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kProton) { + histos.fill(HIST("ptHistogramProtonrec_purity"), track.pt()); + } + nchPr += 1.; + q1Pr += track.pt(); + q2Pr += (track.pt() * track.pt()); + + histos.fill(HIST("hPyProton_rec"), track.p(), track.rapidity(massPr)); + histos.fill(HIST("hPtyProton_rec"), track.pt(), track.rapidity(massPr)); + } } - } } // loop over tracks histos.fill(HIST("Data/hcent_nacc"), cent, nchAll); histos.fill(HIST("hNch_vs_Nch"), sample, nchAll, nchAll); - if (nchAll < cTwoPtlCut2) return; + if (nchAll < cTwoPtlCut2) + return; var1 = (q1 * q1 - q2) / (nchAll * (nchAll - 1)); var2 = (q1 / nchAll); histos.fill(HIST("hterm1"), nchAll, var1); histos.fill(HIST("hterm2"), nchAll, var2); - + histos.fill(HIST("Data/hVar1"), sample, cent, var1); histos.fill(HIST("Data/hVar2"), sample, cent, var2); histos.fill(HIST("Data/hVarc"), sample, cent); histos.fill(HIST("Data/hVar2meanpt"), cent, var2); - + //---------------------- pions ---------------------------------------- if (nchPi >= cTwoPtlCut2) { var1Pi = (q1Pi * q1Pi - q2Pi) / (nchPi * (nchPi - 1)); @@ -1215,13 +1261,13 @@ 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)); var2Pr = (q1Pr / nchPr); } - + //-----------------------nch------------------------------------- histos.fill(HIST("Data/hVar1x"), sample, nchAll, var1); histos.fill(HIST("Data/hVar2x"), sample, nchAll, var2); @@ -1230,48 +1276,47 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Data/hdiffVar2x"), sample, nch, var2); histos.fill(HIST("Data/hdiffVarx"), sample, nch); histos.fill(HIST("Data/hVar2meanptx"), nchAll, var2); - - if(pidSwitchHistoFill){ - histos.fill(HIST("Data/hVar1pi"), sample, cent, var1Pi); - histos.fill(HIST("Data/hVar2pi"), sample, cent, var2Pi); - histos.fill(HIST("Data/hVar2meanptpi"), cent, var2Pi); - histos.fill(HIST("Data/hVar1k"), sample, cent, var1Ka); - histos.fill(HIST("Data/hVar2k"), sample, cent, var2Ka); - histos.fill(HIST("Data/hVar2meanptk"), cent, var2Ka); - histos.fill(HIST("Data/hVar1p"), sample, cent, var1Pr); - histos.fill(HIST("Data/hVar2p"), sample, cent, var2Pr); - histos.fill(HIST("Data/hVar2meanptp"), cent, var2Pr); - histos.fill(HIST("Data/hVar1pix"), sample, nchAll, var1Pi); - histos.fill(HIST("Data/hVar2pix"), sample, nchAll, var2Pi); - histos.fill(HIST("Data/hVarpix"), sample, nchPi); - histos.fill(HIST("Data/hVar2meanptpix"), nchAll, var2Pi); - histos.fill(HIST("Data/hVar1kx"), sample, nchAll, var1Ka); - histos.fill(HIST("Data/hVar2kx"), sample, nchAll, var2Ka); - histos.fill(HIST("Data/hVarkx"), sample, nchKa); - histos.fill(HIST("Data/hVar2meanptkx"), nchAll, var2Ka); - histos.fill(HIST("Data/hVar1px"), sample, nchAll, var1Pr); - histos.fill(HIST("Data/hVar2px"), sample, nchAll, var2Pr); - histos.fill(HIST("Data/hVarpx"), sample, nchPr); - histos.fill(HIST("Data/hVar2meanptpx"), nchAll, var2Pr); + + if (pidSwitchHistoFill) { + histos.fill(HIST("Data/hVar1pi"), sample, cent, var1Pi); + histos.fill(HIST("Data/hVar2pi"), sample, cent, var2Pi); + histos.fill(HIST("Data/hVar2meanptpi"), cent, var2Pi); + histos.fill(HIST("Data/hVar1k"), sample, cent, var1Ka); + histos.fill(HIST("Data/hVar2k"), sample, cent, var2Ka); + histos.fill(HIST("Data/hVar2meanptk"), cent, var2Ka); + histos.fill(HIST("Data/hVar1p"), sample, cent, var1Pr); + histos.fill(HIST("Data/hVar2p"), sample, cent, var2Pr); + histos.fill(HIST("Data/hVar2meanptp"), cent, var2Pr); + histos.fill(HIST("Data/hVar1pix"), sample, nchAll, var1Pi); + histos.fill(HIST("Data/hVar2pix"), sample, nchAll, var2Pi); + histos.fill(HIST("Data/hVarpix"), sample, nchPi); + histos.fill(HIST("Data/hVar2meanptpix"), nchAll, var2Pi); + histos.fill(HIST("Data/hVar1kx"), sample, nchAll, var1Ka); + histos.fill(HIST("Data/hVar2kx"), sample, nchAll, var2Ka); + histos.fill(HIST("Data/hVarkx"), sample, nchKa); + histos.fill(HIST("Data/hVar2meanptkx"), nchAll, var2Ka); + histos.fill(HIST("Data/hVar1px"), sample, nchAll, var1Pr); + histos.fill(HIST("Data/hVar2px"), sample, nchAll, var2Pr); + histos.fill(HIST("Data/hVarpx"), sample, nchPr); + histos.fill(HIST("Data/hVar2meanptpx"), nchAll, var2Pr); } - if(effSwitchHistoFill){ - var1Eff = (sumPtWeight * sumPtWeight - sumPtPtWeight) / (sumWeight * (sumWeight - 1)); - var2Eff = (sumPtWeight / sumWeight); - - histos.fill(HIST("hEffVar1x_data"), sample, nchAll, var1Eff); - histos.fill(HIST("hEffVar2x_data"), sample, nchAll, var2Eff); - histos.fill(HIST("hEffVarx_data"), sample, nchAll); - histos.fill(HIST("hEffVar2Meanptx_data"), nchAll, var2Eff); - histos.fill(HIST("hEffVar1x_Naccorr_data"), sample, sumWeight, var1Eff); - histos.fill(HIST("hEffVar2x_Naccorr_data"), sample, sumWeight, var2Eff); - histos.fill(HIST("hEffVarx_Naccorr_data"), sample, sumWeight); - histos.fill(HIST("hEffVar1x_Naccorr_xaxis_data"), sample, sumWeight, var1); - histos.fill(HIST("hEffVar2x_Naccorr_xaxis_data"), sample, sumWeight, var2); - histos.fill(HIST("hcent_nacc_corr"), cent, sumWeight); - histos.fill(HIST("hNch_vs_corr"), sample, nchAll, sumWeight); - - } + if (effSwitchHistoFill) { + var1Eff = (sumPtWeight * sumPtWeight - sumPtPtWeight) / (sumWeight * (sumWeight - 1)); + var2Eff = (sumPtWeight / sumWeight); + + histos.fill(HIST("hEffVar1x_data"), sample, nchAll, var1Eff); + histos.fill(HIST("hEffVar2x_data"), sample, nchAll, var2Eff); + histos.fill(HIST("hEffVarx_data"), sample, nchAll); + histos.fill(HIST("hEffVar2Meanptx_data"), nchAll, var2Eff); + histos.fill(HIST("hEffVar1x_Naccorr_data"), sample, sumWeight, var1Eff); + histos.fill(HIST("hEffVar2x_Naccorr_data"), sample, sumWeight, var2Eff); + histos.fill(HIST("hEffVarx_Naccorr_data"), sample, sumWeight); + histos.fill(HIST("hEffVar1x_Naccorr_xaxis_data"), sample, sumWeight, var1); + histos.fill(HIST("hEffVar2x_Naccorr_xaxis_data"), sample, sumWeight, var2); + histos.fill(HIST("hcent_nacc_corr"), cent, sumWeight); + histos.fill(HIST("hNch_vs_corr"), sample, nchAll, sumWeight); + } //================= generated level============================== const auto& mccolgen = coll.mcCollision_as(); @@ -1298,7 +1343,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); @@ -1309,17 +1354,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()); @@ -1329,41 +1376,41 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("hnch_gen_all"), nchGenAll); histos.fill(HIST("hPtEta_gen"), mcpart.pt(), mcpart.eta()); - if(pidSwitch) { - if (std::fabs(mcpart.y()) < cRapidityCut05) { - - 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("hPty_pi_gen"), mcpart.pt(), mcpart.y()); - nchPiGen += 1.; - q1PiGen += mcpart.pt(); - q2PiGen += (mcpart.pt() * mcpart.pt()); - histos.fill(HIST("hnch_pi"), nchPiGen); - } - - 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()); - nchKaGen += 1.; - q1KaGen += mcpart.pt(); - q2KaGen += (mcpart.pt() * mcpart.pt()); - histos.fill(HIST("hnch_ka"), nchKaGen); - } - - 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()); - nchPrGen += 1.; - q1PrGen += mcpart.pt(); - q2PrGen += (mcpart.pt() * mcpart.pt()); - histos.fill(HIST("hnch_pr"), nchPrGen); - } - - } //|y| < 0.5 cut ends! - }//pid flag + if (pidSwitch) { + if (std::fabs(mcpart.y()) < cRapidityCut05) { + + 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("hPty_pi_gen"), mcpart.pt(), mcpart.y()); + nchPiGen += 1.; + q1PiGen += mcpart.pt(); + q2PiGen += (mcpart.pt() * mcpart.pt()); + histos.fill(HIST("hnch_pi"), nchPiGen); + } + + 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()); + nchKaGen += 1.; + q1KaGen += mcpart.pt(); + q2KaGen += (mcpart.pt() * mcpart.pt()); + histos.fill(HIST("hnch_ka"), nchKaGen); + } + + 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()); + nchPrGen += 1.; + q1PrGen += mcpart.pt(); + q2PrGen += (mcpart.pt() * mcpart.pt()); + histos.fill(HIST("hnch_pr"), nchPrGen); + } + + } //|y| < 0.5 cut ends! + } // pid flag } // track loop ends! histos.fill(HIST("hcent_nacc_gen"), cent, nchGenAll); @@ -1387,40 +1434,39 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("hdiffVarx_gen"), sampleGen, nchgen); histos.fill(HIST("hVar2meanptx_gen"), nchGenAll, var2AllGen); - if(pidSwitchHistoFill){ - //--------------------------Pions------------------------------------------- - if (nchPiGen >= cTwoPtlCut2) { - var1PiGen = (q1PiGen * q1PiGen - q2PiGen) / (nchPiGen * (nchPiGen - 1)); - var2PiGen = (q1PiGen / nchPiGen); - } - //----------------------- kaons --------------------------------------- - if (nchKaGen >= cTwoPtlCut2) { - var1KaGen = (q1KaGen * q1KaGen - q2KaGen) / (nchKaGen * (nchKaGen - 1)); - var2KaGen = (q1KaGen / nchKaGen); - } - //---------------------------- protons ---------------------------------- - if (nchPrGen >= cTwoPtlCut2) { - var1PrGen = (q1PrGen * q1PrGen - q2PrGen) / (nchPrGen * (nchPrGen - 1)); - var2PrGen = (q1PrGen / nchPrGen); - } - histos.fill(HIST("hVar1pix_gen"), sampleGen, nchGenAll, var1PiGen); - histos.fill(HIST("hVar2pix_gen"), sampleGen, nchGenAll, var2PiGen); - histos.fill(HIST("hVarpix_gen"), sampleGen, nchPiGen); - histos.fill(HIST("hVar2meanptpix_gen"), nchGenAll, var2PiGen); - histos.fill(HIST("hVar1kx_gen"), sampleGen, nchGenAll, var1KaGen); - histos.fill(HIST("hVar2kx_gen"), sampleGen, nchGenAll, var2KaGen); - histos.fill(HIST("hVarkx_gen"), sampleGen, nchKaGen); - histos.fill(HIST("hVar2meanptkx_gen"), nchGenAll, var2KaGen); - histos.fill(HIST("hVar1px_gen"), sampleGen, nchGenAll, var1PrGen); - histos.fill(HIST("hVar2px_gen"), sampleGen, nchGenAll, var2PrGen); - histos.fill(HIST("hVarpx_gen"), sampleGen, nchPrGen); - histos.fill(HIST("hVar2meanptpx_gen"), nchGenAll, var2PrGen); + if (pidSwitchHistoFill) { + //--------------------------Pions------------------------------------------- + if (nchPiGen >= cTwoPtlCut2) { + var1PiGen = (q1PiGen * q1PiGen - q2PiGen) / (nchPiGen * (nchPiGen - 1)); + var2PiGen = (q1PiGen / nchPiGen); + } + //----------------------- kaons --------------------------------------- + if (nchKaGen >= cTwoPtlCut2) { + var1KaGen = (q1KaGen * q1KaGen - q2KaGen) / (nchKaGen * (nchKaGen - 1)); + var2KaGen = (q1KaGen / nchKaGen); + } + //---------------------------- protons ---------------------------------- + if (nchPrGen >= cTwoPtlCut2) { + var1PrGen = (q1PrGen * q1PrGen - q2PrGen) / (nchPrGen * (nchPrGen - 1)); + var2PrGen = (q1PrGen / nchPrGen); + } + histos.fill(HIST("hVar1pix_gen"), sampleGen, nchGenAll, var1PiGen); + histos.fill(HIST("hVar2pix_gen"), sampleGen, nchGenAll, var2PiGen); + histos.fill(HIST("hVarpix_gen"), sampleGen, nchPiGen); + histos.fill(HIST("hVar2meanptpix_gen"), nchGenAll, var2PiGen); + histos.fill(HIST("hVar1kx_gen"), sampleGen, nchGenAll, var1KaGen); + histos.fill(HIST("hVar2kx_gen"), sampleGen, nchGenAll, var2KaGen); + histos.fill(HIST("hVarkx_gen"), sampleGen, nchKaGen); + histos.fill(HIST("hVar2meanptkx_gen"), nchGenAll, var2KaGen); + histos.fill(HIST("hVar1px_gen"), sampleGen, nchGenAll, var1PrGen); + histos.fill(HIST("hVar2px_gen"), sampleGen, nchGenAll, var2PrGen); + histos.fill(HIST("hVarpx_gen"), sampleGen, nchPrGen); + histos.fill(HIST("hVar2meanptpx_gen"), nchGenAll, var2PrGen); } } // void process PROCESS_SWITCH(EventMeanPtId, processMcReco, "Process reconstructed", false); - - }; +}; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) {