From 04de4777ff19f663ddda437dba0e6f38eae2c528 Mon Sep 17 00:00:00 2001 From: Bong-Hwi Lim Date: Mon, 27 Jan 2025 14:39:06 +0100 Subject: [PATCH 1/6] Makes PID function clear --- .../{chk892flow.cxx => Chk892Flow.cxx} | 76 +++++++------------ 1 file changed, 28 insertions(+), 48 deletions(-) rename PWGLF/Tasks/Resonances/{chk892flow.cxx => Chk892Flow.cxx} (96%) diff --git a/PWGLF/Tasks/Resonances/chk892flow.cxx b/PWGLF/Tasks/Resonances/Chk892Flow.cxx similarity index 96% rename from PWGLF/Tasks/Resonances/chk892flow.cxx rename to PWGLF/Tasks/Resonances/Chk892Flow.cxx index 1d253665ca0..fcdcc109506 100644 --- a/PWGLF/Tasks/Resonances/chk892flow.cxx +++ b/PWGLF/Tasks/Resonances/Chk892Flow.cxx @@ -8,12 +8,11 @@ // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. - -/// \file chk892flow.cxx -/// \brief Reconstruction of track-track decay resonance candidates /// +/// \file Chk892Flow.cxx +/// \brief Reconstruction of track-track decay resonance candidates +/// \author Su-Jeong Ji , Bong-Hwi Lim /// -/// \author Su-Jeong Ji #include #include @@ -80,8 +79,8 @@ using namespace o2::framework::expressions; using namespace o2::soa; using namespace o2::constants::physics; -struct chk892flow { - enum binType : unsigned int { +struct Chk892Flow { + enum BinType : unsigned int { kKstarP = 0, kKstarN, kKstarP_Mix, @@ -229,10 +228,10 @@ struct chk892flow { float lCentrality; // PDG code - int kPDGK0s = 310; - int kPDGK0 = 311; + int kPDGK0s = kK0Short; + int kPDGK0 = kK0; int kKstarPlus = o2::constants::physics::Pdg::kKPlusStar892; - int kPiPlus = 211; + int kPiPlus = kPiPlus; void init(o2::framework::InitContext&) { @@ -270,7 +269,7 @@ struct chk892flow { AxisSpec mcTypeAxis = {4, 0, 4, "Histogram types"}; // THnSparse - AxisSpec axisType = {binType::kTYEnd, 0, binType::kTYEnd, "Type of bin with charge and mix"}; + 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"}}); @@ -422,7 +421,7 @@ struct chk892flow { 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) + // 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}); @@ -542,43 +541,24 @@ struct chk892flow { template bool selectionPIDPion(TrackType const& candidate) { - bool tpcPIDPassed{false}, tofPIDPassed{false}; + bool tpcPIDPassed = std::abs(candidate.tpcNSigmaPi()) < cMaxTPCnSigmaPion; + bool tofPIDPassed = false; if (cTPConly) { + return tpcPIDPassed; + } - if (std::abs(candidate.tpcNSigmaPi()) < cMaxTPCnSigmaPion) { - tpcPIDPassed = true; - } else { - return false; - } - tofPIDPassed = true; - + if (candidate.hasTOF()) { + tofPIDPassed = std::abs(candidate.tofNSigmaPi()) < cMaxTOFnSigmaPion || + (nsigmaCutCombinedPion > 0 && + candidate.tpcNSigmaPi() * candidate.tpcNSigmaPi() + + candidate.tofNSigmaPi() * candidate.tofNSigmaPi() < + nsigmaCutCombinedPion * nsigmaCutCombinedPion); } else { - - if (std::abs(candidate.tpcNSigmaPi()) < cMaxTPCnSigmaPion) { - tpcPIDPassed = true; - } else { - return false; - } - if (candidate.hasTOF()) { - if (std::abs(candidate.tofNSigmaPi()) < cMaxTOFnSigmaPion) { - tofPIDPassed = true; - } - if ((nsigmaCutCombinedPion > 0) && (candidate.tpcNSigmaPi() * candidate.tpcNSigmaPi() + candidate.tofNSigmaPi() * candidate.tofNSigmaPi() < nsigmaCutCombinedPion * nsigmaCutCombinedPion)) { - tofPIDPassed = true; - } - } else { - if (!cTOFVeto) { - return false; - } - tofPIDPassed = true; - } + tofPIDPassed = cTOFVeto; } - if (tpcPIDPassed && tofPIDPassed) { - return true; - } - return false; + return tpcPIDPassed && tofPIDPassed; } template @@ -957,7 +937,7 @@ struct chk892flow { continue; if constexpr (!IsMix) { - unsigned int typeKstar = bTrack.sign() > 0 ? binType::kKstarP : binType::kKstarN; + unsigned int typeKstar = bTrack.sign() > 0 ? BinType::kKstarP : BinType::kKstarN; histos.fill(HIST("QA/after/KstarRapidity"), lResoKstar.Rapidity()); histos.fill(HIST("QA/after/kstarinvmass"), lResoKstar.M()); @@ -980,7 +960,7 @@ struct chk892flow { } auto lPhiMinusPsiKstar = RecoDecay::constrainAngle(lResonanceRot.Phi() - lEPDet, 0.0, 1); // constrain angle to range 0, Pi auto v2Kstar = std::cos(static_cast(nmode) * lPhiMinusPsiKstar); - typeKstar = bTrack.sign() > 0 ? binType::kKstarP_RecRot : binType::kKstarN_RecRot; + typeKstar = bTrack.sign() > 0 ? BinType::kKstarP_RecRot : BinType::kKstarN_RecRot; histos.fill(HIST("hInvmass_Kstar"), typeKstar, lCentrality, lResonanceRot.Pt(), lResonanceRot.M(), v2Kstar); } } @@ -997,7 +977,7 @@ struct chk892flow { void processDummy(aod::Collisions const&) { } - PROCESS_SWITCH(chk892flow, processDummy, "process Dummy", true); + PROCESS_SWITCH(Chk892Flow, processDummy, "process Dummy", true); // process data void processData(EventCandidates::iterator const& collision, @@ -1014,7 +994,7 @@ struct chk892flow { fillHistograms(collision, tracks, v0s, 2); // second order } - PROCESS_SWITCH(chk892flow, processData, "Process Event for data without Partitioning", false); + PROCESS_SWITCH(Chk892Flow, processData, "Process Event for data without Partitioning", false); // process MC reconstructed level void processMC(EventCandidates::iterator const& collision, @@ -1026,9 +1006,9 @@ struct chk892flow { fillHistograms(collision, tracks, v0s, 2); } - PROCESS_SWITCH(chk892flow, processMC, "Process Event for MC", false); + PROCESS_SWITCH(Chk892Flow, processMC, "Process Event for MC", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - return WorkflowSpec{adaptAnalysisTask(cfgc)}; + return WorkflowSpec{adaptAnalysisTask(cfgc)}; } From 69e6a137af5a08d01c5c0109d2334d89c05e6729 Mon Sep 17 00:00:00 2001 From: Bong-Hwi Lim Date: Mon, 27 Jan 2025 14:53:08 +0100 Subject: [PATCH 2/6] Update K0s selection cut --- PWGLF/Tasks/Resonances/Chk892Flow.cxx | 215 +++++++++++--------------- 1 file changed, 86 insertions(+), 129 deletions(-) diff --git a/PWGLF/Tasks/Resonances/Chk892Flow.cxx b/PWGLF/Tasks/Resonances/Chk892Flow.cxx index fcdcc109506..f1d9a035153 100644 --- a/PWGLF/Tasks/Resonances/Chk892Flow.cxx +++ b/PWGLF/Tasks/Resonances/Chk892Flow.cxx @@ -186,12 +186,13 @@ struct Chk892Flow { Configurable cfgByPassDauPIDSelection{"cfgByPassDauPIDSelection", true, "Bypass Daughters PID selection"}; Configurable cSecondaryDauDCAMax{"cSecondaryDauDCAMax", 0.2, "Maximum DCA Secondary daughters to PV"}; - // Configurable cSecondaryDauPosDCAtoPVMin{"cSecondaryDauPosDCAtoPVMin", 0.0, "Minimum DCA Secondary positive daughters to PV"}; - // Configurable cSecondaryDauNegDCAtoPVMin{"cSecondaryDauNegDCAtoPVMin", 0.0, "Minimum DCA Secondary negative daughters to PV"}; + Configurable cSecondaryDauPosDCAtoPVMin{"cSecondaryDauPosDCAtoPVMin", 0.0, "Minimum DCA Secondary positive daughters to PV"}; + Configurable cSecondaryDauNegDCAtoPVMin{"cSecondaryDauNegDCAtoPVMin", 0.0, "Minimum DCA Secondary negative daughters to PV"}; // Configurable cSecondaryPtMin{"cSecondaryPtMin", 0.f, "Minimum transverse momentum of Secondary"}; Configurable cSecondaryRapidityMax{"cSecondaryRapidityMax", 0.5, "Maximum rapidity of Secondary"}; - // Configurable cSecondaryRadiusMin{"cSecondaryRadiusMin", 1.2, "Minimum transverse radius of Secondary"}; + Configurable cSecondaryRadiusMin{"cSecondaryRadiusMin", 0.0, "Minimum transverse radius of Secondary"}; + Configurable cSecondaryRadiusMax{"cSecondaryRadiusMax", 999.9, "Maximum transverse radius of Secondary"}; Configurable cSecondaryCosPAMin{"cSecondaryCosPAMin", 0.998, "Mininum cosine pointing angle of Secondary"}; Configurable cSecondaryDCAtoPVMax{"cSecondaryDCAtoPVMax", 0.4, "Maximum DCA Secondary to PV"}; Configurable cSecondaryProperLifetimeMax{"cSecondaryProperLifetimeMax", 20., "Maximum Secondary Lifetime"}; @@ -272,7 +273,9 @@ 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"}; - histos.add("QA/K0sCutCheck", "Check K0s cut", HistType::kTH1D, {AxisSpec{12, -0.5, 11.5, "Check"}}); + if (cfgReturnFlag) { + histos.add("QA/K0sCutCheck", "Check K0s cut", HistType::kTH1D, {AxisSpec{12, -0.5, 11.5, "Check"}}); + } histos.add("QA/before/CentDist", "Centrality distribution", {HistType::kTH1D, {centAxis}}); histos.add("QA/before/VtxZ", "Centrality distribution", {HistType::kTH1D, {vtxzAxis}}); @@ -565,141 +568,95 @@ struct Chk892Flow { bool selectionK0s(CollisionType const& collision, K0sType const& candidate) { auto lDauDCA = candidate.dcaV0daughters(); - // auto lDauPosDCAtoPV = candidate.dcapostopv(); - // auto lDauNegDCAtoPV = candidate.dcanegtopv(); - // auto lPt = candidate.pt(); + auto lDauPosDCAtoPV = candidate.dcapostopv(); + auto lDauNegDCAtoPV = candidate.dcanegtopv(); + auto lPt = candidate.pt(); auto lRapidity = candidate.yK0Short(); - // auto lRadius = candidate.v0radius(); + auto lRadius = candidate.v0radius(); auto lDCAtoPV = candidate.dcav0topv(); auto lCPA = candidate.v0cosPA(); auto lPropTauK0s = candidate.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * MassK0Short; auto lMk0s = candidate.mK0Short(); - if (cfgReturnFlag) { + auto checkCommonCuts = [&]() { + if (lDauDCA > cSecondaryDauDCAMax) + return false; + if (lDauPosDCAtoPV < cSecondaryDauPosDCAtoPVMin) + return false; + if (lDauNegDCAtoPV < cSecondaryDauNegDCAtoPVMin) + return false; + if (lPt < cSecondaryPtMin) + return false; + if (std::fabs(lRapidity) > cSecondaryRapidityMax) + return false; + if (lRadius < cSecondaryRadiusMin || lRadius > cSecondaryRadiusMax) + return false; + if (lDCAtoPV > cSecondaryDCAtoPVMax) + return false; + if (lCPA < cSecondaryCosPAMin) + return false; + if (lPropTauK0s > cSecondaryProperLifetimeMax) + return false; + if (candidate.qtarm() < cSecondaryparamArmenterosCut * std::abs(candidate.alpha())) + return false; + if (std::fabs(lMk0s - MassK0Short) > cSecondaryMassWindow) + return false; + return true; + }; + + if (cfgReturnFlag) { // For cut study bool returnFlag = true; - - if (cSecondaryRequire) { - histos.fill(HIST("QA/K0sCutCheck"), 0); - if (lDauDCA > cSecondaryDauDCAMax) { - histos.fill(HIST("QA/K0sCutCheck"), 1); - returnFlag = false; - } - /* - if (lDauPosDCAtoPV < cSecondaryDauPosDCAtoPVMin) { - histos.fill(HIST("QA/K0sCutCheck"), 2); - returnFlag = false; - } - if (lDauNegDCAtoPV < cSecondaryDauNegDCAtoPVMin) { - histos.fill(HIST("QA/K0sCutCheck"), 3); - returnFlag = false; - } - if (lPt < cSecondaryPtMin) { - histos.fill(HIST("QA/K0sCutCheck"), 4); - returnFlag = false; - } - */ - if (std::fabs(lRapidity) > cSecondaryRapidityMax) { - histos.fill(HIST("QA/K0sCutCheck"), 5); - returnFlag = false; - } - /* - if (lRadius < cSecondaryRadiusMin) { - histos.fill(HIST("QA/K0sCutCheck"), 6); - returnFlag = false; - } - */ - if (lDCAtoPV > cSecondaryDCAtoPVMax) { - histos.fill(HIST("QA/K0sCutCheck"), 7); - returnFlag = false; - } - if (lCPA < cSecondaryCosPAMin) { - histos.fill(HIST("QA/K0sCutCheck"), 8); - returnFlag = false; - } - if (lPropTauK0s > cSecondaryProperLifetimeMax) { - histos.fill(HIST("QA/K0sCutCheck"), 9); - returnFlag = false; - } - if (candidate.qtarm() < cSecondaryparamArmenterosCut * std::abs(candidate.alpha())) { - histos.fill(HIST("QA/K0sCutCheck"), 11); - returnFlag = false; - } - if (std::fabs(lMk0s - MassK0Short) > cSecondaryMassWindow) { - histos.fill(HIST("QA/K0sCutCheck"), 10); - returnFlag = false; - } - - return returnFlag; - - } else { - if (std::fabs(lMk0s - MassK0Short) > cSecondaryMassWindow) { - histos.fill(HIST("QA/K0sCutCheck"), 10); - returnFlag = false; - } - - return returnFlag; + histos.fill(HIST("QA/K0sCutCheck"), 0); + if (lDauDCA > cSecondaryDauDCAMax) { + histos.fill(HIST("QA/K0sCutCheck"), 1); + returnFlag = false; } - - } else { + if (lDauPosDCAtoPV < cSecondaryDauPosDCAtoPVMin) { + histos.fill(HIST("QA/K0sCutCheck"), 2); + returnFlag = false; + } + if (lDauNegDCAtoPV < cSecondaryDauNegDCAtoPVMin) { + histos.fill(HIST("QA/K0sCutCheck"), 3); + returnFlag = false; + } + if (lPt < cSecondaryPtMin) { + histos.fill(HIST("QA/K0sCutCheck"), 4); + returnFlag = false; + } + if (std::fabs(lRapidity) > cSecondaryRapidityMax) { + histos.fill(HIST("QA/K0sCutCheck"), 5); + returnFlag = false; + } + if (lRadius < cSecondaryRadiusMin || lRadius > cSecondaryRadiusMax) { + histos.fill(HIST("QA/K0sCutCheck"), 6); + returnFlag = false; + } + if (lDCAtoPV > cSecondaryDCAtoPVMax) { + histos.fill(HIST("QA/K0sCutCheck"), 7); + returnFlag = false; + } + if (lCPA < cSecondaryCosPAMin) { + histos.fill(HIST("QA/K0sCutCheck"), 8); + returnFlag = false; + } + if (lPropTauK0s > cSecondaryProperLifetimeMax) { + histos.fill(HIST("QA/K0sCutCheck"), 9); + returnFlag = false; + } + if (candidate.qtarm() < cSecondaryparamArmenterosCut * std::abs(candidate.alpha())) { + histos.fill(HIST("QA/K0sCutCheck"), 10); + returnFlag = false; + } + if (std::fabs(lMk0s - MassK0Short) > cSecondaryMassWindow) { + histos.fill(HIST("QA/K0sCutCheck"), 11); + returnFlag = false; + } + return returnFlag; + } else { // normal usage if (cSecondaryRequire) { - - histos.fill(HIST("QA/K0sCutCheck"), 0); - if (lDauDCA > cSecondaryDauDCAMax) { - histos.fill(HIST("QA/K0sCutCheck"), 1); - return false; - } - /* - if (lDauPosDCAtoPV < cSecondaryDauPosDCAtoPVMin) { - histos.fill(HIST("QA/K0sCutCheck"), 2); - return false; - } - if (lDauNegDCAtoPV < cSecondaryDauNegDCAtoPVMin) { - histos.fill(HIST("QA/K0sCutCheck"), 3); - return false; - } - if (lPt < cSecondaryPtMin) { - histos.fill(HIST("QA/K0sCutCheck"), 4); - return false; - } - */ - if (std::fabs(lRapidity) > cSecondaryRapidityMax) { - histos.fill(HIST("QA/K0sCutCheck"), 5); - return false; - } - /* - if (lRadius < cSecondaryRadiusMin) { - histos.fill(HIST("QA/K0sCutCheck"), 6); - return false; - } - */ - if (lDCAtoPV > cSecondaryDCAtoPVMax) { - histos.fill(HIST("QA/K0sCutCheck"), 7); - return false; - } - if (lCPA < cSecondaryCosPAMin) { - histos.fill(HIST("QA/K0sCutCheck"), 8); - return false; - } - if (lPropTauK0s > cSecondaryProperLifetimeMax) { - histos.fill(HIST("QA/K0sCutCheck"), 9); - return false; - } - if (candidate.qtarm() < cSecondaryparamArmenterosCut * std::abs(candidate.alpha())) { - histos.fill(HIST("QA/K0sCutCheck"), 11); - return false; - } - if (std::fabs(lMk0s - MassK0Short) > cSecondaryMassWindow) { - histos.fill(HIST("QA/K0sCutCheck"), 10); - return false; - } - return true; - + return checkCommonCuts(); } else { - if (std::fabs(lMk0s - MassK0Short) > cSecondaryMassWindow) { - histos.fill(HIST("QA/K0sCutCheck"), 10); - return false; - } - return true; + return std::fabs(lMk0s - MassK0Short) <= cSecondaryMassWindow; // always apply mass window cut } } } // selectionK0s From bad1fbff50784644e0a37a71944455b4b2276544 Mon Sep 17 00:00:00 2001 From: Bong-Hwi Lim Date: Mon, 27 Jan 2025 15:08:00 +0100 Subject: [PATCH 3/6] Clear unused histograms and fix k0s analysis --- PWGLF/Tasks/Resonances/Chk892Flow.cxx | 71 +++++++-------------------- 1 file changed, 17 insertions(+), 54 deletions(-) diff --git a/PWGLF/Tasks/Resonances/Chk892Flow.cxx b/PWGLF/Tasks/Resonances/Chk892Flow.cxx index f1d9a035153..110aa22f103 100644 --- a/PWGLF/Tasks/Resonances/Chk892Flow.cxx +++ b/PWGLF/Tasks/Resonances/Chk892Flow.cxx @@ -276,10 +276,8 @@ struct Chk892Flow { if (cfgReturnFlag) { histos.add("QA/K0sCutCheck", "Check K0s cut", HistType::kTH1D, {AxisSpec{12, -0.5, 11.5, "Check"}}); } - histos.add("QA/before/CentDist", "Centrality distribution", {HistType::kTH1D, {centAxis}}); histos.add("QA/before/VtxZ", "Centrality distribution", {HistType::kTH1D, {vtxzAxis}}); - histos.add("QA/before/hEvent", "Number of Events", HistType::kTH1F, {{1, 0.5, 1.5}}); // EventPlane histos.add("QA/EP/hEPDet", "Event plane distribution of FT0C (Det = A)", {HistType::kTH2D, {centAxis, epAxis}}); @@ -341,48 +339,36 @@ struct Chk892Flow { // K0s histos.add("QA/before/hDauDCASecondary", "DCA of daughters of secondary resonance", HistType::kTH1D, {dcaAxis}); - // histos.add("QA/before/hDauPosDCAtoPVSecondary", "Pos DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); - // histos.add("QA/before/hDauNegDCAtoPVSecondary", "Neg DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); - // histos.add("QA/before/hpT_Secondary", "pT distribution of secondary resonance", HistType::kTH1D, {ptAxisQA}); histos.add("QA/before/hy_Secondary", "Rapidity distribution of secondary resonance", HistType::kTH1D, {yAxis}); - // histos.add("QA/before/hRadiusSecondary", "Radius distribution of secondary resonance", HistType::kTH1D, {radiusAxis}); histos.add("QA/before/hCPASecondary", "Cosine pointing angle distribution of secondary resonance", HistType::kTH1D, {cpaAxis}); histos.add("QA/before/hDCAtoPVSecondary", "DCA to PV distribution of secondary resonance", HistType::kTH1D, {dcaAxis}); - // histos.add("QA/before/hPropTauSecondary", "Proper Lifetime distribution of secondary resonance", HistType::kTH1D, {tauAxis}); - // histos.add("QA/before/hPtAsymSecondary", "pT asymmetry distribution of secondary resonance", HistType::kTH1D, {AxisSpec{100, -1, 1, "Pair asymmetry"}}); + histos.add("QA/before/hPropTauSecondary", "Proper Lifetime distribution of secondary resonance", HistType::kTH1D, {tauAxis}); histos.add("QA/before/hInvmassSecondary", "Invariant mass of unlike-sign secondary resonance", HistType::kTH1D, {invMassAxisK0s}); histos.add("QA/after/hDauDCASecondary", "DCA of daughters of secondary resonance", HistType::kTH1D, {dcaAxis}); - // histos.add("QA/after/hDauPosDCAtoPVSecondary", "Pos DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); - // histos.add("QA/after/hDauNegDCAtoPVSecondary", "Neg DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); - // histos.add("QA/after/hpT_Secondary", "pT distribution of secondary resonance", HistType::kTH1D, {ptAxisQA}); histos.add("QA/after/hy_Secondary", "Rapidity distribution of secondary resonance", HistType::kTH1D, {yAxis}); - // histos.add("QA/after/hRadiusSecondary", "Radius distribution of secondary resonance", HistType::kTH1D, {radiusAxis}); histos.add("QA/after/hCPASecondary", "Cosine pointing angle distribution of secondary resonance", HistType::kTH1D, {cpaAxis}); histos.add("QA/after/hDCAtoPVSecondary", "DCA to PV distribution of secondary resonance", HistType::kTH1D, {dcaAxis}); - // histos.add("QA/after/hPropTauSecondary", "Proper Lifetime distribution of secondary resonance", HistType::kTH1D, {tauAxis}); - // histos.add("QA/after/hPtAsymSecondary", "pT asymmetry distribution of secondary resonance", HistType::kTH1D, {AxisSpec{100, -1, 1, "Pair asymmetry"}}); + histos.add("QA/after/hPropTauSecondary", "Proper Lifetime distribution of secondary resonance", HistType::kTH1D, {tauAxis}); histos.add("QA/after/hInvmassSecondary", "Invariant mass of unlike-sign secondary resonance", HistType::kTH1D, {invMassAxisK0s}); // Kstar // Invariant mass nSparse - histos.add("QA/before/KstarRapidity", "Rapidity distribution of chK(892)", HistType::kTH1D, {yAxis}); histos.add("hInvmass_Kstar", "Invariant mass of unlike-sign chK(892)", HistType::kTHnSparseD, {axisType, centAxis, ptAxis, invMassAxisReso, v2Axis}); - histos.add("hInvmass_Kstar_Mix", "Invariant mass of unlike-sign chK(892) from mixed event", HistType::kTHnSparseD, {axisType, centAxis, ptAxis, invMassAxisReso, v2Axis}); + histos.add("hInvmass_K0s", "Invariant mass of unlike-sign K0s", HistType::kTHnSparseD, {centAxis, ptAxis, invMassAxisK0s, v2Axis}); // Mass QA (quick check) + histos.add("QA/before/KstarRapidity", "Rapidity distribution of chK(892)", HistType::kTH1D, {yAxis}); histos.add("QA/before/kstarinvmass", "Invariant mass of unlike-sign chK(892)", HistType::kTH1D, {invMassAxisReso}); histos.add("QA/before/k0sv2vsinvmass", "Invariant mass vs v2 of unlike-sign K0s", HistType::kTH2D, {invMassAxisK0s, v2Axis}); histos.add("QA/before/kstarv2vsinvmass", "Invariant mass vs v2 of unlike-sign chK(892)", HistType::kTH2D, {invMassAxisReso, v2Axis}); histos.add("QA/before/kstarinvmass_Mix", "Invariant mass of unlike-sign chK(892) from mixed event", HistType::kTH1D, {invMassAxisReso}); - histos.add("QA/before/kstarv2vsinvmass_Mix", "Invariant mass vs v2 of unlike-sign chK(892) from mixed event", HistType::kTH2D, {invMassAxisReso, v2Axis}); histos.add("QA/after/KstarRapidity", "Rapidity distribution of chK(892)", HistType::kTH1D, {yAxis}); histos.add("QA/after/kstarinvmass", "Invariant mass of unlike-sign chK(892)", HistType::kTH1D, {invMassAxisReso}); histos.add("QA/after/k0sv2vsinvmass", "Invariant mass vs v2 of unlike-sign K0s", HistType::kTH2D, {invMassAxisK0s, v2Axis}); 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}); - histos.add("QA/after/kstarv2vsinvmass_Mix", "Invariant mass vs v2 of unlike-sign chK(892) from mixed event", HistType::kTH2D, {invMassAxisReso, v2Axis}); lDetId = getlDetId(cfgQvecDetName); lRefAId = getlDetId(cfgQvecRefAName); @@ -398,8 +384,6 @@ struct Chk892Flow { // 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}); @@ -429,13 +413,10 @@ struct Chk892Flow { 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 @@ -780,16 +761,15 @@ struct Chk892Flow { /// K0s auto trkkDauDCA = k0sCand.dcaV0daughters(); - // auto trkkDauDCAPostoPV = k0sCand.dcapostopv(); - // auto trkkDauDCANegtoPV = k0sCand.dcanegtopv(); - // auto trkkpt = k0sCand.pt(); auto trkky = k0sCand.yK0Short(); - // auto trkkRadius = k0sCand.v0radius(); 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(); + lResoSecondary.SetXYZM(k0sCand.px(), k0sCand.py(), k0sCand.pz(), MassK0Short); + auto lPhiMinusPsiK0s = RecoDecay::constrainAngle(lResoSecondary.Phi() - lEPDet, 0.0, 2); // constrain angle to range 0, Pi + auto v2K0s = std::cos(static_cast(nmode) * lPhiMinusPsiK0s); if constexpr (!IsMix) { // Seconddary QA plots histos.fill(HIST("QA/before/trkppionTPCPID"), trkppt, trkpNSigmaPiTPC); @@ -809,23 +789,17 @@ struct Chk892Flow { histos.fill(HIST("QA/before/trknpionpT"), trknpt); histos.fill(HIST("QA/before/trknpionDCAxy"), negDauTrack.dcaXY()); histos.fill(HIST("QA/before/trknpionDCAz"), negDauTrack.dcaZ()); - histos.fill(HIST("QA/before/hDauDCASecondary"), trkkDauDCA); - // histos.fill(HIST("QA/before/hDauPosDCAtoPVSecondary"), trkkDauDCAPostoPV); - // histos.fill(HIST("QA/before/hDauNegDCAtoPVSecondary"), trkkDauDCANegtoPV); - - // histos.fill(HIST("QA/before/hpT_Secondary"), trkkpt); histos.fill(HIST("QA/before/hy_Secondary"), trkky); - // histos.fill(HIST("QA/before/hRadiusSecondary"), trkkRadius); histos.fill(HIST("QA/before/hDCAtoPVSecondary"), trkkDCAtoPV); histos.fill(HIST("QA/before/hCPASecondary"), trkkCPA); - // histos.fill(HIST("QA/before/hPropTauSecondary"), trkkPropTau); + histos.fill(HIST("QA/before/hPropTauSecondary"), trkkPropTau); histos.fill(HIST("QA/before/hInvmassSecondary"), trkkMass); + + histos.fill(HIST("QA/before/k0sv2vsinvmass"), lResoSecondary.M(), v2K0s); } - // if (!trackCut(posDauTrack) || !trackCut(negDauTrack)) // Too tight cut for K0s daugthers - // continue; - if (!cfgByPassDauPIDSelection && !selectionPIDPion(posDauTrack)) // Perhaps it's already applied in trackCut (need to check QA plots) + if (!cfgByPassDauPIDSelection && !selectionPIDPion(posDauTrack)) continue; if (!cfgByPassDauPIDSelection && !selectionPIDPion(negDauTrack)) continue; @@ -834,7 +808,6 @@ struct Chk892Flow { if constexpr (!IsMix) { // Seconddary QA plots after applying cuts - histos.fill(HIST("QA/after/trkppionTPCPID"), trkppt, trkpNSigmaPiTPC); if (istrkphasTOF) { histos.fill(HIST("QA/after/trkppionTOFPID"), trkppt, trkpNSigmaPiTOF); @@ -854,16 +827,14 @@ struct Chk892Flow { histos.fill(HIST("QA/after/trknpionDCAz"), negDauTrack.dcaZ()); histos.fill(HIST("QA/after/hDauDCASecondary"), trkkDauDCA); - // histos.fill(HIST("QA/after/hDauPosDCAtoPVSecondary"), trkkDauDCAPostoPV); - // histos.fill(HIST("QA/after/hDauNegDCAtoPVSecondary"), trkkDauDCANegtoPV); - - // histos.fill(HIST("QA/after/hpT_Secondary"), trkkpt); histos.fill(HIST("QA/after/hy_Secondary"), trkky); - // histos.fill(HIST("QA/after/hRadiusSecondary"), trkkRadius); histos.fill(HIST("QA/after/hDCAtoPVSecondary"), trkkDCAtoPV); histos.fill(HIST("QA/after/hCPASecondary"), trkkCPA); - // histos.fill(HIST("QA/after/hPropTauSecondary"), trkkPropTau); + histos.fill(HIST("QA/after/hPropTauSecondary"), trkkPropTau); histos.fill(HIST("QA/after/hInvmassSecondary"), trkkMass); + + histos.fill(HIST("QA/after/k0sv2vsinvmass"), lResoSecondary.M(), v2K0s); + histos.fill(HIST("hInvmass_K0s"), lCentrality, lResoSecondary.Pt(), lResoSecondary.M(), v2K0s); } k0sIndicies.push_back(k0sCand.index()); } @@ -877,16 +848,13 @@ struct Chk892Flow { lResoSecondary.SetXYZM(k0sCand.px(), k0sCand.py(), k0sCand.pz(), MassK0Short); lResoKstar = lResoSecondary + lDecayDaughter_bach; - auto lPhiMinusPsiK0s = RecoDecay::constrainAngle(lResoSecondary.Phi() - lEPDet, 0.0, 2); // constrain angle to range 0, Pi - auto lPhiMinusPsiKstar = RecoDecay::constrainAngle(lResoKstar.Phi() - lEPDet, 0.0, 2); // constrain angle to range 0, Pi - auto v2K0s = std::cos(static_cast(nmode) * lPhiMinusPsiK0s); + auto lPhiMinusPsiKstar = RecoDecay::constrainAngle(lResoKstar.Phi() - lEPDet, 0.0, 2); // constrain angle to range 0, Pi auto v2Kstar = std::cos(static_cast(nmode) * lPhiMinusPsiKstar); // QA plots if constexpr (!IsMix) { histos.fill(HIST("QA/before/KstarRapidity"), lResoKstar.Rapidity()); histos.fill(HIST("QA/before/kstarinvmass"), lResoKstar.M()); - histos.fill(HIST("QA/before/k0sv2vsinvmass"), lResoSecondary.M(), v2K0s); histos.fill(HIST("QA/before/kstarv2vsinvmass"), lResoKstar.M(), v2Kstar); } @@ -898,7 +866,6 @@ struct Chk892Flow { histos.fill(HIST("QA/after/KstarRapidity"), lResoKstar.Rapidity()); histos.fill(HIST("QA/after/kstarinvmass"), lResoKstar.M()); - histos.fill(HIST("QA/after/k0sv2vsinvmass"), lResoSecondary.M(), v2K0s); histos.fill(HIST("QA/after/kstarv2vsinvmass"), lResoKstar.M(), v2Kstar); histos.fill(HIST("hInvmass_Kstar"), typeKstar, lCentrality, lResoKstar.Pt(), lResoKstar.M(), v2Kstar); @@ -921,7 +888,6 @@ struct Chk892Flow { histos.fill(HIST("hInvmass_Kstar"), typeKstar, lCentrality, lResonanceRot.Pt(), lResonanceRot.M(), v2Kstar); } } - } // IsMix } // k0sCand } // bTrack @@ -958,9 +924,6 @@ struct Chk892Flow { MCTrackCandidates const& tracks, MCV0Candidates const& v0s) { - - histos.fill(HIST("QAMC/hEvent"), 1.0); - fillHistograms(collision, tracks, v0s, 2); } PROCESS_SWITCH(Chk892Flow, processMC, "Process Event for MC", false); From b6b65de4b3230165e43a3a033514c5e780265e9d Mon Sep 17 00:00:00 2001 From: Bong-Hwi Lim Date: Mon, 27 Jan 2025 15:10:38 +0100 Subject: [PATCH 4/6] hot fix error and warnings --- PWGLF/Tasks/Resonances/Chk892Flow.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/PWGLF/Tasks/Resonances/Chk892Flow.cxx b/PWGLF/Tasks/Resonances/Chk892Flow.cxx index 110aa22f103..930bd04f2bd 100644 --- a/PWGLF/Tasks/Resonances/Chk892Flow.cxx +++ b/PWGLF/Tasks/Resonances/Chk892Flow.cxx @@ -189,7 +189,7 @@ struct Chk892Flow { Configurable cSecondaryDauPosDCAtoPVMin{"cSecondaryDauPosDCAtoPVMin", 0.0, "Minimum DCA Secondary positive daughters to PV"}; Configurable cSecondaryDauNegDCAtoPVMin{"cSecondaryDauNegDCAtoPVMin", 0.0, "Minimum DCA Secondary negative daughters to PV"}; - // Configurable cSecondaryPtMin{"cSecondaryPtMin", 0.f, "Minimum transverse momentum of Secondary"}; + Configurable cSecondaryPtMin{"cSecondaryPtMin", 0.f, "Minimum transverse momentum of Secondary"}; Configurable cSecondaryRapidityMax{"cSecondaryRapidityMax", 0.5, "Maximum rapidity of Secondary"}; Configurable cSecondaryRadiusMin{"cSecondaryRadiusMin", 0.0, "Minimum transverse radius of Secondary"}; Configurable cSecondaryRadiusMax{"cSecondaryRadiusMax", 999.9, "Maximum transverse radius of Secondary"}; @@ -232,7 +232,6 @@ struct Chk892Flow { int kPDGK0s = kK0Short; int kPDGK0 = kK0; int kKstarPlus = o2::constants::physics::Pdg::kKPlusStar892; - int kPiPlus = kPiPlus; void init(o2::framework::InitContext&) { From 9bbf0261e9aaa1ee642a870b78e450ffdfaef7c5 Mon Sep 17 00:00:00 2001 From: Bong-Hwi Lim Date: Mon, 27 Jan 2025 15:51:38 +0100 Subject: [PATCH 5/6] fix filename issue --- PWGLF/Tasks/Resonances/{Chk892Flow.cxx => chk892Flow.cxx} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename PWGLF/Tasks/Resonances/{Chk892Flow.cxx => chk892Flow.cxx} (99%) diff --git a/PWGLF/Tasks/Resonances/Chk892Flow.cxx b/PWGLF/Tasks/Resonances/chk892Flow.cxx similarity index 99% rename from PWGLF/Tasks/Resonances/Chk892Flow.cxx rename to PWGLF/Tasks/Resonances/chk892Flow.cxx index 930bd04f2bd..e2abf37da88 100644 --- a/PWGLF/Tasks/Resonances/Chk892Flow.cxx +++ b/PWGLF/Tasks/Resonances/chk892Flow.cxx @@ -9,7 +9,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. /// -/// \file Chk892Flow.cxx +/// \file chk892Flow.cxx /// \brief Reconstruction of track-track decay resonance candidates /// \author Su-Jeong Ji , Bong-Hwi Lim /// From e57955adc441a69989dea33416aa0c2230226aed Mon Sep 17 00:00:00 2001 From: Bong-Hwi Lim Date: Mon, 27 Jan 2025 20:13:50 +0100 Subject: [PATCH 6/6] Update filename --- PWGLF/Tasks/Resonances/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/Tasks/Resonances/CMakeLists.txt b/PWGLF/Tasks/Resonances/CMakeLists.txt index 4f00934dba0..6c98d0325bc 100644 --- a/PWGLF/Tasks/Resonances/CMakeLists.txt +++ b/PWGLF/Tasks/Resonances/CMakeLists.txt @@ -165,7 +165,7 @@ o2physics_add_dpl_workflow(highmasslambdasvx COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(chk892flow - SOURCES chk892flow.cxx + SOURCES chk892Flow.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis)