From 0d38d16fdf015efa155061c4360844c5ebd76815 Mon Sep 17 00:00:00 2001 From: SuJeong Ji <120470463+SuJeong-Ji@users.noreply.github.com> Date: Wed, 3 Sep 2025 11:31:33 +0900 Subject: [PATCH 01/11] Add rapidity cut for K0s daughters --- PWGLF/Tasks/Resonances/chk892Flow.cxx | 557 ++++++++++++++------------ 1 file changed, 306 insertions(+), 251 deletions(-) diff --git a/PWGLF/Tasks/Resonances/chk892Flow.cxx b/PWGLF/Tasks/Resonances/chk892Flow.cxx index 2c616d81406..51c05c4e02c 100644 --- a/PWGLF/Tasks/Resonances/chk892Flow.cxx +++ b/PWGLF/Tasks/Resonances/chk892Flow.cxx @@ -18,7 +18,6 @@ #include #include #include -#include #include #include #include @@ -29,12 +28,15 @@ #include #include #include +#include +#include #include "TRandom3.h" #include "TF1.h" #include "TVector2.h" #include "Math/Vector3D.h" #include "Math/Vector4D.h" +#include "Math/RotationZ.h" #include "Math/GenVector/Boost.h" #include @@ -47,6 +49,7 @@ #include "Framework/ASoAHelpers.h" #include "Framework/StaticFor.h" #include "DCAFitter/DCAFitterN.h" +#include "Framework/EndOfStreamContext.h" #include "Common/DataModel/PIDResponse.h" #include "Common/DataModel/Multiplicity.h" @@ -80,8 +83,10 @@ using namespace o2::soa; using namespace o2::constants::physics; using namespace o2::aod::rctsel; -struct Chk892Flow { - enum BinType : unsigned int { +struct Chk892Flow +{ + enum BinType : unsigned int + { kKstarP = 0, kKstarN, kKstarP_Mix, @@ -91,33 +96,71 @@ struct Chk892Flow { kTYEnd }; + enum class K0sCut + { + DauDCA, // lDauDCA <= cfgSecondaryDauDCAMax + PosDCAtoPVMin, // lDauPosDCAtoPV >= min + NegDCAtoPVMin, // lDauNegDCAtoPV >= min + RadiusWindow, // cfgSecondaryRadiusMin <= lRadius <= cfgSecondaryRadiusMax + DCAtoPVMax, // lDCAtoPV <= max + CPAMin, // lCPA >= min + ProperTauMax, // lPropTauK0s <= max + Armenteros, // qtarm >= param * |alpha| + MassWindow, // |mK0s - m0| <= window + LambdaMassHypo // NOT(lambda-window) + }; + + std::array, 10> hN1NoCut{}; + std::array, 10> hN1Pass{}; + + static constexpr const char *cutTag[] = { + "DauDCA", "PosDCA", "NegDCA", "Radius", "DCAtoPV", "CPA", "Tau", "Arm", "Mass", "LambdaHypo"}; + static constexpr K0sCut kCutsToTest[] = { + K0sCut::DauDCA, K0sCut::PosDCAtoPVMin, K0sCut::NegDCAtoPVMin, + K0sCut::RadiusWindow, K0sCut::DCAtoPVMax, K0sCut::CPAMin, + K0sCut::ProperTauMax, K0sCut::Armenteros, K0sCut::MassWindow, K0sCut::LambdaMassHypo}; + + static constexpr size_t NCuts = sizeof(kCutsToTest) / sizeof(kCutsToTest[0]); + SliceCache cache; Preslice perCollision = aod::track::collisionId; using EventCandidates = soa::Join; - using TrackCandidates = soa::Join; + // using TrackCandidates = soa::Join; + using TrackCandidates = soa::Join; using V0Candidates = aod::V0Datas; + // for MC reco using MCEventCandidates = soa::Join; - using MCTrackCandidates = soa::Join; + using MCTrackCandidates = soa::Join; //, aod::McParticles>; using MCV0Candidates = soa::Join; + // for MC truth + using MCTrueEventCandidates = aod::McCollisions; + using MCTrueTrackCandidates = aod::McParticles; + + using LorentzVectorSetXYZM = ROOT::Math::LorentzVector>; + HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; Service ccdb; o2::ccdb::CcdbApi ccdbApi; + Service pdg; - struct : ConfigurableGroup { + struct : ConfigurableGroup + { Configurable cfgURL{"cfgURL", "http://alice-ccdb.cern.ch", "Address of the CCDB to browse"}; } CCDBConfig; // Configurable nolaterthan{"ccdb-no-later-than", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "Latest acceptable timestamp of creation for the object"}; // Configurables - struct : ConfigurableGroup { + struct : ConfigurableGroup + { ConfigurableAxis cfgBinsPt{"cfgBinsPt", {VARIABLE_WIDTH, 0.0, 0.1, 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, 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8, 4.9, 5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 5.9, 6.0, 6.1, 6.2, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 6.9, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.6, 7.7, 7.8, 7.9, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5, 8.6, 8.7, 8.8, 8.9, 9.0, 9.1, 9.2, 9.3, 9.4, 9.5, 9.6, 9.7, 9.8, 9.9, 10.0, 10.1, 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 11.0, 11.1, 11.2, 11.3, 11.4, 11.5, 11.6, 11.7, 11.8, 11.9, 12.0, 12.1, 12.2, 12.3, 12.4, 12.5, 12.6, 12.7, 12.8, 12.9, 13.0, 13.1, 13.2, 13.3, 13.4, 13.5, 13.6, 13.7, 13.8, 13.9, 14.0, 14.1, 14.2, 14.3, 14.4, 14.5, 14.6, 14.7, 14.8, 14.9, 15.0}, "Binning of the pT axis"}; ConfigurableAxis cfgBinsPtQA{"cfgBinsPtQA", {VARIABLE_WIDTH, 0.0, 0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.2, 2.4, 2.6, 2.8, 3.0, 3.2, 3.4, 3.6, 3.8, 4.0, 4.2, 4.4, 4.6, 4.8, 5.0, 5.2, 5.4, 5.6, 5.8, 6.0, 6.2, 6.4, 6.6, 6.8, 7.0, 7.2, 7.4, 7.6, 7.8, 8.0, 8.2, 8.4, 8.6, 8.8, 9.0, 9.2, 9.4, 9.6, 9.8, 10.0}, "Binning of the pT axis"}; ConfigurableAxis cfgBinsCent{"cfgBinsCent", {VARIABLE_WIDTH, 0.0, 1.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 110.0}, "Binning of the centrality axis"}; ConfigurableAxis cfgBinsVtxZ{"cfgBinsVtxZ", {VARIABLE_WIDTH, -10.0, -9.0, -8.0, -7.0, -6.0, -5.0, -4.0, -3.0, -2.0, -1.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0}, "Binning of the z-vertex axis"}; + ConfigurableAxis binsImpactPar{"binsImpactPar", {VARIABLE_WIDTH, 0.0, 3.00065, 4.28798, 6.14552, 7.6196, 8.90942, 10.0897, 11.2002, 12.2709, 13.3167, 14.4173, 23.2518}, "Binning of the impact parameter axis"}; ConfigurableAxis cfgBinsOccu{"cfgBinsOccu", {VARIABLE_WIDTH, 0, 500, 1000, 2500, 9999}, "Binning of the occupancy axis"}; Configurable cNbinsDiv{"cNbinsDiv", 1, "Integer to divide the number of bins"}; Configurable cNbinsDivQA{"cNbinsDivQA", 1, "Integer to divide the number of bins for QA"}; @@ -125,7 +168,8 @@ struct Chk892Flow { ConfigurableAxis cfgAxisPhi{"cfgAxisPhi", {8, 0, constants::math::PI}, "Binning of the #phi axis"}; } AxisConfig; - struct : ConfigurableGroup { + struct : ConfigurableGroup + { Configurable cfgFillQAPlots{"cfgFillQAPlots", true, "Fill QA plots"}; Configurable cfgQvecSel{"cfgQvecSel", true, "Reject events when no QVector"}; Configurable cfgCentEst{"cfgCentEst", 1, "Centrality estimator, 1: FT0C, 2: FT0M"}; @@ -135,8 +179,11 @@ struct Chk892Flow { // Event cuts o2::analysis::CollisonCuts colCuts; - struct : ConfigurableGroup { + struct : ConfigurableGroup + { Configurable cfgEvtZvtx{"cfgEvtZvtx", 10.f, "Evt sel: Max. z-Vertex (cm)"}; + Configurable cfgEvtZvtxMC{"cfgEvtZvtxMC", 10.f, "MC Evt sel: Max z-vertex (cm)"}; + Configurable cfgIsPhysicalPrimaryMC{"cfgIsPhysicalPrimaryMC", true, "Physical primary selection for MC parents"}; // Configurable cfgEvtOccupancyInTimeRangeMax{"cfgEvtOccupancyInTimeRangeMax", -1, "Evt sel: maximum track occupancy"}; // Configurable cfgEvtOccupancyInTimeRangeMin{"cfgEvtOccupancyInTimeRangeMin", -1, "Evt sel: minimum track occupancy"}; Configurable cfgEvtTriggerCheck{"cfgEvtTriggerCheck", false, "Evt sel: check for trigger"}; @@ -158,7 +205,8 @@ struct Chk892Flow { RCTFlagsChecker rctChecker; /// PID Selections, pion - struct : ConfigurableGroup { + struct : ConfigurableGroup + { Configurable cfgTPConly{"cfgTPConly", false, "Use only TPC for PID"}; // bool Configurable cfgMaxTPCnSigmaPion{"cfgMaxTPCnSigmaPion", 3.0, "TPC nSigma cut for Pion"}; // TPC Configurable cfgMaxTOFnSigmaPion{"cfgMaxTOFnSigmaPion", 3.0, "TOF nSigma cut for Pion"}; // TOF @@ -167,7 +215,8 @@ struct Chk892Flow { } PIDCuts; // Track selections - struct : ConfigurableGroup { + struct : ConfigurableGroup + { Configurable cfgMinPtcut{"cfgMinPtcut", 0.6, "Track minium pt cut"}; Configurable cfgMaxEtacut{"cfgMaxEtacut", 0.8, "Track maximum eta cut"}; Configurable cfgPrimaryTrack{"cfgPrimaryTrack", true, "Primary track selection"}; // kGoldenChi2 | kDCAxy | kDCAz @@ -191,19 +240,22 @@ struct Chk892Flow { } TrackCuts; // Secondary Selection - struct : ConfigurableGroup { + struct : ConfigurableGroup + { Configurable cfgReturnFlag{"cfgReturnFlag", false, "Return Flag for debugging"}; Configurable cfgSecondaryRequire{"cfgSecondaryRequire", true, "Secondary cuts on/off"}; Configurable cfgSecondaryArmenterosCut{"cfgSecondaryArmenterosCut", true, "cut on Armenteros-Podolanski graph"}; - Configurable cfgSecondaryCrossMassHypothesisCut{"cfgSecondaryCrossMassHypothesisCut", false, "Apply cut based on the lambda mass hypothesis"}; + Configurable cfgSecondaryCrossMassHypothesisCut{"cfgSecondaryCrossMassHypothesisCut", true, "Apply cut based on the lambda mass hypothesis"}; Configurable cfgByPassDauPIDSelection{"cfgByPassDauPIDSelection", true, "Bypass Daughters PID selection"}; + Configurable cfgByPassDauRapiditySelection{"cfgByPassDauRapiditySelection", false, "Bypass Daughters Rapidity selection"}; Configurable cfgSecondaryDauDCAMax{"cfgSecondaryDauDCAMax", 0.2, "Maximum DCA Secondary daughters to PV"}; Configurable cfgSecondaryDauPosDCAtoPVMin{"cfgSecondaryDauPosDCAtoPVMin", 0.1, "Minimum DCA Secondary positive daughters to PV"}; Configurable cfgSecondaryDauNegDCAtoPVMin{"cfgSecondaryDauNegDCAtoPVMin", 0.1, "Minimum DCA Secondary negative daughters to PV"}; Configurable cfgSecondaryPtMin{"cfgSecondaryPtMin", 0.f, "Minimum transverse momentum of Secondary"}; Configurable cfgSecondaryRapidityMax{"cfgSecondaryRapidityMax", 0.8, "Maximum rapidity of Secondary"}; + Configurable cfgSecondaryDauRapidityMax{"cfgSecondaryDauRapidityMax", 0.3, "Maximum rapidity of Secondary daughters"}; Configurable cfgSecondaryRadiusMin{"cfgSecondaryRadiusMin", 0.0, "Minimum transverse radius of Secondary"}; Configurable cfgSecondaryRadiusMax{"cfgSecondaryRadiusMax", 999.9, "Maximum transverse radius of Secondary"}; Configurable cfgSecondaryCosPAMin{"cfgSecondaryCosPAMin", 0.995, "Mininum cosine pointing angle of Secondary"}; @@ -215,13 +267,15 @@ struct Chk892Flow { } SecondaryCuts; // K* selection - struct : ConfigurableGroup { + struct : ConfigurableGroup + { Configurable cfgKstarMaxRap{"cfgKstarMaxRap", 0.5, "Kstar maximum rapidity"}; Configurable cfgKstarMinRap{"cfgKstarMinRap", -0.5, "Kstar minimum rapidity"}; } KstarCuts; // Confs from flow analysis - struct : ConfigurableGroup { + struct : ConfigurableGroup + { Configurable cfgnMods{"cfgnMods", 2, "The number of modulations of interest starting from 2"}; Configurable cfgNQvec{"cfgNQvec", 7, "The number of total Qvectors for looping over the task"}; @@ -231,7 +285,8 @@ struct Chk892Flow { } EventPlaneConfig; // Bkg estimation - struct : ConfigurableGroup { + struct : ConfigurableGroup + { Configurable cfgFillRotBkg{"cfgFillRotBkg", true, "Fill rotated background"}; Configurable cfgMinRot{"cfgMinRot", 5.0 * constants::math::PI / 6.0, "Minimum of rotation"}; Configurable cfgMaxRot{"cfgMaxRot", 7.0 * constants::math::PI / 6.0, "Maximum of rotation"}; @@ -254,7 +309,7 @@ struct Chk892Flow { int kPDGK0 = kK0; int kKstarPlus = o2::constants::physics::Pdg::kKPlusStar892; - void init(o2::framework::InitContext&) + void init(o2::framework::InitContext &) { lCentrality = -999; @@ -294,7 +349,8 @@ struct Chk892Flow { AxisSpec axisType = {BinType::kTYEnd, 0, BinType::kTYEnd, "Type of bin with charge and mix"}; AxisSpec mcLabelAxis = {5, -0.5, 4.5, "MC Label"}; - if (SecondaryCuts.cfgReturnFlag) { + if (SecondaryCuts.cfgReturnFlag) + { histos.add("QA/K0sCutCheck", "Check K0s cut", HistType::kTH1D, {AxisSpec{13, -0.5, 12.5, "Check"}}); } histos.add("QA/before/CentDist", "Centrality distribution", {HistType::kTH1D, {centAxis}}); @@ -309,15 +365,18 @@ struct Chk892Flow { histos.add("QA/EP/hEPResAC", "cos(n(A-C))", {HistType::kTH2D, {centAxis, epAxis}}); histos.add("QA/EP/hEPResBC", "cos(n(B-C))", {HistType::kTH2D, {centAxis, epAxis}}); - if (AnalysisConfig.cfgUseScalProduct) { + if (AnalysisConfig.cfgUseScalProduct) + { histos.add("QA/EP/hEPSPResAB", "cos(n(A-B))", {HistType::kTH2D, {centAxis, epAxis}}); histos.add("QA/EP/hEPSPResAC", "cos(n(A-C))", {HistType::kTH2D, {centAxis, epAxis}}); histos.add("QA/EP/hEPSPResBC", "cos(n(B-C))", {HistType::kTH2D, {centAxis, epAxis}}); } - if (AnalysisConfig.cfgFillQAPlots) { + if (AnalysisConfig.cfgFillQAPlots) + { // Rotated background - if (BkgEstimationConfig.cfgFillRotBkg) { + if (BkgEstimationConfig.cfgFillRotBkg) + { histos.add("QA/RotBkg/hRotBkg", "Rotated angle of rotated background", HistType::kTH1F, {{360, 0.0, o2::constants::math::TwoPI}}); } @@ -394,68 +453,29 @@ struct Chk892Flow { histos.add("QA/after/kstarv2vsinvmass", "Invariant mass vs v2 of unlike-sign chK(892)", HistType::kTH2D, {invMassAxisReso, v2Axis}); histos.add("QA/after/kstarinvmass_Mix", "Invariant mass of unlike-sign chK(892) from mixed event", HistType::kTH1D, {invMassAxisReso}); - // MC - if (doprocessMC) { - // Bachelor pion - histos.add("QAMC/trkbpionDCAxy", "DCAxy distribution of bachelor pion candidates", HistType::kTH1D, {dcaxyAxis}); - histos.add("QAMC/trkbpionDCAz", "DCAz distribution of bachelor pion candidates", HistType::kTH1D, {dcazAxis}); - histos.add("QAMC/trkbpionpT", "pT distribution of bachelor pion candidates", HistType::kTH1D, {ptAxis}); - histos.add("QAMC/trkbpionTPCPID", "TPC PID of bachelor pion candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); - histos.add("QAMC/trkbpionTOFPID", "TOF PID of bachelor pion candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); - histos.add("QAMC/trkbpionTPCTOFPID", "TPC-TOF PID map of bachelor pion candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); - - // Secondary pion 1 - histos.add("QAMC/trkppionDCAxy", "DCAxy distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcaxyAxis}); - histos.add("QAMC/trkppionDCAz", "DCAz distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcazAxis}); - histos.add("QAMC/trkppionpT", "pT distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {ptAxis}); - histos.add("QAMC/trkppionTPCPID", "TPC PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); - histos.add("QAMC/trkppionTOFPID", "TOF PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); - histos.add("QAMC/trkppionTPCTOFPID", "TPC-TOF PID map of secondary pion 1 (positive) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); - - // Secondary pion 2 - histos.add("QAMC/trknpionTPCPID", "TPC PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); - histos.add("QAMC/trknpionTOFPID", "TOF PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); - histos.add("QAMC/trknpionTPCTOFPID", "TPC-TOF PID map of secondary pion 2 (negative) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); - histos.add("QAMC/trknpionpT", "pT distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {ptAxis}); - histos.add("QAMC/trknpionDCAxy", "DCAxy distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {dcaxyAxis}); - histos.add("QAMC/trknpionDCAz", "DCAz distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {dcazAxis}); - - // Secondary Resonance (K0s candidates) - histos.add("QAMC/hDauDCASecondary", "DCA of daughters of secondary resonance", HistType::kTH1D, {dcaAxis}); - histos.add("QAMC/hDauPosDCAtoPVSecondary", "Pos DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); - histos.add("QAMC/hDauNegDCAtoPVSecondary", "Neg DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); - - histos.add("QAMC/hy_Secondary", "Rapidity distribution of secondary resonance", HistType::kTH1D, {yAxis}); - histos.add("QAMC/hCPASecondary", "Cosine pointing angle distribution of secondary resonance", HistType::kTH1D, {cpaAxis}); - histos.add("QAMC/hDCAtoPVSecondary", "DCA to PV distribution of secondary resonance", HistType::kTH1D, {dcaAxis}); - histos.add("QAMC/hPropTauSecondary", "Proper Lifetime distribution of secondary resonance", HistType::kTH1D, {tauAxis}); - histos.add("QAMC/hInvmassSecondary", "Invariant mass of unlike-sign secondary resonance", HistType::kTH1D, {invMassAxisK0s}); - - // K892 - histos.add("QAMC/KstarOA", "Opening angle of chK(892)", HistType::kTH1D, {AxisSpec{100, 0, 3.14, "Opening angle"}}); - histos.add("QAMC/KstarPairAsym", "Pair asymmetry of chK(892)", HistType::kTH1D, {AxisSpec{100, -1, 1, "Pair asymmetry"}}); - histos.add("QAMC/KstarRapidity", "Rapidity distribution of chK(892)", HistType::kTH1D, {yAxis}); - - histos.add("QAMC/kstarinvmass", "Invariant mass of unlike-sign chK(892)", HistType::kTH1D, {invMassAxisReso}); - histos.add("QAMC/k0sv2vsinvmass", "Invariant mass vs v2 of unlike-sign K0s", HistType::kTH2D, {invMassAxisK0s, v2Axis}); - histos.add("QAMC/kstarv2vsinvmass", "Invariant mass vs v2 of unlike-sign chK(892)", HistType::kTH2D, {invMassAxisReso, v2Axis}); - histos.add("QAMC/kstarinvmass_noKstar", "Invariant mass of unlike-sign no chK(892)", HistType::kTH1D, {invMassAxisReso}); - histos.add("QAMC/kstarv2vsinvmass_noKstar", "Invariant mass vs v2 of unlike-sign no chK(892)", HistType::kTH2D, {invMassAxisReso, v2Axis}); - } + LOG(info) << "Size of the histograms in spectraTOF"; + histos.print(); } // Invariant mass nSparse - if (AnalysisConfig.cfgFillAdditionalAxis) { + if (AnalysisConfig.cfgFillAdditionalAxis) + { histos.add("hInvmass_Kstar", "Invariant mass of unlike-sign chK(892)", HistType::kTHnSparseD, {axisType, centAxis, ptAxis, invMassAxisReso, v2Axis, phiAxis, occuAxis}); histos.add("hInvmass_K0s", "Invariant mass of unlike-sign K0s", HistType::kTHnSparseD, {centAxis, ptAxis, invMassAxisK0s, v2Axis, phiAxis, occuAxis}); - if (doprocessMC) { + if (doprocessMC) + { histos.add("hInvmass_Kstar_MC", "Invariant mass of unlike chK(892)", HistType::kTHnSparseD, {axisType, centAxis, ptAxis, invMassAxisReso, v2Axis, phiAxis, occuAxis}); + histos.add("hInvmass_K0s_MC", "Invariant mass of unlike K0s", HistType::kTHnSparseD, {centAxis, ptAxis, invMassAxisReso, v2Axis, phiAxis, occuAxis}); } - } else { + } + else + { histos.add("hInvmass_Kstar", "Invariant mass of unlike-sign chK(892)", HistType::kTHnSparseD, {axisType, centAxis, ptAxis, invMassAxisReso, v2Axis, occuAxis}); histos.add("hInvmass_K0s", "Invariant mass of unlike-sign K0s", HistType::kTHnSparseD, {centAxis, ptAxis, invMassAxisK0s, v2Axis, occuAxis}); - if (doprocessMC) { + if (doprocessMC) + { histos.add("hInvmass_Kstar_MC", "Invariant mass of unlike chK(892)", HistType::kTHnSparseD, {axisType, centAxis, ptAxis, invMassAxisReso, v2Axis, occuAxis}); + histos.add("hInvmass_K0s_MC", "Invariant mass of unlike K0s", HistType::kTHnSparseD, {centAxis, ptAxis, invMassAxisK0s, v2Axis, occuAxis}); } } @@ -463,72 +483,19 @@ struct Chk892Flow { lRefAId = getlDetId(EventPlaneConfig.cfgQvecRefAName); lRefBId = getlDetId(EventPlaneConfig.cfgQvecRefBName); - if (lDetId == lRefAId || lDetId == lRefBId || lRefAId == lRefBId) { + if (lDetId == lRefAId || lDetId == lRefBId || lRefAId == lRefBId) + { LOGF(info, "Wrong detector configuration \n The FT0C will be used to get Q-Vector \n The TPCpos and TPCneg will be used as reference systems"); lDetId = 0; lRefAId = 4; lRefBId = 5; } - if (EventPlaneConfig.cfgNQvec < 2) { + if (EventPlaneConfig.cfgNQvec < EventPlaneConfig.cfgnMods) + { LOG(fatal) << "nMode must be larger than 1, current input (cfgNQvec): " << EventPlaneConfig.cfgNQvec; } LOGF(info, "lDetId: %d, lRefAId: %d, lRefBId: %d", lDetId, lRefAId, lRefBId); - // MC - if (doprocessMC) { - // Bachelor pion - histos.add("QAMC/trkbpionDCAxy", "DCAxy distribution of bachelor pion candidates", HistType::kTH1D, {dcaxyAxis}); - histos.add("QAMC/trkbpionDCAz", "DCAz distribution of bachelor pion candidates", HistType::kTH1D, {dcazAxis}); - histos.add("QAMC/trkbpionpT", "pT distribution of bachelor pion candidates", HistType::kTH1D, {ptAxis}); - histos.add("QAMC/trkbpionTPCPID", "TPC PID of bachelor pion candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); - histos.add("QAMC/trkbpionTOFPID", "TOF PID of bachelor pion candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); - histos.add("QAMC/trkbpionTPCTOFPID", "TPC-TOF PID map of bachelor pion candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); - - // Secondary pion 1 - histos.add("QAMC/trkppionDCAxy", "DCAxy distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcaxyAxis}); - histos.add("QAMC/trkppionDCAz", "DCAz distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcazAxis}); - histos.add("QAMC/trkppionpT", "pT distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {ptAxis}); - histos.add("QAMC/trkppionTPCPID", "TPC PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); - histos.add("QAMC/trkppionTOFPID", "TOF PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); - histos.add("QAMC/trkppionTPCTOFPID", "TPC-TOF PID map of secondary pion 1 (positive) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); - - // Secondary pion 2 - histos.add("QAMC/trknpionTPCPID", "TPC PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); - histos.add("QAMC/trknpionTOFPID", "TOF PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); - histos.add("QAMC/trknpionTPCTOFPID", "TPC-TOF PID map of secondary pion 2 (negative) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); - histos.add("QAMC/trknpionpT", "pT distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {ptAxis}); - histos.add("QAMC/trknpionDCAxy", "DCAxy distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {dcaxyAxis}); - histos.add("QAMC/trknpionDCAz", "DCAz distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {dcazAxis}); - - // Secondary Resonance (K0s candidates) - histos.add("QAMC/hDauDCASecondary", "DCA of daughters of secondary resonance", HistType::kTH1D, {dcaAxis}); - histos.add("QAMC/hDauPosDCAtoPVSecondary", "Pos DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); - histos.add("QAMC/hDauNegDCAtoPVSecondary", "Neg DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); - - histos.add("QAMC/hy_Secondary", "Rapidity distribution of secondary resonance", HistType::kTH1D, {yAxis}); - histos.add("QAMC/hCPASecondary", "Cosine pointing angle distribution of secondary resonance", HistType::kTH1D, {cpaAxis}); - histos.add("QAMC/hDCAtoPVSecondary", "DCA to PV distribution of secondary resonance", HistType::kTH1D, {dcaAxis}); - histos.add("QAMC/hPropTauSecondary", "Proper Lifetime distribution of secondary resonance", HistType::kTH1D, {tauAxis}); - histos.add("QAMC/hInvmassSecondary", "Invariant mass of unlike-sign secondary resonance", HistType::kTH1D, {invMassAxisK0s}); - - // K892 - histos.add("QAMC/KstarOA", "Opening angle of chK(892)", HistType::kTH1D, {AxisSpec{100, 0, 3.14, "Opening angle"}}); - histos.add("QAMC/KstarPairAsym", "Pair asymmetry of chK(892)", HistType::kTH1D, {AxisSpec{100, -1, 1, "Pair asymmetry"}}); - histos.add("QAMC/KstarRapidity", "Rapidity distribution of chK(892)", HistType::kTH1D, {yAxis}); - - histos.add("QAMC/kstarinvmass", "Invariant mass of unlike-sign chK(892)", HistType::kTH1D, {invMassAxisReso}); - histos.add("QAMC/k0sv2vsinvmass", "Invariant mass vs v2 of unlike-sign K0s", HistType::kTH2D, {invMassAxisK0s, v2Axis}); - histos.add("QAMC/kstarv2vsinvmass", "Invariant mass vs v2 of unlike-sign chK(892)", HistType::kTH2D, {invMassAxisReso, v2Axis}); - histos.add("QAMC/kstarinvmass_noKstar", "Invariant mass of unlike-sign no chK(892)", HistType::kTH1D, {invMassAxisReso}); - histos.add("QAMC/kstarv2vsinvmass_noKstar", "Invariant mass vs v2 of unlike-sign no chK(892)", HistType::kTH2D, {invMassAxisReso, v2Axis}); - - if (AnalysisConfig.cfgFillAdditionalAxis) { - histos.add("hInvmass_Kstar_MC", "Invariant mass of unlike chK(892)", HistType::kTHnSparseD, {axisType, centAxis, ptAxis, invMassAxisReso, v2Axis, phiAxis, occuAxis}); - } else { - histos.add("hInvmass_Kstar_MC", "Invariant mass of unlike chK(892)", HistType::kTHnSparseD, {axisType, centAxis, ptAxis, invMassAxisReso, v2Axis, occuAxis}); - } - } - ccdb->setURL(CCDBConfig.cfgURL); ccdbApi.init("http://alice-ccdb.cern.ch"); ccdb->setCaching(true); @@ -538,44 +505,65 @@ struct Chk892Flow { // Print output histograms statistics LOG(info) << "Size of the histograms in chK(892) Analysis Task"; histos.print(); - } + } // init + + const int kCentFT0C = 1; + const int kCentFT0M = 2; + const float kInvalidCentrality = -999.f; template - float getCentrality(CollisionType const& collision) + float getCentrality(CollisionType const &collision) { - if (AnalysisConfig.cfgCentEst == 1) { + if (AnalysisConfig.cfgCentEst == kCentFT0C) + { return collision.centFT0C(); - } else if (AnalysisConfig.cfgCentEst == 2) { + } + else if (AnalysisConfig.cfgCentEst == kCentFT0M) + { return collision.centFT0M(); - } else { - return -999; + } + else + { + return kInvalidCentrality; } } template - int getlDetId(DetNameType const& name) + int getlDetId(DetNameType const &name) { - LOGF(info, "GetlDetID running"); - if (name.value == "FT0C") { + if (name.value == "FT0C") + { return 0; - } else if (name.value == "FT0A") { + } + else if (name.value == "FT0A") + { return 1; - } else if (name.value == "FT0M") { + } + else if (name.value == "FT0M") + { return 2; - } else if (name.value == "FV0A") { + } + else if (name.value == "FV0A") + { return 3; - } else if (name.value == "TPCpos") { + } + else if (name.value == "TPCpos") + { return 4; - } else if (name.value == "TPCneg") { + } + else if (name.value == "TPCneg") + { return 5; - } else { + } + else + { return false; } } // Track selection template - bool trackCut(TrackType const& track) + bool trackCut(TrackType const &track) { // basic track cuts if (std::abs(track.pt()) < TrackCuts.cfgMinPtcut) @@ -610,11 +598,14 @@ struct Chk892Flow { return false; if (TrackCuts.cfgPrimaryTrack && !track.isPrimaryTrack()) return false; - if (TrackCuts.cfgpTdepDCAxyCut) { + if (TrackCuts.cfgpTdepDCAxyCut) + { // Tuned on the LHC22f anchored MC LHC23d1d on primary pions. 7 Sigmas of the resolution if (std::abs(track.dcaXY()) > (0.004 + (0.013 / track.pt()))) return false; - } else { + } + else + { if (std::abs(track.dcaXY()) > TrackCuts.cfgMaxbDCArToPVcut) return false; } @@ -625,22 +616,26 @@ struct Chk892Flow { // PID selection tools template - bool selectionPIDPion(TrackType const& candidate) + bool selectionPIDPion(TrackType const &candidate) { bool tpcPIDPassed = std::abs(candidate.tpcNSigmaPi()) < PIDCuts.cfgMaxTPCnSigmaPion; bool tofPIDPassed = false; - if (PIDCuts.cfgTPConly) { + if (PIDCuts.cfgTPConly) + { return tpcPIDPassed; } - if (candidate.hasTOF()) { + if (candidate.hasTOF()) + { tofPIDPassed = std::abs(candidate.tofNSigmaPi()) < PIDCuts.cfgMaxTOFnSigmaPion || (PIDCuts.cfgNsigmaCutCombinedPion > 0 && candidate.tpcNSigmaPi() * candidate.tpcNSigmaPi() + - candidate.tofNSigmaPi() * candidate.tofNSigmaPi() < - PIDCuts.cfgNsigmaCutCombinedPion * PIDCuts.cfgNsigmaCutCombinedPion); - } else { + candidate.tofNSigmaPi() * candidate.tofNSigmaPi() < + PIDCuts.cfgNsigmaCutCombinedPion * PIDCuts.cfgNsigmaCutCombinedPion); + } + else + { tofPIDPassed = PIDCuts.cfgTOFVeto; } @@ -648,22 +643,23 @@ struct Chk892Flow { } template - bool selectionK0s(CollisionType const& collision, K0sType const& candidate) + bool selectionK0s(CollisionType const &collision, K0sType const &candidate) { auto lDauDCA = candidate.dcaV0daughters(); - auto lDauPosDCAtoPV = std::abs(candidate.dcapostopv()); - auto lDauNegDCAtoPV = std::abs(candidate.dcanegtopv()); + auto lDauPosDCAtoPV = std::fabs(candidate.dcapostopv()); + auto lDauNegDCAtoPV = std::fabs(candidate.dcanegtopv()); auto lPt = candidate.pt(); auto lRapidity = candidate.yK0Short(); auto lRadius = candidate.v0radius(); - auto lDCAtoPV = candidate.dcav0topv(); + auto lDCAtoPV = std::fabs(candidate.dcav0topv()); auto lCPA = candidate.v0cosPA(); auto lPropTauK0s = candidate.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * MassK0Short; auto lMk0s = candidate.mK0Short(); auto lMLambda = candidate.mLambda(); auto lMALambda = candidate.mAntiLambda(); - auto checkCommonCuts = [&]() { + auto checkCommonCuts = [&]() + { if (lDauDCA > SecondaryCuts.cfgSecondaryDauDCAMax) return false; if (lDauPosDCAtoPV < SecondaryCuts.cfgSecondaryDauPosDCAtoPVMin) @@ -682,7 +678,7 @@ struct Chk892Flow { return false; if (lPropTauK0s > SecondaryCuts.cfgSecondaryProperLifetimeMax) return false; - if (candidate.qtarm() < SecondaryCuts.cfgSecondaryparamArmenterosCut * std::abs(candidate.alpha())) + if (candidate.qtarm() < SecondaryCuts.cfgSecondaryparamArmenterosCut * std::fabs(candidate.alpha())) return false; if (std::fabs(lMk0s - MassK0Short) > SecondaryCuts.cfgSecondaryMassWindow) return false; @@ -692,74 +688,92 @@ struct Chk892Flow { return true; }; - if (SecondaryCuts.cfgReturnFlag) { // For cut study + if (SecondaryCuts.cfgReturnFlag) + { // For cut study bool returnFlag = true; histos.fill(HIST("QA/K0sCutCheck"), 0); - if (lDauDCA > SecondaryCuts.cfgSecondaryDauDCAMax) { + if (lDauDCA > SecondaryCuts.cfgSecondaryDauDCAMax) + { histos.fill(HIST("QA/K0sCutCheck"), 1); returnFlag = false; } - if (lDauPosDCAtoPV < SecondaryCuts.cfgSecondaryDauPosDCAtoPVMin) { + if (lDauPosDCAtoPV < SecondaryCuts.cfgSecondaryDauPosDCAtoPVMin) + { histos.fill(HIST("QA/K0sCutCheck"), 2); returnFlag = false; } - if (lDauNegDCAtoPV < SecondaryCuts.cfgSecondaryDauNegDCAtoPVMin) { + if (lDauNegDCAtoPV < SecondaryCuts.cfgSecondaryDauNegDCAtoPVMin) + { histos.fill(HIST("QA/K0sCutCheck"), 3); returnFlag = false; } - if (lPt < SecondaryCuts.cfgSecondaryPtMin) { + if (lPt < SecondaryCuts.cfgSecondaryPtMin) + { histos.fill(HIST("QA/K0sCutCheck"), 4); returnFlag = false; } - if (std::fabs(lRapidity) > SecondaryCuts.cfgSecondaryRapidityMax) { + if (std::fabs(lRapidity) > SecondaryCuts.cfgSecondaryRapidityMax) + { histos.fill(HIST("QA/K0sCutCheck"), 5); returnFlag = false; } - if (lRadius < SecondaryCuts.cfgSecondaryRadiusMin || lRadius > SecondaryCuts.cfgSecondaryRadiusMax) { + if (lRadius < SecondaryCuts.cfgSecondaryRadiusMin || lRadius > SecondaryCuts.cfgSecondaryRadiusMax) + { histos.fill(HIST("QA/K0sCutCheck"), 6); returnFlag = false; } - if (lDCAtoPV > SecondaryCuts.cfgSecondaryDCAtoPVMax) { + if (lDCAtoPV > SecondaryCuts.cfgSecondaryDCAtoPVMax) + { histos.fill(HIST("QA/K0sCutCheck"), 7); returnFlag = false; } - if (lCPA < SecondaryCuts.cfgSecondaryCosPAMin) { + if (lCPA < SecondaryCuts.cfgSecondaryCosPAMin) + { histos.fill(HIST("QA/K0sCutCheck"), 8); returnFlag = false; } - if (lPropTauK0s > SecondaryCuts.cfgSecondaryProperLifetimeMax) { + if (lPropTauK0s > SecondaryCuts.cfgSecondaryProperLifetimeMax) + { histos.fill(HIST("QA/K0sCutCheck"), 9); returnFlag = false; } - if (candidate.qtarm() < SecondaryCuts.cfgSecondaryparamArmenterosCut * std::abs(candidate.alpha())) { + if (candidate.qtarm() < SecondaryCuts.cfgSecondaryparamArmenterosCut * std::abs(candidate.alpha())) + { histos.fill(HIST("QA/K0sCutCheck"), 10); returnFlag = false; } - if (std::fabs(lMk0s - MassK0Short) > SecondaryCuts.cfgSecondaryMassWindow) { + if (std::fabs(lMk0s - MassK0Short) > SecondaryCuts.cfgSecondaryMassWindow) + { histos.fill(HIST("QA/K0sCutCheck"), 11); returnFlag = false; } if (SecondaryCuts.cfgSecondaryCrossMassHypothesisCut && - ((std::fabs(lMLambda - MassLambda0) < SecondaryCuts.cfgSecondaryCrossMassCutWindow) || (std::fabs(lMALambda - MassLambda0Bar) < SecondaryCuts.cfgSecondaryCrossMassCutWindow))) { + ((std::fabs(lMLambda - MassLambda0) < SecondaryCuts.cfgSecondaryCrossMassCutWindow) || (std::fabs(lMALambda - MassLambda0Bar) < SecondaryCuts.cfgSecondaryCrossMassCutWindow))) + { histos.fill(HIST("QA/K0sCutCheck"), 12); returnFlag = false; } return returnFlag; - } else { // normal usage - if (SecondaryCuts.cfgSecondaryRequire) { + } + else + { // normal usage + if (SecondaryCuts.cfgSecondaryRequire) + { return checkCommonCuts(); - } else { + } + else + { return std::fabs(lMk0s - MassK0Short) <= SecondaryCuts.cfgSecondaryMassWindow; // always apply mass window cut } } } // selectionK0s template - bool isTrueKstar(const TrackTemplate& bTrack, const V0Template& k0sCand) + bool isTrueKstar(const TrackTemplate &bTrack, const V0Template &k0sCand) { - if (std::abs(bTrack.PDGCode()) != kPiPlus) // Are you pion? + if (std::abs(bTrack.pdgCode()) != kPiPlus) // Are you pion? return false; - if (std::abs(k0sCand.PDGCode()) != kPDGK0s) // Are you K0s? + if (std::abs(k0sCand.pdgCode()) != kPDGK0s) // Are you K0s? return false; auto motherbTrack = bTrack.template mothers_as(); @@ -769,16 +783,16 @@ struct Chk892Flow { if (std::abs(motherbTrack.pdgCode()) != kKstarPlus) // Are you charged Kstar's daughter? return false; // Apply first since it's more restrictive - if (std::abs(motherkV0.pdgCode()) != 310) // Is it K0s? + if (std::abs(motherkV0.pdgCode()) != kPDGK0s) // Is it K0s? return false; // Check if K0s's mother is K0 (311) auto motherK0 = motherkV0.template mothers_as(); - if (std::abs(motherK0.pdgCode()) != 311) + if (std::abs(motherK0.pdgCode()) != kPDGK0) return false; // Check if K0's mother is Kstar (323) auto motherKstar = motherK0.template mothers_as(); - if (std::abs(motherKstar.pdgCode()) != 323) + if (std::abs(motherKstar.pdgCode()) != kKstarPlus) return false; // Check if bTrack and K0 have the same mother (global index) @@ -790,8 +804,8 @@ struct Chk892Flow { int count = 0; - template - void fillHistograms(const CollisionType& collision, const TracksType& dTracks1, const TracksTypeK0s& dTracks2, int nmode) + template + void fillHistograms(const CollisionType &collision, const TracksType &dTracks1, const TracksTypeK0s &dTracks2, int nmode) { histos.fill(HIST("QA/before/CentDist"), lCentrality); @@ -815,7 +829,8 @@ struct Chk892Flow { histos.fill(HIST("QA/EP/hEPResAC"), lCentrality, lEPResAC); histos.fill(HIST("QA/EP/hEPResBC"), lCentrality, lEPResBC); // Scalar product method - if (AnalysisConfig.cfgUseScalProduct) { + if (AnalysisConfig.cfgUseScalProduct) + { double lEPSPResAB = (collision.qvecRe()[lQvecDetInd] * collision.qvecRe()[lQvecRefAInd] + collision.qvecIm()[lQvecDetInd] * collision.qvecIm()[lQvecRefAInd]); double lEPSPResAC = (collision.qvecRe()[lQvecDetInd] * collision.qvecRe()[lQvecRefBInd] + collision.qvecIm()[lQvecDetInd] * collision.qvecIm()[lQvecRefBInd]); double lEPSPResBC = (collision.qvecRe()[lQvecRefAInd] * collision.qvecRe()[lQvecRefBInd] + collision.qvecIm()[lQvecRefAInd] * collision.qvecIm()[lQvecRefBInd]); @@ -825,21 +840,25 @@ struct Chk892Flow { histos.fill(HIST("QA/EP/hEPSPResBC"), lCentrality, lEPSPResBC); } - TLorentzVector lDecayDaughter1, lDecayDaughter2, lResoSecondary, lDecayDaughter_bach, lResoKstar, lDaughterRot, lResonanceRot; + LorentzVectorSetXYZM lDecayDaughter1, lDecayDaughter2, lResoSecondary, lDecayDaughter_bach, lResoKstar, lDaughterRot, lResonanceRot; std::vector trackIndicies = {}; std::vector k0sIndicies = {}; - for (const auto& bTrack : dTracks1) { + for (const auto& bTrack : dTracks1) + { auto trkbpt = bTrack.pt(); auto istrkbhasTOF = bTrack.hasTOF(); auto trkbNSigmaPiTPC = bTrack.tpcNSigmaPi(); auto trkbNSigmaPiTOF = (istrkbhasTOF) ? bTrack.tofNSigmaPi() : -999.; - if constexpr (!IsMix) { - if (AnalysisConfig.cfgFillQAPlots) { + if constexpr (!IsMix) + { + if (AnalysisConfig.cfgFillQAPlots) + { // Bachelor pion QA plots histos.fill(HIST("QA/before/trkbpionTPCPID"), trkbpt, trkbNSigmaPiTPC); - if (istrkbhasTOF) { + if (istrkbhasTOF) + { histos.fill(HIST("QA/before/trkbpionTOFPID"), trkbpt, trkbNSigmaPiTOF); histos.fill(HIST("QA/before/trkbpionTPCTOFPID"), trkbNSigmaPiTPC, trkbNSigmaPiTOF); } @@ -854,11 +873,14 @@ struct Chk892Flow { if (!selectionPIDPion(bTrack)) continue; - if constexpr (!IsMix) { - if (AnalysisConfig.cfgFillQAPlots) { + if constexpr (!IsMix) + { + if (AnalysisConfig.cfgFillQAPlots) + { // Bachelor pion QA plots after applying cuts histos.fill(HIST("QA/after/trkbpionTPCPID"), trkbpt, trkbNSigmaPiTPC); - if (istrkbhasTOF) { + if (istrkbhasTOF) + { histos.fill(HIST("QA/after/trkbpionTOFPID"), trkbpt, trkbNSigmaPiTOF); histos.fill(HIST("QA/after/trkbpionTPCTOFPID"), trkbNSigmaPiTPC, trkbNSigmaPiTOF); } @@ -870,18 +892,21 @@ struct Chk892Flow { trackIndicies.push_back(bTrack.index()); } - for (const auto& k0sCand : dTracks2) { + for (const auto& k0sCand : dTracks2) + { auto posDauTrack = k0sCand.template posTrack_as(); auto negDauTrack = k0sCand.template negTrack_as(); /// Daughters // Positve pion auto trkppt = posDauTrack.pt(); + auto trkpy = posDauTrack.y(); auto istrkphasTOF = posDauTrack.hasTOF(); auto trkpNSigmaPiTPC = posDauTrack.tpcNSigmaPi(); auto trkpNSigmaPiTOF = (istrkphasTOF) ? posDauTrack.tofNSigmaPi() : -999.; // Negative pion auto trknpt = negDauTrack.pt(); + auto trkny = negDauTrack.y(); auto istrknhasTOF = negDauTrack.hasTOF(); auto trknNSigmaPiTPC = negDauTrack.tpcNSigmaPi(); auto trknNSigmaPiTOF = (istrknhasTOF) ? negDauTrack.tofNSigmaPi() : -999.; @@ -894,20 +919,22 @@ struct Chk892Flow { auto trkkPropTau = k0sCand.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * MassK0Short; auto trkkMass = k0sCand.mK0Short(); - // lResoSecondary.SetXYZM(k0sCand.px(), k0sCand.py(), k0sCand.pz(), MassK0Short); - lResoSecondary.SetXYZM(k0sCand.px(), k0sCand.py(), k0sCand.pz(), trkkMass); + lResoSecondary = LorentzVectorSetXYZM(k0sCand.px(), k0sCand.py(), k0sCand.pz(), trkkMass); auto lPhiMinusPsiK0s = RecoDecay::constrainAngle(lResoSecondary.Phi() - lEPDet, 0.0, 2); // constrain angle to range 0, Pi - // auto v2K0s = std::cos(static_cast(nmode) * lPhiMinusPsiK0s); + // auto v2K0s = std::cos(static_cast(nmode) * lPhiMinusPsiK0s); - float cosNPhi_K0s = std::cos(static_cast(nmode) * lResoSecondary.Phi()); - float sinNPhi_K0s = std::sin(static_cast(nmode) * lResoSecondary.Phi()); + float cosNPhiK0s = std::cos(static_cast(nmode) * lResoSecondary.Phi()); + float sinNPhiK0s = std::sin(static_cast(nmode) * lResoSecondary.Phi()); - auto v2K0s = cosNPhi_K0s * collision.qvecRe()[lQvecDetInd] + sinNPhi_K0s * collision.qvecIm()[lQvecDetInd]; - if constexpr (!IsMix) { - if (AnalysisConfig.cfgFillQAPlots) { + auto v2K0s = cosNPhiK0s * collision.qvecRe()[lQvecDetInd] + sinNPhiK0s * collision.qvecIm()[lQvecDetInd]; + if constexpr (!IsMix) + { + if (AnalysisConfig.cfgFillQAPlots) + { // Seconddary QA plots histos.fill(HIST("QA/before/trkppionTPCPID"), trkppt, trkpNSigmaPiTPC); - if (istrkphasTOF) { + if (istrkphasTOF) + { histos.fill(HIST("QA/before/trkppionTOFPID"), trkppt, trkpNSigmaPiTOF); histos.fill(HIST("QA/before/trkppionTPCTOFPID"), trkpNSigmaPiTPC, trkpNSigmaPiTOF); } @@ -916,7 +943,8 @@ struct Chk892Flow { histos.fill(HIST("QA/before/trkppionDCAz"), posDauTrack.dcaZ()); histos.fill(HIST("QA/before/trknpionTPCPID"), trknpt, trknNSigmaPiTPC); - if (istrknhasTOF) { + if (istrknhasTOF) + { histos.fill(HIST("QA/before/trknpionTOFPID"), trknpt, trknNSigmaPiTOF); histos.fill(HIST("QA/before/trknpionTPCTOFPID"), trknNSigmaPiTPC, trknNSigmaPiTOF); } @@ -938,14 +966,21 @@ struct Chk892Flow { continue; if (!SecondaryCuts.cfgByPassDauPIDSelection && !selectionPIDPion(negDauTrack)) continue; + if (!SecondaryCuts.cfgByPassDauRapiditySelection && std::fabs(trkpy) > SecondaryCuts.cfgSecondaryDauRapidityMax) + continue; + if (!SecondaryCuts.cfgByPassDauRapiditySelection && std::fabs(trkny) > SecondaryCuts.cfgSecondaryDauRapidityMax) + continue; if (!selectionK0s(collision, k0sCand)) continue; - if constexpr (!IsMix) { - if (AnalysisConfig.cfgFillQAPlots) { + if constexpr (!IsMix) + { + if (AnalysisConfig.cfgFillQAPlots) + { // Seconddary QA plots after applying cuts histos.fill(HIST("QA/after/trkppionTPCPID"), trkppt, trkpNSigmaPiTPC); - if (istrkphasTOF) { + if (istrkphasTOF) + { histos.fill(HIST("QA/after/trkppionTOFPID"), trkppt, trkpNSigmaPiTOF); histos.fill(HIST("QA/after/trkppionTPCTOFPID"), trkpNSigmaPiTPC, trkpNSigmaPiTOF); } @@ -954,7 +989,8 @@ struct Chk892Flow { histos.fill(HIST("QA/after/trkppionDCAz"), posDauTrack.dcaZ()); histos.fill(HIST("QA/after/trknpionTPCPID"), trknpt, trknNSigmaPiTPC); - if (istrknhasTOF) { + if (istrknhasTOF) + { histos.fill(HIST("QA/after/trknpionTOFPID"), trknpt, trknNSigmaPiTOF); histos.fill(HIST("QA/after/trknpionTPCTOFPID"), trknNSigmaPiTPC, trknNSigmaPiTOF); } @@ -970,45 +1006,47 @@ struct Chk892Flow { histos.fill(HIST("QA/after/hInvmassSecondary"), trkkMass); histos.fill(HIST("QA/after/k0sv2vsinvmass"), lResoSecondary.M(), v2K0s); - if (AnalysisConfig.cfgFillAdditionalAxis) { + if (AnalysisConfig.cfgFillAdditionalAxis) + { histos.fill(HIST("hInvmass_K0s"), lCentrality, lResoSecondary.Pt(), lResoSecondary.M(), v2K0s, static_cast(nmode) * lPhiMinusPsiK0s, collision.trackOccupancyInTimeRange()); - } else { + } + else + { histos.fill(HIST("hInvmass_K0s"), lCentrality, lResoSecondary.Pt(), lResoSecondary.M(), v2K0s, collision.trackOccupancyInTimeRange()); } } - if (AnalysisConfig.cfgFillAdditionalAxis) { - histos.fill(HIST("hInvmass_K0s"), lCentrality, lResoSecondary.Pt(), lResoSecondary.M(), v2K0s, static_cast(nmode) * lPhiMinusPsiK0s, collision.trackOccupancyInTimeRange()); - } else { - histos.fill(HIST("hInvmass_K0s"), lCentrality, lResoSecondary.Pt(), lResoSecondary.M(), v2K0s, collision.trackOccupancyInTimeRange()); - } k0sIndicies.push_back(k0sCand.index()); } } - for (const auto& trackIndex : trackIndicies) { - for (const auto& k0sIndex : k0sIndicies) { + for (const auto& trackIndex : trackIndicies) + { + for (const auto& k0sIndex : k0sIndicies) + { auto bTrack = dTracks1.rawIteratorAt(trackIndex); auto k0sCand = dTracks2.rawIteratorAt(k0sIndex); auto trkkMass = k0sCand.mK0Short(); - lDecayDaughter_bach.SetXYZM(bTrack.px(), bTrack.py(), bTrack.pz(), MassPionCharged); - // lResoSecondary.SetXYZM(k0sCand.px(), k0sCand.py(), k0sCand.pz(), MassK0Short); - lResoSecondary.SetXYZM(k0sCand.px(), k0sCand.py(), k0sCand.pz(), trkkMass); + lDecayDaughter_bach = LorentzVectorSetXYZM(bTrack.px(), bTrack.py(), bTrack.pz(), MassPionCharged); + lResoSecondary = LorentzVectorSetXYZM(k0sCand.px(), k0sCand.py(), k0sCand.pz(), trkkMass); lResoKstar = lResoSecondary + lDecayDaughter_bach; auto resoPhi = lResoKstar.Phi(); // EP method auto lPhiMinusPsiKstar = RecoDecay::constrainAngle(resoPhi - lEPDet, 0.0, 2); // constrain angle to range 0, Pi auto resoFlowValue = std::cos(static_cast(nmode) * lPhiMinusPsiKstar); // Scalar product method - if (AnalysisConfig.cfgUseScalProduct) { + if (AnalysisConfig.cfgUseScalProduct) + { float cosNPhi = std::cos(static_cast(nmode) * resoPhi); float sinNPhi = std::sin(static_cast(nmode) * resoPhi); resoFlowValue = cosNPhi * collision.qvecRe()[lQvecDetInd] + sinNPhi * collision.qvecIm()[lQvecDetInd]; } // QA plots - if constexpr (!IsMix) { - if (AnalysisConfig.cfgFillQAPlots) { + if constexpr (!IsMix) + { + if (AnalysisConfig.cfgFillQAPlots) + { histos.fill(HIST("QA/before/KstarRapidity"), lResoKstar.Rapidity()); histos.fill(HIST("QA/before/kstarinvmass"), lResoKstar.M()); histos.fill(HIST("QA/before/kstarv2vsinvmass"), lResoKstar.M(), resoFlowValue); @@ -1018,52 +1056,72 @@ struct Chk892Flow { if (lResoKstar.Rapidity() > KstarCuts.cfgKstarMaxRap || lResoKstar.Rapidity() < KstarCuts.cfgKstarMinRap) continue; - if constexpr (!IsMix) { + if constexpr (!IsMix) + { unsigned int typeKstar = bTrack.sign() > 0 ? BinType::kKstarP : BinType::kKstarN; - if (AnalysisConfig.cfgFillQAPlots) { + if (AnalysisConfig.cfgFillQAPlots) + { histos.fill(HIST("QA/after/KstarRapidity"), lResoKstar.Rapidity()); histos.fill(HIST("QA/after/kstarinvmass"), lResoKstar.M()); histos.fill(HIST("QA/after/kstarv2vsinvmass"), lResoKstar.M(), resoFlowValue); } - if (AnalysisConfig.cfgFillAdditionalAxis) { + if (AnalysisConfig.cfgFillAdditionalAxis) + { histos.fill(HIST("hInvmass_Kstar"), typeKstar, lCentrality, lResoKstar.Pt(), lResoKstar.M(), resoFlowValue, static_cast(nmode) * lPhiMinusPsiKstar, collision.trackOccupancyInTimeRange()); - } else { + } + else + { histos.fill(HIST("hInvmass_Kstar"), typeKstar, lCentrality, lResoKstar.Pt(), lResoKstar.M(), resoFlowValue, collision.trackOccupancyInTimeRange()); } - if (BkgEstimationConfig.cfgFillRotBkg) { - for (int i = 0; i < BkgEstimationConfig.cfgNrotBkg; i++) { + if (BkgEstimationConfig.cfgFillRotBkg) + { + for (int i = 0; i < BkgEstimationConfig.cfgNrotBkg; i++) + { auto lRotAngle = BkgEstimationConfig.cfgMinRot + i * ((BkgEstimationConfig.cfgMaxRot - BkgEstimationConfig.cfgMinRot) / (BkgEstimationConfig.cfgNrotBkg - 1)); - if (AnalysisConfig.cfgFillQAPlots) { + if (AnalysisConfig.cfgFillQAPlots) + { histos.fill(HIST("QA/RotBkg/hRotBkg"), lRotAngle); } - if (BkgEstimationConfig.cfgRotPion) { + if (BkgEstimationConfig.cfgRotPion) + { lDaughterRot = lDecayDaughter_bach; - lDaughterRot.RotateZ(lRotAngle); + ROOT::Math::RotationZ rot(lRotAngle); + auto p3 = rot * lDaughterRot.Vect(); + lDaughterRot = LorentzVectorSetXYZM(p3.X(), p3.Y(), p3.Z(), lDaughterRot.M()); lResonanceRot = lDaughterRot + lResoSecondary; - } else { + } + else + { lDaughterRot = lResoSecondary; - lDaughterRot.RotateZ(lRotAngle); + ROOT::Math::RotationZ rot(lRotAngle); + auto p3 = rot * lDaughterRot.Vect(); + lDaughterRot = LorentzVectorSetXYZM(p3.X(), p3.Y(), p3.Z(), lDaughterRot.M()); lResonanceRot = lDecayDaughter_bach + lDaughterRot; } resoPhi = lResonanceRot.Phi(); auto lPhiMinusPsiKstar = RecoDecay::constrainAngle(resoPhi - lEPDet, 0.0, 2); // constrain angle to range 0, Pi auto resoFlowValue = std::cos(static_cast(nmode) * lPhiMinusPsiKstar); - if (AnalysisConfig.cfgUseScalProduct) { + if (AnalysisConfig.cfgUseScalProduct) + { float cosNPhi = std::cos(static_cast(nmode) * resoPhi); float sinNPhi = std::sin(static_cast(nmode) * resoPhi); resoFlowValue = cosNPhi * collision.qvecRe()[lQvecDetInd] + sinNPhi * collision.qvecIm()[lQvecDetInd]; } typeKstar = bTrack.sign() > 0 ? BinType::kKstarP_Rot : BinType::kKstarN_Rot; - if (AnalysisConfig.cfgFillAdditionalAxis) { + if (AnalysisConfig.cfgFillAdditionalAxis) + { histos.fill(HIST("hInvmass_Kstar"), typeKstar, lCentrality, lResonanceRot.Pt(), lResonanceRot.M(), resoFlowValue, static_cast(nmode) * lPhiMinusPsiKstar, collision.trackOccupancyInTimeRange()); - } else { + } + else + { histos.fill(HIST("hInvmass_Kstar"), typeKstar, lCentrality, lResonanceRot.Pt(), lResonanceRot.M(), resoFlowValue, collision.trackOccupancyInTimeRange()); } } } } // IsMix + } // k0sCand } // bTrack @@ -1075,7 +1133,7 @@ struct Chk892Flow { void processDummy(aod::Collisions const&) { } - PROCESS_SWITCH(Chk892Flow, processDummy, "process Dummy", true); + PROCESS_SWITCH(Chk892Flow, processDummy, "process Dummy", false); // process data void processData(EventCandidates::iterator const& collision, @@ -1085,32 +1143,29 @@ struct Chk892Flow { { if (!colCuts.isSelected(collision)) // Default event selection return; - if (EventCuts.cfgEvtUseRCTFlagChecker && !rctChecker(collision)) { + if (EventCuts.cfgEvtUseRCTFlagChecker && !rctChecker(collision)) + { return; } - if (AnalysisConfig.cfgQvecSel && (collision.qvecAmp()[lDetId] < 1e-4 || collision.qvecAmp()[lRefAId] < 1e-4 || collision.qvecAmp()[lRefBId] < 1e-4)) + float qAmpThr = 1e-4f; + if (AnalysisConfig.cfgQvecSel && (collision.qvecAmp()[lDetId] < qAmpThr || collision.qvecAmp()[lRefAId] < qAmpThr || collision.qvecAmp()[lRefBId] < qAmpThr)) return; // If we don't have a Q-vector lCentrality = getCentrality(collision); + // lCentrality = collision.centFT0C(); if (lCentrality < EventCuts.cfgEventCentralityMin || lCentrality > EventCuts.cfgEventCentralityMax) return; colCuts.fillQA(collision); - fillHistograms(collision, tracks, v0s, EventPlaneConfig.cfgnMods); // second order + fillHistograms(collision, tracks, v0s, EventPlaneConfig.cfgnMods); // second order } - PROCESS_SWITCH(Chk892Flow, processData, "Process Event for data without Partitioning", false); + PROCESS_SWITCH(Chk892Flow, processData, "Process Event for data without Partitioning", true); - // process MC reconstructed level - void processMC(EventCandidates::iterator const& collision, - MCTrackCandidates const& tracks, - MCV0Candidates const& v0s) + void processMC(aod::McCollisions const&) { - if (EventCuts.cfgEvtUseRCTFlagChecker && !rctChecker(collision)) { - return; - } - fillHistograms(collision, tracks, v0s, EventPlaneConfig.cfgnMods); } - PROCESS_SWITCH(Chk892Flow, processMC, "Process Event for MC", false); + PROCESS_SWITCH(Chk892Flow, processMC, "Process MC for efficiency correction", false); }; + WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; From 532196b6870aeed8f59423dde5bc7a8a1187c350 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Wed, 3 Sep 2025 02:34:11 +0000 Subject: [PATCH 02/11] Please consider the following formatting changes --- PWGLF/Tasks/Resonances/chk892Flow.cxx | 421 ++++++++++---------------- 1 file changed, 153 insertions(+), 268 deletions(-) diff --git a/PWGLF/Tasks/Resonances/chk892Flow.cxx b/PWGLF/Tasks/Resonances/chk892Flow.cxx index 51c05c4e02c..8b91c63188a 100644 --- a/PWGLF/Tasks/Resonances/chk892Flow.cxx +++ b/PWGLF/Tasks/Resonances/chk892Flow.cxx @@ -14,67 +14,61 @@ /// \author Su-Jeong Ji , Bong-Hwi Lim /// -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "TRandom3.h" -#include "TF1.h" -#include "TVector2.h" -#include "Math/Vector3D.h" -#include "Math/Vector4D.h" -#include "Math/RotationZ.h" -#include "Math/GenVector/Boost.h" -#include - -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/StepTHn.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/StaticFor.h" -#include "DCAFitter/DCAFitterN.h" -#include "Framework/EndOfStreamContext.h" +#include "PWGLF/DataModel/LFStrangenessTables.h" +#include "PWGLF/Utils/collisionCuts.h" -#include "Common/DataModel/PIDResponse.h" -#include "Common/DataModel/Multiplicity.h" +#include "Common/Core/RecoDecay.h" +#include "Common/Core/TrackSelection.h" +#include "Common/Core/trackUtilities.h" #include "Common/DataModel/Centrality.h" -#include "Common/DataModel/TrackSelectionTables.h" #include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/PIDResponse.h" #include "Common/DataModel/Qvectors.h" +#include "Common/DataModel/TrackSelectionTables.h" -#include "Common/Core/trackUtilities.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/RecoDecay.h" - -#include "CommonConstants/PhysicsConstants.h" +#include "CCDB/BasicCCDBManager.h" +#include "CCDB/CcdbApi.h" #include "CommonConstants/MathConstants.h" - -#include "ReconstructionDataFormats/Track.h" - -#include "DataFormatsParameters/GRPObject.h" +#include "CommonConstants/PhysicsConstants.h" +#include "DCAFitter/DCAFitterN.h" #include "DataFormatsParameters/GRPMagField.h" +#include "DataFormatsParameters/GRPObject.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/EndOfStreamContext.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "Framework/StaticFor.h" +#include "Framework/StepTHn.h" +#include "Framework/runDataProcessing.h" +#include "ReconstructionDataFormats/Track.h" -#include "CCDB/CcdbApi.h" -#include "CCDB/BasicCCDBManager.h" +#include "Math/GenVector/Boost.h" +#include "Math/RotationZ.h" +#include "Math/Vector3D.h" +#include "Math/Vector4D.h" +#include "TF1.h" +#include "TRandom3.h" +#include "TVector2.h" +#include +#include +#include +#include +#include +#include +#include +#include -#include "PWGLF/DataModel/LFStrangenessTables.h" -#include "PWGLF/Utils/collisionCuts.h" +#include +#include +#include +#include +#include +#include +#include +#include using namespace o2; using namespace o2::framework; @@ -83,10 +77,8 @@ using namespace o2::soa; using namespace o2::constants::physics; using namespace o2::aod::rctsel; -struct Chk892Flow -{ - enum BinType : unsigned int - { +struct Chk892Flow { + enum BinType : unsigned int { kKstarP = 0, kKstarN, kKstarP_Mix, @@ -96,8 +88,7 @@ struct Chk892Flow kTYEnd }; - enum class K0sCut - { + enum class K0sCut { DauDCA, // lDauDCA <= cfgSecondaryDauDCAMax PosDCAtoPVMin, // lDauPosDCAtoPV >= min NegDCAtoPVMin, // lDauNegDCAtoPV >= min @@ -113,12 +104,12 @@ struct Chk892Flow std::array, 10> hN1NoCut{}; std::array, 10> hN1Pass{}; - static constexpr const char *cutTag[] = { - "DauDCA", "PosDCA", "NegDCA", "Radius", "DCAtoPV", "CPA", "Tau", "Arm", "Mass", "LambdaHypo"}; + static constexpr const char* cutTag[] = { + "DauDCA", "PosDCA", "NegDCA", "Radius", "DCAtoPV", "CPA", "Tau", "Arm", "Mass", "LambdaHypo"}; static constexpr K0sCut kCutsToTest[] = { - K0sCut::DauDCA, K0sCut::PosDCAtoPVMin, K0sCut::NegDCAtoPVMin, - K0sCut::RadiusWindow, K0sCut::DCAtoPVMax, K0sCut::CPAMin, - K0sCut::ProperTauMax, K0sCut::Armenteros, K0sCut::MassWindow, K0sCut::LambdaMassHypo}; + K0sCut::DauDCA, K0sCut::PosDCAtoPVMin, K0sCut::NegDCAtoPVMin, + K0sCut::RadiusWindow, K0sCut::DCAtoPVMax, K0sCut::CPAMin, + K0sCut::ProperTauMax, K0sCut::Armenteros, K0sCut::MassWindow, K0sCut::LambdaMassHypo}; static constexpr size_t NCuts = sizeof(kCutsToTest) / sizeof(kCutsToTest[0]); @@ -147,15 +138,13 @@ struct Chk892Flow o2::ccdb::CcdbApi ccdbApi; Service pdg; - struct : ConfigurableGroup - { + struct : ConfigurableGroup { Configurable cfgURL{"cfgURL", "http://alice-ccdb.cern.ch", "Address of the CCDB to browse"}; } CCDBConfig; // Configurable nolaterthan{"ccdb-no-later-than", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "Latest acceptable timestamp of creation for the object"}; // Configurables - struct : ConfigurableGroup - { + struct : ConfigurableGroup { ConfigurableAxis cfgBinsPt{"cfgBinsPt", {VARIABLE_WIDTH, 0.0, 0.1, 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, 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8, 4.9, 5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 5.9, 6.0, 6.1, 6.2, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 6.9, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.6, 7.7, 7.8, 7.9, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5, 8.6, 8.7, 8.8, 8.9, 9.0, 9.1, 9.2, 9.3, 9.4, 9.5, 9.6, 9.7, 9.8, 9.9, 10.0, 10.1, 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 11.0, 11.1, 11.2, 11.3, 11.4, 11.5, 11.6, 11.7, 11.8, 11.9, 12.0, 12.1, 12.2, 12.3, 12.4, 12.5, 12.6, 12.7, 12.8, 12.9, 13.0, 13.1, 13.2, 13.3, 13.4, 13.5, 13.6, 13.7, 13.8, 13.9, 14.0, 14.1, 14.2, 14.3, 14.4, 14.5, 14.6, 14.7, 14.8, 14.9, 15.0}, "Binning of the pT axis"}; ConfigurableAxis cfgBinsPtQA{"cfgBinsPtQA", {VARIABLE_WIDTH, 0.0, 0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.2, 2.4, 2.6, 2.8, 3.0, 3.2, 3.4, 3.6, 3.8, 4.0, 4.2, 4.4, 4.6, 4.8, 5.0, 5.2, 5.4, 5.6, 5.8, 6.0, 6.2, 6.4, 6.6, 6.8, 7.0, 7.2, 7.4, 7.6, 7.8, 8.0, 8.2, 8.4, 8.6, 8.8, 9.0, 9.2, 9.4, 9.6, 9.8, 10.0}, "Binning of the pT axis"}; ConfigurableAxis cfgBinsCent{"cfgBinsCent", {VARIABLE_WIDTH, 0.0, 1.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 110.0}, "Binning of the centrality axis"}; @@ -168,8 +157,7 @@ struct Chk892Flow ConfigurableAxis cfgAxisPhi{"cfgAxisPhi", {8, 0, constants::math::PI}, "Binning of the #phi axis"}; } AxisConfig; - struct : ConfigurableGroup - { + struct : ConfigurableGroup { Configurable cfgFillQAPlots{"cfgFillQAPlots", true, "Fill QA plots"}; Configurable cfgQvecSel{"cfgQvecSel", true, "Reject events when no QVector"}; Configurable cfgCentEst{"cfgCentEst", 1, "Centrality estimator, 1: FT0C, 2: FT0M"}; @@ -179,8 +167,7 @@ struct Chk892Flow // Event cuts o2::analysis::CollisonCuts colCuts; - struct : ConfigurableGroup - { + struct : ConfigurableGroup { Configurable cfgEvtZvtx{"cfgEvtZvtx", 10.f, "Evt sel: Max. z-Vertex (cm)"}; Configurable cfgEvtZvtxMC{"cfgEvtZvtxMC", 10.f, "MC Evt sel: Max z-vertex (cm)"}; Configurable cfgIsPhysicalPrimaryMC{"cfgIsPhysicalPrimaryMC", true, "Physical primary selection for MC parents"}; @@ -205,8 +192,7 @@ struct Chk892Flow RCTFlagsChecker rctChecker; /// PID Selections, pion - struct : ConfigurableGroup - { + struct : ConfigurableGroup { Configurable cfgTPConly{"cfgTPConly", false, "Use only TPC for PID"}; // bool Configurable cfgMaxTPCnSigmaPion{"cfgMaxTPCnSigmaPion", 3.0, "TPC nSigma cut for Pion"}; // TPC Configurable cfgMaxTOFnSigmaPion{"cfgMaxTOFnSigmaPion", 3.0, "TOF nSigma cut for Pion"}; // TOF @@ -215,8 +201,7 @@ struct Chk892Flow } PIDCuts; // Track selections - struct : ConfigurableGroup - { + struct : ConfigurableGroup { Configurable cfgMinPtcut{"cfgMinPtcut", 0.6, "Track minium pt cut"}; Configurable cfgMaxEtacut{"cfgMaxEtacut", 0.8, "Track maximum eta cut"}; Configurable cfgPrimaryTrack{"cfgPrimaryTrack", true, "Primary track selection"}; // kGoldenChi2 | kDCAxy | kDCAz @@ -240,8 +225,7 @@ struct Chk892Flow } TrackCuts; // Secondary Selection - struct : ConfigurableGroup - { + struct : ConfigurableGroup { Configurable cfgReturnFlag{"cfgReturnFlag", false, "Return Flag for debugging"}; Configurable cfgSecondaryRequire{"cfgSecondaryRequire", true, "Secondary cuts on/off"}; Configurable cfgSecondaryArmenterosCut{"cfgSecondaryArmenterosCut", true, "cut on Armenteros-Podolanski graph"}; @@ -267,15 +251,13 @@ struct Chk892Flow } SecondaryCuts; // K* selection - struct : ConfigurableGroup - { + struct : ConfigurableGroup { Configurable cfgKstarMaxRap{"cfgKstarMaxRap", 0.5, "Kstar maximum rapidity"}; Configurable cfgKstarMinRap{"cfgKstarMinRap", -0.5, "Kstar minimum rapidity"}; } KstarCuts; // Confs from flow analysis - struct : ConfigurableGroup - { + struct : ConfigurableGroup { Configurable cfgnMods{"cfgnMods", 2, "The number of modulations of interest starting from 2"}; Configurable cfgNQvec{"cfgNQvec", 7, "The number of total Qvectors for looping over the task"}; @@ -285,8 +267,7 @@ struct Chk892Flow } EventPlaneConfig; // Bkg estimation - struct : ConfigurableGroup - { + struct : ConfigurableGroup { Configurable cfgFillRotBkg{"cfgFillRotBkg", true, "Fill rotated background"}; Configurable cfgMinRot{"cfgMinRot", 5.0 * constants::math::PI / 6.0, "Minimum of rotation"}; Configurable cfgMaxRot{"cfgMaxRot", 7.0 * constants::math::PI / 6.0, "Maximum of rotation"}; @@ -309,7 +290,7 @@ struct Chk892Flow int kPDGK0 = kK0; int kKstarPlus = o2::constants::physics::Pdg::kKPlusStar892; - void init(o2::framework::InitContext &) + void init(o2::framework::InitContext&) { lCentrality = -999; @@ -349,8 +330,7 @@ struct Chk892Flow AxisSpec axisType = {BinType::kTYEnd, 0, BinType::kTYEnd, "Type of bin with charge and mix"}; AxisSpec mcLabelAxis = {5, -0.5, 4.5, "MC Label"}; - if (SecondaryCuts.cfgReturnFlag) - { + if (SecondaryCuts.cfgReturnFlag) { histos.add("QA/K0sCutCheck", "Check K0s cut", HistType::kTH1D, {AxisSpec{13, -0.5, 12.5, "Check"}}); } histos.add("QA/before/CentDist", "Centrality distribution", {HistType::kTH1D, {centAxis}}); @@ -365,18 +345,15 @@ struct Chk892Flow histos.add("QA/EP/hEPResAC", "cos(n(A-C))", {HistType::kTH2D, {centAxis, epAxis}}); histos.add("QA/EP/hEPResBC", "cos(n(B-C))", {HistType::kTH2D, {centAxis, epAxis}}); - if (AnalysisConfig.cfgUseScalProduct) - { + if (AnalysisConfig.cfgUseScalProduct) { histos.add("QA/EP/hEPSPResAB", "cos(n(A-B))", {HistType::kTH2D, {centAxis, epAxis}}); histos.add("QA/EP/hEPSPResAC", "cos(n(A-C))", {HistType::kTH2D, {centAxis, epAxis}}); histos.add("QA/EP/hEPSPResBC", "cos(n(B-C))", {HistType::kTH2D, {centAxis, epAxis}}); } - if (AnalysisConfig.cfgFillQAPlots) - { + if (AnalysisConfig.cfgFillQAPlots) { // Rotated background - if (BkgEstimationConfig.cfgFillRotBkg) - { + if (BkgEstimationConfig.cfgFillRotBkg) { histos.add("QA/RotBkg/hRotBkg", "Rotated angle of rotated background", HistType::kTH1F, {{360, 0.0, o2::constants::math::TwoPI}}); } @@ -458,22 +435,17 @@ struct Chk892Flow } // Invariant mass nSparse - if (AnalysisConfig.cfgFillAdditionalAxis) - { + if (AnalysisConfig.cfgFillAdditionalAxis) { histos.add("hInvmass_Kstar", "Invariant mass of unlike-sign chK(892)", HistType::kTHnSparseD, {axisType, centAxis, ptAxis, invMassAxisReso, v2Axis, phiAxis, occuAxis}); histos.add("hInvmass_K0s", "Invariant mass of unlike-sign K0s", HistType::kTHnSparseD, {centAxis, ptAxis, invMassAxisK0s, v2Axis, phiAxis, occuAxis}); - if (doprocessMC) - { + if (doprocessMC) { histos.add("hInvmass_Kstar_MC", "Invariant mass of unlike chK(892)", HistType::kTHnSparseD, {axisType, centAxis, ptAxis, invMassAxisReso, v2Axis, phiAxis, occuAxis}); histos.add("hInvmass_K0s_MC", "Invariant mass of unlike K0s", HistType::kTHnSparseD, {centAxis, ptAxis, invMassAxisReso, v2Axis, phiAxis, occuAxis}); } - } - else - { + } else { histos.add("hInvmass_Kstar", "Invariant mass of unlike-sign chK(892)", HistType::kTHnSparseD, {axisType, centAxis, ptAxis, invMassAxisReso, v2Axis, occuAxis}); histos.add("hInvmass_K0s", "Invariant mass of unlike-sign K0s", HistType::kTHnSparseD, {centAxis, ptAxis, invMassAxisK0s, v2Axis, occuAxis}); - if (doprocessMC) - { + if (doprocessMC) { histos.add("hInvmass_Kstar_MC", "Invariant mass of unlike chK(892)", HistType::kTHnSparseD, {axisType, centAxis, ptAxis, invMassAxisReso, v2Axis, occuAxis}); histos.add("hInvmass_K0s_MC", "Invariant mass of unlike K0s", HistType::kTHnSparseD, {centAxis, ptAxis, invMassAxisK0s, v2Axis, occuAxis}); } @@ -483,15 +455,13 @@ struct Chk892Flow lRefAId = getlDetId(EventPlaneConfig.cfgQvecRefAName); lRefBId = getlDetId(EventPlaneConfig.cfgQvecRefBName); - if (lDetId == lRefAId || lDetId == lRefBId || lRefAId == lRefBId) - { + if (lDetId == lRefAId || lDetId == lRefBId || lRefAId == lRefBId) { LOGF(info, "Wrong detector configuration \n The FT0C will be used to get Q-Vector \n The TPCpos and TPCneg will be used as reference systems"); lDetId = 0; lRefAId = 4; lRefBId = 5; } - if (EventPlaneConfig.cfgNQvec < EventPlaneConfig.cfgnMods) - { + if (EventPlaneConfig.cfgNQvec < EventPlaneConfig.cfgnMods) { LOG(fatal) << "nMode must be larger than 1, current input (cfgNQvec): " << EventPlaneConfig.cfgNQvec; } LOGF(info, "lDetId: %d, lRefAId: %d, lRefBId: %d", lDetId, lRefAId, lRefBId); @@ -512,58 +482,40 @@ struct Chk892Flow const float kInvalidCentrality = -999.f; template - float getCentrality(CollisionType const &collision) + float getCentrality(CollisionType const& collision) { - if (AnalysisConfig.cfgCentEst == kCentFT0C) - { + if (AnalysisConfig.cfgCentEst == kCentFT0C) { return collision.centFT0C(); - } - else if (AnalysisConfig.cfgCentEst == kCentFT0M) - { + } else if (AnalysisConfig.cfgCentEst == kCentFT0M) { return collision.centFT0M(); - } - else - { + } else { return kInvalidCentrality; } } template - int getlDetId(DetNameType const &name) + int getlDetId(DetNameType const& name) { - if (name.value == "FT0C") - { + if (name.value == "FT0C") { return 0; - } - else if (name.value == "FT0A") - { + } else if (name.value == "FT0A") { return 1; - } - else if (name.value == "FT0M") - { + } else if (name.value == "FT0M") { return 2; - } - else if (name.value == "FV0A") - { + } else if (name.value == "FV0A") { return 3; - } - else if (name.value == "TPCpos") - { + } else if (name.value == "TPCpos") { return 4; - } - else if (name.value == "TPCneg") - { + } else if (name.value == "TPCneg") { return 5; - } - else - { + } else { return false; } } // Track selection template - bool trackCut(TrackType const &track) + bool trackCut(TrackType const& track) { // basic track cuts if (std::abs(track.pt()) < TrackCuts.cfgMinPtcut) @@ -598,14 +550,11 @@ struct Chk892Flow return false; if (TrackCuts.cfgPrimaryTrack && !track.isPrimaryTrack()) return false; - if (TrackCuts.cfgpTdepDCAxyCut) - { + if (TrackCuts.cfgpTdepDCAxyCut) { // Tuned on the LHC22f anchored MC LHC23d1d on primary pions. 7 Sigmas of the resolution if (std::abs(track.dcaXY()) > (0.004 + (0.013 / track.pt()))) return false; - } - else - { + } else { if (std::abs(track.dcaXY()) > TrackCuts.cfgMaxbDCArToPVcut) return false; } @@ -616,26 +565,22 @@ struct Chk892Flow // PID selection tools template - bool selectionPIDPion(TrackType const &candidate) + bool selectionPIDPion(TrackType const& candidate) { bool tpcPIDPassed = std::abs(candidate.tpcNSigmaPi()) < PIDCuts.cfgMaxTPCnSigmaPion; bool tofPIDPassed = false; - if (PIDCuts.cfgTPConly) - { + if (PIDCuts.cfgTPConly) { return tpcPIDPassed; } - if (candidate.hasTOF()) - { + if (candidate.hasTOF()) { tofPIDPassed = std::abs(candidate.tofNSigmaPi()) < PIDCuts.cfgMaxTOFnSigmaPion || (PIDCuts.cfgNsigmaCutCombinedPion > 0 && candidate.tpcNSigmaPi() * candidate.tpcNSigmaPi() + - candidate.tofNSigmaPi() * candidate.tofNSigmaPi() < - PIDCuts.cfgNsigmaCutCombinedPion * PIDCuts.cfgNsigmaCutCombinedPion); - } - else - { + candidate.tofNSigmaPi() * candidate.tofNSigmaPi() < + PIDCuts.cfgNsigmaCutCombinedPion * PIDCuts.cfgNsigmaCutCombinedPion); + } else { tofPIDPassed = PIDCuts.cfgTOFVeto; } @@ -643,7 +588,7 @@ struct Chk892Flow } template - bool selectionK0s(CollisionType const &collision, K0sType const &candidate) + bool selectionK0s(CollisionType const& collision, K0sType const& candidate) { auto lDauDCA = candidate.dcaV0daughters(); auto lDauPosDCAtoPV = std::fabs(candidate.dcapostopv()); @@ -658,8 +603,7 @@ struct Chk892Flow auto lMLambda = candidate.mLambda(); auto lMALambda = candidate.mAntiLambda(); - auto checkCommonCuts = [&]() - { + auto checkCommonCuts = [&]() { if (lDauDCA > SecondaryCuts.cfgSecondaryDauDCAMax) return false; if (lDauPosDCAtoPV < SecondaryCuts.cfgSecondaryDauPosDCAtoPVMin) @@ -688,88 +632,70 @@ struct Chk892Flow return true; }; - if (SecondaryCuts.cfgReturnFlag) - { // For cut study + if (SecondaryCuts.cfgReturnFlag) { // For cut study bool returnFlag = true; histos.fill(HIST("QA/K0sCutCheck"), 0); - if (lDauDCA > SecondaryCuts.cfgSecondaryDauDCAMax) - { + if (lDauDCA > SecondaryCuts.cfgSecondaryDauDCAMax) { histos.fill(HIST("QA/K0sCutCheck"), 1); returnFlag = false; } - if (lDauPosDCAtoPV < SecondaryCuts.cfgSecondaryDauPosDCAtoPVMin) - { + if (lDauPosDCAtoPV < SecondaryCuts.cfgSecondaryDauPosDCAtoPVMin) { histos.fill(HIST("QA/K0sCutCheck"), 2); returnFlag = false; } - if (lDauNegDCAtoPV < SecondaryCuts.cfgSecondaryDauNegDCAtoPVMin) - { + if (lDauNegDCAtoPV < SecondaryCuts.cfgSecondaryDauNegDCAtoPVMin) { histos.fill(HIST("QA/K0sCutCheck"), 3); returnFlag = false; } - if (lPt < SecondaryCuts.cfgSecondaryPtMin) - { + if (lPt < SecondaryCuts.cfgSecondaryPtMin) { histos.fill(HIST("QA/K0sCutCheck"), 4); returnFlag = false; } - if (std::fabs(lRapidity) > SecondaryCuts.cfgSecondaryRapidityMax) - { + if (std::fabs(lRapidity) > SecondaryCuts.cfgSecondaryRapidityMax) { histos.fill(HIST("QA/K0sCutCheck"), 5); returnFlag = false; } - if (lRadius < SecondaryCuts.cfgSecondaryRadiusMin || lRadius > SecondaryCuts.cfgSecondaryRadiusMax) - { + if (lRadius < SecondaryCuts.cfgSecondaryRadiusMin || lRadius > SecondaryCuts.cfgSecondaryRadiusMax) { histos.fill(HIST("QA/K0sCutCheck"), 6); returnFlag = false; } - if (lDCAtoPV > SecondaryCuts.cfgSecondaryDCAtoPVMax) - { + if (lDCAtoPV > SecondaryCuts.cfgSecondaryDCAtoPVMax) { histos.fill(HIST("QA/K0sCutCheck"), 7); returnFlag = false; } - if (lCPA < SecondaryCuts.cfgSecondaryCosPAMin) - { + if (lCPA < SecondaryCuts.cfgSecondaryCosPAMin) { histos.fill(HIST("QA/K0sCutCheck"), 8); returnFlag = false; } - if (lPropTauK0s > SecondaryCuts.cfgSecondaryProperLifetimeMax) - { + if (lPropTauK0s > SecondaryCuts.cfgSecondaryProperLifetimeMax) { histos.fill(HIST("QA/K0sCutCheck"), 9); returnFlag = false; } - if (candidate.qtarm() < SecondaryCuts.cfgSecondaryparamArmenterosCut * std::abs(candidate.alpha())) - { + if (candidate.qtarm() < SecondaryCuts.cfgSecondaryparamArmenterosCut * std::abs(candidate.alpha())) { histos.fill(HIST("QA/K0sCutCheck"), 10); returnFlag = false; } - if (std::fabs(lMk0s - MassK0Short) > SecondaryCuts.cfgSecondaryMassWindow) - { + if (std::fabs(lMk0s - MassK0Short) > SecondaryCuts.cfgSecondaryMassWindow) { histos.fill(HIST("QA/K0sCutCheck"), 11); returnFlag = false; } if (SecondaryCuts.cfgSecondaryCrossMassHypothesisCut && - ((std::fabs(lMLambda - MassLambda0) < SecondaryCuts.cfgSecondaryCrossMassCutWindow) || (std::fabs(lMALambda - MassLambda0Bar) < SecondaryCuts.cfgSecondaryCrossMassCutWindow))) - { + ((std::fabs(lMLambda - MassLambda0) < SecondaryCuts.cfgSecondaryCrossMassCutWindow) || (std::fabs(lMALambda - MassLambda0Bar) < SecondaryCuts.cfgSecondaryCrossMassCutWindow))) { histos.fill(HIST("QA/K0sCutCheck"), 12); returnFlag = false; } return returnFlag; - } - else - { // normal usage - if (SecondaryCuts.cfgSecondaryRequire) - { + } else { // normal usage + if (SecondaryCuts.cfgSecondaryRequire) { return checkCommonCuts(); - } - else - { + } else { return std::fabs(lMk0s - MassK0Short) <= SecondaryCuts.cfgSecondaryMassWindow; // always apply mass window cut } } } // selectionK0s template - bool isTrueKstar(const TrackTemplate &bTrack, const V0Template &k0sCand) + bool isTrueKstar(const TrackTemplate& bTrack, const V0Template& k0sCand) { if (std::abs(bTrack.pdgCode()) != kPiPlus) // Are you pion? return false; @@ -805,7 +731,7 @@ struct Chk892Flow int count = 0; template - void fillHistograms(const CollisionType &collision, const TracksType &dTracks1, const TracksTypeK0s &dTracks2, int nmode) + void fillHistograms(const CollisionType& collision, const TracksType& dTracks1, const TracksTypeK0s& dTracks2, int nmode) { histos.fill(HIST("QA/before/CentDist"), lCentrality); @@ -829,8 +755,7 @@ struct Chk892Flow histos.fill(HIST("QA/EP/hEPResAC"), lCentrality, lEPResAC); histos.fill(HIST("QA/EP/hEPResBC"), lCentrality, lEPResBC); // Scalar product method - if (AnalysisConfig.cfgUseScalProduct) - { + if (AnalysisConfig.cfgUseScalProduct) { double lEPSPResAB = (collision.qvecRe()[lQvecDetInd] * collision.qvecRe()[lQvecRefAInd] + collision.qvecIm()[lQvecDetInd] * collision.qvecIm()[lQvecRefAInd]); double lEPSPResAC = (collision.qvecRe()[lQvecDetInd] * collision.qvecRe()[lQvecRefBInd] + collision.qvecIm()[lQvecDetInd] * collision.qvecIm()[lQvecRefBInd]); double lEPSPResBC = (collision.qvecRe()[lQvecRefAInd] * collision.qvecRe()[lQvecRefBInd] + collision.qvecIm()[lQvecRefAInd] * collision.qvecIm()[lQvecRefBInd]); @@ -844,21 +769,17 @@ struct Chk892Flow std::vector trackIndicies = {}; std::vector k0sIndicies = {}; - for (const auto& bTrack : dTracks1) - { + for (const auto& bTrack : dTracks1) { auto trkbpt = bTrack.pt(); auto istrkbhasTOF = bTrack.hasTOF(); auto trkbNSigmaPiTPC = bTrack.tpcNSigmaPi(); auto trkbNSigmaPiTOF = (istrkbhasTOF) ? bTrack.tofNSigmaPi() : -999.; - if constexpr (!IsMix) - { - if (AnalysisConfig.cfgFillQAPlots) - { + if constexpr (!IsMix) { + if (AnalysisConfig.cfgFillQAPlots) { // Bachelor pion QA plots histos.fill(HIST("QA/before/trkbpionTPCPID"), trkbpt, trkbNSigmaPiTPC); - if (istrkbhasTOF) - { + if (istrkbhasTOF) { histos.fill(HIST("QA/before/trkbpionTOFPID"), trkbpt, trkbNSigmaPiTOF); histos.fill(HIST("QA/before/trkbpionTPCTOFPID"), trkbNSigmaPiTPC, trkbNSigmaPiTOF); } @@ -873,14 +794,11 @@ struct Chk892Flow if (!selectionPIDPion(bTrack)) continue; - if constexpr (!IsMix) - { - if (AnalysisConfig.cfgFillQAPlots) - { + if constexpr (!IsMix) { + if (AnalysisConfig.cfgFillQAPlots) { // Bachelor pion QA plots after applying cuts histos.fill(HIST("QA/after/trkbpionTPCPID"), trkbpt, trkbNSigmaPiTPC); - if (istrkbhasTOF) - { + if (istrkbhasTOF) { histos.fill(HIST("QA/after/trkbpionTOFPID"), trkbpt, trkbNSigmaPiTOF); histos.fill(HIST("QA/after/trkbpionTPCTOFPID"), trkbNSigmaPiTPC, trkbNSigmaPiTOF); } @@ -892,8 +810,7 @@ struct Chk892Flow trackIndicies.push_back(bTrack.index()); } - for (const auto& k0sCand : dTracks2) - { + for (const auto& k0sCand : dTracks2) { auto posDauTrack = k0sCand.template posTrack_as(); auto negDauTrack = k0sCand.template negTrack_as(); @@ -927,14 +844,11 @@ struct Chk892Flow float sinNPhiK0s = std::sin(static_cast(nmode) * lResoSecondary.Phi()); auto v2K0s = cosNPhiK0s * collision.qvecRe()[lQvecDetInd] + sinNPhiK0s * collision.qvecIm()[lQvecDetInd]; - if constexpr (!IsMix) - { - if (AnalysisConfig.cfgFillQAPlots) - { + if constexpr (!IsMix) { + if (AnalysisConfig.cfgFillQAPlots) { // Seconddary QA plots histos.fill(HIST("QA/before/trkppionTPCPID"), trkppt, trkpNSigmaPiTPC); - if (istrkphasTOF) - { + if (istrkphasTOF) { histos.fill(HIST("QA/before/trkppionTOFPID"), trkppt, trkpNSigmaPiTOF); histos.fill(HIST("QA/before/trkppionTPCTOFPID"), trkpNSigmaPiTPC, trkpNSigmaPiTOF); } @@ -943,8 +857,7 @@ struct Chk892Flow histos.fill(HIST("QA/before/trkppionDCAz"), posDauTrack.dcaZ()); histos.fill(HIST("QA/before/trknpionTPCPID"), trknpt, trknNSigmaPiTPC); - if (istrknhasTOF) - { + if (istrknhasTOF) { histos.fill(HIST("QA/before/trknpionTOFPID"), trknpt, trknNSigmaPiTOF); histos.fill(HIST("QA/before/trknpionTPCTOFPID"), trknNSigmaPiTPC, trknNSigmaPiTOF); } @@ -973,14 +886,11 @@ struct Chk892Flow if (!selectionK0s(collision, k0sCand)) continue; - if constexpr (!IsMix) - { - if (AnalysisConfig.cfgFillQAPlots) - { + if constexpr (!IsMix) { + if (AnalysisConfig.cfgFillQAPlots) { // Seconddary QA plots after applying cuts histos.fill(HIST("QA/after/trkppionTPCPID"), trkppt, trkpNSigmaPiTPC); - if (istrkphasTOF) - { + if (istrkphasTOF) { histos.fill(HIST("QA/after/trkppionTOFPID"), trkppt, trkpNSigmaPiTOF); histos.fill(HIST("QA/after/trkppionTPCTOFPID"), trkpNSigmaPiTPC, trkpNSigmaPiTOF); } @@ -989,8 +899,7 @@ struct Chk892Flow histos.fill(HIST("QA/after/trkppionDCAz"), posDauTrack.dcaZ()); histos.fill(HIST("QA/after/trknpionTPCPID"), trknpt, trknNSigmaPiTPC); - if (istrknhasTOF) - { + if (istrknhasTOF) { histos.fill(HIST("QA/after/trknpionTOFPID"), trknpt, trknNSigmaPiTOF); histos.fill(HIST("QA/after/trknpionTPCTOFPID"), trknNSigmaPiTPC, trknNSigmaPiTOF); } @@ -1006,12 +915,9 @@ struct Chk892Flow histos.fill(HIST("QA/after/hInvmassSecondary"), trkkMass); histos.fill(HIST("QA/after/k0sv2vsinvmass"), lResoSecondary.M(), v2K0s); - if (AnalysisConfig.cfgFillAdditionalAxis) - { + if (AnalysisConfig.cfgFillAdditionalAxis) { histos.fill(HIST("hInvmass_K0s"), lCentrality, lResoSecondary.Pt(), lResoSecondary.M(), v2K0s, static_cast(nmode) * lPhiMinusPsiK0s, collision.trackOccupancyInTimeRange()); - } - else - { + } else { histos.fill(HIST("hInvmass_K0s"), lCentrality, lResoSecondary.Pt(), lResoSecondary.M(), v2K0s, collision.trackOccupancyInTimeRange()); } } @@ -1019,10 +925,8 @@ struct Chk892Flow } } - for (const auto& trackIndex : trackIndicies) - { - for (const auto& k0sIndex : k0sIndicies) - { + for (const auto& trackIndex : trackIndicies) { + for (const auto& k0sIndex : k0sIndicies) { auto bTrack = dTracks1.rawIteratorAt(trackIndex); auto k0sCand = dTracks2.rawIteratorAt(k0sIndex); auto trkkMass = k0sCand.mK0Short(); @@ -1035,18 +939,15 @@ struct Chk892Flow auto lPhiMinusPsiKstar = RecoDecay::constrainAngle(resoPhi - lEPDet, 0.0, 2); // constrain angle to range 0, Pi auto resoFlowValue = std::cos(static_cast(nmode) * lPhiMinusPsiKstar); // Scalar product method - if (AnalysisConfig.cfgUseScalProduct) - { + if (AnalysisConfig.cfgUseScalProduct) { float cosNPhi = std::cos(static_cast(nmode) * resoPhi); float sinNPhi = std::sin(static_cast(nmode) * resoPhi); resoFlowValue = cosNPhi * collision.qvecRe()[lQvecDetInd] + sinNPhi * collision.qvecIm()[lQvecDetInd]; } // QA plots - if constexpr (!IsMix) - { - if (AnalysisConfig.cfgFillQAPlots) - { + if constexpr (!IsMix) { + if (AnalysisConfig.cfgFillQAPlots) { histos.fill(HIST("QA/before/KstarRapidity"), lResoKstar.Rapidity()); histos.fill(HIST("QA/before/kstarinvmass"), lResoKstar.M()); histos.fill(HIST("QA/before/kstarv2vsinvmass"), lResoKstar.M(), resoFlowValue); @@ -1056,44 +957,33 @@ struct Chk892Flow if (lResoKstar.Rapidity() > KstarCuts.cfgKstarMaxRap || lResoKstar.Rapidity() < KstarCuts.cfgKstarMinRap) continue; - if constexpr (!IsMix) - { + if constexpr (!IsMix) { unsigned int typeKstar = bTrack.sign() > 0 ? BinType::kKstarP : BinType::kKstarN; - if (AnalysisConfig.cfgFillQAPlots) - { + if (AnalysisConfig.cfgFillQAPlots) { histos.fill(HIST("QA/after/KstarRapidity"), lResoKstar.Rapidity()); histos.fill(HIST("QA/after/kstarinvmass"), lResoKstar.M()); histos.fill(HIST("QA/after/kstarv2vsinvmass"), lResoKstar.M(), resoFlowValue); } - if (AnalysisConfig.cfgFillAdditionalAxis) - { + if (AnalysisConfig.cfgFillAdditionalAxis) { histos.fill(HIST("hInvmass_Kstar"), typeKstar, lCentrality, lResoKstar.Pt(), lResoKstar.M(), resoFlowValue, static_cast(nmode) * lPhiMinusPsiKstar, collision.trackOccupancyInTimeRange()); - } - else - { + } else { histos.fill(HIST("hInvmass_Kstar"), typeKstar, lCentrality, lResoKstar.Pt(), lResoKstar.M(), resoFlowValue, collision.trackOccupancyInTimeRange()); } - if (BkgEstimationConfig.cfgFillRotBkg) - { - for (int i = 0; i < BkgEstimationConfig.cfgNrotBkg; i++) - { + if (BkgEstimationConfig.cfgFillRotBkg) { + for (int i = 0; i < BkgEstimationConfig.cfgNrotBkg; i++) { auto lRotAngle = BkgEstimationConfig.cfgMinRot + i * ((BkgEstimationConfig.cfgMaxRot - BkgEstimationConfig.cfgMinRot) / (BkgEstimationConfig.cfgNrotBkg - 1)); - if (AnalysisConfig.cfgFillQAPlots) - { + if (AnalysisConfig.cfgFillQAPlots) { histos.fill(HIST("QA/RotBkg/hRotBkg"), lRotAngle); } - if (BkgEstimationConfig.cfgRotPion) - { + if (BkgEstimationConfig.cfgRotPion) { lDaughterRot = lDecayDaughter_bach; ROOT::Math::RotationZ rot(lRotAngle); auto p3 = rot * lDaughterRot.Vect(); lDaughterRot = LorentzVectorSetXYZM(p3.X(), p3.Y(), p3.Z(), lDaughterRot.M()); lResonanceRot = lDaughterRot + lResoSecondary; - } - else - { + } else { lDaughterRot = lResoSecondary; ROOT::Math::RotationZ rot(lRotAngle); auto p3 = rot * lDaughterRot.Vect(); @@ -1103,19 +993,15 @@ struct Chk892Flow resoPhi = lResonanceRot.Phi(); auto lPhiMinusPsiKstar = RecoDecay::constrainAngle(resoPhi - lEPDet, 0.0, 2); // constrain angle to range 0, Pi auto resoFlowValue = std::cos(static_cast(nmode) * lPhiMinusPsiKstar); - if (AnalysisConfig.cfgUseScalProduct) - { + if (AnalysisConfig.cfgUseScalProduct) { float cosNPhi = std::cos(static_cast(nmode) * resoPhi); float sinNPhi = std::sin(static_cast(nmode) * resoPhi); resoFlowValue = cosNPhi * collision.qvecRe()[lQvecDetInd] + sinNPhi * collision.qvecIm()[lQvecDetInd]; } typeKstar = bTrack.sign() > 0 ? BinType::kKstarP_Rot : BinType::kKstarN_Rot; - if (AnalysisConfig.cfgFillAdditionalAxis) - { + if (AnalysisConfig.cfgFillAdditionalAxis) { histos.fill(HIST("hInvmass_Kstar"), typeKstar, lCentrality, lResonanceRot.Pt(), lResonanceRot.M(), resoFlowValue, static_cast(nmode) * lPhiMinusPsiKstar, collision.trackOccupancyInTimeRange()); - } - else - { + } else { histos.fill(HIST("hInvmass_Kstar"), typeKstar, lCentrality, lResonanceRot.Pt(), lResonanceRot.M(), resoFlowValue, collision.trackOccupancyInTimeRange()); } } @@ -1143,8 +1029,7 @@ struct Chk892Flow { if (!colCuts.isSelected(collision)) // Default event selection return; - if (EventCuts.cfgEvtUseRCTFlagChecker && !rctChecker(collision)) - { + if (EventCuts.cfgEvtUseRCTFlagChecker && !rctChecker(collision)) { return; } float qAmpThr = 1e-4f; From 79de014781b04ee3415048cd277dd98ab3f43686 Mon Sep 17 00:00:00 2001 From: SuJeong Ji <120470463+SuJeong-Ji@users.noreply.github.com> Date: Wed, 24 Sep 2025 17:30:10 +0900 Subject: [PATCH 03/11] Add histograms for efficiency calculation in chk892pp.cxx --- PWGLF/Tasks/Resonances/chk892pp.cxx | 636 ++++++++++++++++++++-------- 1 file changed, 470 insertions(+), 166 deletions(-) diff --git a/PWGLF/Tasks/Resonances/chk892pp.cxx b/PWGLF/Tasks/Resonances/chk892pp.cxx index 419a8ea69b6..8e2c0a6e861 100644 --- a/PWGLF/Tasks/Resonances/chk892pp.cxx +++ b/PWGLF/Tasks/Resonances/chk892pp.cxx @@ -13,62 +13,69 @@ /// \brief Reconstruction of track-track decay resonance candidates /// /// -/// \author Su-Jeong Ji +/// \author Su-Jeong Ji , Bong-Hwi Lim -#include -#include -#include #include -#include +#include +#include #include #include #include +#include +#include // #include // FIXME -#include "PWGLF/DataModel/LFStrangenessTables.h" -#include "PWGLF/Utils/collisionCuts.h" +#include // FIXME -#include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/trackUtilities.h" -#include "Common/DataModel/Centrality.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/PIDResponse.h" -#include "Common/DataModel/TrackSelectionTables.h" +#include +#include +#include +#include +#include +#include -#include "CCDB/BasicCCDBManager.h" -#include "CCDB/CcdbApi.h" -#include "CommonConstants/MathConstants.h" -#include "CommonConstants/PhysicsConstants.h" -#include "DCAFitter/DCAFitterN.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" +#include "TRandom3.h" +#include "TF1.h" +#include "TVector2.h" +#include "Math/Vector3D.h" +#include "Math/Vector4D.h" +#include "Math/RotationZ.h" +#include "Math/GenVector/Boost.h" +#include + +#include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" #include "Framework/HistogramRegistry.h" +#include "Framework/StepTHn.h" #include "Framework/O2DatabasePDGPlugin.h" +#include "Framework/ASoAHelpers.h" #include "Framework/StaticFor.h" -#include "Framework/StepTHn.h" -#include "Framework/runDataProcessing.h" +#include "DCAFitter/DCAFitterN.h" + +#include "Common/DataModel/PIDResponse.h" +#include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/TrackSelectionTables.h" +#include "Common/DataModel/EventSelection.h" + +#include "Common/Core/trackUtilities.h" +#include "Common/Core/TrackSelection.h" +#include "Common/Core/RecoDecay.h" + +#include "CommonConstants/PhysicsConstants.h" +#include "CommonConstants/MathConstants.h" + #include "ReconstructionDataFormats/Track.h" -#include "Math/GenVector/Boost.h" -#include "Math/RotationZ.h" -#include "Math/Vector3D.h" -#include "Math/Vector4D.h" -#include "TF1.h" -#include "TRandom3.h" -#include "TVector2.h" -#include -#include // FIXME +#include "DataFormatsParameters/GRPObject.h" +#include "DataFormatsParameters/GRPMagField.h" -#include -#include -#include -#include -#include -#include +#include "CCDB/CcdbApi.h" +#include "CCDB/BasicCCDBManager.h" + +#include "PWGLF/DataModel/LFStrangenessTables.h" +#include "PWGLF/Utils/collisionCuts.h" +#include "PWGLF/Utils/inelGt.h" using namespace o2; using namespace o2::framework; @@ -77,6 +84,22 @@ using namespace o2::soa; using namespace o2::constants::physics; using namespace o2::aod::rctsel; +namespace{ + template + inline bool getTruthK0sAndGenKinematics(V0T const &v0, double &ptgen, double &ygen) + { + if (!v0.has_mcParticle()) + return false; + auto mcPart = v0.template mcParticle_as(); + if (mcPart.pdgCode() != kK0Short) + return false; + ptgen = mcPart.pt(); + ygen = mcPart.y(); + return true; + } +} + + struct Chk892pp { enum BinType : unsigned int { kKstarP = 0, @@ -91,14 +114,19 @@ struct Chk892pp { SliceCache cache; Preslice perCollision = aod::track::collisionId; - using EventCandidates = soa::Join; - // using EventCandidates = soa::Join; + using EventCandidates = soa::Join; using TrackCandidates = soa::Join; using V0Candidates = aod::V0Datas; + // for MC reco using MCEventCandidates = soa::Join; - using MCTrackCandidates = soa::Join; + using MCTrackCandidates = soa::Join;//, aod::McParticles>; using MCV0Candidates = soa::Join; + + // for MC truth + using MCTrueEventCandidates = aod::McCollisions; + using MCTrueTrackCandidates = aod::McParticles; + using LorentzVectorSetXYZM = ROOT::Math::LorentzVector>; HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; @@ -115,7 +143,7 @@ struct Chk892pp { // Configurables struct : ConfigurableGroup { ConfigurableAxis cfgBinsPt{"cfgBinsPt", {VARIABLE_WIDTH, 0.0, 0.1, 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, 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8, 4.9, 5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 5.9, 6.0, 6.1, 6.2, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 6.9, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.6, 7.7, 7.8, 7.9, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5, 8.6, 8.7, 8.8, 8.9, 9.0, 9.1, 9.2, 9.3, 9.4, 9.5, 9.6, 9.7, 9.8, 9.9, 10.0, 10.1, 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 11.0, 11.1, 11.2, 11.3, 11.4, 11.5, 11.6, 11.7, 11.8, 11.9, 12.0, 12.1, 12.2, 12.3, 12.4, 12.5, 12.6, 12.7, 12.8, 12.9, 13.0, 13.1, 13.2, 13.3, 13.4, 13.5, 13.6, 13.7, 13.8, 13.9, 14.0, 14.1, 14.2, 14.3, 14.4, 14.5, 14.6, 14.7, 14.8, 14.9, 15.0}, "Binning of the pT axis"}; - ConfigurableAxis cfgBinsPtQA{"cfgBinsPtQA", {VARIABLE_WIDTH, 0.0, 0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.2, 2.4, 2.6, 2.8, 3.0, 3.2, 3.4, 3.6, 3.8, 4.0, 4.2, 4.4, 4.6, 4.8, 5.0, 5.2, 5.4, 5.6, 5.8, 6.0, 6.2, 6.4, 6.6, 6.8, 7.0, 7.2, 7.4, 7.6, 7.8, 8.0, 8.2, 8.4, 8.6, 8.8, 9.0, 9.2, 9.4, 9.6, 9.8, 10.0}, "Binning of the pT axis"}; + ConfigurableAxis cfgBinsPtQA{"cfgBinsPtQA", {VARIABLE_WIDTH, 0.0, 0.8, 1.3, 1.8, 2.3, 2.8, 3.4, 4.0, 5.0, 6.0, 7.0, 8.0}, "Binning of the pT axis"}; ConfigurableAxis cfgBinsCent{"cfgBinsCent", {VARIABLE_WIDTH, 0.0, 1.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 110.0}, "Binning of the centrality axis"}; ConfigurableAxis cfgBinsVtxZ{"cfgBinsVtxZ", {VARIABLE_WIDTH, -10.0, -9.0, -8.0, -7.0, -6.0, -5.0, -4.0, -3.0, -2.0, -1.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0}, "Binning of the z-vertex axis"}; Configurable cNbinsDiv{"cNbinsDiv", 1, "Integer to divide the number of bins"}; @@ -130,14 +158,14 @@ struct Chk892pp { Configurable cfgEvtOccupancyInTimeRangeMin{"cfgEvtOccupancyInTimeRangeMin", -1, "Evt sel: minimum track occupancy"}; Configurable cfgEvtTriggerCheck{"cfgEvtTriggerCheck", false, "Evt sel: check for trigger"}; Configurable cfgEvtOfflineCheck{"cfgEvtOfflineCheck", true, "Evt sel: check for offline selection"}; - Configurable cfgEvtTriggerTVXSel{"cfgEvtTriggerTVXSel", false, "Evt sel: triggerTVX selection (MB)"}; - Configurable cfgEvtTFBorderCut{"cfgEvtTFBorderCut", false, "Evt sel: apply TF border cut"}; + Configurable cfgEvtTriggerTVXSel{"cfgEvtTriggerTVXSel", true, "Evt sel: triggerTVX selection (MB)"}; + Configurable cfgEvtTFBorderCut{"cfgEvtTFBorderCut", true, "Evt sel: apply TF border cut"}; Configurable cfgEvtUseITSTPCvertex{"cfgEvtUseITSTPCvertex", false, "Evt sel: use at lease on ITS-TPC track for vertexing"}; - Configurable cfgEvtZvertexTimedifference{"cfgEvtZvertexTimedifference", true, "Evt sel: apply Z-vertex time difference"}; - Configurable cfgEvtPileupRejection{"cfgEvtPileupRejection", true, "Evt sel: apply pileup rejection"}; - Configurable cfgEvtNoITSROBorderCut{"cfgEvtNoITSROBorderCut", false, "Evt sel: apply NoITSRO border cut"}; + Configurable cfgEvtZvertexTimedifference{"cfgEvtZvertexTimedifference", false, "Evt sel: apply Z-vertex time difference"}; + Configurable cfgEvtPileupRejection{"cfgEvtPileupRejection", false, "Evt sel: apply pileup rejection"}; + Configurable cfgEvtNoITSROBorderCut{"cfgEvtNoITSROBorderCut", true, "Evt sel: apply NoITSRO border cut"}; Configurable cfgincludeCentralityMC{"cfgincludeCentralityMC", false, "Include centrality in MC"}; - Configurable cfgEvtCollInTimeRangeStandard{"cfgEvtCollInTimeRangeStandard", true, "Evt sel: apply NoCollInTimeRangeStandard"}; + Configurable cfgEvtCollInTimeRangeStandard{"cfgEvtCollInTimeRangeStandard", false, "Evt sel: apply NoCollInTimeRangeStandard"}; Configurable cfgEventCentralityMin{"cfgEventCentralityMin", 0.0f, "Event sel: minimum centrality"}; Configurable cfgEventCentralityMax{"cfgEventCentralityMax", 80.0f, "Event sel: maximum centrality"}; Configurable cfgEvtUseRCTFlagChecker{"cfgEvtUseRCTFlagChecker", false, "Evt sel: use RCT flag checker"}; @@ -147,22 +175,16 @@ struct Chk892pp { } EventCuts; RCTFlagsChecker rctChecker; - /* - // Cuts from polarization analysis - Configurable cfgOccupancySel{"cfgOccupancySel", false, "Occupancy selection"}; - Configurable cfgMaxOccupancy{"cfgMaxOccupancy", 999999, "maximum occupancy of tracks in neighbouring collisions in a given time range"}; - Configurable cfgMinOccupancy{"cfgMinOccupancy", -100, "maximum occupancy of tracks in neighbouring collisions in a given time range"}; - Configurable cfgNCollinTR{"cfgNCollinTR", false, "Additional selection for the number of coll in time range"}; -*/ Configurable cfgCentEst{"cfgCentEst", 2, "Centrality estimator, 1: FT0C, 2: FT0M"}; /// PID Selections, pion struct : ConfigurableGroup { - Configurable cfgTPConly{"cfgTPConly", true, "Use only TPC for PID"}; // bool + Configurable cfgTPConly{"cfgTPConly", false, "Use only TPC for PID"}; // bool Configurable cfgMaxTPCnSigmaPion{"cfgMaxTPCnSigmaPion", 3.0, "TPC nSigma cut for Pion"}; // TPC Configurable cfgMaxTOFnSigmaPion{"cfgMaxTOFnSigmaPion", 3.0, "TOF nSigma cut for Pion"}; // TOF Configurable cfgNsigmaCutCombinedPion{"cfgNsigmaCutCombinedPion", -999, "Combined nSigma cut for Pion"}; // Combined Configurable cfgTOFVeto{"cfgTOFVeto", true, "TOF Veto, if false, TOF is nessessary for PID selection"}; // TOF Veto + Configurable cfgTOFMinPt{"cfgTOFMinPt", 0.6, "Minimum TOF pT cut for Pion"}; // TOF pT cut } PIDCuts; // Track selections @@ -174,7 +196,7 @@ struct Chk892pp { Configurable cfgGlobalTrack{"cfgGlobalTrack", false, "Global track selection"}; // kGoldenChi2 | kDCAxy | kDCAz Configurable cfgPVContributor{"cfgPVContributor", false, "PV contributor track selection"}; // PV Contriuibutor - Configurable cfgpTdepDCAxyCut{"cfgpTdepDCAxyCut", false, "pT-dependent DCAxy cut"}; + Configurable cfgpTdepDCAxyCut{"cfgpTdepDCAxyCut", true, "pT-dependent DCAxy cut"}; Configurable cfgITScluster{"cfgITScluster", 0, "Number of ITS cluster"}; Configurable cfgTPCcluster{"cfgTPCcluster", 0, "Number of TPC cluster"}; Configurable cfgRatioTPCRowsOverFindableCls{"cfgRatioTPCRowsOverFindableCls", 0.0f, "TPC Crossed Rows to Findable Clusters"}; @@ -193,22 +215,22 @@ struct Chk892pp { // Secondary Selection struct : ConfigurableGroup { - Configurable cfgReturnFlag{"cfgReturnFlag", false, "Return Flag for debugging"}; + Configurable cfgReturnFlag{"cfgReturnFlag", true, "Return Flag for debugging"}; Configurable cfgSecondaryRequire{"cfgSecondaryRequire", true, "Secondary cuts on/off"}; Configurable cfgSecondaryArmenterosCut{"cfgSecondaryArmenterosCut", true, "cut on Armenteros-Podolanski graph"}; Configurable cfgSecondaryCrossMassHypothesisCut{"cfgSecondaryCrossMassHypothesisCut", false, "Apply cut based on the lambda mass hypothesis"}; Configurable cfgByPassDauPIDSelection{"cfgByPassDauPIDSelection", true, "Bypass Daughters PID selection"}; Configurable cfgSecondaryDauDCAMax{"cfgSecondaryDauDCAMax", 1., "Maximum DCA Secondary daughters to PV"}; - Configurable cfgSecondaryDauPosDCAtoPVMin{"cfgSecondaryDauPosDCAtoPVMin", 0.0, "Minimum DCA Secondary positive daughters to PV"}; - Configurable cfgSecondaryDauNegDCAtoPVMin{"cfgSecondaryDauNegDCAtoPVMin", 0.0, "Minimum DCA Secondary negative daughters to PV"}; + Configurable cfgSecondaryDauPosDCAtoPVMin{"cfgSecondaryDauPosDCAtoPVMin", 0.1, "Minimum DCA Secondary positive daughters to PV"}; + Configurable cfgSecondaryDauNegDCAtoPVMin{"cfgSecondaryDauNegDCAtoPVMin", 0.1, "Minimum DCA Secondary negative daughters to PV"}; Configurable cfgSecondaryPtMin{"cfgSecondaryPtMin", 0.f, "Minimum transverse momentum of Secondary"}; Configurable cfgSecondaryRapidityMax{"cfgSecondaryRapidityMax", 0.8, "Maximum rapidity of Secondary"}; - Configurable cfgSecondaryRadiusMin{"cfgSecondaryRadiusMin", 1.2, "Minimum transverse radius of Secondary"}; + Configurable cfgSecondaryRadiusMin{"cfgSecondaryRadiusMin", 0, "Minimum transverse radius of Secondary"}; Configurable cfgSecondaryRadiusMax{"cfgSecondaryRadiusMax", 999.9, "Maximum transverse radius of Secondary"}; Configurable cfgSecondaryCosPAMin{"cfgSecondaryCosPAMin", 0.995, "Mininum cosine pointing angle of Secondary"}; - Configurable cfgSecondaryDCAtoPVMax{"cfgSecondaryDCAtoPVMax", 0.3, "Maximum DCA Secondary to PV"}; + Configurable cfgSecondaryDCAtoPVMax{"cfgSecondaryDCAtoPVMax", 0.4, "Maximum DCA Secondary to PV"}; Configurable cfgSecondaryProperLifetimeMax{"cfgSecondaryProperLifetimeMax", 20, "Maximum Secondary Lifetime"}; Configurable cfgSecondaryparamArmenterosCut{"cfgSecondaryparamArmenterosCut", 0.2, "parameter for Armenteros Cut"}; Configurable cfgSecondaryMassWindow{"cfgSecondaryMassWindow", 0.03, "Secondary inv mass selciton window"}; @@ -273,12 +295,29 @@ struct Chk892pp { AxisSpec pidQAAxis = {130 / AxisConfig.cNbinsDivQA, -6.5, 6.5}; AxisSpec dataTypeAxis = {9, 0, 9, "Histogram types"}; AxisSpec mcTypeAxis = {4, 0, 4, "Histogram types"}; + AxisSpec cutAxis{14, 0.5, 14.5, "Check"}; // 1..14 // 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{12, -0.5, 11.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"); // 총 후보 수 + hcut->GetXaxis()->SetBinLabel(2, "PASS"); // 최종 통과 + hcut->GetXaxis()->SetBinLabel(3, "DauDCA>max"); + hcut->GetXaxis()->SetBinLabel(4, "PosDCAtoPVGetXaxis()->SetBinLabel(5, "NegDCAtoPVGetXaxis()->SetBinLabel(6, "pTGetXaxis()->SetBinLabel(7, "|y|>max"); + hcut->GetXaxis()->SetBinLabel(8, "Rmax"); + hcut->GetXaxis()->SetBinLabel(9, "DCAtoPV>max"); + hcut->GetXaxis()->SetBinLabel(10, "cosPAGetXaxis()->SetBinLabel(11, "ctau>max"); + hcut->GetXaxis()->SetBinLabel(12, "qtarmGetXaxis()->SetBinLabel(13, "|M(K0s)-m0|>win"); + hcut->GetXaxis()->SetBinLabel(14, "cross-mass veto"); histos.add("QA/before/CentDist", "Centrality distribution", {HistType::kTH1D, {centAxis}}); histos.add("QA/before/VtxZ", "Centrality distribution", {HistType::kTH1D, {vtxzAxis}}); @@ -376,70 +415,38 @@ struct Chk892pp { // MC if (doprocessMC) { - histos.add("QAMC/hEvent", "Number of Events", HistType::kTH1F, {{1, 0.5, 1.5}}); - // Bachelor pion - histos.add("QAMC/trkbpionDCAxy", "DCAxy distribution of bachelor pion candidates", HistType::kTH1D, {dcaxyAxis}); - histos.add("QAMC/trkbpionDCAz", "DCAz distribution of bachelor pion candidates", HistType::kTH1D, {dcazAxis}); - histos.add("QAMC/trkbpionpT", "pT distribution of bachelor pion candidates", HistType::kTH1D, {ptAxis}); - histos.add("QAMC/trkbpionTPCPID", "TPC PID of bachelor pion candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); - histos.add("QAMC/trkbpionTOFPID", "TOF PID of bachelor pion candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); - histos.add("QAMC/trkbpionTPCTOFPID", "TPC-TOF PID map of bachelor pion candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); - - // Secondary pion 1 - histos.add("QAMC/trkppionDCAxy", "DCAxy distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcaxyAxis}); - histos.add("QAMC/trkppionDCAz", "DCAz distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcazAxis}); - histos.add("QAMC/trkppionpT", "pT distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {ptAxis}); - histos.add("QAMC/trkppionTPCPID", "TPC PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); - histos.add("QAMC/trkppionTOFPID", "TOF PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); - histos.add("QAMC/trkppionTPCTOFPID", "TPC-TOF PID map of secondary pion 1 (positive) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); - - // Secondary pion 2 - histos.add("QAMC/trknpionTPCPID", "TPC PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); - histos.add("QAMC/trknpionTOFPID", "TOF PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); - histos.add("QAMC/trknpionTPCTOFPID", "TPC-TOF PID map of secondary pion 2 (negative) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); - histos.add("QAMC/trknpionpT", "pT distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {ptAxis}); - histos.add("QAMC/trknpionDCAxy", "DCAxy distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {dcaxyAxis}); - histos.add("QAMC/trknpionDCAz", "DCAz distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {dcazAxis}); - - // Secondary Resonance (K0s cand) - histos.add("QAMC/hDauDCASecondary", "DCA of daughters of secondary resonance", HistType::kTH1D, {dcaAxis}); - histos.add("QAMC/hDauPosDCAtoPVSecondary", "Pos DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); - histos.add("QAMC/hDauNegDCAtoPVSecondary", "Neg DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); - - histos.add("QAMC/hpT_Secondary", "pT distribution of secondary resonance", HistType::kTH1D, {ptAxis}); - histos.add("QAMC/hy_Secondary", "Rapidity distribution of secondary resonance", HistType::kTH1D, {yAxis}); - histos.add("QAMC/hRadiusSecondary", "Radius distribution of secondary resonance", HistType::kTH1D, {radiusAxis}); - histos.add("QAMC/hCPASecondary", "Cosine pointing angle distribution of secondary resonance", HistType::kTH1D, {cpaAxis}); - histos.add("QAMC/hDCAtoPVSecondary", "DCA to PV distribution of secondary resonance", HistType::kTH1D, {dcaAxis}); - histos.add("QAMC/hPropTauSecondary", "Proper Lifetime distribution of secondary resonance", HistType::kTH1D, {tauAxis}); - histos.add("QAMC/hPtAsymSecondary", "pT asymmetry distribution of secondary resonance", HistType::kTH1D, {AxisSpec{100, -1, 1, "Pair asymmetry"}}); - histos.add("QAMC/hInvmassSecondary", "Invariant mass of unlike-sign secondary resonance", HistType::kTH1D, {invMassAxisK0s}); - - // K892 - histos.add("QAMC/KstarOA", "Opening angle of chK(892)", HistType::kTH1D, {AxisSpec{100, 0, 3.14, "Opening angle"}}); - histos.add("QAMC/KstarPairAsym", "Pair asymmetry of chK(892)", HistType::kTH1D, {AxisSpec{100, -1, 1, "Pair asymmetry"}}); - histos.add("QAMC/KstarRapidity", "Rapidity distribution of chK(892)", HistType::kTH1D, {yAxis}); - - histos.add("QAMC/kstarinvmass", "Invariant mass of unlike-sign chK(892)", HistType::kTH1D, {invMassAxisReso}); - histos.add("QAMC/kstarinvmass_noKstar", "Invariant mass of unlike-sign no chK(892)", HistType::kTH1D, {invMassAxisReso}); - - histos.add("hInvmass_Kstar_MC", "Invariant mass of unlike chK(892)", HistType::kTHnSparseD, {axisType, centAxis, ptAxis, invMassAxisReso}); - - 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()); + histos.add("QACent_woCut","Centrality without cut", HistType::kTH1F, {centAxis}); + histos.add("QACent_woCentCut","Centrality without cent cut", HistType::kTH1F, {centAxis}); + histos.add("QACent_wCentCut","Centrality with cent cut", HistType::kTH1F, {centAxis}); + histos.add("QAvtxz_woCut","z-vertex without cut", HistType::kTH1F, {vtxzAxis}); + histos.add("QAvtxz_wVtxzCut","z-vertex with vtxz cut", HistType::kTH1F, {vtxzAxis}); + + histos.add("EffK0s/genK0s", "Gen K0s (|y<0.8|)", HistType::kTH2F, {ptAxisQA, centAxis}); + histos.add("EffK0s/recoK0s", "Reco K0s (|y<0.8|)", HistType::kTH2F, {ptAxisQA, centAxis}); + + histos.add("EffKstar/genKstar", "Gen Kstar (|y|<0.5)", HistType::kTH2F, {ptAxisQA, centAxis}); + histos.add("EffKstar/genKstar_m", "Gen Kstar (|y|<0.5) invariant mass distribution", HistType::kTH1F, {invMassAxisReso}); + histos.add("EffKstar/recoKstar", "Kstar Reco matched (final all)", HistType::kTH2F, {ptAxisQA, centAxis}); + histos.add("EffKstar/recoKstar_m", "Kstar Reco (final all) invariant mass distribution", HistType::kTH2F, {ptAxisQA, invMassAxisReso}); + histos.add("EffKstar/recoKstar_m_rot", "Kstar Reco (final all) invariant mass distribution of Rot", HistType::kTH2F, {ptAxisQA, invMassAxisReso}); + + histos.add("EffKstar/recoKstar_m_matched", "Kstar Reco matched (final all) invariant mass distribution", HistType::kTH2F, {ptAxisQA, invMassAxisReso}); } + 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 chK(892) Analysis Task"; histos.print(); } - const int kCentFT0C = 1; - const int kCentFT0M = 2; - const float kInvalidCentrality = -999.f; + const int kCentFT0C = 1; + const int kCentFT0M = 2; + const float kInvalidCentrality = -999.f; template float getCentrality(CollisionType const& collision) @@ -528,48 +535,47 @@ struct Chk892pp { template bool selectionPIDPion(TrackType const& candidate) { - bool tpcPIDPassed = std::abs(candidate.tpcNSigmaPi()) < PIDCuts.cfgMaxTPCnSigmaPion; - bool tofPIDPassed = false; - - if (PIDCuts.cfgTPConly) { - return tpcPIDPassed; - } + if (std::abs(candidate.tpcNSigmaPi()) >= PIDCuts.cfgMaxTPCnSigmaPion) + return false; + if (PIDCuts.cfgTPConly) + return true; + if (candidate.pt() <= PIDCuts.cfgTOFMinPt) + return true; if (candidate.hasTOF()) { - tofPIDPassed = std::abs(candidate.tofNSigmaPi()) < PIDCuts.cfgMaxTOFnSigmaPion || - (PIDCuts.cfgNsigmaCutCombinedPion > 0 && - candidate.tpcNSigmaPi() * candidate.tpcNSigmaPi() + + const bool tofPIDPassed = std::abs(candidate.tofNSigmaPi()) < PIDCuts.cfgMaxTOFnSigmaPion; + const bool combo = (PIDCuts.cfgNsigmaCutCombinedPion > 0) && + (candidate.tpcNSigmaPi() * candidate.tpcNSigmaPi() + candidate.tofNSigmaPi() * candidate.tofNSigmaPi() < - PIDCuts.cfgNsigmaCutCombinedPion * PIDCuts.cfgNsigmaCutCombinedPion); + PIDCuts.cfgNsigmaCutCombinedPion * PIDCuts.cfgNsigmaCutCombinedPion); + return tofPIDPassed || combo; } else { - tofPIDPassed = PIDCuts.cfgTOFVeto; + return PIDCuts.cfgTOFVeto; } - - return tpcPIDPassed && tofPIDPassed; } template bool selectionK0s(CollisionType const& collision, K0sType const& candidate) { - auto lDauDCA = candidate.dcaV0daughters(); - auto lDauPosDCAtoPV = candidate.dcapostopv(); - auto lDauNegDCAtoPV = candidate.dcanegtopv(); + auto lDauDCA = std::fabs(candidate.dcaV0daughters()); + auto lDauPosDCAtoPV = std::fabs(candidate.dcapostopv()); + auto lDauNegDCAtoPV = std::fabs(candidate.dcanegtopv()); auto lPt = candidate.pt(); auto lRapidity = candidate.yK0Short(); auto lRadius = candidate.v0radius(); - auto lDCAtoPV = candidate.dcav0topv(); + auto lDCAtoPV = std::fabs(candidate.dcav0topv()); auto lCPA = candidate.v0cosPA(); - auto lPropTauK0s = candidate.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * MassK0Short; + auto lPropTauK0s = candidate.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * MassK0Short; auto lMk0s = candidate.mK0Short(); auto lMLambda = candidate.mLambda(); auto lMALambda = candidate.mAntiLambda(); auto checkCommonCuts = [&]() { - if (lDauDCA > SecondaryCuts.cfgSecondaryDauDCAMax) + if (std::fabs(lDauDCA) > SecondaryCuts.cfgSecondaryDauDCAMax) return false; - if (lDauPosDCAtoPV < SecondaryCuts.cfgSecondaryDauPosDCAtoPVMin) + if (std::fabs(lDauPosDCAtoPV) < SecondaryCuts.cfgSecondaryDauPosDCAtoPVMin) return false; - if (lDauNegDCAtoPV < SecondaryCuts.cfgSecondaryDauNegDCAtoPVMin) + if (std::fabs(lDauNegDCAtoPV) < SecondaryCuts.cfgSecondaryDauNegDCAtoPVMin) return false; if (lPt < SecondaryCuts.cfgSecondaryPtMin) return false; @@ -577,13 +583,13 @@ struct Chk892pp { return false; if (lRadius < SecondaryCuts.cfgSecondaryRadiusMin || lRadius > SecondaryCuts.cfgSecondaryRadiusMax) return false; - if (lDCAtoPV > SecondaryCuts.cfgSecondaryDCAtoPVMax) + if (std::fabs(lDCAtoPV) > SecondaryCuts.cfgSecondaryDCAtoPVMax) return false; if (lCPA < SecondaryCuts.cfgSecondaryCosPAMin) return false; if (lPropTauK0s > SecondaryCuts.cfgSecondaryProperLifetimeMax) return false; - if (candidate.qtarm() < SecondaryCuts.cfgSecondaryparamArmenterosCut * std::abs(candidate.alpha())) + if (candidate.qtarm() < SecondaryCuts.cfgSecondaryparamArmenterosCut * std::fabs(candidate.alpha())) return false; if (std::fabs(lMk0s - MassK0Short) > SecondaryCuts.cfgSecondaryMassWindow) return false; @@ -632,7 +638,7 @@ struct Chk892pp { histos.fill(HIST("QA/K0sCutCheck"), 9); returnFlag = false; } - if (candidate.qtarm() < SecondaryCuts.cfgSecondaryparamArmenterosCut * std::abs(candidate.alpha())) { + if (candidate.qtarm() < SecondaryCuts.cfgSecondaryparamArmenterosCut * std::fabs(candidate.alpha())) { histos.fill(HIST("QA/K0sCutCheck"), 10); returnFlag = false; } @@ -689,11 +695,289 @@ struct Chk892pp { return true; } + std::unordered_set allowedMcIds; + std::unordered_map centByMcIds; + float RapidityMaxKstar= 0.5; + + void buildAllowedMcIds(MCEventCandidates const &events) + { + allowedMcIds.clear(); + centByMcIds.clear(); + + for (const auto& coll : events) + { + lCentrality = getCentrality(coll); + histos.fill(HIST("QACent_woCut"), lCentrality); + histos.fill(HIST("QAvtxz_woCut"), coll.posZ()); + + if (!colCuts.isSelected(coll)) + continue; + if (!coll.isInelGt0()) + continue; + + histos.fill(HIST("QACent_woCentCut"), lCentrality); + histos.fill(HIST("QAvtxz_wVtxzCut"), coll.posZ()); + + if (lCentrality < EventCuts.cfgEventCentralityMin || lCentrality > EventCuts.cfgEventCentralityMax) + continue; + histos.fill(HIST("QACent_wCentCut"), lCentrality); + if (!coll.has_mcCollision()) + continue; + const auto mcid = coll.mcCollisionId(); + if (mcid < 0) + continue; + allowedMcIds.insert(mcid); + centByMcIds[mcid] = lCentrality; + } + } + + + void effK0sProcessGen(MCTrueTrackCandidates const &mcparts) + { + for (const auto& part : mcparts) + { + const auto mcid = part.mcCollisionId(); + + if (!part.has_mcCollision()) + continue; + if (part.pdgCode() != kPDGK0s) + continue; + if (!part.isPhysicalPrimary()) + continue; + if (allowedMcIds.find(mcid) == allowedMcIds.end()) + continue; + + auto iter = centByMcIds.find(mcid); + if (iter == centByMcIds.end()) + continue; + + const float lCentrality = iter->second; + + if (std::abs(part.y()) > SecondaryCuts.cfgSecondaryRapidityMax) + continue; + + histos.fill(HIST("EffK0s/genK0s"), part.pt(), lCentrality); + } + } + + + void effK0sProcessReco(MCV0Candidates const &v0s) + { + for (const auto& v0 : v0s) + { + auto coll = v0.template collision_as(); + + if (!coll.has_mcCollision()) + continue; + + const auto mcid = coll.mcCollisionId(); + + if (allowedMcIds.find(mcid) == allowedMcIds.end()) + continue; + + auto iter = centByMcIds.find(mcid); + if (iter == centByMcIds.end()) + continue; + + const float lCentrality = iter->second; + + const double ptreco = v0.pt(); + const double yreco = v0.yK0Short(); + + double ptgen = -1, ygen = 0; + if (!getTruthK0sAndGenKinematics(v0, ptgen, ygen)) + continue; + if (std::abs(yreco) > SecondaryCuts.cfgSecondaryRapidityMax) + continue; + + if (!SecondaryCuts.cfgByPassDauPIDSelection){ + auto posDauTrack = v0.template posTrack_as(); + auto negDauTrack = v0.template negTrack_as(); + if (!selectionPIDPion(posDauTrack)) + continue; + if (!selectionPIDPion(negDauTrack)) + continue; + } + if (!selectionK0s(coll, v0)) + continue; + + histos.fill(HIST("EffK0s/recoK0s"), ptreco, lCentrality); + } + }//effK0sProcessReco + + + template + bool matchRecoToTruthKstar(V0T const &v0, TrkT const &trk, double &ptgen, double &ygen) + { + if (!v0.has_mcParticle() || !trk.has_mcParticle()) + return false; + + auto mcK0s = v0.template mcParticle_as(); + auto mcPi = trk.template mcParticle_as(); + + if (std::abs(mcK0s.pdgCode()) != kPDGK0s) + return false; + if (std::abs(mcPi.pdgCode()) != kPiPlus) + return false; + + MCTrueTrackCandidates::iterator kstarFromPi; + bool havePiKstar = false; + for (const auto& m1 : mcPi.template mothers_as()){ + if (std::abs(m1.pdgCode()) == kKstarPlus){ + kstarFromPi = m1; + havePiKstar = true; + break; + } + } + if (!havePiKstar){ + return false; + } + + bool shareSameKstar = false; + for (const auto& m1 : mcK0s.template mothers_as()){ + if (std::abs(m1.pdgCode()) == kPDGK0){ + for (const auto& m2 : m1.template mothers_as()){ + if (m2.globalIndex() == kstarFromPi.globalIndex()){ + shareSameKstar = true; + break; + } + } + if (shareSameKstar) + break; + } + } + if (!shareSameKstar){ + return false; + } + + ptgen = kstarFromPi.pt(); + ygen = kstarFromPi.y(); + + return true; + } // matchRecoToTruthKstar + + + void effKstarProcessGen(MCTrueTrackCandidates const &mcparts) + { + for (const auto& part : mcparts) + { + const auto mcid = part.mcCollisionId(); + if (!part.has_mcCollision()) + continue; + if (std::abs(part.pdgCode()) != kKstarPlus) + continue; + if (allowedMcIds.find(mcid) == allowedMcIds.end()) + continue; + + auto iter = centByMcIds.find(mcid); + if (iter == centByMcIds.end()) + continue; + + const float lCentrality = iter->second; + + if (std::abs(part.y()) > KstarCuts.cfgKstarMaxRap) + continue; + + const double px = part.px(), py = part.py(), pz = part.pz(), e = part.e(); + const double mgen2 = e*e - (px*px + py*py + pz*pz); + const double mgen = (mgen2 > 0.0) ? std::sqrt(mgen2) : 0.0; + + histos.fill(HIST("EffKstar/genKstar"), part.pt(), lCentrality); + histos.fill(HIST("EffKstar/genKstar_m"), mgen); + } + }//effKstarProcessGen + + + template + void effKstarProcessReco(V0RangeT const &v0s, TrkRangeT const &tracks) + { + for (const auto& v0 : v0s) + { + auto coll = v0.template collision_as(); + + if (!coll.has_mcCollision()) + continue; + + const auto mcid = coll.mcCollisionId(); + + if (allowedMcIds.find(mcid) == allowedMcIds.end()) + continue; + + auto iter = centByMcIds.find(mcid); + if (iter == centByMcIds.end()) + continue; + + const float lCentrality = iter->second; + + if (!SecondaryCuts.cfgByPassDauPIDSelection) + { + auto posDauTrack = v0.template posTrack_as(); + auto negDauTrack = v0.template negTrack_as(); + if (!selectionPIDPion(posDauTrack)) + continue; + if (!selectionPIDPion(negDauTrack)) + continue; + } + if (!selectionK0s(coll, v0)) + continue; + + auto trks = tracks.sliceBy(perCollision, v0.collisionId()); + for (const auto& bTrack : trks) + { + if (bTrack.collisionId() != v0.collisionId()) + continue; + + if (!trackCut(bTrack)) + continue; + if (!selectionPIDPion(bTrack)) + continue; + + LorentzVectorSetXYZM lResoSecondary, lDecayDaughter_bach, lResoKstar, lDaughterRot, lResonanceRot; + + lResoSecondary = LorentzVectorSetXYZM(v0.px(), v0.py(), v0.pz(), v0.mK0Short()); + lDecayDaughter_bach = LorentzVectorSetXYZM(bTrack.px(), bTrack.py(), bTrack.pz(), MassPionCharged); + lResoKstar = lResoSecondary + lDecayDaughter_bach; + + histos.fill(HIST("EffKstar/recoKstar_m"), lResoKstar.Pt(), lResoKstar.M()); + + if (BkgEstimationConfig.cfgFillRotBkg) + { + for (int i = 0; i < BkgEstimationConfig.cfgNrotBkg; i++) + { + auto lRotAngle = BkgEstimationConfig.cfgMinRot + i * ((BkgEstimationConfig.cfgMaxRot - BkgEstimationConfig.cfgMinRot) / (BkgEstimationConfig.cfgNrotBkg - 1)); + + lDaughterRot = lDecayDaughter_bach; + ROOT::Math::RotationZ rot(lRotAngle); + auto p3 = rot * lDaughterRot.Vect(); + lDaughterRot = LorentzVectorSetXYZM(p3.X(), p3.Y(), p3.Z(), lDaughterRot.M()); + lResonanceRot = lDaughterRot + lResoSecondary; + + histos.fill(HIST("EffKstar/recoKstar_m_rot"), lResonanceRot.Pt(), lResonanceRot.M()); + } + } + + double ptgen = 0, ygen = 0; + if (!matchRecoToTruthKstar(v0, bTrack, ptgen, ygen)) + continue; + + const double ptreco = lResoKstar.Pt(); + const double yreco = lResoKstar.Rapidity(); + + if (std::abs(yreco) > KstarCuts.cfgKstarMaxRap) + continue; + histos.fill(HIST("EffKstar/recoKstar"), ptreco, lCentrality); + histos.fill(HIST("EffKstar/recoKstar_m_matched"), ptreco, lResoKstar.M()); + } + } + }//effKstarProcessReco + int count = 0; template void fillHistograms(const CollisionType& collision, const TracksType& dTracks1, const TracksTypeK0s& dTracks2) { + using TrackTarget = std::decay_t; + histos.fill(HIST("QA/before/CentDist"), lCentrality); LorentzVectorSetXYZM lDecayDaughter1, lDecayDaughter2, lResoSecondary, lDecayDaughter_bach, lResoKstar, lDaughterRot, lResonanceRot; @@ -738,8 +1022,10 @@ struct Chk892pp { } for (const auto& k0sCand : dTracks2) { - auto posDauTrack = k0sCand.template posTrack_as(); - auto negDauTrack = k0sCand.template negTrack_as(); + // auto posDauTrack = k0sCand.template posTrack_as(); + // auto negDauTrack = k0sCand.template negTrack_as(); + auto posDauTrack = k0sCand.template posTrack_as(); + auto negDauTrack = k0sCand.template negTrack_as(); /// Daughters // Positve pion @@ -758,13 +1044,15 @@ struct Chk892pp { auto trkky = k0sCand.yK0Short(); auto trkkDCAtoPV = k0sCand.dcav0topv(); auto trkkCPA = k0sCand.v0cosPA(); - auto trkkPropTau = k0sCand.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * MassK0Short; + auto trkkPropTau = k0sCand.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * MassK0Short; auto trkkMass = k0sCand.mK0Short(); auto trkkDauDCAPostoPV = k0sCand.dcapostopv(); auto trkkDauDCANegtoPV = k0sCand.dcanegtopv(); auto trkkpt = k0sCand.pt(); auto trkkRadius = k0sCand.v0radius(); + lResoSecondary = LorentzVectorSetXYZM(k0sCand.px(), k0sCand.py(), k0sCand.pz(), trkkMass); + if constexpr (!IsMix) { // Seconddary QA plots histos.fill(HIST("QA/before/trkppionTPCPID"), trkppt, trkpNSigmaPiTPC); @@ -874,17 +1162,17 @@ struct Chk892pp { histos.fill(HIST("QA/RotBkg/hRotBkg"), lRotAngle); if (BkgEstimationConfig.cfgRotPion) { lDaughterRot = lDecayDaughter_bach; - // lDaughterRot.RotateZ(lRotAngle); - ROOT::Math::RotationZ rot(lRotAngle); - auto p3 = rot * lDaughterRot.Vect(); - lDaughterRot = LorentzVectorSetXYZM(p3.X(), p3.Y(), p3.Z(), lDaughterRot.M()); + //lDaughterRot.RotateZ(lRotAngle); + ROOT::Math::RotationZ rot(lRotAngle); + auto p3 = rot * lDaughterRot.Vect(); + lDaughterRot = LorentzVectorSetXYZM(p3.X(),p3.Y(),p3.Z(),lDaughterRot.M()); lResonanceRot = lDaughterRot + lResoSecondary; } else { lDaughterRot = lResoSecondary; - // lDaughterRot.RotateZ(lRotAngle); - ROOT::Math::RotationZ rot(lRotAngle); - auto p3 = rot * lDaughterRot.Vect(); - lDaughterRot = LorentzVectorSetXYZM(p3.X(), p3.Y(), p3.Z(), lDaughterRot.M()); + //lDaughterRot.RotateZ(lRotAngle); + ROOT::Math::RotationZ rot(lRotAngle); + auto p3 = rot * lDaughterRot.Vect(); + lDaughterRot = LorentzVectorSetXYZM(p3.X(),p3.Y(),p3.Z(),lDaughterRot.M()); lResonanceRot = lDecayDaughter_bach + lDaughterRot; } typeKstar = bTrack.sign() > 0 ? BinType::kKstarP_Rot : BinType::kKstarN_Rot; @@ -913,24 +1201,40 @@ struct Chk892pp { lCentrality = getCentrality(collision); if (lCentrality < EventCuts.cfgEventCentralityMin || lCentrality > EventCuts.cfgEventCentralityMax) return; + if (!collision.isInelGt0()) + return; colCuts.fillQA(collision); fillHistograms(collision, tracks, v0s); // second order } - PROCESS_SWITCH(Chk892pp, processData, "Process Event for data without Partitioning", true); + PROCESS_SWITCH(Chk892pp, processData, "Process Event for data without Partitioning", false); // process MC reconstructed level - void processMC(EventCandidates::iterator const& collision, + void processMC(MCTrueTrackCandidates const& mcpart, MCTrackCandidates const& tracks, - MCV0Candidates const& v0s) + MCV0Candidates const& v0s, + MCEventCandidates const& events) { - - histos.fill(HIST("QAMC/hEvent"), 1.0); - - fillHistograms(collision, tracks, v0s); + buildAllowedMcIds(events); + effK0sProcessGen(mcpart); + effK0sProcessReco(v0s); + effKstarProcessGen(mcpart); + effKstarProcessReco(v0s, tracks); + + for (auto const& collision : events) { + if (!collision.has_mcCollision()) continue; + const auto mcid = collision.mcCollisionId(); + + auto it = centByMcIds.find(mcid); + if (it == centByMcIds.end()) continue; + + lCentrality = it->second; + fillHistograms(collision, tracks, v0s); + } } - PROCESS_SWITCH(Chk892pp, processMC, "Process Event for MC", false); + PROCESS_SWITCH(Chk892pp, processMC, "Process Event for MC", true); }; + WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; From 3101ce65422c299edb885fc84849022d8ffca006 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Wed, 24 Sep 2025 08:42:05 +0000 Subject: [PATCH 04/11] Please consider the following formatting changes --- PWGLF/Tasks/Resonances/chk892pp.cxx | 414 +++++++++++++--------------- 1 file changed, 198 insertions(+), 216 deletions(-) diff --git a/PWGLF/Tasks/Resonances/chk892pp.cxx b/PWGLF/Tasks/Resonances/chk892pp.cxx index 8e2c0a6e861..47b99596bee 100644 --- a/PWGLF/Tasks/Resonances/chk892pp.cxx +++ b/PWGLF/Tasks/Resonances/chk892pp.cxx @@ -15,67 +15,61 @@ /// /// \author Su-Jeong Ji , Bong-Hwi Lim -#include -#include #include +#include +#include +#include +#include #include #include #include -#include -#include // #include // FIXME -#include // FIXME - -#include -#include -#include -#include -#include -#include +#include "PWGLF/DataModel/LFStrangenessTables.h" +#include "PWGLF/Utils/collisionCuts.h" +#include "PWGLF/Utils/inelGt.h" -#include "TRandom3.h" -#include "TF1.h" -#include "TVector2.h" -#include "Math/Vector3D.h" -#include "Math/Vector4D.h" -#include "Math/RotationZ.h" -#include "Math/GenVector/Boost.h" -#include +#include "Common/Core/RecoDecay.h" +#include "Common/Core/TrackSelection.h" +#include "Common/Core/trackUtilities.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/PIDResponse.h" +#include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" +#include "CCDB/BasicCCDBManager.h" +#include "CCDB/CcdbApi.h" +#include "CommonConstants/MathConstants.h" +#include "CommonConstants/PhysicsConstants.h" +#include "DCAFitter/DCAFitterN.h" +#include "DataFormatsParameters/GRPMagField.h" +#include "DataFormatsParameters/GRPObject.h" +#include "Framework/ASoAHelpers.h" #include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" -#include "Framework/StepTHn.h" #include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/ASoAHelpers.h" #include "Framework/StaticFor.h" -#include "DCAFitter/DCAFitterN.h" - -#include "Common/DataModel/PIDResponse.h" -#include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/Centrality.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "Common/DataModel/EventSelection.h" - -#include "Common/Core/trackUtilities.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/RecoDecay.h" - -#include "CommonConstants/PhysicsConstants.h" -#include "CommonConstants/MathConstants.h" - +#include "Framework/StepTHn.h" +#include "Framework/runDataProcessing.h" #include "ReconstructionDataFormats/Track.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DataFormatsParameters/GRPMagField.h" - -#include "CCDB/CcdbApi.h" -#include "CCDB/BasicCCDBManager.h" +#include "Math/GenVector/Boost.h" +#include "Math/RotationZ.h" +#include "Math/Vector3D.h" +#include "Math/Vector4D.h" +#include "TF1.h" +#include "TRandom3.h" +#include "TVector2.h" +#include +#include // FIXME -#include "PWGLF/DataModel/LFStrangenessTables.h" -#include "PWGLF/Utils/collisionCuts.h" -#include "PWGLF/Utils/inelGt.h" +#include +#include +#include +#include +#include +#include using namespace o2; using namespace o2::framework; @@ -84,21 +78,21 @@ using namespace o2::soa; using namespace o2::constants::physics; using namespace o2::aod::rctsel; -namespace{ - template - inline bool getTruthK0sAndGenKinematics(V0T const &v0, double &ptgen, double &ygen) - { - if (!v0.has_mcParticle()) - return false; - auto mcPart = v0.template mcParticle_as(); - if (mcPart.pdgCode() != kK0Short) - return false; - ptgen = mcPart.pt(); - ygen = mcPart.y(); - return true; - } +namespace +{ +template +inline bool getTruthK0sAndGenKinematics(V0T const& v0, double& ptgen, double& ygen) +{ + if (!v0.has_mcParticle()) + return false; + auto mcPart = v0.template mcParticle_as(); + if (mcPart.pdgCode() != kK0Short) + return false; + ptgen = mcPart.pt(); + ygen = mcPart.y(); + return true; } - +} // namespace struct Chk892pp { enum BinType : unsigned int { @@ -120,7 +114,7 @@ struct Chk892pp { // for MC reco using MCEventCandidates = soa::Join; - using MCTrackCandidates = soa::Join;//, aod::McParticles>; + using MCTrackCandidates = soa::Join; //, aod::McParticles>; using MCV0Candidates = soa::Join; // for MC truth @@ -179,12 +173,12 @@ struct Chk892pp { /// PID Selections, pion struct : ConfigurableGroup { - Configurable cfgTPConly{"cfgTPConly", false, "Use only TPC for PID"}; // bool + Configurable cfgTPConly{"cfgTPConly", false, "Use only TPC for PID"}; // bool Configurable cfgMaxTPCnSigmaPion{"cfgMaxTPCnSigmaPion", 3.0, "TPC nSigma cut for Pion"}; // TPC Configurable cfgMaxTOFnSigmaPion{"cfgMaxTOFnSigmaPion", 3.0, "TOF nSigma cut for Pion"}; // TOF Configurable cfgNsigmaCutCombinedPion{"cfgNsigmaCutCombinedPion", -999, "Combined nSigma cut for Pion"}; // Combined Configurable cfgTOFVeto{"cfgTOFVeto", true, "TOF Veto, if false, TOF is nessessary for PID selection"}; // TOF Veto - Configurable cfgTOFMinPt{"cfgTOFMinPt", 0.6, "Minimum TOF pT cut for Pion"}; // TOF pT cut + Configurable cfgTOFMinPt{"cfgTOFMinPt", 0.6, "Minimum TOF pT cut for Pion"}; // TOF pT cut } PIDCuts; // Track selections @@ -415,16 +409,16 @@ struct Chk892pp { // MC if (doprocessMC) { - histos.add("QACent_woCut","Centrality without cut", HistType::kTH1F, {centAxis}); - histos.add("QACent_woCentCut","Centrality without cent cut", HistType::kTH1F, {centAxis}); - histos.add("QACent_wCentCut","Centrality with cent cut", HistType::kTH1F, {centAxis}); - histos.add("QAvtxz_woCut","z-vertex without cut", HistType::kTH1F, {vtxzAxis}); - histos.add("QAvtxz_wVtxzCut","z-vertex with vtxz cut", HistType::kTH1F, {vtxzAxis}); + histos.add("QACent_woCut", "Centrality without cut", HistType::kTH1F, {centAxis}); + histos.add("QACent_woCentCut", "Centrality without cent cut", HistType::kTH1F, {centAxis}); + histos.add("QACent_wCentCut", "Centrality with cent cut", HistType::kTH1F, {centAxis}); + histos.add("QAvtxz_woCut", "z-vertex without cut", HistType::kTH1F, {vtxzAxis}); + histos.add("QAvtxz_wVtxzCut", "z-vertex with vtxz cut", HistType::kTH1F, {vtxzAxis}); - histos.add("EffK0s/genK0s", "Gen K0s (|y<0.8|)", HistType::kTH2F, {ptAxisQA, centAxis}); - histos.add("EffK0s/recoK0s", "Reco K0s (|y<0.8|)", HistType::kTH2F, {ptAxisQA, centAxis}); + histos.add("EffK0s/genK0s", "Gen K0s (|y<0.8|)", HistType::kTH2F, {ptAxisQA, centAxis}); + histos.add("EffK0s/recoK0s", "Reco K0s (|y<0.8|)", HistType::kTH2F, {ptAxisQA, centAxis}); - histos.add("EffKstar/genKstar", "Gen Kstar (|y|<0.5)", HistType::kTH2F, {ptAxisQA, centAxis}); + histos.add("EffKstar/genKstar", "Gen Kstar (|y|<0.5)", HistType::kTH2F, {ptAxisQA, centAxis}); histos.add("EffKstar/genKstar_m", "Gen Kstar (|y|<0.5) invariant mass distribution", HistType::kTH1F, {invMassAxisReso}); histos.add("EffKstar/recoKstar", "Kstar Reco matched (final all)", HistType::kTH2F, {ptAxisQA, centAxis}); histos.add("EffKstar/recoKstar_m", "Kstar Reco (final all) invariant mass distribution", HistType::kTH2F, {ptAxisQA, invMassAxisReso}); @@ -433,20 +427,20 @@ struct Chk892pp { histos.add("EffKstar/recoKstar_m_matched", "Kstar Reco matched (final all) invariant mass distribution", HistType::kTH2F, {ptAxisQA, invMassAxisReso}); } - 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()); + 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 chK(892) Analysis Task"; histos.print(); } - const int kCentFT0C = 1; - const int kCentFT0M = 2; - const float kInvalidCentrality = -999.f; + const int kCentFT0C = 1; + const int kCentFT0M = 2; + const float kInvalidCentrality = -999.f; template float getCentrality(CollisionType const& collision) @@ -535,22 +529,22 @@ struct Chk892pp { template bool selectionPIDPion(TrackType const& candidate) { - if (std::abs(candidate.tpcNSigmaPi()) >= PIDCuts.cfgMaxTPCnSigmaPion) - return false; - if (PIDCuts.cfgTPConly) - return true; - if (candidate.pt() <= PIDCuts.cfgTOFMinPt) - return true; + if (std::abs(candidate.tpcNSigmaPi()) >= PIDCuts.cfgMaxTPCnSigmaPion) + return false; + if (PIDCuts.cfgTPConly) + return true; + if (candidate.pt() <= PIDCuts.cfgTOFMinPt) + return true; if (candidate.hasTOF()) { - const bool tofPIDPassed = std::abs(candidate.tofNSigmaPi()) < PIDCuts.cfgMaxTOFnSigmaPion; - const bool combo = (PIDCuts.cfgNsigmaCutCombinedPion > 0) && - (candidate.tpcNSigmaPi() * candidate.tpcNSigmaPi() + - candidate.tofNSigmaPi() * candidate.tofNSigmaPi() < + const bool tofPIDPassed = std::abs(candidate.tofNSigmaPi()) < PIDCuts.cfgMaxTOFnSigmaPion; + const bool combo = (PIDCuts.cfgNsigmaCutCombinedPion > 0) && + (candidate.tpcNSigmaPi() * candidate.tpcNSigmaPi() + + candidate.tofNSigmaPi() * candidate.tofNSigmaPi() < PIDCuts.cfgNsigmaCutCombinedPion * PIDCuts.cfgNsigmaCutCombinedPion); - return tofPIDPassed || combo; + return tofPIDPassed || combo; } else { - return PIDCuts.cfgTOFVeto; + return PIDCuts.cfgTOFVeto; } } @@ -565,7 +559,7 @@ struct Chk892pp { auto lRadius = candidate.v0radius(); auto lDCAtoPV = std::fabs(candidate.dcav0topv()); auto lCPA = candidate.v0cosPA(); - auto lPropTauK0s = candidate.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * MassK0Short; + auto lPropTauK0s = candidate.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * MassK0Short; auto lMk0s = candidate.mK0Short(); auto lMLambda = candidate.mLambda(); auto lMALambda = candidate.mAntiLambda(); @@ -695,47 +689,44 @@ struct Chk892pp { return true; } - std::unordered_set allowedMcIds; - std::unordered_map centByMcIds; - float RapidityMaxKstar= 0.5; + std::unordered_set allowedMcIds; + std::unordered_map centByMcIds; + float RapidityMaxKstar = 0.5; - void buildAllowedMcIds(MCEventCandidates const &events) - { - allowedMcIds.clear(); - centByMcIds.clear(); + void buildAllowedMcIds(MCEventCandidates const& events) + { + allowedMcIds.clear(); + centByMcIds.clear(); - for (const auto& coll : events) - { - lCentrality = getCentrality(coll); - histos.fill(HIST("QACent_woCut"), lCentrality); - histos.fill(HIST("QAvtxz_woCut"), coll.posZ()); + for (const auto& coll : events) { + lCentrality = getCentrality(coll); + histos.fill(HIST("QACent_woCut"), lCentrality); + histos.fill(HIST("QAvtxz_woCut"), coll.posZ()); - if (!colCuts.isSelected(coll)) - continue; + if (!colCuts.isSelected(coll)) + continue; if (!coll.isInelGt0()) continue; - histos.fill(HIST("QACent_woCentCut"), lCentrality); - histos.fill(HIST("QAvtxz_wVtxzCut"), coll.posZ()); - - if (lCentrality < EventCuts.cfgEventCentralityMin || lCentrality > EventCuts.cfgEventCentralityMax) - continue; - histos.fill(HIST("QACent_wCentCut"), lCentrality); - if (!coll.has_mcCollision()) - continue; - const auto mcid = coll.mcCollisionId(); - if (mcid < 0) - continue; - allowedMcIds.insert(mcid); - centByMcIds[mcid] = lCentrality; - } - } + histos.fill(HIST("QACent_woCentCut"), lCentrality); + histos.fill(HIST("QAvtxz_wVtxzCut"), coll.posZ()); + if (lCentrality < EventCuts.cfgEventCentralityMin || lCentrality > EventCuts.cfgEventCentralityMax) + continue; + histos.fill(HIST("QACent_wCentCut"), lCentrality); + if (!coll.has_mcCollision()) + continue; + const auto mcid = coll.mcCollisionId(); + if (mcid < 0) + continue; + allowedMcIds.insert(mcid); + centByMcIds[mcid] = lCentrality; + } + } - void effK0sProcessGen(MCTrueTrackCandidates const &mcparts) + void effK0sProcessGen(MCTrueTrackCandidates const& mcparts) { - for (const auto& part : mcparts) - { + for (const auto& part : mcparts) { const auto mcid = part.mcCollisionId(); if (!part.has_mcCollision()) @@ -760,19 +751,17 @@ struct Chk892pp { } } - - void effK0sProcessReco(MCV0Candidates const &v0s) + void effK0sProcessReco(MCV0Candidates const& v0s) { - for (const auto& v0 : v0s) - { + for (const auto& v0 : v0s) { auto coll = v0.template collision_as(); - if (!coll.has_mcCollision()) - continue; + if (!coll.has_mcCollision()) + continue; - const auto mcid = coll.mcCollisionId(); + const auto mcid = coll.mcCollisionId(); - if (allowedMcIds.find(mcid) == allowedMcIds.end()) + if (allowedMcIds.find(mcid) == allowedMcIds.end()) continue; auto iter = centByMcIds.find(mcid); @@ -790,54 +779,53 @@ struct Chk892pp { if (std::abs(yreco) > SecondaryCuts.cfgSecondaryRapidityMax) continue; - if (!SecondaryCuts.cfgByPassDauPIDSelection){ - auto posDauTrack = v0.template posTrack_as(); - auto negDauTrack = v0.template negTrack_as(); - if (!selectionPIDPion(posDauTrack)) - continue; - if (!selectionPIDPion(negDauTrack)) - continue; - } - if (!selectionK0s(coll, v0)) - continue; - - histos.fill(HIST("EffK0s/recoK0s"), ptreco, lCentrality); - } - }//effK0sProcessReco + if (!SecondaryCuts.cfgByPassDauPIDSelection) { + auto posDauTrack = v0.template posTrack_as(); + auto negDauTrack = v0.template negTrack_as(); + if (!selectionPIDPion(posDauTrack)) + continue; + if (!selectionPIDPion(negDauTrack)) + continue; + } + if (!selectionK0s(coll, v0)) + continue; + histos.fill(HIST("EffK0s/recoK0s"), ptreco, lCentrality); + } + } // effK0sProcessReco - template - bool matchRecoToTruthKstar(V0T const &v0, TrkT const &trk, double &ptgen, double &ygen) + template + bool matchRecoToTruthKstar(V0T const& v0, TrkT const& trk, double& ptgen, double& ygen) { - if (!v0.has_mcParticle() || !trk.has_mcParticle()) - return false; - + if (!v0.has_mcParticle() || !trk.has_mcParticle()) + return false; + auto mcK0s = v0.template mcParticle_as(); auto mcPi = trk.template mcParticle_as(); - if (std::abs(mcK0s.pdgCode()) != kPDGK0s) - return false; - if (std::abs(mcPi.pdgCode()) != kPiPlus) - return false; + if (std::abs(mcK0s.pdgCode()) != kPDGK0s) + return false; + if (std::abs(mcPi.pdgCode()) != kPiPlus) + return false; MCTrueTrackCandidates::iterator kstarFromPi; bool havePiKstar = false; - for (const auto& m1 : mcPi.template mothers_as()){ - if (std::abs(m1.pdgCode()) == kKstarPlus){ + for (const auto& m1 : mcPi.template mothers_as()) { + if (std::abs(m1.pdgCode()) == kKstarPlus) { kstarFromPi = m1; havePiKstar = true; break; } } - if (!havePiKstar){ + if (!havePiKstar) { return false; } bool shareSameKstar = false; - for (const auto& m1 : mcK0s.template mothers_as()){ - if (std::abs(m1.pdgCode()) == kPDGK0){ - for (const auto& m2 : m1.template mothers_as()){ - if (m2.globalIndex() == kstarFromPi.globalIndex()){ + for (const auto& m1 : mcK0s.template mothers_as()) { + if (std::abs(m1.pdgCode()) == kPDGK0) { + for (const auto& m2 : m1.template mothers_as()) { + if (m2.globalIndex() == kstarFromPi.globalIndex()) { shareSameKstar = true; break; } @@ -846,7 +834,7 @@ struct Chk892pp { break; } } - if (!shareSameKstar){ + if (!shareSameKstar) { return false; } @@ -856,11 +844,9 @@ struct Chk892pp { return true; } // matchRecoToTruthKstar - - void effKstarProcessGen(MCTrueTrackCandidates const &mcparts) + void effKstarProcessGen(MCTrueTrackCandidates const& mcparts) { - for (const auto& part : mcparts) - { + for (const auto& part : mcparts) { const auto mcid = part.mcCollisionId(); if (!part.has_mcCollision()) continue; @@ -879,20 +865,18 @@ struct Chk892pp { continue; const double px = part.px(), py = part.py(), pz = part.pz(), e = part.e(); - const double mgen2 = e*e - (px*px + py*py + pz*pz); + const double mgen2 = e * e - (px * px + py * py + pz * pz); const double mgen = (mgen2 > 0.0) ? std::sqrt(mgen2) : 0.0; histos.fill(HIST("EffKstar/genKstar"), part.pt(), lCentrality); histos.fill(HIST("EffKstar/genKstar_m"), mgen); } - }//effKstarProcessGen - + } // effKstarProcessGen template - void effKstarProcessReco(V0RangeT const &v0s, TrkRangeT const &tracks) + void effKstarProcessReco(V0RangeT const& v0s, TrkRangeT const& tracks) { - for (const auto& v0 : v0s) - { + for (const auto& v0 : v0s) { auto coll = v0.template collision_as(); if (!coll.has_mcCollision()) @@ -909,8 +893,7 @@ struct Chk892pp { const float lCentrality = iter->second; - if (!SecondaryCuts.cfgByPassDauPIDSelection) - { + if (!SecondaryCuts.cfgByPassDauPIDSelection) { auto posDauTrack = v0.template posTrack_as(); auto negDauTrack = v0.template negTrack_as(); if (!selectionPIDPion(posDauTrack)) @@ -922,8 +905,7 @@ struct Chk892pp { continue; auto trks = tracks.sliceBy(perCollision, v0.collisionId()); - for (const auto& bTrack : trks) - { + for (const auto& bTrack : trks) { if (bTrack.collisionId() != v0.collisionId()) continue; @@ -940,10 +922,8 @@ struct Chk892pp { histos.fill(HIST("EffKstar/recoKstar_m"), lResoKstar.Pt(), lResoKstar.M()); - if (BkgEstimationConfig.cfgFillRotBkg) - { - for (int i = 0; i < BkgEstimationConfig.cfgNrotBkg; i++) - { + if (BkgEstimationConfig.cfgFillRotBkg) { + for (int i = 0; i < BkgEstimationConfig.cfgNrotBkg; i++) { auto lRotAngle = BkgEstimationConfig.cfgMinRot + i * ((BkgEstimationConfig.cfgMaxRot - BkgEstimationConfig.cfgMinRot) / (BkgEstimationConfig.cfgNrotBkg - 1)); lDaughterRot = lDecayDaughter_bach; @@ -969,14 +949,14 @@ struct Chk892pp { histos.fill(HIST("EffKstar/recoKstar_m_matched"), ptreco, lResoKstar.M()); } } - }//effKstarProcessReco + } // effKstarProcessReco int count = 0; template void fillHistograms(const CollisionType& collision, const TracksType& dTracks1, const TracksTypeK0s& dTracks2) { - using TrackTarget = std::decay_t; + using TrackTarget = std::decay_t; histos.fill(HIST("QA/before/CentDist"), lCentrality); @@ -1022,10 +1002,10 @@ struct Chk892pp { } for (const auto& k0sCand : dTracks2) { - // auto posDauTrack = k0sCand.template posTrack_as(); - // auto negDauTrack = k0sCand.template negTrack_as(); - auto posDauTrack = k0sCand.template posTrack_as(); - auto negDauTrack = k0sCand.template negTrack_as(); + // auto posDauTrack = k0sCand.template posTrack_as(); + // auto negDauTrack = k0sCand.template negTrack_as(); + auto posDauTrack = k0sCand.template posTrack_as(); + auto negDauTrack = k0sCand.template negTrack_as(); /// Daughters // Positve pion @@ -1044,7 +1024,7 @@ struct Chk892pp { auto trkky = k0sCand.yK0Short(); auto trkkDCAtoPV = k0sCand.dcav0topv(); auto trkkCPA = k0sCand.v0cosPA(); - auto trkkPropTau = k0sCand.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * MassK0Short; + auto trkkPropTau = k0sCand.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * MassK0Short; auto trkkMass = k0sCand.mK0Short(); auto trkkDauDCAPostoPV = k0sCand.dcapostopv(); auto trkkDauDCANegtoPV = k0sCand.dcanegtopv(); @@ -1162,17 +1142,17 @@ struct Chk892pp { histos.fill(HIST("QA/RotBkg/hRotBkg"), lRotAngle); if (BkgEstimationConfig.cfgRotPion) { lDaughterRot = lDecayDaughter_bach; - //lDaughterRot.RotateZ(lRotAngle); - ROOT::Math::RotationZ rot(lRotAngle); - auto p3 = rot * lDaughterRot.Vect(); - lDaughterRot = LorentzVectorSetXYZM(p3.X(),p3.Y(),p3.Z(),lDaughterRot.M()); + // lDaughterRot.RotateZ(lRotAngle); + ROOT::Math::RotationZ rot(lRotAngle); + auto p3 = rot * lDaughterRot.Vect(); + lDaughterRot = LorentzVectorSetXYZM(p3.X(), p3.Y(), p3.Z(), lDaughterRot.M()); lResonanceRot = lDaughterRot + lResoSecondary; } else { lDaughterRot = lResoSecondary; - //lDaughterRot.RotateZ(lRotAngle); - ROOT::Math::RotationZ rot(lRotAngle); - auto p3 = rot * lDaughterRot.Vect(); - lDaughterRot = LorentzVectorSetXYZM(p3.X(),p3.Y(),p3.Z(),lDaughterRot.M()); + // lDaughterRot.RotateZ(lRotAngle); + ROOT::Math::RotationZ rot(lRotAngle); + auto p3 = rot * lDaughterRot.Vect(); + lDaughterRot = LorentzVectorSetXYZM(p3.X(), p3.Y(), p3.Z(), lDaughterRot.M()); lResonanceRot = lDecayDaughter_bach + lDaughterRot; } typeKstar = bTrack.sign() > 0 ? BinType::kKstarP_Rot : BinType::kKstarN_Rot; @@ -1201,8 +1181,8 @@ struct Chk892pp { lCentrality = getCentrality(collision); if (lCentrality < EventCuts.cfgEventCentralityMin || lCentrality > EventCuts.cfgEventCentralityMax) return; - if (!collision.isInelGt0()) - return; + if (!collision.isInelGt0()) + return; colCuts.fillQA(collision); fillHistograms(collision, tracks, v0s); // second order @@ -1213,24 +1193,26 @@ struct Chk892pp { void processMC(MCTrueTrackCandidates const& mcpart, MCTrackCandidates const& tracks, MCV0Candidates const& v0s, - MCEventCandidates const& events) + MCEventCandidates const& events) { - buildAllowedMcIds(events); - effK0sProcessGen(mcpart); - effK0sProcessReco(v0s); - effKstarProcessGen(mcpart); - effKstarProcessReco(v0s, tracks); - - for (auto const& collision : events) { - if (!collision.has_mcCollision()) continue; - const auto mcid = collision.mcCollisionId(); - - auto it = centByMcIds.find(mcid); - if (it == centByMcIds.end()) continue; - - lCentrality = it->second; - fillHistograms(collision, tracks, v0s); - } + buildAllowedMcIds(events); + effK0sProcessGen(mcpart); + effK0sProcessReco(v0s); + effKstarProcessGen(mcpart); + effKstarProcessReco(v0s, tracks); + + for (auto const& collision : events) { + if (!collision.has_mcCollision()) + continue; + const auto mcid = collision.mcCollisionId(); + + auto it = centByMcIds.find(mcid); + if (it == centByMcIds.end()) + continue; + + lCentrality = it->second; + fillHistograms(collision, tracks, v0s); + } } PROCESS_SWITCH(Chk892pp, processMC, "Process Event for MC", true); }; From cdf164526dd588f59d911e5ea9ce28dc4afaaed9 Mon Sep 17 00:00:00 2001 From: SuJeong Ji <120470463+SuJeong-Ji@users.noreply.github.com> Date: Wed, 24 Sep 2025 17:49:08 +0900 Subject: [PATCH 05/11] Fixed Megalinter issue --- PWGLF/Tasks/Resonances/.chk892pp.cxx.swp | Bin 0 -> 16384 bytes PWGLF/Tasks/Resonances/chk892pp.cxx | 52 +++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 PWGLF/Tasks/Resonances/.chk892pp.cxx.swp diff --git a/PWGLF/Tasks/Resonances/.chk892pp.cxx.swp b/PWGLF/Tasks/Resonances/.chk892pp.cxx.swp new file mode 100644 index 0000000000000000000000000000000000000000..d38dacc09c5581ca8ce33e3462cca3ea879dae6c GIT binary patch literal 16384 zcmeI3UyK_^9mf|6w1uW5t%N8%Fu4NqwP&y61Ccb&!QI|Jr{|nGJ4uToqV?|Bp4@uZ z+MV^?k+hJCKQH`IA9#QlA|WLHJhW9yc>xLfz@JB;1R>F+AR$2f3xz`4w7_>}$M$-C zzDxR6w5xo4_WXYH+u!_VX7@LY9wG}Wc&?_gGRu=V|8LS8T8Vx+x zbS)a_R%`v>p+cvVvo<$}jikTQ2&55sl@ZvZO&1R2Mddpu_LJLhJN_!|q}9?0q!CCX zkVYVlKpKHG0%-)&2&55sEk=NM_Gur7V{-TmkDfy!b`3p+Ul>FBT z`M;ICw_;jQ0aI$)zm&YL>VG*Qe_qLZyBRMhsxNF$I& z;58Zn)7G>%!}piOLKDybd+Yxnyj9cM;4nA{{(7sXeI0xaoCG(6XZL8@W$;o^L5tqRw@NMugXn_v`0-nEF(|!gX178522R1ka_JU__(zHjxBj7XOG$?|@ zU=R51jhglw@C0}qd>WhtCqNP00p1RN|0ehgE`YCqbD##MzzyKy8#V1);5;}6%HS@r z7yJ%u?(cvvf(AGQ-Uj}Hwf;}Q1rUN7ct5xWT*f}aCGcHv0elLa0rvv~WWhVYRrIgu z;}?4y3U~y}T+0bG}oFTx=t2L_mvmo;(}~i>1H%QvoE{l?-~3q7^md{(kDHu%?nkz%wnW{?sE#*L0xmRSzO7Nqa|7;& zmZ(2(a&yu1+a?e6nr~X`!}b<^vrRWVe_i)Osf*WI@LEd1+~zpNDyN;=vO8W3zb%|{ zoWg2B_*6Foiq5DwVUvxuwafzUHR0kKZQ`rHHO}U&YdUz%CJ?XJ?4~2mUd9-3#wu35 z*=6ccg#9~=7Mc_D8^rf}RYW)mG$u%mM&E_Jbj-609W)~TUL4CgW?bxt};kDbI zYlyxzUG%1Uv8Z3Lv$hzD<5Z3LIo+`A`fP_Kj0nk`iT9Tbd@Gx-*`%^xW5X?SOYcWD z8f8`LAR-ulHM8!}L>xz|R7&%BC8~p_VP?kX*@$L2bU5qa)hfmlgJDEOkXS^cH^sz>0-d?kSxSto zxZLs_hXshU5%NToBeg-ltSna10=G$B%s+)DeiQ0nH_iS9@w~!`_C@7y6e6@^&>ZY zH5&MKE%&i)Z`6Z$7DLzbZR%6|bldF2Qkj?_pnN8lG8AiKf(++9qD0>&(HIOHsj*X< za@~o~m|QEFRn=n2SFGL050JIQ8*H_F&-I2%0&Y939xpO|-`t89SZy>tUeJ{p;BdfV zc_hKn&n5AtAE9DR^tVcM#$}vH9cG0GL($)+Ly9uxin~=?E-WT$Egu*yL2@}%Ymqr3 z{fz~#HqU(7MCpX4qYbCbkheUaRKx61>bXsFl#yZ(X3vNpxijoT7WLhn)tZ?ib12C! zZ!ogL+N9X~mBX*Tk}%nWoT~ebHpuV=op=o*uYpY*c=H>n3^5kg zjuG3V0dYM}HcZx~P@tsavo0FYgaGX#tlbV>nNz@;Fu0=Xcc)2asj@;&AkD-ro=i_p z5zFf^cn){!aG*_?D^1FPOc<+``%A}`CS)UP!j-^l@D0UXIvPhX{! zv^ehs_vq2P@L8{r+o1KF8ag^!vL#KD20G5B+(g3Db7UZFc@A6+q)nq=rI0^xC|k%E z@==gQ7)PoITeB-AV}Yy|a++BGU%~qK39OOD`u}dVkMT6t{0{gim;rgP59|d$#M=KU zV1YWA0XKn*Snq!mYyu9BgAagrf~#29{{lP>z5&hy4-~;+a67nyb^Imp4EP>+2%H0( zU>f9s4xWRrSHP1%`29FYk2C^l1kwnk5lADDMj(wq8iD`c2t1$>B-K3hU2+n8^bN<` zsCKAz*0jwIkM9)}4fWqhXEIi!X-z(GSUao5t02E_U@uWDNC!Lo8SIcXSQDR|ZgM2h z*jj!skp?skCJ3pltr`o}>gnpqQq5S-^v*JcC5(JbP&TH>gfd9vwvCDju0%#_}o_6D%nAfx^`xAQj;14OI^7P99BWJ>`dEY zHqNdTWqcxaA%F{ge{*fi==olP?cV8$2(}W^g)Ix962u5oM%f@}%gLo^^5$ zp<-h@m?UQ-$7rK*FIKF+>ISi}&LC>N5Gr31T3F#Nf^b&FE(*2$EE{s582u%EZ{VqF+toOcA5|A^+)h_+c#f*80fib}51rQ^ zz?rg9!x$V>D~gdg57yxvi21kejKSW9Nj4ZZT|!Q< zAI`BK;JMgQz(kUhLv}?plM*vXig%qt!vAQtV4DOB>S*j>Sjh(m!sLf%2lG#LeDCTL z4QDZzVnde&CHZh7-y5`}+VKfnjIIyzbhyMsW1#=krHp-ybLWO;_{`1~%*|*5$Io$u MG$|ikB!=4aKXQP9n*aa+ literal 0 HcmV?d00001 diff --git a/PWGLF/Tasks/Resonances/chk892pp.cxx b/PWGLF/Tasks/Resonances/chk892pp.cxx index 47b99596bee..ce75c75d7f1 100644 --- a/PWGLF/Tasks/Resonances/chk892pp.cxx +++ b/PWGLF/Tasks/Resonances/chk892pp.cxx @@ -24,6 +24,58 @@ #include #include // #include // FIXME +#include // FIXME + +#include +#include +#include +#include +#include +#include + +#include "TRandom3.h" +#include "TF1.h" +#include "TVector2.h" +#include "Math/Vector3D.h" +#include "Math/Vector4D.h" +#include "Math/RotationZ.h" +#include "Math/GenVector/Boost.h" +#include + +#include +#include + +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/StepTHn.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/StaticFor.h" +#include "DCAFitter/DCAFitterN.h" + +#include "Common/DataModel/PIDResponse.h" +#include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/TrackSelectionTables.h" +#include "Common/DataModel/EventSelection.h" + +#include "Common/Core/trackUtilities.h" +#include "Common/Core/TrackSelection.h" +#include "Common/Core/RecoDecay.h" + +#include "CommonConstants/PhysicsConstants.h" +#include "CommonConstants/MathConstants.h" + +#include "ReconstructionDataFormats/Track.h" + +#include "DataFormatsParameters/GRPObject.h" +#include "DataFormatsParameters/GRPMagField.h" + +#include "CCDB/CcdbApi.h" +#include "CCDB/BasicCCDBManager.h" + #include "PWGLF/DataModel/LFStrangenessTables.h" #include "PWGLF/Utils/collisionCuts.h" #include "PWGLF/Utils/inelGt.h" From 199a23335dbe2c5bee3bd6698199b47020bc986a Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Wed, 24 Sep 2025 08:53:57 +0000 Subject: [PATCH 06/11] Please consider the following formatting changes --- PWGLF/Tasks/Resonances/chk892pp.cxx | 55 ++--------------------------- 1 file changed, 3 insertions(+), 52 deletions(-) diff --git a/PWGLF/Tasks/Resonances/chk892pp.cxx b/PWGLF/Tasks/Resonances/chk892pp.cxx index ce75c75d7f1..52c4cbfa630 100644 --- a/PWGLF/Tasks/Resonances/chk892pp.cxx +++ b/PWGLF/Tasks/Resonances/chk892pp.cxx @@ -24,58 +24,6 @@ #include #include // #include // FIXME -#include // FIXME - -#include -#include -#include -#include -#include -#include - -#include "TRandom3.h" -#include "TF1.h" -#include "TVector2.h" -#include "Math/Vector3D.h" -#include "Math/Vector4D.h" -#include "Math/RotationZ.h" -#include "Math/GenVector/Boost.h" -#include - -#include -#include - -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/StepTHn.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/StaticFor.h" -#include "DCAFitter/DCAFitterN.h" - -#include "Common/DataModel/PIDResponse.h" -#include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/Centrality.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "Common/DataModel/EventSelection.h" - -#include "Common/Core/trackUtilities.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/RecoDecay.h" - -#include "CommonConstants/PhysicsConstants.h" -#include "CommonConstants/MathConstants.h" - -#include "ReconstructionDataFormats/Track.h" - -#include "DataFormatsParameters/GRPObject.h" -#include "DataFormatsParameters/GRPMagField.h" - -#include "CCDB/CcdbApi.h" -#include "CCDB/BasicCCDBManager.h" - #include "PWGLF/DataModel/LFStrangenessTables.h" #include "PWGLF/Utils/collisionCuts.h" #include "PWGLF/Utils/inelGt.h" @@ -115,12 +63,15 @@ #include "TVector2.h" #include #include // FIXME +#include // FIXME #include #include #include #include #include +#include +#include #include using namespace o2; From 522f11543a9ba5fb8abefd8c3ef1a70989fe9c1e Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Wed, 24 Sep 2025 08:54:57 +0000 Subject: [PATCH 07/11] Please consider the following formatting changes --- PWGLF/Tasks/Resonances/chk892pp.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/PWGLF/Tasks/Resonances/chk892pp.cxx b/PWGLF/Tasks/Resonances/chk892pp.cxx index 52c4cbfa630..1a868b9e6f7 100644 --- a/PWGLF/Tasks/Resonances/chk892pp.cxx +++ b/PWGLF/Tasks/Resonances/chk892pp.cxx @@ -63,7 +63,6 @@ #include "TVector2.h" #include #include // FIXME -#include // FIXME #include #include From dee1ae0b83bbb57f1588522d9fa429c70460265e Mon Sep 17 00:00:00 2001 From: SuJeong Ji <120470463+SuJeong-Ji@users.noreply.github.com> Date: Sat, 27 Sep 2025 15:46:39 +0900 Subject: [PATCH 08/11] Remove editor swap file and ignore swap files --- PWGLF/Tasks/Resonances/.chk892pp.cxx.swp | Bin 16384 -> 0 bytes PWGLF/Tasks/Resonances/.gitignore | 4 ++++ 2 files changed, 4 insertions(+) delete mode 100644 PWGLF/Tasks/Resonances/.chk892pp.cxx.swp create mode 100644 PWGLF/Tasks/Resonances/.gitignore diff --git a/PWGLF/Tasks/Resonances/.chk892pp.cxx.swp b/PWGLF/Tasks/Resonances/.chk892pp.cxx.swp deleted file mode 100644 index d38dacc09c5581ca8ce33e3462cca3ea879dae6c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 16384 zcmeI3UyK_^9mf|6w1uW5t%N8%Fu4NqwP&y61Ccb&!QI|Jr{|nGJ4uToqV?|Bp4@uZ z+MV^?k+hJCKQH`IA9#QlA|WLHJhW9yc>xLfz@JB;1R>F+AR$2f3xz`4w7_>}$M$-C zzDxR6w5xo4_WXYH+u!_VX7@LY9wG}Wc&?_gGRu=V|8LS8T8Vx+x zbS)a_R%`v>p+cvVvo<$}jikTQ2&55sl@ZvZO&1R2Mddpu_LJLhJN_!|q}9?0q!CCX zkVYVlKpKHG0%-)&2&55sEk=NM_Gur7V{-TmkDfy!b`3p+Ul>FBT z`M;ICw_;jQ0aI$)zm&YL>VG*Qe_qLZyBRMhsxNF$I& z;58Zn)7G>%!}piOLKDybd+Yxnyj9cM;4nA{{(7sXeI0xaoCG(6XZL8@W$;o^L5tqRw@NMugXn_v`0-nEF(|!gX178522R1ka_JU__(zHjxBj7XOG$?|@ zU=R51jhglw@C0}qd>WhtCqNP00p1RN|0ehgE`YCqbD##MzzyKy8#V1);5;}6%HS@r z7yJ%u?(cvvf(AGQ-Uj}Hwf;}Q1rUN7ct5xWT*f}aCGcHv0elLa0rvv~WWhVYRrIgu z;}?4y3U~y}T+0bG}oFTx=t2L_mvmo;(}~i>1H%QvoE{l?-~3q7^md{(kDHu%?nkz%wnW{?sE#*L0xmRSzO7Nqa|7;& zmZ(2(a&yu1+a?e6nr~X`!}b<^vrRWVe_i)Osf*WI@LEd1+~zpNDyN;=vO8W3zb%|{ zoWg2B_*6Foiq5DwVUvxuwafzUHR0kKZQ`rHHO}U&YdUz%CJ?XJ?4~2mUd9-3#wu35 z*=6ccg#9~=7Mc_D8^rf}RYW)mG$u%mM&E_Jbj-609W)~TUL4CgW?bxt};kDbI zYlyxzUG%1Uv8Z3Lv$hzD<5Z3LIo+`A`fP_Kj0nk`iT9Tbd@Gx-*`%^xW5X?SOYcWD z8f8`LAR-ulHM8!}L>xz|R7&%BC8~p_VP?kX*@$L2bU5qa)hfmlgJDEOkXS^cH^sz>0-d?kSxSto zxZLs_hXshU5%NToBeg-ltSna10=G$B%s+)DeiQ0nH_iS9@w~!`_C@7y6e6@^&>ZY zH5&MKE%&i)Z`6Z$7DLzbZR%6|bldF2Qkj?_pnN8lG8AiKf(++9qD0>&(HIOHsj*X< za@~o~m|QEFRn=n2SFGL050JIQ8*H_F&-I2%0&Y939xpO|-`t89SZy>tUeJ{p;BdfV zc_hKn&n5AtAE9DR^tVcM#$}vH9cG0GL($)+Ly9uxin~=?E-WT$Egu*yL2@}%Ymqr3 z{fz~#HqU(7MCpX4qYbCbkheUaRKx61>bXsFl#yZ(X3vNpxijoT7WLhn)tZ?ib12C! zZ!ogL+N9X~mBX*Tk}%nWoT~ebHpuV=op=o*uYpY*c=H>n3^5kg zjuG3V0dYM}HcZx~P@tsavo0FYgaGX#tlbV>nNz@;Fu0=Xcc)2asj@;&AkD-ro=i_p z5zFf^cn){!aG*_?D^1FPOc<+``%A}`CS)UP!j-^l@D0UXIvPhX{! zv^ehs_vq2P@L8{r+o1KF8ag^!vL#KD20G5B+(g3Db7UZFc@A6+q)nq=rI0^xC|k%E z@==gQ7)PoITeB-AV}Yy|a++BGU%~qK39OOD`u}dVkMT6t{0{gim;rgP59|d$#M=KU zV1YWA0XKn*Snq!mYyu9BgAagrf~#29{{lP>z5&hy4-~;+a67nyb^Imp4EP>+2%H0( zU>f9s4xWRrSHP1%`29FYk2C^l1kwnk5lADDMj(wq8iD`c2t1$>B-K3hU2+n8^bN<` zsCKAz*0jwIkM9)}4fWqhXEIi!X-z(GSUao5t02E_U@uWDNC!Lo8SIcXSQDR|ZgM2h z*jj!skp?skCJ3pltr`o}>gnpqQq5S-^v*JcC5(JbP&TH>gfd9vwvCDju0%#_}o_6D%nAfx^`xAQj;14OI^7P99BWJ>`dEY zHqNdTWqcxaA%F{ge{*fi==olP?cV8$2(}W^g)Ix962u5oM%f@}%gLo^^5$ zp<-h@m?UQ-$7rK*FIKF+>ISi}&LC>N5Gr31T3F#Nf^b&FE(*2$EE{s582u%EZ{VqF+toOcA5|A^+)h_+c#f*80fib}51rQ^ zz?rg9!x$V>D~gdg57yxvi21kejKSW9Nj4ZZT|!Q< zAI`BK;JMgQz(kUhLv}?plM*vXig%qt!vAQtV4DOB>S*j>Sjh(m!sLf%2lG#LeDCTL z4QDZzVnde&CHZh7-y5`}+VKfnjIIyzbhyMsW1#=krHp-ybLWO;_{`1~%*|*5$Io$u MG$|ikB!=4aKXQP9n*aa+ diff --git a/PWGLF/Tasks/Resonances/.gitignore b/PWGLF/Tasks/Resonances/.gitignore new file mode 100644 index 00000000000..1cc89a27563 --- /dev/null +++ b/PWGLF/Tasks/Resonances/.gitignore @@ -0,0 +1,4 @@ +*.swp +*.swo +*~ +*.swx From be4ffd1b3ad0bb8f526807e05966a26bdca6c846 Mon Sep 17 00:00:00 2001 From: SuJeong Ji <120470463+SuJeong-Ji@users.noreply.github.com> Date: Sat, 27 Sep 2025 17:23:43 +0900 Subject: [PATCH 09/11] fixed o2 linter issue --- PWGLF/Tasks/Resonances/chk892pp.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/PWGLF/Tasks/Resonances/chk892pp.cxx b/PWGLF/Tasks/Resonances/chk892pp.cxx index 1a868b9e6f7..ca235de8ff9 100644 --- a/PWGLF/Tasks/Resonances/chk892pp.cxx +++ b/PWGLF/Tasks/Resonances/chk892pp.cxx @@ -693,7 +693,6 @@ struct Chk892pp { std::unordered_set allowedMcIds; std::unordered_map centByMcIds; - float RapidityMaxKstar = 0.5; void buildAllowedMcIds(MCEventCandidates const& events) { From 9cbcd64bcc4576eb6f2537526c0c79c468af4d8a Mon Sep 17 00:00:00 2001 From: SuJeong Ji <120470463+SuJeong-Ji@users.noreply.github.com> Date: Sat, 27 Sep 2025 17:29:23 +0900 Subject: [PATCH 10/11] Remove .gitignore file --- .gitignore | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 .gitignore diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 73ebcda4683..00000000000 --- a/.gitignore +++ /dev/null @@ -1,31 +0,0 @@ -CMakeCache.txt -CMakeFiles/ -.vscode -build -compile_commands.json -.DS_Store -megalinter-reports/ -.mypy_cache/ -github_conf/ -.cache - -#VScode -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json -!.vscode/*.code-snippets - -# Local History for Visual Studio Code -.history/ - -# Built Visual Studio Code Extensions -*.vsix - -#Xcode -## User settings -xcuserdata/ - -#QtCreator -CMakeLists.txt.user From ef574d2d80a3623a2381476d02077c3a21f28cf8 Mon Sep 17 00:00:00 2001 From: SuJeong Ji <120470463+SuJeong-Ji@users.noreply.github.com> Date: Mon, 29 Sep 2025 15:09:29 +0900 Subject: [PATCH 11/11] Removed .gitignore in PWGLF/Tasks/Resonanes and restored .gitignore in O2Physics --- .gitignore | 31 +++++++++++++++++++++++++++++++ PWGLF/Tasks/Resonances/.gitignore | 4 ---- 2 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 .gitignore delete mode 100644 PWGLF/Tasks/Resonances/.gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000000..73ebcda4683 --- /dev/null +++ b/.gitignore @@ -0,0 +1,31 @@ +CMakeCache.txt +CMakeFiles/ +.vscode +build +compile_commands.json +.DS_Store +megalinter-reports/ +.mypy_cache/ +github_conf/ +.cache + +#VScode +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +!.vscode/*.code-snippets + +# Local History for Visual Studio Code +.history/ + +# Built Visual Studio Code Extensions +*.vsix + +#Xcode +## User settings +xcuserdata/ + +#QtCreator +CMakeLists.txt.user diff --git a/PWGLF/Tasks/Resonances/.gitignore b/PWGLF/Tasks/Resonances/.gitignore deleted file mode 100644 index 1cc89a27563..00000000000 --- a/PWGLF/Tasks/Resonances/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -*.swp -*.swo -*~ -*.swx