diff --git a/PWGCF/Flow/Tasks/flowDeltav1SP.cxx b/PWGCF/Flow/Tasks/flowDeltav1SP.cxx index b07aa658d23..c1c8f334332 100644 --- a/PWGCF/Flow/Tasks/flowDeltav1SP.cxx +++ b/PWGCF/Flow/Tasks/flowDeltav1SP.cxx @@ -74,13 +74,14 @@ using namespace o2::aod::rctsel; #define O2_DEFINE_CONFIGURABLE(NAME, TYPE, DEFAULT, HELP) Configurable NAME{#NAME, DEFAULT, HELP}; // Function to make linear bins for momentum -inline std::vector make_arange(double start, double stop, double step) { - const int n = std::round((stop - start) / step) + 1; - std::vector res(n); - for (int i = 0; i < n; ++i) { - res[i] = start + i * step; - } - return res; +inline std::vector make_arange(double start, double stop, double step) +{ + const int n = std::round((stop - start) / step) + 1; + std::vector res(n); + for (int i = 0; i < n; ++i) { + res[i] = start + i * step; + } + return res; } struct FlowDeltav1SP { @@ -103,7 +104,7 @@ struct FlowDeltav1SP { O2_DEFINE_CONFIGURABLE(cEvSelsIsGoodITSLayersAll, bool, true, "Cut time intervals with dead ITS staves"); O2_DEFINE_CONFIGURABLE(cEvSelsIsGoodITSLayer0123, bool, false, "Cut time intervals with dead ITS staves"); - // QA Plots + // QA Plots O2_DEFINE_CONFIGURABLE(cFillEventQA, bool, false, "Fill histograms for event QA"); O2_DEFINE_CONFIGURABLE(cFillTrackQA, bool, false, "Fill histograms for track QA"); O2_DEFINE_CONFIGURABLE(cFillPIDQA, bool, true, "Fill histograms for PID QA"); @@ -114,7 +115,7 @@ struct FlowDeltav1SP { O2_DEFINE_CONFIGURABLE(cFillMeanPTextra, bool, false, "Fill histograms for mean PX/PT extra"); O2_DEFINE_CONFIGURABLE(cUseCentAveragePt, bool, false, "Use in 1% centrality intervals and not cent average"); O2_DEFINE_CONFIGURABLE(cFillWithMCParticle, bool, false, "Fill histograms with MCParticle instead of Track"); - // Flags to make and fill histograms + // Flags to make and fill histograms O2_DEFINE_CONFIGURABLE(cFillGeneralV1Histos, bool, true, "Fill histograms for vn analysis"); O2_DEFINE_CONFIGURABLE(cFillMixedHarmonics, bool, false, "Flag to make and fill histos for mixed harmonics"); O2_DEFINE_CONFIGURABLE(cFillEventPlane, bool, false, "Flag to make and fill histos with Event Plane"); @@ -122,12 +123,12 @@ struct FlowDeltav1SP { O2_DEFINE_CONFIGURABLE(cFillChargeDependence, bool, true, "Flag to make and fill histos for charge dependent flow"); O2_DEFINE_CONFIGURABLE(cFillChargeDependenceQA, bool, true, "Flag to make and fill QA histos for charge dependent flow"); O2_DEFINE_CONFIGURABLE(cFillPID, bool, true, "Flag to make and fill histos for PID flow"); - // Centrality Estimators -> standard is FT0C + // Centrality Estimators -> standard is FT0C O2_DEFINE_CONFIGURABLE(cCentFT0Cvariant1, bool, false, "Set centrality estimator to CentFT0Cvariant1"); O2_DEFINE_CONFIGURABLE(cCentFT0M, bool, false, "Set centrality estimator to CentFT0M"); O2_DEFINE_CONFIGURABLE(cCentFV0A, bool, false, "Set centrality estimator to CentFV0A"); O2_DEFINE_CONFIGURABLE(cCentNGlobal, bool, false, "Set centrality estimator to CentNGlobal"); - // Standard selections + // Standard selections O2_DEFINE_CONFIGURABLE(cTrackSelsDCAxy, float, 0.2, "Cut on DCA in the transverse direction (cm)"); O2_DEFINE_CONFIGURABLE(cTrackSelsDCAz, float, 0.2, "Cut on DCA in the longitudinal direction (cm)"); O2_DEFINE_CONFIGURABLE(cTrackSelsNcls, float, 70, "Cut on number of TPC clusters found"); @@ -141,7 +142,7 @@ struct FlowDeltav1SP { O2_DEFINE_CONFIGURABLE(cCentMin, float, 0, "Minimum cenrality for selected events"); O2_DEFINE_CONFIGURABLE(cCentMax, float, 90, "Maximum cenrality for selected events"); O2_DEFINE_CONFIGURABLE(cFilterLeptons, bool, true, "Filter out leptons from MCGenerated by requiring |pdgCode| > 100"); - // NUA and NUE weights + // NUA and NUE weights O2_DEFINE_CONFIGURABLE(cFillWeights, bool, true, "Fill NUA weights"); O2_DEFINE_CONFIGURABLE(cFillWeightsPOS, bool, true, "Fill NUA weights only for positive charges"); O2_DEFINE_CONFIGURABLE(cFillWeightsNEG, bool, true, "Fill NUA weights only for negative charges"); @@ -150,7 +151,7 @@ struct FlowDeltav1SP { O2_DEFINE_CONFIGURABLE(cUseNUE2D, bool, false, "Use 2D NUE weights"); O2_DEFINE_CONFIGURABLE(cUseNUE3D, bool, true, "Use 3D NUE weights (pt, eta, centrality)"); O2_DEFINE_CONFIGURABLE(cUseNUE2Deta, bool, false, "Use 2D NUE weights TRUE: (pt and eta) FALSE: (pt and centrality)"); - // Additional track Selections + // Additional track Selections O2_DEFINE_CONFIGURABLE(cTrackSelsUseAdditionalTrackCut, bool, false, "Bool to enable Additional Track Cut"); O2_DEFINE_CONFIGURABLE(cTrackSelsDoDCApt, bool, true, "Apply Pt dependent DCAz cut"); O2_DEFINE_CONFIGURABLE(cTrackSelsDCApt1, float, 0.1, "DcaZ < const + (a * b) / pt^1.1 -> this sets a"); @@ -158,10 +159,10 @@ struct FlowDeltav1SP { O2_DEFINE_CONFIGURABLE(cTrackSelsDCAptConsMin, float, 0.1, "DcaZ < const + (a * b) / pt^1.1 -> this sets const"); O2_DEFINE_CONFIGURABLE(cTrackSelsPIDNsigma, float, 2.0, "nSigma cut for PID"); O2_DEFINE_CONFIGURABLE(cTrackSelDoTrackQAvsCent, bool, true, "Do track selection QA plots as function of centrality"); - // harmonics for v coefficients + // harmonics for v coefficients O2_DEFINE_CONFIGURABLE(cHarm, int, 1, "Flow harmonic n for ux and uy: (Cos(n*phi), Sin(n*phi))"); O2_DEFINE_CONFIGURABLE(cHarmMixed, int, 2, "Flow harmonic n for ux and uy in mixed harmonics (MH): (Cos(n*phi), Sin(n*phi))"); - // settings for CCDB data + // settings for CCDB data O2_DEFINE_CONFIGURABLE(cCCDBdir_QQ, std::string, "Users/c/ckoster/ZDC/LHC23_PbPb_pass5/meanQQ/Default", "ccdb dir for average QQ values in 1% centrality bins"); O2_DEFINE_CONFIGURABLE(cCCDBdir_SP, std::string, "", "ccdb dir for average event plane resolution in 1% centrality bins"); O2_DEFINE_CONFIGURABLE(cCCDB_NUA, std::string, "Users/c/ckoster/flowSP/LHC23_PbPb_pass5/Default", "ccdb dir for NUA corrections"); @@ -171,11 +172,11 @@ struct FlowDeltav1SP { O2_DEFINE_CONFIGURABLE(cCCDBdir_centrality, std::string, "Users/c/ckoster/flowSP/LHC23_PbPb_pass5/centWeight/Default", "ccdb dir for Centrality corrections"); O2_DEFINE_CONFIGURABLE(cCCDBdir_meanPt, std::string, "", "ccdb dir for Mean Pt corrections"); - // Configurables containing vector + // Configurables containing vector O2_DEFINE_CONFIGURABLE(cUsePredeFinedSigma, bool, true, "Use one of the pre-defines settings for the multiplicity vs. centrality plots"); O2_DEFINE_CONFIGURABLE(cUsePredeFinedSigmaYear, int, 2023, "Predifine what year you want to use (2023/2024)"); - O2_DEFINE_CONFIGURABLE(cUsePredeFinedSigmaNsigma, int, 2, "Sigma used for cuts (1,2,3)"); //on predefined multiplicity vs centrality plots - + O2_DEFINE_CONFIGURABLE(cUsePredeFinedSigmaNsigma, int, 2, "Sigma used for cuts (1,2,3)"); // on predefined multiplicity vs centrality plots + struct : ConfigurableGroup { // p Boundaries for switching from TPC-standalone to TPC+TOF PID O2_DEFINE_CONFIGURABLE(cPBoundaryPi, float, 0.6f, "p boundary for Pions (GeV/c)"); @@ -189,13 +190,13 @@ struct FlowDeltav1SP { O2_DEFINE_CONFIGURABLE(cNSigmaTOF_Ka, float, 2.5f, "TOF nSigma selection radius for Kaons"); O2_DEFINE_CONFIGURABLE(cNSigmaTPC_Pr, float, 2.5f, "TPC nSigma selection radius for Protons"); O2_DEFINE_CONFIGURABLE(cNSigmaTOF_Pr, float, 2.5f, "TOF nSigma selection radius for Protons"); - } pid; + } pid; Configurable> cEvSelsMultPv{"cEvSelsMultPv", std::vector{2223.49, -75.1444, 0.963572, -0.00570399, 1.34877e-05, 3790.99, -137.064, 2.13044, -0.017122, 5.82834e-05}, "Multiplicity cuts (PV) first 5 parameters cutLOW last 5 cutHIGH (Default is +-2sigma pass5) "}; Configurable> cEvSelsMult{"cEvSelsMult", std::vector{1301.56, -41.4615, 0.478224, -0.00239449, 4.46966e-06, 2967.6, -102.927, 1.47488, -0.0106534, 3.28622e-05}, "Multiplicity cuts (Global) first 5 parameters cutLOW last 5 cutHIGH (Default is +-2sigma pass5) "}; Configurable> cPtBinning{"cPtBinning", std::vector{0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2, 2.2, 2.4, 2.6, 2.8, 3, 3.5, 4, 5, 6, 8, 10}, "pT binning for vn"}; - Configurable> cPBinning{"cPBinning", make_arange(0.2, 5.0, 0.1),"Linear bin edges for TOF and TPC momentum plots"}; - + Configurable> cPBinning{"cPBinning", make_arange(0.2, 5.0, 0.1), "Linear bin edges for TOF and TPC momentum plots"}; + } cfg; RCTFlagsChecker rctChecker; @@ -565,7 +566,6 @@ struct FlowDeltav1SP { histos.add("incl/pion/QA/after/hNsigmaTPC_p", "", {HistType::kTH2D, {axisPdEdx, axisNsigma}}); histos.add("incl/pion/QA/after/hNsigmaTOF_p", "", {HistType::kTH2D, {axisPBeta, axisNsigma}}); - if (cfg.cTrackSelDoTrackQAvsCent) { histos.add("incl/pion/QA/after/hPt_Eta", "", kTH3D, {axisPt, axisEta, axisCent}); histos.add("incl/pion/QA/after/hPt_Eta_uncorrected", "", kTH3D, {axisPt, axisEta, axisCent}); @@ -575,7 +575,7 @@ struct FlowDeltav1SP { histos.add("incl/pion/QA/after/hPhi_Eta_Pt", "", kTH3D, {axisPhi, axisEta, axisPt}); histos.add("incl/pion/QA/after/hPhi_Eta_Pt_corrected", "", kTH3D, {axisPhi, axisEta, axisPt}); } - + histos.add("incl/pion/QA/after/hPhi_Eta_vz", "", kTH3D, {axisPhi, axisEta, axisVz}); histos.add("incl/pion/QA/after/hPhi_Eta_vz_corrected", "", kTH3D, {axisPhi, axisEta, axisVz}); histos.add("incl/pion/QA/after/hDCAxy_pt", "", kTH2D, {axisPt, axisDCAxy}); @@ -588,12 +588,11 @@ struct FlowDeltav1SP { if (cfg.cFillQABefore) { histos.addClone("incl/pion/QA/after/", "incl/pion/QA/before/"); } - - } + } if (cfg.cFillPIDTPCTOFCutsQA) { std::vector stages = {"BeforePID", "AfterTOF", "AfterTPC_TOF"}; - + for (const auto& st : stages) { std::string base = "incl/pion/QA/" + st + "/"; @@ -611,8 +610,7 @@ struct FlowDeltav1SP { histos.add(base + "hNsigmaTPC_NsigmaTOF_pt", "", HistType::kTH3D, {axisNsigma, axisNsigma, axisPt}); } } - //Kaon and proton and charge dependence done later, after doProcessDataPID - + // Kaon and proton and charge dependence done later, after doProcessDataPID } if (cfg.cFillEventQA) { @@ -649,7 +647,7 @@ struct FlowDeltav1SP { // track properties per centrality and per eta, pt bin registry.add("incl/vnC", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); registry.add("incl/vnA", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); - //Added for possible covariance error calculation, to be checked + // Added for possible covariance error calculation, to be checked registry.add("incl/vnAvnC", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); registry.add("incl/vnA_nw", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); registry.add("incl/vnC_nw", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); @@ -713,7 +711,7 @@ struct FlowDeltav1SP { registry.add("incl/pion/vnC", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); registry.add("incl/pion/vnA", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); - //Added for possible covariance error calculation, to be checked + // Added for possible covariance error calculation, to be checked registry.add("incl/pion/vnAvnC", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); registry.add("incl/pion/vnA_nw", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); registry.add("incl/pion/vnC_nw", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); @@ -721,7 +719,7 @@ struct FlowDeltav1SP { if (!doprocessData) { registry.add("incl/vnC", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); registry.add("incl/vnA", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); - //Added for possible covariance error calculation, to be checked + // Added for possible covariance error calculation, to be checked registry.add("incl/vnAvnC", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); registry.add("incl/vnA_nw", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); registry.add("incl/vnC_nw", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); @@ -878,69 +876,68 @@ struct FlowDeltav1SP { template ParticleType getTrackPID(const TrackObject& track) { - // Reject tracks without TPC PID - if (!track.hasTPC()) { - return kUnidentified; + // Reject tracks without TPC PID + if (!track.hasTPC()) { + return kUnidentified; + } + + const float p = track.p(); + const bool hasTOF = track.hasTOF(); + + // Store signed TPC PID responses + const float nSigmaPiTPC = track.tpcNSigmaPi(); + const float nSigmaKaTPC = track.tpcNSigmaKa(); + const float nSigmaPrTPC = track.tpcNSigmaPr(); + + // Store TOF responses (if present, else 999f) + const float nSigmaPiTOF = hasTOF ? track.tofNSigmaPi() : 999.f; + const float nSigmaKaTOF = hasTOF ? track.tofNSigmaKa() : 999.f; + const float nSigmaPrTOF = hasTOF ? track.tofNSigmaPr() : 999.f; + + // Species hypothesis tester + auto passesSpeciesPID = [&](float nSigmaTPC, float nSigmaTOF, float pBoundary, float NSigmaTPC_Species, float NSigmaTOF_Species) -> bool { + if (p < pBoundary) { + // Only require TPC + return std::abs(nSigmaTPC) < NSigmaTPC_Species; + } else if (p >= pBoundary) { + // Require TPC and TOF + return hasTOF && std::abs(nSigmaTPC) < NSigmaTPC_Species && std::abs(nSigmaTOF) < NSigmaTOF_Species; } + return false; + }; - const float p = track.p(); - const bool hasTOF = track.hasTOF(); + // Find best candidate using distance metric + ParticleType valPID = kUnidentified; + float bestNSigma = 999.f; - // Store signed TPC PID responses - const float nSigmaPiTPC = track.tpcNSigmaPi(); - const float nSigmaKaTPC = track.tpcNSigmaKa(); - const float nSigmaPrTPC = track.tpcNSigmaPr(); - - // Store TOF responses (if present, else 999f) - const float nSigmaPiTOF = hasTOF ? track.tofNSigmaPi() : 999.f; - const float nSigmaKaTOF = hasTOF ? track.tofNSigmaKa() : 999.f; - const float nSigmaPrTOF = hasTOF ? track.tofNSigmaPr() : 999.f; - - - // Species hypothesis tester - auto passesSpeciesPID = [&](float nSigmaTPC, float nSigmaTOF, float pBoundary, float NSigmaTPC_Species, float NSigmaTOF_Species) -> bool { - if (p < pBoundary) { - // Only require TPC - return std::abs(nSigmaTPC) < NSigmaTPC_Species; - } else if (p >= pBoundary) { - // Require TPC and TOF - return hasTOF && std::abs(nSigmaTPC) < NSigmaTPC_Species && std::abs(nSigmaTOF) < NSigmaTOF_Species; - } - return false; - }; - - // Find best candidate using distance metric - ParticleType valPID = kUnidentified; - float bestNSigma = 999.f; - - // Pions - if (passesSpeciesPID(nSigmaPiTPC, nSigmaPiTOF, cfg.pid.cPBoundaryPi, cfg.pid.cNSigmaTPC_Pi, cfg.pid.cNSigmaTOF_Pi)) { - float dist = (p < cfg.pid.cPBoundaryPi) ? std::abs(nSigmaPiTPC) : std::max(std::abs(nSigmaPiTPC), std::abs(nSigmaPiTOF)); - if (dist < bestNSigma) { - bestNSigma = dist; - valPID = kPions; - } + // Pions + if (passesSpeciesPID(nSigmaPiTPC, nSigmaPiTOF, cfg.pid.cPBoundaryPi, cfg.pid.cNSigmaTPC_Pi, cfg.pid.cNSigmaTOF_Pi)) { + float dist = (p < cfg.pid.cPBoundaryPi) ? std::abs(nSigmaPiTPC) : std::max(std::abs(nSigmaPiTPC), std::abs(nSigmaPiTOF)); + if (dist < bestNSigma) { + bestNSigma = dist; + valPID = kPions; } + } - // Kaons - if (passesSpeciesPID(nSigmaKaTPC, nSigmaKaTOF, cfg.pid.cPBoundaryKa, cfg.pid.cNSigmaTPC_Ka, cfg.pid.cNSigmaTOF_Ka)) { - float dist = (p < cfg.pid.cPBoundaryKa) ? std::abs(nSigmaKaTPC) : std::max(std::abs(nSigmaKaTPC), std::abs(nSigmaKaTOF)); - if (dist < bestNSigma) { - bestNSigma = dist; - valPID = kKaons; - } + // Kaons + if (passesSpeciesPID(nSigmaKaTPC, nSigmaKaTOF, cfg.pid.cPBoundaryKa, cfg.pid.cNSigmaTPC_Ka, cfg.pid.cNSigmaTOF_Ka)) { + float dist = (p < cfg.pid.cPBoundaryKa) ? std::abs(nSigmaKaTPC) : std::max(std::abs(nSigmaKaTPC), std::abs(nSigmaKaTOF)); + if (dist < bestNSigma) { + bestNSigma = dist; + valPID = kKaons; } + } - // Protons - if (passesSpeciesPID(nSigmaPrTPC, nSigmaPrTOF, cfg.pid.cPBoundaryPr, cfg.pid.cNSigmaTPC_Pr, cfg.pid.cNSigmaTOF_Pr)) { - float dist = (p < cfg.pid.cPBoundaryPr) ? std::abs(nSigmaPrTPC) : std::max(std::abs(nSigmaPrTPC), std::abs(nSigmaPrTOF)); - if (dist < bestNSigma) { - bestNSigma = dist; - valPID = kProtons; - } + // Protons + if (passesSpeciesPID(nSigmaPrTPC, nSigmaPrTOF, cfg.pid.cPBoundaryPr, cfg.pid.cNSigmaTPC_Pr, cfg.pid.cNSigmaTOF_Pr)) { + float dist = (p < cfg.pid.cPBoundaryPr) ? std::abs(nSigmaPrTPC) : std::max(std::abs(nSigmaPrTPC), std::abs(nSigmaPrTOF)); + if (dist < bestNSigma) { + bestNSigma = dist; + valPID = kProtons; } + } - return valPID; + return valPID; } template @@ -951,47 +948,45 @@ struct FlowDeltav1SP { float nsigmaTPC = 999.f; float nsigmaTOF = 999.f; - float dEdxDiff = 0.f; - float betaDiff = 0.f; + float dEdxDiff = 0.f; + float betaDiff = 0.f; const bool hasTOF = track.hasTOF(); // Get species-specific variables using if constexpr (par == kPions) { nsigmaTPC = track.tpcNSigmaPi(); - dEdxDiff = track.tpcExpSignalDiffPi(); + dEdxDiff = track.tpcExpSignalDiffPi(); if (hasTOF) { - nsigmaTOF = track.tofNSigmaPi(); - betaDiff = track.tofExpSignalDiffPi(); - } - } - else if constexpr (par == kKaons) { + nsigmaTOF = track.tofNSigmaPi(); + betaDiff = track.tofExpSignalDiffPi(); + } + } else if constexpr (par == kKaons) { nsigmaTPC = track.tpcNSigmaKa(); - dEdxDiff = track.tpcExpSignalDiffKa(); + dEdxDiff = track.tpcExpSignalDiffKa(); if (hasTOF) { - nsigmaTOF = track.tofNSigmaKa(); - betaDiff = track.tofExpSignalDiffKa(); - } - } - else if constexpr (par == kProtons) { + nsigmaTOF = track.tofNSigmaKa(); + betaDiff = track.tofExpSignalDiffKa(); + } + } else if constexpr (par == kProtons) { nsigmaTPC = track.tpcNSigmaPr(); - dEdxDiff = track.tpcExpSignalDiffPr(); + dEdxDiff = track.tpcExpSignalDiffPr(); if (hasTOF) { nsigmaTOF = track.tofNSigmaPr(); - betaDiff = track.tofExpSignalDiffPr(); + betaDiff = track.tofExpSignalDiffPr(); } } // TPC nSigma histos.fill(HIST(Charge[ct]) + HIST(Species[par]) + HIST("QA/") + HIST(Stage[st]) + HIST("hNsigmaTPC_p"), track.tpcInnerParam(), nsigmaTPC); - + // TOF nSigma & Combined if (track.hasTOF()) { histos.fill(HIST(Charge[ct]) + HIST(Species[par]) + HIST("QA/") + HIST(Stage[st]) + HIST("hNsigmaTOF_p"), track.p(), nsigmaTOF); float nsigmaComb = std::hypot(nsigmaTPC, nsigmaTOF); histos.fill(HIST(Charge[ct]) + HIST(Species[par]) + HIST("QA/") + HIST(Stage[st]) + HIST("hNsigmaComb_p"), track.p(), nsigmaComb); } - + // Detector response per species (Raw signals) histos.fill(HIST(Charge[ct]) + HIST(Species[par]) + HIST("QA/") + HIST(Stage[st]) + HIST("hdEdxTPC_p"), track.tpcInnerParam(), track.tpcSignal()); if (track.hasTOF()) { @@ -1169,7 +1164,7 @@ struct FlowDeltav1SP { return true; } -template + template bool eventSelected(TCollision collision, const int& multTrk) { if (!collision.sel8()) @@ -1393,7 +1388,7 @@ template if (cfg.cFillGeneralV1Histos) { registry.fill(HIST(Charge[ct]) + HIST(Species[pt]) + HIST("vnA"), track.pt(), track.eta(), spm.centrality, (uqA)*invSqrtQQ, weight); registry.fill(HIST(Charge[ct]) + HIST(Species[pt]) + HIST("vnC"), track.pt(), track.eta(), spm.centrality, (uqC)*invSqrtQQ, weight); - registry.fill(HIST(Charge[ct]) + HIST(Species[pt]) + HIST("vnAvnC"), track.pt(), track.eta(), spm.centrality, (uqA)*invSqrtQQ*(uqC)*invSqrtQQ, weight); + registry.fill(HIST(Charge[ct]) + HIST(Species[pt]) + HIST("vnAvnC"), track.pt(), track.eta(), spm.centrality, (uqA)*invSqrtQQ * (uqC)*invSqrtQQ, weight); registry.fill(HIST(Charge[ct]) + HIST(Species[pt]) + HIST("vnA_nw"), track.pt(), track.eta(), spm.centrality, (uqA)*invSqrtQQ); registry.fill(HIST(Charge[ct]) + HIST(Species[pt]) + HIST("vnC_nw"), track.pt(), track.eta(), spm.centrality, (uqC)*invSqrtQQ); } @@ -1423,8 +1418,8 @@ template registry.fill(HIST(Charge[ct]) + HIST(Species[pt]) + HIST("meanPT/ptV1C3D"), track.pt(), track.eta(), spm.centrality, track.pt() * ((uqC) * (invSqrtQQ * invMeanPtQQ)), weight); if (cfg.cFillMeanPTextra) { - registry.fill(HIST(Charge[ct]) + HIST(Species[pt]) + HIST("meanPT/hMeanPtEtaCent"), track.eta(), spm.centrality, track.pt(), weight); - registry.fill(HIST(Charge[ct]) + HIST(Species[pt]) + HIST("meanPT/hMeanPtCent"), spm.centrality, track.pt(), weight); + registry.fill(HIST(Charge[ct]) + HIST(Species[pt]) + HIST("meanPT/hMeanPtEtaCent"), track.eta(), spm.centrality, track.pt(), weight); + registry.fill(HIST(Charge[ct]) + HIST(Species[pt]) + HIST("meanPT/hMeanPtCent"), spm.centrality, track.pt(), weight); registry.fill(HIST(Charge[ct]) + HIST(Species[pt]) + HIST("meanPT/ptV1A"), track.eta(), spm.centrality, track.pt() * ((spm.uy * spm.qyA + spm.ux * spm.qxA) * (invSqrtQQ * invMeanPtQQ)), weight); registry.fill(HIST(Charge[ct]) + HIST(Species[pt]) + HIST("meanPT/ptV1C"), track.eta(), spm.centrality, track.pt() * ((spm.uy * spm.qyC + spm.ux * spm.qxC) * (invSqrtQQ * invMeanPtQQ)), weight); @@ -1446,7 +1441,7 @@ template if (!cfg.cFillTrackQA) return; - //Too many QAhistos, so we will not fill them for identified particles, only for inclusive tracks + // Too many QAhistos, so we will not fill them for identified particles, only for inclusive tracks if constexpr (par == kProtons || par == kKaons || par == kPions) return; @@ -1479,17 +1474,15 @@ template return; if constexpr (framework::has_type_v) { - + // Only fill the specific particle's histograms if constexpr (par == kPions) { histos.fill(HIST(Charge[ct]) + HIST("pion/") + HIST("QA/") + HIST(Time[ft]) + HIST("hNsigmaTOF_p"), track.p(), track.tofNSigmaPi()); histos.fill(HIST(Charge[ct]) + HIST("pion/") + HIST("QA/") + HIST(Time[ft]) + HIST("hNsigmaTPC_p"), track.tpcInnerParam(), track.tpcNSigmaPi()); - } - else if constexpr (par == kKaons) { + } else if constexpr (par == kKaons) { histos.fill(HIST(Charge[ct]) + HIST("kaon/") + HIST("QA/") + HIST(Time[ft]) + HIST("hNsigmaTOF_p"), track.p(), track.tofNSigmaKa()); histos.fill(HIST(Charge[ct]) + HIST("kaon/") + HIST("QA/") + HIST(Time[ft]) + HIST("hNsigmaTPC_p"), track.tpcInnerParam(), track.tpcNSigmaKa()); - } - else if constexpr (par == kProtons) { + } else if constexpr (par == kProtons) { histos.fill(HIST(Charge[ct]) + HIST("proton/") + HIST("QA/") + HIST(Time[ft]) + HIST("hNsigmaTOF_p"), track.p(), track.tofNSigmaPr()); histos.fill(HIST(Charge[ct]) + HIST("proton/") + HIST("QA/") + HIST(Time[ft]) + HIST("hNsigmaTPC_p"), track.tpcInnerParam(), track.tpcNSigmaPr()); } @@ -1500,8 +1493,6 @@ template } } - - template inline void fillMCPtHistos(TrackObject track, int pdgCode) { @@ -2006,14 +1997,14 @@ template if (track.sign() == 0) continue; - + // PID QA before cuts if (cfg.cFillPIDTPCTOFCutsQA) { FillPIDTPCTOFCutsQA(track); FillPIDTPCTOFCutsQA(track); FillPIDTPCTOFCutsQA(track); } - + ParticleType trackPID = (cfg.cFillPID || cfg.cFillPIDQA) ? getTrackPID(track) : kUnidentified; histos.fill(HIST("hPIDcounts"), trackPID, track.pt()); @@ -2022,49 +2013,48 @@ template spm.charge = ((track.sign() > 0)) ? kPositive : kNegative; - const float p = track.p(); - //const float tpcInnerParam = track.tpcInnerParam(); + // const float tpcInnerParam = track.tpcInnerParam(); const bool hasTOF = track.hasTOF(); // 1D RECTANGULAR CUTS (FOR QA) - //always require TPC, but only require TOF if p > cPBoundary + // always require TPC, but only require TOF if p > cPBoundary bool passTPCPion = std::abs(track.tpcNSigmaPi()) < cfg.pid.cNSigmaTPC_Pi; bool passTPCKaon = std::abs(track.tpcNSigmaKa()) < cfg.pid.cNSigmaTPC_Ka; bool passTPCProton = std::abs(track.tpcNSigmaPr()) < cfg.pid.cNSigmaTPC_Pr; - - bool passTOFPion = true; // default to true for p < cPBoundary - bool passTOFKaon = true; // default to true for p < cPBoundary + + bool passTOFPion = true; // default to true for p < cPBoundary + bool passTOFKaon = true; // default to true for p < cPBoundary bool passTOFProton = true; // default to true for p < cPBoundary // Check TOF requirements against species-specific momentum boundaries if (p >= cfg.pid.cPBoundaryPi) { - passTOFPion = hasTOF && (std::abs(track.tofNSigmaPi()) < cfg.pid.cNSigmaTOF_Pi); + passTOFPion = hasTOF && (std::abs(track.tofNSigmaPi()) < cfg.pid.cNSigmaTOF_Pi); } if (p >= cfg.pid.cPBoundaryKa) { - passTOFKaon = hasTOF && (std::abs(track.tofNSigmaKa()) < cfg.pid.cNSigmaTOF_Ka); + passTOFKaon = hasTOF && (std::abs(track.tofNSigmaKa()) < cfg.pid.cNSigmaTOF_Ka); } if (p >= cfg.pid.cPBoundaryPr) { - passTOFProton = hasTOF && (std::abs(track.tofNSigmaPr()) < cfg.pid.cNSigmaTOF_Pr); + passTOFProton = hasTOF && (std::abs(track.tofNSigmaPr()) < cfg.pid.cNSigmaTOF_Pr); } // QA histograms for TPC and TOF cuts if (cfg.cFillPIDTPCTOFCutsQA) { - // Passes TOF standalone - if (passTOFPion) - FillPIDTPCTOFCutsQA(track); - if (passTOFKaon) - FillPIDTPCTOFCutsQA(track); - if (passTOFProton) - FillPIDTPCTOFCutsQA(track); - - // Passes both TPC and TOF 1D cuts - if (passTOFPion && passTPCPion) - FillPIDTPCTOFCutsQA(track); - if (passTOFKaon && passTPCKaon) - FillPIDTPCTOFCutsQA(track); - if (passTOFProton && passTPCProton) - FillPIDTPCTOFCutsQA(track); + // Passes TOF standalone + if (passTOFPion) + FillPIDTPCTOFCutsQA(track); + if (passTOFKaon) + FillPIDTPCTOFCutsQA(track); + if (passTOFProton) + FillPIDTPCTOFCutsQA(track); + + // Passes both TPC and TOF 1D cuts + if (passTOFPion && passTPCPion) + FillPIDTPCTOFCutsQA(track); + if (passTOFKaon && passTPCKaon) + FillPIDTPCTOFCutsQA(track); + if (passTOFProton && passTPCProton) + FillPIDTPCTOFCutsQA(track); } if (cfg.cFillQABefore) { @@ -2223,7 +2213,7 @@ template if (cfg.cFillWithMCParticle) { fillMCPtHistos(mcParticle, mcParticle.pdgCode()); } else { - fillMCPtHistos(track, mcParticle.pdgCode()); + fillMCPtHistos(track, mcParticle.pdgCode()); } spm.charge = (track.sign() > 0) ? kPositive : kNegative; @@ -2273,7 +2263,7 @@ template if (cfg.cFillWithMCParticle) { fillMCPtHistos(mcParticle, mcParticle.pdgCode()); } else { - fillMCPtHistos(track, mcParticle.pdgCode()); + fillMCPtHistos(track, mcParticle.pdgCode()); } fillAllQA(track); @@ -2407,4 +2397,4 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ adaptAnalysisTask(cfgc)}; -} \ No newline at end of file +}