diff --git a/PWGLF/Tasks/Resonances/k1analysis.cxx b/PWGLF/Tasks/Resonances/k1analysis.cxx index 220778a9432..02ac98be89b 100644 --- a/PWGLF/Tasks/Resonances/k1analysis.cxx +++ b/PWGLF/Tasks/Resonances/k1analysis.cxx @@ -103,18 +103,18 @@ struct K1analysis { kNSteps }; - enum class K1MassRegion : uint8_t { - Outside = 0, - Signal, - SBLeft, - SBRight - }; + enum class K1MassRegion : uint8_t { + Outside = 0, + Signal, + SBLeft, + SBRight + }; const int nSteps = static_cast(EvtStep::kNSteps); - SliceCache cache; + SliceCache cache; Preslice perCollision = aod::track::collisionId; - // Preslice perCollisionV0 = aod::v0data::collisionId; + // Preslice perCollisionV0 = aod::v0data::collisionId; Preslice perCollisionV0 = aod::v0data::collisionId; Preslice perMCCollision = o2::aod::mcparticle::mcCollisionId; @@ -133,7 +133,7 @@ struct K1analysis { using LorentzVectorSetXYZM = ROOT::Math::LorentzVector>; - HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; Service ccdb; Service pdg; @@ -154,7 +154,7 @@ struct K1analysis { Configurable cNbinsDivQA{"cNbinsDivQA", 1, "Integer to divide the number of bins for QA"}; } AxisConfig; - /// Event cuts + /// Event cuts o2::analysis::CollisonCuts colCuts; struct : ConfigurableGroup { Configurable cfgEvtZvtx{"cfgEvtZvtx", 10.f, "Evt sel: Max. z-Vertex (cm)"}; @@ -182,9 +182,9 @@ struct K1analysis { Configurable cfgFillQAPlots{"cfgFillQAPlots", true, "Fill QA plots"}; Configurable cfgCentEst{"cfgCentEst", 2, "Centrality estimator, 1: FT0C, 2: FT0M"}; - /// PID Selections, pion + /// PID Selections, pion struct : ConfigurableGroup { - Configurable cfgTPConly{"cfgTPConly", true, "Use only TPC for PID"}; // bool + Configurable cfgTPConly{"cfgTPConly", true, "Use only TPC for PID"}; // bool Configurable cfgMaxTPCnSigmaPion{"cfgMaxTPCnSigmaPion", 5.0, "TPC nSigma cut for Pion"}; // TPC Configurable cfgMaxTOFnSigmaPion{"cfgMaxTOFnSigmaPion", 5.0, "TOF nSigma cut for Pion"}; // TOF Configurable cfgNsigmaCutCombinedPion{"cfgNsigmaCutCombinedPion", -999, "Combined nSigma cut for Pion"}; // Combined @@ -192,7 +192,7 @@ struct K1analysis { Configurable cfgTOFMinPt{"cfgTOFMinPt", 0.6, "Minimum TOF pT cut for Pion"}; // TOF pT cut } PIDCuts; - // Track selections + // Track selections struct : ConfigurableGroup { Configurable cfgMinPtcut{"cfgMinPtcut", 0.15, "Track minium pt cut"}; Configurable cfgMaxEtacut{"cfgMaxEtacut", 0.8, "Track maximum eta cut"}; @@ -219,7 +219,7 @@ struct K1analysis { Configurable cfgMaxbDCAzToPVcut{"cfgMaxbDCAzToPVcut", 0.1, "Track DCAz cut to PV Maximum"}; } TrackCuts; - // Secondary Selection + // Secondary Selection struct : ConfigurableGroup { Configurable cfgReturnFlag{"cfgReturnFlag", false, "Return Flag for debugging"}; Configurable cfgSecondaryRequire{"cfgSecondaryRequire", true, "Secondary cuts on/off"}; @@ -243,20 +243,20 @@ struct K1analysis { Configurable cfgSecondaryCrossMassCutWindow{"cfgSecondaryCrossMassCutWindow", 0.05, "Secondary inv mass selection window with (anti)lambda hypothesis"}; } SecondaryCuts; - // K* selection + // K* selection struct : ConfigurableGroup { Configurable cfgKstarMinPt{"cfgKstarMinPt", 0.0, "Kstar minimum pT"}; Configurable cfgKstarMaxRap{"cfgKstarMaxRap", 0.5, "Kstar maximum rapidity"}; Configurable cfgKstarMinRap{"cfgKstarMinRap", -0.5, "Kstar minimum rapidity"}; - Configurable cfgKstarMassWindow{"cfgKstarMassWindow", 0.05, "Kstar inv mass selection window"}; + Configurable cfgKstarMassWindow{"cfgKstarMassWindow", 0.05, "Kstar inv mass selection window"}; } KstarCuts; // K1 selection - struct : ConfigurableGroup { - Configurable cfgK1MinPt{"cfgK1MinPt", 0.0, "K1 minimum pT"}; - Configurable cfgK1MaxRap{"cfgK1MaxRap", 0.5, "K1 maximum rapidity"}; - Configurable cfgK1MinRap{"cfgK1MinRap", -0.5, "K1 minimum rapidity"}; - } K1Cuts; + struct : ConfigurableGroup { + Configurable cfgK1MinPt{"cfgK1MinPt", 0.0, "K1 minimum pT"}; + Configurable cfgK1MaxRap{"cfgK1MaxRap", 0.5, "K1 maximum rapidity"}; + Configurable cfgK1MinRap{"cfgK1MinRap", -0.5, "K1 minimum rapidity"}; + } K1Cuts; // Bkg estimation struct : ConfigurableGroup { @@ -269,8 +269,8 @@ struct K1analysis { Configurable cfgTruthUseInelGt0{"cfgTruthUseInelGt0", true, "Truth denominator: require INEL>0"}; Configurable cfgTruthIncludeZvtx{"cfgTruthIncludeZvtx", true, "Truth denominator: also require |vtxz| cfgHasPair{"cfgHasPair", true, "Check the existence of pairs"}; - Configurable cfgPiPiMinPt{"cfgPiPiMinPt", 0.5, "bachelor pion and secondary pion minimum pT cut"}; + Configurable cfgHasPair{"cfgHasPair", true, "Check the existence of pairs"}; + Configurable cfgPiPiMinPt{"cfgPiPiMinPt", 0.5, "bachelor pion and secondary pion minimum pT cut"}; float lCentrality; @@ -279,15 +279,14 @@ struct K1analysis { int kPDGK0 = kK0; int kPDGKstarPlus = o2::constants::physics::Pdg::kKPlusStar892; int kPDGPiPlus = kPiPlus; - int kPDGK10 = 10313; - double fMaxPosPV = 1e-2; + int kPDGK10 = 10313; + double fMaxPosPV = 1e-2; - - void init(o2::framework::InitContext&) - { + void init(o2::framework::InitContext&) + { lCentrality = -999; - colCuts.setCuts(EventCuts.cfgEvtZvtx, EventCuts.cfgEvtTriggerCheck, EventCuts.cfgEvtOfflineCheck, /*checkRun3*/ true, EventCuts.cfgEvtTriggerTVXSel, EventCuts.cfgEvtOccupancyInTimeRangeMax, EventCuts.cfgEvtOccupancyInTimeRangeMin); + colCuts.setCuts(EventCuts.cfgEvtZvtx, EventCuts.cfgEvtTriggerCheck, EventCuts.cfgEvtOfflineCheck, /*checkRun3*/ true, EventCuts.cfgEvtTriggerTVXSel, EventCuts.cfgEvtOccupancyInTimeRangeMax, EventCuts.cfgEvtOccupancyInTimeRangeMin); colCuts.init(&histos); colCuts.setTriggerTVX(EventCuts.cfgEvtTriggerTVXSel); colCuts.setApplyTFBorderCut(EventCuts.cfgEvtTFBorderCut); @@ -300,7 +299,7 @@ struct K1analysis { rctChecker.init(EventCuts.cfgEvtRCTFlagCheckerLabel, EventCuts.cfgEvtRCTFlagCheckerZDCCheck, EventCuts.cfgEvtRCTFlagCheckerLimitAcceptAsBad); - AxisSpec centAxis = {AxisConfig.cfgBinsCent, "T0M (%)"}; + AxisSpec centAxis = {AxisConfig.cfgBinsCent, "T0M (%)"}; AxisSpec vtxzAxis = {AxisConfig.cfgBinsVtxZ, "Z Vertex (cm)"}; AxisSpec ptAxis = {AxisConfig.cfgBinsPt, "#it{p}_{T} (GeV/#it{c})"}; AxisSpec ptAxisQA = {AxisConfig.cfgBinsPtQA, "#it{p}_{T} (GeV/#it{c})"}; @@ -311,17 +310,17 @@ struct K1analysis { AxisSpec dcaxyAxis = {200, 0, 2, "DCA_{#it{xy}} (cm)"}; AxisSpec dcazAxis = {200, 0, 2, "DCA_{#it{z}} (cm)"}; AxisSpec yAxis = {100, -1, 1, "Rapidity"}; - AxisSpec invMassAxisK0s = {800 / AxisConfig.cNbinsDiv, 0.46, 0.54, "Invariant Mass (GeV/#it{c}^2)"}; // K0s ~497.611 + AxisSpec invMassAxisK0s = {800 / AxisConfig.cNbinsDiv, 0.46, 0.54, "Invariant Mass (GeV/#it{c}^2)"}; // K0s ~497.611 AxisSpec invMassAxisChk892 = {900 / AxisConfig.cNbinsDiv, 0.5f, 1.4f, "Invariant Mass (GeV/#it{c}^2)"}; // chK(892) ~892 - AxisSpec invMassAxisReso = {1600 / AxisConfig.cNbinsDiv, 0.9f, 2.5f, "Invariant Mass (GeV/#it{c}^2)"}; // K1 + AxisSpec invMassAxisReso = {1600 / AxisConfig.cNbinsDiv, 0.9f, 2.5f, "Invariant Mass (GeV/#it{c}^2)"}; // K1 AxisSpec pidQAAxis = {130 / AxisConfig.cNbinsDivQA, -6.5, 6.5}; AxisSpec cutAxis{14, 0.5, 14.5, "Check"}; // 1..14 - // THnSparse + // THnSparse AxisSpec axisType = {BinType::kTYEnd, 0, BinType::kTYEnd, "Type of bin with charge and mix"}; AxisSpec mcLabelAxis = {5, -0.5, 4.5, "MC Label"}; - histos.add("QA/K0sCutCheck", "Check K0s cut", HistType::kTH1D, {AxisSpec{13, -0.5, 12.5, "Check"}}); + histos.add("QA/K0sCutCheck", "Check K0s cut", HistType::kTH1D, {AxisSpec{13, -0.5, 12.5, "Check"}}); histos.add("QA/K0sCutFlow", "Check K0s cut (first-fail or pass)", HistType::kTH1F, {cutAxis}); auto hcut = histos.get(HIST("QA/K0sCutFlow")); hcut->GetXaxis()->SetBinLabel(1, "TOTAL"); @@ -347,8 +346,7 @@ struct K1analysis { histos.add("QA/RotBkg/hRotBkg", "Rotated angle of rotated background", HistType::kTH1F, {{360, 0.0, o2::constants::math::TwoPI}}); } - - // Bachelor pion + // Bachelor pion histos.add("QA/before/trkbpionDCAxy", "DCAxy distribution of bachelor pion candidates", HistType::kTH1D, {dcaxyAxis}); histos.add("QA/before/trkbpionDCAz", "DCAz distribution of bachelor pion candidates", HistType::kTH1D, {dcazAxis}); histos.add("QA/before/trkbpionpT", "pT distribution of bachelor pion candidates", HistType::kTH1D, {ptAxisQA}); @@ -363,7 +361,7 @@ struct K1analysis { histos.add("QA/after/trkbpionTOFPID", "TOF PID of bachelor pion candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); histos.add("QA/after/trkbpionTPCTOFPID", "TPC-TOF PID map of bachelor pion candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); - // Secondary pion + // Secondary pion histos.add("QA/before/trkspionTPCPID", "TPC PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); histos.add("QA/before/trkspionTOFPID", "TOF PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); histos.add("QA/before/trkspionTPCTOFPID", "TPC-TOF PID map of secondary pion 1 (positive) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); @@ -378,7 +376,7 @@ struct K1analysis { histos.add("QA/after/trkspionDCAxy", "DCAxy distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcaxyAxis}); histos.add("QA/after/trkspionDCAz", "DCAz distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcazAxis}); - // K0s pion 1 + // K0s pion 1 histos.add("QA/before/trkppionTPCPID", "TPC PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); histos.add("QA/before/trkppionTOFPID", "TOF PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); histos.add("QA/before/trkppionTPCTOFPID", "TPC-TOF PID map of secondary pion 1 (positive) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); @@ -393,7 +391,6 @@ struct K1analysis { histos.add("QA/after/trkppionDCAxy", "DCAxy distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcaxyAxis}); histos.add("QA/after/trkppionDCAz", "DCAz distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcazAxis}); - // K0s pion 2 histos.add("QA/before/trknpionTPCPID", "TPC PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); histos.add("QA/before/trknpionTOFPID", "TOF PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); @@ -436,28 +433,28 @@ struct K1analysis { histos.add("QA/after/hArmSecondary", "Armenteros distribution of secondary resonance", HistType::kTH2D, {AxisSpec{100, -1, 1, "alpha"}, {200, 0, 0.5, "qtArm"}}); histos.add("QA/after/hInvmassSecondary", "Invariant mass of unlike-sign secondary resonance", HistType::kTH1D, {invMassAxisK0s}); - // charged Kstar - histos.add("QA/before/hpT_Kstar", "pT distribution of chK(892)", HistType::kTH1D, {ptAxisQA}); - histos.add("QA/before/hy_Kstar", "Rapidity distribution of chK(892)", HistType::kTH1D, {yAxis}); - histos.add("QA/before/kstarinvmass", "Invariant mass of unlike-sign chK(892)", HistType::kTH1D, {invMassAxisChk892}); + // charged Kstar + histos.add("QA/before/hpT_Kstar", "pT distribution of chK(892)", HistType::kTH1D, {ptAxisQA}); + histos.add("QA/before/hy_Kstar", "Rapidity distribution of chK(892)", HistType::kTH1D, {yAxis}); + histos.add("QA/before/kstarinvmass", "Invariant mass of unlike-sign chK(892)", HistType::kTH1D, {invMassAxisChk892}); - histos.add("QA/after/hpT_Kstar", "pT distribution of chK(892)", HistType::kTH1D, {ptAxisQA}); - histos.add("QA/after/hy_Kstar", "Rapidity distribution of chK(892)", HistType::kTH1D, {yAxis}); - histos.add("QA/after/kstarinvmass", "Invariant mass of unlike-sign chK(892)", HistType::kTH1D, {invMassAxisChk892}); + histos.add("QA/after/hpT_Kstar", "pT distribution of chK(892)", HistType::kTH1D, {ptAxisQA}); + histos.add("QA/after/hy_Kstar", "Rapidity distribution of chK(892)", HistType::kTH1D, {yAxis}); + histos.add("QA/after/kstarinvmass", "Invariant mass of unlike-sign chK(892)", HistType::kTH1D, {invMassAxisChk892}); - // K1 - histos.add("QA/before/hpT_K1", "pT distribution of K1(1270)", HistType::kTH1F, {ptAxisQA}); - histos.add("QA/before/hy_K1", "Rapidity distribution of K1(1270)", HistType::kTH1F, {yAxis}); - histos.add("QA/before/K1CPA", "Cosine pointing angle distribution of K1(1270)", HistType::kTH1F, {cpaAxis}); + // K1 + histos.add("QA/before/hpT_K1", "pT distribution of K1(1270)", HistType::kTH1F, {ptAxisQA}); + histos.add("QA/before/hy_K1", "Rapidity distribution of K1(1270)", HistType::kTH1F, {yAxis}); + histos.add("QA/before/K1CPA", "Cosine pointing angle distribution of K1(1270)", HistType::kTH1F, {cpaAxis}); histos.add("QA/before/K1PtAsym", "pT asymmetry distribution of K1(1270)", HistType::kTH1F, {AxisSpec{100, -1, 1, "Pair asymmetry"}}); histos.add("QA/before/K1DalitzOS", "Dalitz plot of opposite-sign combination of K1(1270)", HistType::kTH2F, {AxisSpec{300, 0.0, 3.0, "#it{M}^{2}_{K_{s}^{0}#pi_{sec}}"}, {300, 0.0, 3.0, "#it{M}^{2}_{#pi_{sec}#pi_{bach}}"}}); histos.add("QA/before/K1DalitzLS", "Dalitz plot of like-sign combination of K1(1270)", HistType::kTH2F, {AxisSpec{300, 0.0, 3.0, "#it{M}^{2}_{K_{s}^{0}#pi_{sec}}"}, {300, 0.0, 3.0, "#it{M}^{2}_{#pi_{sec}#pi_{bach}}"}}); - histos.add("QA/before/K1invmass", "Invariant mass of K1(1270) (US)", HistType::kTH1F, {invMassAxisReso}); - histos.add("QA/before/K1invmassLS", "Invariant mass of K1(1270) (LS)", HistType::kTH1F, {invMassAxisReso}); + histos.add("QA/before/K1invmass", "Invariant mass of K1(1270) (US)", HistType::kTH1F, {invMassAxisReso}); + histos.add("QA/before/K1invmassLS", "Invariant mass of K1(1270) (LS)", HistType::kTH1F, {invMassAxisReso}); - histos.add("QA/after/hpT_K1", "pT distribution of K1(1270)", HistType::kTH1F, {ptAxisQA}); - histos.add("QA/after/hy_K1", "Rapidity distribution of K1(1270)", HistType::kTH1F, {yAxis}); - histos.add("QA/after/K1CPA", "Cosine pointing angle of K1(1270)", HistType::kTH1F, {cpaAxis}); + histos.add("QA/after/hpT_K1", "pT distribution of K1(1270)", HistType::kTH1F, {ptAxisQA}); + histos.add("QA/after/hy_K1", "Rapidity distribution of K1(1270)", HistType::kTH1F, {yAxis}); + histos.add("QA/after/K1CPA", "Cosine pointing angle of K1(1270)", HistType::kTH1F, {cpaAxis}); histos.add("QA/after/K1PtAsym", "pT asymmetry distribution of K1(1270)", HistType::kTH1F, {AxisSpec{100, -1, 1, "Pair asymmetry"}}); histos.add("QA/after/K1DalitzOS_Signal", "(Signal region) Dalitz plot of opposite-sign combination of K1(1270)", HistType::kTH2F, {AxisSpec{300, 0.0, 3.0, "#it{M}^{2}_{K_{s}^{0}#pi_{sec}}"}, {300, 0.0, 3.0, "#it{M}^{2}_{#pi_{sec}#pi_{bach}}"}}); histos.add("QA/after/K1DalitzOS_SBLeft", "(SB left) Dalitz plot of opposite-sign combination of K1(1270)", HistType::kTH2F, {AxisSpec{300, 0.0, 3.0, "#it{M}^{2}_{K_{s}^{0}#pi_{sec}}"}, {300, 0.0, 3.0, "#it{M}^{2}_{#pi_{sec}#pi_{bach}}"}}); @@ -465,28 +462,26 @@ struct K1analysis { histos.add("QA/after/K1DalitzLS_Signal", "(Signal region) Dalitz plot of like-sign combination of K1(1270)", HistType::kTH2F, {AxisSpec{300, 0.0, 3.0, "#it{M}^{2}_{K_{s}^{0}#pi_{sec}}"}, {300, 0.0, 3.0, "#it{M}^{2}_{#pi_{sec}#pi_{bach}}"}}); histos.add("QA/after/K1DalitzLS_SBLeft", "(SB left) Dalitz plot of like-sign combination of K1(1270)", HistType::kTH2F, {AxisSpec{300, 0.0, 3.0, "#it{M}^{2}_{K_{s}^{0}#pi_{sec}}"}, {300, 0.0, 3.0, "#it{M}^{2}_{#pi_{sec}#pi_{bach}}"}}); histos.add("QA/after/K1DalitzLS_SBRight", "(SB right) Dalitz plot of like-sign combination of K1(1270)", HistType::kTH2F, {AxisSpec{300, 0.0, 3.0, "#it{M}^{2}_{K_{s}^{0}#pi_{sec}}"}, {300, 0.0, 3.0, "#it{M}^{2}_{#pi_{sec}#pi_{bach}}"}}); - histos.add("QA/after/K1invmass", "Invariant mass of K1(1270) (US)", HistType::kTH1F, {invMassAxisReso}); - histos.add("QA/after/K1invmassLS", "Invariant mass of K1(1270) (LS)", HistType::kTH1F, {invMassAxisReso}); - - // Invariant mass - histos.add("hInvmass_K1","Invariant mass of K1(1270)", HistType::kTHnSparseD, {axisType, centAxis, ptAxis, invMassAxisReso}); - histos.add("hInvmass_Kstar","Invariant mass of unlike-sign chK(892)", HistType::kTHnSparseD, {centAxis, ptAxis, invMassAxisChk892}); - histos.add("hInvmass_K0s","Invariant mass of unlike-sign K0s", HistType::kTHnSparseD, {centAxis, ptAxis, invMassAxisK0s}); + histos.add("QA/after/K1invmass", "Invariant mass of K1(1270) (US)", HistType::kTH1F, {invMassAxisReso}); + histos.add("QA/after/K1invmassLS", "Invariant mass of K1(1270) (LS)", HistType::kTH1F, {invMassAxisReso}); + // Invariant mass + histos.add("hInvmass_K1", "Invariant mass of K1(1270)", HistType::kTHnSparseD, {axisType, centAxis, ptAxis, invMassAxisReso}); + histos.add("hInvmass_Kstar", "Invariant mass of unlike-sign chK(892)", HistType::kTHnSparseD, {centAxis, ptAxis, invMassAxisChk892}); + histos.add("hInvmass_K0s", "Invariant mass of unlike-sign K0s", HistType::kTHnSparseD, {centAxis, ptAxis, invMassAxisK0s}); - ccdb->setURL(CCDBConfig.cfgURL); + ccdb->setURL(CCDBConfig.cfgURL); ccdbApi.init("http://alice-ccdb.cern.ch"); ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); ccdb->setCreatedNotAfter(std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count()); - // Print output histograms statistics LOG(info) << "Size of the histograms in K1 Analysis Task"; - histos.print(); - }//init + histos.print(); + } // init - const int kCentFT0C = 1; + const int kCentFT0C = 1; const int kCentFT0M = 2; const float kInvalidCentrality = -999.f; @@ -502,11 +497,11 @@ struct K1analysis { } } - //Track selection + // Track selection template - bool trackCut(TrackType const& track) - { - if (std::abs(track.pt()) < TrackCuts.cfgMinPtcut) + bool trackCut(TrackType const& track) + { + if (std::abs(track.pt()) < TrackCuts.cfgMinPtcut) return false; if (std::abs(track.eta()) > TrackCuts.cfgMaxEtacut) return false; @@ -546,8 +541,8 @@ struct K1analysis { if (std::abs(track.dcaXY()) > TrackCuts.cfgMaxbDCArToPVcut) return false; } - if (TrackCuts.cfgpTdepDCAzCut) { - // Tuned on the LHC22f anchored MC LHC23d1d on primary pions. 7 Sigmas of the resolution + if (TrackCuts.cfgpTdepDCAzCut) { + // Tuned on the LHC22f anchored MC LHC23d1d on primary pions. 7 Sigmas of the resolution if (std::abs(track.dcaZ()) > (0.004 + (0.013 / track.pt()))) return false; } else { @@ -555,10 +550,9 @@ struct K1analysis { return false; } return true; + } - } - - // PID selection tools + // PID selection tools template bool selectionPIDPion(TrackType const& candidate) { @@ -566,8 +560,8 @@ struct K1analysis { return false; if (PIDCuts.cfgTPConly) return true; - // if (candidate.pt() <= PIDCuts.cfgTOFMinPt) - // return true; + // if (candidate.pt() <= PIDCuts.cfgTOFMinPt) + // return true; if (candidate.hasTOF()) { const bool tofPIDPassed = std::abs(candidate.tofNSigmaPi()) < PIDCuts.cfgMaxTOFnSigmaPion; @@ -581,7 +575,7 @@ struct K1analysis { } } - // selection K0s + // selection K0s template bool selectionK0s(CollisionType const& collision, K0sType const& candidate) { @@ -689,50 +683,49 @@ struct K1analysis { } } // selectionK0s - K1MassRegion getK1MassRegion(float mass) - { - constexpr float SigMin = 1.22f; - constexpr float SigMax = 1.32f; - - constexpr float SBLMin = 1.10f; - constexpr float SBLMax = 1.18f; + K1MassRegion getK1MassRegion(float mass) + { + constexpr float SigMin = 1.22f; + constexpr float SigMax = 1.32f; - constexpr float SBRMin = 1.36f; - constexpr float SBRMax = 1.44f; + constexpr float SBLMin = 1.10f; + constexpr float SBLMax = 1.18f; - if (mass > SigMin && mass < SigMax) - return K1MassRegion::Signal; - if (mass > SBLMin && mass < SBLMax) - return K1MassRegion::SBLeft; - if (mass > SBRMin && mass < SBRMax) - return K1MassRegion::SBRight; + constexpr float SBRMin = 1.36f; + constexpr float SBRMax = 1.44f; - return K1MassRegion::Outside; - } + if (mass > SigMin && mass < SigMax) + return K1MassRegion::Signal; + if (mass > SBLMin && mass < SBLMax) + return K1MassRegion::SBLeft; + if (mass > SBRMin && mass < SBRMax) + return K1MassRegion::SBRight; + return K1MassRegion::Outside; + } - int count =0; - template + int count = 0; + template void fillHistograms(const CollisionType& collision, const TracksType& dTracks1, const TracksType& dTracks2, const TracksTypeK0s& dTracks3) { - using TrackTarget = std::decay_t; + using TrackTarget = std::decay_t; histos.fill(HIST("QA/before/CentDist"), lCentrality); LorentzVectorSetXYZM lBachelor_pi, lDecayDaughter_K0s, lDecayDaughter_pi, lResoKstar, lResonanceK1, lDaughterRot, lResonanceRot; - LorentzVectorSetXYZM lPairK0sPiSec, lPairK0sPiBach, lPairPiPi; + LorentzVectorSetXYZM lPairK0sPiSec, lPairK0sPiBach, lPairPiPi; std::vector btrackIndices = {}; std::vector strackIndices = {}; std::vector k0sIndices = {}; std::vector chK892Indices = {}; - // check the existence of the pairs - if (cfgHasPair && (dTracks1.size() < 1 || dTracks2.size() < 1 || dTracks3.size() < 1)) - return; + // check the existence of the pairs + if (cfgHasPair && (dTracks1.size() < 1 || dTracks2.size() < 1 || dTracks3.size() < 1)) + return; - for (const auto& bTrack : dTracks1) { + for (const auto& bTrack : dTracks1) { auto trkbpt = bTrack.pt(); auto istrkbhasTOF = bTrack.hasTOF(); auto trkbNSigmaPiTPC = bTrack.tpcNSigmaPi(); @@ -771,9 +764,9 @@ struct K1analysis { } } btrackIndices.push_back(bTrack.index()); - }//bTrack + } // bTrack - for (const auto& sTrack : dTracks2) { + for (const auto& sTrack : dTracks2) { auto trkspt = sTrack.pt(); auto istrkshasTOF = sTrack.hasTOF(); auto trksNSigmaPiTPC = sTrack.tpcNSigmaPi(); @@ -812,9 +805,9 @@ struct K1analysis { } } strackIndices.push_back(sTrack.index()); - }//sTrack + } // sTrack - for (const auto& k0sCand : dTracks3) { + for (const auto& k0sCand : dTracks3) { auto posDauTrack = k0sCand.template posTrack_as(); auto negDauTrack = k0sCand.template negTrack_as(); @@ -924,163 +917,160 @@ struct K1analysis { histos.fill(HIST("hInvmass_K0s"), lCentrality, trkkpt, trkkMass); } k0sIndices.push_back(k0sCand.index()); - }//K0s + } // K0s - - for (const auto& btrackIndex : btrackIndices) { + for (const auto& btrackIndex : btrackIndices) { auto bTrack = dTracks1.rawIteratorAt(btrackIndex); - for (const auto& strackIndex : strackIndices) { - auto sTrack = dTracks2.rawIteratorAt(strackIndex); - - if (bTrack.index() == sTrack.index()) - continue; - - for (const auto& k0sIndex : k0sIndices) { - auto k0sCand = dTracks3.rawIteratorAt(k0sIndex); - - auto posDauTrack = k0sCand.template posTrack_as(); - auto negDauTrack = k0sCand.template negTrack_as(); - - if (bTrack.index() == posDauTrack.index() || bTrack.index() == negDauTrack.index()) - continue; - if (sTrack.index() == posDauTrack.index() || sTrack.index() == negDauTrack.index()) - continue; - - lBachelor_pi = LorentzVectorSetXYZM(bTrack.px(), bTrack.py(), bTrack.pz(), MassPionCharged); - lDecayDaughter_pi = LorentzVectorSetXYZM(sTrack.px(), sTrack.py(), sTrack.pz(), MassPionCharged); - lDecayDaughter_K0s = LorentzVectorSetXYZM(k0sCand.px(), k0sCand.py(), k0sCand.pz(), MassK0Short); - lResoKstar = lDecayDaughter_pi + lDecayDaughter_K0s; - lResonanceK1 = lResoKstar + lBachelor_pi; - - //QA plots for Kstar - if constexpr (!IsMix) { - if (cfgFillQAPlots) { - histos.fill(HIST("QA/before/hpT_Kstar"), lResoKstar.Pt()); - histos.fill(HIST("QA/before/hy_Kstar"), lResoKstar.Rapidity()); - histos.fill(HIST("QA/before/kstarinvmass"), lResoKstar.M()); - } - } - - if (lResoKstar.Rapidity() > KstarCuts.cfgKstarMaxRap || lResoKstar.Rapidity() < KstarCuts.cfgKstarMinRap) - continue; - if (lResoKstar.Pt() < KstarCuts.cfgKstarMinPt) - continue; - if (std::fabs(lResoKstar.M() - MassKPlusStar892) > KstarCuts.cfgKstarMassWindow) - continue; - - if constexpr (!IsMix) { - if (cfgFillQAPlots) { - histos.fill(HIST("QA/after/hpT_Kstar"), lResoKstar.Pt()); - histos.fill(HIST("QA/after/hy_Kstar"), lResoKstar.Rapidity()); - histos.fill(HIST("QA/after/kstarinvmass"), lResoKstar.M()); - } - histos.fill(HIST("hInvmass_Kstar"), lCentrality, lResoKstar.Pt(), lResoKstar.M()); - }//IsMix - - - lPairK0sPiSec = lDecayDaughter_K0s + lDecayDaughter_pi; - lPairK0sPiBach = lDecayDaughter_K0s + lBachelor_pi; - lPairPiPi = lDecayDaughter_pi + lBachelor_pi; - - float m2K0sPiSec = lPairK0sPiSec.M2(); - //float m2K0sPiBach = lPairK0sPiBach.M2(); - float m2PiPi = lPairPiPi.M2(); - - //QA plots for K1 + for (const auto& strackIndex : strackIndices) { + auto sTrack = dTracks2.rawIteratorAt(strackIndex); + + if (bTrack.index() == sTrack.index()) + continue; + + for (const auto& k0sIndex : k0sIndices) { + auto k0sCand = dTracks3.rawIteratorAt(k0sIndex); + + auto posDauTrack = k0sCand.template posTrack_as(); + auto negDauTrack = k0sCand.template negTrack_as(); + + if (bTrack.index() == posDauTrack.index() || bTrack.index() == negDauTrack.index()) + continue; + if (sTrack.index() == posDauTrack.index() || sTrack.index() == negDauTrack.index()) + continue; + + lBachelor_pi = LorentzVectorSetXYZM(bTrack.px(), bTrack.py(), bTrack.pz(), MassPionCharged); + lDecayDaughter_pi = LorentzVectorSetXYZM(sTrack.px(), sTrack.py(), sTrack.pz(), MassPionCharged); + lDecayDaughter_K0s = LorentzVectorSetXYZM(k0sCand.px(), k0sCand.py(), k0sCand.pz(), MassK0Short); + lResoKstar = lDecayDaughter_pi + lDecayDaughter_K0s; + lResonanceK1 = lResoKstar + lBachelor_pi; + + // QA plots for Kstar + if constexpr (!IsMix) { + if (cfgFillQAPlots) { + histos.fill(HIST("QA/before/hpT_Kstar"), lResoKstar.Pt()); + histos.fill(HIST("QA/before/hy_Kstar"), lResoKstar.Rapidity()); + histos.fill(HIST("QA/before/kstarinvmass"), lResoKstar.M()); + } + } + + if (lResoKstar.Rapidity() > KstarCuts.cfgKstarMaxRap || lResoKstar.Rapidity() < KstarCuts.cfgKstarMinRap) + continue; + if (lResoKstar.Pt() < KstarCuts.cfgKstarMinPt) + continue; + if (std::fabs(lResoKstar.M() - MassKPlusStar892) > KstarCuts.cfgKstarMassWindow) + continue; + + if constexpr (!IsMix) { + if (cfgFillQAPlots) { + histos.fill(HIST("QA/after/hpT_Kstar"), lResoKstar.Pt()); + histos.fill(HIST("QA/after/hy_Kstar"), lResoKstar.Rapidity()); + histos.fill(HIST("QA/after/kstarinvmass"), lResoKstar.M()); + } + histos.fill(HIST("hInvmass_Kstar"), lCentrality, lResoKstar.Pt(), lResoKstar.M()); + } // IsMix + + lPairK0sPiSec = lDecayDaughter_K0s + lDecayDaughter_pi; + lPairK0sPiBach = lDecayDaughter_K0s + lBachelor_pi; + lPairPiPi = lDecayDaughter_pi + lBachelor_pi; + + float m2K0sPiSec = lPairK0sPiSec.M2(); + // float m2K0sPiBach = lPairK0sPiBach.M2(); + float m2PiPi = lPairPiPi.M2(); + + // QA plots for K1 + if constexpr (!IsMix) { + if (cfgFillQAPlots) { + histos.fill(HIST("QA/before/hpT_K1"), lResonanceK1.Pt()); + histos.fill(HIST("QA/before/hy_K1"), lResonanceK1.Rapidity()); + if (bTrack.sign() * sTrack.sign() < 0) { + histos.fill(HIST("QA/before/K1invmass"), lResonanceK1.M()); + histos.fill(HIST("QA/before/K1DalitzOS"), m2K0sPiSec, m2PiPi); + } else { + histos.fill(HIST("QA/before/K1invmassLS"), lResonanceK1.M()); + histos.fill(HIST("QA/before/K1DalitzLS"), m2K0sPiSec, m2PiPi); + } + } + } // IsMix + + if (lResonanceK1.Rapidity() > K1Cuts.cfgK1MaxRap || lResonanceK1.Rapidity() < K1Cuts.cfgK1MinRap) + continue; + if (lResonanceK1.Pt() < K1Cuts.cfgK1MinPt) + continue; + if (lPairPiPi.Pt() < cfgPiPiMinPt) + continue; + + auto k1Region = getK1MassRegion(lResonanceK1.M()); + if constexpr (!IsMix) { - if (cfgFillQAPlots) { - histos.fill(HIST("QA/before/hpT_K1"), lResonanceK1.Pt()); - histos.fill(HIST("QA/before/hy_K1"), lResonanceK1.Rapidity()); - if (bTrack.sign() * sTrack.sign() < 0){ - histos.fill(HIST("QA/before/K1invmass"), lResonanceK1.M()); - histos.fill(HIST("QA/before/K1DalitzOS"), m2K0sPiSec, m2PiPi); - } else { - histos.fill(HIST("QA/before/K1invmassLS"), lResonanceK1.M()); - histos.fill(HIST("QA/before/K1DalitzLS"), m2K0sPiSec, m2PiPi); - } - } - }//IsMix - - if (lResonanceK1.Rapidity() > K1Cuts.cfgK1MaxRap || lResonanceK1.Rapidity() < K1Cuts.cfgK1MinRap) - continue; - if (lResonanceK1.Pt() < K1Cuts.cfgK1MinPt) - continue; - if (lPairPiPi.Pt() < cfgPiPiMinPt) - continue; - - auto k1Region = getK1MassRegion(lResonanceK1.M()); - - if constexpr (!IsMix) { - if (cfgFillQAPlots) { - histos.fill(HIST("QA/after/hpT_K1"), lResonanceK1.Pt()); - histos.fill(HIST("QA/after/hy_K1"), lResonanceK1.Rapidity()); - if (bTrack.sign() * sTrack.sign() < 0){ - histos.fill(HIST("QA/after/K1invmass"), lResonanceK1.M()); - //histos.fill(HIST("QA/after/K1DalitzOS"), m2K0sPiSec, m2PiPi); - if (k1Region == K1MassRegion::Signal) { - histos.fill(HIST("QA/after/K1DalitzOS_Signal"), m2K0sPiSec, m2PiPi); - } else if (k1Region == K1MassRegion::SBLeft) { - histos.fill(HIST("QA/after/K1DalitzOS_SBLeft"), m2K0sPiSec, m2PiPi); - } else if (k1Region == K1MassRegion::SBRight) { - histos.fill(HIST("QA/after/K1DalitzOS_SBRight"), m2K0sPiSec, m2PiPi); - } - } else { - histos.fill(HIST("QA/after/K1invmassLS"), lResonanceK1.M()); - //histos.fill(HIST("QA/after/K1DalitzLS"), m2K0sPiSec, m2PiPi); - if (k1Region == K1MassRegion::Signal) { - histos.fill(HIST("QA/after/K1DalitzLS_Signal"), m2K0sPiSec, m2PiPi); - } else if (k1Region == K1MassRegion::SBLeft) { - histos.fill(HIST("QA/after/K1DalitzLS_SBLeft"), m2K0sPiSec, m2PiPi); - } else if (k1Region == K1MassRegion::SBRight) { - histos.fill(HIST("QA/after/K1DalitzLS_SBRight"), m2K0sPiSec, m2PiPi); - } - } - } - - if (bTrack.sign() * sTrack.sign() < 0){ - //bTrack sign minus for particle, plus for anti-particle - unsigned int typeK1 = bTrack.sign() < 0 ? BinType::kK1P : BinType::kK1A; - histos.fill(HIST("hInvmass_K1"), typeK1, lCentrality, lResonanceK1.Pt(), lResonanceK1.M()); - } else { - unsigned int typeK1 = bTrack.sign() < 0 ? BinType::kK1P_Like : BinType::kK1A_Like; - histos.fill(HIST("hInvmass_K1"), typeK1, lCentrality, lResonanceK1.Pt(), lResonanceK1.M()); - } - - if (BkgEstimationConfig.cfgFillRotBkg) { - for(int i=0; i