diff --git a/PWGCF/EbyEFluctuations/Tasks/nchCumulantsId.cxx b/PWGCF/EbyEFluctuations/Tasks/nchCumulantsId.cxx index 32800bfb680..c10ece98349 100644 --- a/PWGCF/EbyEFluctuations/Tasks/nchCumulantsId.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/nchCumulantsId.cxx @@ -9,10 +9,11 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// \file nchCumulantsId.cxx +/// \file NchCumulantsId.cxx /// \brief Event by Event conserved charges fluctuations /// \author Pravata Panigrahi :: Sadhana Dash(sadhana@phy.iitb.ac.in) +#include "Common/CCDB/EventSelectionParams.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" @@ -20,28 +21,19 @@ #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include +#include "CCDB/BasicCCDBManager.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/HistogramSpec.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "Framework/runDataProcessing.h" + #include -#include -#include -#include -#include +#include #include -#include #include using namespace o2; @@ -113,18 +105,14 @@ struct NchCumulantsId { Configurable cfgCutEta{"cfgCutEta", 0.8, "cut for eta"}; Configurable cfgCutPtMax{"cfgCutPtMax", 3.0, "max cut for pT"}; Configurable cfgCutPtMin{"cfgCutPtMin", 0.15, "min cut for pT"}; - Configurable netChBin{"netChBin", 160, "bins for netch"}; - Configurable netChMax{"netChMax", 80.0, "max for netch"}; - Configurable netChMin{"netChMin", -80.0, "min for netch"}; - Configurable chBins{"chBins", 501, "bins for ch"}; - Configurable chMax{"chMax", 500.0, "max for ch"}; - Configurable chMin{"chMin", -1.0, "min for ch"}; - Configurable midRapMax{"midRapMax", 1000.0, "max for midrapmult"}; - Configurable midRapBins{"midRapBins", 1001, "bins for midrapmult"}; Configurable checkCollPosZMc{"checkCollPosZMc", false, "checkCollPosZMc"}; Configurable flagUnusedVariableError{"flagUnusedVariableError", false, "flagUnusedVariableError"}; + Configurable cfgEvSel01doNoSameBunchPileup{"cfgEvSel01doNoSameBunchPileup", true, "apply kNoSameBunchPileup"}; + Configurable cfgEvSel02doIsGoodZvtxFT0vsPV{"cfgEvSel02doIsGoodZvtxFT0vsPV", true, "apply kIsGoodZvtxFT0vsPV"}; + Configurable cfgEvSel03doIsGoodITSLayersAll{"cfgEvSel03doIsGoodITSLayersAll", true, "apply kIsGoodITSLayersAll"}; + // Configurables for particle Identification Configurable cfgId01CheckVetoCut{"cfgId01CheckVetoCut", false, "cfgId01CheckVetoCut"}; Configurable cfgId02DoElRejection{"cfgId02DoElRejection", true, "cfgId02DoElRejection"}; @@ -133,31 +121,31 @@ struct NchCumulantsId { Configurable cfgId05DoTpcInnerParamId{"cfgId05DoTpcInnerParamId", false, "cfgId05DoTpcInnerParamId"}; Configurable cfgIdPi01ThrPforTOF{"cfgIdPi01ThrPforTOF", 0.7, "cfgIdPi01ThrPforTOF"}; - Configurable cfgIdPi02IdCutTypeLowP{"cfgIdPi02IdCutTypeLowP", 0, "cfgIdPi02IdCutTypeLowP"}; + Configurable cfgIdPi02IdCutTypeLowP{"cfgIdPi02IdCutTypeLowP", 1, "cfgIdPi02IdCutTypeLowP"}; Configurable cfgIdPi03NSigmaTPCLowP{"cfgIdPi03NSigmaTPCLowP", 2.0, "cfgIdPi03NSigmaTPCLowP"}; Configurable cfgIdPi04NSigmaTOFLowP{"cfgIdPi04NSigmaTOFLowP", 2.0, "cfgIdPi04NSigmaTOFLowP"}; Configurable cfgIdPi05NSigmaRadLowP{"cfgIdPi05NSigmaRadLowP", 4.0, "cfgIdPi05NSigmaRadLowP"}; - Configurable cfgIdPi06IdCutTypeHighP{"cfgIdPi06IdCutTypeHighP", 0, "cfgIdPi06IdCutTypeHighP"}; + Configurable cfgIdPi06IdCutTypeHighP{"cfgIdPi06IdCutTypeHighP", 1, "cfgIdPi06IdCutTypeHighP"}; Configurable cfgIdPi07NSigmaTPCHighP{"cfgIdPi07NSigmaTPCHighP", 2.0, "cfgIdPi07NSigmaTPCHighP"}; Configurable cfgIdPi08NSigmaTOFHighP{"cfgIdPi08NSigmaTOFHighP", 2.0, "cfgIdPi08NSigmaTOFHighP"}; Configurable cfgIdPi09NSigmaRadHighP{"cfgIdPi09NSigmaRadHighP", 4.0, "cfgIdPi09NSigmaRadHighP"}; Configurable cfgIdKa01ThrPforTOF{"cfgIdKa01ThrPforTOF", 0.8, "cfgIdKa01ThrPforTOF"}; - Configurable cfgIdKa02IdCutTypeLowP{"cfgIdKa02IdCutTypeLowP", 0, "cfgIdKa02IdCutTypeLowP"}; + Configurable cfgIdKa02IdCutTypeLowP{"cfgIdKa02IdCutTypeLowP", 1, "cfgIdKa02IdCutTypeLowP"}; Configurable cfgIdKa03NSigmaTPCLowP{"cfgIdKa03NSigmaTPCLowP", 2.0, "cfgIdKa03NSigmaTPCLowP"}; Configurable cfgIdKa04NSigmaTOFLowP{"cfgIdKa04NSigmaTOFLowP", 2.0, "cfgIdKa04NSigmaTOFLowP"}; Configurable cfgIdKa05NSigmaRadLowP{"cfgIdKa05NSigmaRadLowP", 4.0, "cfgIdKa05NSigmaRadLowP"}; - Configurable cfgIdKa06IdCutTypeHighP{"cfgIdKa06IdCutTypeHighP", 0, "cfgIdKa06IdCutTypeHighP"}; + Configurable cfgIdKa06IdCutTypeHighP{"cfgIdKa06IdCutTypeHighP", 1, "cfgIdKa06IdCutTypeHighP"}; Configurable cfgIdKa07NSigmaTPCHighP{"cfgIdKa07NSigmaTPCHighP", 2.0, "cfgIdKa07NSigmaTPCHighP"}; Configurable cfgIdKa08NSigmaTOFHighP{"cfgIdKa08NSigmaTOFHighP", 2.0, "cfgIdKa08NSigmaTOFHighP"}; Configurable cfgIdKa09NSigmaRadHighP{"cfgIdKa09NSigmaRadHighP", 4.0, "cfgIdKa09NSigmaRadHighP"}; Configurable cfgIdPr01ThrPforTOF{"cfgIdPr01ThrPforTOF", 0.8, "cfgIdPr01ThrPforTOF"}; - Configurable cfgIdPr02IdCutTypeLowP{"cfgIdPr02IdCutTypeLowP", 0, "cfgIdPr02IdCutTypeLowP"}; + Configurable cfgIdPr02IdCutTypeLowP{"cfgIdPr02IdCutTypeLowP", 1, "cfgIdPr02IdCutTypeLowP"}; Configurable cfgIdPr03NSigmaTPCLowP{"cfgIdPr03NSigmaTPCLowP", 2.0, "cfgIdPr03NSigmaTPCLowP"}; Configurable cfgIdPr04NSigmaTOFLowP{"cfgIdPr04NSigmaTOFLowP", 2.0, "cfgIdPr04NSigmaTOFLowP"}; Configurable cfgIdPr05NSigmaRadLowP{"cfgIdPr05NSigmaRadLowP", 4.0, "cfgIdPr05NSigmaRadLowP"}; - Configurable cfgIdPr06IdCutTypeHighP{"cfgIdPr06IdCutTypeHighP", 0, "cfgIdPr06IdCutTypeHighP"}; + Configurable cfgIdPr06IdCutTypeHighP{"cfgIdPr06IdCutTypeHighP", 1, "cfgIdPr06IdCutTypeHighP"}; Configurable cfgIdPr07NSigmaTPCHighP{"cfgIdPr07NSigmaTPCHighP", 2.0, "cfgIdPr07NSigmaTPCHighP"}; Configurable cfgIdPr08NSigmaTOFHighP{"cfgIdPr08NSigmaTOFHighP", 2.0, "cfgIdPr08NSigmaTOFHighP"}; Configurable cfgIdPr09NSigmaRadHighP{"cfgIdPr09NSigmaRadHighP", 4.0, "cfgIdPr09NSigmaRadHighP"}; @@ -245,16 +233,16 @@ struct NchCumulantsId { const AxisSpec axisTOFNSigma = {200, -10.0, 10.0, "n#sigma_{TOF}"}; const AxisSpec axisTOFExpMom = {200, 0.0f, 10.0f, "#it{p}_{tofExpMom} (GeV/#it{c})"}; - const AxisSpec axisNch(netChBin, netChMin, netChMax, "Net_charge_dN"); - const AxisSpec axisPosCh(chBins, chMin, chMax, "Pos_charge"); - const AxisSpec axisNegCh(chBins, chMin, chMax, "Neg_charge"); - const AxisSpec axisNt(midRapBins, chMin, midRapMax, "Mult_midRap_Nch"); - const AxisSpec axisPrCh(chBins, chMin, chMax, "Pr_charge"); - const AxisSpec axisAPrCh(chBins, chMin, chMax, "APr_charge"); - const AxisSpec axisKaCh(chBins, chMin, chMax, "Ka_charge"); - const AxisSpec axisAKaCh(chBins, chMin, chMax, "AKa_charge"); - const AxisSpec axisPiCh(chBins, chMin, chMax, "Pion_Positive"); - const AxisSpec axisAPiCh(chBins, chMin, chMax, "Pion_Negative"); + const AxisSpec axisNch(100, -50, 50, "Net_charge_dN"); + const AxisSpec axisPosCh(101, -1, 100, "Pos_charge"); + const AxisSpec axisNegCh(101, -1, 100, "Neg_charge"); + const AxisSpec axisNt(201, -1, 200, "Mult_midRap_Nch"); + const AxisSpec axisPrCh(101, -1, 100, "Pr_charge"); + const AxisSpec axisAPrCh(101, -1, 100, "APr_charge"); + const AxisSpec axisKaCh(101, -1, 100, "Ka_charge"); + const AxisSpec axisAKaCh(101, -1, 100, "AKa_charge"); + const AxisSpec axisPiCh(101, -1, 100, "Pion_Positive"); + const AxisSpec axisAPiCh(101, -1, 100, "Pion_Negative"); HistogramConfigSpec qnHist1({HistType::kTHnSparseD, {axisNch, axisPosCh, axisNegCh, axisPrCh, axisAPrCh, axisKaCh, axisAKaCh, axisNt, axisCent}}); HistogramConfigSpec qnHist2({HistType::kTHnSparseD, {axisNch, axisPosCh, axisNegCh, axisPiCh, axisAPiCh, axisKaCh, axisAKaCh, axisNt, axisCent}}); @@ -894,6 +882,28 @@ struct NchCumulantsId { fillIdentificationQA(hist, track); // Look at Proton } + // template + // void fillGenTrackQA(H& histReg, const T& mcTrack) + // { + // histReg.fill(HIST(HistRegDire2[Mode]) + HIST(PidDire[pidMode]) + HIST("h12_p"), mcTrack.p()); + // histReg.fill(HIST(HistRegDire2[Mode]) + HIST(PidDire[pidMode]) + HIST("h13_pt"), mcTrack.pt()); + // histReg.fill(HIST(HistRegDire2[Mode]) + HIST(PidDire[pidMode]) + HIST("h14_eta"), mcTrack.eta()); + // histReg.fill(HIST(HistRegDire2[Mode]) + HIST(PidDire[pidMode]) + HIST("h15_phi"), mcTrack.phi()); + // histReg.fill(HIST(HistRegDire2[Mode]) + HIST(PidDire[pidMode]) + HIST("h16_rapidity"), mcTrack.y()); + // histReg.fill(HIST(HistRegDire2[Mode]) + HIST(PidDire[pidMode]) + HIST("h20_pt_eta"), mcTrack.pt(), mcTrack.eta()); + // } + // + // template + // void fillRecoTrackQA(H& histReg, const T& track) + // { + // histReg.fill(HIST(HistRegDire2[Mode]) + HIST(PidDire[pidMode]) + HIST("h12_p"), track.p()); + // histReg.fill(HIST(HistRegDire2[Mode]) + HIST(PidDire[pidMode]) + HIST("h13_pt"), track.pt()); + // histReg.fill(HIST(HistRegDire2[Mode]) + HIST(PidDire[pidMode]) + HIST("h14_eta"), track.eta()); + // histReg.fill(HIST(HistRegDire2[Mode]) + HIST(PidDire[pidMode]) + HIST("h15_phi"), track.phi()); + // histReg.fill(HIST(HistRegDire2[Mode]) + HIST(PidDire[pidMode]) + HIST("h16_rapidity"), track.y()); + // histReg.fill(HIST(HistRegDire2[Mode]) + HIST(PidDire[pidMode]) + HIST("h20_pt_eta"), track.pt(), track.eta()); + // } + template void fillGenTrackQA(HistogramRegistry& r, const TrackType& t) { @@ -1026,12 +1036,27 @@ struct NchCumulantsId { using MyAllTracks = soa::Join; - using MyCollisions = soa::Join; + using MyCollisions = soa::Join; using MyTracksWithMclabels = soa::Join; - using MyCollisionsWithMcLabels = soa::Join; + using MyCollisionsWithMcLabels = soa::Join; + + template + bool isEventSelected(const CollisionType& col) + { + if (cfgEvSel01doNoSameBunchPileup && + !col.selection_bit(aod::evsel::kNoSameBunchPileup)) + return false; + if (cfgEvSel02doIsGoodZvtxFT0vsPV && + !col.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) + return false; + if (cfgEvSel03doIsGoodITSLayersAll && + !col.selection_bit(aod::evsel::kIsGoodITSLayersAll)) + return false; + return true; + } // tracks and collision filters Filter col = aod::evsel::sel8 == true; @@ -1081,6 +1106,8 @@ struct NchCumulantsId { if constexpr (analysisType == doDataProcessing) { for (const auto& col : collisions) { + if (!isEventSelected(col)) + continue; nP = 0; nM = 0; nCh = 0; @@ -1171,6 +1198,8 @@ struct NchCumulantsId { LOG(warning) << "No MC collision for this collision, skip..."; continue; } + if (!isEventSelected(col)) + continue; float nP = 0; float nM = 0; float nCh = 0; @@ -1297,6 +1326,8 @@ struct NchCumulantsId { LOG(warning) << "No MC collision for this event, skip..."; continue; } + if (!isEventSelected(col)) + continue; const auto& mcColl = col.mcCollision(); // ---- apply same Vz cut as data/reco ---- @@ -1330,6 +1361,7 @@ struct NchCumulantsId { int pdg = mcTrack.pdgCode(); if (pdg == kPiPlus || pdg == kKPlus || pdg == kProton || pdg == kPositron || pdg == kMuonPlus || pdg == kDeuteron) { + // fillGenTrackQA(genAnalysis, mcTrack); nP++; genAnalysis.fill(HIST("genAnalysis/Charge/Pos/h12_p"), mcTrack.p()); @@ -1339,6 +1371,7 @@ struct NchCumulantsId { genAnalysis.fill(HIST("genAnalysis/Charge/Pos/h16_rapidity"), mcTrack.y()); genAnalysis.fill(HIST("genAnalysis/Charge/Pos/h20_pt_eta"), mcTrack.pt(), mcTrack.eta()); } else if (pdg == kPiMinus || pdg == kKMinus || pdg == kProtonBar || pdg == kElectron || pdg == kMuonMinus || pdg == -kDeuteron) { + // fillGenTrackQA(genAnalysis, mcTrack); nM++; genAnalysis.fill(HIST("genAnalysis/Charge/Neg/h12_p"), mcTrack.p()); @@ -1350,21 +1383,27 @@ struct NchCumulantsId { } // ----- Pions ----- if (pdg == kPiPlus) { + // fillGenTrackQA(genAnalysis, mcTrack); nPi++; fillGenTrackQA(genAnalysis, mcTrack); } else if (pdg == kPiMinus) { + // fillGenTrackQA(genAnalysis, mcTrack); nAPi++; fillGenTrackQA(genAnalysis, mcTrack); } else if (pdg == kKPlus) { + // fillGenTrackQA(genAnalysis, mcTrack); nKa++; fillGenTrackQA(genAnalysis, mcTrack); } else if (pdg == kKMinus) { + // fillGenTrackQA(genAnalysis, mcTrack); nAKa++; fillGenTrackQA(genAnalysis, mcTrack); } else if (pdg == kProton) { + // fillGenTrackQA(genAnalysis, mcTrack); nPr++; fillGenTrackQA(genAnalysis, mcTrack); } else if (pdg == kProtonBar) { + // fillGenTrackQA(genAnalysis, mcTrack); nAPr++; fillGenTrackQA(genAnalysis, mcTrack); } @@ -1399,6 +1438,8 @@ struct NchCumulantsId { LOG(warning) << "No MC collision for this collision, skip..."; continue; } + if (!isEventSelected(col)) + continue; auto mcCollision = col.mcCollision(); if (checkCollPosZMc && std::abs(mcCollision.posZ()) > cfgCutPosZ) @@ -1429,6 +1470,7 @@ struct NchCumulantsId { int pdg = mcTrack.pdgCode(); if (pdg == kPiPlus || pdg == kKPlus || pdg == kProton || pdg == kPositron || pdg == kMuonPlus || pdg == kDeuteron) { + // fillGenTrackQA(genAnalysis, mcTrack); nPGen++; genAnalysis.fill(HIST("genAnalysis/Charge/Pos/h12_p"), mcTrack.p()); @@ -1438,6 +1480,7 @@ struct NchCumulantsId { genAnalysis.fill(HIST("genAnalysis/Charge/Pos/h16_rapidity"), mcTrack.y()); genAnalysis.fill(HIST("genAnalysis/Charge/Pos/h20_pt_eta"), mcTrack.pt(), mcTrack.eta()); } else if (pdg == kPiMinus || pdg == kKMinus || pdg == kProtonBar || pdg == kElectron || pdg == kMuonMinus || pdg == -kDeuteron) { + // fillGenTrackQA(genAnalysis, mcTrack); nMGen++; genAnalysis.fill(HIST("genAnalysis/Charge/Neg/h12_p"), mcTrack.p()); @@ -1447,23 +1490,29 @@ struct NchCumulantsId { genAnalysis.fill(HIST("genAnalysis/Charge/Neg/h16_rapidity"), mcTrack.y()); genAnalysis.fill(HIST("genAnalysis/Charge/Neg/h20_pt_eta"), mcTrack.pt(), mcTrack.eta()); } - + // ----- Pions ----- if (pdg == kPiPlus) { + // fillGenTrackQA(genAnalysis, mcTrack); nPiGen++; fillGenTrackQA(genAnalysis, mcTrack); } else if (pdg == kPiMinus) { + // fillGenTrackQA(genAnalysis, mcTrack); nAPiGen++; fillGenTrackQA(genAnalysis, mcTrack); } else if (pdg == kKPlus) { + // fillGenTrackQA(genAnalysis, mcTrack); nKaGen++; fillGenTrackQA(genAnalysis, mcTrack); } else if (pdg == kKMinus) { + // fillGenTrackQA(genAnalysis, mcTrack); nAKaGen++; fillGenTrackQA(genAnalysis, mcTrack); } else if (pdg == kProton) { + // fillGenTrackQA(genAnalysis, mcTrack); nPrGen++; fillGenTrackQA(genAnalysis, mcTrack); } else if (pdg == kProtonBar) { + // fillGenTrackQA(genAnalysis, mcTrack); nAPrGen++; fillGenTrackQA(genAnalysis, mcTrack); } @@ -1584,23 +1633,20 @@ struct NchCumulantsId { } // purity check - check pdg aginst sign bool purityPion = false; + bool purityKaon = false; + bool purityProton = false; + if (trackIsPion) { if (track.sign() > 0 && pdg == kPiPlus) purityPion = true; if (track.sign() < 0 && pdg == kPiMinus) purityPion = true; - } - - bool purityKaon = false; - if (trackIsKaon) { + } else if (trackIsKaon) { if (track.sign() > 0 && pdg == kKPlus) purityKaon = true; if (track.sign() < 0 && pdg == kKMinus) purityKaon = true; - } - - bool purityProton = false; - if (trackIsProton) { + } else if (trackIsProton) { if (track.sign() > 0 && pdg == kProton) purityProton = true; if (track.sign() < 0 && pdg == kProtonBar)