diff --git a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx index a9bb9f53d34..e0ead922240 100644 --- a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx @@ -1,5 +1,5 @@ // Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for +// See https://alice-o2.web.cern.ch/copyright for // All rights not expressly granted are reserved. // // This software is distributed under the terms of the GNU General Public @@ -10,10 +10,9 @@ // or submit itself to any jurisdiction. // /// \file eventMeanPtId.cxx -/// \brief Analysis task to study Mean pT Fluctuations using two particle correlator using Cumulant Method +/// \brief Analysis task to study Mean pT Fluctuations using two particle correlator using Cumulant Method /// \author Sweta Singh (sweta.singh@cern.ch) - #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" #include "Common/DataModel/EventSelection.h" @@ -56,8 +55,8 @@ using o2::constants::physics::Pdg; namespace o2::aod { -using MyCollisions = soa::Join; -using MyTracks = soa::Join; +using MyTracks = soa::Join ccdb; + Service pdg; -struct EventMeanPtId{ - Service ccdb; - Service pdg; - HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; - + Configurable ptMax{"ptMax", 2.0, "maximum pT"}; Configurable ptMin{"ptMin", 0.15, "minimum pT"}; Configurable> ptBins{"ptBins", {0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50, 0.55, 0.60, 0.65, 0.70, 0.75, 0.80, 0.85, 0.90, 0.95, 1.00, 1.05, 1.10, 1.15, 1.20, 1.25, 1.30, 1.35, 1.40, 1.45, 1.50, 1.55, 1.60, 1.65, 1.70, 1.75, 1.80, 1.85, 1.90, 1.95, 2.00}, "p_{T} bins"}; @@ -92,8 +90,8 @@ struct EventMeanPtId{ void init(o2::framework::InitContext&) { - 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})"}; + 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)"}; @@ -101,7 +99,7 @@ struct EventMeanPtId{ 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})"}; - AxisSpec etaAxis = {300, -1.5, 1.5, "#eta"};// 300, -1.5, 1.5 + AxisSpec etaAxis = {300, -1.5, 1.5, "#eta"}; // 300, -1.5, 1.5 AxisSpec nSigmaTPCAxis = {170, -8.5, 8.5, "n#sigma_{TPC}^{proton}"}; AxisSpec nSigmaTPCAxispid = {170, -8.5, 8.5, "n#sigma_{TPC}"}; AxisSpec nSigmaTOFAxispid = {170, -8.5, 8.5, "n#sigma_{TOF}"}; @@ -245,7 +243,7 @@ struct EventMeanPtId{ histos.add("Data/hcent_nacc", "hcent_nacc", kTH2D, {centAxis, nchAxis}); histos.addClone("Data/", "Rec/"); -//rec histograms + // rec histograms histos.add("NSigamaTPCpion_rec", "NSigamaTPCpion_rec", kTH2D, {pAxis, nSigmaTPCAxispid}); histos.add("NSigamaTPCkaon_rec", "NSigamaTPCkaon_rec", kTH2D, {pAxis, nSigmaTPCAxispid}); histos.add("NSigamaTPCproton_rec", "NSigamaTPCproton_rec", kTH2D, {pAxis, nSigmaTPCAxispid}); @@ -274,7 +272,7 @@ struct EventMeanPtId{ histos.add("hdEdx_afterselection_rec_afterpidcut", "hdEdx_afterselection_rec_afterpidcut", kTH2D, {pAxis, dEdxAxis}); histos.add("hTOFbeta_afterselection_rec_beforepidcut", "hTOFbeta_afterselection_rec_beforepidcut", kTH2D, {pAxis, betaAxis}); histos.add("hdEdx_afterselection_rec_beforepidcut", "hdEdx_afterselection_rec_beforepidcut", kTH2D, {pAxis, dEdxAxis}); - + histos.add("heffVar1x", "heffVar1x", kTH2D, {subAxis, nchAxis}); histos.add("heffVar2x", "heffVar2x", kTH2D, {subAxis, nchAxis}); histos.add("heffVarx", "heffVarx", kTH2D, {subAxis, nchAxis}); @@ -284,7 +282,7 @@ struct EventMeanPtId{ histos.add("hnchRec_true", ";hnchRec_true", kTH1D, {nchAxis}); histos.add("hVar1x_rec_old", "hVar1x_rec_old", kTH2D, {subAxis, nchAxis}); histos.add("hVar2x_rec_old", "hVar2x_rec_old", kTH2D, {subAxis, nchAxis}); - histos.add("hVarx_rec_old", "hVarx_rec_old", kTH2D, {subAxis, nchAxis}); + histos.add("hVarx_rec_old", "hVarx_rec_old", kTH2D, {subAxis, nchAxis}); histos.add("hVar1x_rec", "hVar1x_rec", kTH2D, {subAxis, nchAxis}); histos.add("hVar2x_rec", "hVar2x_rec", kTH2D, {subAxis, nchAxis}); histos.add("hVarx_rec", "hVarx_rec", kTH2D, {subAxis, nchAxis}); @@ -333,7 +331,7 @@ struct EventMeanPtId{ histos.add("hnch_gen_eta", ";hnch_gen_eta", kTH1D, {etaAxis}); histos.add("hnch1", ";hnch1", kTH1D, {nchAxis}); histos.add("hnch2", ";hnch2", kTH1D, {nchAxis}); - histos.add("hnch3", ";hnch3", kTH1D, {nchAxis}); + histos.add("hnch3", ";hnch3", kTH1D, {nchAxis}); histos.add("hnch_pi", ";hnch_pi", kTH1D, {nchAxis}); histos.add("hnch_ka", ";hnch_ka", kTH1D, {nchAxis}); histos.add("hnch_pr", ";hnch_pr", kTH1D, {nchAxis}); @@ -356,133 +354,156 @@ struct EventMeanPtId{ histos.add("hVar1px_gen", "hVar1px_gen", kTH2D, {subAxis, nchAxis}); histos.add("hVar2px_gen", "hVar2px_gen", kTH2D, {subAxis, nchAxis}); histos.add("hVarpx_gen", "hVarpx_gen", kTH2D, {subAxis, nchAxis}); - histos.add("hVar2meanptpx_gen", "hVar2meanptpx_gen", kTH2D, {nchAxis, varAxis2}); + histos.add("hVar2meanptpx_gen", "hVar2meanptpx_gen", kTH2D, {nchAxis, varAxis2}); histos.add("hcent_nacc_rec", "hcent_nacc_rec", kTH2D, {centAxis, nchAxis}); histos.add("hcent_nacc_gen", "hcent_nacc_gen", kTH2D, {centAxis, nchAxis}); - histos.add("hGenCentrality", "hGenCentrality", kTH1D, {centAxis}); + histos.add("hGenCentrality", "hGenCentrality", kTH1D, {centAxis}); histos.add("hVtxZ_before_gen", "", kTH1F, {vtxZAxis}); histos.add("hVtxZ_after_gen", "", kTH1F, {vtxZAxis}); histos.add("hEta_gen", "", kTH1F, {etaAxis}); histos.add("hEta_rec", "", kTH1F, {etaAxis}); histos.add("hPt_gen", "", kTH1F, {ptAxis}); histos.add("hPt_rec", "", kTH1F, {ptAxis}); + } + // Configurables + Configurable cVtxZcut{"cVtxZcut", 10.f, "Vertex Z"}; + Configurable cEtacut{"cEtacut", 0.8, "Eta cut"}; + Configurable cPtmincut{"cPtmincut", 0.2, "Pt min cut"}; + Configurable cPtmaxcut{"cPtmaxcut", 2.0, "Pt max cut"}; + Configurable cDcaXYcut{"cDcaXYcut", 0.12, "DCA XY cut"}; + Configurable cDcaZcut{"cDcaZcut", 0.3, "DCA Z cut"}; + Configurable cCentmincut{"cCentmincut", 0.0, "Min cent cut"}; + Configurable cCentmaxcut{"cCentmaxcut", 90.0, "Max cent cut"}; + Configurable cTPCcrosscut{"cTPCcrosscut", 70, "TPC crossrows cut"}; + Configurable cItsChiCut{"cItsChiCut", 70, "ITS chi2 cluster cut"}; + Configurable cTpcChiCut{"cTpcChiCut", 70, "TPC chi2 cluster cut"}; + + // Event selections + Configurable cSel8Trig{"cSel8Trig", true, "Sel8 (T0A + T0C) Selection Run3"}; + Configurable cTFBorder{"cTFBorder", true, "Timeframe Border Selection"}; + Configurable cNoItsROBorder{"cNoItsROBorder", true, "No ITSRO Border Cut"}; + Configurable cItsTpcVtx{"cItsTpcVtx", true, "ITS+TPC Vertex Selection"}; + Configurable cPileupReject{"cPileupReject", true, "Pileup rejection"}; + Configurable cZVtxTimeDiff{"cZVtxTimeDiff", true, "z-vtx time diff selection"}; + Configurable cIsGoodITSLayers{"cIsGoodITSLayers", true, "Good ITS Layers All"}; + Configurable cItslayerall{"cItslayerall", true, "dead staves of ITS removed"}; + Configurable cvtxtofmatched{"cvtxtofmatched", true, "TOF vertex matched"}; + Configurable cfgRejEl{"cfgRejEl", true, "Rejected electrons"}; + + // PID selection configurables + Configurable cPionPmincut{"cPionPmincut", 0.2, "pion min cut of pion"}; + Configurable cKaonPmincut{"cKaonPmincut", 0.2, "kaon min cut of kaon"}; + Configurable cProtonPmincut{"cProtonPmincut", 0.2, "proton min cut of proton"}; + Configurable cPionPmaxcut{"cPionPmaxcut", 2.0, "pion min cut of pion"}; + Configurable cKaonPmaxcut{"cKaonPmaxcut", 2.0, "kaon min cut of kaon"}; + Configurable cProtonPmaxcut{"cProtonPmaxcut", 2.0, "proton min cut of proton"}; + Configurable cPionPthcut{"cPionPthcut", 0.65, "pion threshold cut of pion"}; + Configurable cKaonPthcut{"cKaonPthcut", 0.65, "kaon threshold cut of kaon"}; + Configurable cProtonPthcut{"cProtonPthcut", 1.0, "proton threshold cut of proton"}; + Configurable cNSigCut2{"cNSigCut2", 2.0, "nSigma cut (2)"}; + Configurable cNSigCut3{"cNSigCut3", 3.0, "nSigma cut (3)"}; + Configurable cElMinCut{"cElMinCut", -3.0, "pion min cut of pion"}; + Configurable cElMaxCut{"cElMaxCut", 5.0, "pion min cut of pion"}; + Configurable cTwoPtlCut2{"cTwoPtlCut2", 2.0, "n2ptl cut (2)"}; + Configurable cRapidityCut05{"cRapidityCut05", 0.5, "n2ptl cut (2)"}; + + template + bool selCollision(C const& coll) + { - } - // Configurables - Configurable cVtxZcut{"cVtxZcut", 10.f, "Vertex Z"}; - Configurable cEtacut{"cEtacut", 0.8, "Eta cut"}; - Configurable cPtmincut{"cPtmincut", 0.2, "Pt min cut"}; - Configurable cPtmaxcut{"cPtmaxcut", 2.0, "Pt max cut"}; - Configurable cDcaXYcut{"cDcaXYcut", 0.12, "DCA XY cut"}; - Configurable cDcaZcut{"cDcaZcut", 0.3, "DCA Z cut"}; - Configurable cCentmincut{"cCentmincut", 0.0, "Min cent cut"}; - Configurable cCentmaxcut{"cCentmaxcut", 90.0, "Max cent cut"}; - Configurable cTPCcrosscut{"cTPCcrosscut", 70, "TPC crossrows cut"}; - Configurable cItsChiCut{"cItsChiCut", 70, "ITS chi2 cluster cut"}; - Configurable cTpcChiCut{"cTpcChiCut", 70, "TPC chi2 cluster cut"}; - - // Event selections - Configurable cSel8Trig{"cSel8Trig", true, "Sel8 (T0A + T0C) Selection Run3"}; - Configurable cTFBorder{"cTFBorder", true, "Timeframe Border Selection"}; - Configurable cNoItsROBorder{"cNoItsROBorder", true, "No ITSRO Border Cut"}; - Configurable cItsTpcVtx{"cItsTpcVtx", true, "ITS+TPC Vertex Selection"}; - Configurable cPileupReject{"cPileupReject", true, "Pileup rejection"}; - Configurable cZVtxTimeDiff{"cZVtxTimeDiff", true, "z-vtx time diff selection"}; - Configurable cIsGoodITSLayers{"cIsGoodITSLayers", true, "Good ITS Layers All"}; - Configurable cItslayerall{"cItslayerall", true, "dead staves of ITS removed"}; - Configurable cvtxtofmatched{"cvtxtofmatched", true, "TOF vertex matched"}; - Configurable cfgRejEl{"cfgRejEl", true, "Rejected electrons"}; - - //PID selection configurables - Configurable cPionPmincut{"cPionPmincut", 0.2, "pion min cut of pion"}; - Configurable cKaonPmincut{"cKaonPmincut", 0.2, "kaon min cut of kaon"}; - Configurable cProtonPmincut{"cProtonPmincut", 0.2, "proton min cut of proton"}; - Configurable cPionPmaxcut{"cPionPmaxcut", 2.0, "pion min cut of pion"}; - Configurable cKaonPmaxcut{"cKaonPmaxcut", 2.0, "kaon min cut of kaon"}; - Configurable cProtonPmaxcut{"cProtonPmaxcut", 2.0, "proton min cut of proton"}; - Configurable cPionPthcut{"cPionPthcut", 0.65, "pion threshold cut of pion"}; - Configurable cKaonPthcut{"cKaonPthcut", 0.65, "kaon threshold cut of kaon"}; - Configurable cProtonPthcut{"cProtonPthcut", 1.0, "proton threshold cut of proton"}; - Configurable cNSigCut2{"cNSigCut2", 2.0, "nSigma cut (2)"}; - Configurable cNSigCut3{"cNSigCut3", 3.0, "nSigma cut (3)"}; - Configurable cElMinCut{"cElMinCut", -3.0, "pion min cut of pion"}; - Configurable cElMaxCut{"cElMaxCut", 5.0, "pion min cut of pion"}; - Configurable cTwoPtlCut2{"cTwoPtlCut2", 2.0, "n2ptl cut (2)"}; - Configurable cRapidityCut05{"cRapidityCut05", 0.5, "n2ptl cut (2)"}; - - template < typename C> - bool selCollision(C const& coll) - { - - if (std::abs(coll.posZ()) > cVtxZcut) {return false;} //Reject the collisions with large vertex-z - histos.fill(HIST("hEventcounter"), 2.); + if (std::abs(coll.posZ()) > cVtxZcut) { + return false; + } // Reject the collisions with large vertex-z + histos.fill(HIST("hEventcounter"), 2.); -// cent = coll.centFT0M(); //centrality for run3 - if (cSel8Trig && !coll.sel8()) {return false;} //require min bias trigger - histos.fill(HIST("hEventcounter"), 3.); - - if (cTFBorder && !coll.selection_bit(aod::evsel::kNoTimeFrameBorder)) {return false;} - if (cNoItsROBorder && !coll.selection_bit(aod::evsel::kNoITSROFrameBorder)) {return false;} - histos.fill(HIST("trackSelRec"), 4); - - if (cPileupReject && !coll.selection_bit(aod::evsel::kNoSameBunchPileup)) {return false;} - histos.fill(HIST("trackSelRec"), 5); + // cent = coll.centFT0M(); //centrality for run3 + if (cSel8Trig && !coll.sel8()) { + return false; + } // require min bias trigger + histos.fill(HIST("hEventcounter"), 3.); - if (cZVtxTimeDiff && !coll.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) {return false;} - histos.fill(HIST("trackSelRec"), 6); + if (cTFBorder && !coll.selection_bit(aod::evsel::kNoTimeFrameBorder)) { + return false; + } + if (cNoItsROBorder && !coll.selection_bit(aod::evsel::kNoITSROFrameBorder)) { + return false; + } + histos.fill(HIST("trackSelRec"), 4); - if (cItsTpcVtx && !coll.selection_bit(aod::evsel::kIsVertexITSTPC)) {return false;} - histos.fill(HIST("trackSelRec"), 7); + if (cPileupReject && !coll.selection_bit(aod::evsel::kNoSameBunchPileup)) { + return false; + } + histos.fill(HIST("trackSelRec"), 5); -// if (cItslayerall && !coll.selection_bit(aod::evsel::kIsGoodITSLayersAll)) {return false;} - histos.fill(HIST("trackSelRec"), 8); + if (cZVtxTimeDiff && !coll.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) { + return false; + } + histos.fill(HIST("trackSelRec"), 6); - if (cvtxtofmatched && !coll.selection_bit(aod::evsel::kIsVertexTOFmatched)) {return false;} - histos.fill(HIST("trackSelRec"), 9); + if (cItsTpcVtx && !coll.selection_bit(aod::evsel::kIsVertexITSTPC)) { + return false; + } + histos.fill(HIST("trackSelRec"), 7); - return true; //if all checks pass, accept the collision + // if (cItslayerall && !coll.selection_bit(aod::evsel::kIsGoodITSLayersAll)) {return false;} + histos.fill(HIST("trackSelRec"), 8); + if (cvtxtofmatched && !coll.selection_bit(aod::evsel::kIsVertexTOFmatched)) { + return false; } + histos.fill(HIST("trackSelRec"), 9); + return true; // if all checks pass, accept the collision + } + template + bool selTrack(T const& track) + { + if (!track.isGlobalTrack()) { + return false; + } // accept only global tracks + histos.fill(HIST("tracksel"), 2); - template - bool selTrack(T const& track) - { - if (!track.isGlobalTrack()) {return false;} //accept only global tracks - histos.fill(HIST("tracksel"), 2); - -// if (std::fabs(track.dcaXY()) > cDcaXYcut) {return false;} - histos.fill(HIST("tracksel"), 3); + // if (std::fabs(track.dcaXY()) > cDcaXYcut) {return false;} + histos.fill(HIST("tracksel"), 3); -// if (std::fabs(track.dcaZ()) > cDcaZcut) {return false;} - histos.fill(HIST("tracksel"), 4); + // if (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 (std::fabs(track.eta()) >= cEtacut) { + return false; + } + histos.fill(HIST("tracksel"), 5); - if (track.pt() < cPtmincut ) {return false;} - if (track.pt() > cPtmaxcut) {return false;} - histos.fill(HIST("tracksel"), 6); + if (track.pt() < cPtmincut) { + return false; + } + if (track.pt() > cPtmaxcut) { + return false; + } + histos.fill(HIST("tracksel"), 6); -// if (track.tpcNClsCrossedRows() < cTPCcrosscut) {return false;} - histos.fill(HIST("tracksel"), 7); + // if (track.tpcNClsCrossedRows() < cTPCcrosscut) {return false;} + histos.fill(HIST("tracksel"), 7); -// if (track.itsChi2NCl() > cItsChiCut) {return false;} - histos.fill(HIST("tracksel"), 8); + // if (track.itsChi2NCl() > cItsChiCut) {return false;} + histos.fill(HIST("tracksel"), 8); -// if (track.tpcChi2NCl() > cTpcChiCut) {return false;} - histos.fill(HIST("tracksel"), 9); + // if (track.tpcChi2NCl() > cTpcChiCut) {return false;} + histos.fill(HIST("tracksel"), 9); - if (track.sign() == 0) return false; + if (track.sign() == 0) + return false; - return true; //if all checks pass, accept the collision - } + return true; // if all checks pass, accept the collision + } template bool rejEl(T const& track) { - if ( track.tpcNSigmaEl() > cElMinCut && track.tpcNSigmaEl() < cElMaxCut && std::fabs(track.tpcNSigmaPi()) > cNSigCut3 && std::fabs(track.tpcNSigmaKa()) > cNSigCut3 && std::fabs(track.tpcNSigmaPr()) > cNSigCut3) { return true; } + if (track.tpcNSigmaEl() > cElMinCut && track.tpcNSigmaEl() < cElMaxCut && std::fabs(track.tpcNSigmaPi()) > cNSigCut3 && std::fabs(track.tpcNSigmaKa()) > cNSigCut3 && std::fabs(track.tpcNSigmaPr()) > cNSigCut3) { + return true; + } return false; } @@ -491,17 +512,23 @@ struct EventMeanPtId{ { //! if pt < threshold (For tracks without TOF information) if (track.p() > cProtonPmincut && track.p() <= cProtonPthcut) { - if (track.hasTPC() && std::fabs(track.tpcNSigmaPr()) < cNSigCut2 && std::fabs(track.tpcNSigmaPi()) > cNSigCut2 && std::fabs(track.tpcNSigmaKa()) > cNSigCut2) { return true; } - } + if (track.hasTPC() && std::fabs(track.tpcNSigmaPr()) < cNSigCut2 && std::fabs(track.tpcNSigmaPi()) > cNSigCut2 && std::fabs(track.tpcNSigmaKa()) > cNSigCut2) { + return true; + } + } //! if pt < threshold (For tracks with TOF information) if (track.p() > cProtonPmincut && track.p() <= cProtonPthcut) { - if (track.hasTOF() && std::fabs(track.tpcNSigmaPr()) < cNSigCut2 && std::fabs(track.tofNSigmaPr()) < cNSigCut2 && std::fabs(track.tpcNSigmaPi()) > cNSigCut2 && std::fabs(track.tpcNSigmaKa()) > cNSigCut2) { return true; } - } + if (track.hasTOF() && std::fabs(track.tpcNSigmaPr()) < cNSigCut2 && std::fabs(track.tofNSigmaPr()) < cNSigCut2 && std::fabs(track.tpcNSigmaPi()) > cNSigCut2 && std::fabs(track.tpcNSigmaKa()) > cNSigCut2) { + return true; + } + } //! if pt > threshold (For tracks with TOF information) - if (track.p() > cProtonPthcut && track.p() <= cProtonPmaxcut) { - if ( track.hasTPC() && track.hasTOF() && std::fabs(track.tpcNSigmaPr()) < cNSigCut2 && std::fabs(track.tofNSigmaPr()) < cNSigCut2 && std::hypot(track.tofNSigmaPi(), track.tpcNSigmaPi()) > cNSigCut2 && std::hypot(track.tofNSigmaKa(), track.tpcNSigmaKa()) > cNSigCut2 ) { return true; } + if (track.p() > cProtonPthcut && track.p() <= cProtonPmaxcut) { + if (track.hasTPC() && track.hasTOF() && std::fabs(track.tpcNSigmaPr()) < cNSigCut2 && std::fabs(track.tofNSigmaPr()) < cNSigCut2 && std::hypot(track.tofNSigmaPi(), track.tpcNSigmaPi()) > cNSigCut2 && std::hypot(track.tofNSigmaKa(), track.tpcNSigmaKa()) > cNSigCut2) { + return true; + } } return false; @@ -512,20 +539,26 @@ struct EventMeanPtId{ { //! if pt < threshold (For tracks without TOF information) if (track.p() > cKaonPmincut && track.p() <= cKaonPthcut) { - if (track.hasTPC() && std::fabs(track.tpcNSigmaKa()) < cNSigCut2 && std::fabs(track.tpcNSigmaPi()) > cNSigCut2 && std::fabs(track.tpcNSigmaPr()) > cNSigCut2) { return true; } - } + if (track.hasTPC() && std::fabs(track.tpcNSigmaKa()) < cNSigCut2 && std::fabs(track.tpcNSigmaPi()) > cNSigCut2 && std::fabs(track.tpcNSigmaPr()) > cNSigCut2) { + return true; + } + } //! if pt < threshold (For tracks with TOF information) if (track.p() > cKaonPmincut && track.p() <= cKaonPthcut) { - if (track.hasTOF() && std::fabs(track.tpcNSigmaKa()) < cNSigCut2 && std::fabs(track.tofNSigmaKa()) < cNSigCut2 && std::fabs(track.tpcNSigmaPi()) > cNSigCut2 && std::fabs(track.tpcNSigmaPr()) > cNSigCut2) { return true; } - } + if (track.hasTOF() && std::fabs(track.tpcNSigmaKa()) < cNSigCut2 && std::fabs(track.tofNSigmaKa()) < cNSigCut2 && std::fabs(track.tpcNSigmaPi()) > cNSigCut2 && std::fabs(track.tpcNSigmaPr()) > cNSigCut2) { + return true; + } + } //! if pt > threshold (For tracks with TOF information) - if (track.p() > cKaonPthcut && track.p() <= cKaonPmaxcut) { - if ( track.hasTPC() && track.hasTOF() && std::fabs(track.tpcNSigmaKa()) < cNSigCut2 && std::fabs(track.tofNSigmaKa()) < cNSigCut2 && std::hypot(track.tofNSigmaPi(), track.tpcNSigmaPi()) > cNSigCut2 && std::hypot(track.tofNSigmaPr(), track.tpcNSigmaPr()) > cNSigCut2 ) { return true; } + if (track.p() > cKaonPthcut && track.p() <= cKaonPmaxcut) { + if (track.hasTPC() && track.hasTOF() && std::fabs(track.tpcNSigmaKa()) < cNSigCut2 && std::fabs(track.tofNSigmaKa()) < cNSigCut2 && std::hypot(track.tofNSigmaPi(), track.tpcNSigmaPi()) > cNSigCut2 && std::hypot(track.tofNSigmaPr(), track.tpcNSigmaPr()) > cNSigCut2) { + return true; + } } - return false; + return false; } template @@ -533,17 +566,23 @@ struct EventMeanPtId{ { //! if pt < threshold (For tracks without TOF information) if (track.p() > cPionPmincut && track.p() <= cPionPthcut) { - if (track.hasTPC() && std::fabs(track.tpcNSigmaPi()) < cNSigCut2 && std::fabs(track.tpcNSigmaKa()) > cNSigCut2 && std::fabs(track.tpcNSigmaPr()) > cNSigCut2) { return true; } - } + if (track.hasTPC() && std::fabs(track.tpcNSigmaPi()) < cNSigCut2 && std::fabs(track.tpcNSigmaKa()) > cNSigCut2 && std::fabs(track.tpcNSigmaPr()) > cNSigCut2) { + return true; + } + } - //! if pt < threshold (For tracks with TOF information) + //! if pt < threshold (For tracks with TOF information) if (track.p() > cPionPmincut && track.p() <= cPionPthcut) { - if (track.hasTOF() && std::fabs(track.tpcNSigmaPi()) < cNSigCut2 && std::fabs(track.tofNSigmaPi()) < cNSigCut2 && std::fabs(track.tpcNSigmaKa()) > cNSigCut2 && std::fabs(track.tpcNSigmaPr()) > cNSigCut2) { return true; } - } + if (track.hasTOF() && std::fabs(track.tpcNSigmaPi()) < cNSigCut2 && std::fabs(track.tofNSigmaPi()) < cNSigCut2 && std::fabs(track.tpcNSigmaKa()) > cNSigCut2 && std::fabs(track.tpcNSigmaPr()) > cNSigCut2) { + return true; + } + } //! if pt > threshold (For tracks with TOF information) - if (track.p() > cPionPthcut && track.p() <= cPionPmaxcut) { - if ( track.hasTPC() && track.hasTOF() && std::fabs(track.tpcNSigmaPi()) < cNSigCut2 && std::fabs(track.tofNSigmaPi()) < cNSigCut2 && std::hypot(track.tofNSigmaKa(), track.tpcNSigmaKa()) > cNSigCut2 && std::hypot(track.tofNSigmaPr(), track.tpcNSigmaPr()) > cNSigCut2 ) { return true; } + if (track.p() > cPionPthcut && track.p() <= cPionPmaxcut) { + if (track.hasTPC() && track.hasTOF() && std::fabs(track.tpcNSigmaPi()) < cNSigCut2 && std::fabs(track.tofNSigmaPi()) < cNSigCut2 && std::hypot(track.tofNSigmaKa(), track.tpcNSigmaKa()) > cNSigCut2 && std::hypot(track.tofNSigmaPr(), track.tpcNSigmaPr()) > cNSigCut2) { + return true; + } } return false; @@ -556,12 +595,14 @@ struct EventMeanPtId{ histos.fill(HIST("hEventcounter"), 1.); histos.fill(HIST("Data/hZvtx_before_sel"), coll.posZ()); - if (!selCollision(coll)) return; - { histos.fill(HIST("Data/hZvtx_after_sel8"), coll.posZ()); + if (!selCollision(coll)) + return; + { + histos.fill(HIST("Data/hZvtx_after_sel8"), coll.posZ()); } - - const auto cent = coll.centFT0C(); - histos.fill(HIST("Data/hCentrality"), cent); + + const auto cent = coll.centFT0C(); + histos.fill(HIST("Data/hCentrality"), cent); double nch = 0., nchPi = 0., nchKa = 0., nchPr = 0., nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0.; double q1 = 0., q2 = 0., q1Old = 0., q2Old = 0.; @@ -570,32 +611,35 @@ struct EventMeanPtId{ double var1Pi = 0., var2Pi = 0.; double var1Ka = 0., var2Ka = 0.; double var1Pr = 0., var2Pr = 0.; - // double sumPtWeight = 0., sumWeight = 0., sumPtPtWeight = 0.; + // double sumPtWeight = 0., sumWeight = 0., sumPtPtWeight = 0.; int sample = histos.get(HIST("Data/hZvtx_after_sel8"))->GetEntries(); - sample = sample % 30; //subsample error estimation + sample = sample % 30; // subsample error estimation for (const auto& track : inputTracks) { - nchAllBfCut += 1.; - histos.fill(HIST("Data/hnchAll_bf_cut"), nchAllBfCut); - + nchAllBfCut += 1.; + histos.fill(HIST("Data/hnchAll_bf_cut"), nchAllBfCut); + histos.fill(HIST("tracksel"), 1); 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); - } - if (track.pt() >= cPtmincut && track.pt() <= cPtmaxcut){ - nchPt += 1.; - histos.fill(HIST("Data/hnchTrue_pt"), nchPt);} + if (std::fabs(track.eta()) <= cEtacut) { + nchEta++; + histos.fill(HIST("Data/hnchTrue"), nchEta); + } + if (track.pt() >= cPtmincut && track.pt() <= cPtmaxcut) { + nchPt += 1.; + histos.fill(HIST("Data/hnchTrue_pt"), nchPt); + } - if(track.sign() == 0) continue; - if (!selTrack(track)) continue; + if (track.sign() == 0) + continue; + if (!selTrack(track)) + continue; - nchAll += 1.; - histos.fill(HIST("Data/hnchAll"), nchAll); + nchAll += 1.; + histos.fill(HIST("Data/hnchAll"), nchAll); histos.fill(HIST("Data/hDCAxy"), track.dcaXY()); histos.fill(HIST("Data/hDCAz"), track.dcaZ()); histos.fill(HIST("Data/hTPCCrossedrows_after"), track.tpcNClsCrossedRows()); @@ -609,17 +653,18 @@ struct EventMeanPtId{ histos.fill(HIST("Data/hPtEta"), track.pt(), track.eta()); histos.fill(HIST("Data/hPEta"), track.p(), track.eta()); histos.fill(HIST("Data/hNsigmaTPC"), track.p(), track.tpcNSigmaPr()); - - if (track.pt() >= cPtmincut || track.pt() <= cPtmaxcut) //do not change this (it is for different pt work) - {nch += 1.; + + if (track.pt() >= cPtmincut || track.pt() <= cPtmaxcut) // do not change this (it is for different pt work) + { + nch += 1.; q1Old += track.pt(); - q2Old += (track.pt() * track.pt()); - histos.fill(HIST("Data/hnch"), nch); - } - + q2Old += (track.pt() * track.pt()); + histos.fill(HIST("Data/hnch"), nch); + } + q1 += track.pt(); q2 += (track.pt() * 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()); @@ -636,8 +681,10 @@ struct EventMeanPtId{ 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("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 @@ -647,8 +694,8 @@ struct EventMeanPtId{ histos.fill(HIST("Data/hdEdx_afterselection"), track.p(), track.tpcSignal()); histos.fill(HIST("Data/hTOFbeta_afterselection"), track.p(), track.beta()); } - - if(selPion(track)){ + + 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)); @@ -657,11 +704,12 @@ struct EventMeanPtId{ q1Pi += track.pt(); q2Pi += (track.pt() * track.pt()); - if (track.beta() > 1) continue; + 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()); @@ -669,7 +717,7 @@ struct EventMeanPtId{ histos.fill(HIST("Data/hTOFbeta_afterselection"), track.p(), track.beta()); } - if(selKaon(track)){ + 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)); @@ -677,20 +725,21 @@ struct EventMeanPtId{ nchKa += 1.; q1Ka += track.pt(); q2Ka += (track.pt() * track.pt()); - - if (track.beta() > 1) continue; + + 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)) { + 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)){ + 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)); @@ -699,23 +748,24 @@ struct EventMeanPtId{ q1Pr += track.pt(); q2Pr += (track.pt() * track.pt()); - if (track.beta() > 1) continue; + 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/hcent_nacc"), cent, nchAll); - - if (nch >= cTwoPtlCut2) - { - var1Old = (q1Old * q1Old - q2Old) / (nch * (nch - 1)); - var2Old = (q1Old / nch); - } - if (nchAll < cTwoPtlCut2) return; - var1 = (q1 * q1 - q2) / (nchAll * (nchAll - 1)); - var2 = (q1 / nchAll); - - //------------------ all charges------------------------------------- + } + } // Track loop ends! + histos.fill(HIST("Data/hcent_nacc"), cent, nchAll); + + if (nch >= cTwoPtlCut2) { + var1Old = (q1Old * q1Old - q2Old) / (nch * (nch - 1)); + var2Old = (q1Old / nch); + } + if (nchAll < cTwoPtlCut2) + return; + var1 = (q1 * q1 - q2) / (nchAll * (nchAll - 1)); + var2 = (q1 / nchAll); + + //------------------ 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); @@ -724,22 +774,22 @@ struct EventMeanPtId{ histos.fill(HIST("Data/hVar"), nchAll, twoParAllCharge); //---------------------- pions ---------------------------------------- - if (nchPi >= cTwoPtlCut2) { + if (nchPi >= cTwoPtlCut2) { var1Pi = (q1Pi * q1Pi - q2Pi) / (nchPi * (nchPi - 1)); var2Pi = (q1Pi / nchPi); - } + } //----------------------- kaons --------------------------------------- - if (nchKa >= cTwoPtlCut2) { + if (nchKa >= cTwoPtlCut2) { var1Ka = (q1Ka * q1Ka - q2Ka) / (nchKa * (nchKa - 1)); var2Ka = (q1Ka / nchKa); - } + } //---------------------------- protons ---------------------------------- - if (nchPr >= cTwoPtlCut2) { + if (nchPr >= cTwoPtlCut2) { var1Pr = (q1Pr * q1Pr - q2Pr) / (nchPr * (nchPr - 1)); var2Pr = (q1Pr / nchPr); - } + } //========================centrality========================================== histos.fill(HIST("Data/hVar1pi"), sample, cent, var1Pi); @@ -779,99 +829,124 @@ struct EventMeanPtId{ histos.fill(HIST("Data/hVarpx"), sample, nchPr); histos.fill(HIST("Data/hVar2meanptpx"), nchAll, var2Pr); - - } // event loop ends! PROCESS_SWITCH(EventMeanPtId, process, "process real data information", false); - + //++++++++++++++++++++++++++++++++++++MC Reconstructed +++++++++++++++++++++++++++++++++++++++++++++++++++++// - -SliceCache cache; -Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; - void processMcReco (aod::MyMCRecoCollision const& coll, aod::MyMCRecoTracks const& inputTracks, aod::McCollisions const& mcCollisions, aod::McParticles const& mcParticles) - { - if (!coll.has_mcCollision()) { return; } + + SliceCache cache; + Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; + void processMcReco(aod::MyMCRecoCollision const& coll, aod::MyMCRecoTracks const& inputTracks, aod::McCollisions const& mcCollisions, aod::McParticles const& mcParticles) + { + if (!coll.has_mcCollision()) { + return; + } histos.fill(HIST("Rec/hZvtx_before_sel"), coll.posZ()); histos.fill(HIST("hVtxZ_before_gen"), coll.mcCollision().posZ()); - - if (cTFBorder && !coll.selection_bit(aod::evsel::kNoTimeFrameBorder)) { return ; } - if (cNoItsROBorder && !coll.selection_bit(aod::evsel::kNoITSROFrameBorder)) { return ; } - if (cPileupReject && !coll.selection_bit(aod::evsel::kNoSameBunchPileup)) { return ; } - if (cZVtxTimeDiff && !coll.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) { return ; } - if (cItsTpcVtx && !coll.selection_bit(aod::evsel::kIsVertexITSTPC)) { return ; } - if (cvtxtofmatched && !coll.selection_bit(aod::evsel::kIsVertexTOFmatched)) { return ; } - if (std::abs(coll.posZ()) > cVtxZcut) { return; } - - if (!coll.sel8()) { return;} - float cent = coll.centFT0C(); - histos.fill(HIST("Rec/hZvtx_after_sel8"), coll.posZ()); - + + if (cTFBorder && !coll.selection_bit(aod::evsel::kNoTimeFrameBorder)) { + return; + } + if (cNoItsROBorder && !coll.selection_bit(aod::evsel::kNoITSROFrameBorder)) { + return; + } + if (cPileupReject && !coll.selection_bit(aod::evsel::kNoSameBunchPileup)) { + return; + } + if (cZVtxTimeDiff && !coll.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) { + return; + } + if (cItsTpcVtx && !coll.selection_bit(aod::evsel::kIsVertexITSTPC)) { + return; + } + if (cvtxtofmatched && !coll.selection_bit(aod::evsel::kIsVertexTOFmatched)) { + return; + } + if (std::abs(coll.posZ()) > cVtxZcut) { + return; + } + + if (!coll.sel8()) { + return; + } + float cent = coll.centFT0C(); + histos.fill(HIST("Rec/hZvtx_after_sel8"), coll.posZ()); + double nch = 0., nchPi = 0., nchKa = 0., nchPr = 0., nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0.; double q1 = 0., q2 = 0., q1Old = 0., q2Old = 0.; double q1Pi = 0., q2Pi = 0., q1Ka = 0., q2Ka = 0., q1Pr = 0., q2Pr = 0.; double var1 = 0., var2 = 0., twoParAllCharge = 0., var1Old = 0., var2Old = 0.; double var1Pi = 0., var2Pi = 0., var1Ka = 0., var2Ka = 0., var1Pr = 0., var2Pr = 0.; - - int sample = histos.get(HIST("Rec/hZvtx_after_sel8"))->GetEntries(); - sample = sample % 30; - for (const auto& track : inputTracks) { + int sample = histos.get(HIST("Rec/hZvtx_after_sel8"))->GetEntries(); + sample = sample % 30; + + for (const auto& track : inputTracks) { nchAllBfCut += 1.; - histos.fill(HIST("Rec/hnchAll_bf_cut"), nchAllBfCut); - histos.fill(HIST("Rec/hTPCchi2perCluster_before"), track.tpcChi2NCl()); - histos.fill(HIST("Rec/hITSchi2perCluster_before"), track.itsChi2NCl()); - histos.fill(HIST("Rec/hTPCCrossedrows_before"), track.tpcNClsCrossedRows()); - - if (std::fabs(track.eta()) <= cEtacut ) - { nchEta++; - histos.fill(HIST("Rec/hnchTrue"), nchEta); - } - if (track.pt() >= cPtmincut && track.pt() <= cPtmaxcut) - { nchPt += 1.; - histos.fill(HIST("Rec/hnchTrue_pt"), nchPt); - } - if (!track.isGlobalTrack()) continue; - if (std::fabs(track.eta()) > cEtacut) continue; - if ((track.pt() <= cPtmincut) || (track.pt() >= cPtmaxcut)) continue; - if(track.sign() == 0) continue; - // if (std::fabs(track.y()) > 0.5) continue; - histos.fill(HIST("hPt_rec"), track.pt()); - histos.fill(HIST("hEta_rec"), track.eta()); - - auto mcParticle = track.mcParticle(); - nchAll += 1.; - histos.fill(HIST("Rec/hnchAll"), nchAll); - histos.fill(HIST("ptHistogram_allcharge_rec"), track.pt()); - histos.fill(HIST("Rec/hDCAxy"), track.dcaXY()); - histos.fill(HIST("Rec/hDCAz"), track.dcaZ()); - histos.fill(HIST("Rec/hTPCCrossedrows_after"), track.tpcNClsCrossedRows()); - histos.fill(HIST("Rec/hTPCchi2perCluster_after"), track.tpcChi2NCl()); - histos.fill(HIST("Rec/hITSchi2perCluster_after"), track.itsChi2NCl()); - histos.fill(HIST("Rec/hP"), track.p()); - histos.fill(HIST("Rec/hPt"), track.pt()); - histos.fill(HIST("Rec/hEta"), track.eta()); - histos.fill(HIST("Rec/hPtDCAxy"), track.pt(), track.dcaXY()); - histos.fill(HIST("Rec/hPtDCAz"), track.pt(), track.dcaZ()); - histos.fill(HIST("Rec/hPtEta"), track.pt(), track.eta()); - histos.fill(HIST("Rec/hPEta"), track.p(), track.eta()); - histos.fill(HIST("Rec/hNsigmaTPC"), track.p(), track.tpcNSigmaPr()); - - if (track.pt() >= cPtmincut || track.pt() <= cPtmaxcut) //do not change this (it is for different pt work) - {nch += 1.; + histos.fill(HIST("Rec/hnchAll_bf_cut"), nchAllBfCut); + histos.fill(HIST("Rec/hTPCchi2perCluster_before"), track.tpcChi2NCl()); + histos.fill(HIST("Rec/hITSchi2perCluster_before"), track.itsChi2NCl()); + histos.fill(HIST("Rec/hTPCCrossedrows_before"), track.tpcNClsCrossedRows()); + + if (std::fabs(track.eta()) <= cEtacut) { + nchEta++; + histos.fill(HIST("Rec/hnchTrue"), nchEta); + } + if (track.pt() >= cPtmincut && track.pt() <= cPtmaxcut) { + nchPt += 1.; + histos.fill(HIST("Rec/hnchTrue_pt"), nchPt); + } + if (!track.isGlobalTrack()) + continue; + if (std::fabs(track.eta()) > cEtacut) + continue; + if ((track.pt() <= cPtmincut) || (track.pt() >= cPtmaxcut)) + continue; + if (track.sign() == 0) + continue; + // if (std::fabs(track.y()) > 0.5) continue; + histos.fill(HIST("hPt_rec"), track.pt()); + histos.fill(HIST("hEta_rec"), track.eta()); + + auto mcParticle = track.mcParticle(); + nchAll += 1.; + histos.fill(HIST("Rec/hnchAll"), nchAll); + histos.fill(HIST("ptHistogram_allcharge_rec"), track.pt()); + histos.fill(HIST("Rec/hDCAxy"), track.dcaXY()); + histos.fill(HIST("Rec/hDCAz"), track.dcaZ()); + histos.fill(HIST("Rec/hTPCCrossedrows_after"), track.tpcNClsCrossedRows()); + histos.fill(HIST("Rec/hTPCchi2perCluster_after"), track.tpcChi2NCl()); + histos.fill(HIST("Rec/hITSchi2perCluster_after"), track.itsChi2NCl()); + histos.fill(HIST("Rec/hP"), track.p()); + histos.fill(HIST("Rec/hPt"), track.pt()); + histos.fill(HIST("Rec/hEta"), track.eta()); + histos.fill(HIST("Rec/hPtDCAxy"), track.pt(), track.dcaXY()); + histos.fill(HIST("Rec/hPtDCAz"), track.pt(), track.dcaZ()); + histos.fill(HIST("Rec/hPtEta"), track.pt(), track.eta()); + histos.fill(HIST("Rec/hPEta"), track.p(), track.eta()); + histos.fill(HIST("Rec/hNsigmaTPC"), track.p(), track.tpcNSigmaPr()); + + if (track.pt() >= cPtmincut || track.pt() <= cPtmaxcut) // do not change this (it is for different pt work) + { + nch += 1.; q1Old += track.pt(); q2Old += (track.pt() * track.pt()); histos.fill(HIST("Rec/hnch"), nch); - } - q1 += track.pt(); - q2 += (track.pt() * track.pt()); + } + q1 += track.pt(); + q2 += (track.pt() * track.pt()); - - if (std::abs(mcParticle.pdgCode()) == PDG_t::kPiPlus) histos.fill(HIST("ptHistogramPionrec_pdg"), track.pt()); - if (std::abs(mcParticle.pdgCode()) == PDG_t::kKPlus) histos.fill(HIST("ptHistogramKaonrec_pdg"),track.pt()); - if (std::abs(mcParticle.pdgCode()) == PDG_t::kProton) histos.fill(HIST("ptHistogramProtonrec_pdg"), track.pt()); + if (std::abs(mcParticle.pdgCode()) == PDG_t::kPiPlus) + histos.fill(HIST("ptHistogramPionrec_pdg"), track.pt()); + if (std::abs(mcParticle.pdgCode()) == PDG_t::kKPlus) + histos.fill(HIST("ptHistogramKaonrec_pdg"), track.pt()); + if (std::abs(mcParticle.pdgCode()) == PDG_t::kProton) + histos.fill(HIST("ptHistogramProtonrec_pdg"), track.pt()); - if (cfgRejEl == false && rejEl(track)) { return; } + if (cfgRejEl == false && rejEl(track)) { + return; + } // only TPC tracks: Pion, Kaon, Proton if (track.hasTPC() && std::abs(track.tpcNSigmaPi()) < cNSigCut3) @@ -879,9 +954,9 @@ Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; if (track.hasTPC() && std::abs(track.tpcNSigmaKa()) < cNSigCut3) histos.fill(HIST("Rec/NSigamaTPCkaon"), track.pt(), track.tpcNSigmaKa()); if (track.hasTPC() && std::abs(track.tpcNSigmaPr()) < cNSigCut3) - histos.fill(HIST("Rec/NSigamaTPCproton"), track.pt(), track.tpcNSigmaPr()); - - // only TOF tracks: Pion, Kaon, Proton + histos.fill(HIST("Rec/NSigamaTPCproton"), track.pt(), track.tpcNSigmaPr()); + + // only TOF tracks: Pion, Kaon, Proton if (track.hasTOF() && std::abs(track.tofNSigmaPi()) < cNSigCut3) histos.fill(HIST("Rec/NSigamaTOFpion"), track.pt(), track.tofNSigmaPi()); if (track.hasTOF() && std::abs(track.tofNSigmaKa()) < cNSigCut3) @@ -889,10 +964,14 @@ Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; if (track.hasTOF() && std::abs(track.tofNSigmaPr()) < cNSigCut3) histos.fill(HIST("Rec/NSigamaTOFproton"), track.pt(), track.tofNSigmaPr()); - if (track.hasTPC()) histos.fill(HIST("Rec/hdEdx"), track.p(), track.tpcSignal()); - if (track.hasTOF()) histos.fill(HIST("Rec/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()); + if (track.hasTPC()) + histos.fill(HIST("Rec/hdEdx"), track.p(), track.tpcSignal()); + if (track.hasTOF()) + histos.fill(HIST("Rec/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)) { @@ -902,10 +981,11 @@ Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; histos.fill(HIST("Rec/hTOFbeta_afterselection"), track.p(), track.beta()); } - if(selPion(track)) - { - if (std::fabs(track.y()) > cRapidityCut05) continue; - if (track.beta() > 1) continue; + if (selPion(track)) { + if (std::fabs(track.y()) > cRapidityCut05) + continue; + if (track.beta() > 1) + continue; histos.fill(HIST("ptHistogramPionrec"), track.pt()); histos.fill(HIST("Rec/hPtPion"), track.pt()); histos.fill(HIST("Rec/hEtaPion"), track.eta()); @@ -916,27 +996,29 @@ Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; histos.fill(HIST("NSigamaTPCTOFpion_rec"), track.tpcNSigmaPi(), track.tofNSigmaPi()); 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()); } + 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)); - } + } -//===========================kaon=============================================================== + //===========================kaon=============================================================== - if ((track.hasTPC() && std::abs(track.tpcNSigmaKa()) < cNSigCut3) && (track.hasTOF() && std::abs(track.tofNSigmaKa()) < cNSigCut3)) { + if ((track.hasTPC() && std::abs(track.tpcNSigmaKa()) < cNSigCut3) && (track.hasTOF() && std::abs(track.tofNSigmaKa()) < cNSigCut3)) { histos.fill(HIST("Rec/NSigamaTPCTOFkaon"), track.tpcNSigmaKa(), track.tofNSigmaKa()); histos.fill(HIST("Rec/hdEdx_afterselection"), track.p(), track.tpcSignal()); histos.fill(HIST("Rec/hTOFbeta_afterselection"), track.p(), track.beta()); } - if(selKaon(track)) - { - if (std::fabs(track.y()) > cRapidityCut05) continue; - if (track.beta() > 1) continue; + if (selKaon(track)) { + if (std::fabs(track.y()) > cRapidityCut05) + continue; + if (track.beta() > 1) + continue; histos.fill(HIST("ptHistogramKaonrec"), track.pt()); histos.fill(HIST("Rec/hPtKaon"), track.pt()); histos.fill(HIST("Rec/hEtaKaon"), track.eta()); @@ -947,27 +1029,29 @@ Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; histos.fill(HIST("NSigamaTPCTOFkaon_rec"), track.tpcNSigmaKa(), track.tofNSigmaKa()); 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()); } + 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)); - } + } - //============================proton=========================================================== + //============================proton=========================================================== - if ((track.hasTPC() && std::abs(track.tpcNSigmaPr()) < cNSigCut3) && (track.hasTOF() && std::abs(track.tofNSigmaPr()) < cNSigCut3)) { + if ((track.hasTPC() && std::abs(track.tpcNSigmaPr()) < cNSigCut3) && (track.hasTOF() && std::abs(track.tofNSigmaPr()) < cNSigCut3)) { histos.fill(HIST("Rec/NSigamaTPCTOFproton"), track.tpcNSigmaPr(), track.tofNSigmaPr()); histos.fill(HIST("Rec/hdEdx_afterselection"), track.p(), track.tpcSignal()); histos.fill(HIST("Rec/hTOFbeta_afterselection"), track.p(), track.beta()); } - if(selProton(track)) - { - if (std::fabs(track.y()) > cRapidityCut05) continue; - if (track.beta() > 1) continue; + if (selProton(track)) { + if (std::fabs(track.y()) > cRapidityCut05) + continue; + if (track.beta() > 1) + continue; histos.fill(HIST("ptHistogramProtonrec"), track.pt()); histos.fill(HIST("Rec/hPtProton"), track.pt()); histos.fill(HIST("Rec/hEtaProton"), track.eta()); @@ -978,60 +1062,61 @@ Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; histos.fill(HIST("NSigamaTPCTOFproton_rec"), track.tpcNSigmaPr(), track.tofNSigmaPr()); 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()); } + 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("Rec/hcent_nacc"), cent, nchAll); - - if (nch >= cTwoPtlCut2) - { - var1Old = (q1Old * q1Old - q2Old) / (nch * (nch - 1)); - var2Old = (q1Old / nch); - } - if (nchAll < cTwoPtlCut2) return; - var1 = (q1 * q1 - q2) / (nchAll * (nchAll - 1)); - var2 = (q1 / nchAll); - - histos.fill(HIST("Rec/hVar1"), sample, cent, var1); - histos.fill(HIST("Rec/hVar2"), sample, cent, var2); - histos.fill(HIST("Rec/hVarc"), sample, cent); - histos.fill(HIST("Rec/hVar2meanpt"), cent, var2); + } + + } // loop over tracks + histos.fill(HIST("Rec/hcent_nacc"), cent, nchAll); + + if (nch >= cTwoPtlCut2) { + var1Old = (q1Old * q1Old - q2Old) / (nch * (nch - 1)); + var2Old = (q1Old / nch); + } + if (nchAll < cTwoPtlCut2) + return; + var1 = (q1 * q1 - q2) / (nchAll * (nchAll - 1)); + var2 = (q1 / nchAll); + + histos.fill(HIST("Rec/hVar1"), sample, cent, var1); + histos.fill(HIST("Rec/hVar2"), sample, cent, var2); + histos.fill(HIST("Rec/hVarc"), sample, cent); + histos.fill(HIST("Rec/hVar2meanpt"), cent, var2); twoParAllCharge = (var1 - var2); histos.fill(HIST("Rec/hVar"), nchAll, twoParAllCharge); //---------------------- pions ---------------------------------------- - if (nchPi >= cTwoPtlCut2) { + if (nchPi >= cTwoPtlCut2) { var1Pi = (q1Pi * q1Pi - q2Pi) / (nchPi * (nchPi - 1)); var2Pi = (q1Pi / nchPi); - } + } //----------------------- kaons --------------------------------------- - if (nchKa >= cTwoPtlCut2) { + if (nchKa >= cTwoPtlCut2) { var1Ka = (q1Ka * q1Ka - q2Ka) / (nchKa * (nchKa - 1)); var2Ka = (q1Ka / nchKa); - } + } //---------------------------- protons ---------------------------------- - if (nchPr >= cTwoPtlCut2) { + if (nchPr >= cTwoPtlCut2) { var1Pr = (q1Pr * q1Pr - q2Pr) / (nchPr * (nchPr - 1)); var2Pr = (q1Pr / nchPr); - } - //========================centrality========================================== - - histos.fill(HIST("Rec/hVar1pi"), sample, cent, var1Pi); - histos.fill(HIST("Rec/hVar2pi"), sample, cent, var2Pi); - histos.fill(HIST("Rec/hVar2meanptpi"), cent, var2Pi); - histos.fill(HIST("Rec/hVar1k"), sample, cent, var1Ka); - histos.fill(HIST("Rec/hVar2k"), sample, cent, var2Ka); - histos.fill(HIST("Rec/hVar2meanptk"), cent, var2Ka); - histos.fill(HIST("Rec/hVar1p"), sample, cent, var1Pr); - histos.fill(HIST("Rec/hVar2p"), sample, cent, var2Pr); - histos.fill(HIST("Rec/hVar2meanptp"), cent, var2Pr); + } + //========================centrality========================================== + + histos.fill(HIST("Rec/hVar1pi"), sample, cent, var1Pi); + histos.fill(HIST("Rec/hVar2pi"), sample, cent, var2Pi); + histos.fill(HIST("Rec/hVar2meanptpi"), cent, var2Pi); + histos.fill(HIST("Rec/hVar1k"), sample, cent, var1Ka); + histos.fill(HIST("Rec/hVar2k"), sample, cent, var2Ka); + histos.fill(HIST("Rec/hVar2meanptk"), cent, var2Ka); + histos.fill(HIST("Rec/hVar1p"), sample, cent, var1Pr); + histos.fill(HIST("Rec/hVar2p"), sample, cent, var2Pr); + histos.fill(HIST("Rec/hVar2meanptp"), cent, var2Pr); //-----------------------nch------------------------------------- histos.fill(HIST("Rec/hVar1x"), sample, nchAll, var1); @@ -1049,110 +1134,112 @@ Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; histos.fill(HIST("Rec/hVar1px"), sample, nchAll, var1Pr); histos.fill(HIST("Rec/hVar2px"), sample, nchAll, var2Pr); histos.fill(HIST("Rec/hVarpx"), sample, nchPr); - histos.fill(HIST("Rec/hVar2meanptpx"), nchAll, var2Pr); + histos.fill(HIST("Rec/hVar2meanptpx"), nchAll, var2Pr); -//================= generated level============================== - - const auto& mccolgen = coll.mcCollision_as(); - if (std::abs(mccolgen.posZ()) > cVtxZcut) { return; } + //================= generated level============================== + + const auto& mccolgen = coll.mcCollision_as(); + if (std::abs(mccolgen.posZ()) > cVtxZcut) { + return; + } const auto& mcpartgen = mcParticles.sliceByCached(aod::mcparticle::mcCollisionId, mccolgen.globalIndex(), cache); histos.fill(HIST("hVtxZ_after_gen"), mccolgen.posZ()); double nchGen = 0., nchGenAll = 0., nchGenTrue = 0.; double nchPiGen = 0., nchKaGen = 0., nchPrGen = 0.; - double nch1 = 0., nch2 = 0., nch3 = 0.; + double nch1 = 0., nch2 = 0., nch3 = 0.; double q1AllGen = 0, q2AllGen = 0.; - double q1PiGen = 0, q2PiGen = 0, q1KaGen = 0, q2KaGen = 0, q1PrGen = 0, q2PrGen = 0 ; + double q1PiGen = 0, q2PiGen = 0, q1KaGen = 0, q2KaGen = 0, q1PrGen = 0, q2PrGen = 0; double var1AllGen = 0, var2AllGen = 0.; double var1PiGen = 0, var2PiGen = 0, var1KaGen = 0, var2KaGen = 0, var1PrGen = 0, var2PrGen = 0; - - int sampleGen = histos.get(HIST("hVtxZ_after_gen"))->GetEntries(); - sampleGen = sampleGen % 30; - - for (const auto& mcpart:mcpartgen){ - //auto pdgcode = std::abs(mcpart.pdgCode()); - if(!mcpart.isPhysicalPrimary()) {continue;} - nch1++ ; - histos.fill(HIST("hnch1"), nch1); -// if (!(pdgcode == 211 || pdgcode == 321 || pdgcode == 2212 || pdgcode == -211 || pdgcode == -321 || pdgcode == -2212 || pdgcode == 11 || pdgcode == 13)) continue; - nch2++ ; - histos.fill(HIST("hnch2"), nch2); - nch3++ ; - histos.fill(HIST("hnch3"), nch3); - - int pid = mcpart.pdgCode(); - auto sign = 0; - auto* pd = pdg->GetParticle(pid); - if (pd != nullptr) { - sign = pd->Charge()/3.; - } - if (sign == 0 ) { continue;} -// histos.fill(HIST("gen_hSign"), sign); - if (std::fabs(mcpart.eta()) > cEtacut) continue; - nchGenTrue++; - histos.fill(HIST("hnch_gen_true"), nchGenTrue); - if ((mcpart.pt() <= cPtmincut) || (mcpart.pt() >= cPtmaxcut)) continue; - histos.fill(HIST("hPt_gen"), mcpart.pt()); - histos.fill(HIST("hEta_gen"), mcpart.eta()); - histos.fill(HIST("ptHistogram_allcharge_gen"), mcpart.pt()); - nchGenAll += 1.; - q1AllGen += mcpart.pt(); - q2AllGen += (mcpart.pt() * mcpart.pt()); - histos.fill(HIST("hnch_gen_all"), nchGenAll); - if (std::fabs(mcpart.y()) < cRapidityCut05) - { - - if (mcpart.pdgCode() == PDG_t::kPiPlus || mcpart.pdgCode() == PDG_t::kPiMinus) - { - histos.fill(HIST("ptHistogramPion"), mcpart.pt()); - nchPiGen += 1.; - q1PiGen += mcpart.pt(); - q2PiGen += (mcpart.pt() * mcpart.pt()); - histos.fill(HIST("hnch_pi"), nchPiGen); + + int sampleGen = histos.get(HIST("hVtxZ_after_gen"))->GetEntries(); + sampleGen = sampleGen % 30; + + for (const auto& mcpart : mcpartgen) { + // auto pdgcode = std::abs(mcpart.pdgCode()); + if (!mcpart.isPhysicalPrimary()) { + continue; + } + nch1++; + histos.fill(HIST("hnch1"), nch1); + // if (!(pdgcode == 211 || pdgcode == 321 || pdgcode == 2212 || pdgcode == -211 || pdgcode == -321 || pdgcode == -2212 || pdgcode == 11 || pdgcode == 13)) continue; + nch2++; + histos.fill(HIST("hnch2"), nch2); + nch3++; + histos.fill(HIST("hnch3"), nch3); + + int pid = mcpart.pdgCode(); + auto sign = 0; + auto* pd = pdg->GetParticle(pid); + if (pd != nullptr) { + sign = pd->Charge() / 3.; + } + if (sign == 0) { + continue; + } + // histos.fill(HIST("gen_hSign"), sign); + if (std::fabs(mcpart.eta()) > cEtacut) + continue; + nchGenTrue++; + histos.fill(HIST("hnch_gen_true"), nchGenTrue); + if ((mcpart.pt() <= cPtmincut) || (mcpart.pt() >= cPtmaxcut)) + continue; + histos.fill(HIST("hPt_gen"), mcpart.pt()); + histos.fill(HIST("hEta_gen"), mcpart.eta()); + histos.fill(HIST("ptHistogram_allcharge_gen"), mcpart.pt()); + nchGenAll += 1.; + q1AllGen += mcpart.pt(); + q2AllGen += (mcpart.pt() * mcpart.pt()); + histos.fill(HIST("hnch_gen_all"), nchGenAll); + if (std::fabs(mcpart.y()) < cRapidityCut05) { + + if (mcpart.pdgCode() == PDG_t::kPiPlus || mcpart.pdgCode() == PDG_t::kPiMinus) { + histos.fill(HIST("ptHistogramPion"), mcpart.pt()); + 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()); - nchKaGen += 1.; - q1KaGen += mcpart.pt(); - q2KaGen += (mcpart.pt() * mcpart.pt()); - histos.fill(HIST("hnch_ka"), nchKaGen); + if (mcpart.pdgCode() == PDG_t::kKPlus || mcpart.pdgCode() == PDG_t::kKMinus) { + histos.fill(HIST("ptHistogramKaon"), mcpart.pt()); + 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()); - nchPrGen += 1.; - q1PrGen += mcpart.pt(); - q2PrGen += (mcpart.pt() * mcpart.pt()); - histos.fill(HIST("hnch_pr"), nchPrGen); + if (mcpart.pdgCode() == PDG_t::kProton || mcpart.pdgCode() == PDG_t::kProtonBar) { + histos.fill(HIST("ptHistogramProton"), mcpart.pt()); + nchPrGen += 1.; + q1PrGen += mcpart.pt(); + q2PrGen += (mcpart.pt() * mcpart.pt()); + histos.fill(HIST("hnch_pr"), nchPrGen); } - - }//|y| < 0.5 cut ends! - }//particle - histos.fill(HIST("hcent_nacc_gen"), cent, nchGen); - - if (nchGenAll < cTwoPtlCut2) return; - var1AllGen = (q1AllGen * q1AllGen - q2AllGen) / (nchGenAll * (nchGenAll - 1)); - var2AllGen = (q1AllGen / nchGenAll); + } //|y| < 0.5 cut ends! - if (nchPiGen >= cTwoPtlCut2) - { + } // particle + histos.fill(HIST("hcent_nacc_gen"), cent, nchGen); + + if (nchGenAll < cTwoPtlCut2) + return; + var1AllGen = (q1AllGen * q1AllGen - q2AllGen) / (nchGenAll * (nchGenAll - 1)); + var2AllGen = (q1AllGen / nchGenAll); + + if (nchPiGen >= cTwoPtlCut2) { var1PiGen = (q1PiGen * q1PiGen - q2PiGen) / (nchPiGen * (nchPiGen - 1)); var2PiGen = (q1PiGen / nchPiGen); } //----------------------- kaons --------------------------------------- - if (nchKaGen >= cTwoPtlCut2) - { + if (nchKaGen >= cTwoPtlCut2) { var1KaGen = (q1KaGen * q1KaGen - q2KaGen) / (nchKaGen * (nchKaGen - 1)); var2KaGen = (q1KaGen / nchKaGen); } //---------------------------- protons ---------------------------------- - if (nchPrGen >= cTwoPtlCut2) - { + if (nchPrGen >= cTwoPtlCut2) { var1PrGen = (q1PrGen * q1PrGen - q2PrGen) / (nchPrGen * (nchPrGen - 1)); var2PrGen = (q1PrGen / nchPrGen); } @@ -1174,8 +1261,8 @@ Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; histos.fill(HIST("hVarpx_gen"), sampleGen, nchPrGen); histos.fill(HIST("hVar2meanptpx_gen"), nchGenAll, var2PrGen); - } //void process -PROCESS_SWITCH(EventMeanPtId, processMcReco, "Process reconstructed", true); + } // void process + PROCESS_SWITCH(EventMeanPtId, processMcReco, "Process reconstructed", true); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) @@ -1183,5 +1270,3 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) WorkflowSpec workflow{adaptAnalysisTask(cfgc)}; return workflow; } - -