From b8da914f6c5fd0f8b2c1fce1cde6a60150bd9cf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Wed, 24 Sep 2025 15:53:31 +0200 Subject: [PATCH 01/25] DhCorrelationExtraction.cxx: Fix initializer order --- PWGHF/HFC/Macros/DhCorrelationExtraction.cxx | 52 ++++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/PWGHF/HFC/Macros/DhCorrelationExtraction.cxx b/PWGHF/HFC/Macros/DhCorrelationExtraction.cxx index 5e6125d0bdb..88eaee6d185 100644 --- a/PWGHF/HFC/Macros/DhCorrelationExtraction.cxx +++ b/PWGHF/HFC/Macros/DhCorrelationExtraction.cxx @@ -38,26 +38,23 @@ DhCorrelationExtraction::DhCorrelationExtraction() : // default constructor fFileFDTemplate(0x0), fFileFDPromptFrac(0x0), fFileSecPart(0x0), + fFilePromptMc(0x0), + fFileNonPromptMc(0x0), fDirMass(0x0), fDirSE(0x0), fDirME(0x0), fDirSecPart(0x0), - fFilePromptMc(0x0), - fFileNonPromptMc(0x0), fCorrectedCorrHisto(0x0), fCorrectedCorrHisto_BaselineSubtr(0x0), fCorrectedCorrHisto_Reflected(0x0), fCorrectedCorrHisto_Reflected_BaselineSubtr(0x0), fDmesonSpecies(kDsToKKPi), fDmesonLabel("Ds"), - fNpools(9), - fDeltaEtaMin(-1.), - fDeltaEtaMax(1.), - fCorrectPoolsSeparately(kTRUE), - fSubtractSoftPiME(kFALSE), fFileNameSE(""), fFileNameME(""), fFileSecPartName(""), + fFileFDTemplateName(""), + fFileFDPromptFracName(""), fFilePromptMcRecName(""), fFileNonPromptMcRecName(""), fDirNameSE(""), @@ -74,27 +71,30 @@ DhCorrelationExtraction::DhCorrelationExtraction() : // default constructor fMECorrelSidebandsName(""), fMECorrelSidebandLeftName(""), fMECorrelSidebandRightName(""), - fFileFDTemplateName(""), - fFileFDPromptFracName(""), fHistoFDTemplatePromptName(""), fHistoFDTemplateNonPromptName(""), fHistoFDPromptFracName(""), fHistoPrimaryPartName(""), fHistoAllPartName(""), + fNpools(9), + fRebinAxisDeltaEta(1), + fRebinAxisDeltaPhi(1), + fDebug(0), + fBinPtCand(0), + fBinPtHad(0), + fDeltaEtaMin(-1.), + fDeltaEtaMax(1.), fBkgScaleFactor(1.), fSgnYieldNorm(1.), fBkgYield(1.), + fCorrectPoolsSeparately(kTRUE), + fSubtractSoftPiME(kFALSE), fRebinAngCorr(kFALSE), fRebinFDCorr(kFALSE), fRebinSecPart(kFALSE), fSidebandDivided(kFALSE), fUseSidebLeft(kFALSE), fUseSidebRight(kFALSE), - fRebinAxisDeltaEta(1), - fRebinAxisDeltaPhi(1), - fBinPtCand(0), - fBinPtHad(0), - fDebug(0), fFDsubtraction(0), fSecPartContamination(0), fCorrBiasBtoD(0) @@ -118,14 +118,11 @@ DhCorrelationExtraction::DhCorrelationExtraction(const DhCorrelationExtraction& fCorrectedCorrHisto_Reflected_BaselineSubtr(source.fCorrectedCorrHisto_Reflected_BaselineSubtr), fDmesonSpecies(source.fDmesonSpecies), fDmesonLabel(source.fDmesonLabel), - fNpools(source.fNpools), - fDeltaEtaMin(source.fDeltaEtaMin), - fDeltaEtaMax(source.fDeltaEtaMax), - fCorrectPoolsSeparately(source.fCorrectPoolsSeparately), - fSubtractSoftPiME(source.fSubtractSoftPiME), fFileNameSE(source.fFileNameSE), fFileNameME(source.fFileNameME), fFileSecPartName(source.fFileSecPartName), + fFileFDTemplateName(source.fFileFDTemplateName), + fFileFDPromptFracName(source.fFileFDPromptFracName), fFilePromptMcRecName(source.fFilePromptMcRecName), fFileNonPromptMcRecName(source.fFileNonPromptMcRecName), fDirNameSE(source.fDirNameSE), @@ -142,27 +139,30 @@ DhCorrelationExtraction::DhCorrelationExtraction(const DhCorrelationExtraction& fMECorrelSidebandsName(source.fMECorrelSidebandsName), fMECorrelSidebandLeftName(source.fMECorrelSidebandLeftName), fMECorrelSidebandRightName(source.fMECorrelSidebandRightName), - fFileFDTemplateName(source.fFileFDTemplateName), - fFileFDPromptFracName(source.fFileFDPromptFracName), fHistoFDTemplatePromptName(source.fHistoFDTemplatePromptName), fHistoFDTemplateNonPromptName(source.fHistoFDTemplateNonPromptName), fHistoFDPromptFracName(source.fHistoFDPromptFracName), fHistoPrimaryPartName(source.fHistoPrimaryPartName), fHistoAllPartName(source.fHistoAllPartName), + fNpools(source.fNpools), + fRebinAxisDeltaEta(source.fRebinAxisDeltaEta), + fRebinAxisDeltaPhi(source.fRebinAxisDeltaPhi), + fDebug(source.fDebug), + fBinPtCand(source.fBinPtCand), + fBinPtHad(source.fBinPtHad), + fDeltaEtaMin(source.fDeltaEtaMin), + fDeltaEtaMax(source.fDeltaEtaMax), fBkgScaleFactor(source.fBkgScaleFactor), fSgnYieldNorm(source.fSgnYieldNorm), fBkgYield(source.fBkgYield), + fCorrectPoolsSeparately(source.fCorrectPoolsSeparately), + fSubtractSoftPiME(source.fSubtractSoftPiME), fRebinAngCorr(source.fRebinAngCorr), fRebinFDCorr(source.fRebinFDCorr), fRebinSecPart(source.fRebinSecPart), fSidebandDivided(source.fSidebandDivided), fUseSidebLeft(source.fUseSidebLeft), fUseSidebRight(source.fUseSidebRight), - fRebinAxisDeltaEta(source.fRebinAxisDeltaEta), - fRebinAxisDeltaPhi(source.fRebinAxisDeltaPhi), - fBinPtCand(source.fBinPtCand), - fBinPtHad(source.fBinPtHad), - fDebug(source.fDebug), fFDsubtraction(source.fFDsubtraction), fSecPartContamination(source.fSecPartContamination), fCorrBiasBtoD(source.fCorrBiasBtoD) From c20e574ca4776f49fc75dea8a3cc2e4f24cc13d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Wed, 24 Sep 2025 17:50:41 +0200 Subject: [PATCH 02/25] taskCharmPolarisation.cxx: Fix redundant condition --- PWGHF/D2H/Tasks/taskCharmPolarisation.cxx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx b/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx index f938e7497fc..133eded640f 100644 --- a/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx +++ b/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx @@ -2138,9 +2138,7 @@ struct HfTaskCharmPolarisation { RecoDecay::getDaughters(mcParticle, &listDaughtersD0, dauPdgsD0, 1); for (const auto& dauIdxD0 : listDaughtersD0) { auto dauPartD0 = mcParticles.rawIteratorAt(dauIdxD0 - mcParticles.offset()); - if (areDauInAcc) { - areDauInAcc = isDaughterInAcceptance(dauPartD0, 0.3, 0.8); - } + areDauInAcc = isDaughterInAcceptance(dauPartD0, 0.3, 0.8); } } } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { From 9483d01b77047b4fb77b5e1f3429eb2b4bfea742 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Thu, 25 Sep 2025 16:30:21 +0200 Subject: [PATCH 03/25] Fix missing initialisation --- PWGHF/Core/HfHelper.h | 6 +-- PWGHF/D2H/Macros/HFInvMassFitter.h | 4 +- .../dataCreatorCharmHadPiReduced.cxx | 42 +++++++++---------- .../dataCreatorCharmResoReduced.cxx | 20 ++++----- .../dataCreatorJpsiHadReduced.cxx | 16 +++---- PWGHF/D2H/Tasks/taskB0.cxx | 6 +-- PWGHF/D2H/Tasks/taskBs.cxx | 6 +-- PWGHF/D2H/Tasks/taskDs.cxx | 22 +++++----- PWGHF/D2H/Tasks/taskSigmac.cxx | 2 +- PWGHF/D2H/Tasks/taskXicToXiPiPi.cxx | 12 +++--- .../TableProducer/correlatorDplusHadrons.cxx | 2 +- .../HFC/TableProducer/correlatorDsHadrons.cxx | 2 +- .../TableProducer/correlatorDstarHadrons.cxx | 6 +-- .../HFC/TableProducer/correlatorLcHadrons.cxx | 2 +- .../HFC/TableProducer/femtoDreamProducer.cxx | 6 +-- PWGHF/HFC/Tasks/taskFlow.cxx | 10 ++--- .../TableProducer/candidateCreator2Prong.cxx | 4 +- .../TableProducer/candidateCreator3Prong.cxx | 10 ++--- PWGHF/TableProducer/candidateCreatorB0.cxx | 4 +- PWGHF/TableProducer/candidateCreatorBplus.cxx | 4 +- PWGHF/TableProducer/candidateCreatorBs.cxx | 6 +-- .../TableProducer/candidateCreatorCascade.cxx | 6 +-- PWGHF/TableProducer/candidateCreatorDstar.cxx | 12 +++--- PWGHF/TableProducer/candidateCreatorLb.cxx | 2 +- .../candidateCreatorSigmac0plusplus.cxx | 4 +- .../candidateCreatorXic0Omegac0.cxx | 26 ++++++------ .../candidateCreatorXicToXiPiPi.cxx | 10 ++--- PWGHF/TableProducer/candidateCreatorXicc.cxx | 2 +- PWGHF/TableProducer/candidateSelectorLc.cxx | 2 +- .../candidateSelectorLcPidMl.cxx | 2 +- PWGHF/TableProducer/trackIndexSkimCreator.cxx | 14 +++---- PWGHF/TableProducer/treeCreatorOmegacSt.cxx | 12 +++--- .../TableProducer/treeCreatorTccToD0D0Pi.cxx | 2 +- PWGHF/Tasks/taskMcEfficiency.cxx | 6 +-- PWGHF/Utils/utilsDerivedData.h | 2 +- PWGHF/Utils/utilsMcGen.h | 2 +- 36 files changed, 148 insertions(+), 148 deletions(-) diff --git a/PWGHF/Core/HfHelper.h b/PWGHF/Core/HfHelper.h index 37798045914..74a15898e42 100644 --- a/PWGHF/Core/HfHelper.h +++ b/PWGHF/Core/HfHelper.h @@ -290,9 +290,9 @@ class HfHelper auto cosPiKPhiRestFrame(const T& candidate, int option) { // Ported from AliAODRecoDecayHF3Prong::CosPiKPhiRFrame - std::array momPi; - std::array momK1; - std::array momK2; + std::array momPi{}; + std::array momK1{}; + std::array momK2{}; if (option == 0) { // KKPi momPi = candidate.pVectorProng2(); diff --git a/PWGHF/D2H/Macros/HFInvMassFitter.h b/PWGHF/D2H/Macros/HFInvMassFitter.h index 5ec95ebd473..2ddffb1de0d 100644 --- a/PWGHF/D2H/Macros/HFInvMassFitter.h +++ b/PWGHF/D2H/Macros/HFInvMassFitter.h @@ -73,7 +73,7 @@ class HFInvMassFitter : public TNamed if (mHistoInvMass) { delete mHistoInvMass; } - mHistoInvMass = static_cast(histoToFit->Clone("mHistoInvMass")); + mHistoInvMass = dynamic_cast(histoToFit->Clone("mHistoInvMass")); mHistoInvMass->SetDirectory(0); } void setUseLikelihoodFit() { mFitOption = "L,E"; } @@ -193,7 +193,7 @@ class HFInvMassFitter : public TNamed if (!histoRefl) { mEnableReflections = kFALSE; } - mHistoTemplateRefl = static_cast(histoRefl->Clone("mHistoTemplateRefl")); + mHistoTemplateRefl = dynamic_cast(histoRefl->Clone("mHistoTemplateRefl")); } void setDrawBgPrefit(Bool_t value = true) { mDrawBgPrefit = value; } void setHighlightPeakRegion(Bool_t value = true) { mHighlightPeakRegion = value; } diff --git a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx index 9734cf40148..9cfeb8d08be 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx @@ -210,7 +210,7 @@ struct HfDataCreatorCharmHadPiReduced { // CCDB service Service ccdb; o2::base::Propagator::MatCorrType noMatCorr = o2::base::Propagator::MatCorrType::USEMatCorrNONE; - int runNumber; + int runNumber{}; // O2DatabasePDG service Service pdg; @@ -626,7 +626,7 @@ struct HfDataCreatorCharmHadPiReduced { indexRec = RecoDecay::getMatchedMCRec(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[1], vecDaughtersB[2]}, -Pdg::kDS, std::array{-kKPlus, +kKPlus, -kPiPlus}, true, &sign, 2); if (indexRec > -1) { std::vector arrDaughDsIndex; - std::array arrPDGDaughDs; + std::array arrPDGDaughDs{}; RecoDecay::getDaughters(particlesMc.rawIteratorAt(indexRec), &arrDaughDsIndex, std::array{0}, 1); if (arrDaughDsIndex.size() == NDaughtersDs) { for (auto iProng = 0u; iProng < arrDaughDsIndex.size(); ++iProng) { @@ -663,7 +663,7 @@ struct HfDataCreatorCharmHadPiReduced { indexRec = RecoDecay::getMatchedMCRec(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[1], vecDaughtersB[2]}, -Pdg::kDS, std::array{-kKPlus, +kKPlus, -kPiPlus}, true, &sign, 2); if (indexRec > -1) { std::vector arrDaughDsIndex; - std::array arrPDGDaughDs; + std::array arrPDGDaughDs{}; RecoDecay::getDaughters(particlesMc.rawIteratorAt(indexRec), &arrDaughDsIndex, std::array{0}, 1); if (arrDaughDsIndex.size() == NDaughtersDs) { for (auto iProng = 0u; iProng < arrDaughDsIndex.size(); ++iProng) { @@ -688,7 +688,7 @@ struct HfDataCreatorCharmHadPiReduced { indexRec = RecoDecay::getMatchedMCRec(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[1], vecDaughtersB[2]}, -Pdg::kDS, std::array{-kKPlus, +kKPlus, -kPiPlus}, true, &sign, 2); if (indexRec > -1) { std::vector arrDaughDsIndex; - std::array arrPDGDaughDs; + std::array arrPDGDaughDs{}; RecoDecay::getDaughters(particlesMc.rawIteratorAt(indexRec), &arrDaughDsIndex, std::array{0}, 1); if (arrDaughDsIndex.size() == NDaughtersDs) { for (auto iProng = 0u; iProng < arrDaughDsIndex.size(); ++iProng) { @@ -1545,9 +1545,9 @@ struct HfDataCreatorCharmHadPiReduced { auto yParticle = RecoDecay::y(particle.pVector(), massB); auto etaParticle = particle.eta(); - std::array ptProngs; - std::array yProngs; - std::array etaProngs; + std::array ptProngs{}; + std::array yProngs{}; + std::array etaProngs{}; int counter = 0; for (const auto& daught : particle.daughters_as()) { ptProngs[counter] = daught.pt(); @@ -1565,7 +1565,7 @@ struct HfDataCreatorCharmHadPiReduced { auto candCMC = particlesMc.rawIteratorAt(particle.daughtersIds().front()); if (RecoDecay::isMatchedMCGen(particlesMc, candCMC, -static_cast(Pdg::kDS), std::array{-kKPlus, +kKPlus, -kPiPlus}, true, &sign, 2)) { std::vector arrDaughDsIndex; - std::array arrPDGDaughDs; + std::array arrPDGDaughDs{}; RecoDecay::getDaughters(candCMC, &arrDaughDsIndex, std::array{0}, 1); if (arrDaughDsIndex.size() == NDaughtersDs) { for (auto jProng = 0u; jProng < arrDaughDsIndex.size(); ++jProng) { @@ -1591,7 +1591,7 @@ struct HfDataCreatorCharmHadPiReduced { auto candCMC = particlesMc.rawIteratorAt(particle.daughtersIds().front()); if (RecoDecay::isMatchedMCGen(particlesMc, candCMC, -static_cast(Pdg::kDS), std::array{-kKPlus, +kKPlus, -kPiPlus}, true, &sign, 2)) { std::vector arrDaughDsIndex; - std::array arrPDGDaughDs; + std::array arrPDGDaughDs{}; RecoDecay::getDaughters(candCMC, &arrDaughDsIndex, std::array{0}, 1); if (arrDaughDsIndex.size() == NDaughtersDs) { for (auto jProng = 0u; jProng < arrDaughDsIndex.size(); ++jProng) { @@ -1620,9 +1620,9 @@ struct HfDataCreatorCharmHadPiReduced { auto yParticle = RecoDecay::y(particle.pVector(), massB); auto etaParticle = particle.eta(); - std::array ptProngs; - std::array yProngs; - std::array etaProngs; + std::array ptProngs{}; + std::array yProngs{}; + std::array etaProngs{}; int counter = 0; for (const auto& daught : particle.daughters_as()) { ptProngs[counter] = daught.pt(); @@ -1653,9 +1653,9 @@ struct HfDataCreatorCharmHadPiReduced { auto yParticle = RecoDecay::y(particle.pVector(), massB); auto etaParticle = particle.eta(); - std::array ptProngs; - std::array yProngs; - std::array etaProngs; + std::array ptProngs{}; + std::array yProngs{}; + std::array etaProngs{}; int counter = 0; for (const auto& daught : particle.daughters_as()) { ptProngs[counter] = daught.pt(); @@ -1686,9 +1686,9 @@ struct HfDataCreatorCharmHadPiReduced { auto yParticle = RecoDecay::y(particle.pVector(), massB); auto etaParticle = particle.eta(); - std::array ptProngs; - std::array yProngs; - std::array etaProngs; + std::array ptProngs{}; + std::array yProngs{}; + std::array etaProngs{}; int counter = 0; for (const auto& daught : particle.daughters_as()) { ptProngs[counter] = daught.pt(); @@ -1719,9 +1719,9 @@ struct HfDataCreatorCharmHadPiReduced { auto yParticle = RecoDecay::y(particle.pVector(), massB); auto etaParticle = particle.eta(); - std::array ptProngs; - std::array yProngs; - std::array etaProngs; + std::array ptProngs{}; + std::array yProngs{}; + std::array etaProngs{}; int counter = 0; for (const auto& daught : particle.daughters_as()) { ptProngs[counter] = daught.pt(); diff --git a/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx index b5bedc4e8ee..4d7bd3cf1e3 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx @@ -203,7 +203,7 @@ struct HfDataCreatorCharmResoReduced { int runNumber{0}; // needed to detect if the run changed and trigger update of calibrations etc. // material correction for track propagation - o2::base::MatLayerCylSet* lut; + o2::base::MatLayerCylSet* lut{}; o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT; // O2DatabasePDG service @@ -228,7 +228,7 @@ struct HfDataCreatorCharmResoReduced { float mK0Short; float mLambda; uint8_t v0Type; - } candidateV0; + } candidateV0{}; struct { float invMassD; @@ -241,7 +241,7 @@ struct HfDataCreatorCharmResoReduced { std::array pVectorProng0; std::array pVectorProng1; std::array pVectorProng2; - } varUtils; + } varUtils{}; // Dplus using CandsDplusFiltered = soa::Filtered>; @@ -449,7 +449,7 @@ struct HfDataCreatorCharmResoReduced { if (!selectV0Daughter(trackPos, dDaughtersIds) || !selectV0Daughter(trackNeg, dDaughtersIds)) return false; // daughters DCA to V0's collision primary vertex - std::array dcaInfo; + std::array dcaInfo{}; auto trackPosPar = getTrackPar(trackPos); o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, trackPosPar, 2.f, fitter.getMatCorrType(), &dcaInfo); auto trackPosDcaXY = dcaInfo[0]; @@ -1027,8 +1027,8 @@ struct HfDataCreatorCharmResoReduced { for (const auto& candD : candsD) { // initialize variables depending on D meson type bool fillHfCandD = false; - std::array secondaryVertexD; - std::array prongIdsD; + std::array secondaryVertexD{}; + std::array prongIdsD{}; std::array bdtScores = {-1.f, -1.f, -1.f, -1.f, -1.f, -1.f}; std::vector> charmHadDauTracks{}; varUtils.ptD = candD.pt(); @@ -1152,7 +1152,7 @@ struct HfDataCreatorCharmResoReduced { // propagate V0 to primary vertex (if enabled) if (propagateV0toPV) { std::array pVecV0Orig = {candidateV0.mom[0], candidateV0.mom[1], candidateV0.mom[2]}; - std::array dcaInfo; + std::array dcaInfo{}; auto trackParK0 = o2::track::TrackPar(candidateV0.pos, pVecV0Orig, 0, true); trackParK0.setPID(o2::track::PID::K0); trackParK0.setAbsCharge(0); @@ -1694,9 +1694,9 @@ struct HfDataCreatorCharmResoReduced { auto yParticle = RecoDecay::y(particle.pVector(), invMassGen); auto etaParticle = particle.eta(); - std::array ptProngs; - std::array yProngs; - std::array etaProngs; + std::array ptProngs{}; + std::array yProngs{}; + std::array etaProngs{}; int counter = 0; for (const auto& daught : particle.template daughters_as()) { ptProngs[counter] = daught.pt(); diff --git a/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx index 41ee2790334..5eaa8745e84 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx @@ -207,9 +207,9 @@ struct HfDataCreatorJpsiHadReduced { PresliceUnsorted colPerMcCollision = aod::mccollisionlabel::mcCollisionId; o2::base::Propagator::MatCorrType noMatCorr = o2::base::Propagator::MatCorrType::USEMatCorrNONE; - int runNumber; + int runNumber{}; double bz{0.}; - double invMass2JpsiHadMin, invMass2JpsiHadMax; + double invMass2JpsiHadMin{}, invMass2JpsiHadMax{}; bool isHfCandBhadConfigFilled = false; o2::hf_evsel::HfEventSelection hfEvSel; @@ -658,9 +658,9 @@ struct HfDataCreatorJpsiHadReduced { auto yParticle = RecoDecay::y(particle.pVector(), MassBPlus); auto etaParticle = particle.eta(); - std::array ptProngs; - std::array yProngs; - std::array etaProngs; + std::array ptProngs{}; + std::array yProngs{}; + std::array etaProngs{}; int counter = 0; for (const auto& daught : particle.daughters_as()) { ptProngs[counter] = daught.pt(); @@ -698,9 +698,9 @@ struct HfDataCreatorJpsiHadReduced { auto yParticle = RecoDecay::y(particle.pVector(), MassBPlus); auto etaParticle = particle.eta(); - std::array ptProngs; - std::array yProngs; - std::array etaProngs; + std::array ptProngs{}; + std::array yProngs{}; + std::array etaProngs{}; int counter = 0; for (const auto& daught : particle.daughters_as()) { ptProngs[counter] = daught.pt(); diff --git a/PWGHF/D2H/Tasks/taskB0.cxx b/PWGHF/D2H/Tasks/taskB0.cxx index 219d9dc50bb..54effeb26ea 100644 --- a/PWGHF/D2H/Tasks/taskB0.cxx +++ b/PWGHF/D2H/Tasks/taskB0.cxx @@ -290,9 +290,9 @@ struct HfTaskB0 { continue; } - std::array ptProngs; - std::array yProngs; - std::array etaProngs; + std::array ptProngs{}; + std::array yProngs{}; + std::array etaProngs{}; int counter = 0; for (const auto& daught : particle.daughters_as()) { ptProngs[counter] = daught.pt(); diff --git a/PWGHF/D2H/Tasks/taskBs.cxx b/PWGHF/D2H/Tasks/taskBs.cxx index d1d1e252c7c..6d41a59ba82 100644 --- a/PWGHF/D2H/Tasks/taskBs.cxx +++ b/PWGHF/D2H/Tasks/taskBs.cxx @@ -287,9 +287,9 @@ struct HfTaskBs { continue; } - std::array ptProngs; - std::array yProngs; - std::array etaProngs; + std::array ptProngs{}; + std::array yProngs{}; + std::array etaProngs{}; int counter = 0; for (const auto& daught : particle.daughters_as()) { ptProngs[counter] = daught.pt(); diff --git a/PWGHF/D2H/Tasks/taskDs.cxx b/PWGHF/D2H/Tasks/taskDs.cxx index 2621b1e1163..c69433e398a 100644 --- a/PWGHF/D2H/Tasks/taskDs.cxx +++ b/PWGHF/D2H/Tasks/taskDs.cxx @@ -166,11 +166,11 @@ struct HfTaskDs { ConfigurableAxis axisOccupancy{"axisOccupancy", {14, 0., 14000.}, "axis for occupancy"}; int mRunNumber{0}; - bool lCalibLoaded; - TList* lCalibObjects; - TProfile* hVtxZFT0A; - TProfile* hVtxZFT0C; - TProfile* hVtxZNTracks; + bool lCalibLoaded{}; + TList* lCalibObjects{}; + TProfile* hVtxZFT0A{}; + TProfile* hVtxZFT0C{}; + TProfile* hVtxZNTracks{}; HistogramRegistry registry{"registry", {}}; @@ -844,9 +844,9 @@ struct HfTaskDs { if (lCalibObjects) { LOG(info) << "CCDB objects loaded successfully"; - hVtxZFT0A = static_cast(lCalibObjects->FindObject("hVtxZFT0A")); - hVtxZFT0C = static_cast(lCalibObjects->FindObject("hVtxZFT0C")); - hVtxZNTracks = static_cast(lCalibObjects->FindObject("hVtxZNTracksPV")); + hVtxZFT0A = dynamic_cast(lCalibObjects->FindObject("hVtxZFT0A")); + hVtxZFT0C = dynamic_cast(lCalibObjects->FindObject("hVtxZFT0C")); + hVtxZNTracks = dynamic_cast(lCalibObjects->FindObject("hVtxZNTracksPV")); lCalibLoaded = true; // Capture error if (!hVtxZFT0A || !hVtxZFT0C || !hVtxZNTracks) { @@ -909,9 +909,9 @@ struct HfTaskDs { if (lCalibObjects) { LOG(info) << "CCDB objects loaded successfully"; - hVtxZFT0A = static_cast(lCalibObjects->FindObject("hVtxZFT0A")); - hVtxZFT0C = static_cast(lCalibObjects->FindObject("hVtxZFT0C")); - hVtxZNTracks = static_cast(lCalibObjects->FindObject("hVtxZNTracksPV")); + hVtxZFT0A = dynamic_cast(lCalibObjects->FindObject("hVtxZFT0A")); + hVtxZFT0C = dynamic_cast(lCalibObjects->FindObject("hVtxZFT0C")); + hVtxZNTracks = dynamic_cast(lCalibObjects->FindObject("hVtxZNTracksPV")); lCalibLoaded = true; // Capture error if (!hVtxZFT0A || !hVtxZFT0C || !hVtxZNTracks) { diff --git a/PWGHF/D2H/Tasks/taskSigmac.cxx b/PWGHF/D2H/Tasks/taskSigmac.cxx index 6818508421a..e3383b545f1 100644 --- a/PWGHF/D2H/Tasks/taskSigmac.cxx +++ b/PWGHF/D2H/Tasks/taskSigmac.cxx @@ -65,7 +65,7 @@ struct HfTaskSigmac { Configurable addSoftPiDcaToSigmacSparse{"addSoftPiDcaToSigmacSparse", false, "enable the filling of sof-pion dcaXY, dcaZ in the Σc0,++ THnSparse"}; HfHelper hfHelper; - bool isMc; + bool isMc{}; static constexpr std::size_t NDaughters{2u}; using RecoLc = soa::Join; diff --git a/PWGHF/D2H/Tasks/taskXicToXiPiPi.cxx b/PWGHF/D2H/Tasks/taskXicToXiPiPi.cxx index cc3459eba4a..1c5a0856daf 100644 --- a/PWGHF/D2H/Tasks/taskXicToXiPiPi.cxx +++ b/PWGHF/D2H/Tasks/taskXicToXiPiPi.cxx @@ -518,12 +518,12 @@ struct HfTaskXicToXiPiPi { } // get kinematic variables of Ξ π π - std::array ptProngs; - std::array yProngs; - std::array etaProngs; - std::array prodVtxXProngs; - std::array prodVtxYProngs; - std::array prodVtxZProngs; + std::array ptProngs{}; + std::array yProngs{}; + std::array etaProngs{}; + std::array prodVtxXProngs{}; + std::array prodVtxYProngs{}; + std::array prodVtxZProngs{}; int counter = 0; RecoDecay::getDaughters(particle, &arrDaughIndex, std::array{+kXiMinus, +kPiPlus, +kPiPlus}, 2); for (auto iProng = 0u; iProng < arrDaughIndex.size(); ++iProng) { diff --git a/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx index c10865e21d2..ef9de41f28a 100644 --- a/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx @@ -573,7 +573,7 @@ struct HfCorrelatorDplusHadrons { // prompt and non-prompt division std::vector listDaughters{}; std::array arrDaughDplusPDG = {+kPiPlus, -kKPlus, kPiPlus}; - std::array prongsId; + std::array prongsId{}; listDaughters.clear(); RecoDecay::getDaughters(particle1, &listDaughters, arrDaughDplusPDG, 2); int counterDaughters = 0; diff --git a/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx index 6b171bb23df..e4a32fe8251 100644 --- a/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx @@ -707,7 +707,7 @@ struct HfCorrelatorDsHadrons { isDecayChan = particle.flagMcDecayChanGen() == channelsResonant[decayChannel]; std::vector listDaughters{}; std::array arrDaughDsPDG = {+kKPlus, -kKPlus, kPiPlus}; - std::array prongsId; + std::array prongsId{}; listDaughters.clear(); RecoDecay::getDaughters(particle, &listDaughters, arrDaughDsPDG, 2); int counterDaughters = 0; diff --git a/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx index 6f763420bcd..0f8d95ccd0c 100644 --- a/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx @@ -144,9 +144,9 @@ struct HfCorrelatorDstarHadrons { Configurable> rightSidebandInnerBoundary{"rightSidebandInnerBoundary", std::vector{vecSidebandRightInnerDefault}, "right sideband inner boundary"}; // Inv Mass of Dstar and D0 Candidate - float invMassDstarParticle; - float invMassD0Particle; - int binNumber; + float invMassDstarParticle{}; + float invMassD0Particle{}; + int binNumber{}; SliceCache cache; // using BinningType = ColumnBinningPolicy>; diff --git a/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx index 3407c77829b..6c791c7fde8 100644 --- a/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx @@ -856,7 +856,7 @@ struct HfCorrelatorLcHadrons { // prompt and non-prompt division std::vector listDaughters{}; std::array arrDaughLcPDG = {kProton, -kKPlus, kPiPlus}; - std::array prongsId; + std::array prongsId{}; listDaughters.clear(); RecoDecay::getDaughters(particle, &listDaughters, arrDaughLcPDG, 2); int counterDaughters = 0; diff --git a/PWGHF/HFC/TableProducer/femtoDreamProducer.cxx b/PWGHF/HFC/TableProducer/femtoDreamProducer.cxx index 1255781f2b0..3366a2bb8a3 100644 --- a/PWGHF/HFC/TableProducer/femtoDreamProducer.cxx +++ b/PWGHF/HFC/TableProducer/femtoDreamProducer.cxx @@ -167,11 +167,11 @@ struct HfFemtoDreamProducer { o2::ccdb::CcdbApi ccdbApi; o2::hf_evsel::HfEventSelection hfEvSel; Service ccdb; /// Accessing the CCDB - o2::base::MatLayerCylSet* lut; + o2::base::MatLayerCylSet* lut{}; // if (doPvRefit){ lut = o2::base::MatLayerCylSet::rectifyPtrFromFile(ccdb->get(ccdbPathLut));} //! may be it useful, will check later - float magField; - int runNumber; + float magField{}; + int runNumber{}; using CandidateDplus = soa::Join; using CandidateDplusMc = soa::Join; using CandidateLc = soa::Join; diff --git a/PWGHF/HFC/Tasks/taskFlow.cxx b/PWGHF/HFC/Tasks/taskFlow.cxx index 7512ff1281f..2e61b5117ab 100644 --- a/PWGHF/HFC/Tasks/taskFlow.cxx +++ b/PWGHF/HFC/Tasks/taskFlow.cxx @@ -214,11 +214,11 @@ struct HfTaskFlow { SliceCache cache; Service pdg; Service ccdb; - std::vector* offsetFT0; - std::vector* offsetFV0; + std::vector* offsetFT0{}; + std::vector* offsetFV0{}; o2::ccdb::CcdbApi ccdbApi; o2::ft0::Geometry ft0Det; - o2::fv0::Geometry* fv0Det; + o2::fv0::Geometry* fv0Det{}; std::vector hfIndexCache; // ========================= @@ -708,7 +708,7 @@ struct HfTaskFlow { offsetY = (*offsetFV0)[1].getY(); } - o2::fv0::Point3Dsimple chPos; + o2::fv0::Point3Dsimple chPos{}; chPos = fv0Det->getReadoutCenter(chno); // if (configTask.isReadoutCenter) @@ -746,7 +746,7 @@ struct HfTaskFlow { offsetZ = (*offsetFV0)[1].getZ(); } - o2::fv0::Point3Dsimple chPos; + o2::fv0::Point3Dsimple chPos{}; chPos = fv0Det->getReadoutCenter(chno); // if (configTask.isReadoutCenter) // chPos = fv0Det->getReadoutCenter(chno); diff --git a/PWGHF/TableProducer/candidateCreator2Prong.cxx b/PWGHF/TableProducer/candidateCreator2Prong.cxx index c8bc2bd1274..80abb601ee1 100644 --- a/PWGHF/TableProducer/candidateCreator2Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator2Prong.cxx @@ -288,8 +288,8 @@ struct HfCandidateCreator2Prong { auto trackParVar1 = df.getTrack(1); // get track momenta - std::array pvec0; - std::array pvec1; + std::array pvec0{}; + std::array pvec1{}; trackParVar0.getPxPyPzGlo(pvec0); trackParVar1.getPxPyPzGlo(pvec1); diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index a549cd24df7..ecf5c1f8456 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -333,9 +333,9 @@ struct HfCandidateCreator3Prong { trackParVar2 = df.getTrack(2); // get track momenta - std::array pvec0; - std::array pvec1; - std::array pvec2; + std::array pvec0{}; + std::array pvec1{}; + std::array pvec2{}; trackParVar0.getPxPyPzGlo(pvec0); trackParVar1.getPxPyPzGlo(pvec1); trackParVar2.getPxPyPzGlo(pvec2); @@ -1030,8 +1030,8 @@ struct HfCandidateCreator3ProngExpressions { int8_t swapping = 0; int8_t nKinkedTracks = 0; int8_t nInteractionsWithMaterial = 0; - std::vector arrDaughIndex; - std::array arrPdgDaugResonant; + std::vector arrDaughIndex{}; + std::array arrPdgDaugResonant{}; const std::array arrPdgDaugResonantLcToPKstar0{daughtersLcResonant.at(DecayChannelResonant::LcToPKstar0)}; // Λc± → p± K* const std::array arrPdgDaugResonantLcToDeltaplusplusK{daughtersLcResonant.at(DecayChannelResonant::LcToDeltaplusplusK)}; // Λc± → Δ(1232)±± K∓ const std::array arrPdgDaugResonantLcToL1520Pi{daughtersLcResonant.at(DecayChannelResonant::LcToL1520Pi)}; // Λc± → Λ(1520) π± diff --git a/PWGHF/TableProducer/candidateCreatorB0.cxx b/PWGHF/TableProducer/candidateCreatorB0.cxx index a2751e9f3eb..ff0f318c306 100644 --- a/PWGHF/TableProducer/candidateCreatorB0.cxx +++ b/PWGHF/TableProducer/candidateCreatorB0.cxx @@ -98,9 +98,9 @@ struct HfCandidateCreatorB0 { HfHelper hfHelper; Service ccdb; - o2::base::MatLayerCylSet* lut; + o2::base::MatLayerCylSet* lut{}; o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT; - int runNumber; + int runNumber{}; double massPi{0.}; double massD{0.}; diff --git a/PWGHF/TableProducer/candidateCreatorBplus.cxx b/PWGHF/TableProducer/candidateCreatorBplus.cxx index f3cc0baa11e..b639cf026f1 100644 --- a/PWGHF/TableProducer/candidateCreatorBplus.cxx +++ b/PWGHF/TableProducer/candidateCreatorBplus.cxx @@ -106,9 +106,9 @@ struct HfCandidateCreatorBplus { HfHelper hfHelper; Service ccdb; - o2::base::MatLayerCylSet* lut; + o2::base::MatLayerCylSet* lut{}; o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT; - int runNumber; + int runNumber{}; double invMass2D0PiMin{0.}; double invMass2D0PiMax{0.}; diff --git a/PWGHF/TableProducer/candidateCreatorBs.cxx b/PWGHF/TableProducer/candidateCreatorBs.cxx index 0bf80217b41..628ddf8208d 100644 --- a/PWGHF/TableProducer/candidateCreatorBs.cxx +++ b/PWGHF/TableProducer/candidateCreatorBs.cxx @@ -99,7 +99,7 @@ struct HfCandidateCreatorBs { o2::vertexing::DCAFitterN<3> df3; // 3-prong vertex fitter HfHelper hfHelper; Service ccdb; - o2::base::MatLayerCylSet* lut; + o2::base::MatLayerCylSet* lut{}; o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT; int runNumber{0}; @@ -393,8 +393,8 @@ struct HfCandidateCreatorBsExpressions { int8_t sign = 0; int8_t flagChannelMain = 0; int8_t flagChannelReso = 0; - std::vector arrDaughDsIndex; - std::array arrPDGDaughDs; + std::vector arrDaughDsIndex{}; + std::array arrPDGDaughDs{}; std::array arrPDGResonantDsPhiPi = {Pdg::kPhi, kPiPlus}; // Ds± → Phi π± // Match reconstructed candidates. diff --git a/PWGHF/TableProducer/candidateCreatorCascade.cxx b/PWGHF/TableProducer/candidateCreatorCascade.cxx index 74d78f6a00e..7deb0a5a8b4 100644 --- a/PWGHF/TableProducer/candidateCreatorCascade.cxx +++ b/PWGHF/TableProducer/candidateCreatorCascade.cxx @@ -90,7 +90,7 @@ struct HfCandidateCreatorCascade { HfEventSelection hfEvSel; // event selection and monitoring o2::vertexing::DCAFitterN<2> df; // 2-prong vertex fitter Service ccdb; - o2::base::MatLayerCylSet* lut; + o2::base::MatLayerCylSet* lut{}; o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT; int runNumber{0}; @@ -276,8 +276,8 @@ struct HfCandidateCreatorCascade { auto trackParVarBach = df.getTrack(1); // get track momenta - std::array pVecV0; - std::array pVecBach; + std::array pVecV0{}; + std::array pVecBach{}; trackParVarV0.getPxPyPzGlo(pVecV0); trackParVarBach.getPxPyPzGlo(pVecBach); diff --git a/PWGHF/TableProducer/candidateCreatorDstar.cxx b/PWGHF/TableProducer/candidateCreatorDstar.cxx index 2fb6092c4e3..5a6eae2a8e0 100644 --- a/PWGHF/TableProducer/candidateCreatorDstar.cxx +++ b/PWGHF/TableProducer/candidateCreatorDstar.cxx @@ -107,10 +107,10 @@ struct HfCandidateCreatorDstar { o2::base::Propagator::MatCorrType noMatCorr = o2::base::Propagator::MatCorrType::USEMatCorrNONE; // D0-prong vertex fitter o2::vertexing::DCAFitterN<2> df; - int runNumber; - double bz; + int runNumber{}; + double bz{}; static constexpr float CmToMicrometers = 10000.; // from cm to µm - double massPi, massK, massD0; + double massPi{}, massK{}, massD0{}; using TracksWCovExtraPidPiKa = soa::Join; @@ -287,8 +287,8 @@ struct HfCandidateCreatorDstar { auto trackD0ProngParVar0 = df.getTrack(0); auto trackD0ProngParVar1 = df.getTrack(1); - std::array pVecD0Prong0; - std::array pVecD0Prong1; + std::array pVecD0Prong0{}; + std::array pVecD0Prong1{}; trackD0ProngParVar0.getPxPyPzGlo(pVecD0Prong0); trackD0ProngParVar1.getPxPyPzGlo(pVecD0Prong1); @@ -346,7 +346,7 @@ struct HfCandidateCreatorDstar { auto ptD0 = RecoDecay::pt(pVecD0); // Soft pi momentum vector and sign - std::array pVecSoftPi; + std::array pVecSoftPi{}; trackPiParVar.getPxPyPzGlo(pVecSoftPi); int8_t signSoftPi = static_cast(trackPi.sign()); diff --git a/PWGHF/TableProducer/candidateCreatorLb.cxx b/PWGHF/TableProducer/candidateCreatorLb.cxx index 9d15a7e3e1d..14228f95b53 100644 --- a/PWGHF/TableProducer/candidateCreatorLb.cxx +++ b/PWGHF/TableProducer/candidateCreatorLb.cxx @@ -194,7 +194,7 @@ struct HfCandidateCreatorLb { continue; } hPtPion->Fill(trackPion.pt()); - std::array pvecPion; + std::array pvecPion{}; auto trackParVarPi = getTrackParCov(trackPion); // reconstruct the 3-prong Lc vertex diff --git a/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx b/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx index e826254ea35..600f3c5b357 100644 --- a/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx +++ b/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx @@ -101,9 +101,9 @@ struct HfCandidateCreatorSigmac0plusplus { // Needed for dcaXY, dcaZ recalculation of soft pions reassigned to a new collision Service ccdb; - o2::base::MatLayerCylSet* lut; + o2::base::MatLayerCylSet* lut{}; o2::base::Propagator::MatCorrType noMatCorr = o2::base::Propagator::MatCorrType::USEMatCorrNONE; - int runNumber; + int runNumber{}; using CandidatesLc = soa::Filtered>; diff --git a/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx b/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx index 5f3e0b3ebba..1448a218371 100644 --- a/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx +++ b/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx @@ -140,7 +140,7 @@ struct HfCandidateCreatorXic0Omegac0 { HfEventSelection hfEvSel; // event selection and monitoring o2::vertexing::DCAFitterN<2> df; // 2-prong vertex fitter to build the omegac/xic vertex Service ccdb; - o2::base::MatLayerCylSet* lut; + o2::base::MatLayerCylSet* lut{}; o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT; int runNumber{-1}; double magneticField{0.}; @@ -207,7 +207,7 @@ struct HfCandidateCreatorXic0Omegac0 { float chi2MassCasc; float etaOmegac; float cascRejectInvmass; // rej - } kfOmegac0Candidate; + } kfOmegac0Candidate{}; struct { float chi2GeoV0; @@ -251,7 +251,7 @@ struct HfCandidateCreatorXic0Omegac0 { float chi2MassV0; float chi2MassCasc; float etaXic; - } kfXic0Candidate; + } kfXic0Candidate{}; void init(InitContext const&) { @@ -537,8 +537,8 @@ struct HfCandidateCreatorXic0Omegac0 { hFitterStatus->Fill(0); hCandidateCounter->Fill(2); auto vertexCharmBaryonFromFitter = df.getPCACandidate(); - std::array pVecCascAsD; - std::array pVecCharmBachelorAsD; + std::array pVecCascAsD{}; + std::array pVecCharmBachelorAsD{}; df.propagateTracksToVertex(); if (!df.isPropagateTracksToVertexDone()) { continue; @@ -982,7 +982,7 @@ struct HfCandidateCreatorXic0Omegac0 { auto primaryVertex = getPrimaryVertex(collision); std::array pvCoord = {collision.posX(), collision.posY(), collision.posZ()}; std::array vertexCharmBaryonFromFitter = {0.0, 0.0, 0.0}; // This variable get from DCAfitter in default process, in KF process it is set as 0. - std::array pVecCharmBachelorAsD; + std::array pVecCharmBachelorAsD{}; pVecCharmBachelorAsD[0] = kfBachPionToOmegaC.GetPx(); pVecCharmBachelorAsD[1] = kfBachPionToOmegaC.GetPy(); pVecCharmBachelorAsD[2] = kfBachPionToOmegaC.GetPz(); @@ -994,9 +994,9 @@ struct HfCandidateCreatorXic0Omegac0 { kfVertex.GetCovarianceMatrix(covMatrixPV); // impact parameters - std::array impactParameterV0Dau0; - std::array impactParameterV0Dau1; - std::array impactParameterKaFromCasc; + std::array impactParameterV0Dau0{}; + std::array impactParameterV0Dau1{}; + std::array impactParameterKaFromCasc{}; o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, trackParCovV0Dau0, 2.f, matCorr, &impactParameterV0Dau0); o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, trackParCovV0Dau1, 2.f, matCorr, &impactParameterV0Dau1); o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, omegaDauChargedTrackParCov, 2.f, matCorr, &impactParameterKaFromCasc); @@ -1465,7 +1465,7 @@ struct HfCandidateCreatorXic0Omegac0 { std::array pVecCascBachelor = {kfBachPionToXi.GetPx(), kfBachPionToXi.GetPy(), kfBachPionToXi.GetPz()}; std::array pvCoord = {collision.posX(), collision.posY(), collision.posZ()}; - std::array pVecCharmBachelorAsD; + std::array pVecCharmBachelorAsD{}; pVecCharmBachelorAsD[0] = kfCharmBachPionToXiC.GetPx(); pVecCharmBachelorAsD[1] = kfCharmBachPionToXiC.GetPy(); pVecCharmBachelorAsD[2] = kfCharmBachPionToXiC.GetPz(); @@ -1476,9 +1476,9 @@ struct HfCandidateCreatorXic0Omegac0 { kfVertex.GetCovarianceMatrix(covMatrixPV); // impact parameters - std::array impactParameterV0Dau0; - std::array impactParameterV0Dau1; - std::array impactParameterPiFromCasc; + std::array impactParameterV0Dau0{}; + std::array impactParameterV0Dau1{}; + std::array impactParameterPiFromCasc{}; o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, trackParCovV0Dau0, 2.f, matCorr, &impactParameterV0Dau0); o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, trackParCovV0Dau1, 2.f, matCorr, &impactParameterV0Dau1); o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, xiDauChargedTrackParCov, 2.f, matCorr, &impactParameterPiFromCasc); diff --git a/PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx b/PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx index f88a6d573c9..fb8e8e80fbe 100644 --- a/PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx +++ b/PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx @@ -110,7 +110,7 @@ struct HfCandidateCreatorXicToXiPiPi { Configurable rejDiffCollTrack{"rejDiffCollTrack", true, "Reject tracks coming from different collisions (effective only for KFParticle w/o derived data)"}; Service ccdb; - o2::base::MatLayerCylSet* lut; + o2::base::MatLayerCylSet* lut{}; o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT; o2::vertexing::DCAFitterN<3> df; @@ -302,9 +302,9 @@ struct HfCandidateCreatorXicToXiPiPi { trackCasc = df.getTrack(0); trackParCovCharmBachelor0 = df.getTrack(1); trackParCovCharmBachelor1 = df.getTrack(2); - std::array pVecXi; - std::array pVecPi0; - std::array pVecPi1; + std::array pVecXi{}; + std::array pVecPi0{}; + std::array pVecPi1{}; trackCasc.getPxPyPzGlo(pVecXi); trackParCovCharmBachelor0.getPxPyPzGlo(pVecPi0); trackParCovCharmBachelor1.getPxPyPzGlo(pVecPi1); @@ -918,7 +918,7 @@ struct HfCandidateCreatorXicToXiPiPiExpressions { // for resonance matching std::vector arrDaughIndex; constexpr std::size_t NDaughtersResonant{2u}; - std::array arrPDGDaugh; + std::array arrPDGDaugh{}; std::array arrXiResonance = {3324, kPiPlus}; // 3324: Ξ(1530) // for non-prompt std::vector idxBhadMothers; diff --git a/PWGHF/TableProducer/candidateCreatorXicc.cxx b/PWGHF/TableProducer/candidateCreatorXicc.cxx index 915d6501d6f..996454ec8f3 100644 --- a/PWGHF/TableProducer/candidateCreatorXicc.cxx +++ b/PWGHF/TableProducer/candidateCreatorXicc.cxx @@ -167,7 +167,7 @@ struct HfCandidateCreatorXicc { if (trackpion.globalIndex() == index0Xic || trackpion.globalIndex() == index1Xic || trackpion.globalIndex() == index2Xic) { continue; } - std::array pvecpion; + std::array pvecpion{}; auto trackParVarPi = getTrackParCov(trackpion); // reconstruct the 3-prong X vertex diff --git a/PWGHF/TableProducer/candidateSelectorLc.cxx b/PWGHF/TableProducer/candidateSelectorLc.cxx index 2b06decbec7..5103249ce32 100644 --- a/PWGHF/TableProducer/candidateSelectorLc.cxx +++ b/PWGHF/TableProducer/candidateSelectorLc.cxx @@ -123,7 +123,7 @@ struct HfCandidateSelectorLc { HistogramRegistry registry{"registry"}; - double massK0Star892; + double massK0Star892{}; void init(InitContext const&) { diff --git a/PWGHF/TableProducer/candidateSelectorLcPidMl.cxx b/PWGHF/TableProducer/candidateSelectorLcPidMl.cxx index 9a68436f861..0368f0666b3 100644 --- a/PWGHF/TableProducer/candidateSelectorLcPidMl.cxx +++ b/PWGHF/TableProducer/candidateSelectorLcPidMl.cxx @@ -93,7 +93,7 @@ struct HfCandidateSelectorLcPidMl { Configurable activateQA{"activateQA", false, "flag to enable QA histos"}; - int dataTypeML; + int dataTypeML{}; o2::ccdb::CcdbApi ccdbApi; OnnxModel model; TrackSelectorPi selectorPion; diff --git a/PWGHF/TableProducer/trackIndexSkimCreator.cxx b/PWGHF/TableProducer/trackIndexSkimCreator.cxx index dcd13a07c01..ce1c1d52f2b 100644 --- a/PWGHF/TableProducer/trackIndexSkimCreator.cxx +++ b/PWGHF/TableProducer/trackIndexSkimCreator.cxx @@ -318,9 +318,9 @@ struct HfTrackIndexSkimCreatorTagSelTracks { // Needed for PV refitting Service ccdb; - o2::base::MatLayerCylSet* lut; + o2::base::MatLayerCylSet* lut{}; o2::base::Propagator::MatCorrType noMatCorr = o2::base::Propagator::MatCorrType::USEMatCorrNONE; - int runNumber; + int runNumber{}; using TracksWithSelAndDca = soa::Join; using TracksWithSelAndDcaAndPidTpc = soa::Join; @@ -1263,9 +1263,9 @@ struct HfTrackIndexSkimCreator { o2::vertexing::DCAFitterN<3> df3; // 3-prong vertex fitter // Needed for PV refitting Service ccdb; - o2::base::MatLayerCylSet* lut; + o2::base::MatLayerCylSet* lut{}; o2::base::Propagator::MatCorrType noMatCorr = o2::base::Propagator::MatCorrType::USEMatCorrNONE; - int runNumber; + int runNumber{}; // int nColls{0}; //can be added to run over limited collisions per file - for tesing purposes @@ -3088,7 +3088,7 @@ struct HfTrackIndexSkimCreatorCascades { o2::vertexing::DCAFitterN<2> df2; // 2-prong vertex fitter // Needed for PV refitting Service ccdb; - o2::base::MatLayerCylSet* lut; + o2::base::MatLayerCylSet* lut{}; o2::base::Propagator::MatCorrType noMatCorr = o2::base::Propagator::MatCorrType::USEMatCorrNONE; o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT; int runNumber{0}; @@ -3351,9 +3351,9 @@ struct HfTrackIndexSkimCreatorLfCascades { o2::vertexing::DCAFitterN<2> df2; // 2-prong vertex fitter Service ccdb; - o2::base::MatLayerCylSet* lut; + o2::base::MatLayerCylSet* lut{}; o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT; - int runNumber; + int runNumber{}; // array of PDG masses of possible charm baryon daughters static constexpr int kN2ProngDecays = hf_cand_casc_lf::DecayType2Prong::N2ProngDecays; // number of 2-prong hadron types diff --git a/PWGHF/TableProducer/treeCreatorOmegacSt.cxx b/PWGHF/TableProducer/treeCreatorOmegacSt.cxx index 1bd4466893e..9a932badedb 100644 --- a/PWGHF/TableProducer/treeCreatorOmegacSt.cxx +++ b/PWGHF/TableProducer/treeCreatorOmegacSt.cxx @@ -532,7 +532,7 @@ struct HfTreeCreatorOmegacSt { hCandidatesPrPi->Fill(SVFitting::FitOk); std::array massesV0Daughters{o2::constants::physics::MassProton, o2::constants::physics::MassPiMinus}; - std::array, NDaughters> momentaV0Daughters; + std::array, NDaughters> momentaV0Daughters{}; o2::track::TrackPar trackParV0Pr = df2.getTrackParamAtPCA(0); trackParV0Pr.getPxPyPzGlo(momentaV0Daughters[0]); o2::track::TrackPar trackParV0Pi = df2.getTrackParamAtPCA(1); @@ -557,11 +557,11 @@ struct HfTreeCreatorOmegacSt { const auto decayLengthCascXY = RecoDecay::distanceXY(secondaryVertex, primaryVertexPos); o2::track::TrackPar trackParV0 = df2.getTrackParamAtPCA(0); o2::track::TrackPar trackParBachelor = df2.getTrackParamAtPCA(1); - std::array, NDaughters> momentaCascDaughters; + std::array, NDaughters> momentaCascDaughters{}; trackParV0.getPxPyPzGlo(momentaCascDaughters[0]); trackParBachelor.getPxPyPzGlo(momentaCascDaughters[1]); o2::track::TrackParCov trackParCovCascUntracked = df2.createParentTrackParCov(0); - std::array pCasc; + std::array pCasc{}; trackParCovCascUntracked.getPxPyPzGlo(pCasc); const auto cpaCasc = RecoDecay::cpa(primaryVertexPos, df2.getPCACandidate(), pCasc); const auto cpaXYCasc = RecoDecay::cpaXY(primaryVertexPos, df2.getPCACandidate(), pCasc); @@ -589,7 +589,7 @@ struct HfTreeCreatorOmegacSt { std::array massesOmegacToOmegaPi{o2::constants::physics::MassOmegaMinus, o2::constants::physics::MassPiPlus}; std::array massesOmegacToOmegaK{o2::constants::physics::MassOmegaMinus, o2::constants::physics::MassKPlus}; std::array massesXicDaughters{o2::constants::physics::MassXiMinus, o2::constants::physics::MassPiPlus}; - std::array, NDaughters> momenta; + std::array, NDaughters> momenta{}; auto trackParCovPr = getTrackParCov(v0TrackPr); auto trackParCovKa = getTrackParCov(v0TrackPi); @@ -653,7 +653,7 @@ struct HfTreeCreatorOmegacSt { const auto decayLength = RecoDecay::distance(secondaryVertex, primaryVertexPos); const auto decayLengthXY = RecoDecay::distanceXY(secondaryVertex, primaryVertexPos); const auto chi2TopCharmedBaryon = df2.getChi2AtPCACandidate(); - std::array pCharmedBaryon; + std::array pCharmedBaryon{}; df2.createParentTrackParCov().getPxPyPzGlo(pCharmedBaryon); const auto cpaCharmedBaryon = RecoDecay::cpa(primaryVertexPos, df2.getPCACandidate(), pCharmedBaryon); const auto cpaXYCharmedBaryon = RecoDecay::cpaXY(primaryVertexPos, df2.getPCACandidate(), pCharmedBaryon); @@ -890,7 +890,7 @@ struct HfTreeCreatorOmegacSt { if (std::abs(pdgCode) == kOmegaMinus) { LOG(debug) << "found Omega, looking for pions"; std::array masses{o2::constants::physics::MassOmegaMinus, o2::constants::physics::MassPiPlus}; - std::array, NDaughters> momenta; + std::array, NDaughters> momenta{}; std::array primaryVertexPos = {primaryVertex.getX(), primaryVertex.getY(), primaryVertex.getZ()}; const auto& mcColl = mother.mcCollision(); std::array primaryVertexPosGen = {mcColl.posX(), mcColl.posY(), mcColl.posZ()}; diff --git a/PWGHF/TableProducer/treeCreatorTccToD0D0Pi.cxx b/PWGHF/TableProducer/treeCreatorTccToD0D0Pi.cxx index a59713f4adf..1f74def620c 100644 --- a/PWGHF/TableProducer/treeCreatorTccToD0D0Pi.cxx +++ b/PWGHF/TableProducer/treeCreatorTccToD0D0Pi.cxx @@ -260,7 +260,7 @@ struct HfTreeCreatorTccToD0D0Pi { HfHelper hfHelper; Service ccdb; - o2::base::MatLayerCylSet* lut; + o2::base::MatLayerCylSet* lut{}; o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT; double bz{0.}; int runNumber{0}; diff --git a/PWGHF/Tasks/taskMcEfficiency.cxx b/PWGHF/Tasks/taskMcEfficiency.cxx index 6d58957c664..5f3bd42351b 100644 --- a/PWGHF/Tasks/taskMcEfficiency.cxx +++ b/PWGHF/Tasks/taskMcEfficiency.cxx @@ -136,7 +136,7 @@ struct HfTaskMcEfficiency { for (const auto pdgCode : pdgCodes) { /// loop on pdg codes auto decayType = -1; - std::array pdgDaughters; + std::array pdgDaughters{}; if (pdgCode == Pdg::kDPlus) { decayType = 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi; @@ -334,7 +334,7 @@ struct HfTaskMcEfficiency { for (const auto pdgCode : pdgCodes) { auto decayType = -1; - std::array pdgDaughters; + std::array pdgDaughters{}; if (pdgCode == Pdg::kD0) { decayType = 1 << aod::hf_cand_2prong::DecayType::D0ToPiK; @@ -577,7 +577,7 @@ struct HfTaskMcEfficiency { continue; } - std::array pdgDaughters; + std::array pdgDaughters{}; if (pdgCode == Pdg::kDPlus) { pdgDaughters[0] = +kPiPlus; pdgDaughters[1] = -kKPlus; diff --git a/PWGHF/Utils/utilsDerivedData.h b/PWGHF/Utils/utilsDerivedData.h index 4a08d37d535..ac7c10c8384 100644 --- a/PWGHF/Utils/utilsDerivedData.h +++ b/PWGHF/Utils/utilsDerivedData.h @@ -87,7 +87,7 @@ struct HfProducesDerivedData : o2::framework::ProducesGroup { o2::framework::Produces rowParticleBase; o2::framework::Produces rowParticleId; - HfConfigurableDerivedData const* conf; + HfConfigurableDerivedData const* conf{}; std::map> matchedCollisions; // indices of derived reconstructed collisions matched to the global indices of MC collisions std::map hasMcParticles; // flags for MC collisions with HF particles diff --git a/PWGHF/Utils/utilsMcGen.h b/PWGHF/Utils/utilsMcGen.h index 485b15de1af..094211e99db 100644 --- a/PWGHF/Utils/utilsMcGen.h +++ b/PWGHF/Utils/utilsMcGen.h @@ -147,7 +147,7 @@ void fillMcMatchGen3Prong(TMcParticles const& mcParticles, int8_t sign = 0; std::vector arrDaughIndex; std::vector idxBhadMothers{}; - std::array arrPdgDaugResonant; + std::array arrPdgDaugResonant{}; const std::array arrPdgDaugResonantLcToPKstar0{daughtersLcResonant.at(DecayChannelResonant::LcToPKstar0)}; // Λc± → p± K* const std::array arrPdgDaugResonantLcToDeltaplusplusK{daughtersLcResonant.at(DecayChannelResonant::LcToDeltaplusplusK)}; // Λc± → Δ(1232)±± K∓ const std::array arrPdgDaugResonantLcToL1520Pi{daughtersLcResonant.at(DecayChannelResonant::LcToL1520Pi)}; // Λc± → Λ(1520) π± From cf5e5a7d9c149de1f06e8c548d06d6316452fc22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Fri, 26 Sep 2025 18:00:51 +0200 Subject: [PATCH 04/25] Fix const --- PWGHF/Core/SelectorCuts.h | 62 +++++++++---------- PWGHF/D2H/Core/SelectorCutsRedDataFormat.h | 4 +- PWGHF/D2H/Tasks/taskXicToXiPiPi.cxx | 4 +- PWGHF/HFC/TableProducer/correlatorD0D0bar.cxx | 2 +- .../correlatorD0D0barBarrelFullPid.cxx | 2 +- .../TableProducer/correlatorDplusDminus.cxx | 2 +- .../TableProducer/correlatorDplusHadrons.cxx | 2 +- .../TableProducer/correlatorDstarHadrons.cxx | 10 +-- .../TableProducer/correlatorHfeHadrons.cxx | 9 +-- .../TableProducer/correlatorLcScHadrons.cxx | 28 ++++----- PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx | 16 ++--- PWGHF/HFC/Tasks/taskCorrelationDDbar.cxx | 16 ++--- .../HFC/Tasks/taskCorrelationDplusHadrons.cxx | 16 ++--- PWGHF/HFC/Tasks/taskCorrelationDsHadrons.cxx | 16 ++--- .../HFC/Tasks/taskCorrelationDstarHadrons.cxx | 16 ++--- PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx | 14 ++--- PWGHF/HFL/Tasks/taskSingleElectron.cxx | 20 +++--- PWGHF/TableProducer/treeCreatorOmegacSt.cxx | 20 +++--- PWGHF/Utils/utilsTrkCandHf.h | 2 +- 19 files changed, 131 insertions(+), 130 deletions(-) diff --git a/PWGHF/Core/SelectorCuts.h b/PWGHF/Core/SelectorCuts.h index a3df78aee0f..d4c09c83d87 100644 --- a/PWGHF/Core/SelectorCuts.h +++ b/PWGHF/Core/SelectorCuts.h @@ -40,7 +40,7 @@ constexpr double BinsPtTrack[NBinsPtTrack + 1] = { 2.0, 3.0, 1000.0}; -auto vecBinsPtTrack = std::vector{BinsPtTrack, BinsPtTrack + NBinsPtTrack + 1}; +auto const vecBinsPtTrack = std::vector{BinsPtTrack, BinsPtTrack + NBinsPtTrack + 1}; // default values for the dca_xy and dca_z cuts of displaced tracks constexpr double CutsTrack[NBinsPtTrack][NCutVarsTrack] = {{0.0000, 10., 0.0000, 100.}, /* 0 < pt < 0.5 */ @@ -86,7 +86,7 @@ static constexpr int NCutBdtScores = 3; constexpr double BinsPt[NBinsPt + 1] = { 0., 1000.0}; -auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; +const auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; // default values for the cuts constexpr double Cuts[NBinsPt][NCutBdtScores] = {{0.1, 0.5, 0.5}}; @@ -134,7 +134,7 @@ constexpr double BinsPt[NBinsPt + 1] = { 16., 24., 50.}; -auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; +const auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; // default values for the ML model paths, one model per pT bin static const std::vector modelPaths = { @@ -142,7 +142,7 @@ static const std::vector modelPaths = { // default values for the cut directions constexpr int CutDir[NCutScores] = {CutGreater, CutSmaller, CutSmaller}; -auto vecCutDir = std::vector{CutDir, CutDir + NCutScores}; +const auto vecCutDir = std::vector{CutDir, CutDir + NCutScores}; // default values for the cuts constexpr double Cuts[NBinsPt][NCutScores] = { @@ -190,7 +190,7 @@ constexpr double BinsPt[NBinsPt + 1] = { 1., 5., 1000.0}; -auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; +const auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; // default values for the cuts constexpr double Cuts[NBinsPt][NCutVars] = {{1.65, 2.15, 0.5, 100.}, /* 1 < pt < 5 */ @@ -214,7 +214,7 @@ constexpr double BinsPt[NBinsPt + 1] = { 1., 5., 1000.0}; -auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; +const auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; // default values for the cuts constexpr double Cuts[NBinsPt][NCutVars] = {{1.75, 2.05, 0.7, 0.02}, /* 1 < pt < 5 */ @@ -237,7 +237,7 @@ constexpr double BinsPt[NBinsPt + 1] = { 1., 5., 1000.0}; -auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; +const auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; // default values for the cuts constexpr double Cuts[NBinsPt][NCutVars] = {{1.70, 2.15, 0.7, 0.02, 0.02}, /* 1 < pt < 5 */ @@ -260,7 +260,7 @@ constexpr double BinsPt[NBinsPt + 1] = { 1., 5., 1000.0}; -auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; +const auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; // default values for the cuts constexpr double Cuts[NBinsPt][NCutVars] = {{0.17, 0.05}, /* 1 < pt < 5 */ @@ -306,7 +306,7 @@ constexpr double BinsPt[NBinsPt + 1] = { 36.0, 50.0, 100.0}; -auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; +const auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; // default values for the cuts constexpr double Cuts[NBinsPt][NCutVars] = {{0.400, 350. * 1E-4, 0.8, 0.5, 0.5, 1000. * 1E-4, 1000. * 1E-4, -5000. * 1E-8, 0.80, 0., 0., 10., 10., 0.06, 0.5}, /* 0 < pT < 0.5 */ @@ -400,7 +400,7 @@ constexpr double BinsPt[NBinsPt + 1] = { 36.0, 50.0, 100.0}; -auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; +const auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; // row labels static const std::vector labelsPt = { @@ -480,7 +480,7 @@ constexpr double BinsPt[NBinsPt + 1] = { 12., 24., 36.}; -auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; +const auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; // default values for the cuts m, ptP, ptK, ptPi, chi2PCA, dL, cosp, dLXY, NdLXY, ImpParXY, mass(Kpi) constexpr double Cuts[NBinsPt][NCutVars] = {{0.4, 0.4, 0.4, 0.4, 0., 0.005, 0., 0., 0., 1e+10, -1.}, /* 0 < pT < 1 */ @@ -541,7 +541,7 @@ constexpr double BinsPt[NBinsPt + 1] = { 8., 12., 24.}; -auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; +const auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; // default values for the cuts // mLc(GeV) mK0s(GeV) mLambdas(GeV) mGammas(GeV) ptp ptK0sdau ptK0s d0p d0K0 @@ -589,7 +589,7 @@ constexpr double BinsPt[NBinsPt + 1] = { 16., 24., 36.}; -auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; +const auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; // default values for the cuts // selections from pp at 5 TeV 2017 analysis https://alice-notes.web.cern.ch/node/808 @@ -640,7 +640,7 @@ constexpr double BinsPt[NBinsPt + 1] = { 12., 16., 24.}; -auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; +const auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; // default values for the cuts // selections from pp at 5 TeV 2017 analysis https://alice-notes.web.cern.ch/node/808 @@ -682,7 +682,7 @@ constexpr double BinsPt[NBinsPt + 1] = { 6.0, 12.0}; -auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; +const auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; // default values for the cuts // pi_pT @@ -716,7 +716,7 @@ constexpr double BinsPt[NBinsPt + 1] = { 6.0, 12.0}; -auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; +const auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; // default values for the cuts // pi_pT @@ -756,7 +756,7 @@ constexpr double BinsPt[NBinsPt + 1] = { 16.0, 24.0}; -auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; +const auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; // default values for the cuts constexpr double Cuts[NBinsPt][NCutVars] = {{0.2, 0.99, 0.97, 0.99, 0.99, 0.1, 0.2, 1.0, 0.04, 0.06, 0.06, 0.05, 0.3, 70, 60, 100, 120, 250, 250, 0.4, 100, 300, 0., 0., 1.5, 0., 0., 0.4}, /* 0 < pt < 1 */ @@ -811,7 +811,7 @@ constexpr double BinsPt[NBinsPt + 1] = { 12., 24., 36.}; -auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; +const auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; // default values for the cuts m ptP ptK ptPi chi2PCA dL cosp, dLXY, NdL, ct, ImpParXY constexpr double Cuts[NBinsPt][NCutVars] = {{0.400, 0.4, 0.4, 0.4, 1e-5, 0.005, 0.8, 0.005, 4., 2., 0.}, /* 0 < pT < 1 */ @@ -863,7 +863,7 @@ constexpr double BinsPt[NBinsPt + 1] = { 11., 12., 20.}; -auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; +const auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; // default values for the cuts m Y Eta EtaPi EtaXi pT Pi0 Pi1 Sum chi2SV dL dLXY invMass Xi-Pi pairs constexpr double Cuts[NBinsPt][NCutVars] = {{0.4, 0.8, 0.8, 0.8, 1.0, 0.1, 0.1, 0.2, 100, 0.0, 0.0, 2.4, 2.4}, /* 0 < pT < 1 */ @@ -918,7 +918,7 @@ constexpr double BinsPt[NBinsPt + 1] = { 12., 24., 36.}; -auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; +const auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; // default values for the cuts constexpr double Cuts[NBinsPt][NCutVars] = {{0.400, 0.5, 0.2, 1.e-3, 10.0, 1.e-3, 10.0, 9999., 1.e-3, 0.0, 50.0, 50.0, 0.8, 0.8}, /* 0 < pT < 1 */ @@ -967,7 +967,7 @@ constexpr double BinsPt[NBinsPt + 1] = { 10.0, 15.0, }; -auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; +const auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; // default values for the cuts constexpr double Cuts[NBinsPt][NCutVars] = {{0.5, 0.2, 0.4, 1, 1.}, /* 0 < pT < 0.5 */ @@ -1014,7 +1014,7 @@ constexpr double BinsPt[NBinsPt + 1] = { 10.0, 16.0, }; -auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; +const auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; // default values for the cuts constexpr double Cuts[NBinsPt][NCutVars] = {{0.6, 1.0, 0.2, 0.2, 0.9, 0.9, 0., 0.}, /* 0 < pT < 0.5 */ @@ -1064,7 +1064,7 @@ constexpr double BinsPt[NBinsPt + 1] = { 20.0, 24.0}; -auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; +const auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; // default values for the cuts // DeltaM CPA chi2PCA d0D d0Pi pTD pTPi B0DecayLength B0DecayLengthXY IPProd DeltaMD CthetaStr @@ -1118,7 +1118,7 @@ constexpr double BinsPt[NBinsPt + 1] = { 16.0, 24.0}; -auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; +const auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; // default values for the cuts // DeltaM CPA chi2PCA d0Ds d0Pi pTDs pTPi BsDecayLength BsDecayLengthXY IPProd @@ -1171,7 +1171,7 @@ constexpr double BinsPt[NBinsPt + 1] = { 20.0, 24.0}; -auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; +const auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; // default values for the cuts // DeltaM CPA d0Jpsi d0K pTJpsi pTK BDecayLength BDecayLengthXY BIPProd DeltaMJpsi JpsiIPProd @@ -1227,7 +1227,7 @@ constexpr double BinsPt[NBinsPt + 1] = { 20.0, 24.0}; -auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; +const auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; // default values for the cuts // DeltaM CPA d0D0 d0Pi pTD0 pTPi BDecayLength BDecayLengthXY IPProd DeltaMD0 CthetaStr @@ -1283,7 +1283,7 @@ constexpr double BinsPt[NBinsPt + 1] = { 20.0, 24.0}; -auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; +const auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; // default values for the cuts // DeltaM CPA d0Jpsi d0K pTJpsi pTK BDecayLength BDecayLengthXY BIPProd DeltaMJpsi JpsiIPProd @@ -1339,7 +1339,7 @@ constexpr double BinsPt[NBinsPt + 1] = { 20.0, 24.0}; -auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; +const auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; // default values for the cuts // DeltaM CPA chi2PCA d0Lc d0Pi pTLc pTPi LbDecayLength LbDecayLengthXY IPProd DeltaMLc CthetaStr @@ -1392,7 +1392,7 @@ constexpr double BinsPt[NBinsPt + 1] = { 10.0, 15.0, }; -auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; +const auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; // default values for the cuts // m CPA d0Jpsi d0Pi pTJpsi pTPi chi2PCA @@ -1439,7 +1439,7 @@ constexpr double BinsPt[NBinsPt + 1] = { 10.0, 15.0, }; -auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; +const auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; // default values for the cuts // m CPA d0Jpsi d0gamma pTJpsi pTgamma chi2PCA @@ -1485,7 +1485,7 @@ constexpr double BinsPt[NBinsPt + 1] = { 12., 24., 36.}; -auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; +const auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; // default values for the cuts constexpr double Cuts[NBinsPt][NCutVars] = {{0.03, 0.03}, /* 0 < pT < 1 */ diff --git a/PWGHF/D2H/Core/SelectorCutsRedDataFormat.h b/PWGHF/D2H/Core/SelectorCutsRedDataFormat.h index 4373ded905c..c18fcf61290 100644 --- a/PWGHF/D2H/Core/SelectorCutsRedDataFormat.h +++ b/PWGHF/D2H/Core/SelectorCutsRedDataFormat.h @@ -37,7 +37,7 @@ constexpr double BinsPt[NBinsPt + 1] = { 12., 24., 1000.}; -auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; +const auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; // default values for the cuts constexpr double Cuts[NBinsPt][NCutVars] = {{1.84, 1.89, 1.77, 1.81, 1.92, 1.96}, /* 1 < pt < 2 */ {1.84, 1.89, 1.77, 1.81, 1.92, 1.96}, /* 2 < pt < 4 */ @@ -73,7 +73,7 @@ constexpr double BinsPt[NBinsPt + 1] = { 12., 24., 1000.}; -auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; +const auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; // default values for the cuts constexpr double Cuts[NBinsPt][NCutVars] = {{0.48, 0.52, 0.99, 1., 0.9}, /* 1 < pt < 2 */ {0.48, 0.52, 0.99, 1., 0.9}, /* 2 < pt < 4 */ diff --git a/PWGHF/D2H/Tasks/taskXicToXiPiPi.cxx b/PWGHF/D2H/Tasks/taskXicToXiPiPi.cxx index 1c5a0856daf..9708066f9ec 100644 --- a/PWGHF/D2H/Tasks/taskXicToXiPiPi.cxx +++ b/PWGHF/D2H/Tasks/taskXicToXiPiPi.cxx @@ -67,7 +67,7 @@ struct HfTaskXicToXiPiPi { // THnSparese for ML selection check Configurable enableTHn{"enableTHn", false, "Fill THnSparse for Xic"}; - const int nVarsMultiClass = 3; + static constexpr int NVarsMultiClass{3}; Service pdg; @@ -302,7 +302,7 @@ struct HfTaskXicToXiPiPi { if (scoreSize > 0) { outputBkg = candidate.mlProbXicToXiPiPi()[0]; outputPrompt = candidate.mlProbXicToXiPiPi()[1]; - if (scoreSize == nVarsMultiClass) { + if (scoreSize == NVarsMultiClass) { outputFD = candidate.mlProbXicToXiPiPi()[2]; } } diff --git a/PWGHF/HFC/TableProducer/correlatorD0D0bar.cxx b/PWGHF/HFC/TableProducer/correlatorD0D0bar.cxx index a2ed89ce8d9..d3d73c4c374 100644 --- a/PWGHF/HFC/TableProducer/correlatorD0D0bar.cxx +++ b/PWGHF/HFC/TableProducer/correlatorD0D0bar.cxx @@ -64,7 +64,7 @@ const double epsilon = 1E-5; const int npTBinsMassAndEfficiency = o2::analysis::hf_cuts_d0_to_pi_k::NBinsPt; const double efficiencyDmesonDefault[npTBinsMassAndEfficiency] = {}; -auto efficiencyDmeson_v = std::vector{efficiencyDmesonDefault, efficiencyDmesonDefault + npTBinsMassAndEfficiency}; +const auto efficiencyDmeson_v = std::vector{efficiencyDmesonDefault, efficiencyDmesonDefault + npTBinsMassAndEfficiency}; // histogram binning definition const int massAxisBins = 120; diff --git a/PWGHF/HFC/TableProducer/correlatorD0D0barBarrelFullPid.cxx b/PWGHF/HFC/TableProducer/correlatorD0D0barBarrelFullPid.cxx index 8fa93dc0d63..8257611a6c1 100644 --- a/PWGHF/HFC/TableProducer/correlatorD0D0barBarrelFullPid.cxx +++ b/PWGHF/HFC/TableProducer/correlatorD0D0barBarrelFullPid.cxx @@ -64,7 +64,7 @@ const double epsilon = 1E-5; const int npTBinsMassAndEfficiency = o2::analysis::hf_cuts_d0_to_pi_k::NBinsPt; const double efficiencyDmesonDefault[npTBinsMassAndEfficiency] = {}; -auto efficiencyDmeson_v = std::vector{efficiencyDmesonDefault, efficiencyDmesonDefault + npTBinsMassAndEfficiency}; +const auto efficiencyDmeson_v = std::vector{efficiencyDmesonDefault, efficiencyDmesonDefault + npTBinsMassAndEfficiency}; // histogram binning definition const int massAxisBins = 120; diff --git a/PWGHF/HFC/TableProducer/correlatorDplusDminus.cxx b/PWGHF/HFC/TableProducer/correlatorDplusDminus.cxx index e4c2e0fe6bb..ecba4be2e53 100644 --- a/PWGHF/HFC/TableProducer/correlatorDplusDminus.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDplusDminus.cxx @@ -64,7 +64,7 @@ const double epsilon = 1E-5; const int npTBinsMassAndEfficiency = o2::analysis::hf_cuts_dplus_to_pi_k_pi::NBinsPt; const double efficiencyDmesonDefault[npTBinsMassAndEfficiency] = {}; -auto efficiencyDmeson_v = std::vector{efficiencyDmesonDefault, efficiencyDmesonDefault + npTBinsMassAndEfficiency}; +const auto efficiencyDmeson_v = std::vector{efficiencyDmesonDefault, efficiencyDmesonDefault + npTBinsMassAndEfficiency}; // histogram binning definition const int massAxisBins = 120; diff --git a/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx index ef9de41f28a..84249778c6c 100644 --- a/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx @@ -65,7 +65,7 @@ double getDeltaPhi(double phiD, double phiHadron) /// definition of variables for Dplus hadron pairs (in data-like, MC-reco and MC-kine tasks) const int npTBinsMassAndEfficiency = o2::analysis::hf_cuts_dplus_to_pi_k_pi::NBinsPt; -std::vector efficiencyDmeson(npTBinsMassAndEfficiency + 1); +const std::vector efficiencyDmeson(npTBinsMassAndEfficiency + 1); // definition of ME variables using BinningType = ColumnBinningPolicy>; diff --git a/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx index 0f8d95ccd0c..ede08bbbf6a 100644 --- a/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx @@ -52,19 +52,19 @@ using namespace o2::framework::expressions; const int nBinsPtCorrelation = 8; const double binsPtCorrelationsDefault[nBinsPtCorrelation + 1] = {0., 2., 4., 6., 8., 12., 16., 24., 100.}; -auto vecBinsPtCorrelationsDefault = std::vector{binsPtCorrelationsDefault, binsPtCorrelationsDefault + nBinsPtCorrelation + 1}; +const auto vecBinsPtCorrelationsDefault = std::vector{binsPtCorrelationsDefault, binsPtCorrelationsDefault + nBinsPtCorrelation + 1}; const double signalRegionLefBoundDefault[nBinsPtCorrelation] = {0.144, 0.144, 0.144, 0.144, 0.144, 0.144, 0.144, 0.144}; -auto vecSignalRegionLefBoundDefault = std::vector{signalRegionLefBoundDefault, signalRegionLefBoundDefault + nBinsPtCorrelation}; +const auto vecSignalRegionLefBoundDefault = std::vector{signalRegionLefBoundDefault, signalRegionLefBoundDefault + nBinsPtCorrelation}; const double signalRegionRightBoundDefault[nBinsPtCorrelation] = {0.146, 0.146, 0.146, 0.146, 0.146, 0.146, 0.146, 0.146}; -auto vecSignalRegionRightBoundDefault = std::vector{signalRegionRightBoundDefault, signalRegionRightBoundDefault + nBinsPtCorrelation}; +const auto vecSignalRegionRightBoundDefault = std::vector{signalRegionRightBoundDefault, signalRegionRightBoundDefault + nBinsPtCorrelation}; const double sidebandRightInnerDefault[nBinsPtCorrelation] = {0.147, 0.147, 0.147, 0.147, 0.147, 0.147, 0.147, 0.147}; -auto vecSidebandRightInnerDefault = std::vector{sidebandRightInnerDefault, sidebandRightInnerDefault + nBinsPtCorrelation}; +const auto vecSidebandRightInnerDefault = std::vector{sidebandRightInnerDefault, sidebandRightInnerDefault + nBinsPtCorrelation}; const double sidebandRightOuterDefault[nBinsPtCorrelation] = {0.154, 0.154, 0.154, 0.154, 0.154, 0.154, 0.154, 0.154}; -auto vecSidebandRightOuterDefault = std::vector{sidebandRightOuterDefault, sidebandRightOuterDefault + nBinsPtCorrelation}; +const auto vecSidebandRightOuterDefault = std::vector{sidebandRightOuterDefault, sidebandRightOuterDefault + nBinsPtCorrelation}; // flaging a collision if D* meson is found. struct HfCorrelatorDstarHadronsCollisionSelector { diff --git a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx index 8b3b8186e8a..060e961f5ee 100644 --- a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx @@ -47,11 +47,12 @@ using namespace o2::framework::expressions; using namespace o2::soa; using namespace o2::aod::hf_sel_electron; -std::vector zBins{VARIABLE_WIDTH, -10.0, -2.5, 2.5, 10.0}; -std::vector multBins{VARIABLE_WIDTH, 0., 200., 500.0, 5000.}; -std::vector multBinsMcGen{VARIABLE_WIDTH, 0., 20., 50.0, 500.}; // In MCGen multiplicity is defined by counting primaries +const std::vector zBins{VARIABLE_WIDTH, -10.0, -2.5, 2.5, 10.0}; +const std::vector multBins{VARIABLE_WIDTH, 0., 200., 500.0, 5000.}; +const std::vector multBinsMcGen{VARIABLE_WIDTH, 0., 20., 50.0, 500.}; // In MCGen multiplicity is defined by counting primaries using BinningType = ColumnBinningPolicy>; -BinningType corrBinning{{zBins, multBins}, true}; +const BinningType corrBinning{{zBins, multBins}, true}; + using BinningTypeMcGen = ColumnBinningPolicy; struct HfCorrelatorHfeHadrons { diff --git a/PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx index a7f0d4846d2..595080e1c79 100644 --- a/PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx @@ -300,9 +300,9 @@ struct HfCorrelatorLcScHadrons { bool isPrompt = false; bool isNonPrompt = false; bool isSignal = false; - const int8_t chargeScPlusPlus = 2; - const int8_t chargeZero = 0; - const int8_t assignedChargeSc0 = 1; // to distingush sc0 from anti-sc0, charge set to +1 and -1 + static constexpr int8_t ChargeScPlusPlus{2}; + static constexpr int8_t ChargeZero{0}; + static constexpr int8_t AssignedChargeSc0{1}; // to distinguish sc0 from anti-sc0, charge set to +1 and -1 TRandom3* rnd = new TRandom3(0); // std::vector outputMl = {-1., -1., -1.}; @@ -458,7 +458,7 @@ struct HfCorrelatorLcScHadrons { if constexpr (isCandSc) { int8_t chargeCand = candidate.charge(); - if (chargeCand == chargeZero) { + if (chargeCand == ChargeZero) { y = hfHelper.ySc0(candidate); } else { y = hfHelper.yScPlusPlus(candidate); @@ -805,8 +805,8 @@ struct HfCorrelatorLcScHadrons { // (TESTBIT(std::abs(candidate.flagMcMatchRec()), aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi) && chargeCand == 0) || // (TESTBIT(std::abs(candidate.flagMcMatchRec()), aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi) && std::abs(chargeCand) == 2); isSignal = - (std::abs(candidate.flagMcMatchRec()) == (1 << aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi) && chargeCand == chargeZero) || - (std::abs(candidate.flagMcMatchRec()) == (1 << aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi) && std::abs(chargeCand) == chargeScPlusPlus); + (std::abs(candidate.flagMcMatchRec()) == (1 << aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi) && chargeCand == ChargeZero) || + (std::abs(candidate.flagMcMatchRec()) == (1 << aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi) && std::abs(chargeCand) == ChargeScPlusPlus); auto trackPos1 = candidateLc.template prong0_as(); auto trackPos2 = candidateLc.template prong2_as(); @@ -821,8 +821,8 @@ struct HfCorrelatorLcScHadrons { } registry.fill(HIST("hPtProng0"), ptCandLc); - if (chargeCand == chargeZero) { - chargeCand = (signSoftPion < chargeZero) ? assignedChargeSc0 : -assignedChargeSc0; // to distingush sc0 from anti-sc0, charge set to +1 and -1 + if (chargeCand == ChargeZero) { + chargeCand = (signSoftPion < ChargeZero) ? AssignedChargeSc0 : -AssignedChargeSc0; // to distingush sc0 from anti-sc0, charge set to +1 and -1 } } else { @@ -1029,14 +1029,14 @@ struct HfCorrelatorLcScHadrons { } if constexpr (isMcRec) { isSignal = - (TESTBIT(std::abs(candidate.flagMcMatchRec()), aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi) && chargeCand == chargeZero) || - (TESTBIT(std::abs(candidate.flagMcMatchRec()), aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi) && std::abs(chargeCand) == chargeScPlusPlus); + (TESTBIT(std::abs(candidate.flagMcMatchRec()), aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi) && chargeCand == ChargeZero) || + (TESTBIT(std::abs(candidate.flagMcMatchRec()), aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi) && std::abs(chargeCand) == ChargeScPlusPlus); signSoftPion = candidate.template prong1_as().sign(); } else { signSoftPion = candidate.template prong1_as().sign(); } - if (chargeCand == chargeZero) { - chargeCand = (signSoftPion < chargeZero) ? assignedChargeSc0 : -assignedChargeSc0; // to distingush sc0 from anti-sc0, charge set to +1 and -1 + if (chargeCand == ChargeZero) { + chargeCand = (signSoftPion < ChargeZero) ? AssignedChargeSc0 : -AssignedChargeSc0; // to distingush sc0 from anti-sc0, charge set to +1 and -1 } } else { selLcPKPi = candidate.isSelLcToPKPi() >= selectionFlagLc; @@ -1132,8 +1132,8 @@ struct HfCorrelatorLcScHadrons { registry.fill(HIST("hYMcGen"), yCand); int8_t chargeCand = pdg->GetParticle(particle.pdgCode())->Charge() / PDGChargeScale; // Retrieve charge - if (chargeCand == chargeZero) { - chargeCand = (particle.pdgCode() > chargeZero) ? assignedChargeSc0 : -assignedChargeSc0; // to distingush sc0 from anti-sc0, charge set to +1 and -1 + if (chargeCand == ChargeZero) { + chargeCand = (particle.pdgCode() > ChargeZero) ? AssignedChargeSc0 : -AssignedChargeSc0; // to distingush sc0 from anti-sc0, charge set to +1 and -1 } isPrompt = particle.originMcGen() == RecoDecay::OriginType::Prompt; diff --git a/PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx index bea1510a24b..94103939e5a 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx @@ -62,22 +62,22 @@ using namespace o2::analysis::hf_correlations; // definition of vectors for standard ptbin and invariant mass configurables const int nPtBinsCorrelations = 12; const double pTBinsCorrelations[nPtBinsCorrelations + 1] = {0., 1., 2., 3., 4., 5., 6., 7., 8., 12., 16., 24., 99.}; -auto vecPtBinsCorrelations = std::vector{pTBinsCorrelations, pTBinsCorrelations + nPtBinsCorrelations + 1}; +const auto vecPtBinsCorrelations = std::vector{pTBinsCorrelations, pTBinsCorrelations + nPtBinsCorrelations + 1}; const double signalRegionLeftDefault[nPtBinsCorrelations] = {1.7948, 1.8198, 1.8198, 1.8148, 1.8148, 1.8048, 1.8048, 1.7948, 1.7948, 1.7898, 1.7848, 1.7598}; const double signalRegionRightDefault[nPtBinsCorrelations] = {1.9098, 1.8998, 1.9048, 1.9048, 1.9148, 1.9248, 1.9298, 1.9348, 1.9398, 1.9298, 1.9398, 1.9198}; const double sidebandLeftInnerDefault[nPtBinsCorrelations] = {1.7398, 1.7748, 1.7798, 1.7698, 1.7648, 1.7448, 1.7448, 1.7198, 1.7198, 1.7198, 1.7048, 1.6798}; const double sidebandLeftOuterDefault[nPtBinsCorrelations] = {1.6298, 1.6898, 1.6948, 1.6748, 1.6648, 1.6248, 1.6198, 1.5748, 1.5748, 1.5798, 1.5448, 1.5198}; const double sidebandRightInnerDefault[nPtBinsCorrelations] = {1.9648, 1.9448, 1.9448, 1.9548, 1.9648, 1.9848, 1.9948, 2.0098, 2.0148, 1.9998, 2.0248, 1.9998}; const double sidebandRightOuterDefault[nPtBinsCorrelations] = {2.0748, 2.0248, 2.0298, 2.0448, 2.0648, 2.1048, 2.1148, 2.1548, 2.1648, 2.1398, 2.1848, 2.1598}; -auto vecsignalRegionLeft = std::vector{signalRegionLeftDefault, signalRegionLeftDefault + nPtBinsCorrelations}; -auto vecsignalRegionRight = std::vector{signalRegionRightDefault, signalRegionRightDefault + nPtBinsCorrelations}; -auto vecSidebandLeftInner = std::vector{sidebandLeftInnerDefault, sidebandLeftInnerDefault + nPtBinsCorrelations}; -auto vecSidebandLeftOuter = std::vector{sidebandLeftOuterDefault, sidebandLeftOuterDefault + nPtBinsCorrelations}; -auto vecSidebandRightInner = std::vector{sidebandRightInnerDefault, sidebandRightInnerDefault + nPtBinsCorrelations}; -auto vecSidebandRightOuter = std::vector{sidebandRightOuterDefault, sidebandRightOuterDefault + nPtBinsCorrelations}; +const auto vecsignalRegionLeft = std::vector{signalRegionLeftDefault, signalRegionLeftDefault + nPtBinsCorrelations}; +const auto vecsignalRegionRight = std::vector{signalRegionRightDefault, signalRegionRightDefault + nPtBinsCorrelations}; +const auto vecSidebandLeftInner = std::vector{sidebandLeftInnerDefault, sidebandLeftInnerDefault + nPtBinsCorrelations}; +const auto vecSidebandLeftOuter = std::vector{sidebandLeftOuterDefault, sidebandLeftOuterDefault + nPtBinsCorrelations}; +const auto vecSidebandRightInner = std::vector{sidebandRightInnerDefault, sidebandRightInnerDefault + nPtBinsCorrelations}; +const auto vecSidebandRightOuter = std::vector{sidebandRightOuterDefault, sidebandRightOuterDefault + nPtBinsCorrelations}; const int nPtbinsPtEfficiencyD = o2::analysis::hf_cuts_d0_to_pi_k::NBinsPt; const double efficiencyDmesonDefault[nPtbinsPtEfficiencyD] = {}; -auto vecEfficiencyDmeson = std::vector{efficiencyDmesonDefault, efficiencyDmesonDefault + nPtbinsPtEfficiencyD}; +const auto vecEfficiencyDmeson = std::vector{efficiencyDmesonDefault, efficiencyDmesonDefault + nPtbinsPtEfficiencyD}; struct HfTaskCorrelationD0Hadrons { diff --git a/PWGHF/HFC/Tasks/taskCorrelationDDbar.cxx b/PWGHF/HFC/Tasks/taskCorrelationDDbar.cxx index 21321f51f21..3d8aacdcc4e 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationDDbar.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationDDbar.cxx @@ -76,22 +76,22 @@ const TString stringMCReco = "MC reco - D,Dbar candidates "; // definition of vectors for standard ptbin and invariant mass configurables const int npTBinsCorrelations = 8; const double pTBinsCorrelations[npTBinsCorrelations + 1] = {0., 2., 4., 6., 8., 12., 16., 24., 99.}; -auto pTBinsCorrelations_v = std::vector{pTBinsCorrelations, pTBinsCorrelations + npTBinsCorrelations + 1}; +const auto pTBinsCorrelations_v = std::vector{pTBinsCorrelations, pTBinsCorrelations + npTBinsCorrelations + 1}; const double signalRegionInnerDefault[npTBinsCorrelations] = {1.810, 1.810, 1.810, 1.810, 1.810, 1.810, 1.810, 1.810}; const double signalRegionOuterDefault[npTBinsCorrelations] = {1.922, 1.922, 1.922, 1.922, 1.922, 1.922, 1.922, 1.922}; const double sidebandLeftInnerDefault[npTBinsCorrelations] = {1.642, 1.642, 1.642, 1.642, 1.642, 1.642, 1.642, 1.642}; const double sidebandLeftOuterDefault[npTBinsCorrelations] = {1.754, 1.754, 1.754, 1.754, 1.754, 1.754, 1.754, 1.754}; const double sidebandRightInnerDefault[npTBinsCorrelations] = {1.978, 1.978, 1.978, 1.978, 1.978, 1.978, 1.978, 1.978}; const double sidebandRightOuterDefault[npTBinsCorrelations] = {2.090, 2.090, 2.090, 2.090, 2.090, 2.090, 2.090, 2.090}; -auto signalRegionInner_v = std::vector{signalRegionInnerDefault, signalRegionInnerDefault + npTBinsCorrelations}; -auto signalRegionOuter_v = std::vector{signalRegionOuterDefault, signalRegionOuterDefault + npTBinsCorrelations}; -auto sidebandLeftInner_v = std::vector{sidebandLeftInnerDefault, sidebandLeftInnerDefault + npTBinsCorrelations}; -auto sidebandLeftOuter_v = std::vector{sidebandLeftOuterDefault, sidebandLeftOuterDefault + npTBinsCorrelations}; -auto sidebandRightInner_v = std::vector{sidebandRightInnerDefault, sidebandRightInnerDefault + npTBinsCorrelations}; -auto sidebandRightOuter_v = std::vector{sidebandRightOuterDefault, sidebandRightOuterDefault + npTBinsCorrelations}; +const auto signalRegionInner_v = std::vector{signalRegionInnerDefault, signalRegionInnerDefault + npTBinsCorrelations}; +const auto signalRegionOuter_v = std::vector{signalRegionOuterDefault, signalRegionOuterDefault + npTBinsCorrelations}; +const auto sidebandLeftInner_v = std::vector{sidebandLeftInnerDefault, sidebandLeftInnerDefault + npTBinsCorrelations}; +const auto sidebandLeftOuter_v = std::vector{sidebandLeftOuterDefault, sidebandLeftOuterDefault + npTBinsCorrelations}; +const auto sidebandRightInner_v = std::vector{sidebandRightInnerDefault, sidebandRightInnerDefault + npTBinsCorrelations}; +const auto sidebandRightOuter_v = std::vector{sidebandRightOuterDefault, sidebandRightOuterDefault + npTBinsCorrelations}; const int npTBinsEfficiency = o2::analysis::hf_cuts_d0_to_pi_k::NBinsPt; const double efficiencyDmesonDefault[npTBinsEfficiency] = {}; -auto efficiencyDmeson_v = std::vector{efficiencyDmesonDefault, efficiencyDmesonDefault + npTBinsEfficiency}; +const auto efficiencyDmeson_v = std::vector{efficiencyDmesonDefault, efficiencyDmesonDefault + npTBinsEfficiency}; struct HfTaskCorrelationDDbar { Configurable applyEfficiency{"applyEfficiency", 1, "Flag for applying efficiency weights"}; diff --git a/PWGHF/HFC/Tasks/taskCorrelationDplusHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationDplusHadrons.cxx index ebdbab469df..d9a1ef22760 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationDplusHadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationDplusHadrons.cxx @@ -79,21 +79,21 @@ const TString stringMCGenDFd = "MC gen, non-prompt D+;"; const int npTBinsCorrelations = 8; const double pTBinsCorrelations[npTBinsCorrelations + 1] = {0., 2., 4., 6., 8., 12., 16., 24., 99.}; -auto ptBinsCorrelationsVec = std::vector{pTBinsCorrelations, pTBinsCorrelations + npTBinsCorrelations + 1}; +const auto ptBinsCorrelationsVec = std::vector{pTBinsCorrelations, pTBinsCorrelations + npTBinsCorrelations + 1}; const double signalRegionInnerDefault[npTBinsCorrelations] = {1.8490, 1.8490, 1.8490, 1.8490, 1.8490, 1.8490, 1.8490, 1.8490}; const double signalRegionOuterDefault[npTBinsCorrelations] = {1.8890, 1.8890, 1.8890, 1.8890, 1.8890, 1.8890, 1.8890, 1.8890}; const double sidebandLeftOuterDefault[npTBinsCorrelations] = {1.7690, 1.7690, 1.7690, 1.7690, 1.7690, 1.7690, 1.7690, 1.7690}; const double sidebandLeftInnerDefault[npTBinsCorrelations] = {1.8250, 1.8250, 1.8250, 1.8250, 1.8250, 1.8250, 1.8250, 1.8250}; const double sidebandRightInnerDefault[npTBinsCorrelations] = {1.9130, 1.9130, 1.9130, 1.9130, 1.9130, 1.9130, 1.9130, 1.9130}; const double sidebandRightOuterDefault[npTBinsCorrelations] = {1.9690, 1.9690, 1.9690, 1.9690, 1.9690, 1.9690, 1.9690, 1.9690}; -auto signalRegionInnerVec = std::vector{signalRegionInnerDefault, signalRegionInnerDefault + npTBinsCorrelations}; -auto signalRegionOuterVec = std::vector{signalRegionOuterDefault, signalRegionOuterDefault + npTBinsCorrelations}; -auto sidebandLeftInnerVec = std::vector{sidebandLeftInnerDefault, sidebandLeftInnerDefault + npTBinsCorrelations}; -auto sidebandLeftOuterVec = std::vector{sidebandLeftOuterDefault, sidebandLeftOuterDefault + npTBinsCorrelations}; -auto sidebandRightInnerVec = std::vector{sidebandRightInnerDefault, sidebandRightInnerDefault + npTBinsCorrelations}; -auto sidebandRightOuterVec = std::vector{sidebandRightOuterDefault, sidebandRightOuterDefault + npTBinsCorrelations}; +const auto signalRegionInnerVec = std::vector{signalRegionInnerDefault, signalRegionInnerDefault + npTBinsCorrelations}; +const auto signalRegionOuterVec = std::vector{signalRegionOuterDefault, signalRegionOuterDefault + npTBinsCorrelations}; +const auto sidebandLeftInnerVec = std::vector{sidebandLeftInnerDefault, sidebandLeftInnerDefault + npTBinsCorrelations}; +const auto sidebandLeftOuterVec = std::vector{sidebandLeftOuterDefault, sidebandLeftOuterDefault + npTBinsCorrelations}; +const auto sidebandRightInnerVec = std::vector{sidebandRightInnerDefault, sidebandRightInnerDefault + npTBinsCorrelations}; +const auto sidebandRightOuterVec = std::vector{sidebandRightOuterDefault, sidebandRightOuterDefault + npTBinsCorrelations}; const int npTBinsEfficiency = o2::analysis::hf_cuts_dplus_to_pi_k_pi::NBinsPt; -std::vector efficiencyDmeson(npTBinsEfficiency + 1); +const std::vector efficiencyDmeson(npTBinsEfficiency + 1); /// Dplus-Hadron correlation pair filling task, from pair tables - for real data and data-like analysis (i.e. reco-level w/o matching request via MC truth) struct HfTaskCorrelationDplusHadrons { diff --git a/PWGHF/HFC/Tasks/taskCorrelationDsHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationDsHadrons.cxx index 1536814e5f8..470875f1d50 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationDsHadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationDsHadrons.cxx @@ -130,7 +130,7 @@ struct HfTaskCorrelationDsHadrons { std::shared_ptr hEfficiencyAssociatedMult = nullptr; std::shared_ptr hEfficiencyAssociatedDeltaPhiCorr = nullptr; - const float epsilon = 1.e-8; + static constexpr float Epsilon{1.e-8}; HfHelper hfHelper; SliceCache cache; @@ -351,18 +351,18 @@ struct HfTaskCorrelationDsHadrons { case EfficiencyMode::DsOnly: if (loadAccXEffFromCCDB) { if (useHighDimHistoForEff) { - if (hEfficiencyDMult->GetBinContent(hEfficiencyDMult->FindBin(ptD, static_cast(*multPvContrib))) <= epsilon) { + if (hEfficiencyDMult->GetBinContent(hEfficiencyDMult->FindBin(ptD, static_cast(*multPvContrib))) <= Epsilon) { LOG(fatal) << "A bin content in Ds-meson efficiency histogram is zero!"; } weight = 1. / hEfficiencyDMult->GetBinContent(hEfficiencyDMult->FindBin(ptD, static_cast(*multPvContrib))); } else { - if (hEfficiencyD->GetBinContent(hEfficiencyD->FindBin(ptD)) <= epsilon) { + if (hEfficiencyD->GetBinContent(hEfficiencyD->FindBin(ptD)) <= Epsilon) { LOG(fatal) << "A bin content in Ds-meson efficiency histogram is zero!"; } weight = 1. / hEfficiencyD->GetBinContent(hEfficiencyD->FindBin(ptD)); } } else { - if (efficiencyD->at(o2::analysis::findBin(binsPtEfficiencyD, ptD)) <= epsilon) { + if (efficiencyD->at(o2::analysis::findBin(binsPtEfficiencyD, ptD)) <= Epsilon) { LOG(fatal) << "A bin content in Ds-meson efficiency vector is zero!"; } weight = 1. / efficiencyD->at(o2::analysis::findBin(binsPtEfficiencyD, ptD)); @@ -373,18 +373,18 @@ struct HfTaskCorrelationDsHadrons { if (ptAssoc && (hEfficiencyAssociated || hEfficiencyAssociatedMult || hEfficiencyAssociatedDeltaPhiCorr)) { if (useHighDimHistoForEff) { if (applyDeltaPhiCorrEff) { - if (hEfficiencyAssociatedDeltaPhiCorr->GetBinContent(hEfficiencyAssociatedDeltaPhiCorr->FindBin(*ptAssoc, ptD, static_cast(*deltaPhi))) <= epsilon) { + if (hEfficiencyAssociatedDeltaPhiCorr->GetBinContent(hEfficiencyAssociatedDeltaPhiCorr->FindBin(*ptAssoc, ptD, static_cast(*deltaPhi))) <= Epsilon) { LOG(fatal) << "A bin content in associated particle efficiency histogram is zero!"; } weight = 1. / (hEfficiencyDMult->GetBinContent(hEfficiencyDMult->FindBin(ptD, static_cast(*multPvContrib))) * hEfficiencyAssociatedDeltaPhiCorr->GetBinContent(hEfficiencyAssociatedDeltaPhiCorr->FindBin(*ptAssoc, ptD, static_cast(*deltaPhi)))); } else { - if (hEfficiencyAssociatedMult->GetBinContent(hEfficiencyAssociatedMult->FindBin(*ptAssoc, static_cast(*multPvContrib))) <= epsilon) { + if (hEfficiencyAssociatedMult->GetBinContent(hEfficiencyAssociatedMult->FindBin(*ptAssoc, static_cast(*multPvContrib))) <= Epsilon) { LOG(fatal) << "A bin content in associated particle efficiency histogram is zero!"; } weight = 1. / (hEfficiencyDMult->GetBinContent(hEfficiencyDMult->FindBin(ptD, static_cast(*multPvContrib))) * hEfficiencyAssociatedMult->GetBinContent(hEfficiencyAssociatedMult->FindBin(*ptAssoc, static_cast(*multPvContrib)))); } } else { - if (hEfficiencyAssociated->GetBinContent(hEfficiencyAssociated->FindBin(*ptAssoc)) <= epsilon) { + if (hEfficiencyAssociated->GetBinContent(hEfficiencyAssociated->FindBin(*ptAssoc)) <= Epsilon) { LOG(fatal) << "A bin content in associated particle efficiency histogram is zero!"; } weight = 1. / (hEfficiencyD->GetBinContent(hEfficiencyD->FindBin(ptD)) * hEfficiencyAssociated->GetBinContent(hEfficiencyAssociated->FindBin(*ptAssoc))); @@ -392,7 +392,7 @@ struct HfTaskCorrelationDsHadrons { } } else { if (ptAssoc) { - if (efficiencyHad->at(o2::analysis::findBin(binsPtEfficiencyHad, *ptAssoc)) <= epsilon) { + if (efficiencyHad->at(o2::analysis::findBin(binsPtEfficiencyHad, *ptAssoc)) <= Epsilon) { LOG(fatal) << "A bin content in associated particle efficiency vector is zero!"; } weight = 1. / (efficiencyD->at(o2::analysis::findBin(binsPtEfficiencyD, ptD)) * efficiencyHad->at(o2::analysis::findBin(binsPtEfficiencyHad, *ptAssoc))); diff --git a/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx index eb450cc7e61..0a62f162630 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx @@ -48,28 +48,28 @@ const TString stringPoolBin = "Pool Bin Number;"; const int nBinsPtCorrelation = 8; const double binsPtCorrelationsDefault[nBinsPtCorrelation + 1] = {0., 2., 4., 6., 8., 12., 16., 24., 100.}; -auto vecBinsPtCorrelationsDefault = std::vector{binsPtCorrelationsDefault, binsPtCorrelationsDefault + nBinsPtCorrelation + 1}; +const auto vecBinsPtCorrelationsDefault = std::vector{binsPtCorrelationsDefault, binsPtCorrelationsDefault + nBinsPtCorrelation + 1}; const double signalRegionLefBoundDefault[nBinsPtCorrelation] = {0.144, 0.144, 0.144, 0.144, 0.144, 0.144, 0.144, 0.144}; -auto vecSignalRegionLefBoundDefault = std::vector{signalRegionLefBoundDefault, signalRegionLefBoundDefault + nBinsPtCorrelation}; +const auto vecSignalRegionLefBoundDefault = std::vector{signalRegionLefBoundDefault, signalRegionLefBoundDefault + nBinsPtCorrelation}; const double signalRegionRightBoundDefault[nBinsPtCorrelation] = {0.146, 0.146, 0.146, 0.146, 0.146, 0.146, 0.146, 0.146}; -auto vecSignalRegionRightBoundDefault = std::vector{signalRegionRightBoundDefault, signalRegionRightBoundDefault + nBinsPtCorrelation}; +const auto vecSignalRegionRightBoundDefault = std::vector{signalRegionRightBoundDefault, signalRegionRightBoundDefault + nBinsPtCorrelation}; // const double sidebandLeftOuterDefault[nBinsPtCorrelation] = {1.7690, 1.7690, 1.7690, 1.7690, 1.7690, 1.7690, 1.7690, 1.7690}; -// auto vecSidebandLeftOuterDefault = std::vector{sidebandLeftOuterDefault, sidebandLeftOuterDefault + nBinsPtCorrelation}; +// const auto vecSidebandLeftOuterDefault = std::vector{sidebandLeftOuterDefault, sidebandLeftOuterDefault + nBinsPtCorrelation}; // const double sidebandLeftInnerDefault[nBinsPtCorrelation] = {1.8250, 1.8250, 1.8250, 1.8250, 1.8250, 1.8250, 1.8250, 1.8250}; -// auto vecSidebandLeftInnerDefault = std::vector{sidebandLeftInnerDefault, sidebandLeftInnerDefault + nBinsPtCorrelation}; +// const auto vecSidebandLeftInnerDefault = std::vector{sidebandLeftInnerDefault, sidebandLeftInnerDefault + nBinsPtCorrelation}; const double sidebandRightInnerDefault[nBinsPtCorrelation] = {0.147, 0.147, 0.147, 0.147, 0.147, 0.147, 0.147, 0.147}; -auto vecSidebandRightInnerDefault = std::vector{sidebandRightInnerDefault, sidebandRightInnerDefault + nBinsPtCorrelation}; +const auto vecSidebandRightInnerDefault = std::vector{sidebandRightInnerDefault, sidebandRightInnerDefault + nBinsPtCorrelation}; const double sidebandRightOuterDefault[nBinsPtCorrelation] = {0.154, 0.154, 0.154, 0.154, 0.154, 0.154, 0.154, 0.154}; -auto vecSidebandRightOuterDefault = std::vector{sidebandRightOuterDefault, sidebandRightOuterDefault + nBinsPtCorrelation}; +const auto vecSidebandRightOuterDefault = std::vector{sidebandRightOuterDefault, sidebandRightOuterDefault + nBinsPtCorrelation}; const int npTBinsEfficiency = o2::analysis::hf_cuts_dstar_to_d0_pi::NBinsPt; -std::vector vecEfficiencyDstarDefault(npTBinsEfficiency); // line # 76 in taskCorrelationDstarHadron.cxx; why (npTBinsEfficiency+1) ? +const std::vector vecEfficiencyDstarDefault(npTBinsEfficiency); // line # 76 in taskCorrelationDstarHadron.cxx; why (npTBinsEfficiency+1) ? // Dstar-Hadron correlation pair struct HfTaskCorrelationDstarHadrons { diff --git a/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx index fa308c257f0..cf3e92e78df 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx @@ -86,19 +86,19 @@ const TString stringMcGenLcFd = "MC gen, non-prompt #Lambda_c;"; // definition of vectors for standard ptbin and invariant mass configurables const int nPtBinsCorrelations = 8; const double pTBinsCorrelations[nPtBinsCorrelations + 1] = {0., 2., 4., 6., 8., 12., 16., 24., 99.}; -auto vecBinsPtCorrelations = std::vector{pTBinsCorrelations, pTBinsCorrelations + nPtBinsCorrelations + 1}; +const auto vecBinsPtCorrelations = std::vector{pTBinsCorrelations, pTBinsCorrelations + nPtBinsCorrelations + 1}; const double signalRegionInnerDefault[nPtBinsCorrelations] = {2.269, 2.269, 2.269, 2.269, 2.269, 2.269, 2.269, 2.269}; const double signalRegionOuterDefault[nPtBinsCorrelations] = {2.309, 2.309, 2.309, 2.309, 2.309, 2.309, 2.309, 2.309}; const double sidebandLeftOuterDefault[nPtBinsCorrelations] = {2.209, 2.209, 2.209, 2.209, 2.209, 2.209, 2.209, 2.209}; const double sidebandLeftInnerDefault[nPtBinsCorrelations] = {2.249, 2.249, 2.249, 2.249, 2.249, 2.249, 2.249, 2.249}; const double sidebandRightInnerDefault[nPtBinsCorrelations] = {2.329, 2.329, 2.329, 2.329, 2.329, 2.329, 2.329, 2.329}; const double sidebandRightOuterDefault[nPtBinsCorrelations] = {2.369, 2.369, 2.369, 2.369, 2.369, 2.369, 2.369, 2.369}; -auto vecSignalRegionInner = std::vector{signalRegionInnerDefault, signalRegionInnerDefault + nPtBinsCorrelations}; -auto vecSignalRegionOuter = std::vector{signalRegionOuterDefault, signalRegionOuterDefault + nPtBinsCorrelations}; -auto vecSidebandLeftInner = std::vector{sidebandLeftInnerDefault, sidebandLeftInnerDefault + nPtBinsCorrelations}; -auto vecSidebandLeftOuter = std::vector{sidebandLeftOuterDefault, sidebandLeftOuterDefault + nPtBinsCorrelations}; -auto vecSidebandRightInner = std::vector{sidebandRightInnerDefault, sidebandRightInnerDefault + nPtBinsCorrelations}; -auto vecSidebandRightOuter = std::vector{sidebandRightOuterDefault, sidebandRightOuterDefault + nPtBinsCorrelations}; +const auto vecSignalRegionInner = std::vector{signalRegionInnerDefault, signalRegionInnerDefault + nPtBinsCorrelations}; +const auto vecSignalRegionOuter = std::vector{signalRegionOuterDefault, signalRegionOuterDefault + nPtBinsCorrelations}; +const auto vecSidebandLeftInner = std::vector{sidebandLeftInnerDefault, sidebandLeftInnerDefault + nPtBinsCorrelations}; +const auto vecSidebandLeftOuter = std::vector{sidebandLeftOuterDefault, sidebandLeftOuterDefault + nPtBinsCorrelations}; +const auto vecSidebandRightInner = std::vector{sidebandRightInnerDefault, sidebandRightInnerDefault + nPtBinsCorrelations}; +const auto vecSidebandRightOuter = std::vector{sidebandRightOuterDefault, sidebandRightOuterDefault + nPtBinsCorrelations}; /// Lc-Hadron correlation pair filling task, from pair tables - for real data and data-like analysis (i.e. reco-level w/o matching request via Mc truth) struct HfTaskCorrelationLcHadrons { diff --git a/PWGHF/HFL/Tasks/taskSingleElectron.cxx b/PWGHF/HFL/Tasks/taskSingleElectron.cxx index a19b8c79cb8..a235dc78da7 100644 --- a/PWGHF/HFL/Tasks/taskSingleElectron.cxx +++ b/PWGHF/HFL/Tasks/taskSingleElectron.cxx @@ -108,21 +108,21 @@ struct HfTaskSingleElectron { // ConfigurableAxis ConfigurableAxis axisPtEl{"axisPtEl", {VARIABLE_WIDTH, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.f, 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.75f, 2.0f, 2.25f, 2.5f, 2.75f, 3.f, 3.5f, 4.0f, 5.0f, 6.0f, 8.0f, 10.0f}, "electron pt bins"}; - // AxisSpec - const AxisSpec axisEvt{4, 0., 4., "nEvents"}; - const AxisSpec axisNCont{100, 0., 100., "nCont"}; - const AxisSpec axisPosZ{600, -30., 30., "Z_{pos}"}; - const AxisSpec axisEta{30, -1.5, +1.5, "#eta"}; - const AxisSpec axisP{nBinsP, 0., 15., "p_{T}"}; - const AxisSpec axisPt{nBinsPt, 0., 15., "p_{T}"}; - const AxisSpec axisNsig{800, -20., 20.}; - const AxisSpec axisTrackIp{4000, -0.2, 0.2, "dca"}; - // Histogram registry HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; void init(InitContext const&) { + // AxisSpec + const AxisSpec axisEvt{4, 0., 4., "nEvents"}; + const AxisSpec axisNCont{100, 0., 100., "nCont"}; + const AxisSpec axisPosZ{600, -30., 30., "Z_{pos}"}; + const AxisSpec axisEta{30, -1.5, +1.5, "#eta"}; + const AxisSpec axisP{nBinsP, 0., 15., "p_{T}"}; + const AxisSpec axisPt{nBinsPt, 0., 15., "p_{T}"}; + const AxisSpec axisNsig{800, -20., 20.}; + const AxisSpec axisTrackIp{4000, -0.2, 0.2, "dca"}; + // create histograms histos.add("nEvents", "Number of events", kTH1D, {{1, 0., 1.}}); histos.add("VtxZ", "VtxZ; cm; entries", kTH1D, {axisPosZ}); diff --git a/PWGHF/TableProducer/treeCreatorOmegacSt.cxx b/PWGHF/TableProducer/treeCreatorOmegacSt.cxx index 9a932badedb..18ebc9e225a 100644 --- a/PWGHF/TableProducer/treeCreatorOmegacSt.cxx +++ b/PWGHF/TableProducer/treeCreatorOmegacSt.cxx @@ -260,16 +260,16 @@ struct HfTreeCreatorOmegacSt { Configurable bzOnly{"bzOnly", true, "Use B_z instead of full field map"}; Configurable cfgTriggersOfInterest{"cfgTriggersOfInterest", "fTrackedOmega,fHfCharmBarToXiBach", "Triggers of interest, comma separated for Zorro"}; - const int itsNClsMin = 4; - const float tpcNclsFindableFraction = 0.8; - const float tpcChi2NclMax = 4.; - const float itsChi2NclMax = 36.; - SliceCache cache; Service ccdb; o2::vertexing::DCAFitterN<2> df2; - float bz = 0.; + static constexpr int ItsNClsMin{4}; + static constexpr float TpcNclsFindableFraction{0.8f}; + static constexpr float TpcChi2NclMax{4.f}; + static constexpr float ItsChi2NclMax{36.f}; + + float bz{0.f}; int runNumber{0}; std::map mapMcPartToGenTable; @@ -614,12 +614,12 @@ struct HfTreeCreatorOmegacSt { track.globalIndex() == bachelor.globalIndex()) { continue; } - if ((track.itsNCls() >= itsNClsMin) && + if ((track.itsNCls() >= ItsNClsMin) && (track.tpcNClsFound() >= minNoClsTrackedPionOrKaon) && (track.tpcNClsCrossedRows() >= minNoClsTrackedPionOrKaon) && - (track.tpcNClsCrossedRows() >= tpcNclsFindableFraction * track.tpcNClsFindable()) && - (track.tpcChi2NCl() <= tpcChi2NclMax) && - (track.itsChi2NCl() <= itsChi2NclMax) && + (track.tpcNClsCrossedRows() >= TpcNclsFindableFraction * track.tpcNClsFindable()) && + (track.tpcChi2NCl() <= TpcChi2NclMax) && + (track.itsChi2NCl() <= ItsChi2NclMax) && (std::abs(track.tpcNSigmaPi()) < maxNSigmaPion || std::abs(track.tpcNSigmaKa()) < maxNSigmaKaon)) { LOGF(debug, " .. combining with pion/kaon candidate %d", track.globalIndex()); int trackMotherId = -1; diff --git a/PWGHF/Utils/utilsTrkCandHf.h b/PWGHF/Utils/utilsTrkCandHf.h index 295b8fb7538..55e1ecc8857 100644 --- a/PWGHF/Utils/utilsTrkCandHf.h +++ b/PWGHF/Utils/utilsTrkCandHf.h @@ -35,7 +35,7 @@ enum SVFitting { NCases }; -o2::framework::AxisSpec axisCands = {SVFitting::NCases, -0.5f, static_cast(SVFitting::NCases) - 0.5f, ""}; +const o2::framework::AxisSpec axisCands = {SVFitting::NCases, -0.5f, static_cast(SVFitting::NCases) - 0.5f, ""}; /// \brief Function to put labels on candidate monitoring histogram /// \param hCandidates is the histogram From b8ab7f09bf4a0f280f56e0b1bb6b55aabe98c1af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Fri, 26 Sep 2025 19:04:34 +0200 Subject: [PATCH 05/25] Fix performance --- PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx | 1 + PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx | 4 ++-- PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx | 2 ++ PWGHF/HFC/TableProducer/femtoDreamProducer.cxx | 2 +- PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx | 2 +- PWGHF/TableProducer/candidateCreatorLb.cxx | 2 +- PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx | 6 +++--- PWGHF/TableProducer/trackIndexSkimCreator.cxx | 2 +- PWGHF/TableProducer/treeCreatorTccToD0D0Pi.cxx | 2 +- 9 files changed, 13 insertions(+), 10 deletions(-) diff --git a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx index 9cfeb8d08be..35cc8b1798b 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx @@ -1330,6 +1330,7 @@ struct HfDataCreatorCharmHadPiReduced { if constexpr (doMc) { std::vector beautyHadDauTracks{}; + beautyHadDauTracks.reserve(charmHadDauTracks.size()); for (const auto& track : charmHadDauTracks) { beautyHadDauTracks.push_back(track); } diff --git a/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx index 4d7bd3cf1e3..5b0281eb52d 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx @@ -443,8 +443,8 @@ struct HfDataCreatorCharmResoReduced { template bool buildAndSelectV0(const Coll& collision, const std::array& dDaughtersIds, const std::array& dauTracks) { - auto trackPos = dauTracks[0]; - auto trackNeg = dauTracks[1]; + const auto& trackPos = dauTracks[0]; + const auto& trackNeg = dauTracks[1]; // single-tracks selection if (!selectV0Daughter(trackPos, dDaughtersIds) || !selectV0Daughter(trackNeg, dDaughtersIds)) return false; diff --git a/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx index 5eaa8745e84..71e3aad64d6 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx @@ -913,6 +913,7 @@ struct HfDataCreatorJpsiHadReduced { if constexpr (doMc) { std::vector beautyHadDauTracks{}; + beautyHadDauTracks.reserve(jPsiDauTracks.size()); for (const auto& track : jPsiDauTracks) { beautyHadDauTracks.push_back(track); } @@ -1034,6 +1035,7 @@ struct HfDataCreatorJpsiHadReduced { if constexpr (doMc) { std::vector beautyHadDauTracks{}; + beautyHadDauTracks.reserve(jPsiDauTracks.size()); for (const auto& track : jPsiDauTracks) { beautyHadDauTracks.push_back(track); } diff --git a/PWGHF/HFC/TableProducer/femtoDreamProducer.cxx b/PWGHF/HFC/TableProducer/femtoDreamProducer.cxx index 3366a2bb8a3..066e6d45022 100644 --- a/PWGHF/HFC/TableProducer/femtoDreamProducer.cxx +++ b/PWGHF/HFC/TableProducer/femtoDreamProducer.cxx @@ -264,7 +264,7 @@ struct HfFemtoDreamProducer { } /// Function to retrieve the nominal magnetic field in kG (0.1T) and convert it directly to T - void getMagneticFieldTesla(aod::BCsWithTimestamps::iterator bc) + void getMagneticFieldTesla(const aod::BCsWithTimestamps::iterator& bc) { initCCDB(bc, runNumber, ccdb, !isRun3 ? ccdbPathGrp : ccdbPathGrpMag, lut, !isRun3); } diff --git a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx index 068cac4030c..25fdbc7c142 100644 --- a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx +++ b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx @@ -366,7 +366,7 @@ struct HfTaskElectronWeakBoson { return std::make_pair(trackCount - 1, isoMomentum); } - void recoMassZee(KFParticle kfpIsoEle, + void recoMassZee(KFParticle const& kfpIsoEle, int charge, float centrality, TrackEle const& tracks) diff --git a/PWGHF/TableProducer/candidateCreatorLb.cxx b/PWGHF/TableProducer/candidateCreatorLb.cxx index 14228f95b53..bc85bc8772a 100644 --- a/PWGHF/TableProducer/candidateCreatorLb.cxx +++ b/PWGHF/TableProducer/candidateCreatorLb.cxx @@ -248,7 +248,7 @@ struct HfCandidateCreatorLb { rowCandidateProngs(lcCand.globalIndex(), trackPion.globalIndex()); // calculate invariant mass auto arrayMomenta = std::array{pvecLc, pvecPion}; - massLcPi = RecoDecay::m(std::move(arrayMomenta), std::array{massLc, massPi}); + massLcPi = RecoDecay::m(arrayMomenta, std::array{massLc, massPi}); if (lcCand.isSelLcToPKPi() > 0) { hMassLbToLcPi->Fill(massLcPi); } diff --git a/PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx b/PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx index fb8e8e80fbe..68189d60763 100644 --- a/PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx +++ b/PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx @@ -311,7 +311,7 @@ struct HfCandidateCreatorXicToXiPiPi { // get invariant mass of Xic candidate auto arrayMomenta = std::array{pVecXi, pVecPi0, pVecPi1}; - massXiPiPi = RecoDecay::m(std::move(arrayMomenta), std::array{MassXiMinus, MassPiPlus, MassPiPlus}); + massXiPiPi = RecoDecay::m(arrayMomenta, std::array{MassXiMinus, MassPiPlus, MassPiPlus}); // get track impact parameters // This modifies track momenta! @@ -336,9 +336,9 @@ struct HfCandidateCreatorXicToXiPiPi { // get invariant mass of Xi-pi pairs auto arrayMomentaXiPi0 = std::array{pVecXi, pVecPi0}; - massXiPi0 = RecoDecay::m(std::move(arrayMomentaXiPi0), std::array{MassXiMinus, MassPiPlus}); + massXiPi0 = RecoDecay::m(arrayMomentaXiPi0, std::array{MassXiMinus, MassPiPlus}); auto arrayMomentaXiPi1 = std::array{pVecXi, pVecPi1}; - massXiPi1 = RecoDecay::m(std::move(arrayMomentaXiPi1), std::array{MassXiMinus, MassPiPlus}); + massXiPi1 = RecoDecay::m(arrayMomentaXiPi1, std::array{MassXiMinus, MassPiPlus}); // get uncertainty of the decay length float phi, theta; diff --git a/PWGHF/TableProducer/trackIndexSkimCreator.cxx b/PWGHF/TableProducer/trackIndexSkimCreator.cxx index ce1c1d52f2b..ae316e4ddc7 100644 --- a/PWGHF/TableProducer/trackIndexSkimCreator.cxx +++ b/PWGHF/TableProducer/trackIndexSkimCreator.cxx @@ -1933,7 +1933,7 @@ struct HfTrackIndexSkimCreator { aod::BCsWithTimestamps const&, std::vector const& vecPvContributorGlobId, std::vector const& vecPvContributorTrackParCov, - std::vector vecCandPvContributorGlobId, + std::vector const& vecCandPvContributorGlobId, std::array& pvCoord, std::array& pvCovMatrix) { diff --git a/PWGHF/TableProducer/treeCreatorTccToD0D0Pi.cxx b/PWGHF/TableProducer/treeCreatorTccToD0D0Pi.cxx index 1f74def620c..24cd582d4c3 100644 --- a/PWGHF/TableProducer/treeCreatorTccToD0D0Pi.cxx +++ b/PWGHF/TableProducer/treeCreatorTccToD0D0Pi.cxx @@ -646,7 +646,7 @@ struct HfTreeCreatorTccToD0D0Pi { auto massKpipi1 = RecoDecay::m(std::array{pVecD1Prong0, pVecD1Prong1, pVecSoftPi}, std::array{massD1Daus[0], massD1Daus[1], MassPiPlus}); auto massKpipi2 = RecoDecay::m(std::array{pVecD2Prong0, pVecD2Prong1, pVecSoftPi}, std::array{massD2Daus[0], massD2Daus[1], MassPiPlus}); auto arrayMomentaDDpi = std::array{pVecD1, pVecD2, pVecSoftPi}; - const auto massD0D0Pi = RecoDecay::m(std::move(arrayMomentaDDpi), std::array{MassD0, MassD0, MassPiPlus}); + const auto massD0D0Pi = RecoDecay::m(arrayMomentaDDpi, std::array{MassD0, MassD0, MassPiPlus}); const auto deltaMassD0D0Pi = massD0D0Pi - (massD01 + massD02); deltaMassD01 = massKpipi1 - massD01; From b5c5976f7ac3b41d8f058bc27dbfb82589caaf8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Fri, 26 Sep 2025 20:29:29 +0200 Subject: [PATCH 06/25] Modernise --- PWGHF/D2H/Macros/HFInvMassFitter.cxx | 10 +++--- PWGHF/D2H/Macros/HFInvMassFitter.h | 34 +++++++++---------- .../dataCreatorCharmHadPiReduced.cxx | 8 ++--- .../dataCreatorJpsiHadReduced.cxx | 2 +- PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx | 4 +-- PWGHF/D2H/Tasks/taskOmegac0ToOmegapi.cxx | 6 ++-- PWGHF/D2H/Tasks/taskXicToXiPiPi.cxx | 4 +-- .../TableProducer/correlatorDplusHadrons.cxx | 6 ++-- .../HFC/Tasks/taskCharmHadronsFemtoDream.cxx | 3 +- PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx | 2 +- .../TableProducer/candidateCreator2Prong.cxx | 2 +- .../TableProducer/candidateCreator3Prong.cxx | 6 ++-- PWGHF/TableProducer/candidateCreatorDstar.cxx | 4 +-- .../candidateCreatorSigmac0plusplus.cxx | 4 +-- .../candidateSelectorLcPidMl.cxx | 2 +- PWGHF/TableProducer/treeCreatorOmegacSt.cxx | 8 ++--- PWGHF/Tasks/taskMcValidation.cxx | 14 ++++---- PWGHF/Utils/utilsMcGen.h | 4 +-- 18 files changed, 62 insertions(+), 61 deletions(-) diff --git a/PWGHF/D2H/Macros/HFInvMassFitter.cxx b/PWGHF/D2H/Macros/HFInvMassFitter.cxx index fba3d7c67a1..d1c1dcf0270 100644 --- a/PWGHF/D2H/Macros/HFInvMassFitter.cxx +++ b/PWGHF/D2H/Macros/HFInvMassFitter.cxx @@ -563,8 +563,8 @@ void HFInvMassFitter::drawFit(TVirtualPad* pad, Int_t writeFitInfo) gStyle->SetFrameFillColor(0); pad->cd(); if (writeFitInfo > 0) { - TPaveText* textInfoLeft = new TPaveText(0.12, 0.65, 0.47, 0.89, "NDC"); - TPaveText* textInfoRight = new TPaveText(0.6, 0.7, 1., .87, "NDC"); + auto* textInfoLeft = new TPaveText(0.12, 0.65, 0.47, 0.89, "NDC"); + auto* textInfoRight = new TPaveText(0.6, 0.7, 1., .87, "NDC"); textInfoLeft->SetBorderSize(0); textInfoLeft->SetFillStyle(0); textInfoRight->SetBorderSize(0); @@ -621,7 +621,7 @@ void HFInvMassFitter::drawResidual(TVirtualPad* pad) { pad->cd(); mResidualFrame->GetYaxis()->SetTitle(""); - TPaveText* textInfo = new TPaveText(0.12, 0.65, 0.47, .89, "NDC"); + auto* textInfo = new TPaveText(0.12, 0.65, 0.47, .89, "NDC"); textInfo->SetBorderSize(0); textInfo->SetFillStyle(0); textInfo->SetTextColor(kBlue); @@ -651,8 +651,8 @@ void HFInvMassFitter::highlightPeakRegion(const RooPlot* plot, Color_t color, Wi const Double_t sigma = mRooSigmaSgn->getVal(); const Double_t minForSgn = mean - mNSigmaForSidebands * sigma; const Double_t maxForSgn = mean + mNSigmaForSidebands * sigma; - TLine* leftLine = new TLine(minForSgn, yMin, minForSgn, yMax); - TLine* rightLine = new TLine(maxForSgn, yMin, maxForSgn, yMax); + auto* leftLine = new TLine(minForSgn, yMin, minForSgn, yMax); + auto* rightLine = new TLine(maxForSgn, yMin, maxForSgn, yMax); for (const auto& line : std::array{leftLine, rightLine}) { line->SetLineColor(color); line->SetLineWidth(width); diff --git a/PWGHF/D2H/Macros/HFInvMassFitter.h b/PWGHF/D2H/Macros/HFInvMassFitter.h index 2ddffb1de0d..e8506ab00a3 100644 --- a/PWGHF/D2H/Macros/HFInvMassFitter.h +++ b/PWGHF/D2H/Macros/HFInvMassFitter.h @@ -67,14 +67,14 @@ class HFInvMassFitter : public TNamed std::vector namesOfReflPdf{"reflFuncGaus", "reflFuncDoubleGaus", "reflFuncPoly3", "reflFuncPoly6"}; HFInvMassFitter(); HFInvMassFitter(const TH1* histoToFit, Double_t minValue, Double_t maxValue, Int_t fitTypeBkg = Expo, Int_t fitTypeSgn = SingleGaus); - ~HFInvMassFitter(); + ~HFInvMassFitter() override; void setHistogramForFit(const TH1* histoToFit) { if (mHistoInvMass) { delete mHistoInvMass; } mHistoInvMass = dynamic_cast(histoToFit->Clone("mHistoInvMass")); - mHistoInvMass->SetDirectory(0); + mHistoInvMass->SetDirectory(nullptr); } void setUseLikelihoodFit() { mFitOption = "L,E"; } void setUseChi2Fit() { mFitOption = "Chi2"; } @@ -197,21 +197,21 @@ class HFInvMassFitter : public TNamed } void setDrawBgPrefit(Bool_t value = true) { mDrawBgPrefit = value; } void setHighlightPeakRegion(Bool_t value = true) { mHighlightPeakRegion = value; } - Double_t getChiSquareOverNDFTotal() const { return mChiSquareOverNdfTotal; } - Double_t getChiSquareOverNDFBkg() const { return mChiSquareOverNdfBkg; } - Double_t getRawYield() const { return mRawYield; } - Double_t getRawYieldError() const { return mRawYieldErr; } - Double_t getRawYieldCounted() const { return mRawYieldCounted; } - Double_t getRawYieldCountedError() const { return mRawYieldCountedErr; } - Double_t getBkgYield() const { return mBkgYield; } - Double_t getBkgYieldError() const { return mBkgYieldErr; } - Double_t getSignificance() const { return mSignificance; } - Double_t getSignificanceError() const { return mSignificanceErr; } - Double_t getMean() const { return mRooMeanSgn->getVal(); } - Double_t getMeanUncertainty() const { return mRooMeanSgn->getError(); } - Double_t getSigma() const { return mRooSigmaSgn->getVal(); } - Double_t getSigmaUncertainty() const { return mRooSigmaSgn->getError(); } - Double_t getReflOverSig() const + [[nodiscard]] Double_t getChiSquareOverNDFTotal() const { return mChiSquareOverNdfTotal; } + [[nodiscard]] Double_t getChiSquareOverNDFBkg() const { return mChiSquareOverNdfBkg; } + [[nodiscard]] Double_t getRawYield() const { return mRawYield; } + [[nodiscard]] Double_t getRawYieldError() const { return mRawYieldErr; } + [[nodiscard]] Double_t getRawYieldCounted() const { return mRawYieldCounted; } + [[nodiscard]] Double_t getRawYieldCountedError() const { return mRawYieldCountedErr; } + [[nodiscard]] Double_t getBkgYield() const { return mBkgYield; } + [[nodiscard]] Double_t getBkgYieldError() const { return mBkgYieldErr; } + [[nodiscard]] Double_t getSignificance() const { return mSignificance; } + [[nodiscard]] Double_t getSignificanceError() const { return mSignificanceErr; } + [[nodiscard]] Double_t getMean() const { return mRooMeanSgn->getVal(); } + [[nodiscard]] Double_t getMeanUncertainty() const { return mRooMeanSgn->getError(); } + [[nodiscard]] Double_t getSigma() const { return mRooSigmaSgn->getVal(); } + [[nodiscard]] Double_t getSigmaUncertainty() const { return mRooSigmaSgn->getError(); } + [[nodiscard]] Double_t getReflOverSig() const { if (mReflPdf) { return mReflOverSgn; diff --git a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx index 35cc8b1798b..546c3a2c194 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx @@ -984,9 +984,9 @@ struct HfDataCreatorCharmHadPiReduced { std::vector arrDaughDstarIndex; RecoDecay::getDaughters(particlesMc.rawIteratorAt(indexRec), &arrDaughDstarIndex, std::array{0}, 1); if (arrDaughDstarIndex.size() == NDaughtersDstar) { - bool matchD0{0}; - for (auto iProng = 0u; iProng < arrDaughDstarIndex.size(); ++iProng) { - auto daughI = particlesMc.rawIteratorAt(arrDaughDstarIndex[iProng]); + bool matchD0{false}; + for (const int iProng : arrDaughDstarIndex) { + auto daughI = particlesMc.rawIteratorAt(iProng); if (std::abs(daughI.pdgCode()) == Pdg::kD0) { matchD0 = RecoDecay::isMatchedMCGen(particlesMc, daughI, +Pdg::kD0, std::array{+kPiPlus, -kKPlus}, true, &signD, 2); } @@ -1045,7 +1045,7 @@ struct HfDataCreatorCharmHadPiReduced { auto bc = collision.template bc_as(); if (runNumber != bc.runNumber()) { LOG(info) << ">>>>>>>>>>>> Current run number: " << runNumber; - o2::parameters::GRPMagField* grpo = ccdb->getForTimeStamp(configs.ccdbPathGrpMag, bc.timestamp()); + auto* grpo = ccdb->getForTimeStamp(configs.ccdbPathGrpMag, bc.timestamp()); if (grpo == nullptr) { LOGF(fatal, "Run 3 GRP object (type o2::parameters::GRPMagField) is not available in CCDB for run=%d at timestamp=%llu", bc.runNumber(), bc.timestamp()); } diff --git a/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx index 71e3aad64d6..469040aa4dc 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx @@ -750,7 +750,7 @@ struct HfDataCreatorJpsiHadReduced { auto bc = collision.template bc_as(); if (runNumber != bc.runNumber()) { LOG(info) << ">>>>>>>>>>>> Current run number: " << runNumber; - o2::parameters::GRPMagField* grpo = ccdb->getForTimeStamp(ccdbPathGrpMag, bc.timestamp()); + auto* grpo = ccdb->getForTimeStamp(ccdbPathGrpMag, bc.timestamp()); if (grpo == nullptr) { LOGF(fatal, "Run 3 GRP object (type o2::parameters::GRPMagField) is not available in CCDB for run=%d at timestamp=%llu", bc.runNumber(), bc.timestamp()); } diff --git a/PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx b/PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx index 801e25e3460..0f9d3393f21 100644 --- a/PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx +++ b/PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx @@ -284,7 +284,7 @@ struct HfTaskDstarToD0Pi { LOGF(fatal, "Histogram %s not found in weight file!", histName.c_str()); return; } - hWeights[ithWeight]->SetDirectory(0); + hWeights[ithWeight]->SetDirectory(nullptr); hWeights[ithWeight]->SetName(("hWeight" + std::to_string(ithWeight + 1)).c_str()); } weightFile->Close(); @@ -587,7 +587,7 @@ struct HfTaskDstarToD0Pi { if (recCollisions.size()) { std::vector::iterator, int>> tempRecCols; for (const auto& recCol : recCollisions) { - tempRecCols.push_back(std::make_pair(recCol, recCol.numContrib())); + tempRecCols.emplace_back(recCol, recCol.numContrib()); } std::sort(tempRecCols.begin(), tempRecCols.end(), compare); centFT0MGen = tempRecCols.at(0).first.centFT0M(); diff --git a/PWGHF/D2H/Tasks/taskOmegac0ToOmegapi.cxx b/PWGHF/D2H/Tasks/taskOmegac0ToOmegapi.cxx index 69c09d88d5f..6fd41c8c2ef 100644 --- a/PWGHF/D2H/Tasks/taskOmegac0ToOmegapi.cxx +++ b/PWGHF/D2H/Tasks/taskOmegac0ToOmegapi.cxx @@ -135,14 +135,14 @@ struct HfTaskOmegac0ToOmegapi { if (doprocessDataKFParticleFT0C || doprocessDataKFParticleMlFT0C || doprocessDataKFParticleFT0M || doprocessDataKFParticleMlFT0M) { axes.push_back(thnAxisCent); - axes.push_back(thnConfigAxisNumPvContr); + axes.emplace_back(thnConfigAxisNumPvContr); } if (doprocessMcKFParticleFT0M || doprocessMcKFParticleMlFT0M) { axes.push_back(thnAxisCentMc); - axes.push_back(thnConfigAxisNumPvContr); + axes.emplace_back(thnConfigAxisNumPvContr); axesMcGen.push_back(thnAxisCentMc); - axesMcGen.push_back(thnConfigAxisNumPvContr); + axesMcGen.emplace_back(thnConfigAxisNumPvContr); } if (doprocessMcKFParticle || doprocessMcKFParticleMl || doprocessMcKFParticleFT0M || doprocessMcKFParticleMlFT0M) { diff --git a/PWGHF/D2H/Tasks/taskXicToXiPiPi.cxx b/PWGHF/D2H/Tasks/taskXicToXiPiPi.cxx index 9708066f9ec..cad6f361d2e 100644 --- a/PWGHF/D2H/Tasks/taskXicToXiPiPi.cxx +++ b/PWGHF/D2H/Tasks/taskXicToXiPiPi.cxx @@ -526,8 +526,8 @@ struct HfTaskXicToXiPiPi { std::array prodVtxZProngs{}; int counter = 0; RecoDecay::getDaughters(particle, &arrDaughIndex, std::array{+kXiMinus, +kPiPlus, +kPiPlus}, 2); - for (auto iProng = 0u; iProng < arrDaughIndex.size(); ++iProng) { - auto daughI = mcParticles.rawIteratorAt(arrDaughIndex[iProng]); + for (const int iProng : arrDaughIndex) { + auto daughI = mcParticles.rawIteratorAt(iProng); ptProngs[counter] = daughI.pt(); etaProngs[counter] = daughI.eta(); yProngs[counter] = RecoDecay::y(daughI.pVector(), pdg->Mass(daughI.pdgCode())); diff --git a/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx index 84249778c6c..b3f01ecba4c 100644 --- a/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx @@ -133,7 +133,7 @@ struct HfCorrelatorDplusHadronsDplusSelection { if (std::abs(hfHelper.yDplus(candidate)) >= yCandMax || candidate.pt() <= ptCandMin) { continue; } - isDplusFound = 1; + isDplusFound = true; break; } } @@ -152,7 +152,7 @@ struct HfCorrelatorDplusHadronsDplusSelection { void processDplusSelectionMcGen(aod::McCollision const&, CandDplusMcGen const& mcParticles) { - bool isDplusFound = 0; + bool isDplusFound = false; for (const auto& particle1 : mcParticles) { if (std::abs(particle1.pdgCode()) != Pdg::kDPlus) { continue; @@ -161,7 +161,7 @@ struct HfCorrelatorDplusHadronsDplusSelection { if (std::abs(yD) >= yCandMax || particle1.pt() <= ptCandMin) { continue; } - isDplusFound = 1; + isDplusFound = true; break; } dplusSel(isDplusFound); diff --git a/PWGHF/HFC/Tasks/taskCharmHadronsFemtoDream.cxx b/PWGHF/HFC/Tasks/taskCharmHadronsFemtoDream.cxx index 96af0f52f5a..54b5ffe5230 100644 --- a/PWGHF/HFC/Tasks/taskCharmHadronsFemtoDream.cxx +++ b/PWGHF/HFC/Tasks/taskCharmHadronsFemtoDream.cxx @@ -26,6 +26,7 @@ #include "Common/Core/RecoDecay.h" +#include #include #include #include @@ -191,7 +192,7 @@ struct HfTaskCharmHadronsFemtoDream { ConfigurableAxis binMulPercentile{"binMulPercentile", {10, 0.0f, 100.0f}, "multiplicity percentile Binning"}; ConfigurableAxis binpTTrack{"binpTTrack", {50, 0.5, 10.05}, "pT binning of the pT vs. TempFitVar plot (Track)"}; ConfigurableAxis binEta{"binEta", {{200, -1.5, 1.5}}, "eta binning"}; - ConfigurableAxis binPhi{"binPhi", {{200, 0, 2.f * 3.14159274101257324e+00f}}, "phi binning"}; + ConfigurableAxis binPhi{"binPhi", {{200, 0, o2::constants::math::TwoPI}}, "phi binning"}; ConfigurableAxis binkT{"binkT", {150, 0., 9.}, "binning kT"}; ConfigurableAxis binkstar{"binkstar", {1500, 0., 6.}, "binning kstar"}; ConfigurableAxis binNSigmaTPC{"binNSigmaTPC", {1600, -8, 8}, "Binning of Nsigma TPC plot"}; diff --git a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx index 25fdbc7c142..1d547044468 100644 --- a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx +++ b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx @@ -463,7 +463,7 @@ struct HfTaskElectronWeakBoson { lastRunNumber = runNumber; // initialize magnetic field - o2::parameters::GRPMagField* grpo = ccdb->getForTimeStamp(ccdbPathGrpMag, currentTimestamp); + auto* grpo = ccdb->getForTimeStamp(ccdbPathGrpMag, currentTimestamp); o2::base::Propagator::initFieldFromGRP(grpo); double magneticField = o2::base::Propagator::Instance()->getNominalBz(); LOG(info) << "magneticField = " << magneticField; diff --git a/PWGHF/TableProducer/candidateCreator2Prong.cxx b/PWGHF/TableProducer/candidateCreator2Prong.cxx index 80abb601ee1..e3b422d8454 100644 --- a/PWGHF/TableProducer/candidateCreator2Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator2Prong.cxx @@ -18,10 +18,10 @@ #ifndef HomogeneousField #define HomogeneousField // o2-linter: disable=name/macro (required by KFParticle) -#include "PWGHF/Core/DecayChannels.h" #endif #include "PWGHF/Core/CentralityEstimation.h" +#include "PWGHF/Core/DecayChannels.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/Utils/utilsBfieldCCDB.h" #include "PWGHF/Utils/utilsEvSelHf.h" diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index ecf5c1f8456..9d553d25bd0 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -1108,7 +1108,7 @@ struct HfCandidateCreator3ProngExpressions { } } } - } else if (finalState.size() == 3) { // o2-linter: disable=magic-number(fully reconstructed 3-prong decays) + } else if (finalState.size() == 3) { // o2-linter: disable=magic-number (fully reconstructed 3-prong decays) if (matchKinkedDecayTopology && matchInteractionsWithMaterial) { indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdgMother, arrPdgDaughtersMain3Prongs, true, &sign, depthMainMax, &nKinkedTracks, &nInteractionsWithMaterial); } else if (matchKinkedDecayTopology && !matchInteractionsWithMaterial) { @@ -1137,8 +1137,8 @@ struct HfCandidateCreator3ProngExpressions { if (pdgMother == Pdg::kDStar) { std::vector arrResoDaughIndexDstar = {}; RecoDecay::getDaughters(mcParticles.rawIteratorAt(indexRec), &arrResoDaughIndexDstar, std::array{0}, DepthResoMax); - for (size_t iDaug = 0; iDaug < arrResoDaughIndexDstar.size(); iDaug++) { - auto daughDstar = mcParticles.rawIteratorAt(arrResoDaughIndexDstar[iDaug]); + for (const int iDaug : arrResoDaughIndexDstar) { // o2-linter: disable=const-ref-in-for-loop (int elements) + auto daughDstar = mcParticles.rawIteratorAt(iDaug); if (std::abs(daughDstar.pdgCode()) == Pdg::kD0 || std::abs(daughDstar.pdgCode()) == Pdg::kDPlus) { RecoDecay::getDaughters(daughDstar, &arrResoDaughIndex, std::array{0}, DepthResoMax); break; diff --git a/PWGHF/TableProducer/candidateCreatorDstar.cxx b/PWGHF/TableProducer/candidateCreatorDstar.cxx index 5a6eae2a8e0..54c2b958ec1 100644 --- a/PWGHF/TableProducer/candidateCreatorDstar.cxx +++ b/PWGHF/TableProducer/candidateCreatorDstar.cxx @@ -249,7 +249,7 @@ struct HfCandidateCreatorDstar { auto bc = collision.template bc_as(); if (runNumber != bc.runNumber()) { // LOG(info) << ">>>>>>>>>>>> Current run number: " << runNumber; - o2::parameters::GRPMagField* grpo = ccdb->getForTimeStamp(ccdbPathGrpMag, bc.timestamp()); + auto* grpo = ccdb->getForTimeStamp(ccdbPathGrpMag, bc.timestamp()); if (grpo == nullptr) { LOGF(fatal, "Run 3 GRP object (type o2::parameters::GRPMagField) is not available in CCDB for run=%d at timestamp=%llu", bc.runNumber(), bc.timestamp()); } @@ -348,7 +348,7 @@ struct HfCandidateCreatorDstar { // Soft pi momentum vector and sign std::array pVecSoftPi{}; trackPiParVar.getPxPyPzGlo(pVecSoftPi); - int8_t signSoftPi = static_cast(trackPi.sign()); + auto signSoftPi = static_cast(trackPi.sign()); // D* pt magnitude auto ptDstar = RecoDecay::pt(pVecD0, pVecSoftPi); diff --git a/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx b/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx index 600f3c5b357..03eddf9d331 100644 --- a/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx +++ b/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx @@ -173,8 +173,8 @@ struct HfCandidateCreatorSigmac0plusplus { LOG(info) << "### ITS hitmap for soft pion"; LOG(info) << " >>> setSoftPiItsHitMap.size(): " << setSoftPiItsHitMap.size(); LOG(info) << " >>> Custom ITS hitmap dfchecked: "; - for (std::set::iterator it = setSoftPiItsHitMap.begin(); it != setSoftPiItsHitMap.end(); it++) { - LOG(info) << " Layer " << static_cast(*it) << " "; + for (const auto it : setSoftPiItsHitMap) { + LOG(info) << " Layer " << static_cast(it) << " "; } LOG(info) << "############"; softPiCuts.SetRequireITSRefit(); diff --git a/PWGHF/TableProducer/candidateSelectorLcPidMl.cxx b/PWGHF/TableProducer/candidateSelectorLcPidMl.cxx index 0368f0666b3..d89f9c4c5dd 100644 --- a/PWGHF/TableProducer/candidateSelectorLcPidMl.cxx +++ b/PWGHF/TableProducer/candidateSelectorLcPidMl.cxx @@ -138,7 +138,7 @@ struct HfCandidateSelectorLcPidMl { if (loadModelsFromCCDB && timestampCCDB > 0) { retrieveSuccess = ccdbApi.retrieveBlob(mlModelPathCCDB.value, ".", metadata, timestampCCDB.value, false, onnxFileLcToPiKPConf.value); headers = ccdbApi.retrieveHeaders(mlModelPathCCDB.value, metadata, timestampCCDB.value); - model.initModel(onnxFileLcToPiKPConf.value, false, 1, strtoul(headers["Valid-From"].c_str(), NULL, 0), strtoul(headers["Valid-Until"].c_str(), NULL, 0)); + model.initModel(onnxFileLcToPiKPConf.value, false, 1, strtoul(headers["Valid-From"].c_str(), nullptr, 0), strtoul(headers["Valid-Until"].c_str(), nullptr, 0)); } else if (!loadModelsFromCCDB) { model.initModel(onnxFileLcToPiKPConf.value, false, 1); } else { diff --git a/PWGHF/TableProducer/treeCreatorOmegacSt.cxx b/PWGHF/TableProducer/treeCreatorOmegacSt.cxx index 18ebc9e225a..b54c6e3b42b 100644 --- a/PWGHF/TableProducer/treeCreatorOmegacSt.cxx +++ b/PWGHF/TableProducer/treeCreatorOmegacSt.cxx @@ -455,10 +455,10 @@ struct HfTreeCreatorOmegacSt { runNumber = bc.runNumber(); auto timestamp = bc.timestamp(); - if (o2::parameters::GRPObject* grpo = ccdb->getForTimeStamp(grpPath, timestamp)) { + if (auto* grpo = ccdb->getForTimeStamp(grpPath, timestamp)) { o2::base::Propagator::initFieldFromGRP(grpo); bz = grpo->getNominalL3Field(); - } else if (o2::parameters::GRPMagField* grpmag = ccdb->getForTimeStamp(grpMagPath, timestamp)) { + } else if (auto* grpmag = ccdb->getForTimeStamp(grpMagPath, timestamp)) { o2::base::Propagator::initFieldFromGRP(grpmag); bz = std::lround(5.f * grpmag->getL3Current() / 30000.f); } else { @@ -841,9 +841,9 @@ struct HfTreeCreatorOmegacSt { runNumber = bc.runNumber(); auto timestamp = bc.timestamp(); - if (o2::parameters::GRPObject* grpo = ccdb->getForTimeStamp(grpPath, timestamp)) { + if (auto* grpo = ccdb->getForTimeStamp(grpPath, timestamp)) { o2::base::Propagator::initFieldFromGRP(grpo); - } else if (o2::parameters::GRPMagField* grpmag = ccdb->getForTimeStamp(grpMagPath, timestamp)) { + } else if (auto* grpmag = ccdb->getForTimeStamp(grpMagPath, timestamp)) { o2::base::Propagator::initFieldFromGRP(grpmag); } else { LOG(fatal) << "Got nullptr from CCDB for path " << grpMagPath << " of object GRPMagField and " << grpPath << " of object GRPObject for timestamp " << timestamp; diff --git a/PWGHF/Tasks/taskMcValidation.cxx b/PWGHF/Tasks/taskMcValidation.cxx index 083b85d6255..3227018bbd5 100644 --- a/PWGHF/Tasks/taskMcValidation.cxx +++ b/PWGHF/Tasks/taskMcValidation.cxx @@ -217,14 +217,14 @@ struct HfTaskMcValidationGen { } // add per species histograms - for (size_t iOrigin = 0; iOrigin < nOriginTypes; iOrigin++) { + for (auto originName : originNames) { for (int iChannel = 0; iChannel < nCharmMesonChannels; iChannel++) { // Charm mesons - registry.add(Form("%sCharmMesons/hCount%s%s", originNames[iOrigin].data(), originNames[iOrigin].data(), particleNames[iChannel].data()), - Form("Event counter - %s %s; Events Per Collision; entries", originNames[iOrigin].data(), labels[iChannel].data()), {HistType::kTH1F, {axisNhadrons}}); + registry.add(Form("%sCharmMesons/hCount%s%s", originName.data(), originName.data(), particleNames[iChannel].data()), + Form("Event counter - %s %s; Events Per Collision; entries", originName.data(), labels[iChannel].data()), {HistType::kTH1F, {axisNhadrons}}); } for (int iChannel = nCharmMesonChannels + nBeautyChannels; iChannel < nChannels; iChannel++) { // Charm baryons - registry.add(Form("%sCharmBaryons/hCount%s%s", originNames[iOrigin].data(), originNames[iOrigin].data(), particleNames[iChannel].data()), - Form("Event counter - %s %s; Events Per Collision; entries", originNames[iOrigin].data(), labels[iChannel].data()), {HistType::kTH1F, {axisNhadrons}}); + registry.add(Form("%sCharmBaryons/hCount%s%s", originName.data(), originName.data(), particleNames[iChannel].data()), + Form("Event counter - %s %s; Events Per Collision; entries", originName.data(), labels[iChannel].data()), {HistType::kTH1F, {axisNhadrons}}); } } for (int iChannel = nCharmMesonChannels; iChannel < nCharmMesonChannels + nBeautyChannels; iChannel++) { // Beauty mesons @@ -451,8 +451,8 @@ struct HfTaskMcValidationGen { double sumPyDau = 0.; double sumPzDau = 0.; bool momentumCheck = true; - for (std::size_t iDau = 0; iDau < listDaughters.size(); ++iDau) { - auto daughter = mcParticles.rawIteratorAt(listDaughters.at(iDau) - mcParticles.offset()); + for (const int listDaughter : listDaughters) { + auto daughter = mcParticles.rawIteratorAt(listDaughter - mcParticles.offset()); sumPxDau += daughter.px(); sumPyDau += daughter.py(); sumPzDau += daughter.pz(); diff --git a/PWGHF/Utils/utilsMcGen.h b/PWGHF/Utils/utilsMcGen.h index 094211e99db..8bde2fc9265 100644 --- a/PWGHF/Utils/utilsMcGen.h +++ b/PWGHF/Utils/utilsMcGen.h @@ -202,8 +202,8 @@ void fillMcMatchGen3Prong(TMcParticles const& mcParticles, if (std::abs(pdgMother) == Pdg::kDStar) { std::vector arrResoDaughIndexDStar = {}; RecoDecay::getDaughters(particle, &arrResoDaughIndexDStar, std::array{0}, DepthResoMax); - for (std::size_t iDaug = 0; iDaug < arrResoDaughIndexDStar.size(); iDaug++) { - auto daughDstar = mcParticles.rawIteratorAt(arrResoDaughIndexDStar[iDaug]); + for (const int iDaug : arrResoDaughIndexDStar) { + auto daughDstar = mcParticles.rawIteratorAt(iDaug); if (std::abs(daughDstar.pdgCode()) == Pdg::kD0 || std::abs(daughDstar.pdgCode()) == Pdg::kDPlus) { RecoDecay::getDaughters(daughDstar, &arrResoDaughIndex, std::array{0}, DepthResoMax); break; From b5abdc6969565804e0837cb2946332df9af01dfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Sat, 27 Sep 2025 00:28:44 +0200 Subject: [PATCH 07/25] Fix readability --- PWGHF/D2H/Macros/HFInvMassFitter.cxx | 29 +-- PWGHF/D2H/Macros/HFInvMassFitter.h | 15 +- PWGHF/D2H/Macros/runMassFitter.C | 54 ++-- .../candidateCreatorCharmResoReduced.cxx | 7 +- .../candidateCreatorLbReduced.cxx | 4 +- .../candidateSelectorB0ToDPiReduced.cxx | 2 +- .../candidateSelectorBplusToD0PiReduced.cxx | 2 +- .../candidateSelectorBsToDsPiReduced.cxx | 2 +- .../candidateSelectorLbToLcPiReduced.cxx | 2 +- .../dataCreatorCharmHadPiReduced.cxx | 6 +- .../dataCreatorCharmResoReduced.cxx | 34 ++- .../dataCreatorJpsiHadReduced.cxx | 2 +- PWGHF/D2H/Tasks/taskB0Reduced.cxx | 2 +- PWGHF/D2H/Tasks/taskBplusToJpsiKReduced.cxx | 4 +- PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx | 4 +- PWGHF/D2H/Tasks/taskCharmPolarisation.cxx | 12 +- .../D2H/Tasks/taskCharmResoToDTrkReduced.cxx | 3 +- PWGHF/D2H/Tasks/taskCharmResoToDV0Reduced.cxx | 33 ++- .../Tasks/taskDirectedFlowCharmHadrons.cxx | 18 +- PWGHF/D2H/Tasks/taskDs.cxx | 81 +++--- PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx | 16 +- PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx | 30 ++- PWGHF/D2H/Tasks/taskLb.cxx | 43 ++-- PWGHF/D2H/Tasks/taskSigmac.cxx | 9 +- PWGHF/D2H/Tasks/taskXicc.cxx | 4 +- PWGHF/HFC/Macros/DhCorrelationExtraction.cxx | 126 ++++----- PWGHF/HFC/Macros/DhCorrelationExtraction.h | 2 +- PWGHF/HFC/Macros/DhCorrelationFitter.h | 14 +- PWGHF/HFC/TableProducer/correlatorD0D0bar.cxx | 12 +- .../correlatorD0D0barBarrelFullPid.cxx | 12 +- .../HFC/TableProducer/correlatorD0Hadrons.cxx | 12 +- .../TableProducer/correlatorDMesonPairs.cxx | 32 +-- .../TableProducer/correlatorDplusDminus.cxx | 12 +- .../TableProducer/correlatorDplusHadrons.cxx | 4 +- .../HFC/TableProducer/correlatorDsHadrons.cxx | 9 +- .../TableProducer/correlatorDstarHadrons.cxx | 2 +- .../TableProducer/correlatorHfeHadrons.cxx | 6 +- .../HFC/TableProducer/correlatorLcHadrons.cxx | 38 ++- .../TableProducer/correlatorLcScHadrons.cxx | 24 +- .../derivedDataCreatorCorrelationsReduced.cxx | 5 +- .../HFC/TableProducer/femtoDreamProducer.cxx | 19 +- .../HFC/Tasks/taskCharmHadronsFemtoDream.cxx | 10 +- PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx | 6 +- PWGHF/HFC/Tasks/taskCorrelationDDbar.cxx | 4 +- .../HFC/Tasks/taskCorrelationDMesonPairs.cxx | 11 +- .../HFC/Tasks/taskCorrelationDplusHadrons.cxx | 16 +- PWGHF/HFC/Tasks/taskCorrelationHfeHadrons.cxx | 2 +- PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx | 20 +- PWGHF/HFC/Tasks/taskFlow.cxx | 26 +- PWGHF/HFC/Utils/utilsCorrelations.h | 9 +- .../electronSelectionWithTpcEmcal.cxx | 9 +- .../TableProducer/treeCreatorElectronDCA.cxx | 24 +- PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx | 21 +- .../Tasks/taskMuonCharmBeautySeparation.cxx | 3 +- PWGHF/HFL/Tasks/taskSingleElectron.cxx | 243 ++++++++++-------- PWGHF/HFL/Tasks/taskSingleMuonSource.cxx | 7 +- .../TableProducer/candidateCreator2Prong.cxx | 4 +- .../TableProducer/candidateCreator3Prong.cxx | 4 +- PWGHF/TableProducer/candidateCreatorB0.cxx | 4 +- PWGHF/TableProducer/candidateCreatorBplus.cxx | 2 +- PWGHF/TableProducer/candidateCreatorBs.cxx | 6 +- .../TableProducer/candidateCreatorCascade.cxx | 8 +- PWGHF/TableProducer/candidateCreatorDstar.cxx | 2 +- PWGHF/TableProducer/candidateCreatorLb.cxx | 2 +- .../candidateCreatorSigmac0plusplus.cxx | 43 ++-- ...candidateCreatorSigmac0plusplusCascade.cxx | 27 +- .../candidateCreatorXic0Omegac0.cxx | 69 +++-- .../candidateCreatorXicToXiPiPi.cxx | 4 +- PWGHF/TableProducer/candidateCreatorXicc.cxx | 2 +- .../candidateSelectorB0ToDPi.cxx | 2 +- .../candidateSelectorBplusToD0Pi.cxx | 2 +- .../candidateSelectorBsToDsPi.cxx | 8 +- PWGHF/TableProducer/candidateSelectorD0.cxx | 4 +- .../candidateSelectorDplusToPiKPi.cxx | 4 +- .../candidateSelectorDsToKKPi.cxx | 27 +- .../candidateSelectorDstarToD0Pi.cxx | 2 +- .../candidateSelectorLbToLcPi.cxx | 26 +- PWGHF/TableProducer/candidateSelectorLc.cxx | 13 +- .../candidateSelectorLcPidMl.cxx | 8 +- .../candidateSelectorLcToK0sP.cxx | 8 +- .../candidateSelectorOmegac0ToOmegaPi.cxx | 5 +- .../candidateSelectorOmegac0Xic0ToOmegaKa.cxx | 6 +- .../candidateSelectorXic0ToXiPiKf.cxx | 2 +- .../candidateSelectorXicToPKPi.cxx | 8 +- .../candidateSelectorXicToXiPiPi.cxx | 7 +- .../candidateSelectorXiccToPKPiPi.cxx | 2 +- PWGHF/TableProducer/mcPidTof.cxx | 27 +- PWGHF/TableProducer/trackIndexSkimCreator.cxx | 40 ++- PWGHF/TableProducer/treeCreatorLcToK0sP.cxx | 2 +- PWGHF/TableProducer/treeCreatorLcToPKPi.cxx | 14 +- PWGHF/TableProducer/treeCreatorOmegacSt.cxx | 8 +- .../treeCreatorSigmacCorrBkg.cxx | 11 +- .../TableProducer/treeCreatorTccToD0D0Pi.cxx | 3 +- PWGHF/Tasks/taskLcCentrality.cxx | 4 +- PWGHF/Tasks/taskMcEfficiency.cxx | 2 +- PWGHF/Tasks/taskMcEfficiencyToXiPi.cxx | 4 +- PWGHF/Tasks/taskMcGenPtRapShapes.cxx | 10 +- PWGHF/Tasks/taskMcValidation.cxx | 60 ++--- PWGHF/Tasks/taskSelOptimisation.cxx | 110 ++++---- PWGHF/Utils/utilsEvSelHf.h | 30 +-- PWGHF/Utils/utilsMcGen.h | 2 +- 101 files changed, 948 insertions(+), 848 deletions(-) diff --git a/PWGHF/D2H/Macros/HFInvMassFitter.cxx b/PWGHF/D2H/Macros/HFInvMassFitter.cxx index d1c1dcf0270..e69c9a194a6 100644 --- a/PWGHF/D2H/Macros/HFInvMassFitter.cxx +++ b/PWGHF/D2H/Macros/HFInvMassFitter.cxx @@ -56,8 +56,7 @@ using namespace RooFit; ClassImp(HFInvMassFitter); -HFInvMassFitter::HFInvMassFitter() : TNamed(), - mHistoInvMass(nullptr), +HFInvMassFitter::HFInvMassFitter() : mHistoInvMass(nullptr), mFitOption("L,E"), mMinMass(0), mMaxMass(5), @@ -128,8 +127,7 @@ HFInvMassFitter::HFInvMassFitter() : TNamed(), // default constructor } -HFInvMassFitter::HFInvMassFitter(const TH1* histoToFit, Double_t minValue, Double_t maxValue, Int_t fitTypeBkg, Int_t fitTypeSgn) : TNamed(), - mHistoInvMass(nullptr), +HFInvMassFitter::HFInvMassFitter(const TH1* histoToFit, Double_t minValue, Double_t maxValue, Int_t fitTypeBkg, Int_t fitTypeSgn) : mHistoInvMass(nullptr), mFitOption("L,E"), mMinMass(minValue), mMaxMass(maxValue), @@ -260,7 +258,7 @@ void HFInvMassFitter::doFit() if (mTypeOfBkgPdf == NoBkg) { // MC mRooNSgn = new RooRealVar("mRooNSig", "number of signal", 0.3 * mIntegralHisto, 0., 1.2 * mIntegralHisto); // signal yield mTotalPdf = new RooAddPdf("mMCFunc", "MC fit function", RooArgList(*sgnPdf), RooArgList(*mRooNSgn)); // create total pdf - if (!strcmp(mFitOption.Data(), "Chi2")) { + if (strcmp(mFitOption.Data(), "Chi2") == 0) { mTotalPdf->chi2FitTo(dataHistogram, Range("signal")); } else { mTotalPdf->fitTo(dataHistogram, Range("signal")); @@ -272,13 +270,13 @@ void HFInvMassFitter::doFit() } else { // data mBkgPdf = new RooAddPdf("mBkgPdf", "background fit function", RooArgList(*bkgPdf), RooArgList(*mRooNBkg)); if (mTypeOfSgnPdf == GausSec) { // two peak fit - if (!strcmp(mFitOption.Data(), "Chi2")) { + if (strcmp(mFitOption.Data(), "Chi2") == 0) { mBkgPdf->chi2FitTo(dataHistogram, Range("SBL,SBR,SEC"), Save()); } else { mBkgPdf->fitTo(dataHistogram, Range("SBL,SBR,SEC"), Save()); } } else { // single peak fit - if (!strcmp(mFitOption.Data(), "Chi2")) { + if (strcmp(mFitOption.Data(), "Chi2") == 0) { mBkgPdf->chi2FitTo(dataHistogram, Range("SBL,SBR"), Save()); } else { mBkgPdf->fitTo(dataHistogram, Range("SBL,SBR"), Save()); @@ -287,7 +285,7 @@ void HFInvMassFitter::doFit() // define the frame to evaluate background sidebands chi2 (bg pdf needs to be plotted within sideband ranges) RooPlot* frameTemporary = mass->frame(Title(Form("%s_temp", mHistoInvMass->GetTitle()))); dataHistogram.plotOn(frameTemporary, Name("data_for_bkgchi2")); - mBkgPdf->plotOn(frameTemporary, Range("SBL", "SBR"), Name("Bkg_sidebands")); + mBkgPdf->plotOn(frameTemporary, Range("SBL", true), Name("Bkg_sidebands")); mChiSquareOverNdfBkg = frameTemporary->chiSquare("Bkg_sidebands", "data_for_bkgchi2"); // calculate reduced chi2 / NDF of background sidebands (pre-fit) delete frameTemporary; RooAbsPdf* mBkgPdfPrefit{nullptr}; @@ -311,7 +309,7 @@ void HFInvMassFitter::doFit() } mSgnPdf = new RooAddPdf("mSgnPdf", "signal fit function", RooArgList(*sgnPdf), RooArgList(*mRooNSgn)); // create reflection template and fit to reflection - if (mHistoTemplateRefl) { + if (mHistoTemplateRefl != nullptr) { RooAbsPdf* reflPdf = createReflectionFitFunction(mWorkspace); // create reflection pdf RooDataHist reflHistogram("reflHistogram", "refl for fit", *mass, Import(*mHistoTemplateRefl)); mReflFrame = mass->frame(); @@ -319,7 +317,7 @@ void HFInvMassFitter::doFit() reflHistogram.plotOn(mReflOnlyFrame); mRooNRefl = new RooRealVar("mNRefl", "number of reflection", 0.5 * mHistoTemplateRefl->Integral(), 0, mHistoTemplateRefl->Integral()); RooAddPdf reflFuncTemp("reflFuncTemp", "template reflection fit function", RooArgList(*reflPdf), RooArgList(*mRooNRefl)); - if (!strcmp(mFitOption.Data(), "Chi2")) { + if (strcmp(mFitOption.Data(), "Chi2") == 0) { reflFuncTemp.chi2FitTo(reflHistogram); } else { reflFuncTemp.fitTo(reflHistogram); @@ -330,7 +328,7 @@ void HFInvMassFitter::doFit() mRooNRefl->setConstant(kTRUE); setReflFuncFixed(); // fix reflection pdf parameter mTotalPdf = new RooAddPdf("mTotalPdf", "background + signal + reflection fit function", RooArgList(*bkgPdf, *sgnPdf, *reflPdf), RooArgList(*mRooNBkg, *mRooNSgn, *mRooNRefl)); - if (!strcmp(mFitOption.Data(), "Chi2")) { + if (strcmp(mFitOption.Data(), "Chi2") == 0) { mTotalPdf->chi2FitTo(dataHistogram); } else { mTotalPdf->fitTo(dataHistogram); @@ -350,7 +348,7 @@ void HFInvMassFitter::doFit() mSgnPdf->plotOn(mResidualFrame, Normalization(1.0, RooAbsReal::RelativeExpected), LineColor(kBlue)); } else { mTotalPdf = new RooAddPdf("mTotalPdf", "background + signal pdf", RooArgList(*bkgPdf, *sgnPdf), RooArgList(*mRooNBkg, *mRooNSgn)); - if (!strcmp(mFitOption.Data(), "Chi2")) { + if (strcmp(mFitOption.Data(), "Chi2") == 0) { mTotalPdf->chi2FitTo(dataHistogram); } else { mTotalPdf->fitTo(dataHistogram); @@ -576,7 +574,7 @@ void HFInvMassFitter::drawFit(TVirtualPad* pad, Int_t writeFitInfo) textInfoLeft->AddText(Form("B (%d#sigma) = %.0f #pm %.0f", mNSigmaForSidebands, mBkgYield, mBkgYieldErr)); textInfoLeft->AddText(Form("S/B (%d#sigma) = %.4g ", mNSigmaForSidebands, mRawYield / mBkgYield)); } - if (mReflPdf) { + if (mReflPdf != nullptr) { textInfoLeft->AddText(Form("Refl/Sig = %.3f #pm %.3f ", mReflOverSgn, 0.0)); } if (mTypeOfBkgPdf != NoBkg) { @@ -610,7 +608,7 @@ void HFInvMassFitter::drawFit(TVirtualPad* pad, Int_t writeFitInfo) mInvMassFrame->GetXaxis()->SetTitle(Form("%s", mHistoInvMass->GetXaxis()->GetTitle())); mInvMassFrame->Draw(); highlightPeakRegion(mInvMassFrame); - if (mHistoTemplateRefl) { + if (mHistoTemplateRefl != nullptr) { mReflFrame->Draw("same"); } } @@ -643,8 +641,9 @@ void HFInvMassFitter::drawResidual(TVirtualPad* pad) // draw peak region with vertical lines void HFInvMassFitter::highlightPeakRegion(const RooPlot* plot, Color_t color, Width_t width, Style_t style) const { - if (!mHighlightPeakRegion) + if (!mHighlightPeakRegion) { return; + } double yMin = plot->GetMinimum(); double yMax = plot->GetMaximum(); const Double_t mean = mRooMeanSgn->getVal(); diff --git a/PWGHF/D2H/Macros/HFInvMassFitter.h b/PWGHF/D2H/Macros/HFInvMassFitter.h index e8506ab00a3..c4d558da0f9 100644 --- a/PWGHF/D2H/Macros/HFInvMassFitter.h +++ b/PWGHF/D2H/Macros/HFInvMassFitter.h @@ -70,9 +70,9 @@ class HFInvMassFitter : public TNamed ~HFInvMassFitter() override; void setHistogramForFit(const TH1* histoToFit) { - if (mHistoInvMass) { - delete mHistoInvMass; - } + + delete mHistoInvMass; + mHistoInvMass = dynamic_cast(histoToFit->Clone("mHistoInvMass")); mHistoInvMass->SetDirectory(nullptr); } @@ -99,7 +99,7 @@ class HFInvMassFitter : public TNamed mParamSgn = sigmaLimit; } void setParticlePdgMass(Double_t mass) { mMassParticle = mass; } - Double_t getParticlePdgMass() { return mMassParticle; } + Double_t getParticlePdgMass() const { return mMassParticle; } void setInitialGaussianMean(Double_t mean) { mMass = mean; @@ -190,7 +190,7 @@ class HFInvMassFitter : public TNamed } void setTemplateReflections(const TH1* histoRefl, Int_t fitTypeRefl = DoubleGaus) { - if (!histoRefl) { + if (histoRefl == nullptr) { mEnableReflections = kFALSE; } mHistoTemplateRefl = dynamic_cast(histoRefl->Clone("mHistoTemplateRefl")); @@ -213,11 +213,10 @@ class HFInvMassFitter : public TNamed [[nodiscard]] Double_t getSigmaUncertainty() const { return mRooSigmaSgn->getError(); } [[nodiscard]] Double_t getReflOverSig() const { - if (mReflPdf) { + if (mReflPdf != nullptr) { return mReflOverSgn; - } else { - return 0; } + return 0; } void calculateSignal(Double_t& signal, Double_t& signalErr) const; void countSignal(Double_t& signal, Double_t& signalErr) const; diff --git a/PWGHF/D2H/Macros/runMassFitter.C b/PWGHF/D2H/Macros/runMassFitter.C index e6cb569f4b0..68ff814da54 100644 --- a/PWGHF/D2H/Macros/runMassFitter.C +++ b/PWGHF/D2H/Macros/runMassFitter.C @@ -47,7 +47,7 @@ int runMassFitter(const TString& configFileName = "config_massfitter.json"); template void readArray(const Value& jsonArray, std::vector& output) { - for (auto it = jsonArray.Begin(); it != jsonArray.End(); it++) { + for (const auto* it = jsonArray.Begin(); it != jsonArray.End(); it++) { auto value = it->template Get(); output.emplace_back(value); } @@ -70,7 +70,7 @@ int runMassFitter(const TString& configFileName) { // load config FILE* configFile = fopen(configFileName.Data(), "r"); - if (!configFile) { + if (configFile == nullptr) { throw std::runtime_error("ERROR: Missing configuration json file: " + configFileName); } @@ -208,15 +208,15 @@ int runMassFitter(const TString& configFileName) const double massPDG = TDatabasePDG::Instance()->GetParticle(particles[particleName.Data()].second.c_str())->Mass(); // load inv-mass histograms - auto inputFile = TFile::Open(inputFileName.Data()); - if (!inputFile || !inputFile->IsOpen()) { + auto* inputFile = TFile::Open(inputFileName.Data()); + if ((inputFile == nullptr) || !inputFile->IsOpen()) { return -1; } TFile* inputFileRefl = nullptr; if (enableRefl) { inputFileRefl = TFile::Open(reflFileName.Data()); - if (!inputFileRefl || !inputFileRefl->IsOpen()) { + if ((inputFileRefl == nullptr) || !inputFileRefl->IsOpen()) { return -1; } } @@ -232,10 +232,10 @@ int runMassFitter(const TString& configFileName) hMassRefl[iSliceVar] = inputFileRefl->Get(reflHistoName[iSliceVar].data()); hMassSgn[iSliceVar] = inputFileRefl->Get(fdHistoName[iSliceVar].data()); hMassSgn[iSliceVar]->Add(inputFileRefl->Get(promptHistoName[iSliceVar].data())); - if (!hMassRefl[iSliceVar]) { + if (hMassRefl[iSliceVar] == nullptr) { throw std::runtime_error("ERROR: MC reflection histogram not found! Exit!"); } - if (!hMassSgn[iSliceVar]) { + if (hMassSgn[iSliceVar] == nullptr) { throw std::runtime_error("ERROR: MC prompt or FD histogram not found! Exit!"); } } @@ -247,7 +247,7 @@ int runMassFitter(const TString& configFileName) hMass[iSliceVar]->Add(inputFile->Get(fdSecPeakHistoName[iSliceVar].data())); } } - if (!hMass[iSliceVar]) { + if (hMass[iSliceVar] == nullptr) { throw std::runtime_error("ERROR: input histogram for fit not found! Exit!"); } hMass[iSliceVar]->SetDirectory(nullptr); @@ -255,39 +255,39 @@ int runMassFitter(const TString& configFileName) inputFile->Close(); // define output histos - auto hRawYieldsSignal = new TH1D("hRawYieldsSignal", ";" + sliceVarName + "(" + sliceVarUnit + ");raw yield", - nSliceVarBins, sliceVarLimits.data()); - auto hRawYieldsSignalCounted = new TH1D("hRawYieldsSignalCounted", ";" + sliceVarName + "(" + sliceVarUnit + ");raw yield via bin count", - nSliceVarBins, sliceVarLimits.data()); - auto hRawYieldsSigma = new TH1D( + auto* hRawYieldsSignal = new TH1D("hRawYieldsSignal", ";" + sliceVarName + "(" + sliceVarUnit + ");raw yield", + nSliceVarBins, sliceVarLimits.data()); + auto* hRawYieldsSignalCounted = new TH1D("hRawYieldsSignalCounted", ";" + sliceVarName + "(" + sliceVarUnit + ");raw yield via bin count", + nSliceVarBins, sliceVarLimits.data()); + auto* hRawYieldsSigma = new TH1D( "hRawYieldsSigma", ";" + sliceVarName + "(" + sliceVarUnit + ");width (GeV/#it{c}^{2})", nSliceVarBins, sliceVarLimits.data()); - auto hRawYieldsMean = new TH1D( + auto* hRawYieldsMean = new TH1D( "hRawYieldsMean", ";" + sliceVarName + "(" + sliceVarUnit + ");mean (GeV/#it{c}^{2})", nSliceVarBins, sliceVarLimits.data()); - auto hRawYieldsSignificance = new TH1D( + auto* hRawYieldsSignificance = new TH1D( "hRawYieldsSignificance", ";" + sliceVarName + "(" + sliceVarUnit + ");significance (3#sigma)", nSliceVarBins, sliceVarLimits.data()); - auto hRawYieldsSgnOverBkg = + auto* hRawYieldsSgnOverBkg = new TH1D("hRawYieldsSgnOverBkg", ";" + sliceVarName + "(" + sliceVarUnit + ");S/B (3#sigma)", nSliceVarBins, sliceVarLimits.data()); - auto hRawYieldsBkg = + auto* hRawYieldsBkg = new TH1D("hRawYieldsBkg", ";" + sliceVarName + "(" + sliceVarUnit + ");Background (3#sigma)", nSliceVarBins, sliceVarLimits.data()); - auto hRawYieldsChiSquareBkg = + auto* hRawYieldsChiSquareBkg = new TH1D("hRawYieldsChiSquareBkg", ";" + sliceVarName + "(" + sliceVarUnit + ");#chi^{2}/#it{ndf}", nSliceVarBins, sliceVarLimits.data()); - auto hRawYieldsChiSquareTotal = + auto* hRawYieldsChiSquareTotal = new TH1D("hRawYieldsChiSquareTotal", ";" + sliceVarName + "(" + sliceVarUnit + ");#chi^{2}/#it{ndf}", nSliceVarBins, sliceVarLimits.data()); - auto hReflectionOverSignal = + auto* hReflectionOverSignal = new TH1D("hReflectionOverSignal", ";" + sliceVarName + "(" + sliceVarUnit + ");Refl/Signal", nSliceVarBins, sliceVarLimits.data()); const Int_t nConfigsToSave = 6; - auto hFitConfig = new TH2F("hfitConfig", "Fit Configurations", nConfigsToSave, 0, 6, nSliceVarBins, sliceVarLimits.data()); + auto* hFitConfig = new TH2F("hfitConfig", "Fit Configurations", nConfigsToSave, 0, 6, nSliceVarBins, sliceVarLimits.data()); const char* hFitConfigXLabel[nConfigsToSave] = {"mass min", "mass max", "rebin num", "fix sigma", "bkg func", "sgn func"}; - hFitConfig->SetStats(0); + hFitConfig->SetStats(false); hFitConfig->LabelsDeflate("X"); hFitConfig->LabelsDeflate("Y"); hFitConfig->LabelsOption("v"); @@ -310,8 +310,8 @@ int runMassFitter(const TString& configFileName) TH1* histToFix = nullptr; if (isFix) { if (fixManual.empty()) { - auto fixInputFile = TFile::Open(fixFileName.data()); - if (!fixInputFile) { + auto* fixInputFile = TFile::Open(fixFileName.data()); + if (fixInputFile == nullptr) { throw std::runtime_error("Cannot open file for fixed " + var); } const std::string histName = "hRawYields" + var; @@ -364,7 +364,7 @@ int runMassFitter(const TString& configFileName) for (unsigned int iSliceVar = 0; iSliceVar < nSliceVarBins; iSliceVar++) { const Int_t iCanvas = std::floor(static_cast(iSliceVar) / nCanvasesMax); - hMassForFit[iSliceVar] = static_cast(hMass[iSliceVar]->Rebin(nRebin[iSliceVar])); + hMassForFit[iSliceVar] = hMass[iSliceVar]->Rebin(nRebin[iSliceVar]); TString ptTitle = Form("%0.2f < " + sliceVarName + " < %0.2f " + sliceVarUnit, sliceVarMin[iSliceVar], sliceVarMax[iSliceVar]); hMassForFit[iSliceVar]->SetTitle(Form("%s;%s;Counts per %0.1f MeV/#it{c}^{2}", @@ -373,8 +373,8 @@ int runMassFitter(const TString& configFileName) hMassForFit[iSliceVar]->SetName(Form("MassForFit%d", iSliceVar)); if (enableRefl) { - hMassForRefl[iSliceVar] = static_cast(hMassRefl[iSliceVar]->Rebin(nRebin[iSliceVar])); - hMassForSgn[iSliceVar] = static_cast(hMassSgn[iSliceVar]->Rebin(nRebin[iSliceVar])); + hMassForRefl[iSliceVar] = hMassRefl[iSliceVar]->Rebin(nRebin[iSliceVar]); + hMassForSgn[iSliceVar] = hMassSgn[iSliceVar]->Rebin(nRebin[iSliceVar]); } Double_t reflOverSgn = 0; diff --git a/PWGHF/D2H/TableProducer/candidateCreatorCharmResoReduced.cxx b/PWGHF/D2H/TableProducer/candidateCreatorCharmResoReduced.cxx index baef99914fb..618ac8db5a9 100644 --- a/PWGHF/D2H/TableProducer/candidateCreatorCharmResoReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateCreatorCharmResoReduced.cxx @@ -184,11 +184,10 @@ struct HfCandidateCreatorCharmResoReduced { { if (!cfgDmesCuts.keepSideBands) { return (invMass >= cfgDmesCuts.cutsD->get(ptBin, "invMassSignalLow") && invMass <= cfgDmesCuts.cutsD->get(ptBin, "invMassSignalHigh")); - } else { - return ((invMass >= cfgDmesCuts.cutsD->get(ptBin, "invMassLeftSBLow") && invMass <= cfgDmesCuts.cutsD->get(ptBin, "invMassLeftSBHigh")) || - (invMass >= cfgDmesCuts.cutsD->get(ptBin, "invMassRightSBLow") && invMass <= cfgDmesCuts.cutsD->get(ptBin, "invMassRightSBHigh")) || - (invMass >= cfgDmesCuts.cutsD->get(ptBin, "invMassSignalLow") && invMass <= cfgDmesCuts.cutsD->get(ptBin, "invMassSignalHigh"))); } + return ((invMass >= cfgDmesCuts.cutsD->get(ptBin, "invMassLeftSBLow") && invMass <= cfgDmesCuts.cutsD->get(ptBin, "invMassLeftSBHigh")) || + (invMass >= cfgDmesCuts.cutsD->get(ptBin, "invMassRightSBLow") && invMass <= cfgDmesCuts.cutsD->get(ptBin, "invMassRightSBHigh")) || + (invMass >= cfgDmesCuts.cutsD->get(ptBin, "invMassSignalLow") && invMass <= cfgDmesCuts.cutsD->get(ptBin, "invMassSignalHigh"))); } /// Basic selection of D candidates diff --git a/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx b/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx index 3246cedb03f..6bdd1e8c881 100644 --- a/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx @@ -109,8 +109,8 @@ struct HfCandidateCreatorLbReduced { } template - inline std::pair computeInvMass2LcPiWindow(Config const& configs, - float invMassWindowLcPiTolerance) + std::pair computeInvMass2LcPiWindow(Config const& configs, + float invMassWindowLcPiTolerance) { myInvMassWindowLcPi = 0.0f; diff --git a/PWGHF/D2H/TableProducer/candidateSelectorB0ToDPiReduced.cxx b/PWGHF/D2H/TableProducer/candidateSelectorB0ToDPiReduced.cxx index 51ba23c8511..18cf281a21c 100644 --- a/PWGHF/D2H/TableProducer/candidateSelectorB0ToDPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateSelectorB0ToDPiReduced.cxx @@ -97,7 +97,7 @@ struct HfCandidateSelectorB0ToDPiReduced { o2::analysis::HfMlResponseB0ToDPi hfMlResponse; float outputMlNotPreselected = -1.; - std::vector outputMl = {}; + std::vector outputMl; o2::ccdb::CcdbApi ccdbApi; TrackSelectorPi selectorPion; diff --git a/PWGHF/D2H/TableProducer/candidateSelectorBplusToD0PiReduced.cxx b/PWGHF/D2H/TableProducer/candidateSelectorBplusToD0PiReduced.cxx index 3e1554fdb2e..d67af343e8b 100644 --- a/PWGHF/D2H/TableProducer/candidateSelectorBplusToD0PiReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateSelectorBplusToD0PiReduced.cxx @@ -97,7 +97,7 @@ struct HfCandidateSelectorBplusToD0PiReduced { o2::analysis::HfMlResponseBplusToD0PiReduced hfMlResponse; float outputMlNotPreselected = -1.; - std::vector outputMl = {}; + std::vector outputMl; o2::ccdb::CcdbApi ccdbApi; HfHelper hfHelper; diff --git a/PWGHF/D2H/TableProducer/candidateSelectorBsToDsPiReduced.cxx b/PWGHF/D2H/TableProducer/candidateSelectorBsToDsPiReduced.cxx index 99e71e34acd..c795c4ea964 100644 --- a/PWGHF/D2H/TableProducer/candidateSelectorBsToDsPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateSelectorBsToDsPiReduced.cxx @@ -93,7 +93,7 @@ struct HfCandidateSelectorBsToDsPiReduced { Configurable loadModelsFromCCDB{"loadModelsFromCCDB", false, "Flag to enable or disable the loading of models from CCDB"}; o2::analysis::HfMlResponseBsToDsPi hfMlResponse; - std::vector outputMl = {}; + std::vector outputMl; o2::ccdb::CcdbApi ccdbApi; TrackSelectorPi selectorPion; diff --git a/PWGHF/D2H/TableProducer/candidateSelectorLbToLcPiReduced.cxx b/PWGHF/D2H/TableProducer/candidateSelectorLbToLcPiReduced.cxx index dbe86c4905d..3a67cdffce6 100644 --- a/PWGHF/D2H/TableProducer/candidateSelectorLbToLcPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateSelectorLbToLcPiReduced.cxx @@ -94,7 +94,7 @@ struct HfCandidateSelectorLbToLcPiReduced { o2::analysis::HfMlResponseLbToLcPi hfMlResponse; float outputMlNotPreselected = -1.; - std::vector outputMl = {}; + std::vector outputMl; o2::ccdb::CcdbApi ccdbApi; TrackSelectorPi selectorPion; diff --git a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx index 546c3a2c194..6a8bf45bd7a 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx @@ -349,8 +349,8 @@ struct HfDataCreatorCharmHadPiReduced { registry.get(HIST("hEvents"))->GetXaxis()->SetBinLabel(iBin + 1, labels[iBin].data()); } - std::string charmHadTitle = ""; - std::string histMassTitle = ""; + std::string charmHadTitle; + std::string histMassTitle; if (doprocessDplusPiData || doprocessDplusPiDataWithMl || doprocessDplusPiDataWithQvec || doprocessDplusPiDataWithMlAndQvec || doprocessDplusPiMc || doprocessDplusPiMcWithMl) { charmHadTitle = "D^{#plus}"; histMassTitle = "Dplus"; @@ -402,7 +402,7 @@ struct HfDataCreatorCharmHadPiReduced { doprocessDstarPiMc || doprocessDstarPiMcWithMl) { const auto& workflows = initContext.services().get(); for (const DeviceSpec& device : workflows.devices) { - if (device.name.compare("hf-data-creator-charm-had-pi-reduced") == 0) { + if (device.name == "hf-data-creator-charm-had-pi-reduced") { // init HF event selection helper hfEvSelMc.init(device, registry); break; diff --git a/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx index 5b0281eb52d..0e52d741f56 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx @@ -385,7 +385,7 @@ struct HfDataCreatorCharmResoReduced { const auto& workflows = initContext.services().get(); for (const DeviceSpec& device : workflows.devices) { - if (device.name.compare("hf-data-creator-charm-reso-reduced") == 0) { + if (device.name == "hf-data-creator-charm-reso-reduced") { // init HF event selection helper hfEvSelMc.init(device, registry); break; @@ -446,8 +446,9 @@ struct HfDataCreatorCharmResoReduced { const auto& trackPos = dauTracks[0]; const auto& trackNeg = dauTracks[1]; // single-tracks selection - if (!selectV0Daughter(trackPos, dDaughtersIds) || !selectV0Daughter(trackNeg, dDaughtersIds)) + if (!selectV0Daughter(trackPos, dDaughtersIds) || !selectV0Daughter(trackNeg, dDaughtersIds)) { return false; + } // daughters DCA to V0's collision primary vertex std::array dcaInfo{}; auto trackPosPar = getTrackPar(trackPos); @@ -536,20 +537,23 @@ struct HfDataCreatorCharmResoReduced { // PID if (TESTBIT(candidateV0.v0Type, BachelorType::K0s)) { if ((trackPos.hasTPC() && std::fabs(trackPos.tpcNSigmaPi()) > cfgV0Cuts.nSigmaTpc) || - (trackNeg.hasTPC() && std::fabs(trackNeg.tpcNSigmaPi()) > cfgV0Cuts.nSigmaTpc)) + (trackNeg.hasTPC() && std::fabs(trackNeg.tpcNSigmaPi()) > cfgV0Cuts.nSigmaTpc)) { CLRBIT(candidateV0.v0Type, BachelorType::K0s); + } } if (TESTBIT(candidateV0.v0Type, BachelorType::Lambda)) { if ((trackPos.hasTPC() && std::fabs(trackPos.tpcNSigmaPr()) > cfgV0Cuts.nSigmaTpc) || (trackPos.hasTOF() && std::fabs(trackPos.tofNSigmaPr()) > cfgV0Cuts.nSigmaTofPr) || - (trackNeg.hasTPC() && std::fabs(trackNeg.tpcNSigmaPi()) > cfgV0Cuts.nSigmaTpc)) + (trackNeg.hasTPC() && std::fabs(trackNeg.tpcNSigmaPi()) > cfgV0Cuts.nSigmaTpc)) { CLRBIT(candidateV0.v0Type, BachelorType::Lambda); + } } if (TESTBIT(candidateV0.v0Type, BachelorType::AntiLambda)) { if ((trackPos.hasTPC() && std::fabs(trackPos.tpcNSigmaPi()) > cfgV0Cuts.nSigmaTpc) || (trackNeg.hasTPC() && std::fabs(trackNeg.tpcNSigmaPr()) > cfgV0Cuts.nSigmaTpc) || - (trackNeg.hasTOF() && std::fabs(trackNeg.tofNSigmaPr()) > cfgV0Cuts.nSigmaTofPr)) + (trackNeg.hasTOF() && std::fabs(trackNeg.tofNSigmaPr()) > cfgV0Cuts.nSigmaTofPr)) { CLRBIT(candidateV0.v0Type, BachelorType::AntiLambda); + } } if (candidateV0.v0Type == 0) { return false; @@ -821,9 +825,11 @@ struct HfDataCreatorCharmResoReduced { auto pdgCode = std::abs(particle.pdgCode()); if (pdgCode == kPiPlus) { return hf_decay::hf_cand_reso::PartialMatchMc::PionMatched; - } else if (pdgCode == kKPlus) { + } + if (pdgCode == kKPlus) { return hf_decay::hf_cand_reso::PartialMatchMc::KaonMatched; - } else if (pdgCode == kProton) { + } + if (pdgCode == kProton) { return hf_decay::hf_cand_reso::PartialMatchMc::ProtonMatched; } return 0; @@ -1265,12 +1271,13 @@ struct HfDataCreatorCharmResoReduced { // Optional filling of MC Rec table, for now only implemented for Ds1->D*K0s and Ds2*->D+K0s if constexpr (doMc) { int indexHfCandCharm{-1}; - if constexpr (dType == DType::Dstar) + if constexpr (dType == DType::Dstar) { indexHfCandCharm = hfCandDstar.lastIndex() + 1; - else if constexpr (dType == DType::Dplus) + } else if constexpr (dType == DType::Dplus) { indexHfCandCharm = hfCandD3Pr.lastIndex() + 1; - else if constexpr (dType == DType::D0) + } else if constexpr (dType == DType::D0) { indexHfCandCharm = hfCandD2Pr.lastIndex() + 1; + } fillMcRecoInfoDV0(particlesMc, candD, v0, tracksIU, indexHfCandCharm, selectedV0s[v0.globalIndex()]); } } // end of loop on V0 candidates @@ -1464,12 +1471,13 @@ struct HfDataCreatorCharmResoReduced { fillHfCandD = true; if constexpr (doMc) { int indexHfCandCharm{-1}; - if constexpr (dType == DType::Dstar) + if constexpr (dType == DType::Dstar) { indexHfCandCharm = hfCandDstar.lastIndex() + 1; - else if constexpr (dType == DType::Dplus) + } else if constexpr (dType == DType::Dplus) { indexHfCandCharm = hfCandD3Pr.lastIndex() + 1; - else if constexpr (dType == DType::D0) + } else if constexpr (dType == DType::D0) { indexHfCandCharm = hfCandD2Pr.lastIndex() + 1; + } fillMcRecoInfoDTrack(particlesMc, candD, track, tracks, indexHfCandCharm, selectedTracks[track.globalIndex()]); } } // end of loop on bachelor tracks diff --git a/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx index 469040aa4dc..98e3b09d390 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx @@ -339,7 +339,7 @@ struct HfDataCreatorJpsiHadReduced { if (doprocessJpsiKMc || doprocessJpsiPhiMc) { const auto& workflows = initContext.services().get(); for (const DeviceSpec& device : workflows.devices) { - if (device.name.compare("hf-data-creator-jpsi-had-reduced") == 0) { + if (device.name == "hf-data-creator-jpsi-had-reduced") { // init HF event selection helper hfEvSelMc.init(device, registry); break; diff --git a/PWGHF/D2H/Tasks/taskB0Reduced.cxx b/PWGHF/D2H/Tasks/taskB0Reduced.cxx index fefbd739f11..2cb28375d86 100644 --- a/PWGHF/D2H/Tasks/taskB0Reduced.cxx +++ b/PWGHF/D2H/Tasks/taskB0Reduced.cxx @@ -236,7 +236,7 @@ struct HfTaskB0Reduced { doprocessMcDplusPiWithDmesMlAndDecayTypeCheck, doprocessMcDplusPiWithB0Ml, doprocessMcDplusPiWithB0MlAndDecayTypeCheck}; const AxisSpec axisMass = ((std::accumulate(processFuncDplusPi.begin(), processFuncDplusPi.end(), 0)) > 0) ? axisMassDminus : axisMassDeltaMassDStar; - std::string dMesSpecie{""}; + std::string dMesSpecie; if ((std::accumulate(processFuncDplusPi.begin(), processFuncDplusPi.end(), 0)) > 0) { dMesSpecie += "D^{#minus}"; } else { diff --git a/PWGHF/D2H/Tasks/taskBplusToJpsiKReduced.cxx b/PWGHF/D2H/Tasks/taskBplusToJpsiKReduced.cxx index 25bec4a1f6f..d1595756ab1 100644 --- a/PWGHF/D2H/Tasks/taskBplusToJpsiKReduced.cxx +++ b/PWGHF/D2H/Tasks/taskBplusToJpsiKReduced.cxx @@ -242,7 +242,7 @@ struct HfTaskBplusToJpsiKReduced { o2::ccdb::CcdbApi ccdbApi; using TracksKaon = soa::Join; - std::vector outputMl = {}; + std::vector outputMl; // Filter filterSelectCandidates = (aod::hf_sel_candidate_bplus::isSelBplusToJpsiPi >= selectionFlagBplus); @@ -324,7 +324,7 @@ struct HfTaskBplusToJpsiKReduced { /// Calculate pseudorapidity from track tan(lambda) /// \param tgl is the track tangent of the dip angle /// \return pseudorapidity - inline float absEta(float tgl) + float absEta(float tgl) { return std::abs(std::log(std::tan(o2::constants::math::PIQuarter - 0.5f * std::atan(tgl)))); } diff --git a/PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx b/PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx index bf06d3c7295..fc2eb8c1ac9 100644 --- a/PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx +++ b/PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx @@ -267,7 +267,7 @@ struct HfTaskBsToJpsiPhiReduced { o2::ccdb::CcdbApi ccdbApi; using TracksKaon = soa::Join; - std::vector outputMl = {}; + std::vector outputMl; // Filter filterSelectCandidates = (aod::hf_sel_candidate_bplus::isSelBsToJpsiPi >= selectionFlagBs); @@ -355,7 +355,7 @@ struct HfTaskBsToJpsiPhiReduced { /// Calculate pseudorapidity from track tan(lambda) /// \param tgl is the track tangent of the dip angle /// \return pseudorapidity - inline float absEta(float tgl) + float absEta(float tgl) { return std::abs(std::log(std::tan(o2::constants::math::PIQuarter - 0.5f * std::atan(tgl)))); } diff --git a/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx b/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx index 133eded640f..26500d5e3a3 100644 --- a/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx +++ b/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx @@ -1976,23 +1976,23 @@ struct HfTaskCharmPolarisation { int pdgMotherProng0 = -1; int pdgMotherProng1 = -1; int pdgMotherProng2 = -1; - bool atLeast2ProngsFromSameMother = (idMothersProng0.size() > 0 && idMothersProng1.size() > 0 && idMothersProng0.at(0) == idMothersProng1.at(0)) || - (idMothersProng1.size() > 0 && idMothersProng2.size() > 0 && idMothersProng1.at(0) == idMothersProng2.at(0)) || - (idMothersProng0.size() > 0 && idMothersProng2.size() > 0 && idMothersProng0.at(0) == idMothersProng2.at(0)); + bool atLeast2ProngsFromSameMother = (!idMothersProng0.empty() && !idMothersProng1.empty() && idMothersProng0.at(0) == idMothersProng1.at(0)) || + (!idMothersProng1.empty() && !idMothersProng2.empty() && idMothersProng1.at(0) == idMothersProng2.at(0)) || + (!idMothersProng0.empty() && !idMothersProng2.empty() && idMothersProng0.at(0) == idMothersProng2.at(0)); if (atLeast2ProngsFromSameMother) { - if (idMothersProng0.size() > 0) { + if (!idMothersProng0.empty()) { /// BEWARE: in case of mcCollision grouping, the idMother can anyway point to a particle in another collision (*) /// therefore the rawIteratorAt call might crash the code because one goes above the (grouped) particles table size auto mother = particles.rawIteratorAt(idMothersProng0.at(0) - particles.offset()); pdgMotherProng0 = std::abs(mother.pdgCode()); // PDG code of the mother } - if (idMothersProng1.size() > 0) { + if (!idMothersProng1.empty()) { /// BEWARE: in case of mcCollision grouping, the idMother can anyway point to a particle in another collision (*) /// therefore the rawIteratorAt call might crash the code because one goes above the (grouped) particles table size auto mother = particles.rawIteratorAt(idMothersProng1.at(0) - particles.offset()); pdgMotherProng1 = std::abs(mother.pdgCode()); // PDG code of the mother } - if (idMothersProng2.size() > 0) { + if (!idMothersProng2.empty()) { /// BEWARE: in case of mcCollision grouping, the idMother can anyway point to a particle in another collision (*) /// therefore the rawIteratorAt call might crash the code because one goes above the (grouped) particles table size auto mother = particles.rawIteratorAt(idMothersProng2.at(0) - particles.offset()); diff --git a/PWGHF/D2H/Tasks/taskCharmResoToDTrkReduced.cxx b/PWGHF/D2H/Tasks/taskCharmResoToDTrkReduced.cxx index 362933d9124..347184a9248 100644 --- a/PWGHF/D2H/Tasks/taskCharmResoToDTrkReduced.cxx +++ b/PWGHF/D2H/Tasks/taskCharmResoToDTrkReduced.cxx @@ -347,7 +347,8 @@ struct HfTaskCharmResoToDTrkReduced { } if (doWrongSign && cand.isWrongSign() == 0) { continue; - } else if (!doWrongSign && cand.isWrongSign() != 0) { + } + if (!doWrongSign && cand.isWrongSign() != 0) { continue; } diff --git a/PWGHF/D2H/Tasks/taskCharmResoToDV0Reduced.cxx b/PWGHF/D2H/Tasks/taskCharmResoToDV0Reduced.cxx index 360b8a3002f..6d5ac96757a 100644 --- a/PWGHF/D2H/Tasks/taskCharmResoToDV0Reduced.cxx +++ b/PWGHF/D2H/Tasks/taskCharmResoToDV0Reduced.cxx @@ -270,14 +270,17 @@ struct HfTaskCharmResoToDV0Reduced { if (channel == DecayChannel::DstarK0s && !hf_decay::hf_cand_reso::particlesToDstarK0s.contains(static_cast(std::abs(flagMcMatchRec)))) { return; - } else if (channel == DecayChannel::DplusK0s && - !hf_decay::hf_cand_reso::particlesToDplusK0s.contains(static_cast(std::abs(flagMcMatchRec)))) { + } + if (channel == DecayChannel::DplusK0s && + !hf_decay::hf_cand_reso::particlesToDplusK0s.contains(static_cast(std::abs(flagMcMatchRec)))) { return; - } else if (channel == DecayChannel::DplusLambda && - !hf_decay::hf_cand_reso::particlesToDplusLambda.contains(static_cast(std::abs(flagMcMatchRec)))) { + } + if (channel == DecayChannel::DplusLambda && + !hf_decay::hf_cand_reso::particlesToDplusLambda.contains(static_cast(std::abs(flagMcMatchRec)))) { return; - } else if (channel == DecayChannel::D0Lambda && - !hf_decay::hf_cand_reso::particlesToD0Lambda.contains(static_cast(std::abs(flagMcMatchRec)))) { + } + if (channel == DecayChannel::D0Lambda && + !hf_decay::hf_cand_reso::particlesToD0Lambda.contains(static_cast(std::abs(flagMcMatchRec)))) { return; } } @@ -390,7 +393,8 @@ struct HfTaskCharmResoToDV0Reduced { } if (doWrongSign && cand.isWrongSign() == 0) { continue; - } else if (!doWrongSign && cand.isWrongSign() != 0) { + } + if (!doWrongSign && cand.isWrongSign() != 0) { continue; } @@ -450,14 +454,17 @@ struct HfTaskCharmResoToDV0Reduced { if (channel == DecayChannel::DstarK0s && !hf_decay::hf_cand_reso::particlesToDstarK0s.contains(static_cast(std::abs(flag)))) { continue; - } else if (channel == DecayChannel::DplusK0s && - !hf_decay::hf_cand_reso::particlesToDplusK0s.contains(static_cast(std::abs(flag)))) { + } + if (channel == DecayChannel::DplusK0s && + !hf_decay::hf_cand_reso::particlesToDplusK0s.contains(static_cast(std::abs(flag)))) { continue; - } else if (channel == DecayChannel::DplusLambda && - !hf_decay::hf_cand_reso::particlesToDplusLambda.contains(static_cast(std::abs(flag)))) { + } + if (channel == DecayChannel::DplusLambda && + !hf_decay::hf_cand_reso::particlesToDplusLambda.contains(static_cast(std::abs(flag)))) { continue; - } else if (channel == DecayChannel::D0Lambda && - !hf_decay::hf_cand_reso::particlesToD0Lambda.contains(static_cast(std::abs(flag)))) { + } + if (channel == DecayChannel::D0Lambda && + !hf_decay::hf_cand_reso::particlesToD0Lambda.contains(static_cast(std::abs(flag)))) { continue; } registry.fill(HIST("hYGenAll"), ptParticle, yParticle); diff --git a/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx b/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx index 23afd2c23ba..79b6fa89753 100644 --- a/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx +++ b/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx @@ -258,8 +258,9 @@ struct HfTaskDirectedFlowCharmHadrons { auto trackprong0 = candidate.template prong0_as(); sign = trackprong0.sign(); if constexpr (std::is_same_v) { - for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) + for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { outputMl[iclass] = candidate.mlProbDplusToPiKPi()[classMl->at(iclass)]; + } } } else if constexpr (std::is_same_v || std::is_same_v) { switch (channel) { @@ -268,8 +269,9 @@ struct HfTaskDirectedFlowCharmHadrons { rapCand = hfHelper.yD0(candidate); sign = candidate.isSelD0bar() ? 3 : 1; // 3: reflected D0bar, 1: pure D0 excluding reflected D0bar if constexpr (std::is_same_v) { - for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) + for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { outputMl[iclass] = candidate.mlProbD0()[classMl->at(iclass)]; + } } break; case DecayChannel::D0ToKPi: @@ -277,8 +279,9 @@ struct HfTaskDirectedFlowCharmHadrons { rapCand = hfHelper.yD0(candidate); sign = candidate.isSelD0() ? 3 : 2; // 3: reflected D0, 2: pure D0bar excluding reflected D0 if constexpr (std::is_same_v) { - for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) + for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { outputMl[iclass] = candidate.mlProbD0bar()[classMl->at(iclass)]; + } } break; default: @@ -294,8 +297,9 @@ struct HfTaskDirectedFlowCharmHadrons { rapCand = candidate.y(candidate.invMassAntiDstar()); } if constexpr (std::is_same_v) { - for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) + for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { outputMl[iclass] = candidate.mlProbDstarToD0Pi()[classMl->at(iclass)]; + } } } @@ -305,11 +309,13 @@ struct HfTaskDirectedFlowCharmHadrons { double cosNPhi = std::cos(phiCand); double sinNPhi = std::sin(phiCand); - if (userap) + if (userap) { etaCand = rapCand; + } - if (selectionFlagDstar) + if (selectionFlagDstar) { sign = signDstarCand; + } auto ux = cosNPhi; // real part of candidate q vector auto uy = sinNPhi; // imaginary part of candidate q vector diff --git a/PWGHF/D2H/Tasks/taskDs.cxx b/PWGHF/D2H/Tasks/taskDs.cxx index c69433e398a..f1bde71490b 100644 --- a/PWGHF/D2H/Tasks/taskDs.cxx +++ b/PWGHF/D2H/Tasks/taskDs.cxx @@ -176,14 +176,14 @@ struct HfTaskDs { std::array folders = {"Data/", "MC/Ds/Prompt/", "MC/Ds/NonPrompt/", "MC/Dplus/Prompt/", "MC/Dplus/NonPrompt/", "MC/Dplus/Bkg/", "MC/Lc/", "MC/Bkg/"}; - std::unordered_map dataHistograms = {}; - std::unordered_map mcDsPromptHistograms = {}; - std::unordered_map mcDsNonPromptHistograms = {}; - std::unordered_map mcDplusPromptHistograms = {}; - std::unordered_map mcDplusNonPromptHistograms = {}; - std::unordered_map mcDplusBkgHistograms = {}; - std::unordered_map mcLcBkgHistograms = {}; - std::unordered_map mcBkgHistograms = {}; + std::unordered_map dataHistograms; + std::unordered_map mcDsPromptHistograms; + std::unordered_map mcDsNonPromptHistograms; + std::unordered_map mcDplusPromptHistograms; + std::unordered_map mcDplusNonPromptHistograms; + std::unordered_map mcDplusBkgHistograms; + std::unordered_map mcLcBkgHistograms; + std::unordered_map mcBkgHistograms; std::array, DataType::kDataTypes> histosPtr = {dataHistograms, mcDsPromptHistograms, mcDsNonPromptHistograms, mcDplusPromptHistograms, mcDplusNonPromptHistograms, mcDplusBkgHistograms, mcLcBkgHistograms, mcBkgHistograms}; @@ -404,9 +404,8 @@ struct HfTaskDs { { if (fillPercentiles) { return o2::hf_centrality::getCentralityColl(collision); - } else { - return getZEqMultColl(collision, candidate.nProngsContributorsPV()); } + return getZEqMultColl(collision, candidate.nProngsContributorsPV()); } /// Evaluate centrality/multiplicity percentile (centrality estimator is automatically selected based on the used table) @@ -417,9 +416,8 @@ struct HfTaskDs { { if (fillPercentiles) { return o2::hf_centrality::getCentralityColl(collision); - } else { - return getZEqMultColl(collision, 0); } + return getZEqMultColl(collision, 0); } /// Evaluate centrality/multiplicity percentile @@ -460,8 +458,6 @@ struct HfTaskDs { std::get(histosPtr[dataType]["hd0Prong0"])->Fill(candidate.impactParameter0(), pt); std::get(histosPtr[dataType]["hd0Prong1"])->Fill(candidate.impactParameter1(), pt); std::get(histosPtr[dataType]["hd0Prong2"])->Fill(candidate.impactParameter2(), pt); - - return; } /// Fill mass sparse if ML information is present @@ -487,29 +483,25 @@ struct HfTaskDs { if (storeOccupancy) { std::get(histosPtr[dataType]["hSparseMass"])->Fill(mass, pt, evaluateCentralityCand(candidate), outputMl[0], outputMl[1], outputMl[2], o2::hf_occupancy::getOccupancyColl(candidate.template collision_as(), occEstimator)); return; - } else { - std::get(histosPtr[dataType]["hSparseMass"])->Fill(mass, pt, evaluateCentralityCand(candidate), outputMl[0], outputMl[1], outputMl[2]); - return; } + std::get(histosPtr[dataType]["hSparseMass"])->Fill(mass, pt, evaluateCentralityCand(candidate), outputMl[0], outputMl[1], outputMl[2]); + return; } if constexpr (isMc) { if (dataType == DataType::McDsNonPrompt || dataType == DataType::McDplusNonPrompt) { if (storeOccupancy) { std::get(histosPtr[dataType]["hSparseMass"])->Fill(mass, pt, evaluateCentralityCand(candidate), outputMl[0], outputMl[1], outputMl[2], candidate.template collision_as().numContrib(), candidate.ptBhadMotherPart(), getBHadMotherFlag(candidate.pdgBhadMotherPart()), o2::hf_occupancy::getOccupancyColl(candidate.template collision_as(), occEstimator)); return; - } else { - std::get(histosPtr[dataType]["hSparseMass"])->Fill(mass, pt, evaluateCentralityCand(candidate), outputMl[0], outputMl[1], outputMl[2], candidate.template collision_as().numContrib(), candidate.ptBhadMotherPart(), getBHadMotherFlag(candidate.pdgBhadMotherPart())); - return; - } - } else { - if (storeOccupancy) { - std::get(histosPtr[dataType]["hSparseMass"])->Fill(mass, pt, evaluateCentralityCand(candidate), outputMl[0], outputMl[1], outputMl[2], candidate.template collision_as().numContrib(), o2::hf_occupancy::getOccupancyColl(candidate.template collision_as(), occEstimator)); - return; - } else { - std::get(histosPtr[dataType]["hSparseMass"])->Fill(mass, pt, evaluateCentralityCand(candidate), outputMl[0], outputMl[1], outputMl[2], candidate.template collision_as().numContrib()); - return; } + std::get(histosPtr[dataType]["hSparseMass"])->Fill(mass, pt, evaluateCentralityCand(candidate), outputMl[0], outputMl[1], outputMl[2], candidate.template collision_as().numContrib(), candidate.ptBhadMotherPart(), getBHadMotherFlag(candidate.pdgBhadMotherPart())); + return; } + if (storeOccupancy) { + std::get(histosPtr[dataType]["hSparseMass"])->Fill(mass, pt, evaluateCentralityCand(candidate), outputMl[0], outputMl[1], outputMl[2], candidate.template collision_as().numContrib(), o2::hf_occupancy::getOccupancyColl(candidate.template collision_as(), occEstimator)); + return; + } + std::get(histosPtr[dataType]["hSparseMass"])->Fill(mass, pt, evaluateCentralityCand(candidate), outputMl[0], outputMl[1], outputMl[2], candidate.template collision_as().numContrib()); + return; } } @@ -527,29 +519,25 @@ struct HfTaskDs { if (storeOccupancy) { std::get(histosPtr[dataType]["hSparseMass"])->Fill(mass, pt, evaluateCentralityCand(candidate), o2::hf_occupancy::getOccupancyColl(candidate.template collision_as(), occEstimator)); return; - } else { - std::get(histosPtr[dataType]["hSparseMass"])->Fill(mass, pt, evaluateCentralityCand(candidate)); - return; } + std::get(histosPtr[dataType]["hSparseMass"])->Fill(mass, pt, evaluateCentralityCand(candidate)); + return; } if constexpr (isMc) { if (dataType == DataType::McDsNonPrompt || dataType == DataType::McDplusNonPrompt) { if (storeOccupancy) { std::get(histosPtr[dataType]["hSparseMass"])->Fill(mass, pt, evaluateCentralityCand(candidate), candidate.template collision_as().numContrib(), candidate.ptBhadMotherPart(), getBHadMotherFlag(candidate.pdgBhadMotherPart()), o2::hf_occupancy::getOccupancyColl(candidate.template collision_as(), occEstimator)); return; - } else { - std::get(histosPtr[dataType]["hSparseMass"])->Fill(mass, pt, evaluateCentralityCand(candidate), candidate.template collision_as().numContrib(), candidate.ptBhadMotherPart(), getBHadMotherFlag(candidate.pdgBhadMotherPart())); - return; - } - } else { - if (storeOccupancy) { - std::get(histosPtr[dataType]["hSparseMass"])->Fill(mass, pt, evaluateCentralityCand(candidate), candidate.template collision_as().numContrib(), o2::hf_occupancy::getOccupancyColl(candidate.template collision_as(), occEstimator)); - return; - } else { - std::get(histosPtr[dataType]["hSparseMass"])->Fill(mass, pt, evaluateCentralityCand(candidate), candidate.template collision_as().numContrib()); - return; } + std::get(histosPtr[dataType]["hSparseMass"])->Fill(mass, pt, evaluateCentralityCand(candidate), candidate.template collision_as().numContrib(), candidate.ptBhadMotherPart(), getBHadMotherFlag(candidate.pdgBhadMotherPart())); + return; + } + if (storeOccupancy) { + std::get(histosPtr[dataType]["hSparseMass"])->Fill(mass, pt, evaluateCentralityCand(candidate), candidate.template collision_as().numContrib(), o2::hf_occupancy::getOccupancyColl(candidate.template collision_as(), occEstimator)); + return; } + std::get(histosPtr[dataType]["hSparseMass"])->Fill(mass, pt, evaluateCentralityCand(candidate), candidate.template collision_as().numContrib()); + return; } } @@ -566,8 +554,6 @@ struct HfTaskDs { std::get(histosPtr[dataType]["hAbsCos3PiK"])->Fill(hfHelper.absCos3PiKDsToKKPi(candidate), pt); std::get(histosPtr[dataType]["hDeltaMassPhi"])->Fill(hfHelper.deltaMassPhiDsToKKPi(candidate), pt); std::get(histosPtr[dataType]["hMassKK"])->Fill(hfHelper.massKKPairDsToKKPi(candidate), pt); - - return; } /// Fill histograms of quantities for the PiKK daugther-mass hypothesis @@ -583,8 +569,6 @@ struct HfTaskDs { std::get(histosPtr[dataType]["hAbsCos3PiK"])->Fill(hfHelper.absCos3PiKDsToPiKK(candidate), pt); std::get(histosPtr[dataType]["hDeltaMassPhi"])->Fill(hfHelper.deltaMassPhiDsToPiKK(candidate), pt); std::get(histosPtr[dataType]["hMassKK"])->Fill(hfHelper.massKKPairDsToPiKK(candidate), pt); - - return; } /// Fill MC histograms at reconstruction level @@ -647,7 +631,6 @@ struct HfTaskDs { } } } - return; } template @@ -828,7 +811,7 @@ struct HfTaskDs { const auto& bc = collision.bc(); if (bc.runNumber() != mRunNumber) { mRunNumber = bc.runNumber(); // mark this run as at least tried - if (ccdbConfig.reconstructionPass.value == "") { + if (ccdbConfig.reconstructionPass.value.empty()) { lCalibObjects = ccdb->getForRun(ccdbConfig.ccdbPath, mRunNumber); } else if (ccdbConfig.reconstructionPass.value == "metadata") { std::map metadata; @@ -893,7 +876,7 @@ struct HfTaskDs { const auto& bc = collision.bc(); if (bc.runNumber() != mRunNumber) { mRunNumber = bc.runNumber(); // mark this run as at least tried - if (ccdbConfig.reconstructionPass.value == "") { + if (ccdbConfig.reconstructionPass.value.empty()) { lCalibObjects = ccdb->getForRun(ccdbConfig.ccdbPath, mRunNumber); } else if (ccdbConfig.reconstructionPass.value == "metadata") { std::map metadata; diff --git a/PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx b/PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx index 0f9d3393f21..5b40ce67ce6 100644 --- a/PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx +++ b/PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx @@ -274,13 +274,13 @@ struct HfTaskDstarToD0Pi { if (isCentStudy) { // Open the ROOT file TFile* weightFile = TFile::Open(weightFileName.value.c_str(), "READ"); - if (weightFile && !weightFile->IsZombie()) { + if ((weightFile != nullptr) && !weightFile->IsZombie()) { // Ensure hWeights is properly sized hWeights.resize(nWeights); for (int ithWeight = 0; ithWeight < nWeights; ++ithWeight) { std::string histName = "hMult" + std::to_string(ithWeight + 1) + "_Weight"; hWeights[ithWeight] = reinterpret_cast(weightFile->Get(histName.c_str())); - if (!hWeights[ithWeight]) { + if (hWeights[ithWeight] == nullptr) { LOGF(fatal, "Histogram %s not found in weight file!", histName.c_str()); return; } @@ -458,10 +458,11 @@ struct HfTaskDstarToD0Pi { if (candDstarMcRec.isSelDstarToD0Pi()) { // if all selection passed float weightValue = 1.0; - if (useWeight && (hWeights.size() < 1 || hWeights[0] == nullptr)) { + if (useWeight && (hWeights.empty() || hWeights[0] == nullptr)) { LOGF(fatal, "Weight histograms are not initialized or empty. Check CCDB path or weight file."); return; - } else if (useWeight && isCentStudy) { + } + if (useWeight && isCentStudy) { for (int ithWeight = 0; ithWeight < nWeights; ++ithWeight) { if (centrality > centRangesForWeights.value[ithWeight] && centrality <= centRangesForWeights.value[ithWeight + 1]) { weightValue = hWeights[ithWeight]->GetBinContent(hWeights[ithWeight]->FindBin(nPVContributors)); @@ -584,7 +585,7 @@ struct HfTaskDstarToD0Pi { float centFT0MGen; float pvContributors; // assigning centrality to MC Collision using max FT0M amplitute from Reconstructed collisions - if (recCollisions.size()) { + if (recCollisions.size() != 0) { std::vector::iterator, int>> tempRecCols; for (const auto& recCol : recCollisions) { tempRecCols.emplace_back(recCol, recCol.numContrib()); @@ -598,10 +599,11 @@ struct HfTaskDstarToD0Pi { } float weightValue = 1.0; - if (useWeight && (hWeights.size() < 1 || hWeights[0] == nullptr)) { + if (useWeight && (hWeights.empty() || hWeights[0] == nullptr)) { LOGF(fatal, "Weight histograms are not initialized or empty. Check CCDB path or weight file."); return; - } else if (useWeight && isCentStudy) { + } + if (useWeight && isCentStudy) { for (int ithWeight = 0; ithWeight < nWeights; ++ithWeight) { if (centFT0MGen > centRangesForWeights.value[ithWeight] && centFT0MGen <= centRangesForWeights.value[ithWeight + 1]) { weightValue = hWeights[ithWeight]->GetBinContent(hWeights[ithWeight]->FindBin(centFT0MGen, pvContributors)); diff --git a/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx b/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx index 5666daeaacb..4327d1278ad 100644 --- a/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx +++ b/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx @@ -569,15 +569,17 @@ struct HfTaskFlowCharmHadrons { case DecayChannel::DsToKKPi: massCand = hfHelper.invMassDsToKKPi(candidate); if constexpr (std::is_same_v) { - for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) + for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { outputMl[iclass] = candidate.mlProbDsToKKPi()[classMl->at(iclass)]; + } } break; case DecayChannel::DsToPiKK: massCand = hfHelper.invMassDsToPiKK(candidate); if constexpr (std::is_same_v) { - for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) + for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { outputMl[iclass] = candidate.mlProbDsToPiKK()[classMl->at(iclass)]; + } } break; default: @@ -586,8 +588,9 @@ struct HfTaskFlowCharmHadrons { } else if constexpr (std::is_same_v || std::is_same_v) { massCand = hfHelper.invMassDplusToPiKPi(candidate); if constexpr (std::is_same_v) { - for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) + for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { outputMl[iclass] = candidate.mlProbDplusToPiKPi()[classMl->at(iclass)]; + } } } else if constexpr (std::is_same_v || std::is_same_v) { nProngs = 2; @@ -595,15 +598,17 @@ struct HfTaskFlowCharmHadrons { case DecayChannel::D0ToPiK: massCand = hfHelper.invMassD0ToPiK(candidate); if constexpr (std::is_same_v) { - for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) + for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { outputMl[iclass] = candidate.mlProbD0()[classMl->at(iclass)]; + } } break; case DecayChannel::D0ToKPi: massCand = hfHelper.invMassD0barToKPi(candidate); if constexpr (std::is_same_v) { - for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) + for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { outputMl[iclass] = candidate.mlProbD0bar()[classMl->at(iclass)]; + } } break; default: @@ -614,15 +619,17 @@ struct HfTaskFlowCharmHadrons { case DecayChannel::LcToPKPi: massCand = hfHelper.invMassLcToPKPi(candidate); if constexpr (std::is_same_v) { - for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) + for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { outputMl[iclass] = candidate.mlProbLcToPKPi()[classMl->at(iclass)]; + } } break; case DecayChannel::LcToPiKP: massCand = hfHelper.invMassLcToPiKP(candidate); if constexpr (std::is_same_v) { - for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) + for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { outputMl[iclass] = candidate.mlProbLcToPiKP()[classMl->at(iclass)]; + } } break; default: @@ -633,15 +640,17 @@ struct HfTaskFlowCharmHadrons { case DecayChannel::XicToPKPi: massCand = hfHelper.invMassXicToPKPi(candidate); if constexpr (std::is_same_v) { - for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) + for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { outputMl[iclass] = candidate.mlProbXicToPKPi()[classMl->at(iclass)]; + } } break; case DecayChannel::XicToPiKP: massCand = hfHelper.invMassXicToPiKP(candidate); if constexpr (std::is_same_v) { - for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) + for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { outputMl[iclass] = candidate.mlProbXicToPiKP()[classMl->at(iclass)]; + } } break; default: @@ -650,8 +659,9 @@ struct HfTaskFlowCharmHadrons { } else if constexpr (std::is_same_v || std::is_same_v) { massCand = candidate.invMassCharmBaryon(); if constexpr (std::is_same_v) { - for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) + for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { outputMl[iclass] = candidate.mlProbToXiPi()[classMl->at(iclass)]; + } } } diff --git a/PWGHF/D2H/Tasks/taskLb.cxx b/PWGHF/D2H/Tasks/taskLb.cxx index 3272db196b3..f92a4754d12 100644 --- a/PWGHF/D2H/Tasks/taskLb.cxx +++ b/PWGHF/D2H/Tasks/taskLb.cxx @@ -193,8 +193,9 @@ struct HfTaskLb { std::array dcaResolution = {0.f, 0.f, 0.f}; for (const auto& candidateLc : candidatesLc) { - if (!candidateLc.isSelLcToPKPi() && !candidateLc.isSelLcToPiKP()) + if ((candidateLc.isSelLcToPKPi() == 0) && (candidateLc.isSelLcToPiKP() == 0)) { continue; + } auto track0 = candidateLc.prong0_as(); auto track1 = candidateLc.prong1_as(); auto track2 = candidateLc.prong2_as(); @@ -207,12 +208,15 @@ struct HfTaskLb { registry.get(HIST("hIPResolution"))->Fill(track0.pt(), reso0); registry.get(HIST("hIPResolution"))->Fill(track1.pt(), reso1); registry.get(HIST("hIPResolution"))->Fill(track2.pt(), reso2); - if (!passesImpactParameterResolution(track0.pt(), reso0)) + if (!passesImpactParameterResolution(track0.pt(), reso0)) { continue; - if (!passesImpactParameterResolution(track1.pt(), reso1)) + } + if (!passesImpactParameterResolution(track1.pt(), reso1)) { continue; - if (!passesImpactParameterResolution(track2.pt(), reso2)) + } + if (!passesImpactParameterResolution(track2.pt(), reso2)) { continue; + } dca = { candidateLc.impactParameter0(), @@ -234,12 +238,13 @@ struct HfTaskLb { } registry.get(HIST("hPtlogLikelihood"))->Fill(candidateLc.pt(), likelihoodRatio); - if (likelihoodRatio < minLikelihoodRatioLc) + if (likelihoodRatio < minLikelihoodRatioLc) { continue; + } registry.get(HIST("hIPsAfterCut"))->Fill(candidateLc.pt(), candidateLc.impactParameter0()); registry.get(HIST("hIPsAfterCut"))->Fill(candidateLc.pt(), candidateLc.impactParameter1()); registry.get(HIST("hIPsAfterCut"))->Fill(candidateLc.pt(), candidateLc.impactParameter2()); - if (candidateLc.isSelLcToPKPi()) { + if (candidateLc.isSelLcToPKPi() != 0) { registry.get(HIST("hPtinvMassLc"))->Fill(candidateLc.pt(), hfHelper.invMassLcToPKPi(candidateLc)); float mRecoKstar = RecoDecay::m(std::array{track1.pVector(), track2.pVector()}, std::array{o2::constants::physics::MassKPlus, o2::constants::physics::MassPiPlus}); float mRecoDelta1232 = RecoDecay::m(std::array{track0.pVector(), track2.pVector()}, std::array{o2::constants::physics::MassProton, o2::constants::physics::MassPiPlus}); @@ -247,14 +252,18 @@ struct HfTaskLb { float mDiffKStar892 = std::abs(mRecoKstar - massKStar892); float mDiffDelta1232 = std::abs(mRecoDelta1232 - massDelta1232); float mDiffLambda1520 = std::abs(mRecoLambda1520 - o2::constants::physics::MassLambda1520); - if (mDiffKStar892 < mDiffKStar892Max || mDiffDelta1232 < mDiffDelta1232Max || mDiffLambda1520 < mDiffLambda1520Max) + if (mDiffKStar892 < mDiffKStar892Max || mDiffDelta1232 < mDiffDelta1232Max || mDiffLambda1520 < mDiffLambda1520Max) { registry.get(HIST("hPtinvMassLcReso"))->Fill(candidateLc.pt(), hfHelper.invMassLcToPKPi(candidateLc)); - if (mDiffKStar892 < mDiffKStar892Max) + } + if (mDiffKStar892 < mDiffKStar892Max) { registry.get(HIST("hPtinvMassLcKStar"))->Fill(candidateLc.pt(), hfHelper.invMassLcToPKPi(candidateLc)); - if (mDiffDelta1232 < mDiffDelta1232Max) + } + if (mDiffDelta1232 < mDiffDelta1232Max) { registry.get(HIST("hPtinvMassLcDelta"))->Fill(candidateLc.pt(), hfHelper.invMassLcToPKPi(candidateLc)); - if (mDiffLambda1520 < mDiffLambda1520Max) + } + if (mDiffLambda1520 < mDiffLambda1520Max) { registry.get(HIST("hPtinvMassLcLambda1520"))->Fill(candidateLc.pt(), hfHelper.invMassLcToPKPi(candidateLc)); + } if (std::abs(hfHelper.invMassLcToPKPi(candidateLc) - o2::constants::physics::MassLambdaCPlus) < mDiffLcMax) { registry.get(HIST("hPtinvMassKStar"))->Fill(candidateLc.pt(), mRecoKstar); @@ -262,7 +271,7 @@ struct HfTaskLb { registry.get(HIST("hPtinvMassLambda1520"))->Fill(candidateLc.pt(), mRecoLambda1520); } } - if (candidateLc.isSelLcToPiKP()) { + if (candidateLc.isSelLcToPiKP() != 0) { registry.get(HIST("hPtinvMassLc"))->Fill(candidateLc.pt(), hfHelper.invMassLcToPiKP(candidateLc)); float mRecoKstar = RecoDecay::m(std::array{track1.pVector(), track0.pVector()}, std::array{o2::constants::physics::MassKPlus, o2::constants::physics::MassPiPlus}); float mRecoDelta1232 = RecoDecay::m(std::array{track2.pVector(), track0.pVector()}, std::array{o2::constants::physics::MassProton, o2::constants::physics::MassPiPlus}); @@ -270,14 +279,18 @@ struct HfTaskLb { float mDiffKStar892 = std::abs(mRecoKstar - massKStar892); float mDiffDelta1232 = std::abs(mRecoDelta1232 - massDelta1232); float mDiffLambda1520 = std::abs(mRecoLambda1520 - o2::constants::physics::MassLambda1520); - if (mDiffKStar892 < mDiffKStar892Max || mDiffDelta1232 < mDiffDelta1232Max || mDiffLambda1520 < mDiffLambda1520Max) + if (mDiffKStar892 < mDiffKStar892Max || mDiffDelta1232 < mDiffDelta1232Max || mDiffLambda1520 < mDiffLambda1520Max) { registry.get(HIST("hPtinvMassLcReso"))->Fill(candidateLc.pt(), hfHelper.invMassLcToPiKP(candidateLc)); - if (mDiffKStar892 < mDiffKStar892Max) + } + if (mDiffKStar892 < mDiffKStar892Max) { registry.get(HIST("hPtinvMassLcKStar"))->Fill(candidateLc.pt(), hfHelper.invMassLcToPiKP(candidateLc)); - if (mDiffDelta1232 < mDiffDelta1232Max) + } + if (mDiffDelta1232 < mDiffDelta1232Max) { registry.get(HIST("hPtinvMassLcDelta"))->Fill(candidateLc.pt(), hfHelper.invMassLcToPiKP(candidateLc)); - if (mDiffLambda1520 < mDiffLambda1520Max) + } + if (mDiffLambda1520 < mDiffLambda1520Max) { registry.get(HIST("hPtinvMassLcLambda1520"))->Fill(candidateLc.pt(), hfHelper.invMassLcToPiKP(candidateLc)); + } if (std::abs(hfHelper.invMassLcToPiKP(candidateLc) - o2::constants::physics::MassLambdaCPlus) < mDiffLcMax) { registry.get(HIST("hPtinvMassKStar"))->Fill(candidateLc.pt(), mRecoKstar); diff --git a/PWGHF/D2H/Tasks/taskSigmac.cxx b/PWGHF/D2H/Tasks/taskSigmac.cxx index e3383b545f1..bbc305b5dd6 100644 --- a/PWGHF/D2H/Tasks/taskSigmac.cxx +++ b/PWGHF/D2H/Tasks/taskSigmac.cxx @@ -152,11 +152,7 @@ struct HfTaskSigmac { } /// establish if the analysis is done on Data or MC - if (doprocessMcWoMl || doprocessMcWithMl) { - isMc = true; - } else { - isMc = false; - } + isMc = doprocessMcWoMl || doprocessMcWithMl; const AxisSpec thnAxisMassLambdaC{configAxisMassLambdaC, "inv. mass (p K #pi) (GeV/#it{c}^{2})"}; const AxisSpec thnAxisPtLambdaC{thnConfigAxisPt, "#it{p}_{T}(#Lambda_{c}^{+}) (GeV/#it{c})"}; @@ -610,8 +606,9 @@ struct HfTaskSigmac { bool isScStar0Gen = (std::abs(particle.flagMcMatchGen()) == BIT(aod::hf_cand_sigmac::DecayType::ScStar0ToPKPiPi)); bool isScPlusPlusGen = (std::abs(particle.flagMcMatchGen()) == BIT(aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi)); bool isScStarPlusPlusGen = (std::abs(particle.flagMcMatchGen()) == BIT(aod::hf_cand_sigmac::DecayType::ScStarPlusPlusToPKPiPi)); - if (!isSc0Gen && !isScPlusPlusGen && !isScStar0Gen && !isScStarPlusPlusGen) + if (!isSc0Gen && !isScPlusPlusGen && !isScStar0Gen && !isScStarPlusPlusGen) { continue; + } /// look for generated particles in acceptance /* diff --git a/PWGHF/D2H/Tasks/taskXicc.cxx b/PWGHF/D2H/Tasks/taskXicc.cxx index 90f4c5da24d..d4caed562fc 100644 --- a/PWGHF/D2H/Tasks/taskXicc.cxx +++ b/PWGHF/D2H/Tasks/taskXicc.cxx @@ -87,7 +87,7 @@ struct HfTaskXicc { void process(soa::Filtered> const& candidates) { for (const auto& candidate : candidates) { - if (!(candidate.hfflag() & 1 << aod::hf_cand_xicc::DecayType::XiccToXicPi)) { + if ((candidate.hfflag() & 1 << aod::hf_cand_xicc::DecayType::XiccToXicPi) == 0) { continue; } if (yCandMax >= 0. && std::abs(hfHelper.yXicc(candidate)) > yCandMax) { @@ -195,7 +195,7 @@ struct HfTaskXiccMc { { // MC rec. for (const auto& candidate : candidates) { - if (!(candidate.hfflag() & 1 << aod::hf_cand_xicc::DecayType::XiccToXicPi)) { + if ((candidate.hfflag() & 1 << aod::hf_cand_xicc::DecayType::XiccToXicPi) == 0) { continue; } if (yCandMax >= 0. && std::abs(hfHelper.yXicc(candidate)) > yCandMax) { diff --git a/PWGHF/HFC/Macros/DhCorrelationExtraction.cxx b/PWGHF/HFC/Macros/DhCorrelationExtraction.cxx index 88eaee6d185..fbe7b51b489 100644 --- a/PWGHF/HFC/Macros/DhCorrelationExtraction.cxx +++ b/PWGHF/HFC/Macros/DhCorrelationExtraction.cxx @@ -95,9 +95,9 @@ DhCorrelationExtraction::DhCorrelationExtraction() : // default constructor fSidebandDivided(kFALSE), fUseSidebLeft(kFALSE), fUseSidebRight(kFALSE), - fFDsubtraction(0), - fSecPartContamination(0), - fCorrBiasBtoD(0) + fFDsubtraction(false), + fSecPartContamination(false), + fCorrBiasBtoD(false) { } @@ -180,7 +180,8 @@ Bool_t DhCorrelationExtraction::SetDmesonSpecie(DmesonSpecie k) if (k < 0 || k > 3) { printf("[ERROR] D meson specie not correctly set!\n"); return kFALSE; - } else if (k == 0) { + } + if (k == 0) { fDmesonLabel = "Dzero"; } else if (k == 1) { fDmesonLabel = "Dplus"; @@ -200,8 +201,9 @@ Bool_t DhCorrelationExtraction::ExtractCorrelations(Double_t PtCandMin, Double_t printf("[INFO] Fake softPi subtraction in ME via extraction code is enabled!\n"); } - if (!fCorrectPoolsSeparately) + if (!fCorrectPoolsSeparately) { fNpools = 1; // single histogram with integrated pools + } // Histograms definition TH2D* hSE_Sign[fNpools]; @@ -426,8 +428,8 @@ Bool_t DhCorrelationExtraction::ExtractCorrelations(Double_t PtCandMin, Double_t c2D_Sub->SaveAs(Form("Output_CorrelationExtraction_%s_Root/h2D_%s_Subtr_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.root", codeName.Data(), fDmesonLabel.Data(), PtCandMin, PtCandMax, PtHadMin, PtHadMax)); // 1D projection - h1D_Sign = reinterpret_cast(h2D_Sign->ProjectionY("h1D_Sign")); // projection on deltaPhi axis - h1D_Sideb = reinterpret_cast(h2D_Sideb->ProjectionY("h1D_Sideb")); + h1D_Sign = h2D_Sign->ProjectionY("h1D_Sign"); // projection on deltaPhi axis + h1D_Sideb = h2D_Sideb->ProjectionY("h1D_Sideb"); h1D_Sign->SetTitle("Signal region correlations"); h1D_Sideb->SetTitle("Sidebands correlations"); h1D_Sign->Scale(1. / h1D_Sign->GetXaxis()->GetBinWidth(1)); @@ -547,8 +549,8 @@ Bool_t DhCorrelationExtraction::ExtractCorrelations(Double_t PtCandMin, Double_t // FD Subtraction if (fFDsubtraction) { - h1D_FDTemplatePrompt = reinterpret_cast(h2D_FDTemplatePrompt->ProjectionY("h1D_FDTemplatePrompt")); - h1D_FDTemplateNonPrompt = reinterpret_cast(h2D_FDTemplateNonPrompt->ProjectionY("h1D_FDTemplateNonPrompt")); + h1D_FDTemplatePrompt = h2D_FDTemplatePrompt->ProjectionY("h1D_FDTemplatePrompt"); + h1D_FDTemplateNonPrompt = h2D_FDTemplateNonPrompt->ProjectionY("h1D_FDTemplateNonPrompt"); h1D_FDTemplatePrompt->Scale(1. / h1D_FDTemplatePrompt->GetXaxis()->GetBinWidth(1)); h1D_FDTemplateNonPrompt->Scale(1. / h1D_FDTemplateNonPrompt->GetXaxis()->GetBinWidth(1)); @@ -686,12 +688,14 @@ Bool_t DhCorrelationExtraction::ExtractCorrelations(Double_t PtCandMin, Double_t h1D_SubtrFDNorm->SetMarkerStyle(kFullCircle); h1D_SubtrFDNorm->Draw("same"); } - if (fFDsubtraction) + if (fFDsubtraction) { h1D_TemplateTotal->Draw("same"); + } TLegend* lFinal = new TLegend(); lFinal->AddEntry(h1D_SubtrNorm, "Corr. after bkg subtr."); - if (fFDsubtraction) + if (fFDsubtraction) { lFinal->AddEntry(h1D_TemplateTotal, "CR Mode 2 total template"); + } if (fSecPartContamination) { lFinal->AddEntry(h1D_SubtrNorm_SecPart, "Corr. after sec. part. correction"); } @@ -811,11 +815,11 @@ Bool_t DhCorrelationExtraction::ExtractCorrelations(Double_t PtCandMin, Double_t hBaseline_Refl->SetLineColor(kOrange); cFinal_Reflected_BaselineSubtr->cd(); h1D_ReflCorr->SetMinimum(-0.8); - h1D_ReflCorr->SetStats(0); - hBaseline_Refl->SetStats(0); + h1D_ReflCorr->SetStats(false); + hBaseline_Refl->SetStats(false); h1D_ReflCorr->Draw(); hBaseline_Refl->Draw("same"); - h1D_ReflCorr_BaselineSubtr->SetStats(0); + h1D_ReflCorr_BaselineSubtr->SetStats(false); h1D_ReflCorr_BaselineSubtr->Draw("same"); // then keep just this fConstZero->Draw("same"); cFinal_Reflected_BaselineSubtr->SaveAs(Form("Output_CorrelationExtraction_%s_png/AzimCorrDistr_Reflected_BaselineSubtr_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.png", codeName.Data(), fDmesonLabel.Data(), PtCandMin, PtCandMax, PtHadMin, PtHadMax)); @@ -831,13 +835,13 @@ Bool_t DhCorrelationExtraction::ReadInputSEandME() { fFileSE = TFile::Open(fFileNameSE.Data()); - if (!fFileSE) { + if (fFileSE == nullptr) { std::cout << "[ERROR] File " << fFileNameSE << " cannot be opened! check your file path!"; return kFALSE; } fFileME = TFile::Open(fFileNameME.Data()); - if (!fFileME) { + if (fFileME == nullptr) { std::cout << "[ERROR] File " << fFileNameME << " cannot be opened! check your file path!"; return kFALSE; } @@ -861,7 +865,7 @@ Bool_t DhCorrelationExtraction::ReadInputInvMass() { fFileMass = TFile::Open(fFileNameMass.Data()); - if (!fFileMass) { + if (fFileMass == nullptr) { std::cout << "[ERROR] File " << fFileNameMass << " cannot be opened! check your file path!"; return kFALSE; } @@ -883,11 +887,11 @@ Bool_t DhCorrelationExtraction::ReadInputFDSubtr() fFileFDTemplate = TFile::Open(fFileFDTemplateName.Data()); fFileFDPromptFrac = TFile::Open(fFileFDPromptFracName.Data()); - if (!fFileFDTemplate) { + if (fFileFDTemplate == nullptr) { std::cout << "[ERROR] File " << fFileFDTemplateName << " cannot be opened! check your file path!" << std::endl; return kFALSE; } - if (!fFileFDPromptFrac) { + if (fFileFDPromptFrac == nullptr) { std::cout << "[ERROR] File " << fFileFDPromptFracName << " cannot be opened! check your file path!" << std::endl; return kFALSE; } @@ -909,14 +913,14 @@ Bool_t DhCorrelationExtraction::ReadInputSecondaryPartContamination() { fFileSecPart = TFile::Open(fFileSecPartName.Data()); - if (!fFileSecPart) { + if (fFileSecPart == nullptr) { std::cout << "[ERROR] File " << fFileSecPartName << " cannot be opened! check your file path!" << std::endl; return kFALSE; } fDirSecPart = reinterpret_cast(fFileSecPart->Get(fDirSecPartName.Data())); - if (!fDirSecPart) { + if (fDirSecPart == nullptr) { std::cout << "[ERROR] Directory " << fDirSecPart << " cannot be opened! check your file path!" << std::endl; return kFALSE; } @@ -939,10 +943,10 @@ TH1D* DhCorrelationExtraction::EvaluateMCClosModulations(Double_t PtCandMin, Dou fFilePromptMc = TFile::Open(fFilePromptMcRecName.Data()); fFileNonPromptMc = TFile::Open(fFileNonPromptMcRecName.Data()); - if (!fFilePromptMc) { + if (fFilePromptMc == nullptr) { std::cout << "[ERROR] File prompt MC rec cannot be opened! check your file path!" << std::endl; } - if (!fFileNonPromptMc) { + if (fFileNonPromptMc == nullptr) { std::cout << "[ERROR] File non-prompt MC rec cannot be opened! check your file path!" << std::endl; } @@ -1066,31 +1070,33 @@ TH2D* DhCorrelationExtraction::GetCorrelHisto(Int_t SEorME, Int_t SorSB, Int_t p } }*/ - Int_t binExtPtCandMin = (Int_t)hSparse->GetAxis(2)->FindBin(PtCandMin + 0.01); // axis2: ptCand, the 0.01 to avoid bin edges! - Int_t binExtPtCandMax = (Int_t)hSparse->GetAxis(2)->FindBin(PtCandMax - 0.01); - Int_t binExtPtHadMin = (Int_t)hSparse->GetAxis(3)->FindBin(PtHadMin + 0.01); // axis3: ptHad - Int_t binExtPtHadMax = (Int_t)hSparse->GetAxis(3)->FindBin(PtHadMax - 0.01); + Int_t binExtPtCandMin = hSparse->GetAxis(2)->FindBin(PtCandMin + 0.01); // axis2: ptCand, the 0.01 to avoid bin edges! + Int_t binExtPtCandMax = hSparse->GetAxis(2)->FindBin(PtCandMax - 0.01); + Int_t binExtPtHadMin = hSparse->GetAxis(3)->FindBin(PtHadMin + 0.01); // axis3: ptHad + Int_t binExtPtHadMax = hSparse->GetAxis(3)->FindBin(PtHadMax - 0.01); Int_t binExtPoolMin; Int_t binExtPoolMax; if (fCorrectPoolsSeparately) { - binExtPoolMin = (Int_t)hSparse->GetAxis(4)->FindBin(pool + 0.01); // axis4: pool bin - binExtPoolMax = (Int_t)hSparse->GetAxis(4)->FindBin(pool + 0.99); + binExtPoolMin = hSparse->GetAxis(4)->FindBin(pool + 0.01); // axis4: pool bin + binExtPoolMax = hSparse->GetAxis(4)->FindBin(pool + 0.99); } else { // merge all pools in one binExtPoolMin = 1; - binExtPoolMax = (Int_t)hSparse->GetAxis(4)->GetNbins(); + binExtPoolMax = hSparse->GetAxis(4)->GetNbins(); } // possibility to select a certain eta region - Int_t binExtEtaMin = (Int_t)hSparse->GetAxis(1)->FindBin(fDeltaEtaMin + 0.0001); - Int_t binExtEtaMax = (Int_t)hSparse->GetAxis(1)->FindBin(fDeltaEtaMax - 0.0001); - if (binExtEtaMax > hSparse->GetAxis(1)->GetNbins()) + Int_t binExtEtaMin = hSparse->GetAxis(1)->FindBin(fDeltaEtaMin + 0.0001); + Int_t binExtEtaMax = hSparse->GetAxis(1)->FindBin(fDeltaEtaMax - 0.0001); + if (binExtEtaMax > hSparse->GetAxis(1)->GetNbins()) { binExtEtaMax = hSparse->GetAxis(1)->GetNbins(); - if (binExtEtaMin < 1) + } + if (binExtEtaMin < 1) { binExtEtaMin = 1; + } hSparse->GetAxis(1)->SetRange(binExtEtaMin, binExtEtaMax); // axis1: deltaEta hSparse->GetAxis(2)->SetRange(binExtPtCandMin, binExtPtCandMax); // axis2: ptCand hSparse->GetAxis(3)->SetRange(binExtPtHadMin, binExtPtHadMax); // axis3: ptHad hSparse->GetAxis(4)->SetRange(binExtPoolMin, binExtPoolMax); // axis4: pool bin - h2D = reinterpret_cast(hSparse->Projection(0, 1)); // axis0: deltaPhi, axis1: deltaEta + h2D = hSparse->Projection(0, 1); // axis0: deltaPhi, axis1: deltaEta if (SEorME == kSE) { // Same Event if (SorSB == kSign) { h2D->SetName(Form("hCorr_SE_Sig_2D_PtCandBin%d_PtHadBin%d_iPool%d", binExtPtCandMin, binExtPtHadMin, pool)); @@ -1135,8 +1141,9 @@ void DhCorrelationExtraction::GetSignalAndBackgroundForNorm(Double_t PtCandMin, TH1F* hMassFitSBRYield = reinterpret_cast(fFileMass->Get("hBackgroundSidebandRight")); Int_t PtCandBin = hMassFitSgnYield->FindBin(PtCandMin + 0.01); - if (PtCandBin != hMassFitSgnYield->FindBin(PtCandMax - 0.01)) + if (PtCandBin != hMassFitSgnYield->FindBin(PtCandMax - 0.01)) { std::cout << "[ERROR] Pt bin in invariant mass histogram not univocally defined " << std::endl; + } Float_t SgnYield = hMassFitSgnYield->GetBinContent(PtCandBin); Float_t BkgYield = hMassFitBkgYield->GetBinContent(PtCandBin); @@ -1167,8 +1174,6 @@ void DhCorrelationExtraction::GetSignalAndBackgroundForNorm(Double_t PtCandMin, SetBkgScaleFactor(BkgYield / SBRYield); SetSBYield(SBRYield); } - - return; } TH2D* DhCorrelationExtraction::GetFDTemplateHisto(Int_t PromptOrFD, Double_t PtCandMin, Double_t PtCandMax, Double_t PtHadMin, Double_t PtHadMax) @@ -1182,12 +1187,14 @@ TH2D* DhCorrelationExtraction::GetFDTemplateHisto(Int_t PromptOrFD, Double_t PtC h2D = reinterpret_cast(fFileFDTemplate->Get(Form("%s%.0f_%.0f_ptassoc%.0f_%.0f", fHistoFDTemplateNonPromptName.Data(), PtCandMin, PtCandMax, PtHadMin, PtHadMax))); } - Int_t binExtEtaMin = (Int_t)h2D->GetXaxis()->FindBin(fDeltaEtaMin + 0.000001); - Int_t binExtEtaMax = (Int_t)h2D->GetXaxis()->FindBin(fDeltaEtaMax - 0.000001); - if (binExtEtaMax > h2D->GetXaxis()->GetNbins()) + Int_t binExtEtaMin = h2D->GetXaxis()->FindBin(fDeltaEtaMin + 0.000001); + Int_t binExtEtaMax = h2D->GetXaxis()->FindBin(fDeltaEtaMax - 0.000001); + if (binExtEtaMax > h2D->GetXaxis()->GetNbins()) { binExtEtaMax = h2D->GetXaxis()->GetNbins(); - if (binExtEtaMin < 1) + } + if (binExtEtaMin < 1) { binExtEtaMin = 1; + } h2D->GetXaxis()->SetRange(binExtEtaMin, binExtEtaMax); if (PromptOrFD == kPrompt) { @@ -1213,23 +1220,25 @@ TH1D* DhCorrelationExtraction::GetCorrelHistoSecondaryPart(Int_t PartType, Doubl } else { // all selected particles hSparse = reinterpret_cast(fDirSecPart->Get(fHistoAllPartName.Data())); } - Int_t binExtPtCandMin = (Int_t)hSparse->GetAxis(2)->FindBin(PtCandMin + 0.01); // axis2: ptCand, the 0.01 to avoid bin edges! - Int_t binExtPtCandMax = (Int_t)hSparse->GetAxis(2)->FindBin(PtCandMax - 0.01); - Int_t binExtPtHadMin = (Int_t)hSparse->GetAxis(3)->FindBin(PtHadMin + 0.01); // axis3: ptHad - Int_t binExtPtHadMax = (Int_t)hSparse->GetAxis(3)->FindBin(PtHadMax - 0.01); + Int_t binExtPtCandMin = hSparse->GetAxis(2)->FindBin(PtCandMin + 0.01); // axis2: ptCand, the 0.01 to avoid bin edges! + Int_t binExtPtCandMax = hSparse->GetAxis(2)->FindBin(PtCandMax - 0.01); + Int_t binExtPtHadMin = hSparse->GetAxis(3)->FindBin(PtHadMin + 0.01); // axis3: ptHad + Int_t binExtPtHadMax = hSparse->GetAxis(3)->FindBin(PtHadMax - 0.01); Int_t binExtPoolMin; Int_t binExtPoolMax; if (PartType == kAllPart) { binExtPoolMin = 1; - binExtPoolMax = (Int_t)hSparse->GetAxis(4)->GetNbins(); + binExtPoolMax = hSparse->GetAxis(4)->GetNbins(); } // possibility to select a certain eta region - Int_t binExtEtaMin = (Int_t)hSparse->GetAxis(1)->FindBin(fDeltaEtaMin + 0.0001); - Int_t binExtEtaMax = (Int_t)hSparse->GetAxis(1)->FindBin(fDeltaEtaMax - 0.0001); - if (binExtEtaMax > hSparse->GetAxis(1)->GetNbins()) + Int_t binExtEtaMin = hSparse->GetAxis(1)->FindBin(fDeltaEtaMin + 0.0001); + Int_t binExtEtaMax = hSparse->GetAxis(1)->FindBin(fDeltaEtaMax - 0.0001); + if (binExtEtaMax > hSparse->GetAxis(1)->GetNbins()) { binExtEtaMax = hSparse->GetAxis(1)->GetNbins(); - if (binExtEtaMin < 1) + } + if (binExtEtaMin < 1) { binExtEtaMin = 1; + } hSparse->GetAxis(1)->SetRange(binExtEtaMin, binExtEtaMax); // axis1: deltaEta hSparse->GetAxis(2)->SetRange(binExtPtCandMin, binExtPtCandMax); // axis2: ptCand @@ -1238,8 +1247,8 @@ TH1D* DhCorrelationExtraction::GetCorrelHistoSecondaryPart(Int_t PartType, Doubl hSparse->GetAxis(4)->SetRange(binExtPoolMin, binExtPoolMax); // axis4: pool bin } - h1D = reinterpret_cast(hSparse->Projection(0)); // axis0: deltaPhi - if (PartType == kPrimaryPart) { // primary particles + h1D = hSparse->Projection(0); // axis0: deltaPhi + if (PartType == kPrimaryPart) { // primary particles h1D->SetName(Form("hPrimaryPartCorr_PtD%.0fto%.0f_PtHad%.0fto%.0f", PtCandMin, PtCandMax, PtHadMin, PtHadMax)); } else { // all selected particles h1D->SetName(Form("hAllPartCorr_PtD%.0fto%.0f_PtHad%.0fto%.0f", PtCandMin, PtCandMax, PtHadMin, PtHadMax)); @@ -1332,7 +1341,7 @@ Double_t DhCorrelationExtraction::GetFDPromptFrac(Double_t PtCandMin, Double_t P return PromptFraction; } -void DhCorrelationExtraction::NormalizeMEplot(TH2D*& histoME, TH2D*& histoMEsoftPi) +void DhCorrelationExtraction::NormalizeMEplot(TH2D*& histoME, TH2D*& histoMEsoftPi) const { Int_t bin0phi = histoME->GetYaxis()->FindBin(0.); @@ -1353,13 +1362,12 @@ void DhCorrelationExtraction::NormalizeMEplot(TH2D*& histoME, TH2D*& histoMEsoft std::cout << "Factor norm. ME: " << factorNorm << std::endl; std::cout << "Bin content (0,0) ME: " << histoME->GetBinContent(bin0eta, bin0phi) << std::endl; - if (fSubtractSoftPiME) + if (fSubtractSoftPiME) { histoME->Add(histoMEsoftPi, -1); // remove the tracks compatible with soft pion (if requested) + } // apply the normalization histoME->Scale(1. / factorNorm); - - return; } Double_t DhCorrelationExtraction::CalculateBaseline(TH1D*& histo, Bool_t totalRange, Bool_t reflected) @@ -1523,8 +1531,6 @@ void DhCorrelationExtraction::SetTH1HistoStyle(TH1D*& histo, TString hTitle, TSt histo->GetYaxis()->SetLabelSize(hLabelYaxisSize); histo->GetXaxis()->CenterTitle(centerXaxisTitle); histo->GetYaxis()->CenterTitle(centerYaxisTitle); - - return; } void DhCorrelationExtraction::SetTH2HistoStyle(TH2D*& histo, TString hTitle, TString hXaxisTitle, TString hYaxisTitle, TString hZaxisTitle, @@ -1549,6 +1555,4 @@ void DhCorrelationExtraction::SetTH2HistoStyle(TH2D*& histo, TString hTitle, TSt histo->GetZaxis()->SetLabelSize(hLabelZaxisSize); histo->GetXaxis()->CenterTitle(centerXaxisTitle); histo->GetYaxis()->CenterTitle(centerYaxisTitle); - - return; } diff --git a/PWGHF/HFC/Macros/DhCorrelationExtraction.h b/PWGHF/HFC/Macros/DhCorrelationExtraction.h index 52508ea3bb9..5040466d441 100644 --- a/PWGHF/HFC/Macros/DhCorrelationExtraction.h +++ b/PWGHF/HFC/Macros/DhCorrelationExtraction.h @@ -112,7 +112,7 @@ class DhCorrelationExtraction : public TObject fRebinSecPart = rebinSecPart; } void GetSignalAndBackgroundForNorm(Double_t PtCandMin, Double_t PtCandMax); - void NormalizeMEplot(TH2D*& histoME, TH2D*& histoMEsoftPi); + void NormalizeMEplot(TH2D*& histoME, TH2D*& histoMEsoftPi) const; void SetDebugLevel(Int_t debug) { fDebug = debug; } void SetDividedSidebands(Bool_t dividedSideb, Bool_t useSidebLeft, Bool_t useSidebRight) { diff --git a/PWGHF/HFC/Macros/DhCorrelationFitter.h b/PWGHF/HFC/Macros/DhCorrelationFitter.h index 8a9db7fe6e7..dbfe6f9a8a2 100644 --- a/PWGHF/HFC/Macros/DhCorrelationFitter.h +++ b/PWGHF/HFC/Macros/DhCorrelationFitter.h @@ -85,7 +85,7 @@ class DhCorrelationFitter Double_t GetNSYield() { return fFit->GetParameter("NS Y"); } Double_t GetASYield() { return fFit->GetParameter("AS Y"); } Double_t GetBeta() { return fFit->GetParameter(7); } - Double_t GetPedestal() { return fBaseline; } + Double_t GetPedestal() const { return fBaseline; } Double_t Getv2hadron() { return fFit->GetParameter("v_{2} hadron"); } Double_t Getv2Dmeson() { return fFit->GetParameter("v_{2} D meson"); } Double_t GetNSSigmaError() { return fFit->GetParError(fFit->GetParNumber("NS #sigma")); } // TODO: case kConstThreeGausPeriodicity @@ -93,16 +93,16 @@ class DhCorrelationFitter Double_t GetNSYieldError() { return fFit->GetParError(fFit->GetParNumber("NS Y")); } Double_t GetASYieldError() { return fFit->GetParError(fFit->GetParNumber("AS Y")); } Double_t GetBetaError() { return fFit->GetParError(7); } - Double_t GetPedestalError() { return fErrBaseline; } + Double_t GetPedestalError() const { return fErrBaseline; } Double_t Getv2hadronError() { return fFit->GetParError(fFit->GetParNumber("v_{2} hadron")); } Double_t Getv2DmesonError() { return fFit->GetParError(fFit->GetParNumber("v_{2} D meson")); } - Double_t GetBinCountingNSYield() { return fNSyieldBinCount; } - Double_t GetBinCountingASYield() { return fASyieldBinCount; } - Double_t GetBinCountingNSYieldErr() { return fErrNSyieldBinCount; } - Double_t GetBinCountingASYieldErr() { return fErrASyieldBinCount; } + Double_t GetBinCountingNSYield() const { return fNSyieldBinCount; } + Double_t GetBinCountingASYield() const { return fASyieldBinCount; } + Double_t GetBinCountingNSYieldErr() const { return fErrNSyieldBinCount; } + Double_t GetBinCountingASYieldErr() const { return fErrASyieldBinCount; } TF1* GetFitFunction() { - if (!fFit) { + if (fFit == nullptr) { printf("[ERROR] DhCorrelationFitter::GetFitFunction, No fit function"); return NULL; } diff --git a/PWGHF/HFC/TableProducer/correlatorD0D0bar.cxx b/PWGHF/HFC/TableProducer/correlatorD0D0bar.cxx index d3d73c4c374..d2b5a006658 100644 --- a/PWGHF/HFC/TableProducer/correlatorD0D0bar.cxx +++ b/PWGHF/HFC/TableProducer/correlatorD0D0bar.cxx @@ -182,12 +182,12 @@ struct HfCorrelatorD0D0bar { continue; } // check decay channel flag for candidate1 - if (!(candidate1.hfflag() & 1 << aod::hf_cand_2prong::DecayType::D0ToPiK)) { + if ((candidate1.hfflag() & 1 << aod::hf_cand_2prong::DecayType::D0ToPiK) == 0) { continue; } double efficiencyWeight = 1.; - if (applyEfficiency) { + if (applyEfficiency != 0) { efficiencyWeight = 1. / efficiencyD->at(o2::analysis::findBin(binsPt, candidate1.pt())); } @@ -214,7 +214,7 @@ struct HfCorrelatorD0D0bar { continue; } for (const auto& candidate2 : selectedD0CandidatesGrouped) { - if (!(candidate2.hfflag() & 1 << aod::hf_cand_2prong::DecayType::D0ToPiK)) { // check decay channel flag for candidate2 + if ((candidate2.hfflag() & 1 << aod::hf_cand_2prong::DecayType::D0ToPiK) == 0) { // check decay channel flag for candidate2 continue; } if (candidate2.isSelD0bar() < selectionFlagD0bar) { // keep only D0bar candidates passing the selection @@ -292,7 +292,7 @@ struct HfCorrelatorD0D0bar { bool flagD0barReflection = false; for (const auto& candidate1 : selectedD0CandidatesGroupedMC) { // check decay channel flag for candidate1 - if (!(candidate1.hfflag() & 1 << aod::hf_cand_2prong::DecayType::D0ToPiK)) { + if ((candidate1.hfflag() & 1 << aod::hf_cand_2prong::DecayType::D0ToPiK) == 0) { continue; } if (yCandMax >= 0. && std::abs(hfHelper.yD0(candidate1)) > yCandMax) { @@ -303,7 +303,7 @@ struct HfCorrelatorD0D0bar { } double efficiencyWeight = 1.; - if (applyEfficiency) { + if (applyEfficiency != 0) { efficiencyWeight = 1. / efficiencyD->at(o2::analysis::findBin(binsPt, candidate1.pt())); } @@ -345,7 +345,7 @@ struct HfCorrelatorD0D0bar { flagD0Signal = candidate1.flagMcMatchRec() == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK; // flagD0Signal 'true' if candidate1 matched to D0 (particle) flagD0Reflection = candidate1.flagMcMatchRec() == -o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK; // flagD0Reflection 'true' if candidate1, selected as D0 (particle), is matched to D0bar (antiparticle) for (const auto& candidate2 : selectedD0CandidatesGroupedMC) { - if (!(candidate2.hfflag() & 1 << aod::hf_cand_2prong::DecayType::D0ToPiK)) { // check decay channel flag for candidate2 + if ((candidate2.hfflag() & 1 << aod::hf_cand_2prong::DecayType::D0ToPiK) == 0) { // check decay channel flag for candidate2 continue; } if (candidate2.isSelD0bar() < selectionFlagD0bar) { // discard candidates not selected as D0bar in inner loop diff --git a/PWGHF/HFC/TableProducer/correlatorD0D0barBarrelFullPid.cxx b/PWGHF/HFC/TableProducer/correlatorD0D0barBarrelFullPid.cxx index 8257611a6c1..bdd438118fb 100644 --- a/PWGHF/HFC/TableProducer/correlatorD0D0barBarrelFullPid.cxx +++ b/PWGHF/HFC/TableProducer/correlatorD0D0barBarrelFullPid.cxx @@ -183,12 +183,12 @@ struct HfCorrelatorD0D0barBarrelFullPid { continue; } // check decay channel flag for candidate1 - if (!(candidate1.hfflag() & 1 << aod::hf_cand_2prong::DecayType::D0ToPiK)) { + if ((candidate1.hfflag() & 1 << aod::hf_cand_2prong::DecayType::D0ToPiK) == 0) { continue; } double efficiencyWeight = 1.; - if (applyEfficiency) { + if (applyEfficiency != 0) { efficiencyWeight = 1. / efficiencyD->at(o2::analysis::findBin(binsPt, candidate1.pt())); } @@ -215,7 +215,7 @@ struct HfCorrelatorD0D0barBarrelFullPid { continue; } for (const auto& candidate2 : selectedD0candidatesGrouped) { - if (!(candidate2.hfflag() & 1 << aod::hf_cand_2prong::DecayType::D0ToPiK)) { // check decay channel flag for candidate2 + if ((candidate2.hfflag() & 1 << aod::hf_cand_2prong::DecayType::D0ToPiK) == 0) { // check decay channel flag for candidate2 continue; } if (candidate2.isSelD0barTofPlusRichPid() < selectionFlagD0bar) { // keep only D0bar candidates passing the selection @@ -293,7 +293,7 @@ struct HfCorrelatorD0D0barBarrelFullPid { bool flagD0barReflection = false; for (const auto& candidate1 : selectedD0candidatesGroupedMC) { // check decay channel flag for candidate1 - if (!(candidate1.hfflag() & 1 << aod::hf_cand_2prong::DecayType::D0ToPiK)) { + if ((candidate1.hfflag() & 1 << aod::hf_cand_2prong::DecayType::D0ToPiK) == 0) { continue; } if (yCandMax >= 0. && std::abs(hfHelper.yD0(candidate1)) > yCandMax) { @@ -304,7 +304,7 @@ struct HfCorrelatorD0D0barBarrelFullPid { } double efficiencyWeight = 1.; - if (applyEfficiency) { + if (applyEfficiency != 0) { efficiencyWeight = 1. / efficiencyD->at(o2::analysis::findBin(binsPt, candidate1.pt())); } @@ -346,7 +346,7 @@ struct HfCorrelatorD0D0barBarrelFullPid { flagD0Signal = candidate1.flagMcMatchRec() == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK; // flagD0Signal 'true' if candidate1 matched to D0 (particle) flagD0Reflection = candidate1.flagMcMatchRec() == -o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK; // flagD0Reflection 'true' if candidate1, selected as D0 (particle), is matched to D0bar (antiparticle) for (const auto& candidate2 : selectedD0candidatesGroupedMC) { - if (!(candidate2.hfflag() & 1 << aod::hf_cand_2prong::DecayType::D0ToPiK)) { // check decay channel flag for candidate2 + if ((candidate2.hfflag() & 1 << aod::hf_cand_2prong::DecayType::D0ToPiK) == 0) { // check decay channel flag for candidate2 continue; } if (candidate2.isSelD0barTofPlusRichPid() < selectionFlagD0bar) { // discard candidates not selected as D0bar in inner loop diff --git a/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx b/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx index 09585789935..421c10fabb4 100644 --- a/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx @@ -135,7 +135,7 @@ struct HfCorrelatorD0HadronsSelection { } if (selNoSameBunchPileUpColl) { isNosameBunchPileUp = false; - isNosameBunchPileUp = static_cast(collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)); + isNosameBunchPileUp = collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup); } isSelColl = isD0Found && isSel8 && isNosameBunchPileUp; collisionsWithSelD0(isSelColl); @@ -169,7 +169,7 @@ struct HfCorrelatorD0HadronsSelection { isSel8 = collision.sel8(); } if (selNoSameBunchPileUpColl) { - isNosameBunchPileUp = static_cast(collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)); + isNosameBunchPileUp = collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup); } isSelColl = isD0Found && isSel8 && isNosameBunchPileUp; collisionsWithSelD0(isSelColl); @@ -398,7 +398,7 @@ struct HfCorrelatorD0Hadrons { // ========================== trigger efficiency ================================ double efficiencyWeight = 1.; - if (applyEfficiency) { + if (applyEfficiency != 0) { efficiencyWeight = 1. / efficiencyDmeson->at(o2::analysis::findBin(binsPtEfficiencyD, candidate.pt())); } // ========================== Fill mass histo ================================ @@ -409,7 +409,7 @@ struct HfCorrelatorD0Hadrons { for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { outputMlD0[iclass] = candidate.mlProbD0()[classMl->at(iclass)]; } - registry.fill(HIST("hMLScoresVsMassVsPtVsOrigin"), outputMlD0[0], outputMlD0[2], hfHelper.invMassD0ToPiK(candidate), candidate.pt(), candidate.isSelD0bar() ? o2::aod::hf_correlation_d0_hadron::D0D0barBoth : o2::aod::hf_correlation_d0_hadron::D0Only); + registry.fill(HIST("hMLScoresVsMassVsPtVsOrigin"), outputMlD0[0], outputMlD0[2], hfHelper.invMassD0ToPiK(candidate), candidate.pt(), (candidate.isSelD0bar() != 0) ? o2::aod::hf_correlation_d0_hadron::D0D0barBoth : o2::aod::hf_correlation_d0_hadron::D0Only); } if (candidate.isSelD0bar() >= selectionFlagD0bar) { registry.fill(HIST("hMass"), hfHelper.invMassD0barToKPi(candidate), candidate.pt(), efficiencyWeight); @@ -418,7 +418,7 @@ struct HfCorrelatorD0Hadrons { for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { outputMlD0bar[iclass] = candidate.mlProbD0bar()[classMl->at(iclass)]; } - registry.fill(HIST("hMLScoresVsMassVsPtVsOrigin"), outputMlD0bar[0], outputMlD0bar[2], hfHelper.invMassD0barToKPi(candidate), candidate.pt(), candidate.isSelD0() ? o2::aod::hf_correlation_d0_hadron::D0D0barBoth : o2::aod::hf_correlation_d0_hadron::D0barOnly); + registry.fill(HIST("hMLScoresVsMassVsPtVsOrigin"), outputMlD0bar[0], outputMlD0bar[2], hfHelper.invMassD0barToKPi(candidate), candidate.pt(), (candidate.isSelD0() != 0) ? o2::aod::hf_correlation_d0_hadron::D0D0barBoth : o2::aod::hf_correlation_d0_hadron::D0barOnly); } entryD0CandRecoInfo(hfHelper.invMassD0ToPiK(candidate), hfHelper.invMassD0barToKPi(candidate), candidate.pt(), outputMlD0[0], outputMlD0[2], outputMlD0bar[0], outputMlD0bar[2]); @@ -557,7 +557,7 @@ struct HfCorrelatorD0Hadrons { registry.fill(HIST("hD0PoolBin"), poolBin); double efficiencyWeight = 1.; - if (applyEfficiency) { + if (applyEfficiency != 0) { efficiencyWeight = 1. / efficiencyDmeson->at(o2::analysis::findBin(binsPtEfficiencyD, candidate.pt())); } diff --git a/PWGHF/HFC/TableProducer/correlatorDMesonPairs.cxx b/PWGHF/HFC/TableProducer/correlatorDMesonPairs.cxx index 8616569468c..5be8bb22275 100644 --- a/PWGHF/HFC/TableProducer/correlatorDMesonPairs.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDMesonPairs.cxx @@ -114,11 +114,11 @@ struct HfCorrelatorDMesonPairs { o2::analysis::HfMlResponseD0ToKPi hfMlResponse; o2::ccdb::CcdbApi ccdbApi; - std::vector outputMlD0Cand1 = {}; - std::vector outputMlD0barCand1 = {}; + std::vector outputMlD0Cand1; + std::vector outputMlD0barCand1; - std::vector outputMlD0Cand2 = {}; - std::vector outputMlD0barCand2 = {}; + std::vector outputMlD0Cand2; + std::vector outputMlD0barCand2; // using TracksWPid = soa::Join; @@ -550,23 +550,23 @@ struct HfCorrelatorDMesonPairs { registry.fill(HIST("hMatchingMcRec"), 8); } // Fill True info - if (isTrueDCand1) { + if (isTrueDCand1 != 0) { registry.fill(HIST("hSelectionStatus"), 6); - } else if (isTrueDbarCand1) { + } else if (isTrueDbarCand1 != 0) { registry.fill(HIST("hSelectionStatus"), 7); } - if (isTrueDCand2) { + if (isTrueDCand2 != 0) { registry.fill(HIST("hSelectionStatus"), 12); - } else if (isTrueDbarCand2) { + } else if (isTrueDbarCand2 != 0) { registry.fill(HIST("hSelectionStatus"), 13); } - if (isTrueDCand1 && isTrueDCand2) { + if ((isTrueDCand1 != 0) && (isTrueDCand2 != 0)) { registry.fill(HIST("hSelectionStatus"), 22); - } else if (isTrueDbarCand1 && isTrueDbarCand2) { + } else if ((isTrueDbarCand1 != 0) && (isTrueDbarCand2 != 0)) { registry.fill(HIST("hSelectionStatus"), 23); - } else if (isTrueDCand1 && isTrueDbarCand2) { + } else if ((isTrueDCand1 != 0) && (isTrueDbarCand2 != 0)) { registry.fill(HIST("hSelectionStatus"), 24); - } else if (isTrueDbarCand1 && isTrueDCand2) { + } else if ((isTrueDbarCand1 != 0) && (isTrueDCand2 != 0)) { registry.fill(HIST("hSelectionStatus"), 25); } } @@ -759,7 +759,7 @@ struct HfCorrelatorDMesonPairs { if (selectSignalRegionOnly && !(isSignalD0Cand1 || isSignalD0barCand1)) { continue; } - if (!(candidate1.isSelD0() >= selectionFlagD0 || candidate1.isSelD0bar() >= selectionFlagD0bar)) { + if (candidate1.isSelD0() < selectionFlagD0 && candidate1.isSelD0bar() < selectionFlagD0bar) { continue; } @@ -874,7 +874,7 @@ struct HfCorrelatorDMesonPairs { if (selectSignalRegionOnly && !(isSignalD0Cand2 || isSignalD0barCand2)) { continue; } - if (!(candidate2.isSelD0() >= selectionFlagD0 || candidate2.isSelD0bar() >= selectionFlagD0bar)) { + if (candidate2.isSelD0() < selectionFlagD0 && candidate2.isSelD0bar() < selectionFlagD0bar) { continue; } if (daughterTracksCutFlag && ((prong0Cand1 == prong0Cand2) || (prong1Cand1 == prong1Cand2) || (prong0Cand1 == prong1Cand2) || (prong1Cand1 == prong0Cand2))) { @@ -916,7 +916,7 @@ struct HfCorrelatorDMesonPairs { // Fill tables fillEntry(isDCand1, isDbarCand1, isDCand2, isDbarCand2, candidateType1, candidateType2, yCandidate1, yCandidate2, phiCandidate1, phiCandidate2, ptCandidate1, ptCandidate2, massD0Cand1, massD0barCand1, massD0Cand2, massD0barCand2); - fillMcHistos(matchedRec1, matchedRec2, isTrueDCand1, isTrueDbarCand1, isTrueDCand2, isTrueDbarCand2); + fillMcHistos(matchedRec1, matchedRec2, static_cast(isTrueDCand1), static_cast(isTrueDbarCand1), static_cast(isTrueDCand2), static_cast(isTrueDbarCand2)); entryD0PairMcInfo(originRec1, originRec2, matchedRec1, matchedRec2); entryD0PairMl(outputMlD0Cand1, outputMlD0barCand1, outputMlD0Cand2, outputMlD0barCand2); @@ -924,7 +924,7 @@ struct HfCorrelatorDMesonPairs { // Fill tables fillEntry(isDCand1, isDbarCand1, isDCand2, isDbarCand2, candidateType1, candidateType2, yCandidate1, yCandidate2, phiCandidate1, phiCandidate2, ptCandidate1, ptCandidate2, massD0Cand1, massD0barCand1, massD0Cand2, massD0barCand2); - fillMcHistos(matchedRec1, matchedRec2, isTrueDCand1, isTrueDbarCand1, isTrueDCand2, isTrueDbarCand2); + fillMcHistos(matchedRec1, matchedRec2, static_cast(isTrueDCand1), static_cast(isTrueDbarCand1), static_cast(isTrueDCand2), static_cast(isTrueDbarCand2)); entryD0PairMcInfo(originRec1, originRec2, matchedRec1, matchedRec2); } } // end inner loop (Cand2) diff --git a/PWGHF/HFC/TableProducer/correlatorDplusDminus.cxx b/PWGHF/HFC/TableProducer/correlatorDplusDminus.cxx index ecba4be2e53..29d0293c3e9 100644 --- a/PWGHF/HFC/TableProducer/correlatorDplusDminus.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDplusDminus.cxx @@ -183,12 +183,12 @@ struct HfCorrelatorDplusDminus { continue; } // check decay channel flag for candidate1 - if (!(candidate1.hfflag() & 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi)) { // probably dummy since already selected? not sure... + if ((candidate1.hfflag() & 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi) == 0) { // probably dummy since already selected? not sure... continue; } double efficiencyWeight = 1.; - if (applyEfficiency) { + if (applyEfficiency != 0) { efficiencyWeight = 1. / efficiencyD->at(o2::analysis::findBin(binsPt, candidate1.pt())); } @@ -222,7 +222,7 @@ struct HfCorrelatorDplusDminus { } for (const auto& candidate2 : selectedDPlusCandidatesGrouped) { // check decay channel flag for candidate2 - if (!(candidate2.hfflag() & 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi)) { // probably dummy since already selected? not sure... + if ((candidate2.hfflag() & 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi) == 0) { // probably dummy since already selected? not sure... continue; } auto innerSecondTrack = candidate2.prong1_as(); @@ -289,7 +289,7 @@ struct HfCorrelatorDplusDminus { bool flagDminusSignal = false; for (const auto& candidate1 : selectedDPlusCandidatesGroupedMC) { // check decay channel flag for candidate1 - if (!(candidate1.hfflag() & 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi)) { + if ((candidate1.hfflag() & 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi) == 0) { continue; } if (yCandMax >= 0. && std::abs(hfHelper.yDplus(candidate1)) > yCandMax) { @@ -300,7 +300,7 @@ struct HfCorrelatorDplusDminus { } double efficiencyWeight = 1.; - if (applyEfficiency) { + if (applyEfficiency != 0) { efficiencyWeight = 1. / efficiencyD->at(o2::analysis::findBin(binsPt, candidate1.pt())); } @@ -339,7 +339,7 @@ struct HfCorrelatorDplusDminus { } flagDplusSignal = std::abs(candidate1.flagMcMatchRec()) == hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi; // flagDplusSignal 'true' if candidate1 matched to Dplus for (const auto& candidate2 : selectedDPlusCandidatesGroupedMC) { - if (!(candidate2.hfflag() & 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi)) { // check decay channel flag for candidate2 + if ((candidate2.hfflag() & 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi) == 0) { // check decay channel flag for candidate2 continue; } auto innerSecondTrack = candidate2.prong1_as(); diff --git a/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx index b3f01ecba4c..d0fa0fd2d2c 100644 --- a/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx @@ -114,7 +114,7 @@ struct HfCorrelatorDplusHadronsDplusSelection { isSel8 = collision.sel8(); } if (selNoSameBunchPileUpColl) { - isNosameBunchPileUp = static_cast(collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)); + isNosameBunchPileUp = collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup); } isSelColl = isDplusFound && isSel8 && isNosameBunchPileUp; dplusSel(isSelColl); @@ -141,7 +141,7 @@ struct HfCorrelatorDplusHadronsDplusSelection { isSel8 = collision.sel8(); } if (selNoSameBunchPileUpColl) { - isNosameBunchPileUp = static_cast(collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)); + isNosameBunchPileUp = collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup); } isSelColl = isDplusFound && isSel8 && isNosameBunchPileUp; dplusSel(isSelColl); diff --git a/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx index e4a32fe8251..77523171e08 100644 --- a/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx @@ -123,7 +123,7 @@ struct HfCorrelatorDsHadronsSelCollision { } if (selNoSameBunchPileUpColl) { isNosameBunchPileUp = false; - isNosameBunchPileUp = static_cast(collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)); + isNosameBunchPileUp = collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup); } isSelColl = isDsFound && isSel8 && isNosameBunchPileUp; collisionsWithSelDs(isSelColl); @@ -152,7 +152,7 @@ struct HfCorrelatorDsHadronsSelCollision { isSel8 = collision.sel8(); } if (selNoSameBunchPileUpColl) { - isNosameBunchPileUp = static_cast(collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)); + isNosameBunchPileUp = collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup); } isSelColl = isDsFound && isSel8 && isNosameBunchPileUp; collisionsWithSelDs(isSelColl); @@ -821,8 +821,9 @@ struct HfCorrelatorDsHadrons { continue; } if (pidTrkApplied) { - if (!passPIDSelection(track, trkPIDspecies, pidTPCMax, pidTOFMax, tofPIDThreshold, forceTOF)) + if (!passPIDSelection(track, trkPIDspecies, pidTPCMax, pidTOFMax, tofPIDThreshold, forceTOF)) { continue; + } } assocTrackReduced(indexHfcReducedCollision, track.globalIndex(), track.phi(), track.eta(), track.pt() * track.sign()); assocTrackSelInfo(indexHfcReducedCollision, track.tpcNClsCrossedRows(), track.itsClusterMap(), track.itsNCls(), track.dcaXY(), track.dcaZ()); @@ -858,7 +859,7 @@ struct HfCorrelatorDsHadrons { registry.fill(HIST("hTracksPoolBin"), poolBin); // note that the selections here are not yet applied registry.fill(HIST("hDsPoolBin"), poolBinDs); // note that the selections here are not yet applied for (const auto& [cand, pAssoc] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { - if (!(cand.hfflag() & 1 << aod::hf_cand_3prong::DecayType::DsToKKPi)) { + if ((cand.hfflag() & 1 << aod::hf_cand_3prong::DecayType::DsToKKPi) == 0) { continue; } if (std::abs(hfHelper.yDs(cand)) > yCandMax || cand.pt() < ptCandMin || cand.pt() > ptCandMax) { diff --git a/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx index ede08bbbf6a..48a21874511 100644 --- a/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx @@ -237,7 +237,7 @@ struct HfCorrelatorDstarHadrons { auto candidatesPerCol = candidates.sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); auto tracksPerCol = tracks.sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); - if (candidatesPerCol.size() && tracksPerCol.size() == 0) { + if ((candidatesPerCol.size() != 0) && tracksPerCol.size() == 0) { continue; } // endif diff --git a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx index 060e961f5ee..7e6a59092ce 100644 --- a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx @@ -170,8 +170,9 @@ struct HfCorrelatorHfeHadrons { template void fillCorrelation(CollisionType const& collision, ElectronType const& electron, TracksType const& tracks, BcType const&) { - if (!(isRun3 ? collision.sel8() : (collision.sel7() && collision.alias_bit(kINT7)))) + if (!(isRun3 ? collision.sel8() : (collision.sel7() && collision.alias_bit(kINT7)))) { return; + } int poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.multFT0M())); auto bc = collision.template bc_as(); int gCollisionId = collision.globalIndex(); @@ -304,8 +305,9 @@ struct HfCorrelatorHfeHadrons { template void fillMixCorrelation(CollisionType1 const&, CollisionType2 const& c2, ElectronType const& tracks1, TracksType const& tracks2) { - if (!(isRun3 ? c2.sel8() : (c2.sel7() && c2.alias_bit(kINT7)))) + if (!(isRun3 ? c2.sel8() : (c2.sel7() && c2.alias_bit(kINT7)))) { return; + } double ptElectronMix = -999; double phiElectronMix = -999; double etaElectronMix = -999; diff --git a/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx index 6c791c7fde8..7abeb5201b1 100644 --- a/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx @@ -132,7 +132,7 @@ struct HfCorrelatorLcHadronsSelection { isSel8 = collision.sel8(); } if (selNoSameBunchPileUpColl) { - isNosameBunchPileUp = static_cast(collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)); + isNosameBunchPileUp = collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup); } isCentInRange = (cent >= centMin && cent < centMax); @@ -162,7 +162,7 @@ struct HfCorrelatorLcHadronsSelection { isSel8 = collision.sel8(); } if (selNoSameBunchPileUpColl) { - isNosameBunchPileUp = static_cast(collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)); + isNosameBunchPileUp = collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup); } isSelColl = isLcFound && isSel8 && isNosameBunchPileUp; lcSel(isSelColl); @@ -417,7 +417,7 @@ struct HfCorrelatorLcHadrons { continue; } double efficiencyWeightLc = 1.; - if (applyEfficiency) { + if (applyEfficiency != 0) { efficiencyWeightLc = 1. / efficiencyLc->at(o2::analysis::findBin(binsPtEfficiencyLc, candidate.pt())); } auto trackPos1 = candidate.template prong0_as(); // positive daughter (negative for the antiparticles) @@ -472,8 +472,9 @@ struct HfCorrelatorLcHadrons { continue; } if (pidTrkApplied) { - if (!passPIDSelection(track, trkPIDspecies, pidTPCMax, pidTOFMax, tofPIDThreshold, forceTOF)) + if (!passPIDSelection(track, trkPIDspecies, pidTPCMax, pidTOFMax, tofPIDThreshold, forceTOF)) { continue; + } } if (correlateLcWithLeadingParticle) { if (track.globalIndex() != leadingIndex) { @@ -575,7 +576,7 @@ struct HfCorrelatorLcHadrons { continue; } double efficiencyWeightLc = 1.; - if (applyEfficiency) { + if (applyEfficiency != 0) { efficiencyWeightLc = 1. / efficiencyLc->at(o2::analysis::findBin(binsPtEfficiencyLc, candidate.pt())); } auto trackPos1 = candidate.template prong0_as(); // positive daughter (negative for the antiparticles) @@ -677,16 +678,18 @@ struct HfCorrelatorLcHadrons { continue; } - if (pidTrkApplied && (std::abs(track.pdgCode()) != kProton)) + if (pidTrkApplied && (std::abs(track.pdgCode()) != kProton)) { continue; // proton PID + } if (!track.isPhysicalPrimary()) { continue; } auto motherTrkGen = mcParticles.iteratorAt(track.mothersIds()[0]); - if (std::abs(motherTrkGen.pdgCode()) == kLambdaCPlus) + if (std::abs(motherTrkGen.pdgCode()) == kLambdaCPlus) { continue; + } auto chargeTrack = pdg->GetParticle(track.pdgCode())->Charge(); // Retrieve charge registry.fill(HIST("hPtTracksVsSignGen"), track.pt(), chargeTrack / (2 * std::abs(chargeTrack))); @@ -706,22 +709,26 @@ struct HfCorrelatorLcHadrons { continue; } if (pidTrkApplied) { - if (!passPIDSelection(track, trkPIDspecies, pidTPCMax, pidTOFMax, tofPIDThreshold, forceTOF)) + if (!passPIDSelection(track, trkPIDspecies, pidTPCMax, pidTOFMax, tofPIDThreshold, forceTOF)) { continue; + } } if (calTrkEff && countLc == 1 && (isLcSignal || !calEffLcEvent) && track.has_mcParticle()) { auto mcParticle = track.template mcParticle_as(); - if (!mcParticle.isPhysicalPrimary() && isRecTrkPhyPrimary) + if (!mcParticle.isPhysicalPrimary() && isRecTrkPhyPrimary) { continue; + } auto motherTrk = mcParticles.iteratorAt(mcParticle.mothersIds()[0]); - if (std::abs(motherTrk.pdgCode()) == kLambdaCPlus) + if (std::abs(motherTrk.pdgCode()) == kLambdaCPlus) { continue; + } registry.fill(HIST("hPtTracksVsSignRec"), track.pt(), track.sign() / 2.); - if (std::abs(mcParticle.pdgCode()) == kProton) + if (std::abs(mcParticle.pdgCode()) == kProton) { registry.fill(HIST("hPtTracksVsSignRecTrue"), track.pt(), track.sign() / 2.); + } } // Removing Lc daughters by checking track indices @@ -887,8 +894,9 @@ struct HfCorrelatorLcHadrons { continue; } - if (pidTrkApplied && (std::abs(particleAssoc.pdgCode()) != kProton)) + if (pidTrkApplied && (std::abs(particleAssoc.pdgCode()) != kProton)) { continue; // proton PID + } if (!particleAssoc.isPhysicalPrimary()) { continue; @@ -937,8 +945,9 @@ struct HfCorrelatorLcHadrons { } if (pidTrkApplied) { - if (!passPIDSelection(assocParticle, trkPIDspecies, pidTPCMax, pidTOFMax, tofPIDThreshold, forceTOF)) + if (!passPIDSelection(assocParticle, trkPIDspecies, pidTPCMax, pidTOFMax, tofPIDThreshold, forceTOF)) { continue; + } } auto trackPos1 = trigLc.template prong0_as(); // positive daughter (negative for the antiparticles) @@ -1057,8 +1066,9 @@ struct HfCorrelatorLcHadrons { bool isLcSignal = std::abs(candidate.flagMcMatchRec()) == hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi; bool isLcPrompt = candidate.originMcRec() == RecoDecay::OriginType::Prompt; if (pidTrkApplied) { - if (!passPIDSelection(pAssoc, trkPIDspecies, pidTPCMax, pidTOFMax, tofPIDThreshold, forceTOF)) + if (!passPIDSelection(pAssoc, trkPIDspecies, pidTPCMax, pidTOFMax, tofPIDThreshold, forceTOF)) { continue; + } } auto trackPos1 = candidate.template prong0_as(); // positive daughter (negative for the antiparticles) int8_t chargeLc = trackPos1.sign(); // charge of 1st prong will be the charge of Lc candidate diff --git a/PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx index 595080e1c79..681d1b79592 100644 --- a/PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx @@ -644,16 +644,18 @@ struct HfCorrelatorLcScHadrons { continue; } - if (pidTrkApplied && (std::abs(track.pdgCode()) != kProton)) + if (pidTrkApplied && (std::abs(track.pdgCode()) != kProton)) { continue; // proton PID + } if (!track.isPhysicalPrimary()) { continue; } auto motherTrkGen = mcParticles.iteratorAt(track.mothersIds()[0]); - if (std::abs(motherTrkGen.pdgCode()) == kLambdaCPlus) + if (std::abs(motherTrkGen.pdgCode()) == kLambdaCPlus) { continue; + } auto chargeTrack = pdg->GetParticle(track.pdgCode())->Charge(); // Retrieve charge registry.fill(HIST("hPtTracksVsSignGen"), track.pt(), chargeTrack / (std::abs(chargeTrack))); @@ -924,8 +926,9 @@ struct HfCorrelatorLcScHadrons { continue; } if (pidTrkApplied) { - if (!passPIDSelection(track, trkPIDspecies, pidTPCMax, pidTOFMax, tofPIDThreshold, forceTOF)) + if (!passPIDSelection(track, trkPIDspecies, pidTPCMax, pidTOFMax, tofPIDThreshold, forceTOF)) { continue; + } } if (correlateLcWithLeadingParticle) { if (track.globalIndex() != leadingIndex) { @@ -935,16 +938,19 @@ struct HfCorrelatorLcScHadrons { if constexpr (isMcRec) { if (calTrkEff && countCand == 1 && (isSignal || !calEffEventWithCand) && track.has_mcParticle()) { auto mcParticle = track.template mcParticle_as(); - if (!mcParticle.isPhysicalPrimary() && isRecTrkPhyPrimary) + if (!mcParticle.isPhysicalPrimary() && isRecTrkPhyPrimary) { continue; + } auto motherTrk = mcParticles->iteratorAt(mcParticle.mothersIds()[0]); - if (std::abs(motherTrk.pdgCode()) == kLambdaCPlus) + if (std::abs(motherTrk.pdgCode()) == kLambdaCPlus) { continue; + } registry.fill(HIST("hPtTracksVsSignRec"), track.pt(), track.sign()); - if (std::abs(mcParticle.pdgCode()) == kProton) + if (std::abs(mcParticle.pdgCode()) == kProton) { registry.fill(HIST("hPtTracksVsSignRecTrue"), track.pt(), track.sign()); + } } } @@ -1063,8 +1069,9 @@ struct HfCorrelatorLcScHadrons { } if (pidTrkApplied) { - if (!passPIDSelection(assocParticle, trkPIDspecies, pidTPCMax, pidTOFMax, tofPIDThreshold, forceTOF)) + if (!passPIDSelection(assocParticle, trkPIDspecies, pidTPCMax, pidTOFMax, tofPIDThreshold, forceTOF)) { continue; + } } if (selLcPKPi) { @@ -1195,8 +1202,9 @@ struct HfCorrelatorLcScHadrons { continue; } - if (pidTrkApplied && (std::abs(particleAssoc.pdgCode()) != kProton)) + if (pidTrkApplied && (std::abs(particleAssoc.pdgCode()) != kProton)) { continue; // proton PID + } if (!particleAssoc.isPhysicalPrimary()) { continue; diff --git a/PWGHF/HFC/TableProducer/derivedDataCreatorCorrelationsReduced.cxx b/PWGHF/HFC/TableProducer/derivedDataCreatorCorrelationsReduced.cxx index 0ccbc065dd9..a35dbe29aed 100644 --- a/PWGHF/HFC/TableProducer/derivedDataCreatorCorrelationsReduced.cxx +++ b/PWGHF/HFC/TableProducer/derivedDataCreatorCorrelationsReduced.cxx @@ -266,10 +266,7 @@ struct HfDerivedDataCreatorCorrelationsReduced { std::abort(); } hfEvSel.fillHistograms(collision, collRejMask, cent); - if (collRejMask != 0) { - return false; - } - return true; + return collRejMask == 0; } /// Checks if the trigger cand-associated track pair can be accepted for SE correlation diff --git a/PWGHF/HFC/TableProducer/femtoDreamProducer.cxx b/PWGHF/HFC/TableProducer/femtoDreamProducer.cxx index 066e6d45022..8db6148de90 100644 --- a/PWGHF/HFC/TableProducer/femtoDreamProducer.cxx +++ b/PWGHF/HFC/TableProducer/femtoDreamProducer.cxx @@ -161,9 +161,9 @@ struct HfFemtoDreamProducer { HfHelper hfHelper; o2::analysis::HfMlResponseLcToPKPi hfMlResponse; o2::analysis::HfMlResponseDplusToPiKPi hfMlResponseDplus; - std::vector outputMlDplus = {}; - std::vector outputMlPKPi = {}; - std::vector outputMlPiKP = {}; + std::vector outputMlDplus; + std::vector outputMlPKPi; + std::vector outputMlPiKP; o2::ccdb::CcdbApi ccdbApi; o2::hf_evsel::HfEventSelection hfEvSel; Service ccdb; /// Accessing the CCDB @@ -529,8 +529,9 @@ struct HfFemtoDreamProducer { std::vector inputFeaturesDplusToPiKPi = hfMlResponseDplus.getInputFeatures(candidate); isSelectedMlDplusToPiKPi = hfMlResponseDplus.isSelectedMl(inputFeaturesDplusToPiKPi, candidate.pt(), outputMlDplus); } - if (!isSelectedMlDplusToPiKPi) + if (!isSelectedMlDplusToPiKPi) { continue; + } } else { LOGF(fatal, "Please check your Ml configuration!!"); } @@ -563,8 +564,9 @@ struct HfFemtoDreamProducer { std::vector inputFeaturesLcToPiKP = hfMlResponse.getInputFeatures(candidate, false); isSelectedMlLcToPiKP = hfMlResponse.isSelectedMl(inputFeaturesLcToPiKP, candidate.pt(), outputMlPKPi); } - if (!isSelectedMlLcToPKPi && !isSelectedMlLcToPiKP) + if (!isSelectedMlLcToPKPi && !isSelectedMlLcToPiKP) { continue; + } } else { LOGF(fatal, "Please check your Ml configuration!!"); } @@ -591,11 +593,12 @@ struct HfFemtoDreamProducer { qaRegistry.fill(HIST("hEventQA"), 1 + Event::CharmSelected); } - if (isTrackFilled && (sizeCand > 0)) + if (isTrackFilled && (sizeCand > 0)) { qaRegistry.fill(HIST("hEventQA"), 1 + Event::PairSelected); + } - rowMasks(static_cast(bitTrack), - static_cast(bitCand), + rowMasks(bitTrack, + bitCand, 0); } diff --git a/PWGHF/HFC/Tasks/taskCharmHadronsFemtoDream.cxx b/PWGHF/HFC/Tasks/taskCharmHadronsFemtoDream.cxx index 54b5ffe5230..146d6fb8955 100644 --- a/PWGHF/HFC/Tasks/taskCharmHadronsFemtoDream.cxx +++ b/PWGHF/HFC/Tasks/taskCharmHadronsFemtoDream.cxx @@ -287,10 +287,9 @@ struct HfTaskCharmHadronsFemtoDream { if (cand.candidateSelFlag() == 1) { invMass = cand.m(std::array{o2::constants::physics::MassProton, o2::constants::physics::MassKPlus, o2::constants::physics::MassPiPlus}); return invMass; - } else { - invMass = cand.m(std::array{o2::constants::physics::MassPiPlus, o2::constants::physics::MassKPlus, o2::constants::physics::MassProton}); - return invMass; } + invMass = cand.m(std::array{o2::constants::physics::MassPiPlus, o2::constants::physics::MassKPlus, o2::constants::physics::MassProton}); + return invMass; } // D+ → π K π (PDG: 411) if (charmHadPDGCode == o2::constants::physics::Pdg::kDPlus) { @@ -352,8 +351,9 @@ struct HfTaskCharmHadronsFemtoDream { processType = 1; // for same event for (auto const& [p1, p2] : combinations(CombinationsFullIndexPolicy(sliceTrk1, sliceCharmHad))) { - if (p1.trackId() == p2.prong0Id() || p1.trackId() == p2.prong1Id() || p1.trackId() == p2.prong2Id()) + if (p1.trackId() == p2.prong0Id() || p1.trackId() == p2.prong1Id() || p1.trackId() == p2.prong2Id()) { continue; + } if (useCPR.value) { if (pairCloseRejectionSE.isClosePair(p1, p2, parts, col.magField())) { @@ -579,7 +579,7 @@ struct HfTaskCharmHadronsFemtoDream { part.bdtFD()); } - if (sliceCharmHad.size() || sliceTrk1.size()) { + if ((sliceCharmHad.size() != 0) || (sliceTrk1.size() != 0)) { rowFemtoResultColl( col.globalIndex(), diff --git a/PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx index 94103939e5a..e053d3d576a 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx @@ -356,7 +356,7 @@ struct HfTaskCorrelationD0Hadrons { continue; } double efficiencyWeight = 1.; - if (applyEfficiency) { + if (applyEfficiency != 0) { efficiencyWeight = 1. / (efficiencyDmeson->at(o2::analysis::findBin(binsPtEfficiencyD, ptD)) * efficiencyHad->at(o2::analysis::findBin(binsPtEfficiencyHad, ptHadron))); } // reject entries outside pT ranges of interest @@ -514,7 +514,7 @@ struct HfTaskCorrelationD0Hadrons { continue; } double efficiencyWeight = 1.; - if (applyEfficiency) { + if (applyEfficiency != 0) { efficiencyWeight = 1. / (efficiencyDmeson->at(o2::analysis::findBin(binsPtEfficiencyD, ptD)) * efficiencyHad->at(o2::analysis::findBin(binsPtEfficiencyHad, ptHadron))); } if (isTowardTransverseAway) { @@ -538,7 +538,7 @@ struct HfTaskCorrelationD0Hadrons { } } // fill correlation plots for signal/bagkground correlations - if (pairEntry.signalStatus()) { + if (pairEntry.signalStatus() != 0) { registry.fill(HIST("hCorrel2DVsPtRecSig"), deltaPhi, deltaEta, ptD, ptHadron, efficiencyWeight); } else { diff --git a/PWGHF/HFC/Tasks/taskCorrelationDDbar.cxx b/PWGHF/HFC/Tasks/taskCorrelationDDbar.cxx index 3d8aacdcc4e..7a5584ff519 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationDDbar.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationDDbar.cxx @@ -257,7 +257,7 @@ struct HfTaskCorrelationDDbar { int pTBinDbar = o2::analysis::findBin(binsPtCorrelations, ptDbar); double efficiencyWeight = 1.; - if (applyEfficiency) { + if (applyEfficiency != 0) { efficiencyWeight = 1. / (efficiencyD->at(o2::analysis::findBin(binsPtEfficiency, ptD)) * efficiencyD->at(o2::analysis::findBin(binsPtEfficiency, ptDbar))); } @@ -314,7 +314,7 @@ struct HfTaskCorrelationDDbar { int pTBinDbar = o2::analysis::findBin(binsPtCorrelations, ptDbar); double efficiencyWeight = 1.; - if (applyEfficiency) { + if (applyEfficiency != 0) { efficiencyWeight = 1. / (efficiencyD->at(o2::analysis::findBin(binsPtEfficiency, ptD)) * efficiencyD->at(o2::analysis::findBin(binsPtEfficiency, ptDbar))); } diff --git a/PWGHF/HFC/Tasks/taskCorrelationDMesonPairs.cxx b/PWGHF/HFC/Tasks/taskCorrelationDMesonPairs.cxx index 31082ef795a..af5b60e03d7 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationDMesonPairs.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationDMesonPairs.cxx @@ -94,14 +94,15 @@ struct HfTaskCorrelationDMesonPairs { { if ((TESTBIT(candidateType, SelectedD) && TESTBIT(candidateType, TrueD)) || (TESTBIT(candidateType, SelectedDbar) && TESTBIT(candidateType, TrueDbar))) { return Signal; - } else if ((TESTBIT(candidateType, SelectedD) && TESTBIT(candidateType, TrueDbar)) || (TESTBIT(candidateType, SelectedDbar) && TESTBIT(candidateType, TrueD))) { + } + if ((TESTBIT(candidateType, SelectedD) && TESTBIT(candidateType, TrueDbar)) || (TESTBIT(candidateType, SelectedDbar) && TESTBIT(candidateType, TrueD))) { return Reflected; - } else if ((TESTBIT(candidateType, SelectedD) && !(TESTBIT(candidateType, TrueD) && TESTBIT(candidateType, TrueDbar))) || - (TESTBIT(candidateType, SelectedDbar) && !(TESTBIT(candidateType, TrueD) && TESTBIT(candidateType, TrueDbar)))) { + } + if ((TESTBIT(candidateType, SelectedD) && !(TESTBIT(candidateType, TrueD) && TESTBIT(candidateType, TrueDbar))) || + (TESTBIT(candidateType, SelectedDbar) && !(TESTBIT(candidateType, TrueD) && TESTBIT(candidateType, TrueDbar)))) { return Bkg; - } else { - return Default; } + return Default; } void processData(aod::D0Pair const& pairEntries) diff --git a/PWGHF/HFC/Tasks/taskCorrelationDplusHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationDplusHadrons.cxx index d9a1ef22760..fa5c3f05cfe 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationDplusHadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationDplusHadrons.cxx @@ -281,7 +281,7 @@ struct HfTaskCorrelationDplusHadrons { hCandidates->GetAxis(2)->SetTitle("Charm hadron origin"); // Loading efficiency histograms from CCDB - if (applyEfficiency && loadAccXEffFromCCDB) { + if ((applyEfficiency != 0) && loadAccXEffFromCCDB) { ccdb->setURL(ccdbUrl); ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); @@ -347,7 +347,7 @@ struct HfTaskCorrelationDplusHadrons { continue; } double efficiencyWeightD = 1.; - if (applyEfficiency) { + if (applyEfficiency != 0) { efficiencyWeightD = 1. / efficiencyD->at(o2::analysis::findBin(binsPtEfficiencyD, ptD)); if (loadAccXEffFromCCDB) { efficiencyWeightD = 1. / effD->GetBinContent(effD->FindBin(ptD)); @@ -389,7 +389,7 @@ struct HfTaskCorrelationDplusHadrons { continue; } double efficiencyWeight = 1.; - if (applyEfficiency) { + if (applyEfficiency != 0) { efficiencyWeight = 1. / (efficiencyD->at(effBinD) * efficiencyHad->at(o2::analysis::findBin(binsPtEfficiencyHad, ptHadron))); if (loadAccXEffFromCCDB) { efficiencyWeight = 1. / (effD->GetBinContent(effD->FindBin(ptD)) * mEfficiencyAssociated->GetBinContent(mEfficiencyAssociated->FindBin(ptHadron))); @@ -442,14 +442,15 @@ struct HfTaskCorrelationDplusHadrons { float bdtScorePromptOrNonPrompt = isPromptAnalysis ? bdtScorePrompt : bdtScoreNonPrompt; // reject entries outside pT ranges of interest - if (ptD < binsPtEfficiencyD->front() || ptD > binsPtEfficiencyD->back()) + if (ptD < binsPtEfficiencyD->front() || ptD > binsPtEfficiencyD->back()) { continue; + } if (bdtScorePromptOrNonPrompt < mlScorePromptOrNonPromptMin->at(effBinD) || bdtScorePromptOrNonPrompt > mlScorePromptOrNonPromptMax->at(effBinD) || bdtScoreBkg > mlScoreBkg->at(effBinD)) { continue; } double efficiencyWeightD = 1.; - if (applyEfficiency) { + if (applyEfficiency != 0) { if (isDplusPrompt) { efficiencyWeightD = 1. / efficiencyD->at(effBinD); if (loadAccXEffFromCCDB) { @@ -496,8 +497,9 @@ struct HfTaskCorrelationDplusHadrons { float bdtScorePromptOrNonPrompt = isPromptAnalysis ? bdtScorePrompt : bdtScoreNonPrompt; // reject entries outside pT ranges of interest - if (ptD < binsPtEfficiencyD->front() || ptD > binsPtEfficiencyD->back()) + if (ptD < binsPtEfficiencyD->front() || ptD > binsPtEfficiencyD->back()) { continue; + } if (bdtScorePromptOrNonPrompt < mlScorePromptOrNonPromptMin->at(effBinD) || bdtScorePromptOrNonPrompt > mlScorePromptOrNonPromptMax->at(effBinD) || bdtScoreBkg > mlScoreBkg->at(effBinD)) { continue; @@ -507,7 +509,7 @@ struct HfTaskCorrelationDplusHadrons { } double efficiencyWeight = 1.; - if (applyEfficiency) { + if (applyEfficiency != 0) { if (isDplusPrompt) { efficiencyWeight = 1. / (efficiencyD->at(effBinD) * efficiencyHad->at(o2::analysis::findBin(binsPtEfficiencyHad, ptHadron))); if (loadAccXEffFromCCDB) { diff --git a/PWGHF/HFC/Tasks/taskCorrelationHfeHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationHfeHadrons.cxx index 00202c55122..7a37a9181ac 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationHfeHadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationHfeHadrons.cxx @@ -103,7 +103,7 @@ struct HfTaskCorrelationHfeHadrons { ptHadron = pairEntry.ptHadron(); registry.fill(HIST("hMcGenInclusiveEHCorrel"), ptElectron, ptHadron, deltaPhi, deltaEta); - if (pairEntry.isNonHfEHCorr()) { + if (pairEntry.isNonHfEHCorr() != 0) { registry.fill(HIST("hMcGenNonHfEHCorrel"), ptElectron, ptHadron, deltaPhi, deltaEta); } diff --git a/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx index cf3e92e78df..fb5f992309c 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx @@ -368,7 +368,7 @@ struct HfTaskCorrelationLcHadrons { hCandidates->GetAxis(2)->SetTitle("Charm hadron origin"); // Loading efficiency histograms from CCDB - if (applyEfficiency && loadAccXEffFromCCDB) { + if ((applyEfficiency != 0) && loadAccXEffFromCCDB) { ccdb->setURL(ccdbUrl); ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); @@ -430,7 +430,7 @@ struct HfTaskCorrelationLcHadrons { continue; } double efficiencyWeightLc = 1.; - if (applyEfficiency) { + if (applyEfficiency != 0) { efficiencyWeightLc = 1. / efficiencyLc->at(o2::analysis::findBin(binsPtEfficiencyLc, ptLc)); if (loadAccXEffFromCCDB) { efficiencyWeightLc = 1. / mEfficiencyPrompt->GetBinContent(mEfficiencyPrompt->FindBin(ptLc)); @@ -476,7 +476,7 @@ struct HfTaskCorrelationLcHadrons { } double efficiencyWeight = 1.; - if (applyEfficiency) { + if (applyEfficiency != 0) { efficiencyWeight = 1. / (efficiencyLc->at(effBinLc) * efficiencyHad->at(o2::analysis::findBin(binsPtEfficiencyHad, ptHadron))); if (loadAccXEffFromCCDB) { efficiencyWeight = 1. / (mEfficiencyPrompt->GetBinContent(mEfficiencyPrompt->FindBin(ptLc)) * mEfficiencyAssociated->GetBinContent(mEfficiencyAssociated->FindBin(ptHadron))); @@ -567,14 +567,15 @@ struct HfTaskCorrelationLcHadrons { bool isLcPrompt = candidate.isPrompt(); // reject entries outside pT ranges of interest - if (ptLc < binsPtEfficiencyLc->front() || ptLc > binsPtEfficiencyLc->back()) + if (ptLc < binsPtEfficiencyLc->front() || ptLc > binsPtEfficiencyLc->back()) { continue; + } if (bdtScorePrompt < mlOutputPrompt->at(effBinLc) || bdtScoreBkg > mlOutputBkg->at(effBinLc)) { continue; } double efficiencyWeightLc = 1.; - if (applyEfficiency) { + if (applyEfficiency != 0) { if (isLcPrompt) { efficiencyWeightLc = 1. / efficiencyLc->at(effBinLc); if (loadAccXEffFromCCDB) { @@ -621,8 +622,9 @@ struct HfTaskCorrelationLcHadrons { int signPair = 0; // reject entries outside pT ranges of interest - if (ptLc < binsPtEfficiencyLc->front() || ptLc > binsPtEfficiencyLc->back()) + if (ptLc < binsPtEfficiencyLc->front() || ptLc > binsPtEfficiencyLc->back()) { continue; + } if (bdtScorePrompt < mlOutputPrompt->at(effBinLc) || bdtScoreBkg > mlOutputBkg->at(effBinLc)) { continue; @@ -632,8 +634,8 @@ struct HfTaskCorrelationLcHadrons { } double efficiencyWeight = 1.; - if (applyEfficiency) { - if (statusLcPrompt) { + if (applyEfficiency != 0) { + if (statusLcPrompt != 0) { efficiencyWeight = 1. / (efficiencyLc->at(effBinLc) * efficiencyHad->at(o2::analysis::findBin(binsPtEfficiencyHad, ptHadron))); if (loadAccXEffFromCCDB) { efficiencyWeight = 1. / (mEfficiencyPrompt->GetBinContent(mEfficiencyPrompt->FindBin(ptLc)) * mEfficiencyAssociated->GetBinContent(mEfficiencyAssociated->FindBin(ptHadron))); @@ -675,7 +677,7 @@ struct HfTaskCorrelationLcHadrons { } // fill correlation plots for signal/bagkground correlations - if (pairEntry.signalStatus()) { + if (pairEntry.signalStatus() != 0) { if (fillSign) { registry.fill(HIST("hCorrel2DVsPtSignSignalMcRec"), deltaPhi, deltaEta, ptLc, ptHadron, signPair, poolBin, efficiencyWeight); } else { diff --git a/PWGHF/HFC/Tasks/taskFlow.cxx b/PWGHF/HFC/Tasks/taskFlow.cxx index 2e61b5117ab..30864fd8de3 100644 --- a/PWGHF/HFC/Tasks/taskFlow.cxx +++ b/PWGHF/HFC/Tasks/taskFlow.cxx @@ -695,7 +695,7 @@ struct HfTaskFlow { return RecoDecay::phi(chPos.X() + (*offsetFT0)[i].getX(), chPos.Y() + (*offsetFT0)[i].getY()); } - double getPhiFV0(unsigned int chno) + double getPhiFV0(unsigned int chno) const { int cellsInLeft[] = {0, 1, 2, 3, 8, 9, 10, 11, 16, 17, 18, 19, 24, 25, 26, 27, 32, 40, 33, 41, 34, 42, 35, 43}; bool isChnoInLeft = std::find(std::begin(cellsInLeft), std::end(cellsInLeft), chno) != std::end(cellsInLeft); @@ -731,7 +731,7 @@ struct HfTaskFlow { return -std::log(std::tan(0.5 * theta)); } - double getEtaFV0(unsigned int chno) + double getEtaFV0(unsigned int chno) const { int cellsInLeft[] = {0, 1, 2, 3, 8, 9, 10, 11, 16, 17, 18, 19, 24, 25, 26, 27, 32, 40, 33, 41, 34, 42, 35, 43}; bool isChnoInLeft = std::find(std::begin(cellsInLeft), std::end(cellsInLeft), chno) != std::end(cellsInLeft); @@ -773,7 +773,7 @@ struct HfTaskFlow { registry.fill(HIST("Data/hEventCounter"), EventSelectionStep::AllEvents); } - if (configTask.processMc == false) { + if (!configTask.processMc) { if (!collision.sel8()) { return false; } @@ -1018,7 +1018,7 @@ struct HfTaskFlow { // FILL QA PLOTS for trigger particle if (sameEvent && (step == CorrelationContainer::kCFStepReconstructed)) { - if (configTask.processMc == false) { // If DATA + if (!configTask.processMc) { // If DATA if constexpr (!std::is_same_v) { // IF TPC-TPC case if constexpr (std::is_same_v) { // IF D0 CASE -> TPC-TPC D0-h fillTriggerQa(multiplicity, eta1, phi1, pt1); @@ -1185,7 +1185,7 @@ struct HfTaskFlow { } // FILL QA PLOTS for trigger particle - if (sameEvent && (cutAmbiguousTracks == false)) { + if (sameEvent && (!cutAmbiguousTracks)) { if constexpr (std::is_same_v) { fillTriggerQa(multiplicity, eta1, phi1, pt1); } else if constexpr (std::is_same_v) { @@ -1265,7 +1265,7 @@ struct HfTaskFlow { } // FILL QA PLOTS for associated particle - if (sameEvent && (loopCounter == 1) && (cutAmbiguousTracks == false)) { + if (sameEvent && (loopCounter == 1) && (!cutAmbiguousTracks)) { if constexpr (std::is_same_v) { fillAssociatedQa(multiplicity, eta2, phi2); } else if constexpr (std::is_same_v) { @@ -1332,7 +1332,7 @@ struct HfTaskFlow { // FILL QA PLOTS for trigger particle if (sameEvent && (step == CorrelationContainer::kCFStepReconstructed)) { - if (configTask.processMc == false) { // If DATA + if (!configTask.processMc) { // If DATA if constexpr (!std::is_same_v) { // If not FilteredMftTracks as trigger -> TPC-FV0a correlations if constexpr (std::is_same_v) { // IF D0 CASE -> TPC-FV0a D0-h if constexpr (std::is_same_v) { // IF NEITHER D0 NOR LC -> @@ -1744,8 +1744,9 @@ struct HfTaskFlow { auto fillEventSelectionPlots = true; // When doing reference flow, two cases are used (HF-h, h-h) and thus eventSelectionPlots was filled twice - if (configTask.doReferenceFlow) + if (configTask.doReferenceFlow) { fillEventSelectionPlots = false; + } if (!(isAcceptedCollision(collision, fillEventSelectionPlots))) { return; @@ -1769,8 +1770,9 @@ struct HfTaskFlow { auto fillEventSelectionPlots = true; // When doing reference flow, two cases are used (HF-h, h-h) and thus eventSelectionPlots was filled twice - if (configTask.doReferenceFlow) + if (configTask.doReferenceFlow) { fillEventSelectionPlots = false; + } if (!(isAcceptedCollision(collision, fillEventSelectionPlots))) { return; @@ -1885,8 +1887,9 @@ struct HfTaskFlow { auto fillEventSelectionPlots = true; // When doing reference flow, two cases are used (HF-h, h-h) and thus eventSelectionPlots was filled twice - if (configTask.doReferenceFlow) + if (configTask.doReferenceFlow) { fillEventSelectionPlots = false; + } if (!(isAcceptedCollision(collision, fillEventSelectionPlots))) { return; @@ -1928,8 +1931,9 @@ struct HfTaskFlow { auto fillEventSelectionPlots = true; // When doing reference flow, two cases are used (HF-h, h-h) and thus eventSelectionPlots was filled twice - if (configTask.doReferenceFlow) + if (configTask.doReferenceFlow) { fillEventSelectionPlots = false; + } if (!(isAcceptedCollision(collision, fillEventSelectionPlots))) { return; diff --git a/PWGHF/HFC/Utils/utilsCorrelations.h b/PWGHF/HFC/Utils/utilsCorrelations.h index 56fc5e435e2..332867cc135 100644 --- a/PWGHF/HFC/Utils/utilsCorrelations.h +++ b/PWGHF/HFC/Utils/utilsCorrelations.h @@ -59,11 +59,11 @@ Region getRegion(T const deltaPhi) { if (std::abs(deltaPhi) < PhiTowardMax) { return Toward; - } else if (deltaPhi > PhiAwayMin && deltaPhi < PhiAwayMax) { + } + if (deltaPhi > PhiAwayMin && deltaPhi < PhiAwayMax) { return Away; - } else { - return Transverse; } + return Transverse; } // Pair Sign Calculation @@ -99,8 +99,9 @@ bool passPIDSelection(Atrack const& track, SpeciesContainer const mPIDspecies, auto const& pid = mPIDspecies->at(speciesIndex); auto nSigmaTPC = o2::aod::pidutils::tpcNSigma(pid, track); - if (tofForced && !track.hasTOF()) + if (tofForced && !track.hasTOF()) { return false; + } if (speciesIndex == 0) { // First species logic if (std::abs(nSigmaTPC) > maxTPC->at(speciesIndex)) { diff --git a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx index e890bbe72d7..db8502466c5 100644 --- a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx +++ b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx @@ -376,8 +376,9 @@ struct HfElectronSelectionWithTpcEmcal { template void fillElectronTrack(CollisionType const& collision, TracksType const& tracks, EmcClusterType const& emcClusters, MatchType const& matchedTracks, ParticleType const& /*particlemc*/) { - if (!(isRun3 ? collision.sel8() : (collision.sel7() && collision.alias_bit(kINT7)))) + if (!(isRun3 ? collision.sel8() : (collision.sel7() && collision.alias_bit(kINT7)))) { return; + } registry.fill(HIST("hNevents"), 1); @@ -421,10 +422,12 @@ struct HfElectronSelectionWithTpcEmcal { if (!selTracks(track)) { continue; } - if ((phiTrack > phiTrackEMCalMin && phiTrack < phiTrackEMCalMax) && (etaTrack > etaTrackMin && etaTrack < etaTrackMax)) + if ((phiTrack > phiTrackEMCalMin && phiTrack < phiTrackEMCalMax) && (etaTrack > etaTrackMin && etaTrack < etaTrackMax)) { passEMCal = EMCalAcceptance; // EMcal acceptance passed - if ((phiTrack > phiTrackDCalMin && phiTrack < phiTrackDCalMax) && ((etaTrack > etaTrackDCalPositiveMin && etaTrack < etaTrackDCalPositiveMax) || (etaTrack > etaTrackDCalNegativeMin && etaTrack < etaTrackDCalNegativeMax))) + } + if ((phiTrack > phiTrackDCalMin && phiTrack < phiTrackDCalMax) && ((etaTrack > etaTrackDCalPositiveMin && etaTrack < etaTrackDCalPositiveMax) || (etaTrack > etaTrackDCalNegativeMin && etaTrack < etaTrackDCalNegativeMax))) { passEMCal = DCalAcceptance; // Dcal acceptance passed + } if (fillTrackInfo) { registry.fill(HIST("hTrackEtaPhi"), etaTrack, phiTrack, passEMCal); // track etaphi infor after filter bit diff --git a/PWGHF/HFL/TableProducer/treeCreatorElectronDCA.cxx b/PWGHF/HFL/TableProducer/treeCreatorElectronDCA.cxx index 1b32608a310..8f462ae24e6 100644 --- a/PWGHF/HFL/TableProducer/treeCreatorElectronDCA.cxx +++ b/PWGHF/HFL/TableProducer/treeCreatorElectronDCA.cxx @@ -94,15 +94,19 @@ struct HfTreeCreatorElectronDCA { registry.get(HIST("hZVertex"))->Fill(collision.posZ()); int pdgCode = 0, absPDGCode = 0, sourcePDG = 0; for (const auto& track : tracks) { - if (!track.trackCutFlagFb3()) + if (!track.trackCutFlagFb3()) { continue; + } registry.get(HIST("hpTTracks"))->Fill(track.pt()); - if (track.pt() < pTMin) + if (track.pt() < pTMin) { continue; - if (std::abs(track.eta()) > etaRange) + } + if (std::abs(track.eta()) > etaRange) { continue; - if (track.mcParticleId() < 1) + } + if (track.mcParticleId() < 1) { continue; + } auto mcTrack = track.mcParticle(); if (std::abs(mcTrack.pdgCode()) == kElectron) { bool isConversion = false; @@ -114,17 +118,18 @@ struct HfTreeCreatorElectronDCA { int numberOfMothers = motherTracks.size(); // Categorise the electron sources int firstMotherPDG = motherTracks[0].pdgCode(); - if (firstMotherPDG == kGamma) + if (firstMotherPDG == kGamma) { isConversion = true; + } while (numberOfMothers == 1) // loop through all generations { pdgCode = motherTracks[0].pdgCode(); absPDGCode = std::abs(pdgCode); - if (static_cast(absPDGCode / 100) == 4 || static_cast(absPDGCode / 1000) == 4) { + if ((absPDGCode / 100) == 4 || (absPDGCode / 1000) == 4) { isCharm = true; sourcePDG = pdgCode; } - if (static_cast(absPDGCode / 100) == 5 || static_cast(absPDGCode / 1000) == 5) { + if ((absPDGCode / 100) == 5 || (absPDGCode / 1000) == 5) { isBeauty = true; sourcePDG = pdgCode; // already in order, since beauty would decay to charm } @@ -133,10 +138,11 @@ struct HfTreeCreatorElectronDCA { numberOfMothers = motherTracks.size(); } if (!isBeauty && !isCharm) { - if (isConversion) + if (isConversion) { sourcePDG = kGamma; - else + } else { sourcePDG = firstMotherPDG; + } } hfEleTable(track.eta(), track.phi(), track.pt(), sourcePDG, track.dcaXY(), productionRadius); } diff --git a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx index 1d547044468..18306b50b80 100644 --- a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx +++ b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx @@ -467,8 +467,9 @@ struct HfTaskElectronWeakBoson { o2::base::Propagator::initFieldFromGRP(grpo); double magneticField = o2::base::Propagator::Instance()->getNominalBz(); LOG(info) << "magneticField = " << magneticField; - if (magneticField) + if (magneticField != 0.0) { KFParticle::SetField(magneticField); + } } // Check if this is a triggered event using Zorro @@ -583,11 +584,12 @@ struct HfTaskElectronWeakBoson { bool isIsolated = false; bool isIsolatedTr = false; - if (tracksofcluster.size() && isEMCacceptance) { + if ((tracksofcluster.size() != 0) && isEMCacceptance) { int nMatch = 0; for (const auto& match : tracksofcluster) { - if (match.emcalcluster_as().time() < timeEmcMin || match.emcalcluster_as().time() > timeEmcMax) + if (match.emcalcluster_as().time() < timeEmcMin || match.emcalcluster_as().time() > timeEmcMax) { continue; + } float m02Emc = match.emcalcluster_as().m02(); float energyEmc = match.emcalcluster_as().energy(); @@ -617,8 +619,9 @@ struct HfTaskElectronWeakBoson { registry.fill(HIST("hEMCtime"), timeEmc); registry.fill(HIST("hEnergy"), energyEmc); - if (std::abs(dPhi) > rMatchMax || std::abs(dEta) > rMatchMax) + if (std::abs(dPhi) > rMatchMax || std::abs(dEta) > rMatchMax) { continue; + } registry.fill(HIST("hTrMatchR"), match.track_as().pt(), r); registry.fill(HIST("hEnergyNcell"), energyEmc, match.emcalcluster_as().nCells()); @@ -641,10 +644,12 @@ struct HfTaskElectronWeakBoson { if (match.track_as().tpcNSigmaEl() > nsigTpcMin && match.track_as().tpcNSigmaEl() < nsigTpcMax) { registry.fill(HIST("hEop"), match.track_as().pt(), eop); - if (eop > eopMin && eop < eopMax && isoEnergy < energyIsolationMax) + if (eop > eopMin && eop < eopMax && isoEnergy < energyIsolationMax) { isIsolated = true; - if (eop > eopMin && eop < eopMax && trackCount < trackIsolationMax) + } + if (eop > eopMin && eop < eopMax && trackCount < trackIsolationMax) { isIsolatedTr = true; + } if (isIsolated && isIsolatedTr) { registry.fill(HIST("hEopIsolation"), match.track_as().pt(), eop); @@ -705,7 +710,7 @@ struct HfTaskElectronWeakBoson { } // end of track loop // Z-hadron - if (reconstructedZ.size() > 0) { + if (!reconstructedZ.empty()) { for (const auto& zBoson : reconstructedZ) { // Z boson selection if (zBoson.mass < massZMin || zBoson.mass > massZMax) { @@ -728,7 +733,7 @@ struct HfTaskElectronWeakBoson { } // end of Z-hadron correlation // Z->ee QA if (enableZeeRecoQA) { - if (selectedElectronsIso.size() > 0 && selectedPositronsIso.size() > 0) { + if (!selectedElectronsIso.empty() && !selectedPositronsIso.empty()) { for (const auto& trackEle : selectedElectronsIso) { for (const auto& trackPos : selectedPositronsIso) { auto child1 = RecoDecayPtEtaPhi::pVector(trackEle.pt, trackEle.eta, trackEle.phi); diff --git a/PWGHF/HFL/Tasks/taskMuonCharmBeautySeparation.cxx b/PWGHF/HFL/Tasks/taskMuonCharmBeautySeparation.cxx index 5fca08870fa..33f04cef72b 100644 --- a/PWGHF/HFL/Tasks/taskMuonCharmBeautySeparation.cxx +++ b/PWGHF/HFL/Tasks/taskMuonCharmBeautySeparation.cxx @@ -86,8 +86,9 @@ struct HfTaskMuonCharmBeautySeparation { } } registry.fill(HIST("hForwardMultiplicity"), nFwdTracks); - if (nFwdTracks > 0) + if (nFwdTracks > 0) { registry.fill(HIST("hZvtx_WithMuons"), zvtx); + } } }; diff --git a/PWGHF/HFL/Tasks/taskSingleElectron.cxx b/PWGHF/HFL/Tasks/taskSingleElectron.cxx index a235dc78da7..cb7dc2d4288 100644 --- a/PWGHF/HFL/Tasks/taskSingleElectron.cxx +++ b/PWGHF/HFL/Tasks/taskSingleElectron.cxx @@ -237,14 +237,13 @@ struct HfTaskSingleElectron { if (grmothersIdsVec.empty()) { return DirectCharm; - } else { - grmotherPt = mctrack.front().pt(); - grmotherPdg = std::abs(mctrack.front().pdgCode()); - if ((static_cast(grmotherPdg / 100.) % 10) == kBottom || (static_cast(grmotherPdg / 1000.) % 10) == kBottom) { - mpt = grmotherPt; - mpdg = grmotherPdg; - return BeautyCharm; - } + } + grmotherPt = mctrack.front().pt(); + grmotherPdg = std::abs(mctrack.front().pdgCode()); + if ((static_cast(grmotherPdg / 100.) % 10) == kBottom || (static_cast(grmotherPdg / 1000.) % 10) == kBottom) { + mpt = grmotherPt; + mpdg = grmotherPdg; + return BeautyCharm; } } partMother = mctrack; @@ -257,77 +256,86 @@ struct HfTaskSingleElectron { auto const& grmothersIdsVec = mctrack.front().mothersIds(); if (grmothersIdsVec.empty()) { return DirectGamma; - } else { - grmotherPdg = std::abs(mctrack.front().pdgCode()); - mpdg = grmotherPdg; - mpt = mctrack.front().pt(); - - partMother = mctrack; - mctrack = partMother.front().template mothers_as(); - if (mctrack.size()) { - auto const& ggrmothersIdsVec = mctrack.front().mothersIds(); - if (ggrmothersIdsVec.empty()) { - if (grmotherPdg == kPi0) { - return GammaPi0; - } else if (grmotherPdg == kEta) { - return GammaEta; - } else if (grmotherPdg == kOmega) { - return GammaOmega; - } else if (grmotherPdg == kPhi) { - return GammaPhi; - } else if (grmotherPdg == kEtaPrime) { - return GammaEtaPrime; - } else if (grmotherPdg == kRho770_0) { - return GammaRho0; - } else { - return Else; - } - } else { - ggrmotherPdg = mctrack.front().pdgCode(); - ggrmotherPt = mctrack.front().pt(); - mpdg = ggrmotherPdg; - mpt = ggrmotherPt; - if (grmotherPdg == kPi0) { - if (ggrmotherPdg == kK0Short) { - return GammaK0s; - } else if (ggrmotherPdg == kK0Long) { - return GammaK0l; - } else if (ggrmotherPdg == kKPlus) { - return GammaKe3; - } else if (ggrmotherPdg == kLambda0) { - return GammaLambda0; - } else if (ggrmotherPdg == kSigmaPlus) { - return GammaSigma; - } else { - mpdg = grmotherPdg; - mpt = grmotherPt; - return GammaPi0; - } - } else if (grmotherPdg == kEta) { - mpdg = grmotherPdg; - mpt = grmotherPt; - return GammaEta; - } else if (grmotherPdg == kOmega) { - mpdg = grmotherPdg; - mpt = grmotherPt; - return GammaOmega; - } else if (grmotherPdg == kPhi) { - mpdg = grmotherPdg; - mpt = grmotherPt; - return GammaPhi; - } else if (grmotherPdg == kEtaPrime) { - mpdg = grmotherPdg; - mpt = grmotherPt; - return GammaEtaPrime; - } else if (grmotherPdg == kRho770_0) { - mpdg = grmotherPdg; - mpt = grmotherPt; - return GammaRho0; - } else { - return Else; - } + } + grmotherPdg = std::abs(mctrack.front().pdgCode()); + mpdg = grmotherPdg; + mpt = mctrack.front().pt(); + + partMother = mctrack; + mctrack = partMother.front().template mothers_as(); + if (mctrack.size()) { + auto const& ggrmothersIdsVec = mctrack.front().mothersIds(); + if (ggrmothersIdsVec.empty()) { + if (grmotherPdg == kPi0) { + return GammaPi0; + } + if (grmotherPdg == kEta) { + return GammaEta; + } + if (grmotherPdg == kOmega) { + return GammaOmega; + } + if (grmotherPdg == kPhi) { + return GammaPhi; + } + if (grmotherPdg == kEtaPrime) { + return GammaEtaPrime; } + if (grmotherPdg == kRho770_0) { + return GammaRho0; + } + return Else; + } + ggrmotherPdg = mctrack.front().pdgCode(); + ggrmotherPt = mctrack.front().pt(); + mpdg = ggrmotherPdg; + mpt = ggrmotherPt; + if (grmotherPdg == kPi0) { + if (ggrmotherPdg == kK0Short) { + return GammaK0s; + } + if (ggrmotherPdg == kK0Long) { + return GammaK0l; + } + if (ggrmotherPdg == kKPlus) { + return GammaKe3; + } + if (ggrmotherPdg == kLambda0) { + return GammaLambda0; + } + if (ggrmotherPdg == kSigmaPlus) { + return GammaSigma; + } + mpdg = grmotherPdg; + mpt = grmotherPt; + return GammaPi0; + } + if (grmotherPdg == kEta) { + mpdg = grmotherPdg; + mpt = grmotherPt; + return GammaEta; + } + if (grmotherPdg == kOmega) { + mpdg = grmotherPdg; + mpt = grmotherPt; + return GammaOmega; + } + if (grmotherPdg == kPhi) { + mpdg = grmotherPdg; + mpt = grmotherPt; + return GammaPhi; + } + if (grmotherPdg == kEtaPrime) { + mpdg = grmotherPdg; + mpt = grmotherPt; + return GammaEtaPrime; + } + if (grmotherPdg == kRho770_0) { + mpdg = grmotherPdg; + mpt = grmotherPt; + return GammaRho0; } + return Else; } } } else { // check if electron from Dalitz decays @@ -350,46 +358,53 @@ struct HfTaskSingleElectron { return it->second; } return Else; - - } else { - if (motherPdg == kPi0) { - grmotherPt = mctrack.front().pt(); - grmotherPdg = mctrack.front().pdgCode(); - mpt = grmotherPt; - mpdg = grmotherPdg; - if (grmotherPdg == kK0Short) { - return K0s; - } else if (grmotherPdg == kK0Long) { - return K0l; - } else if (grmotherPdg == kKPlus) { - return Ke3; - } else if (grmotherPdg == kLambda0) { - return Lambda0; - } else if (grmotherPdg == kSigmaPlus) { - return Sigma; - } else { - mpt = motherPt; - mpdg = motherPdg; - return Pi0; - } - } else if (motherPdg == kEta) { - return Eta; - } else if (motherPdg == kOmega) { - return Omega; - } else if (motherPdg == kPhi) { - return Phi; - } else if (motherPdg == kEtaPrime) { - return EtaPrime; - } else if (motherPdg == kRho770_0) { - return Rho0; - } else if (motherPdg == kKPlus) { - return Ke3; - } else if (motherPdg == kK0Long) { + } + if (motherPdg == kPi0) { + grmotherPt = mctrack.front().pt(); + grmotherPdg = mctrack.front().pdgCode(); + mpt = grmotherPt; + mpdg = grmotherPdg; + if (grmotherPdg == kK0Short) { + return K0s; + } + if (grmotherPdg == kK0Long) { return K0l; - } else { - return Else; } + if (grmotherPdg == kKPlus) { + return Ke3; + } + if (grmotherPdg == kLambda0) { + return Lambda0; + } + if (grmotherPdg == kSigmaPlus) { + return Sigma; + } + mpt = motherPt; + mpdg = motherPdg; + return Pi0; + } + if (motherPdg == kEta) { + return Eta; + } + if (motherPdg == kOmega) { + return Omega; + } + if (motherPdg == kPhi) { + return Phi; + } + if (motherPdg == kEtaPrime) { + return EtaPrime; + } + if (motherPdg == kRho770_0) { + return Rho0; + } + if (motherPdg == kKPlus) { + return Ke3; + } + if (motherPdg == kK0Long) { + return K0l; } + return Else; } } diff --git a/PWGHF/HFL/Tasks/taskSingleMuonSource.cxx b/PWGHF/HFL/Tasks/taskSingleMuonSource.cxx index 58f6654ee68..3f577ce0034 100644 --- a/PWGHF/HFL/Tasks/taskSingleMuonSource.cxx +++ b/PWGHF/HFL/Tasks/taskSingleMuonSource.cxx @@ -146,8 +146,9 @@ struct HfTaskSingleMuonSource { mcPart = *(mcPart.mothers_first_as()); const auto pdgAbs(std::abs(mcPart.pdgCode())); - if (pdgAbs < 10) + if (pdgAbs < 10) { break; // Quark + } if (!mcPart.producedByGenerator()) { // Produced in transport code SETBIT(mask, IsSecondary); @@ -181,8 +182,8 @@ struct HfTaskSingleMuonSource { continue; } - auto pdgData(TDatabasePDG::Instance()->GetParticle(mcPart.pdgCode())); - if (pdgData && !pdgData->AntiParticle()) { + auto* pdgData(TDatabasePDG::Instance()->GetParticle(mcPart.pdgCode())); + if ((pdgData != nullptr) && (pdgData->AntiParticle() == nullptr)) { SETBIT(mask, HasQuarkoniumParent); } else if (flv == 4) { SETBIT(mask, HasCharmParent); diff --git a/PWGHF/TableProducer/candidateCreator2Prong.cxx b/PWGHF/TableProducer/candidateCreator2Prong.cxx index e3b422d8454..7374a5a6b5c 100644 --- a/PWGHF/TableProducer/candidateCreator2Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator2Prong.cxx @@ -478,7 +478,7 @@ struct HfCandidateCreator2Prong { registry.fill(HIST("hCovSVXZ"), kfCandD0.Covariance(2, 0)); registry.fill(HIST("hCovSVZZ"), kfCandD0.Covariance(2, 2)); - auto covMatrixSV = kfCandD0.CovarianceMatrix(); + auto* covMatrixSV = kfCandD0.CovarianceMatrix(); double phi, theta; getPointDirection(std::array{kfpV.GetX(), kfpV.GetY(), kfpV.GetZ()}, std::array{kfCandD0.GetX(), kfCandD0.GetY(), kfCandD0.GetZ()}, phi, theta); @@ -857,7 +857,7 @@ struct HfCandidateCreator2ProngExpressions { const auto& workflows = initContext.services().get(); for (const DeviceSpec& device : workflows.devices) { - if (device.name.compare("hf-candidate-creator-2prong") == 0) { + if (device.name == "hf-candidate-creator-2prong") { // init HF event selection helper hfEvSelMc.init(device, registry); break; diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index 9d553d25bd0..8cb93d5c6ec 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -618,7 +618,7 @@ struct HfCandidateCreator3Prong { registry.fill(HIST("hCovSVXZ"), kfCandPKPi.Covariance(2, 0)); registry.fill(HIST("hCovSVZZ"), kfCandPKPi.Covariance(2, 2)); - auto covMatrixSV = kfCandPKPi.CovarianceMatrix(); + auto* covMatrixSV = kfCandPKPi.CovarianceMatrix(); double phi, theta; getPointDirection(std::array{kfpV.GetX(), kfpV.GetY(), kfpV.GetZ()}, std::array{kfCandPKPi.GetX(), kfCandPKPi.GetY(), kfCandPKPi.GetZ()}, phi, theta); auto errorDecayLength = std::sqrt(getRotatedCovMatrixXX(covMatrixPV, phi, theta) + getRotatedCovMatrixXX(covMatrixSV, phi, theta)); @@ -1004,7 +1004,7 @@ struct HfCandidateCreator3ProngExpressions { // inspect for which particle species the candidates were created and which zPvPosMax cut was set for reconstructed const auto& workflows = initContext.services().get(); for (const DeviceSpec& device : workflows.devices) { - if (device.name.compare("hf-candidate-creator-3prong") == 0) { + if (device.name == "hf-candidate-creator-3prong") { // init HF event selection helper hfEvSelMc.init(device, registry); break; diff --git a/PWGHF/TableProducer/candidateCreatorB0.cxx b/PWGHF/TableProducer/candidateCreatorB0.cxx index ff0f318c306..92e7e2d0c3a 100644 --- a/PWGHF/TableProducer/candidateCreatorB0.cxx +++ b/PWGHF/TableProducer/candidateCreatorB0.cxx @@ -438,7 +438,7 @@ struct HfCandidateCreatorB0Expressions { } // B0 → Ds- π+ → (K- K+ π-) π+ - if (!flagChannelMain) { + if (flagChannelMain == 0) { indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersB0, Pdg::kB0, std::array{-kKPlus, +kKPlus, -kPiPlus, +kPiPlus}, true, &sign, 3); if (indexRec > -1) { // Ds- → K- K+ π- @@ -451,7 +451,7 @@ struct HfCandidateCreatorB0Expressions { // Partly reconstructed decays, i.e. the 4 prongs have a common b-hadron ancestor // convention: final state particles are prong0,1,2,3 - if (!flagChannelMain) { + if (flagChannelMain == 0) { auto particleProng0 = arrayDaughtersB0[0].mcParticle(); auto particleProng1 = arrayDaughtersB0[1].mcParticle(); auto particleProng2 = arrayDaughtersB0[2].mcParticle(); diff --git a/PWGHF/TableProducer/candidateCreatorBplus.cxx b/PWGHF/TableProducer/candidateCreatorBplus.cxx index b639cf026f1..d9dc956c301 100644 --- a/PWGHF/TableProducer/candidateCreatorBplus.cxx +++ b/PWGHF/TableProducer/candidateCreatorBplus.cxx @@ -288,7 +288,7 @@ struct HfCandidateCreatorBplus { } // Select D0pi- and D0(bar)pi+ pairs only - if (!((candD0.isSelD0() >= selectionFlagD0 && trackPion.sign() < 0) || (candD0.isSelD0bar() >= selectionFlagD0bar && trackPion.sign() > 0))) { + if ((candD0.isSelD0() < selectionFlagD0 || trackPion.sign() >= 0) && (candD0.isSelD0bar() < selectionFlagD0bar || trackPion.sign() <= 0)) { // LOGF(debug, "D0: %d, D0bar%d, sign: %d", candD0.isSelD0(), candD0.isSelD0bar(), track.sign()); continue; } diff --git a/PWGHF/TableProducer/candidateCreatorBs.cxx b/PWGHF/TableProducer/candidateCreatorBs.cxx index 628ddf8208d..812169965b1 100644 --- a/PWGHF/TableProducer/candidateCreatorBs.cxx +++ b/PWGHF/TableProducer/candidateCreatorBs.cxx @@ -430,7 +430,7 @@ struct HfCandidateCreatorBsExpressions { } } - if (!flagChannelMain) { + if (flagChannelMain == 0) { // Checking B0(bar) → Ds± π∓ → (K- K+ π±) π∓ indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersBs, Pdg::kB0, std::array{-kKPlus, +kKPlus, +kPiPlus, -kPiPlus}, true, &sign, 3); if (indexRec > -1) { @@ -453,7 +453,7 @@ struct HfCandidateCreatorBsExpressions { // Partly reconstructed decays, i.e. the 4 prongs have a common b-hadron ancestor // convention: final state particles are prong0,1,2,3 - if (!flagChannelMain) { + if (flagChannelMain == 0) { auto particleProng0 = arrayDaughtersBs[0].mcParticle(); auto particleProng1 = arrayDaughtersBs[1].mcParticle(); auto particleProng2 = arrayDaughtersBs[2].mcParticle(); @@ -502,7 +502,7 @@ struct HfCandidateCreatorBsExpressions { } } - if (!flagChannelMain) { + if (flagChannelMain == 0) { // Checking B0(bar) → Ds± π∓ → (K- K+ π±) π∓ if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kB0, std::array{+Pdg::kDS, -kPiPlus}, true)) { // Checking Ds± → K- K+ π± diff --git a/PWGHF/TableProducer/candidateCreatorCascade.cxx b/PWGHF/TableProducer/candidateCreatorCascade.cxx index 7deb0a5a8b4..c0f50d07751 100644 --- a/PWGHF/TableProducer/candidateCreatorCascade.cxx +++ b/PWGHF/TableProducer/candidateCreatorCascade.cxx @@ -257,9 +257,9 @@ struct HfCandidateCreatorCascade { try { if (df.process(trackV0, trackBach) == 0) { continue; - } else { - LOG(debug) << "Vertexing succeeded for Lc candidate"; } + LOG(debug) << "Vertexing succeeded for Lc candidate"; + } catch (const std::runtime_error& error) { LOG(debug) << "Run time error found: " << error.what() << ". DCAFitterN cannot work, skipping the candidate."; hCandidates->Fill(SVFitting::Fail); @@ -324,8 +324,6 @@ struct HfCandidateCreatorCascade { registry.fill(HIST("hMass2"), mass2K0sP); } } - - return; } /// @brief process function w/o centrality selections @@ -457,7 +455,7 @@ struct HfCandidateCreatorCascadeMc { const auto& workflows = initContext.services().get(); for (const DeviceSpec& device : workflows.devices) { - if (device.name.compare("hf-candidate-creator-cascade") == 0) { + if (device.name == "hf-candidate-creator-cascade") { // init HF event selection helper hfEvSelMc.init(device, registry); break; diff --git a/PWGHF/TableProducer/candidateCreatorDstar.cxx b/PWGHF/TableProducer/candidateCreatorDstar.cxx index 54c2b958ec1..85d3bc5f6f4 100644 --- a/PWGHF/TableProducer/candidateCreatorDstar.cxx +++ b/PWGHF/TableProducer/candidateCreatorDstar.cxx @@ -575,7 +575,7 @@ struct HfCandidateCreatorDstarExpressions { const auto& workflows = initContext.services().get(); for (const DeviceSpec& device : workflows.devices) { - if (device.name.compare("hf-candidate-creator-dstar") == 0) { + if (device.name == "hf-candidate-creator-dstar") { // init HF event selection helper hfEvSelMc.init(device, registry); break; diff --git a/PWGHF/TableProducer/candidateCreatorLb.cxx b/PWGHF/TableProducer/candidateCreatorLb.cxx index bc85bc8772a..dbf816f5b0c 100644 --- a/PWGHF/TableProducer/candidateCreatorLb.cxx +++ b/PWGHF/TableProducer/candidateCreatorLb.cxx @@ -135,7 +135,7 @@ struct HfCandidateCreatorLb { { // loop over Lc candidates for (const auto& lcCand : lcCands) { - if (!(lcCand.hfflag() & 1 << o2::aod::hf_cand_3prong::DecayType::LcToPKPi)) { + if ((lcCand.hfflag() & 1 << o2::aod::hf_cand_3prong::DecayType::LcToPKPi) == 0) { continue; } if (lcCand.isSelLcToPKPi() >= selectionFlagLc) { diff --git a/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx b/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx index 03eddf9d331..cb0cadd5a1b 100644 --- a/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx +++ b/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx @@ -132,7 +132,7 @@ struct HfCandidateCreatorSigmac0plusplus { /// process function switches std::array arrProcess = {doprocessDataTrackToCollAssoc, doprocessDataNoTrackToCollAssoc}; - int processes = std::accumulate(arrProcess.begin(), arrProcess.end(), 0); + int const processes = std::accumulate(arrProcess.begin(), arrProcess.end(), 0); if (processes != 1) { LOG(fatal) << "Check the enabled process functions. doprocessDataTrackToCollAssoc=" << doprocessDataTrackToCollAssoc << ", doprocessDataNoTrackToCollAssoc=" << doprocessDataNoTrackToCollAssoc; } @@ -217,7 +217,7 @@ struct HfCandidateCreatorSigmac0plusplus { // define mass window for Lc float mPKPiCandLcMax = -1; float mPiKPCandLcMax = -1; - int pTBin = findBin(binsPt, candLc.pt()); + int const pTBin = findBin(binsPt, candLc.pt()); if (pTBin != -1) { mPKPiCandLcMax = cutsMassLcMax->get(pTBin, "max pKpi mass Lc"); mPiKPCandLcMax = cutsMassLcMax->get(pTBin, "max piKp mass Lc"); @@ -244,19 +244,19 @@ struct HfCandidateCreatorSigmac0plusplus { ////////////////////////////////////////////////////////////////////////////////////// /// Exclude the current candidate soft pion if it corresponds already to a candidate Lc prong - int indexProng0 = candLc.template prong0_as().globalIndex(); - int indexProng1 = candLc.template prong1_as().globalIndex(); - int indexProng2 = candLc.template prong2_as().globalIndex(); - int indexSoftPi = trackSoftPi.globalIndex(); + int const indexProng0 = candLc.template prong0_as().globalIndex(); + int const indexProng1 = candLc.template prong1_as().globalIndex(); + int const indexProng2 = candLc.template prong2_as().globalIndex(); + int const indexSoftPi = trackSoftPi.globalIndex(); if (indexSoftPi == indexProng0 || indexSoftPi == indexProng1 || indexSoftPi == indexProng2) { continue; } histos.fill(HIST("hCounter"), 6); /// determine the Σc candidate charge - int chargeLc = candLc.template prong0_as().sign() + candLc.template prong1_as().sign() + candLc.template prong2_as().sign(); - int chargeSoftPi = trackSoftPi.sign(); - int8_t chargeSigmac = chargeLc + chargeSoftPi; + int const chargeLc = candLc.template prong0_as().sign() + candLc.template prong1_as().sign() + candLc.template prong2_as().sign(); + int const chargeSoftPi = trackSoftPi.sign(); + int8_t const chargeSigmac = chargeLc + chargeSoftPi; if (std::abs(chargeSigmac) != o2::aod::hf_cand_sigmac::ChargeNull && std::abs(chargeSigmac) != o2::aod::hf_cand_sigmac::ChargePlusPlus) { /// this shall never happen LOG(fatal) << ">>> Sc candidate with charge +1 built, not possible! Charge Lc: " << chargeLc << ", charge soft pion: " << chargeSoftPi; @@ -283,7 +283,7 @@ struct HfCandidateCreatorSigmac0plusplus { /// @param trackSoftPi is the track (with dcaXY, dcaZ information)of a candidate soft-pion in the collision /// @param tracks are the tracks (with dcaXY, dcaZ information) → soft-pion candidate tracks /// @param candidates are 3-prong candidates satisfying the analysis selections for Λc+ → pK-π+ (and charge conj.) - template + template void createSigmaC(aod::Collisions::iterator const& collision, TRK const& trackSoftPi, aod::TracksWDcaExtra const& tracks, @@ -300,7 +300,7 @@ struct HfCandidateCreatorSigmac0plusplus { return; } std::array softPiDca = {-999.f, -999.f}; - if constexpr (withTimeAssoc) { + if constexpr (WithTimeAssoc) { /// dcaXY, dcaZ selections /// To be done separately from the others, because for reassigned tracks the dca must be recalculated /// TODO: to be properly adapted in case of PV refit usage @@ -334,7 +334,7 @@ struct HfCandidateCreatorSigmac0plusplus { histos.fill(HIST("hCounter"), 3); /// loop over Λc+ → pK-π+ (and charge conj.) candidates - if constexpr (withTimeAssoc) { + if constexpr (WithTimeAssoc) { /// need to group candidates manually auto candidatesThisColl = candidates.sliceBy(hf3ProngPerCollision, thisCollId); makeSoftPiLcPair(softPiDca, trackSoftPi, candidatesThisColl, tracks); @@ -431,7 +431,7 @@ struct HfCandidateSigmac0plusplusMc { for (const DeviceSpec& device : workflows.devices) { // here we assume that the hf-candidate-creator-3prong is in the workflow // configure the ev. sel from that workflow - if (device.name.compare("hf-candidate-creator-3prong") == 0) { + if (device.name == "hf-candidate-creator-3prong") { // init HF event selection helper hfEvSelMc.init(device, registry); break; @@ -446,11 +446,12 @@ struct HfCandidateSigmac0plusplusMc { int8_t isParticleAntiparticle(PART const& particle, int pdgSigmac) { - int pdgCode = particle.pdgCode(); + int const pdgCode = particle.pdgCode(); if (pdgCode == pdgSigmac) { // particle return aod::hf_cand_sigmac::Particle; - } else if (pdgCode == -pdgSigmac) { + } + if (pdgCode == -pdgSigmac) { // antiparticle return aod::hf_cand_sigmac::Antiparticle; } @@ -606,8 +607,9 @@ struct HfCandidateSigmac0plusplusMc { // generated Σc0(2455) for (const auto& daughter : particle.daughters_as()) { // look for Λc+ daughter decaying in pK-π+ - if (std::abs(daughter.pdgCode()) != Pdg::kLambdaCPlus) + if (std::abs(daughter.pdgCode()) != Pdg::kLambdaCPlus) { continue; + } if (std::abs(daughter.flagMcMatchGen()) == o2::hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) { /// Λc+ daughter decaying in pK-π+ found! flag = sign * BIT(aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi); @@ -619,8 +621,9 @@ struct HfCandidateSigmac0plusplusMc { // generated Σc++(2455) for (const auto& daughter : particle.daughters_as()) { // look for Λc+ daughter decaying in pK-π+ - if (std::abs(daughter.pdgCode()) != Pdg::kLambdaCPlus) + if (std::abs(daughter.pdgCode()) != Pdg::kLambdaCPlus) { continue; + } if (std::abs(daughter.flagMcMatchGen()) == o2::hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) { /// Λc+ daughter decaying in pK-π+ found! flag = sign * BIT(aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi); @@ -636,8 +639,9 @@ struct HfCandidateSigmac0plusplusMc { // generated Σc0(2520) for (const auto& daughter : particle.daughters_as()) { // look for Λc+ daughter decaying in pK-π+ - if (std::abs(daughter.pdgCode()) != Pdg::kLambdaCPlus) + if (std::abs(daughter.pdgCode()) != Pdg::kLambdaCPlus) { continue; + } if (std::abs(daughter.flagMcMatchGen()) == o2::hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) { /// Λc+ daughter decaying in pK-π+ found! flag = sign * BIT(aod::hf_cand_sigmac::DecayType::ScStar0ToPKPiPi); @@ -649,8 +653,9 @@ struct HfCandidateSigmac0plusplusMc { // generated Σc++(2520) for (const auto& daughter : particle.daughters_as()) { // look for Λc+ daughter decaying in pK-π+ - if (std::abs(daughter.pdgCode()) != Pdg::kLambdaCPlus) + if (std::abs(daughter.pdgCode()) != Pdg::kLambdaCPlus) { continue; + } if (std::abs(daughter.flagMcMatchGen()) == o2::hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) { /// Λc+ daughter decaying in pK-π+ found! flag = sign * BIT(aod::hf_cand_sigmac::DecayType::ScStarPlusPlusToPKPiPi); diff --git a/PWGHF/TableProducer/candidateCreatorSigmac0plusplusCascade.cxx b/PWGHF/TableProducer/candidateCreatorSigmac0plusplusCascade.cxx index 71a61bec437..eefea4cd0ab 100644 --- a/PWGHF/TableProducer/candidateCreatorSigmac0plusplusCascade.cxx +++ b/PWGHF/TableProducer/candidateCreatorSigmac0plusplusCascade.cxx @@ -179,24 +179,33 @@ struct HfCandidateCreatorSigmac0plusplusCascade { template bool isTrackSelected(const TrackType& track) { - if (track.pt() < trkMinPt) + if (track.pt() < trkMinPt) { return false; - if (std::abs(track.eta()) > trkMaxEta) + } + if (std::abs(track.eta()) > trkMaxEta) { return false; - if (std::abs(track.dcaXY()) > maxDCAxyToPVcut) + } + if (std::abs(track.dcaXY()) > maxDCAxyToPVcut) { return false; - if (std::abs(track.dcaZ()) > maxDCAzToPVcut) + } + if (std::abs(track.dcaZ()) > maxDCAzToPVcut) { return false; - if (track.tpcNClsFound() < nTpcNClsFound) + } + if (track.tpcNClsFound() < nTpcNClsFound) { return false; - if (track.tpcNClsCrossedRows() < nTPCCrossedRows) + } + if (track.tpcNClsCrossedRows() < nTPCCrossedRows) { return false; - if (track.tpcChi2NCl() > nTPCChi2) + } + if (track.tpcChi2NCl() > nTPCChi2) { return false; - if (track.itsChi2NCl() > nITSChi2) + } + if (track.itsChi2NCl() > nITSChi2) { return false; - if (track.tpcNSigmaPi() > tpcnSigmaPi) + } + if (track.tpcNSigmaPi() > tpcnSigmaPi) { return false; + } return true; } diff --git a/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx b/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx index 1448a218371..d769df6054c 100644 --- a/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx +++ b/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx @@ -842,11 +842,13 @@ struct HfCandidateCreatorXic0Omegac0 { // mass window cut on lambda before mass constraint float massLam, sigLam; kfV0.GetMass(massLam, sigLam); - if (std::abs(massLam - MassLambda0) > lambdaMassWindow) + if (std::abs(massLam - MassLambda0) > lambdaMassWindow) { continue; + } // err_mass>0 of Lambda - if (sigLam <= 0) + if (sigLam <= 0) { continue; + } kfOmegac0Candidate.chi2GeoV0 = kfV0.GetChi2(); KFParticle kfV0MassConstrained = kfV0; kfV0MassConstrained.SetNonlinearMassConstraint(o2::constants::physics::MassLambda); // set mass constrain to Lambda @@ -876,10 +878,12 @@ struct HfCandidateCreatorXic0Omegac0 { kfOmega.GetMass(massCasc, sigCasc); kfOmegarej.GetMass(massCascrej, sigCascrej); // rej // err_massOmega > 0 - if (sigCasc <= 0) + if (sigCasc <= 0) { continue; - if (std::abs(massCasc - MassOmegaMinus) > massToleranceCascade) + } + if (std::abs(massCasc - MassOmegaMinus) > massToleranceCascade) { continue; + } kfOmegac0Candidate.chi2GeoCasc = kfOmega.GetChi2(); kfOmegac0Candidate.cascRejectInvmass = massCascrej; @@ -912,8 +916,9 @@ struct HfCandidateCreatorXic0Omegac0 { } float massOmegaC0, sigOmegaC0; kfOmegaC0.GetMass(massOmegaC0, sigOmegaC0); - if (sigOmegaC0 <= 0) + if (sigOmegaC0 <= 0) { continue; + } hFitterStatus->Fill(0); hCandidateCounter->Fill(2); @@ -989,7 +994,7 @@ struct HfCandidateCreatorXic0Omegac0 { std::array pVecCharmBaryon = {kfOmegaC0.GetPx(), kfOmegaC0.GetPy(), kfOmegaC0.GetPz()}; std::array coordVtxCharmBaryon = {kfOmegaC0.GetX(), kfOmegaC0.GetY(), kfOmegaC0.GetZ()}; - auto covVtxCharmBaryon = kfOmegaC0.CovarianceMatrix(); + auto* covVtxCharmBaryon = kfOmegaC0.CovarianceMatrix(); float covMatrixPV[6]; kfVertex.GetCovarianceMatrix(covMatrixPV); @@ -1322,15 +1327,18 @@ struct HfCandidateCreatorXic0Omegac0 { // mass window cut on lambda before mass constraint float massLam, sigLam; kfV0.GetMass(massLam, sigLam); - if (std::abs(massLam - MassLambda0) > lambdaMassWindow) + if (std::abs(massLam - MassLambda0) > lambdaMassWindow) { continue; + } // err_mass>0 of Lambda - if (sigLam <= 0) + if (sigLam <= 0) { continue; + } // chi2>0 && NDF>0 for selecting Lambda - if ((kfV0.GetNDF() <= 0 || kfV0.GetChi2() <= 0)) + if ((kfV0.GetNDF() <= 0 || kfV0.GetChi2() <= 0)) { continue; + } kfXic0Candidate.chi2GeoV0 = kfV0.GetChi2(); KFParticle kfV0MassConstrained = kfV0; @@ -1356,14 +1364,17 @@ struct HfCandidateCreatorXic0Omegac0 { float massCasc, sigCasc; kfXi.GetMass(massCasc, sigCasc); // err_massXi > 0 - if (sigCasc <= 0) + if (sigCasc <= 0) { continue; + } - if (std::abs(massCasc - MassXiMinus) > massToleranceCascade) + if (std::abs(massCasc - MassXiMinus) > massToleranceCascade) { continue; + } // chi2>0 && NDF>0 - if (kfXi.GetNDF() <= 0 || kfXi.GetChi2() <= 0) + if (kfXi.GetNDF() <= 0 || kfXi.GetChi2() <= 0) { continue; + } kfXic0Candidate.chi2GeoCasc = kfXi.GetChi2(); KFParticle kfXiMassConstrained = kfXi; kfXiMassConstrained.SetNonlinearMassConstraint(o2::constants::physics::MassXiMinus); // set mass constrain to XiMinus @@ -1392,11 +1403,13 @@ struct HfCandidateCreatorXic0Omegac0 { } float massXiC0, sigXiC0; kfXiC0.GetMass(massXiC0, sigXiC0); - if (sigXiC0 <= 0) + if (sigXiC0 <= 0) { continue; + } // chi2>0 && NDF>0 - if (kfXiC0.GetNDF() <= 0 || kfXiC0.GetChi2() <= 0) + if (kfXiC0.GetNDF() <= 0 || kfXiC0.GetChi2() <= 0) { continue; + } hFitterStatus->Fill(0); hCandidateCounter->Fill(2); @@ -1471,7 +1484,7 @@ struct HfCandidateCreatorXic0Omegac0 { pVecCharmBachelorAsD[2] = kfCharmBachPionToXiC.GetPz(); std::array pVecCharmBaryon = {kfXiC0.GetPx(), kfXiC0.GetPy(), kfXiC0.GetPz()}; - auto covVtxCharmBaryon = kfXiC0.CovarianceMatrix(); + auto* covVtxCharmBaryon = kfXiC0.CovarianceMatrix(); float covMatrixPV[6]; kfVertex.GetCovarianceMatrix(covMatrixPV); @@ -1746,14 +1759,17 @@ struct HfCandidateCreatorXic0Omegac0 { // mass window cut on lambda before mass constraint float massLam, sigLam; kfV0.GetMass(massLam, sigLam); - if (std::abs(massLam - MassLambda0) > lambdaMassWindow) + if (std::abs(massLam - MassLambda0) > lambdaMassWindow) { continue; + } // err_mass>0 of Lambda - if (sigLam <= 0) + if (sigLam <= 0) { continue; + } // chi2>0 && NDF>0 for selecting Lambda - if ((kfV0.GetNDF() <= 0 || kfV0.GetChi2() <= 0)) + if ((kfV0.GetNDF() <= 0 || kfV0.GetChi2() <= 0)) { continue; + } KFParticle kfV0MassConstrained = kfV0; kfV0MassConstrained.SetNonlinearMassConstraint(o2::constants::physics::MassLambda); // set mass constrain to Lambda if (kfUseV0MassConstraint) { @@ -1781,13 +1797,16 @@ struct HfCandidateCreatorXic0Omegac0 { kfOmega.GetMass(massCasc, sigCasc); kfOmegarej.GetMass(massCascrej, sigCascrej); // rej // err_massOmega and err_massXiRej > 0 - if (sigCasc <= 0 || sigCascrej <= 0) + if (sigCasc <= 0 || sigCascrej <= 0) { continue; + } // chi2>0 && NDF>0 - if (kfOmega.GetNDF() <= 0 || kfOmega.GetChi2() <= 0) + if (kfOmega.GetNDF() <= 0 || kfOmega.GetChi2() <= 0) { continue; - if ((std::abs(massCasc - MassOmegaMinus) > massToleranceCascade) || (std::abs(massCascrej - MassXiMinus) < massToleranceCascadeRej)) + } + if ((std::abs(massCasc - MassOmegaMinus) > massToleranceCascade) || (std::abs(massCascrej - MassXiMinus) < massToleranceCascadeRej)) { continue; + } registry.fill(HIST("hInvMassXiMinus_rej"), massCascrej); // rej: Add competing rejection to minimize misidentified Xi impact. Reject if kfBachPionRej is Pion and the constructed cascade has Xi's invariant mass. KFParticle kfOmegaMassConstrained = kfOmega; kfOmegaMassConstrained.SetNonlinearMassConstraint(o2::constants::physics::MassOmegaMinus); // set mass constrain to XiMinus @@ -1813,10 +1832,12 @@ struct HfCandidateCreatorXic0Omegac0 { } float massOmegaKa, sigOmegaKa; kfOmegaKa.GetMass(massOmegaKa, sigOmegaKa); - if (sigOmegaKa <= 0) + if (sigOmegaKa <= 0) { continue; - if (kfOmegaKa.GetNDF() <= 0 || kfOmegaKa.GetChi2() <= 0) + } + if (kfOmegaKa.GetNDF() <= 0 || kfOmegaKa.GetChi2() <= 0) { continue; + } kfOmegaKa.TransportToDecayVertex(); hFitterStatus->Fill(0); hCandidateCounter->Fill(2); @@ -2309,7 +2330,7 @@ struct HfCandidateCreatorXic0Omegac0Mc { const auto& workflows = initContext.services().get(); for (const DeviceSpec& device : workflows.devices) { - if (device.name.compare("hf-candidate-creator-xic0-omegac0") == 0) { + if (device.name == "hf-candidate-creator-xic0-omegac0") { // init HF event selection helper hfEvSelMc.init(device, registry); break; diff --git a/PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx b/PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx index 68189d60763..b974ac23027 100644 --- a/PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx +++ b/PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx @@ -660,7 +660,7 @@ struct HfCandidateCreatorXicToXiPiPi { registry.fill(HIST("hCovPVXZ"), covMatrixPV[3]); registry.fill(HIST("hCovPVZZ"), covMatrixPV[5]); // covariance matrix elements of SV - auto covMatrixXicPlus = kfXicPlus.CovarianceMatrix(); + auto* covMatrixXicPlus = kfXicPlus.CovarianceMatrix(); registry.fill(HIST("hCovSVXX"), covMatrixXicPlus[0]); registry.fill(HIST("hCovSVYY"), covMatrixXicPlus[2]); registry.fill(HIST("hCovSVXZ"), covMatrixXicPlus[3]); @@ -891,7 +891,7 @@ struct HfCandidateCreatorXicToXiPiPiExpressions { // initialize HF event selection helper const auto& workflows = initContext.services().get(); for (const DeviceSpec& device : workflows.devices) { - if (device.name.compare("hf-candidate-creator-xic-to-xi-pi-pi") == 0) { + if (device.name == "hf-candidate-creator-xic-to-xi-pi-pi") { hfEvSelMc.init(device, registry); break; } diff --git a/PWGHF/TableProducer/candidateCreatorXicc.cxx b/PWGHF/TableProducer/candidateCreatorXicc.cxx index 996454ec8f3..b5c9dd0a2da 100644 --- a/PWGHF/TableProducer/candidateCreatorXicc.cxx +++ b/PWGHF/TableProducer/candidateCreatorXicc.cxx @@ -121,7 +121,7 @@ struct HfCandidateCreatorXicc { aod::TracksWCov const& tracks) { for (const auto& xicCand : xicCands) { - if (!(xicCand.hfflag() & 1 << o2::aod::hf_cand_3prong::DecayType::XicToPKPi)) { + if ((xicCand.hfflag() & 1 << o2::aod::hf_cand_3prong::DecayType::XicToPKPi) == 0) { continue; } if (xicCand.isSelXicToPKPi() >= selectionFlagXic) { diff --git a/PWGHF/TableProducer/candidateSelectorB0ToDPi.cxx b/PWGHF/TableProducer/candidateSelectorB0ToDPi.cxx index 60709a4e4dc..782de25bb36 100644 --- a/PWGHF/TableProducer/candidateSelectorB0ToDPi.cxx +++ b/PWGHF/TableProducer/candidateSelectorB0ToDPi.cxx @@ -97,7 +97,7 @@ struct HfCandidateSelectorB0ToDPi { o2::analysis::HfMlResponseB0ToDPi hfMlResponse; float outputMlNotPreselected = -1.; - std::vector outputMl = {}; + std::vector outputMl; o2::ccdb::CcdbApi ccdbApi; HfHelper hfHelper; diff --git a/PWGHF/TableProducer/candidateSelectorBplusToD0Pi.cxx b/PWGHF/TableProducer/candidateSelectorBplusToD0Pi.cxx index 1bcc8bff8e0..6bfbe624ec9 100644 --- a/PWGHF/TableProducer/candidateSelectorBplusToD0Pi.cxx +++ b/PWGHF/TableProducer/candidateSelectorBplusToD0Pi.cxx @@ -100,7 +100,7 @@ struct HfCandidateSelectorBplusToD0Pi { o2::analysis::HfMlResponseBplusToD0Pi hfMlResponse; float outputMlNotPreselected = -1.; - std::vector outputMl = {}; + std::vector outputMl; o2::ccdb::CcdbApi ccdbApi; HfHelper hfHelper; diff --git a/PWGHF/TableProducer/candidateSelectorBsToDsPi.cxx b/PWGHF/TableProducer/candidateSelectorBsToDsPi.cxx index 05a66854ada..f653b5a3673 100644 --- a/PWGHF/TableProducer/candidateSelectorBsToDsPi.cxx +++ b/PWGHF/TableProducer/candidateSelectorBsToDsPi.cxx @@ -90,7 +90,7 @@ struct HfCandidateSelectorBsToDsPi { bool selectionFlagDsAndUsePidInSync = true; o2::analysis::HfMlResponse hfMlResponse; - std::vector outputMl = {}; + std::vector outputMl; o2::ccdb::CcdbApi ccdbApi; @@ -138,11 +138,11 @@ struct HfCandidateSelectorBsToDsPi { } int selectionFlagDs = -1; - auto& workflows = initContext.services().get(); + const auto& workflows = initContext.services().get(); for (const DeviceSpec& device : workflows.devices) { - if (device.name.compare("hf-candidate-creator-bs") == 0) { + if (device.name == "hf-candidate-creator-bs") { for (const auto& option : device.options) { - if (option.name.compare("selectionFlagDs") == 0) { + if (option.name == "selectionFlagDs") { selectionFlagDs = option.defaultValue.get(); LOGF(info, "selectionFlagDs = %d", selectionFlagDs); } diff --git a/PWGHF/TableProducer/candidateSelectorD0.cxx b/PWGHF/TableProducer/candidateSelectorD0.cxx index 98634b9cf08..fefb799c072 100644 --- a/PWGHF/TableProducer/candidateSelectorD0.cxx +++ b/PWGHF/TableProducer/candidateSelectorD0.cxx @@ -100,8 +100,8 @@ struct HfCandidateSelectorD0 { Configurable useTriggerMassCut{"useTriggerMassCut", false, "Flag to enable parametrize pT differential mass cut for triggered data"}; o2::analysis::HfMlResponseD0ToKPi hfMlResponse; - std::vector outputMlD0 = {}; - std::vector outputMlD0bar = {}; + std::vector outputMlD0; + std::vector outputMlD0bar; o2::ccdb::CcdbApi ccdbApi; TrackSelectorPi selectorPion; TrackSelectorKa selectorKaon; diff --git a/PWGHF/TableProducer/candidateSelectorDplusToPiKPi.cxx b/PWGHF/TableProducer/candidateSelectorDplusToPiKPi.cxx index a531b6dbab0..485d324d7f6 100644 --- a/PWGHF/TableProducer/candidateSelectorDplusToPiKPi.cxx +++ b/PWGHF/TableProducer/candidateSelectorDplusToPiKPi.cxx @@ -94,8 +94,8 @@ struct HfCandidateSelectorDplusToPiKPi { Configurable useTriggerMassCut{"useTriggerMassCut", false, "Flag to enable parametrize pT differential mass cut for triggered data"}; HfMlResponseDplusToPiKPi hfMlResponse; - std::vector outputMlNotPreselected = {}; - std::vector outputMl = {}; + std::vector outputMlNotPreselected; + std::vector outputMl; o2::ccdb::CcdbApi ccdbApi; TrackSelectorPi selectorPion; TrackSelectorKa selectorKaon; diff --git a/PWGHF/TableProducer/candidateSelectorDsToKKPi.cxx b/PWGHF/TableProducer/candidateSelectorDsToKKPi.cxx index 80f22343ff1..98168f58aba 100644 --- a/PWGHF/TableProducer/candidateSelectorDsToKKPi.cxx +++ b/PWGHF/TableProducer/candidateSelectorDsToKKPi.cxx @@ -96,8 +96,8 @@ struct HfCandidateSelectorDsToKKPi { HfHelper hfHelper; o2::analysis::HfMlResponseDsToKKPi hfMlResponse; - std::vector outputMlDsToKKPi = {}; - std::vector outputMlDsToPiKK = {}; + std::vector outputMlDsToKKPi; + std::vector outputMlDsToPiKK; o2::ccdb::CcdbApi ccdbApi; TrackSelectorPi selectorPion; TrackSelectorKa selectorKaon; @@ -151,12 +151,9 @@ struct HfCandidateSelectorDsToKKPi { template bool isSelectedCandidateProngDca(const T1& candidate) { - if (isSelectedTrackDca(binsPtTrack, cutsSingleTrack, candidate.ptProng0(), candidate.impactParameter0(), candidate.impactParameterZ0()) && - isSelectedTrackDca(binsPtTrack, cutsSingleTrack, candidate.ptProng1(), candidate.impactParameter1(), candidate.impactParameterZ1()) && - isSelectedTrackDca(binsPtTrack, cutsSingleTrack, candidate.ptProng2(), candidate.impactParameter2(), candidate.impactParameterZ2())) { - return true; - } - return false; + return static_cast(isSelectedTrackDca(binsPtTrack, cutsSingleTrack, candidate.ptProng0(), candidate.impactParameter0(), candidate.impactParameterZ0()) && + isSelectedTrackDca(binsPtTrack, cutsSingleTrack, candidate.ptProng1(), candidate.impactParameter1(), candidate.impactParameterZ1()) && + isSelectedTrackDca(binsPtTrack, cutsSingleTrack, candidate.ptProng2(), candidate.impactParameter2(), candidate.impactParameterZ2())); } /// Candidate selections independent from the daugther-mass hypothesis @@ -278,7 +275,7 @@ struct HfCandidateSelectorDsToKKPi { outputMlDsToKKPi.clear(); outputMlDsToPiKK.clear(); - if (!(candidate.hfflag() & 1 << aod::hf_cand_3prong::DecayType::DsToKKPi)) { + if ((candidate.hfflag() & 1 << aod::hf_cand_3prong::DecayType::DsToKKPi) == 0) { hfSelDsToKKPiCandidate(statusDsToKKPi, statusDsToPiKK); if (applyMl) { hfMlDsToKKPiCandidate(outputMlDsToKKPi, outputMlDsToPiKK); @@ -347,13 +344,13 @@ struct HfCandidateSelectorDsToKKPi { pidTrackNegKaon = selectorKaon.statusTpcOrTof(trackNeg, candidate.nSigTpcKa1(), candidate.nSigTofKa1()); } - bool pidDsToKKPi = !(pidTrackPos1Kaon == TrackSelectorPID::Rejected || - pidTrackNegKaon == TrackSelectorPID::Rejected || - pidTrackPos2Pion == TrackSelectorPID::Rejected); + bool pidDsToKKPi = pidTrackPos1Kaon != TrackSelectorPID::Rejected && + pidTrackNegKaon != TrackSelectorPID::Rejected && + pidTrackPos2Pion != TrackSelectorPID::Rejected; - bool pidDsToPiKK = !(pidTrackPos1Pion == TrackSelectorPID::Rejected || - pidTrackNegKaon == TrackSelectorPID::Rejected || - pidTrackPos2Kaon == TrackSelectorPID::Rejected); + bool pidDsToPiKK = pidTrackPos1Pion != TrackSelectorPID::Rejected && + pidTrackNegKaon != TrackSelectorPID::Rejected && + pidTrackPos2Kaon != TrackSelectorPID::Rejected; if (!pidDsToKKPi && !pidDsToPiKK) { hfSelDsToKKPiCandidate(statusDsToKKPi, statusDsToPiKK); diff --git a/PWGHF/TableProducer/candidateSelectorDstarToD0Pi.cxx b/PWGHF/TableProducer/candidateSelectorDstarToD0Pi.cxx index b5d0c2258f9..b720e3da614 100644 --- a/PWGHF/TableProducer/candidateSelectorDstarToD0Pi.cxx +++ b/PWGHF/TableProducer/candidateSelectorDstarToD0Pi.cxx @@ -108,7 +108,7 @@ struct HfCandidateSelectorDstarToD0Pi { HfHelper hfHelper; o2::analysis::HfMlResponseDstarToD0Pi hfMlResponse; - std::vector outputMlDstarToD0Pi = {}; + std::vector outputMlDstarToD0Pi; o2::ccdb::CcdbApi ccdbApi; TrackSelectorPi selectorPion; diff --git a/PWGHF/TableProducer/candidateSelectorLbToLcPi.cxx b/PWGHF/TableProducer/candidateSelectorLbToLcPi.cxx index 74abba33758..9b60e8d67fb 100644 --- a/PWGHF/TableProducer/candidateSelectorLbToLcPi.cxx +++ b/PWGHF/TableProducer/candidateSelectorLbToLcPi.cxx @@ -70,10 +70,7 @@ struct HfCandidateSelectorLbToLcPi { bool passesImpactParameterResolution(float pT, float d0Resolution) { float expectedResolution(0.001 + 0.0052 * std::exp(-0.655 * pT)); - if (d0Resolution > expectedResolution * 1.5) - return false; - else - return true; + return d0Resolution <= expectedResolution * 1.5; } // Compares to pT dependent cut on impact parameter resolution // Apply topological cuts as defined in SelectorCuts.h; return true if candidate passes all cuts @@ -109,17 +106,22 @@ struct HfCandidateSelectorLbToLcPi { } float lcMass = 0.; - if (hfCandLc.isSelLcToPKPi()) + if (hfCandLc.isSelLcToPKPi()) { lcMass = hfHelper.invMassLcToPKPi(hfCandLc); - if (hfCandLc.isSelLcToPiKP()) + } + if (hfCandLc.isSelLcToPiKP()) { lcMass = hfHelper.invMassLcToPiKP(hfCandLc); - if (std::abs(lcMass - o2::constants::physics::MassLambdaCPlus) > cuts->get(pTBin, "DeltaMLc")) + } + if (std::abs(lcMass - o2::constants::physics::MassLambdaCPlus) > cuts->get(pTBin, "DeltaMLc")) { return false; + } - if (hfCandLb.errorDecayLengthXY() > maxDecayLengthXYError) + if (hfCandLb.errorDecayLengthXY() > maxDecayLengthXYError) { return false; - if (hfCandLb.errorDecayLength() > maxDecayLengthError) + } + if (hfCandLb.errorDecayLength() > maxDecayLengthError) { return false; + } // Lb Decay length if (hfCandLb.decayLength() < cuts->get(pTBin, "Lb decLen")) { @@ -157,11 +159,7 @@ struct HfCandidateSelectorLbToLcPi { float diffYVert = hfCandLb.ySecondaryVertex() - hfCandLc.ySecondaryVertex(); float diffZVert = hfCandLb.zSecondaryVertex() - hfCandLc.zSecondaryVertex(); float vertexDistance = std::sqrt(diffXVert * diffXVert + diffYVert * diffYVert + diffZVert * diffZVert); - if (vertexDistance > maxVertexDistanceLbLc) { - return false; - } - - return true; + return vertexDistance <= maxVertexDistanceLbLc; } void process(aod::HfCandLb const& hfCandLbs, diff --git a/PWGHF/TableProducer/candidateSelectorLc.cxx b/PWGHF/TableProducer/candidateSelectorLc.cxx index 5103249ce32..1332674722d 100644 --- a/PWGHF/TableProducer/candidateSelectorLc.cxx +++ b/PWGHF/TableProducer/candidateSelectorLc.cxx @@ -110,8 +110,8 @@ struct HfCandidateSelectorLc { HfHelper hfHelper; o2::analysis::HfMlResponseLcToPKPi hfMlResponseDCA; o2::analysis::HfMlResponseLcToPKPi hfMlResponseKF; - std::vector outputMlLcToPKPi = {}; - std::vector outputMlLcToPiKP = {}; + std::vector outputMlLcToPKPi; + std::vector outputMlLcToPiKP; o2::ccdb::CcdbApi ccdbApi; TrackSelectorPi selectorPion; TrackSelectorKa selectorKaon; @@ -429,12 +429,9 @@ struct HfCandidateSelectorLc { /// \return true if prongs pass all selections bool isSelectedPID(const TrackSelectorPID::Status pidTrackProton, const TrackSelectorPID::Status pidTrackKaon, const TrackSelectorPID::Status pidTrackPion) { - if (pidTrackProton == TrackSelectorPID::Rejected || - pidTrackKaon == TrackSelectorPID::Rejected || - pidTrackPion == TrackSelectorPID::Rejected) { - return false; - } - return true; + return pidTrackProton != TrackSelectorPID::Rejected && + pidTrackKaon != TrackSelectorPID::Rejected && + pidTrackPion != TrackSelectorPID::Rejected; } /// \brief function to apply Lc selections diff --git a/PWGHF/TableProducer/candidateSelectorLcPidMl.cxx b/PWGHF/TableProducer/candidateSelectorLcPidMl.cxx index d89f9c4c5dd..b9298145bc1 100644 --- a/PWGHF/TableProducer/candidateSelectorLcPidMl.cxx +++ b/PWGHF/TableProducer/candidateSelectorLcPidMl.cxx @@ -132,7 +132,7 @@ struct HfCandidateSelectorLcPidMl { std::map headers; bool retrieveSuccess = true; if (applyML) { - if (onnxFileLcToPiKPConf.value == "") { + if (onnxFileLcToPiKPConf.value.empty()) { LOG(error) << "Apply ML specified, but no name given to the local model file"; } if (loadModelsFromCCDB && timestampCCDB > 0) { @@ -174,7 +174,7 @@ struct HfCandidateSelectorLcPidMl { auto statusLcToPKPi = 0; auto statusLcToPiKP = 0; - if (!(candidate.hfflag() & 1 << aod::hf_cand_3prong::DecayType::LcToPKPi)) { + if ((candidate.hfflag() & 1 << aod::hf_cand_3prong::DecayType::LcToPKPi) == 0) { hfSelLcCandidate(statusLcToPKPi, statusLcToPiKP); continue; } @@ -305,12 +305,12 @@ struct HfCandidateSelectorLcPidMl { std::vector inputFeaturesD{trackParPos1.getPt(), trackPos1.dcaXY(), trackPos1.dcaZ(), trackParNeg.getPt(), trackNeg.dcaXY(), trackNeg.dcaZ(), trackParPos2.getPt(), trackPos2.dcaXY(), trackPos2.dcaZ()}; float scores[3] = {-1.f, -1.f, -1.f}; if (dataTypeML == 1) { - auto scoresRaw = model.evalModel(inputFeaturesF); + auto* scoresRaw = model.evalModel(inputFeaturesF); for (int iScore = 0; iScore < 3; ++iScore) { scores[iScore] = scoresRaw[iScore]; } } else if (dataTypeML == 11) { - auto scoresRaw = model.evalModel(inputFeaturesD); + auto* scoresRaw = model.evalModel(inputFeaturesD); for (int iScore = 0; iScore < 3; ++iScore) { scores[iScore] = scoresRaw[iScore]; } diff --git a/PWGHF/TableProducer/candidateSelectorLcToK0sP.cxx b/PWGHF/TableProducer/candidateSelectorLcToK0sP.cxx index d91ab2f718e..decf738d984 100644 --- a/PWGHF/TableProducer/candidateSelectorLcToK0sP.cxx +++ b/PWGHF/TableProducer/candidateSelectorLcToK0sP.cxx @@ -96,7 +96,7 @@ struct HfCandidateSelectorLcToK0sP { TrackSelectorPr selectorProtonHighP; o2::analysis::HfMlResponseLcToK0sP hfMlResponse; - std::vector outputMl = {}; + std::vector outputMl; o2::ccdb::CcdbApi ccdbApi; @@ -221,9 +221,8 @@ struct HfCandidateSelectorLcToK0sP { { if (track.p() < pPidThreshold) { return selectorProtonLowP.statusTpcAndTof(track) == TrackSelectorPID::Accepted; - } else { - return selectorProtonHighP.statusTpcAndTof(track) == TrackSelectorPID::Accepted; } + return selectorProtonHighP.statusTpcAndTof(track) == TrackSelectorPID::Accepted; } template @@ -235,9 +234,8 @@ struct HfCandidateSelectorLcToK0sP { if (track.p() < pPidThreshold) { return selectorProtonLowP.statusBayesProb(track) == TrackSelectorPID::Accepted; - } else { - return selectorProtonHighP.statusBayesProb(track) == TrackSelectorPID::Accepted; } + return selectorProtonHighP.statusBayesProb(track) == TrackSelectorPID::Accepted; } template diff --git a/PWGHF/TableProducer/candidateSelectorOmegac0ToOmegaPi.cxx b/PWGHF/TableProducer/candidateSelectorOmegac0ToOmegaPi.cxx index 7b31151af9d..e567f43bbf5 100644 --- a/PWGHF/TableProducer/candidateSelectorOmegac0ToOmegaPi.cxx +++ b/PWGHF/TableProducer/candidateSelectorOmegac0ToOmegaPi.cxx @@ -191,7 +191,7 @@ struct HfCandidateSelectorToOmegaPi { Configurable loadModelsFromCCDB{"loadModelsFromCCDB", false, "Flag to enable or disable the loading of models from CCDB"}; o2::analysis::HfMlResponseOmegacToOmegaPi hfMlResponse; - std::vector outputMlOmegac = {}; + std::vector outputMlOmegac; o2::ccdb::CcdbApi ccdbApi; TrackSelectorPi selectorPion; @@ -317,9 +317,8 @@ struct HfCandidateSelectorToOmegaPi { if (pionPtFromOmegac < cuts->get(pTBin, "pT pi from Omegac")) { registry.fill(HIST("hSelPtPiFromCharm"), 0); return false; - } else { - registry.fill(HIST("hSelPtPiFromCharm"), 1); } + registry.fill(HIST("hSelPtPiFromCharm"), 1); return true; } // end template diff --git a/PWGHF/TableProducer/candidateSelectorOmegac0Xic0ToOmegaKa.cxx b/PWGHF/TableProducer/candidateSelectorOmegac0Xic0ToOmegaKa.cxx index 3bb9e410347..319356820a1 100644 --- a/PWGHF/TableProducer/candidateSelectorOmegac0Xic0ToOmegaKa.cxx +++ b/PWGHF/TableProducer/candidateSelectorOmegac0Xic0ToOmegaKa.cxx @@ -275,17 +275,15 @@ struct HfCandidateSelectorToOmegaKa { if (candpT <= ptCandMin || candpT >= ptCandMax) { registry.fill(HIST("hSelPtOmegaKa"), 0); return false; - } else { - registry.fill(HIST("hSelPtOmegaKa"), 1); } + registry.fill(HIST("hSelPtOmegaKa"), 1); // check that the candidate pT is within the analysis range if (KaPtFromOmegaKa < cuts->get(pTBin, "pT ka from OmegaKa")) { registry.fill(HIST("hSelPtKaFromCharm"), 0); return false; - } else { - registry.fill(HIST("hSelPtKaFromCharm"), 1); } + registry.fill(HIST("hSelPtKaFromCharm"), 1); return true; } // end template diff --git a/PWGHF/TableProducer/candidateSelectorXic0ToXiPiKf.cxx b/PWGHF/TableProducer/candidateSelectorXic0ToXiPiKf.cxx index 88824d4d75d..341328ebb97 100644 --- a/PWGHF/TableProducer/candidateSelectorXic0ToXiPiKf.cxx +++ b/PWGHF/TableProducer/candidateSelectorXic0ToXiPiKf.cxx @@ -137,7 +137,7 @@ struct HfCandidateSelectorXic0ToXiPiKf { Configurable loadModelsFromCCDB{"loadModelsFromCCDB", false, "Flag to enable or disable the loading of models from CCDB"}; o2::analysis::HfMlResponseXic0ToXiPiKf hfMlResponse; - std::vector outputMlXic0ToXiPiKf = {}; + std::vector outputMlXic0ToXiPiKf; o2::ccdb::CcdbApi ccdbApi; TrackSelectorPr selectorProton; diff --git a/PWGHF/TableProducer/candidateSelectorXicToPKPi.cxx b/PWGHF/TableProducer/candidateSelectorXicToPKPi.cxx index 14b010aeaa2..3da2a9de721 100644 --- a/PWGHF/TableProducer/candidateSelectorXicToPKPi.cxx +++ b/PWGHF/TableProducer/candidateSelectorXicToPKPi.cxx @@ -90,8 +90,8 @@ struct HfCandidateSelectorXicToPKPi { Configurable activateQA{"activateQA", true, "Flag to enable QA histogram"}; o2::analysis::HfMlResponseXicToPKPi hfMlResponse; - std::vector outputMlXicToPKPi = {}; - std::vector outputMlXicToPiKP = {}; + std::vector outputMlXicToPKPi; + std::vector outputMlXicToPiKP; o2::ccdb::CcdbApi ccdbApi; TrackSelectorPi selectorPion; TrackSelectorKa selectorKaon; @@ -376,11 +376,11 @@ struct HfCandidateSelectorXicToPKPi { bool isSelectedMlXicToPKPi = false; bool isSelectedMlXicToPiKP = false; - if (topolXicToPKPi && pidXicToPKPi) { + if (topolXicToPKPi && (pidXicToPKPi != 0)) { std::vector inputFeaturesXicToPKPi = hfMlResponse.getInputFeatures(candidate, true); isSelectedMlXicToPKPi = hfMlResponse.isSelectedMl(inputFeaturesXicToPKPi, ptCand, outputMlXicToPKPi); } - if (topolXicToPiKP && pidXicToPiKP) { + if (topolXicToPiKP && (pidXicToPiKP != 0)) { std::vector inputFeaturesXicToPiKP = hfMlResponse.getInputFeatures(candidate, false); isSelectedMlXicToPiKP = hfMlResponse.isSelectedMl(inputFeaturesXicToPiKP, ptCand, outputMlXicToPiKP); } diff --git a/PWGHF/TableProducer/candidateSelectorXicToXiPiPi.cxx b/PWGHF/TableProducer/candidateSelectorXicToXiPiPi.cxx index c4087a93e75..50565fdce38 100644 --- a/PWGHF/TableProducer/candidateSelectorXicToXiPiPi.cxx +++ b/PWGHF/TableProducer/candidateSelectorXicToXiPiPi.cxx @@ -92,7 +92,7 @@ struct HfCandidateSelectorXicToXiPiPi { Configurable loadModelsFromCCDB{"loadModelsFromCCDB", false, "Flag to enable or disable the loading of models from CCDB"}; o2::analysis::HfMlResponseXicToXiPiPi hfMlResponse; - std::vector outputMlXicToXiPiPi = {}; + std::vector outputMlXicToXiPiPi; o2::ccdb::CcdbApi ccdbApi; TrackSelectorPi selectorPion; TrackSelectorPr selectorProton; @@ -276,10 +276,7 @@ struct HfCandidateSelectorXicToXiPiPi { bool const useTpcPidOnly) { if (useTpcPidOnly) { - if ((statusPidPi0 != TrackSelectorPID::Accepted && statusPidPi0 != TrackSelectorPID::NotApplicable) || (statusPidPi1 != TrackSelectorPID::Accepted && statusPidPi1 != TrackSelectorPID::NotApplicable) || (statusPidPiXi != TrackSelectorPID::Accepted && statusPidPiXi != TrackSelectorPID::NotApplicable) || (statusPidPrLam != TrackSelectorPID::Accepted && statusPidPrLam != TrackSelectorPID::NotApplicable) || (statusPidPiLam != TrackSelectorPID::Accepted && statusPidPiLam != TrackSelectorPID::NotApplicable)) { - return false; - } - return true; + return (statusPidPi0 == TrackSelectorPID::Accepted || statusPidPi0 == TrackSelectorPID::NotApplicable) && (statusPidPi1 == TrackSelectorPID::Accepted || statusPidPi1 == TrackSelectorPID::NotApplicable) && (statusPidPiXi == TrackSelectorPID::Accepted || statusPidPiXi == TrackSelectorPID::NotApplicable) && (statusPidPrLam == TrackSelectorPID::Accepted || statusPidPrLam == TrackSelectorPID::NotApplicable) && (statusPidPiLam == TrackSelectorPID::Accepted || statusPidPiLam == TrackSelectorPID::NotApplicable); } if (statusPidPi0 == TrackSelectorPID::Rejected || statusPidPi1 == TrackSelectorPID::Rejected || statusPidPiXi == TrackSelectorPID::Rejected || statusPidPrLam == TrackSelectorPID::Rejected || statusPidPiLam == TrackSelectorPID::Rejected) { return false; diff --git a/PWGHF/TableProducer/candidateSelectorXiccToPKPiPi.cxx b/PWGHF/TableProducer/candidateSelectorXiccToPKPiPi.cxx index dd178bd83f0..669d1331569 100644 --- a/PWGHF/TableProducer/candidateSelectorXiccToPKPiPi.cxx +++ b/PWGHF/TableProducer/candidateSelectorXiccToPKPiPi.cxx @@ -161,7 +161,7 @@ struct HfCandidateSelectorXiccToPKPiPi { // final selection flag: 0 - rejected, 1 - accepted auto statusXiccToPKPiPi = 0; - if (!(hfCandXicc.hfflag() & 1 << aod::hf_cand_xicc::DecayType::XiccToXicPi)) { + if ((hfCandXicc.hfflag() & 1 << aod::hf_cand_xicc::DecayType::XiccToXicPi) == 0) { hfSelXiccToPKPiPiCandidate(statusXiccToPKPiPi); continue; } diff --git a/PWGHF/TableProducer/mcPidTof.cxx b/PWGHF/TableProducer/mcPidTof.cxx index a310175c789..ddff5d8c00e 100644 --- a/PWGHF/TableProducer/mcPidTof.cxx +++ b/PWGHF/TableProducer/mcPidTof.cxx @@ -335,10 +335,7 @@ struct TOFCalibConfig { /// Selection criteria for tracks used for TOF event time bool isTrackGoodMatchForTOFPID(const Trks::iterator& tr) { - if (!tr.hasTOF()) { - return false; - } - return true; + return tr.hasTOF(); } /// Task to produce the TOF signal from the trackTime information @@ -517,7 +514,7 @@ struct tofEventTime { trackSampleMaxMomentum = maxMomentum; LOG(info) << "Configuring track sample for TOF ev. time: " << trackSampleMinMomentum << " < p < " << trackSampleMaxMomentum; - if (sel8TOFEvTime.value == true) { + if (sel8TOFEvTime.value) { LOG(info) << "TOF event time will be computed for collisions that pass the event selection only!"; } mTOFCalibConfig.initSetup(mRespParamsV3, ccdb); // Getting the parametrization parameters @@ -569,9 +566,9 @@ struct tofEventTime { LOG(debug) << "Running on " << CollisionSystemType::getCollisionSystemName(mTOFCalibConfig.collisionSystem()) << " mComputeEvTimeWithTOF " << mComputeEvTimeWithTOF.value << " mComputeEvTimeWithFT0 " << mComputeEvTimeWithFT0.value; if (mComputeEvTimeWithTOF == 1 && mComputeEvTimeWithFT0 == 1) { - int lastCollisionId = -1; // Last collision ID analysed - for (auto const& t : tracks) { // Loop on collisions - if (!t.has_collision() || ((sel8TOFEvTime.value == true) && !t.collision_as().sel8())) { // Track was not assigned, cannot compute event time or event did not pass the event selection + int lastCollisionId = -1; // Last collision ID analysed + for (auto const& t : tracks) { // Loop on collisions + if (!t.has_collision() || ((sel8TOFEvTime.value) && !t.collision_as().sel8())) { // Track was not assigned, cannot compute event time or event did not pass the event selection tableFlags(0); tableEvTime(0.f, 999.f); if (enableTableEvTimeTOFOnly) { @@ -646,9 +643,9 @@ struct tofEventTime { } } } else if (mComputeEvTimeWithTOF == 1 && mComputeEvTimeWithFT0 == 0) { - int lastCollisionId = -1; // Last collision ID analysed - for (auto const& t : tracks) { // Loop on collisions - if (!t.has_collision() || ((sel8TOFEvTime.value == true) && !t.collision_as().sel8())) { // Track was not assigned, cannot compute event time or event did not pass the event selection + int lastCollisionId = -1; // Last collision ID analysed + for (auto const& t : tracks) { // Loop on collisions + if (!t.has_collision() || ((sel8TOFEvTime.value) && !t.collision_as().sel8())) { // Track was not assigned, cannot compute event time or event did not pass the event selection tableFlags(0); tableEvTime(0.f, 999.f); if (enableTableEvTimeTOFOnly) { @@ -749,8 +746,8 @@ struct mcPidTof { std::array, nSpecies> hnSigmaFull; // postcalibrations to overcome MC FT0 timing issue - std::map gMcPostCalibMean{}; - std::map gMcPostCalibSigma{}; + std::map gMcPostCalibMean; + std::map gMcPostCalibSigma; int currentRun{0}; struct : ConfigurableGroup { std::string prefix = "mcRecalib"; @@ -787,7 +784,7 @@ struct mcPidTof { mEnabledParticlesFull.push_back(supportedSpecies[iSpecie]); } } - if (mEnabledParticlesFull.size() == 0 && mEnabledParticles.size() == 0) { + if (mEnabledParticlesFull.empty() && mEnabledParticles.empty()) { LOG(info) << "No PID tables are required, disabling process function"; doprocessFillTables.value = false; doprocessDummy.value = true; @@ -913,7 +910,7 @@ struct mcPidTof { LOGP(error, "Impossible to read metadata! Using default calibrations (2022 apass7)"); metadata["RecoPassName"] = ""; } - auto calibList = ccdb->getSpecific(mcRecalib.ccdbPath, timestamp, metadata); + auto* calibList = ccdb->getSpecific(mcRecalib.ccdbPath, timestamp, metadata); std::vector updatedSpecies{}; for (auto const& pidId : mEnabledParticles) { // Loop on enabled particle hypotheses (tiny) gMcPostCalibMean[pidId] = reinterpret_cast(calibList->FindObject(Form("Mean%s", particleNames[pidId].data()))); diff --git a/PWGHF/TableProducer/trackIndexSkimCreator.cxx b/PWGHF/TableProducer/trackIndexSkimCreator.cxx index ae316e4ddc7..c652c7361db 100644 --- a/PWGHF/TableProducer/trackIndexSkimCreator.cxx +++ b/PWGHF/TableProducer/trackIndexSkimCreator.cxx @@ -140,7 +140,7 @@ struct HfTrackIndexSkimCreatorTagSelCollisions { } // set numerical value of the Run 2 trigger class - const auto triggerAlias = std::find(aliasLabels, aliasLabels + kNaliases, triggerClassName.value.data()); + auto* const triggerAlias = std::find(aliasLabels, aliasLabels + kNaliases, triggerClassName.value.data()); if (triggerAlias != aliasLabels + kNaliases) { hfEvSel.triggerClass.value = std::distance(aliasLabels, triggerAlias); } @@ -1466,7 +1466,7 @@ struct HfTrackIndexSkimCreator { // initialise 3-prong ML responses for (int iDecay3P{0}; iDecay3P < kN3ProngDecays; ++iDecay3P) { - if (onnxFileNames3Prongs[iDecay3P][0] == "") { // 3-prong species to be skipped + if (onnxFileNames3Prongs[iDecay3P][0].empty()) { // 3-prong species to be skipped continue; } hasMlModel3Prong[iDecay3P] = true; @@ -1749,11 +1749,7 @@ struct HfTrackIndexSkimCreator { return false; } const auto decLen = RecoDecay::distance(primVtx, secVtx); - if (decLen < config.minTwoTrackDecayLengthFor3Prongs) { - return false; - } - - return true; + return static_cast(decLen >= config.minTwoTrackDecayLengthFor3Prongs); } /// Method to perform selections for 3-prong candidates after vertex reconstruction @@ -2054,7 +2050,6 @@ struct HfTrackIndexSkimCreator { } /// end 'if (doprocess2And3ProngsWithPvRefit && pvRefitDoable)' - return; } /// end of performPvRefitCandProngs function template @@ -2091,14 +2086,13 @@ struct HfTrackIndexSkimCreator { /// the track did not contribute to fit the primary vertex nNonContrib++; continue; - } else { - vecPvContributorGlobId.push_back(trackUnfiltered.globalIndex()); - vecPvContributorTrackParCov.push_back(getTrackParCov(trackUnfiltered)); - nContrib++; - if (config.debugPvRefit) { - LOG(info) << "---> a contributor! stuff saved"; - LOG(info) << "vec_contrib size: " << vecPvContributorTrackParCov.size() << ", nContrib: " << nContrib; - } + } + vecPvContributorGlobId.push_back(trackUnfiltered.globalIndex()); + vecPvContributorTrackParCov.push_back(getTrackParCov(trackUnfiltered)); + nContrib++; + if (config.debugPvRefit) { + LOG(info) << "---> a contributor! stuff saved"; + LOG(info) << "vec_contrib size: " << vecPvContributorTrackParCov.size() << ", nContrib: " << nContrib; } } if (config.debugPvRefit) { @@ -2399,17 +2393,15 @@ struct HfTrackIndexSkimCreator { if (!TESTBIT(trackIndexPos2.isSelProng(), CandidateType::Cand3Prong)) { // continue immediately if (!config.debug) { continue; - } else { - isSelected3ProngCand = 0; } + isSelected3ProngCand = 0; } if (config.applyKaonPidIn3Prongs && !TESTBIT(trackIndexNeg1.isIdentifiedPid(), ChannelKaonPid)) { // continue immediately if kaon PID enabled and opposite-sign track not a kaon if (!config.debug) { continue; - } else { - isSelected3ProngCand = 0; } + isSelected3ProngCand = 0; } const auto trackPos2 = trackIndexPos2.template track_as(); @@ -2651,17 +2643,15 @@ struct HfTrackIndexSkimCreator { if (!TESTBIT(trackIndexNeg2.isSelProng(), CandidateType::Cand3Prong)) { // continue immediately if (!config.debug) { continue; - } else { - isSelected3ProngCand = 0; } + isSelected3ProngCand = 0; } if (config.applyKaonPidIn3Prongs && !TESTBIT(trackIndexPos1.isIdentifiedPid(), ChannelKaonPid)) { // continue immediately if kaon PID enabled and opposite-sign track not a kaon if (!config.debug) { continue; - } else { - isSelected3ProngCand = 0; } + isSelected3ProngCand = 0; } auto trackNeg2 = trackIndexNeg2.template track_as(); @@ -3097,7 +3087,7 @@ struct HfTrackIndexSkimCreatorCascades { using FilteredTrackAssocSel = soa::Filtered>; Filter filterSelectCollisions = (aod::hf_sel_collision::whyRejectColl == static_cast(0)); - Filter filterSelectTrackIds = (aod::hf_sel_track::isSelProng & static_cast(BIT(CandidateType::CandV0bachelor))) != 0u && (config.applyProtonPid == false || (aod::hf_sel_track::isIdentifiedPid & static_cast(BIT(ChannelsProtonPid::LcToPK0S))) != 0u); + Filter filterSelectTrackIds = (aod::hf_sel_track::isSelProng & static_cast(BIT(CandidateType::CandV0bachelor))) != 0u && (!config.applyProtonPid || (aod::hf_sel_track::isIdentifiedPid & static_cast(BIT(ChannelsProtonPid::LcToPK0S))) != 0u); Preslice trackIndicesPerCollision = aod::track_association::collisionId; Preslice v0sPerCollision = aod::v0data::collisionId; diff --git a/PWGHF/TableProducer/treeCreatorLcToK0sP.cxx b/PWGHF/TableProducer/treeCreatorLcToK0sP.cxx index e14b9182347..8c88c70398f 100644 --- a/PWGHF/TableProducer/treeCreatorLcToK0sP.cxx +++ b/PWGHF/TableProducer/treeCreatorLcToK0sP.cxx @@ -266,7 +266,7 @@ struct HfTreeCreatorLcToK0sP { constexpr int IndexFirstClass{0}; constexpr int IndexSecondClass{1}; constexpr int IndexThirdClass{2}; - if (mlScores.size() == 0) { + if (mlScores.empty()) { return; // when candidateSelectorLcK0sP rejects a candidate by "usual", non-ML cut, the ml score vector remains empty } mlScoreFirstClass = mlScores.at(IndexFirstClass); diff --git a/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx b/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx index e9cc4401c31..7015058dfb5 100644 --- a/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx +++ b/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx @@ -440,19 +440,21 @@ struct HfTreeCreatorLcToPKPi { if (std::abs(flag) == o2::hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) { if (swapped == 0) { if (candFlag == 0) { - if (origin == RecoDecay::OriginType::Prompt) + if (origin == RecoDecay::OriginType::Prompt) { status = Prompt; - else if (origin == RecoDecay::OriginType::NonPrompt) + } else if (origin == RecoDecay::OriginType::NonPrompt) { status = NonPrompt; + } } else { status = WrongOrder; } } else { if (candFlag == 1) { - if (origin == RecoDecay::OriginType::Prompt) + if (origin == RecoDecay::OriginType::Prompt) { status = Prompt; - else if (origin == RecoDecay::OriginType::NonPrompt) + } else if (origin == RecoDecay::OriginType::NonPrompt) { status = NonPrompt; + } } else { status = WrongOrder; } @@ -471,7 +473,7 @@ struct HfTreeCreatorLcToPKPi { if (std::accumulate(processes.begin(), processes.end(), 0) != 1) { LOGP(fatal, "One and only one process function must be enabled at a time."); } - if (std::accumulate(processes.begin(), processes.begin() + 4, 0) && fillCandidateMcTable) { + if ((std::accumulate(processes.begin(), processes.begin() + 4, 0) != 0) && fillCandidateMcTable) { LOGP(fatal, "fillCandidateMcTable can be activated only in case of MC processing."); } } @@ -592,7 +594,7 @@ struct HfTreeCreatorLcToPKPi { constexpr int IndexFirstClass{0}; constexpr int IndexSecondClass{1}; constexpr int IndexThirdClass{2}; - if (mlScores.size() == 0) { + if (mlScores.empty()) { return; // when candidateSelectorLc rejects a candidate by "usual", non-ML cut, the ml score vector remains empty } mlScoreFirstClass = mlScores.at(IndexFirstClass); diff --git a/PWGHF/TableProducer/treeCreatorOmegacSt.cxx b/PWGHF/TableProducer/treeCreatorOmegacSt.cxx index b54c6e3b42b..37093d354f6 100644 --- a/PWGHF/TableProducer/treeCreatorOmegacSt.cxx +++ b/PWGHF/TableProducer/treeCreatorOmegacSt.cxx @@ -354,7 +354,7 @@ struct HfTreeCreatorOmegacSt { int8_t origin = 0; // to be used for prompt/non prompt int8_t nPiToMuV0{0}, nPiToMuCasc{0}, nPiToMuOmegac0{0}; int8_t nKaToPiCasc{0}, nKaToPiOmegac0{0}; - std::vector idxBhadMothers{}; + std::vector idxBhadMothers; int decayChannel = -1; // flag for different decay channels bool isMatched = false; static constexpr std::size_t NDaughters{2u}; @@ -746,11 +746,11 @@ struct HfTreeCreatorOmegacSt { momenta[0][0], // cascade momentum momenta[0][1], momenta[0][2], - trackCasc.sign() > 0 ? true : false, + static_cast(trackCasc.sign() > 0), momenta[1][0], // pion/kaon momentum momenta[1][1], momenta[1][2], - track.sign() > 0 ? true : false, + static_cast(track.sign() > 0), track.itsClusterMap(), cpaCharmedBaryon, cpaXYCharmedBaryon, @@ -917,7 +917,7 @@ struct HfTreeCreatorOmegacSt { hCandidatesCascPiOrK->Fill(SVFitting::BeforeFit); try { - if (df2.process(trackParCovCasc, trackParCovPion)) { + if (df2.process(trackParCovCasc, trackParCovPion) != 0) { const auto& secondaryVertex = df2.getPCACandidate(); const auto decayLength = RecoDecay::distance(secondaryVertex, primaryVertexPos); if (mother.has_mothers()) { diff --git a/PWGHF/TableProducer/treeCreatorSigmacCorrBkg.cxx b/PWGHF/TableProducer/treeCreatorSigmacCorrBkg.cxx index 1e46bfc9ea5..4e3f627761a 100644 --- a/PWGHF/TableProducer/treeCreatorSigmacCorrBkg.cxx +++ b/PWGHF/TableProducer/treeCreatorSigmacCorrBkg.cxx @@ -104,7 +104,7 @@ struct HfTreeCreatorSigmacCorrBkg { } /// BDT scores - if (candLcDauSc.mlProbLcToPiKP().size() > 0) { + if (!candLcDauSc.mlProbLcToPiKP().empty()) { outputMl.at(0) = candLcDauSc.mlProbLcToPiKP()[0]; /// bkg score outputMl.at(1) = candLcDauSc.mlProbLcToPiKP()[2]; /// non-prompt score } @@ -152,21 +152,24 @@ struct HfTreeCreatorSigmacCorrBkg { /// the candidate that we reconstructed is a real Sigmac(2455, 2520), but later we look for correlated background sources /// let's continue continue; - } else if (isTrueSigmacPlusPlus) { + } + if (isTrueSigmacPlusPlus) { /// fill the output for the signal fillTable(candidateSc, candLcDauSc, o2::constants::physics::Pdg::kSigmaCPlusPlus); /// the candidate that we reconstructed is a real Sigmac(2455, 2520), but later we look for correlated background sources /// let's continue continue; - } else if (isTrueSigmacStar0) { + } + if (isTrueSigmacStar0) { /// fill the output for the signal fillTable(candidateSc, candLcDauSc, o2::constants::physics::Pdg::kSigmaCStar0); /// the candidate that we reconstructed is a real Sigmac(2455, 2520), but later we look for correlated background sources /// let's continue continue; - } else if (isTrueSigmacStarPlusPlus) { + } + if (isTrueSigmacStarPlusPlus) { /// fill the output for the signal fillTable(candidateSc, candLcDauSc, o2::constants::physics::Pdg::kSigmaCStarPlusPlus); diff --git a/PWGHF/TableProducer/treeCreatorTccToD0D0Pi.cxx b/PWGHF/TableProducer/treeCreatorTccToD0D0Pi.cxx index 24cd582d4c3..85f7d998026 100644 --- a/PWGHF/TableProducer/treeCreatorTccToD0D0Pi.cxx +++ b/PWGHF/TableProducer/treeCreatorTccToD0D0Pi.cxx @@ -392,8 +392,9 @@ struct HfTreeCreatorTccToD0D0Pi { o2::dataformats::V0 trackD2; auto thisCollId = collision.globalIndex(); auto candwD0ThisColl = candidates.sliceBy(candsD0PerCollisionWithMl, thisCollId); - if (candwD0ThisColl.size() <= 1) + if (candwD0ThisColl.size() <= 1) { continue; // only loop the collision that include at least 2 D candidates + } auto trackIdsThisCollision = trackIndices.sliceBy(trackIndicesPerCollision, thisCollId); for (const auto& candidateD1 : candwD0ThisColl) { diff --git a/PWGHF/Tasks/taskLcCentrality.cxx b/PWGHF/Tasks/taskLcCentrality.cxx index d866224d752..c97f395879e 100644 --- a/PWGHF/Tasks/taskLcCentrality.cxx +++ b/PWGHF/Tasks/taskLcCentrality.cxx @@ -95,7 +95,7 @@ struct HfTaskLcCentrality { registry.fill(HIST("hCentrality"), centrality); for (const auto& candidate : candidates) { - if (!(candidate.hfflag() & 1 << aod::hf_cand_3prong::DecayType::LcToPKPi)) { + if ((candidate.hfflag() & 1 << aod::hf_cand_3prong::DecayType::LcToPKPi) == 0) { continue; } if (yCandMax >= 0. && std::abs(hfHelper.yLc(candidate)) > yCandMax) { @@ -166,7 +166,7 @@ struct HfTaskLcCentralityMc { { // MC rec. for (const auto& candidate : candidates) { - if (!(candidate.hfflag() & 1 << aod::hf_cand_3prong::DecayType::LcToPKPi)) { + if ((candidate.hfflag() & 1 << aod::hf_cand_3prong::DecayType::LcToPKPi) == 0) { continue; } if (yCandMax >= 0. && std::abs(hfHelper.yLc(candidate)) > yCandMax) { diff --git a/PWGHF/Tasks/taskMcEfficiency.cxx b/PWGHF/Tasks/taskMcEfficiency.cxx index 5f3bd42351b..1f581030bfd 100644 --- a/PWGHF/Tasks/taskMcEfficiency.cxx +++ b/PWGHF/Tasks/taskMcEfficiency.cxx @@ -118,7 +118,7 @@ struct HfTaskMcEfficiency { } template - inline bool checkTrack(T track) + bool checkTrack(T track) { // TODO configurable? return track.isGlobalTrackWoDCA(); diff --git a/PWGHF/Tasks/taskMcEfficiencyToXiPi.cxx b/PWGHF/Tasks/taskMcEfficiencyToXiPi.cxx index 0550bd5e726..78398ae2ec0 100644 --- a/PWGHF/Tasks/taskMcEfficiencyToXiPi.cxx +++ b/PWGHF/Tasks/taskMcEfficiencyToXiPi.cxx @@ -104,13 +104,13 @@ struct HfTaskMcEfficiencyToXiPi { } template - inline bool checkTrackGlbTrk(T const& track) + bool checkTrackGlbTrk(T const& track) { return (track.isGlobalTrackWoDCA() && track.tpcNClsFound() > nClustersTpcMin && track.itsNCls() > nClustersItsMin); } template - inline bool checkTrackItsTrk(T const& track) + bool checkTrackItsTrk(T const& track) { return (track.isQualityTrackITS() && track.itsNCls() > nClustersItsMin); } diff --git a/PWGHF/Tasks/taskMcGenPtRapShapes.cxx b/PWGHF/Tasks/taskMcGenPtRapShapes.cxx index 01c795d0461..393cf30aefe 100644 --- a/PWGHF/Tasks/taskMcGenPtRapShapes.cxx +++ b/PWGHF/Tasks/taskMcGenPtRapShapes.cxx @@ -44,10 +44,10 @@ using namespace o2::constants::physics; namespace { const int nCharmHadrons = 10; -static constexpr std::array pdgCodesCharm = {Pdg::kD0, Pdg::kDPlus, Pdg::kDS, Pdg::kDStar, Pdg::kLambdaCPlus, Pdg::kSigmaC0, Pdg::kSigmaCPlusPlus, Pdg::kXiC0, Pdg::kXiCPlus, Pdg::kOmegaC0}; +constexpr std::array pdgCodesCharm = {Pdg::kD0, Pdg::kDPlus, Pdg::kDS, Pdg::kDStar, Pdg::kLambdaCPlus, Pdg::kSigmaC0, Pdg::kSigmaCPlusPlus, Pdg::kXiC0, Pdg::kXiCPlus, Pdg::kOmegaC0}; const int nBeautyHadrons = 4; -static constexpr std::array pdgCodesBeauty = {Pdg::kB0, Pdg::kBPlus, Pdg::kBS, Pdg::kLambdaB0}; +constexpr std::array pdgCodesBeauty = {Pdg::kB0, Pdg::kBPlus, Pdg::kBS, Pdg::kLambdaB0}; } // namespace struct HfTaskMcGenPtRapShapes { @@ -62,7 +62,7 @@ struct HfTaskMcGenPtRapShapes { std::array, nCharmHadrons> histPtCharmVsPtBeautyNonPrompt{}; std::array, nBeautyHadrons> histRapVsPtBeauty{}; - HistogramRegistry registry{}; + HistogramRegistry registry; void init(InitContext&) { @@ -84,8 +84,8 @@ struct HfTaskMcGenPtRapShapes { int absPdgCode = std::abs(mcParticle.pdgCode()); float pt = mcParticle.pt(); float rap = mcParticle.y(); - auto itCharm = std::find(pdgCodesCharm.begin(), pdgCodesCharm.end(), absPdgCode); - auto itBeauty = std::find(pdgCodesBeauty.begin(), pdgCodesBeauty.end(), absPdgCode); + const auto* itCharm = std::find(pdgCodesCharm.begin(), pdgCodesCharm.end(), absPdgCode); + const auto* itBeauty = std::find(pdgCodesBeauty.begin(), pdgCodesBeauty.end(), absPdgCode); if (itCharm != pdgCodesCharm.end()) { auto idxCharm = std::distance(pdgCodesCharm.begin(), itCharm); std::vector idxBhadMothers{}; diff --git a/PWGHF/Tasks/taskMcValidation.cxx b/PWGHF/Tasks/taskMcValidation.cxx index 3227018bbd5..0fcf53348f2 100644 --- a/PWGHF/Tasks/taskMcValidation.cxx +++ b/PWGHF/Tasks/taskMcValidation.cxx @@ -100,36 +100,36 @@ enum DecayChannels { DzeroToKPi = 0, nChannels }; // always keep nChannels at the end -static constexpr int nCharmMesonChannels = 10; // number of charm meson channels -static constexpr int nBeautyChannels = 3; // number of beauty hadron channels -static constexpr int nCharmBaryonChannels = nChannels - nCharmMesonChannels - nBeautyChannels; // number of charm baryon channels -static constexpr int nOriginTypes = 2; // number of origin types (prompt, non-prompt; only for charm hadrons) -static constexpr std::array PDGArrayParticle = {o2::constants::physics::Pdg::kD0, o2::constants::physics::Pdg::kDStar, - o2::constants::physics::Pdg::kDPlus, o2::constants::physics::Pdg::kDPlus, - o2::constants::physics::Pdg::kDS, o2::constants::physics::Pdg::kDS, o2::constants::physics::Pdg::kDS1, o2::constants::physics::Pdg::kDS2Star, - o2::constants::physics::Pdg::kD10, o2::constants::physics::Pdg::kD2Star0, - o2::constants::physics::Pdg::kB0, o2::constants::physics::Pdg::kBPlus, o2::constants::physics::Pdg::kBS, - o2::constants::physics::Pdg::kLambdaCPlus, o2::constants::physics::Pdg::kLambdaCPlus, - o2::constants::physics::Pdg::kXiCPlus, o2::constants::physics::Pdg::kXiCPlus, o2::constants::physics::Pdg::kXiC0, - o2::constants::physics::Pdg::kOmegaC0, o2::constants::physics::Pdg::kOmegaC0}; -static constexpr std::array nDaughters = {2, 3, 3, 3, 3, 3, 5, 5, 4, 4, 4, 3, 4, 3, 3, 3, 5, 4, 4, 4}; -static constexpr std::array maxDepthForSearch = {1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 2, 3, 2, 3, 2, 4, 3, 3, 3}; +constexpr int nCharmMesonChannels = 10; // number of charm meson channels +constexpr int nBeautyChannels = 3; // number of beauty hadron channels +constexpr int nCharmBaryonChannels = nChannels - nCharmMesonChannels - nBeautyChannels; // number of charm baryon channels +constexpr int nOriginTypes = 2; // number of origin types (prompt, non-prompt; only for charm hadrons) +constexpr std::array PDGArrayParticle = {o2::constants::physics::Pdg::kD0, o2::constants::physics::Pdg::kDStar, + o2::constants::physics::Pdg::kDPlus, o2::constants::physics::Pdg::kDPlus, + o2::constants::physics::Pdg::kDS, o2::constants::physics::Pdg::kDS, o2::constants::physics::Pdg::kDS1, o2::constants::physics::Pdg::kDS2Star, + o2::constants::physics::Pdg::kD10, o2::constants::physics::Pdg::kD2Star0, + o2::constants::physics::Pdg::kB0, o2::constants::physics::Pdg::kBPlus, o2::constants::physics::Pdg::kBS, + o2::constants::physics::Pdg::kLambdaCPlus, o2::constants::physics::Pdg::kLambdaCPlus, + o2::constants::physics::Pdg::kXiCPlus, o2::constants::physics::Pdg::kXiCPlus, o2::constants::physics::Pdg::kXiC0, + o2::constants::physics::Pdg::kOmegaC0, o2::constants::physics::Pdg::kOmegaC0}; +constexpr std::array nDaughters = {2, 3, 3, 3, 3, 3, 5, 5, 4, 4, 4, 3, 4, 3, 3, 3, 5, 4, 4, 4}; +constexpr std::array maxDepthForSearch = {1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 2, 3, 2, 3, 2, 4, 3, 3, 3}; // keep coherent indexing with PDGArrayParticle // FIXME: look for a better solution -static constexpr std::array, nChannels> arrPDGFinal2Prong = {{{+kPiPlus, -kKPlus}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}}}; -static constexpr std::array, nChannels> arrPDGFinal3Prong = {{{}, {+kPiPlus, -kKPlus, +kPiPlus}, {+kPiPlus, -kKPlus, +kPiPlus}, {+kKPlus, -kKPlus, +kPiPlus}, {+kKPlus, -kKPlus, +kPiPlus}, {+kKPlus, -kKPlus, +kPiPlus}, {}, {}, {}, {}, {}, {-kPiPlus, +kKPlus, +kPiPlus}, {}, {+kProton, -kKPlus, +kPiPlus}, {+kProton, -kPiPlus, +kPiPlus}, {+kProton, -kKPlus, +kPiPlus}, {}, {}, {}, {}}}; -static constexpr std::array, nChannels> arrPDGFinal4Prong = {{{}, {}, {}, {}, {}, {}, {}, {}, {+kPiPlus, -kKPlus, +kPiPlus, -kPiPlus}, {+kPiPlus, -kKPlus, +kPiPlus, -kPiPlus}, {-kPiPlus, +kKPlus, -kPiPlus, +kPiPlus}, {}, {-kKPlus, +kKPlus, -kPiPlus, +kPiPlus}, {}, {}, {}, {}, {+kPiPlus, -kPiPlus, -kPiPlus, +kProton}, {+kPiPlus, -kKPlus, -kPiPlus, +kProton}, {+kPiPlus, -kPiPlus, -kPiPlus, +kProton}}}; -static constexpr std::array, nChannels> arrPDGFinal5Prong = {{{}, {}, {}, {}, {}, {}, {+kPiPlus, -kKPlus, +kPiPlus, +kPiPlus, -kPiPlus}, {+kPiPlus, -kKPlus, +kPiPlus, +kPiPlus, -kPiPlus}, {}, {}, {}, {}, {}, {}, {}, {}, {+kPiPlus, +kPiPlus, -kPiPlus, -kPiPlus, +kProton}, {}, {}, {}}}; -static constexpr std::string_view labels[nChannels] = {"D^{0} #rightarrow K#pi", "D*^{+} #rightarrow D^{0}#pi", "D^{+} #rightarrow K#pi#pi", "D^{+} #rightarrow KK#pi", "D_{s}^{+} #rightarrow #Phi#pi #rightarrow KK#pi", - "D_{s}^{+} #rightarrow #bar{K}^{*0}K #rightarrow KK#pi", "D_{s}1 #rightarrow D*^{+}K^{0}_{s}", "D_{s}2* #rightarrow D^{+}K^{0}_{s}", "D1^{0} #rightarrow D*^{+}#pi", - "D2^{*} #rightarrow D^{+}#pi", - "B^{0} #rightarrow D^{-}#pi", "B^{+} #rightarrow D^{0}#pi", "B_{s}^{+} #rightarrow D_{s}^{-}#pi", - "#Lambda_{c}^{+} #rightarrow pK#pi", - "#Lambda_{c}^{+} #rightarrow pK^{0}_{s}", "#Xi_{c}^{+} #rightarrow pK#pi", - "#Xi_{c}^{+} #rightarrow #Xi#pi#pi", "#Xi_{c}^{0} #rightarrow #Xi#pi", "#Omega_{c}^{0} #rightarrow #Omega#pi", "#Omega_{c}^{0} #rightarrow #Xi#pi"}; -static constexpr std::string_view particleNames[nChannels] = {"DzeroToKPi", "DstarToDzeroPi", "DplusToPiKPi", "DplusToPhiPiToKKPi", "DsToPhiPiToKKPi", "DsToK0starKToKKPi", "Ds1ToDStarK0s", "Ds2StarToDPlusK0s", "D10ToDStarPi", "D2Star0ToDPlusPi", "B0ToDminusPi", "BplusToD0Pi", "BsToDsPi", - "LcToPKPi", "LcToPiK0s", "XiCplusToPKPi", "XiCplusToXiPiPi", "XiCzeroToXiPi", "OmegaCToOmegaPi", "OmegaCToXiPi"}; -static constexpr std::string_view originNames[nOriginTypes] = {"Prompt", "NonPrompt"}; +constexpr std::array, nChannels> arrPDGFinal2Prong = {{{+kPiPlus, -kKPlus}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}}}; +constexpr std::array, nChannels> arrPDGFinal3Prong = {{{}, {+kPiPlus, -kKPlus, +kPiPlus}, {+kPiPlus, -kKPlus, +kPiPlus}, {+kKPlus, -kKPlus, +kPiPlus}, {+kKPlus, -kKPlus, +kPiPlus}, {+kKPlus, -kKPlus, +kPiPlus}, {}, {}, {}, {}, {}, {-kPiPlus, +kKPlus, +kPiPlus}, {}, {+kProton, -kKPlus, +kPiPlus}, {+kProton, -kPiPlus, +kPiPlus}, {+kProton, -kKPlus, +kPiPlus}, {}, {}, {}, {}}}; +constexpr std::array, nChannels> arrPDGFinal4Prong = {{{}, {}, {}, {}, {}, {}, {}, {}, {+kPiPlus, -kKPlus, +kPiPlus, -kPiPlus}, {+kPiPlus, -kKPlus, +kPiPlus, -kPiPlus}, {-kPiPlus, +kKPlus, -kPiPlus, +kPiPlus}, {}, {-kKPlus, +kKPlus, -kPiPlus, +kPiPlus}, {}, {}, {}, {}, {+kPiPlus, -kPiPlus, -kPiPlus, +kProton}, {+kPiPlus, -kKPlus, -kPiPlus, +kProton}, {+kPiPlus, -kPiPlus, -kPiPlus, +kProton}}}; +constexpr std::array, nChannels> arrPDGFinal5Prong = {{{}, {}, {}, {}, {}, {}, {+kPiPlus, -kKPlus, +kPiPlus, +kPiPlus, -kPiPlus}, {+kPiPlus, -kKPlus, +kPiPlus, +kPiPlus, -kPiPlus}, {}, {}, {}, {}, {}, {}, {}, {}, {+kPiPlus, +kPiPlus, -kPiPlus, -kPiPlus, +kProton}, {}, {}, {}}}; +constexpr std::string_view labels[nChannels] = {"D^{0} #rightarrow K#pi", "D*^{+} #rightarrow D^{0}#pi", "D^{+} #rightarrow K#pi#pi", "D^{+} #rightarrow KK#pi", "D_{s}^{+} #rightarrow #Phi#pi #rightarrow KK#pi", + "D_{s}^{+} #rightarrow #bar{K}^{*0}K #rightarrow KK#pi", "D_{s}1 #rightarrow D*^{+}K^{0}_{s}", "D_{s}2* #rightarrow D^{+}K^{0}_{s}", "D1^{0} #rightarrow D*^{+}#pi", + "D2^{*} #rightarrow D^{+}#pi", + "B^{0} #rightarrow D^{-}#pi", "B^{+} #rightarrow D^{0}#pi", "B_{s}^{+} #rightarrow D_{s}^{-}#pi", + "#Lambda_{c}^{+} #rightarrow pK#pi", + "#Lambda_{c}^{+} #rightarrow pK^{0}_{s}", "#Xi_{c}^{+} #rightarrow pK#pi", + "#Xi_{c}^{+} #rightarrow #Xi#pi#pi", "#Xi_{c}^{0} #rightarrow #Xi#pi", "#Omega_{c}^{0} #rightarrow #Omega#pi", "#Omega_{c}^{0} #rightarrow #Xi#pi"}; +constexpr std::string_view particleNames[nChannels] = {"DzeroToKPi", "DstarToDzeroPi", "DplusToPiKPi", "DplusToPhiPiToKKPi", "DsToPhiPiToKKPi", "DsToK0starKToKKPi", "Ds1ToDStarK0s", "Ds2StarToDPlusK0s", "D10ToDStarPi", "D2Star0ToDPlusPi", "B0ToDminusPi", "BplusToD0Pi", "BsToDsPi", + "LcToPKPi", "LcToPiK0s", "XiCplusToPKPi", "XiCplusToXiPiPi", "XiCzeroToXiPi", "OmegaCToOmegaPi", "OmegaCToXiPi"}; +constexpr std::string_view originNames[nOriginTypes] = {"Prompt", "NonPrompt"}; } // namespace /// Generated Level Validation @@ -267,7 +267,7 @@ struct HfTaskMcValidationGen { // inspect for which particle species the candidates were created and which zPvPosMax cut was set for reconstructed const auto& workflows = initContext.services().get(); for (const DeviceSpec& device : workflows.devices) { - if (device.name.compare("hf-task-mc-validation-rec") == 0) { + if (device.name == "hf-task-mc-validation-rec") { hfEvSelMc.configureFromDevice(device); break; } @@ -974,7 +974,7 @@ struct HfTaskMcValidationRec { ambCollPosZ.push_back(ambCollision.posZ()); } // here we are only interested to tracks associated to multiple vertices - if (ambCollPosZ.size() > 0) { + if (!ambCollPosZ.empty()) { registry.fill(HIST("TrackToCollChecks/histAmbiguousTrackZvtxRMS"), computeRMS(ambCollPosZ)); } } diff --git a/PWGHF/Tasks/taskSelOptimisation.cxx b/PWGHF/Tasks/taskSelOptimisation.cxx index c91f5d55819..c9be2c770ca 100644 --- a/PWGHF/Tasks/taskSelOptimisation.cxx +++ b/PWGHF/Tasks/taskSelOptimisation.cxx @@ -45,11 +45,11 @@ using namespace o2::framework::expressions; namespace { -static constexpr int nCutsToTestCosp = 15; -static constexpr int nCutsToTestDecLen = 11; -static constexpr int nCutsToTestImpParProd = 11; -static constexpr int nCutsToTestMinDCAxy = 9; -static constexpr int nCutsToTestMinTrackPt = 7; +constexpr int nCutsToTestCosp = 15; +constexpr int nCutsToTestDecLen = 11; +constexpr int nCutsToTestImpParProd = 11; +constexpr int nCutsToTestMinDCAxy = 9; +constexpr int nCutsToTestMinTrackPt = 7; constexpr float cutsCosp[nCutsToTestCosp] = {0.70, 0.75, 0.80, 0.85, 0.88, 0.90, 0.92, 0.93, 0.94, 0.95, 0.96, 0.97, 0.98, 0.99, 0.995}; constexpr float cutsDecLen[nCutsToTestDecLen] = {0., 0.005, 0.01, 0.015, 0.02, 0.025, 0.03, 0.04, 0.05, 0.075, 0.1}; @@ -63,56 +63,56 @@ auto vecCutsImpParProd = std::vector{cutsImpParProd, cutsImpParProd + nCu auto vecCutsMinDCAxy = std::vector{cutsMinDCAxy, cutsMinDCAxy + nCutsToTestMinDCAxy}; auto vecCutsMinTrackPt = std::vector{cutsMinTrackPt, cutsMinTrackPt + nCutsToTestMinTrackPt}; -static const int n2Prong = o2::aod::hf_cand_2prong::DecayType::N2ProngDecays; -static const int n3Prong = o2::aod::hf_cand_3prong::DecayType::N3ProngDecays; - -static constexpr std::array, 3> histoNames2Prong = {{{"hPromptVsPtD0ToPiK", "hPromptVsPtJpsiToEE", "hPromptVsPtJpsiToMuMu", "hPromptVsPt2Prong"}, - {"hNonPromptVsPtD0ToPiK", "hNonPromptVsPtJpsiToEE", "hNonPromptVsPtJpsiToMuMu", "hNonPromptVsPt2Prong"}, - {"hBkgVsPtD0ToPiK", "hBkgVsPtJpsiToEE", "hBkgVsPtJpsiToMuMu", "hBkgVsPt2Prong"}}}; -static constexpr std::array, 3> histoNamesCosp2Prong = {{{"hPromptCospVsPtD0ToPiK", "hPromptCospVsPtJpsiToEE", "hPromptCospVsPtJpsiToMuMu", "hPromptCospVsPt2Prong"}, - {"hNonPromptCospVsPtD0ToPiK", "hNonPromptCospVsPtJpsiToEE", "hNonPromptCospVsPtJpsiToMuMu", "hNonPromptCospVsPt2Prong"}, - {"hBkgCospVsPtD0ToPiK", "hBkgCospVsPtJpsiToEE", "hBkgCospVsPtJpsiToMuMu", "hBkgCospVsPt2Prong"}}}; -static constexpr std::array, 3> histoNamesDecLen2Prong = {{{"hPromptDecLenVsPtD0ToPiK", "hPromptDecLenVsPtJpsiToEE", "hPromptDecLenVsPtJpsiToMuMu", "hPromptDecLenVsPt2Prong"}, - {"hNonPromptDecLenVsPtD0ToPiK", "hNonPromptDecLenVsPtJpsiToEE", "hNonPromptDecLenVsPtJpsiToMuMu", "hNonPromptDecLenVsPt2Prong"}, - {"hBkgDecLenVsPtD0ToPiK", "hBkgDecLenVsPtJpsiToEE", "hBkgDecLenVsPtJpsiToMuMu", "hBkgDecLenVsPt2Prong"}}}; -static constexpr std::array, 3> histoNamesImpParProd2Prong = {{{"hPromptImpParProdVsPtD0ToPiK", "hPromptImpParProdVsPtJpsiToEE", "hPromptImpParProdVsPtJpsiToMuMu", "hPromptImpParProdVsPt2Prong"}, - {"hNonPromptImpParProdVsPtD0ToPiK", "hNonPromptImpParProdVsPtJpsiToEE", "hNonPromptImpParProdVsPtJpsiToMuMu", "hNonPromptImpParProdVsPt2Prong"}, - {"hBkgImpParProdVsPtD0ToPiK", "hBkgImpParProdVsPtJpsiToEE", "hBkgImpParProdVsPtJpsiToMuMu", "hBkgImpParProdVsPt2Prong"}}}; -static constexpr std::array, 3> histoNamesMinDCAxy2Prong = {{{"hPromptMinDCAxyVsPtD0ToPiK", "hPromptMinDCAxyVsPtJpsiToEE", "hPromptMinDCAxyVsPtJpsiToMuMu", "hPromptMinDCAxyVsPt2Prong"}, - {"hNonPromptMinDCAxyVsPtD0ToPiK", "hNonPromptMinDCAxyVsPtJpsiToEE", "hNonPromptMinDCAxyVsPtJpsiToMuMu", "hNonPromptMinDCAxyVsPt2Prong"}, - {"hBkgMinDCAxyVsPtD0ToPiK", "hBkgMinDCAxyVsPtJpsiToEE", "hBkgMinDCAxyVsPtJpsiToMuMu", "hBkgMinDCAxyVsPt2Prong"}}}; -static constexpr std::array, 3> histoNamesMinTrackPt2Prong = {{{"hPromptMinTrackPtVsPtD0ToPiK", "hPromptMinTrackPtVsPtJpsiToEE", "hPromptMinTrackPtVsPtJpsiToMuMu", "hPromptMinTrackPtVsPt2Prong"}, - {"hNonPromptMinTrackPtVsPtD0ToPiK", "hNonPromptMinTrackPtVsPtJpsiToEE", "hNonPromptMinTrackPtVsPtJpsiToMuMu", "hNonPromptMinTrackPtVsPt2Prong"}, - {"hBkgMinTrackPtVsPtD0ToPiK", "hBkgMinTrackPtVsPtJpsiToEE", "hBkgMinTrackPtVsPtJpsiToMuMu", "hBkgMinTrackPtVsPt2Prong"}}}; - -static constexpr std::array, 3> histoNames3Prong = {{{"hPromptVsPtDPlusToPiKPi", "hPromptVsPtLcToPKPi", "hPromptVsPtDsToPiKK", "hPromptVsPtXicToPKPi", "hPromptVsPt3Prong"}, - {"hNonPromptVsPtDPlusToPiKPi", "hNonPromptVsPtLcToPKPi", "hNonPromptVsPtDsToPiKK", "hNonPromptVsPtXicToPKPi", "hNonPromptVsPt3Prong"}, - {"hBkgVsPtDPlusToPiKPi", "hBkgVsPtLcToPKPi", "hBkgVsPtDsToPiKK", "hBkgVsPtXicToPKPi", "hBkgVsPt3Prong"}}}; -static constexpr std::array, 3> histoNamesCosp3Prong = {{{"hPromptCospVsPtDPlusToPiKPi", "hPromptCospVsPtLcToPKPi", "hPromptCospVsPtDsToPiKK", "hPromptCospVsPtXicToPKPi", "hPromptCospVsPt3Prong"}, - {"hNonPromptCospVsPtDPlusToPiKPi", "hNonPromptCospVsPtLcToPKPi", "hNonPromptCospVsPtDsToPiKK", "hNonPromptCospVsPtXicToPKPi", "hNonPromptCospVsPt3Prong"}, - {"hBkgCospVsPtDPlusToPiKPi", "hBkgCospVsPtLcToPKPi", "hBkgCospVsPtDsToPiKK", "hBkgCospVsPtXicToPKPi", "hBkgCospVsPt3Prong"}}}; -static constexpr std::array, 3> histoNamesDecLen3Prong = {{{"hPromptDecLenVsPtDPlusToPiKPi", "hPromptDecLenVsPtLcToPKPi", "hPromptDecLenVsPtDsToPiKK", "hPromptDecLenVsPtXicToPKPi", "hPromptDecLenVsPt3Prong"}, - {"hNonPromptDecLenVsPtDPlusToPiKPi", "hNonPromptDecLenVsPtLcToPKPi", "hNonPromptDecLenVsPtDsToPiKK", "hNonPromptDecLenVsPtXicToPKPi", "hNonPromptDecLenVsPt3Prong"}, - {"hBkgDecLenVsPtDPlusToPiKPi", "hBkgDecLenVsPtLcToPKPi", "hBkgDecLenVsPtDsToPiKK", "hBkgDecLenVsPtXicToPKPi", "hBkgDecLenVsPt3Prong"}}}; -static constexpr std::array, 3> histoNamesMinDCAxy3Prong = {{{"hPromptMinDCAxyVsPtDPlusToPiKPi", "hPromptMinDCAxyVsPtLcToPKPi", "hPromptMinDCAxyVsPtDsToPiKK", "hPromptMinDCAxyVsPtXicToPKPi", "hPromptMinDCAxyVsPt3Prong"}, - {"hNonPromptMinDCAxyVsPtDPlusToPiKPi", "hNonPromptMinDCAxyVsPtLcToPKPi", "hNonPromptMinDCAxyVsPtDsToPiKK", "hNonPromptMinDCAxyVsPtXicToPKPi", "hNonPromptMinDCAxyVsPt3Prong"}, - {"hBkgMinDCAxyVsPtDPlusToPiKPi", "hBkgMinDCAxyVsPtLcToPKPi", "hBkgMinDCAxyVsPtDsToPiKK", "hBkgMinDCAxyVsPtXicToPKPi", "hBkgMinDCAxyVsPt3Prong"}}}; -static constexpr std::array, 3> histoNamesMinTrackPt3Prong = {{{"hPromptMinTrackPtVsPtDPlusToPiKPi", "hPromptMinTrackPtVsPtLcToPKPi", "hPromptMinTrackPtVsPtDsToPiKK", "hPromptMinTrackPtVsPtXicToPKPi", "hPromptMinTrackPtVsPt3Prong"}, - {"hNonPromptMinTrackPtVsPtDPlusToPiKPi", "hNonPromptMinTrackPtVsPtLcToPKPi", "hNonPromptMinTrackPtVsPtDsToPiKK", "hNonPromptMinTrackPtVsPtXicToPKPi", "hNonPromptMinTrackPtVsPt3Prong"}, - {"hBkgMinTrackPtVsPtDPlusToPiKPi", "hBkgMinTrackPtVsPtLcToPKPi", "hBkgMinTrackPtVsPtDsToPiKK", "hBkgMinTrackPtVsPtXicToPKPi", "hBkgMinTrackPtVsPt3Prong"}}}; - -static std::array, n2Prong + 1>, 3> histPt2Prong{}; -static std::array, n2Prong + 1>, 3> histCospVsPt2Prong{}; -static std::array, n2Prong + 1>, 3> histDecLenVsPt2Prong{}; -static std::array, n2Prong + 1>, 3> histImpParProdVsPt2Prong{}; -static std::array, n2Prong + 1>, 3> histMinDCAxyVsPt2Prong{}; -static std::array, n2Prong + 1>, 3> histMinTrackPtVsPt2Prong{}; - -static std::array, n3Prong + 1>, 3> histPt3Prong{}; -static std::array, n3Prong + 1>, 3> histCospVsPt3Prong{}; -static std::array, n3Prong + 1>, 3> histDecLenVsPt3Prong{}; -static std::array, n3Prong + 1>, 3> histMinDCAxyVsPt3Prong{}; -static std::array, n3Prong + 1>, 3> histMinTrackPtVsPt3Prong{}; +const int n2Prong = o2::aod::hf_cand_2prong::DecayType::N2ProngDecays; +const int n3Prong = o2::aod::hf_cand_3prong::DecayType::N3ProngDecays; + +constexpr std::array, 3> histoNames2Prong = {{{"hPromptVsPtD0ToPiK", "hPromptVsPtJpsiToEE", "hPromptVsPtJpsiToMuMu", "hPromptVsPt2Prong"}, + {"hNonPromptVsPtD0ToPiK", "hNonPromptVsPtJpsiToEE", "hNonPromptVsPtJpsiToMuMu", "hNonPromptVsPt2Prong"}, + {"hBkgVsPtD0ToPiK", "hBkgVsPtJpsiToEE", "hBkgVsPtJpsiToMuMu", "hBkgVsPt2Prong"}}}; +constexpr std::array, 3> histoNamesCosp2Prong = {{{"hPromptCospVsPtD0ToPiK", "hPromptCospVsPtJpsiToEE", "hPromptCospVsPtJpsiToMuMu", "hPromptCospVsPt2Prong"}, + {"hNonPromptCospVsPtD0ToPiK", "hNonPromptCospVsPtJpsiToEE", "hNonPromptCospVsPtJpsiToMuMu", "hNonPromptCospVsPt2Prong"}, + {"hBkgCospVsPtD0ToPiK", "hBkgCospVsPtJpsiToEE", "hBkgCospVsPtJpsiToMuMu", "hBkgCospVsPt2Prong"}}}; +constexpr std::array, 3> histoNamesDecLen2Prong = {{{"hPromptDecLenVsPtD0ToPiK", "hPromptDecLenVsPtJpsiToEE", "hPromptDecLenVsPtJpsiToMuMu", "hPromptDecLenVsPt2Prong"}, + {"hNonPromptDecLenVsPtD0ToPiK", "hNonPromptDecLenVsPtJpsiToEE", "hNonPromptDecLenVsPtJpsiToMuMu", "hNonPromptDecLenVsPt2Prong"}, + {"hBkgDecLenVsPtD0ToPiK", "hBkgDecLenVsPtJpsiToEE", "hBkgDecLenVsPtJpsiToMuMu", "hBkgDecLenVsPt2Prong"}}}; +constexpr std::array, 3> histoNamesImpParProd2Prong = {{{"hPromptImpParProdVsPtD0ToPiK", "hPromptImpParProdVsPtJpsiToEE", "hPromptImpParProdVsPtJpsiToMuMu", "hPromptImpParProdVsPt2Prong"}, + {"hNonPromptImpParProdVsPtD0ToPiK", "hNonPromptImpParProdVsPtJpsiToEE", "hNonPromptImpParProdVsPtJpsiToMuMu", "hNonPromptImpParProdVsPt2Prong"}, + {"hBkgImpParProdVsPtD0ToPiK", "hBkgImpParProdVsPtJpsiToEE", "hBkgImpParProdVsPtJpsiToMuMu", "hBkgImpParProdVsPt2Prong"}}}; +constexpr std::array, 3> histoNamesMinDCAxy2Prong = {{{"hPromptMinDCAxyVsPtD0ToPiK", "hPromptMinDCAxyVsPtJpsiToEE", "hPromptMinDCAxyVsPtJpsiToMuMu", "hPromptMinDCAxyVsPt2Prong"}, + {"hNonPromptMinDCAxyVsPtD0ToPiK", "hNonPromptMinDCAxyVsPtJpsiToEE", "hNonPromptMinDCAxyVsPtJpsiToMuMu", "hNonPromptMinDCAxyVsPt2Prong"}, + {"hBkgMinDCAxyVsPtD0ToPiK", "hBkgMinDCAxyVsPtJpsiToEE", "hBkgMinDCAxyVsPtJpsiToMuMu", "hBkgMinDCAxyVsPt2Prong"}}}; +constexpr std::array, 3> histoNamesMinTrackPt2Prong = {{{"hPromptMinTrackPtVsPtD0ToPiK", "hPromptMinTrackPtVsPtJpsiToEE", "hPromptMinTrackPtVsPtJpsiToMuMu", "hPromptMinTrackPtVsPt2Prong"}, + {"hNonPromptMinTrackPtVsPtD0ToPiK", "hNonPromptMinTrackPtVsPtJpsiToEE", "hNonPromptMinTrackPtVsPtJpsiToMuMu", "hNonPromptMinTrackPtVsPt2Prong"}, + {"hBkgMinTrackPtVsPtD0ToPiK", "hBkgMinTrackPtVsPtJpsiToEE", "hBkgMinTrackPtVsPtJpsiToMuMu", "hBkgMinTrackPtVsPt2Prong"}}}; + +constexpr std::array, 3> histoNames3Prong = {{{"hPromptVsPtDPlusToPiKPi", "hPromptVsPtLcToPKPi", "hPromptVsPtDsToPiKK", "hPromptVsPtXicToPKPi", "hPromptVsPt3Prong"}, + {"hNonPromptVsPtDPlusToPiKPi", "hNonPromptVsPtLcToPKPi", "hNonPromptVsPtDsToPiKK", "hNonPromptVsPtXicToPKPi", "hNonPromptVsPt3Prong"}, + {"hBkgVsPtDPlusToPiKPi", "hBkgVsPtLcToPKPi", "hBkgVsPtDsToPiKK", "hBkgVsPtXicToPKPi", "hBkgVsPt3Prong"}}}; +constexpr std::array, 3> histoNamesCosp3Prong = {{{"hPromptCospVsPtDPlusToPiKPi", "hPromptCospVsPtLcToPKPi", "hPromptCospVsPtDsToPiKK", "hPromptCospVsPtXicToPKPi", "hPromptCospVsPt3Prong"}, + {"hNonPromptCospVsPtDPlusToPiKPi", "hNonPromptCospVsPtLcToPKPi", "hNonPromptCospVsPtDsToPiKK", "hNonPromptCospVsPtXicToPKPi", "hNonPromptCospVsPt3Prong"}, + {"hBkgCospVsPtDPlusToPiKPi", "hBkgCospVsPtLcToPKPi", "hBkgCospVsPtDsToPiKK", "hBkgCospVsPtXicToPKPi", "hBkgCospVsPt3Prong"}}}; +constexpr std::array, 3> histoNamesDecLen3Prong = {{{"hPromptDecLenVsPtDPlusToPiKPi", "hPromptDecLenVsPtLcToPKPi", "hPromptDecLenVsPtDsToPiKK", "hPromptDecLenVsPtXicToPKPi", "hPromptDecLenVsPt3Prong"}, + {"hNonPromptDecLenVsPtDPlusToPiKPi", "hNonPromptDecLenVsPtLcToPKPi", "hNonPromptDecLenVsPtDsToPiKK", "hNonPromptDecLenVsPtXicToPKPi", "hNonPromptDecLenVsPt3Prong"}, + {"hBkgDecLenVsPtDPlusToPiKPi", "hBkgDecLenVsPtLcToPKPi", "hBkgDecLenVsPtDsToPiKK", "hBkgDecLenVsPtXicToPKPi", "hBkgDecLenVsPt3Prong"}}}; +constexpr std::array, 3> histoNamesMinDCAxy3Prong = {{{"hPromptMinDCAxyVsPtDPlusToPiKPi", "hPromptMinDCAxyVsPtLcToPKPi", "hPromptMinDCAxyVsPtDsToPiKK", "hPromptMinDCAxyVsPtXicToPKPi", "hPromptMinDCAxyVsPt3Prong"}, + {"hNonPromptMinDCAxyVsPtDPlusToPiKPi", "hNonPromptMinDCAxyVsPtLcToPKPi", "hNonPromptMinDCAxyVsPtDsToPiKK", "hNonPromptMinDCAxyVsPtXicToPKPi", "hNonPromptMinDCAxyVsPt3Prong"}, + {"hBkgMinDCAxyVsPtDPlusToPiKPi", "hBkgMinDCAxyVsPtLcToPKPi", "hBkgMinDCAxyVsPtDsToPiKK", "hBkgMinDCAxyVsPtXicToPKPi", "hBkgMinDCAxyVsPt3Prong"}}}; +constexpr std::array, 3> histoNamesMinTrackPt3Prong = {{{"hPromptMinTrackPtVsPtDPlusToPiKPi", "hPromptMinTrackPtVsPtLcToPKPi", "hPromptMinTrackPtVsPtDsToPiKK", "hPromptMinTrackPtVsPtXicToPKPi", "hPromptMinTrackPtVsPt3Prong"}, + {"hNonPromptMinTrackPtVsPtDPlusToPiKPi", "hNonPromptMinTrackPtVsPtLcToPKPi", "hNonPromptMinTrackPtVsPtDsToPiKK", "hNonPromptMinTrackPtVsPtXicToPKPi", "hNonPromptMinTrackPtVsPt3Prong"}, + {"hBkgMinTrackPtVsPtDPlusToPiKPi", "hBkgMinTrackPtVsPtLcToPKPi", "hBkgMinTrackPtVsPtDsToPiKK", "hBkgMinTrackPtVsPtXicToPKPi", "hBkgMinTrackPtVsPt3Prong"}}}; + +std::array, n2Prong + 1>, 3> histPt2Prong{}; +std::array, n2Prong + 1>, 3> histCospVsPt2Prong{}; +std::array, n2Prong + 1>, 3> histDecLenVsPt2Prong{}; +std::array, n2Prong + 1>, 3> histImpParProdVsPt2Prong{}; +std::array, n2Prong + 1>, 3> histMinDCAxyVsPt2Prong{}; +std::array, n2Prong + 1>, 3> histMinTrackPtVsPt2Prong{}; + +std::array, n3Prong + 1>, 3> histPt3Prong{}; +std::array, n3Prong + 1>, 3> histCospVsPt3Prong{}; +std::array, n3Prong + 1>, 3> histDecLenVsPt3Prong{}; +std::array, n3Prong + 1>, 3> histMinDCAxyVsPt3Prong{}; +std::array, n3Prong + 1>, 3> histMinTrackPtVsPt3Prong{}; } // namespace diff --git a/PWGHF/Utils/utilsEvSelHf.h b/PWGHF/Utils/utilsEvSelHf.h index eac38fbfaf3..635678890e7 100644 --- a/PWGHF/Utils/utilsEvSelHf.h +++ b/PWGHF/Utils/utilsEvSelHf.h @@ -248,7 +248,7 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { } // we initialise the summary object - if (softwareTrigger.value != "") { + if (!softwareTrigger.value.empty()) { zorroSummary.setObject(zorro.getZorroSummary()); } @@ -344,7 +344,7 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { SETBIT(rejectionMask, EventRejection::PositionZ); } - if (softwareTrigger.value != "") { + if (!softwareTrigger.value.empty()) { // we might have to update it from CCDB const auto bc = collision.template bc_as(); const auto runNumber = bc.runNumber(); @@ -435,7 +435,7 @@ struct HfEventSelectionMc { float centralityMin{-10.f}; // Minimum centrality float centralityMax{100.f}; // Maximum centrality bool requireGoodRct{false}; // Apply RCT selection - std::string rctLabel{""}; // RCT selection flag + std::string rctLabel; // RCT selection flag bool rctCheckZDC{false}; // require ZDC from RCT bool rctTreatLimitedAcceptanceAsBad{false}; // RCT flag to reject events with limited acceptance for selected detectors @@ -471,29 +471,29 @@ struct HfEventSelectionMc { void configureFromDevice(o2::framework::DeviceSpec const& device) { for (const auto& option : device.options) { - if (option.name.compare("hfEvSel.useSel8Trigger") == 0) { + if (option.name == "hfEvSel.useSel8Trigger") { useSel8Trigger = option.defaultValue.get(); - } else if (option.name.compare("hfEvSel.useTvxTrigger") == 0) { + } else if (option.name == "hfEvSel.useTvxTrigger") { useTvxTrigger = option.defaultValue.get(); - } else if (option.name.compare("hfEvSel.useTimeFrameBorderCut") == 0) { + } else if (option.name == "hfEvSel.useTimeFrameBorderCut") { useTimeFrameBorderCut = option.defaultValue.get(); - } else if (option.name.compare("hfEvSel.useItsRofBorderCut") == 0) { + } else if (option.name == "hfEvSel.useItsRofBorderCut") { useItsRofBorderCut = option.defaultValue.get(); - } else if (option.name.compare("hfEvSel.zPvPosMin") == 0) { + } else if (option.name == "hfEvSel.zPvPosMin") { zPvPosMin = option.defaultValue.get(); - } else if (option.name.compare("hfEvSel.zPvPosMax") == 0) { + } else if (option.name == "hfEvSel.zPvPosMax") { zPvPosMax = option.defaultValue.get(); - } else if (option.name.compare("hfEvSel.centralityMin") == 0) { + } else if (option.name == "hfEvSel.centralityMin") { centralityMin = option.defaultValue.get(); - } else if (option.name.compare("hfEvSel.centralityMax") == 0) { + } else if (option.name == "hfEvSel.centralityMax") { centralityMax = option.defaultValue.get(); - } else if (option.name.compare("hfEvSel.requireGoodRct") == 0) { + } else if (option.name == "hfEvSel.requireGoodRct") { requireGoodRct = option.defaultValue.get(); - } else if (option.name.compare("hfEvSel.rctLabel") == 0) { + } else if (option.name == "hfEvSel.rctLabel") { rctLabel = option.defaultValue.get(); - } else if (option.name.compare("hfEvSel.rctCheckZDC") == 0) { + } else if (option.name == "hfEvSel.rctCheckZDC") { rctCheckZDC = option.defaultValue.get(); - } else if (option.name.compare("hfEvSel.rctTreatLimitedAcceptanceAsBad") == 0) { + } else if (option.name == "hfEvSel.rctTreatLimitedAcceptanceAsBad") { rctTreatLimitedAcceptanceAsBad = option.defaultValue.get(); } } diff --git a/PWGHF/Utils/utilsMcGen.h b/PWGHF/Utils/utilsMcGen.h index 8bde2fc9265..18734c1e96a 100644 --- a/PWGHF/Utils/utilsMcGen.h +++ b/PWGHF/Utils/utilsMcGen.h @@ -160,7 +160,7 @@ void fillMcMatchGen3Prong(TMcParticles const& mcParticles, continue; } - if (pdgMothersCorrelBkg.size() > 0) { + if (!pdgMothersCorrelBkg.empty()) { for (const auto& pdgMother : pdgMothersCorrelBkg) { if (std::abs(particle.pdgCode()) != pdgMother) { continue; // Skip if the particle PDG code does not match the mother PDG code From 2ad6d6b98d51ca4477a0615a18a4f76c99d992ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Sat, 27 Sep 2025 03:16:15 +0200 Subject: [PATCH 08/25] Fix names --- PWGHF/Core/CentralityEstimation.h | 28 +- .../candidateCreatorB0Reduced.cxx | 14 +- .../candidateCreatorBToJpsiReduced.cxx | 16 +- .../candidateCreatorBplusReduced.cxx | 10 +- .../candidateCreatorBsReduced.cxx | 10 +- .../candidateCreatorCharmResoReduced.cxx | 102 +- .../candidateCreatorLbReduced.cxx | 10 +- .../candidateSelectorB0ToDPiReduced.cxx | 14 +- .../candidateSelectorBplusToD0PiReduced.cxx | 6 +- .../candidateSelectorBsToDsPiReduced.cxx | 6 +- .../candidateSelectorLbToLcPiReduced.cxx | 6 +- .../dataCreatorCharmHadPiReduced.cxx | 96 +- .../dataCreatorCharmResoReduced.cxx | 106 +- .../dataCreatorJpsiHadReduced.cxx | 22 +- PWGHF/D2H/Tasks/taskB0Reduced.cxx | 68 +- PWGHF/D2H/Tasks/taskBplusReduced.cxx | 38 +- PWGHF/D2H/Tasks/taskBplusToJpsiKReduced.cxx | 10 +- PWGHF/D2H/Tasks/taskBsReduced.cxx | 46 +- PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx | 10 +- PWGHF/D2H/Tasks/taskCharmPolarisation.cxx | 228 ++--- .../D2H/Tasks/taskCharmResoToDTrkReduced.cxx | 22 +- PWGHF/D2H/Tasks/taskCharmResoToDV0Reduced.cxx | 40 +- PWGHF/D2H/Tasks/taskD0.cxx | 18 +- .../Tasks/taskDirectedFlowCharmHadrons.cxx | 4 +- PWGHF/D2H/Tasks/taskDplus.cxx | 28 +- PWGHF/D2H/Tasks/taskDs.cxx | 20 +- PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx | 10 +- PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx | 22 +- PWGHF/D2H/Tasks/taskLbReduced.cxx | 40 +- PWGHF/D2H/Tasks/taskLc.cxx | 20 +- PWGHF/D2H/Tasks/taskOmegac0ToOmegapi.cxx | 18 +- PWGHF/D2H/Tasks/taskSigmac.cxx | 24 +- PWGHF/D2H/Tasks/taskXic.cxx | 12 +- PWGHF/D2H/Tasks/taskXic0ToXiPi.cxx | 24 +- PWGHF/D2H/Tasks/taskXicToXiPiPi.cxx | 18 +- PWGHF/D2H/Utils/utilsRedDataFormat.h | 4 +- PWGHF/HFC/Macros/DhCorrelationExtraction.cxx | 906 +++++++++--------- PWGHF/HFC/Macros/DhCorrelationExtraction.h | 142 +-- PWGHF/HFC/Macros/DhCorrelationFitter.h | 86 +- PWGHF/HFC/TableProducer/correlatorD0D0bar.cxx | 4 +- .../correlatorD0D0barBarrelFullPid.cxx | 4 +- .../TableProducer/correlatorDMesonPairs.cxx | 4 +- .../TableProducer/correlatorDplusDminus.cxx | 4 +- .../correlatorFlowCharmHadronsReduced.cxx | 18 +- .../TableProducer/correlatorLcScHadrons.cxx | 62 +- .../derivedDataCreatorCorrelationsReduced.cxx | 70 +- .../HFC/TableProducer/femtoDreamProducer.cxx | 46 +- .../HFC/Tasks/taskCharmHadronsFemtoDream.cxx | 14 +- PWGHF/HFC/Tasks/taskCorrelationDDbar.cxx | 32 +- PWGHF/HFC/Tasks/taskCorrelationHfeHadrons.cxx | 4 +- PWGHF/HFC/Tasks/taskFlow.cxx | 38 +- PWGHF/HFC/Utils/utilsCorrelations.h | 4 +- .../electronSelectionWithTpcEmcal.cxx | 2 +- .../Tasks/taskMuonCharmBeautySeparation.cxx | 4 +- PWGHF/HFL/Tasks/taskSingleMuonReader.cxx | 16 +- PWGHF/HFL/Tasks/taskSingleMuonReaderAssoc.cxx | 16 +- .../TableProducer/candidateCreator2Prong.cxx | 48 +- .../TableProducer/candidateCreator3Prong.cxx | 48 +- .../TableProducer/candidateCreatorCascade.cxx | 32 +- PWGHF/TableProducer/candidateCreatorDstar.cxx | 34 +- .../candidateCreatorXic0Omegac0.cxx | 90 +- .../candidateCreatorXicToXiPiPi.cxx | 24 +- .../candidateSelectorB0ToDPi.cxx | 6 +- .../candidateSelectorBplusToD0Pi.cxx | 6 +- PWGHF/TableProducer/candidateSelectorD0.cxx | 14 +- PWGHF/TableProducer/candidateSelectorLc.cxx | 28 +- .../candidateSelectorOmegac0ToOmegaPi.cxx | 22 +- .../candidateSelectorOmegac0Xic0ToOmegaKa.cxx | 24 +- .../candidateSelectorXicToXiPiPi.cxx | 42 +- .../derivedDataCreatorB0ToDPi.cxx | 20 +- .../derivedDataCreatorBplusToD0Pi.cxx | 20 +- .../derivedDataCreatorD0ToKPi.cxx | 20 +- .../derivedDataCreatorDplusToPiKPi.cxx | 20 +- .../derivedDataCreatorDsToKKPi.cxx | 20 +- .../derivedDataCreatorDstarToD0Pi.cxx | 20 +- .../derivedDataCreatorLcToPKPi.cxx | 18 +- .../derivedDataCreatorXicToXiPiPi.cxx | 20 +- PWGHF/TableProducer/mcPidTof.cxx | 146 +-- PWGHF/TableProducer/pidCreator.cxx | 4 +- PWGHF/TableProducer/trackIndexSkimCreator.cxx | 58 +- PWGHF/TableProducer/treeCreatorB0ToDPi.cxx | 4 +- .../TableProducer/treeCreatorBplusToD0Pi.cxx | 4 +- PWGHF/TableProducer/treeCreatorBsToDsPi.cxx | 4 +- PWGHF/TableProducer/treeCreatorD0ToKPi.cxx | 28 +- .../TableProducer/treeCreatorDplusToPiKPi.cxx | 10 +- PWGHF/TableProducer/treeCreatorDsToKKPi.cxx | 18 +- .../TableProducer/treeCreatorDstarToD0Pi.cxx | 4 +- PWGHF/TableProducer/treeCreatorLbToLcPi.cxx | 16 +- PWGHF/TableProducer/treeCreatorLcToPKPi.cxx | 34 +- PWGHF/TableProducer/treeCreatorToXiPi.cxx | 10 +- .../TableProducer/treeCreatorXic0ToXiPiKf.cxx | 4 +- PWGHF/TableProducer/treeCreatorXicToPKPi.cxx | 8 +- .../TableProducer/treeCreatorXicToXiPiPi.cxx | 6 +- .../TableProducer/treeCreatorXiccToPKPiPi.cxx | 20 +- PWGHF/Tasks/taskCharmHadImpactPar.cxx | 36 +- PWGHF/Tasks/taskMcEfficiency.cxx | 20 +- PWGHF/Tasks/taskMcGenPtRapShapes.cxx | 24 +- PWGHF/Tasks/taskMcValidation.cxx | 346 +++---- .../taskMultiplicityEstimatorCorrelation.cxx | 20 +- PWGHF/Tasks/taskPidStudies.cxx | 16 +- PWGHF/Tasks/taskSelOptimisation.cxx | 104 +- PWGHF/Utils/utilsDerivedData.h | 4 +- PWGHF/Utils/utilsEvSelHf.h | 26 +- PWGHF/Utils/utilsPid.h | 12 +- 104 files changed, 2104 insertions(+), 2104 deletions(-) diff --git a/PWGHF/Core/CentralityEstimation.h b/PWGHF/Core/CentralityEstimation.h index 916d183a289..4382213dbe0 100644 --- a/PWGHF/Core/CentralityEstimation.h +++ b/PWGHF/Core/CentralityEstimation.h @@ -32,34 +32,34 @@ enum CentralityEstimator { }; template -concept hasFT0ACent = requires(T collision) { +concept HasFT0ACent = requires(T collision) { collision.centFT0A(); }; template -concept hasFT0CCent = requires(T collision) { +concept HasFT0CCent = requires(T collision) { collision.centFT0C(); }; template -concept hasFT0MCent = requires(T collision) { +concept HasFT0MCent = requires(T collision) { collision.centFT0M(); }; template -concept hasFV0ACent = requires(T collision) { +concept HasFV0ACent = requires(T collision) { collision.centFV0A(); }; template -concept hasNTracksPVCent = requires(T collision) { +concept HasNTracksPvCent = requires(T collision) { collision.centNTPV(); }; /// Evaluate centrality/multiplicity percentile using FT0A estimator /// \param candidate is candidate /// \return centrality/multiplicity percentile of the collision -template +template float getCentralityColl(const TCollision& collision) { return collision.centFT0A(); @@ -68,7 +68,7 @@ float getCentralityColl(const TCollision& collision) /// Evaluate centrality/multiplicity percentile using FT0C estimator /// \param candidate is candidate /// \return centrality/multiplicity percentile of the collision -template +template float getCentralityColl(const TCollision& collision) { return collision.centFT0C(); @@ -77,7 +77,7 @@ float getCentralityColl(const TCollision& collision) /// Evaluate centrality/multiplicity percentile using FT0M estimator /// \param candidate is candidate /// \return centrality/multiplicity percentile of the collision -template +template float getCentralityColl(const TCollision& collision) { return collision.centFT0M(); @@ -86,7 +86,7 @@ float getCentralityColl(const TCollision& collision) /// Evaluate centrality/multiplicity percentile using FV0A estimator /// \param candidate is candidate /// \return centrality/multiplicity percentile of the collision -template +template float getCentralityColl(const TCollision& collision) { return collision.centFV0A(); @@ -95,7 +95,7 @@ float getCentralityColl(const TCollision& collision) /// Evaluate centrality/multiplicity percentile using NTracksPV estimator /// \param candidate is candidate /// \return centrality/multiplicity percentile of the collision -template +template float getCentralityColl(const TCollision& collision) { return collision.centNTPV(); @@ -119,25 +119,25 @@ float getCentralityColl(const TCollision& collision, const int centEstimator) { switch (centEstimator) { case CentralityEstimator::FT0A: - if constexpr (hasFT0ACent) { + if constexpr (HasFT0ACent) { return collision.centFT0A(); } LOG(fatal) << "Collision does not have centFT0A()."; break; case CentralityEstimator::FT0C: - if constexpr (hasFT0CCent) { + if constexpr (HasFT0CCent) { return collision.centFT0C(); } LOG(fatal) << "Collision does not have centFT0C()."; break; case CentralityEstimator::FT0M: - if constexpr (hasFT0MCent) { + if constexpr (HasFT0MCent) { return collision.centFT0M(); } LOG(fatal) << "Collision does not have centFT0M()."; break; case CentralityEstimator::FV0A: - if constexpr (hasFV0ACent) { + if constexpr (HasFV0ACent) { return collision.centFV0A(); } LOG(fatal) << "Collision does not have centFV0A()."; diff --git a/PWGHF/D2H/TableProducer/candidateCreatorB0Reduced.cxx b/PWGHF/D2H/TableProducer/candidateCreatorB0Reduced.cxx index fd6a2b4098c..08e436e272b 100644 --- a/PWGHF/D2H/TableProducer/candidateCreatorB0Reduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateCreatorB0Reduced.cxx @@ -132,7 +132,7 @@ struct HfCandidateCreatorB0Reduced { /// \param tracksPionThisCollision pion tracks in this collision /// \param invMass2DPiMin minimum B0 invariant-mass /// \param invMass2DPiMax maximum B0 invariant-mass - template + template void runCandidateCreationDStar(Coll const& collision, Cands const& candsDThisColl, SoftPions const& softPions, @@ -230,7 +230,7 @@ struct HfCandidateCreatorB0Reduced { rowCandidateProngsDStar(candD.globalIndex(), trackBachPion.globalIndex(), trackSoftPion.globalIndex()); - if constexpr (withDmesMl) { + if constexpr (WithDmesMl) { rowCandidateDmesMlScores(candD.mlScoreBkgMassHypo0(), candD.mlScorePromptMassHypo0(), candD.mlScoreNonpromptMassHypo0()); } } // pi loop @@ -244,7 +244,7 @@ struct HfCandidateCreatorB0Reduced { /// \param tracksPionThisCollision pion tracks in this collision /// \param invMass2DPiMin minimum B0 invariant-mass /// \param invMass2DPiMax maximum B0 invariant-mass - template + template void runCandidateCreation(Coll const& collision, Cands const& candsDThisColl, Pions const& tracksPionThisCollision, @@ -333,7 +333,7 @@ struct HfCandidateCreatorB0Reduced { rowCandidateProngs(candD.globalIndex(), trackPion.globalIndex()); - if constexpr (withDmesMl) { + if constexpr (WithDmesMl) { rowCandidateDmesMlScores(candD.mlScoreBkgMassHypo0(), candD.mlScorePromptMassHypo0(), candD.mlScoreNonpromptMassHypo0()); } } // pi loop @@ -492,7 +492,7 @@ struct HfCandidateCreatorB0ReducedExpressions { /// \param checkDecayTypeMc /// \param rowsDPiMcRec MC reco information on DPi pairs /// \param candsB0 prong global indices of B0 candidates - template + template void fillB0McRec(McRec const& rowsDPiMcRec, B0Prongs const& candsB0) { for (const auto& candB0 : candsB0) { @@ -509,7 +509,7 @@ struct HfCandidateCreatorB0ReducedExpressions { } rowB0McRec(rowDPiMcRec.flagMcMatchRec(), -1 /*channel*/, rowDPiMcRec.flagWrongCollision(), rowDPiMcRec.debugMcRec(), rowDPiMcRec.ptMother()); filledMcInfo = true; - if constexpr (checkDecayTypeMc) { + if constexpr (CheckDecayTypeMc) { rowB0McCheck(rowDPiMcRec.pdgCodeBeautyMother(), rowDPiMcRec.pdgCodeCharmMother(), rowDPiMcRec.pdgCodeProng0(), @@ -521,7 +521,7 @@ struct HfCandidateCreatorB0ReducedExpressions { } if (!filledMcInfo) { // protection to get same size tables in case something went wrong: we created a candidate that was not preselected in the D-Pi creator rowB0McRec(0, -1, -1, -1, -1.f); - if constexpr (checkDecayTypeMc) { + if constexpr (CheckDecayTypeMc) { rowB0McCheck(-1, -1, -1, -1, -1, -1); } } diff --git a/PWGHF/D2H/TableProducer/candidateCreatorBToJpsiReduced.cxx b/PWGHF/D2H/TableProducer/candidateCreatorBToJpsiReduced.cxx index d96365a6b47..0ee3e103103 100644 --- a/PWGHF/D2H/TableProducer/candidateCreatorBToJpsiReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateCreatorBToJpsiReduced.cxx @@ -150,7 +150,7 @@ struct HfCandidateCreatorBToJpsiReduced { /// \param tracksLfThisCollisionArr LF tracks in this collision /// \param invMass2JpsiHadMin minimum B invariant-mass /// \param invMass2JpsiHadMax maximum B invariant-mass - template + template void runCandidateCreation(Coll const& collision, Cands const& candsJpsiThisColl, TTracks0 const& tracksLfDau0ThisCollision, @@ -215,7 +215,7 @@ struct HfCandidateCreatorBToJpsiReduced { } auto trackParCovLf0 = getTrackParCov(trackLf0); std::array pVecTrackLf0{}; - if constexpr (decChannel == DecayChannel::BplusToJpsiK) { + if constexpr (DecChannel == DecayChannel::BplusToJpsiK) { // --------------------------------- // reconstruct the 3-prong B+ vertex hCandidatesB->Fill(SVFitting::BeforeFit); @@ -278,7 +278,7 @@ struct HfCandidateCreatorBToJpsiReduced { std::sqrt(dcaDauPos.getSigmaY2()), std::sqrt(dcaDauNeg.getSigmaY2()), std::sqrt(dcaKaon.getSigmaY2())); rowCandidateBpProngs(candJpsi.globalIndex(), trackLf0.globalIndex()); - } else if constexpr (decChannel == DecayChannel::BsToJpsiPhi) { + } else if constexpr (DecChannel == DecayChannel::BsToJpsiPhi) { for (const auto& trackLf1 : tracksLfDau1ThisCollision) { // this track is among daughters if (trackLf1.trackId() == candJpsi.prongPosId() || trackLf1.trackId() == candJpsi.prongNegId()) { @@ -426,12 +426,12 @@ struct HfCandidateCreatorBToJpsiReducedExpressions { /// Fill candidate information at MC reconstruction level /// \param rowsJpsiHadMcRec MC reco information on Jpsi hadron pairs /// \param candsBIds prong global indices of B candidates - template + template void fillMcRec(McRec const& rowsJpsiHadMcRec, CCands const& candsBIds) { for (const auto& candB : candsBIds) { bool filledMcInfo{false}; - if constexpr (decChannel == DecayChannel::BplusToJpsiK) { + if constexpr (DecChannel == DecayChannel::BplusToJpsiK) { for (const auto& rowJpsiHadMcRec : rowsJpsiHadMcRec) { if ((rowJpsiHadMcRec.jpsiId() != candB.jpsiId()) || (rowJpsiHadMcRec.bachKaId() != candB.bachKaId())) { continue; @@ -443,7 +443,7 @@ struct HfCandidateCreatorBToJpsiReducedExpressions { if (!filledMcInfo) { // protection to get same size tables in case something went wrong: we created a candidate that was not preselected in the Jpsi-K creator rowBplusMcRec(0, -1, -1, -1, -1.f); } - } else if constexpr (decChannel == DecayChannel::BsToJpsiPhi) { + } else if constexpr (DecChannel == DecayChannel::BsToJpsiPhi) { for (const auto& rowJpsiHadMcRec : rowsJpsiHadMcRec) { if ((rowJpsiHadMcRec.jpsiId() != candB.jpsiId()) || (rowJpsiHadMcRec.prong0PhiId() != candB.prong0PhiId()) || (rowJpsiHadMcRec.prong1PhiId() != candB.prong1PhiId())) { continue; @@ -465,9 +465,9 @@ struct HfCandidateCreatorBToJpsiReducedExpressions { } PROCESS_SWITCH(HfCandidateCreatorBToJpsiReducedExpressions, processMcBPlus, "Process MC", false); - void processMcBs(HfMcRecRedJPPhis const& rowsJpsiPhiMcRec, HfRedBs2JpsiDaus const& Bs) + void processMcBs(HfMcRecRedJPPhis const& rowsJpsiPhiMcRec, HfRedBs2JpsiDaus const& bs) { - fillMcRec(rowsJpsiPhiMcRec, Bs); + fillMcRec(rowsJpsiPhiMcRec, bs); } PROCESS_SWITCH(HfCandidateCreatorBToJpsiReducedExpressions, processMcBs, "Process MC", false); }; diff --git a/PWGHF/D2H/TableProducer/candidateCreatorBplusReduced.cxx b/PWGHF/D2H/TableProducer/candidateCreatorBplusReduced.cxx index 1bcff8ae7ae..57c421c6721 100644 --- a/PWGHF/D2H/TableProducer/candidateCreatorBplusReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateCreatorBplusReduced.cxx @@ -120,7 +120,7 @@ struct HfCandidateCreatorBplusReduced { /// \param tracksPionThisCollision pion tracks in this collision /// \param invMass2D0PiMin minimum B+ invariant-mass /// \param invMass2D0PiMax maximum B+ invariant-mass - template + template void runCandidateCreation(Coll const& collision, Cands const& candsDThisColl, Pions const& tracksPionThisCollision, @@ -203,7 +203,7 @@ struct HfCandidateCreatorBplusReduced { rowCandidateProngs(candD0.globalIndex(), trackPion.globalIndex()); - if constexpr (withDmesMl) { + if constexpr (WithDmesMl) { if (trackPion.signed1Pt() < 0) { rowCandidateDmesMlScores(candD0.mlScoreBkgMassHypo0(), candD0.mlScorePromptMassHypo0(), candD0.mlScoreNonpromptMassHypo0()); } else { @@ -295,7 +295,7 @@ struct HfCandidateCreatorBplusReducedExpressions { /// \param checkDecayTypeMc /// \param rowsD0PiMcRec MC reco information on D0Pi pairs /// \param candsBplus prong global indices of B+ candidates - template + template void fillBplusMcRec(McRec const& rowsD0PiMcRec, HfRedBplusProngs const& candsBplus) { for (const auto& candBplus : candsBplus) { @@ -306,7 +306,7 @@ struct HfCandidateCreatorBplusReducedExpressions { } rowBplusMcRec(rowD0PiMcRec.flagMcMatchRec(), -1 /*channel*/, rowD0PiMcRec.flagWrongCollision(), rowD0PiMcRec.debugMcRec(), rowD0PiMcRec.ptMother()); filledMcInfo = true; - if constexpr (checkDecayTypeMc) { + if constexpr (CheckDecayTypeMc) { rowBplusMcCheck(rowD0PiMcRec.pdgCodeBeautyMother(), rowD0PiMcRec.pdgCodeCharmMother(), rowD0PiMcRec.pdgCodeProng0(), @@ -317,7 +317,7 @@ struct HfCandidateCreatorBplusReducedExpressions { } if (!filledMcInfo) { // protection to get same size tables in case something went wrong: we created a candidate that was not preselected in the D0-Pi creator rowBplusMcRec(0, -1, -1, -1, -1.f); - if constexpr (checkDecayTypeMc) { + if constexpr (CheckDecayTypeMc) { rowBplusMcCheck(-1, -1, -1, -1, -1); } } diff --git a/PWGHF/D2H/TableProducer/candidateCreatorBsReduced.cxx b/PWGHF/D2H/TableProducer/candidateCreatorBsReduced.cxx index 4a9ee3a9c57..f23c60e2432 100644 --- a/PWGHF/D2H/TableProducer/candidateCreatorBsReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateCreatorBsReduced.cxx @@ -116,7 +116,7 @@ struct HfCandidateCreatorBsReduced { /// \param tracksPionThisCollision pion tracks in this collision /// \param invMass2DPiMin minimum Bs invariant-mass /// \param invMass2DPiMax maximum Bs invariant-mass - template + template void runCandidateCreation(Coll const& collision, Cands const& candsDThisColl, Pions const& tracksPionThisCollision, @@ -203,7 +203,7 @@ struct HfCandidateCreatorBsReduced { rowCandidateProngs(candD.globalIndex(), trackPion.globalIndex()); - if constexpr (withDmesMl) { + if constexpr (WithDmesMl) { if (candD.invMassHypo0() > 0) { rowCandidateDmesMlScores(candD.mlScoreBkgMassHypo0(), candD.mlScorePromptMassHypo0(), candD.mlScoreNonpromptMassHypo0()); } else { @@ -295,7 +295,7 @@ struct HfCandidateCreatorBsReducedExpressions { /// \param checkDecayTypeMc /// \param rowsDPiMcRec MC reco information on DsPi pairs /// \param candsB prong global indices of Bs candidates - template + template void fillBsMcRec(McRec const& rowsDPiMcRec, HfRedBsProngs const& candsB) { for (const auto& candB : candsB) { @@ -306,7 +306,7 @@ struct HfCandidateCreatorBsReducedExpressions { } rowBsMcRec(rowDPiMcRec.flagMcMatchRec(), -1 /*channel*/, rowDPiMcRec.flagWrongCollision(), rowDPiMcRec.debugMcRec(), rowDPiMcRec.ptMother()); filledMcInfo = true; - if constexpr (checkDecayTypeMc) { + if constexpr (CheckDecayTypeMc) { rowBsMcCheck(rowDPiMcRec.pdgCodeBeautyMother(), rowDPiMcRec.pdgCodeCharmMother(), rowDPiMcRec.pdgCodeProng0(), @@ -318,7 +318,7 @@ struct HfCandidateCreatorBsReducedExpressions { } if (!filledMcInfo) { // protection to get same size tables in case something went wrong: we created a candidate that was not preselected in the DsPi creator rowBsMcRec(0, -1, -1, -1, -1.f); - if constexpr (checkDecayTypeMc) { + if constexpr (CheckDecayTypeMc) { rowBsMcCheck(-1, -1, -1, -1, -1, -1); } } diff --git a/PWGHF/D2H/TableProducer/candidateCreatorCharmResoReduced.cxx b/PWGHF/D2H/TableProducer/candidateCreatorCharmResoReduced.cxx index 618ac8db5a9..1b99908d3ea 100644 --- a/PWGHF/D2H/TableProducer/candidateCreatorCharmResoReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateCreatorCharmResoReduced.cxx @@ -63,11 +63,11 @@ enum Selections : uint8_t { }; enum D0Sel : uint8_t { - selectedD0 = 0, - selectedD0Bar + SelectedD0 = 0, + SelectedD0Bar }; -enum DType : uint8_t { +enum DMesonType : uint8_t { Dplus = 1, Dstar, D0 @@ -193,22 +193,22 @@ struct HfCandidateCreatorCharmResoReduced { /// Basic selection of D candidates /// \param candD is the reduced D meson candidate /// \return true if selections are passed - template + template uint8_t selctionFlagBachD(DRedTable const& candD) { - uint8_t selection = {BIT(D0Sel::selectedD0) | BIT(D0Sel::selectedD0Bar)}; + uint8_t selection = {BIT(D0Sel::SelectedD0) | BIT(D0Sel::SelectedD0Bar)}; float invMassD{0.}; float ptD = candD.pt(); int ptBin = findBin(cfgDmesCuts.binsPtD, ptD); if (ptBin == -1) { return 0; } - if constexpr (dType == DType::Dplus) { + if constexpr (DType == DMesonType::Dplus) { invMassD = candD.invMassDplus(); if (!isInMassInterval(invMassD, ptBin)) { return 0; } - } else if constexpr (dType == DType::Dstar) { + } else if constexpr (DType == DMesonType::Dstar) { if (candD.sign() > 0) { invMassD = candD.invMassDstar() - candD.invMassD0(); } else { @@ -217,22 +217,22 @@ struct HfCandidateCreatorCharmResoReduced { if (!isInMassInterval(invMassD, ptBin)) { return 0; } - } else if constexpr (dType == DType::D0) { - if (TESTBIT(candD.selFlagD0(), D0Sel::selectedD0)) { + } else if constexpr (DType == DMesonType::D0) { + if (TESTBIT(candD.selFlagD0(), D0Sel::SelectedD0)) { invMassD = candD.invMassD0(); if (!isInMassInterval(invMassD, ptBin)) { - CLRBIT(selection, D0Sel::selectedD0); + CLRBIT(selection, D0Sel::SelectedD0); } } else { - CLRBIT(selection, D0Sel::selectedD0); + CLRBIT(selection, D0Sel::SelectedD0); } - if (TESTBIT(candD.selFlagD0(), D0Sel::selectedD0Bar)) { + if (TESTBIT(candD.selFlagD0(), D0Sel::SelectedD0Bar)) { invMassD = candD.invMassD0Bar(); if (!isInMassInterval(invMassD, ptBin)) { - CLRBIT(selection, D0Sel::selectedD0Bar); + CLRBIT(selection, D0Sel::SelectedD0Bar); } } else { - CLRBIT(selection, D0Sel::selectedD0Bar); + CLRBIT(selection, D0Sel::SelectedD0Bar); } } return selection; @@ -349,7 +349,7 @@ struct HfCandidateCreatorCharmResoReduced { /// \param candV0Tr is the reduced V0 or track candidate /// \tparam dType is the type of D meson (Dplus, Dstar, D0) /// \tparam bachType is the type of bachelor (V0 or Track) - template + template void fillOutputTables(Coll const& collision, DRedTable const& candD, V0TrRedTable const& candV0Tr, @@ -372,10 +372,10 @@ struct HfCandidateCreatorCharmResoReduced { int8_t signReso{0}, isWrongSign{0}; double ptReso = RecoDecay::pt(RecoDecay::sumOfVec(pVecV0Tr, pVecD)); - if constexpr (dType == DType::Dplus) { + if constexpr (DType == DMesonType::Dplus) { invMassD = candD.invMassDplus(); pVectorCharmProngs.push_back(candD.pVectorProng2()); - if constexpr (bachType == BachelorType::V0) { + if constexpr (BachType == BachelorType::V0) { if (cfgV0Cuts.v0Type == V0Type::K0s) { // K0s invMassV0Tr = candV0Tr.invMassK0s(); signReso = candD.sign(); @@ -411,7 +411,7 @@ struct HfCandidateCreatorCharmResoReduced { registry.fill(HIST("hMassResoVsPt"), invMassReso, ptReso); registry.fill(HIST("hMassDmesDauVsPt"), invMassD, candD.pt()); registry.fill(HIST("hMassV0DauVsPt"), invMassV0Tr, candV0Tr.pt()); - } else if constexpr (bachType == BachelorType::Track) { + } else if constexpr (BachType == BachelorType::Track) { signReso = candD.sign() + candV0Tr.sign(); isWrongSign = candD.sign() * candV0Tr.sign() > 0 ? 1 : 0; if (cfgTrackCuts.massHypo == TrackType::Pion) { // Pion @@ -448,7 +448,7 @@ struct HfCandidateCreatorCharmResoReduced { registry.fill(HIST("hMassDmesDauVsPt"), invMassD, candD.pt()); registry.fill(HIST("hMassV0DauVsPt"), invMassV0Tr, candV0Tr.pt()); } - } else if constexpr (dType == DType::Dstar) { + } else if constexpr (DType == DMesonType::Dstar) { float invMassD0; if (candD.sign() > 0) { invMassD = candD.invMassDstar(); @@ -458,7 +458,7 @@ struct HfCandidateCreatorCharmResoReduced { invMassD0 = candD.invMassD0Bar(); } pVectorCharmProngs.push_back(candD.pVectorProng2()); - if constexpr (bachType == BachelorType::V0) { + if constexpr (BachType == BachelorType::V0) { signReso = candD.sign(); if (cfgV0Cuts.v0Type == V0Type::K0s) { // K0s invMassV0Tr = candV0Tr.invMassK0s(); @@ -499,7 +499,7 @@ struct HfCandidateCreatorCharmResoReduced { registry.fill(HIST("hMassResoVsPt"), invMassReso, ptReso); registry.fill(HIST("hMassDmesDauVsPt"), invMassD - invMassD0, candD.pt()); registry.fill(HIST("hMassV0DauVsPt"), invMassV0Tr, candV0Tr.pt()); - } else if constexpr (bachType == BachelorType::Track) { + } else if constexpr (BachType == BachelorType::Track) { signReso = candD.sign() + candV0Tr.sign(); isWrongSign = candD.sign() * candV0Tr.sign() > 0 ? 1 : 0; if (cfgTrackCuts.massHypo == TrackType::Pion) { // Pion @@ -548,11 +548,11 @@ struct HfCandidateCreatorCharmResoReduced { registry.fill(HIST("hMassDmesDauVsPt"), invMassD, candD.pt()); registry.fill(HIST("hMassV0DauVsPt"), invMassV0Tr, candV0Tr.pt()); } - } else if constexpr (dType == DType::D0) { + } else if constexpr (DType == DMesonType::D0) { // D0 - if (TESTBIT(selectionFlag, D0Sel::selectedD0)) { + if (TESTBIT(selectionFlag, D0Sel::SelectedD0)) { invMassD = candD.invMassD0(); - if constexpr (bachType == BachelorType::V0) { + if constexpr (BachType == BachelorType::V0) { signReso = 0; if (cfgV0Cuts.v0Type == V0Type::K0s) { // K0s invMassV0Tr = candV0Tr.invMassK0s(); @@ -585,7 +585,7 @@ struct HfCandidateCreatorCharmResoReduced { registry.fill(HIST("hMassResoVsPt"), invMassReso, ptReso); registry.fill(HIST("hMassDmesDauVsPt"), invMassD, candD.pt()); registry.fill(HIST("hMassV0DauVsPt"), invMassV0Tr, candV0Tr.pt()); - } else if constexpr (bachType == BachelorType::Track) { + } else if constexpr (BachType == BachelorType::Track) { signReso = candV0Tr.sign(); isWrongSign = candV0Tr.sign() > 0 ? 0 : 1; if (cfgTrackCuts.massHypo == TrackType::Pion) { // Pion @@ -624,9 +624,9 @@ struct HfCandidateCreatorCharmResoReduced { } } // D0bar - if (TESTBIT(selectionFlag, D0Sel::selectedD0Bar)) { + if (TESTBIT(selectionFlag, D0Sel::SelectedD0Bar)) { invMassD = candD.invMassD0Bar(); - if constexpr (bachType == BachelorType::V0) { + if constexpr (BachType == BachelorType::V0) { signReso = 0; if (cfgV0Cuts.v0Type == V0Type::K0s) { // K0s invMassV0Tr = candV0Tr.invMassK0s(); @@ -659,7 +659,7 @@ struct HfCandidateCreatorCharmResoReduced { registry.fill(HIST("hMassResoVsPt"), invMassReso, ptReso); registry.fill(HIST("hMassDmesDauVsPt"), invMassD, candD.pt()); registry.fill(HIST("hMassV0DauVsPt"), invMassV0Tr, candV0Tr.pt()); - } else if constexpr (bachType == BachelorType::Track) { + } else if constexpr (BachType == BachelorType::Track) { signReso = candV0Tr.sign(); isWrongSign = candV0Tr.sign() > 0 ? 1 : 0; if (cfgTrackCuts.massHypo == TrackType::Pion) { // Pion @@ -701,7 +701,7 @@ struct HfCandidateCreatorCharmResoReduced { } } - template + template void runCandidateCreation(Coll const& collision, DRedTable const& candsD, V0TrRedTable const& candsV0Tr) @@ -711,19 +711,19 @@ struct HfCandidateCreatorCharmResoReduced { for (const auto& candD : candsD) { // selection of D candidates registry.fill(HIST("hSelections"), 1); - uint8_t selFlagD = selctionFlagBachD(candD); + uint8_t selFlagD = selctionFlagBachD(candD); if (selFlagD == 0) { continue; } registry.fill(HIST("hSelections"), 1 + Selections::DSel); std::vector dDaughtersIDs = {candD.prong0Id(), candD.prong1Id()}; - if constexpr (dType == DType::Dstar || dType == DType::Dplus) { + if constexpr (DType == DMesonType::Dstar || DType == DMesonType::Dplus) { dDaughtersIDs.push_back(candD.prong2Id()); } // loop on V0 or track candidates bool alreadyCounted{false}; for (const auto& candV0Tr : candsV0Tr) { - if constexpr (bachType == BachelorType::V0) { // Case: V0 + if constexpr (BachType == BachelorType::V0) { // Case: V0 if (rejectPairsWithCommonDaughter && (std::find(dDaughtersIDs.begin(), dDaughtersIDs.end(), candV0Tr.prong0Id()) != dDaughtersIDs.end() || std::find(dDaughtersIDs.begin(), dDaughtersIDs.end(), candV0Tr.prong1Id()) != dDaughtersIDs.end())) { continue; } @@ -734,7 +734,7 @@ struct HfCandidateCreatorCharmResoReduced { registry.fill(HIST("hSelections"), 1 + Selections::BachSel); alreadyCounted = true; } - } else if constexpr (bachType == BachelorType::Track) { // Case: Track + } else if constexpr (BachType == BachelorType::Track) { // Case: Track if (rejectPairsWithCommonDaughter && std::find(dDaughtersIDs.begin(), dDaughtersIDs.end(), candV0Tr.trackId()) != dDaughtersIDs.end()) { continue; } @@ -747,7 +747,7 @@ struct HfCandidateCreatorCharmResoReduced { } } // Filling of tables and histograms - fillOutputTables(collision, candD, candV0Tr, selFlagD); + fillOutputTables(collision, candD, candV0Tr, selFlagD); } // end of loop on V0/Track candidates } // end of loop on D candidates } // end of function @@ -758,7 +758,7 @@ struct HfCandidateCreatorCharmResoReduced { /// \param Coll is the reduced collisions table /// \param DRedTable is the D bachelors table /// \param V0TrRedTable is the V0/Track bachelors table - template + template void runCandidateCreationMixedEvent(Coll const& collisions, DRedTable const& candsD, V0TrRedTable const& candsV0Tr) @@ -772,20 +772,20 @@ struct HfCandidateCreatorCharmResoReduced { registry.fill(HIST("hZvertCorr"), collision1.posZ(), collision2.posZ()); for (const auto& [bachD, bachV0Tr] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(bachDs, bachV0Trs))) { // Apply analysis selections on D and V0 bachelors - uint8_t selFlagD = selctionFlagBachD(bachD); + uint8_t selFlagD = selctionFlagBachD(bachD); if (selFlagD == 0) { continue; } - if constexpr (bachType == BachelorType::V0) { + if constexpr (BachType == BachelorType::V0) { if (!isV0Selected(bachV0Tr)) { continue; } - } else if constexpr (bachType == BachelorType::Track) { + } else if constexpr (BachType == BachelorType::Track) { if (!isTrackSelected(bachV0Tr)) { continue; } } - fillOutputTables(collision1, bachD, bachV0Tr, selFlagD); + fillOutputTables(collision1, bachD, bachV0Tr, selFlagD); } } } // runCandidateCreationMixedEvent @@ -799,7 +799,7 @@ struct HfCandidateCreatorCharmResoReduced { auto thisCollId = collision.globalIndex(); auto candsDThisColl = candsD.sliceBy(cands3PrPerCollision, thisCollId); auto v0sThisColl = candsV0.sliceBy(candsV0PerCollision, thisCollId); - runCandidateCreation(collision, candsDThisColl, v0sThisColl); + runCandidateCreation(collision, candsDThisColl, v0sThisColl); } } PROCESS_SWITCH(HfCandidateCreatorCharmResoReduced, process3ProngV0s, "Process resonances decaying in a 3 prong D meson and a V0", true); @@ -812,7 +812,7 @@ struct HfCandidateCreatorCharmResoReduced { auto thisCollId = collision.globalIndex(); auto candsDThisColl = candsD.sliceBy(candsDstarPerCollision, thisCollId); auto v0sThisColl = candsV0.sliceBy(candsV0PerCollision, thisCollId); - runCandidateCreation(collision, candsDThisColl, v0sThisColl); + runCandidateCreation(collision, candsDThisColl, v0sThisColl); } } PROCESS_SWITCH(HfCandidateCreatorCharmResoReduced, processDstarV0s, "Process resonances decaying in a Dstar meson and a V0", false); @@ -825,7 +825,7 @@ struct HfCandidateCreatorCharmResoReduced { auto thisCollId = collision.globalIndex(); auto candsDThisColl = candsD.sliceBy(cands2PrPerCollision, thisCollId); auto v0sThisColl = candsV0.sliceBy(candsV0PerCollision, thisCollId); - runCandidateCreation(collision, candsDThisColl, v0sThisColl); + runCandidateCreation(collision, candsDThisColl, v0sThisColl); } } PROCESS_SWITCH(HfCandidateCreatorCharmResoReduced, process2PrV0s, "Process resonances decaying in a 2 prong D meson and a V0", false); @@ -838,7 +838,7 @@ struct HfCandidateCreatorCharmResoReduced { auto thisCollId = collision.globalIndex(); auto candsDThisColl = candsD.sliceBy(cands3PrPerCollision, thisCollId); auto trksThisColl = candsTr.sliceBy(candsTrackPerCollision, thisCollId); - runCandidateCreation(collision, candsDThisColl, trksThisColl); + runCandidateCreation(collision, candsDThisColl, trksThisColl); } } PROCESS_SWITCH(HfCandidateCreatorCharmResoReduced, process3ProngTracks, "Process resonances decaying in a 3 prong D meson and a Track", false); @@ -851,7 +851,7 @@ struct HfCandidateCreatorCharmResoReduced { auto thisCollId = collision.globalIndex(); auto candsDThisColl = candsD.sliceBy(candsDstarPerCollision, thisCollId); auto trksThisColl = candsTr.sliceBy(candsTrackPerCollision, thisCollId); - runCandidateCreation(collision, candsDThisColl, trksThisColl); + runCandidateCreation(collision, candsDThisColl, trksThisColl); } } PROCESS_SWITCH(HfCandidateCreatorCharmResoReduced, processDstarTracks, "Process resonances decaying in a Dstar meson and a Track", false); @@ -864,7 +864,7 @@ struct HfCandidateCreatorCharmResoReduced { auto thisCollId = collision.globalIndex(); auto candsDThisColl = candsD.sliceBy(cands2PrPerCollision, thisCollId); auto trksThisColl = candsTr.sliceBy(candsTrackPerCollision, thisCollId); - runCandidateCreation(collision, candsDThisColl, trksThisColl); + runCandidateCreation(collision, candsDThisColl, trksThisColl); } } PROCESS_SWITCH(HfCandidateCreatorCharmResoReduced, process2PrTracks, "Process resonances decaying in a 2 prong D meson and a Track", false); @@ -874,7 +874,7 @@ struct HfCandidateCreatorCharmResoReduced { aod::HfRed3PrNoTrks const& candsD, aod::HfRedVzeros const& candsV0) { - runCandidateCreationMixedEvent(collisions, candsD, candsV0); + runCandidateCreationMixedEvent(collisions, candsD, candsV0); } PROCESS_SWITCH(HfCandidateCreatorCharmResoReduced, process3ProngV0sMixedEvent, "Process mixed events for resonances decaying in a 3 prong D meson and a V0", false); @@ -882,7 +882,7 @@ struct HfCandidateCreatorCharmResoReduced { aod::HfRedDstarNoTrks const& candsD, aod::HfRedVzeros const& candsV0) { - runCandidateCreationMixedEvent(collisions, candsD, candsV0); + runCandidateCreationMixedEvent(collisions, candsD, candsV0); } PROCESS_SWITCH(HfCandidateCreatorCharmResoReduced, processDstarV0sMixedEvent, "Process mixed events for resonances decaying in a Dstar meson and a V0", false); @@ -890,7 +890,7 @@ struct HfCandidateCreatorCharmResoReduced { aod::HfRed2PrNoTrks const& candsD, aod::HfRedVzeros const& candsV0) { - runCandidateCreationMixedEvent(collisions, candsD, candsV0); + runCandidateCreationMixedEvent(collisions, candsD, candsV0); } PROCESS_SWITCH(HfCandidateCreatorCharmResoReduced, process2PrV0sMixedEvent, "Process mixed events for resonances decaying in a 2 prong D meson and a V0", false); @@ -898,7 +898,7 @@ struct HfCandidateCreatorCharmResoReduced { aod::HfRed3PrNoTrks const& candsD, HfRedTrkNoParams const& candsTr) { - runCandidateCreationMixedEvent(collisions, candsD, candsTr); + runCandidateCreationMixedEvent(collisions, candsD, candsTr); } PROCESS_SWITCH(HfCandidateCreatorCharmResoReduced, process3ProngTracksMixedEvent, "Process mixed events for resonances decaying in a 3 prong D meson and a Track", false); @@ -906,7 +906,7 @@ struct HfCandidateCreatorCharmResoReduced { aod::HfRedDstarNoTrks const& candsD, HfRedTrkNoParams const& candsTr) { - runCandidateCreationMixedEvent(collisions, candsD, candsTr); + runCandidateCreationMixedEvent(collisions, candsD, candsTr); } PROCESS_SWITCH(HfCandidateCreatorCharmResoReduced, processDstarTracksMixedEvent, "Process mixed events for resonances decaying in a Dstar meson and a Track", false); @@ -914,7 +914,7 @@ struct HfCandidateCreatorCharmResoReduced { aod::HfRed2PrNoTrks const& candsD, HfRedTrkNoParams const& candsTr) { - runCandidateCreationMixedEvent(collisions, candsD, candsTr); + runCandidateCreationMixedEvent(collisions, candsD, candsTr); } PROCESS_SWITCH(HfCandidateCreatorCharmResoReduced, process2PrTracksMixedEvent, "Process mixed events for resonances decaying in a 2 prong D meson and a Track", false); diff --git a/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx b/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx index 6bdd1e8c881..f63f3f8ecc4 100644 --- a/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx @@ -134,7 +134,7 @@ struct HfCandidateCreatorLbReduced { /// \param tracksPionThisCollision pion tracks in this collision /// \param invMass2LcPiMin minimum Lb invariant-mass /// \param invMass2LcPiMax maximum Lb invariant-mass - template + template void runCandidateCreation(Coll const& collision, Cands const& candsLcThisColl, Pions const& tracksPionThisCollision, @@ -223,7 +223,7 @@ struct HfCandidateCreatorLbReduced { rowCandidateProngs(candLc.globalIndex(), trackPion.globalIndex()); - if constexpr (withLcMl) { + if constexpr (WithLcMl) { if (candLc.invMassHypo0() > 0) { rowCandidateLcMlScores(candLc.mlScoreBkgMassHypo0(), candLc.mlScorePromptMassHypo0(), candLc.mlScoreNonpromptMassHypo0()); } else { @@ -308,7 +308,7 @@ struct HfCandidateCreatorLbReducedExpressions { /// \param checkDecayTypeMc /// \param rowsLcPiMcRec MC reco information on LcPi pairs /// \param candsLb prong global indices of Lb candidates - template + template void fillLbMcRec(McRec const& rowsLcPiMcRec, HfRedLbProngs const& candsLb) { for (const auto& candLb : candsLb) { @@ -319,7 +319,7 @@ struct HfCandidateCreatorLbReducedExpressions { } rowLbMcRec(rowLcPiMcRec.flagMcMatchRec(), rowLcPiMcRec.flagWrongCollision(), rowLcPiMcRec.debugMcRec(), rowLcPiMcRec.ptMother()); filledMcInfo = true; - if constexpr (checkDecayTypeMc) { + if constexpr (CheckDecayTypeMc) { rowLbMcCheck(rowLcPiMcRec.pdgCodeBeautyMother(), rowLcPiMcRec.pdgCodeCharmMother(), rowLcPiMcRec.pdgCodeProng0(), @@ -331,7 +331,7 @@ struct HfCandidateCreatorLbReducedExpressions { } if (!filledMcInfo) { // protection to get same size tables in case something went wrong: we created a candidate that was not preselected in the LcPi creator rowLbMcRec(0, -1, -1, -1.f); - if constexpr (checkDecayTypeMc) { + if constexpr (CheckDecayTypeMc) { rowLbMcCheck(-1, -1, -1, -1, -1, -1); } } diff --git a/PWGHF/D2H/TableProducer/candidateSelectorB0ToDPiReduced.cxx b/PWGHF/D2H/TableProducer/candidateSelectorB0ToDPiReduced.cxx index 18cf281a21c..4dfda7909c0 100644 --- a/PWGHF/D2H/TableProducer/candidateSelectorB0ToDPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateSelectorB0ToDPiReduced.cxx @@ -170,11 +170,11 @@ struct HfCandidateSelectorB0ToDPiReduced { /// \param candidate is the B0 candidate /// \param prongBachPi is the candidate's bachelor pion prong /// \note this method is used for B0 → D*- π+ candidates with D meson ML scores - template + template auto getMlInputFeatures(const T1& candB0, const T2& prongBachPi) { auto prongSoftPi = candB0.template prongSoftPi_as(); - if constexpr (withDmesMl) { + if constexpr (WithDmesMl) { return hfMlResponse.getInputFeaturesDStarPi(candB0, prongBachPi, prongSoftPi); } else { return hfMlResponse.getInputFeaturesDStarPi(candB0, prongBachPi, prongSoftPi); @@ -195,10 +195,10 @@ struct HfCandidateSelectorB0ToDPiReduced { /// \param candB0 is the B0 candidate /// \param prongBachPi is the candidate's bachelor pion prong /// \note this method is used for B0 → D- π+ candidates with D meson ML scores - template + template auto getMlInputFeatures(const T1& candB0, const T2& prongBachPi) { - if constexpr (withDmesMl) { + if constexpr (WithDmesMl) { return hfMlResponse.getInputFeatures(candB0, prongBachPi); } else { return hfMlResponse.getInputFeatures(candB0, prongBachPi); @@ -210,7 +210,7 @@ struct HfCandidateSelectorB0ToDPiReduced { /// \param hfCandsB0 B0 candidates /// \param pionTracks pion tracks /// \param configs config inherited from the Dpi data creator - template + template void runSelection(Cands const& hfCandsB0, TracksBachPion const&, HfCandB0Configs const& configs) @@ -239,7 +239,7 @@ struct HfCandidateSelectorB0ToDPiReduced { continue; } - if constexpr (withDmesMl) { // we include it in the topological selections + if constexpr (WithDmesMl) { // we include it in the topological selections if (!hfHelper.selectionDmesMlScoresForBReduced(hfCandB0, cutsDmesMl, binsPtDmesMl)) { hfSelB0ToDPiCandidate(statusB0ToDPi); if (applyB0Ml) { @@ -278,7 +278,7 @@ struct HfCandidateSelectorB0ToDPiReduced { } if (applyB0Ml) { // B0 ML selections - std::vector inputFeatures = getMlInputFeatures(hfCandB0, trackBachPi); + std::vector inputFeatures = getMlInputFeatures(hfCandB0, trackBachPi); bool isSelectedMl = hfMlResponse.isSelectedMl(inputFeatures, ptCandB0, outputMl); hfMlB0ToDPiCandidate(outputMl[1]); // storing ML score for signal class diff --git a/PWGHF/D2H/TableProducer/candidateSelectorBplusToD0PiReduced.cxx b/PWGHF/D2H/TableProducer/candidateSelectorBplusToD0PiReduced.cxx index d67af343e8b..6ab03c85970 100644 --- a/PWGHF/D2H/TableProducer/candidateSelectorBplusToD0PiReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateSelectorBplusToD0PiReduced.cxx @@ -160,7 +160,7 @@ struct HfCandidateSelectorBplusToD0PiReduced { /// \param hfCandsBp B+ candidates /// \param pionTracks pion tracks /// \param configs config inherited from the D0pi data creator - template + template void runSelection(Cands const& hfCandsBp, TracksPion const& /*pionTracks*/, HfCandBpConfigs const& configs) @@ -190,7 +190,7 @@ struct HfCandidateSelectorBplusToD0PiReduced { continue; } - if constexpr (withDmesMl) { // we include it in the topological selections + if constexpr (WithDmesMl) { // we include it in the topological selections if (!hfHelper.selectionDmesMlScoresForBReduced(hfCandBp, cutsDmesMl, binsPtDmesMl)) { hfSelBplusToD0PiCandidate(statusBplus); if (applyBplusMl) { @@ -230,7 +230,7 @@ struct HfCandidateSelectorBplusToD0PiReduced { } if (applyBplusMl) { // B+ ML selections - std::vector inputFeatures = hfMlResponse.getInputFeatures(hfCandBp, trackPi); + std::vector inputFeatures = hfMlResponse.getInputFeatures(hfCandBp, trackPi); bool isSelectedMl = hfMlResponse.isSelectedMl(inputFeatures, ptCandBplus, outputMl); hfMlBplusToD0PiCandidate(outputMl[1]); // storing ML score for signal class diff --git a/PWGHF/D2H/TableProducer/candidateSelectorBsToDsPiReduced.cxx b/PWGHF/D2H/TableProducer/candidateSelectorBsToDsPiReduced.cxx index c795c4ea964..6a4bd65ccda 100644 --- a/PWGHF/D2H/TableProducer/candidateSelectorBsToDsPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateSelectorBsToDsPiReduced.cxx @@ -156,7 +156,7 @@ struct HfCandidateSelectorBsToDsPiReduced { /// \param hfCandsBs Bs candidates /// \param pionTracks pion tracks /// \param configs config inherited from the charm-hadron data creator - template + template void runSelection(Cands const& hfCandsBs, TracksPion const&, HfCandBsConfigs const&) @@ -180,7 +180,7 @@ struct HfCandidateSelectorBsToDsPiReduced { continue; } - if constexpr (withDmesMl) { // we include it in the topological selections + if constexpr (WithDmesMl) { // we include it in the topological selections if (!hfHelper.selectionDmesMlScoresForBReduced(hfCandBs, cutsDmesMl, binsPtDmesMl)) { hfSelBsToDsPiCandidate(statusBsToDsPi); if (applyBsMl) { @@ -219,7 +219,7 @@ struct HfCandidateSelectorBsToDsPiReduced { if (applyBsMl) { // Bs ML selections - std::vector inputFeatures = hfMlResponse.getInputFeatures(hfCandBs, trackPi); + std::vector inputFeatures = hfMlResponse.getInputFeatures(hfCandBs, trackPi); bool isSelectedMl = hfMlResponse.isSelectedMl(inputFeatures, ptCandBs, outputMl); hfMlBsToDsPiCandidate(outputMl); diff --git a/PWGHF/D2H/TableProducer/candidateSelectorLbToLcPiReduced.cxx b/PWGHF/D2H/TableProducer/candidateSelectorLbToLcPiReduced.cxx index 3a67cdffce6..e99a6983c3f 100644 --- a/PWGHF/D2H/TableProducer/candidateSelectorLbToLcPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateSelectorLbToLcPiReduced.cxx @@ -157,7 +157,7 @@ struct HfCandidateSelectorLbToLcPiReduced { /// \param hfCandsLb Lb candidates /// \param pionTracks pion tracks /// \param configs config inherited from the charm-hadron data creator - template + template void runSelection(Cands const& hfCandsLb, TracksPion const&, HfCandLbConfigs const&) @@ -181,7 +181,7 @@ struct HfCandidateSelectorLbToLcPiReduced { continue; } - if constexpr (withLcMl) { // we include it in the topological selections + if constexpr (WithLcMl) { // we include it in the topological selections if (!hfHelper.selectionDmesMlScoresForBReduced(hfCandLb, cutsLcMl, binsPtLcMl)) { hfSelLbToLcPiCandidate(statusLbToLcPi); if (applyLbMl) { @@ -220,7 +220,7 @@ struct HfCandidateSelectorLbToLcPiReduced { if (applyLbMl) { // Lb ML selections - std::vector inputFeatures = hfMlResponse.getInputFeatures(hfCandLb, trackPi); + std::vector inputFeatures = hfMlResponse.getInputFeatures(hfCandLb, trackPi); bool isSelectedMl = hfMlResponse.isSelectedMl(inputFeatures, ptCandLb, outputMl); hfMlLbToLcPiCandidate(outputMl[1]); diff --git a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx index 6a8bf45bd7a..a6e80ef7948 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx @@ -481,7 +481,7 @@ struct HfDataCreatorCharmHadPiReduced { /// \param vecDaughtersB is the vector with all daughter tracks (bachelor pion in last position) /// \param indexHfCandCharm is the index of the charm-hadron candidate /// \param selectedTracksPion is the map with the indices of selected bachelor pion tracks - template + template void fillMcRecoInfo(const CColl& collision, const PParticles& particlesMc, const std::vector& vecDaughtersB, @@ -504,7 +504,7 @@ struct HfDataCreatorCharmHadPiReduced { int pdgCodeProng3{0}; float motherPt{-1.f}; - if constexpr (decChannel == DecayChannel::B0ToDminusPi) { + if constexpr (DecChannel == DecayChannel::B0ToDminusPi) { // B0 → D- π+ → (π- K+ π-) π+ auto indexRec = RecoDecay::getMatchedMCRec(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[1], vecDaughtersB[2], vecDaughtersB[3]}, Pdg::kB0, std::array{-kPiPlus, +kKPlus, -kPiPlus, +kPiPlus}, true, &sign, 3); if (indexRec > -1) { @@ -618,7 +618,7 @@ struct HfDataCreatorCharmHadPiReduced { tables.rowHfDPiMcCheckReduced(pdgCodeBeautyMother, pdgCodeCharmMother, pdgCodeProng0, pdgCodeProng1, pdgCodeProng2, pdgCodeProng3); } tables.rowHfDPiMcRecReduced(indexHfCandCharm, selectedTracksPion[vecDaughtersB.back().globalIndex()], flag, flagWrongCollision, debug, motherPt); - } else if constexpr (decChannel == DecayChannel::BsToDsminusPi) { + } else if constexpr (DecChannel == DecayChannel::BsToDsminusPi) { // Bs → Ds- π+ → (K- K+ π-) π+ auto indexRec = RecoDecay::getMatchedMCRec(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[1], vecDaughtersB[2], vecDaughtersB[3]}, Pdg::kBS, std::array{-kKPlus, +kKPlus, -kPiPlus, +kPiPlus}, true, &sign, 3); if (indexRec > -1) { @@ -773,7 +773,7 @@ struct HfDataCreatorCharmHadPiReduced { tables.rowHfDsPiMcCheckReduced(pdgCodeBeautyMother, pdgCodeCharmMother, pdgCodeProng0, pdgCodeProng1, pdgCodeProng2, pdgCodeProng3); } tables.rowHfDsPiMcRecReduced(indexHfCandCharm, selectedTracksPion[vecDaughtersB.back().globalIndex()], flag, flagWrongCollision, debug, motherPt); - } else if constexpr (decChannel == DecayChannel::BplusToD0barPi) { + } else if constexpr (DecChannel == DecayChannel::BplusToD0barPi) { // B+ → D0(bar) π+ → (K+ π-) π+ auto indexRec = RecoDecay::getMatchedMCRec(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[1], vecDaughtersB[2]}, Pdg::kBPlus, std::array{+kPiPlus, +kKPlus, -kPiPlus}, true, &sign, 2); if (indexRec > -1) { @@ -870,7 +870,7 @@ struct HfDataCreatorCharmHadPiReduced { tables.rowHfD0PiMcCheckReduced(pdgCodeBeautyMother, pdgCodeCharmMother, pdgCodeProng0, pdgCodeProng1, pdgCodeProng2); } tables.rowHfD0PiMcRecReduced(indexHfCandCharm, selectedTracksPion[vecDaughtersB.back().globalIndex()], flag, flagWrongCollision, debug, motherPt); - } else if constexpr (decChannel == DecayChannel::LbToLcplusPi) { + } else if constexpr (DecChannel == DecayChannel::LbToLcplusPi) { // Lb → Lc+ π- → (p K- π+) π- auto indexRec = RecoDecay::getMatchedMCRec(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[1], vecDaughtersB[2], vecDaughtersB[3]}, Pdg::kLambdaB0, std::array{+kProton, -kKPlus, +kPiPlus, -kPiPlus}, true, &sign, 3); if (indexRec > -1) { @@ -974,7 +974,7 @@ struct HfDataCreatorCharmHadPiReduced { tables.rowHfLcPiMcCheckReduced(pdgCodeBeautyMother, pdgCodeCharmMother, pdgCodeProng0, pdgCodeProng1, pdgCodeProng2, pdgCodeProng3); } tables.rowHfLcPiMcRecReduced(indexHfCandCharm, selectedTracksPion[vecDaughtersB.back().globalIndex()], flag, flagWrongCollision, debug, motherPt); - } else if constexpr (decChannel == DecayChannel::B0ToDstarPi) { + } else if constexpr (DecChannel == DecayChannel::B0ToDstarPi) { // B0 → D*+ π- → (D0 π+) π- → (K- π+ π+) π- auto indexRec = RecoDecay::getMatchedMCRec(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[1], vecDaughtersB[2], vecDaughtersB[3]}, Pdg::kB0, std::array{+kKPlus, -kPiPlus, -kPiPlus, +kPiPlus}, true, &sign, 4); if (indexRec > -1) { @@ -1014,7 +1014,7 @@ struct HfDataCreatorCharmHadPiReduced { } } - template + template void runDataCreation(Coll const& collision, CCharmCands const& candsC, aod::TrackAssoc const& trackIndices, @@ -1061,13 +1061,13 @@ struct HfDataCreatorCharmHadPiReduced { for (const auto& candC : candsC) { int indexHfCandCharm{-1}; float invMassC0{-1.f}, invMassC1{-1.f}; - if constexpr (decChannel == DecayChannel::B0ToDminusPi) { + if constexpr (DecChannel == DecayChannel::B0ToDminusPi) { indexHfCandCharm = tables.hfCand3Prong.lastIndex() + 1; invMassC0 = hfHelper.invMassDplusToPiKPi(candC); registry.fill(HIST("hMassDplus"), invMassC0); registry.fill(HIST("hPtDplus"), candC.pt()); registry.fill(HIST("hCpaDplus"), candC.cpa()); - } else if constexpr (decChannel == DecayChannel::BsToDsminusPi) { + } else if constexpr (DecChannel == DecayChannel::BsToDsminusPi) { indexHfCandCharm = tables.hfCand3Prong.lastIndex() + 1; if (candC.isSelDsToKKPi() >= hfflagConfigurations.selectionFlagDs) { invMassC0 = hfHelper.invMassDsToKKPi(candC); @@ -1079,7 +1079,7 @@ struct HfDataCreatorCharmHadPiReduced { } registry.fill(HIST("hPtDs"), candC.pt()); registry.fill(HIST("hCpaDs"), candC.cpa()); - } else if constexpr (decChannel == DecayChannel::BplusToD0barPi) { + } else if constexpr (DecChannel == DecayChannel::BplusToD0barPi) { indexHfCandCharm = tables.hfCand2Prong.lastIndex() + 1; if (candC.isSelD0() >= hfflagConfigurations.selectionFlagD0) { invMassC0 = hfHelper.invMassD0ToPiK(candC); @@ -1091,7 +1091,7 @@ struct HfDataCreatorCharmHadPiReduced { } registry.fill(HIST("hPtD0"), candC.pt()); registry.fill(HIST("hCpaD0"), candC.cpa()); - } else if constexpr (decChannel == DecayChannel::LbToLcplusPi) { + } else if constexpr (DecChannel == DecayChannel::LbToLcplusPi) { indexHfCandCharm = tables.hfCand3Prong.lastIndex() + 1; if (candC.isSelLcToPKPi() >= hfflagConfigurations.selectionFlagLc) { invMassC0 = hfHelper.invMassLcToPKPi(candC); @@ -1103,7 +1103,7 @@ struct HfDataCreatorCharmHadPiReduced { } registry.fill(HIST("hPtLc"), candC.pt()); registry.fill(HIST("hCpaLc"), candC.cpa()); - } else if constexpr (decChannel == DecayChannel::B0ToDstarPi) { + } else if constexpr (DecChannel == DecayChannel::B0ToDstarPi) { indexHfCandCharm = tables.hfCand2Prong.lastIndex() + 1; if (candC.signSoftPi() > 0) { invMassC0 = candC.invMassDstar() - candC.invMassD0(); @@ -1138,8 +1138,8 @@ struct HfDataCreatorCharmHadPiReduced { } // third track, if it's a 3-prong - if constexpr (decChannel == DecayChannel::B0ToDminusPi || decChannel == DecayChannel::BsToDsminusPi || decChannel == DecayChannel::LbToLcplusPi || decChannel == DecayChannel::B0ToDstarPi) { - if constexpr (decChannel == DecayChannel::B0ToDstarPi) { + if constexpr (DecChannel == DecayChannel::B0ToDminusPi || DecChannel == DecayChannel::BsToDsminusPi || DecChannel == DecayChannel::LbToLcplusPi || DecChannel == DecayChannel::B0ToDstarPi) { + if constexpr (DecChannel == DecayChannel::B0ToDstarPi) { charmHadDauTracks.push_back(candC.template prongPi_as()); // Soft pion from D* decay } else { charmHadDauTracks.push_back(candC.template prong2_as()); @@ -1157,13 +1157,13 @@ struct HfDataCreatorCharmHadPiReduced { // reconstruct charm candidate secondary vertex o2::track::TrackParCov trackParCovCharmHad{}; std::array pVecCharm{}; - if constexpr (decChannel == DecayChannel::B0ToDminusPi || decChannel == DecayChannel::BsToDsminusPi || decChannel == DecayChannel::LbToLcplusPi) { // D∓ → π∓ K± π∓ and Ds∓ → K∓ K± π∓ and Lc∓ → p∓ K± π∓ + if constexpr (DecChannel == DecayChannel::B0ToDminusPi || DecChannel == DecayChannel::BsToDsminusPi || DecChannel == DecayChannel::LbToLcplusPi) { // D∓ → π∓ K± π∓ and Ds∓ → K∓ K± π∓ and Lc∓ → p∓ K± π∓ - if constexpr (decChannel == DecayChannel::B0ToDminusPi) { + if constexpr (DecChannel == DecayChannel::B0ToDminusPi) { hCandidatesDPlus->Fill(SVFitting::BeforeFit); - } else if constexpr (decChannel == DecayChannel::BsToDsminusPi) { + } else if constexpr (DecChannel == DecayChannel::BsToDsminusPi) { hCandidatesDs->Fill(SVFitting::BeforeFit); - } else if constexpr (decChannel == DecayChannel::LbToLcplusPi) { + } else if constexpr (DecChannel == DecayChannel::LbToLcplusPi) { hCandidatesLc->Fill(SVFitting::BeforeFit); } @@ -1173,20 +1173,20 @@ struct HfDataCreatorCharmHadPiReduced { } } catch (const std::runtime_error& error) { LOG(info) << "Run time error found: " << error.what() << ". DCAFitterN cannot work, skipping the candidate."; - if constexpr (decChannel == DecayChannel::B0ToDminusPi) { + if constexpr (DecChannel == DecayChannel::B0ToDminusPi) { hCandidatesDPlus->Fill(SVFitting::Fail); - } else if constexpr (decChannel == DecayChannel::BsToDsminusPi) { + } else if constexpr (DecChannel == DecayChannel::BsToDsminusPi) { hCandidatesDs->Fill(SVFitting::Fail); - } else if constexpr (decChannel == DecayChannel::LbToLcplusPi) { + } else if constexpr (DecChannel == DecayChannel::LbToLcplusPi) { hCandidatesLc->Fill(SVFitting::Fail); } continue; } - if constexpr (decChannel == DecayChannel::B0ToDminusPi) { + if constexpr (DecChannel == DecayChannel::B0ToDminusPi) { hCandidatesDPlus->Fill(SVFitting::FitOk); - } else if constexpr (decChannel == DecayChannel::BsToDsminusPi) { + } else if constexpr (DecChannel == DecayChannel::BsToDsminusPi) { hCandidatesDs->Fill(SVFitting::FitOk); - } else if constexpr (decChannel == DecayChannel::LbToLcplusPi) { + } else if constexpr (DecChannel == DecayChannel::LbToLcplusPi) { hCandidatesLc->Fill(SVFitting::FitOk); } @@ -1200,7 +1200,7 @@ struct HfDataCreatorCharmHadPiReduced { pVecCharm = RecoDecay::pVec(pVec0, pVec1, pVec2); trackParCovCharmHad = df3.createParentTrackParCov(); trackParCovCharmHad.setAbsCharge(charmHadDauTracks[1].sign()); // to be sure - } else if constexpr (decChannel == DecayChannel::BplusToD0barPi) { // D0(bar) → K± π∓ + } else if constexpr (DecChannel == DecayChannel::BplusToD0barPi) { // D0(bar) → K± π∓ hCandidatesD0->Fill(SVFitting::BeforeFit); try { @@ -1222,7 +1222,7 @@ struct HfDataCreatorCharmHadPiReduced { pVecCharm = RecoDecay::pVec(pVec0, pVec1); trackParCovCharmHad = df2.createParentTrackParCov(); trackParCovCharmHad.setAbsCharge(0); // to be sure - } else if constexpr (decChannel == DecayChannel::B0ToDstarPi) { + } else if constexpr (DecChannel == DecayChannel::B0ToDstarPi) { hCandidatesD0FromDstar->Fill(SVFitting::BeforeFit); try { @@ -1279,15 +1279,15 @@ struct HfDataCreatorCharmHadPiReduced { } // reject pi D with same sign as D - if constexpr (decChannel == DecayChannel::B0ToDminusPi || decChannel == DecayChannel::BsToDsminusPi || decChannel == DecayChannel::LbToLcplusPi) { // D∓ → π∓ K± π∓ and Ds∓ → K∓ K± π∓ and Lc∓ → p∓ K± π∓ + if constexpr (DecChannel == DecayChannel::B0ToDminusPi || DecChannel == DecayChannel::BsToDsminusPi || DecChannel == DecayChannel::LbToLcplusPi) { // D∓ → π∓ K± π∓ and Ds∓ → K∓ K± π∓ and Lc∓ → p∓ K± π∓ if (trackPion.sign() * charmHadDauTracks[0].sign() > 0) { continue; } - } else if constexpr (decChannel == DecayChannel::BplusToD0barPi) { // D0(bar) → K± π∓ + } else if constexpr (DecChannel == DecayChannel::BplusToD0barPi) { // D0(bar) → K± π∓ if (!((candC.isSelD0() >= hfflagConfigurations.selectionFlagD0 && trackPion.sign() < 0) || (candC.isSelD0bar() >= hfflagConfigurations.selectionFlagD0bar && trackPion.sign() > 0))) { continue; } - } else if constexpr (decChannel == DecayChannel::B0ToDstarPi) { // D*+ → D0 π+ + } else if constexpr (DecChannel == DecayChannel::B0ToDstarPi) { // D*+ → D0 π+ if (trackPion.sign() * charmHadDauTracks.back().sign() > 0) { continue; } @@ -1328,20 +1328,20 @@ struct HfDataCreatorCharmHadPiReduced { selectedTracksPion[trackPion.globalIndex()] = tables.hfTrackPion.lastIndex(); } - if constexpr (doMc) { + if constexpr (DoMc) { std::vector beautyHadDauTracks{}; beautyHadDauTracks.reserve(charmHadDauTracks.size()); for (const auto& track : charmHadDauTracks) { beautyHadDauTracks.push_back(track); } beautyHadDauTracks.push_back(trackPion); - fillMcRecoInfo(collision, particlesMc, beautyHadDauTracks, indexHfCandCharm, selectedTracksPion, indexCollisionMaxNumContrib); + fillMcRecoInfo(collision, particlesMc, beautyHadDauTracks, indexHfCandCharm, selectedTracksPion, indexCollisionMaxNumContrib); } fillHfCandCharm = true; } // pion loop if (fillHfCandCharm) { // fill candCplus table only once per D candidate constexpr std::size_t NSizeMLScore{3u}; - if constexpr (decChannel == DecayChannel::B0ToDminusPi || decChannel == DecayChannel::BsToDsminusPi || decChannel == DecayChannel::LbToLcplusPi) { // D∓ → π∓ K± π∓ and Ds∓ → K∓ K± π∓ and Lc∓ → p∓ K± π∓ + if constexpr (DecChannel == DecayChannel::B0ToDminusPi || DecChannel == DecayChannel::BsToDsminusPi || DecChannel == DecayChannel::LbToLcplusPi) { // D∓ → π∓ K± π∓ and Ds∓ → K∓ K± π∓ and Lc∓ → p∓ K± π∓ tables.hfCand3Prong(charmHadDauTracks[0].globalIndex(), charmHadDauTracks[1].globalIndex(), charmHadDauTracks[2].globalIndex(), indexHfReducedCollision, trackParCovCharmHad.getX(), trackParCovCharmHad.getAlpha(), @@ -1357,7 +1357,7 @@ struct HfDataCreatorCharmHadPiReduced { trackParCovCharmHad.getSigma1PtTgl(), trackParCovCharmHad.getSigma1Pt2()); float nSigmaTpcPr0{-999.f}, nSigmaTpcPr1{-999.f}, nSigmaTpcPr2{-999.f}; float nSigmaTofPr0{-999.f}, nSigmaTofPr1{-999.f}, nSigmaTofPr2{-999.f}; - if constexpr (decChannel == DecayChannel::LbToLcplusPi) { + if constexpr (DecChannel == DecayChannel::LbToLcplusPi) { /// assign non-dummy values only for Lb->LcPi analysis nSigmaTpcPr0 = candC.nSigTpcPr0(); nSigmaTpcPr1 = candC.nSigTpcPr1(); @@ -1369,11 +1369,11 @@ struct HfDataCreatorCharmHadPiReduced { tables.hfCandPidProng0(candC.nSigTpcPi0(), candC.nSigTofPi0(), candC.nSigTpcKa0(), candC.nSigTofKa0(), nSigmaTpcPr0, nSigmaTofPr0, charmHadDauTracks[0].hasTOF(), charmHadDauTracks[0].hasTPC()); tables.hfCandPidProng1(candC.nSigTpcPi1(), candC.nSigTofPi1(), candC.nSigTpcKa1(), candC.nSigTofKa1(), nSigmaTpcPr1, nSigmaTofPr1, charmHadDauTracks[1].hasTOF(), charmHadDauTracks[1].hasTPC()); tables.hfCandPidProng2(candC.nSigTpcPi2(), candC.nSigTofPi2(), candC.nSigTpcKa2(), candC.nSigTofKa2(), nSigmaTpcPr2, nSigmaTofPr2, charmHadDauTracks[2].hasTOF(), charmHadDauTracks[2].hasTPC()); - if constexpr (withMl) { + if constexpr (WithMl) { std::array mlScores = {-1.f, -1.f, -1.f, -1.f, -1.f, -1.f}; - if constexpr (decChannel == DecayChannel::B0ToDminusPi) { + if constexpr (DecChannel == DecayChannel::B0ToDminusPi) { tables.hfCand3ProngMl(candC.mlProbDplusToPiKPi()[0], candC.mlProbDplusToPiKPi()[1], candC.mlProbDplusToPiKPi()[2], -1., -1., -1.); - } else if constexpr (decChannel == DecayChannel::BsToDsminusPi) { + } else if constexpr (DecChannel == DecayChannel::BsToDsminusPi) { if (candC.mlProbDsToKKPi().size() == NSizeMLScore) { std::copy(candC.mlProbDsToKKPi().begin(), candC.mlProbDsToKKPi().end(), mlScores.begin()); } @@ -1381,7 +1381,7 @@ struct HfDataCreatorCharmHadPiReduced { std::copy(candC.mlProbDsToPiKK().begin(), candC.mlProbDsToPiKK().end(), mlScores.begin() + 3); } tables.hfCand3ProngMl(mlScores[0], mlScores[1], mlScores[2], mlScores[3], mlScores[4], mlScores[5]); - } else if constexpr (decChannel == DecayChannel::LbToLcplusPi) { + } else if constexpr (DecChannel == DecayChannel::LbToLcplusPi) { if (candC.mlProbLcToPKPi().size() == NSizeMLScore) { std::copy(candC.mlProbLcToPKPi().begin(), candC.mlProbLcToPKPi().end(), mlScores.begin()); } @@ -1391,7 +1391,7 @@ struct HfDataCreatorCharmHadPiReduced { tables.hfCand3ProngMl(mlScores[0], mlScores[1], mlScores[2], mlScores[3], mlScores[4], mlScores[5]); } } - } else if constexpr (decChannel == DecayChannel::BplusToD0barPi) { // D0(bar) → K± π∓ + } else if constexpr (DecChannel == DecayChannel::BplusToD0barPi) { // D0(bar) → K± π∓ tables.hfCand2Prong(charmHadDauTracks[0].globalIndex(), charmHadDauTracks[1].globalIndex(), indexHfReducedCollision, trackParCovCharmHad.getX(), trackParCovCharmHad.getAlpha(), @@ -1407,7 +1407,7 @@ struct HfDataCreatorCharmHadPiReduced { trackParCovCharmHad.getSigma1PtTgl(), trackParCovCharmHad.getSigma1Pt2()); tables.hfCandPidProng0(candC.nSigTpcPi0(), candC.nSigTofPi0(), candC.nSigTpcKa0(), candC.nSigTofKa0(), 0., 0., charmHadDauTracks[0].hasTOF(), charmHadDauTracks[0].hasTPC()); tables.hfCandPidProng1(candC.nSigTpcPi1(), candC.nSigTofPi1(), candC.nSigTpcKa1(), candC.nSigTofKa1(), 0., 0., charmHadDauTracks[1].hasTOF(), charmHadDauTracks[1].hasTPC()); - if constexpr (withMl) { + if constexpr (WithMl) { std::array mlScores = {-1.f, -1.f, -1.f, -1.f, -1.f, -1.f}; if (candC.mlProbD0().size() == NSizeMLScore) { std::copy(candC.mlProbD0().begin(), candC.mlProbD0().end(), mlScores.begin()); @@ -1417,7 +1417,7 @@ struct HfDataCreatorCharmHadPiReduced { } tables.hfCand2ProngMl(mlScores[0], mlScores[1], mlScores[2], mlScores[3], mlScores[4], mlScores[5]); } - } else if constexpr (decChannel == DecayChannel::B0ToDstarPi) { + } else if constexpr (DecChannel == DecayChannel::B0ToDstarPi) { tables.hfCand2Prong(charmHadDauTracks[0].globalIndex(), charmHadDauTracks[1].globalIndex(), indexHfReducedCollision, trackParCovCharmHad.getX(), trackParCovCharmHad.getAlpha(), @@ -1457,7 +1457,7 @@ struct HfDataCreatorCharmHadPiReduced { trackParCovSoftPion.getSigma1PtY(), trackParCovSoftPion.getSigma1PtZ(), trackParCovSoftPion.getSigma1PtSnp(), trackParCovSoftPion.getSigma1PtTgl(), trackParCovSoftPion.getSigma1Pt2()); tables.hfTrackPidSoftPion(candC.nSigTpcPi2(), candC.nSigTofPi2(), charmHadDauTracks[2].hasTOF(), charmHadDauTracks[2].hasTPC()); - if constexpr (withMl) { + if constexpr (WithMl) { std::array mlScores = {-1.f, -1.f, -1.f, -1.f, -1.f, -1.f}; if (candC.mlProbDstarToD0Pi().size() == NSizeMLScore) { std::copy(candC.mlProbDstarToD0Pi().begin(), candC.mlProbDstarToD0Pi().end(), mlScores.begin()); @@ -1484,7 +1484,7 @@ struct HfDataCreatorCharmHadPiReduced { tables.hfReducedCollExtra(collision.covXX(), collision.covXY(), collision.covYY(), collision.covXZ(), collision.covYZ(), collision.covZZ()); tables.hfReducedCollCentrality(collision.centFT0C(), collision.centFT0M(), collision.trackOccupancyInTimeRange(), collision.ft0cOccupancyInTimeRange()); - if constexpr (withQvec) { + if constexpr (WithQvec) { tables.hfReducedQvector(collision.qvecFT0CRe(), collision.qvecFT0CIm(), collision.sumAmplFT0C(), collision.qvecFT0ARe(), collision.qvecFT0AIm(), collision.sumAmplFT0A(), collision.qvecFT0MRe(), collision.qvecFT0MIm(), collision.sumAmplFT0M(), @@ -1494,7 +1494,7 @@ struct HfDataCreatorCharmHadPiReduced { } } - template + template void runMcGen(aod::McCollision const& mcCollision, aod::McParticles const& particlesMc, CollisionsWCentAndMcLabels const& collisions, @@ -1526,7 +1526,7 @@ struct HfDataCreatorCharmHadPiReduced { for (const auto& particle : mcParticlesPerMcColl) { int8_t sign{0}; int8_t flag{0}; - if constexpr (decayChannel == DecayChannel::B0ToDminusPi) { + if constexpr (DecayChannel == DecayChannel::B0ToDminusPi) { // B0 → D- π+ if (RecoDecay::isMatchedMCGen(particlesMc, particle, Pdg::kB0, std::array{-static_cast(Pdg::kDPlus), +kPiPlus}, true)) { // Match D- -> π- K+ π- @@ -1559,7 +1559,7 @@ struct HfDataCreatorCharmHadPiReduced { tables.rowHfB0McGenReduced(flag, -1 /*channel*/, ptParticle, yParticle, etaParticle, ptProngs[0], yProngs[0], etaProngs[0], ptProngs[1], yProngs[1], etaProngs[1], hfRejMap, centFT0C, centFT0M); - } else if constexpr (decayChannel == DecayChannel::BsToDsminusPi) { + } else if constexpr (DecayChannel == DecayChannel::BsToDsminusPi) { // Bs → Ds- π+ if (RecoDecay::isMatchedMCGen(particlesMc, particle, Pdg::kBS, std::array{-static_cast(Pdg::kDS), +kPiPlus}, true)) { // Match Ds- -> π- K+ π- @@ -1634,7 +1634,7 @@ struct HfDataCreatorCharmHadPiReduced { tables.rowHfBsMcGenReduced(flag, -1 /*channel*/, ptParticle, yParticle, etaParticle, ptProngs[0], yProngs[0], etaProngs[0], ptProngs[1], yProngs[1], etaProngs[1], hfRejMap, centFT0C, centFT0M); - } else if constexpr (decayChannel == DecayChannel::BplusToD0barPi) { + } else if constexpr (DecayChannel == DecayChannel::BplusToD0barPi) { // B+ → D0bar π+ if (RecoDecay::isMatchedMCGen(particlesMc, particle, Pdg::kBPlus, std::array{-static_cast(Pdg::kD0), +kPiPlus}, true)) { // Match D0bar -> π- K+ @@ -1667,7 +1667,7 @@ struct HfDataCreatorCharmHadPiReduced { tables.rowHfBpMcGenReduced(flag, -1 /*channel*/, ptParticle, yParticle, etaParticle, ptProngs[0], yProngs[0], etaProngs[0], ptProngs[1], yProngs[1], etaProngs[1], hfRejMap, centFT0C, centFT0M); - } else if constexpr (decayChannel == DecayChannel::LbToLcplusPi) { + } else if constexpr (DecayChannel == DecayChannel::LbToLcplusPi) { // Lb → Lc+ π- if (RecoDecay::isMatchedMCGen(particlesMc, particle, Pdg::kLambdaB0, std::array{static_cast(Pdg::kLambdaCPlus), -kPiPlus}, true)) { // Match Lc+ → p K- π+ @@ -1700,7 +1700,7 @@ struct HfDataCreatorCharmHadPiReduced { tables.rowHfLbMcGenReduced(flag, ptParticle, yParticle, etaParticle, ptProngs[0], yProngs[0], etaProngs[0], ptProngs[1], yProngs[1], etaProngs[1], hfRejMap, centFT0C, centFT0M); - } else if constexpr (decayChannel == DecayChannel::B0ToDstarPi) { + } else if constexpr (DecayChannel == DecayChannel::B0ToDstarPi) { // B0 → D* π+ if (RecoDecay::isMatchedMCGen(particlesMc, particle, Pdg::kB0, std::array{-static_cast(Pdg::kDStar), +kPiPlus}, true)) { // Match D- -> π- K+ π- diff --git a/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx index 0e52d741f56..67a8dec5fb9 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx @@ -103,8 +103,8 @@ enum PairingType : uint8_t { }; enum D0Sel : uint8_t { - selectedD0 = 0, - selectedD0Bar + SelectedD0 = 0, + SelectedD0Bar }; /// Creation of D-V0 pairs @@ -431,9 +431,9 @@ struct HfDataCreatorCharmResoReduced { return (lQlPos - lQlNeg) / (lQlPos + lQlNeg); } // Utility to find DCA of V0 to Primary vertex - float calculateDCAStraightToPV(float X, float Y, float Z, float Px, float Py, float Pz, float pvX, float pvY, float pvZ) + float calculateDCAStraightToPV(float x, float y, float z, float px, float py, float pz, float pvX, float pvY, float pvZ) { - return std::sqrt((std::pow((pvY - Y) * Pz - (pvZ - Z) * Py, 2) + std::pow((pvX - X) * Pz - (pvZ - Z) * Px, 2) + std::pow((pvX - X) * Py - (pvY - Y) * Px, 2)) / (Px * Px + Py * Py + Pz * Pz)); + return std::sqrt((std::pow((pvY - y) * pz - (pvZ - z) * py, 2) + std::pow((pvX - x) * pz - (pvZ - z) * px, 2) + std::pow((pvX - x) * py - (pvY - y) * px, 2)) / (px * px + py * py + pz * pz)); } /// Basic selection of V0 candidates /// \param collision is the current collision @@ -643,7 +643,7 @@ struct HfDataCreatorCharmResoReduced { /// \param tracks is the table with tracks /// \param indexHfCandCharm is the index of the charm-hadron bachelor in the reduced table /// \param indexCandV0TrBach is the index of the v0 bachelor in the reduced table - template + template void fillMcRecoInfoDV0(PParticles const& particlesMc, CCand const& candCharmBach, BBachV0 const& bachelorV0, @@ -655,7 +655,7 @@ struct HfDataCreatorCharmResoReduced { int8_t sign{0}, nKinkedTracks{0}, origin{0}, flagCharmBach{0}, flagCharmBachInterm{0}, flagV0{0}, flagReso{0}; int indexRec{-1}, debugMcRec{0}; float ptGen{-1.f}, invMassGen{-1.f}; - if constexpr (dType == DType::Dstar) { + if constexpr (DType == DType::Dstar) { vecDaughtersReso.push_back(tracks.rawIteratorAt(candCharmBach.prong0Id())); vecDaughtersReso.push_back(tracks.rawIteratorAt(candCharmBach.prong1Id())); vecDaughtersReso.push_back(tracks.rawIteratorAt(candCharmBach.prongPiId())); @@ -712,7 +712,7 @@ struct HfDataCreatorCharmResoReduced { flagCharmBachInterm, debugMcRec, origin, ptGen, invMassGen, nKinkedTracks); - } else if constexpr (dType == DType::Dplus) { + } else if constexpr (DType == DType::Dplus) { vecDaughtersReso.push_back(tracks.rawIteratorAt(candCharmBach.prong0Id())); vecDaughtersReso.push_back(tracks.rawIteratorAt(candCharmBach.prong1Id())); vecDaughtersReso.push_back(tracks.rawIteratorAt(candCharmBach.prong2Id())); @@ -765,7 +765,7 @@ struct HfDataCreatorCharmResoReduced { flagCharmBachInterm, debugMcRec, origin, ptGen, invMassGen, nKinkedTracks); - } else if constexpr (dType == DType::D0) { + } else if constexpr (DType == DType::D0) { vecDaughtersReso.push_back(tracks.rawIteratorAt(candCharmBach.prong0Id())); vecDaughtersReso.push_back(tracks.rawIteratorAt(candCharmBach.prong1Id())); // Check if D0 is matched @@ -842,7 +842,7 @@ struct HfDataCreatorCharmResoReduced { /// \param tracks is the table with tracks /// \param indexHfCandCharm is the index of the charm-hadron bachelor in the reduced table /// \param indexCandTrBach is the index of the v0 bachelor in the reduced table - template + template void fillMcRecoInfoDTrack(PParticles const& particlesMc, CCand const& candCharmBach, BBachTr const& bachelorTrack, @@ -855,7 +855,7 @@ struct HfDataCreatorCharmResoReduced { int indexRec{-1}; uint16_t debugMcRec{0}; float ptGen{-1.f}, invMassGen{-1.f}; - if constexpr (dType == DType::Dstar) { + if constexpr (DType == DType::Dstar) { vecDaughtersReso.push_back(tracks.rawIteratorAt(candCharmBach.prong0Id())); vecDaughtersReso.push_back(tracks.rawIteratorAt(candCharmBach.prong1Id())); vecDaughtersReso.push_back(tracks.rawIteratorAt(candCharmBach.prongPiId())); @@ -898,7 +898,7 @@ struct HfDataCreatorCharmResoReduced { flagCharmBachInterm, debugMcRec, origin, ptGen, invMassGen, nKinkedTracks); - } else if constexpr (dType == DType::Dplus) { + } else if constexpr (DType == DType::Dplus) { vecDaughtersReso.push_back(tracks.rawIteratorAt(candCharmBach.prong0Id())); vecDaughtersReso.push_back(tracks.rawIteratorAt(candCharmBach.prong1Id())); vecDaughtersReso.push_back(tracks.rawIteratorAt(candCharmBach.prong2Id())); @@ -938,7 +938,7 @@ struct HfDataCreatorCharmResoReduced { flagCharmBachInterm, debugMcRec, origin, ptGen, invMassGen, nKinkedTracks); - } else if constexpr (dType == DType::D0) { + } else if constexpr (DType == DType::D0) { vecDaughtersReso.push_back(tracks.rawIteratorAt(candCharmBach.prong0Id())); vecDaughtersReso.push_back(tracks.rawIteratorAt(candCharmBach.prong1Id())); // Check if D0 is matched @@ -997,7 +997,7 @@ struct HfDataCreatorCharmResoReduced { } } // fillMcRecoInfoDTrack - template + template void runDataCreation(Coll const& collision, CCands const& candsD, BBachV0s const& bachelorV0s, @@ -1019,8 +1019,8 @@ struct HfDataCreatorCharmResoReduced { std::map selectedV0s; std::map selectedTracks; bool fillHfReducedCollision = false; - constexpr bool DoTracks = pairingType == PairingType::TrackOnly || pairingType == PairingType::V0AndTrack; - constexpr bool DoV0s = pairingType == PairingType::V0Only || pairingType == PairingType::V0AndTrack; + constexpr bool DoTracks = PairingType == PairingType::TrackOnly || PairingType == PairingType::V0AndTrack; + constexpr bool DoV0s = PairingType == PairingType::V0Only || PairingType == PairingType::V0AndTrack; auto bc = collision.template bc_as(); if (runNumber != bc.runNumber()) { LOG(info) << ">>>>>>>>>>>> Current run number: " << runNumber; @@ -1038,7 +1038,7 @@ struct HfDataCreatorCharmResoReduced { std::array bdtScores = {-1.f, -1.f, -1.f, -1.f, -1.f, -1.f}; std::vector> charmHadDauTracks{}; varUtils.ptD = candD.pt(); - if constexpr (dType == DType::Dstar) { + if constexpr (DType == DType::Dstar) { varUtils.signD = candD.signSoftPi(); if (varUtils.signD > 0) { varUtils.invMassD = candD.invMassDstar(); @@ -1058,11 +1058,11 @@ struct HfDataCreatorCharmResoReduced { varUtils.pVectorProng2 = candD.pVecSoftPi(); charmHadDauTracks.push_back(tracksIU.rawIteratorAt(candD.prong0Id())); charmHadDauTracks.push_back(tracksIU.rawIteratorAt(candD.prong1Id())); - if constexpr (withMl) { + if constexpr (WithMl) { std::copy(candD.mlProbDstarToD0Pi().begin(), candD.mlProbDstarToD0Pi().end(), bdtScores.begin()); } registry.fill(HIST("hMassVsPtDstarAll"), varUtils.ptD, varUtils.invMassD - varUtils.invMassD0); - } else if constexpr (dType == DType::Dplus) { + } else if constexpr (DType == DType::Dplus) { auto prong0 = tracksIU.rawIteratorAt(candD.prong0Id()); varUtils.invMassD = hfHelper.invMassDplusToPiKPi(candD); secondaryVertexD[0] = candD.xSecondaryVertex(); @@ -1078,11 +1078,11 @@ struct HfDataCreatorCharmResoReduced { charmHadDauTracks.push_back(tracksIU.rawIteratorAt(candD.prong0Id())); charmHadDauTracks.push_back(tracksIU.rawIteratorAt(candD.prong1Id())); charmHadDauTracks.push_back(tracksIU.rawIteratorAt(candD.prong2Id())); - if constexpr (withMl) { + if constexpr (WithMl) { std::copy(candD.mlProbDplusToPiKPi().begin(), candD.mlProbDplusToPiKPi().end(), bdtScores.begin()); } registry.fill(HIST("hMassVsPtDplusAll"), varUtils.ptD, varUtils.invMassD); - } else if constexpr (dType == DType::D0) { + } else if constexpr (DType == DType::D0) { varUtils.invMassD0 = hfHelper.invMassD0ToPiK(candD); varUtils.invMassD0Bar = hfHelper.invMassD0barToKPi(candD); secondaryVertexD[0] = candD.xSecondaryVertex(); @@ -1096,7 +1096,7 @@ struct HfDataCreatorCharmResoReduced { varUtils.pVectorProng0 = candD.pVectorProng0(); varUtils.pVectorProng1 = candD.pVectorProng1(); varUtils.pVectorProng2 = {0.f, 0.f, 0.f}; // D0 does not have a third prong - if constexpr (withMl) { + if constexpr (WithMl) { std::copy(candD.mlProbD0().begin(), candD.mlProbD0().end(), bdtScores.begin()); std::copy(candD.mlProbD0bar().begin(), candD.mlProbD0bar().end(), bdtScores.begin() + 3); } @@ -1124,7 +1124,7 @@ struct HfDataCreatorCharmResoReduced { chi2TpcDauMax = charmHadTrack.tpcChi2NCl(); } } - if constexpr (dType == DType::Dstar) { + if constexpr (DType == DType::Dstar) { auto softPi = tracksIU.rawIteratorAt(candD.prongPiId()); nItsClsSoftPi = softPi.itsNCls(); nTpcCrossRowsSoftPi = softPi.tpcNClsCrossedRows(); @@ -1168,7 +1168,7 @@ struct HfDataCreatorCharmResoReduced { // compute resonance invariant mass and filling of QA histograms if (TESTBIT(candidateV0.v0Type, BachelorType::K0s)) { registry.fill(HIST("hMassVsPtK0s"), candidateV0.pT, candidateV0.mK0Short); - switch (dType) { + switch (DType) { case DType::Dstar: varUtils.ptReso = RecoDecay::pt(RecoDecay::sumOfVec(varUtils.pVectorProng0, varUtils.pVectorProng1, varUtils.pVectorProng2, candidateV0.mom)); if (varUtils.signD > 0) { @@ -1203,7 +1203,7 @@ struct HfDataCreatorCharmResoReduced { bool isAntiLambda = TESTBIT(candidateV0.v0Type, BachelorType::AntiLambda); if (isLambda || isAntiLambda) { registry.fill(HIST("hMassVsPtLambda"), candidateV0.pT, candidateV0.mLambda); - switch (dType) { + switch (DType) { case DType::Dstar: varUtils.ptReso = RecoDecay::pt(RecoDecay::sumOfVec(varUtils.pVectorProng0, varUtils.pVectorProng1, varUtils.pVectorProng2, candidateV0.mom)); if (varUtils.signD > 0) { @@ -1269,16 +1269,16 @@ struct HfDataCreatorCharmResoReduced { } fillHfCandD = true; // Optional filling of MC Rec table, for now only implemented for Ds1->D*K0s and Ds2*->D+K0s - if constexpr (doMc) { + if constexpr (DoMc) { int indexHfCandCharm{-1}; - if constexpr (dType == DType::Dstar) { + if constexpr (DType == DType::Dstar) { indexHfCandCharm = hfCandDstar.lastIndex() + 1; - } else if constexpr (dType == DType::Dplus) { + } else if constexpr (DType == DType::Dplus) { indexHfCandCharm = hfCandD3Pr.lastIndex() + 1; - } else if constexpr (dType == DType::D0) { + } else if constexpr (DType == DType::D0) { indexHfCandCharm = hfCandD2Pr.lastIndex() + 1; } - fillMcRecoInfoDV0(particlesMc, candD, v0, tracksIU, indexHfCandCharm, selectedV0s[v0.globalIndex()]); + fillMcRecoInfoDV0(particlesMc, candD, v0, tracksIU, indexHfCandCharm, selectedV0s[v0.globalIndex()]); } } // end of loop on V0 candidates } // end of do V0s @@ -1299,7 +1299,7 @@ struct HfDataCreatorCharmResoReduced { } registry.fill(HIST("hdEdxVsP"), track.p(), track.tpcSignal()); // compute invariant mass and filling of QA histograms - switch (dType) { + switch (DType) { case DType::Dstar: // D* pi if (std::abs(track.tpcNSigmaPi()) < cfgSingleTrackCuts.maxNsigmaTpcPi) { @@ -1469,22 +1469,22 @@ struct HfDataCreatorCharmResoReduced { selectedTracks[track.globalIndex()] = hfTrackNoParam.lastIndex(); } fillHfCandD = true; - if constexpr (doMc) { + if constexpr (DoMc) { int indexHfCandCharm{-1}; - if constexpr (dType == DType::Dstar) { + if constexpr (DType == DType::Dstar) { indexHfCandCharm = hfCandDstar.lastIndex() + 1; - } else if constexpr (dType == DType::Dplus) { + } else if constexpr (DType == DType::Dplus) { indexHfCandCharm = hfCandD3Pr.lastIndex() + 1; - } else if constexpr (dType == DType::D0) { + } else if constexpr (DType == DType::D0) { indexHfCandCharm = hfCandD2Pr.lastIndex() + 1; } - fillMcRecoInfoDTrack(particlesMc, candD, track, tracks, indexHfCandCharm, selectedTracks[track.globalIndex()]); + fillMcRecoInfoDTrack(particlesMc, candD, track, tracks, indexHfCandCharm, selectedTracks[track.globalIndex()]); } } // end of loop on bachelor tracks } // end of do tracks // fill D candidate table if (fillHfCandD) { // fill candDplus table only once per D candidate, only if at least one V0 is found - if constexpr (dType == DType::Dplus) { + if constexpr (DType == DType::Dplus) { hfCandD3Pr(prongIdsD[0], prongIdsD[1], prongIdsD[2], indexHfReducedCollision, secondaryVertexD[0], secondaryVertexD[1], secondaryVertexD[2], @@ -1492,16 +1492,16 @@ struct HfDataCreatorCharmResoReduced { candD.pxProng1(), candD.pyProng1(), candD.pzProng1(), varUtils.pVectorProng2[0], varUtils.pVectorProng2[1], varUtils.pVectorProng2[2], nItsClsDauMin, nTpcCrossRowsDauMin, chi2TpcDauMax, varUtils.signD); - if constexpr (withMl) { + if constexpr (WithMl) { hfCandD3PrMl(bdtScores[0], bdtScores[1], bdtScores[2], bdtScores[3], bdtScores[4], bdtScores[5]); } - } else if constexpr (dType == DType::D0) { - uint8_t selFlagD0 = {BIT(D0Sel::selectedD0) | BIT(D0Sel::selectedD0Bar)}; + } else if constexpr (DType == DType::D0) { + uint8_t selFlagD0 = {BIT(D0Sel::SelectedD0) | BIT(D0Sel::SelectedD0Bar)}; if (candD.isSelD0() < cfgDmesCuts.selectionFlagD0) { - CLRBIT(selFlagD0, D0Sel::selectedD0); + CLRBIT(selFlagD0, D0Sel::SelectedD0); } if (candD.isSelD0bar() < cfgDmesCuts.selectionFlagD0Bar) { - CLRBIT(selFlagD0, D0Sel::selectedD0Bar); + CLRBIT(selFlagD0, D0Sel::SelectedD0Bar); } hfCandD2Pr(prongIdsD[0], prongIdsD[1], indexHfReducedCollision, @@ -1510,10 +1510,10 @@ struct HfDataCreatorCharmResoReduced { candD.pxProng1(), candD.pyProng1(), candD.pzProng1(), nItsClsDauMin, nTpcCrossRowsDauMin, chi2TpcDauMax, selFlagD0); - if constexpr (withMl) { + if constexpr (WithMl) { hfCandD2PrMl(bdtScores[0], bdtScores[1], bdtScores[2], bdtScores[3], bdtScores[4], bdtScores[5]); } - } else if constexpr (dType == DType::Dstar) { + } else if constexpr (DType == DType::Dstar) { hfCandDstar(prongIdsD[0], prongIdsD[1], prongIdsD[2], indexHfReducedCollision, secondaryVertexD[0], secondaryVertexD[1], secondaryVertexD[2], @@ -1523,16 +1523,16 @@ struct HfDataCreatorCharmResoReduced { nItsClsDauMin, nTpcCrossRowsDauMin, chi2TpcDauMax, nItsClsSoftPi, nTpcCrossRowsSoftPi, chi2TpcSoftPi, varUtils.signD); - if constexpr (withMl) { + if constexpr (WithMl) { hfCandD3PrMl(bdtScores[0], bdtScores[1], bdtScores[2], bdtScores[3], bdtScores[4], bdtScores[5]); } } fillHfReducedCollision = true; - if constexpr (dType == DType::Dstar) { + if constexpr (DType == DType::Dstar) { registry.fill(HIST("hMassVsPtDstarPaired"), candD.pt(), varUtils.invMassD - varUtils.invMassD0); - } else if constexpr (dType == DType::Dplus) { + } else if constexpr (DType == DType::Dplus) { registry.fill(HIST("hMassVsPtDplusPaired"), candD.pt(), varUtils.invMassD); - } else if constexpr (dType == DType::D0) { + } else if constexpr (DType == DType::D0) { if (candD.isSelD0() >= cfgDmesCuts.selectionFlagD0) { registry.fill(HIST("hMassVsPtD0Paired"), varUtils.ptD, varUtils.invMassD0); } @@ -1552,14 +1552,14 @@ struct HfDataCreatorCharmResoReduced { hfReducedCollision(collision.posX(), collision.posY(), collision.posZ(), collision.numContrib(), hfRejMap, bz); } // end of runDataCreation function - template + template void runMcGen(McParticles const& mcParticles, CCs const& collInfos, McCollisions const& mcCollisions, BCsInfo const&) { - bool doV0s = (pairingType == PairingType::V0Only || pairingType == PairingType::V0AndTrack); - bool doTracks = (pairingType == PairingType::TrackOnly || pairingType == PairingType::V0AndTrack); + bool doV0s = (PairingType == PairingType::V0Only || PairingType == PairingType::V0AndTrack); + bool doTracks = (PairingType == PairingType::TrackOnly || PairingType == PairingType::V0AndTrack); for (const auto& mcCollision : mcCollisions) { // Slice the particles table to get the particles for the current MC collision const auto mcParticlesPerMcColl = mcParticles.sliceBy(mcParticlesPerMcCollision, mcCollision.globalIndex()); @@ -1582,7 +1582,7 @@ struct HfDataCreatorCharmResoReduced { int8_t origin{0}; bool matchedReso{false}, matchedD{false}, matchedV0Tr{false}; std::vector idxBhadMothers{}; - if constexpr (dType == DType::Dstar) { + if constexpr (DType == DType::Dstar) { if (doV0s) { // D* K0s for (const auto& [decayChannelFlag, pdgCodeReso] : hf_decay::hf_cand_reso::particlesToDstarK0s) { @@ -1614,7 +1614,7 @@ struct HfDataCreatorCharmResoReduced { matchedD = RecoDecay::isMatchedMCGen(mcParticlesPerMcColl, candD0MC, Pdg::kD0, std::array{-kKPlus, +kPiPlus}, true, &signD, 2); } } - } else if constexpr (dType == DType::Dplus) { + } else if constexpr (DType == DType::Dplus) { if (doV0s) { // D+ K0s for (const auto& [decayChannelFlag, pdgCodeReso] : hf_decay::hf_cand_reso::particlesToDplusK0s) { @@ -1654,7 +1654,7 @@ struct HfDataCreatorCharmResoReduced { auto candDplusMC = mcParticles.rawIteratorAt(particle.daughtersIds().front()); matchedD = RecoDecay::isMatchedMCGen(mcParticlesPerMcColl, candDplusMC, Pdg::kDPlus, std::array{+kPiPlus, -kKPlus, +kPiPlus}, true, &signD, 2); } - } else if constexpr (dType == DType::D0) { + } else if constexpr (DType == DType::D0) { if (doV0s) { // D0 Lambda for (const auto& [decayChannelFlag, pdgCodeReso] : hf_decay::hf_cand_reso::particlesToD0Lambda) { diff --git a/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx index 98e3b09d390..02797338234 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx @@ -510,7 +510,7 @@ struct HfDataCreatorJpsiHadReduced { /// \param vecDaughtersB is the vector with all daughter tracks (Jpsi daughters in first position) /// \param indexHfCandJpsi is the index of the Jpsi candidate /// \param selectedTracksBach is the map with the indices of selected bachelor pion tracks - template + template void fillMcRecoInfo(CColl const& collision, PParticles const& particlesMc, std::vector const& vecDaughtersB, @@ -525,7 +525,7 @@ struct HfDataCreatorJpsiHadReduced { int8_t debug{0}; float motherPt{-1.f}; - if constexpr (decChannel == DecayChannel::BplusToJpsiK) { + if constexpr (DecChannel == DecayChannel::BplusToJpsiK) { // B+ → J/Psi K+ → (µ+µ-) K+ int indexRec = -1; if (!runJpsiToee) { @@ -555,7 +555,7 @@ struct HfDataCreatorJpsiHadReduced { } } rowHfJpsiKMcRecReduced(indexHfCandJpsi, selectedTracksBach[0][vecDaughtersB.back().globalIndex()], flag, channel, flagWrongCollision, debug, motherPt); - } else if constexpr (decChannel == DecayChannel::BsToJpsiPhi) { + } else if constexpr (DecChannel == DecayChannel::BsToJpsiPhi) { // Bs → J/Psi phi → (µ+µ-) (K+K-) int indexRec = -1; if (!runJpsiToee) { @@ -612,7 +612,7 @@ struct HfDataCreatorJpsiHadReduced { return indexCollisionMaxNumContrib; } - template + template void runMcGen(aod::McCollision const& mcCollision, aod::McParticles const& particlesMc, CollisionsWCMcLabels const& collisions, @@ -631,7 +631,7 @@ struct HfDataCreatorJpsiHadReduced { // Match generated particles. for (const auto& particle : mcParticlesPerMcColl) { int8_t sign{0}, flag{0}, channel{0}; - if constexpr (decChannel == DecayChannel::BplusToJpsiK) { + if constexpr (DecChannel == DecayChannel::BplusToJpsiK) { // B+ → J/Psi K+ → (µ+µ-) K+ if (RecoDecay::isMatchedMCGen(particlesMc, particle, Pdg::kBPlus, std::array{static_cast(Pdg::kJPsi), +kKPlus}, true, &sign)) { // Match J/Psi -> µ+µ- @@ -671,7 +671,7 @@ struct HfDataCreatorJpsiHadReduced { rowHfBpMcGenReduced(flag, channel, ptParticle, yParticle, etaParticle, ptProngs[0], yProngs[0], etaProngs[0], ptProngs[1], yProngs[1], etaProngs[1], hfRejMap, centFT0C, centFT0M); - } else if constexpr (decChannel == DecayChannel::BsToJpsiPhi) { + } else if constexpr (DecChannel == DecayChannel::BsToJpsiPhi) { // Bs → J/Psi phi → (µ+µ-) (K+K-) if (RecoDecay::isMatchedMCGen(particlesMc, particle, Pdg::kBS, std::array{static_cast(Pdg::kJPsi), +kKPlus, -kKPlus}, true, &sign, 2)) { // Match J/Psi -> µ+µ- and phi -> K+K- @@ -716,7 +716,7 @@ struct HfDataCreatorJpsiHadReduced { } // Jpsi candidate selection - template + template void runDataCreation(Coll const& collision, JpsiCands const& candsJpsi, aod::TrackAssoc const& trackIndices, @@ -850,7 +850,7 @@ struct HfDataCreatorJpsiHadReduced { continue; } - if constexpr (decChannel == DecayChannel::BplusToJpsiK) { + if constexpr (DecChannel == DecayChannel::BplusToJpsiK) { registry.fill(HIST("hPtKaon"), trackParCovBach.getPt()); // compute invariant mass square and apply selection invMass2JpsiHad = RecoDecay::m2(std::array{pVecJpsi, pVecBach}, std::array{MassJPsi, MassKPlus}); @@ -911,7 +911,7 @@ struct HfDataCreatorJpsiHadReduced { selectedTracksBach[trackBach.globalIndex()] = hfTrackLfDau0.lastIndex(); } - if constexpr (doMc) { + if constexpr (DoMc) { std::vector beautyHadDauTracks{}; beautyHadDauTracks.reserve(jPsiDauTracks.size()); for (const auto& track : jPsiDauTracks) { @@ -921,7 +921,7 @@ struct HfDataCreatorJpsiHadReduced { fillMcRecoInfo(collision, particlesMc, beautyHadDauTracks, indexHfCandJpsi, std::array, 2>{selectedTracksBach}, indexCollisionMaxNumContrib); } fillHfCandJpsi = true; - } else if constexpr (decChannel == DecayChannel::BsToJpsiPhi) { + } else if constexpr (DecChannel == DecayChannel::BsToJpsiPhi) { for (auto trackBachId2 = trackId + 1; trackBachId2 != trackIndices.end(); ++trackBachId2) { auto trackBach2 = trackBachId2.template track_as(); auto trackBach2ParCov = getTrackParCov(trackBach2); @@ -1033,7 +1033,7 @@ struct HfDataCreatorJpsiHadReduced { selectedTracksBach2[trackBach2.globalIndex()] = hfTrackLfDau1.lastIndex(); } - if constexpr (doMc) { + if constexpr (DoMc) { std::vector beautyHadDauTracks{}; beautyHadDauTracks.reserve(jPsiDauTracks.size()); for (const auto& track : jPsiDauTracks) { diff --git a/PWGHF/D2H/Tasks/taskB0Reduced.cxx b/PWGHF/D2H/Tasks/taskB0Reduced.cxx index 2cb28375d86..58c88aabc48 100644 --- a/PWGHF/D2H/Tasks/taskB0Reduced.cxx +++ b/PWGHF/D2H/Tasks/taskB0Reduced.cxx @@ -448,7 +448,7 @@ struct HfTaskB0Reduced { /// \param withB0Ml is the flag to enable the filling with ML scores for the B0 candidate /// \param candidate is the B0 candidate /// \param candidatesD is the table with D- candidates - template + template void fillCandDStarPi(Cand const& candidate, SoftPions const& softPions, CandsDmes const&) @@ -470,14 +470,14 @@ struct HfTaskB0Reduced { int8_t flagMcMatchRec = 0; int8_t flagWrongCollision = 0; bool isSignal = false; - if constexpr (doMc) { + if constexpr (DoMc) { flagMcMatchRec = candidate.flagMcMatchRec(); flagWrongCollision = candidate.flagWrongCollision(); isSignal = TESTBIT(std::abs(flagMcMatchRec), hf_cand_b0::DecayTypeMc::B0ToDstarPiToD0PiPiToKPiPiPi); } if (fillHistograms) { - if constexpr (doMc) { + if constexpr (DoMc) { if (isSignal) { registry.fill(HIST("hMassRecSig"), ptCandB0, hfHelper.invMassB0ToDPi(candidate)); registry.fill(HIST("hPtProngD0RecSig"), ptCandB0, candidate.ptProng0()); @@ -499,7 +499,7 @@ struct HfTaskB0Reduced { registry.fill(HIST("hDecLengthXyDRecSig"), ptD, decLenXyD); registry.fill(HIST("hCospDRecSig"), ptD, cospD); registry.fill(HIST("hCospXyDRecSig"), ptD, cospXyD); - if constexpr (withDmesMl) { + if constexpr (WithDmesMl) { registry.fill(HIST("hMlScoreBkgDRecSig"), ptD, candidate.prong0MlScoreBkg()); registry.fill(HIST("hMlScorePromptDRecSig"), ptD, candidate.prong0MlScorePrompt()); registry.fill(HIST("hMlScoreNonPromptDRecSig"), ptD, candidate.prong0MlScoreNonprompt()); @@ -525,7 +525,7 @@ struct HfTaskB0Reduced { registry.fill(HIST("hDecLengthXyDRecBg"), ptD, decLenXyD); registry.fill(HIST("hCospDRecBg"), ptD, cospD); registry.fill(HIST("hCospXyDRecBg"), ptD, cospXyD); - if constexpr (withDmesMl) { + if constexpr (WithDmesMl) { registry.fill(HIST("hMlScoreBkgDRecBg"), ptD, candidate.prong0MlScoreBkg()); registry.fill(HIST("hMlScorePromptDRecBg"), ptD, candidate.prong0MlScorePrompt()); registry.fill(HIST("hMlScoreNonPromptDRecBg"), ptD, candidate.prong0MlScoreNonprompt()); @@ -553,7 +553,7 @@ struct HfTaskB0Reduced { registry.fill(HIST("hCospD"), ptD, cospD); registry.fill(HIST("hCospXyD"), ptD, cospXyD); - if constexpr (withDmesMl) { + if constexpr (WithDmesMl) { registry.fill(HIST("hMlScoreBkgD"), ptD, candidate.prong0MlScoreBkg()); registry.fill(HIST("hMlScorePromptD"), ptD, candidate.prong0MlScorePrompt()); registry.fill(HIST("hMlScoreNonPromptD"), ptD, candidate.prong0MlScoreNonprompt()); @@ -561,22 +561,22 @@ struct HfTaskB0Reduced { } } if (fillSparses) { - if constexpr (doMc) { + if constexpr (DoMc) { if (isSignal) { - if constexpr (withDmesMl) { + if constexpr (WithDmesMl) { registry.fill(HIST("hMassPtCutVarsRecSig"), invMassB0, ptCandB0, candidate.decayLength(), candidate.decayLengthXY() / candidate.errorDecayLengthXY(), candidate.impactParameterProngSqSum(), candidate.cpa(), invMassD, ptD, candidate.prong0MlScoreBkg(), candidate.prong0MlScoreNonprompt()); } else { registry.fill(HIST("hMassPtCutVarsRecSig"), invMassB0, ptCandB0, candidate.decayLength(), candidate.decayLengthXY() / candidate.errorDecayLengthXY(), candidate.impactParameterProngSqSum(), candidate.cpa(), invMassD, ptD, decLenD, cospD); } } else if (fillBackground) { - if constexpr (withDmesMl) { + if constexpr (WithDmesMl) { registry.fill(HIST("hMassPtCutVarsRecBg"), invMassB0, ptCandB0, candidate.decayLength(), candidate.decayLengthXY() / candidate.errorDecayLengthXY(), candidate.impactParameterProngSqSum(), candidate.cpa(), invMassD, ptD, candidate.prong0MlScoreBkg(), candidate.prong0MlScoreNonprompt()); } else { registry.fill(HIST("hMassPtCutVarsRecBg"), invMassB0, ptCandB0, candidate.decayLength(), candidate.decayLengthXY() / candidate.errorDecayLengthXY(), candidate.impactParameterProngSqSum(), candidate.cpa(), invMassD, ptD, decLenD, cospD); } } } else { - if constexpr (withDmesMl) { + if constexpr (WithDmesMl) { registry.fill(HIST("hMassPtCutVars"), invMassB0, ptCandB0, candidate.decayLength(), candidate.decayLengthXY() / candidate.errorDecayLengthXY(), candidate.impactParameterProngSqSum(), candidate.cpa(), invMassD, ptD, candidate.prong0MlScoreBkg(), candidate.prong0MlScoreNonprompt()); } else { registry.fill(HIST("hMassPtCutVars"), invMassB0, ptCandB0, candidate.decayLength(), candidate.decayLengthXY() / candidate.errorDecayLengthXY(), candidate.impactParameterProngSqSum(), candidate.cpa(), invMassD, ptD, decLenD, cospD); @@ -585,12 +585,12 @@ struct HfTaskB0Reduced { } if (fillTree) { float pseudoRndm = ptD * 1000. - static_cast(ptD * 1000); - if (flagMcMatchRec != 0 || (((doMc && fillBackground) || !doMc) && (ptCandB0 >= ptMaxForDownSample || pseudoRndm < downSampleBkgFactor))) { + if (flagMcMatchRec != 0 || (((DoMc && fillBackground) || !DoMc) && (ptCandB0 >= ptMaxForDownSample || pseudoRndm < downSampleBkgFactor))) { float prong0MlScoreBkg = -1.; float prong0MlScorePrompt = -1.; float prong0MlScoreNonprompt = -1.; float candidateMlScoreSig = -1; - if constexpr (withDmesMl) { + if constexpr (WithDmesMl) { prong0MlScoreBkg = candidate.prong0MlScoreBkg(); prong0MlScorePrompt = candidate.prong0MlScorePrompt(); prong0MlScoreNonprompt = candidate.prong0MlScoreNonprompt(); @@ -598,7 +598,7 @@ struct HfTaskB0Reduced { auto prongBachPi = candidate.template prongBachPi_as(); float ptMother = -1.; - if constexpr (doMc) { + if constexpr (DoMc) { ptMother = candidate.ptMother(); } @@ -659,7 +659,7 @@ struct HfTaskB0Reduced { flagWrongCollision, ptMother); - if constexpr (withDecayTypeCheck) { + if constexpr (WithDecayTypeCheck) { hfRedB0McCheck( flagMcMatchRec, flagWrongCollision, @@ -686,7 +686,7 @@ struct HfTaskB0Reduced { /// \param withB0Ml is the flag to enable the filling with ML scores for the B0 candidate /// \param candidate is the B0 candidate /// \param candidatesD is the table with D- candidates - template + template void fillCand(Cand const& candidate, CandsDmes const&) { @@ -706,14 +706,14 @@ struct HfTaskB0Reduced { int8_t flagMcMatchRec = 0; int8_t flagWrongCollision = 0; bool isSignal = false; - if constexpr (doMc) { + if constexpr (DoMc) { flagMcMatchRec = candidate.flagMcMatchRec(); flagWrongCollision = candidate.flagWrongCollision(); isSignal = TESTBIT(std::abs(flagMcMatchRec), hf_cand_b0::DecayTypeMc::B0ToDplusPiToPiKPiPi); } if (fillHistograms) { - if constexpr (doMc) { + if constexpr (DoMc) { if (isSignal) { registry.fill(HIST("hMassRecSig"), ptCandB0, hfHelper.invMassB0ToDPi(candidate)); registry.fill(HIST("hPtProng0RecSig"), ptCandB0, candidate.ptProng0()); @@ -733,15 +733,15 @@ struct HfTaskB0Reduced { registry.fill(HIST("hDecLengthXyDRecSig"), ptD, decLenXyD); registry.fill(HIST("hCospDRecSig"), ptD, cospD); registry.fill(HIST("hCospXyDRecSig"), ptD, cospXyD); - if constexpr (withDecayTypeCheck) { + if constexpr (WithDecayTypeCheck) { registry.fill(HIST("hDecayTypeMc"), 1 + hf_cand_b0::DecayTypeMc::B0ToDplusPiToPiKPiPi, invMassB0, ptCandB0); } - if constexpr (withDmesMl) { + if constexpr (WithDmesMl) { registry.fill(HIST("hMlScoreBkgDRecSig"), ptD, candidate.prong0MlScoreBkg()); registry.fill(HIST("hMlScorePromptDRecSig"), ptD, candidate.prong0MlScorePrompt()); registry.fill(HIST("hMlScoreNonPromptDRecSig"), ptD, candidate.prong0MlScoreNonprompt()); } - if constexpr (withB0Ml) { + if constexpr (WithB0Ml) { registry.fill(HIST("hMlScoreSigB0RecSig"), ptCandB0, candidate.mlProbB0ToDPi()); } } else if (fillBackground) { @@ -763,15 +763,15 @@ struct HfTaskB0Reduced { registry.fill(HIST("hDecLengthXyDRecBg"), ptD, decLenXyD); registry.fill(HIST("hCospDRecBg"), ptD, cospD); registry.fill(HIST("hCospXyDRecBg"), ptD, cospXyD); - if constexpr (withDmesMl) { + if constexpr (WithDmesMl) { registry.fill(HIST("hMlScoreBkgDRecBg"), ptD, candidate.prong0MlScoreBkg()); registry.fill(HIST("hMlScorePromptDRecBg"), ptD, candidate.prong0MlScorePrompt()); registry.fill(HIST("hMlScoreNonPromptDRecBg"), ptD, candidate.prong0MlScoreNonprompt()); } - if constexpr (withB0Ml) { + if constexpr (WithB0Ml) { registry.fill(HIST("hMlScoreSigB0RecBg"), ptCandB0, candidate.mlProbB0ToDPi()); } - } else if constexpr (withDecayTypeCheck) { + } else if constexpr (WithDecayTypeCheck) { if (TESTBIT(flagMcMatchRec, hf_cand_b0::DecayTypeMc::B0ToDsPiToKKPiPi)) { // B0 → Ds- π+ → (K- K+ π-) π+ registry.fill(HIST("hDecayTypeMc"), 1 + hf_cand_b0::DecayTypeMc::B0ToDsPiToKKPiPi, invMassB0, ptCandB0); } else if (TESTBIT(flagMcMatchRec, hf_cand_b0::DecayTypeMc::BsToDsPiToKKPiPi)) { // B0s → Ds- π+ → (K- K+ π-) π+ @@ -804,33 +804,33 @@ struct HfTaskB0Reduced { registry.fill(HIST("hCospD"), ptD, cospD); registry.fill(HIST("hCospXyD"), ptD, cospXyD); - if constexpr (withDmesMl) { + if constexpr (WithDmesMl) { registry.fill(HIST("hMlScoreBkgD"), ptD, candidate.prong0MlScoreBkg()); registry.fill(HIST("hMlScorePromptD"), ptD, candidate.prong0MlScorePrompt()); registry.fill(HIST("hMlScoreNonPromptD"), ptD, candidate.prong0MlScoreNonprompt()); } - if constexpr (withB0Ml) { + if constexpr (WithB0Ml) { registry.fill(HIST("hMlScoreSigB0"), ptCandB0, candidate.mlProbB0ToDPi()); } } } if (fillSparses) { - if constexpr (doMc) { + if constexpr (DoMc) { if (isSignal) { - if constexpr (withDmesMl) { + if constexpr (WithDmesMl) { registry.fill(HIST("hMassPtCutVarsRecSig"), invMassB0, ptCandB0, candidate.decayLength(), candidate.decayLengthXY() / candidate.errorDecayLengthXY(), candidate.impactParameterProduct(), candidate.cpa(), invMassD, ptD, candidate.prong0MlScoreBkg(), candidate.prong0MlScoreNonprompt()); } else { registry.fill(HIST("hMassPtCutVarsRecSig"), invMassB0, ptCandB0, candidate.decayLength(), candidate.decayLengthXY() / candidate.errorDecayLengthXY(), candidate.impactParameterProduct(), candidate.cpa(), invMassD, ptD, decLenD, cospD); } } else if (fillBackground) { - if constexpr (withDmesMl) { + if constexpr (WithDmesMl) { registry.fill(HIST("hMassPtCutVarsRecBg"), invMassB0, ptCandB0, candidate.decayLength(), candidate.decayLengthXY() / candidate.errorDecayLengthXY(), candidate.impactParameterProduct(), candidate.cpa(), invMassD, ptD, candidate.prong0MlScoreBkg(), candidate.prong0MlScoreNonprompt()); } else { registry.fill(HIST("hMassPtCutVarsRecBg"), invMassB0, ptCandB0, candidate.decayLength(), candidate.decayLengthXY() / candidate.errorDecayLengthXY(), candidate.impactParameterProduct(), candidate.cpa(), invMassD, ptD, decLenD, cospD); } } } else { - if constexpr (withDmesMl) { + if constexpr (WithDmesMl) { registry.fill(HIST("hMassPtCutVars"), invMassB0, ptCandB0, candidate.decayLength(), candidate.decayLengthXY() / candidate.errorDecayLengthXY(), candidate.impactParameterProduct(), candidate.cpa(), invMassD, ptD, candidate.prong0MlScoreBkg(), candidate.prong0MlScoreNonprompt()); } else { registry.fill(HIST("hMassPtCutVars"), invMassB0, ptCandB0, candidate.decayLength(), candidate.decayLengthXY() / candidate.errorDecayLengthXY(), candidate.impactParameterProduct(), candidate.cpa(), invMassD, ptD, decLenD, cospD); @@ -839,23 +839,23 @@ struct HfTaskB0Reduced { } if (fillTree) { float pseudoRndm = ptD * 1000. - static_cast(ptD * 1000); - if (flagMcMatchRec != 0 || (((doMc && fillBackground) || !doMc) && (ptCandB0 >= ptMaxForDownSample || pseudoRndm < downSampleBkgFactor))) { + if (flagMcMatchRec != 0 || (((DoMc && fillBackground) || !DoMc) && (ptCandB0 >= ptMaxForDownSample || pseudoRndm < downSampleBkgFactor))) { float prong0MlScoreBkg = -1.; float prong0MlScorePrompt = -1.; float prong0MlScoreNonprompt = -1.; float candidateMlScoreSig = -1; - if constexpr (withDmesMl) { + if constexpr (WithDmesMl) { prong0MlScoreBkg = candidate.prong0MlScoreBkg(); prong0MlScorePrompt = candidate.prong0MlScorePrompt(); prong0MlScoreNonprompt = candidate.prong0MlScoreNonprompt(); } - if constexpr (withB0Ml) { + if constexpr (WithB0Ml) { candidateMlScoreSig = candidate.mlProbB0ToDPi(); } auto prong1 = candidate.template prong1_as(); float ptMother = -1.; - if constexpr (doMc) { + if constexpr (DoMc) { ptMother = candidate.ptMother(); } @@ -916,7 +916,7 @@ struct HfTaskB0Reduced { flagWrongCollision, ptMother); - if constexpr (withDecayTypeCheck) { + if constexpr (WithDecayTypeCheck) { hfRedB0McCheck( flagMcMatchRec, flagWrongCollision, diff --git a/PWGHF/D2H/Tasks/taskBplusReduced.cxx b/PWGHF/D2H/Tasks/taskBplusReduced.cxx index e7a9a8f93db..2358c730cc0 100644 --- a/PWGHF/D2H/Tasks/taskBplusReduced.cxx +++ b/PWGHF/D2H/Tasks/taskBplusReduced.cxx @@ -402,7 +402,7 @@ struct HfTaskBplusReduced { /// \param withBplusMl is the flag to enable the filling with ML scores for the B+ candidate /// \param candidate is the B+ candidate /// \param candidatesD is the table with D0 candidates - template + template void fillCand(Cand const& candidate, CandsDmes const& /*candidatesD*/, TracksPion const&) @@ -424,14 +424,14 @@ struct HfTaskBplusReduced { int8_t flagMcMatchRec = 0; int8_t flagWrongCollision = 0; bool isSignal = false; - if constexpr (doMc) { + if constexpr (DoMc) { flagMcMatchRec = candidate.flagMcMatchRec(); flagWrongCollision = candidate.flagWrongCollision(); isSignal = TESTBIT(std::abs(flagMcMatchRec), hf_cand_bplus::DecayTypeMc::BplusToD0PiToKPiPi); } if (fillHistograms) { - if constexpr (doMc) { + if constexpr (DoMc) { if (isSignal) { registry.fill(HIST("hMassRecSig"), invMassBplus, ptCandBplus); registry.fill(HIST("hPtRecSig"), ptCandBplus); @@ -453,15 +453,15 @@ struct HfTaskBplusReduced { registry.fill(HIST("hDecLengthXyD0RecSig"), decLenXyD0, ptD0); registry.fill(HIST("hCpaD0RecSig"), cpaD0, ptD0); registry.fill(HIST("hCpaXyD0RecSig"), cpaXyD0, ptD0); - if constexpr (withDecayTypeCheck) { + if constexpr (WithDecayTypeCheck) { registry.fill(HIST("hDecayTypeMc"), 1 + hf_cand_bplus::DecayTypeMc::BplusToD0PiToKPiPi, invMassBplus, ptCandBplus); } - if constexpr (withDmesMl) { + if constexpr (WithDmesMl) { registry.fill(HIST("hMlScoreBkgDRecSig"), ptD0, candidate.prong0MlScoreBkg()); registry.fill(HIST("hMlScorePromptDRecSig"), ptD0, candidate.prong0MlScorePrompt()); registry.fill(HIST("hMlScoreNonPromptDRecSig"), ptD0, candidate.prong0MlScoreNonprompt()); } - if constexpr (withBplusMl) { + if constexpr (WithBplusMl) { registry.fill(HIST("hMlScoreSigBplusRecSig"), ptCandBplus, candidate.mlProbBplusToD0Pi()); } } else if (fillBackground) { @@ -485,15 +485,15 @@ struct HfTaskBplusReduced { registry.fill(HIST("hDecLengthXyDRecBg"), decLenXyD0, ptD0); registry.fill(HIST("hCpaDRecBg"), cpaD0, ptD0); registry.fill(HIST("hCpaXyDRecBg"), cpaXyD0, ptD0); - if constexpr (withDmesMl) { + if constexpr (WithDmesMl) { registry.fill(HIST("hMlScoreBkgDRecBg"), ptD0, candidate.prong0MlScoreBkg()); registry.fill(HIST("hMlScorePromptDRecBg"), ptD0, candidate.prong0MlScorePrompt()); registry.fill(HIST("hMlScoreNonPromptDRecBg"), ptD0, candidate.prong0MlScoreNonprompt()); } - if constexpr (withBplusMl) { + if constexpr (WithBplusMl) { registry.fill(HIST("hMlScoreSigBplusRecBg"), ptCandBplus, candidate.mlProbBplusToD0Pi()); } - } else if constexpr (withDecayTypeCheck) { + } else if constexpr (WithDecayTypeCheck) { if (TESTBIT(flagMcMatchRec, hf_cand_bplus::DecayTypeMc::BplusToD0KToKPiK)) { // Partly reconstructed decay channel registry.fill(HIST("hDecayTypeMc"), 1 + hf_cand_bplus::DecayTypeMc::BplusToD0KToKPiK, invMassBplus, ptCandBplus); } else if (TESTBIT(flagMcMatchRec, hf_cand_bplus::DecayTypeMc::PartlyRecoDecay)) { // Partly reconstructed decay channel @@ -522,33 +522,33 @@ struct HfTaskBplusReduced { registry.fill(HIST("hDecLengthXyD0"), decLenXyD0, ptD0); registry.fill(HIST("hCpaD0"), cpaD0, ptD0); registry.fill(HIST("hCpaXyD0"), cpaXyD0, ptD0); - if constexpr (withDmesMl) { + if constexpr (WithDmesMl) { registry.fill(HIST("hMlScoreBkgD"), ptD0, candidate.prong0MlScoreBkg()); registry.fill(HIST("hMlScorePromptD"), ptD0, candidate.prong0MlScorePrompt()); registry.fill(HIST("hMlScoreNonPromptD"), ptD0, candidate.prong0MlScoreNonprompt()); } - if constexpr (withBplusMl) { + if constexpr (WithBplusMl) { registry.fill(HIST("hMlScoreSigBplus"), ptCandBplus, candidate.mlProbBplusToD0Pi()); } } } if (fillSparses) { - if constexpr (doMc) { + if constexpr (DoMc) { if (isSignal) { - if constexpr (withDmesMl) { + if constexpr (WithDmesMl) { registry.fill(HIST("hMassPtCutVarsRecSig"), invMassBplus, ptCandBplus, candidate.decayLength(), candidate.decayLengthXY() / candidate.errorDecayLengthXY(), candidate.impactParameterProduct(), candidate.cpa(), invMassD0, ptD0, candidate.prong0MlScoreBkg(), candidate.prong0MlScoreNonprompt()); } else { registry.fill(HIST("hMassPtCutVarsRecSig"), invMassBplus, ptCandBplus, candidate.decayLength(), candidate.decayLengthXY() / candidate.errorDecayLengthXY(), candidate.impactParameterProduct(), candidate.cpa(), invMassD0, ptD0, decLenD0, cpaD0); } } else if (fillBackground) { - if constexpr (withDmesMl) { + if constexpr (WithDmesMl) { registry.fill(HIST("hMassPtCutVarsRecBg"), invMassBplus, ptCandBplus, candidate.decayLength(), candidate.decayLengthXY() / candidate.errorDecayLengthXY(), candidate.impactParameterProduct(), candidate.cpa(), invMassD0, ptD0, candidate.prong0MlScoreBkg(), candidate.prong0MlScoreNonprompt()); } else { registry.fill(HIST("hMassPtCutVarsRecBg"), invMassBplus, ptCandBplus, candidate.decayLength(), candidate.decayLengthXY() / candidate.errorDecayLengthXY(), candidate.impactParameterProduct(), candidate.cpa(), invMassD0, ptD0, decLenD0, cpaD0); } } } else { - if constexpr (withDmesMl) { + if constexpr (WithDmesMl) { registry.fill(HIST("hMassPtCutVars"), invMassBplus, ptCandBplus, candidate.decayLength(), candidate.decayLengthXY() / candidate.errorDecayLengthXY(), candidate.impactParameterProduct(), candidate.cpa(), invMassD0, ptD0, candidate.prong0MlScoreBkg(), candidate.prong0MlScoreNonprompt()); } else { registry.fill(HIST("hMassPtCutVars"), invMassBplus, ptCandBplus, candidate.decayLength(), candidate.decayLengthXY() / candidate.errorDecayLengthXY(), candidate.impactParameterProduct(), candidate.cpa(), invMassD0, ptD0, decLenD0, cpaD0); @@ -562,12 +562,12 @@ struct HfTaskBplusReduced { float prong0MlScorePrompt = -1.; float prong0MlScoreNonprompt = -1.; float candidateMlScoreSig = -1; - if constexpr (withDmesMl) { + if constexpr (WithDmesMl) { prong0MlScoreBkg = candidate.prong0MlScoreBkg(); prong0MlScorePrompt = candidate.prong0MlScorePrompt(); prong0MlScoreNonprompt = candidate.prong0MlScoreNonprompt(); } - if constexpr (withBplusMl) { + if constexpr (WithBplusMl) { candidateMlScoreSig = candidate.mlProbBplusToD0Pi(); } auto prong1 = candidate.template prong1_as(); @@ -589,7 +589,7 @@ struct HfTaskBplusReduced { } float ptMother = -1.; - if constexpr (doMc) { + if constexpr (DoMc) { ptMother = candidate.ptMother(); } @@ -649,7 +649,7 @@ struct HfTaskBplusReduced { flagWrongCollision, ptMother); - if constexpr (withDecayTypeCheck) { + if constexpr (WithDecayTypeCheck) { hfRedBpMcCheck( flagMcMatchRec, flagWrongCollision, diff --git a/PWGHF/D2H/Tasks/taskBplusToJpsiKReduced.cxx b/PWGHF/D2H/Tasks/taskBplusToJpsiKReduced.cxx index d1595756ab1..347fe6e6cca 100644 --- a/PWGHF/D2H/Tasks/taskBplusToJpsiKReduced.cxx +++ b/PWGHF/D2H/Tasks/taskBplusToJpsiKReduced.cxx @@ -334,7 +334,7 @@ struct HfTaskBplusToJpsiKReduced { /// \param withBplusMl is the flag to enable the filling with ML scores for the B+ candidate /// \param candidate is the B+ candidate /// \param candidatesJpsi is the table with Jpsi candidates - template + template void fillCand(Cand const& candidate, aod::HfRedJpsis const& /*candidatesJpsi*/, aod::HfRedBach0Tracks const&) @@ -349,7 +349,7 @@ struct HfTaskBplusToJpsiKReduced { int8_t flagMcMatchRec{0}, flagMcDecayChanRec{0}, flagWrongCollision{0}; bool isSignal = false; - if constexpr (doMc) { + if constexpr (DoMc) { flagMcMatchRec = candidate.flagMcMatchRec(); flagMcDecayChanRec = candidate.flagMcDecayChanRec(); flagWrongCollision = candidate.flagWrongCollision(); @@ -380,7 +380,7 @@ struct HfTaskBplusToJpsiKReduced { } float candidateMlScoreSig = -1; - if constexpr (withBplusMl) { + if constexpr (WithBplusMl) { // B+ ML selections std::vector inputFeatures = hfMlResponse.getInputFeatures(candidate, candKa); if (hfMlResponse.isSelectedMl(inputFeatures, ptCandBplus, outputMl)) { @@ -394,7 +394,7 @@ struct HfTaskBplusToJpsiKReduced { registry.fill(HIST("hMass"), invMassBplus, ptCandBplus); registry.fill(HIST("hMassJpsi"), invMassJpsi, candidate.ptProng0()); registry.fill(HIST("hd0K"), candidate.impactParameter1(), candidate.ptProng1()); - if constexpr (doMc) { + if constexpr (DoMc) { if (isSignal) { registry.fill(HIST("hMassRecSig"), invMassBplus, ptCandBplus); registry.fill(HIST("hMassJpsiRecSig"), invMassJpsi, candidate.ptProng0()); @@ -409,7 +409,7 @@ struct HfTaskBplusToJpsiKReduced { float pseudoRndm = ptJpsi * 1000. - static_cast(ptJpsi * 1000); if (ptCandBplus >= ptMaxForDownSample || pseudoRndm < downSampleBkgFactor) { float ptMother = -1.; - if constexpr (doMc) { + if constexpr (DoMc) { ptMother = candidate.ptMother(); } diff --git a/PWGHF/D2H/Tasks/taskBsReduced.cxx b/PWGHF/D2H/Tasks/taskBsReduced.cxx index 098814b8e37..901a3908e0f 100644 --- a/PWGHF/D2H/Tasks/taskBsReduced.cxx +++ b/PWGHF/D2H/Tasks/taskBsReduced.cxx @@ -96,8 +96,8 @@ DECLARE_SOA_COLUMN(NSigTpcPiProng1, nSigTpcPiProng1, float); //! DECLARE_SOA_COLUMN(NSigTofPiProng1, nSigTofPiProng1, float); //! TOF Nsigma separation for prong1 with pion mass hypothesis DECLARE_SOA_COLUMN(NSigTpcTofPiProng1, nSigTpcTofPiProng1, float); //! Combined TPC and TOF Nsigma separation for prong1 with pion mass hypothesis // MC truth -DECLARE_SOA_COLUMN(FlagWrongCollision, flagWrongCollision, int8_t); //! Flag for association with wrong collision -DECLARE_SOA_COLUMN(PtGen, ptGen, float); //! Transverse momentum of candidate (GeV/c) +DECLARE_SOA_COLUMN(FlagWrongCollision, flagWrongCollision, int8_t); //! Flag for association with wrong collision +DECLARE_SOA_COLUMN(PtGen, ptGen, float); //! Transverse momentum of candidate (GeV/c) // General vars (unused for now) DECLARE_SOA_COLUMN(P, p, float); //! Momentum of candidate (GeV/c) DECLARE_SOA_COLUMN(E, e, float); //! Energy of candidate (GeV) @@ -398,7 +398,7 @@ struct HfTaskBsReduced { /// \param withBsMl is the flag to enable the filling with ML scores for the Bs candidate /// \param candidate is the Bs candidate /// \param candidatesD is the table with Ds- candidates - template + template void fillCand(Cand const& candidate, CandsDmes const&) { @@ -419,14 +419,14 @@ struct HfTaskBsReduced { int8_t flagMcMatchRec = 0; int8_t flagWrongCollision = 0; bool isSignal = false; - if constexpr (doMc) { + if constexpr (DoMc) { flagMcMatchRec = candidate.flagMcMatchRec(); flagWrongCollision = candidate.flagWrongCollision(); isSignal = TESTBIT(std::abs(flagMcMatchRec), hf_cand_bs::DecayTypeMc::BsToDsPiToPhiPiPiToKKPiPi); } if (fillHistograms) { - if constexpr (doMc) { + if constexpr (DoMc) { if (isSignal) { registry.fill(HIST("hMassRecSig"), ptCandBs, invMassBs); registry.fill(HIST("hPtProng0RecSig"), ptCandBs, candidate.ptProng0()); @@ -446,15 +446,15 @@ struct HfTaskBsReduced { registry.fill(HIST("hDecLengthXyDRecSig"), ptDs, decLenXyDs); registry.fill(HIST("hCospDRecSig"), ptDs, cospDs); registry.fill(HIST("hCospXyDRecSig"), ptDs, cospXyDs); - if constexpr (withDecayTypeCheck) { + if constexpr (WithDecayTypeCheck) { registry.fill(HIST("hDecayTypeMc"), 1 + hf_cand_bs::DecayTypeMc::BsToDsPiToPhiPiPiToKKPiPi, invMassBs, ptCandBs); } - if constexpr (withDmesMl) { + if constexpr (WithDmesMl) { registry.fill(HIST("hMlScoreBkgDsRecSig"), ptDs, candidate.prong0MlScoreBkg()); registry.fill(HIST("hMlScorePromptDsRecSig"), ptDs, candidate.prong0MlScorePrompt()); registry.fill(HIST("hMlScoreNonPromptDsRecSig"), ptDs, candidate.prong0MlScoreNonprompt()); } - if constexpr (withBsMl) { + if constexpr (WithBsMl) { registry.fill(HIST("hMlScoreSigBsRecSig"), ptCandBs, candidate.mlProbBsToDsPi()[1]); } } else if (fillBackground) { @@ -476,15 +476,15 @@ struct HfTaskBsReduced { registry.fill(HIST("hDecLengthXyDRecBg"), ptDs, decLenXyDs); registry.fill(HIST("hCospDRecBg"), ptDs, cospDs); registry.fill(HIST("hCospXyDRecBg"), ptDs, cospXyDs); - if constexpr (withDmesMl) { + if constexpr (WithDmesMl) { registry.fill(HIST("hMlScoreBkgDsRecBg"), ptDs, candidate.prong0MlScoreBkg()); registry.fill(HIST("hMlScorePromptDsRecBg"), ptDs, candidate.prong0MlScorePrompt()); registry.fill(HIST("hMlScoreNonPromptDsRecBg"), ptDs, candidate.prong0MlScoreNonprompt()); } - if constexpr (withBsMl) { + if constexpr (WithBsMl) { registry.fill(HIST("hMlScoreSigBsRecBg"), ptCandBs, candidate.mlProbBsToDsPi()[1]); } - } else if constexpr (withDecayTypeCheck) { + } else if constexpr (WithDecayTypeCheck) { for (uint8_t iFlag = 1; iFlag < hf_cand_bs::DecayTypeMc::NDecayTypeMc; ++iFlag) { if (TESTBIT(flagMcMatchRec, iFlag)) { registry.fill(HIST("hDecayTypeMc"), 1 + iFlag, invMassBs, ptCandBs); @@ -511,33 +511,33 @@ struct HfTaskBsReduced { registry.fill(HIST("hCospD"), ptDs, cospDs); registry.fill(HIST("hCospXyD"), ptDs, cospXyDs); - if constexpr (withDmesMl) { + if constexpr (WithDmesMl) { registry.fill(HIST("hMlScoreBkgDs"), ptDs, candidate.prong0MlScoreBkg()); registry.fill(HIST("hMlScorePromptDs"), ptDs, candidate.prong0MlScorePrompt()); registry.fill(HIST("hMlScoreNonPromptDs"), ptDs, candidate.prong0MlScoreNonprompt()); } - if constexpr (withBsMl) { + if constexpr (WithBsMl) { registry.fill(HIST("hMlScoreSigBs"), ptCandBs, candidate.mlProbBsToDsPi()[1]); } } } if (fillSparses) { - if constexpr (doMc) { + if constexpr (DoMc) { if (isSignal) { - if constexpr (withDmesMl) { + if constexpr (WithDmesMl) { registry.fill(HIST("hMassPtCutVarsRecSig"), invMassBs, ptCandBs, candidate.decayLength(), candidate.decayLengthXY() / candidate.errorDecayLengthXY(), candidate.impactParameterProduct(), candidate.cpa(), invMassDs, ptDs, candidate.prong0MlScoreBkg(), candidate.prong0MlScoreNonprompt()); } else { registry.fill(HIST("hMassPtCutVarsRecSig"), invMassBs, ptCandBs, candidate.decayLength(), candidate.decayLengthXY() / candidate.errorDecayLengthXY(), candidate.impactParameterProduct(), candidate.cpa(), invMassDs, ptDs, decLenDs, cospDs); } } else if (fillBackground) { - if constexpr (withDmesMl) { + if constexpr (WithDmesMl) { registry.fill(HIST("hMassPtCutVarsRecBg"), invMassBs, ptCandBs, candidate.decayLength(), candidate.decayLengthXY() / candidate.errorDecayLengthXY(), candidate.impactParameterProduct(), candidate.cpa(), invMassDs, ptDs, candidate.prong0MlScoreBkg(), candidate.prong0MlScoreNonprompt()); } else { registry.fill(HIST("hMassPtCutVarsRecBg"), invMassBs, ptCandBs, candidate.decayLength(), candidate.decayLengthXY() / candidate.errorDecayLengthXY(), candidate.impactParameterProduct(), candidate.cpa(), invMassDs, ptDs, decLenDs, cospDs); } } } else { - if constexpr (withDmesMl) { + if constexpr (WithDmesMl) { registry.fill(HIST("hMassPtCutVars"), invMassBs, ptCandBs, candidate.decayLength(), candidate.decayLengthXY() / candidate.errorDecayLengthXY(), candidate.impactParameterProduct(), candidate.cpa(), invMassDs, ptDs, candidate.prong0MlScoreBkg(), candidate.prong0MlScoreNonprompt()); } else { registry.fill(HIST("hMassPtCutVars"), invMassBs, ptCandBs, candidate.decayLength(), candidate.decayLengthXY() / candidate.errorDecayLengthXY(), candidate.impactParameterProduct(), candidate.cpa(), invMassDs, ptDs, decLenDs, cospDs); @@ -546,23 +546,23 @@ struct HfTaskBsReduced { } if (fillTree) { float pseudoRndm = ptDs * 1000. - static_cast(ptDs * 1000); - if (flagMcMatchRec != 0 || (((doMc && fillBackground) || !doMc) && (ptCandBs >= ptMaxForDownSample || pseudoRndm < downSampleBkgFactor))) { + if (flagMcMatchRec != 0 || (((DoMc && fillBackground) || !DoMc) && (ptCandBs >= ptMaxForDownSample || pseudoRndm < downSampleBkgFactor))) { float prong0MlScoreBkg = -1.; float prong0MlScorePrompt = -1.; float prong0MlScoreNonprompt = -1.; float candidateMlScoreSig = -1; - if constexpr (withDmesMl) { + if constexpr (WithDmesMl) { prong0MlScoreBkg = candidate.prong0MlScoreBkg(); prong0MlScorePrompt = candidate.prong0MlScorePrompt(); prong0MlScoreNonprompt = candidate.prong0MlScoreNonprompt(); } - if constexpr (withBsMl) { + if constexpr (WithBsMl) { candidateMlScoreSig = candidate.mlProbBsToDsPi()[1]; } auto prong1 = candidate.template prong1_as(); float ptMother = -1.; - if constexpr (doMc) { + if constexpr (DoMc) { ptMother = candidate.ptMother(); } @@ -623,9 +623,9 @@ struct HfTaskBsReduced { flagWrongCollision, ptMother); - if constexpr (withDecayTypeCheck) { + if constexpr (WithDecayTypeCheck) { float candidateMlScoreSig = -1; - if constexpr (withBsMl) { + if constexpr (WithBsMl) { candidateMlScoreSig = candidate.mlProbBsToDsPi()[1]; } hfRedBsMcCheck( diff --git a/PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx b/PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx index fc2eb8c1ac9..76e21f2dc44 100644 --- a/PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx +++ b/PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx @@ -365,7 +365,7 @@ struct HfTaskBsToJpsiPhiReduced { /// \param withBsMl is the flag to enable the filling with ML scores for the Bs candidate /// \param candidate is the Bs candidate /// \param candidatesJpsi is the table with Jpsi candidates - template + template void fillCand(Cand const& candidate, aod::HfRedJpsis const& /*candidatesJpsi*/, aod::HfRedBach0Tracks const&, @@ -385,7 +385,7 @@ struct HfTaskBsToJpsiPhiReduced { int8_t flagMcMatchRec{0}, flagMcDecayChanRec{0}, flagWrongCollision{0}; bool isSignal = false; - if constexpr (doMc) { + if constexpr (DoMc) { flagMcMatchRec = candidate.flagMcMatchRec(); flagMcDecayChanRec = candidate.flagMcDecayChanRec(); flagWrongCollision = candidate.flagWrongCollision(); @@ -421,7 +421,7 @@ struct HfTaskBsToJpsiPhiReduced { } float candidateMlScoreSig = -1; - if constexpr (withBsMl) { + if constexpr (WithBsMl) { // Bs ML selections std::vector inputFeatures = hfMlResponse.getInputFeatures(candidate, candKa0, candKa1); if (hfMlResponse.isSelectedMl(inputFeatures, ptCandBs, outputMl)) { @@ -436,7 +436,7 @@ struct HfTaskBsToJpsiPhiReduced { registry.fill(HIST("hMassJpsi"), invMassJpsi, candidate.ptProng0()); registry.fill(HIST("hMassPhi"), invMassPhi, candidate.ptProng0()); registry.fill(HIST("hd0K"), candidate.impactParameter1(), candidate.ptProng1()); - if constexpr (doMc) { + if constexpr (DoMc) { if (isSignal) { registry.fill(HIST("hMassRecSig"), invMassBs, ptCandBs); registry.fill(HIST("hMassJpsiRecSig"), invMassJpsi, candidate.ptProng0()); @@ -451,7 +451,7 @@ struct HfTaskBsToJpsiPhiReduced { float pseudoRndm = ptJpsi * 1000. - static_cast(ptJpsi * 1000); if (ptCandBs >= ptMaxForDownSample || pseudoRndm < downSampleBkgFactor) { float ptMother = -1.; - if constexpr (doMc) { + if constexpr (DoMc) { ptMother = candidate.ptMother(); } diff --git a/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx b/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx index 26500d5e3a3..09e6bef4e8a 100644 --- a/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx +++ b/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx @@ -701,13 +701,13 @@ struct HfTaskCharmPolarisation { /// \param charge is the charge of the hadron /// \param nMuons is the number of muons from daughter decays /// \param isPartRecoDstar is a flag indicating if it is a partly reconstructed Dstar meson (MC only) - template + template void fillRecoHistos(float invMassCharmHad, float ptCharmHad, int numPvContributors, float rapCharmHad, float invMassD0, float invMassKPiLc, float cosThetaStar, float phiEuler, std::array outputMl, int isRotatedCandidate, int8_t origin, float ptBhadMother, int8_t resoChannelLc, float absEtaMin, int numItsClsMin, int numTpcClsMin, int8_t charge, int8_t nMuons, bool isPartRecoDstar) { - if constexpr (cosThetaStarType == charm_polarisation::CosThetaStarType::Helicity) { // Helicity - if constexpr (!doMc) { // data - if constexpr (withMl) { // with ML - if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { + if constexpr (CosThetaStarType == charm_polarisation::CosThetaStarType::Helicity) { // Helicity + if constexpr (!DoMc) { // data + if constexpr (WithMl) { // with ML + if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { if (activateTrackingSys) { if (nBkgRotations > 0) { registry.fill(HIST("hHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate); @@ -721,14 +721,14 @@ struct HfTaskCharmPolarisation { registry.fill(HIST("hHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2]); } } - } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), invMassKPiLc, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate, charge); if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hEulerPhiHelicity"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, outputMl[0], /*outputMl[1],*/ outputMl[2], charge); } } } else { // without ML - if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ + if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ if (activateTrackingSys) { if (nBkgRotations > 0) { registry.fill(HIST("hHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate); @@ -742,7 +742,7 @@ struct HfTaskCharmPolarisation { registry.fill(HIST("hHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), invMassD0, cosThetaStar); } } - } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), invMassKPiLc, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate, charge); if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hEulerPhiHelicity"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, charge); @@ -750,9 +750,9 @@ struct HfTaskCharmPolarisation { } } } else { // MC --> no distinction among channels, since rotational bkg not supported - if constexpr (withMl) { // with ML + if constexpr (WithMl) { // with ML if (origin == RecoDecay::OriginType::Prompt) { // prompt - if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ + if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ if (activateTrackingSys) { if (!isPartRecoDstar) { registry.fill(HIST("hRecoPromptHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, nMuons); @@ -766,14 +766,14 @@ struct HfTaskCharmPolarisation { registry.fill(HIST("hPartRecoPromptHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], nMuons); } } - } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoPromptHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hRecPromptEulerPhiHelicity"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, outputMl[0], /*outputMl[1],*/ outputMl[2], resoChannelLc, charge); } } } else { // non-prompt - if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ + if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ if (activateTrackingSys) { if (!isPartRecoDstar) { registry.fill(HIST("hRecoNonPromptHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, nMuons, ptBhadMother); @@ -787,7 +787,7 @@ struct HfTaskCharmPolarisation { registry.fill(HIST("hPartRecoNonPromptHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], nMuons, ptBhadMother); } } - } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoNonPromptHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hRecNonPromptEulerPhiHelicity"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, outputMl[0], /*outputMl[1],*/ outputMl[2], resoChannelLc, charge); @@ -796,7 +796,7 @@ struct HfTaskCharmPolarisation { } } else { // without ML if (origin == RecoDecay::OriginType::Prompt) { // prompt - if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ + if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ if (activateTrackingSys) { if (!isPartRecoDstar) { registry.fill(HIST("hRecoPromptHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, nMuons); @@ -810,14 +810,14 @@ struct HfTaskCharmPolarisation { registry.fill(HIST("hPartRecoPromptHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, nMuons); } } - } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoPromptHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hRecPromptEulerPhiHelicity"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, resoChannelLc, charge); } } } else { // non-prompt - if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ + if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ if (activateTrackingSys) { if (!isPartRecoDstar) { registry.fill(HIST("hRecoNonPromptHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, nMuons, ptBhadMother); @@ -831,7 +831,7 @@ struct HfTaskCharmPolarisation { registry.fill(HIST("hPartRecoNonPromptHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, nMuons, ptBhadMother); } } - } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoNonPromptHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hRecNonPromptEulerPhiHelicity"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, resoChannelLc, charge); @@ -840,10 +840,10 @@ struct HfTaskCharmPolarisation { } } } - } else if constexpr (cosThetaStarType == charm_polarisation::CosThetaStarType::Production) { // Production - if constexpr (!doMc) { // data - if constexpr (withMl) { // with ML - if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ + } else if constexpr (CosThetaStarType == charm_polarisation::CosThetaStarType::Production) { // Production + if constexpr (!DoMc) { // data + if constexpr (WithMl) { // with ML + if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ if (activateTrackingSys) { if (nBkgRotations > 0) { registry.fill(HIST("hProduction"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate); @@ -857,14 +857,14 @@ struct HfTaskCharmPolarisation { registry.fill(HIST("hProduction"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2]); } } - } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hProduction"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), invMassKPiLc, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate, charge); if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hEulerPhiProduction"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, outputMl[0], /*outputMl[1],*/ outputMl[2], charge); } } } else { // without ML - if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ + if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ if (activateTrackingSys) { if (nBkgRotations > 0) { registry.fill(HIST("hProduction"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate); @@ -878,7 +878,7 @@ struct HfTaskCharmPolarisation { registry.fill(HIST("hProduction"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), invMassD0, cosThetaStar); } } - } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hProduction"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), invMassKPiLc, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate, charge); if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hEulerPhiProduction"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, charge); @@ -886,9 +886,9 @@ struct HfTaskCharmPolarisation { } } } else { // MC --> no distinction among channels, since rotational bkg not supported - if constexpr (withMl) { // with ML + if constexpr (WithMl) { // with ML if (origin == RecoDecay::OriginType::Prompt) { // prompt - if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ + if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ if (activateTrackingSys) { if (!isPartRecoDstar) { registry.fill(HIST("hRecoPromptProduction"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, nMuons); @@ -902,14 +902,14 @@ struct HfTaskCharmPolarisation { registry.fill(HIST("hPartRecoPromptProduction"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], nMuons); } } - } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoPromptProduction"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hRecPromptEulerPhiProduction"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, outputMl[0], /*outputMl[1],*/ outputMl[2], resoChannelLc, charge); } } } else { // non-prompt - if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ + if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ if (activateTrackingSys) { if (!isPartRecoDstar) { registry.fill(HIST("hRecoNonPromptProduction"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, nMuons, ptBhadMother); @@ -923,7 +923,7 @@ struct HfTaskCharmPolarisation { registry.fill(HIST("hPartRecoNonPromptProduction"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], nMuons, ptBhadMother); } } - } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoNonPromptProduction"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hRecNonPromptEulerPhiProduction"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, outputMl[0], /*outputMl[1],*/ outputMl[2], resoChannelLc, charge); @@ -932,7 +932,7 @@ struct HfTaskCharmPolarisation { } } else { // without ML if (origin == RecoDecay::OriginType::Prompt) { // prompt - if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ + if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ if (activateTrackingSys) { if (!isPartRecoDstar) { registry.fill(HIST("hRecoPromptProduction"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, nMuons); @@ -946,14 +946,14 @@ struct HfTaskCharmPolarisation { registry.fill(HIST("hPartRecoPromptProduction"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, nMuons); } } - } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoPromptProduction"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hRecPromptEulerPhiProduction"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, resoChannelLc, charge); } } } else { // non-prompt - if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ + if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ if (activateTrackingSys) { if (!isPartRecoDstar) { registry.fill(HIST("hRecoNonPromptProduction"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, nMuons, ptBhadMother); @@ -967,7 +967,7 @@ struct HfTaskCharmPolarisation { registry.fill(HIST("hPartRecoNonPromptProduction"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, nMuons, ptBhadMother); } } - } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoNonPromptProduction"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hRecNonPromptEulerPhiProduction"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, resoChannelLc, charge); @@ -976,10 +976,10 @@ struct HfTaskCharmPolarisation { } } } - } else if constexpr (cosThetaStarType == charm_polarisation::CosThetaStarType::Beam) { // Beam - if constexpr (!doMc) { // data - if constexpr (withMl) { // with ML - if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ + } else if constexpr (CosThetaStarType == charm_polarisation::CosThetaStarType::Beam) { // Beam + if constexpr (!DoMc) { // data + if constexpr (WithMl) { // with ML + if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ if (activateTrackingSys) { if (nBkgRotations > 0) { registry.fill(HIST("hBeam"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate); @@ -993,14 +993,14 @@ struct HfTaskCharmPolarisation { registry.fill(HIST("hBeam"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2]); } } - } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hBeam"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), invMassKPiLc, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate, charge); if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hEulerPhiBeam"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, outputMl[0], /*outputMl[1],*/ outputMl[2], charge); } } } else { // without ML - if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ + if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ if (activateTrackingSys) { if (nBkgRotations > 0) { registry.fill(HIST("hBeam"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate); @@ -1014,7 +1014,7 @@ struct HfTaskCharmPolarisation { registry.fill(HIST("hBeam"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), invMassD0, cosThetaStar); } } - } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hBeam"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), invMassKPiLc, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate, charge); if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hEulerPhiBeam"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, charge); @@ -1022,9 +1022,9 @@ struct HfTaskCharmPolarisation { } } } else { // MC --> no distinction among channels, since rotational bkg not supported - if constexpr (withMl) { // with ML + if constexpr (WithMl) { // with ML if (origin == RecoDecay::OriginType::Prompt) { // prompt - if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ + if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ if (activateTrackingSys) { if (!isPartRecoDstar) { registry.fill(HIST("hRecoPromptBeam"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, nMuons); @@ -1038,14 +1038,14 @@ struct HfTaskCharmPolarisation { registry.fill(HIST("hPartRecoPromptBeam"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], nMuons); } } - } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoPromptBeam"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hRecPromptEulerPhiBeam"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, outputMl[0], /*outputMl[1],*/ outputMl[2], resoChannelLc, charge); } } } else { // non-prompt - if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ + if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ if (activateTrackingSys) { if (!isPartRecoDstar) { registry.fill(HIST("hRecoNonPromptBeam"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, nMuons, ptBhadMother); @@ -1059,7 +1059,7 @@ struct HfTaskCharmPolarisation { registry.fill(HIST("hPartRecoNonPromptBeam"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], nMuons, ptBhadMother); } } - } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoNonPromptBeam"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hRecNonPromptEulerPhiBeam"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, outputMl[0], /*outputMl[1],*/ outputMl[2], resoChannelLc, charge); @@ -1068,7 +1068,7 @@ struct HfTaskCharmPolarisation { } } else { // without ML if (origin == RecoDecay::OriginType::Prompt) { // prompt - if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ + if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ if (activateTrackingSys) { if (!isPartRecoDstar) { registry.fill(HIST("hRecoPromptBeam"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, nMuons); @@ -1082,14 +1082,14 @@ struct HfTaskCharmPolarisation { registry.fill(HIST("hPartRecoPromptBeam"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, nMuons); } } - } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoPromptBeam"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hRecPromptEulerPhiBeam"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, resoChannelLc, charge); } } } else { // non-prompt - if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ + if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ if (activateTrackingSys) { if (!isPartRecoDstar) { registry.fill(HIST("hRecoNonPromptBeam"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, nMuons, ptBhadMother); @@ -1103,7 +1103,7 @@ struct HfTaskCharmPolarisation { registry.fill(HIST("hPartRecoNonPromptBeam"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, nMuons, ptBhadMother); } } - } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoNonPromptBeam"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hRecNonPromptEulerPhiBeam"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, resoChannelLc, charge); @@ -1112,10 +1112,10 @@ struct HfTaskCharmPolarisation { } } } - } else if constexpr (cosThetaStarType == charm_polarisation::CosThetaStarType::Random) { // Random - if constexpr (!doMc) { // data - if constexpr (withMl) { // with ML - if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ + } else if constexpr (CosThetaStarType == charm_polarisation::CosThetaStarType::Random) { // Random + if constexpr (!DoMc) { // data + if constexpr (WithMl) { // with ML + if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ if (activateTrackingSys) { if (nBkgRotations > 0) { registry.fill(HIST("hRandom"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate); @@ -1129,11 +1129,11 @@ struct HfTaskCharmPolarisation { registry.fill(HIST("hRandom"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2]); } } - } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRandom"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), invMassKPiLc, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate, charge); } } else { // without ML - if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ + if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ if (activateTrackingSys) { if (nBkgRotations > 0) { registry.fill(HIST("hRandom"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate); @@ -1147,14 +1147,14 @@ struct HfTaskCharmPolarisation { registry.fill(HIST("hRandom"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), invMassD0, cosThetaStar); } } - } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRandom"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), invMassKPiLc, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate, charge); } } } else { // MC --> no distinction among channels, since rotational bkg not supported - if constexpr (withMl) { // with ML + if constexpr (WithMl) { // with ML if (origin == RecoDecay::OriginType::Prompt) { // prompt - if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ + if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ if (activateTrackingSys) { if (!isPartRecoDstar) { registry.fill(HIST("hRecoPromptRandom"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, nMuons); @@ -1168,11 +1168,11 @@ struct HfTaskCharmPolarisation { registry.fill(HIST("hPartRecoPromptRandom"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], nMuons); } } - } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoPromptRandom"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); } } else { // non-prompt - if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ + if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ if (activateTrackingSys) { if (!isPartRecoDstar) { registry.fill(HIST("hRecoNonPromptRandom"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, nMuons, ptBhadMother); @@ -1186,38 +1186,38 @@ struct HfTaskCharmPolarisation { registry.fill(HIST("hPartRecoNonPromptRandom"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], nMuons, ptBhadMother); } } - } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoNonPromptRandom"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); } } } else { // without ML if (origin == RecoDecay::OriginType::Prompt) { // prompt - if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ + if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ if (!isPartRecoDstar) { registry.fill(HIST("hRecoPromptRandom"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, nMuons); } else { registry.fill(HIST("hPartRecoPromptRandom"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, nMuons); } - } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoPromptRandom"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); } } else { // non-prompt - if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ + if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ if (!isPartRecoDstar) { registry.fill(HIST("hRecoNonPromptRandom"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, nMuons, ptBhadMother); } else { registry.fill(HIST("hPartRecoNonPromptRandom"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, nMuons, ptBhadMother); } - } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoNonPromptRandom"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); } } } } - } else if constexpr (cosThetaStarType == charm_polarisation::CosThetaStarType::EP) { // EP - if constexpr (!doMc) { // data - if constexpr (withMl) { // with ML - if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ + } else if constexpr (CosThetaStarType == charm_polarisation::CosThetaStarType::EP) { // EP + if constexpr (!DoMc) { // data + if constexpr (WithMl) { // with ML + if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ if (activateTrackingSys) { if (nBkgRotations > 0) { registry.fill(HIST("hEP"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate); @@ -1233,7 +1233,7 @@ struct HfTaskCharmPolarisation { } } } else { - if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ + if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ if (activateTrackingSys) { if (nBkgRotations > 0) { registry.fill(HIST("hEP"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate); @@ -1250,9 +1250,9 @@ struct HfTaskCharmPolarisation { } } } else { - if constexpr (withMl) { // with ML + if constexpr (WithMl) { // with ML if (origin == RecoDecay::OriginType::Prompt) { // prompt - if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ + if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ if (activateTrackingSys) { if (!isPartRecoDstar) { registry.fill(HIST("hRecoPromptEP"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, nMuons); @@ -1268,7 +1268,7 @@ struct HfTaskCharmPolarisation { } } } else { // non-prompt - if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ + if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ if (activateTrackingSys) { if (!isPartRecoDstar) { registry.fill(HIST("hRecoNonPromptEP"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, nMuons, ptBhadMother); @@ -1298,10 +1298,10 @@ struct HfTaskCharmPolarisation { /// \param areDausInAcc is a flag indicating whether the daughters are in acceptance or not /// \param resoChannelLc indicates the Lc decay channel (direct, resonant) /// \param isPartRecoDstar is a flag indicating if it is a partly reconstructed Dstar->D0pi->Kpipipi0 meson (MC only) - template + template void fillGenHistos(float ptCharmHad, int numPvContributors, float rapCharmHad, float cosThetaStar, int8_t origin, float ptBhadMother, bool areDausInAcc, uint8_t resoChannelLc, int8_t charge, bool isPartRecoDstar) { - if constexpr (cosThetaStarType == charm_polarisation::CosThetaStarType::Helicity) { // Helicity + if constexpr (CosThetaStarType == charm_polarisation::CosThetaStarType::Helicity) { // Helicity if (origin == RecoDecay::OriginType::Prompt) { // prompt if (!isPartRecoDstar) { registry.fill(HIST("hGenPromptHelicity"), ptCharmHad, numPvContributors, rapCharmHad, cosThetaStar, areDausInAcc, resoChannelLc, charge); @@ -1315,7 +1315,7 @@ struct HfTaskCharmPolarisation { registry.fill(HIST("hGenPartRecoNonPromptHelicity"), ptCharmHad, numPvContributors, rapCharmHad, cosThetaStar, ptBhadMother, areDausInAcc, resoChannelLc, charge); } } - } else if constexpr (cosThetaStarType == charm_polarisation::CosThetaStarType::Production) { // Production + } else if constexpr (CosThetaStarType == charm_polarisation::CosThetaStarType::Production) { // Production if (origin == RecoDecay::OriginType::Prompt) { // prompt if (!isPartRecoDstar) { registry.fill(HIST("hGenPromptProduction"), ptCharmHad, numPvContributors, rapCharmHad, cosThetaStar, areDausInAcc, resoChannelLc, charge); @@ -1329,7 +1329,7 @@ struct HfTaskCharmPolarisation { registry.fill(HIST("hGenPartRecoNonPromptProduction"), ptCharmHad, numPvContributors, rapCharmHad, cosThetaStar, ptBhadMother, areDausInAcc, resoChannelLc, charge); } } - } else if constexpr (cosThetaStarType == charm_polarisation::CosThetaStarType::Beam) { // Beam + } else if constexpr (CosThetaStarType == charm_polarisation::CosThetaStarType::Beam) { // Beam if (origin == RecoDecay::OriginType::Prompt) { // prompt if (!isPartRecoDstar) { registry.fill(HIST("hGenPromptBeam"), ptCharmHad, numPvContributors, rapCharmHad, cosThetaStar, areDausInAcc, resoChannelLc, charge); @@ -1343,7 +1343,7 @@ struct HfTaskCharmPolarisation { registry.fill(HIST("hGenPartRecoNonPromptBeam"), ptCharmHad, numPvContributors, rapCharmHad, cosThetaStar, ptBhadMother, areDausInAcc, resoChannelLc, charge); } } - } else if constexpr (cosThetaStarType == charm_polarisation::CosThetaStarType::Random) { // Random + } else if constexpr (CosThetaStarType == charm_polarisation::CosThetaStarType::Random) { // Random if (origin == RecoDecay::OriginType::Prompt) { // prompt if (!isPartRecoDstar) { registry.fill(HIST("hGenPromptRandom"), ptCharmHad, numPvContributors, rapCharmHad, cosThetaStar, areDausInAcc, resoChannelLc, charge); @@ -1357,7 +1357,7 @@ struct HfTaskCharmPolarisation { registry.fill(HIST("hGenPartRecoNonPromptRandom"), ptCharmHad, numPvContributors, rapCharmHad, cosThetaStar, ptBhadMother, areDausInAcc, resoChannelLc, charge); } } - } else if constexpr (cosThetaStarType == charm_polarisation::CosThetaStarType::EP) { // EP + } else if constexpr (CosThetaStarType == charm_polarisation::CosThetaStarType::EP) { // EP if (origin == RecoDecay::OriginType::Prompt) { // prompt if (!isPartRecoDstar) { registry.fill(HIST("hGenPromptEP"), ptCharmHad, numPvContributors, rapCharmHad, cosThetaStar, areDausInAcc, resoChannelLc, charge); @@ -1390,18 +1390,18 @@ struct HfTaskCharmPolarisation { /// \param invMass is the invariant mass /// \return true if candidate in signal region - template + template bool isInSignalRegion(float invMass) { float invMassMin = 0.f; float invMassMax = 100.f; - if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ + if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ invMassMin = 0.142f; invMassMax = 0.15f; if (invMassMin < invMass && invMass < invMassMax) { return true; } - } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ (to be tuned!) + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ (to be tuned!) invMassMin = 2.25f; invMassMax = 2.35f; if (invMassMin < invMass && invMass < invMassMax) { @@ -1511,10 +1511,10 @@ struct HfTaskCharmPolarisation { /// \param particles are the generated particles /// \param tracks are the reconstructed tracks /// \return true if candidate in signal region - template + template bool runPolarisationAnalysis(Cand const& candidate, int bkgRotationId, int numPvContributors, Part const& particles, Trk const& /*tracks*/, QVecs const* qVecs = nullptr) { - if constexpr (withEP) { + if constexpr (WithEp) { assert(qVecs && "EP analysis requested but qVecs == nullptr"); } @@ -1527,8 +1527,8 @@ struct HfTaskCharmPolarisation { int8_t resoChannelLc = -1; int8_t charge = -99; bool partRecoDstar{false}; - if constexpr (doMc) { - if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { + if constexpr (DoMc) { + if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { partRecoDstar = std::abs(candidate.flagMcMatchRec()) == hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPiPi0 && std::abs(candidate.flagMcMatchRecD0()) == hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiKPi0; bool signalDstar = std::abs(candidate.flagMcMatchRec()) == hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi && std::abs(candidate.flagMcMatchRecD0()) == hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK; if (!signalDstar && (!partRecoDstar || !activatePartRecoDstar)) { // this candidate is not signal and not partially reconstructed signal, skip @@ -1541,8 +1541,8 @@ struct HfTaskCharmPolarisation { if (origin == RecoDecay::OriginType::NonPrompt && (pdgBhadMother == 5101 || pdgBhadMother == 5103 || pdgBhadMother == 5201 || pdgBhadMother == 5203 || pdgBhadMother == 5301 || pdgBhadMother == 5303 || pdgBhadMother == 5401 || pdgBhadMother == 5403 || pdgBhadMother == 5503 || pdgBhadMother == 553 || pdgBhadMother == 555 || pdgBhadMother == 553 || pdgBhadMother == 557)) { // o2-linter: disable=pdg/explicit-code, magic-number (constants not in the PDG header) return isCandidateInSignalRegion; } - } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { - if constexpr (!studyLcPKPiBkgMc) { // skip this if studyLcPKPiBkgMc is true, since we are interested in background + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPKPi) { + if constexpr (!StudyLcPkPiBkgMc) { // skip this if studyLcPKPiBkgMc is true, since we are interested in background if (std::abs(candidate.flagMcMatchRec()) != hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) { // this candidate is not signal, skip return isCandidateInSignalRegion; } @@ -1562,7 +1562,7 @@ struct HfTaskCharmPolarisation { } } else { /// data - if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { + if constexpr (Channel == charm_polarisation::DecayChannel::LcToPKPi) { /// Calculate the electric charge from reconstructed daughter tracks /// Lc charge == first daughter charge auto trackProng0 = candidate.template prong0_as(); @@ -1581,7 +1581,7 @@ struct HfTaskCharmPolarisation { std::array outputMl{-1.f, -1.f, -1.f}; int isRotatedCandidate = 0; // currently meaningful only for Lc->pKpi - if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { + if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // Dstar analysis // polarization measured from the soft-pion daughter (*) @@ -1626,16 +1626,16 @@ struct HfTaskCharmPolarisation { } invMassCharmHadForSparse = invMassCharmHad - invMassD0; - if constexpr (withMl) { + if constexpr (WithMl) { outputMl[0] = candidate.mlProbDstarToD0Pi()[0]; outputMl[1] = candidate.mlProbDstarToD0Pi()[1]; outputMl[2] = candidate.mlProbDstarToD0Pi()[2]; } - } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc->pKpi analysis // polarization measured from the proton daughter (*) - if constexpr (doMc) { // we keep only the good hypo in the MC + if constexpr (DoMc) { // we keep only the good hypo in the MC if ((iMass == charm_polarisation::MassHyposLcToPKPi::PiKP && massHypoMcTruth == charm_polarisation::MassHyposLcToPKPi::PKPi) || (iMass == charm_polarisation::MassHyposLcToPKPi::PKPi && massHypoMcTruth == charm_polarisation::MassHyposLcToPKPi::PiKP)) { continue; } @@ -1683,7 +1683,7 @@ struct HfTaskCharmPolarisation { invMassCharmHad = hfHelper.invMassLcToPKPi(candidate); invMassCharmHadForSparse = hfHelper.invMassLcToPKPi(candidate); } - if constexpr (withMl) { + if constexpr (WithMl) { if (candidate.mlProbLcToPKPi().size() == NScores) { // protect from empty vectors // the BDT output score might be empty if no preselections were enabled (selectionFlag null) @@ -1717,7 +1717,7 @@ struct HfTaskCharmPolarisation { invMassCharmHad = hfHelper.invMassLcToPiKP(candidate); invMassCharmHadForSparse = hfHelper.invMassLcToPiKP(candidate); } - if constexpr (withMl) { + if constexpr (WithMl) { if (candidate.mlProbLcToPiKP().size() == NScores) { // protect from empty vectors // the BDT output score might be empty if no preselections were enabled (selectionFlag null) @@ -1791,7 +1791,7 @@ struct HfTaskCharmPolarisation { float ptCharmHad = std::sqrt(pxCharmHad * pxCharmHad + pyCharmHad * pyCharmHad); // this definition is valid for both rotated and original candidates if (!isCandidateInSignalRegion) { // it could be that only one mass hypothesis is in signal region - isCandidateInSignalRegion = isInSignalRegion(invMassCharmHadForSparse); + isCandidateInSignalRegion = isInSignalRegion(invMassCharmHadForSparse); } float absEtaTrackMin{-1.f}; @@ -1800,10 +1800,10 @@ struct HfTaskCharmPolarisation { if (activateTrackingSys) { auto trackProng0 = candidate.template prong0_as(); auto trackProng1 = candidate.template prong1_as(); - if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { + if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { auto trackProng2 = candidate.template prongPi_as(); getTrackingInfos(std::vector{trackProng0, trackProng1, trackProng2}, absEtaTrackMin, numItsClsMin, numTpcClsMin); - } else if (channel == charm_polarisation::DecayChannel::LcToPKPi) { + } else if (Channel == charm_polarisation::DecayChannel::LcToPKPi) { auto trackProng2 = candidate.template prong2_as(); getTrackingInfos(std::vector{trackProng0, trackProng1, trackProng2}, absEtaTrackMin, numItsClsMin, numTpcClsMin); } @@ -1825,11 +1825,11 @@ struct HfTaskCharmPolarisation { float cosThetaStarRandom = -10.f; int8_t nMuons{0u}; - if constexpr (doMc) { + if constexpr (DoMc) { nMuons = candidate.nTracksDecayed(); } - if constexpr (withEP && !doMc) { + if constexpr (WithEp && !DoMc) { /// EP analysis float xQvec = (*qVecs).at(0); float yQvec = (*qVecs).at(1); @@ -1840,7 +1840,7 @@ struct HfTaskCharmPolarisation { if (activateTHnSparseCosThStarEP) { // EP cosThetaStarEP = qVecNorm.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()) / std::sqrt(qVecNorm.Mag2()); - fillRecoHistos(invMassCharmHadForSparse, ptCharmHad, numPvContributors, rapidity, invMassD0, invMassKPiLc, cosThetaStarEP, phiEP, outputMl, isRotatedCandidate, origin, ptBhadMother, resoChannelLc, absEtaTrackMin, numItsClsMin, numTpcClsMin, charge, nMuons, partRecoDstar); + fillRecoHistos(invMassCharmHadForSparse, ptCharmHad, numPvContributors, rapidity, invMassD0, invMassKPiLc, cosThetaStarEP, phiEP, outputMl, isRotatedCandidate, origin, ptBhadMother, resoChannelLc, absEtaTrackMin, numItsClsMin, numTpcClsMin, charge, nMuons, partRecoDstar); } } @@ -1848,31 +1848,31 @@ struct HfTaskCharmPolarisation { // helicity cosThetaStarHelicity = helicityVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()) / std::sqrt(helicityVec.Mag2()); phiHelicity = std::atan2(beamVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()), normalVec.Dot(threeVecDauCM) / (std::sqrt(threeVecDauCM.Mag2()) * std::sqrt(normalVec.Mag2()))); - fillRecoHistos(invMassCharmHadForSparse, ptCharmHad, numPvContributors, rapidity, invMassD0, invMassKPiLc, cosThetaStarHelicity, phiHelicity, outputMl, isRotatedCandidate, origin, ptBhadMother, resoChannelLc, absEtaTrackMin, numItsClsMin, numTpcClsMin, charge, nMuons, partRecoDstar); + fillRecoHistos(invMassCharmHadForSparse, ptCharmHad, numPvContributors, rapidity, invMassD0, invMassKPiLc, cosThetaStarHelicity, phiHelicity, outputMl, isRotatedCandidate, origin, ptBhadMother, resoChannelLc, absEtaTrackMin, numItsClsMin, numTpcClsMin, charge, nMuons, partRecoDstar); } if (activateTHnSparseCosThStarProduction) { // production cosThetaStarProduction = normalVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()) / std::sqrt(normalVec.Mag2()); phiProduction = std::atan2(normalVec.Dot(threeVecDauCM) / (std::sqrt(threeVecDauCM.Mag2()) * std::sqrt(normalVec.Mag2())), helicityVec.Dot(threeVecDauCM) / (std::sqrt(threeVecDauCM.Mag2()) * std::sqrt(helicityVec.Mag2()))); - fillRecoHistos(invMassCharmHadForSparse, ptCharmHad, numPvContributors, rapidity, invMassD0, invMassKPiLc, cosThetaStarProduction, phiProduction, outputMl, isRotatedCandidate, origin, ptBhadMother, resoChannelLc, absEtaTrackMin, numItsClsMin, numTpcClsMin, charge, nMuons, partRecoDstar); + fillRecoHistos(invMassCharmHadForSparse, ptCharmHad, numPvContributors, rapidity, invMassD0, invMassKPiLc, cosThetaStarProduction, phiProduction, outputMl, isRotatedCandidate, origin, ptBhadMother, resoChannelLc, absEtaTrackMin, numItsClsMin, numTpcClsMin, charge, nMuons, partRecoDstar); } if (activateTHnSparseCosThStarBeam) { // beam cosThetaStarBeam = beamVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()); phiBeam = std::atan2(helicityVec.Dot(threeVecDauCM) / (std::sqrt(threeVecDauCM.Mag2()) * std::sqrt(helicityVec.Mag2())), beamVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2())); - fillRecoHistos(invMassCharmHadForSparse, ptCharmHad, numPvContributors, rapidity, invMassD0, invMassKPiLc, cosThetaStarBeam, phiBeam, outputMl, isRotatedCandidate, origin, ptBhadMother, resoChannelLc, absEtaTrackMin, numItsClsMin, numTpcClsMin, charge, nMuons, partRecoDstar); + fillRecoHistos(invMassCharmHadForSparse, ptCharmHad, numPvContributors, rapidity, invMassD0, invMassKPiLc, cosThetaStarBeam, phiBeam, outputMl, isRotatedCandidate, origin, ptBhadMother, resoChannelLc, absEtaTrackMin, numItsClsMin, numTpcClsMin, charge, nMuons, partRecoDstar); } if (activateTHnSparseCosThStarRandom) { // random ROOT::Math::XYZVector randomVec = ROOT::Math::XYZVector(std::sin(thetaRandom) * std::cos(phiRandom), std::sin(thetaRandom) * std::sin(phiRandom), std::cos(thetaRandom)); cosThetaStarRandom = randomVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()); - fillRecoHistos(invMassCharmHadForSparse, ptCharmHad, numPvContributors, rapidity, invMassD0, invMassKPiLc, cosThetaStarRandom, -99.f, outputMl, isRotatedCandidate, origin, ptBhadMother, resoChannelLc, absEtaTrackMin, numItsClsMin, numTpcClsMin, charge, nMuons, partRecoDstar); + fillRecoHistos(invMassCharmHadForSparse, ptCharmHad, numPvContributors, rapidity, invMassD0, invMassKPiLc, cosThetaStarRandom, -99.f, outputMl, isRotatedCandidate, origin, ptBhadMother, resoChannelLc, absEtaTrackMin, numItsClsMin, numTpcClsMin, charge, nMuons, partRecoDstar); } /// Table for Lc->pKpi background studies /// Defined only in MC simulations, to study resonances and reflected signal - if constexpr (doMc && channel == charm_polarisation::DecayChannel::LcToPKPi) { - if constexpr (studyLcPKPiBkgMc) { + if constexpr (DoMc && Channel == charm_polarisation::DecayChannel::LcToPKPi) { + if constexpr (StudyLcPkPiBkgMc) { /****************************************************************************************** The code below can work only without grouping on "mcCollision". In fact, grouping by "mcCollision" introduces the following inconsistencies: @@ -2053,13 +2053,13 @@ struct HfTaskCharmPolarisation { /// \param mcParticle is the Mc particle /// \param mcParticles is the table of Mc particles /// \param numPvContributors is the number of PV contributors in the associated reco collision - template + template void runMcGenPolarisationAnalysis(Part const& mcParticle, Particles const& mcParticles, int numPvContributors, Cent const* centrality = nullptr) { - if constexpr (withCent) { + if constexpr (WithCent) { assert(qVecs && "Centrality analysis requested but Cent == nullptr"); } - if constexpr (withCent) { + if constexpr (WithCent) { if (*centrality < centralityMin || *centrality > centralityMax) { return; // skip this collision if outside of the centrality range } @@ -2073,7 +2073,7 @@ struct HfTaskCharmPolarisation { int8_t resoChannelLc = -1; int8_t charge = -99; bool partRecoDstar{false}; - if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { + if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { partRecoDstar = (std::abs(mcParticle.flagMcMatchGen()) == hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPiPi0) && (std::abs(mcParticle.flagMcMatchGenD0()) == hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiKPi0); bool signalDstar = (std::abs(mcParticle.flagMcMatchGen()) == hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi) && (std::abs(mcParticle.flagMcMatchGenD0()) == hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK); @@ -2095,7 +2095,7 @@ struct HfTaskCharmPolarisation { RecoDecay::getDaughters(mcParticle, &listDaughters, dauPdgs, 1); massDau = massPi; massCharmHad = massDstar; - } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPKPi) { if (std::abs(mcParticle.flagMcMatchGen()) != hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) { // this particle is not signal, skip return; } @@ -2124,7 +2124,7 @@ struct HfTaskCharmPolarisation { float pxDau{-1000.f}, pyDau{-1000.f}, pzDau{-1000.f}; for (const auto& dauIdx : listDaughters) { auto dauPart = mcParticles.rawIteratorAt(dauIdx - mcParticles.offset()); - if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { + if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { if (std::abs(dauPart.pdgCode()) == kPiPlus) { pxDau = dauPart.px(); pyDau = dauPart.py(); @@ -2141,7 +2141,7 @@ struct HfTaskCharmPolarisation { areDauInAcc = isDaughterInAcceptance(dauPartD0, 0.3, 0.8); } } - } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPKPi) { if (std::abs(dauPart.pdgCode()) == kProton) { pxDau = dauPart.px(); pyDau = dauPart.py(); diff --git a/PWGHF/D2H/Tasks/taskCharmResoToDTrkReduced.cxx b/PWGHF/D2H/Tasks/taskCharmResoToDTrkReduced.cxx index 347184a9248..f393d9693a7 100644 --- a/PWGHF/D2H/Tasks/taskCharmResoToDTrkReduced.cxx +++ b/PWGHF/D2H/Tasks/taskCharmResoToDTrkReduced.cxx @@ -204,14 +204,14 @@ struct HfTaskCharmResoToDTrkReduced { /// \param coll is a reduced collision /// \param bach0 is a bachelor of the candidate /// \param bach1 is a bachelor of the candidate - template + template void fillCand(const Cand& candidate, const Coll& collision, const CharmBach& bach0, const TrkBach& bach1) { // Base float massReso{0}, cosThetaStar{0}; int8_t sign{0}; float tpcNSigmaBach1{0}, tofNSigmaBach1{0}, tpcTofNSigmaBach1{0}; - if constexpr (channel == DecayChannel::D0Kplus) { + if constexpr (Channel == DecayChannel::D0Kplus) { massReso = useDeltaMass ? candidate.invMass() + MassD0 : candidate.invMass(); cosThetaStar = RecoDecay::cosThetaStar(std::array{bach0.pVector(), bach1.pVector()}, std::array{MassD0, MassKPlus}, massReso, 0); tpcNSigmaBach1 = bach1.tpcNSigmaKa(); @@ -229,7 +229,7 @@ struct HfTaskCharmResoToDTrkReduced { float ptGen{-1.}, invMassGen{-1}; int8_t origin{0}, flagMcMatchRec{0}, flagCharmBach{0}, flagCharmBachInterm{0}; int debugMcRec{-1}; - if constexpr (doMc) { + if constexpr (DoMc) { ptGen = candidate.ptGen(); origin = candidate.origin(); flagMcMatchRec = candidate.flagMcMatchRec(); @@ -238,7 +238,7 @@ struct HfTaskCharmResoToDTrkReduced { flagCharmBach = candidate.flagMcMatchRecD(); flagCharmBachInterm = candidate.flagMcMatchChanD(); if (fillOnlySignal) { - if (channel == DecayChannel::D0Kplus && + if (Channel == DecayChannel::D0Kplus && !hf_decay::hf_cand_reso::particlesToD0Kplus.contains(static_cast(std::abs(flagMcMatchRec)))) { return; } @@ -252,8 +252,8 @@ struct HfTaskCharmResoToDTrkReduced { // Ml float mlScoreBkg{-1.}, mlScorePrompt{-1.}, mlScoreNonPrompt{-1.}; - if constexpr (withMl) { - if constexpr (channel == DecayChannel::D0Kplus) { + if constexpr (WithMl) { + if constexpr (Channel == DecayChannel::D0Kplus) { if (bach1.sign() > 0 && !doWrongSign) { mlScoreBkg = bach0.mlScoreBkgMassHypo0(); mlScorePrompt = bach0.mlScorePromptMassHypo0(); @@ -334,7 +334,7 @@ struct HfTaskCharmResoToDTrkReduced { /// \param CharmBach is the reduced 3 prong table /// \param TrkBach is the reduced v0 table /// \param Cand is the candidates table - template + template void processData(Coll const&, Candidates const& candidates, CharmBach const&, aod::HfRedTrkNoParams const&) { for (const auto& cand : candidates) { @@ -354,7 +354,7 @@ struct HfTaskCharmResoToDTrkReduced { float massReso{0}; if (useDeltaMass) { - switch (channel) { + switch (Channel) { case DecayChannel::D0Kplus: massReso = cand.invMass() + MassD0; break; @@ -370,7 +370,7 @@ struct HfTaskCharmResoToDTrkReduced { auto coll = cand.template hfRedCollision_as(); auto bach0 = cand.template prong0_as(); auto bach1 = cand.template prong1_as(); - fillCand(cand, coll, bach0, bach1); + fillCand(cand, coll, bach0, bach1); } } @@ -385,7 +385,7 @@ struct HfTaskCharmResoToDTrkReduced { } /// Fill particle histograms (gen MC truth) - template + template void fillCandMcGen(aod::HfMcGenRedResos const& mcParticles) { for (const auto& particle : mcParticles) { @@ -396,7 +396,7 @@ struct HfTaskCharmResoToDTrkReduced { std::array ptProngs = {particle.ptProng0(), particle.ptProng1()}; std::array etaProngs = {particle.etaProng0(), particle.etaProng1()}; bool prongsInAcc = isProngInAcceptance(etaProngs[0], ptProngs[0]) && isProngInAcceptance(etaProngs[1], ptProngs[1]); - if (channel == DecayChannel::D0Kplus && + if (Channel == DecayChannel::D0Kplus && !hf_decay::hf_cand_reso::particlesToD0Kplus.contains(static_cast(std::abs(flag)))) { continue; } diff --git a/PWGHF/D2H/Tasks/taskCharmResoToDV0Reduced.cxx b/PWGHF/D2H/Tasks/taskCharmResoToDV0Reduced.cxx index 6d5ac96757a..e8ae3d8b903 100644 --- a/PWGHF/D2H/Tasks/taskCharmResoToDV0Reduced.cxx +++ b/PWGHF/D2H/Tasks/taskCharmResoToDV0Reduced.cxx @@ -221,7 +221,7 @@ struct HfTaskCharmResoToDV0Reduced { /// \param coll is a reduced collision /// \param bach0 is a bachelor of the candidate /// \param bach1 is a bachelor of the candidate - template + template void fillCand(const Cand& candidate, const Coll& collision, const CharmBach& bach0, const V0Bach& bach1) { // Base @@ -229,22 +229,22 @@ struct HfTaskCharmResoToDV0Reduced { int8_t sign{0}; int itsNClsSoftPi{0}, tpcNClsCrossedRowsSoftPi{0}; float tpcChi2NClSoftPi{0.}; - if constexpr (channel == DecayChannel::DstarK0s) { + if constexpr (Channel == DecayChannel::DstarK0s) { sign = bach0.sign(); massReso = useDeltaMass ? candidate.invMass() + MassDStar : candidate.invMass(); cosThetaStar = RecoDecay::cosThetaStar(std::array{bach0.pVector(), bach1.pVector()}, std::array{MassDStar, MassK0}, massReso, 0); itsNClsSoftPi = bach0.itsNClsSoftPi(); tpcNClsCrossedRowsSoftPi = bach0.tpcNClsCrossedRowsSoftPi(); tpcChi2NClSoftPi = bach0.tpcChi2NClSoftPi(); - } else if constexpr (channel == DecayChannel::DplusK0s) { + } else if constexpr (Channel == DecayChannel::DplusK0s) { sign = bach0.sign(); massReso = useDeltaMass ? candidate.invMass() + MassDPlus : candidate.invMass(); cosThetaStar = RecoDecay::cosThetaStar(std::array{bach0.pVector(), bach1.pVector()}, std::array{MassDPlus, MassK0}, massReso, 0); - } else if constexpr (channel == DecayChannel::DplusLambda) { + } else if constexpr (Channel == DecayChannel::DplusLambda) { sign = bach0.sign(); massReso = useDeltaMass ? candidate.invMass() + MassDPlus : candidate.invMass(); cosThetaStar = RecoDecay::cosThetaStar(std::array{bach0.pVector(), bach1.pVector()}, std::array{MassDPlus, MassLambda0}, massReso, 0); - } else if constexpr (channel == DecayChannel::D0Lambda) { + } else if constexpr (Channel == DecayChannel::D0Lambda) { massReso = useDeltaMass ? candidate.invMass() + MassD0 : candidate.invMass(); cosThetaStar = RecoDecay::cosThetaStar(std::array{bach0.pVector(), bach1.pVector()}, std::array{MassD0, MassLambda0}, massReso, 0); } @@ -258,7 +258,7 @@ struct HfTaskCharmResoToDV0Reduced { float ptGen{-1.}, invMassGen{-1}; int8_t origin{0}, flagMcMatchRec{0}, flagCharmBach{0}, flagCharmBachInterm{0}; int debugMcRec{-1}; - if constexpr (doMc) { + if constexpr (DoMc) { ptGen = candidate.ptGen(); origin = candidate.origin(); flagMcMatchRec = candidate.flagMcMatchRec(); @@ -267,19 +267,19 @@ struct HfTaskCharmResoToDV0Reduced { flagCharmBach = candidate.flagMcMatchRecD(); flagCharmBachInterm = candidate.flagMcMatchChanD(); if (fillOnlySignal) { - if (channel == DecayChannel::DstarK0s && + if (Channel == DecayChannel::DstarK0s && !hf_decay::hf_cand_reso::particlesToDstarK0s.contains(static_cast(std::abs(flagMcMatchRec)))) { return; } - if (channel == DecayChannel::DplusK0s && + if (Channel == DecayChannel::DplusK0s && !hf_decay::hf_cand_reso::particlesToDplusK0s.contains(static_cast(std::abs(flagMcMatchRec)))) { return; } - if (channel == DecayChannel::DplusLambda && + if (Channel == DecayChannel::DplusLambda && !hf_decay::hf_cand_reso::particlesToDplusLambda.contains(static_cast(std::abs(flagMcMatchRec)))) { return; } - if (channel == DecayChannel::D0Lambda && + if (Channel == DecayChannel::D0Lambda && !hf_decay::hf_cand_reso::particlesToD0Lambda.contains(static_cast(std::abs(flagMcMatchRec)))) { return; } @@ -293,8 +293,8 @@ struct HfTaskCharmResoToDV0Reduced { // Ml float mlScoreBkg{-1.}, mlScorePrompt{-1.}, mlScoreNonPrompt{-1.}; - if constexpr (withMl) { - if constexpr (channel == DecayChannel::D0Lambda) { + if constexpr (WithMl) { + if constexpr (Channel == DecayChannel::D0Lambda) { if (TESTBIT(bach1.v0Type(), BachelorType::Lambda) && !doWrongSign) { mlScoreBkg = bach0.mlScoreBkgMassHypo0(); mlScorePrompt = bach0.mlScorePromptMassHypo0(); @@ -380,7 +380,7 @@ struct HfTaskCharmResoToDV0Reduced { /// \param CharmBach is the reduced 3 prong table /// \param V0Bach is the reduced v0 table /// \param Cand is the candidates table - template + template void processData(Coll const&, Candidates const& candidates, CharmBach const&, aod::HfRedVzeros const&) { for (const auto& cand : candidates) { @@ -400,7 +400,7 @@ struct HfTaskCharmResoToDV0Reduced { float massReso{0}; if (useDeltaMass) { - switch (channel) { + switch (Channel) { case DecayChannel::DstarK0s: massReso = cand.invMass() + MassDStar; break; @@ -425,7 +425,7 @@ struct HfTaskCharmResoToDV0Reduced { auto coll = cand.template hfRedCollision_as(); auto bach0 = cand.template prong0_as(); auto bach1 = cand.template prong1_as(); - fillCand(cand, coll, bach0, bach1); + fillCand(cand, coll, bach0, bach1); } } @@ -440,7 +440,7 @@ struct HfTaskCharmResoToDV0Reduced { } /// Fill particle histograms (gen MC truth) - template + template void fillCandMcGen(aod::HfMcGenRedResos const& mcParticles) { for (const auto& particle : mcParticles) { @@ -451,19 +451,19 @@ struct HfTaskCharmResoToDV0Reduced { std::array ptProngs = {particle.ptProng0(), particle.ptProng1()}; std::array etaProngs = {particle.etaProng0(), particle.etaProng1()}; bool prongsInAcc = isProngInAcceptance(etaProngs[0], ptProngs[0]) && isProngInAcceptance(etaProngs[1], ptProngs[1]); - if (channel == DecayChannel::DstarK0s && + if (Channel == DecayChannel::DstarK0s && !hf_decay::hf_cand_reso::particlesToDstarK0s.contains(static_cast(std::abs(flag)))) { continue; } - if (channel == DecayChannel::DplusK0s && + if (Channel == DecayChannel::DplusK0s && !hf_decay::hf_cand_reso::particlesToDplusK0s.contains(static_cast(std::abs(flag)))) { continue; } - if (channel == DecayChannel::DplusLambda && + if (Channel == DecayChannel::DplusLambda && !hf_decay::hf_cand_reso::particlesToDplusLambda.contains(static_cast(std::abs(flag)))) { continue; } - if (channel == DecayChannel::D0Lambda && + if (Channel == DecayChannel::D0Lambda && !hf_decay::hf_cand_reso::particlesToD0Lambda.contains(static_cast(std::abs(flag)))) { continue; } diff --git a/PWGHF/D2H/Tasks/taskD0.cxx b/PWGHF/D2H/Tasks/taskD0.cxx index 3e4be3ca15c..5506a58cd88 100644 --- a/PWGHF/D2H/Tasks/taskD0.cxx +++ b/PWGHF/D2H/Tasks/taskD0.cxx @@ -321,7 +321,7 @@ struct HfTaskD0 { } } - template + template void processData(CandType const& candidates, CollType const&, aod::TracksWExtra const&) @@ -335,7 +335,7 @@ struct HfTaskD0 { } float massD0, massD0bar; - if constexpr (reconstructionType == aod::hf_cand::VertexerType::KfParticle) { + if constexpr (ReconstructionType == aod::hf_cand::VertexerType::KfParticle) { massD0 = candidate.kfGeoMassD0(); massD0bar = candidate.kfGeoMassD0bar(); } else { @@ -399,7 +399,7 @@ struct HfTaskD0 { auto trackNeg = candidate.template prong1_as(); // negative daughter int minItsClustersOfProngs = std::min(trackPos.itsNCls(), trackNeg.itsNCls()); int minTpcCrossedRowsOfProngs = std::min(trackPos.tpcNClsCrossedRows(), trackNeg.tpcNClsCrossedRows()); - if constexpr (applyMl) { + if constexpr (ApplyMl) { if (storeCentrality && storeOccupancy) { if (candidate.isSelD0() >= selectionFlagD0) { registry.fill(HIST("hBdtScoreVsMassVsPtVsPtBVsYVsOriginVsD0Type"), candidate.mlProbD0()[0], candidate.mlProbD0()[1], candidate.mlProbD0()[2], massD0, ptCandidate, hfHelper.yD0(candidate), SigD0, cent, occ); @@ -534,7 +534,7 @@ struct HfTaskD0 { PROCESS_SWITCH(HfTaskD0, processDataWithKFParticleMl, "process taskD0 with KFParticle and ML selections", false); // TODO: add processKFParticleMlCent - template + template void processMc(CandType const& candidates, soa::Join const& mcParticles, TracksSelQuality const&, @@ -561,7 +561,7 @@ struct HfTaskD0 { occ = o2::hf_occupancy::getOccupancyColl(collision, occEstimator); } float massD0, massD0bar; - if constexpr (reconstructionType == aod::hf_cand::VertexerType::KfParticle) { + if constexpr (ReconstructionType == aod::hf_cand::VertexerType::KfParticle) { massD0 = candidate.kfGeoMassD0(); massD0bar = candidate.kfGeoMassD0bar(); } else { @@ -688,7 +688,7 @@ struct HfTaskD0 { registry.fill(HIST("hDecLengthVsPtSig"), declengthCandidate, ptCandidate); registry.fill(HIST("hDecLengthxyVsPtSig"), declengthxyCandidate, ptCandidate); registry.fill(HIST("hMassSigD0"), massD0, ptCandidate, rapidityCandidate); - if constexpr (applyMl) { + if constexpr (ApplyMl) { if (storeCentrality && storeOccupancy) { registry.fill(HIST("hBdtScoreVsMassVsPtVsPtBVsYVsOriginVsD0Type"), candidate.mlProbD0()[0], candidate.mlProbD0()[1], candidate.mlProbD0()[2], massD0, ptCandidate, rapidityCandidate, SigD0, candidate.ptBhadMotherPart(), candidate.originMcRec(), numPvContributors, cent, occ); } else if (storeCentrality && !storeOccupancy) { @@ -730,7 +730,7 @@ struct HfTaskD0 { registry.fill(HIST("hMassBkgD0"), massD0, ptCandidate, rapidityCandidate); if (candidate.flagMcMatchRec() == -o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { registry.fill(HIST("hMassReflBkgD0"), massD0, ptCandidate, rapidityCandidate); - if constexpr (applyMl) { + if constexpr (ApplyMl) { if (storeCentrality && storeOccupancy) { registry.fill(HIST("hBdtScoreVsMassVsPtVsPtBVsYVsOriginVsD0Type"), candidate.mlProbD0()[0], candidate.mlProbD0()[1], candidate.mlProbD0()[2], massD0, ptCandidate, rapidityCandidate, ReflectedD0, candidate.ptBhadMotherPart(), candidate.originMcRec(), numPvContributors, cent, occ); } else if (storeCentrality && !storeOccupancy) { @@ -762,7 +762,7 @@ struct HfTaskD0 { registry.fill(HIST("hMassSigBkgD0bar"), massD0bar, ptCandidate, rapidityCandidate); if (candidate.flagMcMatchRec() == -o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { registry.fill(HIST("hMassSigD0bar"), massD0bar, ptCandidate, rapidityCandidate); - if constexpr (applyMl) { + if constexpr (ApplyMl) { if (storeCentrality && storeOccupancy) { registry.fill(HIST("hBdtScoreVsMassVsPtVsPtBVsYVsOriginVsD0Type"), candidate.mlProbD0bar()[0], candidate.mlProbD0bar()[1], candidate.mlProbD0bar()[2], massD0bar, ptCandidate, rapidityCandidate, SigD0bar, candidate.ptBhadMotherPart(), candidate.originMcRec(), numPvContributors, cent, occ); } else if (storeCentrality && !storeOccupancy) { @@ -791,7 +791,7 @@ struct HfTaskD0 { registry.fill(HIST("hMassBkgD0bar"), massD0bar, ptCandidate, rapidityCandidate); if (candidate.flagMcMatchRec() == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { registry.fill(HIST("hMassReflBkgD0bar"), massD0bar, ptCandidate, rapidityCandidate); - if constexpr (applyMl) { + if constexpr (ApplyMl) { if (storeCentrality && storeOccupancy) { registry.fill(HIST("hBdtScoreVsMassVsPtVsPtBVsYVsOriginVsD0Type"), candidate.mlProbD0bar()[0], candidate.mlProbD0bar()[1], candidate.mlProbD0bar()[2], massD0bar, ptCandidate, rapidityCandidate, ReflectedD0bar, candidate.ptBhadMotherPart(), candidate.originMcRec(), numPvContributors, cent, occ); } else if (storeCentrality && !storeOccupancy) { diff --git a/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx b/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx index 79b6fa89753..159d24a7541 100644 --- a/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx +++ b/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx @@ -201,7 +201,7 @@ struct HfTaskDirectedFlowCharmHadrons { /// Compute the scalar product /// \param collision is the collision with the Q vector information and event plane /// \param candidates are the selected candidates - template + template void runFlowAnalysis(CollsWithQvecs::iterator const& collision, T1 const& candidates, Trk const& /*tracks*/) @@ -263,7 +263,7 @@ struct HfTaskDirectedFlowCharmHadrons { } } } else if constexpr (std::is_same_v || std::is_same_v) { - switch (channel) { + switch (Channel) { case DecayChannel::D0ToPiK: massCand = hfHelper.invMassD0ToPiK(candidate); rapCand = hfHelper.yD0(candidate); diff --git a/PWGHF/D2H/Tasks/taskDplus.cxx b/PWGHF/D2H/Tasks/taskDplus.cxx index 18e2e59b26d..8f0e5332375 100644 --- a/PWGHF/D2H/Tasks/taskDplus.cxx +++ b/PWGHF/D2H/Tasks/taskDplus.cxx @@ -280,7 +280,7 @@ struct HfTaskDplus { /// \param centrality collision centrality /// \param occupancy collision occupancy /// \param numPvContributors contributors to the PV - template + template void fillSparseML(const T1& candidate, float ptbhad, int flagBHad, @@ -292,8 +292,8 @@ struct HfTaskDplus { for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { outputMl[iclass] = candidate.mlProbDplusToPiKPi()[classMl->at(iclass)]; } - if constexpr (isMc) { // MC - if constexpr (isMatched) { // Matched + if constexpr (IsMc) { // MC + if constexpr (IsMatched) { // Matched if (candidate.originMcRec() == RecoDecay::OriginType::Prompt) { // Prompt if (storeCentrality && storeOccupancy) { @@ -367,10 +367,10 @@ struct HfTaskDplus { // Fill histograms of quantities for the reconstructed Dplus candidates with MC matching /// \param candidate is candidate - template + template void fillHistoMCRec(const T1& candidate) { - if constexpr (isMatched) { + if constexpr (IsMatched) { auto ptRec = candidate.pt(); auto yRec = hfHelper.yDplus(candidate); registry.fill(HIST("hPtVsYRecSig_RecoSkim"), ptRec, yRec); @@ -479,7 +479,7 @@ struct HfTaskDplus { // Run analysis for the reconstructed Dplus candidates from data /// \param candidates are reconstructed candidates - template + template void runDataAnalysis(const T1& /*candidates*/, CollisionsCent const& /*colls*/) { float cent{-1.f}; @@ -487,7 +487,7 @@ struct HfTaskDplus { float numPvContr{-1.f}; float ptBhad{-1.f}; int flagBHad{-1}; - if constexpr (!fillMl) { + if constexpr (!FillMl) { for (const auto& candidate : selectedDPlusCandidates) { if ((yCandRecoMax >= 0. && std::abs(hfHelper.yDplus(candidate)) > yCandRecoMax)) { continue; @@ -522,7 +522,7 @@ struct HfTaskDplus { // Run analysis for the reconstructed Dplus candidates with MC matching /// \param recoCandidates are reconstructed candidates /// \param recoColls are reconstructed collisions - template + template void runAnalysisMcRec(McRecoCollisionsCent const& /*recoColls*/) { float cent{-1}; @@ -532,7 +532,7 @@ struct HfTaskDplus { int flagBHad{-1}; // MC rec. w/o Ml - if constexpr (!fillMl) { + if constexpr (!FillMl) { for (const auto& candidate : recoDPlusCandidates) { if ((yCandRecoMax >= 0. && std::abs(hfHelper.yDplus(candidate)) > yCandRecoMax)) { continue; @@ -565,9 +565,9 @@ struct HfTaskDplus { occ = o2::hf_occupancy::getOccupancyColl(collision, occEstimator); } } - if (storePvContributors) { - numPvContr = collision.numContrib(); - } + if (storePvContributors) { + numPvContr = collision.numContrib(); + } fillHisto(candidate); fillHistoMCRec(candidate); fillSparseML(candidate, ptBhad, flagBHad, cent, occ, numPvContr); @@ -601,7 +601,7 @@ struct HfTaskDplus { /// \param mcGenCollisions are the generated MC collisions /// \param mcRecoCollisions are the reconstructed MC collisions /// \param mcGenParticles are the generated MC particle candidates - template + template void runAnalysisMcGen(aod::McCollisions const& mcGenCollisions, McRecoCollisionsCent const& mcRecoCollisions, Cand const& mcGenParticles) @@ -640,7 +640,7 @@ struct HfTaskDplus { numPvContr = std::max(numPvContr, recCol.numContrib()); } fillHistoMCGen(particle); - if constexpr (fillMl) { + if constexpr (FillMl) { fillSparseMcGen(particle, ptGenB, flagGenB, cent, occ, numPvContr); } } diff --git a/PWGHF/D2H/Tasks/taskDs.cxx b/PWGHF/D2H/Tasks/taskDs.cxx index f1bde71490b..e7af652fa98 100644 --- a/PWGHF/D2H/Tasks/taskDs.cxx +++ b/PWGHF/D2H/Tasks/taskDs.cxx @@ -366,7 +366,7 @@ struct HfTaskDs { /// Evaluate centrality/multiplicity percentile using FT0M estimator /// \param candidate is candidate /// \return centrality/multiplicity percentile of the collision - template + template float getZEqMultColl(const Coll& collision, uint8_t nProngsContributorsPV) { auto multFT0A = collision.multFT0A() - nProngsContributorsPV; @@ -379,7 +379,7 @@ struct HfTaskDs { /// Evaluate centrality/multiplicity percentile using NTracksPV estimator /// \param candidate is candidate /// \return centrality/multiplicity percentile of the collision - template + template float getZEqMultColl(const Coll& collision, uint8_t nProngsContributorsPV) { auto multNTracksPV = collision.multNTracksPV() - nProngsContributorsPV; @@ -464,7 +464,7 @@ struct HfTaskDs { /// \param candidate is candidate /// \param dataType is data class, as defined in DataType enum /// \param finalState is either KKPi or PiKK, as defined in FinalState enum - template + template void fillSparse(const Cand& candidate, DataType dataType, FinalState finalState) { auto mass = finalState == FinalState::KKPi ? hfHelper.invMassDsToKKPi(candidate) : hfHelper.invMassDsToPiKK(candidate); @@ -487,7 +487,7 @@ struct HfTaskDs { std::get(histosPtr[dataType]["hSparseMass"])->Fill(mass, pt, evaluateCentralityCand(candidate), outputMl[0], outputMl[1], outputMl[2]); return; } - if constexpr (isMc) { + if constexpr (IsMc) { if (dataType == DataType::McDsNonPrompt || dataType == DataType::McDplusNonPrompt) { if (storeOccupancy) { std::get(histosPtr[dataType]["hSparseMass"])->Fill(mass, pt, evaluateCentralityCand(candidate), outputMl[0], outputMl[1], outputMl[2], candidate.template collision_as().numContrib(), candidate.ptBhadMotherPart(), getBHadMotherFlag(candidate.pdgBhadMotherPart()), o2::hf_occupancy::getOccupancyColl(candidate.template collision_as(), occEstimator)); @@ -509,7 +509,7 @@ struct HfTaskDs { /// \param candidate is candidate /// \param dataType is data class, as defined in DataType enum /// \param finalState is either KKPi or PiKK, as defined in FinalState enum - template + template void fillSparse(const Cand& candidate, DataType dataType, FinalState finalState) { auto mass = finalState == FinalState::KKPi ? hfHelper.invMassDsToKKPi(candidate) : hfHelper.invMassDsToPiKK(candidate); @@ -523,7 +523,7 @@ struct HfTaskDs { std::get(histosPtr[dataType]["hSparseMass"])->Fill(mass, pt, evaluateCentralityCand(candidate)); return; } - if constexpr (isMc) { + if constexpr (IsMc) { if (dataType == DataType::McDsNonPrompt || dataType == DataType::McDplusNonPrompt) { if (storeOccupancy) { std::get(histosPtr[dataType]["hSparseMass"])->Fill(mass, pt, evaluateCentralityCand(candidate), candidate.template collision_as().numContrib(), candidate.ptBhadMotherPart(), getBHadMotherFlag(candidate.pdgBhadMotherPart()), o2::hf_occupancy::getOccupancyColl(candidate.template collision_as(), occEstimator)); @@ -544,11 +544,11 @@ struct HfTaskDs { /// Fill histograms of quantities for the KKPi daugther-mass hypothesis /// \param candidate is candidate /// \param dataType is data class, as defined in DataType enum - template + template void fillHistoKKPi(const T1& candidate, DataType dataType) { auto pt = candidate.pt(); - fillSparse(candidate, dataType, FinalState::KKPi); + fillSparse(candidate, dataType, FinalState::KKPi); std::get(histosPtr[dataType]["hCos3PiK"])->Fill(hfHelper.cos3PiKDsToKKPi(candidate), pt); std::get(histosPtr[dataType]["hAbsCos3PiK"])->Fill(hfHelper.absCos3PiKDsToKKPi(candidate), pt); @@ -559,11 +559,11 @@ struct HfTaskDs { /// Fill histograms of quantities for the PiKK daugther-mass hypothesis /// \param candidate is candidate /// \param dataType is data class, as defined in DataType enum - template + template void fillHistoPiKK(const T1& candidate, DataType dataType) { auto pt = candidate.pt(); - fillSparse(candidate, dataType, FinalState::PiKK); + fillSparse(candidate, dataType, FinalState::PiKK); std::get(histosPtr[dataType]["hCos3PiK"])->Fill(hfHelper.cos3PiKDsToPiKK(candidate), pt); std::get(histosPtr[dataType]["hAbsCos3PiK"])->Fill(hfHelper.absCos3PiKDsToPiKK(candidate), pt); diff --git a/PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx b/PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx index 5b40ce67ce6..ac1acb661cf 100644 --- a/PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx +++ b/PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx @@ -310,7 +310,7 @@ struct HfTaskDstarToD0Pi { /// @param cols reconstructed collision with centrality /// @param selectedCands selected candidates with selection flag /// @param preslice preslice to slice - template + template void runTaskDstar(CollisionsWCent const& cols, T1 selectedCands, T2 preslice) { for (const auto& col : cols) { @@ -370,7 +370,7 @@ struct HfTaskDstarToD0Pi { nCandsSignalRegion++; } - if constexpr (applyMl) { + if constexpr (ApplyMl) { auto mlBdtScore = candDstar.mlProbDstarToD0Pi(); registry.fill(HIST("Yield/hDeltaInvMassVsPtVsCentVsBDTScore"), deltaMDstar, candDstar.pt(), centrality, mlBdtScore[0], mlBdtScore[1], mlBdtScore[2]); } @@ -393,7 +393,7 @@ struct HfTaskDstarToD0Pi { nCandsSignalRegion++; } - if constexpr (applyMl) { + if constexpr (ApplyMl) { auto mlBdtScore = candDstar.mlProbDstarToD0Pi(); registry.fill(HIST("Yield/hDeltaInvMassVsPtVsCentVsBDTScore"), deltaMAntiDstar, candDstar.pt(), centrality, mlBdtScore[0], mlBdtScore[1], mlBdtScore[2]); } @@ -425,7 +425,7 @@ struct HfTaskDstarToD0Pi { /// @tparam applyMl a boolean to apply ML or not /// @param candsMcRecSel reconstructed candidates with selection flag /// @param rowsMcPartilces generated particles table - template + template void runMcRecTaskDstar(T1 const& candsMcRecSel, CandDstarMcGen const& rowsMcPartilces) { int8_t signDstar = 0; @@ -474,7 +474,7 @@ struct HfTaskDstarToD0Pi { registry.fill(HIST("QA/hPtFullRecoDstarRecSig"), ptDstarRecSig); } - if constexpr (applyMl) { // All efficiency histograms at reconstruction level w/ ml + if constexpr (ApplyMl) { // All efficiency histograms at reconstruction level w/ ml if (isCentStudy) { auto bdtScore = candDstarMcRec.mlProbDstarToD0Pi(); registry.fill(HIST("Efficiency/hPtVsCentVsBDTScoreVsPvContribRecSig"), ptDstarRecSig, centrality, bdtScore[0], bdtScore[1], bdtScore[2], nPVContributors, weightValue); diff --git a/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx b/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx index 4327d1278ad..00de5c93c75 100644 --- a/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx +++ b/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx @@ -316,7 +316,7 @@ struct HfTaskFlowCharmHadrons { /// \param tracksQx is the X component of the Q vector for the tracks /// \param tracksQy is the Y component of the Q vector for the tracks /// \param channel is the decay channel - template + template void getQvecDtracks(T1 const& cand, std::vector& tracksQx, std::vector& tracksQy, @@ -337,7 +337,7 @@ struct HfTaskFlowCharmHadrons { tracksQx.push_back(std::cos(harmonic * phiTrack1) * pTTrack1 / ampl); tracksQy.push_back(std::sin(harmonic * phiTrack1) * pTTrack1 / ampl); - if constexpr (channel != DecayChannel::D0ToPiK && channel != DecayChannel::D0ToKPi) { + if constexpr (Channel != DecayChannel::D0ToPiK && Channel != DecayChannel::D0ToKPi) { float pXTrack2 = cand.pxProng2(); float pYTrack2 = cand.pyProng2(); float pTTrack2 = cand.ptProng2(); @@ -471,14 +471,14 @@ struct HfTaskFlowCharmHadrons { /// \param bc is the bunch crossing with timestamp information /// \param centrality is the collision centrality /// \return true if the collision is selected, false otherwise - template + template bool isCollSelected(CollsWithQvecs::iterator const& collision, aod::BCsWithTimestamps const&, float& centrality) { const auto occupancy = o2::hf_occupancy::getOccupancyColl(collision, occEstimator); - const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); - centrality = o2::hf_centrality::getCentralityColl(collision, centEstimator); + const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); + centrality = o2::hf_centrality::getCentralityColl(collision, CentEstimator); /// monitor the satisfied event selections hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy); @@ -537,7 +537,7 @@ struct HfTaskFlowCharmHadrons { /// Compute the scalar product /// \param collision is the collision with the Q vector information and event plane /// \param candidates are the selected candidates - template + template void runFlowAnalysis(CollsWithQvecs::iterator const& collision, T1 const& candidates) { @@ -565,7 +565,7 @@ struct HfTaskFlowCharmHadrons { std::vector outputMl = {-999., -999.}; if constexpr (std::is_same_v || std::is_same_v) { - switch (channel) { + switch (Channel) { case DecayChannel::DsToKKPi: massCand = hfHelper.invMassDsToKKPi(candidate); if constexpr (std::is_same_v) { @@ -594,7 +594,7 @@ struct HfTaskFlowCharmHadrons { } } else if constexpr (std::is_same_v || std::is_same_v) { nProngs = 2; - switch (channel) { + switch (Channel) { case DecayChannel::D0ToPiK: massCand = hfHelper.invMassD0ToPiK(candidate); if constexpr (std::is_same_v) { @@ -615,7 +615,7 @@ struct HfTaskFlowCharmHadrons { break; } } else if constexpr (std::is_same_v || std::is_same_v) { - switch (channel) { + switch (Channel) { case DecayChannel::LcToPKPi: massCand = hfHelper.invMassLcToPKPi(candidate); if constexpr (std::is_same_v) { @@ -636,7 +636,7 @@ struct HfTaskFlowCharmHadrons { break; } } else if constexpr (std::is_same_v || std::is_same_v) { - switch (channel) { + switch (Channel) { case DecayChannel::XicToPKPi: massCand = hfHelper.invMassXicToPKPi(candidate); if constexpr (std::is_same_v) { @@ -685,7 +685,7 @@ struct HfTaskFlowCharmHadrons { // std::cout<(candidate, tracksQx, tracksQy, ampl); + getQvecDtracks(candidate, tracksQx, tracksQy, ampl); } for (auto iTrack{0u}; iTrack < tracksQx.size(); ++iTrack) { xQVec -= tracksQx[iTrack]; diff --git a/PWGHF/D2H/Tasks/taskLbReduced.cxx b/PWGHF/D2H/Tasks/taskLbReduced.cxx index f756d9abc62..798f04ac3f7 100644 --- a/PWGHF/D2H/Tasks/taskLbReduced.cxx +++ b/PWGHF/D2H/Tasks/taskLbReduced.cxx @@ -388,7 +388,7 @@ struct HfTaskLbReduced { /// \param withLbMl is the flag to enable the filling with ML scores for the Lb candidate /// \param candidate is the Lb candidate /// \param candidatesLc is the table with Lc candidates - template + template void fillCand(Cand const& candidate, CandsLc const&) { @@ -409,14 +409,14 @@ struct HfTaskLbReduced { int8_t flagMcMatchRec = 0; int8_t flagWrongCollision = 0; bool isSignal = false; - if constexpr (doMc) { + if constexpr (DoMc) { flagMcMatchRec = candidate.flagMcMatchRec(); flagWrongCollision = candidate.flagWrongCollision(); isSignal = TESTBIT(std::abs(flagMcMatchRec), hf_cand_lb::DecayTypeMc::LbToLcPiToPKPiPi); } if (fillHistograms) { - if constexpr (doMc) { + if constexpr (DoMc) { if (isSignal) { registry.fill(HIST("hMassRecSig"), ptCandLb, hfHelper.invMassLbToLcPi(candidate)); registry.fill(HIST("hPtProng0RecSig"), ptCandLb, candidate.ptProng0()); @@ -436,15 +436,15 @@ struct HfTaskLbReduced { registry.fill(HIST("hDecLengthXyLcRecSig"), ptLc, decLenXyLc); registry.fill(HIST("hCospLcRecSig"), ptLc, cospLc); registry.fill(HIST("hCospXyLcRecSig"), ptLc, cospXyLc); - if constexpr (withDecayTypeCheck) { + if constexpr (WithDecayTypeCheck) { registry.fill(HIST("hDecayTypeMc"), 1 + hf_cand_lb::DecayTypeMc::LbToLcPiToPKPiPi, invMassLb, ptCandLb); } - if constexpr (withLcMl) { + if constexpr (WithLcMl) { registry.fill(HIST("hMlScoreBkgLcRecSig"), ptLc, candidate.prong0MlScoreBkg()); registry.fill(HIST("hMlScorePromptLcRecSig"), ptLc, candidate.prong0MlScorePrompt()); registry.fill(HIST("hMlScoreNonPromptLcRecSig"), ptLc, candidate.prong0MlScoreNonprompt()); } - if constexpr (withLbMl) { + if constexpr (WithLbMl) { registry.fill(HIST("hMlScoreSigLbRecSig"), ptCandLb, candidate.mlProbLbToLcPi()); } } else if (fillBackground) { @@ -466,15 +466,15 @@ struct HfTaskLbReduced { registry.fill(HIST("hDecLengthXyLcRecBg"), ptLc, decLenXyLc); registry.fill(HIST("hCospLcRecBg"), ptLc, cospLc); registry.fill(HIST("hCospXyLcRecBg"), ptLc, cospXyLc); - if constexpr (withLcMl) { + if constexpr (WithLcMl) { registry.fill(HIST("hMlScoreBkgLcRecBg"), ptLc, candidate.prong0MlScoreBkg()); registry.fill(HIST("hMlScorePromptLcRecBg"), ptLc, candidate.prong0MlScorePrompt()); registry.fill(HIST("hMlScoreNonPromptLcRecBg"), ptLc, candidate.prong0MlScoreNonprompt()); } - if constexpr (withLbMl) { + if constexpr (WithLbMl) { registry.fill(HIST("hMlScoreSigLbRecBg"), ptCandLb, candidate.mlProbLbToLcPi()); } - } else if constexpr (withDecayTypeCheck) { + } else if constexpr (WithDecayTypeCheck) { if (TESTBIT(flagMcMatchRec, hf_cand_lb::DecayTypeMc::LbToLcKToPKPiK)) { // Lb → Lc+ K- → (pK-π+) K- registry.fill(HIST("hDecayTypeMc"), 1 + hf_cand_lb::DecayTypeMc::LbToLcKToPKPiK, invMassLb, ptCandLb); } else if (TESTBIT(flagMcMatchRec, hf_cand_lb::DecayTypeMc::B0ToDplusPiToPiKPiPi)) { // // B0 → D- π+ → (π- K+ π-) π+ @@ -505,33 +505,33 @@ struct HfTaskLbReduced { registry.fill(HIST("hCospLc"), ptLc, cospLc); registry.fill(HIST("hCospXyLc"), ptLc, cospXyLc); - if constexpr (withLcMl) { + if constexpr (WithLcMl) { registry.fill(HIST("hMlScoreBkgLc"), ptLc, candidate.prong0MlScoreBkg()); registry.fill(HIST("hMlScorePromptLc"), ptLc, candidate.prong0MlScorePrompt()); registry.fill(HIST("hMlScoreNonPromptLc"), ptLc, candidate.prong0MlScoreNonprompt()); } - if constexpr (withLbMl) { + if constexpr (WithLbMl) { registry.fill(HIST("hMlScoreSigLb"), ptCandLb, candidate.mlProbLbToLcPi()); } } } if (fillSparses) { - if constexpr (withLcMl) { + if constexpr (WithLcMl) { if (isSignal) { - if constexpr (withLcMl) { + if constexpr (WithLcMl) { registry.fill(HIST("hMassPtCutVarsRecSig"), invMassLb, ptCandLb, candidate.decayLength(), candidate.decayLengthXY() / candidate.errorDecayLengthXY(), candidate.impactParameterProduct(), candidate.cpa(), invMassLc, ptLc, candidate.prong0MlScoreBkg(), candidate.prong0MlScoreNonprompt()); } else { registry.fill(HIST("hMassPtCutVarsRecSig"), invMassLb, ptCandLb, candidate.decayLength(), candidate.decayLengthXY() / candidate.errorDecayLengthXY(), candidate.impactParameterProduct(), candidate.cpa(), invMassLc, ptLc, decLenLc, cospLc); } } else if (fillBackground) { - if constexpr (withLcMl) { + if constexpr (WithLcMl) { registry.fill(HIST("hMassPtCutVarsRecBg"), invMassLb, ptCandLb, candidate.decayLength(), candidate.decayLengthXY() / candidate.errorDecayLengthXY(), candidate.impactParameterProduct(), candidate.cpa(), invMassLc, ptLc, candidate.prong0MlScoreBkg(), candidate.prong0MlScoreNonprompt()); } else { registry.fill(HIST("hMassPtCutVarsRecBg"), invMassLb, ptCandLb, candidate.decayLength(), candidate.decayLengthXY() / candidate.errorDecayLengthXY(), candidate.impactParameterProduct(), candidate.cpa(), invMassLc, ptLc, decLenLc, cospLc); } } } else { - if constexpr (withLcMl) { + if constexpr (WithLcMl) { registry.fill(HIST("hMassPtCutVars"), invMassLb, ptCandLb, candidate.decayLength(), candidate.decayLengthXY() / candidate.errorDecayLengthXY(), candidate.impactParameterProduct(), candidate.cpa(), invMassLc, ptLc, candidate.prong0MlScoreBkg(), candidate.prong0MlScoreNonprompt()); } else { registry.fill(HIST("hMassPtCutVars"), invMassLb, ptCandLb, candidate.decayLength(), candidate.decayLengthXY() / candidate.errorDecayLengthXY(), candidate.impactParameterProduct(), candidate.cpa(), invMassLc, ptLc, decLenLc, cospLc); @@ -540,23 +540,23 @@ struct HfTaskLbReduced { } if (fillTree) { float pseudoRndm = ptLc * 1000. - static_cast(ptLc * 1000); - if (flagMcMatchRec != 0 || (((doMc && fillBackground) || !doMc) && (ptCandLb >= ptMaxForDownSample || pseudoRndm < downSampleBkgFactor))) { + if (flagMcMatchRec != 0 || (((DoMc && fillBackground) || !DoMc) && (ptCandLb >= ptMaxForDownSample || pseudoRndm < downSampleBkgFactor))) { float prong0MlScoreBkg = -1.; float prong0MlScorePrompt = -1.; float prong0MlScoreNonprompt = -1.; float candidateMlScoreSig = -1; - if constexpr (withLcMl) { + if constexpr (WithLcMl) { prong0MlScoreBkg = candidate.prong0MlScoreBkg(); prong0MlScorePrompt = candidate.prong0MlScorePrompt(); prong0MlScoreNonprompt = candidate.prong0MlScoreNonprompt(); } - if constexpr (withLbMl) { + if constexpr (WithLbMl) { candidateMlScoreSig = candidate.mlProbLbToLcPi(); } auto prong1 = candidate.template prong1_as(); float ptMother = -1.; - if constexpr (doMc) { + if constexpr (DoMc) { ptMother = candidate.ptMother(); } @@ -617,7 +617,7 @@ struct HfTaskLbReduced { flagWrongCollision, ptMother); - if constexpr (withDecayTypeCheck) { + if constexpr (WithDecayTypeCheck) { hfRedLbMcCheck( flagMcMatchRec, flagWrongCollision, diff --git a/PWGHF/D2H/Tasks/taskLc.cxx b/PWGHF/D2H/Tasks/taskLc.cxx index f1fdc7ef961..6fee55b67e2 100644 --- a/PWGHF/D2H/Tasks/taskLc.cxx +++ b/PWGHF/D2H/Tasks/taskLc.cxx @@ -394,7 +394,7 @@ struct HfTaskLc { /// Fill MC histograms at reconstruction level /// \tparam fillMl switch to fill ML histograms - template + template void fillHistosMcRec(CollType const& collision, CandLcMcRec const& candidates, CandLcMcGen const& mcParticles) { @@ -565,7 +565,7 @@ struct HfTaskLc { if ((candidate.isSelLcToPKPi() >= selectionFlagLc) && pdgCodeProng0 == kProton) { massLc = hfHelper.invMassLcToPKPi(candidate); - if constexpr (fillMl) { + if constexpr (FillMl) { if (candidate.mlProbLcToPKPi().size() == NumberOfMlClasses) { outputBkg = candidate.mlProbLcToPKPi()[MlClassBackground]; /// bkg score outputPrompt = candidate.mlProbLcToPKPi()[MlClassPrompt]; /// prompt score @@ -594,7 +594,7 @@ struct HfTaskLc { if ((candidate.isSelLcToPiKP() >= selectionFlagLc) && pdgCodeProng0 == kPiPlus) { massLc = hfHelper.invMassLcToPiKP(candidate); - if constexpr (fillMl) { + if constexpr (FillMl) { if (candidate.mlProbLcToPiKP().size() == NumberOfMlClasses) { outputBkg = candidate.mlProbLcToPiKP()[MlClassBackground]; /// bkg score outputPrompt = candidate.mlProbLcToPiKP()[MlClassPrompt]; /// prompt score @@ -709,7 +709,7 @@ struct HfTaskLc { /// Fill histograms for real data /// \tparam fillMl switch to fill ML histograms - template + template void fillHistosData(CollType const& collision, CandType const& candidates) { auto thisCollId = collision.globalIndex(); @@ -788,7 +788,7 @@ struct HfTaskLc { if (candidate.isSelLcToPKPi() >= selectionFlagLc) { massLc = hfHelper.invMassLcToPKPi(candidate); - if constexpr (fillMl) { + if constexpr (FillMl) { if (candidate.mlProbLcToPKPi().size() == NumberOfMlClasses) { outputBkg = candidate.mlProbLcToPKPi()[MlClassBackground]; /// bkg score outputPrompt = candidate.mlProbLcToPKPi()[MlClassPrompt]; /// prompt score @@ -817,7 +817,7 @@ struct HfTaskLc { if (candidate.isSelLcToPiKP() >= selectionFlagLc) { massLc = hfHelper.invMassLcToPiKP(candidate); - if constexpr (fillMl) { + if constexpr (FillMl) { if (candidate.mlProbLcToPiKP().size() == NumberOfMlClasses) { outputBkg = candidate.mlProbLcToPiKP()[MlClassBackground]; /// bkg score outputPrompt = candidate.mlProbLcToPiKP()[MlClassPrompt]; /// prompt score @@ -848,26 +848,26 @@ struct HfTaskLc { } /// Run the analysis on real data /// \tparam fillMl switch to fill ML histograms - template + template void runAnalysisPerCollisionData(CollType const& collisions, CandType const& candidates) { for (const auto& collision : collisions) { - fillHistosData(collision, candidates); + fillHistosData(collision, candidates); } } /// Run the analysis on MC data /// \tparam fillMl switch to fill ML histograms - template + template void runAnalysisPerCollisionMc(CollType const& collisions, CandType const& candidates, CandLcMcGen const& mcParticles) { for (const auto& collision : collisions) { // MC Rec. - fillHistosMcRec(collision, candidates, mcParticles); + fillHistosMcRec(collision, candidates, mcParticles); } // MC gen. fillHistosMcGen(mcParticles, collisions); diff --git a/PWGHF/D2H/Tasks/taskOmegac0ToOmegapi.cxx b/PWGHF/D2H/Tasks/taskOmegac0ToOmegapi.cxx index 6fd41c8c2ef..c2b8dd976a7 100644 --- a/PWGHF/D2H/Tasks/taskOmegac0ToOmegapi.cxx +++ b/PWGHF/D2H/Tasks/taskOmegac0ToOmegapi.cxx @@ -177,7 +177,7 @@ struct HfTaskOmegac0ToOmegapi { return o2::hf_centrality::getCentralityColl(collision); } - template + template void processData(const CandType& candidates) { for (const auto& candidate : candidates) { @@ -189,7 +189,7 @@ struct HfTaskOmegac0ToOmegapi { continue; } - if constexpr (applyMl) { + if constexpr (ApplyMl) { registry.fill(HIST("hReco"), candidate.invMassCharmBaryon(), candidate.ptCharmBaryon(), candidate.kfRapOmegac(), candidate.mlProbOmegac()[0]); } else { registry.fill(HIST("hReco"), candidate.invMassCharmBaryon(), candidate.ptCharmBaryon(), candidate.kfRapOmegac()); @@ -197,12 +197,12 @@ struct HfTaskOmegac0ToOmegapi { } } - template + template void processDataCent(const CandType& candidates, CollType const& collisions) { for (const auto& collision : collisions) { auto thisCollId = collision.globalIndex(); - auto groupedOmegacCandidates = applyMl ? candidates.sliceBy(candOmegacKFMlPerCollision, thisCollId) : candidates.sliceBy(candOmegacKFPerCollision, thisCollId); + auto groupedOmegacCandidates = ApplyMl ? candidates.sliceBy(candOmegacKFMlPerCollision, thisCollId) : candidates.sliceBy(candOmegacKFPerCollision, thisCollId); auto numPvContributors = collision.numContrib(); for (const auto& candidate : groupedOmegacCandidates) { @@ -216,7 +216,7 @@ struct HfTaskOmegac0ToOmegapi { float cent = evaluateCentralityColl(collision); - if constexpr (applyMl) { + if constexpr (ApplyMl) { registry.fill(HIST("hReco"), candidate.invMassCharmBaryon(), candidate.ptCharmBaryon(), candidate.kfRapOmegac(), cent, numPvContributors, candidate.mlProbOmegac()[0]); if (fillTree) { @@ -230,7 +230,7 @@ struct HfTaskOmegac0ToOmegapi { } } - template + template void processMc(const CandType& candidates, Omegac0Gen const& mcParticles) { // MC rec. @@ -242,7 +242,7 @@ struct HfTaskOmegac0ToOmegapi { continue; } - if constexpr (applyMl) { + if constexpr (ApplyMl) { registry.fill(HIST("hReco"), candidate.invMassCharmBaryon(), candidate.ptCharmBaryon(), candidate.kfRapOmegac(), candidate.ptBhadMotherPart(), candidate.originMcRec(), candidate.flagMcMatchRec(), candidate.mlProbOmegac()[0]); } else { @@ -268,7 +268,7 @@ struct HfTaskOmegac0ToOmegapi { } } - template + template void processMcCent(const CandType& candidates, Omegac0Gen const& mcParticles, CollisionsWithMcLabels const& collisions, McCollisionWithCents const&) { @@ -285,7 +285,7 @@ struct HfTaskOmegac0ToOmegapi { uint16_t numPvContributors = collision.numContrib(); float mcCent = evaluateCentralityColl(collision.template mcCollision_as()); - if constexpr (applyMl) { + if constexpr (ApplyMl) { registry.fill(HIST("hReco"), candidate.invMassCharmBaryon(), candidate.ptCharmBaryon(), candidate.kfRapOmegac(), mcCent, numPvContributors, candidate.ptBhadMotherPart(), candidate.originMcRec(), candidate.flagMcMatchRec(), candidate.mlProbOmegac()[0]); } else { diff --git a/PWGHF/D2H/Tasks/taskSigmac.cxx b/PWGHF/D2H/Tasks/taskSigmac.cxx index bbc305b5dd6..e47f1133334 100644 --- a/PWGHF/D2H/Tasks/taskSigmac.cxx +++ b/PWGHF/D2H/Tasks/taskSigmac.cxx @@ -340,7 +340,7 @@ struct HfTaskSigmac { /// @brief function to fill the histograms needed in analysis (data) /// @param candidatesSc are the reconstructed candidate Σc0,++ /// @param - template + template void fillHistosData(aod::HfCandSc const& candidatesSc, CandsLc const& candidatesLc, aod::Tracks const&) @@ -429,7 +429,7 @@ struct HfTaskSigmac { /// fill it only if no MC operations are enabled, otherwise fill it in the processMC with the right origin and channel! const float softPiAbsDcaXY = std::abs(candSc.softPiDcaXY()); const float softPiAbsDcaZ = std::abs(candSc.softPiDcaZ()); - if constexpr (useMl) { + if constexpr (UseMl) { /// fill with ML information /// BDT index 0: bkg score; BDT index 2: non-prompt score std::array outputMl{-1., -1.}; @@ -512,7 +512,7 @@ struct HfTaskSigmac { /// fill it only if no MC operations are enabled, otherwise fill it in the processMC with the right origin and channel! const float softPiAbsDcaXY = std::abs(candSc.softPiDcaXY()); const float softPiAbsDcaZ = std::abs(candSc.softPiDcaZ()); - if constexpr (useMl) { + if constexpr (UseMl) { /// fill with ML information /// BDT index 0: bkg score; BDT index 2: non-prompt score std::array outputMl{-1., -1.}; @@ -550,7 +550,7 @@ struct HfTaskSigmac { double cpaLc(candidateLc.cpa()), cpaXYLc(candidateLc.cpaXY()); if (candidateLc.isSelLcToPKPi() >= 1) { massLc = hfHelper.invMassLcToPKPi(candidateLc); - if constexpr (useMl) { + if constexpr (UseMl) { /// fill with ML information /// BDT index 0: bkg score; BDT index 2: non-prompt score std::array outputMl{-1., -1.}; @@ -566,7 +566,7 @@ struct HfTaskSigmac { } if (candidateLc.isSelLcToPiKP() >= 1) { massLc = hfHelper.invMassLcToPiKP(candidateLc); - if constexpr (useMl) { + if constexpr (UseMl) { /// fill with ML information /// BDT index 0: bkg score; BDT index 2: non-prompt score std::array outputMl{-1., -1.}; @@ -589,7 +589,7 @@ struct HfTaskSigmac { /// @param candidatesSc are the reconstructed candidate Σc0,++ with MC info /// @param mcParticles are the generated particles with flags wheter they are Σc0,++ or not /// @param - template + template void fillHistosMc(soa::Join const& candidatesSc, soa::Join const& mcParticlesSc, soa::Join const& mcParticlesLc, @@ -899,7 +899,7 @@ struct HfTaskSigmac { int8_t particleAntiparticle = candSc.particleAntiparticle(); const float softPiAbsDcaXY = std::abs(candSc.softPiDcaXY()); const float softPiAbsDcaZ = std::abs(candSc.softPiDcaZ()); - if constexpr (useMl) { + if constexpr (UseMl) { /// fill with ML information /// BDT index 0: bkg score; BDT index 2: non-prompt score std::array outputMl{-1., -1.}; @@ -984,7 +984,7 @@ struct HfTaskSigmac { int8_t particleAntiparticle = candSc.particleAntiparticle(); const float softPiAbsDcaXY = std::abs(candSc.softPiDcaXY()); const float softPiAbsDcaZ = std::abs(candSc.softPiDcaZ()); - if constexpr (useMl) { + if constexpr (UseMl) { /// fill with ML information /// BDT index 0: bkg score; BDT index 2: non-prompt score std::array outputMl{-1., -1.}; @@ -1105,7 +1105,7 @@ struct HfTaskSigmac { int8_t particleAntiparticle = candSc.particleAntiparticle(); const float softPiAbsDcaXY = std::abs(candSc.softPiDcaXY()); const float softPiAbsDcaZ = std::abs(candSc.softPiDcaZ()); - if constexpr (useMl) { + if constexpr (UseMl) { /// fill with ML information /// BDT index 0: bkg score; BDT index 2: non-prompt score std::array outputMl{-1., -1.}; @@ -1188,7 +1188,7 @@ struct HfTaskSigmac { int8_t particleAntiparticle = candSc.particleAntiparticle(); const float softPiAbsDcaXY = std::abs(candSc.softPiDcaXY()); const float softPiAbsDcaZ = std::abs(candSc.softPiDcaZ()); - if constexpr (useMl) { + if constexpr (UseMl) { /// fill with ML information /// BDT index 0: bkg score; BDT index 2: non-prompt score std::array outputMl{-1., -1.}; @@ -1235,7 +1235,7 @@ struct HfTaskSigmac { } if (candidateLc.isSelLcToPKPi() >= 1 && pdgAbs == kProton) { massLc = hfHelper.invMassLcToPKPi(candidateLc); - if constexpr (useMl) { + if constexpr (UseMl) { /// fill with ML information /// BDT index 0: bkg score; BDT index 2: non-prompt score std::array outputMl{-1., -1.}; @@ -1251,7 +1251,7 @@ struct HfTaskSigmac { } if (candidateLc.isSelLcToPiKP() >= 1 && pdgAbs == kPiPlus) { massLc = hfHelper.invMassLcToPiKP(candidateLc); - if constexpr (useMl) { + if constexpr (UseMl) { /// fill with ML information /// BDT index 0: bkg score; BDT index 2: non-prompt score std::array outputMl{-1., -1.}; diff --git a/PWGHF/D2H/Tasks/taskXic.cxx b/PWGHF/D2H/Tasks/taskXic.cxx index 8a07bfbe3bd..f8f9ff97299 100644 --- a/PWGHF/D2H/Tasks/taskXic.cxx +++ b/PWGHF/D2H/Tasks/taskXic.cxx @@ -266,7 +266,7 @@ struct HfTaskXic { { return std::abs(etaProng) <= etaMaxAcceptance && ptProng >= ptMinAcceptance; } - template + template void analysisData(aod::Collision const& collision, Cands const& candidates, aod::TracksWDca const& tracks) @@ -370,7 +370,7 @@ struct HfTaskXic { const int ternaryCl = 3; if (candidate.isSelXicToPKPi() >= selectionFlagXic) { massXic = hfHelper.invMassXicToPKPi(candidate); - if constexpr (useMl) { + if constexpr (UseMl) { if (candidate.mlProbXicToPKPi().size() == ternaryCl) { outputBkg = candidate.mlProbXicToPKPi()[0]; /// bkg score outputPrompt = candidate.mlProbXicToPKPi()[1]; /// prompt score @@ -384,7 +384,7 @@ struct HfTaskXic { } if (candidate.isSelXicToPiKP() >= selectionFlagXic) { massXic = hfHelper.invMassXicToPiKP(candidate); - if constexpr (useMl) { + if constexpr (UseMl) { if (candidate.mlProbXicToPiKP().size() == ternaryCl) { outputBkg = candidate.mlProbXicToPiKP()[0]; /// bkg score outputPrompt = candidate.mlProbXicToPiKP()[1]; /// prompt score @@ -416,7 +416,7 @@ struct HfTaskXic { PROCESS_SWITCH(HfTaskXic, processDataWithMl, "Process Data with the ML method", false); // Fill MC histograms - template + template void analysisMc(Cands const& candidates, soa::Join const& mcParticles, aod::TracksWMc const&) @@ -506,7 +506,7 @@ struct HfTaskXic { double outputBkg(-1), outputPrompt(-1), outputFD(-1); const int ternaryCl = 3; if ((candidate.isSelXicToPKPi() >= selectionFlagXic) && pdgCodeProng0 == kProton) { - if constexpr (useMl) { + if constexpr (UseMl) { if (candidate.mlProbXicToPKPi().size() == ternaryCl) { outputBkg = candidate.mlProbXicToPKPi()[0]; /// bkg score outputPrompt = candidate.mlProbXicToPKPi()[1]; /// prompt score @@ -519,7 +519,7 @@ struct HfTaskXic { } } if ((candidate.isSelXicToPiKP() >= selectionFlagXic) && pdgCodeProng0 == kPiPlus) { - if constexpr (useMl) { + if constexpr (UseMl) { if (candidate.mlProbXicToPiKP().size() == ternaryCl) { outputBkg = candidate.mlProbXicToPiKP()[0]; /// bkg score outputPrompt = candidate.mlProbXicToPiKP()[1]; /// prompt score diff --git a/PWGHF/D2H/Tasks/taskXic0ToXiPi.cxx b/PWGHF/D2H/Tasks/taskXic0ToXiPi.cxx index 40efcbbcc31..1404a9941b0 100644 --- a/PWGHF/D2H/Tasks/taskXic0ToXiPi.cxx +++ b/PWGHF/D2H/Tasks/taskXic0ToXiPi.cxx @@ -150,7 +150,7 @@ struct HfTaskXic0ToXiPi { } } - template + template void processData(const CandType& candidates, CollType const&) { for (const auto& candidate : candidates) { @@ -161,7 +161,7 @@ struct HfTaskXic0ToXiPi { continue; } - if constexpr (applyMl) { + if constexpr (ApplyMl) { registry.fill(HIST("hBdtScoreVsMassVsPtVsPtBVsYVsOriginVsXic0Type"), candidate.mlProbToXiPi()[0], candidate.invMassCharmBaryon(), candidate.kfptXic(), candidate.kfRapXic()); } else { registry.fill(HIST("hMassVsPtVsPtBVsYVsOriginVsXic0Type"), candidate.invMassCharmBaryon(), candidate.kfptXic(), candidate.kfRapXic()); @@ -169,13 +169,13 @@ struct HfTaskXic0ToXiPi { } } - template + template void processDataCent(const CandType& candidates, CollType const& collisions) { for (const auto& collision : collisions) { auto thisCollId = collision.globalIndex(); - auto groupedXicCandidates = applyMl + auto groupedXicCandidates = ApplyMl ? candidates.sliceBy(candXicKFMlPerCollision, thisCollId) : candidates.sliceBy(candXicKFPerCollision, thisCollId); // auto numPvContributors = collision.numContrib(); @@ -190,13 +190,13 @@ struct HfTaskXic0ToXiPi { auto numPvContributors = candidate.template collision_as().numContrib(); float centrality = -999.f; - if constexpr (useCentrality) { + if constexpr (UseCentrality) { auto const& collision = candidate.template collision_as(); centrality = o2::hf_centrality::getCentralityColl(collision); } double kfptXic = RecoDecay::sqrtSumOfSquares(candidate.pxCharmBaryon(), candidate.pyCharmBaryon()); double kfptPiFromXic = RecoDecay::sqrtSumOfSquares(candidate.pxBachFromCharmBaryon(), candidate.pyBachFromCharmBaryon()); - if constexpr (applyMl) { + if constexpr (ApplyMl) { registry.fill(HIST("hBdtScoreVsMassVsPtVsYVsCentVsPtPion"), candidate.mlProbToXiPi()[0], candidate.invMassCharmBaryon(), @@ -218,7 +218,7 @@ struct HfTaskXic0ToXiPi { } } - template + template void processMc(const CandType& candidates, Xic0Gen const& mcParticles, TracksMc const&, @@ -236,7 +236,7 @@ struct HfTaskXic0ToXiPi { auto numPvContributors = candidate.template collision_as().numContrib(); double kfptXic = RecoDecay::sqrtSumOfSquares(candidate.pxCharmBaryon(), candidate.pyCharmBaryon()); - if constexpr (applyMl) { + if constexpr (ApplyMl) { registry.fill(HIST("hBdtScoreVsMassVsPtVsPtBVsYVsOriginVsXic0Type"), candidate.mlProbToXiPi()[0], candidate.invMassCharmBaryon(), @@ -334,23 +334,23 @@ struct HfTaskXic0ToXiPi { } PROCESS_SWITCH(HfTaskXic0ToXiPi, processDataWithKFParticleMlFT0M, "process HfTaskXic0ToXiPi with KFParticle and ML selections and with FT0M centrality", false); - void processMcWithKFParticle(Xic0CandsMcKF const& Xic0CandidatesMcKF, + void processMcWithKFParticle(Xic0CandsMcKF const& xic0CandidatesMcKf, Xic0Gen const& mcParticles, TracksMc const& tracks, CollisionsWithMcLabels const& collisions, aod::McCollisions const& mcCollisions) { - processMc(Xic0CandidatesMcKF, mcParticles, tracks, collisions, mcCollisions); + processMc(xic0CandidatesMcKf, mcParticles, tracks, collisions, mcCollisions); } PROCESS_SWITCH(HfTaskXic0ToXiPi, processMcWithKFParticle, "Process MC with KFParticle", false); - void processMcWithKFParticleMl(Xic0CandsMlMcKF const& Xic0CandidatesMlMcKF, + void processMcWithKFParticleMl(Xic0CandsMlMcKF const& xic0CandidatesMlMcKf, Xic0Gen const& mcParticles, TracksMc const& tracks, CollisionsWithMcLabels const& collisions, aod::McCollisions const& mcCollisions) { - processMc(Xic0CandidatesMlMcKF, mcParticles, tracks, collisions, mcCollisions); + processMc(xic0CandidatesMlMcKf, mcParticles, tracks, collisions, mcCollisions); } PROCESS_SWITCH(HfTaskXic0ToXiPi, processMcWithKFParticleMl, "Process MC with KFParticle and ML selections", false); }; diff --git a/PWGHF/D2H/Tasks/taskXicToXiPiPi.cxx b/PWGHF/D2H/Tasks/taskXicToXiPiPi.cxx index cad6f361d2e..58ba6805cee 100644 --- a/PWGHF/D2H/Tasks/taskXicToXiPiPi.cxx +++ b/PWGHF/D2H/Tasks/taskXicToXiPiPi.cxx @@ -286,14 +286,14 @@ struct HfTaskXicToXiPiPi { /// Fill THnSpare depending on whether ML selection is used // \param candidate is candidate - template + template void fillTHnSparse(const T1& candidate) { if (!enableTHn) { return; } - if constexpr (useMl) { + if constexpr (UseMl) { // with ML information double outputBkg = -99.; // bkg score double outputPrompt = -99.; // prompt score @@ -324,7 +324,7 @@ struct HfTaskXicToXiPiPi { } /// Function to fill histograms - template + template void fillHistograms(TCanTable const& candidates) { for (const auto& candidate : candidates) { @@ -369,7 +369,7 @@ struct HfTaskXicToXiPiPi { registry.fill(HIST("hMassXiPi2"), candidate.invMassXiPi1(), ptCandXic); // fill KFParticle specific histograms - if constexpr (useKfParticle) { + if constexpr (UseKfParticle) { registry.fill(HIST("hChi2GeoXi"), candidate.kfCascadeChi2(), ptCandXic); registry.fill(HIST("hChi2GeoLam"), candidate.kfV0Chi2(), ptCandXic); registry.fill(HIST("hChi2TopoXicPlusToPV"), candidate.chi2TopoXicPlusToPV(), ptCandXic); @@ -377,7 +377,7 @@ struct HfTaskXicToXiPiPi { // fill THnSparse if (enableTHn) { - if constexpr (useMl) { + if constexpr (UseMl) { fillTHnSparse(candidate); } else { fillTHnSparse(candidate); @@ -387,7 +387,7 @@ struct HfTaskXicToXiPiPi { } /// Function for MC analysis and histogram filling - template + template void fillHistogramsMc(TCandTable const& candidates, soa::Join const& mcParticles, aod::TracksWMc const&) @@ -441,7 +441,7 @@ struct HfTaskXicToXiPiPi { registry.fill(HIST("hCPAxyLambdaRecSig"), candidate.cpaLambda(), ptCandXic); // fill KFParticle specific histograms - if constexpr (useKfParticle) { + if constexpr (UseKfParticle) { registry.fill(HIST("hChi2geoXiRecSig"), candidate.kfCascadeChi2(), ptCandXic); registry.fill(HIST("hChi2geoLamRecSig"), candidate.kfV0Chi2(), ptCandXic); registry.fill(HIST("hChi2TopoXicPlusToPVRecSig"), candidate.chi2TopoXicPlusToPV(), ptCandXic); @@ -479,7 +479,7 @@ struct HfTaskXicToXiPiPi { registry.fill(HIST("hCPAxyLambdaRecBg"), candidate.cpaLambda(), ptCandXic); // fill KFParticle specific histograms - if constexpr (useKfParticle) { + if constexpr (UseKfParticle) { registry.fill(HIST("hChi2geoXiRecBg"), candidate.kfCascadeChi2(), ptCandXic); registry.fill(HIST("hChi2geoLamRecBg"), candidate.kfV0Chi2(), ptCandXic); registry.fill(HIST("hChi2TopoXicPlusToPVRecBg"), candidate.chi2TopoXicPlusToPV(), ptCandXic); @@ -497,7 +497,7 @@ struct HfTaskXicToXiPiPi { } // fill THnSparse if (enableTHn) { - if constexpr (useMl) { + if constexpr (UseMl) { fillTHnSparse(candidate); } else { fillTHnSparse(candidate); diff --git a/PWGHF/D2H/Utils/utilsRedDataFormat.h b/PWGHF/D2H/Utils/utilsRedDataFormat.h index f5115e59ac0..5956385e994 100644 --- a/PWGHF/D2H/Utils/utilsRedDataFormat.h +++ b/PWGHF/D2H/Utils/utilsRedDataFormat.h @@ -33,11 +33,11 @@ namespace o2::hf_evsel /// \tparam useEvSel use information from the EvSel table /// \tparam centEstimator centrality estimator /// \param collision collision to test against the selection criteria -template +template void checkEvSel(Coll const& collision, o2::hf_evsel::HfEventSelection& hfEvSel, int& zvtxColl, int& sel8Coll, int& zvtxAndSel8Coll, int& zvtxAndSel8CollAndSoftTrig, int& allSelColl, o2::framework::Service const& ccdb, o2::framework::HistogramRegistry& registry) { float centrality{-1.f}; - const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); + const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); if (!TESTBIT(rejectionMask, o2::hf_evsel::EventRejection::Trigger)) { sel8Coll++; } diff --git a/PWGHF/HFC/Macros/DhCorrelationExtraction.cxx b/PWGHF/HFC/Macros/DhCorrelationExtraction.cxx index fbe7b51b489..62ee854a29f 100644 --- a/PWGHF/HFC/Macros/DhCorrelationExtraction.cxx +++ b/PWGHF/HFC/Macros/DhCorrelationExtraction.cxx @@ -194,7 +194,7 @@ Bool_t DhCorrelationExtraction::SetDmesonSpecie(DmesonSpecie k) return kTRUE; } -Bool_t DhCorrelationExtraction::ExtractCorrelations(Double_t PtCandMin, Double_t PtCandMax, Double_t PtHadMin, Double_t PtHadMax, TString codeName) +Bool_t DhCorrelationExtraction::ExtractCorrelations(Double_t ptCandMin, Double_t ptCandMax, Double_t ptHadMin, Double_t ptHadMax, TString codeName) { if (fSubtractSoftPiME) { @@ -206,306 +206,306 @@ Bool_t DhCorrelationExtraction::ExtractCorrelations(Double_t PtCandMin, Double_t } // Histograms definition - TH2D* hSE_Sign[fNpools]; - TH2D* hME_Sign[fNpools]; - TH2D* hME_Sign_SoftPi[fNpools]; - TH2D* hSE_Sideb[fNpools]; - TH2D* hME_Sideb[fNpools]; - TH2D* hME_Sideb_SoftPi[fNpools]; - - TH2D* hCorr_Sign[fNpools]; - TH2D* hCorr_Sideb[fNpools]; - - TH2D* h2D_Sign; - TH2D* h2D_Sideb; - TH2D* h2D_Subtr; - - TH2D* h2D_FDTemplatePrompt; - TH2D* h2D_FDTemplateNonPrompt; - - TH1D* h1D_Sign; - TH1D* h1D_Sideb; - TH1D* h1D_Subtr; - TH1D* h1D_SignNorm; - TH1D* h1D_SidebNorm; - TH1D* h1D_SubtrNorm; - TH1D* h1D_FDTemplatePrompt; - TH1D* h1D_FDTemplateNonPrompt; - TH1D* h1D_TemplateTotal; - TH1D* h1D_SubtrFDNorm; - TH1D* h1D_PrimaryPartCorr; - TH1D* h1D_AllPartCorr; - TH1D* h1D_SecPartFrac; - TH1D* h1D_SubtrNorm_SecPart; - TH1D* h1D_BaselineSubtr; - TH1D* h1D_ReflCorr; - TH1D* h1D_ReflCorr_BaselineSubtr; + TH2D* hSeSign[fNpools]; + TH2D* hMeSign[fNpools]; + TH2D* hMeSignSoftPi[fNpools]; + TH2D* hSeSideb[fNpools]; + TH2D* hMeSideb[fNpools]; + TH2D* hMeSidebSoftPi[fNpools]; + + TH2D* hCorrSign[fNpools]; + TH2D* hCorrSideb[fNpools]; + + TH2D* h2DSign; + TH2D* h2DSideb; + TH2D* h2DSubtr; + + TH2D* h2DFdTemplatePrompt; + TH2D* h2DFdTemplateNonPrompt; + + TH1D* h1DSign; + TH1D* h1DSideb; + TH1D* h1DSubtr; + TH1D* h1DSignNorm; + TH1D* h1DSidebNorm; + TH1D* h1DSubtrNorm; + TH1D* h1DFdTemplatePrompt; + TH1D* h1DFdTemplateNonPrompt; + TH1D* h1DTemplateTotal; + TH1D* h1DSubtrFdNorm; + TH1D* h1DPrimaryPartCorr; + TH1D* h1DAllPartCorr; + TH1D* h1DSecPartFrac; + TH1D* h1DSubtrNormSecPart; + TH1D* h1DBaselineSubtr; + TH1D* h1DReflCorr; + TH1D* h1DReflCorrBaselineSubtr; TH1D* hModul; TH1D* hBeforeModulCorr; - Double_t FDPromptFrac; + Double_t fdPromptFrac; // if (fIntegratePtBins && iBinPtHad>0) continue; for (int iPool = 0; iPool < fNpools; iPool++) { // Retrieve 2D plots for SE and ME, signal and bkg regions, for each pTbin and pool - hSE_Sign[iPool] = GetCorrelHisto(kSE, kSign, iPool, PtCandMin, PtCandMax, PtHadMin, PtHadMax); + hSeSign[iPool] = GetCorrelHisto(kSE, kSign, iPool, ptCandMin, ptCandMax, ptHadMin, ptHadMax); std::cout << "Got SE histogram signal region" << std::endl; - hME_Sign[iPool] = GetCorrelHisto(kME, kSign, iPool, PtCandMin, PtCandMax, PtHadMin, PtHadMax); + hMeSign[iPool] = GetCorrelHisto(kME, kSign, iPool, ptCandMin, ptCandMax, ptHadMin, ptHadMax); std::cout << "Got ME histogram signal region" << std::endl; - hSE_Sideb[iPool] = GetCorrelHisto(kSE, kSideb, iPool, PtCandMin, PtCandMax, PtHadMin, PtHadMax); + hSeSideb[iPool] = GetCorrelHisto(kSE, kSideb, iPool, ptCandMin, ptCandMax, ptHadMin, ptHadMax); std::cout << "Got SE histogram sdeband region" << std::endl; - hME_Sideb[iPool] = GetCorrelHisto(kME, kSideb, iPool, PtCandMin, PtCandMax, PtHadMin, PtHadMax); + hMeSideb[iPool] = GetCorrelHisto(kME, kSideb, iPool, ptCandMin, ptCandMax, ptHadMin, ptHadMax); std::cout << "Got ME histogram sdeband region" << std::endl; - hSE_Sign[iPool]->Sumw2(); - hME_Sign[iPool]->Sumw2(); - hSE_Sideb[iPool]->Sumw2(); - hME_Sideb[iPool]->Sumw2(); + hSeSign[iPool]->Sumw2(); + hMeSign[iPool]->Sumw2(); + hSeSideb[iPool]->Sumw2(); + hMeSideb[iPool]->Sumw2(); // rebin axes deltaEta and deltaPhi if (fRebinAngCorr) { - hSE_Sign[iPool]->Rebin2D(fRebinAxisDeltaEta, fRebinAxisDeltaPhi); // Xaxis: deltaEta, Yaxis: deltaPhi - hSE_Sideb[iPool]->Rebin2D(fRebinAxisDeltaEta, fRebinAxisDeltaPhi); - hME_Sign[iPool]->Rebin2D(fRebinAxisDeltaEta, fRebinAxisDeltaPhi); - hME_Sideb[iPool]->Rebin2D(fRebinAxisDeltaEta, fRebinAxisDeltaPhi); + hSeSign[iPool]->Rebin2D(fRebinAxisDeltaEta, fRebinAxisDeltaPhi); // Xaxis: deltaEta, Yaxis: deltaPhi + hSeSideb[iPool]->Rebin2D(fRebinAxisDeltaEta, fRebinAxisDeltaPhi); + hMeSign[iPool]->Rebin2D(fRebinAxisDeltaEta, fRebinAxisDeltaPhi); + hMeSideb[iPool]->Rebin2D(fRebinAxisDeltaEta, fRebinAxisDeltaPhi); if (fSubtractSoftPiME) { - hME_Sideb_SoftPi[iPool]->Rebin2D(fRebinAxisDeltaEta, fRebinAxisDeltaPhi); + hMeSidebSoftPi[iPool]->Rebin2D(fRebinAxisDeltaEta, fRebinAxisDeltaPhi); } std::cout << "SE and ME histograms rebinned" << std::endl; } if (fDebug >= 1) { - TCanvas* c = new TCanvas(Form("cSE_Original_%d_%1.1fto%1.1f", iPool, PtHadMin, PtHadMax), Form("cSE_Original_%s_pool%d_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), iPool, PtCandMin, PtCandMax, PtHadMin, PtHadMax), 100, 100, 1600, 900); + TCanvas* c = new TCanvas(Form("cSE_Original_%d_%1.1fto%1.1f", iPool, ptHadMin, ptHadMax), Form("cSE_Original_%s_pool%d_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), iPool, ptCandMin, ptCandMax, ptHadMin, ptHadMax), 100, 100, 1600, 900); c->Divide(2, 1); c->cd(1); - hSE_Sign[iPool]->SetMinimum(0); - hSE_Sign[iPool]->Draw("lego2"); + hSeSign[iPool]->SetMinimum(0); + hSeSign[iPool]->Draw("lego2"); c->cd(2); - hSE_Sideb[iPool]->SetMinimum(0); - hSE_Sideb[iPool]->Draw("lego2"); - c->SaveAs(Form("Output_CorrelationExtraction_%s_png/CorrSE_Original_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.png", codeName.Data(), fDmesonLabel.Data(), PtCandMin, PtCandMax, PtHadMin, PtHadMax)); - c->SaveAs(Form("Output_CorrelationExtraction_%s_Root/CorrSE_Original_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.root", codeName.Data(), fDmesonLabel.Data(), PtCandMin, PtCandMax, PtHadMin, PtHadMax)); + hSeSideb[iPool]->SetMinimum(0); + hSeSideb[iPool]->Draw("lego2"); + c->SaveAs(Form("Output_CorrelationExtraction_%s_png/CorrSE_Original_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.png", codeName.Data(), fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax)); + c->SaveAs(Form("Output_CorrelationExtraction_%s_Root/CorrSE_Original_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.root", codeName.Data(), fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax)); } if (fDebug >= 1) { - TCanvas* c = new TCanvas(Form("cME_Original_%d_%1.1fto%1.1f", iPool, PtHadMin, PtHadMax), Form("cME_Original_%s_pool%d_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), iPool, PtCandMin, PtCandMax, PtHadMin, PtHadMax), 100, 100, 1600, 900); + TCanvas* c = new TCanvas(Form("cME_Original_%d_%1.1fto%1.1f", iPool, ptHadMin, ptHadMax), Form("cME_Original_%s_pool%d_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), iPool, ptCandMin, ptCandMax, ptHadMin, ptHadMax), 100, 100, 1600, 900); c->Divide(2, 1); c->cd(1); - hME_Sign[iPool]->SetMinimum(0); - hME_Sign[iPool]->Draw("lego2"); + hMeSign[iPool]->SetMinimum(0); + hMeSign[iPool]->Draw("lego2"); c->cd(2); - hME_Sideb[iPool]->SetMinimum(0); - hME_Sideb[iPool]->Draw("lego2"); - c->SaveAs(Form("Output_CorrelationExtraction_%s_png/CorrME_Original_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.png", codeName.Data(), fDmesonLabel.Data(), PtCandMin, PtCandMax, PtHadMin, PtHadMax)); - c->SaveAs(Form("Output_CorrelationExtraction_%s_Root/CorrME_Original_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.root", codeName.Data(), fDmesonLabel.Data(), PtCandMin, PtCandMax, PtHadMin, PtHadMax)); + hMeSideb[iPool]->SetMinimum(0); + hMeSideb[iPool]->Draw("lego2"); + c->SaveAs(Form("Output_CorrelationExtraction_%s_png/CorrME_Original_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.png", codeName.Data(), fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax)); + c->SaveAs(Form("Output_CorrelationExtraction_%s_Root/CorrME_Original_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.root", codeName.Data(), fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax)); } // Scale bkg plots by ratio of signal region/sidebands - hSE_Sideb[iPool]->Scale(fBkgScaleFactor); - hME_Sideb[iPool]->Scale(fBkgScaleFactor); // when normalised this factor should cancel out + hSeSideb[iPool]->Scale(fBkgScaleFactor); + hMeSideb[iPool]->Scale(fBkgScaleFactor); // when normalised this factor should cancel out std::cout << "[INFO] fBkgScaleFactor = " << fBkgScaleFactor << std::endl; - hSE_Sideb[iPool]->SetEntries(hSE_Sideb[iPool]->GetEntries() * fBkgScaleFactor); - hME_Sideb[iPool]->SetEntries(hME_Sideb[iPool]->GetEntries() * fBkgScaleFactor); + hSeSideb[iPool]->SetEntries(hSeSideb[iPool]->GetEntries() * fBkgScaleFactor); + hMeSideb[iPool]->SetEntries(hMeSideb[iPool]->GetEntries() * fBkgScaleFactor); if (fSubtractSoftPiME) { - hME_Sideb_SoftPi[iPool]->Scale(fBkgScaleFactor); - hME_Sideb_SoftPi[iPool]->SetEntries(hME_Sideb_SoftPi[iPool]->GetEntries() * fBkgScaleFactor); + hMeSidebSoftPi[iPool]->Scale(fBkgScaleFactor); + hMeSidebSoftPi[iPool]->SetEntries(hMeSidebSoftPi[iPool]->GetEntries() * fBkgScaleFactor); } // Normalize ME plots for the entries in (deltaEta, deltaPhi) = (0, 0) - NormalizeMEplot(hME_Sign[iPool], hME_Sign_SoftPi[iPool]); - NormalizeMEplot(hME_Sideb[iPool], hME_Sideb_SoftPi[iPool]); + NormalizeMEplot(hMeSign[iPool], hMeSignSoftPi[iPool]); + NormalizeMEplot(hMeSideb[iPool], hMeSidebSoftPi[iPool]); // Apply Event Mixing Correction - hCorr_Sign[iPool] = reinterpret_cast(hSE_Sign[iPool]->Clone(Form("hCorr_Sign_Pool%d", iPool))); - hCorr_Sign[iPool]->Sumw2(); - hCorr_Sign[iPool]->Divide(hME_Sign[iPool]); - - hCorr_Sideb[iPool] = reinterpret_cast(hSE_Sideb[iPool]->Clone(Form("hCorr_Sideb_Pool%d", iPool))); - hCorr_Sideb[iPool]->Sumw2(); - hCorr_Sideb[iPool]->Divide(hME_Sideb[iPool]); - - Double_t N_SEsign = 0, N_SEsideb = 0, N_sign = 0, N_sideb = 0; - for (int i = 1; i <= hCorr_Sign[iPool]->GetXaxis()->GetNbins(); i++) { - for (int j = 1; j <= hCorr_Sign[iPool]->GetYaxis()->GetNbins(); j++) { - N_SEsign += hSE_Sign[iPool]->GetBinContent(i, j); - N_SEsideb += hSE_Sideb[iPool]->GetBinContent(i, j); - N_sign += hCorr_Sign[iPool]->GetBinContent(i, j); - N_sideb += hCorr_Sideb[iPool]->GetBinContent(i, j); + hCorrSign[iPool] = reinterpret_cast(hSeSign[iPool]->Clone(Form("hCorr_Sign_Pool%d", iPool))); + hCorrSign[iPool]->Sumw2(); + hCorrSign[iPool]->Divide(hMeSign[iPool]); + + hCorrSideb[iPool] = reinterpret_cast(hSeSideb[iPool]->Clone(Form("hCorr_Sideb_Pool%d", iPool))); + hCorrSideb[iPool]->Sumw2(); + hCorrSideb[iPool]->Divide(hMeSideb[iPool]); + + Double_t nSEsign = 0, nSEsideb = 0, nSign = 0, nSideb = 0; + for (int i = 1; i <= hCorrSign[iPool]->GetXaxis()->GetNbins(); i++) { + for (int j = 1; j <= hCorrSign[iPool]->GetYaxis()->GetNbins(); j++) { + nSEsign += hSeSign[iPool]->GetBinContent(i, j); + nSEsideb += hSeSideb[iPool]->GetBinContent(i, j); + nSign += hCorrSign[iPool]->GetBinContent(i, j); + nSideb += hCorrSideb[iPool]->GetBinContent(i, j); } } - hSE_Sign[iPool]->SetEntries(N_SEsign); - hSE_Sideb[iPool]->SetEntries(N_SEsideb); - hCorr_Sign[iPool]->SetEntries(N_sign); - hCorr_Sideb[iPool]->SetEntries(N_sideb); + hSeSign[iPool]->SetEntries(nSEsign); + hSeSideb[iPool]->SetEntries(nSEsideb); + hCorrSign[iPool]->SetEntries(nSign); + hCorrSideb[iPool]->SetEntries(nSideb); if (fDebug >= 1) { - TCanvas* c = new TCanvas(Form("cSEME_%d_%1.1fto%1.1f", iPool, PtHadMin, PtHadMax), Form("cSEME_%s_pool%d_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), iPool, PtCandMin, PtCandMax, PtHadMin, PtHadMax), 100, 100, 1600, 900); + TCanvas* c = new TCanvas(Form("cSEME_%d_%1.1fto%1.1f", iPool, ptHadMin, ptHadMax), Form("cSEME_%s_pool%d_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), iPool, ptCandMin, ptCandMax, ptHadMin, ptHadMax), 100, 100, 1600, 900); c->Divide(3, 2); c->cd(1); - hSE_Sign[iPool]->SetMinimum(0); - hSE_Sign[iPool]->Draw("lego2"); + hSeSign[iPool]->SetMinimum(0); + hSeSign[iPool]->Draw("lego2"); c->cd(2); - hME_Sign[iPool]->SetMinimum(0); - hME_Sign[iPool]->Draw("lego2"); + hMeSign[iPool]->SetMinimum(0); + hMeSign[iPool]->Draw("lego2"); c->cd(3); - hCorr_Sign[iPool]->SetMinimum(0); - hCorr_Sign[iPool]->Draw("lego2"); + hCorrSign[iPool]->SetMinimum(0); + hCorrSign[iPool]->Draw("lego2"); c->cd(4); - hSE_Sideb[iPool]->SetMinimum(0); - hSE_Sideb[iPool]->Draw("lego2"); + hSeSideb[iPool]->SetMinimum(0); + hSeSideb[iPool]->Draw("lego2"); c->cd(5); - hME_Sideb[iPool]->SetMinimum(0); - hME_Sideb[iPool]->Draw("lego2"); + hMeSideb[iPool]->SetMinimum(0); + hMeSideb[iPool]->Draw("lego2"); c->cd(6); - hCorr_Sideb[iPool]->SetMinimum(0); - hCorr_Sideb[iPool]->Draw("lego2"); - c->SaveAs(Form("Output_CorrelationExtraction_%s_png/CorrSEandME_%s_Canvas_PtCand%.0fto%.0f_Pool%d_PtAssoc%.0fto%.0f.png", codeName.Data(), fDmesonLabel.Data(), PtCandMin, PtCandMax, iPool, PtHadMin, PtHadMax)); - c->SaveAs(Form("Output_CorrelationExtraction_%s_Root/CorrSEandME_%s_Canvas_PtCand%.0fto%.0f_Pool%d_PtAssoc%.0fto%.0f.root", codeName.Data(), fDmesonLabel.Data(), PtCandMin, PtCandMax, iPool, PtHadMin, PtHadMax)); + hCorrSideb[iPool]->SetMinimum(0); + hCorrSideb[iPool]->Draw("lego2"); + c->SaveAs(Form("Output_CorrelationExtraction_%s_png/CorrSEandME_%s_Canvas_PtCand%.0fto%.0f_Pool%d_PtAssoc%.0fto%.0f.png", codeName.Data(), fDmesonLabel.Data(), ptCandMin, ptCandMax, iPool, ptHadMin, ptHadMax)); + c->SaveAs(Form("Output_CorrelationExtraction_%s_Root/CorrSEandME_%s_Canvas_PtCand%.0fto%.0f_Pool%d_PtAssoc%.0fto%.0f.root", codeName.Data(), fDmesonLabel.Data(), ptCandMin, ptCandMax, iPool, ptHadMin, ptHadMax)); } // Pools integration if (iPool == 0) { - h2D_Sign = reinterpret_cast(hCorr_Sign[0]->Clone("h2D_Sign")); - h2D_Sideb = reinterpret_cast(hCorr_Sideb[0]->Clone("h2D_Sideb")); - h2D_Sign->Sumw2(); - h2D_Sideb->Sumw2(); + h2DSign = reinterpret_cast(hCorrSign[0]->Clone("h2D_Sign")); + h2DSideb = reinterpret_cast(hCorrSideb[0]->Clone("h2D_Sideb")); + h2DSign->Sumw2(); + h2DSideb->Sumw2(); } else { - h2D_Sign->Add(hCorr_Sign[iPool]); - h2D_Sideb->Add(hCorr_Sideb[iPool]); + h2DSign->Add(hCorrSign[iPool]); + h2DSideb->Add(hCorrSideb[iPool]); } } // end pool loop // Draw 2D plots (Signal region and Sidebands) - TCanvas* c2D = new TCanvas(Form("c2D_IntPools_PtHad%.0fto%.0f", PtHadMin, PtHadMax), Form("c2D_%s_IntPools_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), PtHadMin, PtHadMax), 100, 100, 1500, 800); - SetTH2HistoStyle(h2D_Sign, Form("Signal region, %.0f < p^{%s}_{T} < %.0f GeV/c, %.0f < p^{assoc}_{T} < %.0f GeV/c", PtCandMin, fDmesonLabel.Data(), PtCandMax, PtHadMin, PtHadMax), "#Delta#eta", "#Delta#phi [rad]", "entries", 1.6, 1.6, 1.6, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04); - SetTH2HistoStyle(h2D_Sideb, Form("Sideband region, %.0f < p^{%s}_{T} < %.0f GeV/c, %.0f < p^{assoc}_{T} < %.0f GeV/c", PtCandMin, fDmesonLabel.Data(), PtCandMax, PtHadMin, PtHadMax), "#Delta#eta", "#Delta#phi [rad]", "#frac{Y_{Bkg}}{Y_{SB}} entries", 1.6, 1.6, 1.6, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04); + TCanvas* c2D = new TCanvas(Form("c2D_IntPools_PtHad%.0fto%.0f", ptHadMin, ptHadMax), Form("c2D_%s_IntPools_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), ptHadMin, ptHadMax), 100, 100, 1500, 800); + SetTH2HistoStyle(h2DSign, Form("Signal region, %.0f < p^{%s}_{T} < %.0f GeV/c, %.0f < p^{assoc}_{T} < %.0f GeV/c", ptCandMin, fDmesonLabel.Data(), ptCandMax, ptHadMin, ptHadMax), "#Delta#eta", "#Delta#phi [rad]", "entries", 1.6, 1.6, 1.6, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04); + SetTH2HistoStyle(h2DSideb, Form("Sideband region, %.0f < p^{%s}_{T} < %.0f GeV/c, %.0f < p^{assoc}_{T} < %.0f GeV/c", ptCandMin, fDmesonLabel.Data(), ptCandMax, ptHadMin, ptHadMax), "#Delta#eta", "#Delta#phi [rad]", "#frac{Y_{Bkg}}{Y_{SB}} entries", 1.6, 1.6, 1.6, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04); c2D->Divide(2, 1); c2D->cd(1); - h2D_Sign->SetMinimum(0); - h2D_Sign->Draw("lego2"); + h2DSign->SetMinimum(0); + h2DSign->Draw("lego2"); c2D->cd(2); - h2D_Sideb->SetMinimum(0); - h2D_Sideb->Draw("lego2"); - c2D->SaveAs(Form("Output_CorrelationExtraction_%s_png/h2D_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.png", codeName.Data(), fDmesonLabel.Data(), PtCandMin, PtCandMax, PtHadMin, PtHadMax)); - c2D->SaveAs(Form("Output_CorrelationExtraction_%s_Root/h2D_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.root", codeName.Data(), fDmesonLabel.Data(), PtCandMin, PtCandMax, PtHadMin, PtHadMax)); + h2DSideb->SetMinimum(0); + h2DSideb->Draw("lego2"); + c2D->SaveAs(Form("Output_CorrelationExtraction_%s_png/h2D_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.png", codeName.Data(), fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax)); + c2D->SaveAs(Form("Output_CorrelationExtraction_%s_Root/h2D_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.root", codeName.Data(), fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax)); // Get FD correlations for FD subtraction if (fFDsubtraction) { - h2D_FDTemplatePrompt = GetFDTemplateHisto(kPrompt, PtCandMin, PtCandMax, PtHadMin, PtHadMax); - h2D_FDTemplateNonPrompt = GetFDTemplateHisto(kFD, PtCandMin, PtCandMax, PtHadMin, PtHadMax); + h2DFdTemplatePrompt = GetFDTemplateHisto(kPrompt, ptCandMin, ptCandMax, ptHadMin, ptHadMax); + h2DFdTemplateNonPrompt = GetFDTemplateHisto(kFD, ptCandMin, ptCandMax, ptHadMin, ptHadMax); // h1D_BaselineSubtr - FDPromptFrac = GetFDPromptFrac(PtCandMin, PtCandMax, PtHadMin, PtHadMax); + fdPromptFrac = GetFDPromptFrac(ptCandMin, ptCandMax, ptHadMin, ptHadMax); if (fRebinFDCorr) { - h2D_FDTemplatePrompt->Rebin2D(fRebinAxisDeltaEta, fRebinAxisDeltaPhi); - h2D_FDTemplateNonPrompt->Rebin2D(fRebinAxisDeltaEta, fRebinAxisDeltaPhi); + h2DFdTemplatePrompt->Rebin2D(fRebinAxisDeltaEta, fRebinAxisDeltaPhi); + h2DFdTemplateNonPrompt->Rebin2D(fRebinAxisDeltaEta, fRebinAxisDeltaPhi); } if (fDebug >= 1) { - TCanvas* c = new TCanvas(Form("cFDTemplate_PtCand%.0fto%.0f_PtHad%.0fto%.0f", PtCandMin, PtCandMax, PtHadMin, PtHadMax), Form("cFDTemplate_%s_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), PtCandMin, PtCandMax, PtHadMin, PtHadMax)); + TCanvas* c = new TCanvas(Form("cFDTemplate_PtCand%.0fto%.0f_PtHad%.0fto%.0f", ptCandMin, ptCandMax, ptHadMin, ptHadMax), Form("cFDTemplate_%s_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax)); c->Divide(2, 1); c->cd(1); - h2D_FDTemplatePrompt->SetMinimum(0); - h2D_FDTemplatePrompt->Draw("lego2"); + h2DFdTemplatePrompt->SetMinimum(0); + h2DFdTemplatePrompt->Draw("lego2"); c->cd(2); - h2D_FDTemplateNonPrompt->SetMinimum(0); - h2D_FDTemplateNonPrompt->Draw("lego2"); - c->SaveAs(Form("Output_CorrelationExtraction_%s_png/CorrFDTemplate_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.png", codeName.Data(), fDmesonLabel.Data(), PtCandMin, PtCandMax, PtHadMin, PtHadMax)); + h2DFdTemplateNonPrompt->SetMinimum(0); + h2DFdTemplateNonPrompt->Draw("lego2"); + c->SaveAs(Form("Output_CorrelationExtraction_%s_png/CorrFDTemplate_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.png", codeName.Data(), fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax)); } } // Bkg subtraction (2D plot) - TCanvas* c2D_Sub = new TCanvas(Form("c2D_Subtr_IntPools_PtHAd%.0fto%.0f", PtHadMin, PtHadMax), Form("c2D_%s_Subtr_IntPools_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), PtHadMin, PtHadMax), 100, 100, 1500, 800); - h2D_Subtr = reinterpret_cast(h2D_Sign->Clone("h2D_Subtr")); - h2D_Subtr->Sumw2(); - h2D_Subtr->Add(h2D_Sideb, -1); - h2D_Subtr->SetEntries(h2D_Sign->GetEntries() - h2D_Sideb->GetEntries()); - h2D_Subtr->SetTitle("Signal region after sideb. subt. corr. - 2D"); - h2D_Subtr->Draw("lego2"); - c2D_Sub->SaveAs(Form("Output_CorrelationExtraction_%s_png/h2D_%s_Subtr_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.png", codeName.Data(), fDmesonLabel.Data(), PtCandMin, PtCandMax, PtHadMin, PtHadMax)); - c2D_Sub->SaveAs(Form("Output_CorrelationExtraction_%s_Root/h2D_%s_Subtr_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.root", codeName.Data(), fDmesonLabel.Data(), PtCandMin, PtCandMax, PtHadMin, PtHadMax)); + TCanvas* c2DSub = new TCanvas(Form("c2D_Subtr_IntPools_PtHAd%.0fto%.0f", ptHadMin, ptHadMax), Form("c2D_%s_Subtr_IntPools_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), ptHadMin, ptHadMax), 100, 100, 1500, 800); + h2DSubtr = reinterpret_cast(h2DSign->Clone("h2D_Subtr")); + h2DSubtr->Sumw2(); + h2DSubtr->Add(h2DSideb, -1); + h2DSubtr->SetEntries(h2DSign->GetEntries() - h2DSideb->GetEntries()); + h2DSubtr->SetTitle("Signal region after sideb. subt. corr. - 2D"); + h2DSubtr->Draw("lego2"); + c2DSub->SaveAs(Form("Output_CorrelationExtraction_%s_png/h2D_%s_Subtr_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.png", codeName.Data(), fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax)); + c2DSub->SaveAs(Form("Output_CorrelationExtraction_%s_Root/h2D_%s_Subtr_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.root", codeName.Data(), fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax)); // 1D projection - h1D_Sign = h2D_Sign->ProjectionY("h1D_Sign"); // projection on deltaPhi axis - h1D_Sideb = h2D_Sideb->ProjectionY("h1D_Sideb"); - h1D_Sign->SetTitle("Signal region correlations"); - h1D_Sideb->SetTitle("Sidebands correlations"); - h1D_Sign->Scale(1. / h1D_Sign->GetXaxis()->GetBinWidth(1)); - h1D_Sideb->Scale(1. / h1D_Sideb->GetXaxis()->GetBinWidth(1)); + h1DSign = h2DSign->ProjectionY("h1D_Sign"); // projection on deltaPhi axis + h1DSideb = h2DSideb->ProjectionY("h1D_Sideb"); + h1DSign->SetTitle("Signal region correlations"); + h1DSideb->SetTitle("Sidebands correlations"); + h1DSign->Scale(1. / h1DSign->GetXaxis()->GetBinWidth(1)); + h1DSideb->Scale(1. / h1DSideb->GetXaxis()->GetBinWidth(1)); // Bkg subtraction (1D plot) - h1D_Subtr = reinterpret_cast(h1D_Sign->Clone("h1D_Subtr")); - h1D_Subtr->Sumw2(); - h1D_Subtr->Add(h1D_Sideb, -1); - h1D_Subtr->SetEntries(h1D_Sign->GetEntries() - h1D_Sideb->GetEntries()); - h1D_Subtr->SetTitle("Signal region after sideb. subt. corr."); + h1DSubtr = reinterpret_cast(h1DSign->Clone("h1D_Subtr")); + h1DSubtr->Sumw2(); + h1DSubtr->Add(h1DSideb, -1); + h1DSubtr->SetEntries(h1DSign->GetEntries() - h1DSideb->GetEntries()); + h1DSubtr->SetTitle("Signal region after sideb. subt. corr."); // Draw 1D plots (Signal region, Sidebands, S-SB (subtr.)) - TCanvas* c1D = new TCanvas(Form("c1D_IntPools_PtCand%.0fto%.0f_PtHad%.0fto%.0f", PtCandMin, PtCandMax, PtHadMin, PtHadMax), Form("c1D_%s_IntPools_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), PtHadMin, PtHadMax), 100, 100, 1600, 500); + TCanvas* c1D = new TCanvas(Form("c1D_IntPools_PtCand%.0fto%.0f_PtHad%.0fto%.0f", ptCandMin, ptCandMax, ptHadMin, ptHadMax), Form("c1D_%s_IntPools_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), ptHadMin, ptHadMax), 100, 100, 1600, 500); c1D->Divide(3, 1); c1D->cd(1); - h1D_Sign->Draw(); + h1DSign->Draw(); c1D->cd(2); - h1D_Sideb->Draw(); + h1DSideb->Draw(); c1D->cd(3); - h1D_Subtr->Draw(); - c1D->SaveAs(Form("Output_CorrelationExtraction_%s_png/h1D_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.png", codeName.Data(), fDmesonLabel.Data(), PtCandMin, PtCandMax, PtHadMin, PtHadMax)); - c1D->SaveAs(Form("Output_CorrelationExtraction_%s_Root/h1D_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.root", codeName.Data(), fDmesonLabel.Data(), PtCandMin, PtCandMax, PtHadMin, PtHadMax)); + h1DSubtr->Draw(); + c1D->SaveAs(Form("Output_CorrelationExtraction_%s_png/h1D_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.png", codeName.Data(), fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax)); + c1D->SaveAs(Form("Output_CorrelationExtraction_%s_Root/h1D_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.root", codeName.Data(), fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax)); if (fDebug >= 1) { - h1D_SignNorm = reinterpret_cast(h1D_Sign->Clone("h1D_Sign_Norm")); - h1D_SidebNorm = reinterpret_cast(h1D_Sideb->Clone("h1D_Sideb_Norm")); - h1D_SignNorm->Scale(1. / (fSgnYieldNorm + fBkgYield)); + h1DSignNorm = reinterpret_cast(h1DSign->Clone("h1D_Sign_Norm")); + h1DSidebNorm = reinterpret_cast(h1DSideb->Clone("h1D_Sideb_Norm")); + h1DSignNorm->Scale(1. / (fSgnYieldNorm + fBkgYield)); // h1D_SidebNorm -> Scale(1./fBkgYield); - h1D_SidebNorm->Scale(1. / fBkgScaleFactor); - h1D_SidebNorm->Scale(1. / fSBYield); - h1D_SignNorm->SetMarkerStyle(kFullCircle); - h1D_SignNorm->SetMarkerSize(1.2); - h1D_SignNorm->SetLineColor(kRed); - h1D_SignNorm->SetMarkerColor(kRed); - h1D_SignNorm->SetLineWidth(2); - h1D_SidebNorm->SetMinimum(0); - h1D_SidebNorm->SetMarkerStyle(kFullSquare); - h1D_SidebNorm->SetMarkerSize(1.2); - h1D_SidebNorm->SetLineColor(kBlue); - h1D_SidebNorm->SetMarkerColor(kBlue); - h1D_SidebNorm->SetLineWidth(2); - h1D_SidebNorm->SetTitle(Form("%.0f < p_{T} < %.0f", PtCandMin, PtCandMax)); - TCanvas* c = new TCanvas(Form("c_IntPools_PtCand%.0fto%.0f_PtHad%.0fto%.0f", PtCandMin, PtCandMax, PtHadMin, PtHadMax), ""); + h1DSidebNorm->Scale(1. / fBkgScaleFactor); + h1DSidebNorm->Scale(1. / fSBYield); + h1DSignNorm->SetMarkerStyle(kFullCircle); + h1DSignNorm->SetMarkerSize(1.2); + h1DSignNorm->SetLineColor(kRed); + h1DSignNorm->SetMarkerColor(kRed); + h1DSignNorm->SetLineWidth(2); + h1DSidebNorm->SetMinimum(0); + h1DSidebNorm->SetMarkerStyle(kFullSquare); + h1DSidebNorm->SetMarkerSize(1.2); + h1DSidebNorm->SetLineColor(kBlue); + h1DSidebNorm->SetMarkerColor(kBlue); + h1DSidebNorm->SetLineWidth(2); + h1DSidebNorm->SetTitle(Form("%.0f < p_{T} < %.0f", ptCandMin, ptCandMax)); + TCanvas* c = new TCanvas(Form("c_IntPools_PtCand%.0fto%.0f_PtHad%.0fto%.0f", ptCandMin, ptCandMax, ptHadMin, ptHadMax), ""); c->cd(); - h1D_SidebNorm->Draw(); - h1D_SignNorm->Draw("same"); - c->SaveAs(Form("Output_CorrelationExtraction_%s_png/ComparisonSignalSidebCorr_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.png", codeName.Data(), fDmesonLabel.Data(), PtCandMin, PtCandMax, PtHadMin, PtHadMax)); - c->SaveAs(Form("Output_CorrelationExtraction_%s_Root/ComparisonSignalSidebCorr_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.root", codeName.Data(), fDmesonLabel.Data(), PtCandMin, PtCandMax, PtHadMin, PtHadMax)); + h1DSidebNorm->Draw(); + h1DSignNorm->Draw("same"); + c->SaveAs(Form("Output_CorrelationExtraction_%s_png/ComparisonSignalSidebCorr_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.png", codeName.Data(), fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax)); + c->SaveAs(Form("Output_CorrelationExtraction_%s_Root/ComparisonSignalSidebCorr_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.root", codeName.Data(), fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax)); } // Apply normalization to number of triggers - h1D_SubtrNorm = reinterpret_cast(h1D_Subtr->Clone("h1D_SubtrNorm")); - h1D_SubtrNorm->Sumw2(); - h1D_SubtrNorm->Scale(1. / fSgnYieldNorm); - h1D_SubtrNorm->SetTitle("Signal region after sideb. subt. corr. - Normalized to # of triggers"); + h1DSubtrNorm = reinterpret_cast(h1DSubtr->Clone("h1D_SubtrNorm")); + h1DSubtrNorm->Sumw2(); + h1DSubtrNorm->Scale(1. / fSgnYieldNorm); + h1DSubtrNorm->SetTitle("Signal region after sideb. subt. corr. - Normalized to # of triggers"); // Correction for bias B to D topologies if (fCorrBiasBtoD) { - hModul = EvaluateMCClosModulations(PtCandMin, PtCandMax, PtHadMin, PtHadMax); - TCanvas* c1D_corrBbias = new TCanvas(Form("c1D_corrBbias_IntPools_PtCand%.0fto%.0f_PtHad%.0fto%.0f", PtCandMin, PtCandMax, PtHadMin, PtHadMax), Form("c1D_corrBbias_%s_IntPools_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), PtHadMin, PtHadMax), 100, 100, 1600, 500); - c1D_corrBbias->cd(); - hBeforeModulCorr = reinterpret_cast(h1D_SubtrNorm->Clone("hBeforeModulCorr")); + hModul = EvaluateMCClosModulations(ptCandMin, ptCandMax, ptHadMin, ptHadMax); + TCanvas* c1DCorrBbias = new TCanvas(Form("c1D_corrBbias_IntPools_PtCand%.0fto%.0f_PtHad%.0fto%.0f", ptCandMin, ptCandMax, ptHadMin, ptHadMax), Form("c1D_corrBbias_%s_IntPools_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), ptHadMin, ptHadMax), 100, 100, 1600, 500); + c1DCorrBbias->cd(); + hBeforeModulCorr = reinterpret_cast(h1DSubtrNorm->Clone("hBeforeModulCorr")); hBeforeModulCorr->SetLineColor(kViolet - 3); hBeforeModulCorr->GetYaxis()->SetRangeUser(0., 5.); hBeforeModulCorr->Draw(); - h1D_SubtrNorm->Multiply(hModul); - h1D_SubtrNorm->Draw("same"); - c1D_corrBbias->SaveAs(Form("Output_CorrelationExtraction_%s_png/ComparisonCorrBiasBtoD_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.png", codeName.Data(), fDmesonLabel.Data(), PtCandMin, PtCandMax, PtHadMin, PtHadMax)); - c1D_corrBbias->SaveAs(Form("Output_CorrelationExtraction_%s_Root/ComparisonCorrBiasBtoD_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.root", codeName.Data(), fDmesonLabel.Data(), PtCandMin, PtCandMax, PtHadMin, PtHadMax)); - - TFile* file = new TFile(Form("Output_CorrelationExtraction_%s_Root/SystematicCorrBiasBtoD_%s_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.root", codeName.Data(), fDmesonLabel.Data(), PtCandMin, PtCandMax, PtHadMin, PtHadMax), "RECREATE"); // Open file in write mode - TH1D* h1D_SubtrNorm_Clone = reinterpret_cast(h1D_SubtrNorm->Clone("h1D_SubtrNorm_Clone")); - h1D_SubtrNorm_Clone = ReflectCorrHistogram(h1D_SubtrNorm_Clone); + h1DSubtrNorm->Multiply(hModul); + h1DSubtrNorm->Draw("same"); + c1DCorrBbias->SaveAs(Form("Output_CorrelationExtraction_%s_png/ComparisonCorrBiasBtoD_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.png", codeName.Data(), fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax)); + c1DCorrBbias->SaveAs(Form("Output_CorrelationExtraction_%s_Root/ComparisonCorrBiasBtoD_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.root", codeName.Data(), fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax)); + + TFile* file = new TFile(Form("Output_CorrelationExtraction_%s_Root/SystematicCorrBiasBtoD_%s_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.root", codeName.Data(), fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax), "RECREATE"); // Open file in write mode + TH1D* h1DSubtrNormClone = reinterpret_cast(h1DSubtrNorm->Clone("h1D_SubtrNorm_Clone")); + h1DSubtrNormClone = ReflectCorrHistogram(h1DSubtrNormClone); hBeforeModulCorr = ReflectCorrHistogram(hBeforeModulCorr); - TH1D* hSystematicCorrBiasBtoD = reinterpret_cast(h1D_SubtrNorm_Clone->Clone("hSystematicCorrBiasBtoD")); - hSystematicCorrBiasBtoD->Add(h1D_SubtrNorm_Clone, hBeforeModulCorr, 1, -1); + TH1D* hSystematicCorrBiasBtoD = reinterpret_cast(h1DSubtrNormClone->Clone("hSystematicCorrBiasBtoD")); + hSystematicCorrBiasBtoD->Add(h1DSubtrNormClone, hBeforeModulCorr, 1, -1); // Set bin contents to absolute values for (int i = 1; i <= hSystematicCorrBiasBtoD->GetNbinsX(); ++i) { hSystematicCorrBiasBtoD->SetBinContent(i, std::abs(hSystematicCorrBiasBtoD->GetBinContent(i)) / TMath::Sqrt(12)); @@ -517,257 +517,257 @@ Bool_t DhCorrelationExtraction::ExtractCorrelations(Double_t PtCandMin, Double_t // Secondary particle contamination if (fSecPartContamination) { - h1D_PrimaryPartCorr = GetCorrelHistoSecondaryPart(kPrimaryPart, PtCandMin, PtCandMax, PtHadMin, PtHadMax); - h1D_AllPartCorr = GetCorrelHistoSecondaryPart(kAllPart, PtCandMin, PtCandMax, PtHadMin, PtHadMax); - h1D_PrimaryPartCorr->Sumw2(); - h1D_AllPartCorr->Sumw2(); + h1DPrimaryPartCorr = GetCorrelHistoSecondaryPart(kPrimaryPart, ptCandMin, ptCandMax, ptHadMin, ptHadMax); + h1DAllPartCorr = GetCorrelHistoSecondaryPart(kAllPart, ptCandMin, ptCandMax, ptHadMin, ptHadMax); + h1DPrimaryPartCorr->Sumw2(); + h1DAllPartCorr->Sumw2(); if (fRebinSecPart) { - h1D_PrimaryPartCorr->RebinX(fRebinAxisDeltaPhi); // Xaxis: deltaPhi - h1D_AllPartCorr->RebinX(fRebinAxisDeltaPhi); + h1DPrimaryPartCorr->RebinX(fRebinAxisDeltaPhi); // Xaxis: deltaPhi + h1DAllPartCorr->RebinX(fRebinAxisDeltaPhi); std::cout << "Secondary particle histogram rebinned" << std::endl; } - h1D_SecPartFrac = reinterpret_cast(h1D_PrimaryPartCorr->Clone(Form("hCorrRatio_PtD%.0fto%.0f_PtHad%.0fto%.0f", PtCandMin, PtCandMax, PtHadMin, PtHadMax))); - h1D_SecPartFrac->Sumw2(); - h1D_SecPartFrac->Divide(h1D_PrimaryPartCorr, h1D_AllPartCorr, 1., 1., "B"); + h1DSecPartFrac = reinterpret_cast(h1DPrimaryPartCorr->Clone(Form("hCorrRatio_PtD%.0fto%.0f_PtHad%.0fto%.0f", ptCandMin, ptCandMax, ptHadMin, ptHadMax))); + h1DSecPartFrac->Sumw2(); + h1DSecPartFrac->Divide(h1DPrimaryPartCorr, h1DAllPartCorr, 1., 1., "B"); - TCanvas* c1D = new TCanvas(Form("c1D_CorrPrimaryPart_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f", PtCandMin, PtCandMax, PtHadMin, PtHadMax), Form("c1D_%s_CorrPrimaryPart_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), PtHadMin, PtHadMax)); + TCanvas* c1D = new TCanvas(Form("c1D_CorrPrimaryPart_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f", ptCandMin, ptCandMax, ptHadMin, ptHadMax), Form("c1D_%s_CorrPrimaryPart_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), ptHadMin, ptHadMax)); c1D->cd(); - SetTH1HistoStyle(h1D_SecPartFrac, Form("%.0f < p_{T} < %.0f GeV/c", PtCandMin, PtCandMax), "#Delta#phi [rad]", "#frac{primary part.}{part. selected}"); - h1D_SecPartFrac->Draw(); - c1D->SaveAs(Form("Output_CorrelationExtraction_%s_png/CorrPrimaryPartRatio_%s_Canvas_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f.png", codeName.Data(), fDmesonLabel.Data(), PtCandMin, PtCandMax, PtHadMin, PtHadMax)); - c1D->SaveAs(Form("Output_CorrelationExtraction_%s_Root/CorrPrimaryPartRatio_%s_Canvas_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f.root", codeName.Data(), fDmesonLabel.Data(), PtCandMin, PtCandMax, PtHadMin, PtHadMax)); - - h1D_SubtrNorm_SecPart = reinterpret_cast(h1D_SubtrNorm->Clone("h1D_SubtrNorm_SecPart")); - h1D_SubtrNorm_SecPart->Sumw2(); - Int_t nBinsPhi = h1D_SubtrNorm_SecPart->GetNbinsX(); - if (nBinsPhi != h1D_SecPartFrac->GetNbinsX()) { + SetTH1HistoStyle(h1DSecPartFrac, Form("%.0f < p_{T} < %.0f GeV/c", ptCandMin, ptCandMax), "#Delta#phi [rad]", "#frac{primary part.}{part. selected}"); + h1DSecPartFrac->Draw(); + c1D->SaveAs(Form("Output_CorrelationExtraction_%s_png/CorrPrimaryPartRatio_%s_Canvas_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f.png", codeName.Data(), fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax)); + c1D->SaveAs(Form("Output_CorrelationExtraction_%s_Root/CorrPrimaryPartRatio_%s_Canvas_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f.root", codeName.Data(), fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax)); + + h1DSubtrNormSecPart = reinterpret_cast(h1DSubtrNorm->Clone("h1D_SubtrNorm_SecPart")); + h1DSubtrNormSecPart->Sumw2(); + Int_t nBinsPhi = h1DSubtrNormSecPart->GetNbinsX(); + if (nBinsPhi != h1DSecPartFrac->GetNbinsX()) { std::cout << "[ERROR]: nBinsPhi different between h1D_SubtrNorm and h1D_SecPartFrac" << std::endl; return kFALSE; } - h1D_SubtrNorm_SecPart->Multiply(h1D_SecPartFrac); + h1DSubtrNormSecPart->Multiply(h1DSecPartFrac); } // FD Subtraction if (fFDsubtraction) { - h1D_FDTemplatePrompt = h2D_FDTemplatePrompt->ProjectionY("h1D_FDTemplatePrompt"); - h1D_FDTemplateNonPrompt = h2D_FDTemplateNonPrompt->ProjectionY("h1D_FDTemplateNonPrompt"); + h1DFdTemplatePrompt = h2DFdTemplatePrompt->ProjectionY("h1D_FDTemplatePrompt"); + h1DFdTemplateNonPrompt = h2DFdTemplateNonPrompt->ProjectionY("h1D_FDTemplateNonPrompt"); - h1D_FDTemplatePrompt->Scale(1. / h1D_FDTemplatePrompt->GetXaxis()->GetBinWidth(1)); - h1D_FDTemplateNonPrompt->Scale(1. / h1D_FDTemplateNonPrompt->GetXaxis()->GetBinWidth(1)); + h1DFdTemplatePrompt->Scale(1. / h1DFdTemplatePrompt->GetXaxis()->GetBinWidth(1)); + h1DFdTemplateNonPrompt->Scale(1. / h1DFdTemplateNonPrompt->GetXaxis()->GetBinWidth(1)); - h1D_TemplateTotal = reinterpret_cast(h1D_FDTemplatePrompt->Clone("h1D_TemplateTotal")); - h1D_TemplateTotal->Sumw2(); - h1D_TemplateTotal->Scale(FDPromptFrac); - h1D_TemplateTotal->Add(h1D_FDTemplateNonPrompt, 1 - FDPromptFrac); + h1DTemplateTotal = reinterpret_cast(h1DFdTemplatePrompt->Clone("h1D_TemplateTotal")); + h1DTemplateTotal->Sumw2(); + h1DTemplateTotal->Scale(fdPromptFrac); + h1DTemplateTotal->Add(h1DFdTemplateNonPrompt, 1 - fdPromptFrac); if (fDebug >= 1) { - TCanvas* c = new TCanvas(Form("cFDTemplate_1D_%1.1fto%1.1f", PtHadMin, PtHadMax), Form("cFDTemplate_%s_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), PtCandMin, PtCandMax, PtHadMin, PtHadMax)); + TCanvas* c = new TCanvas(Form("cFDTemplate_1D_%1.1fto%1.1f", ptHadMin, ptHadMax), Form("cFDTemplate_%s_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax)); c->cd(); - h1D_TemplateTotal->SetMinimum(0); - h1D_FDTemplateNonPrompt->SetMinimum(0); - h1D_TemplateTotal->SetMarkerColor(kGreen); - h1D_TemplateTotal->SetLineColor(kGreen); - h1D_TemplateTotal->SetLineWidth(2); - h1D_TemplateTotal->SetMarkerStyle(kFullCircle); - h1D_FDTemplatePrompt->SetMarkerColor(kRed); - h1D_FDTemplatePrompt->SetLineColor(kRed); - h1D_FDTemplatePrompt->SetLineWidth(2); - h1D_FDTemplatePrompt->SetMarkerStyle(kFullCircle); - h1D_FDTemplateNonPrompt->SetMarkerColor(kBlue); - h1D_FDTemplateNonPrompt->SetLineColor(kBlue); - h1D_FDTemplateNonPrompt->SetLineWidth(2); - h1D_FDTemplateNonPrompt->SetMarkerStyle(kFullCircle); - h1D_FDTemplateNonPrompt->Draw(); - h1D_FDTemplatePrompt->Draw("same"); - h1D_TemplateTotal->Draw("same"); + h1DTemplateTotal->SetMinimum(0); + h1DFdTemplateNonPrompt->SetMinimum(0); + h1DTemplateTotal->SetMarkerColor(kGreen); + h1DTemplateTotal->SetLineColor(kGreen); + h1DTemplateTotal->SetLineWidth(2); + h1DTemplateTotal->SetMarkerStyle(kFullCircle); + h1DFdTemplatePrompt->SetMarkerColor(kRed); + h1DFdTemplatePrompt->SetLineColor(kRed); + h1DFdTemplatePrompt->SetLineWidth(2); + h1DFdTemplatePrompt->SetMarkerStyle(kFullCircle); + h1DFdTemplateNonPrompt->SetMarkerColor(kBlue); + h1DFdTemplateNonPrompt->SetLineColor(kBlue); + h1DFdTemplateNonPrompt->SetLineWidth(2); + h1DFdTemplateNonPrompt->SetMarkerStyle(kFullCircle); + h1DFdTemplateNonPrompt->Draw(); + h1DFdTemplatePrompt->Draw("same"); + h1DTemplateTotal->Draw("same"); TLegend* lFD = new TLegend(); - lFD->AddEntry(h1D_TemplateTotal, "Total template"); - lFD->AddEntry(h1D_FDTemplatePrompt, "Prompt Template"); - lFD->AddEntry(h1D_FDTemplateNonPrompt, "Non prompt template"); + lFD->AddEntry(h1DTemplateTotal, "Total template"); + lFD->AddEntry(h1DFdTemplatePrompt, "Prompt Template"); + lFD->AddEntry(h1DFdTemplateNonPrompt, "Non prompt template"); lFD->Draw("same"); - c->SaveAs(Form("Output_CorrelationExtraction_%s_png/CorrFDTemplate_1D_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.png", codeName.Data(), fDmesonLabel.Data(), PtCandMin, PtCandMax, PtHadMin, PtHadMax)); - c->SaveAs(Form("Output_CorrelationExtraction_%s_Root/CorrFDTemplate_1D_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.root", codeName.Data(), fDmesonLabel.Data(), PtCandMin, PtCandMax, PtHadMin, PtHadMax)); + c->SaveAs(Form("Output_CorrelationExtraction_%s_png/CorrFDTemplate_1D_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.png", codeName.Data(), fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax)); + c->SaveAs(Form("Output_CorrelationExtraction_%s_Root/CorrFDTemplate_1D_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.root", codeName.Data(), fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax)); } - Double_t BaselineFD = CalculateBaseline(h1D_TemplateTotal, kTRUE); - Double_t BaselineData; + Double_t baselineFd = CalculateBaseline(h1DTemplateTotal, kTRUE); + Double_t baselineData; if (fSecPartContamination) { - BaselineData = CalculateBaseline(h1D_SubtrNorm_SecPart, kTRUE); + baselineData = CalculateBaseline(h1DSubtrNormSecPart, kTRUE); } else { - BaselineData = CalculateBaseline(h1D_SubtrNorm, kTRUE); + baselineData = CalculateBaseline(h1DSubtrNorm, kTRUE); } std::cout << "===================== " << std::endl; - std::cout << "Baseline FD: " << BaselineFD << std::endl; - std::cout << "Baseline Data: " << BaselineData << std::endl; + std::cout << "Baseline FD: " << baselineFd << std::endl; + std::cout << "Baseline Data: " << baselineData << std::endl; std::cout << "===================== " << std::endl; std::cout << " " << std::endl; - Double_t Baselinediff = BaselineData - BaselineFD; - TH1D* hBaselineDiff = reinterpret_cast(h1D_FDTemplateNonPrompt->Clone("hBaselineDiff")); + Double_t baselinediff = baselineData - baselineFd; + TH1D* hBaselineDiff = reinterpret_cast(h1DFdTemplateNonPrompt->Clone("hBaselineDiff")); for (int iBin = 0; iBin < hBaselineDiff->GetNbinsX(); iBin++) { - hBaselineDiff->SetBinContent(iBin + 1, Baselinediff); + hBaselineDiff->SetBinContent(iBin + 1, baselinediff); } - h1D_FDTemplateNonPrompt->Add(hBaselineDiff); - h1D_TemplateTotal->Add(hBaselineDiff); + h1DFdTemplateNonPrompt->Add(hBaselineDiff); + h1DTemplateTotal->Add(hBaselineDiff); if (fSecPartContamination) { - h1D_SubtrFDNorm = reinterpret_cast(h1D_SubtrNorm_SecPart->Clone("h1D_SubtrFDNorm")); + h1DSubtrFdNorm = reinterpret_cast(h1DSubtrNormSecPart->Clone("h1D_SubtrFDNorm")); } else { - h1D_SubtrFDNorm = reinterpret_cast(h1D_SubtrNorm->Clone("h1D_SubtrFDNorm")); + h1DSubtrFdNorm = reinterpret_cast(h1DSubtrNorm->Clone("h1D_SubtrFDNorm")); } - h1D_FDTemplateNonPrompt->Scale(1 - FDPromptFrac); - h1D_SubtrFDNorm->Add(h1D_FDTemplateNonPrompt, -1); - h1D_SubtrFDNorm->Scale(1. / FDPromptFrac); + h1DFdTemplateNonPrompt->Scale(1 - fdPromptFrac); + h1DSubtrFdNorm->Add(h1DFdTemplateNonPrompt, -1); + h1DSubtrFdNorm->Scale(1. / fdPromptFrac); if (fDebug >= 1) { - TCanvas* c1 = new TCanvas(Form("cFDTemplateSubtr_%1.1fto%1.1f", PtHadMin, PtHadMax), Form("cFDTemplateSubtr_%s_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), PtCandMin, PtCandMax, PtHadMin, PtHadMax), 100, 100, 1600, 900); + TCanvas* c1 = new TCanvas(Form("cFDTemplateSubtr_%1.1fto%1.1f", ptHadMin, ptHadMax), Form("cFDTemplateSubtr_%s_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax), 100, 100, 1600, 900); c1->cd(); - h1D_SubtrNorm->SetLineColor(kRed); - h1D_SubtrNorm_SecPart->SetLineColor(kOrange); - h1D_FDTemplateNonPrompt->SetLineColor(kBlue); - h1D_SubtrFDNorm->SetLineColor(kGreen); - h1D_TemplateTotal->SetLineColor(kMagenta); - h1D_SubtrNorm->SetMinimum(0); - h1D_SubtrNorm_SecPart->SetMinimum(0); - h1D_FDTemplateNonPrompt->SetMinimum(0); - h1D_SubtrFDNorm->SetMinimum(0); + h1DSubtrNorm->SetLineColor(kRed); + h1DSubtrNormSecPart->SetLineColor(kOrange); + h1DFdTemplateNonPrompt->SetLineColor(kBlue); + h1DSubtrFdNorm->SetLineColor(kGreen); + h1DTemplateTotal->SetLineColor(kMagenta); + h1DSubtrNorm->SetMinimum(0); + h1DSubtrNormSecPart->SetMinimum(0); + h1DFdTemplateNonPrompt->SetMinimum(0); + h1DSubtrFdNorm->SetMinimum(0); // h1D_SubtrNorm -> GetYaxis() -> SetRangeUser(0., 8.); - h1D_SubtrNorm->SetMarkerStyle(kFullCircle); - h1D_SubtrNorm->SetMarkerSize(1.2); - h1D_SubtrNorm->SetMarkerColor(kRed); - h1D_SubtrNorm->SetLineWidth(2); - h1D_SubtrNorm_SecPart->SetMarkerStyle(kFullCircle); - h1D_SubtrNorm_SecPart->SetMarkerSize(1.2); - h1D_SubtrNorm_SecPart->SetMarkerColor(kOrange); - h1D_SubtrNorm_SecPart->SetLineWidth(2); - h1D_SubtrFDNorm->SetMarkerStyle(kFullCircle); - h1D_SubtrFDNorm->SetMarkerSize(1.2); - h1D_SubtrFDNorm->SetMarkerColor(kGreen); - h1D_SubtrFDNorm->SetLineWidth(2); - h1D_SubtrNorm->GetYaxis()->SetTitle("#frac{1}{N_{D}} #frac{dN^{assoc. part}}{d#Delta#phi}"); - h1D_SubtrNorm_SecPart->GetYaxis()->SetTitle("#frac{1}{N_{D}} #frac{dN^{assoc. part}}{d#Delta#phi}"); + h1DSubtrNorm->SetMarkerStyle(kFullCircle); + h1DSubtrNorm->SetMarkerSize(1.2); + h1DSubtrNorm->SetMarkerColor(kRed); + h1DSubtrNorm->SetLineWidth(2); + h1DSubtrNormSecPart->SetMarkerStyle(kFullCircle); + h1DSubtrNormSecPart->SetMarkerSize(1.2); + h1DSubtrNormSecPart->SetMarkerColor(kOrange); + h1DSubtrNormSecPart->SetLineWidth(2); + h1DSubtrFdNorm->SetMarkerStyle(kFullCircle); + h1DSubtrFdNorm->SetMarkerSize(1.2); + h1DSubtrFdNorm->SetMarkerColor(kGreen); + h1DSubtrFdNorm->SetLineWidth(2); + h1DSubtrNorm->GetYaxis()->SetTitle("#frac{1}{N_{D}} #frac{dN^{assoc. part}}{d#Delta#phi}"); + h1DSubtrNormSecPart->GetYaxis()->SetTitle("#frac{1}{N_{D}} #frac{dN^{assoc. part}}{d#Delta#phi}"); if (fSecPartContamination) { - h1D_SubtrNorm_SecPart->Draw(); + h1DSubtrNormSecPart->Draw(); } else { - h1D_SubtrNorm->Draw(); + h1DSubtrNorm->Draw(); } // h1D_FDTemplateNonPrompt -> Draw("same"); - h1D_SubtrFDNorm->Draw("same"); - h1D_TemplateTotal->Draw("same"); - c1->SaveAs(Form("Output_CorrelationExtraction_%s_png/CorrFDTemplateSubtr_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.png", codeName.Data(), fDmesonLabel.Data(), PtCandMin, PtCandMax, PtHadMin, PtHadMax)); - c1->SaveAs(Form("Output_CorrelationExtraction_%s_Root/CorrFDTemplateSubtr_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.root", codeName.Data(), fDmesonLabel.Data(), PtCandMin, PtCandMax, PtHadMin, PtHadMax)); + h1DSubtrFdNorm->Draw("same"); + h1DTemplateTotal->Draw("same"); + c1->SaveAs(Form("Output_CorrelationExtraction_%s_png/CorrFDTemplateSubtr_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.png", codeName.Data(), fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax)); + c1->SaveAs(Form("Output_CorrelationExtraction_%s_Root/CorrFDTemplateSubtr_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.root", codeName.Data(), fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax)); } } if (fFDsubtraction) { - fCorrectedCorrHisto = reinterpret_cast(h1D_SubtrFDNorm->Clone(Form("hCorrectedCorr_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f", PtCandMin, PtCandMax, PtHadMin, PtHadMax))); + fCorrectedCorrHisto = reinterpret_cast(h1DSubtrFdNorm->Clone(Form("hCorrectedCorr_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f", ptCandMin, ptCandMax, ptHadMin, ptHadMax))); } else if (fSecPartContamination) { - fCorrectedCorrHisto = reinterpret_cast(h1D_SubtrNorm_SecPart->Clone(Form("hCorrectedCorr_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f", PtCandMin, PtCandMax, PtHadMin, PtHadMax))); + fCorrectedCorrHisto = reinterpret_cast(h1DSubtrNormSecPart->Clone(Form("hCorrectedCorr_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f", ptCandMin, ptCandMax, ptHadMin, ptHadMax))); } else { - fCorrectedCorrHisto = reinterpret_cast(h1D_SubtrNorm->Clone(Form("hCorrectedCorr_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f", PtCandMin, PtCandMax, PtHadMin, PtHadMax))); + fCorrectedCorrHisto = reinterpret_cast(h1DSubtrNorm->Clone(Form("hCorrectedCorr_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f", ptCandMin, ptCandMax, ptHadMin, ptHadMax))); } std::cout << "Analysis steps completed - baseline subtraction missing" << std::endl; // Draw 1D plots (Signal region, normalized) - TCanvas* cFinal = new TCanvas(Form("cFinal_%.0fto%.0f", PtHadMin, PtHadMax), Form("cFinal_%s_IntPools_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), PtHadMin, PtHadMax), 100, 100, 1200, 700); - h1D_SubtrNorm->SetLineColor(kBlue + 1); - h1D_SubtrNorm->SetMarkerColor(kBlue + 1); - h1D_SubtrNorm->SetMarkerStyle(kFullCircle); - h1D_SubtrNorm->SetMinimum(0); - h1D_SubtrNorm->Draw(); + TCanvas* cFinal = new TCanvas(Form("cFinal_%.0fto%.0f", ptHadMin, ptHadMax), Form("cFinal_%s_IntPools_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), ptHadMin, ptHadMax), 100, 100, 1200, 700); + h1DSubtrNorm->SetLineColor(kBlue + 1); + h1DSubtrNorm->SetMarkerColor(kBlue + 1); + h1DSubtrNorm->SetMarkerStyle(kFullCircle); + h1DSubtrNorm->SetMinimum(0); + h1DSubtrNorm->Draw(); if (fSecPartContamination) { - h1D_SubtrNorm_SecPart->SetLineColor(kRed + 1); - h1D_SubtrNorm_SecPart->SetMarkerColor(kRed + 1); - h1D_SubtrNorm_SecPart->SetMarkerStyle(kFullCircle); - h1D_SubtrNorm_SecPart->Draw("same"); + h1DSubtrNormSecPart->SetLineColor(kRed + 1); + h1DSubtrNormSecPart->SetMarkerColor(kRed + 1); + h1DSubtrNormSecPart->SetMarkerStyle(kFullCircle); + h1DSubtrNormSecPart->Draw("same"); } if (fFDsubtraction) { - h1D_SubtrFDNorm->SetLineColor(kGreen + 2); - h1D_SubtrFDNorm->SetMarkerColor(kGreen + 2); - h1D_SubtrFDNorm->SetMarkerStyle(kFullCircle); - h1D_SubtrFDNorm->Draw("same"); + h1DSubtrFdNorm->SetLineColor(kGreen + 2); + h1DSubtrFdNorm->SetMarkerColor(kGreen + 2); + h1DSubtrFdNorm->SetMarkerStyle(kFullCircle); + h1DSubtrFdNorm->Draw("same"); } if (fFDsubtraction) { - h1D_TemplateTotal->Draw("same"); + h1DTemplateTotal->Draw("same"); } TLegend* lFinal = new TLegend(); - lFinal->AddEntry(h1D_SubtrNorm, "Corr. after bkg subtr."); + lFinal->AddEntry(h1DSubtrNorm, "Corr. after bkg subtr."); if (fFDsubtraction) { - lFinal->AddEntry(h1D_TemplateTotal, "CR Mode 2 total template"); + lFinal->AddEntry(h1DTemplateTotal, "CR Mode 2 total template"); } if (fSecPartContamination) { - lFinal->AddEntry(h1D_SubtrNorm_SecPart, "Corr. after sec. part. correction"); + lFinal->AddEntry(h1DSubtrNormSecPart, "Corr. after sec. part. correction"); } if (fFDsubtraction) { - lFinal->AddEntry(h1D_SubtrFDNorm, "Corr. FD subtr."); + lFinal->AddEntry(h1DSubtrFdNorm, "Corr. FD subtr."); } lFinal->Draw("same"); - cFinal->SaveAs(Form("Output_CorrelationExtraction_%s_png/AzimCorrDistr_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.png", codeName.Data(), fDmesonLabel.Data(), PtCandMin, PtCandMax, PtHadMin, PtHadMax)); - cFinal->SaveAs(Form("Output_CorrelationExtraction_%s_Root/AzimCorrDistr_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.root", codeName.Data(), fDmesonLabel.Data(), PtCandMin, PtCandMax, PtHadMin, PtHadMax)); + cFinal->SaveAs(Form("Output_CorrelationExtraction_%s_png/AzimCorrDistr_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.png", codeName.Data(), fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax)); + cFinal->SaveAs(Form("Output_CorrelationExtraction_%s_Root/AzimCorrDistr_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.root", codeName.Data(), fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax)); // Baseline subtraction - Double_t BaselineData, BaselineDataErr; - TH1D* hBaseline = reinterpret_cast(h1D_SubtrNorm->Clone("hBaseline")); + Double_t baselineData, baselineDataErr; + TH1D* hBaseline = reinterpret_cast(h1DSubtrNorm->Clone("hBaseline")); hBaseline->Sumw2(); if (fFDsubtraction) { - BaselineData = CalculateBaseline(h1D_SubtrFDNorm, kTRUE, kFALSE); // introduced kFALSE - BaselineDataErr = CalculateBaselineError(h1D_SubtrFDNorm, kTRUE, kFALSE); + baselineData = CalculateBaseline(h1DSubtrFdNorm, kTRUE, kFALSE); // introduced kFALSE + baselineDataErr = CalculateBaselineError(h1DSubtrFdNorm, kTRUE, kFALSE); for (int iBin = 0; iBin < hBaseline->GetNbinsX(); iBin++) { - hBaseline->SetBinContent(iBin + 1, BaselineData); - hBaseline->SetBinError(iBin + 1, BaselineDataErr); + hBaseline->SetBinContent(iBin + 1, baselineData); + hBaseline->SetBinError(iBin + 1, baselineDataErr); } - h1D_BaselineSubtr = reinterpret_cast(h1D_SubtrFDNorm->Clone("h1D_BaselineSubtr")); - h1D_BaselineSubtr->Add(hBaseline, -1.); + h1DBaselineSubtr = reinterpret_cast(h1DSubtrFdNorm->Clone("h1D_BaselineSubtr")); + h1DBaselineSubtr->Add(hBaseline, -1.); } else if (fSecPartContamination) { - BaselineData = CalculateBaseline(h1D_SubtrNorm_SecPart, kTRUE, kFALSE); - BaselineDataErr = CalculateBaselineError(h1D_SubtrNorm_SecPart, kTRUE, kFALSE); + baselineData = CalculateBaseline(h1DSubtrNormSecPart, kTRUE, kFALSE); + baselineDataErr = CalculateBaselineError(h1DSubtrNormSecPart, kTRUE, kFALSE); for (int iBin = 0; iBin < hBaseline->GetNbinsX(); iBin++) { - hBaseline->SetBinContent(iBin + 1, BaselineData); - hBaseline->SetBinError(iBin + 1, BaselineDataErr); + hBaseline->SetBinContent(iBin + 1, baselineData); + hBaseline->SetBinError(iBin + 1, baselineDataErr); } - h1D_BaselineSubtr = reinterpret_cast(h1D_SubtrNorm_SecPart->Clone("h1D_BaselineSubtr")); - h1D_BaselineSubtr->Add(hBaseline, -1.); + h1DBaselineSubtr = reinterpret_cast(h1DSubtrNormSecPart->Clone("h1D_BaselineSubtr")); + h1DBaselineSubtr->Add(hBaseline, -1.); } else { - BaselineData = CalculateBaseline(h1D_SubtrNorm, kTRUE, kFALSE); - BaselineDataErr = CalculateBaselineError(h1D_SubtrNorm, kTRUE, kFALSE); + baselineData = CalculateBaseline(h1DSubtrNorm, kTRUE, kFALSE); + baselineDataErr = CalculateBaselineError(h1DSubtrNorm, kTRUE, kFALSE); for (int iBin = 0; iBin < hBaseline->GetNbinsX(); iBin++) { - hBaseline->SetBinContent(iBin + 1, BaselineData); - hBaseline->SetBinError(iBin + 1, BaselineDataErr); + hBaseline->SetBinContent(iBin + 1, baselineData); + hBaseline->SetBinError(iBin + 1, baselineDataErr); } - h1D_BaselineSubtr = reinterpret_cast(h1D_SubtrNorm->Clone("h1D_BaselineSubtr")); - h1D_BaselineSubtr->Add(hBaseline, -1.); + h1DBaselineSubtr = reinterpret_cast(h1DSubtrNorm->Clone("h1D_BaselineSubtr")); + h1DBaselineSubtr->Add(hBaseline, -1.); } - fCorrectedCorrHisto_BaselineSubtr = reinterpret_cast(h1D_BaselineSubtr->Clone(Form("hCorrectedCorrBaselineSubtr_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f", PtCandMin, PtCandMax, PtHadMin, PtHadMax))); + fCorrectedCorrHisto_BaselineSubtr = reinterpret_cast(h1DBaselineSubtr->Clone(Form("hCorrectedCorrBaselineSubtr_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f", ptCandMin, ptCandMax, ptHadMin, ptHadMax))); - TCanvas* cFinal_BaselineSubtr = new TCanvas(Form("cFinal_BaselineSubtr_%.0fto%.0f", PtHadMin, PtHadMax), Form("cFinal_BaselineSubtr_%s_IntPools_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), PtHadMin, PtHadMax), 100, 100, 1200, 700); - h1D_BaselineSubtr->SetMarkerColor(kOrange + 8); - h1D_BaselineSubtr->SetLineColor(kOrange + 8); - h1D_BaselineSubtr->GetYaxis()->SetRangeUser(-0.2, 8.); - h1D_BaselineSubtr->Draw(); + TCanvas* cFinalBaselineSubtr = new TCanvas(Form("cFinal_BaselineSubtr_%.0fto%.0f", ptHadMin, ptHadMax), Form("cFinal_BaselineSubtr_%s_IntPools_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), ptHadMin, ptHadMax), 100, 100, 1200, 700); + h1DBaselineSubtr->SetMarkerColor(kOrange + 8); + h1DBaselineSubtr->SetLineColor(kOrange + 8); + h1DBaselineSubtr->GetYaxis()->SetRangeUser(-0.2, 8.); + h1DBaselineSubtr->Draw(); if (fFDsubtraction) { - h1D_SubtrFDNorm->Draw("same"); + h1DSubtrFdNorm->Draw("same"); } else if (fSecPartContamination) { - h1D_SubtrNorm_SecPart->Draw("same"); + h1DSubtrNormSecPart->Draw("same"); } else { - h1D_SubtrNorm->Draw("same"); + h1DSubtrNorm->Draw("same"); } hBaseline->SetMarkerColor(kPink - 6); hBaseline->SetMarkerStyle(kFullSquare); hBaseline->SetLineColor(kPink - 6); hBaseline->Draw("same"); - cFinal_BaselineSubtr->SaveAs(Form("Output_CorrelationExtraction_%s_png/AzimCorrDistr_BaselineSubtr_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.png", codeName.Data(), fDmesonLabel.Data(), PtCandMin, PtCandMax, PtHadMin, PtHadMax)); - cFinal_BaselineSubtr->SaveAs(Form("Output_CorrelationExtraction_%s_Root/AzimCorrDistr_BaselineSubtr_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.root", codeName.Data(), fDmesonLabel.Data(), PtCandMin, PtCandMax, PtHadMin, PtHadMax)); + cFinalBaselineSubtr->SaveAs(Form("Output_CorrelationExtraction_%s_png/AzimCorrDistr_BaselineSubtr_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.png", codeName.Data(), fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax)); + cFinalBaselineSubtr->SaveAs(Form("Output_CorrelationExtraction_%s_Root/AzimCorrDistr_BaselineSubtr_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.root", codeName.Data(), fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax)); // Reflected histograms if (fFDsubtraction) { - h1D_ReflCorr = ReflectCorrHistogram(h1D_SubtrFDNorm); + h1DReflCorr = ReflectCorrHistogram(h1DSubtrFdNorm); } else if (fSecPartContamination) { - h1D_ReflCorr = ReflectCorrHistogram(h1D_SubtrNorm_SecPart); + h1DReflCorr = ReflectCorrHistogram(h1DSubtrNormSecPart); } else { - h1D_ReflCorr = ReflectCorrHistogram(h1D_SubtrNorm); + h1DReflCorr = ReflectCorrHistogram(h1DSubtrNorm); } /* used as control using Run2 reflection function @@ -779,27 +779,27 @@ Bool_t DhCorrelationExtraction::ExtractCorrelations(Double_t PtCandMin, Double_t h1D_ReflCorr = ReflectHistoRun2(h1D_SubtrNorm, 0.5); }*/ - TCanvas* cFinal_Reflected = new TCanvas(Form("cFinal_Reflected_%.0fto%.0f", PtHadMin, PtHadMax), Form("cFinal_Reflected_%s_IntPools_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), PtHadMin, PtHadMax), 100, 100, 1200, 700); - cFinal_Reflected->cd(); - SetTH1HistoStyle(h1D_ReflCorr, Form("%.0f < p_{T} < %.0f GeV/c", PtCandMin, PtCandMax), "#Delta#phi [rad]", "#frac{1}{N_{D}}#frac{dN^{assoc}}{d#Delta#phi} [rad^{-1}]", kFullCircle, kOrange + 8, 1.6, kOrange + 8, 3); - h1D_ReflCorr->SetMinimum(0); - h1D_ReflCorr->Draw(); - cFinal_Reflected->SaveAs(Form("Output_CorrelationExtraction_%s_png/AzimCorrDistr_Reflected_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.png", codeName.Data(), fDmesonLabel.Data(), PtCandMin, PtCandMax, PtHadMin, PtHadMax)); - cFinal_Reflected->SaveAs(Form("Output_CorrelationExtraction_%s_Root/AzimCorrDistr_Reflected_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.root", codeName.Data(), fDmesonLabel.Data(), PtCandMin, PtCandMax, PtHadMin, PtHadMax)); + TCanvas* cFinalReflected = new TCanvas(Form("cFinal_Reflected_%.0fto%.0f", ptHadMin, ptHadMax), Form("cFinal_Reflected_%s_IntPools_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), ptHadMin, ptHadMax), 100, 100, 1200, 700); + cFinalReflected->cd(); + SetTH1HistoStyle(h1DReflCorr, Form("%.0f < p_{T} < %.0f GeV/c", ptCandMin, ptCandMax), "#Delta#phi [rad]", "#frac{1}{N_{D}}#frac{dN^{assoc}}{d#Delta#phi} [rad^{-1}]", kFullCircle, kOrange + 8, 1.6, kOrange + 8, 3); + h1DReflCorr->SetMinimum(0); + h1DReflCorr->Draw(); + cFinalReflected->SaveAs(Form("Output_CorrelationExtraction_%s_png/AzimCorrDistr_Reflected_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.png", codeName.Data(), fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax)); + cFinalReflected->SaveAs(Form("Output_CorrelationExtraction_%s_Root/AzimCorrDistr_Reflected_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.root", codeName.Data(), fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax)); // Reflected histograms baseline subtracted - TH1D* hBaseline_Refl = reinterpret_cast(h1D_ReflCorr->Clone("hBaseline_Refl")); - hBaseline_Refl->Sumw2(); - BaselineData = CalculateBaseline(h1D_ReflCorr, kFALSE, kTRUE); - BaselineDataErr = CalculateBaselineError(h1D_ReflCorr, kFALSE, kTRUE); - - for (int iBin = 0; iBin < hBaseline_Refl->GetNbinsX(); iBin++) { - hBaseline_Refl->SetBinContent(iBin + 1, BaselineData); - hBaseline_Refl->SetBinError(iBin + 1, BaselineDataErr); + TH1D* hBaselineRefl = reinterpret_cast(h1DReflCorr->Clone("hBaseline_Refl")); + hBaselineRefl->Sumw2(); + baselineData = CalculateBaseline(h1DReflCorr, kFALSE, kTRUE); + baselineDataErr = CalculateBaselineError(h1DReflCorr, kFALSE, kTRUE); + + for (int iBin = 0; iBin < hBaselineRefl->GetNbinsX(); iBin++) { + hBaselineRefl->SetBinContent(iBin + 1, baselineData); + hBaselineRefl->SetBinError(iBin + 1, baselineDataErr); } - h1D_ReflCorr_BaselineSubtr = reinterpret_cast(h1D_ReflCorr->Clone("h1D_ReflCorr_BaselineSubtr")); - h1D_ReflCorr_BaselineSubtr->Sumw2(); - h1D_ReflCorr_BaselineSubtr->Add(hBaseline_Refl, -1.); + h1DReflCorrBaselineSubtr = reinterpret_cast(h1DReflCorr->Clone("h1D_ReflCorr_BaselineSubtr")); + h1DReflCorrBaselineSubtr->Sumw2(); + h1DReflCorrBaselineSubtr->Add(hBaselineRefl, -1.); TF1* fConstZero = new TF1("fConstZero", "[0]", 0., TMath::Pi()); fConstZero->SetParameter(0, 0.); @@ -808,25 +808,25 @@ Bool_t DhCorrelationExtraction::ExtractCorrelations(Double_t PtCandMin, Double_t fConstZero->SetLineWidth(4); fConstZero->SetTitle(""); - TCanvas* cFinal_Reflected_BaselineSubtr = new TCanvas(Form("cFinal_Reflected_BaselineSubtr_%.0fto%.0f", PtHadMin, PtHadMax), Form("cFinal_Reflected_BaselineSubtr_%s_IntPools_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), PtHadMin, PtHadMax), 100, 100, 1200, 700); - SetTH1HistoStyle(h1D_ReflCorr_BaselineSubtr, Form("%.0f < p_{T} < %.0f GeV/c", PtCandMin, PtCandMax), "#Delta#phi [rad]", "#frac{1}{N_{D}}#frac{dN^{assoc}}{d#Delta#phi} [rad^{-1}]", kFullCircle, kRed + 1, 1.6, kRed + 1, 3); - hBaseline_Refl->SetMarkerColor(kOrange); - hBaseline_Refl->SetMarkerStyle(kFullSquare); - hBaseline_Refl->SetLineColor(kOrange); - cFinal_Reflected_BaselineSubtr->cd(); - h1D_ReflCorr->SetMinimum(-0.8); - h1D_ReflCorr->SetStats(false); - hBaseline_Refl->SetStats(false); - h1D_ReflCorr->Draw(); - hBaseline_Refl->Draw("same"); - h1D_ReflCorr_BaselineSubtr->SetStats(false); - h1D_ReflCorr_BaselineSubtr->Draw("same"); // then keep just this + TCanvas* cFinalReflectedBaselineSubtr = new TCanvas(Form("cFinal_Reflected_BaselineSubtr_%.0fto%.0f", ptHadMin, ptHadMax), Form("cFinal_Reflected_BaselineSubtr_%s_IntPools_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), ptHadMin, ptHadMax), 100, 100, 1200, 700); + SetTH1HistoStyle(h1DReflCorrBaselineSubtr, Form("%.0f < p_{T} < %.0f GeV/c", ptCandMin, ptCandMax), "#Delta#phi [rad]", "#frac{1}{N_{D}}#frac{dN^{assoc}}{d#Delta#phi} [rad^{-1}]", kFullCircle, kRed + 1, 1.6, kRed + 1, 3); + hBaselineRefl->SetMarkerColor(kOrange); + hBaselineRefl->SetMarkerStyle(kFullSquare); + hBaselineRefl->SetLineColor(kOrange); + cFinalReflectedBaselineSubtr->cd(); + h1DReflCorr->SetMinimum(-0.8); + h1DReflCorr->SetStats(false); + hBaselineRefl->SetStats(false); + h1DReflCorr->Draw(); + hBaselineRefl->Draw("same"); + h1DReflCorrBaselineSubtr->SetStats(false); + h1DReflCorrBaselineSubtr->Draw("same"); // then keep just this fConstZero->Draw("same"); - cFinal_Reflected_BaselineSubtr->SaveAs(Form("Output_CorrelationExtraction_%s_png/AzimCorrDistr_Reflected_BaselineSubtr_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.png", codeName.Data(), fDmesonLabel.Data(), PtCandMin, PtCandMax, PtHadMin, PtHadMax)); - cFinal_Reflected_BaselineSubtr->SaveAs(Form("Output_CorrelationExtraction_%s_Root/AzimCorrDistr_Reflected_BaselineSubtr_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.root", codeName.Data(), fDmesonLabel.Data(), PtCandMin, PtCandMax, PtHadMin, PtHadMax)); + cFinalReflectedBaselineSubtr->SaveAs(Form("Output_CorrelationExtraction_%s_png/AzimCorrDistr_Reflected_BaselineSubtr_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.png", codeName.Data(), fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax)); + cFinalReflectedBaselineSubtr->SaveAs(Form("Output_CorrelationExtraction_%s_Root/AzimCorrDistr_Reflected_BaselineSubtr_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.root", codeName.Data(), fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax)); - fCorrectedCorrHisto_Reflected = reinterpret_cast(h1D_ReflCorr->Clone(Form("hCorrectedCorrReflected_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f", PtCandMin, PtCandMax, PtHadMin, PtHadMax))); - fCorrectedCorrHisto_Reflected_BaselineSubtr = reinterpret_cast(h1D_ReflCorr_BaselineSubtr->Clone(Form("hCorrectedCorrReflected_BaselineSubtr_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f", PtCandMin, PtCandMax, PtHadMin, PtHadMax))); + fCorrectedCorrHisto_Reflected = reinterpret_cast(h1DReflCorr->Clone(Form("hCorrectedCorrReflected_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f", ptCandMin, ptCandMax, ptHadMin, ptHadMax))); + fCorrectedCorrHisto_Reflected_BaselineSubtr = reinterpret_cast(h1DReflCorrBaselineSubtr->Clone(Form("hCorrectedCorrReflected_BaselineSubtr_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f", ptCandMin, ptCandMax, ptHadMin, ptHadMax))); return kTRUE; } @@ -935,7 +935,7 @@ Bool_t DhCorrelationExtraction::ReadInputSecondaryPartContamination() return kTRUE; } -TH1D* DhCorrelationExtraction::EvaluateMCClosModulations(Double_t PtCandMin, Double_t PtCandMax, Double_t PtHadMin, Double_t PtHadMax) +TH1D* DhCorrelationExtraction::EvaluateMCClosModulations(Double_t ptCandMin, Double_t ptCandMax, Double_t ptHadMin, Double_t ptHadMax) { TH1D* hModul = new TH1D(); @@ -977,12 +977,12 @@ TH1D* DhCorrelationExtraction::EvaluateMCClosModulations(Double_t PtCandMin, Dou hRatioNonPrompt->Fit(funFit, "R"); Double_t fitVal = funFit->GetParameter(0); - TCanvas* cRatio_MCClosure = new TCanvas(Form("cRatio_MCClosure_PtCand%.0fto%.0f_Pthad%.0fto%.0f", PtCandMin, PtCandMax, PtHadMin, PtHadMax), Form("cRatio_MCClosure_PtCand%.0fto%.0f_Pthad%.0fto%.0f", PtCandMin, PtCandMax, PtHadMin, PtHadMax), 100, 100, 1200, 700); - cRatio_MCClosure->cd(); + TCanvas* cRatioMcClosure = new TCanvas(Form("cRatio_MCClosure_PtCand%.0fto%.0f_Pthad%.0fto%.0f", ptCandMin, ptCandMax, ptHadMin, ptHadMax), Form("cRatio_MCClosure_PtCand%.0fto%.0f_Pthad%.0fto%.0f", ptCandMin, ptCandMax, ptHadMin, ptHadMax), 100, 100, 1200, 700); + cRatioMcClosure->cd(); hRatioNonPrompt->GetYaxis()->SetRangeUser(0.2, 1.8); hRatioNonPrompt->Draw(); - Double_t FPrompt = GetFDPromptFrac(PtCandMin, PtCandMax, PtHadMin, PtHadMax); + Double_t fPrompt = GetFDPromptFrac(ptCandMin, ptCandMax, ptHadMin, ptHadMax); Double_t relAmplC[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; Double_t relAmplB[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; Double_t recoKineVal[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; @@ -991,13 +991,13 @@ TH1D* DhCorrelationExtraction::EvaluateMCClosModulations(Double_t PtCandMin, Dou for (int iBin = 0; iBin < hRatioNonPrompt->GetNbinsX(); iBin++) { if (iBin > 1 && iBin < 13) { recoKineVal[iBin - 2] = hRatioNonPrompt->GetBinContent(iBin + 1) - (fitVal - 1); - relAmplC[iBin - 2] = hRecPrompt->GetBinContent(iBin + 1) / (hRecPrompt->GetBinContent(iBin + 1) * FPrompt + hRecNonPrompt->GetBinContent(iBin + 1) * (1 - FPrompt)); - relAmplB[iBin - 2] = hRecNonPrompt->GetBinContent(iBin + 1) / (hRecPrompt->GetBinContent(iBin + 1) * FPrompt + hRecNonPrompt->GetBinContent(iBin + 1) * (1 - FPrompt)); - modul[iBin - 2] = relAmplC[iBin - 2] * FPrompt + relAmplB[iBin - 2] * (1 - FPrompt) / recoKineVal[iBin - 2]; + relAmplC[iBin - 2] = hRecPrompt->GetBinContent(iBin + 1) / (hRecPrompt->GetBinContent(iBin + 1) * fPrompt + hRecNonPrompt->GetBinContent(iBin + 1) * (1 - fPrompt)); + relAmplB[iBin - 2] = hRecNonPrompt->GetBinContent(iBin + 1) / (hRecPrompt->GetBinContent(iBin + 1) * fPrompt + hRecNonPrompt->GetBinContent(iBin + 1) * (1 - fPrompt)); + modul[iBin - 2] = relAmplC[iBin - 2] * fPrompt + relAmplB[iBin - 2] * (1 - fPrompt) / recoKineVal[iBin - 2]; hModul->SetBinContent(iBin + 1, modul[iBin - 2]); hModul->SetBinError(iBin + 1, 0.); - printf("[INFO] Bin%d MODUL = %1.5f\t (Reco/Kine-fitVal = %1.4f, FPrompt = %1.3f, Ampl_ratio C,B = %1.4f, %1.4f)\n", iBin + 1, modul[iBin - 2], recoKineVal[iBin - 2], FPrompt, relAmplC[iBin - 2], relAmplB[iBin - 2]); + printf("[INFO] Bin%d MODUL = %1.5f\t (Reco/Kine-fitVal = %1.4f, FPrompt = %1.3f, Ampl_ratio C,B = %1.4f, %1.4f)\n", iBin + 1, modul[iBin - 2], recoKineVal[iBin - 2], fPrompt, relAmplC[iBin - 2], relAmplB[iBin - 2]); } else { hModul->SetBinContent(iBin + 1, 1.); hModul->SetBinError(iBin + 1, 0.); @@ -1007,19 +1007,19 @@ TH1D* DhCorrelationExtraction::EvaluateMCClosModulations(Double_t PtCandMin, Dou hModul->SetLineColor(kMagenta); hModul->Draw("same"); - cRatio_MCClosure->SaveAs(Form("Output_CorrelationExtraction_Thin2023_FullAnalysis_CentralPoints_png/Ratio_MCClosure_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.png", PtCandMin, PtCandMax, PtHadMin, PtHadMax)); + cRatioMcClosure->SaveAs(Form("Output_CorrelationExtraction_Thin2023_FullAnalysis_CentralPoints_png/Ratio_MCClosure_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.png", ptCandMin, ptCandMax, ptHadMin, ptHadMax)); return hModul; } -TH2D* DhCorrelationExtraction::GetCorrelHisto(Int_t SEorME, Int_t SorSB, Int_t pool, Double_t PtCandMin, Double_t PtCandMax, Double_t PtHadMin, Double_t PtHadMax) +TH2D* DhCorrelationExtraction::GetCorrelHisto(Int_t sEorMe, Int_t sorSb, Int_t pool, Double_t ptCandMin, Double_t ptCandMax, Double_t ptHadMin, Double_t ptHadMax) { // TODO: Subtraction of softpion TH2D* h2D = new TH2D(); // pointer to be returned THnSparseD* hSparse = 0x0; - if (SEorME == kSE) { // Same Event - if (SorSB == kSign) { + if (sEorMe == kSE) { // Same Event + if (sorSb == kSign) { hSparse = reinterpret_cast(fDirSE->Get(fSECorrelSignalRegionName.Data())); } else if (!fSidebandDivided) { hSparse = reinterpret_cast(fDirSE->Get(fSECorrelSidebandsName.Data())); @@ -1036,7 +1036,7 @@ TH2D* DhCorrelationExtraction::GetCorrelHisto(Int_t SEorME, Int_t SorSB, Int_t p } } } else { // Mixed Event - if (SorSB == kSign) { + if (sorSb == kSign) { hSparse = reinterpret_cast(fDirME->Get(fMECorrelSignalRegionName.Data())); } else if (!fSidebandDivided) { hSparse = reinterpret_cast(fDirME->Get(fMECorrelSidebandsName.Data())); @@ -1070,10 +1070,10 @@ TH2D* DhCorrelationExtraction::GetCorrelHisto(Int_t SEorME, Int_t SorSB, Int_t p } }*/ - Int_t binExtPtCandMin = hSparse->GetAxis(2)->FindBin(PtCandMin + 0.01); // axis2: ptCand, the 0.01 to avoid bin edges! - Int_t binExtPtCandMax = hSparse->GetAxis(2)->FindBin(PtCandMax - 0.01); - Int_t binExtPtHadMin = hSparse->GetAxis(3)->FindBin(PtHadMin + 0.01); // axis3: ptHad - Int_t binExtPtHadMax = hSparse->GetAxis(3)->FindBin(PtHadMax - 0.01); + Int_t binExtPtCandMin = hSparse->GetAxis(2)->FindBin(ptCandMin + 0.01); // axis2: ptCand, the 0.01 to avoid bin edges! + Int_t binExtPtCandMax = hSparse->GetAxis(2)->FindBin(ptCandMax - 0.01); + Int_t binExtPtHadMin = hSparse->GetAxis(3)->FindBin(ptHadMin + 0.01); // axis3: ptHad + Int_t binExtPtHadMax = hSparse->GetAxis(3)->FindBin(ptHadMax - 0.01); Int_t binExtPoolMin; Int_t binExtPoolMax; if (fCorrectPoolsSeparately) { @@ -1097,8 +1097,8 @@ TH2D* DhCorrelationExtraction::GetCorrelHisto(Int_t SEorME, Int_t SorSB, Int_t p hSparse->GetAxis(3)->SetRange(binExtPtHadMin, binExtPtHadMax); // axis3: ptHad hSparse->GetAxis(4)->SetRange(binExtPoolMin, binExtPoolMax); // axis4: pool bin h2D = hSparse->Projection(0, 1); // axis0: deltaPhi, axis1: deltaEta - if (SEorME == kSE) { // Same Event - if (SorSB == kSign) { + if (sEorMe == kSE) { // Same Event + if (sorSb == kSign) { h2D->SetName(Form("hCorr_SE_Sig_2D_PtCandBin%d_PtHadBin%d_iPool%d", binExtPtCandMin, binExtPtHadMin, pool)); } else if (!fSidebandDivided) { h2D->SetName(Form("hCorr_SE_Sideb_2D_PtCandBin%d_PtHadBin%d_iPool%d", binExtPtCandMin, binExtPtHadMin, pool)); @@ -1112,7 +1112,7 @@ TH2D* DhCorrelationExtraction::GetCorrelHisto(Int_t SEorME, Int_t SorSB, Int_t p } } } else { // Mixed Event - if (SorSB == kSign) { + if (sorSb == kSign) { h2D->SetName(Form("hCorr_ME_Sig_2D_PtCandBin%d_PtHadBin%d_iPool%d", binExtPtCandMin, binExtPtHadMin, pool)); } else if (!fSidebandDivided) { h2D->SetName(Form("hCorr_SE_Sideb_2D_PtCandBin%d_PtHadBin%d_iPool%d", binExtPtCandMin, binExtPtHadMin, pool)); @@ -1130,7 +1130,7 @@ TH2D* DhCorrelationExtraction::GetCorrelHisto(Int_t SEorME, Int_t SorSB, Int_t p return h2D; } -void DhCorrelationExtraction::GetSignalAndBackgroundForNorm(Double_t PtCandMin, Double_t PtCandMax) +void DhCorrelationExtraction::GetSignalAndBackgroundForNorm(Double_t ptCandMin, Double_t ptCandMax) { // using results obtained from HFInvariantMassFitter.cxx class @@ -1140,51 +1140,51 @@ void DhCorrelationExtraction::GetSignalAndBackgroundForNorm(Double_t PtCandMin, TH1F* hMassFitSBLYield = reinterpret_cast(fFileMass->Get("hBackgroundSidebandLeft")); TH1F* hMassFitSBRYield = reinterpret_cast(fFileMass->Get("hBackgroundSidebandRight")); - Int_t PtCandBin = hMassFitSgnYield->FindBin(PtCandMin + 0.01); - if (PtCandBin != hMassFitSgnYield->FindBin(PtCandMax - 0.01)) { + Int_t ptCandBin = hMassFitSgnYield->FindBin(ptCandMin + 0.01); + if (ptCandBin != hMassFitSgnYield->FindBin(ptCandMax - 0.01)) { std::cout << "[ERROR] Pt bin in invariant mass histogram not univocally defined " << std::endl; } - Float_t SgnYield = hMassFitSgnYield->GetBinContent(PtCandBin); - Float_t BkgYield = hMassFitBkgYield->GetBinContent(PtCandBin); - Float_t SBsYield = hMassFitSBsYield->GetBinContent(PtCandBin); - Float_t SBLYield = hMassFitSBLYield->GetBinContent(PtCandBin); - Float_t SBRYield = hMassFitSBRYield->GetBinContent(PtCandBin); + Float_t sgnYield = hMassFitSgnYield->GetBinContent(ptCandBin); + Float_t bkgYield = hMassFitBkgYield->GetBinContent(ptCandBin); + Float_t sBsYield = hMassFitSBsYield->GetBinContent(ptCandBin); + Float_t sblYield = hMassFitSBLYield->GetBinContent(ptCandBin); + Float_t sbrYield = hMassFitSBRYield->GetBinContent(ptCandBin); std::cout << "================================= " << std::endl; std::cout << "Getting invariant mass parameters " << std::endl; - std::cout << "Pt cand " << PtCandMin << " - " << PtCandMax << std::endl; - std::cout << "Signal yield = " << SgnYield << std::endl; - std::cout << "Bkg yield = " << BkgYield << std::endl; - std::cout << "Sideband yield = " << SBsYield << std::endl; - std::cout << "Sideband left yield = " << SBLYield << std::endl; - std::cout << "Sideband right yield = " << SBRYield << std::endl; + std::cout << "Pt cand " << ptCandMin << " - " << ptCandMax << std::endl; + std::cout << "Signal yield = " << sgnYield << std::endl; + std::cout << "Bkg yield = " << bkgYield << std::endl; + std::cout << "Sideband yield = " << sBsYield << std::endl; + std::cout << "Sideband left yield = " << sblYield << std::endl; + std::cout << "Sideband right yield = " << sbrYield << std::endl; std::cout << "================================= " << std::endl; std::cout << " " << std::endl; - SetSignalYieldforNorm(SgnYield); - SetBkgYield(BkgYield); + SetSignalYieldforNorm(sgnYield); + SetBkgYield(bkgYield); if (fUseSidebLeft && fUseSidebRight) { - SetBkgScaleFactor(BkgYield / SBsYield); - SetSBYield(SBsYield); + SetBkgScaleFactor(bkgYield / sBsYield); + SetSBYield(sBsYield); } else if (fUseSidebLeft && !fUseSidebRight) { - SetBkgScaleFactor(BkgYield / SBLYield); - SetSBYield(SBLYield); + SetBkgScaleFactor(bkgYield / sblYield); + SetSBYield(sblYield); } else if (!fUseSidebLeft && fUseSidebRight) { - SetBkgScaleFactor(BkgYield / SBRYield); - SetSBYield(SBRYield); + SetBkgScaleFactor(bkgYield / sbrYield); + SetSBYield(sbrYield); } } -TH2D* DhCorrelationExtraction::GetFDTemplateHisto(Int_t PromptOrFD, Double_t PtCandMin, Double_t PtCandMax, Double_t PtHadMin, Double_t PtHadMax) +TH2D* DhCorrelationExtraction::GetFDTemplateHisto(Int_t promptOrFd, Double_t ptCandMin, Double_t ptCandMax, Double_t ptHadMin, Double_t ptHadMax) { TH2D* h2D = new TH2D(); // pointer to be returned - if (PromptOrFD == kPrompt) { - h2D = reinterpret_cast(fFileFDTemplate->Get(Form("%s%.0f_%.0f_ptassoc%.0f_%.0f", fHistoFDTemplatePromptName.Data(), PtCandMin, PtCandMax, PtHadMin, PtHadMax))); + if (promptOrFd == kPrompt) { + h2D = reinterpret_cast(fFileFDTemplate->Get(Form("%s%.0f_%.0f_ptassoc%.0f_%.0f", fHistoFDTemplatePromptName.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax))); } else { - h2D = reinterpret_cast(fFileFDTemplate->Get(Form("%s%.0f_%.0f_ptassoc%.0f_%.0f", fHistoFDTemplateNonPromptName.Data(), PtCandMin, PtCandMax, PtHadMin, PtHadMax))); + h2D = reinterpret_cast(fFileFDTemplate->Get(Form("%s%.0f_%.0f_ptassoc%.0f_%.0f", fHistoFDTemplateNonPromptName.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax))); } Int_t binExtEtaMin = h2D->GetXaxis()->FindBin(fDeltaEtaMin + 0.000001); @@ -1197,10 +1197,10 @@ TH2D* DhCorrelationExtraction::GetFDTemplateHisto(Int_t PromptOrFD, Double_t PtC } h2D->GetXaxis()->SetRange(binExtEtaMin, binExtEtaMax); - if (PromptOrFD == kPrompt) { - h2D->SetName(Form("hFDTemplatePrompt_2D_PtCand%.0fto%.0f_PtHad%.0fto%.0f", PtCandMin, PtCandMax, PtHadMin, PtHadMax)); + if (promptOrFd == kPrompt) { + h2D->SetName(Form("hFDTemplatePrompt_2D_PtCand%.0fto%.0f_PtHad%.0fto%.0f", ptCandMin, ptCandMax, ptHadMin, ptHadMax)); } else { - h2D->SetName(Form("hFDTemplateNonPrompt_2D_PtCand%.0fto%.0f_PtHad%.0fto%.0f", PtCandMin, PtCandMax, PtHadMin, PtHadMax)); + h2D->SetName(Form("hFDTemplateNonPrompt_2D_PtCand%.0fto%.0f_PtHad%.0fto%.0f", ptCandMin, ptCandMax, ptHadMin, ptHadMax)); } h2D->GetYaxis()->SetTitle("#Delta#phi (rad)"); h2D->GetXaxis()->SetTitle("#Delta#eta"); @@ -1208,25 +1208,25 @@ TH2D* DhCorrelationExtraction::GetFDTemplateHisto(Int_t PromptOrFD, Double_t PtC return h2D; } -TH1D* DhCorrelationExtraction::GetCorrelHistoSecondaryPart(Int_t PartType, Double_t PtCandMin, Double_t PtCandMax, Double_t PtHadMin, Double_t PtHadMax) +TH1D* DhCorrelationExtraction::GetCorrelHistoSecondaryPart(Int_t partType, Double_t ptCandMin, Double_t ptCandMax, Double_t ptHadMin, Double_t ptHadMax) { TH1D* h1D = new TH1D(); // pointer to be returned THnSparseD* hSparse = 0x0; - if (PartType == kPrimaryPart) { // primary particles + if (partType == kPrimaryPart) { // primary particles hSparse = reinterpret_cast(fDirSecPart->Get(fHistoPrimaryPartName.Data())); } else { // all selected particles hSparse = reinterpret_cast(fDirSecPart->Get(fHistoAllPartName.Data())); } - Int_t binExtPtCandMin = hSparse->GetAxis(2)->FindBin(PtCandMin + 0.01); // axis2: ptCand, the 0.01 to avoid bin edges! - Int_t binExtPtCandMax = hSparse->GetAxis(2)->FindBin(PtCandMax - 0.01); - Int_t binExtPtHadMin = hSparse->GetAxis(3)->FindBin(PtHadMin + 0.01); // axis3: ptHad - Int_t binExtPtHadMax = hSparse->GetAxis(3)->FindBin(PtHadMax - 0.01); + Int_t binExtPtCandMin = hSparse->GetAxis(2)->FindBin(ptCandMin + 0.01); // axis2: ptCand, the 0.01 to avoid bin edges! + Int_t binExtPtCandMax = hSparse->GetAxis(2)->FindBin(ptCandMax - 0.01); + Int_t binExtPtHadMin = hSparse->GetAxis(3)->FindBin(ptHadMin + 0.01); // axis3: ptHad + Int_t binExtPtHadMax = hSparse->GetAxis(3)->FindBin(ptHadMax - 0.01); Int_t binExtPoolMin; Int_t binExtPoolMax; - if (PartType == kAllPart) { + if (partType == kAllPart) { binExtPoolMin = 1; binExtPoolMax = hSparse->GetAxis(4)->GetNbins(); } @@ -1243,15 +1243,15 @@ TH1D* DhCorrelationExtraction::GetCorrelHistoSecondaryPart(Int_t PartType, Doubl hSparse->GetAxis(1)->SetRange(binExtEtaMin, binExtEtaMax); // axis1: deltaEta hSparse->GetAxis(2)->SetRange(binExtPtCandMin, binExtPtCandMax); // axis2: ptCand hSparse->GetAxis(3)->SetRange(binExtPtHadMin, binExtPtHadMax); // axis3: ptHad - if (PartType == kAllPart) { + if (partType == kAllPart) { hSparse->GetAxis(4)->SetRange(binExtPoolMin, binExtPoolMax); // axis4: pool bin } h1D = hSparse->Projection(0); // axis0: deltaPhi - if (PartType == kPrimaryPart) { // primary particles - h1D->SetName(Form("hPrimaryPartCorr_PtD%.0fto%.0f_PtHad%.0fto%.0f", PtCandMin, PtCandMax, PtHadMin, PtHadMax)); + if (partType == kPrimaryPart) { // primary particles + h1D->SetName(Form("hPrimaryPartCorr_PtD%.0fto%.0f_PtHad%.0fto%.0f", ptCandMin, ptCandMax, ptHadMin, ptHadMax)); } else { // all selected particles - h1D->SetName(Form("hAllPartCorr_PtD%.0fto%.0f_PtHad%.0fto%.0f", PtCandMin, PtCandMax, PtHadMin, PtHadMax)); + h1D->SetName(Form("hAllPartCorr_PtD%.0fto%.0f_PtHad%.0fto%.0f", ptCandMin, ptCandMax, ptHadMin, ptHadMax)); } return h1D; @@ -1322,23 +1322,23 @@ TH1D* DhCorrelationExtraction::ReflectHistoRun2(TH1D* h, Double_t scale) return h2; } -Double_t DhCorrelationExtraction::GetFDPromptFrac(Double_t PtCandMin, Double_t PtCandMax, Double_t PtHadMin, Double_t PtHadMax) +Double_t DhCorrelationExtraction::GetFDPromptFrac(Double_t ptCandMin, Double_t ptCandMax, Double_t ptHadMin, Double_t ptHadMax) { TH1D* h1D = new TH1D(); h1D = reinterpret_cast(fFileFDPromptFrac->Get(fHistoFDPromptFracName.Data())); - Int_t binPtCandMin = h1D->GetXaxis()->FindBin(PtCandMin + 0.01); - Int_t binPtCandMax = h1D->GetXaxis()->FindBin(PtCandMax - 0.01); - Double_t PromptFraction; + Int_t binPtCandMin = h1D->GetXaxis()->FindBin(ptCandMin + 0.01); + Int_t binPtCandMax = h1D->GetXaxis()->FindBin(ptCandMax - 0.01); + Double_t promptFraction; if (binPtCandMin == binPtCandMax) { - PromptFraction = h1D->GetBinContent(binPtCandMin); + promptFraction = h1D->GetBinContent(binPtCandMin); } else { std::cout << "[ERROR] Different bin obtained from PtCandMin and PtCandMax"; return 0.; } - return PromptFraction; + return promptFraction; } void DhCorrelationExtraction::NormalizeMEplot(TH2D*& histoME, TH2D*& histoMEsoftPi) const diff --git a/PWGHF/HFC/Macros/DhCorrelationExtraction.h b/PWGHF/HFC/Macros/DhCorrelationExtraction.h index 5040466d441..820ee73cb26 100644 --- a/PWGHF/HFC/Macros/DhCorrelationExtraction.h +++ b/PWGHF/HFC/Macros/DhCorrelationExtraction.h @@ -37,13 +37,13 @@ class DhCorrelationExtraction : public TObject kDplusKpipi, kDsToKKPi, kDStarD0pi }; - enum selectAnalysisType { kSE, + enum SelectAnalysisType { kSE, kME }; - enum selectInvMassRegion { kSign, + enum SelectInvMassRegion { kSign, kSideb }; - enum selectDmesonOrigin { kPrompt, + enum SelectDmesonOrigin { kPrompt, kFD }; - enum selectParticleType { kPrimaryPart, + enum SelectParticleType { kPrimaryPart, kAllPart }; DhCorrelationExtraction(); // default constructor @@ -52,106 +52,106 @@ class DhCorrelationExtraction : public TObject /// Methods to set the input configuration // Input files, directories and histograms - Bool_t SetDmesonSpecie(DmesonSpecie k); - void SetInputFilenameMass(TString filenameMass) { fFileNameMass = filenameMass; } - void SetInputFilenameSE(TString filenameSE) { fFileNameSE = filenameSE; } - void SetInputFilenameME(TString filenameME) { fFileNameME = filenameME; } - void SetInputFilenameSecPart(TString filenameSecPart) { fFileSecPartName = filenameSecPart; } - void SetInputFilenameBiasBtoD(TString filenamePromptMcRec, TString filenameNonPromptMcRec) + Bool_t setDmesonSpecie(DmesonSpecie k); + void setInputFilenameMass(TString filenameMass) { fFileNameMass = filenameMass; } + void setInputFilenameSe(TString filenameSE) { fFileNameSE = filenameSE; } + void setInputFilenameMe(TString filenameME) { fFileNameME = filenameME; } + void setInputFilenameSecPart(TString filenameSecPart) { fFileSecPartName = filenameSecPart; } + void setInputFilenameBiasBtoD(TString filenamePromptMcRec, TString filenameNonPromptMcRec) { fFilePromptMcRecName = filenamePromptMcRec; fFileNonPromptMcRecName = filenameNonPromptMcRec; } - void SetDirNameSE(TString dirNameSE) { fDirNameSE = dirNameSE; } - void SetDirNameME(TString dirNameME) { fDirNameME = dirNameME; } - void SetDirNameSecPart(TString dirNameSecPart) { fDirSecPartName = dirNameSecPart; } - void SetMassHistoNameSgn(TString massHistoNameSgn) { fMassHistoNameSgn = massHistoNameSgn; } - void SetMassHistoNameBkg(TString massHistoNameBkg) { fMassHistoNameBkg = massHistoNameBkg; } - void SetMassHistoNameSBs(TString massHistoNameSBs) { fMassHistoNameSBs = massHistoNameSBs; } - void SetSECorrelHistoSignalName(TString correlNameSigSE) { fSECorrelSignalRegionName = correlNameSigSE; } - void SetSECorrelHistoSidebandName(TString correlNameSbSE) { fSECorrelSidebandsName = correlNameSbSE; } - void SetSECorrelHistoSidebandLeftName(TString correlNameSbSE) { fSECorrelSidebandLeftName = correlNameSbSE; } - void SetSECorrelHistoSidebandRightName(TString correlNameSbSE) { fSECorrelSidebandRightName = correlNameSbSE; } - void SetMECorrelHistoSignalName(TString correlNameSigME) { fMECorrelSignalRegionName = correlNameSigME; } - void SetMECorrelHistoSidebandName(TString correlNameSbME) { fMECorrelSidebandsName = correlNameSbME; } - void SetMECorrelHistoSidebandLeftName(TString correlNameSbME) { fMECorrelSidebandLeftName = correlNameSbME; } - void SetMECorrelHistoSidebandRightName(TString correlNameSbME) { fMECorrelSidebandRightName = correlNameSbME; } - void SetHistoSecPartName(TString histoPrimaryPartName, TString histoAllPartName) + void setDirNameSe(TString dirNameSE) { fDirNameSE = dirNameSE; } + void setDirNameMe(TString dirNameME) { fDirNameME = dirNameME; } + void setDirNameSecPart(TString dirNameSecPart) { fDirSecPartName = dirNameSecPart; } + void setMassHistoNameSgn(TString massHistoNameSgn) { fMassHistoNameSgn = massHistoNameSgn; } + void setMassHistoNameBkg(TString massHistoNameBkg) { fMassHistoNameBkg = massHistoNameBkg; } + void setMassHistoNameSBs(TString massHistoNameSBs) { fMassHistoNameSBs = massHistoNameSBs; } + void setSeCorrelHistoSignalName(TString correlNameSigSE) { fSECorrelSignalRegionName = correlNameSigSE; } + void setSeCorrelHistoSidebandName(TString correlNameSbSE) { fSECorrelSidebandsName = correlNameSbSE; } + void setSeCorrelHistoSidebandLeftName(TString correlNameSbSE) { fSECorrelSidebandLeftName = correlNameSbSE; } + void setSeCorrelHistoSidebandRightName(TString correlNameSbSE) { fSECorrelSidebandRightName = correlNameSbSE; } + void setMeCorrelHistoSignalName(TString correlNameSigME) { fMECorrelSignalRegionName = correlNameSigME; } + void setMeCorrelHistoSidebandName(TString correlNameSbME) { fMECorrelSidebandsName = correlNameSbME; } + void setMeCorrelHistoSidebandLeftName(TString correlNameSbME) { fMECorrelSidebandLeftName = correlNameSbME; } + void setMeCorrelHistoSidebandRightName(TString correlNameSbME) { fMECorrelSidebandRightName = correlNameSbME; } + void setHistoSecPartName(TString histoPrimaryPartName, TString histoAllPartName) { fHistoPrimaryPartName = histoPrimaryPartName; fHistoAllPartName = histoAllPartName; } - void SetInputFilenameFDTemplate(TString filenameFDTemplate) { fFileFDTemplateName = filenameFDTemplate; } - void SetInputFilenameFDPromptFrac(TString filenameFDPromptFrac) { fFileFDPromptFracName = filenameFDPromptFrac; } - void SetInputHistoNameFDTemplatePrompt(TString hNameFDTemplatePrompt) { fHistoFDTemplatePromptName = hNameFDTemplatePrompt; } - void SetInputHistoNameFDTemplateNonPrompt(TString hNameFDTemplateNonPrompt) { fHistoFDTemplateNonPromptName = hNameFDTemplateNonPrompt; } - void SetInputHistoNameFDPromptFrac(TString hNameFDPromptFrac) { fHistoFDPromptFracName = hNameFDPromptFrac; } + void setInputFilenameFdTemplate(TString filenameFDTemplate) { fFileFDTemplateName = filenameFDTemplate; } + void setInputFilenameFdPromptFrac(TString filenameFDPromptFrac) { fFileFDPromptFracName = filenameFDPromptFrac; } + void setInputHistoNameFdTemplatePrompt(TString hNameFDTemplatePrompt) { fHistoFDTemplatePromptName = hNameFDTemplatePrompt; } + void setInputHistoNameFdTemplateNonPrompt(TString hNameFDTemplateNonPrompt) { fHistoFDTemplateNonPromptName = hNameFDTemplateNonPrompt; } + void setInputHistoNameFdPromptFrac(TString hNameFDPromptFrac) { fHistoFDPromptFracName = hNameFDPromptFrac; } // Input conditions: PtCand, PtHad, PoolBins - void SetNpools(Int_t npools) { fNpools = npools; } - void SetCorrectPoolsSeparately(Bool_t usePools) { fCorrectPoolsSeparately = usePools; } - void SetDeltaEtaRange(Double_t etaLow = -1., Double_t etaHigh = 1) + void setNpools(Int_t npools) { fNpools = npools; } + void setCorrectPoolsSeparately(Bool_t usePools) { fCorrectPoolsSeparately = usePools; } + void setDeltaEtaRange(Double_t etaLow = -1., Double_t etaHigh = 1) { fDeltaEtaMin = etaLow; fDeltaEtaMax = etaHigh; } - void SetSubtractSoftPiInMEdistr(Bool_t subtractSoftPiME) { fSubtractSoftPiME = subtractSoftPiME; } - void SetBkgScaleFactor(Double_t scaleFactor) { fBkgScaleFactor = scaleFactor; } - void SetSignalYieldforNorm(Double_t sgnYield) { fSgnYieldNorm = sgnYield; } - void SetBkgYield(Double_t bkgYield) { fBkgYield = bkgYield; } - void SetSBYield(Double_t SBYield) { fSBYield = SBYield; } - void SetRebin2DcorrelHisto(Int_t rebinDeltaEta, Int_t rebinDeltaPhi) + void setSubtractSoftPiInMEdistr(Bool_t subtractSoftPiME) { fSubtractSoftPiME = subtractSoftPiME; } + void setBkgScaleFactor(Double_t scaleFactor) { fBkgScaleFactor = scaleFactor; } + void setSignalYieldforNorm(Double_t sgnYield) { fSgnYieldNorm = sgnYield; } + void setBkgYield(Double_t bkgYield) { fBkgYield = bkgYield; } + void setSbYield(Double_t sbYield) { fSBYield = sbYield; } + void setRebin2DcorrelHisto(Int_t rebinDeltaEta, Int_t rebinDeltaPhi) { fRebinAxisDeltaEta = rebinDeltaEta; fRebinAxisDeltaPhi = rebinDeltaPhi; } - void SetRebinOptions(Bool_t rebinAngCorr, Bool_t rebinFDCorr, Bool_t rebinSecPart) + void setRebinOptions(Bool_t rebinAngCorr, Bool_t rebinFDCorr, Bool_t rebinSecPart) { fRebinAngCorr = rebinAngCorr; fRebinFDCorr = rebinFDCorr; fRebinSecPart = rebinSecPart; } - void GetSignalAndBackgroundForNorm(Double_t PtCandMin, Double_t PtCandMax); - void NormalizeMEplot(TH2D*& histoME, TH2D*& histoMEsoftPi) const; - void SetDebugLevel(Int_t debug) { fDebug = debug; } - void SetDividedSidebands(Bool_t dividedSideb, Bool_t useSidebLeft, Bool_t useSidebRight) + void getSignalAndBackgroundForNorm(Double_t ptCandMin, Double_t ptCandMax); + void normalizeMEplot(TH2D*& histoME, TH2D*& histoMEsoftPi) const; + void setDebugLevel(Int_t debug) { fDebug = debug; } + void setDividedSidebands(Bool_t dividedSideb, Bool_t useSidebLeft, Bool_t useSidebRight) { fSidebandDivided = dividedSideb; fUseSidebLeft = useSidebLeft; fUseSidebRight = useSidebRight; } - void SetFDSubtraction(Bool_t subtractFD) { fFDsubtraction = subtractFD; } - void SetSecPartContamination(Bool_t secPartContamination) { fSecPartContamination = secPartContamination; } - void SetCorrBiasBtoD(Bool_t corrbiasBtoD) { fCorrBiasBtoD = corrbiasBtoD; } - void SetBinCandAndHad(Int_t binCand, Int_t binHad) + void setFdSubtraction(Bool_t subtractFD) { fFDsubtraction = subtractFD; } + void setSecPartContamination(Bool_t secPartContamination) { fSecPartContamination = secPartContamination; } + void setCorrBiasBtoD(Bool_t corrbiasBtoD) { fCorrBiasBtoD = corrbiasBtoD; } + void setBinCandAndHad(Int_t binCand, Int_t binHad) { fBinPtCand = binCand; fBinPtHad = binHad; } /// Analysis methods - TH2D* GetCorrelHisto(Int_t SEorME, Int_t SorSB, Int_t pool, Double_t PtCandMin, Double_t PtCandMax, Double_t PtHadMin, Double_t PtHadMax); - TH2D* GetFDTemplateHisto(Int_t PromptOrFD, Double_t PtCandMin, Double_t PtCandMax, Double_t PtHadMin, Double_t PtHadMax); - TH1D* GetCorrelHistoSecondaryPart(Int_t PrimaryPart, Double_t PtCandMin, Double_t PtCandMax, Double_t PtHadMin, Double_t PtHadMax); - TH1D* ReflectCorrHistogram(TH1D*& histo); - TH1D* ReflectHistoRun2(TH1D* h, Double_t scale); - TH1D* EvaluateMCClosModulations(Double_t PtCandMin, Double_t PtCandMax, Double_t PtHadMin, Double_t PtHadMax); - Double_t GetFDPromptFrac(Double_t PtCandMin, Double_t PtCandMax, Double_t PtHadMin, Double_t PtHadMax); - Double_t CalculateBaseline(TH1D*& histo, Bool_t totalRange = kTRUE, Bool_t reflected = kFALSE); - Double_t CalculateBaselineError(TH1D*& histo, Bool_t totalRange = kTRUE, Bool_t reflected = kFALSE); - Bool_t ReadInputSEandME(); - Bool_t ReadInputInvMass(); - Bool_t ReadInputFDSubtr(); - Bool_t ReadInputSecondaryPartContamination(); - Bool_t ExtractCorrelations(Double_t PtCandMin, Double_t PtCandMax, Double_t PtHadMin, Double_t PtHadMax, TString codeName); - TH1D* GetCorrectedCorrHisto() { return fCorrectedCorrHisto; } - TH1D* GetCorrectedCorrHisto_BaselineSubtr() { return fCorrectedCorrHisto_BaselineSubtr; } - TH1D* GetCorrectedCorrHisto_Reflected() { return fCorrectedCorrHisto_Reflected; } - TH1D* GetCorrectedCorrHisto_Reflected_BaselineSubtr() { return fCorrectedCorrHisto_Reflected_BaselineSubtr; } + TH2D* getCorrelHisto(Int_t sEorMe, Int_t sorSb, Int_t pool, Double_t ptCandMin, Double_t ptCandMax, Double_t ptHadMin, Double_t ptHadMax); + TH2D* getFdTemplateHisto(Int_t promptOrFd, Double_t ptCandMin, Double_t ptCandMax, Double_t ptHadMin, Double_t ptHadMax); + TH1D* getCorrelHistoSecondaryPart(Int_t primaryPart, Double_t ptCandMin, Double_t ptCandMax, Double_t ptHadMin, Double_t ptHadMax); + TH1D* reflectCorrHistogram(TH1D*& histo); + TH1D* reflectHistoRun2(TH1D* h, Double_t scale); + TH1D* evaluateMcClosModulations(Double_t ptCandMin, Double_t ptCandMax, Double_t ptHadMin, Double_t ptHadMax); + Double_t getFdPromptFrac(Double_t ptCandMin, Double_t ptCandMax, Double_t ptHadMin, Double_t ptHadMax); + Double_t calculateBaseline(TH1D*& histo, Bool_t totalRange = kTRUE, Bool_t reflected = kFALSE); + Double_t calculateBaselineError(TH1D*& histo, Bool_t totalRange = kTRUE, Bool_t reflected = kFALSE); + Bool_t readInputSEandMe(); + Bool_t readInputInvMass(); + Bool_t readInputFdSubtr(); + Bool_t readInputSecondaryPartContamination(); + Bool_t extractCorrelations(Double_t ptCandMin, Double_t ptCandMax, Double_t ptHadMin, Double_t ptHadMax, TString codeName); + TH1D* getCorrectedCorrHisto() { return fCorrectedCorrHisto; } + TH1D* getCorrectedCorrHistoBaselineSubtr() { return fCorrectedCorrHistoBaselineSubtr; } + TH1D* getCorrectedCorrHistoReflected() { return fCorrectedCorrHistoReflected; } + TH1D* getCorrectedCorrHistoReflectedBaselineSubtr() { return fCorrectedCorrHistoReflectedBaselineSubtr; } /// Histogram style - void SetTH1HistoStyle(TH1D*& histo, TString hTitle, TString hXaxisTitle, TString hYaxisTitle, Style_t markerStyle = kFullCircle, Color_t markerColor = kRed + 1, Double_t markerSize = 1.4, Color_t lineColor = kRed + 1, Int_t lineWidth = 3, Float_t hTitleXaxisOffset = 1.0, Float_t hTitleYaxisOffset = 1.0, Float_t hTitleXaxisSize = 0.060, Float_t hTitleYaxisSize = 0.060, Float_t hLabelXaxisSize = 0.060, Float_t hLabelYaxisSize = 0.060, Bool_t centerXaxisTitle = false, Bool_t centerYaxisTitle = false); - void SetTH2HistoStyle(TH2D*& histo, TString hTitle, TString hXaxisTitle, TString hYaxisTitle, TString hZaxisTitle, Float_t hTitleXaxisOffset = 1.8, Float_t hTitleYaxisOffset = 1.8, Float_t hTitleZaxisOffset = 1.2, Float_t hTitleXaxisSize = 0.060, Float_t hTitleYaxisSize = 0.060, Float_t hTitleZaxisSize = 0.060, Float_t hLabelXaxisSize = 0.060, Float_t hLabelYaxisSize = 0.060, Float_t hLabelZaxisSize = 0.060, Bool_t centerXaxisTitle = true, Bool_t centerYaxisTitle = true); + void setTH1HistoStyle(TH1D*& histo, TString hTitle, TString hXaxisTitle, TString hYaxisTitle, Style_t markerStyle = kFullCircle, Color_t markerColor = kRed + 1, Double_t markerSize = 1.4, Color_t lineColor = kRed + 1, Int_t lineWidth = 3, Float_t hTitleXaxisOffset = 1.0, Float_t hTitleYaxisOffset = 1.0, Float_t hTitleXaxisSize = 0.060, Float_t hTitleYaxisSize = 0.060, Float_t hLabelXaxisSize = 0.060, Float_t hLabelYaxisSize = 0.060, Bool_t centerXaxisTitle = false, Bool_t centerYaxisTitle = false); + void setTH2HistoStyle(TH2D*& histo, TString hTitle, TString hXaxisTitle, TString hYaxisTitle, TString hZaxisTitle, Float_t hTitleXaxisOffset = 1.8, Float_t hTitleYaxisOffset = 1.8, Float_t hTitleZaxisOffset = 1.2, Float_t hTitleXaxisSize = 0.060, Float_t hTitleYaxisSize = 0.060, Float_t hTitleZaxisSize = 0.060, Float_t hLabelXaxisSize = 0.060, Float_t hLabelYaxisSize = 0.060, Float_t hLabelZaxisSize = 0.060, Bool_t centerXaxisTitle = true, Bool_t centerYaxisTitle = true); private: TFile* fFileMass; // File containing the mass histograms @@ -169,9 +169,9 @@ class DhCorrelationExtraction : public TObject TDirectoryFile* fDirSecPart; // TDirectory for seondary particle correction TH1D* fCorrectedCorrHisto; // Corrected correlation histogram - TH1D* fCorrectedCorrHisto_BaselineSubtr; // Corrected correlation histogram with baseline subtracion - TH1D* fCorrectedCorrHisto_Reflected; // Corrected correlation histogram relected in azimuth - TH1D* fCorrectedCorrHisto_Reflected_BaselineSubtr; // Corrected correlation histogram reflected in azimuth with baseline subtraction + TH1D* fCorrectedCorrHistoBaselineSubtr; // Corrected correlation histogram with baseline subtracion + TH1D* fCorrectedCorrHistoReflected; // Corrected correlation histogram relected in azimuth + TH1D* fCorrectedCorrHistoReflectedBaselineSubtr; // Corrected correlation histogram reflected in azimuth with baseline subtraction DmesonSpecie fDmesonSpecies; // D meson specie TString fDmesonLabel; // D meson label diff --git a/PWGHF/HFC/Macros/DhCorrelationFitter.h b/PWGHF/HFC/Macros/DhCorrelationFitter.h index dbfe6f9a8a2..ee3dcbe9d39 100644 --- a/PWGHF/HFC/Macros/DhCorrelationFitter.h +++ b/PWGHF/HFC/Macros/DhCorrelationFitter.h @@ -44,63 +44,63 @@ class DhCorrelationFitter DhCorrelationFitter& operator=(const DhCorrelationFitter& cfit); /// Setters - void SetHistoIsReflected(Bool_t isrefl) { fIsReflected = isrefl; } - void SetFuncType(FunctionType fitType) { fTypeOfFitFunc = fitType; } - void SetFixBaseline(Int_t fixBase) { fFixBase = fixBase; } - void SetFixMean(Int_t fixMean) { fFixMean = fixMean; } - void SetPtRanges(Double_t PtCandMin, Double_t PtCandMax, Double_t PtAssocMin, Double_t PtAssocMax) + void setHistoIsReflected(Bool_t isrefl) { fIsReflected = isrefl; } + void setFuncType(FunctionType fitType) { fTypeOfFitFunc = fitType; } + void setFixBaseline(Int_t fixBase) { fFixBase = fixBase; } + void setFixMean(Int_t fixMean) { fFixMean = fixMean; } + void setPtRanges(Double_t ptCandMin, Double_t ptCandMax, Double_t ptAssocMin, Double_t ptAssocMax) { - fMinCandPt = PtCandMin; - fMaxCandPt = PtCandMax; - fMinAssoPt = PtAssocMin; - fMaxAssoPt = PtAssocMax; + fMinCandPt = ptCandMin; + fMaxCandPt = ptCandMax; + fMinAssoPt = ptAssocMin; + fMaxAssoPt = ptAssocMax; } - void SetExternalValsAndBounds(Int_t nPars, Double_t* vals, Double_t* lowBounds, Double_t* uppBounds); - void SetPointsForBaseline(Int_t nBaselinePoints, Int_t* binsBaseline); - void SetReflectedCorrHisto(Bool_t isReflected) { fIsTotal = !isReflected; } - void SetBaselineUpOrDown(Bool_t baseUp, Bool_t baseDown) + void setExternalValsAndBounds(Int_t nPars, Double_t* vals, Double_t* lowBounds, Double_t* uppBounds); + void setPointsForBaseline(Int_t nBaselinePoints, Int_t* binsBaseline); + void setReflectedCorrHisto(Bool_t isReflected) { fIsTotal = !isReflected; } + void setBaselineUpOrDown(Bool_t baseUp, Bool_t baseDown) { fShiftBaselineUp = baseUp; fShiftBaselineDown = baseDown; } - void Setv2(Double_t v2AssocPart, Double_t v2Dmeson) + void setv2(Double_t v2AssocPart, Double_t v2Dmeson) { fv2AssocPart = v2AssocPart; fv2Dmeson = v2Dmeson; } /// Functions for fitting - void Fitting(Bool_t drawSplitTerm = kTRUE, Bool_t useExternalPars = kFALSE); - void SetFitFunction(); - void CalculateYieldsAboveBaseline(); - void FitBaselineWv2(); - Double_t CalculateBaseline(TH1F*& histo, Bool_t totalRange = kTRUE); - Double_t CalculateBaselineError(TH1F*& histo, Bool_t totalRange = kTRUE); - void SetSingleTermsForDrawing(Bool_t draw); - Double_t FindBaseline(); + void fitting(Bool_t drawSplitTerm = kTRUE, Bool_t useExternalPars = kFALSE); + void setFitFunction(); + void calculateYieldsAboveBaseline(); + void fitBaselineWv2(); + Double_t calculateBaseline(TH1F*& histo, Bool_t totalRange = kTRUE); + Double_t calculateBaselineError(TH1F*& histo, Bool_t totalRange = kTRUE); + void setSingleTermsForDrawing(Bool_t draw); + Double_t findBaseline(); /// Getters - Double_t GetNSSigma() { return fFit->GetParameter("NS #sigma"); } // TODO: case kConstThreeGausPeriodicity - Double_t GetASSigma() { return fFit->GetParameter("AS #sigma"); } // TODO: case kConstThreeGausPeriodicity - Double_t GetNSYield() { return fFit->GetParameter("NS Y"); } - Double_t GetASYield() { return fFit->GetParameter("AS Y"); } - Double_t GetBeta() { return fFit->GetParameter(7); } - Double_t GetPedestal() const { return fBaseline; } - Double_t Getv2hadron() { return fFit->GetParameter("v_{2} hadron"); } - Double_t Getv2Dmeson() { return fFit->GetParameter("v_{2} D meson"); } - Double_t GetNSSigmaError() { return fFit->GetParError(fFit->GetParNumber("NS #sigma")); } // TODO: case kConstThreeGausPeriodicity - Double_t GetASSigmaError() { return fFit->GetParError(fFit->GetParNumber("AS #sigma")); } // TODO: case kConstThreeGausPeriodicityAS - Double_t GetNSYieldError() { return fFit->GetParError(fFit->GetParNumber("NS Y")); } - Double_t GetASYieldError() { return fFit->GetParError(fFit->GetParNumber("AS Y")); } - Double_t GetBetaError() { return fFit->GetParError(7); } - Double_t GetPedestalError() const { return fErrBaseline; } - Double_t Getv2hadronError() { return fFit->GetParError(fFit->GetParNumber("v_{2} hadron")); } - Double_t Getv2DmesonError() { return fFit->GetParError(fFit->GetParNumber("v_{2} D meson")); } - Double_t GetBinCountingNSYield() const { return fNSyieldBinCount; } - Double_t GetBinCountingASYield() const { return fASyieldBinCount; } - Double_t GetBinCountingNSYieldErr() const { return fErrNSyieldBinCount; } - Double_t GetBinCountingASYieldErr() const { return fErrASyieldBinCount; } - TF1* GetFitFunction() + Double_t getNsSigma() { return fFit->GetParameter("NS #sigma"); } // TODO: case kConstThreeGausPeriodicity + Double_t getAsSigma() { return fFit->GetParameter("AS #sigma"); } // TODO: case kConstThreeGausPeriodicity + Double_t getNsYield() { return fFit->GetParameter("NS Y"); } + Double_t getAsYield() { return fFit->GetParameter("AS Y"); } + Double_t getBeta() { return fFit->GetParameter(7); } + Double_t getPedestal() const { return fBaseline; } + Double_t getv2hadron() { return fFit->GetParameter("v_{2} hadron"); } + Double_t getv2Dmeson() { return fFit->GetParameter("v_{2} D meson"); } + Double_t getNsSigmaError() { return fFit->GetParError(fFit->GetParNumber("NS #sigma")); } // TODO: case kConstThreeGausPeriodicity + Double_t getAsSigmaError() { return fFit->GetParError(fFit->GetParNumber("AS #sigma")); } // TODO: case kConstThreeGausPeriodicityAS + Double_t getNsYieldError() { return fFit->GetParError(fFit->GetParNumber("NS Y")); } + Double_t getAsYieldError() { return fFit->GetParError(fFit->GetParNumber("AS Y")); } + Double_t getBetaError() { return fFit->GetParError(7); } + Double_t getPedestalError() const { return fErrBaseline; } + Double_t getv2hadronError() { return fFit->GetParError(fFit->GetParNumber("v_{2} hadron")); } + Double_t getv2DmesonError() { return fFit->GetParError(fFit->GetParNumber("v_{2} D meson")); } + Double_t getBinCountingNsYield() const { return fNSyieldBinCount; } + Double_t getBinCountingAsYield() const { return fASyieldBinCount; } + Double_t getBinCountingNsYieldErr() const { return fErrNSyieldBinCount; } + Double_t getBinCountingAsYieldErr() const { return fErrASyieldBinCount; } + TF1* getFitFunction() { if (fFit == nullptr) { printf("[ERROR] DhCorrelationFitter::GetFitFunction, No fit function"); diff --git a/PWGHF/HFC/TableProducer/correlatorD0D0bar.cxx b/PWGHF/HFC/TableProducer/correlatorD0D0bar.cxx index d2b5a006658..d9e3949d889 100644 --- a/PWGHF/HFC/TableProducer/correlatorD0D0bar.cxx +++ b/PWGHF/HFC/TableProducer/correlatorD0D0bar.cxx @@ -64,7 +64,7 @@ const double epsilon = 1E-5; const int npTBinsMassAndEfficiency = o2::analysis::hf_cuts_d0_to_pi_k::NBinsPt; const double efficiencyDmesonDefault[npTBinsMassAndEfficiency] = {}; -const auto efficiencyDmeson_v = std::vector{efficiencyDmesonDefault, efficiencyDmesonDefault + npTBinsMassAndEfficiency}; +const auto efficiencyDmesonV = std::vector{efficiencyDmesonDefault, efficiencyDmesonDefault + npTBinsMassAndEfficiency}; // histogram binning definition const int massAxisBins = 120; @@ -96,7 +96,7 @@ struct HfCorrelatorD0D0bar { Configurable multMin{"multMin", 0., "minimum multiplicity accepted"}; Configurable multMax{"multMax", 10000., "maximum multiplicity accepted"}; Configurable> binsPt{"binsPt", std::vector{o2::analysis::hf_cuts_d0_to_pi_k::vecBinsPt}, "pT bin limits for candidate mass plots and efficiency"}; - Configurable> efficiencyD{"efficiencyD", std::vector{efficiencyDmeson_v}, "Efficiency values for D0 meson"}; + Configurable> efficiencyD{"efficiencyD", std::vector{efficiencyDmesonV}, "Efficiency values for D0 meson"}; HfHelper hfHelper; diff --git a/PWGHF/HFC/TableProducer/correlatorD0D0barBarrelFullPid.cxx b/PWGHF/HFC/TableProducer/correlatorD0D0barBarrelFullPid.cxx index bdd438118fb..955e2d091e8 100644 --- a/PWGHF/HFC/TableProducer/correlatorD0D0barBarrelFullPid.cxx +++ b/PWGHF/HFC/TableProducer/correlatorD0D0barBarrelFullPid.cxx @@ -64,7 +64,7 @@ const double epsilon = 1E-5; const int npTBinsMassAndEfficiency = o2::analysis::hf_cuts_d0_to_pi_k::NBinsPt; const double efficiencyDmesonDefault[npTBinsMassAndEfficiency] = {}; -const auto efficiencyDmeson_v = std::vector{efficiencyDmesonDefault, efficiencyDmesonDefault + npTBinsMassAndEfficiency}; +const auto efficiencyDmesonV = std::vector{efficiencyDmesonDefault, efficiencyDmesonDefault + npTBinsMassAndEfficiency}; // histogram binning definition const int massAxisBins = 120; @@ -97,7 +97,7 @@ struct HfCorrelatorD0D0barBarrelFullPid { Configurable multMin{"multMin", 0., "minimum multiplicity accepted"}; Configurable multMax{"multMax", 10000., "maximum multiplicity accepted"}; Configurable> binsPt{"binsPt", std::vector{o2::analysis::hf_cuts_d0_to_pi_k::vecBinsPt}, "pT bin limits for candidate mass plots and efficiency"}; - Configurable> efficiencyD{"efficiencyD", std::vector{efficiencyDmeson_v}, "Efficiency values for D0 meson"}; + Configurable> efficiencyD{"efficiencyD", std::vector{efficiencyDmesonV}, "Efficiency values for D0 meson"}; HfHelper hfHelper; diff --git a/PWGHF/HFC/TableProducer/correlatorDMesonPairs.cxx b/PWGHF/HFC/TableProducer/correlatorDMesonPairs.cxx index 5be8bb22275..9ea0c350f66 100644 --- a/PWGHF/HFC/TableProducer/correlatorDMesonPairs.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDMesonPairs.cxx @@ -316,7 +316,7 @@ struct HfCorrelatorDMesonPairs { /// SelectedD and SelectedDbar bits look at whether the candidate passed the selection flags. /// \param candidate is candidate /// \return bitmap with type of candidate - template + template uint8_t assignCandidateTypeD0(const T& candidate) { uint8_t candidateType(0); @@ -326,7 +326,7 @@ struct HfCorrelatorDMesonPairs { if (candidate.isSelD0bar() >= selectionFlagD0bar) { SETBIT(candidateType, SelectedDbar); } - if constexpr (isMcRec) { + if constexpr (IsMcRec) { if (candidate.flagMcMatchRec() == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { // matched as D0 SETBIT(candidateType, TrueD); } diff --git a/PWGHF/HFC/TableProducer/correlatorDplusDminus.cxx b/PWGHF/HFC/TableProducer/correlatorDplusDminus.cxx index 29d0293c3e9..ad7fd59f989 100644 --- a/PWGHF/HFC/TableProducer/correlatorDplusDminus.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDplusDminus.cxx @@ -64,7 +64,7 @@ const double epsilon = 1E-5; const int npTBinsMassAndEfficiency = o2::analysis::hf_cuts_dplus_to_pi_k_pi::NBinsPt; const double efficiencyDmesonDefault[npTBinsMassAndEfficiency] = {}; -const auto efficiencyDmeson_v = std::vector{efficiencyDmesonDefault, efficiencyDmesonDefault + npTBinsMassAndEfficiency}; +const auto efficiencyDmesonV = std::vector{efficiencyDmesonDefault, efficiencyDmesonDefault + npTBinsMassAndEfficiency}; // histogram binning definition const int massAxisBins = 120; @@ -94,7 +94,7 @@ struct HfCorrelatorDplusDminus { Configurable multMin{"multMin", 0., "minimum multiplicity accepted"}; Configurable multMax{"multMax", 10000., "maximum multiplicity accepted"}; Configurable> binsPt{"binsPt", std::vector{o2::analysis::hf_cuts_dplus_to_pi_k_pi::vecBinsPt}, "pT bin limits for candidate mass plots and efficiency"}; - Configurable> efficiencyD{"efficiencyD", std::vector{efficiencyDmeson_v}, "Efficiency values for Dplus meson"}; + Configurable> efficiencyD{"efficiencyD", std::vector{efficiencyDmesonV}, "Efficiency values for Dplus meson"}; HfHelper hfHelper; SliceCache cache; diff --git a/PWGHF/HFC/TableProducer/correlatorFlowCharmHadronsReduced.cxx b/PWGHF/HFC/TableProducer/correlatorFlowCharmHadronsReduced.cxx index bb3c7c34b0a..3d6ab204e53 100644 --- a/PWGHF/HFC/TableProducer/correlatorFlowCharmHadronsReduced.cxx +++ b/PWGHF/HFC/TableProducer/correlatorFlowCharmHadronsReduced.cxx @@ -216,13 +216,13 @@ struct HfCorrelatorFlowCharmHadronsReduced { /// Get the binning pool associated to the collision /// \param collision is the collision /// \param binPolicy is the binning policy for the correlation - template + template int getPoolBin(const TColl& collision, const TBinningType& binPolicy) { int poolBin{0}; if constexpr (std::is_same_v) { poolBin = binPolicy.getBin(std::make_tuple(collision.posZ(), collision.centrality())); - if constexpr (isMixedEvent) { + if constexpr (IsMixedEvent) { registry.fill(HIST("hCentPoolBinME"), collision.centrality(), poolBin); registry.fill(HIST("hZVtxPoolBinME"), collision.posZ(), poolBin); } else { @@ -231,7 +231,7 @@ struct HfCorrelatorFlowCharmHadronsReduced { } } else if constexpr (std::is_same_v) { poolBin = binPolicy.getBin(std::make_tuple(collision.posZ(), collision.multiplicity())); - if constexpr (isMixedEvent) { + if constexpr (IsMixedEvent) { registry.fill(HIST("hMultFT0MPoolBinME"), collision.multiplicity(), poolBin); registry.fill(HIST("hZVtxPoolBinME"), collision.posZ(), poolBin); } else { @@ -261,7 +261,7 @@ struct HfCorrelatorFlowCharmHadronsReduced { /// \param trigCands are the selected trigger candidates /// \param assocTracks are the selected associated tracks /// \param binPolicy is the binning policy for the correlation - template + template void fillSameEvent(TPair const& pair, TTrigCand const& trigCand, TBinningType binPolicy) @@ -282,7 +282,7 @@ struct HfCorrelatorFlowCharmHadronsReduced { int poolBin = getPoolBin(collision, binPolicy); registry.fill(HIST("hPoolBinTrigSE"), poolBin); registry.fill(HIST("hPoolBinAssocSE"), poolBin); - if constexpr (fillTables) { + if constexpr (FillTables) { if constexpr (requires { trigCand.bdtScore0Trig(); }) { // Separate Charm-Had and Had-Had cases rowPairSECharmHads(poolBin, ptTrig, pair.ptAssoc(), pair.deltaEta(), pair.deltaPhi(), trigCand.invMassTrig(), trigCand.bdtScore0Trig(), trigCand.bdtScore1Trig(), @@ -294,7 +294,7 @@ struct HfCorrelatorFlowCharmHadronsReduced { } rowCollInfos(collision.multiplicity(), collision.numPvContrib(), collision.centrality()); } - if constexpr (fillSparses) { + if constexpr (FillSparses) { if constexpr (requires { trigCand.bdtScore0Trig(); }) { // Separate Charm-Had and Had-Had cases registry.fill(HIST("hSparseCorrelationsSECharmHad"), poolBin, ptTrig, pair.ptAssoc(), pair.deltaEta(), pair.deltaPhi(), trigCand.invMassTrig(), trigCand.bdtScore0Trig(), trigCand.bdtScore1Trig()); @@ -308,7 +308,7 @@ struct HfCorrelatorFlowCharmHadronsReduced { /// \param collisions are the selected collisions /// \param pairs are the mixed event pairs of trigger candidates and associated tracks /// \param binPolicy is the binning policy for the correlation - template + template void fillMixedEvent(TPairs const& pairs, TBinningType binPolicy) { @@ -346,7 +346,7 @@ struct HfCorrelatorFlowCharmHadronsReduced { } } double deltaPhi = RecoDecay::constrainAngle(getPhi(assocTrack) - getPhi(trigCand), -o2::constants::math::PIHalf); - if constexpr (fillTables) { + if constexpr (FillTables) { if constexpr (requires { trigCand.bdtScore0Trig(); }) { // Separate Charm-Had and Had-Had cases rowPairMECharmHads(poolBinTrig, ptTrig, ptAssoc, deltaEta, deltaPhi, trigCand.invMassTrig(), trigCand.bdtScore0Trig(), trigCand.bdtScore1Trig(), @@ -358,7 +358,7 @@ struct HfCorrelatorFlowCharmHadronsReduced { } rowCollInfos(trigColl.multiplicity(), trigColl.numPvContrib(), trigColl.centrality()); } - if constexpr (fillSparses) { + if constexpr (FillSparses) { if constexpr (requires { trigCand.bdtScore0Trig(); }) { // Separate Charm-Had and Had-Had cases registry.fill(HIST("hSparseCorrelationsMECharmHad"), poolBinTrig, ptTrig, ptAssoc, deltaEta, deltaPhi, trigCand.invMassTrig(), trigCand.bdtScore0Trig(), trigCand.bdtScore1Trig()); diff --git a/PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx index 681d1b79592..4f0a7cdc07c 100644 --- a/PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx @@ -104,7 +104,7 @@ struct HfCorrelatorLcScHadronsSelection { // filter on selection of Lc and decay channel Lc->PKPi Filter lcFilter = ((o2::aod::hf_track_index::hfflag & static_cast(1 << aod::hf_cand_3prong::DecayType::LcToPKPi)) != static_cast(0)) && (aod::hf_sel_candidate_lc::isSelLcToPKPi >= selectionFlagLc || aod::hf_sel_candidate_lc::isSelLcToPiKP >= selectionFlagLc); - template + template void selectionCollision(CollType const& collision, CandType const& candidates) { bool isSelColl = true; @@ -116,7 +116,7 @@ struct HfCorrelatorLcScHadronsSelection { if (doSelLcCollision) { for (const auto& candidate : candidates) { - if constexpr (isCandSc) { + if constexpr (IsCandSc) { int8_t chargeCand = candidate.charge(); if (chargeCand == chargeZero) { @@ -147,14 +147,14 @@ struct HfCorrelatorLcScHadronsSelection { candSel(isSelColl); } - template + template void selectionCollisionMcGen(CandType const& mcParticles) { bool isCandFound = false; double massCand = -999.0; for (const auto& particle : mcParticles) { - isCandFound = matchCandAndMass(particle, massCand); + isCandFound = matchCandAndMass(particle, massCand); if (!isCandFound) { continue; } @@ -451,11 +451,11 @@ struct HfCorrelatorLcScHadrons { } }; - template + template double estimateY(CandType const& candidate) { double y = -999.; - if constexpr (isCandSc) { + if constexpr (IsCandSc) { int8_t chargeCand = candidate.charge(); if (chargeCand == ChargeZero) { @@ -661,7 +661,7 @@ struct HfCorrelatorLcScHadrons { registry.fill(HIST("hPtTracksVsSignGen"), track.pt(), chargeTrack / (std::abs(chargeTrack))); } } - template + template void fillCorrelationTable(bool trkPidFill, TrackType const& track, CandType const& candidate, const std::vector& outMl, int binPool, int8_t correlStatus, double yCand, int signCand, McPart const& mcParticles) @@ -684,7 +684,7 @@ struct HfCorrelatorLcScHadrons { if (trkPidFill) { entryCandHadronPairTrkPID(track.tpcNSigmaPr(), track.tpcNSigmaKa(), track.tpcNSigmaPi(), track.tofNSigmaPr(), track.tofNSigmaKa(), track.tofNSigmaPi()); } - if constexpr (isMcRec) { + if constexpr (IsMcRec) { if (track.has_mcParticle()) { auto mcParticle = track.template mcParticle_as(); isPhysicalPrimary = mcParticle.isPhysicalPrimary(); @@ -701,7 +701,7 @@ struct HfCorrelatorLcScHadrons { } } - template + template void doSameEvent(CollisionType const& collision, TrackType const& tracks, CandType const& candidates, @@ -723,7 +723,7 @@ struct HfCorrelatorLcScHadrons { } } - if constexpr (!isMcRec) { + if constexpr (!IsMcRec) { timeStamp = collision.template bc_as().timestamp(); } @@ -762,7 +762,7 @@ struct HfCorrelatorLcScHadrons { bool selLcPKPi = false; bool selLcPiKP = false; - yCand = estimateY(candidate); + yCand = estimateY(candidate); etaCand = candidate.eta(); ptCand = candidate.pt(); phiCand = RecoDecay::constrainAngle(candidate.phi(), -PIHalf); @@ -781,12 +781,12 @@ struct HfCorrelatorLcScHadrons { efficiencyWeightCand = 1. / efficiencyLc->at(o2::analysis::findBin(binsPtEfficiencyLc, ptCand)); } - if constexpr (isMcRec) { + if constexpr (IsMcRec) { isPrompt = candidate.originMcRec() == RecoDecay::OriginType::Prompt; isNonPrompt = candidate.originMcRec() == RecoDecay::OriginType::NonPrompt; } - if constexpr (isCandSc) { + if constexpr (IsCandSc) { chargeCand = candidate.charge(); const auto& candidateLc = candidate.template prongLc_as(); ptCandLc = candidateLc.pt(); @@ -802,7 +802,7 @@ struct HfCorrelatorLcScHadrons { fillMlOutput(probs, outputMlPiKP); massCandPiKP = std::abs(hfHelper.invMassScRecoLcToPiKP(candidate, candidateLc) - hfHelper.invMassLcToPiKP(candidateLc)); } - if constexpr (isMcRec) { + if constexpr (IsMcRec) { // isSignal = // (TESTBIT(std::abs(candidate.flagMcMatchRec()), aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi) && chargeCand == 0) || // (TESTBIT(std::abs(candidate.flagMcMatchRec()), aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi) && std::abs(chargeCand) == 2); @@ -843,7 +843,7 @@ struct HfCorrelatorLcScHadrons { auto trackPos1 = candidate.template prong0_as(); auto trackPos2 = candidate.template prong2_as(); chargeCand = trackPos1.sign(); - if constexpr (isMcRec) { + if constexpr (IsMcRec) { isSignal = std::abs(candidate.flagMcMatchRec()) == o2::hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi; if (calTrkEff && countCand == 1 && (isSignal || !calEffEventWithCand)) { calculateTrkEff(trackPos1, trackPos2, *mcParticles); @@ -906,7 +906,7 @@ struct HfCorrelatorLcScHadrons { // Correlation with hadrons for (const auto& track : tracks) { // Remove Lc daughters by checking track indices - if constexpr (!isCandSc) { + if constexpr (!IsCandSc) { if ((candidate.prong0Id() == track.globalIndex()) || (candidate.prong1Id() == track.globalIndex()) || (candidate.prong2Id() == track.globalIndex())) { if (!storeAutoCorrelationFlag) { continue; @@ -935,7 +935,7 @@ struct HfCorrelatorLcScHadrons { continue; } } - if constexpr (isMcRec) { + if constexpr (IsMcRec) { if (calTrkEff && countCand == 1 && (isSignal || !calEffEventWithCand) && track.has_mcParticle()) { auto mcParticle = track.template mcParticle_as(); if (!mcParticle.isPhysicalPrimary() && isRecTrkPhyPrimary) { @@ -955,11 +955,11 @@ struct HfCorrelatorLcScHadrons { } if (selLcPKPi) { - fillCorrelationTable(fillTrkPID, track, candidate, outputMlPKPi, poolBin, correlationStatus, yCand, chargeCand, *mcParticles); + fillCorrelationTable(fillTrkPID, track, candidate, outputMlPKPi, poolBin, correlationStatus, yCand, chargeCand, *mcParticles); entryCandHadronRecoInfo(massCandPKPi, false); } if (selLcPiKP) { - fillCorrelationTable(fillTrkPID, track, candidate, outputMlPiKP, poolBin, correlationStatus, yCand, chargeCand, *mcParticles); + fillCorrelationTable(fillTrkPID, track, candidate, outputMlPiKP, poolBin, correlationStatus, yCand, chargeCand, *mcParticles); entryCandHadronRecoInfo(massCandPiKP, false); } @@ -979,7 +979,7 @@ struct HfCorrelatorLcScHadrons { registry.fill(HIST("hMultFT0M"), multiplicityFT0M); } - template + template void doMixEvent(CollisionType const& collisions, TrackType const& tracks, CandType const& candidates, @@ -1010,14 +1010,14 @@ struct HfCorrelatorLcScHadrons { registry.fill(HIST("hLcPoolBin"), poolBinLc); for (const auto& [candidate, assocParticle] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { - yCand = estimateY(candidate); + yCand = estimateY(candidate); ptCand = candidate.pt(); - if constexpr (isMcRec) { + if constexpr (IsMcRec) { isPrompt = candidate.originMcRec() == RecoDecay::OriginType::Prompt; isNonPrompt = candidate.originMcRec() == RecoDecay::OriginType::NonPrompt; } - if constexpr (isCandSc) { + if constexpr (IsCandSc) { const auto& candidateLc = candidate.template prongLc_as(); chargeCand = candidate.charge(); @@ -1033,7 +1033,7 @@ struct HfCorrelatorLcScHadrons { fillMlOutput(probs, outputMlPiKP); massCandPiKP = std::abs(hfHelper.invMassScRecoLcToPiKP(candidate, candidateLc) - hfHelper.invMassLcToPiKP(candidateLc)); } - if constexpr (isMcRec) { + if constexpr (IsMcRec) { isSignal = (TESTBIT(std::abs(candidate.flagMcMatchRec()), aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi) && chargeCand == ChargeZero) || (TESTBIT(std::abs(candidate.flagMcMatchRec()), aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi) && std::abs(chargeCand) == ChargeScPlusPlus); @@ -1059,7 +1059,7 @@ struct HfCorrelatorLcScHadrons { } auto trackPos1 = candidate.template prong0_as(); chargeCand = trackPos1.sign(); - if constexpr (isMcRec) { + if constexpr (IsMcRec) { isSignal = std::abs(candidate.flagMcMatchRec()) == o2::hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi; } } @@ -1075,7 +1075,7 @@ struct HfCorrelatorLcScHadrons { } if (selLcPKPi) { - fillCorrelationTable(fillTrkPID, assocParticle, candidate, outputMlPKPi, poolBin, correlationStatus, yCand, chargeCand, *mcParticles); + fillCorrelationTable(fillTrkPID, assocParticle, candidate, outputMlPKPi, poolBin, correlationStatus, yCand, chargeCand, *mcParticles); entryCandHadronRecoInfo(massCandPKPi, false); if (isPrompt) { @@ -1088,7 +1088,7 @@ struct HfCorrelatorLcScHadrons { } if (selLcPiKP) { - fillCorrelationTable(fillTrkPID, assocParticle, candidate, outputMlPiKP, poolBin, correlationStatus, yCand, chargeCand, *mcParticles); + fillCorrelationTable(fillTrkPID, assocParticle, candidate, outputMlPiKP, poolBin, correlationStatus, yCand, chargeCand, *mcParticles); entryCandHadronRecoInfo(massCandPiKP, false); if (isPrompt) { @@ -1103,7 +1103,7 @@ struct HfCorrelatorLcScHadrons { } } - template + template void doSameEventMcGen(CollisionType const& mcCollision, PartType const& mcParticles) { @@ -1123,7 +1123,7 @@ struct HfCorrelatorLcScHadrons { for (const auto& particle : mcParticles) { double massCand = -999.0; - bool isCandFound = isCandSc ? matchCandAndMass(particle, massCand) : matchCandAndMass(particle, massCand); + bool isCandFound = IsCandSc ? matchCandAndMass(particle, massCand) : matchCandAndMass(particle, massCand); if (!isCandFound) { continue; } @@ -1157,9 +1157,9 @@ struct HfCorrelatorLcScHadrons { static constexpr std::size_t NDaughtersLc{3u}; std::vector listDaughters{}; listDaughters.clear(); - const std::size_t nDaughtersExpected = isCandSc ? NDaughtersSc : NDaughtersLc; + const std::size_t nDaughtersExpected = IsCandSc ? NDaughtersSc : NDaughtersLc; - if (isCandSc) { + if (IsCandSc) { if (massCand == o2::constants::physics::MassSigmaC0 || massCand == o2::constants::physics::MassSigmaCStar0) { std::array arrDaughSc0PDG = {kProton, -kKPlus, kPiPlus, kPiMinus}; RecoDecay::getDaughters(particle, &listDaughters, arrDaughSc0PDG, 2); diff --git a/PWGHF/HFC/TableProducer/derivedDataCreatorCorrelationsReduced.cxx b/PWGHF/HFC/TableProducer/derivedDataCreatorCorrelationsReduced.cxx index a35dbe29aed..4fa3d9cc68b 100644 --- a/PWGHF/HFC/TableProducer/derivedDataCreatorCorrelationsReduced.cxx +++ b/PWGHF/HFC/TableProducer/derivedDataCreatorCorrelationsReduced.cxx @@ -51,7 +51,7 @@ using namespace o2::framework::expressions; using namespace o2::hf_centrality; using namespace o2::hf_evsel; -enum CandType { +enum CandidateType { DplusToPiKPi = 0, DsToKKPi, DsToPiKK, @@ -188,22 +188,22 @@ struct HfDerivedDataCreatorCorrelationsReduced { /// Get charm hadron candidate mass /// \param candidate is the charm hadron candidate - template + template double getCandMass(const TCand& candidate) { - if constexpr (candType == CandType::DsToKKPi) { + if constexpr (CandType == CandidateType::DsToKKPi) { return hfHelper.invMassDsToKKPi(candidate); } - if constexpr (candType == CandType::DsToPiKK) { + if constexpr (CandType == CandidateType::DsToPiKK) { return hfHelper.invMassDsToPiKK(candidate); } - if constexpr (candType == CandType::DplusToPiKPi) { + if constexpr (CandType == CandidateType::DplusToPiKPi) { return hfHelper.invMassDplusToPiKPi(candidate); } - if constexpr (candType == CandType::D0ToPiK) { + if constexpr (CandType == CandidateType::D0ToPiK) { return hfHelper.invMassD0ToPiK(candidate); } - if constexpr (candType == CandType::D0ToKPi) { + if constexpr (CandType == CandidateType::D0ToKPi) { return hfHelper.invMassD0barToKPi(candidate); } return -1.; @@ -211,31 +211,31 @@ struct HfDerivedDataCreatorCorrelationsReduced { /// Get charm hadron bdt scores /// \param candidate is the charm hadron candidate - template + template std::array getCandMlScores(const TCand& candidate) { std::array outputMl{-999.f, -999.f}; - if constexpr (candType == CandType::DsToKKPi) { + if constexpr (CandType == CandidateType::DsToKKPi) { for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { outputMl[iclass] = candidate.mlProbDsToKKPi()[classMl->at(iclass)]; } } - if constexpr (candType == CandType::DsToPiKK) { + if constexpr (CandType == CandidateType::DsToPiKK) { for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { outputMl[iclass] = candidate.mlProbDsToPiKK()[classMl->at(iclass)]; } } - if constexpr (candType == CandType::DplusToPiKPi) { + if constexpr (CandType == CandidateType::DplusToPiKPi) { for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { outputMl[iclass] = candidate.mlProbDplusToPiKPi()[classMl->at(iclass)]; } } - if constexpr (candType == CandType::D0ToPiK) { + if constexpr (CandType == CandidateType::D0ToPiK) { for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { outputMl[iclass] = candidate.mlProbD0()[classMl->at(iclass)]; } } - if constexpr (candType == CandType::D0ToKPi) { + if constexpr (CandType == CandidateType::D0ToKPi) { for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { outputMl[iclass] = candidate.mlProbD0bar()[classMl->at(iclass)]; } @@ -272,7 +272,7 @@ struct HfDerivedDataCreatorCorrelationsReduced { /// Checks if the trigger cand-associated track pair can be accepted for SE correlation /// \param assTrk is the associated track /// \param cand is the trigger candidate - template + template bool acceptSameEvtPair(TAssocTrk const& assTrk, TCand const& cand, double deltaEta) { if (std::abs(deltaEta) <= deltaEtaAbsMin || std::abs(deltaEta) > deltaEtaAbsMax) { @@ -284,7 +284,7 @@ struct HfDerivedDataCreatorCorrelationsReduced { } int trackGlobalIndex = assTrk.globalIndex(); - if constexpr (candType == CandType::Hadron) { + if constexpr (CandType == CandidateType::Hadron) { if (!cand.isGlobalTrackWoDCA() || cand.tpcNClsCrossedRows() < tpcNClsCrossedRowsMin) { return false; } @@ -309,7 +309,7 @@ struct HfDerivedDataCreatorCorrelationsReduced { /// \param trigCands are the trigger candidates /// \param assTrks are the associated tracks /// \param collCentrality is the collision centrality - template + template void fillSameEvent(TTrigCands const& trigCands, TAssocTrks const& assTrks, const float collCentrality) @@ -318,11 +318,11 @@ struct HfDerivedDataCreatorCorrelationsReduced { double trigCandPt = trigCand.pt(); registry.fill(HIST("hPhiVsPtTrig"), RecoDecay::constrainAngle(trigCand.phi(), -o2::constants::math::PIHalf), trigCandPt); registry.fill(HIST("hEtaVsPtTrig"), trigCand.eta(), trigCandPt); - if constexpr (candType == CandType::Hadron) { + if constexpr (CandType == CandidateType::Hadron) { rowTrigHads(trigCandPt, trigCand.tpcNClsCrossedRows(), trigCand.itsClusterMap(), trigCand.itsNCls(), trigCand.dcaXY(), trigCand.dcaZ()); } else { - std::array outputMl = getCandMlScores(trigCand); - rowTrigCharms(trigCandPt, getCandMass(trigCand), outputMl[0], outputMl[1]); + std::array outputMl = getCandMlScores(trigCand); + rowTrigCharms(trigCandPt, getCandMass(trigCand), outputMl[0], outputMl[1]); } for (const auto& assTrk : assTrks) { @@ -335,7 +335,7 @@ struct HfDerivedDataCreatorCorrelationsReduced { } double deltaEta = assTrk.eta() - trigCand.eta(); - if (!acceptSameEvtPair(assTrk, trigCand, deltaEta)) { + if (!acceptSameEvtPair(assTrk, trigCand, deltaEta)) { continue; } if (downSampleTrksFactor < 1.) { @@ -353,7 +353,7 @@ struct HfDerivedDataCreatorCorrelationsReduced { double deltaPhi = RecoDecay::constrainAngle(assTrk.phi() - trigCand.phi(), -o2::constants::math::PIHalf); rowAssocTrkSels(assTrk.tpcNClsCrossedRows(), assTrk.itsClusterMap(), assTrk.itsNCls(), assTrk.dcaXY(), assTrk.dcaZ()); - if constexpr (candType == CandType::Hadron) { + if constexpr (CandType == CandidateType::Hadron) { rowSEHadHadPairs(rowCollisions.lastIndex(), rowTrigHads.lastIndex(), assTrkPt, deltaEta, deltaPhi); } else { rowSECharmHadPairs(rowCollisions.lastIndex(), rowTrigCharms.lastIndex(), assTrkPt, deltaEta, deltaPhi); @@ -364,16 +364,16 @@ struct HfDerivedDataCreatorCorrelationsReduced { /// Fill charm hadron tables for mixed-event /// \param trigCands are the charm trigger candidates - template + template void fillCharmMixedEvent(TTrigCands const& trigCands) { for (const auto& trigCand : trigCands) { registry.fill(HIST("hPhiVsPtTrig"), RecoDecay::constrainAngle(trigCand.phi(), -o2::constants::math::PIHalf), trigCand.pt()); registry.fill(HIST("hEtaVsPtTrig"), trigCand.eta(), trigCand.pt()); - std::array outputMl = getCandMlScores(trigCand); + std::array outputMl = getCandMlScores(trigCand); rowTrigBases(rowCollisions.lastIndex(), trigCand.phi(), trigCand.eta()); - rowTrigCharms(trigCand.pt(), getCandMass(trigCand), outputMl[0], outputMl[1]); + rowTrigCharms(trigCand.pt(), getCandMass(trigCand), outputMl[0], outputMl[1]); } } @@ -425,7 +425,7 @@ struct HfDerivedDataCreatorCorrelationsReduced { return; } rowCollisions(mult, coll.numContrib(), cent, coll.posZ()); - fillSameEvent(candsDplus, tracks, cent); + fillSameEvent(candsDplus, tracks, cent); } PROCESS_SWITCH(HfDerivedDataCreatorCorrelationsReduced, processDplusSameEvent, "Process Same Event for Dplus candidates", true); @@ -442,7 +442,7 @@ struct HfDerivedDataCreatorCorrelationsReduced { return; } rowCollisions(mult, coll.numContrib(), cent, coll.posZ()); - fillCharmMixedEvent(candsDplus); + fillCharmMixedEvent(candsDplus); fillTrkMixedEvent(tracks, cent); } PROCESS_SWITCH(HfDerivedDataCreatorCorrelationsReduced, processDplusMixedEvent, "Process Mixed Event for Dplus candidates", false); @@ -462,8 +462,8 @@ struct HfDerivedDataCreatorCorrelationsReduced { return; } rowCollisions(mult, coll.numContrib(), cent, coll.posZ()); - fillSameEvent(candsDsToPiKK, tracks, cent); - fillSameEvent(candsDsToKKPi, tracks, cent); + fillSameEvent(candsDsToPiKK, tracks, cent); + fillSameEvent(candsDsToKKPi, tracks, cent); } PROCESS_SWITCH(HfDerivedDataCreatorCorrelationsReduced, processDsSameEvent, "Process Same Event for Ds candidates", false); @@ -482,8 +482,8 @@ struct HfDerivedDataCreatorCorrelationsReduced { return; } rowCollisions(mult, coll.numContrib(), cent, coll.posZ()); - fillCharmMixedEvent(candsDsToPiKK); - fillCharmMixedEvent(candsDsToKKPi); + fillCharmMixedEvent(candsDsToPiKK); + fillCharmMixedEvent(candsDsToKKPi); fillTrkMixedEvent(tracks, cent); } PROCESS_SWITCH(HfDerivedDataCreatorCorrelationsReduced, processDsMixedEvent, "Process Mixed Event for Ds candidates", false); @@ -503,8 +503,8 @@ struct HfDerivedDataCreatorCorrelationsReduced { return; } rowCollisions(mult, coll.numContrib(), cent, coll.posZ()); - fillSameEvent(candsD0ToPiK, tracks, cent); - fillSameEvent(candsD0ToKPi, tracks, cent); + fillSameEvent(candsD0ToPiK, tracks, cent); + fillSameEvent(candsD0ToKPi, tracks, cent); } PROCESS_SWITCH(HfDerivedDataCreatorCorrelationsReduced, processD0SameEvent, "Process Same Event for D0 candidates", false); @@ -523,8 +523,8 @@ struct HfDerivedDataCreatorCorrelationsReduced { return; } rowCollisions(mult, coll.numContrib(), cent, coll.posZ()); - fillCharmMixedEvent(candsD0ToPiK); - fillCharmMixedEvent(candsD0ToKPi); + fillCharmMixedEvent(candsD0ToPiK); + fillCharmMixedEvent(candsD0ToKPi); fillTrkMixedEvent(tracks, cent); } PROCESS_SWITCH(HfDerivedDataCreatorCorrelationsReduced, processD0MixedEvent, "Process Mixed Event for D0 candidates", false); @@ -538,7 +538,7 @@ struct HfDerivedDataCreatorCorrelationsReduced { return; } rowCollisions(mult, coll.numContrib(), cent, coll.posZ()); - fillSameEvent(tracks, tracks, cent); + fillSameEvent(tracks, tracks, cent); } PROCESS_SWITCH(HfDerivedDataCreatorCorrelationsReduced, processHadronHadronSameEvent, "Process Same Event for hadron candidates", true); diff --git a/PWGHF/HFC/TableProducer/femtoDreamProducer.cxx b/PWGHF/HFC/TableProducer/femtoDreamProducer.cxx index 8db6148de90..004886dfeb3 100644 --- a/PWGHF/HFC/TableProducer/femtoDreamProducer.cxx +++ b/PWGHF/HFC/TableProducer/femtoDreamProducer.cxx @@ -374,7 +374,7 @@ struct HfFemtoDreamProducer { } } - template + template bool fillTracksForCharmHadron(CollisionType const& col, TrackType const& tracks) { @@ -413,14 +413,14 @@ struct HfFemtoDreamProducer { fillDebugParticle(track); } - if constexpr (isMc) { + if constexpr (IsMc) { fillMcParticle(col, track, o2::aod::femtodreamparticle::ParticleType::kTrack); } } return fIsTrackFilled; } - template + template void fillCharmHadronTable(CollisionType const& col, TrackType const& tracks, CandType const& candidates) { const auto vtxZ = col.posZ(); @@ -458,7 +458,7 @@ struct HfFemtoDreamProducer { } outputCollision(vtxZ, mult, multNtr, spher, magField); - if constexpr (isMc) { + if constexpr (IsMc) { fillMcCollision(col); } @@ -478,12 +478,12 @@ struct HfFemtoDreamProducer { auto bc = col.template bc_as(); int64_t timeStamp = bc.timestamp(); - auto fillTable = [&](int CandFlag, - int FunctionSelection, - float BDTScoreBkg, - float BDTScorePrompt, - float BDTScoreFD) { - if (FunctionSelection >= 1){ + auto fillTable = [&](int candFlag, + int functionSelection, + float bdtScoreBkg, + float bdtScorePrompt, + float bdtScoreFd) { + if (functionSelection >= 1){ rowCandCharmHad( outputCollision.lastIndex(), timeStamp, @@ -500,21 +500,21 @@ struct HfFemtoDreamProducer { trackPos1.phi(), trackNeg.phi(), trackPos2.phi(), - 1 << CandFlag, - BDTScoreBkg, - BDTScorePrompt, - BDTScoreFD); + 1 << candFlag, + bdtScoreBkg, + bdtScorePrompt, + bdtScoreFd); // Row for MC candidate charm hadron (if constexpr isMc) - if constexpr (isMc) { + if constexpr (IsMc) { rowCandMcCharmHad( candidate.flagMcMatchRec(), candidate.originMcRec()); } } }; - if constexpr (channel == DecayChannel::DplusToPiKPi) { - if constexpr (useCharmMl) { + if constexpr (Channel == DecayChannel::DplusToPiKPi) { + if constexpr (UseCharmMl) { /// fill with ML information /// BDT index 0: bkg score; BDT index 1: prompt score; BDT index 2: non-prompt score if (applyMlMode == FillMlFromSelector) { @@ -538,8 +538,8 @@ struct HfFemtoDreamProducer { } fillTable(2, candidate.isSelDplusToPiKPi(), outputMlDplus.at(0), outputMlDplus.at(1), outputMlDplus.at(2)); - } else if constexpr (channel == DecayChannel::LcToPKPi) { - if constexpr (useCharmMl) { + } else if constexpr (Channel == DecayChannel::LcToPKPi) { + if constexpr (UseCharmMl) { /// fill with ML information /// BDT index 0: bkg score; BDT index 1: prompt score; BDT index 2: non-prompt score if (applyMlMode == FillMlFromSelector) { @@ -577,7 +577,7 @@ struct HfFemtoDreamProducer { } if (!isTrackFilled) { - isTrackFilled = fillTracksForCharmHadron(col, tracks); + isTrackFilled = fillTracksForCharmHadron(col, tracks); // If track filling was successful, fill the collision table } @@ -618,12 +618,12 @@ struct HfFemtoDreamProducer { return true; } - template + template void fillCharmHadMcGen(ParticleType particles) { // Filling particle properties rowCandCharmHadGen.reserve(particles.size()); - if constexpr (channel == DecayChannel::DplusToPiKPi) { + if constexpr (Channel == DecayChannel::DplusToPiKPi) { for (const auto& particle : particles) { if (std::abs(particle.flagMcMatchGen()) == hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi) { rowCandCharmHadGen( @@ -632,7 +632,7 @@ struct HfFemtoDreamProducer { particle.originMcGen()); } } - } else if constexpr (channel == DecayChannel::LcToPKPi) { + } else if constexpr (Channel == DecayChannel::LcToPKPi) { for (const auto& particle : particles) { if (std::abs(particle.flagMcMatchGen()) == hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) { rowCandCharmHadGen( diff --git a/PWGHF/HFC/Tasks/taskCharmHadronsFemtoDream.cxx b/PWGHF/HFC/Tasks/taskCharmHadronsFemtoDream.cxx index 146d6fb8955..8dfa43f0ebd 100644 --- a/PWGHF/HFC/Tasks/taskCharmHadronsFemtoDream.cxx +++ b/PWGHF/HFC/Tasks/taskCharmHadronsFemtoDream.cxx @@ -344,7 +344,7 @@ struct HfTaskCharmHadronsFemtoDream { } /// This function processes the same event and takes care of all the histogramming - template + template void doSameEvent(PartitionType& sliceTrk1, CandType& sliceCharmHad, TableTracks const& parts, Collision const& col) { fillCollision(col); @@ -396,11 +396,11 @@ struct HfTaskCharmHadronsFemtoDream { } /// Filling QA histograms of the selected tracks - selectedTrackHisto.fillQA(p1, static_cast(confTempFitVarMomentum.value), col.multNtr(), col.multV0M()); + selectedTrackHisto.fillQA(p1, static_cast(confTempFitVarMomentum.value), col.multNtr(), col.multV0M()); int charmHadMc = 0; int originType = 0; - if constexpr (isMc) { + if constexpr (IsMc) { charmHadMc = p2.flagMc(); originType = p2.originMcRec(); } @@ -424,11 +424,11 @@ struct HfTaskCharmHadronsFemtoDream { charmHadMc, originType); - sameEventCont.setPair(p1, p2, col.multNtr(), col.multV0M(), use4D, extendedPlots, smearingByOrigin); + sameEventCont.setPair(p1, p2, col.multNtr(), col.multV0M(), use4D, extendedPlots, smearingByOrigin); } } - template + template void doMixedEvent(CollisionType const& cols, PartType const& parts, PartitionType1& part1, PartitionType2& part2, BinningType policy) { processType = 2; // for mixed event @@ -494,7 +494,7 @@ struct HfTaskCharmHadronsFemtoDream { int charmHadMc = 0; int originType = 0; - if constexpr (isMc) { + if constexpr (IsMc) { charmHadMc = p2.flagMc(); originType = p2.originMcRec(); } @@ -518,7 +518,7 @@ struct HfTaskCharmHadronsFemtoDream { charmHadMc, originType); - mixedEventCont.setPair(p1, p2, collision1.multNtr(), collision1.multV0M(), use4D, extendedPlots, smearingByOrigin); + mixedEventCont.setPair(p1, p2, collision1.multNtr(), collision1.multV0M(), use4D, extendedPlots, smearingByOrigin); } } } diff --git a/PWGHF/HFC/Tasks/taskCorrelationDDbar.cxx b/PWGHF/HFC/Tasks/taskCorrelationDDbar.cxx index 7a5584ff519..6f3328d96de 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationDDbar.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationDDbar.cxx @@ -76,37 +76,37 @@ const TString stringMCReco = "MC reco - D,Dbar candidates "; // definition of vectors for standard ptbin and invariant mass configurables const int npTBinsCorrelations = 8; const double pTBinsCorrelations[npTBinsCorrelations + 1] = {0., 2., 4., 6., 8., 12., 16., 24., 99.}; -const auto pTBinsCorrelations_v = std::vector{pTBinsCorrelations, pTBinsCorrelations + npTBinsCorrelations + 1}; +const auto pTBinsCorrelationsV = std::vector{pTBinsCorrelations, pTBinsCorrelations + npTBinsCorrelations + 1}; const double signalRegionInnerDefault[npTBinsCorrelations] = {1.810, 1.810, 1.810, 1.810, 1.810, 1.810, 1.810, 1.810}; const double signalRegionOuterDefault[npTBinsCorrelations] = {1.922, 1.922, 1.922, 1.922, 1.922, 1.922, 1.922, 1.922}; const double sidebandLeftInnerDefault[npTBinsCorrelations] = {1.642, 1.642, 1.642, 1.642, 1.642, 1.642, 1.642, 1.642}; const double sidebandLeftOuterDefault[npTBinsCorrelations] = {1.754, 1.754, 1.754, 1.754, 1.754, 1.754, 1.754, 1.754}; const double sidebandRightInnerDefault[npTBinsCorrelations] = {1.978, 1.978, 1.978, 1.978, 1.978, 1.978, 1.978, 1.978}; const double sidebandRightOuterDefault[npTBinsCorrelations] = {2.090, 2.090, 2.090, 2.090, 2.090, 2.090, 2.090, 2.090}; -const auto signalRegionInner_v = std::vector{signalRegionInnerDefault, signalRegionInnerDefault + npTBinsCorrelations}; -const auto signalRegionOuter_v = std::vector{signalRegionOuterDefault, signalRegionOuterDefault + npTBinsCorrelations}; -const auto sidebandLeftInner_v = std::vector{sidebandLeftInnerDefault, sidebandLeftInnerDefault + npTBinsCorrelations}; -const auto sidebandLeftOuter_v = std::vector{sidebandLeftOuterDefault, sidebandLeftOuterDefault + npTBinsCorrelations}; -const auto sidebandRightInner_v = std::vector{sidebandRightInnerDefault, sidebandRightInnerDefault + npTBinsCorrelations}; -const auto sidebandRightOuter_v = std::vector{sidebandRightOuterDefault, sidebandRightOuterDefault + npTBinsCorrelations}; +const auto signalRegionInnerV = std::vector{signalRegionInnerDefault, signalRegionInnerDefault + npTBinsCorrelations}; +const auto signalRegionOuterV = std::vector{signalRegionOuterDefault, signalRegionOuterDefault + npTBinsCorrelations}; +const auto sidebandLeftInnerV = std::vector{sidebandLeftInnerDefault, sidebandLeftInnerDefault + npTBinsCorrelations}; +const auto sidebandLeftOuterV = std::vector{sidebandLeftOuterDefault, sidebandLeftOuterDefault + npTBinsCorrelations}; +const auto sidebandRightInnerV = std::vector{sidebandRightInnerDefault, sidebandRightInnerDefault + npTBinsCorrelations}; +const auto sidebandRightOuterV = std::vector{sidebandRightOuterDefault, sidebandRightOuterDefault + npTBinsCorrelations}; const int npTBinsEfficiency = o2::analysis::hf_cuts_d0_to_pi_k::NBinsPt; const double efficiencyDmesonDefault[npTBinsEfficiency] = {}; -const auto efficiencyDmeson_v = std::vector{efficiencyDmesonDefault, efficiencyDmesonDefault + npTBinsEfficiency}; +const auto efficiencyDmesonV = std::vector{efficiencyDmesonDefault, efficiencyDmesonDefault + npTBinsEfficiency}; struct HfTaskCorrelationDDbar { Configurable applyEfficiency{"applyEfficiency", 1, "Flag for applying efficiency weights"}; // pT ranges for correlation plots: the default values are those embedded in hf_cuts_d0_to_pi_k (i.e. the mass pT bins), but can be redefined via json files - Configurable> binsPtCorrelations{"binsPtCorrelations", std::vector{pTBinsCorrelations_v}, "pT bin limits for correlation plots"}; + Configurable> binsPtCorrelations{"binsPtCorrelations", std::vector{pTBinsCorrelationsV}, "pT bin limits for correlation plots"}; // pT bins for effiencies: same as above Configurable> binsPtEfficiency{"binsPtEfficiency", std::vector{o2::analysis::hf_cuts_d0_to_pi_k::vecBinsPt}, "pT bin limits for efficiency"}; // signal and sideband region edges, to be defined via json file (initialised to empty) - Configurable> signalRegionInner{"signalRegionInner", std::vector{signalRegionInner_v}, "Inner values of signal region vs pT"}; - Configurable> signalRegionOuter{"signalRegionOuter", std::vector{signalRegionOuter_v}, "Outer values of signal region vs pT"}; - Configurable> sidebandLeftInner{"sidebandLeftInner", std::vector{sidebandLeftInner_v}, "Inner values of left sideband vs pT"}; - Configurable> sidebandLeftOuter{"sidebandLeftOuter", std::vector{sidebandLeftOuter_v}, "Outer values of left sideband vs pT"}; - Configurable> sidebandRightInner{"sidebandRightInner", std::vector{sidebandRightInner_v}, "Inner values of right sideband vs pT"}; - Configurable> sidebandRightOuter{"sidebandRightOuter", std::vector{sidebandRightOuter_v}, "Outer values of right sideband vs pT"}; - Configurable> efficiencyD{"efficiencyD", std::vector{efficiencyDmeson_v}, "Efficiency values for D meson specie under study"}; + Configurable> signalRegionInner{"signalRegionInner", std::vector{signalRegionInnerV}, "Inner values of signal region vs pT"}; + Configurable> signalRegionOuter{"signalRegionOuter", std::vector{signalRegionOuterV}, "Outer values of signal region vs pT"}; + Configurable> sidebandLeftInner{"sidebandLeftInner", std::vector{sidebandLeftInnerV}, "Inner values of left sideband vs pT"}; + Configurable> sidebandLeftOuter{"sidebandLeftOuter", std::vector{sidebandLeftOuterV}, "Outer values of left sideband vs pT"}; + Configurable> sidebandRightInner{"sidebandRightInner", std::vector{sidebandRightInnerV}, "Inner values of right sideband vs pT"}; + Configurable> sidebandRightOuter{"sidebandRightOuter", std::vector{sidebandRightOuterV}, "Outer values of right sideband vs pT"}; + Configurable> efficiencyD{"efficiencyD", std::vector{efficiencyDmesonV}, "Efficiency values for D meson specie under study"}; HistogramRegistry registry{ "registry", diff --git a/PWGHF/HFC/Tasks/taskCorrelationHfeHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationHfeHadrons.cxx index 7a37a9181ac..f3eaef5e54f 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationHfeHadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationHfeHadrons.cxx @@ -88,14 +88,14 @@ struct HfTaskCorrelationHfeHadrons { PROCESS_SWITCH(HfTaskCorrelationHfeHadrons, process, "Process ", false); - void processMcGen(aod::HfEHadronMcPair const& McGenpairEntries) + void processMcGen(aod::HfEHadronMcPair const& mcGenpairEntries) { double deltaPhi = -999; double deltaEta = -999; double ptHadron = -999; double ptElectron = -999; - for (const auto& pairEntry : McGenpairEntries) { + for (const auto& pairEntry : mcGenpairEntries) { deltaPhi = pairEntry.deltaPhi(); deltaEta = pairEntry.deltaEta(); diff --git a/PWGHF/HFC/Tasks/taskFlow.cxx b/PWGHF/HFC/Tasks/taskFlow.cxx index 30864fd8de3..8c98645675e 100644 --- a/PWGHF/HFC/Tasks/taskFlow.cxx +++ b/PWGHF/HFC/Tasks/taskFlow.cxx @@ -354,17 +354,17 @@ struct HfTaskFlow { OutputObj sameEventHfMc{"sameEventHfMc"}; OutputObj mixedEventHfMc{"mixedEventHfMc"}; - template + template void addHistograms() { - registry.add(Form("%s%s%shEtaTrigger", WhatDataType[dataType].data(), WhatCorrelationCase[correlationCase].data(), WhatParticles[correlatedParticles].data()), "", {HistType::kTH1D, {axisEtaTrigger}}); - registry.add(Form("%s%s%shPhiTrigger", WhatDataType[dataType].data(), WhatCorrelationCase[correlationCase].data(), WhatParticles[correlatedParticles].data()), "", {HistType::kTH1D, {axisPhi}}); - registry.add(Form("%s%s%shPtTrigger", WhatDataType[dataType].data(), WhatCorrelationCase[correlationCase].data(), WhatParticles[correlatedParticles].data()), "", {HistType::kTH1D, {axisPt}}); - registry.add(Form("%s%s%shYieldsTrigger", WhatDataType[dataType].data(), WhatCorrelationCase[correlationCase].data(), WhatParticles[correlatedParticles].data()), "", {HistType::kTH3F, {axisMultiplicity, axisPt, axisEtaTrigger}}); - registry.add(Form("%s%s%shEtaPhiTrigger", WhatDataType[dataType].data(), WhatCorrelationCase[correlationCase].data(), WhatParticles[correlatedParticles].data()), "", {HistType::kTH3F, {axisMultiplicity, axisEtaTrigger, axisPhi}}); - registry.add(Form("%s%s%shEtaAssociated", WhatDataType[dataType].data(), WhatCorrelationCase[correlationCase].data(), WhatParticles[correlatedParticles].data()), "", {HistType::kTH1D, {axisEtaAssociated}}); - registry.add(Form("%s%s%shPhiAssociated", WhatDataType[dataType].data(), WhatCorrelationCase[correlationCase].data(), WhatParticles[correlatedParticles].data()), "", {HistType::kTH1D, {axisPhi}}); - registry.add(Form("%s%s%shEtaPhiAssociated", WhatDataType[dataType].data(), WhatCorrelationCase[correlationCase].data(), WhatParticles[correlatedParticles].data()), "", {HistType::kTH3F, {axisMultiplicity, axisEtaAssociated, axisPhi}}); + registry.add(Form("%s%s%shEtaTrigger", WhatDataType[DataType].data(), WhatCorrelationCase[CorrelationCase].data(), WhatParticles[CorrelatedParticles].data()), "", {HistType::kTH1D, {axisEtaTrigger}}); + registry.add(Form("%s%s%shPhiTrigger", WhatDataType[DataType].data(), WhatCorrelationCase[CorrelationCase].data(), WhatParticles[CorrelatedParticles].data()), "", {HistType::kTH1D, {axisPhi}}); + registry.add(Form("%s%s%shPtTrigger", WhatDataType[DataType].data(), WhatCorrelationCase[CorrelationCase].data(), WhatParticles[CorrelatedParticles].data()), "", {HistType::kTH1D, {axisPt}}); + registry.add(Form("%s%s%shYieldsTrigger", WhatDataType[DataType].data(), WhatCorrelationCase[CorrelationCase].data(), WhatParticles[CorrelatedParticles].data()), "", {HistType::kTH3F, {axisMultiplicity, axisPt, axisEtaTrigger}}); + registry.add(Form("%s%s%shEtaPhiTrigger", WhatDataType[DataType].data(), WhatCorrelationCase[CorrelationCase].data(), WhatParticles[CorrelatedParticles].data()), "", {HistType::kTH3F, {axisMultiplicity, axisEtaTrigger, axisPhi}}); + registry.add(Form("%s%s%shEtaAssociated", WhatDataType[DataType].data(), WhatCorrelationCase[CorrelationCase].data(), WhatParticles[CorrelatedParticles].data()), "", {HistType::kTH1D, {axisEtaAssociated}}); + registry.add(Form("%s%s%shPhiAssociated", WhatDataType[DataType].data(), WhatCorrelationCase[CorrelationCase].data(), WhatParticles[CorrelatedParticles].data()), "", {HistType::kTH1D, {axisPhi}}); + registry.add(Form("%s%s%shEtaPhiAssociated", WhatDataType[DataType].data(), WhatCorrelationCase[CorrelationCase].data(), WhatParticles[CorrelatedParticles].data()), "", {HistType::kTH3F, {axisMultiplicity, axisEtaAssociated, axisPhi}}); } // ========================= @@ -623,22 +623,22 @@ struct HfTaskFlow { // Quality assessment functions // ========================= - template + template void fillTriggerQa(float multiplicity, float const& eta, float const& phi, float const& pt) { - registry.fill(HIST(WhatDataType[dataType]) + HIST(WhatCorrelationCase[correlationCase]) + HIST(WhatParticles[correlatedParticles]) + HIST("hPtTrigger"), pt); - registry.fill(HIST(WhatDataType[dataType]) + HIST(WhatCorrelationCase[correlationCase]) + HIST(WhatParticles[correlatedParticles]) + HIST("hEtaTrigger"), eta); - registry.fill(HIST(WhatDataType[dataType]) + HIST(WhatCorrelationCase[correlationCase]) + HIST(WhatParticles[correlatedParticles]) + HIST("hPhiTrigger"), phi); - registry.fill(HIST(WhatDataType[dataType]) + HIST(WhatCorrelationCase[correlationCase]) + HIST(WhatParticles[correlatedParticles]) + HIST("hYieldsTrigger"), multiplicity, pt, eta); - registry.fill(HIST(WhatDataType[dataType]) + HIST(WhatCorrelationCase[correlationCase]) + HIST(WhatParticles[correlatedParticles]) + HIST("hEtaPhiTrigger"), multiplicity, eta, phi); + registry.fill(HIST(WhatDataType[DataType]) + HIST(WhatCorrelationCase[CorrelationCase]) + HIST(WhatParticles[CorrelatedParticles]) + HIST("hPtTrigger"), pt); + registry.fill(HIST(WhatDataType[DataType]) + HIST(WhatCorrelationCase[CorrelationCase]) + HIST(WhatParticles[CorrelatedParticles]) + HIST("hEtaTrigger"), eta); + registry.fill(HIST(WhatDataType[DataType]) + HIST(WhatCorrelationCase[CorrelationCase]) + HIST(WhatParticles[CorrelatedParticles]) + HIST("hPhiTrigger"), phi); + registry.fill(HIST(WhatDataType[DataType]) + HIST(WhatCorrelationCase[CorrelationCase]) + HIST(WhatParticles[CorrelatedParticles]) + HIST("hYieldsTrigger"), multiplicity, pt, eta); + registry.fill(HIST(WhatDataType[DataType]) + HIST(WhatCorrelationCase[CorrelationCase]) + HIST(WhatParticles[CorrelatedParticles]) + HIST("hEtaPhiTrigger"), multiplicity, eta, phi); } - template + template void fillAssociatedQa(float multiplicity, float const& eta, float const& phi) { - registry.fill(HIST(WhatDataType[dataType]) + HIST(WhatCorrelationCase[correlationCase]) + HIST(WhatParticles[correlatedParticles]) + HIST("hEtaAssociated"), eta); - registry.fill(HIST(WhatDataType[dataType]) + HIST(WhatCorrelationCase[correlationCase]) + HIST(WhatParticles[correlatedParticles]) + HIST("hPhiAssociated"), phi); - registry.fill(HIST(WhatDataType[dataType]) + HIST(WhatCorrelationCase[correlationCase]) + HIST(WhatParticles[correlatedParticles]) + HIST("hEtaPhiAssociated"), multiplicity, eta, phi); + registry.fill(HIST(WhatDataType[DataType]) + HIST(WhatCorrelationCase[CorrelationCase]) + HIST(WhatParticles[CorrelatedParticles]) + HIST("hEtaAssociated"), eta); + registry.fill(HIST(WhatDataType[DataType]) + HIST(WhatCorrelationCase[CorrelationCase]) + HIST(WhatParticles[CorrelatedParticles]) + HIST("hPhiAssociated"), phi); + registry.fill(HIST(WhatDataType[DataType]) + HIST(WhatCorrelationCase[CorrelationCase]) + HIST(WhatParticles[CorrelatedParticles]) + HIST("hEtaPhiAssociated"), multiplicity, eta, phi); } // ========================= diff --git a/PWGHF/HFC/Utils/utilsCorrelations.h b/PWGHF/HFC/Utils/utilsCorrelations.h index 332867cc135..7e3a84687f2 100644 --- a/PWGHF/HFC/Utils/utilsCorrelations.h +++ b/PWGHF/HFC/Utils/utilsCorrelations.h @@ -140,14 +140,14 @@ bool passPIDSelection(Atrack const& track, SpeciesContainer const mPIDspecies, /// @param[out] massCand Mass of the matched candidate is set here, if a valid match is found /// /// @return `true` if candidate matches expected PDG and decay flag, and mass is set; `false` otherwise -template +template bool matchCandAndMass(McParticleType const& particle, double& massCand) { const auto pdgCand = std::abs(particle.pdgCode()); const auto matchGenFlag = std::abs(particle.flagMcMatchGen()); // Validate PDG code based on candidate type - if (isScCandidate) { + if (IsScCandidate) { if (!(pdgCand == o2::constants::physics::Pdg::kSigmaC0 || pdgCand == o2::constants::physics::Pdg::kSigmaCPlusPlus || pdgCand == o2::constants::physics::Pdg::kSigmaCStar0 || diff --git a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx index db8502466c5..76b66668fe7 100644 --- a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx +++ b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx @@ -373,7 +373,7 @@ struct HfElectronSelectionWithTpcEmcal { hfElectronSelection(electron.collisionId(), electron.globalIndex(), electron.eta(), electron.phi(), electron.pt(), electron.tpcNSigmaEl(), electron.tofNSigmaEl(), nElPairsLS, nElPairsUS, isEMcal); } // Electron Identification - template + template void fillElectronTrack(CollisionType const& collision, TracksType const& tracks, EmcClusterType const& emcClusters, MatchType const& matchedTracks, ParticleType const& /*particlemc*/) { if (!(isRun3 ? collision.sel8() : (collision.sel7() && collision.alias_bit(kINT7)))) { diff --git a/PWGHF/HFL/Tasks/taskMuonCharmBeautySeparation.cxx b/PWGHF/HFL/Tasks/taskMuonCharmBeautySeparation.cxx index 33f04cef72b..355465f8c9f 100644 --- a/PWGHF/HFL/Tasks/taskMuonCharmBeautySeparation.cxx +++ b/PWGHF/HFL/Tasks/taskMuonCharmBeautySeparation.cxx @@ -47,8 +47,8 @@ struct HfTaskMuonCharmBeautySeparation { AxisSpec chi2MCHMFTAxis = {170, -1.5, 150.5, "#chi^{2} MCH-MFT"}; AxisSpec chi2MCHMIDAxis = {170, -1.5, 150.5, "#chi^{2} MCH-MID"}; - HistogramConfigSpec HistVariable({HistType::kTHnSparseF, {ptRecoAxis, dcaxAxis, dcaxAxis, dcaAxis, zvtxAxis}}); - registry.add("hBasicDist", "", HistVariable); + HistogramConfigSpec histVariable({HistType::kTHnSparseF, {ptRecoAxis, dcaxAxis, dcaxAxis, dcaAxis, zvtxAxis}}); + registry.add("hBasicDist", "", histVariable); registry.add("hTrackType", "hTrackType", {HistType::kTH1F, {trackTypeAxis}}); registry.add("hZvtx", "Zvtx in cm", {HistType::kTH1F, {zvtxAxis}}); registry.add("hZvtx_WithMuons", "Zvtx with muons", {HistType::kTH1F, {zvtxAxis}}); diff --git a/PWGHF/HFL/Tasks/taskSingleMuonReader.cxx b/PWGHF/HFL/Tasks/taskSingleMuonReader.cxx index 52cb12b6f41..4ffad84b25f 100644 --- a/PWGHF/HFL/Tasks/taskSingleMuonReader.cxx +++ b/PWGHF/HFL/Tasks/taskSingleMuonReader.cxx @@ -119,10 +119,10 @@ struct HfTaskSingleMuonReader { // histograms after acceptance cuts if (muon.has_matchMCHTrack()) { auto muonType3 = muon.template matchMCHTrack_as(); - auto Dpt = muonType3.pt() - pt; + auto dpt = muonType3.pt() - pt; - singleMuon(pt, dcaXY, Dpt, chi2); - registry.fill(HIST("hMuAfterCuts"), pt, eta, dcaXY, rAbs, charge, chi2, Dpt); + singleMuon(pt, dcaXY, dpt, chi2); + registry.fill(HIST("hMuAfterCuts"), pt, eta, dcaXY, rAbs, charge, chi2, dpt); } } } @@ -156,15 +156,15 @@ struct HfTaskSingleMuonReader { // histograms after acceptance cuts if (muon.has_matchMCHTrack()) { auto muonType3 = muon.template matchMCHTrack_as(); - auto Dpt = muonType3.pt() - pt; + auto dpt = muonType3.pt() - pt; - singleMuon(pt, dcaXY, Dpt, chi2); - registry.fill(HIST("hMuAfterCuts"), pt, eta, dcaXY, rAbs, charge, chi2, Dpt); + singleMuon(pt, dcaXY, dpt, chi2); + registry.fill(HIST("hMuAfterCuts"), pt, eta, dcaXY, rAbs, charge, chi2, dpt); if (muon.mcMask() == 0) { - registry.fill(HIST("hMuAfterCutsTrue"), pt, eta, dcaXY, rAbs, charge, chi2, Dpt); + registry.fill(HIST("hMuAfterCutsTrue"), pt, eta, dcaXY, rAbs, charge, chi2, dpt); } if (muon.mcMask() == 128) { - registry.fill(HIST("hMuAfterCutsFake"), pt, eta, dcaXY, rAbs, charge, chi2, Dpt); + registry.fill(HIST("hMuAfterCutsFake"), pt, eta, dcaXY, rAbs, charge, chi2, dpt); } } } diff --git a/PWGHF/HFL/Tasks/taskSingleMuonReaderAssoc.cxx b/PWGHF/HFL/Tasks/taskSingleMuonReaderAssoc.cxx index 2b43e9ab14f..5ba3915dc9d 100644 --- a/PWGHF/HFL/Tasks/taskSingleMuonReaderAssoc.cxx +++ b/PWGHF/HFL/Tasks/taskSingleMuonReaderAssoc.cxx @@ -114,10 +114,10 @@ struct HfTaskSingleMuonReaderAssoc { // histograms after acceptance cuts if (muon.has_matchMCHTrack()) { auto muonType3 = muon.template matchMCHTrack_as(); - auto Dpt = muonType3.pt() - pt; + auto dpt = muonType3.pt() - pt; - singleMuon(pt, dcaXY, Dpt, chi2); - registry.fill(HIST("hMuAfterCuts"), pt, eta, dcaXY, rAbs, charge, chi2, Dpt); + singleMuon(pt, dcaXY, dpt, chi2); + registry.fill(HIST("hMuAfterCuts"), pt, eta, dcaXY, rAbs, charge, chi2, dpt); } } } @@ -154,15 +154,15 @@ struct HfTaskSingleMuonReaderAssoc { // histograms after acceptance cuts if (muon.has_matchMCHTrack()) { auto muonType3 = muon.template matchMCHTrack_as(); - auto Dpt = muonType3.pt() - pt; + auto dpt = muonType3.pt() - pt; - singleMuon(pt, dcaXY, Dpt, chi2); - registry.fill(HIST("hMuAfterCuts"), pt, eta, dcaXY, rAbs, charge, chi2, Dpt); + singleMuon(pt, dcaXY, dpt, chi2); + registry.fill(HIST("hMuAfterCuts"), pt, eta, dcaXY, rAbs, charge, chi2, dpt); if (muon.mcMask() == 0) { - registry.fill(HIST("hMuAfterCutsTrue"), pt, eta, dcaXY, rAbs, charge, chi2, Dpt); + registry.fill(HIST("hMuAfterCutsTrue"), pt, eta, dcaXY, rAbs, charge, chi2, dpt); } if (muon.mcMask() == 128) { - registry.fill(HIST("hMuAfterCutsFake"), pt, eta, dcaXY, rAbs, charge, chi2, Dpt); + registry.fill(HIST("hMuAfterCutsFake"), pt, eta, dcaXY, rAbs, charge, chi2, dpt); } } } diff --git a/PWGHF/TableProducer/candidateCreator2Prong.cxx b/PWGHF/TableProducer/candidateCreator2Prong.cxx index 7374a5a6b5c..9964cd60d85 100644 --- a/PWGHF/TableProducer/candidateCreator2Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator2Prong.cxx @@ -222,7 +222,7 @@ struct HfCandidateCreator2Prong { setLabelHistoCands(hCandidates); } - template + template void runCreator2ProngWithDCAFitterN(Coll const&, CandType const& rowsTrackIndexProng2, TTracks const&, @@ -235,10 +235,10 @@ struct HfCandidateCreator2Prong { auto collision = rowTrackIndexProng2.template collision_as(); float centrality{-1.f}; o2::hf_evsel::HfCollisionRejectionMask rejectionMask{}; - if constexpr (applyUpcSel) { - rejectionMask = hfEvSel.getHfCollisionRejectionMaskWithUpc(collision, centrality, ccdb, registry, bcs); + if constexpr (ApplyUpcSel) { + rejectionMask = hfEvSel.getHfCollisionRejectionMaskWithUpc(collision, centrality, ccdb, registry, bcs); } else { - rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); + rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); } if (rejectionMask != 0) { /// at least one event selection not satisfied --> reject the candidate @@ -297,7 +297,7 @@ struct HfCandidateCreator2Prong { // This modifies track momenta! auto primaryVertex = getPrimaryVertex(collision); auto covMatrixPV = primaryVertex.getCov(); - if constexpr (doPvRefit) { + if constexpr (DoPvRefit) { /// use PV refit /// Using it in the rowCandidateBase all dynamic columns shall take it into account // coordinates @@ -379,7 +379,7 @@ struct HfCandidateCreator2Prong { } } - template + template void runCreator2ProngWithKFParticle(Coll const&, CandType const& rowsTrackIndexProng2, TTracks const&, @@ -392,10 +392,10 @@ struct HfCandidateCreator2Prong { auto collision = rowTrackIndexProng2.template collision_as(); float centrality{-1.f}; o2::hf_evsel::HfCollisionRejectionMask rejectionMask{}; - if constexpr (applyUpcSel) { - rejectionMask = hfEvSel.getHfCollisionRejectionMaskWithUpc(collision, centrality, ccdb, registry, bcs); + if constexpr (ApplyUpcSel) { + rejectionMask = hfEvSel.getHfCollisionRejectionMaskWithUpc(collision, centrality, ccdb, registry, bcs); } else { - rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); + rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); } if (rejectionMask != 0) { /// at least one event selection not satisfied --> reject the candidate @@ -422,7 +422,7 @@ struct HfCandidateCreator2Prong { KFParticle::SetField(bz); KFPVertex kfpVertex = createKFPVertexFromCollision(collision); - if constexpr (doPvRefit) { + if constexpr (DoPvRefit) { /// use PV refit /// Using it in the rowCandidateBase all dynamic columns shall take it into account // coordinates @@ -866,7 +866,7 @@ struct HfCandidateCreator2ProngExpressions { } /// Performs MC matching. - template + template void runCreator2ProngMc(aod::TracksWMc const& tracks, aod::McParticles const& mcParticles, CCs const& collInfos, @@ -1030,18 +1030,18 @@ struct HfCandidateCreator2ProngExpressions { float centrality{-1.f}; o2::hf_evsel::HfCollisionRejectionMask rejectionMask{}; int nSplitColl = 0; - if constexpr (centEstimator == CentralityEstimator::FT0C) { + if constexpr (CentEstimator == CentralityEstimator::FT0C) { const auto collSlice = collInfos.sliceBy(colPerMcCollisionFT0C, mcCollision.globalIndex()); - rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, collSlice, centrality); - } else if constexpr (centEstimator == CentralityEstimator::FT0M) { + rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, collSlice, centrality); + } else if constexpr (CentEstimator == CentralityEstimator::FT0M) { const auto collSlice = collInfos.sliceBy(colPerMcCollisionFT0M, mcCollision.globalIndex()); nSplitColl = collSlice.size(); - rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, collSlice, centrality); - } else if constexpr (centEstimator == CentralityEstimator::None) { + rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, collSlice, centrality); + } else if constexpr (CentEstimator == CentralityEstimator::None) { const auto collSlice = collInfos.sliceBy(colPerMcCollision, mcCollision.globalIndex()); - rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, collSlice, centrality); + rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, collSlice, centrality); } - hfEvSelMc.fillHistograms(mcCollision, rejectionMask, nSplitColl); + hfEvSelMc.fillHistograms(mcCollision, rejectionMask, nSplitColl); if (rejectionMask != 0) { // at least one event selection not satisfied --> reject all particles from this collision for (unsigned int i = 0; i < mcParticlesPerMcColl.size(); ++i) { @@ -1057,9 +1057,9 @@ struct HfCandidateCreator2ProngExpressions { aod::McParticles const& mcParticles, McCollisionsNoCents const& collInfos, aod::McCollisions const& mcCollisions, - BCsInfo const& BCsInfo) + BCsInfo const& bcsInfo) { - runCreator2ProngMc(tracks, mcParticles, collInfos, mcCollisions, BCsInfo); + runCreator2ProngMc(tracks, mcParticles, collInfos, mcCollisions, bcsInfo); } PROCESS_SWITCH(HfCandidateCreator2ProngExpressions, processMc, "Process MC - no centrality", false); @@ -1067,9 +1067,9 @@ struct HfCandidateCreator2ProngExpressions { aod::McParticles const& mcParticles, McCollisionsFT0Cs const& collInfos, aod::McCollisions const& mcCollisions, - BCsInfo const& BCsInfo) + BCsInfo const& bcsInfo) { - runCreator2ProngMc(tracks, mcParticles, collInfos, mcCollisions, BCsInfo); + runCreator2ProngMc(tracks, mcParticles, collInfos, mcCollisions, bcsInfo); } PROCESS_SWITCH(HfCandidateCreator2ProngExpressions, processMcCentFT0C, "Process MC - FT0c centrality", false); @@ -1077,9 +1077,9 @@ struct HfCandidateCreator2ProngExpressions { aod::McParticles const& mcParticles, McCollisionsFT0Ms const& collInfos, McCollisionsCentFT0Ms const& mcCollisions, - BCsInfo const& BCsInfo) + BCsInfo const& bcsInfo) { - runCreator2ProngMc(tracks, mcParticles, collInfos, mcCollisions, BCsInfo); + runCreator2ProngMc(tracks, mcParticles, collInfos, mcCollisions, bcsInfo); } PROCESS_SWITCH(HfCandidateCreator2ProngExpressions, processMcCentFT0M, "Process MC - FT0m centrality", false); }; diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index 8cb93d5c6ec..a75b38f7fc4 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -264,7 +264,7 @@ struct HfCandidateCreator3Prong { } } - template + template void runCreator3ProngWithDCAFitterN(Coll const&, Cand const& rowsTrackIndexProng3, TracksWCovExtraPidPiKaPr const&, @@ -277,10 +277,10 @@ struct HfCandidateCreator3Prong { auto collision = rowTrackIndexProng3.template collision_as(); float centrality{-1.f}; o2::hf_evsel::HfCollisionRejectionMask rejectionMask{}; - if constexpr (applyUpcSel) { - rejectionMask = hfEvSel.getHfCollisionRejectionMaskWithUpc(collision, centrality, ccdb, registry, bcs); + if constexpr (ApplyUpcSel) { + rejectionMask = hfEvSel.getHfCollisionRejectionMaskWithUpc(collision, centrality, ccdb, registry, bcs); } else { - rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); + rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); } if (rejectionMask != 0) { /// at least one event selection not satisfied --> reject the candidate @@ -344,7 +344,7 @@ struct HfCandidateCreator3Prong { // This modifies track momenta! auto primaryVertex = getPrimaryVertex(collision); auto covMatrixPV = primaryVertex.getCov(); - if constexpr (doPvRefit) { + if constexpr (DoPvRefit) { /// use PV refit /// Using it in the rowCandidateBase all dynamic columns shall take it into account // coordinates @@ -437,7 +437,7 @@ struct HfCandidateCreator3Prong { } } - template + template void runCreator3ProngWithKFParticle(Coll const&, Cand const& rowsTrackIndexProng3, TracksWCovExtraPidPiKaPr const&, @@ -448,10 +448,10 @@ struct HfCandidateCreator3Prong { auto collision = rowTrackIndexProng3.template collision_as(); float centrality{-1.f}; o2::hf_evsel::HfCollisionRejectionMask rejectionMask{}; - if constexpr (applyUpcSel) { - rejectionMask = hfEvSel.getHfCollisionRejectionMaskWithUpc(collision, centrality, ccdb, registry, bcs); + if constexpr (ApplyUpcSel) { + rejectionMask = hfEvSel.getHfCollisionRejectionMaskWithUpc(collision, centrality, ccdb, registry, bcs); } else { - rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); + rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); } if (rejectionMask != 0) { /// at least one event selection not satisfied --> reject the candidate @@ -479,7 +479,7 @@ struct HfCandidateCreator3Prong { KFParticle::SetField(bz); KFPVertex kfpVertex = createKFPVertexFromCollision(collision); - if constexpr (doPvRefit) { + if constexpr (DoPvRefit) { /// use PV refit /// Using it in the rowCandidateBase all dynamic columns shall take it into account // coordinates @@ -1013,7 +1013,7 @@ struct HfCandidateCreator3ProngExpressions { } /// Performs MC matching. - template + template void runCreator3ProngMc(aod::TracksWMc const& tracks, aod::McParticles const& mcParticles, CCs const& collInfos, @@ -1318,18 +1318,18 @@ struct HfCandidateCreator3ProngExpressions { float centrality{-1.f}; o2::hf_evsel::HfCollisionRejectionMask rejectionMask{}; int nSplitColl = 0; - if constexpr (centEstimator == CentralityEstimator::FT0C) { + if constexpr (CentEstimator == CentralityEstimator::FT0C) { const auto collSlice = collInfos.sliceBy(colPerMcCollisionFT0C, mcCollision.globalIndex()); - rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, collSlice, centrality); - } else if constexpr (centEstimator == CentralityEstimator::FT0M) { + rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, collSlice, centrality); + } else if constexpr (CentEstimator == CentralityEstimator::FT0M) { const auto collSlice = collInfos.sliceBy(colPerMcCollisionFT0M, mcCollision.globalIndex()); nSplitColl = collSlice.size(); - rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, collSlice, centrality); - } else if constexpr (centEstimator == CentralityEstimator::None) { + rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, collSlice, centrality); + } else if constexpr (CentEstimator == CentralityEstimator::None) { const auto collSlice = collInfos.sliceBy(colPerMcCollision, mcCollision.globalIndex()); - rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, collSlice, centrality); + rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, collSlice, centrality); } - hfEvSelMc.fillHistograms(mcCollision, rejectionMask, nSplitColl); + hfEvSelMc.fillHistograms(mcCollision, rejectionMask, nSplitColl); if (rejectionMask != 0) { // at least one event selection not satisfied --> reject all gen particles from this collision for (unsigned int i = 0; i < mcParticlesPerMcColl.size(); ++i) { @@ -1345,9 +1345,9 @@ struct HfCandidateCreator3ProngExpressions { aod::McParticles const& mcParticles, McCollisionsNoCents const& collInfos, aod::McCollisions const& mcCollisions, - BCsInfo const& BCsInfo) + BCsInfo const& bcsInfo) { - runCreator3ProngMc(tracks, mcParticles, collInfos, mcCollisions, BCsInfo); + runCreator3ProngMc(tracks, mcParticles, collInfos, mcCollisions, bcsInfo); } PROCESS_SWITCH(HfCandidateCreator3ProngExpressions, processMc, "Process MC - no centrality", false); @@ -1355,9 +1355,9 @@ struct HfCandidateCreator3ProngExpressions { aod::McParticles const& mcParticles, McCollisionsFT0Cs const& collInfos, aod::McCollisions const& mcCollisions, - BCsInfo const& BCsInfo) + BCsInfo const& bcsInfo) { - runCreator3ProngMc(tracks, mcParticles, collInfos, mcCollisions, BCsInfo); + runCreator3ProngMc(tracks, mcParticles, collInfos, mcCollisions, bcsInfo); } PROCESS_SWITCH(HfCandidateCreator3ProngExpressions, processMcCentFT0C, "Process MC - FT0c centrality", false); @@ -1365,9 +1365,9 @@ struct HfCandidateCreator3ProngExpressions { aod::McParticles const& mcParticles, McCollisionsFT0Ms const& collInfos, McCollisionsCentFT0Ms const& mcCollisions, - BCsInfo const& BCsInfo) + BCsInfo const& bcsInfo) { - runCreator3ProngMc(tracks, mcParticles, collInfos, mcCollisions, BCsInfo); + runCreator3ProngMc(tracks, mcParticles, collInfos, mcCollisions, bcsInfo); } PROCESS_SWITCH(HfCandidateCreator3ProngExpressions, processMcCentFT0M, "Process MC - FT0m centrality", false); }; diff --git a/PWGHF/TableProducer/candidateCreatorCascade.cxx b/PWGHF/TableProducer/candidateCreatorCascade.cxx index c0f50d07751..0a24495b54d 100644 --- a/PWGHF/TableProducer/candidateCreatorCascade.cxx +++ b/PWGHF/TableProducer/candidateCreatorCascade.cxx @@ -163,7 +163,7 @@ struct HfCandidateCreatorCascade { setLabelHistoCands(hCandidates); } - template + template void runCreatorCascade(Coll const&, aod::HfCascades const& rowsTrackIndexCasc, aod::V0sLinked const&, @@ -178,7 +178,7 @@ struct HfCandidateCreatorCascade { auto collision = casc.template collision_as(); /// reject candidates in collisions not satisfying the event selections float centrality{-1.f}; - const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); + const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); if (rejectionMask != 0) { /// at least one event selection not satisfied --> reject the candidate continue; @@ -463,7 +463,7 @@ struct HfCandidateCreatorCascadeMc { } } - template + template void runCreatorCascMc(MyTracksWMc const& tracks, aod::McParticles const& mcParticles, CCs const& collInfos, @@ -531,18 +531,18 @@ struct HfCandidateCreatorCascadeMc { float centrality{-1.f}; o2::hf_evsel::HfCollisionRejectionMask rejectionMask{}; int nSplitColl = 0; - if constexpr (centEstimator == CentralityEstimator::FT0C) { + if constexpr (CentEstimator == CentralityEstimator::FT0C) { const auto collSlice = collInfos.sliceBy(colPerMcCollisionFT0C, mcCollision.globalIndex()); - rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, collSlice, centrality); - } else if constexpr (centEstimator == CentralityEstimator::FT0M) { + rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, collSlice, centrality); + } else if constexpr (CentEstimator == CentralityEstimator::FT0M) { const auto collSlice = collInfos.sliceBy(colPerMcCollisionFT0M, mcCollision.globalIndex()); nSplitColl = collSlice.size(); - rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, collSlice, centrality); - } else if constexpr (centEstimator == CentralityEstimator::None) { + rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, collSlice, centrality); + } else if constexpr (CentEstimator == CentralityEstimator::None) { const auto collSlice = collInfos.sliceBy(colPerMcCollision, mcCollision.globalIndex()); - rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, collSlice, centrality); + rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, collSlice, centrality); } - hfEvSelMc.fillHistograms(mcCollision, rejectionMask, nSplitColl); + hfEvSelMc.fillHistograms(mcCollision, rejectionMask, nSplitColl); if (rejectionMask != 0) { // at least one event selection not satisfied --> reject all particles from this collision for (unsigned int i = 0; i < mcParticlesPerMcColl.size(); ++i) { @@ -603,9 +603,9 @@ struct HfCandidateCreatorCascadeMc { aod::McParticles const& mcParticles, McCollisionsNoCents const& collInfos, aod::McCollisions const& mcCollisions, - BCsInfo const& BCsInfo) + BCsInfo const& bcsInfo) { - runCreatorCascMc(tracks, mcParticles, collInfos, mcCollisions, BCsInfo); + runCreatorCascMc(tracks, mcParticles, collInfos, mcCollisions, bcsInfo); } PROCESS_SWITCH(HfCandidateCreatorCascadeMc, processMc, "Process MC - no centrality", false); @@ -613,9 +613,9 @@ struct HfCandidateCreatorCascadeMc { aod::McParticles const& mcParticles, McCollisionsFT0Cs const& collInfos, aod::McCollisions const& mcCollisions, - BCsInfo const& BCsInfo) + BCsInfo const& bcsInfo) { - runCreatorCascMc(tracks, mcParticles, collInfos, mcCollisions, BCsInfo); + runCreatorCascMc(tracks, mcParticles, collInfos, mcCollisions, bcsInfo); } PROCESS_SWITCH(HfCandidateCreatorCascadeMc, processMcCentFT0C, "Process MC - FT0c centrality", false); @@ -623,9 +623,9 @@ struct HfCandidateCreatorCascadeMc { aod::McParticles const& mcParticles, McCollisionsFT0Ms const& collInfos, McCollisionsCentFT0Ms const& mcCollisions, - BCsInfo const& BCsInfo) + BCsInfo const& bcsInfo) { - runCreatorCascMc(tracks, mcParticles, collInfos, mcCollisions, BCsInfo); + runCreatorCascMc(tracks, mcParticles, collInfos, mcCollisions, bcsInfo); } PROCESS_SWITCH(HfCandidateCreatorCascadeMc, processMcCentFT0M, "Process MC - FT0m centrality", false); }; diff --git a/PWGHF/TableProducer/candidateCreatorDstar.cxx b/PWGHF/TableProducer/candidateCreatorDstar.cxx index 85d3bc5f6f4..e0837ed94c8 100644 --- a/PWGHF/TableProducer/candidateCreatorDstar.cxx +++ b/PWGHF/TableProducer/candidateCreatorDstar.cxx @@ -204,7 +204,7 @@ struct HfCandidateCreatorDstar { /// @param rowsTrackIndexD0 D0 table object from trackIndexSkimCreator.cxx /// @param tracks track table with Cov object /// @param bcWithTimeStamps Bunch Crossing with timestamps - template + template void runCreatorDstar(Coll const&, CandsDstar const& rowsTrackIndexDstar, aod::Hf2Prongs const&, @@ -219,7 +219,7 @@ struct HfCandidateCreatorDstar { /// reject candidates in collisions not satisfying the event selections auto collision = rowTrackIndexDstar.template collision_as(); float centrality{-1.f}; - const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); + const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); if (rejectionMask != 0) { /// at least one event selection not satisfied --> reject the candidate continue; @@ -293,7 +293,7 @@ struct HfCandidateCreatorDstar { trackD0ProngParVar1.getPxPyPzGlo(pVecD0Prong1); // This modifies track momenta! - if constexpr (doPvRefit) { + if constexpr (DoPvRefit) { /// use PV refit /// Using it in the *HfCand3ProngBase/HfCand2ProngBase* all dynamic columns shall take it into account // coordinates @@ -584,7 +584,7 @@ struct HfCandidateCreatorDstarExpressions { } /// Perform MC Matching. - template + template void runCreatorDstarMc(aod::TracksWMc const& tracks, aod::McParticles const& mcParticles, CCs const& collInfos, @@ -734,18 +734,18 @@ struct HfCandidateCreatorDstarExpressions { float centrality{-1.f}; o2::hf_evsel::HfCollisionRejectionMask rejectionMask{}; int nSplitColl = 0; - if constexpr (centEstimator == CentralityEstimator::FT0C) { + if constexpr (CentEstimator == CentralityEstimator::FT0C) { const auto collSlice = collInfos.sliceBy(colPerMcCollisionFT0C, mcCollision.globalIndex()); - rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, collSlice, centrality); - } else if constexpr (centEstimator == CentralityEstimator::FT0M) { + rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, collSlice, centrality); + } else if constexpr (CentEstimator == CentralityEstimator::FT0M) { const auto collSlice = collInfos.sliceBy(colPerMcCollisionFT0M, mcCollision.globalIndex()); nSplitColl = collSlice.size(); - rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, collSlice, centrality); - } else if constexpr (centEstimator == CentralityEstimator::None) { + rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, collSlice, centrality); + } else if constexpr (CentEstimator == CentralityEstimator::None) { const auto collSlice = collInfos.sliceBy(colPerMcCollision, mcCollision.globalIndex()); - rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, collSlice, centrality); + rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, collSlice, centrality); } - hfEvSelMc.fillHistograms(mcCollision, rejectionMask, nSplitColl); + hfEvSelMc.fillHistograms(mcCollision, rejectionMask, nSplitColl); if (rejectionMask != 0) { // at least one event selection not satisfied --> reject all particles from this collision for (unsigned int i = 0; i < mcParticlesPerMcColl.size(); ++i) { @@ -808,9 +808,9 @@ struct HfCandidateCreatorDstarExpressions { aod::McParticles const& mcParticles, McCollisionsNoCents const& collInfos, aod::McCollisions const& mcCollisions, - BCsInfo const& BCsInfo) + BCsInfo const& bcsInfo) { - runCreatorDstarMc(tracks, mcParticles, collInfos, mcCollisions, BCsInfo); + runCreatorDstarMc(tracks, mcParticles, collInfos, mcCollisions, bcsInfo); } PROCESS_SWITCH(HfCandidateCreatorDstarExpressions, processMc, "Process MC - no centrality", false); @@ -818,9 +818,9 @@ struct HfCandidateCreatorDstarExpressions { aod::McParticles const& mcParticles, McCollisionsFT0Cs const& collInfos, aod::McCollisions const& mcCollisions, - BCsInfo const& BCsInfo) + BCsInfo const& bcsInfo) { - runCreatorDstarMc(tracks, mcParticles, collInfos, mcCollisions, BCsInfo); + runCreatorDstarMc(tracks, mcParticles, collInfos, mcCollisions, bcsInfo); } PROCESS_SWITCH(HfCandidateCreatorDstarExpressions, processMcCentFT0C, "Process MC - FT0c centrality", false); @@ -828,9 +828,9 @@ struct HfCandidateCreatorDstarExpressions { aod::McParticles const& mcParticles, McCollisionsFT0Ms const& collInfos, McCollisionsCentFT0Ms const& mcCollisions, - BCsInfo const& BCsInfo) + BCsInfo const& bcsInfo) { - runCreatorDstarMc(tracks, mcParticles, collInfos, mcCollisions, BCsInfo); + runCreatorDstarMc(tracks, mcParticles, collInfos, mcCollisions, bcsInfo); } PROCESS_SWITCH(HfCandidateCreatorDstarExpressions, processMcCentFT0M, "Process MC - FT0m centrality", false); }; diff --git a/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx b/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx index d769df6054c..bdaeade98a7 100644 --- a/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx +++ b/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx @@ -380,7 +380,7 @@ struct HfCandidateCreatorXic0Omegac0 { runNumber = 0; } - template + template void runXic0Omegac0Creator(Coll const&, aod::BCsWithTimestamps const& /*bcWithTimeStamps*/, MyLFTracksWCov const& lfTracks, @@ -393,7 +393,7 @@ struct HfCandidateCreatorXic0Omegac0 { Hist& hCascadesCounter) { - if constexpr (decayChannel != hf_cand_casc_lf::DecayType2Prong::XiczeroOmegaczeroToXiPi && decayChannel != hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaPi && decayChannel != hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaK) { + if constexpr (DecayChannel != hf_cand_casc_lf::DecayType2Prong::XiczeroOmegaczeroToXiPi && DecayChannel != hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaPi && DecayChannel != hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaK) { LOGP(fatal, "Decay channel not recognized!"); } @@ -401,15 +401,15 @@ struct HfCandidateCreatorXic0Omegac0 { hCandidateCounter->Fill(0); - if constexpr (decayChannel == hf_cand_casc_lf::DecayType2Prong::XiczeroOmegaczeroToXiPi) { + if constexpr (DecayChannel == hf_cand_casc_lf::DecayType2Prong::XiczeroOmegaczeroToXiPi) { if (!TESTBIT(cand.hfflag(), aod::hf_cand_casc_lf::DecayType2Prong::XiczeroOmegaczeroToXiPi)) { continue; } - } else if constexpr (decayChannel == hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaPi) { + } else if constexpr (DecayChannel == hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaPi) { if (!TESTBIT(cand.hfflag(), aod::hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaPi)) { continue; } - } else if constexpr (decayChannel == hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaK) { + } else if constexpr (DecayChannel == hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaK) { if (!TESTBIT(cand.hfflag(), aod::hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaK)) { continue; } @@ -419,7 +419,7 @@ struct HfCandidateCreatorXic0Omegac0 { auto collision = cand.collision_as(); float centrality{-1.f}; - const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); + const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); if (rejectionMask != 0) { /// at least one event selection not satisfied --> reject the candidate continue; @@ -510,7 +510,7 @@ struct HfCandidateCreatorXic0Omegac0 { continue; } trackCasc.setAbsCharge(1); - if constexpr (decayChannel == hf_cand_casc_lf::DecayType2Prong::XiczeroOmegaczeroToXiPi) { + if constexpr (DecayChannel == hf_cand_casc_lf::DecayType2Prong::XiczeroOmegaczeroToXiPi) { trackCasc.setPID(o2::track::PID::XiMinus); } else { trackCasc.setPID(o2::track::PID::OmegaMinus); @@ -585,15 +585,15 @@ struct HfCandidateCreatorXic0Omegac0 { // invariant mass under the hypothesis of particles ID corresponding to the decay chain float mLambda = casc.mLambda(); // from LF table, V0 mass under lambda hypothesis float mCasc = 0.; - if constexpr (decayChannel == hf_cand_casc_lf::DecayType2Prong::XiczeroOmegaczeroToXiPi) { + if constexpr (DecayChannel == hf_cand_casc_lf::DecayType2Prong::XiczeroOmegaczeroToXiPi) { mCasc = casc.mXi(); } else { mCasc = casc.mOmega(); } auto arrMassCharmBaryon = std::array{0., 0.}; - if constexpr (decayChannel == hf_cand_casc_lf::DecayType2Prong::XiczeroOmegaczeroToXiPi) { + if constexpr (DecayChannel == hf_cand_casc_lf::DecayType2Prong::XiczeroOmegaczeroToXiPi) { arrMassCharmBaryon = {MassXiMinus, MassPiPlus}; - } else if constexpr (decayChannel == hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaPi) { + } else if constexpr (DecayChannel == hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaPi) { arrMassCharmBaryon = {MassOmegaMinus, MassPiPlus}; } else { arrMassCharmBaryon = {MassOmegaMinus, MassKPlus}; @@ -621,7 +621,7 @@ struct HfCandidateCreatorXic0Omegac0 { float ctOmegac = RecoDecay::ct(pVecCharmBaryon, decLenCharmBaryon, MassOmegaC0); float ctXic = RecoDecay::ct(pVecCharmBaryon, decLenCharmBaryon, MassXiC0); float ctCascade = 0.; - if constexpr (decayChannel == hf_cand_casc_lf::DecayType2Prong::XiczeroOmegaczeroToXiPi) { + if constexpr (DecayChannel == hf_cand_casc_lf::DecayType2Prong::XiczeroOmegaczeroToXiPi) { ctCascade = RecoDecay::ct(pVecCasc, decLenCascade, MassXiMinus); } else { ctCascade = RecoDecay::ct(pVecCasc, decLenCascade, MassOmegaMinus); @@ -643,7 +643,7 @@ struct HfCandidateCreatorXic0Omegac0 { hCandidateCounter->Fill(3); // fill the table - if constexpr (decayChannel == hf_cand_casc_lf::DecayType2Prong::XiczeroOmegaczeroToXiPi) { + if constexpr (DecayChannel == hf_cand_casc_lf::DecayType2Prong::XiczeroOmegaczeroToXiPi) { rowCandToXiPi(collision.globalIndex(), pvCoord[0], pvCoord[1], pvCoord[2], vertexCharmBaryonFromFitter[0], vertexCharmBaryonFromFitter[1], vertexCharmBaryonFromFitter[2], @@ -673,7 +673,7 @@ struct HfCandidateCreatorXic0Omegac0 { dcaCascDau, dcaV0Dau, dcaCharmBaryonDau, decLenCharmBaryon, decLenCascade, decLenV0, errorDecayLengthCharmBaryon, errorDecayLengthXYCharmBaryon); - } else if constexpr (decayChannel == hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaPi) { + } else if constexpr (DecayChannel == hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaPi) { rowCandToOmegaPi(collision.globalIndex(), pvCoord[0], pvCoord[1], pvCoord[2], vertexCharmBaryonFromFitter[0], vertexCharmBaryonFromFitter[1], vertexCharmBaryonFromFitter[2], @@ -737,7 +737,7 @@ struct HfCandidateCreatorXic0Omegac0 { } // loop over LF Cascade-bachelor candidates } // end of run function - template + template void runKfOmegac0CreatorWithKFParticle(Coll const&, aod::BCsWithTimestamps const& /*bcWithTimeStamps*/, MyKfTracksIU const& tracksIU, @@ -754,7 +754,7 @@ struct HfCandidateCreatorXic0Omegac0 { auto collision = cand.collision_as(); float centrality{-1.f}; - const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); + const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); if (rejectionMask != 0) { /// at least one event selection not satisfied --> reject the candidate continue; @@ -1223,7 +1223,7 @@ struct HfCandidateCreatorXic0Omegac0 { } // loop over LF Cascade-bachelor candidates } // end of run function //========================================================== - template + template void runKfXic0CreatorWithKFParticle(Coll const&, aod::BCsWithTimestamps const& /*bcWithTimeStamps*/, MyKfTracksIU const& tracksIU, @@ -1243,7 +1243,7 @@ struct HfCandidateCreatorXic0Omegac0 { auto collision = cand.collision_as(); float centrality{-1.f}; - const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); + const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); if (rejectionMask != 0) { /// at least one event selection not satisfied --> reject the candidate continue; @@ -1645,7 +1645,7 @@ struct HfCandidateCreatorXic0Omegac0 { } // loop over LF Cascade-bachelor candidates } - template + template void runOmegac0Xic0ToOmegaKaCreatorWithKFParticle(Coll const&, aod::BCsWithTimestamps const& /*bcWithTimeStamps*/, MyKfTracksIU const& tracksIU, @@ -1663,7 +1663,7 @@ struct HfCandidateCreatorXic0Omegac0 { //----------------------check if the event is selected----------------------------- auto collision = cand.collision_as(); float centrality{-1.f}; - const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); + const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); if (rejectionMask != 0) { /// at least one event selection not satisfied --> reject the candidate continue; @@ -2485,7 +2485,7 @@ struct HfCandidateCreatorXic0Omegac0Mc { } } - template + template void runXic0Omegac0Mc(TMyRecoCand const& candidates, MyTracksWMc const&, aod::McParticles const& mcParticles, @@ -2549,7 +2549,7 @@ struct HfCandidateCreatorXic0Omegac0Mc { } } // Xic0 -> xi pi matching - if constexpr (decayChannel == aod::hf_cand_xic0_omegac0::DecayType::XiczeroToXiPi) { + if constexpr (DecayChannel == aod::hf_cand_xic0_omegac0::DecayType::XiczeroToXiPi) { // Xic → pi pi pi p indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, +kXiC0, std::array{+kPiPlus, +kPiMinus, +kProton, +kPiMinus}, true, &sign, 3); indexRecCharmBaryon = indexRec; @@ -2588,7 +2588,7 @@ struct HfCandidateCreatorXic0Omegac0Mc { if (debug == McMatchFlag::CascUnmatched || debug == McMatchFlag::V0Unmatched) { LOGF(info, "WARNING: Xic0ToXiPi decays in the expected final state but the condition on the intermediate states are not fulfilled"); } - } else if constexpr (decayChannel == aod::hf_cand_xic0_omegac0::DecayType::OmegaczeroToXiPi) { // Omegac -> xi pi matching + } else if constexpr (DecayChannel == aod::hf_cand_xic0_omegac0::DecayType::OmegaczeroToXiPi) { // Omegac -> xi pi matching // Omegac → pi pi pi p indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, +kOmegaC0, std::array{+kPiPlus, +kPiMinus, +kProton, +kPiMinus}, true, &sign, 3); indexRecCharmBaryon = indexRec; @@ -2627,7 +2627,7 @@ struct HfCandidateCreatorXic0Omegac0Mc { if (debug == McMatchFlag::CascUnmatched || debug == McMatchFlag::V0Unmatched) { LOGF(info, "WARNING: Omegac0ToXiPi decays in the expected final state but the condition on the intermediate states are not fulfilled"); } - } else if constexpr (decayChannel == aod::hf_cand_xic0_omegac0::DecayType::OmegaczeroToOmegaPi) { // Omegac0 -> omega pi matching + } else if constexpr (DecayChannel == aod::hf_cand_xic0_omegac0::DecayType::OmegaczeroToOmegaPi) { // Omegac0 -> omega pi matching if (acceptTrackIntWithMaterial) { // Omegac → pi K pi p indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, +kOmegaC0, std::array{+kPiPlus, +kKMinus, +kProton, +kPiMinus}, true, &sign, 3, &nPiToMuOmegac0, &nKaToPiOmegac0); @@ -2699,7 +2699,7 @@ struct HfCandidateCreatorXic0Omegac0Mc { if (debug == McMatchFlag::CascUnmatched || debug == McMatchFlag::V0Unmatched) { LOGF(info, "WARNING: Omegac0ToOmegaPi decays in the expected final state but the condition on the intermediate states are not fulfilled"); } - } else if constexpr (decayChannel == aod::hf_cand_xic0_omegac0::DecayType::OmegaczeroToOmegaK) { // Omegac0 -> omega K matching + } else if constexpr (DecayChannel == aod::hf_cand_xic0_omegac0::DecayType::OmegaczeroToOmegaK) { // Omegac0 -> omega K matching // Omegac → K K pi p indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, +kOmegaC0, std::array{+kKPlus, +kKMinus, +kProton, +kPiMinus}, true, &sign, 3); indexRecCharmBaryon = indexRec; @@ -2749,30 +2749,30 @@ struct HfCandidateCreatorXic0Omegac0Mc { float centrality{-1.f}; o2::hf_evsel::HfCollisionRejectionMask rejectionMask{}; int nSplitColl = 0; - if constexpr (centEstimator == CentralityEstimator::FT0C) { + if constexpr (CentEstimator == CentralityEstimator::FT0C) { const auto collSlice = collsWithMcLabels.sliceBy(colPerMcCollisionFT0C, mcCollision.globalIndex()); - rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, collSlice, centrality); + rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, collSlice, centrality); nSplitColl = collSlice.size(); - } else if constexpr (centEstimator == CentralityEstimator::FT0M) { + } else if constexpr (CentEstimator == CentralityEstimator::FT0M) { const auto collSlice = collsWithMcLabels.sliceBy(colPerMcCollisionFT0M, mcCollision.globalIndex()); - rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, collSlice, centrality); + rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, collSlice, centrality); nSplitColl = collSlice.size(); - } else if constexpr (centEstimator == CentralityEstimator::None) { + } else if constexpr (CentEstimator == CentralityEstimator::None) { const auto collSlice = collsWithMcLabels.sliceBy(colPerMcCollision, mcCollision.globalIndex()); - rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, collSlice, centrality); + rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, collSlice, centrality); nSplitColl = collSlice.size(); } - hfEvSelMc.fillHistograms(mcCollision, rejectionMask, nSplitColl); + hfEvSelMc.fillHistograms(mcCollision, rejectionMask, nSplitColl); if (rejectionMask != 0) { /// at least one event selection not satisfied --> reject all particles from this collision for (unsigned int i = 0; i < mcParticlesPerMcColl.size(); ++i) { - if constexpr (decayChannel == aod::hf_cand_xic0_omegac0::DecayType::XiczeroToXiPi) { + if constexpr (DecayChannel == aod::hf_cand_xic0_omegac0::DecayType::XiczeroToXiPi) { rowMCMatchGenXicToXiPi(0, 0, 0, 0, -999., -999., RecoDecay::OriginType::None, -1); - } else if constexpr (decayChannel == aod::hf_cand_xic0_omegac0::DecayType::OmegaczeroToXiPi) { + } else if constexpr (DecayChannel == aod::hf_cand_xic0_omegac0::DecayType::OmegaczeroToXiPi) { rowMCMatchGenOmegacToXiPi(0, 0, 0, 0, -999., -999., RecoDecay::OriginType::None, -1); - } else if constexpr (decayChannel == aod::hf_cand_xic0_omegac0::DecayType::OmegaczeroToOmegaPi) { + } else if constexpr (DecayChannel == aod::hf_cand_xic0_omegac0::DecayType::OmegaczeroToOmegaPi) { rowMCMatchGenToOmegaPi(0, 0, 0, 0, -999., -999., RecoDecay::OriginType::None, -1); - } else if constexpr (decayChannel == aod::hf_cand_xic0_omegac0::DecayType::OmegaczeroToOmegaK) { + } else if constexpr (DecayChannel == aod::hf_cand_xic0_omegac0::DecayType::OmegaczeroToOmegaK) { rowMCMatchGenToOmegaK(0, 0, 0, 0, -999., -999., RecoDecay::OriginType::None, -1); } } @@ -2795,19 +2795,19 @@ struct HfCandidateCreatorXic0Omegac0Mc { // Reject particles from background events if (particle.fromBackgroundEvent() && rejectBackground) { - if constexpr (decayChannel == aod::hf_cand_xic0_omegac0::DecayType::XiczeroToXiPi) { + if constexpr (DecayChannel == aod::hf_cand_xic0_omegac0::DecayType::XiczeroToXiPi) { rowMCMatchGenXicToXiPi(flag, debugGenCharmBar, debugGenCasc, debugGenLambda, ptCharmBaryonGen, rapidityCharmBaryonGen, origin, -1); - } else if constexpr (decayChannel == aod::hf_cand_xic0_omegac0::DecayType::OmegaczeroToXiPi) { + } else if constexpr (DecayChannel == aod::hf_cand_xic0_omegac0::DecayType::OmegaczeroToXiPi) { rowMCMatchGenOmegacToXiPi(flag, debugGenCharmBar, debugGenCasc, debugGenLambda, ptCharmBaryonGen, rapidityCharmBaryonGen, origin, -1); - } else if constexpr (decayChannel == aod::hf_cand_xic0_omegac0::DecayType::OmegaczeroToOmegaPi) { + } else if constexpr (DecayChannel == aod::hf_cand_xic0_omegac0::DecayType::OmegaczeroToOmegaPi) { rowMCMatchGenToOmegaPi(flag, debugGenCharmBar, debugGenCasc, debugGenLambda, ptCharmBaryonGen, rapidityCharmBaryonGen, origin, -1); - } else if constexpr (decayChannel == aod::hf_cand_xic0_omegac0::DecayType::OmegaczeroToOmegaK) { + } else if constexpr (DecayChannel == aod::hf_cand_xic0_omegac0::DecayType::OmegaczeroToOmegaK) { rowMCMatchGenToOmegaK(flag, debugGenCharmBar, debugGenCasc, debugGenLambda, ptCharmBaryonGen, rapidityCharmBaryonGen, origin, -1); } continue; } - if constexpr (decayChannel == aod::hf_cand_xic0_omegac0::DecayType::XiczeroToXiPi) { + if constexpr (DecayChannel == aod::hf_cand_xic0_omegac0::DecayType::XiczeroToXiPi) { // Xic → Xi pi if (RecoDecay::isMatchedMCGen(mcParticles, particle, +kXiC0, std::array{+kXiMinus, +kPiPlus}, true, &sign)) { debugGenCharmBar = 1; @@ -2849,7 +2849,7 @@ struct HfCandidateCreatorXic0Omegac0Mc { rowMCMatchGenXicToXiPi(flag, debugGenCharmBar, debugGenCasc, debugGenLambda, ptCharmBaryonGen, rapidityCharmBaryonGen, origin, -1); } - } else if constexpr (decayChannel == aod::hf_cand_xic0_omegac0::DecayType::OmegaczeroToXiPi) { + } else if constexpr (DecayChannel == aod::hf_cand_xic0_omegac0::DecayType::OmegaczeroToXiPi) { // Omegac → Xi pi if (RecoDecay::isMatchedMCGen(mcParticles, particle, +kOmegaC0, std::array{+kXiMinus, +kPiPlus}, true, &sign)) { debugGenCharmBar = 1; @@ -2891,7 +2891,7 @@ struct HfCandidateCreatorXic0Omegac0Mc { rowMCMatchGenOmegacToXiPi(flag, debugGenCharmBar, debugGenCasc, debugGenLambda, ptCharmBaryonGen, rapidityCharmBaryonGen, origin, -1); } - } else if constexpr (decayChannel == aod::hf_cand_xic0_omegac0::DecayType::OmegaczeroToOmegaPi) { + } else if constexpr (DecayChannel == aod::hf_cand_xic0_omegac0::DecayType::OmegaczeroToOmegaPi) { // Omegac → Omega pi if (RecoDecay::isMatchedMCGen(mcParticles, particle, +kOmegaC0, std::array{+kOmegaMinus, +kPiPlus}, true, &sign)) { debugGenCharmBar = 1; @@ -2933,7 +2933,7 @@ struct HfCandidateCreatorXic0Omegac0Mc { rowMCMatchGenToOmegaPi(flag, debugGenCharmBar, debugGenCasc, debugGenLambda, ptCharmBaryonGen, rapidityCharmBaryonGen, origin, -1); } - } else if constexpr (decayChannel == aod::hf_cand_xic0_omegac0::DecayType::OmegaczeroToOmegaK) { + } else if constexpr (DecayChannel == aod::hf_cand_xic0_omegac0::DecayType::OmegaczeroToOmegaK) { // Omegac → Omega K if (RecoDecay::isMatchedMCGen(mcParticles, particle, +kOmegaC0, std::array{+kOmegaMinus, +kKPlus}, true, &sign)) { debugGenCharmBar = 1; @@ -2979,7 +2979,7 @@ struct HfCandidateCreatorXic0Omegac0Mc { } // close loop on MCCollisions } // close process - template + template void runXic0Omegac0McQa(TMyRecoCand const& candidates, MyTracksWMc const&, aod::McParticles const& mcParticles, @@ -3008,7 +3008,7 @@ struct HfCandidateCreatorXic0Omegac0Mc { auto mcXic0Bachelor = arrayDaughters[0].mcParticle(); // Xic0 -> xi pi matching - if constexpr (decayChannel == aod::hf_cand_xic0_omegac0::DecayType::XiczeroToXiPi) { + if constexpr (DecayChannel == aod::hf_cand_xic0_omegac0::DecayType::XiczeroToXiPi) { // Lambda → p pi indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersV0, +kLambda0, std::array{+kProton, +kPiMinus}, true, &signV0, 1); if (indexRec > -1 && signV0 == 1) { diff --git a/PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx b/PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx index b974ac23027..436350e0496 100644 --- a/PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx +++ b/PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx @@ -194,7 +194,7 @@ struct HfCandidateCreatorXicToXiPiPi { df.setWeightedFinalPCA(useWeightedFinalPCA); } - template + template void runXicplusCreatorWithDcaFitter(Collision const&, aod::HfCascLf3Prongs const& rowsTrackIndexXicPlus, CascadesLinked const&, @@ -209,7 +209,7 @@ struct HfCandidateCreatorXicToXiPiPi { // check if the event is selected auto collision = rowTrackIndexXicPlus.collision_as(); float centrality{-1.f}; - const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); + const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); if (rejectionMask != 0) { /// at least one event selection not satisfied --> reject the candidate continue; @@ -427,7 +427,7 @@ struct HfCandidateCreatorXicToXiPiPi { } // loop over track triplets } - template + template void runXicplusCreatorWithKFParticle(Collision const&, aod::HfCascLf3Prongs const& rowsTrackIndexXicPlus, KFCascadesLinked const&, @@ -442,7 +442,7 @@ struct HfCandidateCreatorXicToXiPiPi { // check if the event is selected auto collision = rowTrackIndexXicPlus.collision_as(); float centrality{-1.f}; - const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); + const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); if (rejectionMask != 0) { /// at least one event selection not satisfied --> reject the candidate continue; @@ -898,7 +898,7 @@ struct HfCandidateCreatorXicToXiPiPiExpressions { } } - template + template void runMcMatching(aod::TracksWMc const& tracks, aod::McParticles const& mcParticles, McCollisions const& mcCollisions, @@ -1074,18 +1074,18 @@ struct HfCandidateCreatorXicToXiPiPiExpressions { float centrality{-1.f}; o2::hf_evsel::HfCollisionRejectionMask rejectionMask{}; int nSplitColl = 0; - if constexpr (centEstimator == o2::hf_centrality::CentralityEstimator::FT0C) { + if constexpr (CentEstimator == o2::hf_centrality::CentralityEstimator::FT0C) { const auto collSlice = collInfos.sliceBy(colPerMcCollisionFT0C, mcCollision.globalIndex()); - rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, collSlice, centrality); - } else if constexpr (centEstimator == o2::hf_centrality::CentralityEstimator::FT0M) { + rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, collSlice, centrality); + } else if constexpr (CentEstimator == o2::hf_centrality::CentralityEstimator::FT0M) { const auto collSlice = collInfos.sliceBy(colPerMcCollisionFT0M, mcCollision.globalIndex()); nSplitColl = collSlice.size(); - rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, collSlice, centrality); - } else if constexpr (centEstimator == o2::hf_centrality::CentralityEstimator::None) { + rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, collSlice, centrality); + } else if constexpr (CentEstimator == o2::hf_centrality::CentralityEstimator::None) { const auto collSlice = collInfos.sliceBy(colPerMcCollision, mcCollision.globalIndex()); - rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, collSlice, centrality); + rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, collSlice, centrality); } - hfEvSelMc.fillHistograms(mcCollision, rejectionMask, nSplitColl); + hfEvSelMc.fillHistograms(mcCollision, rejectionMask, nSplitColl); if (rejectionMask != 0) { // at least one event selection not satisfied --> reject all particles from this collision for (unsigned int i = 0; i < mcParticlesPerMcColl.size(); ++i) { diff --git a/PWGHF/TableProducer/candidateSelectorB0ToDPi.cxx b/PWGHF/TableProducer/candidateSelectorB0ToDPi.cxx index 782de25bb36..1d571950ef7 100644 --- a/PWGHF/TableProducer/candidateSelectorB0ToDPi.cxx +++ b/PWGHF/TableProducer/candidateSelectorB0ToDPi.cxx @@ -159,7 +159,7 @@ struct HfCandidateSelectorB0ToDPi { /// \param withDmesMl is the flag to use the table with ML scores for the D- daughter (only possible if present in the derived data) /// \param hfCandsB0 B0 candidates /// \param pionTracks pion tracks - template + template void runSelection(Cands const& hfCandsB0, CandsDmes const& /*hfCandsD*/, TracksPion const& /*pionTracks*/) @@ -188,7 +188,7 @@ struct HfCandidateSelectorB0ToDPi { auto hfCandD = hfCandB0.template prong0_as(); std::vector mlScoresD; - if constexpr (withDmesMl) { + if constexpr (WithDmesMl) { std::copy(hfCandD.mlProbDplusToPiKPi().begin(), hfCandD.mlProbDplusToPiKPi().end(), std::back_inserter(mlScoresD)); if (!hfHelper.selectionDmesMlScoresForB(hfCandD, cutsDmesMl, binsPtDmesMl, mlScoresD)) { @@ -229,7 +229,7 @@ struct HfCandidateSelectorB0ToDPi { } if (applyB0Ml) { // B0 ML selections - std::vector inputFeatures = hfMlResponse.getInputFeatures(hfCandB0, trackPi, &mlScoresD); + std::vector inputFeatures = hfMlResponse.getInputFeatures(hfCandB0, trackPi, &mlScoresD); bool isSelectedMl = hfMlResponse.isSelectedMl(inputFeatures, ptCandB0, outputMl); hfMlB0ToDPiCandidate(outputMl[1]); // storing ML score for signal class diff --git a/PWGHF/TableProducer/candidateSelectorBplusToD0Pi.cxx b/PWGHF/TableProducer/candidateSelectorBplusToD0Pi.cxx index 6bfbe624ec9..d3ecf73fc2f 100644 --- a/PWGHF/TableProducer/candidateSelectorBplusToD0Pi.cxx +++ b/PWGHF/TableProducer/candidateSelectorBplusToD0Pi.cxx @@ -162,7 +162,7 @@ struct HfCandidateSelectorBplusToD0Pi { /// \param withDmesMl is the flag to use the table with ML scores for the D- daughter (only possible if present in the derived data) /// \param hfCandsBp B+ candidates /// \param pionTracks pion tracks - template + template void runSelection(Cands const& hfCandsBp, CandsDmes const& /*hfCandsD0*/, TracksPion const& /*pionTracks*/) @@ -190,7 +190,7 @@ struct HfCandidateSelectorBplusToD0Pi { auto trackPi = hfCandBp.template prong1_as(); auto hfCandD = hfCandBp.template prong0_as(); - if constexpr (withDmesMl) { + if constexpr (WithDmesMl) { std::vector mlScoresD; if (trackPi.sign() < 0) { std::copy(hfCandD.mlProbD0().begin(), hfCandD.mlProbD0().end(), std::back_inserter(mlScoresD)); @@ -240,7 +240,7 @@ struct HfCandidateSelectorBplusToD0Pi { if (trackPi.sign() > 0) { pdgCode = -1 * pdgCode; } - std::vector inputFeatures = hfMlResponse.getInputFeatures(hfCandBp, hfCandD, pdgCode, trackPi); + std::vector inputFeatures = hfMlResponse.getInputFeatures(hfCandBp, hfCandD, pdgCode, trackPi); bool isSelectedMl = hfMlResponse.isSelectedMl(inputFeatures, ptCandBplus, outputMl); hfMlBplusToD0PiCandidate(outputMl[1]); // storing ML score for signal class diff --git a/PWGHF/TableProducer/candidateSelectorD0.cxx b/PWGHF/TableProducer/candidateSelectorD0.cxx index fefb799c072..a4471492fa8 100644 --- a/PWGHF/TableProducer/candidateSelectorD0.cxx +++ b/PWGHF/TableProducer/candidateSelectorD0.cxx @@ -172,7 +172,7 @@ struct HfCandidateSelectorD0 { /// \param reconstructionType is the reconstruction type (DCAFitterN or KFParticle) /// \param candidate is candidate /// \return true if candidate passes all cuts - template + template bool selectionTopol(const T& candidate) { auto candpT = candidate.pt(); @@ -233,7 +233,7 @@ struct HfCandidateSelectorD0 { /// \param trackKaon is the track with the kaon hypothesis /// \note trackPion = positive and trackKaon = negative for D0 selection and inverse for D0bar /// \return true if candidate passes all cuts for the given Conjugate - template + template bool selectionTopolConjugate(const T1& candidate, const T2& trackPion, const T2& trackKaon) { auto candpT = candidate.pt(); @@ -244,7 +244,7 @@ struct HfCandidateSelectorD0 { // invariant-mass cut float massD0, massD0bar; - if constexpr (reconstructionType == aod::hf_cand::VertexerType::KfParticle) { + if constexpr (ReconstructionType == aod::hf_cand::VertexerType::KfParticle) { massD0 = candidate.kfGeoMassD0(); massD0bar = candidate.kfGeoMassD0bar(); } else { @@ -303,7 +303,7 @@ struct HfCandidateSelectorD0 { return true; } - template + template void processSel(CandType const& candidates, TracksSel const&) { @@ -344,7 +344,7 @@ struct HfCandidateSelectorD0 { } // conjugate-independent topological selection - if (!selectionTopol(candidate)) { + if (!selectionTopol(candidate)) { hfSelD0Candidate(statusD0, statusD0bar, statusHFFlag, statusTopol, statusCand, statusPID); if (applyMl) { hfMlD0Candidate(outputMlD0, outputMlD0bar); @@ -357,9 +357,9 @@ struct HfCandidateSelectorD0 { // need to add special cuts (additional cuts on decay length and d0 norm) // conjugate-dependent topological selection for D0 - bool topolD0 = selectionTopolConjugate(candidate, trackPos, trackNeg); + bool topolD0 = selectionTopolConjugate(candidate, trackPos, trackNeg); // conjugate-dependent topological selection for D0bar - bool topolD0bar = selectionTopolConjugate(candidate, trackNeg, trackPos); + bool topolD0bar = selectionTopolConjugate(candidate, trackNeg, trackPos); if (!topolD0 && !topolD0bar) { hfSelD0Candidate(statusD0, statusD0bar, statusHFFlag, statusTopol, statusCand, statusPID); diff --git a/PWGHF/TableProducer/candidateSelectorLc.cxx b/PWGHF/TableProducer/candidateSelectorLc.cxx index 1332674722d..da9ed2fe089 100644 --- a/PWGHF/TableProducer/candidateSelectorLc.cxx +++ b/PWGHF/TableProducer/candidateSelectorLc.cxx @@ -207,7 +207,7 @@ struct HfCandidateSelectorLc { /// Conjugate-independent topological cuts /// \param candidate is candidate /// \return true if candidate passes all cuts - template + template bool selectionTopol(const T& candidate) { auto candpT = candidate.pt(); @@ -222,7 +222,7 @@ struct HfCandidateSelectorLc { return false; } - if (reconstructionType == aod::hf_cand::VertexerType::DCAFitter || (reconstructionType == aod::hf_cand::VertexerType::KfParticle && applyNonKfCuts)) { + if (ReconstructionType == aod::hf_cand::VertexerType::DCAFitter || (ReconstructionType == aod::hf_cand::VertexerType::KfParticle && applyNonKfCuts)) { // cosine of pointing angle if (candidate.cpa() <= cuts->get(pTBin, "cos pointing angle")) { return false; @@ -253,7 +253,7 @@ struct HfCandidateSelectorLc { } } - if constexpr (reconstructionType == aod::hf_cand::VertexerType::KfParticle) { + if constexpr (ReconstructionType == aod::hf_cand::VertexerType::KfParticle) { if (applyKfCuts) { // candidate chi2geo of the triplet of prongs if (candidate.kfChi2Geo() > kfCuts->get(pTBin, "kfChi2Geo")) { @@ -285,7 +285,7 @@ struct HfCandidateSelectorLc { /// \param trackPion is the track with the pion hypothesis /// \param trackKaon is the track with the kaon hypothesis /// \return true if candidate passes all cuts for the given Conjugate - template + template bool selectionTopolConjugate(const T1& candidate, const T2& trackProton, const T2& trackKaon, const T2& trackPion) { @@ -295,7 +295,7 @@ struct HfCandidateSelectorLc { return false; } - if (reconstructionType == aod::hf_cand::VertexerType::DCAFitter || (reconstructionType == aod::hf_cand::VertexerType::KfParticle && applyNonKfCuts)) { + if (ReconstructionType == aod::hf_cand::VertexerType::DCAFitter || (ReconstructionType == aod::hf_cand::VertexerType::KfParticle && applyNonKfCuts)) { // cut on daughter pT if (trackProton.pt() < cuts->get(pTBin, "pT p") || trackKaon.pt() < cuts->get(pTBin, "pT K") || trackPion.pt() < cuts->get(pTBin, "pT Pi")) { @@ -303,7 +303,7 @@ struct HfCandidateSelectorLc { } float massLc{0.f}, massKPi{0.f}; - if constexpr (reconstructionType == aod::hf_cand::VertexerType::DCAFitter) { + if constexpr (ReconstructionType == aod::hf_cand::VertexerType::DCAFitter) { if (trackProton.globalIndex() == candidate.prong0Id()) { massLc = hfHelper.invMassLcToPKPi(candidate); massKPi = hfHelper.invMassKPiPairLcToPKPi(candidate); @@ -311,7 +311,7 @@ struct HfCandidateSelectorLc { massLc = hfHelper.invMassLcToPiKP(candidate); massKPi = hfHelper.invMassKPiPairLcToPiKP(candidate); } - } else if constexpr (reconstructionType == aod::hf_cand::VertexerType::KfParticle) { + } else if constexpr (ReconstructionType == aod::hf_cand::VertexerType::KfParticle) { if (trackProton.globalIndex() == candidate.prong0Id()) { massLc = candidate.kfMassPKPi(); massKPi = candidate.kfMassKPi(); @@ -333,7 +333,7 @@ struct HfCandidateSelectorLc { } } - if constexpr (reconstructionType == aod::hf_cand::VertexerType::KfParticle) { + if constexpr (ReconstructionType == aod::hf_cand::VertexerType::KfParticle) { if (applyKfCuts) { const float chi2PrimProng0 = candidate.kfChi2PrimProng0(); const float chi2PrimProng1 = candidate.kfChi2PrimProng1(); @@ -438,7 +438,7 @@ struct HfCandidateSelectorLc { /// \param reconstructionType is the reconstruction type (DCAFitterN or KFParticle) /// \param candidates Lc candidate table /// \param tracks track table - template + template void runSelectLc(CandType const& candidates, TTracks const&) { // looping over 3-prong candidates @@ -485,7 +485,7 @@ struct HfCandidateSelectorLc { } // conjugate-independent topological selection - if (!selectionTopol(candidate)) { + if (!selectionTopol(candidate)) { hfSelLcCandidate(statusLcToPKPi, statusLcToPiKP); if (applyMl) { hfMlLcToPKPiCandidate(outputMlLcToPKPi, outputMlLcToPiKP); @@ -494,8 +494,8 @@ struct HfCandidateSelectorLc { } // conjugate-dependent topological selection for Lc - bool topolLcToPKPi = selectionTopolConjugate(candidate, trackPos1, trackNeg, trackPos2); - bool topolLcToPiKP = selectionTopolConjugate(candidate, trackPos2, trackNeg, trackPos1); + bool topolLcToPKPi = selectionTopolConjugate(candidate, trackPos1, trackNeg, trackPos2); + bool topolLcToPiKP = selectionTopolConjugate(candidate, trackPos2, trackNeg, trackPos1); if (!topolLcToPKPi && !topolLcToPiKP) { hfSelLcCandidate(statusLcToPKPi, statusLcToPiKP); @@ -544,7 +544,7 @@ struct HfCandidateSelectorLc { } } - if constexpr (useBayesPid) { + if constexpr (UseBayesPid) { TrackSelectorPID::Status pidBayesTrackPos1Proton = selectorProton.statusBayes(trackPos1); TrackSelectorPID::Status pidBayesTrackPos2Proton = selectorProton.statusBayes(trackPos2); TrackSelectorPID::Status pidBayesTrackPos1Pion = selectorPion.statusBayes(trackPos1); @@ -579,7 +579,7 @@ struct HfCandidateSelectorLc { isSelectedMlLcToPKPi = false; isSelectedMlLcToPiKP = false; - if constexpr (reconstructionType == aod::hf_cand::VertexerType::DCAFitter) { + if constexpr (ReconstructionType == aod::hf_cand::VertexerType::DCAFitter) { if (pidLcToPKPi == 1 && pidBayesLcToPKPi == 1 && topolLcToPKPi) { std::vector inputFeaturesLcToPKPi = hfMlResponseDCA.getInputFeatures(candidate, true); isSelectedMlLcToPKPi = hfMlResponseDCA.isSelectedMl(inputFeaturesLcToPKPi, candidate.pt(), outputMlLcToPKPi); diff --git a/PWGHF/TableProducer/candidateSelectorOmegac0ToOmegaPi.cxx b/PWGHF/TableProducer/candidateSelectorOmegac0ToOmegaPi.cxx index e567f43bbf5..4fc0976c463 100644 --- a/PWGHF/TableProducer/candidateSelectorOmegac0ToOmegaPi.cxx +++ b/PWGHF/TableProducer/candidateSelectorOmegac0ToOmegaPi.cxx @@ -172,7 +172,7 @@ struct HfCandidateSelectorToOmegaPi { Configurable decayLenXYLambdaMin{"decayLenXYLambdaMin", 0., "Minimum decay lengthXY of V0"}; Configurable cosPaCascToOmegacMin{"cosPaCascToOmegacMin", 0.995, "Minimum cosPA of cascade<-Omegac"}; Configurable cosPaV0ToCascMin{"cosPaV0ToCascMin", 0.99, "Minimum cosPA of V0<-cascade"}; - } KfconfigurableGroup; + } kfConfigurableGroup; // topological cuts Configurable> binsPt{"binsPt", std::vector{hf_cuts_omegac_to_omega_pi::vecBinsPt}, "pT bin limits"}; Configurable> cuts{"cuts", {hf_cuts_omegac_to_omega_pi::Cuts[0], hf_cuts_omegac_to_omega_pi::NBinsPt, hf_cuts_omegac_to_omega_pi::NCutVars, hf_cuts_omegac_to_omega_pi::labelsPt, hf_cuts_omegac_to_omega_pi::labelsCutVar}, "OmegaC0 candidate selection per pT bin"}; @@ -270,7 +270,7 @@ struct HfCandidateSelectorToOmegaPi { registry.add("hSelDcaXYToPvV0Daughters", "hSelDcaXYToPvV0Daughters;status;entries", {HistType::kTH1D, {axisSel}}); registry.add("hSelDcaXYToPvKaFromCasc", "hSelDcaXYToPvKaFromCasc;status;entries", {HistType::kTH1D, {axisSel}}); - if (KfconfigurableGroup.applyKFpreselections) { + if (kfConfigurableGroup.applyKFpreselections) { registry.add("hSelPtOmegac", "hSelPtOmegac;status;entries", {HistType::kTH1D, {axisSel}}); registry.add("hSelCompetingCasc", "hSelCompetingCasc;status;entries", {HistType::kTH1D, {axisSel}}); registry.add("hSelKFstatus", "hSelKFstatus;status;entries", {HistType::kTH1D, {axisSel}}); @@ -524,7 +524,7 @@ struct HfCandidateSelectorToOmegaPi { if constexpr (ConstructMethod == hf_cand_casc_lf::ConstructMethod::KfParticle) { // KFParticle Preselections(kfsel) - if (KfconfigurableGroup.applyKFpreselections) { + if (kfConfigurableGroup.applyKFpreselections) { bool inputKF = false; if (resultSelections) { @@ -533,8 +533,8 @@ struct HfCandidateSelectorToOmegaPi { } // Competing Ξ rejection(KF) Try to reject cases in which the candidate has a an inv. mass compatibler to Xi (bachelor pion) instead of Omega (bachelor kaon) - if (KfconfigurableGroup.applyCompetingCascRejection) { - if (std::abs(candidate.cascRejectInvmass() - o2::constants::physics::MassXiMinus) < KfconfigurableGroup.cascadeRejMassWindow) { + if (kfConfigurableGroup.applyCompetingCascRejection) { + if (std::abs(candidate.cascRejectInvmass() - o2::constants::physics::MassXiMinus) < kfConfigurableGroup.cascadeRejMassWindow) { resultSelections = false; registry.fill(HIST("hSelCompetingCasc"), 0); } else { @@ -552,7 +552,7 @@ struct HfCandidateSelectorToOmegaPi { } // v0&Casc&Omegac ldl selection - if ((candidate.v0ldl() < KfconfigurableGroup.v0LdlMin) || (candidate.cascldl() < KfconfigurableGroup.cascLdlMin) || (candidate.omegacldl() > KfconfigurableGroup.omegacLdlMax)) { + if ((candidate.v0ldl() < kfConfigurableGroup.v0LdlMin) || (candidate.cascldl() < kfConfigurableGroup.cascLdlMin) || (candidate.omegacldl() > kfConfigurableGroup.omegacLdlMax)) { resultSelections = false; registry.fill(HIST("hSelV0_Casc_Omegacldl"), 0); } else { @@ -560,7 +560,7 @@ struct HfCandidateSelectorToOmegaPi { } // Omegac ctau selsection - if (candidate.cTauOmegac() > KfconfigurableGroup.cTauOmegacMax) { + if (candidate.cTauOmegac() > kfConfigurableGroup.cTauOmegacMax) { resultSelections = false; registry.fill(HIST("hSelctauOmegac"), 0); } else { @@ -568,7 +568,7 @@ struct HfCandidateSelectorToOmegaPi { } // Chi2Geo/NDF V0&Casc&Omegac selection - if ((candidate.v0Chi2OverNdf() > KfconfigurableGroup.v0Chi2OverNdfMax) || (candidate.v0Chi2OverNdf() < 0) || (candidate.cascChi2OverNdf() > KfconfigurableGroup.cascChi2OverNdfMax) || (candidate.cascChi2OverNdf() < 0) || (candidate.omegacChi2OverNdf() > KfconfigurableGroup.omegacChi2OverNdfMax) || (candidate.omegacChi2OverNdf() < 0)) { + if ((candidate.v0Chi2OverNdf() > kfConfigurableGroup.v0Chi2OverNdfMax) || (candidate.v0Chi2OverNdf() < 0) || (candidate.cascChi2OverNdf() > kfConfigurableGroup.cascChi2OverNdfMax) || (candidate.cascChi2OverNdf() < 0) || (candidate.omegacChi2OverNdf() > kfConfigurableGroup.omegacChi2OverNdfMax) || (candidate.omegacChi2OverNdf() < 0)) { resultSelections = false; registry.fill(HIST("hSelChi2GeooverNDFV0_Casc_Omegac"), 0); } else { @@ -576,7 +576,7 @@ struct HfCandidateSelectorToOmegaPi { } // Chi2Topo/NDF (chi2TopoV0ToCasc chi2TopoOmegacToPv chi2TopoCascToOmegac chi2TopoCascToPv) selection (???????????/NDF of which particle????????) - if ((candidate.chi2TopoV0ToCasc() > KfconfigurableGroup.chi2TopoV0ToCascMax) || (candidate.chi2TopoV0ToCasc() < 0) || (candidate.chi2TopoOmegacToPv() > KfconfigurableGroup.chi2TopoOmegacToPvMax) || (candidate.chi2TopoOmegacToPv() < 0) || (candidate.chi2TopoCascToOmegac() > KfconfigurableGroup.chi2TopoCascToOmegacMax) || (candidate.chi2TopoCascToOmegac() < 0) || (candidate.chi2TopoCascToPv() > KfconfigurableGroup.chi2TopoCascToPvMax) || (candidate.chi2TopoCascToPv() < 0)) { + if ((candidate.chi2TopoV0ToCasc() > kfConfigurableGroup.chi2TopoV0ToCascMax) || (candidate.chi2TopoV0ToCasc() < 0) || (candidate.chi2TopoOmegacToPv() > kfConfigurableGroup.chi2TopoOmegacToPvMax) || (candidate.chi2TopoOmegacToPv() < 0) || (candidate.chi2TopoCascToOmegac() > kfConfigurableGroup.chi2TopoCascToOmegacMax) || (candidate.chi2TopoCascToOmegac() < 0) || (candidate.chi2TopoCascToPv() > kfConfigurableGroup.chi2TopoCascToPvMax) || (candidate.chi2TopoCascToPv() < 0)) { resultSelections = false; registry.fill(HIST("hSelChi2TopooverNDFV0_Casc_Omegac"), 0); } else { @@ -584,7 +584,7 @@ struct HfCandidateSelectorToOmegaPi { } // DecaylengthXY of Omegac&Casc&V0 selection - if ((std::abs(candidate.decayLenXYOmegac()) > KfconfigurableGroup.decayLenXYOmegacMax) || (std::abs(candidate.decayLenXYCasc()) < KfconfigurableGroup.decayLenXYCascMin) || (std::abs(candidate.decayLenXYLambda()) < KfconfigurableGroup.decayLenXYLambdaMin)) { + if ((std::abs(candidate.decayLenXYOmegac()) > kfConfigurableGroup.decayLenXYOmegacMax) || (std::abs(candidate.decayLenXYCasc()) < kfConfigurableGroup.decayLenXYCascMin) || (std::abs(candidate.decayLenXYLambda()) < kfConfigurableGroup.decayLenXYLambdaMin)) { resultSelections = false; registry.fill(HIST("hSeldecayLenXYOmegac_Casc_V0"), 0); } else { @@ -592,7 +592,7 @@ struct HfCandidateSelectorToOmegaPi { } // KFPA cut cosPaCascToOmegac cosPaV0ToCasc - if ((candidate.cosPaCascToOmegac() < KfconfigurableGroup.cosPaCascToOmegacMin) || (candidate.cosPaV0ToCasc() < KfconfigurableGroup.cosPaV0ToCascMin)) { + if ((candidate.cosPaCascToOmegac() < kfConfigurableGroup.cosPaCascToOmegacMin) || (candidate.cosPaV0ToCasc() < kfConfigurableGroup.cosPaV0ToCascMin)) { resultSelections = false; registry.fill(HIST("hSelcosPaCascToOmegac_V0ToCasc"), 0); } else { diff --git a/PWGHF/TableProducer/candidateSelectorOmegac0Xic0ToOmegaKa.cxx b/PWGHF/TableProducer/candidateSelectorOmegac0Xic0ToOmegaKa.cxx index 319356820a1..39939f7e095 100644 --- a/PWGHF/TableProducer/candidateSelectorOmegac0Xic0ToOmegaKa.cxx +++ b/PWGHF/TableProducer/candidateSelectorOmegac0Xic0ToOmegaKa.cxx @@ -171,7 +171,7 @@ struct HfCandidateSelectorToOmegaKa { Configurable decayLenLambdaMin{"decayLenLambdaMin", 0., "Minimum decay lengthXY of V0"}; Configurable cosPaCascToOmegaKaMin{"cosPaCascToOmegaKaMin", 0.995, "Minimum cosPA of cascade<-OmegaKa"}; Configurable cosPaV0ToCascMin{"cosPaV0ToCascMin", 0.99, "Minimum cosPA of V0<-cascade"}; - } KfconfigurableGroup; + } kfConfigurableGroup; TrackSelectorPi selectorPion; TrackSelectorPr selectorProton; @@ -265,7 +265,7 @@ struct HfCandidateSelectorToOmegaKa { bool selectionTopol(const T1& hfCandOmegaKa) { auto candpT = hfCandOmegaKa.kfPtOmegaKa(); - auto KaPtFromOmegaKa = hfCandOmegaKa.kfPtKaFromOmegaKa(); + auto kaPtFromOmegaKa = hfCandOmegaKa.kfPtKaFromOmegaKa(); int pTBin = findBin(binsPt, candpT); if (pTBin == -1) { return false; @@ -279,7 +279,7 @@ struct HfCandidateSelectorToOmegaKa { registry.fill(HIST("hSelPtOmegaKa"), 1); // check that the candidate pT is within the analysis range - if (KaPtFromOmegaKa < cuts->get(pTBin, "pT ka from OmegaKa")) { + if (kaPtFromOmegaKa < cuts->get(pTBin, "pT ka from OmegaKa")) { registry.fill(HIST("hSelPtKaFromCharm"), 0); return false; } @@ -444,8 +444,8 @@ struct HfCandidateSelectorToOmegaKa { } // Competing Ξ rejection(KF) Try to reject cases in which the candidate has a an inv. mass compatibler to Xi (bachelor pion) instead of Omega (bachelor kaon) - if (KfconfigurableGroup.applyCompetingCascRejection) { - if (std::abs(candidate.invMassCascadeRej() - o2::constants::physics::MassXiMinus) < KfconfigurableGroup.cascadeRejMassWindow) { + if (kfConfigurableGroup.applyCompetingCascRejection) { + if (std::abs(candidate.invMassCascadeRej() - o2::constants::physics::MassXiMinus) < kfConfigurableGroup.cascadeRejMassWindow) { resultSelections = false; registry.fill(HIST("hSelCompetingCasc"), 0); } else { @@ -455,7 +455,7 @@ struct HfCandidateSelectorToOmegaKa { } // v0&Casc&OmegaKa ldl selection - if ((candidate.v0ldl() < KfconfigurableGroup.v0LdlMin) || (candidate.cascldl() < KfconfigurableGroup.cascLdlMin) || (candidate.omegaKaldl() > KfconfigurableGroup.omegaKaLdlMax)) { + if ((candidate.v0ldl() < kfConfigurableGroup.v0LdlMin) || (candidate.cascldl() < kfConfigurableGroup.cascLdlMin) || (candidate.omegaKaldl() > kfConfigurableGroup.omegaKaLdlMax)) { resultSelections = false; registry.fill(HIST("hSelV0_Casc_OmegaKaldl"), 0); } else { @@ -463,7 +463,7 @@ struct HfCandidateSelectorToOmegaKa { } // OmegaKa ctau selsection - if (candidate.cTauOmegaKa() > KfconfigurableGroup.cTauOmegaKaMax) { + if (candidate.cTauOmegaKa() > kfConfigurableGroup.cTauOmegaKaMax) { resultSelections = false; registry.fill(HIST("hSelctauOmegaKa"), 0); } else { @@ -471,7 +471,7 @@ struct HfCandidateSelectorToOmegaKa { } // Chi2Geo/NDF V0&Casc&OmegaKa selection - if ((candidate.chi2GeoV0() > KfconfigurableGroup.v0Chi2OverNdfMax) || (candidate.chi2GeoV0() < 0) || (candidate.chi2GeoCasc() > KfconfigurableGroup.cascChi2OverNdfMax) || (candidate.chi2GeoCasc() < 0) || (candidate.chi2GeoOmegaKa() > KfconfigurableGroup.omegaKaChi2OverNdfMax) || (candidate.chi2GeoOmegaKa() < 0)) { + if ((candidate.chi2GeoV0() > kfConfigurableGroup.v0Chi2OverNdfMax) || (candidate.chi2GeoV0() < 0) || (candidate.chi2GeoCasc() > kfConfigurableGroup.cascChi2OverNdfMax) || (candidate.chi2GeoCasc() < 0) || (candidate.chi2GeoOmegaKa() > kfConfigurableGroup.omegaKaChi2OverNdfMax) || (candidate.chi2GeoOmegaKa() < 0)) { resultSelections = false; registry.fill(HIST("hSelChi2GeooverNDFV0_Casc_OmegaKa"), 0); } else { @@ -479,8 +479,8 @@ struct HfCandidateSelectorToOmegaKa { } // Chi2Topo/NDF selection - if ((candidate.chi2TopoV0ToCasc() > KfconfigurableGroup.chi2TopoV0ToCascMax) || (candidate.chi2TopoV0ToCasc() < 0) || (candidate.chi2TopoKaToCasc() > KfconfigurableGroup.chi2TopoKaToCascMax) || (candidate.chi2TopoKaToCasc() < 0) || (candidate.chi2TopoCascToOmegaKa() > KfconfigurableGroup.chi2TopoCascToOmegaKaMax) || (candidate.chi2TopoCascToOmegaKa() < 0) || (candidate.chi2TopoKaToOmegaKa() > KfconfigurableGroup.chi2TopoKaToOmegaKaMax) || (candidate.chi2TopoKaToOmegaKa() < 0) || - (candidate.chi2TopoOmegaKaToPv() > KfconfigurableGroup.chi2TopoOmegaKaToPvMax) || (candidate.chi2TopoOmegaKaToPv() < 0) || (candidate.chi2TopoCascToPv() > KfconfigurableGroup.chi2TopoCascToPvMax) || (candidate.chi2TopoCascToPv() < 0) || (candidate.chi2TopoKaFromOmegaKaToPv() > KfconfigurableGroup.chi2TopoKaFromOmegaKaToPvMax) || (candidate.chi2TopoKaFromOmegaKaToPv() < 0)) { + if ((candidate.chi2TopoV0ToCasc() > kfConfigurableGroup.chi2TopoV0ToCascMax) || (candidate.chi2TopoV0ToCasc() < 0) || (candidate.chi2TopoKaToCasc() > kfConfigurableGroup.chi2TopoKaToCascMax) || (candidate.chi2TopoKaToCasc() < 0) || (candidate.chi2TopoCascToOmegaKa() > kfConfigurableGroup.chi2TopoCascToOmegaKaMax) || (candidate.chi2TopoCascToOmegaKa() < 0) || (candidate.chi2TopoKaToOmegaKa() > kfConfigurableGroup.chi2TopoKaToOmegaKaMax) || (candidate.chi2TopoKaToOmegaKa() < 0) || + (candidate.chi2TopoOmegaKaToPv() > kfConfigurableGroup.chi2TopoOmegaKaToPvMax) || (candidate.chi2TopoOmegaKaToPv() < 0) || (candidate.chi2TopoCascToPv() > kfConfigurableGroup.chi2TopoCascToPvMax) || (candidate.chi2TopoCascToPv() < 0) || (candidate.chi2TopoKaFromOmegaKaToPv() > kfConfigurableGroup.chi2TopoKaFromOmegaKaToPvMax) || (candidate.chi2TopoKaFromOmegaKaToPv() < 0)) { resultSelections = false; registry.fill(HIST("hSelChi2TopooverNDFV0_Casc_OmegaKa"), 0); } else { @@ -488,7 +488,7 @@ struct HfCandidateSelectorToOmegaKa { } // DecaylengthXY of OmegaKa&Casc&V0 selection - if ((std::abs(candidate.decLenCharmBaryon()) > KfconfigurableGroup.decayLenOmegaKaMax) || (std::abs(candidate.decLenCascade()) < KfconfigurableGroup.decayLenCascMin) || (std::abs(candidate.decLenV0()) < KfconfigurableGroup.decayLenLambdaMin)) { + if ((std::abs(candidate.decLenCharmBaryon()) > kfConfigurableGroup.decayLenOmegaKaMax) || (std::abs(candidate.decLenCascade()) < kfConfigurableGroup.decayLenCascMin) || (std::abs(candidate.decLenV0()) < kfConfigurableGroup.decayLenLambdaMin)) { resultSelections = false; registry.fill(HIST("hSeldecayLenOmegaKa_Casc_V0"), 0); } else { @@ -496,7 +496,7 @@ struct HfCandidateSelectorToOmegaKa { } // KFPA cut cosPaCascToOmegaKa cosPaV0ToCasc - if ((candidate.cosPaCascToOmegaKa() < KfconfigurableGroup.cosPaCascToOmegaKaMin) || (candidate.cosPaV0ToCasc() < KfconfigurableGroup.cosPaV0ToCascMin)) { + if ((candidate.cosPaCascToOmegaKa() < kfConfigurableGroup.cosPaCascToOmegaKaMin) || (candidate.cosPaV0ToCasc() < kfConfigurableGroup.cosPaV0ToCascMin)) { resultSelections = false; registry.fill(HIST("hSelcosPaCascToOmegaKa_V0ToCasc"), 0); } else { diff --git a/PWGHF/TableProducer/candidateSelectorXicToXiPiPi.cxx b/PWGHF/TableProducer/candidateSelectorXicToXiPiPi.cxx index 50565fdce38..ea5aa8009fa 100644 --- a/PWGHF/TableProducer/candidateSelectorXicToXiPiPi.cxx +++ b/PWGHF/TableProducer/candidateSelectorXicToXiPiPi.cxx @@ -289,7 +289,7 @@ struct HfCandidateSelectorXicToXiPiPi { /// \param statusXicToXiPiPi Flag to store selection status as defined in hf_sel_candidate_xic::XicToXiPiPiSelectionStep /// \param isMatchedSignal Flag to indicate if the candidate is matched to a genereated XiCplus MC particle /// \return true if Xic candidate passes all selections, otherwise false - template + template bool isSelectedXicToXiPiPiCandidateWoMl(XicCandidate const& hfCandXic, TracksExtraWPid const&, int& statusXicToXiPiPi, @@ -297,7 +297,7 @@ struct HfCandidateSelectorXicToXiPiPi { { // Successful reconstruction SETBIT(statusXicToXiPiPi, hf_sel_candidate_xic::XicToXiPiPiSelectionStep::RecoTotal); // RecoTotal = 0 --> statusXicToXiPiPi += 1 - if constexpr (isMc) { + if constexpr (IsMc) { if (isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecSig"), All); } else { @@ -315,7 +315,7 @@ struct HfCandidateSelectorXicToXiPiPi { auto trackV0NegDau = hfCandXic.template negTrack_as(); if (fillQAHistograms) { - if constexpr (isMc) { + if constexpr (IsMc) { if (isMatchedSignal) { registry.fill(HIST("hEtaPi0FromXicRecSig"), trackPi0.eta()); registry.fill(HIST("hEtaPi1FromXicRecSig"), trackPi1.eta()); @@ -390,7 +390,7 @@ struct HfCandidateSelectorXicToXiPiPi { if (pTBin == -1) { return false; } - if constexpr (isMc) { + if constexpr (IsMc) { if (isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecSig"), Pt); } else { @@ -404,7 +404,7 @@ struct HfCandidateSelectorXicToXiPiPi { if (std::abs(hfCandXic.invMassXicPlus() - o2::constants::physics::MassXiCPlus) > cuts->get(pTBin, "m")) { return false; } - if constexpr (isMc) { + if constexpr (IsMc) { if (isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecSig"), Mass); } else { @@ -418,7 +418,7 @@ struct HfCandidateSelectorXicToXiPiPi { if (std::abs(hfCandXic.y(o2::constants::physics::MassXiCPlus)) > cuts->get(pTBin, "y")) { return false; } - if constexpr (isMc) { + if constexpr (IsMc) { if (isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecSig"), Rapidity); } else { @@ -432,7 +432,7 @@ struct HfCandidateSelectorXicToXiPiPi { if (std::abs(hfCandXic.eta()) > cuts->get(pTBin, "eta")) { return false; } - if constexpr (isMc) { + if constexpr (IsMc) { if (isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecSig"), Eta); } else { @@ -446,7 +446,7 @@ struct HfCandidateSelectorXicToXiPiPi { if (std::abs(trackPi0.eta()) > cuts->get(pTBin, "eta Pi from XicPlus") || std::abs(trackPi1.eta()) > cuts->get(pTBin, "eta Pi from XicPlus")) { return false; } - if constexpr (isMc) { + if constexpr (IsMc) { if (isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecSig"), EtaPionFromXicPlus); } else { @@ -460,7 +460,7 @@ struct HfCandidateSelectorXicToXiPiPi { if (std::abs(trackPiFromXi.eta()) > cuts->get(pTBin, "eta Xi Daughters") || std::abs(trackV0PosDau.eta()) > cuts->get(pTBin, "eta Xi Daughters") || std::abs(trackV0NegDau.eta()) > cuts->get(pTBin, "eta Xi Daughters")) { return false; } - if constexpr (isMc) { + if constexpr (IsMc) { if (isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecSig"), EtaXiDaughters); } else { @@ -474,7 +474,7 @@ struct HfCandidateSelectorXicToXiPiPi { if (hfCandXic.ptProng1() < cuts->get(pTBin, "pT Pi0") || hfCandXic.ptProng2() < cuts->get(pTBin, "pT Pi1") || (hfCandXic.ptProng1() + hfCandXic.ptProng2()) < cuts->get(pTBin, "pT Pi0 + Pi1")) { return false; } - if constexpr (isMc) { + if constexpr (IsMc) { if (isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecSig"), PtPionFromXicPlus); } else { @@ -488,7 +488,7 @@ struct HfCandidateSelectorXicToXiPiPi { if (hfCandXic.chi2PCA() > cuts->get(pTBin, "chi2SV")) { return false; } - if constexpr (isMc) { + if constexpr (IsMc) { if (isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecSig"), Chi2SV); } else { @@ -502,7 +502,7 @@ struct HfCandidateSelectorXicToXiPiPi { if (hfCandXic.decayLength() < cuts->get(pTBin, "min decay length") || hfCandXic.decayLengthXY() < cuts->get(pTBin, "min decay length XY")) { return false; } - if constexpr (isMc) { + if constexpr (IsMc) { if (isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecSig"), MinDecayLength); } else { @@ -516,7 +516,7 @@ struct HfCandidateSelectorXicToXiPiPi { if (hfCandXic.invMassXiPi0() > cuts->get(pTBin, "max inv mass Xi-Pi0") || hfCandXic.invMassXiPi1() > cuts->get(pTBin, "max inv mass Xi-Pi1")) { return false; } - if constexpr (isMc) { + if constexpr (IsMc) { if (isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecSig"), MaxInvMassXiPiPairs); } else { @@ -539,7 +539,7 @@ struct HfCandidateSelectorXicToXiPiPi { !isSelectedTrackTpcQuality(trackV0NegDau, nClustersTpcMin, nTpcCrossedRowsMin, tpcCrossedRowsOverFindableClustersRatioMin, tpcChi2PerClusterMax)) { return false; } - if constexpr (isMc) { + if constexpr (IsMc) { if (isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecSig"), TpcTrackQualityXiDaughters); } else { @@ -554,7 +554,7 @@ struct HfCandidateSelectorXicToXiPiPi { !isSelectedTrackTpcQuality(trackPi1, nClustersTpcMin, nTpcCrossedRowsMin, tpcCrossedRowsOverFindableClustersRatioMin, tpcChi2PerClusterMax)) { return false; } - if constexpr (isMc) { + if constexpr (IsMc) { if (isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecSig"), TpcTrackQualityPiFromCharm); } else { @@ -569,7 +569,7 @@ struct HfCandidateSelectorXicToXiPiPi { (!isSelectedTrackItsQuality(trackPi0, nClustersItsMin, itsChi2PerClusterMax) || trackPi1.itsNClsInnerBarrel() < nClustersItsInnBarrMin)) { return false; } - if constexpr (isMc) { + if constexpr (IsMc) { if (isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecSig"), ItsTrackQualityPiFromCharm); } else { @@ -582,7 +582,7 @@ struct HfCandidateSelectorXicToXiPiPi { // Successful track quality selection SETBIT(statusXicToXiPiPi, hf_sel_candidate_xic::XicToXiPiPiSelectionStep::RecoTrackQuality); // RecoTrackQuality = 2 --> statusXicToXiPiPi += 4 } else { - if constexpr (isMc) { + if constexpr (IsMc) { if (isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecSig"), TpcTrackQualityXiDaughters); registry.fill(HIST("hSelCandidatesRecSig"), TpcTrackQualityPiFromCharm); @@ -637,7 +637,7 @@ struct HfCandidateSelectorXicToXiPiPi { // Successful PID selection SETBIT(statusXicToXiPiPi, hf_sel_candidate_xic::XicToXiPiPiSelectionStep::RecoPID); // RecoPID = 3 --> statusXicToXiPiPi += 8 - if constexpr (isMc) { + if constexpr (IsMc) { if (isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecSig"), PidSelected); } else { @@ -647,7 +647,7 @@ struct HfCandidateSelectorXicToXiPiPi { registry.fill(HIST("hSelCandidates"), PidSelected); } } else { - if constexpr (isMc) { + if constexpr (IsMc) { if (isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecSig"), PidSelected); } else { @@ -665,7 +665,7 @@ struct HfCandidateSelectorXicToXiPiPi { /// \param hfCandXic Xic candidate /// \param statusXicToXiPiPi Flag to store selection status as defined in hf_sel_candidate_xic::XicToXiPiPiSelectionStep /// \param isMatchedSignal Flag to indicate if the candidate is matched to a genereated XiCplus MC particle - template + template void isBdtSelected(XicCandidate const& hfCandXic, int& statusXicToXiPiPi, bool const isMatchedSignal = false) @@ -684,7 +684,7 @@ struct HfCandidateSelectorXicToXiPiPi { // Successful ML selection SETBIT(statusXicToXiPiPi, hf_sel_candidate_xic::XicToXiPiPiSelectionStep::RecoMl); // RecoML = 4 --> statusXicToXiPiPi += 16 - if constexpr (isMc) { + if constexpr (IsMc) { if (isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecSig"), BdtSelected); } else { diff --git a/PWGHF/TableProducer/derivedDataCreatorB0ToDPi.cxx b/PWGHF/TableProducer/derivedDataCreatorB0ToDPi.cxx index 53a1c31e8c7..960dbc272a4 100644 --- a/PWGHF/TableProducer/derivedDataCreatorB0ToDPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorB0ToDPi.cxx @@ -236,7 +236,7 @@ struct HfDerivedDataCreatorB0ToDPi { } } - template + template void processCandidates(CollType const& collisions, Partition& candidates, CandCharmType const&, @@ -244,7 +244,7 @@ struct HfDerivedDataCreatorB0ToDPi { aod::BCs const&) { // Fill collision properties - if constexpr (isMc) { + if constexpr (IsMc) { if (confDerData.fillMcRCollId) { rowsCommon.matchedCollisions.clear(); } @@ -258,7 +258,7 @@ struct HfDerivedDataCreatorB0ToDPi { LOGF(debug, "Rec. collision %d has %d candidates", thisCollId, sizeTableCand); // Skip collisions without HF candidates (and without HF particles in matched MC collisions if saving indices of reconstructed collisions matched to MC collisions) bool mcCollisionHasMcParticles{false}; - if constexpr (isMc) { + if constexpr (IsMc) { mcCollisionHasMcParticles = confDerData.fillMcRCollId && collision.has_mcCollision() && rowsCommon.hasMcParticles[collision.mcCollisionId()]; LOGF(debug, "Rec. collision %d has MC collision %d with MC particles? %s", thisCollId, collision.mcCollisionId(), mcCollisionHasMcParticles ? "yes" : "no"); } @@ -267,7 +267,7 @@ struct HfDerivedDataCreatorB0ToDPi { continue; } LOGF(debug, "Filling rec. collision %d at derived index %d", thisCollId, rowsCommon.rowCollBase.lastIndex() + 1); - rowsCommon.fillTablesCollision(collision); + rowsCommon.fillTablesCollision(collision); // Fill candidate properties rowsCommon.reserveTablesCandidates(sizeTableCand); @@ -278,20 +278,20 @@ struct HfDerivedDataCreatorB0ToDPi { reserveTable(rowCandidateMl, fillCandidateMl, sizeTableCand); reserveTable(rowCandidateMlDplus, fillCandidateMlDplus, sizeTableCand); reserveTable(rowCandidateId, fillCandidateId, sizeTableCand); - if constexpr (isMc) { + if constexpr (IsMc) { reserveTable(rowCandidateMc, fillCandidateMc, sizeTableCand); } int8_t flagMcRec = 0, origin = 0; for (const auto& candidate : candidatesThisColl) { - if constexpr (isMl) { + if constexpr (IsMl) { if (!TESTBIT(candidate.isSelB0ToDPi(), aod::SelectionStep::RecoMl)) { continue; } } - if constexpr (isMc) { + if constexpr (IsMc) { flagMcRec = candidate.flagMcMatchRec(); origin = candidate.originMcRec(); - if constexpr (onlyBkg) { + if constexpr (OnlyBkg) { if (std::abs(flagMcRec) == DecayChannelMain::B0ToDminusPi) { continue; } @@ -302,7 +302,7 @@ struct HfDerivedDataCreatorB0ToDPi { } } } - if constexpr (onlySig) { + if constexpr (OnlySig) { if (std::abs(flagMcRec) != DecayChannelMain::B0ToDminusPi) { continue; } @@ -316,7 +316,7 @@ struct HfDerivedDataCreatorB0ToDPi { float mlScoreB0ToDPi{-1.f}; std::vector mlScoresDplus; std::copy(prongCharm.mlProbDplusToPiKPi().begin(), prongCharm.mlProbDplusToPiKPi().end(), std::back_inserter(mlScoresDplus)); - if constexpr (isMl) { + if constexpr (IsMl) { mlScoreB0ToDPi = candidate.mlProbB0ToDPi(); } fillTablesCandidate(candidate, prongCharm, prongBachelor, 0, massB0ToDPi, ct, y, flagMcRec, origin, mlScoreB0ToDPi, mlScoresDplus); diff --git a/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx b/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx index da07e1abfad..b05bb4f967d 100644 --- a/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx @@ -239,7 +239,7 @@ struct HfDerivedDataCreatorBplusToD0Pi { } } - template + template void processCandidates(CollType const& collisions, Partition& candidates, CandCharmType const&, @@ -247,7 +247,7 @@ struct HfDerivedDataCreatorBplusToD0Pi { aod::BCs const&) { // Fill collision properties - if constexpr (isMc) { + if constexpr (IsMc) { if (confDerData.fillMcRCollId) { rowsCommon.matchedCollisions.clear(); } @@ -261,7 +261,7 @@ struct HfDerivedDataCreatorBplusToD0Pi { LOGF(debug, "Rec. collision %d has %d candidates", thisCollId, sizeTableCand); // Skip collisions without HF candidates (and without HF particles in matched MC collisions if saving indices of reconstructed collisions matched to MC collisions) bool mcCollisionHasMcParticles{false}; - if constexpr (isMc) { + if constexpr (IsMc) { mcCollisionHasMcParticles = confDerData.fillMcRCollId && collision.has_mcCollision() && rowsCommon.hasMcParticles[collision.mcCollisionId()]; LOGF(debug, "Rec. collision %d has MC collision %d with MC particles? %s", thisCollId, collision.mcCollisionId(), mcCollisionHasMcParticles ? "yes" : "no"); } @@ -270,7 +270,7 @@ struct HfDerivedDataCreatorBplusToD0Pi { continue; } LOGF(debug, "Filling rec. collision %d at derived index %d", thisCollId, rowsCommon.rowCollBase.lastIndex() + 1); - rowsCommon.fillTablesCollision(collision); + rowsCommon.fillTablesCollision(collision); // Fill candidate properties rowsCommon.reserveTablesCandidates(sizeTableCand); @@ -281,20 +281,20 @@ struct HfDerivedDataCreatorBplusToD0Pi { reserveTable(rowCandidateMl, fillCandidateMl, sizeTableCand); reserveTable(rowCandidateMlD0, fillCandidateMlD0, sizeTableCand); reserveTable(rowCandidateId, fillCandidateId, sizeTableCand); - if constexpr (isMc) { + if constexpr (IsMc) { reserveTable(rowCandidateMc, fillCandidateMc, sizeTableCand); } int8_t flagMcRec = 0, origin = 0; for (const auto& candidate : candidatesThisColl) { - if constexpr (isMl) { + if constexpr (IsMl) { if (!TESTBIT(candidate.isSelBplusToD0Pi(), aod::SelectionStep::RecoMl)) { continue; } } - if constexpr (isMc) { + if constexpr (IsMc) { flagMcRec = candidate.flagMcMatchRec(); origin = candidate.originMcRec(); - if constexpr (onlyBkg) { + if constexpr (OnlyBkg) { if (std::abs(flagMcRec) == DecayChannelMain::BplusToD0Pi) { continue; } @@ -305,7 +305,7 @@ struct HfDerivedDataCreatorBplusToD0Pi { } } } - if constexpr (onlySig) { + if constexpr (OnlySig) { if (std::abs(flagMcRec) != DecayChannelMain::BplusToD0Pi) { continue; } @@ -324,7 +324,7 @@ struct HfDerivedDataCreatorBplusToD0Pi { } else { // is D0bar std::copy(prongCharm.mlProbD0bar().begin(), prongCharm.mlProbD0bar().end(), std::back_inserter(mlScoresD0)); } - if constexpr (isMl) { + if constexpr (IsMl) { mlScoreBplusToD0Pi = candidate.mlProbBplusToD0Pi(); } // flag = 0 for D0 pi-, flag = 1 for D0bar pi+ diff --git a/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx index d1d803d5361..d80e75330ce 100644 --- a/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx @@ -237,14 +237,14 @@ struct HfDerivedDataCreatorD0ToKPi { } } - template + template void processCandidates(CollType const& collisions, Partition& candidates, aod::Tracks const&, aod::BCs const&) { // Fill collision properties - if constexpr (isMc) { + if constexpr (IsMc) { if (confDerData.fillMcRCollId) { rowsCommon.matchedCollisions.clear(); } @@ -258,7 +258,7 @@ struct HfDerivedDataCreatorD0ToKPi { LOGF(debug, "Rec. collision %d has %d candidates", thisCollId, sizeTableCand); // Skip collisions without HF candidates (and without HF particles in matched MC collisions if saving indices of reconstructed collisions matched to MC collisions) bool mcCollisionHasMcParticles{false}; - if constexpr (isMc) { + if constexpr (IsMc) { mcCollisionHasMcParticles = confDerData.fillMcRCollId && collision.has_mcCollision() && rowsCommon.hasMcParticles[collision.mcCollisionId()]; LOGF(debug, "Rec. collision %d has MC collision %d with MC particles? %s", thisCollId, collision.mcCollisionId(), mcCollisionHasMcParticles ? "yes" : "no"); } @@ -267,7 +267,7 @@ struct HfDerivedDataCreatorD0ToKPi { continue; } LOGF(debug, "Filling rec. collision %d at derived index %d", thisCollId, rowsCommon.rowCollBase.lastIndex() + 1); - rowsCommon.fillTablesCollision(collision); + rowsCommon.fillTablesCollision(collision); // Fill candidate properties rowsCommon.reserveTablesCandidates(sizeTableCand); @@ -276,15 +276,15 @@ struct HfDerivedDataCreatorD0ToKPi { reserveTable(rowCandidateSel, fillCandidateSel, sizeTableCand); reserveTable(rowCandidateMl, fillCandidateMl, sizeTableCand); reserveTable(rowCandidateId, fillCandidateId, sizeTableCand); - if constexpr (isMc) { + if constexpr (IsMc) { reserveTable(rowCandidateMc, fillCandidateMc, sizeTableCand); } int8_t flagMcRec = 0, origin = 0; for (const auto& candidate : candidatesThisColl) { - if constexpr (isMc) { + if constexpr (IsMc) { flagMcRec = candidate.flagMcMatchRec(); origin = candidate.originMcRec(); - if constexpr (onlyBkg) { + if constexpr (OnlyBkg) { if (std::abs(flagMcRec) == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { continue; } @@ -295,7 +295,7 @@ struct HfDerivedDataCreatorD0ToKPi { } } } - if constexpr (onlySig) { + if constexpr (OnlySig) { if (std::abs(flagMcRec) != o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { continue; } @@ -313,7 +313,7 @@ struct HfDerivedDataCreatorD0ToKPi { double y = hfHelper.yD0(candidate); float massD0, massD0bar; float topolChi2PerNdf = -999.; - if constexpr (reconstructionType == aod::hf_cand::VertexerType::KfParticle) { + if constexpr (ReconstructionType == aod::hf_cand::VertexerType::KfParticle) { massD0 = candidate.kfGeoMassD0(); massD0bar = candidate.kfGeoMassD0bar(); topolChi2PerNdf = candidate.kfTopolChi2OverNdf(); @@ -322,7 +322,7 @@ struct HfDerivedDataCreatorD0ToKPi { massD0bar = hfHelper.invMassD0barToKPi(candidate); } std::vector mlScoresD0, mlScoresD0bar; - if constexpr (isMl) { + if constexpr (IsMl) { std::copy(candidate.mlProbD0().begin(), candidate.mlProbD0().end(), std::back_inserter(mlScoresD0)); std::copy(candidate.mlProbD0bar().begin(), candidate.mlProbD0bar().end(), std::back_inserter(mlScoresD0bar)); } diff --git a/PWGHF/TableProducer/derivedDataCreatorDplusToPiKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorDplusToPiKPi.cxx index e1b06568c49..c71f1966ed4 100644 --- a/PWGHF/TableProducer/derivedDataCreatorDplusToPiKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorDplusToPiKPi.cxx @@ -211,14 +211,14 @@ struct HfDerivedDataCreatorDplusToPiKPi { } } - template + template void processCandidates(CollType const& collisions, Partition& candidates, TracksWPid const&, aod::BCs const&) { // Fill collision properties - if constexpr (isMc) { + if constexpr (IsMc) { if (confDerData.fillMcRCollId) { rowsCommon.matchedCollisions.clear(); } @@ -232,7 +232,7 @@ struct HfDerivedDataCreatorDplusToPiKPi { LOGF(debug, "Rec. collision %d has %d candidates", thisCollId, sizeTableCand); // Skip collisions without HF candidates (and without HF particles in matched MC collisions if saving indices of reconstructed collisions matched to MC collisions) bool mcCollisionHasMcParticles{false}; - if constexpr (isMc) { + if constexpr (IsMc) { mcCollisionHasMcParticles = confDerData.fillMcRCollId && collision.has_mcCollision() && rowsCommon.hasMcParticles[collision.mcCollisionId()]; LOGF(debug, "Rec. collision %d has MC collision %d with MC particles? %s", thisCollId, collision.mcCollisionId(), mcCollisionHasMcParticles ? "yes" : "no"); } @@ -241,7 +241,7 @@ struct HfDerivedDataCreatorDplusToPiKPi { continue; } LOGF(debug, "Filling rec. collision %d at derived index %d", thisCollId, rowsCommon.rowCollBase.lastIndex() + 1); - rowsCommon.fillTablesCollision(collision); + rowsCommon.fillTablesCollision(collision); // Fill candidate properties rowsCommon.reserveTablesCandidates(sizeTableCand); @@ -250,22 +250,22 @@ struct HfDerivedDataCreatorDplusToPiKPi { reserveTable(rowCandidateSel, fillCandidateSel, sizeTableCand); reserveTable(rowCandidateMl, fillCandidateMl, sizeTableCand); reserveTable(rowCandidateId, fillCandidateId, sizeTableCand); - if constexpr (isMc) { + if constexpr (IsMc) { reserveTable(rowCandidateMc, fillCandidateMc, sizeTableCand); } int8_t flagMcRec = 0, origin = 0, swapping = 0, flagDecayChanRec = 0; for (const auto& candidate : candidatesThisColl) { - if constexpr (isMl) { + if constexpr (IsMl) { if (!TESTBIT(candidate.isSelDplusToPiKPi(), aod::SelectionStep::RecoMl)) { continue; } } - if constexpr (isMc) { + if constexpr (IsMc) { flagMcRec = candidate.flagMcMatchRec(); origin = candidate.originMcRec(); swapping = candidate.isCandidateSwapped(); flagDecayChanRec = candidate.flagMcDecayChanRec(); - if constexpr (onlyBkg) { + if constexpr (OnlyBkg) { if (std::abs(flagMcRec) == hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi) { continue; } @@ -276,7 +276,7 @@ struct HfDerivedDataCreatorDplusToPiKPi { } } } - if constexpr (onlySig) { + if constexpr (OnlySig) { if (std::abs(flagMcRec) != hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi) { continue; } @@ -286,7 +286,7 @@ struct HfDerivedDataCreatorDplusToPiKPi { double y = hfHelper.yDplus(candidate); float massDplusToPiKPi = hfHelper.invMassDplusToPiKPi(candidate); std::vector mlScoresDplusToPiKPi; - if constexpr (isMl) { + if constexpr (IsMl) { std::copy(candidate.mlProbDplusToPiKPi().begin(), candidate.mlProbDplusToPiKPi().end(), std::back_inserter(mlScoresDplusToPiKPi)); } fillTablesCandidate(candidate, 0, massDplusToPiKPi, ct, y, flagMcRec, origin, swapping, flagDecayChanRec, mlScoresDplusToPiKPi); diff --git a/PWGHF/TableProducer/derivedDataCreatorDsToKKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorDsToKKPi.cxx index 1dfe94c9d62..7a8a4e9cd12 100644 --- a/PWGHF/TableProducer/derivedDataCreatorDsToKKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorDsToKKPi.cxx @@ -217,14 +217,14 @@ struct HfDerivedDataCreatorDsToKKPi { } } - template + template void processCandidates(CollType const& collisions, Partition& candidates, TracksWPid const&, aod::BCs const&) { // Fill collision properties - if constexpr (isMc) { + if constexpr (IsMc) { if (confDerData.fillMcRCollId) { rowsCommon.matchedCollisions.clear(); } @@ -238,7 +238,7 @@ struct HfDerivedDataCreatorDsToKKPi { LOGF(debug, "Rec. collision %d has %d candidates", thisCollId, sizeTableCand); // Skip collisions without HF candidates (and without HF particles in matched MC collisions if saving indices of reconstructed collisions matched to MC collisions) bool mcCollisionHasMcParticles{false}; - if constexpr (isMc) { + if constexpr (IsMc) { mcCollisionHasMcParticles = confDerData.fillMcRCollId && collision.has_mcCollision() && rowsCommon.hasMcParticles[collision.mcCollisionId()]; LOGF(debug, "Rec. collision %d has MC collision %d with MC particles? %s", thisCollId, collision.mcCollisionId(), mcCollisionHasMcParticles ? "yes" : "no"); } @@ -247,7 +247,7 @@ struct HfDerivedDataCreatorDsToKKPi { continue; } LOGF(debug, "Filling rec. collision %d at derived index %d", thisCollId, rowsCommon.rowCollBase.lastIndex() + 1); - rowsCommon.fillTablesCollision(collision); + rowsCommon.fillTablesCollision(collision); // Fill candidate properties rowsCommon.reserveTablesCandidates(sizeTableCand); @@ -256,22 +256,22 @@ struct HfDerivedDataCreatorDsToKKPi { reserveTable(rowCandidateSel, fillCandidateSel, sizeTableCand); reserveTable(rowCandidateMl, fillCandidateMl, sizeTableCand); reserveTable(rowCandidateId, fillCandidateId, sizeTableCand); - if constexpr (isMc) { + if constexpr (IsMc) { reserveTable(rowCandidateMc, fillCandidateMc, sizeTableCand); } int8_t flagMcRec = 0, origin = 0, swapping = 0, flagDecayChanRec = 0; for (const auto& candidate : candidatesThisColl) { - if constexpr (isMl) { + if constexpr (IsMl) { if (!TESTBIT(candidate.isSelDsToKKPi(), aod::SelectionStep::RecoMl)) { continue; } } - if constexpr (isMc) { + if constexpr (IsMc) { flagMcRec = candidate.flagMcMatchRec(); origin = candidate.originMcRec(); swapping = candidate.isCandidateSwapped(); flagDecayChanRec = candidate.flagMcDecayChanRec(); - if constexpr (onlyBkg) { + if constexpr (OnlyBkg) { if (std::abs(flagMcRec) == hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK) { continue; } @@ -282,7 +282,7 @@ struct HfDerivedDataCreatorDsToKKPi { } } } - if constexpr (onlySig) { + if constexpr (OnlySig) { if (std::abs(flagMcRec) != hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK) { continue; } @@ -292,7 +292,7 @@ struct HfDerivedDataCreatorDsToKKPi { double y = hfHelper.yDs(candidate); float massDsToKKPi = hfHelper.invMassDsToKKPi(candidate); std::vector mlScoresDsToKKPi; - if constexpr (isMl) { + if constexpr (IsMl) { std::copy(candidate.mlProbDsToKKPi().begin(), candidate.mlProbDsToKKPi().end(), std::back_inserter(mlScoresDsToKKPi)); } fillTablesCandidate(candidate, 0, massDsToKKPi, ct, y, flagMcRec, origin, swapping, flagDecayChanRec, mlScoresDsToKKPi); diff --git a/PWGHF/TableProducer/derivedDataCreatorDstarToD0Pi.cxx b/PWGHF/TableProducer/derivedDataCreatorDstarToD0Pi.cxx index f1b14a5769f..3374904bf91 100644 --- a/PWGHF/TableProducer/derivedDataCreatorDstarToD0Pi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorDstarToD0Pi.cxx @@ -204,14 +204,14 @@ struct HfDerivedDataCreatorDstarToD0Pi { } } - template + template void processCandidates(CollType const& collisions, Partition& candidates, TracksWPid const&, aod::BCs const&) { // Fill collision properties - if constexpr (isMc) { + if constexpr (IsMc) { if (confDerData.fillMcRCollId) { rowsCommon.matchedCollisions.clear(); } @@ -225,7 +225,7 @@ struct HfDerivedDataCreatorDstarToD0Pi { LOGF(debug, "Rec. collision %d has %d candidates", thisCollId, sizeTableCand); // Skip collisions without HF candidates (and without HF particles in matched MC collisions if saving indices of reconstructed collisions matched to MC collisions) bool mcCollisionHasMcParticles{false}; - if constexpr (isMc) { + if constexpr (IsMc) { mcCollisionHasMcParticles = confDerData.fillMcRCollId && collision.has_mcCollision() && rowsCommon.hasMcParticles[collision.mcCollisionId()]; LOGF(debug, "Rec. collision %d has MC collision %d with MC particles? %s", thisCollId, collision.mcCollisionId(), mcCollisionHasMcParticles ? "yes" : "no"); } @@ -234,7 +234,7 @@ struct HfDerivedDataCreatorDstarToD0Pi { continue; } LOGF(debug, "Filling rec. collision %d at derived index %d", thisCollId, rowsCommon.rowCollBase.lastIndex() + 1); - rowsCommon.fillTablesCollision(collision); + rowsCommon.fillTablesCollision(collision); // Fill candidate properties rowsCommon.reserveTablesCandidates(sizeTableCand); @@ -243,26 +243,26 @@ struct HfDerivedDataCreatorDstarToD0Pi { reserveTable(rowCandidateSel, fillCandidateSel, sizeTableCand); reserveTable(rowCandidateMl, fillCandidateMl, sizeTableCand); reserveTable(rowCandidateId, fillCandidateId, sizeTableCand); - if constexpr (isMc) { + if constexpr (IsMc) { reserveTable(rowCandidateMc, fillCandidateMc, sizeTableCand); } int8_t flagMcRec = 0, flagMcRecD0 = 0, origin = 0, nTracksDecayed = 0; double ptBhadMotherPart = 0; int pdgBhadMotherPart = 0; for (const auto& candidate : candidatesThisColl) { - if constexpr (isMl) { + if constexpr (IsMl) { if (!TESTBIT(candidate.isSelDstarToD0Pi(), aod::SelectionStep::RecoMl)) { continue; } } - if constexpr (isMc) { + if constexpr (IsMc) { flagMcRec = candidate.flagMcMatchRec(); flagMcRecD0 = candidate.flagMcMatchRecD0(); origin = candidate.originMcRec(); nTracksDecayed = candidate.nTracksDecayed(); ptBhadMotherPart = candidate.ptBhadMotherPart(); pdgBhadMotherPart = candidate.pdgBhadMotherPart(); - if constexpr (onlyBkg) { + if constexpr (OnlyBkg) { if (std::abs(flagMcRec) == hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi) { continue; } @@ -273,7 +273,7 @@ struct HfDerivedDataCreatorDstarToD0Pi { } } } - if constexpr (onlySig) { + if constexpr (OnlySig) { if (std::abs(flagMcRec) != hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi) { continue; } @@ -286,7 +286,7 @@ struct HfDerivedDataCreatorDstarToD0Pi { int flagSign = -1; double massDstar = 0, invMassD0 = 0; std::vector mlScoresDstarToD0Pi; - if constexpr (isMl) { + if constexpr (IsMl) { std::copy(candidate.mlProbDstarToD0Pi().begin(), candidate.mlProbDstarToD0Pi().end(), std::back_inserter(mlScoresDstarToD0Pi)); } if (candidate.signSoftPi() > 0) { diff --git a/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx index 96835cdefe5..2576f072622 100644 --- a/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx @@ -216,14 +216,14 @@ struct HfDerivedDataCreatorLcToPKPi { } } - template + template void processCandidates(CollType const& collisions, Partition& candidates, TracksWPid const&, aod::BCs const&) { // Fill collision properties - if constexpr (isMc) { + if constexpr (IsMc) { if (confDerData.fillMcRCollId) { rowsCommon.matchedCollisions.clear(); } @@ -237,7 +237,7 @@ struct HfDerivedDataCreatorLcToPKPi { LOGF(debug, "Rec. collision %d has %d candidates", thisCollId, sizeTableCand); // Skip collisions without HF candidates (and without HF particles in matched MC collisions if saving indices of reconstructed collisions matched to MC collisions) bool mcCollisionHasMcParticles{false}; - if constexpr (isMc) { + if constexpr (IsMc) { mcCollisionHasMcParticles = confDerData.fillMcRCollId && collision.has_mcCollision() && rowsCommon.hasMcParticles[collision.mcCollisionId()]; LOGF(debug, "Rec. collision %d has MC collision %d with MC particles? %s", thisCollId, collision.mcCollisionId(), mcCollisionHasMcParticles ? "yes" : "no"); } @@ -246,7 +246,7 @@ struct HfDerivedDataCreatorLcToPKPi { continue; } LOGF(debug, "Filling rec. collision %d at derived index %d", thisCollId, rowsCommon.rowCollBase.lastIndex() + 1); - rowsCommon.fillTablesCollision(collision); + rowsCommon.fillTablesCollision(collision); // Fill candidate properties rowsCommon.reserveTablesCandidates(sizeTableCand); @@ -255,16 +255,16 @@ struct HfDerivedDataCreatorLcToPKPi { reserveTable(rowCandidateSel, fillCandidateSel, sizeTableCand); reserveTable(rowCandidateMl, fillCandidateMl, sizeTableCand); reserveTable(rowCandidateId, fillCandidateId, sizeTableCand); - if constexpr (isMc) { + if constexpr (IsMc) { reserveTable(rowCandidateMc, fillCandidateMc, sizeTableCand); } int8_t flagMcRec = 0, origin = 0, swapping = 0; for (const auto& candidate : candidatesThisColl) { - if constexpr (isMc) { + if constexpr (IsMc) { flagMcRec = candidate.flagMcMatchRec(); origin = candidate.originMcRec(); swapping = candidate.isCandidateSwapped(); - if constexpr (onlyBkg) { + if constexpr (OnlyBkg) { if (std::abs(flagMcRec) == hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) { continue; } @@ -275,7 +275,7 @@ struct HfDerivedDataCreatorLcToPKPi { } } } - if constexpr (onlySig) { + if constexpr (OnlySig) { if (std::abs(flagMcRec) != hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) { continue; } @@ -293,7 +293,7 @@ struct HfDerivedDataCreatorLcToPKPi { float massLcToPKPi = hfHelper.invMassLcToPKPi(candidate); float massLcToPiKP = hfHelper.invMassLcToPiKP(candidate); std::vector mlScoresLcToPKPi, mlScoresLcToPiKP; - if constexpr (isMl) { + if constexpr (IsMl) { std::copy(candidate.mlProbLcToPKPi().begin(), candidate.mlProbLcToPKPi().end(), std::back_inserter(mlScoresLcToPKPi)); std::copy(candidate.mlProbLcToPiKP().begin(), candidate.mlProbLcToPiKP().end(), std::back_inserter(mlScoresLcToPiKP)); } diff --git a/PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx b/PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx index 92af9a89c53..a6ef21c011e 100644 --- a/PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx @@ -215,14 +215,14 @@ struct HfDerivedDataCreatorXicToXiPiPi { } } - template + template void processCandidates(CollType const& collisions, Partition& candidates, TracksWPid const&, aod::BCs const&) { // Fill collision properties - if constexpr (isMc) { + if constexpr (IsMc) { if (confDerData.fillMcRCollId) { rowsCommon.matchedCollisions.clear(); } @@ -236,7 +236,7 @@ struct HfDerivedDataCreatorXicToXiPiPi { LOGF(debug, "Rec. collision %d has %d candidates", thisCollId, sizeTableCand); // Skip collisions without HF candidates (and without HF particles in matched MC collisions if saving indices of reconstructed collisions matched to MC collisions) bool mcCollisionHasMcParticles{false}; - if constexpr (isMc) { + if constexpr (IsMc) { mcCollisionHasMcParticles = confDerData.fillMcRCollId && collision.has_mcCollision() && rowsCommon.hasMcParticles[collision.mcCollisionId()]; LOGF(debug, "Rec. collision %d has MC collision %d with MC particles? %s", thisCollId, collision.mcCollisionId(), mcCollisionHasMcParticles ? "yes" : "no"); } @@ -245,7 +245,7 @@ struct HfDerivedDataCreatorXicToXiPiPi { continue; } LOGF(debug, "Filling rec. collision %d at derived index %d", thisCollId, rowsCommon.rowCollBase.lastIndex() + 1); - rowsCommon.fillTablesCollision(collision); + rowsCommon.fillTablesCollision(collision); // Fill candidate properties rowsCommon.reserveTablesCandidates(sizeTableCand); @@ -254,20 +254,20 @@ struct HfDerivedDataCreatorXicToXiPiPi { reserveTable(rowCandidateSel, fillCandidateSel, sizeTableCand); reserveTable(rowCandidateMl, fillCandidateMl, sizeTableCand); reserveTable(rowCandidateId, fillCandidateId, sizeTableCand); - if constexpr (isMc) { + if constexpr (IsMc) { reserveTable(rowCandidateMc, fillCandidateMc, sizeTableCand); } int8_t flagMcRec = 0, origin = 0; for (const auto& candidate : candidatesThisColl) { - if constexpr (isMl) { + if constexpr (IsMl) { if (!TESTBIT(candidate.isSelXicToXiPiPi(), o2::aod::hf_sel_candidate_xic::XicToXiPiPiSelectionStep::RecoMl)) { continue; } } - if constexpr (isMc) { + if constexpr (IsMc) { flagMcRec = candidate.flagMcMatchRec(); origin = candidate.originMcRec(); - if constexpr (onlyBkg) { + if constexpr (OnlyBkg) { if (TESTBIT(std::abs(flagMcRec), DecayType::XicToXiPiPi)) { continue; } @@ -278,7 +278,7 @@ struct HfDerivedDataCreatorXicToXiPiPi { } } } - if constexpr (onlySig) { + if constexpr (OnlySig) { if (!TESTBIT(std::abs(flagMcRec), DecayType::XicToXiPiPi)) { continue; } @@ -288,7 +288,7 @@ struct HfDerivedDataCreatorXicToXiPiPi { double ct = hfHelper.ctXic(candidate); double y = hfHelper.yXic(candidate); std::vector mlScoresXicToXiPiPi; - if constexpr (isMl) { + if constexpr (IsMl) { std::copy(candidate.mlProbXicToXiPiPi().begin(), candidate.mlProbXicToXiPiPi().end(), std::back_inserter(mlScoresXicToXiPiPi)); } // FIXME: Remove candFlag? diff --git a/PWGHF/TableProducer/mcPidTof.cxx b/PWGHF/TableProducer/mcPidTof.cxx index ddff5d8c00e..e614b3bc406 100644 --- a/PWGHF/TableProducer/mcPidTof.cxx +++ b/PWGHF/TableProducer/mcPidTof.cxx @@ -339,7 +339,7 @@ bool isTrackGoodMatchForTOFPID(const Trks::iterator& tr) } /// Task to produce the TOF signal from the trackTime information -struct tofSignal { +struct TofSignal { // Tables to produce o2::framework::Produces table; o2::framework::Produces tableFlags; @@ -431,8 +431,8 @@ struct tofSignal { /// Selection criteria for tracks used for TOF event time float trackSampleMinMomentum = 0.5f; float trackSampleMaxMomentum = 2.f; -template -bool filterForTOFEventTime(const trackType& tr) +template +bool filterForTOFEventTime(const TrackType& tr) { return (tr.hasTOF() && tr.p() > trackSampleMinMomentum && tr.p() < trackSampleMaxMomentum && @@ -442,30 +442,30 @@ bool filterForTOFEventTime(const trackType& tr) } // accept all /// Specialization of TOF event time maker -template typename response, - typename trackTypeContainer, - typename responseParametersType> -o2::tof::eventTimeContainer evTimeMakerForTracks(const trackTypeContainer& tracks, - const responseParametersType& responseParameters, +template typename Response, + typename TrackTypeContainer, + typename ResponseParametersType> +o2::tof::eventTimeContainer evTimeMakerForTracks(const TrackTypeContainer& tracks, + const ResponseParametersType& responseParameters, const float& diamond = 6.0) { - return o2::tof::evTimeMakerFromParam(tracks, responseParameters, diamond); + return o2::tof::evTimeMakerFromParam(tracks, responseParameters, diamond); } // Part 2 event time definition /// Task to produce the TOF event time table -struct tofEventTime { +struct TofEventTime { // Tables to produce Produces tableEvTime; Produces tableEvTimeTOFOnly; Produces tableFlags; - static constexpr bool removeTOFEvTimeBias = true; // Flag to subtract the Ev. Time bias for low multiplicity events with TOF - static constexpr float diamond = 6.0; // Collision diamond used in the estimation of the TOF event time - static constexpr float errDiamond = diamond * 33.356409f; - static constexpr float weightDiamond = 1.f / (errDiamond * errDiamond); + static constexpr bool RemoveTofEvTimeBias = true; // Flag to subtract the Ev. Time bias for low multiplicity events with TOF + static constexpr float Diamond = 6.0; // Collision diamond used in the estimation of the TOF event time + static constexpr float ErrDiamond = Diamond * 33.356409f; + static constexpr float WeightDiamond = 1.f / (ErrDiamond * ErrDiamond); bool enableTableTOFEvTime = false; bool enableTableEvTimeTOFOnly = false; @@ -527,8 +527,8 @@ struct tofEventTime { /// Process function to prepare the event for each track on Run 3 data without the FT0 // Define slice per collision Preslice perCollision = aod::track::collisionId; - template - using ResponseImplementationEvTime = o2::pid::tof::ExpTimes; + template + using ResponseImplementationEvTime = o2::pid::tof::ExpTimes; void process(TrksWtof const& tracks, aod::FT0s const&, EvTimeCollisionsFT0 const&, @@ -586,7 +586,7 @@ struct tofEventTime { const auto& collision = t.collision_as(); // Compute the TOF event time - const auto evTimeMakerTOF = evTimeMakerForTracks(tracksInCollision, mRespParamsV3, diamond); + const auto evTimeMakerTOF = evTimeMakerForTracks(tracksInCollision, mRespParamsV3, Diamond); float t0AC[2] = {.0f, 999.f}; // Value and error of T0A or T0C or T0AC float t0TOF[2] = {static_cast(evTimeMakerTOF.mEventTime), static_cast(evTimeMakerTOF.mEventTimeError)}; // Value and error of TOF @@ -605,10 +605,10 @@ struct tofEventTime { sumOfWeights = 0.f; weight = 0.f; // Remove the bias on TOF ev. time - if constexpr (removeTOFEvTimeBias) { + if constexpr (RemoveTofEvTimeBias) { evTimeMakerTOF.removeBias(trk, nGoodTracksForTOF, t0TOF[0], t0TOF[1], 2); } - if (t0TOF[1] < errDiamond && (maxEvTimeTOF <= 0 || std::abs(t0TOF[0]) < maxEvTimeTOF)) { + if (t0TOF[1] < ErrDiamond && (maxEvTimeTOF <= 0 || std::abs(t0TOF[0]) < maxEvTimeTOF)) { flags |= o2::aod::pidflags::enums::PIDFlags::EvTimeTOF; weight = 1.f / (t0TOF[1] * t0TOF[1]); @@ -629,9 +629,9 @@ struct tofEventTime { sumOfWeights += weight; } - if (sumOfWeights < weightDiamond) { // avoiding sumOfWeights = 0 or worse that diamond + if (sumOfWeights < WeightDiamond) { // avoiding sumOfWeights = 0 or worse that diamond eventTime = 0; - sumOfWeights = weightDiamond; + sumOfWeights = WeightDiamond; tableFlags(0); } else { tableFlags(flags); @@ -662,21 +662,21 @@ struct tofEventTime { const auto& tracksInCollision = tracks.sliceBy(perCollision, lastCollisionId); // First make table for event time - const auto evTimeMakerTOF = evTimeMakerForTracks(tracksInCollision, mRespParamsV3, diamond); + const auto evTimeMakerTOF = evTimeMakerForTracks(tracksInCollision, mRespParamsV3, Diamond); int nGoodTracksForTOF = 0; float et = evTimeMakerTOF.mEventTime; float erret = evTimeMakerTOF.mEventTimeError; for (auto const& trk : tracksInCollision) { // Loop on Tracks - if constexpr (removeTOFEvTimeBias) { + if constexpr (RemoveTofEvTimeBias) { evTimeMakerTOF.removeBias(trk, nGoodTracksForTOF, et, erret, 2); } uint8_t flags = 0; - if (erret < errDiamond && (maxEvTimeTOF <= 0.f || std::abs(et) < maxEvTimeTOF)) { + if (erret < ErrDiamond && (maxEvTimeTOF <= 0.f || std::abs(et) < maxEvTimeTOF)) { flags |= o2::aod::pidflags::enums::PIDFlags::EvTimeTOF; } else { et = 0.f; - erret = errDiamond; + erret = ErrDiamond; } tableFlags(flags); tableEvTime(et, erret); @@ -716,13 +716,13 @@ struct tofEventTime { // Part 3 Nsigma computation -static constexpr int idxPi = 2; -static constexpr int idxKa = 3; -static constexpr int idxPr = 4; -static constexpr int idxDe = 5; +static constexpr int IdxPi = 2; +static constexpr int IdxKa = 3; +static constexpr int IdxPr = 4; +static constexpr int IdxDe = 5; /// Task to produce the response table -struct mcPidTof { +struct McPidTof { // Tables to produce Produces tablePIDPi; Produces tablePIDKa; @@ -768,7 +768,7 @@ struct mcPidTof { { mTOFCalibConfig.inheritFromBaseTask(initContext); // Checking the tables are requested in the workflow and enabling them (only pi, K, p) - std::array supportedSpecies = {idxPi, idxKa, idxPr, idxDe}; + std::array supportedSpecies = {IdxPi, IdxKa, IdxPr, IdxDe}; for (auto iSpecie{0u}; iSpecie < supportedSpecies.size(); ++iSpecie) { // First checking tiny int flag = -1; @@ -823,7 +823,7 @@ struct mcPidTof { void reserveTable(const int id, const int64_t& size, const bool fullTable = false) { switch (id) { - case idxPi: { + case IdxPi: { if (fullTable) { tablePIDFullPi.reserve(size); } else { @@ -831,7 +831,7 @@ struct mcPidTof { } break; } - case idxKa: { + case IdxKa: { if (fullTable) { tablePIDFullKa.reserve(size); } else { @@ -839,7 +839,7 @@ struct mcPidTof { } break; } - case idxPr: { + case IdxPr: { if (fullTable) { tablePIDFullPr.reserve(size); } else { @@ -857,7 +857,7 @@ struct mcPidTof { void makeTableEmpty(const int id, bool fullTable = false) { switch (id) { - case idxPi: + case IdxPi: if (fullTable) { tablePIDFullPi(-999.f, -999.f); } else { @@ -865,7 +865,7 @@ struct mcPidTof { tablePIDPi); } break; - case idxKa: + case IdxKa: if (fullTable) { tablePIDFullKa(-999.f, -999.f); } else { @@ -873,7 +873,7 @@ struct mcPidTof { tablePIDKa); } break; - case idxPr: + case IdxPr: if (fullTable) { tablePIDFullPr(-999.f, -999.f); } else { @@ -881,7 +881,7 @@ struct mcPidTof { tablePIDPr); } break; - case idxDe: + case IdxDe: if (fullTable) { tablePIDFullDe(-999.f, -999.f); } else { @@ -956,19 +956,19 @@ struct mcPidTof { } void processDummy(Trks const&) {} - PROCESS_SWITCH(mcPidTof, processDummy, "Dummy process function", false); + PROCESS_SWITCH(McPidTof, processDummy, "Dummy process function", false); - template - using ResponseImplementation = o2::pid::tof::ExpTimes; + template + using ResponseImplementation = o2::pid::tof::ExpTimes; void processFillTables(TrksWtofWevTime const& tracks, Cols const&, aod::BCsWithTimestamps const& bcs, aod::McParticles const&) { - constexpr auto responsePi = ResponseImplementation(); - constexpr auto responseKa = ResponseImplementation(); - constexpr auto responsePr = ResponseImplementation(); - constexpr auto responseDe = ResponseImplementation(); + constexpr auto ResponsePi = ResponseImplementation(); + constexpr auto ResponseKa = ResponseImplementation(); + constexpr auto ResponsePr = ResponseImplementation(); + constexpr auto ResponseDe = ResponseImplementation(); mTOFCalibConfig.processSetup(mRespParamsV3, ccdb, bcs.iteratorAt(0)); // Update the calibration parameters @@ -1005,8 +1005,8 @@ struct mcPidTof { for (auto const& pidId : mEnabledParticles) { // Loop on enabled particle hypotheses switch (pidId) { - case idxPi: { - nSigma = responsePi.GetSeparation(mRespParamsV3, trk); + case IdxPi: { + nSigma = ResponsePi.GetSeparation(mRespParamsV3, trk); if (enableMcRecalib && trk.has_mcParticle()) { if (std::abs(trk.mcParticle().pdgCode()) == kPiPlus) { // we rescale only true signal nSigma = applyMcRecalib(pidId, trk.pt(), nSigma); @@ -1015,8 +1015,8 @@ struct mcPidTof { aod::pidutils::packInTable(nSigma, tablePIDPi); break; } - case idxKa: { - nSigma = responseKa.GetSeparation(mRespParamsV3, trk); + case IdxKa: { + nSigma = ResponseKa.GetSeparation(mRespParamsV3, trk); if (enableMcRecalib && trk.has_mcParticle()) { if (std::abs(trk.mcParticle().pdgCode()) == kKPlus) { // we rescale only true signal nSigma = applyMcRecalib(pidId, trk.pt(), nSigma); @@ -1025,8 +1025,8 @@ struct mcPidTof { aod::pidutils::packInTable(nSigma, tablePIDKa); break; } - case idxPr: { - nSigma = responsePr.GetSeparation(mRespParamsV3, trk); + case IdxPr: { + nSigma = ResponsePr.GetSeparation(mRespParamsV3, trk); if (enableMcRecalib && trk.has_mcParticle()) { if (std::abs(trk.mcParticle().pdgCode()) == kProton) { // we rescale only true signal nSigma = applyMcRecalib(pidId, trk.pt(), nSigma); @@ -1035,11 +1035,11 @@ struct mcPidTof { aod::pidutils::packInTable(nSigma, tablePIDPr); break; } - case idxDe: { - nSigma = responseDe.GetSeparation(mRespParamsV3, trk); + case IdxDe: { + nSigma = ResponseDe.GetSeparation(mRespParamsV3, trk); if (enableMcRecalib && trk.has_mcParticle()) { if (std::abs(trk.mcParticle().pdgCode()) == o2::constants::physics::kDeuteron) { // we rescale only true signal - nSigma = applyMcRecalib(idxPr, trk.pt(), nSigma); // FIXME: currently postcalibrations for protons applied to deuterons, to be checked + nSigma = applyMcRecalib(IdxPr, trk.pt(), nSigma); // FIXME: currently postcalibrations for protons applied to deuterons, to be checked } } aod::pidutils::packInTable(nSigma, tablePIDDe); @@ -1056,9 +1056,9 @@ struct mcPidTof { for (auto const& pidId : mEnabledParticlesFull) { // Loop on enabled particle hypotheses with full tables switch (pidId) { - case idxPi: { - resolution = responsePi.GetExpectedSigma(mRespParamsV3, trk); - nSigma = responsePi.GetSeparation(mRespParamsV3, trk); + case IdxPi: { + resolution = ResponsePi.GetExpectedSigma(mRespParamsV3, trk); + nSigma = ResponsePi.GetSeparation(mRespParamsV3, trk); if (enableMcRecalib && trk.has_mcParticle()) { if (std::abs(trk.mcParticle().pdgCode()) == kPiPlus) { // we rescale only true signal nSigma = applyMcRecalib(pidId, trk.pt(), nSigma); @@ -1067,9 +1067,9 @@ struct mcPidTof { tablePIDFullPi(resolution, nSigma); break; } - case idxKa: { - resolution = responseKa.GetExpectedSigma(mRespParamsV3, trk); - nSigma = responseKa.GetSeparation(mRespParamsV3, trk, resolution); + case IdxKa: { + resolution = ResponseKa.GetExpectedSigma(mRespParamsV3, trk); + nSigma = ResponseKa.GetSeparation(mRespParamsV3, trk, resolution); if (enableMcRecalib && trk.has_mcParticle()) { if (std::abs(trk.mcParticle().pdgCode()) == kKPlus) { // we rescale only true signal nSigma = applyMcRecalib(pidId, trk.pt(), nSigma); @@ -1078,9 +1078,9 @@ struct mcPidTof { tablePIDFullKa(resolution, nSigma); break; } - case idxPr: { - resolution = responsePr.GetExpectedSigma(mRespParamsV3, trk); - nSigma = responsePr.GetSeparation(mRespParamsV3, trk, resolution); + case IdxPr: { + resolution = ResponsePr.GetExpectedSigma(mRespParamsV3, trk); + nSigma = ResponsePr.GetSeparation(mRespParamsV3, trk, resolution); if (enableMcRecalib && trk.has_mcParticle()) { if (std::abs(trk.mcParticle().pdgCode()) == kProton) { // we rescale only true signal nSigma = applyMcRecalib(pidId, trk.pt(), nSigma); @@ -1089,12 +1089,12 @@ struct mcPidTof { tablePIDFullPr(resolution, nSigma); break; } - case idxDe: { - resolution = responseDe.GetExpectedSigma(mRespParamsV3, trk); - nSigma = responseDe.GetSeparation(mRespParamsV3, trk, resolution); + case IdxDe: { + resolution = ResponseDe.GetExpectedSigma(mRespParamsV3, trk); + nSigma = ResponseDe.GetSeparation(mRespParamsV3, trk, resolution); if (enableMcRecalib && trk.has_mcParticle()) { if (std::abs(trk.mcParticle().pdgCode()) == o2::constants::physics::kDeuteron) { // we rescale only true signal - nSigma = applyMcRecalib(idxPr, trk.pt(), nSigma); // FIXME: currently postcalibrations for protons applied to deuterons, to be checked + nSigma = applyMcRecalib(IdxPr, trk.pt(), nSigma); // FIXME: currently postcalibrations for protons applied to deuterons, to be checked } } tablePIDFullDe(resolution, nSigma); @@ -1110,15 +1110,15 @@ struct mcPidTof { } } } - PROCESS_SWITCH(mcPidTof, processFillTables, "Process with table filling", true); + PROCESS_SWITCH(McPidTof, processFillTables, "Process with table filling", true); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { // Parse the metadata metadataInfo.initMetadata(cfgc); - auto workflow = WorkflowSpec{adaptAnalysisTask(cfgc)}; - workflow.push_back(adaptAnalysisTask(cfgc)); - workflow.push_back(adaptAnalysisTask(cfgc)); + auto workflow = WorkflowSpec{adaptAnalysisTask(cfgc)}; + workflow.push_back(adaptAnalysisTask(cfgc)); + workflow.push_back(adaptAnalysisTask(cfgc)); return workflow; } diff --git a/PWGHF/TableProducer/pidCreator.cxx b/PWGHF/TableProducer/pidCreator.cxx index d4a236b5d72..e011b18cf9b 100644 --- a/PWGHF/TableProducer/pidCreator.cxx +++ b/PWGHF/TableProducer/pidCreator.cxx @@ -86,10 +86,10 @@ struct HfPidCreator { /// \param tpcNSigma is the (binned) NSigma separation in TPC (if tiny = true) /// \param tofNSigma is the (binned) NSigma separation in TOF (if tiny = true) /// \return combined NSigma of TPC and TOF - template + template T1 combineNSigma(T1 tpcNSigma, T1 tofNSigma) { - if constexpr (tiny) { + if constexpr (Tiny) { tpcNSigma *= aod::pidtpc_tiny::binning::bin_width; tofNSigma *= aod::pidtof_tiny::binning::bin_width; } diff --git a/PWGHF/TableProducer/trackIndexSkimCreator.cxx b/PWGHF/TableProducer/trackIndexSkimCreator.cxx index c652c7361db..0caea28363a 100644 --- a/PWGHF/TableProducer/trackIndexSkimCreator.cxx +++ b/PWGHF/TableProducer/trackIndexSkimCreator.cxx @@ -158,25 +158,25 @@ struct HfTrackIndexSkimCreatorTagSelCollisions { /// Collision selection /// \param collision collision table with - template + template void selectCollision(const Col& collision, const BCsType& bcs) { float centrality{-1.f}; o2::hf_evsel::HfCollisionRejectionMask rejectionMask{}; - if constexpr (applyUpcSel) { - rejectionMask = hfEvSel.getHfCollisionRejectionMaskWithUpc( + if constexpr (ApplyUpcSel) { + rejectionMask = hfEvSel.getHfCollisionRejectionMaskWithUpc( collision, centrality, ccdb, registry, bcs); } else { - rejectionMask = hfEvSel.getHfCollisionRejectionMask( + rejectionMask = hfEvSel.getHfCollisionRejectionMask( collision, centrality, ccdb, registry); } if (fillHistograms) { hfEvSel.fillHistograms(collision, rejectionMask, centrality); // additional centrality histos - if constexpr (centEstimator != o2::hf_centrality::None) { + if constexpr (CentEstimator != o2::hf_centrality::None) { if (rejectionMask == 0) { registry.fill(HIST("hCentralitySelected"), centrality); } else if (rejectionMask == BIT(EventRejection::Centrality)) { // rejected by centrality only @@ -464,11 +464,11 @@ struct HfTrackIndexSkimCreatorTagSelTracks { /// PID track cuts (for proton only) /// \param hfTrack is a track /// \return true if the track is compatible with a proton hypothesis - template + template uint8_t isSelectedPid(const T& hfTrack) { std::array statusPid{TrackSelectorPID::Accepted, TrackSelectorPID::Accepted, TrackSelectorPID::Accepted, TrackSelectorPID::Accepted}; - if constexpr (pidStrategy == ProtonPidStrategy::PidTofOnly) { + if constexpr (PidStrategy == ProtonPidStrategy::PidTofOnly) { if (hfTrack.hasTOF()) { for (auto iChannel{0u}; iChannel < ChannelsProtonPid::NChannelsProtonPid; ++iChannel) { statusPid[iChannel] = selectorProton[iChannel].statusTof(hfTrack); @@ -476,7 +476,7 @@ struct HfTrackIndexSkimCreatorTagSelTracks { statusPid[ChannelKaonPid] = selectorKaon.statusTof(hfTrack); } } - if constexpr (pidStrategy == ProtonPidStrategy::PidTpcOnly) { + if constexpr (PidStrategy == ProtonPidStrategy::PidTpcOnly) { if (hfTrack.hasTPC()) { for (auto iChannel{0u}; iChannel < ChannelsProtonPid::NChannelsProtonPid; ++iChannel) { statusPid[iChannel] = selectorProton[iChannel].statusTpc(hfTrack); @@ -484,13 +484,13 @@ struct HfTrackIndexSkimCreatorTagSelTracks { statusPid[ChannelKaonPid] = selectorKaon.statusTpc(hfTrack); } } - if constexpr (pidStrategy == ProtonPidStrategy::PidTpcOrTof) { + if constexpr (PidStrategy == ProtonPidStrategy::PidTpcOrTof) { for (auto iChannel{0u}; iChannel < ChannelsProtonPid::NChannelsProtonPid; ++iChannel) { statusPid[iChannel] = selectorProton[iChannel].statusTpcOrTof(hfTrack); } statusPid[ChannelKaonPid] = selectorKaon.statusTpcOrTof(hfTrack); } - if constexpr (pidStrategy == ProtonPidStrategy::PidTpcAndTof) { + if constexpr (PidStrategy == ProtonPidStrategy::PidTpcAndTof) { for (auto iChannel{0u}; iChannel < ChannelsProtonPid::NChannelsProtonPid; ++iChannel) { statusPid[iChannel] = selectorProton[iChannel].statusTpcAndTof(hfTrack); } @@ -921,7 +921,7 @@ struct HfTrackIndexSkimCreatorTagSelTracks { /// \param pvRefitDcaPerTrack is a vector to be filled with track dcas after PV refit /// \param pvRefitPvCoordPerTrack is a vector to be filled with PV coordinates after PV refit /// \param pvRefitPvCovMatrixPerTrack is a vector to be filled with PV coordinate covariances after PV refit - template + template void runTagSelTracks(aod::Collision const& collision, TTracks const&, GroupedTrackIndices const& trackIndicesCollision, @@ -991,7 +991,7 @@ struct HfTrackIndexSkimCreatorTagSelTracks { // } isSelectedTrack(track, trackPt, trackEta, pvRefitDcaXYDcaZ, statusProng); - const int8_t isIdentifiedPid = isSelectedPid(track); + const int8_t isIdentifiedPid = isSelectedPid(track); const bool isPositive = track.sign() > 0; rowSelectedTrack(statusProng, isIdentifiedPid, isPositive); } @@ -1807,7 +1807,7 @@ struct HfTrackIndexSkimCreator { /// \param featuresCandPid is the vector with the candidate PID features /// \param outputScores is the array of vectors with the output scores to be filled /// \param isSelected ia s bitmap with selection outcome - template + template void applyMlSelectionForHfFilters3Prong(std::vector featuresCand, std::vector featuresCandPid, std::array, kN3ProngDecays>& outputScores, auto& isSelected) { if (isSelected == 0) { @@ -1818,7 +1818,7 @@ struct HfTrackIndexSkimCreator { for (int iDecay3P{0}; iDecay3P < kN3ProngDecays; ++iDecay3P) { if (TESTBIT(isSelected, iDecay3P) && hasMlModel3Prong[iDecay3P]) { bool isMlSel = false; - if constexpr (usePidForHfFiltersBdt) { + if constexpr (UsePidForHfFiltersBdt) { if (iDecay3P != hf_cand_3prong::DecayType::LcToPKPi && iDecay3P != hf_cand_3prong::DecayType::XicToPKPi) { isMlSel = hfMlResponse3Prongs[iDecay3P].isSelectedMl(featuresCand, ptDummy, outputScores[iDecay3P]); } else { @@ -2052,7 +2052,7 @@ struct HfTrackIndexSkimCreator { } /// end of performPvRefitCandProngs function - template + template void run2And3Prongs(SelectedCollisions const& collisions, aod::BCsWithTimestamps const& bcWithTimeStamps, FilteredTrackAssocSel const&, @@ -2076,7 +2076,7 @@ struct HfTrackIndexSkimCreator { std::vector vecPvContributorGlobId{}; std::vector vecPvContributorTrackParCov{}; std::vector vecPvRefitContributorUsed{}; - if constexpr (doPvRefit) { + if constexpr (DoPvRefit) { auto groupedTracksUnfiltered = tracks.sliceBy(tracksPerCollision, collision.globalIndex()); const int nTrk = groupedTracksUnfiltered.size(); int nContrib = 0; @@ -2221,7 +2221,7 @@ struct HfTrackIndexSkimCreator { df2.getTrack(1).getPxPyPzGlo(pvec1); /// PV refit excluding the candidate daughters, if contributors - if constexpr (doPvRefit) { + if constexpr (DoPvRefit) { if (config.fillHistograms) { registry.fill(HIST("PvRefit/verticesPerCandidate"), 1); } @@ -2283,7 +2283,7 @@ struct HfTrackIndexSkimCreator { const auto pVecCandProng2 = RecoDecay::pVec(pvec0, pvec1); // 2-prong selections after secondary vertex std::array pvCoord2Prong = {collision.posX(), collision.posY(), collision.posZ()}; - if constexpr (doPvRefit) { + if constexpr (DoPvRefit) { pvCoord2Prong[0] = pvRefitCoord2Prong[0]; pvCoord2Prong[1] = pvRefitCoord2Prong[1]; pvCoord2Prong[2] = pvRefitCoord2Prong[2]; @@ -2311,7 +2311,7 @@ struct HfTrackIndexSkimCreator { lastFilledD0 = rowTrackIndexProng2.lastIndex(); } - if constexpr (doPvRefit) { + if constexpr (DoPvRefit) { // fill table row with coordinates of PV refit rowProng2PVrefit(pvRefitCoord2Prong[0], pvRefitCoord2Prong[1], pvRefitCoord2Prong[2], pvRefitCovMatrix2Prong[0], pvRefitCovMatrix2Prong[1], pvRefitCovMatrix2Prong[2], pvRefitCovMatrix2Prong[3], pvRefitCovMatrix2Prong[4], pvRefitCovMatrix2Prong[5]); @@ -2436,7 +2436,7 @@ struct HfTrackIndexSkimCreator { /// PV refit excluding the candidate daughters, if contributors std::array pvRefitCoord3Prong2Pos1Neg{collision.posX(), collision.posY(), collision.posZ()}; /// initialize to the original PV std::array pvRefitCovMatrix3Prong2Pos1Neg{getPrimaryVertex(collision).getCov()}; /// initialize to the original PV - if constexpr (doPvRefit) { + if constexpr (DoPvRefit) { if (config.fillHistograms) { registry.fill(HIST("PvRefit/verticesPerCandidate"), 1); } @@ -2554,14 +2554,14 @@ struct HfTrackIndexSkimCreator { if (config.applyMlForHfFilters) { const std::vector inputFeatures{trackParVarPcaPos1.getPt(), dcaInfoPos1[0], dcaInfoPos1[1], trackParVarPcaNeg1.getPt(), dcaInfoNeg1[0], dcaInfoNeg1[1], trackParVarPcaPos2.getPt(), dcaInfoPos2[0], dcaInfoPos2[1]}; std::vector inputFeaturesLcPid{}; - if constexpr (usePidForHfFiltersBdt) { + if constexpr (UsePidForHfFiltersBdt) { inputFeaturesLcPid.push_back(trackPos1.tpcNSigmaPr()); inputFeaturesLcPid.push_back(trackPos2.tpcNSigmaPr()); inputFeaturesLcPid.push_back(trackPos1.tpcNSigmaPi()); inputFeaturesLcPid.push_back(trackPos2.tpcNSigmaPi()); inputFeaturesLcPid.push_back(trackNeg1.tpcNSigmaKa()); } - applyMlSelectionForHfFilters3Prong(inputFeatures, inputFeaturesLcPid, mlScores3Prongs, isSelected3ProngCand); + applyMlSelectionForHfFilters3Prong(inputFeatures, inputFeaturesLcPid, mlScores3Prongs, isSelected3ProngCand); } if (!config.debug && isSelected3ProngCand == 0) { @@ -2573,7 +2573,7 @@ struct HfTrackIndexSkimCreator { if (config.applyMlForHfFilters) { rowTrackIndexMlScoreProng3(mlScores3Prongs[0], mlScores3Prongs[1], mlScores3Prongs[2], mlScores3Prongs[3]); } - if constexpr (doPvRefit) { + if constexpr (DoPvRefit) { // fill table row of coordinates of PV refit rowProng3PVrefit(pvRefitCoord3Prong2Pos1Neg[0], pvRefitCoord3Prong2Pos1Neg[1], pvRefitCoord3Prong2Pos1Neg[2], pvRefitCovMatrix3Prong2Pos1Neg[0], pvRefitCovMatrix3Prong2Pos1Neg[1], pvRefitCovMatrix3Prong2Pos1Neg[2], pvRefitCovMatrix3Prong2Pos1Neg[3], pvRefitCovMatrix3Prong2Pos1Neg[4], pvRefitCovMatrix3Prong2Pos1Neg[5]); @@ -2686,7 +2686,7 @@ struct HfTrackIndexSkimCreator { /// PV refit excluding the candidate daughters, if contributors std::array pvRefitCoord3Prong1Pos2Neg{collision.posX(), collision.posY(), collision.posZ()}; /// initialize to the original PV std::array pvRefitCovMatrix3Prong1Pos2Neg{getPrimaryVertex(collision).getCov()}; /// initialize to the original PV - if constexpr (doPvRefit) { + if constexpr (DoPvRefit) { if (config.fillHistograms) { registry.fill(HIST("PvRefit/verticesPerCandidate"), 1); } @@ -2805,14 +2805,14 @@ struct HfTrackIndexSkimCreator { if (config.applyMlForHfFilters) { const std::vector inputFeatures{trackParVarPcaNeg1.getPt(), dcaInfoNeg1[0], dcaInfoNeg1[1], trackParVarPcaPos1.getPt(), dcaInfoPos1[0], dcaInfoPos1[1], trackParVarPcaNeg2.getPt(), dcaInfoNeg2[0], dcaInfoNeg2[1]}; std::vector inputFeaturesLcPid{}; - if constexpr (usePidForHfFiltersBdt) { + if constexpr (UsePidForHfFiltersBdt) { inputFeaturesLcPid.push_back(trackNeg1.tpcNSigmaPr()); inputFeaturesLcPid.push_back(trackNeg2.tpcNSigmaPr()); inputFeaturesLcPid.push_back(trackNeg1.tpcNSigmaPi()); inputFeaturesLcPid.push_back(trackNeg2.tpcNSigmaPi()); inputFeaturesLcPid.push_back(trackPos1.tpcNSigmaKa()); } - applyMlSelectionForHfFilters3Prong(inputFeatures, inputFeaturesLcPid, mlScores3Prongs, isSelected3ProngCand); + applyMlSelectionForHfFilters3Prong(inputFeatures, inputFeaturesLcPid, mlScores3Prongs, isSelected3ProngCand); } if (!config.debug && isSelected3ProngCand == 0) { @@ -2824,7 +2824,7 @@ struct HfTrackIndexSkimCreator { if (config.applyMlForHfFilters) { rowTrackIndexMlScoreProng3(mlScores3Prongs[0], mlScores3Prongs[1], mlScores3Prongs[2], mlScores3Prongs[3]); } - if constexpr (doPvRefit) { + if constexpr (DoPvRefit) { // fill table row of coordinates of PV refit rowProng3PVrefit(pvRefitCoord3Prong1Pos2Neg[0], pvRefitCoord3Prong1Pos2Neg[1], pvRefitCoord3Prong1Pos2Neg[2], pvRefitCovMatrix3Prong1Pos2Neg[0], pvRefitCovMatrix3Prong1Pos2Neg[1], pvRefitCovMatrix3Prong1Pos2Neg[2], pvRefitCovMatrix3Prong1Pos2Neg[3], pvRefitCovMatrix3Prong1Pos2Neg[4], pvRefitCovMatrix3Prong1Pos2Neg[5]); @@ -2915,7 +2915,7 @@ struct HfTrackIndexSkimCreator { if (config.fillHistograms) { registry.fill(HIST("hMassDstarToD0Pi"), deltaMass); } - if constexpr (doPvRefit) { + if constexpr (DoPvRefit) { // fill table row with coordinates of PV refit (same as 2-prong because we do not remove the soft pion) rowDstarPVrefit(pvRefitCoord2Prong[0], pvRefitCoord2Prong[1], pvRefitCoord2Prong[2], pvRefitCovMatrix2Prong[0], pvRefitCovMatrix2Prong[1], pvRefitCovMatrix2Prong[2], pvRefitCovMatrix2Prong[3], pvRefitCovMatrix2Prong[4], pvRefitCovMatrix2Prong[5]); @@ -2952,7 +2952,7 @@ struct HfTrackIndexSkimCreator { if (config.fillHistograms) { registry.fill(HIST("hMassDstarToD0Pi"), deltaMass); } - if constexpr (doPvRefit) { + if constexpr (DoPvRefit) { // fill table row with coordinates of PV refit (same as 2-prong because we do not remove the soft pion) rowDstarPVrefit(pvRefitCoord2Prong[0], pvRefitCoord2Prong[1], pvRefitCoord2Prong[2], pvRefitCovMatrix2Prong[0], pvRefitCovMatrix2Prong[1], pvRefitCovMatrix2Prong[2], pvRefitCovMatrix2Prong[3], pvRefitCovMatrix2Prong[4], pvRefitCovMatrix2Prong[5]); diff --git a/PWGHF/TableProducer/treeCreatorB0ToDPi.cxx b/PWGHF/TableProducer/treeCreatorB0ToDPi.cxx index ebfd87c5e46..d3b2fabd1e3 100644 --- a/PWGHF/TableProducer/treeCreatorB0ToDPi.cxx +++ b/PWGHF/TableProducer/treeCreatorB0ToDPi.cxx @@ -209,12 +209,12 @@ struct HfTreeCreatorB0ToDPi { runNumber); } - template + template void fillCandidateTable(const T& candidate, const U& prong1) { int8_t flagMc = 0; int8_t originMc = 0; - if constexpr (doMc) { + if constexpr (DoMc) { flagMc = candidate.flagMcMatchRec(); originMc = candidate.originMcRec(); } diff --git a/PWGHF/TableProducer/treeCreatorBplusToD0Pi.cxx b/PWGHF/TableProducer/treeCreatorBplusToD0Pi.cxx index cd9665de50c..cd3d5f2f1a7 100644 --- a/PWGHF/TableProducer/treeCreatorBplusToD0Pi.cxx +++ b/PWGHF/TableProducer/treeCreatorBplusToD0Pi.cxx @@ -265,12 +265,12 @@ struct HfTreeCreatorBplusToD0Pi { runNumber); } - template + template void fillCandidateTable(const T& candidate, const U& prong1) { int8_t flagMc = 0; int8_t originMc = 0; - if constexpr (doMc) { + if constexpr (DoMc) { flagMc = candidate.flagMcMatchRec(); originMc = candidate.originMcRec(); } diff --git a/PWGHF/TableProducer/treeCreatorBsToDsPi.cxx b/PWGHF/TableProducer/treeCreatorBsToDsPi.cxx index 3c639967995..cef73bc0a90 100644 --- a/PWGHF/TableProducer/treeCreatorBsToDsPi.cxx +++ b/PWGHF/TableProducer/treeCreatorBsToDsPi.cxx @@ -204,11 +204,11 @@ struct HfTreeCreatorBsToDsPi { runNumber); } - template + template void fillCandidateTable(const T& candidate, const U& prong1) { int8_t flagMc = 0; - if constexpr (doMc) { + if constexpr (DoMc) { flagMc = candidate.flagMcMatchRec(); } if (fillCandidateLiteTable) { diff --git a/PWGHF/TableProducer/treeCreatorD0ToKPi.cxx b/PWGHF/TableProducer/treeCreatorD0ToKPi.cxx index 4178f66f864..9dcd3921713 100644 --- a/PWGHF/TableProducer/treeCreatorD0ToKPi.cxx +++ b/PWGHF/TableProducer/treeCreatorD0ToKPi.cxx @@ -286,7 +286,7 @@ struct HfTreeCreatorD0ToKPi { runNumber); } - template + template auto fillTable(const T& candidate, int candFlag, double invMass, double topoChi2, double ct, double y, double e, int8_t flagMc, int8_t flagMcDecay, int8_t origin) { @@ -392,7 +392,7 @@ struct HfTreeCreatorD0ToKPi { flagMcDecay, origin); } - if constexpr (applyMl) { + if constexpr (ApplyMl) { if (candFlag == 0) { rowCandidateMl( candidate.mlProbD0()[0], @@ -407,7 +407,7 @@ struct HfTreeCreatorD0ToKPi { } } - template + template void processData(aod::Collisions const& collisions, CandType const& candidates, aod::Tracks const&, aod::BCs const&) @@ -424,7 +424,7 @@ struct HfTreeCreatorD0ToKPi { } else { rowCandidateFull.reserve(candidates.size()); } - if constexpr (applyMl) { + if constexpr (ApplyMl) { rowCandidateMl.reserve(candidates.size()); } for (const auto& candidate : candidates) { @@ -439,7 +439,7 @@ struct HfTreeCreatorD0ToKPi { double ctD = hfHelper.ctD0(candidate); float massD0, massD0bar; float topolChi2PerNdf = -999.; - if constexpr (reconstructionType == aod::hf_cand::VertexerType::KfParticle) { + if constexpr (ReconstructionType == aod::hf_cand::VertexerType::KfParticle) { massD0 = candidate.kfGeoMassD0(); massD0bar = candidate.kfGeoMassD0bar(); topolChi2PerNdf = candidate.kfTopolChi2OverNdf(); @@ -448,10 +448,10 @@ struct HfTreeCreatorD0ToKPi { massD0bar = hfHelper.invMassD0barToKPi(candidate); } if (candidate.isSelD0()) { - fillTable(candidate, 0, massD0, topolChi2PerNdf, ctD, yD, eD, 0, 0, 0); + fillTable(candidate, 0, massD0, topolChi2PerNdf, ctD, yD, eD, 0, 0, 0); } if (candidate.isSelD0bar()) { - fillTable(candidate, 1, massD0bar, topolChi2PerNdf, ctD, yD, eD, 0, 0, 0); + fillTable(candidate, 1, massD0bar, topolChi2PerNdf, ctD, yD, eD, 0, 0, 0); } } } @@ -492,7 +492,7 @@ struct HfTreeCreatorD0ToKPi { } PROCESS_SWITCH(HfTreeCreatorD0ToKPi, processDataWithKFParticleMl, "Process data with KFParticle and ML", false); - template + template void processMc(aod::Collisions const& collisions, aod::McCollisions const&, CandType const& candidates, @@ -512,11 +512,11 @@ struct HfTreeCreatorD0ToKPi { } else { rowCandidateFull.reserve(candidates.size()); } - if constexpr (applyMl) { + if constexpr (ApplyMl) { rowCandidateMl.reserve(candidates.size()); } for (const auto& candidate : candidates) { - if constexpr (onlyBkg) { + if constexpr (OnlyBkg) { if ((std::abs(candidate.flagMcMatchRec()) == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) || (fillCorrBkgs && (candidate.flagMcMatchRec() != 0))) { continue; } @@ -527,7 +527,7 @@ struct HfTreeCreatorD0ToKPi { } } } - if constexpr (onlySig) { + if constexpr (OnlySig) { if (fillCorrBkgs && candidate.flagMcMatchRec() == 0) { continue; } @@ -540,7 +540,7 @@ struct HfTreeCreatorD0ToKPi { double ctD = hfHelper.ctD0(candidate); float massD0, massD0bar; float topolChi2PerNdf = -999.; - if constexpr (reconstructionType == aod::hf_cand::VertexerType::KfParticle) { + if constexpr (ReconstructionType == aod::hf_cand::VertexerType::KfParticle) { massD0 = candidate.kfGeoMassD0(); massD0bar = candidate.kfGeoMassD0bar(); topolChi2PerNdf = candidate.kfTopolChi2OverNdf(); @@ -549,10 +549,10 @@ struct HfTreeCreatorD0ToKPi { massD0bar = hfHelper.invMassD0barToKPi(candidate); } if (candidate.isSelD0()) { - fillTable(candidate, 0, massD0, topolChi2PerNdf, ctD, yD, eD, candidate.flagMcMatchRec(), candidate.flagMcDecayChanRec(), candidate.originMcRec()); + fillTable(candidate, 0, massD0, topolChi2PerNdf, ctD, yD, eD, candidate.flagMcMatchRec(), candidate.flagMcDecayChanRec(), candidate.originMcRec()); } if (candidate.isSelD0bar()) { - fillTable(candidate, 1, massD0bar, topolChi2PerNdf, ctD, yD, eD, candidate.flagMcMatchRec(), candidate.flagMcDecayChanRec(), candidate.originMcRec()); + fillTable(candidate, 1, massD0bar, topolChi2PerNdf, ctD, yD, eD, candidate.flagMcMatchRec(), candidate.flagMcDecayChanRec(), candidate.originMcRec()); } } diff --git a/PWGHF/TableProducer/treeCreatorDplusToPiKPi.cxx b/PWGHF/TableProducer/treeCreatorDplusToPiKPi.cxx index f0fc63623a6..4741a2ea185 100644 --- a/PWGHF/TableProducer/treeCreatorDplusToPiKPi.cxx +++ b/PWGHF/TableProducer/treeCreatorDplusToPiKPi.cxx @@ -300,20 +300,20 @@ struct HfTreeCreatorDplusToPiKPi { runNumber); } - template + template void fillCandidateTable(const T& candidate) { int8_t flagMc = 0; int8_t originMc = 0; int8_t channelMc = 0; - if constexpr (doMc) { + if constexpr (DoMc) { flagMc = candidate.flagMcMatchRec(); originMc = candidate.originMcRec(); channelMc = candidate.flagMcDecayChanRec(); } std::vector outputMl = {-999., -999.}; - if constexpr (doMl) { + if constexpr (DoMl) { for (unsigned int iclass = 0; iclass < classMlIndexes->size(); iclass++) { outputMl[iclass] = candidate.mlProbDplusToPiKPi()[classMlIndexes->at(iclass)]; } @@ -518,7 +518,7 @@ struct HfTreeCreatorDplusToPiKPi { PROCESS_SWITCH(HfTreeCreatorDplusToPiKPi, processDataWCent, "Process data with cent", false); - template + template void fillMcTables(CollType const& collisions, aod::McCollisions const&, CandTypeMcRec const& candidates, @@ -544,7 +544,7 @@ struct HfTreeCreatorDplusToPiKPi { continue; } } - fillCandidateTable(candidate); + fillCandidateTable(candidate); } // Filling particle properties diff --git a/PWGHF/TableProducer/treeCreatorDsToKKPi.cxx b/PWGHF/TableProducer/treeCreatorDsToKKPi.cxx index de1c9984435..837756e42f1 100644 --- a/PWGHF/TableProducer/treeCreatorDsToKKPi.cxx +++ b/PWGHF/TableProducer/treeCreatorDsToKKPi.cxx @@ -325,17 +325,17 @@ struct HfTreeCreatorDsToKKPi { /// \param doMc true to fill MC information /// \param massHypo mass hypothesis considered: 0 = KKPi, 1 = PiKK /// \param candidate is candidate - template + template void fillCandidateTable(const T& candidate) { float invMassDs = 0; float deltaMassPhiKK = 0; float absCos3PiKDs = 0; - if constexpr (massHypo == 0) { + if constexpr (MassHypo == 0) { invMassDs = hfHelper.invMassDsToKKPi(candidate); deltaMassPhiKK = hfHelper.deltaMassPhiDsToKKPi(candidate); absCos3PiKDs = hfHelper.absCos3PiKDsToKKPi(candidate); - } else if constexpr (massHypo == 1) { + } else if constexpr (MassHypo == 1) { invMassDs = hfHelper.invMassDsToPiKK(candidate); deltaMassPhiKK = hfHelper.deltaMassPhiDsToPiKK(candidate); absCos3PiKDs = hfHelper.absCos3PiKDsToPiKK(candidate); @@ -344,11 +344,11 @@ struct HfTreeCreatorDsToKKPi { int8_t flagMc{0}; int8_t originMc{0}; int8_t channelMc{0}; - int8_t isSwapped{massHypo}; // 0 if KKPi, 1 if PiKK + int8_t isSwapped{MassHypo}; // 0 if KKPi, 1 if PiKK float eCand{0.f}; float ctCand{0.f}; float yCand = candidate.y(invMassDs); - if constexpr (doMc) { + if constexpr (DoMc) { flagMc = candidate.flagMcMatchRec(); originMc = candidate.originMcRec(); channelMc = candidate.flagMcDecayChanRec(); @@ -395,8 +395,8 @@ struct HfTreeCreatorDsToKKPi { candidate.nSigTofKa2(), candidate.tpcTofNSigmaPi2(), candidate.tpcTofNSigmaKa2(), - massHypo == 0 ? candidate.isSelDsToKKPi() : -1, - massHypo == 1 ? candidate.isSelDsToPiKK() : -1, + MassHypo == 0 ? candidate.isSelDsToKKPi() : -1, + MassHypo == 1 ? candidate.isSelDsToPiKK() : -1, invMassDs, candidate.pt(), candidate.eta(), @@ -463,8 +463,8 @@ struct HfTreeCreatorDsToKKPi { candidate.nSigTofKa2(), candidate.tpcTofNSigmaPi2(), candidate.tpcTofNSigmaKa2(), - massHypo == 0 ? candidate.isSelDsToKKPi() : -1, - massHypo == 1 ? candidate.isSelDsToPiKK() : -1, + MassHypo == 0 ? candidate.isSelDsToKKPi() : -1, + MassHypo == 1 ? candidate.isSelDsToPiKK() : -1, candidate.xSecondaryVertex(), candidate.ySecondaryVertex(), candidate.zSecondaryVertex(), diff --git a/PWGHF/TableProducer/treeCreatorDstarToD0Pi.cxx b/PWGHF/TableProducer/treeCreatorDstarToD0Pi.cxx index 18ee43a111b..ec27ddefe35 100644 --- a/PWGHF/TableProducer/treeCreatorDstarToD0Pi.cxx +++ b/PWGHF/TableProducer/treeCreatorDstarToD0Pi.cxx @@ -293,12 +293,12 @@ struct HfTreeCreatorDstarToD0Pi { runNumber); } - template + template void fillCandidateTable(const T& candidate, float ptBhadMotherPart = -1) { int8_t flagMc{0}; int8_t originMc{0}; - if constexpr (doMc) { + if constexpr (DoMc) { flagMc = candidate.flagMcMatchRec(); originMc = candidate.originMcRec(); } diff --git a/PWGHF/TableProducer/treeCreatorLbToLcPi.cxx b/PWGHF/TableProducer/treeCreatorLbToLcPi.cxx index a60a7eba661..899d2c2ca28 100644 --- a/PWGHF/TableProducer/treeCreatorLbToLcPi.cxx +++ b/PWGHF/TableProducer/treeCreatorLbToLcPi.cxx @@ -207,10 +207,10 @@ struct HfTreeCreatorLbToLcPi { // Filling candidate properties rowCandidateFull.reserve(candidates.size()); for (const auto& candidate : candidates) { - auto fillTable = [&](int FunctionSelection, - float FunctionInvMass, - float FunctionCt, - float FunctionY) { + auto fillTable = [&](int functionSelection, + float functionInvMass, + float functionCt, + float functionY) { auto candLc = candidate.prong0_as>(); auto track0 = candidate.prong1_as(); // daughter pion track auto track1 = candLc.prong0_as(); // granddaughter tracks (lc decay particles) @@ -290,16 +290,16 @@ struct HfTreeCreatorLbToLcPi { track2.px(), track2.py(), track2.pz(), track3.px(), track3.py(), track3.pz(), track1.sign(), track2.sign(), track3.sign(), - FunctionSelection, - FunctionInvMass, + functionSelection, + functionInvMass, candidate.pt(), candidate.p(), candidate.cpa(), candidate.cpaXY(), - FunctionCt, + functionCt, candidate.eta(), candidate.phi(), - FunctionY, + functionY, tempConst, tempConst); }; diff --git a/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx b/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx index 7015058dfb5..0f69ed17d62 100644 --- a/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx +++ b/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx @@ -480,7 +480,7 @@ struct HfTreeCreatorLcToPKPi { /// \brief function to fill event properties /// \param collisions Collision table - template + template void fillEventProperties(Colls const& collisions) { // Filling event properties @@ -492,7 +492,7 @@ struct HfTreeCreatorLcToPKPi { float centFT0M = -1.f; float centFV0A = -1.f; float centFDDM = -1.f; - if constexpr (useCentrality) { + if constexpr (UseCentrality) { centFT0A = collision.centFT0A(); centFT0C = collision.centFT0C(); centFT0M = collision.centFT0M(); @@ -505,7 +505,7 @@ struct HfTreeCreatorLcToPKPi { float mcPosZ{UndefValueFloat}; int mcCollId{-1}; - if constexpr (isMc) { + if constexpr (IsMc) { auto mcCollision = collision.template mcCollision_as(); mcPosX = mcCollision.posX(); @@ -543,10 +543,10 @@ struct HfTreeCreatorLcToPKPi { /// \brief function to reserve tables size /// \param candidatesSize size of the candidates table /// \param isMc boolean flag whether MC or data is processed - template + template void reserveTables(size_t candidatesSize, bool isMc) { - if constexpr (reconstructionType == aod::hf_cand::VertexerType::DCAFitter) { + if constexpr (ReconstructionType == aod::hf_cand::VertexerType::DCAFitter) { if (fillCandidateLiteTable) { rowCandidateLite.reserve(candidatesSize * 2); } else { @@ -608,7 +608,7 @@ struct HfTreeCreatorLcToPKPi { /// \param candidate candidate instance /// \param candidateMlScore instance of handler of vectors with ML scores associated with the current candidate /// \param candFlag flag indicating if PKPi (0) or PiKP (1) hypothesis is used - template + template void fillLiteTable(CandType const& candidate, aod::HfMlLcToPKPi::iterator const& candidateMlScore, int candFlag) { auto [functionInvMass, functionInvMassKPi] = evaluateInvariantMassesDCAFitter(candidate, candFlag); @@ -620,7 +620,7 @@ struct HfTreeCreatorLcToPKPi { int8_t functionIsCandidateSwapped{0}; int8_t functionFlagMcDecayChanRec{-1}; - if constexpr (isMc) { + if constexpr (IsMc) { functionFlagMcMatchRec = candidate.flagMcMatchRec(); functionOriginMcRec = candidate.originMcRec(); functionIsCandidateSwapped = candidate.isCandidateSwapped(); @@ -693,7 +693,7 @@ struct HfTreeCreatorLcToPKPi { /// \param candidate candidate instance /// \param candidateMlScore instance of handler of vectors with ML scores associated with the current candidate /// \param candFlag flag indicating if PKPi (0) or PiKP (1) hypothesis is used - template + template void fillFullTable(CandType const& candidate, aod::HfMlLcToPKPi::iterator const& candidateMlScore, int candFlag) { auto [functionInvMass, functionInvMassKPi] = evaluateInvariantMassesDCAFitter(candidate, candFlag); @@ -706,7 +706,7 @@ struct HfTreeCreatorLcToPKPi { int8_t functionIsCandidateSwapped{0}; int8_t functionFlagMcDecayChanRec{-1}; - if constexpr (isMc) { + if constexpr (IsMc) { functionFlagMcMatchRec = candidate.flagMcMatchRec(); functionOriginMcRec = candidate.originMcRec(); functionIsCandidateSwapped = candidate.isCandidateSwapped(); @@ -910,7 +910,7 @@ struct HfTreeCreatorLcToPKPi { /// \param mcCollisions MC collision table /// \param candidates Lc->pKpi candidate table /// \param particles Generated particle table - template + template void fillTablesMc(Colls const& collisions, aod::McCollisions const&, CandType const& candidates, @@ -921,10 +921,10 @@ struct HfTreeCreatorLcToPKPi { constexpr bool IsMc = true; - fillEventProperties(collisions); + fillEventProperties(collisions); const size_t candidatesSize = candidates.size(); - reserveTables(candidatesSize, IsMc); + reserveTables(candidatesSize, IsMc); int iCand{0}; for (const auto& candidate : candidates) { @@ -949,7 +949,7 @@ struct HfTreeCreatorLcToPKPi { fillFullTable(candidate, candidateMlScore, candFlag); } - if constexpr (reconstructionType == aod::hf_cand::VertexerType::KfParticle) { + if constexpr (ReconstructionType == aod::hf_cand::VertexerType::KfParticle) { fillKFTable(candidate, collision, candFlag, functionSelection, sigbgstatus); } if (fillCandidateMcTable) { @@ -1099,7 +1099,7 @@ struct HfTreeCreatorLcToPKPi { /// \brief core function to fill tables in data /// \param collisions Collision table /// \param candidates Lc->pKpi candidate table - template + template void fillTablesData(Colls const& collisions, CandType const& candidates, aod::HfMlLcToPKPi const& candidateMlScores, @@ -1108,10 +1108,10 @@ struct HfTreeCreatorLcToPKPi { constexpr bool IsMc = false; - fillEventProperties(collisions); + fillEventProperties(collisions); const size_t candidatesSize = candidates.size(); - reserveTables(candidatesSize, IsMc); + reserveTables(candidatesSize, IsMc); // Filling candidate properties @@ -1131,7 +1131,7 @@ struct HfTreeCreatorLcToPKPi { fillFullTable(candidate, candidateMlScore, candFlag); } - if constexpr (reconstructionType == aod::hf_cand::VertexerType::KfParticle) { + if constexpr (ReconstructionType == aod::hf_cand::VertexerType::KfParticle) { fillKFTable(candidate, collision, candFlag, functionSelection, UndefValueInt); } } diff --git a/PWGHF/TableProducer/treeCreatorToXiPi.cxx b/PWGHF/TableProducer/treeCreatorToXiPi.cxx index 01e40cfb2c8..ed265daa74a 100644 --- a/PWGHF/TableProducer/treeCreatorToXiPi.cxx +++ b/PWGHF/TableProducer/treeCreatorToXiPi.cxx @@ -246,19 +246,19 @@ struct HfTreeCreatorToXiPi { } } - template + template void fillEvent(const T& collision, float cutZPv) { rowEv( collision.sel8(), std::abs(collision.posZ()) < cutZPv); } - template + template void fillCandidate(const T& candidate, int8_t flagMc, int8_t debugMc, int8_t originMc, bool collisionMatched) { float centrality = -999.f; - if constexpr (useCentrality) { + if constexpr (UseCentrality) { auto const& collision = candidate.template collision_as(); centrality = o2::hf_centrality::getCentralityColl(collision); } @@ -376,13 +376,13 @@ struct HfTreeCreatorToXiPi { collisionMatched); } - template + template void fillCandidateLite(const T& candidate, int8_t flagMc, int8_t originMc, bool collisionMatched) { if (candidate.resultSelections() && candidate.statusPidCharmBaryon() && candidate.statusInvMassLambda() && candidate.statusInvMassCascade() && candidate.statusInvMassCharmBaryon()) { float centrality = -999.f; - if constexpr (useCentrality) { + if constexpr (UseCentrality) { auto const& collision = candidate.template collision_as(); centrality = o2::hf_centrality::getCentralityColl(collision); } diff --git a/PWGHF/TableProducer/treeCreatorXic0ToXiPiKf.cxx b/PWGHF/TableProducer/treeCreatorXic0ToXiPiKf.cxx index 0e1c06d5965..296d9e11ab7 100644 --- a/PWGHF/TableProducer/treeCreatorXic0ToXiPiKf.cxx +++ b/PWGHF/TableProducer/treeCreatorXic0ToXiPiKf.cxx @@ -156,14 +156,14 @@ struct HfTreeCreatorXic0ToXiPiKf { registry.add("hV0Dau1ItsChi2NCls", "hItsChi2NCls;status;entries", {HistType::kTH1D, {{1000, 0.0f, 10.0f}}}); } - template + template void fillKfCandidate(const T& candidate, int8_t flagMc, int8_t debugMc, int8_t originMc, bool collisionMatched) { if (candidate.resultSelections()) { float centrality = -999.f; - if constexpr (useCentrality) { + if constexpr (UseCentrality) { auto const& collision = candidate.template collision_as(); centrality = o2::hf_centrality::getCentralityColl(collision); } diff --git a/PWGHF/TableProducer/treeCreatorXicToPKPi.cxx b/PWGHF/TableProducer/treeCreatorXicToPKPi.cxx index a7e592d910e..9876f4f1f98 100644 --- a/PWGHF/TableProducer/treeCreatorXicToPKPi.cxx +++ b/PWGHF/TableProducer/treeCreatorXicToPKPi.cxx @@ -269,22 +269,22 @@ struct HfTreeCreatorXicToPKPi { /// \param doMc true to fill MC information /// \param massHypo mass hypothesis considered: 0 = PKPi, 1 = PiKP /// \param candidate is candidate - template + template void fillCandidateTable(const T& candidate) { int8_t flagMc = 0; int8_t originMc = 0; int candSwapped = 0; - if constexpr (doMc) { + if constexpr (DoMc) { flagMc = candidate.flagMcMatchRec(); originMc = candidate.originMcRec(); candSwapped = candidate.isCandidateSwapped(); } float invMassXic = 0; - if constexpr (massHypo == 0) { + if constexpr (MassHypo == 0) { invMassXic = hfHelper.invMassXicToPKPi(candidate); - } else if constexpr (massHypo == 1) { + } else if constexpr (MassHypo == 1) { invMassXic = hfHelper.invMassXicToPiKP(candidate); } diff --git a/PWGHF/TableProducer/treeCreatorXicToXiPiPi.cxx b/PWGHF/TableProducer/treeCreatorXicToXiPiPi.cxx index ca2f34ae5d3..c681fb2c9ef 100644 --- a/PWGHF/TableProducer/treeCreatorXicToXiPiPi.cxx +++ b/PWGHF/TableProducer/treeCreatorXicToXiPiPi.cxx @@ -373,16 +373,16 @@ struct HfTreeCreatorXicToXiPiPi { { } - template + template void fillCandidateTable(const T& candidate) { int8_t particleFlag = candidate.sign(); int8_t originMc = 0; - if constexpr (doMc) { + if constexpr (DoMc) { particleFlag = candidate.flagMcMatchRec(); originMc = candidate.originMcRec(); } - if constexpr (!doKf) { + if constexpr (!DoKf) { if (fillCandidateLiteTable) { rowCandidateLite( particleFlag, diff --git a/PWGHF/TableProducer/treeCreatorXiccToPKPiPi.cxx b/PWGHF/TableProducer/treeCreatorXiccToPKPiPi.cxx index 56ca3f152c6..9e4f0e3703c 100644 --- a/PWGHF/TableProducer/treeCreatorXiccToPKPiPi.cxx +++ b/PWGHF/TableProducer/treeCreatorXiccToPKPiPi.cxx @@ -204,12 +204,12 @@ struct HfTreeCreatorXiccToPKPiPi { // Filling candidate properties rowCandidateFull.reserve(candidates.size()); for (const auto& candidate : candidates) { - auto fillTable = [&](int CandFlag, - int FunctionSelection, - float FunctionInvMass, - float FunctionCt, - float FunctionY) { - if (FunctionSelection >= 1) { + auto fillTable = [&](int candFlag, + int functionSelection, + float functionInvMass, + float functionCt, + float functionY) { + if (functionSelection >= 1) { auto xicCand = candidate.prong0(); rowCandidateFull( @@ -253,16 +253,16 @@ struct HfTreeCreatorXiccToPKPiPi { xicCand.prong1_as().tofNSigmaKa(), xicCand.prong2_as().tofNSigmaPr(), xicCand.prong2_as().tofNSigmaPi(), - 1 << CandFlag, - FunctionInvMass, + 1 << candFlag, + functionInvMass, candidate.pt(), candidate.p(), candidate.cpa(), candidate.cpaXY(), - FunctionCt, + functionCt, candidate.eta(), candidate.phi(), - FunctionY, + functionY, candidate.flagMcMatchRec(), candidate.originMcRec()); } diff --git a/PWGHF/Tasks/taskCharmHadImpactPar.cxx b/PWGHF/Tasks/taskCharmHadImpactPar.cxx index 01c838df129..b8da8a09ffa 100644 --- a/PWGHF/Tasks/taskCharmHadImpactPar.cxx +++ b/PWGHF/Tasks/taskCharmHadImpactPar.cxx @@ -167,14 +167,14 @@ struct HfTaskCharmHadImpactPar { // Fill THnSparses for the ML analysis /// \param candidate is a particle candidate - template + template void fillSparse(const CCands& candidate) { std::vector outputMl = {-999., -999., -999.}; float invMass{-1.f}; float yCand{-999.f}; - if constexpr (channel == Channel::DplusToKPiPi) { // D+ -> Kpipi - if constexpr (doMc) { + if constexpr (Channel == Channel::DplusToKPiPi) { // D+ -> Kpipi + if constexpr (DoMc) { if (fillOnlySignal) { if (std::abs(candidate.flagMcMatchRec()) != o2::hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi) { return; @@ -183,7 +183,7 @@ struct HfTaskCharmHadImpactPar { } invMass = hfHelper.invMassDplusToPiKPi(candidate); yCand = hfHelper.yDplus(candidate); - if constexpr (withMl) { + if constexpr (WithMl) { for (auto iScore{0u}; iScore < candidate.mlProbDplusToPiKPi().size(); ++iScore) { outputMl[iScore] = candidate.mlProbDplusToPiKPi()[iScore]; } @@ -191,9 +191,9 @@ struct HfTaskCharmHadImpactPar { } else { registry.fill(HIST("hMassPtImpParPhiY"), invMass, candidate.pt(), candidate.impactParameterXY(), candidate.phi(), yCand); } - } else if constexpr (channel == Channel::DzeroToKPi) { + } else if constexpr (Channel == Channel::DzeroToKPi) { if (candidate.isSelD0()) { // D0 -> Kpi - if constexpr (doMc) { + if constexpr (DoMc) { if (fillOnlySignal) { if (std::abs(candidate.flagMcMatchRec()) != o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { return; @@ -202,7 +202,7 @@ struct HfTaskCharmHadImpactPar { } invMass = hfHelper.invMassD0ToPiK(candidate); yCand = hfHelper.yD0(candidate); - if constexpr (withMl) { + if constexpr (WithMl) { for (auto iScore{0u}; iScore < candidate.mlProbD0().size(); ++iScore) { outputMl[iScore] = candidate.mlProbD0()[iScore]; } @@ -214,7 +214,7 @@ struct HfTaskCharmHadImpactPar { if (candidate.isSelD0bar()) { invMass = hfHelper.invMassD0barToKPi(candidate); yCand = hfHelper.yD0(candidate); - if constexpr (withMl) { + if constexpr (WithMl) { for (auto iScore{0u}; iScore < candidate.mlProbD0bar().size(); ++iScore) { outputMl[iScore] = candidate.mlProbD0bar()[iScore]; } @@ -229,7 +229,7 @@ struct HfTaskCharmHadImpactPar { // Fill the TTree with both event and candidate properties /// \param candidate is a particle candidate /// \param collision is the respective collision - template + template void fillTree(const CCands& candidate, const CollType& collision) { std::vector outputMl = {-999., -999., -999.}; @@ -238,22 +238,22 @@ struct HfTaskCharmHadImpactPar { std::array ptProngs = {candidate.ptProng0(), candidate.ptProng1(), -1.}; std::array phiProngs = {RecoDecay::phi(std::array{candidate.pxProng0(), candidate.pyProng0()}), RecoDecay::phi(std::array{candidate.pxProng1(), candidate.pyProng1()}), 99.}; std::array etaProngs = {RecoDecay::eta(std::array{candidate.pxProng0(), candidate.pyProng0(), candidate.pzProng0()}), RecoDecay::eta(std::array{candidate.pxProng1(), candidate.pyProng1(), candidate.pzProng1()}), 99.}; - if constexpr (channel == Channel::DplusToKPiPi) { // D+ -> Kpipi + if constexpr (Channel == Channel::DplusToKPiPi) { // D+ -> Kpipi invMass = hfHelper.invMassDplusToPiKPi(candidate); yCand = hfHelper.yDplus(candidate); ptProngs[2] = candidate.ptProng2(); phiProngs[2] = RecoDecay::phi(candidate.pxProng2(), candidate.pyProng2()); etaProngs[2] = RecoDecay::eta(std::array{candidate.pxProng2(), candidate.pyProng2(), candidate.pzProng2()}); - if constexpr (withMl) { + if constexpr (WithMl) { for (auto iScore{0u}; iScore < candidate.mlProbDplusToPiKPi().size(); ++iScore) { outputMl[iScore] = candidate.mlProbDplusToPiKPi()[iScore]; } } - } else if constexpr (channel == Channel::DzeroToKPi) { + } else if constexpr (Channel == Channel::DzeroToKPi) { if (candidate.isSelD0()) { // D0 -> Kpi invMass = hfHelper.invMassD0ToPiK(candidate); yCand = hfHelper.yD0(candidate); - if constexpr (withMl) { + if constexpr (WithMl) { for (auto iScore{0u}; iScore < candidate.mlProbD0().size(); ++iScore) { outputMl[iScore] = candidate.mlProbD0()[iScore]; } @@ -262,7 +262,7 @@ struct HfTaskCharmHadImpactPar { if (candidate.isSelD0bar()) { invMass = hfHelper.invMassD0barToKPi(candidate); yCand = hfHelper.yD0(candidate); - if constexpr (withMl) { + if constexpr (WithMl) { for (auto iScore{0u}; iScore < candidate.mlProbD0bar().size(); ++iScore) { outputMl[iScore] = candidate.mlProbD0bar()[iScore]; } @@ -279,7 +279,7 @@ struct HfTaskCharmHadImpactPar { } int8_t flagMcMatchRec = 0; - if constexpr (doMc) { + if constexpr (DoMc) { flagMcMatchRec = candidate.flagMcMatchRec(); } double impParZ = candidate.impactParameterXY() * (-1) * candidate.pz() / candidate.pt(); @@ -319,14 +319,14 @@ struct HfTaskCharmHadImpactPar { } /// \param candidates are reconstructed candidates - template + template void runAnalysis(const CCands& candidates, CollisionsCent const&) { for (auto const& candidate : candidates) { auto collision = candidate.template collision_as(); - fillSparse(candidate); + fillSparse(candidate); if (fillLightTreeCandidate) { - fillTree(candidate, collision); + fillTree(candidate, collision); } } } diff --git a/PWGHF/Tasks/taskMcEfficiency.cxx b/PWGHF/Tasks/taskMcEfficiency.cxx index 1f581030bfd..9a9fe7a1283 100644 --- a/PWGHF/Tasks/taskMcEfficiency.cxx +++ b/PWGHF/Tasks/taskMcEfficiency.cxx @@ -124,7 +124,7 @@ struct HfTaskMcEfficiency { return track.isGlobalTrackWoDCA(); } - template + template void candidate3ProngLoop(T1& candidates, T2& tracks, T3& mcParticles, std::vector pdgCodes) { using TracksType = std::decay_t; @@ -175,24 +175,24 @@ struct HfTaskMcEfficiency { bool isHypoMass1SelStep = false; bool isHypoMass2SelStep = false; /// selections from candidate selectors - if constexpr (hasDplus) { + if constexpr (HasDplus) { if (pdgCode == Pdg::kDPlus) { isHypoMass1SelStep = candidate.isSelDplusToPiKPi(); // only one mass hypo for D+ } } - if constexpr (hasDs) { + if constexpr (HasDs) { if (pdgCode == Pdg::kDS) { isHypoMass1SelStep = candidate.isSelDsToKKPi(); isHypoMass2SelStep = candidate.isSelDsToPiKK(); } } - if constexpr (hasLc) { + if constexpr (HasLc) { if (pdgCode == Pdg::kLambdaCPlus) { isHypoMass1SelStep = candidate.isSelLcToPKPi(); isHypoMass2SelStep = candidate.isSelLcToPiKP(); } } - if constexpr (hasXicPlus) { + if constexpr (HasXicPlus) { if (pdgCode == Pdg::kXiCPlus) { isHypoMass1SelStep = candidate.isSelXicToPKPi(); isHypoMass2SelStep = candidate.isSelXicToPiKP(); @@ -201,7 +201,7 @@ struct HfTaskMcEfficiency { bool collisionMatched = false; int origin = RecoDecay::OriginType::None; - if constexpr (mc) { /// info MC used + if constexpr (Mc) { /// info MC used int8_t sign = 0; int indexRec = RecoDecay::getMatchedMCRec(mcParticles, std::array{trackPos, trackNeg, trackThird}, pdgCode, pdgDaughters, true, &sign, 2); @@ -324,7 +324,7 @@ struct HfTaskMcEfficiency { } } - template + template void candidate2ProngLoop(T1 const& candidates, T2 const& tracks, T3 const& mcParticles, std::vector pdgCodes) { using TracksType = std::decay_t; @@ -360,7 +360,7 @@ struct HfTaskMcEfficiency { bool collisionMatched = false; int origin = RecoDecay::OriginType::None; - if constexpr (mc) { + if constexpr (Mc) { auto indexRec = RecoDecay::getMatchedMCRec(mcParticles, std::array{trackPos, trackNeg}, pdgCode, pdgDaughters, false); if (indexRec < 0) { continue; @@ -536,10 +536,10 @@ struct HfTaskMcEfficiency { /// 3-prong analyses - template + template void candidate3ProngMcLoop(C const& candidates, TracksWithSelectionMC const& tracks, aod::McParticles const& mcParticles, aod::McCollisionLabels const&, std::vector pdgCodes) { - candidate3ProngLoop(candidates, tracks, mcParticles, pdgCodes); + candidate3ProngLoop(candidates, tracks, mcParticles, pdgCodes); auto hCandidates = registry.get(HIST("hCandidates")); auto hTrackablePtEta = registry.get(HIST("hTrackablePtEta")); diff --git a/PWGHF/Tasks/taskMcGenPtRapShapes.cxx b/PWGHF/Tasks/taskMcGenPtRapShapes.cxx index 393cf30aefe..7b33ad2afd5 100644 --- a/PWGHF/Tasks/taskMcGenPtRapShapes.cxx +++ b/PWGHF/Tasks/taskMcGenPtRapShapes.cxx @@ -44,10 +44,10 @@ using namespace o2::constants::physics; namespace { const int nCharmHadrons = 10; -constexpr std::array pdgCodesCharm = {Pdg::kD0, Pdg::kDPlus, Pdg::kDS, Pdg::kDStar, Pdg::kLambdaCPlus, Pdg::kSigmaC0, Pdg::kSigmaCPlusPlus, Pdg::kXiC0, Pdg::kXiCPlus, Pdg::kOmegaC0}; +constexpr std::array PdgCodesCharm = {Pdg::kD0, Pdg::kDPlus, Pdg::kDS, Pdg::kDStar, Pdg::kLambdaCPlus, Pdg::kSigmaC0, Pdg::kSigmaCPlusPlus, Pdg::kXiC0, Pdg::kXiCPlus, Pdg::kOmegaC0}; const int nBeautyHadrons = 4; -constexpr std::array pdgCodesBeauty = {Pdg::kB0, Pdg::kBPlus, Pdg::kBS, Pdg::kLambdaB0}; +constexpr std::array PdgCodesBeauty = {Pdg::kB0, Pdg::kBPlus, Pdg::kBS, Pdg::kLambdaB0}; } // namespace struct HfTaskMcGenPtRapShapes { @@ -68,13 +68,13 @@ struct HfTaskMcGenPtRapShapes { { for (auto iCharmHad{0}; iCharmHad < nCharmHadrons; ++iCharmHad) { - histRapVsPtCharmPrompt[iCharmHad] = registry.add(Form("CharmHadrons/hRapVsPtPrompt%d", pdgCodesCharm[iCharmHad]), Form("Prompt %d;#it{p}_{T} (GeV/#it{c});#it{y}", pdgCodesCharm[iCharmHad]), {HistType::kTH2F, {axisPtCharm, axisRapCharm}}); - histRapVsPtCharmNonPrompt[iCharmHad] = registry.add(Form("CharmHadrons/hRapVsPtNonPrompt%d", pdgCodesCharm[iCharmHad]), Form("Non-prompt %d;#it{p}_{T} (GeV/#it{c});#it{y}", pdgCodesCharm[iCharmHad]), {HistType::kTH2F, {axisPtCharm, axisRapCharm}}); - histPtCharmVsPtBeautyNonPrompt[iCharmHad] = registry.add(Form("CharmHadrons/hPtCharmVsPtBeautyNonPrompt%d", pdgCodesCharm[iCharmHad]), Form("Non-prompt %d;#it{p}_{T}(b-had) (GeV/#it{c});#it{p}_{T}(c-had) (GeV/#it{c})", pdgCodesCharm[iCharmHad]), {HistType::kTH2F, {axisPtBeauty, axisPtCharm}}); + histRapVsPtCharmPrompt[iCharmHad] = registry.add(Form("CharmHadrons/hRapVsPtPrompt%d", PdgCodesCharm[iCharmHad]), Form("Prompt %d;#it{p}_{T} (GeV/#it{c});#it{y}", PdgCodesCharm[iCharmHad]), {HistType::kTH2F, {axisPtCharm, axisRapCharm}}); + histRapVsPtCharmNonPrompt[iCharmHad] = registry.add(Form("CharmHadrons/hRapVsPtNonPrompt%d", PdgCodesCharm[iCharmHad]), Form("Non-prompt %d;#it{p}_{T} (GeV/#it{c});#it{y}", PdgCodesCharm[iCharmHad]), {HistType::kTH2F, {axisPtCharm, axisRapCharm}}); + histPtCharmVsPtBeautyNonPrompt[iCharmHad] = registry.add(Form("CharmHadrons/hPtCharmVsPtBeautyNonPrompt%d", PdgCodesCharm[iCharmHad]), Form("Non-prompt %d;#it{p}_{T}(b-had) (GeV/#it{c});#it{p}_{T}(c-had) (GeV/#it{c})", PdgCodesCharm[iCharmHad]), {HistType::kTH2F, {axisPtBeauty, axisPtCharm}}); } for (auto iBeautyHad{0}; iBeautyHad < nBeautyHadrons; ++iBeautyHad) { - histRapVsPtBeauty[iBeautyHad] = registry.add(Form("BeautyHadrons/hRapVsPt%d", pdgCodesBeauty[iBeautyHad]), Form("%d;#it{p}_{T} (GeV/#it{c});#it{y}", pdgCodesBeauty[iBeautyHad]), {HistType::kTH2F, {axisPtBeauty, axisRapBeauty}}); + histRapVsPtBeauty[iBeautyHad] = registry.add(Form("BeautyHadrons/hRapVsPt%d", PdgCodesBeauty[iBeautyHad]), Form("%d;#it{p}_{T} (GeV/#it{c});#it{y}", PdgCodesBeauty[iBeautyHad]), {HistType::kTH2F, {axisPtBeauty, axisRapBeauty}}); } } @@ -84,10 +84,10 @@ struct HfTaskMcGenPtRapShapes { int absPdgCode = std::abs(mcParticle.pdgCode()); float pt = mcParticle.pt(); float rap = mcParticle.y(); - const auto* itCharm = std::find(pdgCodesCharm.begin(), pdgCodesCharm.end(), absPdgCode); - const auto* itBeauty = std::find(pdgCodesBeauty.begin(), pdgCodesBeauty.end(), absPdgCode); - if (itCharm != pdgCodesCharm.end()) { - auto idxCharm = std::distance(pdgCodesCharm.begin(), itCharm); + const auto* itCharm = std::find(PdgCodesCharm.begin(), PdgCodesCharm.end(), absPdgCode); + const auto* itBeauty = std::find(PdgCodesBeauty.begin(), PdgCodesBeauty.end(), absPdgCode); + if (itCharm != PdgCodesCharm.end()) { + auto idxCharm = std::distance(PdgCodesCharm.begin(), itCharm); std::vector idxBhadMothers{}; auto origin = RecoDecay::getCharmHadronOrigin(mcParticles, mcParticle, false, &idxBhadMothers); if (origin == RecoDecay::OriginType::Prompt) { @@ -99,8 +99,8 @@ struct HfTaskMcGenPtRapShapes { histPtCharmVsPtBeautyNonPrompt[idxCharm]->Fill(bMother.pt(), pt); } } - } else if (itBeauty != pdgCodesBeauty.end()) { - auto idxBeauty = std::distance(pdgCodesBeauty.begin(), itBeauty); + } else if (itBeauty != PdgCodesBeauty.end()) { + auto idxBeauty = std::distance(PdgCodesBeauty.begin(), itBeauty); histRapVsPtBeauty[idxBeauty]->Fill(pt, rap); } } diff --git a/PWGHF/Tasks/taskMcValidation.cxx b/PWGHF/Tasks/taskMcValidation.cxx index 0fcf53348f2..ff5c05afe07 100644 --- a/PWGHF/Tasks/taskMcValidation.cxx +++ b/PWGHF/Tasks/taskMcValidation.cxx @@ -97,14 +97,14 @@ enum DecayChannels { DzeroToKPi = 0, XiCzeroToXiPi, OmegaCToOmegaPi, OmegaCToXiPi, - nChannels + NChannels }; // always keep nChannels at the end -constexpr int nCharmMesonChannels = 10; // number of charm meson channels -constexpr int nBeautyChannels = 3; // number of beauty hadron channels -constexpr int nCharmBaryonChannels = nChannels - nCharmMesonChannels - nBeautyChannels; // number of charm baryon channels -constexpr int nOriginTypes = 2; // number of origin types (prompt, non-prompt; only for charm hadrons) -constexpr std::array PDGArrayParticle = {o2::constants::physics::Pdg::kD0, o2::constants::physics::Pdg::kDStar, +constexpr int NCharmMesonChannels = 10; // number of charm meson channels +constexpr int NBeautyChannels = 3; // number of beauty hadron channels +constexpr int NCharmBaryonChannels = NChannels - NCharmMesonChannels - NBeautyChannels; // number of charm baryon channels +constexpr int NOriginTypes = 2; // number of origin types (prompt, non-prompt; only for charm hadrons) +constexpr std::array PDGArrayParticle = {o2::constants::physics::Pdg::kD0, o2::constants::physics::Pdg::kDStar, o2::constants::physics::Pdg::kDPlus, o2::constants::physics::Pdg::kDPlus, o2::constants::physics::Pdg::kDS, o2::constants::physics::Pdg::kDS, o2::constants::physics::Pdg::kDS1, o2::constants::physics::Pdg::kDS2Star, o2::constants::physics::Pdg::kD10, o2::constants::physics::Pdg::kD2Star0, @@ -112,24 +112,24 @@ constexpr std::array PDGArrayParticle = {o2::constants::physics: o2::constants::physics::Pdg::kLambdaCPlus, o2::constants::physics::Pdg::kLambdaCPlus, o2::constants::physics::Pdg::kXiCPlus, o2::constants::physics::Pdg::kXiCPlus, o2::constants::physics::Pdg::kXiC0, o2::constants::physics::Pdg::kOmegaC0, o2::constants::physics::Pdg::kOmegaC0}; -constexpr std::array nDaughters = {2, 3, 3, 3, 3, 3, 5, 5, 4, 4, 4, 3, 4, 3, 3, 3, 5, 4, 4, 4}; -constexpr std::array maxDepthForSearch = {1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 2, 3, 2, 3, 2, 4, 3, 3, 3}; +constexpr std::array NDaughters = {2, 3, 3, 3, 3, 3, 5, 5, 4, 4, 4, 3, 4, 3, 3, 3, 5, 4, 4, 4}; +constexpr std::array MaxDepthForSearch = {1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 2, 3, 2, 3, 2, 4, 3, 3, 3}; // keep coherent indexing with PDGArrayParticle // FIXME: look for a better solution -constexpr std::array, nChannels> arrPDGFinal2Prong = {{{+kPiPlus, -kKPlus}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}}}; -constexpr std::array, nChannels> arrPDGFinal3Prong = {{{}, {+kPiPlus, -kKPlus, +kPiPlus}, {+kPiPlus, -kKPlus, +kPiPlus}, {+kKPlus, -kKPlus, +kPiPlus}, {+kKPlus, -kKPlus, +kPiPlus}, {+kKPlus, -kKPlus, +kPiPlus}, {}, {}, {}, {}, {}, {-kPiPlus, +kKPlus, +kPiPlus}, {}, {+kProton, -kKPlus, +kPiPlus}, {+kProton, -kPiPlus, +kPiPlus}, {+kProton, -kKPlus, +kPiPlus}, {}, {}, {}, {}}}; -constexpr std::array, nChannels> arrPDGFinal4Prong = {{{}, {}, {}, {}, {}, {}, {}, {}, {+kPiPlus, -kKPlus, +kPiPlus, -kPiPlus}, {+kPiPlus, -kKPlus, +kPiPlus, -kPiPlus}, {-kPiPlus, +kKPlus, -kPiPlus, +kPiPlus}, {}, {-kKPlus, +kKPlus, -kPiPlus, +kPiPlus}, {}, {}, {}, {}, {+kPiPlus, -kPiPlus, -kPiPlus, +kProton}, {+kPiPlus, -kKPlus, -kPiPlus, +kProton}, {+kPiPlus, -kPiPlus, -kPiPlus, +kProton}}}; -constexpr std::array, nChannels> arrPDGFinal5Prong = {{{}, {}, {}, {}, {}, {}, {+kPiPlus, -kKPlus, +kPiPlus, +kPiPlus, -kPiPlus}, {+kPiPlus, -kKPlus, +kPiPlus, +kPiPlus, -kPiPlus}, {}, {}, {}, {}, {}, {}, {}, {}, {+kPiPlus, +kPiPlus, -kPiPlus, -kPiPlus, +kProton}, {}, {}, {}}}; -constexpr std::string_view labels[nChannels] = {"D^{0} #rightarrow K#pi", "D*^{+} #rightarrow D^{0}#pi", "D^{+} #rightarrow K#pi#pi", "D^{+} #rightarrow KK#pi", "D_{s}^{+} #rightarrow #Phi#pi #rightarrow KK#pi", +constexpr std::array, NChannels> ArrPdgFinal2Prong = {{{+kPiPlus, -kKPlus}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}}}; +constexpr std::array, NChannels> ArrPdgFinal3Prong = {{{}, {+kPiPlus, -kKPlus, +kPiPlus}, {+kPiPlus, -kKPlus, +kPiPlus}, {+kKPlus, -kKPlus, +kPiPlus}, {+kKPlus, -kKPlus, +kPiPlus}, {+kKPlus, -kKPlus, +kPiPlus}, {}, {}, {}, {}, {}, {-kPiPlus, +kKPlus, +kPiPlus}, {}, {+kProton, -kKPlus, +kPiPlus}, {+kProton, -kPiPlus, +kPiPlus}, {+kProton, -kKPlus, +kPiPlus}, {}, {}, {}, {}}}; +constexpr std::array, NChannels> ArrPdgFinal4Prong = {{{}, {}, {}, {}, {}, {}, {}, {}, {+kPiPlus, -kKPlus, +kPiPlus, -kPiPlus}, {+kPiPlus, -kKPlus, +kPiPlus, -kPiPlus}, {-kPiPlus, +kKPlus, -kPiPlus, +kPiPlus}, {}, {-kKPlus, +kKPlus, -kPiPlus, +kPiPlus}, {}, {}, {}, {}, {+kPiPlus, -kPiPlus, -kPiPlus, +kProton}, {+kPiPlus, -kKPlus, -kPiPlus, +kProton}, {+kPiPlus, -kPiPlus, -kPiPlus, +kProton}}}; +constexpr std::array, NChannels> ArrPdgFinal5Prong = {{{}, {}, {}, {}, {}, {}, {+kPiPlus, -kKPlus, +kPiPlus, +kPiPlus, -kPiPlus}, {+kPiPlus, -kKPlus, +kPiPlus, +kPiPlus, -kPiPlus}, {}, {}, {}, {}, {}, {}, {}, {}, {+kPiPlus, +kPiPlus, -kPiPlus, -kPiPlus, +kProton}, {}, {}, {}}}; +constexpr std::string_view Labels[NChannels] = {"D^{0} #rightarrow K#pi", "D*^{+} #rightarrow D^{0}#pi", "D^{+} #rightarrow K#pi#pi", "D^{+} #rightarrow KK#pi", "D_{s}^{+} #rightarrow #Phi#pi #rightarrow KK#pi", "D_{s}^{+} #rightarrow #bar{K}^{*0}K #rightarrow KK#pi", "D_{s}1 #rightarrow D*^{+}K^{0}_{s}", "D_{s}2* #rightarrow D^{+}K^{0}_{s}", "D1^{0} #rightarrow D*^{+}#pi", "D2^{*} #rightarrow D^{+}#pi", "B^{0} #rightarrow D^{-}#pi", "B^{+} #rightarrow D^{0}#pi", "B_{s}^{+} #rightarrow D_{s}^{-}#pi", "#Lambda_{c}^{+} #rightarrow pK#pi", "#Lambda_{c}^{+} #rightarrow pK^{0}_{s}", "#Xi_{c}^{+} #rightarrow pK#pi", "#Xi_{c}^{+} #rightarrow #Xi#pi#pi", "#Xi_{c}^{0} #rightarrow #Xi#pi", "#Omega_{c}^{0} #rightarrow #Omega#pi", "#Omega_{c}^{0} #rightarrow #Xi#pi"}; -constexpr std::string_view particleNames[nChannels] = {"DzeroToKPi", "DstarToDzeroPi", "DplusToPiKPi", "DplusToPhiPiToKKPi", "DsToPhiPiToKKPi", "DsToK0starKToKKPi", "Ds1ToDStarK0s", "Ds2StarToDPlusK0s", "D10ToDStarPi", "D2Star0ToDPlusPi", "B0ToDminusPi", "BplusToD0Pi", "BsToDsPi", +constexpr std::string_view ParticleNames[NChannels] = {"DzeroToKPi", "DstarToDzeroPi", "DplusToPiKPi", "DplusToPhiPiToKKPi", "DsToPhiPiToKKPi", "DsToK0starKToKKPi", "Ds1ToDStarK0s", "Ds2StarToDPlusK0s", "D10ToDStarPi", "D2Star0ToDPlusPi", "B0ToDminusPi", "BplusToD0Pi", "BsToDsPi", "LcToPKPi", "LcToPiK0s", "XiCplusToPKPi", "XiCplusToXiPiPi", "XiCzeroToXiPi", "OmegaCToOmegaPi", "OmegaCToXiPi"}; -constexpr std::string_view originNames[nOriginTypes] = {"Prompt", "NonPrompt"}; +constexpr std::string_view OriginNames[NOriginTypes] = {"Prompt", "NonPrompt"}; } // namespace /// Generated Level Validation @@ -155,16 +155,16 @@ struct HfTaskMcValidationGen { HfEventSelectionMc hfEvSelMc; // mc event selection and monitoring - AxisSpec axisNhadrons{nChannels, -0.5, static_cast(nChannels) - 0.5}; + AxisSpec axisNhadrons{NChannels, -0.5, static_cast(NChannels) - 0.5}; AxisSpec axisNquarks{20, -0.5, 19.5}; AxisSpec axisResiduals{100, -0.01, 0.01}; AxisSpec axisPt{100, 0., 50.}; AxisSpec axisY{100, -5., 5.}; AxisSpec axisCent{110, 0., 110.}; AxisSpec axisOcc{3000, 0., 15000.}; - AxisSpec axisCharmMesonSpecies{nCharmMesonChannels, -0.5, static_cast(nCharmMesonChannels) - 0.5}; - AxisSpec axisBeautySpecies{nBeautyChannels, -0.5, static_cast(nBeautyChannels) - 0.5}; - AxisSpec axisCharmBaryonSpecies{nCharmBaryonChannels, -0.5, static_cast(nCharmBaryonChannels) - 0.5}; + AxisSpec axisCharmMesonSpecies{NCharmMesonChannels, -0.5, static_cast(NCharmMesonChannels) - 0.5}; + AxisSpec axisBeautySpecies{NBeautyChannels, -0.5, static_cast(NBeautyChannels) - 0.5}; + AxisSpec axisCharmBaryonSpecies{NCharmBaryonChannels, -0.5, static_cast(NCharmBaryonChannels) - 0.5}; AxisSpec axisDecLen{100, 0., 10000.}; HistogramRegistry registry{ @@ -217,51 +217,51 @@ struct HfTaskMcValidationGen { } // add per species histograms - for (auto originName : originNames) { - for (int iChannel = 0; iChannel < nCharmMesonChannels; iChannel++) { // Charm mesons - registry.add(Form("%sCharmMesons/hCount%s%s", originName.data(), originName.data(), particleNames[iChannel].data()), - Form("Event counter - %s %s; Events Per Collision; entries", originName.data(), labels[iChannel].data()), {HistType::kTH1F, {axisNhadrons}}); + for (auto originName : OriginNames) { + for (int iChannel = 0; iChannel < NCharmMesonChannels; iChannel++) { // Charm mesons + registry.add(Form("%sCharmMesons/hCount%s%s", originName.data(), originName.data(), ParticleNames[iChannel].data()), + Form("Event counter - %s %s; Events Per Collision; entries", originName.data(), Labels[iChannel].data()), {HistType::kTH1F, {axisNhadrons}}); } - for (int iChannel = nCharmMesonChannels + nBeautyChannels; iChannel < nChannels; iChannel++) { // Charm baryons - registry.add(Form("%sCharmBaryons/hCount%s%s", originName.data(), originName.data(), particleNames[iChannel].data()), - Form("Event counter - %s %s; Events Per Collision; entries", originName.data(), labels[iChannel].data()), {HistType::kTH1F, {axisNhadrons}}); + for (int iChannel = NCharmMesonChannels + NBeautyChannels; iChannel < NChannels; iChannel++) { // Charm baryons + registry.add(Form("%sCharmBaryons/hCount%s%s", originName.data(), originName.data(), ParticleNames[iChannel].data()), + Form("Event counter - %s %s; Events Per Collision; entries", originName.data(), Labels[iChannel].data()), {HistType::kTH1F, {axisNhadrons}}); } } - for (int iChannel = nCharmMesonChannels; iChannel < nCharmMesonChannels + nBeautyChannels; iChannel++) { // Beauty mesons - registry.add(Form("Beauty/hCount%s", particleNames[iChannel].data()), - Form("Event counter - %s; Events Per Collision; entries", labels[iChannel].data()), {HistType::kTH1F, {axisNhadrons}}); + for (int iChannel = NCharmMesonChannels; iChannel < NCharmMesonChannels + NBeautyChannels; iChannel++) { // Beauty mesons + registry.add(Form("Beauty/hCount%s", ParticleNames[iChannel].data()), + Form("Event counter - %s; Events Per Collision; entries", Labels[iChannel].data()), {HistType::kTH1F, {axisNhadrons}}); } - for (auto iBin = 1; iBin <= nCharmMesonChannels; ++iBin) { - registry.get(HIST("PromptCharmMesons/hPromptMesonsPtDistr"))->GetXaxis()->SetBinLabel(iBin, labels[iBin - 1].data()); - registry.get(HIST("PromptCharmMesons/hPromptMesonsPtCentDistr"))->GetXaxis()->SetBinLabel(iBin, labels[iBin - 1].data()); - registry.get(HIST("PromptCharmMesons/hPromptMesonsPtOccDistr"))->GetXaxis()->SetBinLabel(iBin, labels[iBin - 1].data()); - registry.get(HIST("PromptCharmMesons/hPromptMesonsYDistr"))->GetXaxis()->SetBinLabel(iBin, labels[iBin - 1].data()); - registry.get(HIST("PromptCharmMesons/hPromptMesonsDecLenDistr"))->GetXaxis()->SetBinLabel(iBin, labels[iBin - 1].data()); - registry.get(HIST("NonPromptCharmMesons/hNonPromptMesonsPtDistr"))->GetXaxis()->SetBinLabel(iBin, labels[iBin - 1].data()); - registry.get(HIST("NonPromptCharmMesons/hNonPromptMesonsPtCentDistr"))->GetXaxis()->SetBinLabel(iBin, labels[iBin - 1].data()); - registry.get(HIST("NonPromptCharmMesons/hNonPromptMesonsPtOccDistr"))->GetXaxis()->SetBinLabel(iBin, labels[iBin - 1].data()); - registry.get(HIST("NonPromptCharmMesons/hNonPromptMesonsYDistr"))->GetXaxis()->SetBinLabel(iBin, labels[iBin - 1].data()); - registry.get(HIST("NonPromptCharmMesons/hNonPromptMesonsDecLenDistr"))->GetXaxis()->SetBinLabel(iBin, labels[iBin - 1].data()); + for (auto iBin = 1; iBin <= NCharmMesonChannels; ++iBin) { + registry.get(HIST("PromptCharmMesons/hPromptMesonsPtDistr"))->GetXaxis()->SetBinLabel(iBin, Labels[iBin - 1].data()); + registry.get(HIST("PromptCharmMesons/hPromptMesonsPtCentDistr"))->GetXaxis()->SetBinLabel(iBin, Labels[iBin - 1].data()); + registry.get(HIST("PromptCharmMesons/hPromptMesonsPtOccDistr"))->GetXaxis()->SetBinLabel(iBin, Labels[iBin - 1].data()); + registry.get(HIST("PromptCharmMesons/hPromptMesonsYDistr"))->GetXaxis()->SetBinLabel(iBin, Labels[iBin - 1].data()); + registry.get(HIST("PromptCharmMesons/hPromptMesonsDecLenDistr"))->GetXaxis()->SetBinLabel(iBin, Labels[iBin - 1].data()); + registry.get(HIST("NonPromptCharmMesons/hNonPromptMesonsPtDistr"))->GetXaxis()->SetBinLabel(iBin, Labels[iBin - 1].data()); + registry.get(HIST("NonPromptCharmMesons/hNonPromptMesonsPtCentDistr"))->GetXaxis()->SetBinLabel(iBin, Labels[iBin - 1].data()); + registry.get(HIST("NonPromptCharmMesons/hNonPromptMesonsPtOccDistr"))->GetXaxis()->SetBinLabel(iBin, Labels[iBin - 1].data()); + registry.get(HIST("NonPromptCharmMesons/hNonPromptMesonsYDistr"))->GetXaxis()->SetBinLabel(iBin, Labels[iBin - 1].data()); + registry.get(HIST("NonPromptCharmMesons/hNonPromptMesonsDecLenDistr"))->GetXaxis()->SetBinLabel(iBin, Labels[iBin - 1].data()); } - for (auto iBin = 1; iBin <= nBeautyChannels; ++iBin) { - registry.get(HIST("Beauty/hPtDistr"))->GetXaxis()->SetBinLabel(iBin, labels[iBin + nCharmMesonChannels - 1].data()); - registry.get(HIST("Beauty/hPtCentDistr"))->GetXaxis()->SetBinLabel(iBin, labels[iBin + nCharmMesonChannels - 1].data()); - registry.get(HIST("Beauty/hPtOccDistr"))->GetXaxis()->SetBinLabel(iBin, labels[iBin + nCharmMesonChannels - 1].data()); - registry.get(HIST("Beauty/hYDistr"))->GetXaxis()->SetBinLabel(iBin, labels[iBin + nCharmMesonChannels - 1].data()); - registry.get(HIST("Beauty/hDecLenDistr"))->GetXaxis()->SetBinLabel(iBin, labels[iBin + nCharmMesonChannels - 1].data()); + for (auto iBin = 1; iBin <= NBeautyChannels; ++iBin) { + registry.get(HIST("Beauty/hPtDistr"))->GetXaxis()->SetBinLabel(iBin, Labels[iBin + NCharmMesonChannels - 1].data()); + registry.get(HIST("Beauty/hPtCentDistr"))->GetXaxis()->SetBinLabel(iBin, Labels[iBin + NCharmMesonChannels - 1].data()); + registry.get(HIST("Beauty/hPtOccDistr"))->GetXaxis()->SetBinLabel(iBin, Labels[iBin + NCharmMesonChannels - 1].data()); + registry.get(HIST("Beauty/hYDistr"))->GetXaxis()->SetBinLabel(iBin, Labels[iBin + NCharmMesonChannels - 1].data()); + registry.get(HIST("Beauty/hDecLenDistr"))->GetXaxis()->SetBinLabel(iBin, Labels[iBin + NCharmMesonChannels - 1].data()); } - for (auto iBin = 1; iBin <= nCharmBaryonChannels; ++iBin) { - registry.get(HIST("PromptCharmBaryons/hPromptBaryonsPtDistr"))->GetXaxis()->SetBinLabel(iBin, labels[iBin + nCharmMesonChannels + nBeautyChannels - 1].data()); - registry.get(HIST("PromptCharmBaryons/hPromptBaryonsPtCentDistr"))->GetXaxis()->SetBinLabel(iBin, labels[iBin + nCharmMesonChannels + nBeautyChannels - 1].data()); - registry.get(HIST("PromptCharmBaryons/hPromptBaryonsPtOccDistr"))->GetXaxis()->SetBinLabel(iBin, labels[iBin + nCharmMesonChannels + nBeautyChannels - 1].data()); - registry.get(HIST("PromptCharmBaryons/hPromptBaryonsYDistr"))->GetXaxis()->SetBinLabel(iBin, labels[iBin + nCharmMesonChannels + nBeautyChannels - 1].data()); - registry.get(HIST("PromptCharmBaryons/hPromptBaryonsDecLenDistr"))->GetXaxis()->SetBinLabel(iBin, labels[iBin + nCharmMesonChannels + nBeautyChannels - 1].data()); - registry.get(HIST("NonPromptCharmBaryons/hNonPromptBaryonsPtDistr"))->GetXaxis()->SetBinLabel(iBin, labels[iBin + nCharmMesonChannels + nBeautyChannels - 1].data()); - registry.get(HIST("NonPromptCharmBaryons/hNonPromptBaryonsPtCentDistr"))->GetXaxis()->SetBinLabel(iBin, labels[iBin + nCharmMesonChannels + nBeautyChannels - 1].data()); - registry.get(HIST("NonPromptCharmBaryons/hNonPromptBaryonsPtOccDistr"))->GetXaxis()->SetBinLabel(iBin, labels[iBin + nCharmMesonChannels + nBeautyChannels - 1].data()); - registry.get(HIST("NonPromptCharmBaryons/hNonPromptBaryonsYDistr"))->GetXaxis()->SetBinLabel(iBin, labels[iBin + nCharmMesonChannels + nBeautyChannels - 1].data()); - registry.get(HIST("NonPromptCharmBaryons/hNonPromptBaryonsDecLenDistr"))->GetXaxis()->SetBinLabel(iBin, labels[iBin + nCharmMesonChannels + nBeautyChannels - 1].data()); + for (auto iBin = 1; iBin <= NCharmBaryonChannels; ++iBin) { + registry.get(HIST("PromptCharmBaryons/hPromptBaryonsPtDistr"))->GetXaxis()->SetBinLabel(iBin, Labels[iBin + NCharmMesonChannels + NBeautyChannels - 1].data()); + registry.get(HIST("PromptCharmBaryons/hPromptBaryonsPtCentDistr"))->GetXaxis()->SetBinLabel(iBin, Labels[iBin + NCharmMesonChannels + NBeautyChannels - 1].data()); + registry.get(HIST("PromptCharmBaryons/hPromptBaryonsPtOccDistr"))->GetXaxis()->SetBinLabel(iBin, Labels[iBin + NCharmMesonChannels + NBeautyChannels - 1].data()); + registry.get(HIST("PromptCharmBaryons/hPromptBaryonsYDistr"))->GetXaxis()->SetBinLabel(iBin, Labels[iBin + NCharmMesonChannels + NBeautyChannels - 1].data()); + registry.get(HIST("PromptCharmBaryons/hPromptBaryonsDecLenDistr"))->GetXaxis()->SetBinLabel(iBin, Labels[iBin + NCharmMesonChannels + NBeautyChannels - 1].data()); + registry.get(HIST("NonPromptCharmBaryons/hNonPromptBaryonsPtDistr"))->GetXaxis()->SetBinLabel(iBin, Labels[iBin + NCharmMesonChannels + NBeautyChannels - 1].data()); + registry.get(HIST("NonPromptCharmBaryons/hNonPromptBaryonsPtCentDistr"))->GetXaxis()->SetBinLabel(iBin, Labels[iBin + NCharmMesonChannels + NBeautyChannels - 1].data()); + registry.get(HIST("NonPromptCharmBaryons/hNonPromptBaryonsPtOccDistr"))->GetXaxis()->SetBinLabel(iBin, Labels[iBin + NCharmMesonChannels + NBeautyChannels - 1].data()); + registry.get(HIST("NonPromptCharmBaryons/hNonPromptBaryonsYDistr"))->GetXaxis()->SetBinLabel(iBin, Labels[iBin + NCharmMesonChannels + NBeautyChannels - 1].data()); + registry.get(HIST("NonPromptCharmBaryons/hNonPromptBaryonsDecLenDistr"))->GetXaxis()->SetBinLabel(iBin, Labels[iBin + NCharmMesonChannels + NBeautyChannels - 1].data()); } // inspect for which particle species the candidates were created and which zPvPosMax cut was set for reconstructed @@ -276,8 +276,8 @@ struct HfTaskMcValidationGen { hfEvSelMc.addHistograms(registry); // particles monitoring } - template - void runCheckGenParticles(GenColl const& mcCollision, Particles const& mcParticles, RecoColls const& recoCollisions, BCsInfo const&, std::array& counterPrompt, std::array& counterNonPrompt) + template + void runCheckGenParticles(GenColl const& mcCollision, Particles const& mcParticles, RecoColls const& recoCollisions, BCsInfo const&, std::array& counterPrompt, std::array& counterNonPrompt) { if (eventGeneratorType >= 0 && mcCollision.getSubGeneratorId() != eventGeneratorType) { return; @@ -291,14 +291,14 @@ struct HfTaskMcValidationGen { occupancy = o2::hf_occupancy::getOccupancyGenColl(recoCollisions, OccupancyEstimator::Its); } o2::hf_evsel::HfCollisionRejectionMask rejectionMask{}; - if constexpr (centEstimator == CentralityEstimator::FT0C) { - rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, recoCollisions, centrality); - } else if constexpr (centEstimator == CentralityEstimator::FT0M) { - rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, recoCollisions, centrality); - } else if constexpr (centEstimator == CentralityEstimator::None) { - rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, recoCollisions, centrality); + if constexpr (CentEstimator == CentralityEstimator::FT0C) { + rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, recoCollisions, centrality); + } else if constexpr (CentEstimator == CentralityEstimator::FT0M) { + rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, recoCollisions, centrality); + } else if constexpr (CentEstimator == CentralityEstimator::None) { + rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, recoCollisions, centrality); } - hfEvSelMc.fillHistograms(mcCollision, rejectionMask); + hfEvSelMc.fillHistograms(mcCollision, rejectionMask); if (rejectionMask != 0) { return; } @@ -356,14 +356,14 @@ struct HfTaskMcValidationGen { std::vector listDaughters{}; // Check that the decay channel is correct and retrieve the daughters - if (nDaughters[iD] == 2) { - if (!RecoDecay::isMatchedMCGen(mcParticles, particle, PDGArrayParticle[iD], arrPDGFinal2Prong[iD], true, nullptr, maxDepthForSearch[iD], &listDaughters)) { + if (NDaughters[iD] == 2) { + if (!RecoDecay::isMatchedMCGen(mcParticles, particle, PDGArrayParticle[iD], ArrPdgFinal2Prong[iD], true, nullptr, MaxDepthForSearch[iD], &listDaughters)) { continue; } } - if (nDaughters[iD] == 3) { - if (!RecoDecay::isMatchedMCGen(mcParticles, particle, PDGArrayParticle[iD], arrPDGFinal3Prong[iD], true, nullptr, maxDepthForSearch[iD], &listDaughters)) { + if (NDaughters[iD] == 3) { + if (!RecoDecay::isMatchedMCGen(mcParticles, particle, PDGArrayParticle[iD], ArrPdgFinal3Prong[iD], true, nullptr, MaxDepthForSearch[iD], &listDaughters)) { continue; } if (iD == DstarToDzeroPi && @@ -390,13 +390,13 @@ struct HfTaskMcValidationGen { } } - if (nDaughters[iD] == 4) { + if (NDaughters[iD] == 4) { if (iD != B0ToDminusPi) { - if (!RecoDecay::isMatchedMCGen(mcParticles, particle, PDGArrayParticle[iD], arrPDGFinal4Prong[iD], true, nullptr, maxDepthForSearch[iD], &listDaughters)) { + if (!RecoDecay::isMatchedMCGen(mcParticles, particle, PDGArrayParticle[iD], ArrPdgFinal4Prong[iD], true, nullptr, MaxDepthForSearch[iD], &listDaughters)) { continue; } } else { // For B0 we consider flavour oscillations - if (!RecoDecay::isMatchedMCGen(mcParticles, particle, PDGArrayParticle[iD], arrPDGFinal4Prong[iD], true, nullptr, maxDepthForSearch[iD], &listDaughters)) { + if (!RecoDecay::isMatchedMCGen(mcParticles, particle, PDGArrayParticle[iD], ArrPdgFinal4Prong[iD], true, nullptr, MaxDepthForSearch[iD], &listDaughters)) { continue; } } @@ -426,8 +426,8 @@ struct HfTaskMcValidationGen { } } - if (nDaughters[iD] == 5) { - if (!RecoDecay::isMatchedMCGen(mcParticles, particle, PDGArrayParticle[iD], arrPDGFinal5Prong[iD], true, nullptr, maxDepthForSearch[iD], &listDaughters)) { + if (NDaughters[iD] == 5) { + if (!RecoDecay::isMatchedMCGen(mcParticles, particle, PDGArrayParticle[iD], ArrPdgFinal5Prong[iD], true, nullptr, MaxDepthForSearch[iD], &listDaughters)) { continue; } if (iD == Ds1ToDStarK0s && @@ -473,7 +473,7 @@ struct HfTaskMcValidationGen { registry.fill(HIST("hPtDiffMotherDaughterGen"), ptDiff); int origin{0}; - if (iD < nCharmMesonChannels || iD >= nCharmMesonChannels + nBeautyChannels) { // Charm hadrons + if (iD < NCharmMesonChannels || iD >= NCharmMesonChannels + NBeautyChannels) { // Charm hadrons origin = RecoDecay::getCharmHadronOrigin(mcParticles, particle); if (origin == RecoDecay::OriginType::Prompt) { counterPrompt[iD]++; @@ -486,7 +486,7 @@ struct HfTaskMcValidationGen { double vertexDau[3] = {daughter0.vx(), daughter0.vy(), daughter0.vz()}; double vertexPrimary[3] = {mcCollision.posX(), mcCollision.posY(), mcCollision.posZ()}; auto decayLength = RecoDecay::distance(vertexPrimary, vertexDau); - if (iD < nCharmMesonChannels) { + if (iD < NCharmMesonChannels) { if (origin == RecoDecay::OriginType::Prompt) { // Prompt charm mesons if (std::abs(particle.y()) < 0.5) { registry.fill(HIST("PromptCharmMesons/hPromptMesonsPtDistr"), iD, particle.pt()); @@ -508,34 +508,34 @@ struct HfTaskMcValidationGen { registry.fill(HIST("NonPromptCharmMesons/hNonPromptMesonsYDistr"), iD, particle.y()); registry.fill(HIST("NonPromptCharmMesons/hNonPromptMesonsDecLenDistr"), iD, decayLength * 10000); } - } else if (iD < nCharmMesonChannels + nBeautyChannels) { // Beauty mesons + } else if (iD < NCharmMesonChannels + NBeautyChannels) { // Beauty mesons if (std::abs(particle.y()) < 0.5) { - registry.fill(HIST("Beauty/hPtDistr"), iD - nCharmMesonChannels, particle.pt()); - registry.fill(HIST("Beauty/hPtCentDistr"), iD - nCharmMesonChannels, particle.pt(), centrality); + registry.fill(HIST("Beauty/hPtDistr"), iD - NCharmMesonChannels, particle.pt()); + registry.fill(HIST("Beauty/hPtCentDistr"), iD - NCharmMesonChannels, particle.pt(), centrality); } - registry.fill(HIST("Beauty/hYDistr"), iD - nCharmMesonChannels, particle.y()); - registry.fill(HIST("Beauty/hDecLenDistr"), iD - nCharmMesonChannels, decayLength * 10000); + registry.fill(HIST("Beauty/hYDistr"), iD - NCharmMesonChannels, particle.y()); + registry.fill(HIST("Beauty/hDecLenDistr"), iD - NCharmMesonChannels, decayLength * 10000); } else { // Charm baryons if (origin == RecoDecay::OriginType::Prompt) { if (std::abs(particle.y()) < 0.5) { - registry.fill(HIST("PromptCharmBaryons/hPromptBaryonsPtDistr"), iD - nCharmMesonChannels - nBeautyChannels, particle.pt()); - registry.fill(HIST("PromptCharmBaryons/hPromptBaryonsPtCentDistr"), iD - nCharmMesonChannels - nBeautyChannels, particle.pt(), centrality); + registry.fill(HIST("PromptCharmBaryons/hPromptBaryonsPtDistr"), iD - NCharmMesonChannels - NBeautyChannels, particle.pt()); + registry.fill(HIST("PromptCharmBaryons/hPromptBaryonsPtCentDistr"), iD - NCharmMesonChannels - NBeautyChannels, particle.pt(), centrality); if (storeOccupancy) { - registry.fill(HIST("PromptCharmBaryons/hPromptBaryonsPtOccDistr"), iD - nCharmMesonChannels - nBeautyChannels, particle.pt(), occupancy); + registry.fill(HIST("PromptCharmBaryons/hPromptBaryonsPtOccDistr"), iD - NCharmMesonChannels - NBeautyChannels, particle.pt(), occupancy); } } - registry.fill(HIST("PromptCharmBaryons/hPromptBaryonsYDistr"), iD - nCharmMesonChannels - nBeautyChannels, particle.y()); - registry.fill(HIST("PromptCharmBaryons/hPromptBaryonsDecLenDistr"), iD - nCharmMesonChannels - nBeautyChannels, decayLength * 10000); + registry.fill(HIST("PromptCharmBaryons/hPromptBaryonsYDistr"), iD - NCharmMesonChannels - NBeautyChannels, particle.y()); + registry.fill(HIST("PromptCharmBaryons/hPromptBaryonsDecLenDistr"), iD - NCharmMesonChannels - NBeautyChannels, decayLength * 10000); } else if (origin == RecoDecay::OriginType::NonPrompt) { if (std::abs(particle.y()) < 0.5) { - registry.fill(HIST("NonPromptCharmBaryons/hNonPromptBaryonsPtDistr"), iD - nCharmMesonChannels - nBeautyChannels, particle.pt()); - registry.fill(HIST("NonPromptCharmBaryons/hNonPromptBaryonsPtCentDistr"), iD - nCharmMesonChannels - nBeautyChannels, particle.pt(), centrality); + registry.fill(HIST("NonPromptCharmBaryons/hNonPromptBaryonsPtDistr"), iD - NCharmMesonChannels - NBeautyChannels, particle.pt()); + registry.fill(HIST("NonPromptCharmBaryons/hNonPromptBaryonsPtCentDistr"), iD - NCharmMesonChannels - NBeautyChannels, particle.pt(), centrality); if (storeOccupancy) { - registry.fill(HIST("NonPromptCharmBaryons/hNonPromptBaryonsPtOccDistr"), iD - nCharmMesonChannels - nBeautyChannels, particle.pt(), occupancy); + registry.fill(HIST("NonPromptCharmBaryons/hNonPromptBaryonsPtOccDistr"), iD - NCharmMesonChannels - NBeautyChannels, particle.pt(), occupancy); } } - registry.fill(HIST("NonPromptCharmBaryons/hNonPromptBaryonsYDistr"), iD - nCharmMesonChannels - nBeautyChannels, particle.y()); - registry.fill(HIST("NonPromptCharmBaryons/hNonPromptBaryonsDecLenDistr"), iD - nCharmMesonChannels - nBeautyChannels, decayLength * 10000); + registry.fill(HIST("NonPromptCharmBaryons/hNonPromptBaryonsYDistr"), iD - NCharmMesonChannels - NBeautyChannels, particle.y()); + registry.fill(HIST("NonPromptCharmBaryons/hNonPromptBaryonsDecLenDistr"), iD - NCharmMesonChannels - NBeautyChannels, decayLength * 10000); } } } @@ -555,21 +555,21 @@ struct HfTaskMcValidationGen { for (const auto& mcCollision : mcCollisions) { const auto recoCollsPerMcColl = recoCollisions.sliceBy(colPerMcCollision, mcCollision.globalIndex()); const auto mcParticlesPerMcColl = mcParticles.sliceBy(mcParticlesPerMcCollision, mcCollision.globalIndex()); - std::array counterPrompt{0}, counterNonPrompt{0}; + std::array counterPrompt{0}, counterNonPrompt{0}; runCheckGenParticles(mcCollision, mcParticlesPerMcColl, recoCollsPerMcColl, bcInfo, counterPrompt, counterNonPrompt); - static_for<0, nCharmMesonChannels - 1>([&](auto i) { // Charm mesons - constexpr int index = i.value; - registry.fill(HIST("PromptCharmMesons/hCountPrompt") + HIST(particleNames[index]), counterPrompt[index]); - registry.fill(HIST("NonPromptCharmMesons/hCountNonPrompt") + HIST(particleNames[index]), counterNonPrompt[index]); + static_for<0, NCharmMesonChannels - 1>([&](auto i) { // Charm mesons + constexpr int Index = i.value; + registry.fill(HIST("PromptCharmMesons/hCountPrompt") + HIST(ParticleNames[Index]), counterPrompt[Index]); + registry.fill(HIST("NonPromptCharmMesons/hCountNonPrompt") + HIST(ParticleNames[Index]), counterNonPrompt[Index]); }); - static_for([&](auto i) { // Beauty hadrons - constexpr int index = i.value; - registry.fill(HIST("Beauty/hCount") + HIST(particleNames[index]), counterPrompt[index]); + static_for([&](auto i) { // Beauty hadrons + constexpr int Index = i.value; + registry.fill(HIST("Beauty/hCount") + HIST(ParticleNames[Index]), counterPrompt[Index]); }); - static_for([&](auto i) { // Charm baryons - constexpr int index = i.value; - registry.fill(HIST("PromptCharmBaryons/hCountPrompt") + HIST(particleNames[index]), counterPrompt[index]); - registry.fill(HIST("NonPromptCharmBaryons/hCountNonPrompt") + HIST(particleNames[index]), counterNonPrompt[index]); + static_for([&](auto i) { // Charm baryons + constexpr int Index = i.value; + registry.fill(HIST("PromptCharmBaryons/hCountPrompt") + HIST(ParticleNames[Index]), counterPrompt[Index]); + registry.fill(HIST("NonPromptCharmBaryons/hCountNonPrompt") + HIST(ParticleNames[Index]), counterNonPrompt[Index]); }); } } // end processNoCentSel @@ -583,21 +583,21 @@ struct HfTaskMcValidationGen { for (const auto& mcCollision : mcCollisions) { const auto recoCollsPerMcColl = recoCollisions.sliceBy(colPerMcCollisionFT0C, mcCollision.globalIndex()); const auto mcParticlesPerMcColl = mcParticles.sliceBy(mcParticlesPerMcCollision, mcCollision.globalIndex()); - std::array counterPrompt{0}, counterNonPrompt{0}; + std::array counterPrompt{0}, counterNonPrompt{0}; runCheckGenParticles(mcCollision, mcParticlesPerMcColl, recoCollsPerMcColl, bcInfo, counterPrompt, counterNonPrompt); - static_for<0, nCharmMesonChannels - 1>([&](auto i) { // Charm mesons - constexpr int index = i.value; - registry.fill(HIST("PromptCharmMesons/hCountPrompt") + HIST(particleNames[index]), counterPrompt[index]); - registry.fill(HIST("NonPromptCharmMesons/hCountNonPrompt") + HIST(particleNames[index]), counterNonPrompt[index]); + static_for<0, NCharmMesonChannels - 1>([&](auto i) { // Charm mesons + constexpr int Index = i.value; + registry.fill(HIST("PromptCharmMesons/hCountPrompt") + HIST(ParticleNames[Index]), counterPrompt[Index]); + registry.fill(HIST("NonPromptCharmMesons/hCountNonPrompt") + HIST(ParticleNames[Index]), counterNonPrompt[Index]); }); - static_for([&](auto i) { // Beauty - constexpr int index = i.value; - registry.fill(HIST("Beauty/hCount") + HIST(particleNames[index]), counterPrompt[index]); + static_for([&](auto i) { // Beauty + constexpr int Index = i.value; + registry.fill(HIST("Beauty/hCount") + HIST(ParticleNames[Index]), counterPrompt[Index]); }); - static_for([&](auto i) { // Charm baryons - constexpr int index = i.value; - registry.fill(HIST("PromptCharmBaryons/hCountPrompt") + HIST(particleNames[index]), counterPrompt[index]); - registry.fill(HIST("NonPromptCharmBaryons/hCountNonPrompt") + HIST(particleNames[index]), counterNonPrompt[index]); + static_for([&](auto i) { // Charm baryons + constexpr int Index = i.value; + registry.fill(HIST("PromptCharmBaryons/hCountPrompt") + HIST(ParticleNames[Index]), counterPrompt[Index]); + registry.fill(HIST("NonPromptCharmBaryons/hCountNonPrompt") + HIST(ParticleNames[Index]), counterNonPrompt[Index]); }); } } // end processCentFT0C @@ -611,21 +611,21 @@ struct HfTaskMcValidationGen { for (const auto& mcCollision : mcCollisions) { const auto recoCollsPerMcColl = recoCollisions.sliceBy(colPerMcCollisionFT0M, mcCollision.globalIndex()); const auto mcParticlesPerMcColl = mcParticles.sliceBy(mcParticlesPerMcCollision, mcCollision.globalIndex()); - std::array counterPrompt{0}, counterNonPrompt{0}; + std::array counterPrompt{0}, counterNonPrompt{0}; runCheckGenParticles(mcCollision, mcParticlesPerMcColl, recoCollsPerMcColl, bcInfo, counterPrompt, counterNonPrompt); - static_for<0, nCharmMesonChannels - 1>([&](auto i) { // Charm mesons - constexpr int index = i.value; - registry.fill(HIST("PromptCharmMesons/hCountPrompt") + HIST(particleNames[index]), counterPrompt[index]); - registry.fill(HIST("NonPromptCharmMesons/hCountNonPrompt") + HIST(particleNames[index]), counterNonPrompt[index]); + static_for<0, NCharmMesonChannels - 1>([&](auto i) { // Charm mesons + constexpr int Index = i.value; + registry.fill(HIST("PromptCharmMesons/hCountPrompt") + HIST(ParticleNames[Index]), counterPrompt[Index]); + registry.fill(HIST("NonPromptCharmMesons/hCountNonPrompt") + HIST(ParticleNames[Index]), counterNonPrompt[Index]); }); - static_for([&](auto i) { // Beauty mesons - constexpr int index = i.value; - registry.fill(HIST("Beauty/hCount") + HIST(particleNames[index]), counterPrompt[index]); + static_for([&](auto i) { // Beauty mesons + constexpr int Index = i.value; + registry.fill(HIST("Beauty/hCount") + HIST(ParticleNames[Index]), counterPrompt[Index]); }); - static_for([&](auto i) { // Charm baryons - constexpr int index = i.value; - registry.fill(HIST("PromptCharmBaryons/hCountPrompt") + HIST(particleNames[index]), counterPrompt[index]); - registry.fill(HIST("NonPromptCharmBaryons/hCountNonPrompt") + HIST(particleNames[index]), counterNonPrompt[index]); + static_for([&](auto i) { // Charm baryons + constexpr int Index = i.value; + registry.fill(HIST("PromptCharmBaryons/hCountPrompt") + HIST(ParticleNames[Index]), counterPrompt[Index]); + registry.fill(HIST("NonPromptCharmBaryons/hCountNonPrompt") + HIST(ParticleNames[Index]), counterNonPrompt[Index]); }); } } // end processCentFT0M @@ -643,10 +643,10 @@ struct HfTaskMcValidationRec { Configurable eventGeneratorType{"eventGeneratorType", -1, "If positive, enable event selection using subGeneratorId information. The value indicates which events to keep (0 = MB, 4 = charm triggered, 5 = beauty triggered)"}; Configurable storeOccupancy{"storeOccupancy", false, "Store collision occupancy for dedicated studies"}; - std::array, nChannels> histDeltaPt, histDeltaPx, histDeltaPy, histDeltaPz, histDeltaSecondaryVertexX, histDeltaSecondaryVertexY, histDeltaSecondaryVertexZ, histDeltaDecayLength; - std::array, 2>, nChannels> histPtCentReco; - std::array, 2>, nChannels> histPtOccReco; - std::array, 5>, 2>, nChannels> histPtDau, histEtaDau, histImpactParameterDau; + std::array, NChannels> histDeltaPt, histDeltaPx, histDeltaPy, histDeltaPz, histDeltaSecondaryVertexX, histDeltaSecondaryVertexY, histDeltaSecondaryVertexZ, histDeltaDecayLength; + std::array, 2>, NChannels> histPtCentReco; + std::array, 2>, NChannels> histPtOccReco; + std::array, 5>, 2>, NChannels> histPtDau, histEtaDau, histImpactParameterDau; std::array, 4> histOriginTracks; std::shared_ptr histAmbiguousTracks, histTracks; std::shared_ptr histContributors; @@ -707,8 +707,8 @@ struct HfTaskMcValidationRec { std::vector diff(vec.size()); std::transform(vec.begin(), vec.end(), diff.begin(), [mean](T x) { return x - mean; }); - T sq_sum = std::inner_product(diff.begin(), diff.end(), diff.begin(), 0.0); - T stdev = std::sqrt(sq_sum / vec.size()); + T sqSum = std::inner_product(diff.begin(), diff.end(), diff.begin(), 0.0); + T stdev = std::sqrt(sqSum / vec.size()); return stdev; } @@ -787,45 +787,45 @@ struct HfTaskMcValidationRec { histAmbiguousTracks->GetXaxis()->SetBinLabel(2, "no quark"); histAmbiguousTracks->GetXaxis()->SetBinLabel(3, "charm"); histAmbiguousTracks->GetXaxis()->SetBinLabel(4, "beauty"); - for (auto iHad = 0; iHad < nChannels; ++iHad) { - if (iHad < nCharmMesonChannels) { - histDeltaPt[iHad] = registryMesons.add(Form("%s/histDeltaPt", particleNames[iHad].data()), Form("Pt difference reco - MC %s; #it{p}_{T}^{reco} - #it{p}_{T}^{gen} (GeV/#it{c}); entries", labels[iHad].data()), HistType::kTH1F, {axisDeltaMom}); - histDeltaPx[iHad] = registryMesons.add(Form("%s/histDeltaPx", particleNames[iHad].data()), Form("Px difference reco - MC %s; #it{p}_{x}^{reco} - #it{p}_{x}^{gen} (GeV/#it{c}); entries", labels[iHad].data()), HistType::kTH1F, {axisDeltaMom}); - histDeltaPy[iHad] = registryMesons.add(Form("%s/histDeltaPy", particleNames[iHad].data()), Form("Py difference reco - MC %s; #it{p}_{y}^{reco} - #it{p}_{y}^{gen} (GeV/#it{c}); entries", labels[iHad].data()), HistType::kTH1F, {axisDeltaMom}); - histDeltaPz[iHad] = registryMesons.add(Form("%s/histDeltaPz", particleNames[iHad].data()), Form("Pz difference reco - MC %s; #it{p}_{z}^{reco} - #it{p}_{z}^{gen} (GeV/#it{c}); entries", labels[iHad].data()), HistType::kTH1F, {axisDeltaMom}); - histDeltaSecondaryVertexX[iHad] = registryMesons.add(Form("%s/histDeltaSecondaryVertexX", particleNames[iHad].data()), Form("Sec. Vertex difference reco - MC (MC matched) - %s; #Delta x (cm); entries", labels[iHad].data()), HistType::kTH1F, {axisDeltaVtx}); - histDeltaSecondaryVertexY[iHad] = registryMesons.add(Form("%s/histDeltaSecondaryVertexY", particleNames[iHad].data()), Form("Sec. Vertex difference reco - MC (MC matched) - %s; #Delta y (cm); entries", labels[iHad].data()), HistType::kTH1F, {axisDeltaVtx}); - histDeltaSecondaryVertexZ[iHad] = registryMesons.add(Form("%s/histDeltaSecondaryVertexZ", particleNames[iHad].data()), Form("Sec. Vertex difference reco - MC (MC matched) - %s; #Delta z (cm); entries", labels[iHad].data()), HistType::kTH1F, {axisDeltaVtx}); - histDeltaDecayLength[iHad] = registryMesons.add(Form("%s/histDeltaDecayLength", particleNames[iHad].data()), Form("Decay length difference reco - MC (%s); #Delta L (cm); entries", labels[iHad].data()), HistType::kTH1F, {axisDeltaVtx}); + for (auto iHad = 0; iHad < NChannels; ++iHad) { + if (iHad < NCharmMesonChannels) { + histDeltaPt[iHad] = registryMesons.add(Form("%s/histDeltaPt", ParticleNames[iHad].data()), Form("Pt difference reco - MC %s; #it{p}_{T}^{reco} - #it{p}_{T}^{gen} (GeV/#it{c}); entries", Labels[iHad].data()), HistType::kTH1F, {axisDeltaMom}); + histDeltaPx[iHad] = registryMesons.add(Form("%s/histDeltaPx", ParticleNames[iHad].data()), Form("Px difference reco - MC %s; #it{p}_{x}^{reco} - #it{p}_{x}^{gen} (GeV/#it{c}); entries", Labels[iHad].data()), HistType::kTH1F, {axisDeltaMom}); + histDeltaPy[iHad] = registryMesons.add(Form("%s/histDeltaPy", ParticleNames[iHad].data()), Form("Py difference reco - MC %s; #it{p}_{y}^{reco} - #it{p}_{y}^{gen} (GeV/#it{c}); entries", Labels[iHad].data()), HistType::kTH1F, {axisDeltaMom}); + histDeltaPz[iHad] = registryMesons.add(Form("%s/histDeltaPz", ParticleNames[iHad].data()), Form("Pz difference reco - MC %s; #it{p}_{z}^{reco} - #it{p}_{z}^{gen} (GeV/#it{c}); entries", Labels[iHad].data()), HistType::kTH1F, {axisDeltaMom}); + histDeltaSecondaryVertexX[iHad] = registryMesons.add(Form("%s/histDeltaSecondaryVertexX", ParticleNames[iHad].data()), Form("Sec. Vertex difference reco - MC (MC matched) - %s; #Delta x (cm); entries", Labels[iHad].data()), HistType::kTH1F, {axisDeltaVtx}); + histDeltaSecondaryVertexY[iHad] = registryMesons.add(Form("%s/histDeltaSecondaryVertexY", ParticleNames[iHad].data()), Form("Sec. Vertex difference reco - MC (MC matched) - %s; #Delta y (cm); entries", Labels[iHad].data()), HistType::kTH1F, {axisDeltaVtx}); + histDeltaSecondaryVertexZ[iHad] = registryMesons.add(Form("%s/histDeltaSecondaryVertexZ", ParticleNames[iHad].data()), Form("Sec. Vertex difference reco - MC (MC matched) - %s; #Delta z (cm); entries", Labels[iHad].data()), HistType::kTH1F, {axisDeltaVtx}); + histDeltaDecayLength[iHad] = registryMesons.add(Form("%s/histDeltaDecayLength", ParticleNames[iHad].data()), Form("Decay length difference reco - MC (%s); #Delta L (cm); entries", Labels[iHad].data()), HistType::kTH1F, {axisDeltaVtx}); for (auto iOrigin = 0; iOrigin < 2; ++iOrigin) { - histPtCentReco[iHad][iOrigin] = registryMesons.add(Form("%s/histPtCentReco%s", particleNames[iHad].data(), originNames[iOrigin].data()), Form("Pt Cent reco %s %s; #it{p}_{T}^{reco} (GeV/#it{c}); Centrality (%%); entries", originNames[iOrigin].data(), labels[iHad].data()), HistType::kTH2F, {axisPtD, axisCent}); + histPtCentReco[iHad][iOrigin] = registryMesons.add(Form("%s/histPtCentReco%s", ParticleNames[iHad].data(), OriginNames[iOrigin].data()), Form("Pt Cent reco %s %s; #it{p}_{T}^{reco} (GeV/#it{c}); Centrality (%%); entries", OriginNames[iOrigin].data(), Labels[iHad].data()), HistType::kTH2F, {axisPtD, axisCent}); if (storeOccupancy) { - histPtOccReco[iHad][iOrigin] = registryMesons.add(Form("%s/histPtOccReco%s", particleNames[iHad].data(), originNames[iOrigin].data()), Form("Pt Cent reco %s %s; #it{p}_{T}^{reco} (GeV/#it{c}); Occupancy; entries", originNames[iOrigin].data(), labels[iHad].data()), HistType::kTH2F, {axisPtD, axisOcc}); + histPtOccReco[iHad][iOrigin] = registryMesons.add(Form("%s/histPtOccReco%s", ParticleNames[iHad].data(), OriginNames[iOrigin].data()), Form("Pt Cent reco %s %s; #it{p}_{T}^{reco} (GeV/#it{c}); Occupancy; entries", OriginNames[iOrigin].data(), Labels[iHad].data()), HistType::kTH2F, {axisPtD, axisOcc}); } - for (unsigned int iDau = 0; iDau < nDaughters[iHad]; ++iDau) { - histPtDau[iHad][iOrigin][iDau] = registryMesons.add(Form("%s/histPtDau%d%s", particleNames[iHad].data(), iDau, originNames[iOrigin].data()), Form("Daughter %d Pt reco - %s %s; #it{p}_{T}^{dau, reco} (GeV/#it{c}); entries", iDau, originNames[iOrigin].data(), labels[iHad].data()), HistType::kTH1F, {axisPt}); - histEtaDau[iHad][iOrigin][iDau] = registryMesons.add(Form("%s/histEtaDau%d%s", particleNames[iHad].data(), iDau, originNames[iOrigin].data()), Form("Daughter %d Eta reco - %s %s; #it{#eta}^{dau, reco}; entries", iDau, originNames[iOrigin].data(), labels[iHad].data()), HistType::kTH1F, {{100, -1., 1.}}); - histImpactParameterDau[iHad][iOrigin][iDau] = registryMesons.add(Form("%s/histImpactParameterDau%d%s", particleNames[iHad].data(), iDau, originNames[iOrigin].data()), Form("Daughter %d DCAxy reco - %s %s; DCAxy (cm); entries", iDau, originNames[iOrigin].data(), labels[iHad].data()), HistType::kTH1F, {axisDeltaVtx}); + for (unsigned int iDau = 0; iDau < NDaughters[iHad]; ++iDau) { + histPtDau[iHad][iOrigin][iDau] = registryMesons.add(Form("%s/histPtDau%d%s", ParticleNames[iHad].data(), iDau, OriginNames[iOrigin].data()), Form("Daughter %d Pt reco - %s %s; #it{p}_{T}^{dau, reco} (GeV/#it{c}); entries", iDau, OriginNames[iOrigin].data(), Labels[iHad].data()), HistType::kTH1F, {axisPt}); + histEtaDau[iHad][iOrigin][iDau] = registryMesons.add(Form("%s/histEtaDau%d%s", ParticleNames[iHad].data(), iDau, OriginNames[iOrigin].data()), Form("Daughter %d Eta reco - %s %s; #it{#eta}^{dau, reco}; entries", iDau, OriginNames[iOrigin].data(), Labels[iHad].data()), HistType::kTH1F, {{100, -1., 1.}}); + histImpactParameterDau[iHad][iOrigin][iDau] = registryMesons.add(Form("%s/histImpactParameterDau%d%s", ParticleNames[iHad].data(), iDau, OriginNames[iOrigin].data()), Form("Daughter %d DCAxy reco - %s %s; DCAxy (cm); entries", iDau, OriginNames[iOrigin].data(), Labels[iHad].data()), HistType::kTH1F, {axisDeltaVtx}); } } - } else if (iHad >= nCharmMesonChannels + nBeautyChannels) { - histDeltaPt[iHad] = registryBaryons.add(Form("%s/histDeltaPt", particleNames[iHad].data()), Form("Pt difference reco - MC %s; #it{p}_{T}^{reco} - #it{p}_{T}^{gen} (GeV/#it{c}); entries", labels[iHad].data()), HistType::kTH1F, {axisDeltaMom}); - histDeltaPx[iHad] = registryBaryons.add(Form("%s/histDeltaPx", particleNames[iHad].data()), Form("Px difference reco - MC %s; #it{p}_{x}^{reco} - #it{p}_{x}^{gen} (GeV/#it{c}); entries", labels[iHad].data()), HistType::kTH1F, {axisDeltaMom}); - histDeltaPy[iHad] = registryBaryons.add(Form("%s/histDeltaPy", particleNames[iHad].data()), Form("Py difference reco - MC %s; #it{p}_{y}^{reco} - #it{p}_{y}^{gen} (GeV/#it{c}); entries", labels[iHad].data()), HistType::kTH1F, {axisDeltaMom}); - histDeltaPz[iHad] = registryBaryons.add(Form("%s/histDeltaPz", particleNames[iHad].data()), Form("Pz difference reco - MC %s; #it{p}_{z}^{reco} - #it{p}_{z}^{gen} (GeV/#it{c}); entries", labels[iHad].data()), HistType::kTH1F, {axisDeltaMom}); - histDeltaSecondaryVertexX[iHad] = registryBaryons.add(Form("%s/histDeltaSecondaryVertexX", particleNames[iHad].data()), Form("Sec. Vertex difference reco - MC (MC matched) - %s; #Delta x (cm); entries", labels[iHad].data()), HistType::kTH1F, {axisDeltaVtx}); - histDeltaSecondaryVertexY[iHad] = registryBaryons.add(Form("%s/histDeltaSecondaryVertexY", particleNames[iHad].data()), Form("Sec. Vertex difference reco - MC (MC matched) - %s; #Delta y (cm); entries", labels[iHad].data()), HistType::kTH1F, {axisDeltaVtx}); - histDeltaSecondaryVertexZ[iHad] = registryBaryons.add(Form("%s/histDeltaSecondaryVertexZ", particleNames[iHad].data()), Form("Sec. Vertex difference reco - MC (MC matched) - %s; #Delta z (cm); entries", labels[iHad].data()), HistType::kTH1F, {axisDeltaVtx}); - histDeltaDecayLength[iHad] = registryBaryons.add(Form("%s/histDeltaDecayLength", particleNames[iHad].data()), Form("Decay length difference reco - MC (%s); #Delta L (cm); entries", labels[iHad].data()), HistType::kTH1F, {axisDeltaVtx}); + } else if (iHad >= NCharmMesonChannels + NBeautyChannels) { + histDeltaPt[iHad] = registryBaryons.add(Form("%s/histDeltaPt", ParticleNames[iHad].data()), Form("Pt difference reco - MC %s; #it{p}_{T}^{reco} - #it{p}_{T}^{gen} (GeV/#it{c}); entries", Labels[iHad].data()), HistType::kTH1F, {axisDeltaMom}); + histDeltaPx[iHad] = registryBaryons.add(Form("%s/histDeltaPx", ParticleNames[iHad].data()), Form("Px difference reco - MC %s; #it{p}_{x}^{reco} - #it{p}_{x}^{gen} (GeV/#it{c}); entries", Labels[iHad].data()), HistType::kTH1F, {axisDeltaMom}); + histDeltaPy[iHad] = registryBaryons.add(Form("%s/histDeltaPy", ParticleNames[iHad].data()), Form("Py difference reco - MC %s; #it{p}_{y}^{reco} - #it{p}_{y}^{gen} (GeV/#it{c}); entries", Labels[iHad].data()), HistType::kTH1F, {axisDeltaMom}); + histDeltaPz[iHad] = registryBaryons.add(Form("%s/histDeltaPz", ParticleNames[iHad].data()), Form("Pz difference reco - MC %s; #it{p}_{z}^{reco} - #it{p}_{z}^{gen} (GeV/#it{c}); entries", Labels[iHad].data()), HistType::kTH1F, {axisDeltaMom}); + histDeltaSecondaryVertexX[iHad] = registryBaryons.add(Form("%s/histDeltaSecondaryVertexX", ParticleNames[iHad].data()), Form("Sec. Vertex difference reco - MC (MC matched) - %s; #Delta x (cm); entries", Labels[iHad].data()), HistType::kTH1F, {axisDeltaVtx}); + histDeltaSecondaryVertexY[iHad] = registryBaryons.add(Form("%s/histDeltaSecondaryVertexY", ParticleNames[iHad].data()), Form("Sec. Vertex difference reco - MC (MC matched) - %s; #Delta y (cm); entries", Labels[iHad].data()), HistType::kTH1F, {axisDeltaVtx}); + histDeltaSecondaryVertexZ[iHad] = registryBaryons.add(Form("%s/histDeltaSecondaryVertexZ", ParticleNames[iHad].data()), Form("Sec. Vertex difference reco - MC (MC matched) - %s; #Delta z (cm); entries", Labels[iHad].data()), HistType::kTH1F, {axisDeltaVtx}); + histDeltaDecayLength[iHad] = registryBaryons.add(Form("%s/histDeltaDecayLength", ParticleNames[iHad].data()), Form("Decay length difference reco - MC (%s); #Delta L (cm); entries", Labels[iHad].data()), HistType::kTH1F, {axisDeltaVtx}); for (auto iOrigin = 0; iOrigin < 2; ++iOrigin) { - histPtCentReco[iHad][iOrigin] = registryBaryons.add(Form("%s/histPtCentReco%s", particleNames[iHad].data(), originNames[iOrigin].data()), Form("Pt Cent reco %s %s; #it{p}_{T}^{reco} (GeV/#it{c}); Centrality (%%); entries", originNames[iOrigin].data(), labels[iHad].data()), HistType::kTH2F, {axisPtD, axisCent}); + histPtCentReco[iHad][iOrigin] = registryBaryons.add(Form("%s/histPtCentReco%s", ParticleNames[iHad].data(), OriginNames[iOrigin].data()), Form("Pt Cent reco %s %s; #it{p}_{T}^{reco} (GeV/#it{c}); Centrality (%%); entries", OriginNames[iOrigin].data(), Labels[iHad].data()), HistType::kTH2F, {axisPtD, axisCent}); if (storeOccupancy) { - histPtOccReco[iHad][iOrigin] = registryBaryons.add(Form("%s/histPtOccReco%s", particleNames[iHad].data(), originNames[iOrigin].data()), Form("Pt Cent reco %s %s; #it{p}_{T}^{reco} (GeV/#it{c}); Occupancy; entries", originNames[iOrigin].data(), labels[iHad].data()), HistType::kTH2F, {axisPtD, axisOcc}); + histPtOccReco[iHad][iOrigin] = registryBaryons.add(Form("%s/histPtOccReco%s", ParticleNames[iHad].data(), OriginNames[iOrigin].data()), Form("Pt Cent reco %s %s; #it{p}_{T}^{reco} (GeV/#it{c}); Occupancy; entries", OriginNames[iOrigin].data(), Labels[iHad].data()), HistType::kTH2F, {axisPtD, axisOcc}); } - for (unsigned int iDau = 0; iDau < nDaughters[iHad]; ++iDau) { - histPtDau[iHad][iOrigin][iDau] = registryBaryons.add(Form("%s/histPtDau%d%s", particleNames[iHad].data(), iDau, originNames[iOrigin].data()), Form("Daughter %d Pt reco - %s %s; #it{p}_{T}^{dau, reco} (GeV/#it{c}); entries", iDau, originNames[iOrigin].data(), labels[iHad].data()), HistType::kTH1F, {axisPt}); - histEtaDau[iHad][iOrigin][iDau] = registryBaryons.add(Form("%s/histEtaDau%d%s", particleNames[iHad].data(), iDau, originNames[iOrigin].data()), Form("Daughter %d Eta reco - %s %s; #it{#eta}^{dau, reco}; entries", iDau, originNames[iOrigin].data(), labels[iHad].data()), HistType::kTH1F, {{100, -1., 1.}}); - histImpactParameterDau[iHad][iOrigin][iDau] = registryBaryons.add(Form("%s/histImpactParameterDau%d%s", particleNames[iHad].data(), iDau, originNames[iOrigin].data()), Form("Daughter %d DCAxy reco - %s %s; DCAxy (cm); entries", iDau, originNames[iOrigin].data(), labels[iHad].data()), HistType::kTH1F, {axisDeltaVtx}); + for (unsigned int iDau = 0; iDau < NDaughters[iHad]; ++iDau) { + histPtDau[iHad][iOrigin][iDau] = registryBaryons.add(Form("%s/histPtDau%d%s", ParticleNames[iHad].data(), iDau, OriginNames[iOrigin].data()), Form("Daughter %d Pt reco - %s %s; #it{p}_{T}^{dau, reco} (GeV/#it{c}); entries", iDau, OriginNames[iOrigin].data(), Labels[iHad].data()), HistType::kTH1F, {axisPt}); + histEtaDau[iHad][iOrigin][iDau] = registryBaryons.add(Form("%s/histEtaDau%d%s", ParticleNames[iHad].data(), iDau, OriginNames[iOrigin].data()), Form("Daughter %d Eta reco - %s %s; #it{#eta}^{dau, reco}; entries", iDau, OriginNames[iOrigin].data(), Labels[iHad].data()), HistType::kTH1F, {{100, -1., 1.}}); + histImpactParameterDau[iHad][iOrigin][iDau] = registryBaryons.add(Form("%s/histImpactParameterDau%d%s", ParticleNames[iHad].data(), iDau, OriginNames[iOrigin].data()), Form("Daughter %d DCAxy reco - %s %s; DCAxy (cm); entries", iDau, OriginNames[iOrigin].data(), Labels[iHad].data()), HistType::kTH1F, {axisDeltaVtx}); } } } @@ -840,7 +840,7 @@ struct HfTaskMcValidationRec { ccdb->setLocalObjectValidityChecking(); } - template + template void checkCollisions(Coll const& collision, aod::McCollisions const&, aod::BCsWithTimestamps const&) @@ -851,7 +851,7 @@ struct HfTaskMcValidationRec { } float centrality{-1.f}; - const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); + const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); if (rejectionMask != 0) { /// at least one event selection not satisfied --> reject the candidate return; @@ -869,7 +869,7 @@ struct HfTaskMcValidationRec { registry.fill(HIST("histDeltaZvtx"), collision.numContrib(), collision.posZ() - mcCollision.posZ()); } - template + template void checkCollisionAssociation(Colls const& collisions, TracksWithSel const&, aod::McParticles const& mcParticles, @@ -881,7 +881,7 @@ struct HfTaskMcValidationRec { // check that collision is selected by hf-track-index-skim-creator-tag-sel-collisions float centrality{-1.f}; - const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); + const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); if (rejectionMask != 0) { /// at least one event selection not satisfied --> reject the candidate continue; @@ -949,9 +949,9 @@ struct HfTaskMcValidationRec { for (const auto& track : tracksFilteredGlobalTrackWoDCA) { // check number of ITS hits int nITSlayers = 0; - uint8_t ITSHitMap = track.itsClusterMap(); + uint8_t itsHitMap = track.itsClusterMap(); for (int iLayer = 0; iLayer < 7; ++iLayer) { - if (TESTBIT(ITSHitMap, iLayer)) { + if (TESTBIT(itsHitMap, iLayer)) { nITSlayers++; } } @@ -1066,7 +1066,7 @@ struct HfTaskMcValidationRec { } PROCESS_SWITCH(HfTaskMcValidationRec, processCollAssocWithCentFTOM, "Process collision-association information with centrality selection with FT0M, requires extra table from TrackToCollisionAssociation task (fillTableOfCollIdsPerTrack=true)", false); - template + template void processEff(HfCand2ProngWithMCRec const& cand2Prongs, HfCand3ProngWithMCRec const& cand3Prongs, aod::TracksWMc const&, @@ -1082,7 +1082,7 @@ struct HfTaskMcValidationRec { // apply event selection float centrality{105.f}; int occupancy = collision.trackOccupancyInTimeRange(); - hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); // only needed to update centrality, no bitmask selection applied + hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); // only needed to update centrality, no bitmask selection applied if (!collision.has_mcCollision()) { return; } diff --git a/PWGHF/Tasks/taskMultiplicityEstimatorCorrelation.cxx b/PWGHF/Tasks/taskMultiplicityEstimatorCorrelation.cxx index 3e8537a47d1..3df1ca0fc65 100644 --- a/PWGHF/Tasks/taskMultiplicityEstimatorCorrelation.cxx +++ b/PWGHF/Tasks/taskMultiplicityEstimatorCorrelation.cxx @@ -43,8 +43,8 @@ using namespace o2::framework::expressions; struct HfTaskMultiplicityEstimatorCorrelation { HistogramRegistry registry{"registry", {}}; - static constexpr int8_t nEstimators = 8; - static constexpr std::array estimatorsNames = {"FV0A", "FT0A", "FT0C", "FT0M", "FDDA", "FDDC", "FDDM", "NTPV"}; + static constexpr int8_t NEstimators = 8; + static constexpr std::array EstimatorsNames = {"FV0A", "FT0A", "FT0C", "FT0M", "FDDA", "FDDC", "FDDM", "NTPV"}; std::vector consideredParticles = { kElectron, @@ -72,9 +72,9 @@ struct HfTaskMultiplicityEstimatorCorrelation { void init(InitContext&) { - for (int8_t i = 0; i < nEstimators; i++) { - registry.add(("etaPFive/" + std::string(estimatorsNames[i]) + "VsdNdeta").c_str(), (std::string(estimatorsNames[i]) + "VsdNdeta;" + std::string(estimatorsNames[i]) + ";").c_str(), HistType::kTH2F, {*(estimatorsAxes[i]), axisdNdEta}); - registry.add(("etaOne/" + std::string(estimatorsNames[i]) + "VsdNdeta").c_str(), (std::string(estimatorsNames[i]) + "VsdNdeta;" + std::string(estimatorsNames[i]) + ";").c_str(), HistType::kTH2F, {*(estimatorsAxes[i]), axisdNdEta}); + for (int8_t i = 0; i < NEstimators; i++) { + registry.add(("etaPFive/" + std::string(EstimatorsNames[i]) + "VsdNdeta").c_str(), (std::string(EstimatorsNames[i]) + "VsdNdeta;" + std::string(EstimatorsNames[i]) + ";").c_str(), HistType::kTH2F, {*(estimatorsAxes[i]), axisdNdEta}); + registry.add(("etaOne/" + std::string(EstimatorsNames[i]) + "VsdNdeta").c_str(), (std::string(EstimatorsNames[i]) + "VsdNdeta;" + std::string(EstimatorsNames[i]) + ";").c_str(), HistType::kTH2F, {*(estimatorsAxes[i]), axisdNdEta}); } } @@ -132,11 +132,11 @@ struct HfTaskMultiplicityEstimatorCorrelation { float dNdetaFive = nChargedInEtaFive; float dNdetaOne = nChargedInEtaOne / 2.0; - for (int i = 0; i < nEstimators; i++) { - static_for<0, nEstimators - 1>([&](auto j) { - constexpr int index = j.value; - registry.fill(HIST("etaPFive/") + HIST(estimatorsNames[index]) + HIST("VsdNdeta"), multiplicity[index], dNdetaFive); - registry.fill(HIST("etaOne/") + HIST(estimatorsNames[index]) + HIST("VsdNdeta"), multiplicity[index], dNdetaOne); + for (int i = 0; i < NEstimators; i++) { + static_for<0, NEstimators - 1>([&](auto j) { + constexpr int Index = j.value; + registry.fill(HIST("etaPFive/") + HIST(EstimatorsNames[Index]) + HIST("VsdNdeta"), multiplicity[Index], dNdetaFive); + registry.fill(HIST("etaOne/") + HIST(EstimatorsNames[Index]) + HIST("VsdNdeta"), multiplicity[Index], dNdetaOne); }); } } diff --git a/PWGHF/Tasks/taskPidStudies.cxx b/PWGHF/Tasks/taskPidStudies.cxx index 805266b76a9..5103f2ad573 100644 --- a/PWGHF/Tasks/taskPidStudies.cxx +++ b/PWGHF/Tasks/taskPidStudies.cxx @@ -238,7 +238,7 @@ struct HfTaskPidStudies { hTrackSel->GetXaxis()->SetBinLabel(TrackCuts::ItsChi2NCls + 1, "ITS #chi^{2}/NCls"); } - template + template void fillTree(Cand const& candidate, const int flag) { float pseudoRndm = candidate.pt() * 1000. - static_cast(candidate.pt() * 1000); @@ -247,7 +247,7 @@ struct HfTaskPidStudies { } const auto& coll = candidate.template collision_as(); - if constexpr (isV0) { + if constexpr (IsV0) { const auto& posTrack = candidate.template posTrack_as(); const auto& negTrack = candidate.template negTrack_as(); pidV0( @@ -361,13 +361,13 @@ struct HfTaskPidStudies { return rejectionMask == 0; } - template + template bool isTrackSelected(const T1& candidate) { const auto& posTrack = candidate.template posTrack_as(); const auto& negTrack = candidate.template negTrack_as(); registry.fill(HIST("hTrackSel"), TrackCuts::All); - if constexpr (isV0) { + if constexpr (IsV0) { if (!posTrack.hasITS() || !negTrack.hasITS()) { return false; } @@ -508,13 +508,13 @@ struct HfTaskPidStudies { } void processV0Mc(CollisionsMc const& /*mcCollisions*/, - V0sMcRec const& V0s, + V0sMcRec const& v0s, aod::V0MCCores const&, aod::McParticles const& /*particlesMc*/, PidTracks const& /*tracks*/, aod::BCsWithTimestamps const&) { - for (const auto& v0 : V0s) { + for (const auto& v0 : v0s) { if (applyEvSels && !isCollSelected(v0.collision_as())) { continue; } @@ -531,12 +531,12 @@ struct HfTaskPidStudies { } PROCESS_SWITCH(HfTaskPidStudies, processV0Mc, "Process MC", true); - void processV0Data(aod::V0Datas const& V0s, + void processV0Data(aod::V0Datas const& v0s, PidTracks const&, aod::BCsWithTimestamps const&, CollSels const&) { - for (const auto& v0 : V0s) { + for (const auto& v0 : v0s) { if (applyEvSels && !isCollSelected(v0.collision_as())) { continue; } diff --git a/PWGHF/Tasks/taskSelOptimisation.cxx b/PWGHF/Tasks/taskSelOptimisation.cxx index c9be2c770ca..dbb14b1c9c0 100644 --- a/PWGHF/Tasks/taskSelOptimisation.cxx +++ b/PWGHF/Tasks/taskSelOptimisation.cxx @@ -45,59 +45,59 @@ using namespace o2::framework::expressions; namespace { -constexpr int nCutsToTestCosp = 15; -constexpr int nCutsToTestDecLen = 11; -constexpr int nCutsToTestImpParProd = 11; -constexpr int nCutsToTestMinDCAxy = 9; -constexpr int nCutsToTestMinTrackPt = 7; - -constexpr float cutsCosp[nCutsToTestCosp] = {0.70, 0.75, 0.80, 0.85, 0.88, 0.90, 0.92, 0.93, 0.94, 0.95, 0.96, 0.97, 0.98, 0.99, 0.995}; -constexpr float cutsDecLen[nCutsToTestDecLen] = {0., 0.005, 0.01, 0.015, 0.02, 0.025, 0.03, 0.04, 0.05, 0.075, 0.1}; -constexpr float cutsImpParProd[nCutsToTestImpParProd] = {-0.00005, -0.00004, -0.00003, -0.00002, -0.00001, 0., 0.00001, 0.00002, 0.00003, 0.00004, 0.00005}; -constexpr float cutsMinDCAxy[nCutsToTestMinDCAxy] = {0., 0.0005, 0.001, 0.0015, 0.0020, 0.0025, 0.0030, 0.0040, 0.0050}; -constexpr float cutsMinTrackPt[nCutsToTestMinTrackPt] = {0.30, 0.35, 0.40, 0.45, 0.50, 0.55, 0.60}; - -auto vecCutsCosp = std::vector{cutsCosp, cutsCosp + nCutsToTestCosp}; -auto vecCutsDecLen = std::vector{cutsDecLen, cutsDecLen + nCutsToTestDecLen}; -auto vecCutsImpParProd = std::vector{cutsImpParProd, cutsImpParProd + nCutsToTestImpParProd}; -auto vecCutsMinDCAxy = std::vector{cutsMinDCAxy, cutsMinDCAxy + nCutsToTestMinDCAxy}; -auto vecCutsMinTrackPt = std::vector{cutsMinTrackPt, cutsMinTrackPt + nCutsToTestMinTrackPt}; +constexpr int NCutsToTestCosp = 15; +constexpr int NCutsToTestDecLen = 11; +constexpr int NCutsToTestImpParProd = 11; +constexpr int NCutsToTestMinDcAxy = 9; +constexpr int NCutsToTestMinTrackPt = 7; + +constexpr float CutsCosp[NCutsToTestCosp] = {0.70, 0.75, 0.80, 0.85, 0.88, 0.90, 0.92, 0.93, 0.94, 0.95, 0.96, 0.97, 0.98, 0.99, 0.995}; +constexpr float CutsDecLen[NCutsToTestDecLen] = {0., 0.005, 0.01, 0.015, 0.02, 0.025, 0.03, 0.04, 0.05, 0.075, 0.1}; +constexpr float CutsImpParProd[NCutsToTestImpParProd] = {-0.00005, -0.00004, -0.00003, -0.00002, -0.00001, 0., 0.00001, 0.00002, 0.00003, 0.00004, 0.00005}; +constexpr float CutsMinDcAxy[NCutsToTestMinDcAxy] = {0., 0.0005, 0.001, 0.0015, 0.0020, 0.0025, 0.0030, 0.0040, 0.0050}; +constexpr float CutsMinTrackPt[NCutsToTestMinTrackPt] = {0.30, 0.35, 0.40, 0.45, 0.50, 0.55, 0.60}; + +auto vecCutsCosp = std::vector{CutsCosp, CutsCosp + NCutsToTestCosp}; +auto vecCutsDecLen = std::vector{CutsDecLen, CutsDecLen + NCutsToTestDecLen}; +auto vecCutsImpParProd = std::vector{CutsImpParProd, CutsImpParProd + NCutsToTestImpParProd}; +auto vecCutsMinDCAxy = std::vector{CutsMinDcAxy, CutsMinDcAxy + NCutsToTestMinDcAxy}; +auto vecCutsMinTrackPt = std::vector{CutsMinTrackPt, CutsMinTrackPt + NCutsToTestMinTrackPt}; const int n2Prong = o2::aod::hf_cand_2prong::DecayType::N2ProngDecays; const int n3Prong = o2::aod::hf_cand_3prong::DecayType::N3ProngDecays; -constexpr std::array, 3> histoNames2Prong = {{{"hPromptVsPtD0ToPiK", "hPromptVsPtJpsiToEE", "hPromptVsPtJpsiToMuMu", "hPromptVsPt2Prong"}, +constexpr std::array, 3> HistoNames2Prong = {{{"hPromptVsPtD0ToPiK", "hPromptVsPtJpsiToEE", "hPromptVsPtJpsiToMuMu", "hPromptVsPt2Prong"}, {"hNonPromptVsPtD0ToPiK", "hNonPromptVsPtJpsiToEE", "hNonPromptVsPtJpsiToMuMu", "hNonPromptVsPt2Prong"}, {"hBkgVsPtD0ToPiK", "hBkgVsPtJpsiToEE", "hBkgVsPtJpsiToMuMu", "hBkgVsPt2Prong"}}}; -constexpr std::array, 3> histoNamesCosp2Prong = {{{"hPromptCospVsPtD0ToPiK", "hPromptCospVsPtJpsiToEE", "hPromptCospVsPtJpsiToMuMu", "hPromptCospVsPt2Prong"}, +constexpr std::array, 3> HistoNamesCosp2Prong = {{{"hPromptCospVsPtD0ToPiK", "hPromptCospVsPtJpsiToEE", "hPromptCospVsPtJpsiToMuMu", "hPromptCospVsPt2Prong"}, {"hNonPromptCospVsPtD0ToPiK", "hNonPromptCospVsPtJpsiToEE", "hNonPromptCospVsPtJpsiToMuMu", "hNonPromptCospVsPt2Prong"}, {"hBkgCospVsPtD0ToPiK", "hBkgCospVsPtJpsiToEE", "hBkgCospVsPtJpsiToMuMu", "hBkgCospVsPt2Prong"}}}; -constexpr std::array, 3> histoNamesDecLen2Prong = {{{"hPromptDecLenVsPtD0ToPiK", "hPromptDecLenVsPtJpsiToEE", "hPromptDecLenVsPtJpsiToMuMu", "hPromptDecLenVsPt2Prong"}, +constexpr std::array, 3> HistoNamesDecLen2Prong = {{{"hPromptDecLenVsPtD0ToPiK", "hPromptDecLenVsPtJpsiToEE", "hPromptDecLenVsPtJpsiToMuMu", "hPromptDecLenVsPt2Prong"}, {"hNonPromptDecLenVsPtD0ToPiK", "hNonPromptDecLenVsPtJpsiToEE", "hNonPromptDecLenVsPtJpsiToMuMu", "hNonPromptDecLenVsPt2Prong"}, {"hBkgDecLenVsPtD0ToPiK", "hBkgDecLenVsPtJpsiToEE", "hBkgDecLenVsPtJpsiToMuMu", "hBkgDecLenVsPt2Prong"}}}; -constexpr std::array, 3> histoNamesImpParProd2Prong = {{{"hPromptImpParProdVsPtD0ToPiK", "hPromptImpParProdVsPtJpsiToEE", "hPromptImpParProdVsPtJpsiToMuMu", "hPromptImpParProdVsPt2Prong"}, +constexpr std::array, 3> HistoNamesImpParProd2Prong = {{{"hPromptImpParProdVsPtD0ToPiK", "hPromptImpParProdVsPtJpsiToEE", "hPromptImpParProdVsPtJpsiToMuMu", "hPromptImpParProdVsPt2Prong"}, {"hNonPromptImpParProdVsPtD0ToPiK", "hNonPromptImpParProdVsPtJpsiToEE", "hNonPromptImpParProdVsPtJpsiToMuMu", "hNonPromptImpParProdVsPt2Prong"}, {"hBkgImpParProdVsPtD0ToPiK", "hBkgImpParProdVsPtJpsiToEE", "hBkgImpParProdVsPtJpsiToMuMu", "hBkgImpParProdVsPt2Prong"}}}; -constexpr std::array, 3> histoNamesMinDCAxy2Prong = {{{"hPromptMinDCAxyVsPtD0ToPiK", "hPromptMinDCAxyVsPtJpsiToEE", "hPromptMinDCAxyVsPtJpsiToMuMu", "hPromptMinDCAxyVsPt2Prong"}, +constexpr std::array, 3> HistoNamesMinDcAxy2Prong = {{{"hPromptMinDCAxyVsPtD0ToPiK", "hPromptMinDCAxyVsPtJpsiToEE", "hPromptMinDCAxyVsPtJpsiToMuMu", "hPromptMinDCAxyVsPt2Prong"}, {"hNonPromptMinDCAxyVsPtD0ToPiK", "hNonPromptMinDCAxyVsPtJpsiToEE", "hNonPromptMinDCAxyVsPtJpsiToMuMu", "hNonPromptMinDCAxyVsPt2Prong"}, {"hBkgMinDCAxyVsPtD0ToPiK", "hBkgMinDCAxyVsPtJpsiToEE", "hBkgMinDCAxyVsPtJpsiToMuMu", "hBkgMinDCAxyVsPt2Prong"}}}; -constexpr std::array, 3> histoNamesMinTrackPt2Prong = {{{"hPromptMinTrackPtVsPtD0ToPiK", "hPromptMinTrackPtVsPtJpsiToEE", "hPromptMinTrackPtVsPtJpsiToMuMu", "hPromptMinTrackPtVsPt2Prong"}, +constexpr std::array, 3> HistoNamesMinTrackPt2Prong = {{{"hPromptMinTrackPtVsPtD0ToPiK", "hPromptMinTrackPtVsPtJpsiToEE", "hPromptMinTrackPtVsPtJpsiToMuMu", "hPromptMinTrackPtVsPt2Prong"}, {"hNonPromptMinTrackPtVsPtD0ToPiK", "hNonPromptMinTrackPtVsPtJpsiToEE", "hNonPromptMinTrackPtVsPtJpsiToMuMu", "hNonPromptMinTrackPtVsPt2Prong"}, {"hBkgMinTrackPtVsPtD0ToPiK", "hBkgMinTrackPtVsPtJpsiToEE", "hBkgMinTrackPtVsPtJpsiToMuMu", "hBkgMinTrackPtVsPt2Prong"}}}; -constexpr std::array, 3> histoNames3Prong = {{{"hPromptVsPtDPlusToPiKPi", "hPromptVsPtLcToPKPi", "hPromptVsPtDsToPiKK", "hPromptVsPtXicToPKPi", "hPromptVsPt3Prong"}, +constexpr std::array, 3> HistoNames3Prong = {{{"hPromptVsPtDPlusToPiKPi", "hPromptVsPtLcToPKPi", "hPromptVsPtDsToPiKK", "hPromptVsPtXicToPKPi", "hPromptVsPt3Prong"}, {"hNonPromptVsPtDPlusToPiKPi", "hNonPromptVsPtLcToPKPi", "hNonPromptVsPtDsToPiKK", "hNonPromptVsPtXicToPKPi", "hNonPromptVsPt3Prong"}, {"hBkgVsPtDPlusToPiKPi", "hBkgVsPtLcToPKPi", "hBkgVsPtDsToPiKK", "hBkgVsPtXicToPKPi", "hBkgVsPt3Prong"}}}; -constexpr std::array, 3> histoNamesCosp3Prong = {{{"hPromptCospVsPtDPlusToPiKPi", "hPromptCospVsPtLcToPKPi", "hPromptCospVsPtDsToPiKK", "hPromptCospVsPtXicToPKPi", "hPromptCospVsPt3Prong"}, +constexpr std::array, 3> HistoNamesCosp3Prong = {{{"hPromptCospVsPtDPlusToPiKPi", "hPromptCospVsPtLcToPKPi", "hPromptCospVsPtDsToPiKK", "hPromptCospVsPtXicToPKPi", "hPromptCospVsPt3Prong"}, {"hNonPromptCospVsPtDPlusToPiKPi", "hNonPromptCospVsPtLcToPKPi", "hNonPromptCospVsPtDsToPiKK", "hNonPromptCospVsPtXicToPKPi", "hNonPromptCospVsPt3Prong"}, {"hBkgCospVsPtDPlusToPiKPi", "hBkgCospVsPtLcToPKPi", "hBkgCospVsPtDsToPiKK", "hBkgCospVsPtXicToPKPi", "hBkgCospVsPt3Prong"}}}; -constexpr std::array, 3> histoNamesDecLen3Prong = {{{"hPromptDecLenVsPtDPlusToPiKPi", "hPromptDecLenVsPtLcToPKPi", "hPromptDecLenVsPtDsToPiKK", "hPromptDecLenVsPtXicToPKPi", "hPromptDecLenVsPt3Prong"}, +constexpr std::array, 3> HistoNamesDecLen3Prong = {{{"hPromptDecLenVsPtDPlusToPiKPi", "hPromptDecLenVsPtLcToPKPi", "hPromptDecLenVsPtDsToPiKK", "hPromptDecLenVsPtXicToPKPi", "hPromptDecLenVsPt3Prong"}, {"hNonPromptDecLenVsPtDPlusToPiKPi", "hNonPromptDecLenVsPtLcToPKPi", "hNonPromptDecLenVsPtDsToPiKK", "hNonPromptDecLenVsPtXicToPKPi", "hNonPromptDecLenVsPt3Prong"}, {"hBkgDecLenVsPtDPlusToPiKPi", "hBkgDecLenVsPtLcToPKPi", "hBkgDecLenVsPtDsToPiKK", "hBkgDecLenVsPtXicToPKPi", "hBkgDecLenVsPt3Prong"}}}; -constexpr std::array, 3> histoNamesMinDCAxy3Prong = {{{"hPromptMinDCAxyVsPtDPlusToPiKPi", "hPromptMinDCAxyVsPtLcToPKPi", "hPromptMinDCAxyVsPtDsToPiKK", "hPromptMinDCAxyVsPtXicToPKPi", "hPromptMinDCAxyVsPt3Prong"}, +constexpr std::array, 3> HistoNamesMinDcAxy3Prong = {{{"hPromptMinDCAxyVsPtDPlusToPiKPi", "hPromptMinDCAxyVsPtLcToPKPi", "hPromptMinDCAxyVsPtDsToPiKK", "hPromptMinDCAxyVsPtXicToPKPi", "hPromptMinDCAxyVsPt3Prong"}, {"hNonPromptMinDCAxyVsPtDPlusToPiKPi", "hNonPromptMinDCAxyVsPtLcToPKPi", "hNonPromptMinDCAxyVsPtDsToPiKK", "hNonPromptMinDCAxyVsPtXicToPKPi", "hNonPromptMinDCAxyVsPt3Prong"}, {"hBkgMinDCAxyVsPtDPlusToPiKPi", "hBkgMinDCAxyVsPtLcToPKPi", "hBkgMinDCAxyVsPtDsToPiKK", "hBkgMinDCAxyVsPtXicToPKPi", "hBkgMinDCAxyVsPt3Prong"}}}; -constexpr std::array, 3> histoNamesMinTrackPt3Prong = {{{"hPromptMinTrackPtVsPtDPlusToPiKPi", "hPromptMinTrackPtVsPtLcToPKPi", "hPromptMinTrackPtVsPtDsToPiKK", "hPromptMinTrackPtVsPtXicToPKPi", "hPromptMinTrackPtVsPt3Prong"}, +constexpr std::array, 3> HistoNamesMinTrackPt3Prong = {{{"hPromptMinTrackPtVsPtDPlusToPiKPi", "hPromptMinTrackPtVsPtLcToPKPi", "hPromptMinTrackPtVsPtDsToPiKK", "hPromptMinTrackPtVsPtXicToPKPi", "hPromptMinTrackPtVsPt3Prong"}, {"hNonPromptMinTrackPtVsPtDPlusToPiKPi", "hNonPromptMinTrackPtVsPtLcToPKPi", "hNonPromptMinTrackPtVsPtDsToPiKK", "hNonPromptMinTrackPtVsPtXicToPKPi", "hNonPromptMinTrackPtVsPt3Prong"}, {"hBkgMinTrackPtVsPtDPlusToPiKPi", "hBkgMinTrackPtVsPtLcToPKPi", "hBkgMinTrackPtVsPtDsToPiKK", "hBkgMinTrackPtVsPtXicToPKPi", "hBkgMinTrackPtVsPt3Prong"}}}; @@ -139,43 +139,43 @@ struct HfSelOptimisation { { for (int iOrig{0}; iOrig < 3; iOrig++) { for (int i2Prong = 0; i2Prong < n2Prong + 1; ++i2Prong) { - histPt2Prong[iOrig][i2Prong] = registry.add(histoNames2Prong[iOrig][i2Prong].data(), "", HistType::kTH1F, {axisPt}); - histCospVsPt2Prong[iOrig][i2Prong] = registry.add(histoNamesCosp2Prong[iOrig][i2Prong].data(), "", HistType::kTH2F, {axisPt, axisCosp}); + histPt2Prong[iOrig][i2Prong] = registry.add(HistoNames2Prong[iOrig][i2Prong].data(), "", HistType::kTH1F, {axisPt}); + histCospVsPt2Prong[iOrig][i2Prong] = registry.add(HistoNamesCosp2Prong[iOrig][i2Prong].data(), "", HistType::kTH2F, {axisPt, axisCosp}); for (int iBin{0}; iBin < histCospVsPt2Prong[iOrig][i2Prong]->GetYaxis()->GetNbins(); ++iBin) { histCospVsPt2Prong[iOrig][i2Prong]->GetYaxis()->SetBinLabel(iBin + 1, Form("%0.4f", cutsToTestCpa->at(iBin))); } - histDecLenVsPt2Prong[iOrig][i2Prong] = registry.add(histoNamesDecLen2Prong[iOrig][i2Prong].data(), "", HistType::kTH2F, {axisPt, axisDecLen}); + histDecLenVsPt2Prong[iOrig][i2Prong] = registry.add(HistoNamesDecLen2Prong[iOrig][i2Prong].data(), "", HistType::kTH2F, {axisPt, axisDecLen}); for (int iBin{0}; iBin < histDecLenVsPt2Prong[iOrig][i2Prong]->GetYaxis()->GetNbins(); ++iBin) { histDecLenVsPt2Prong[iOrig][i2Prong]->GetYaxis()->SetBinLabel(iBin + 1, Form("%0.3f", cutsToTestDecLen->at(iBin))); } - histImpParProdVsPt2Prong[iOrig][i2Prong] = registry.add(histoNamesImpParProd2Prong[iOrig][i2Prong].data(), "", HistType::kTH2F, {axisPt, axisImpParProd}); + histImpParProdVsPt2Prong[iOrig][i2Prong] = registry.add(HistoNamesImpParProd2Prong[iOrig][i2Prong].data(), "", HistType::kTH2F, {axisPt, axisImpParProd}); for (int iBin{0}; iBin < histImpParProdVsPt2Prong[iOrig][i2Prong]->GetYaxis()->GetNbins(); ++iBin) { histImpParProdVsPt2Prong[iOrig][i2Prong]->GetYaxis()->SetBinLabel(iBin + 1, Form("%0.4f", cutsToTestImpParProd->at(iBin))); } - histMinDCAxyVsPt2Prong[iOrig][i2Prong] = registry.add(histoNamesMinDCAxy2Prong[iOrig][i2Prong].data(), "", HistType::kTH2F, {axisPt, axisMinDCAxy}); + histMinDCAxyVsPt2Prong[iOrig][i2Prong] = registry.add(HistoNamesMinDcAxy2Prong[iOrig][i2Prong].data(), "", HistType::kTH2F, {axisPt, axisMinDCAxy}); for (int iBin{0}; iBin < histMinDCAxyVsPt2Prong[iOrig][i2Prong]->GetYaxis()->GetNbins(); ++iBin) { histMinDCAxyVsPt2Prong[iOrig][i2Prong]->GetYaxis()->SetBinLabel(iBin + 1, Form("%0.4f", cutsToTestMinDcaXY->at(iBin))); } - histMinTrackPtVsPt2Prong[iOrig][i2Prong] = registry.add(histoNamesMinTrackPt2Prong[iOrig][i2Prong].data(), "", HistType::kTH2F, {axisPt, axisMinTrackPt}); + histMinTrackPtVsPt2Prong[iOrig][i2Prong] = registry.add(HistoNamesMinTrackPt2Prong[iOrig][i2Prong].data(), "", HistType::kTH2F, {axisPt, axisMinTrackPt}); for (int iBin{0}; iBin < histMinTrackPtVsPt2Prong[iOrig][i2Prong]->GetYaxis()->GetNbins(); ++iBin) { histMinTrackPtVsPt2Prong[iOrig][i2Prong]->GetYaxis()->SetBinLabel(iBin + 1, Form("%0.2f", cutsToTestMinTrackPt->at(iBin))); } } for (int i3Prong{0}; i3Prong < n3Prong + 1; ++i3Prong) { - histPt3Prong[iOrig][i3Prong] = registry.add(histoNames3Prong[iOrig][i3Prong].data(), "", HistType::kTH1F, {axisPt}); - histCospVsPt3Prong[iOrig][i3Prong] = registry.add(histoNamesCosp3Prong[iOrig][i3Prong].data(), "", HistType::kTH2F, {axisPt, axisCosp}); + histPt3Prong[iOrig][i3Prong] = registry.add(HistoNames3Prong[iOrig][i3Prong].data(), "", HistType::kTH1F, {axisPt}); + histCospVsPt3Prong[iOrig][i3Prong] = registry.add(HistoNamesCosp3Prong[iOrig][i3Prong].data(), "", HistType::kTH2F, {axisPt, axisCosp}); for (int iBin{0}; iBin < histCospVsPt3Prong[iOrig][i3Prong]->GetYaxis()->GetNbins(); ++iBin) { histCospVsPt3Prong[iOrig][i3Prong]->GetYaxis()->SetBinLabel(iBin + 1, Form("%0.4f", cutsToTestCpa->at(iBin))); } - histDecLenVsPt3Prong[iOrig][i3Prong] = registry.add(histoNamesDecLen3Prong[iOrig][i3Prong].data(), "", HistType::kTH2F, {axisPt, axisDecLen}); + histDecLenVsPt3Prong[iOrig][i3Prong] = registry.add(HistoNamesDecLen3Prong[iOrig][i3Prong].data(), "", HistType::kTH2F, {axisPt, axisDecLen}); for (int iBin{0}; iBin < histDecLenVsPt3Prong[iOrig][i3Prong]->GetYaxis()->GetNbins(); ++iBin) { histDecLenVsPt3Prong[iOrig][i3Prong]->GetYaxis()->SetBinLabel(iBin + 1, Form("%0.4f", cutsToTestDecLen->at(iBin))); } - histMinDCAxyVsPt3Prong[iOrig][i3Prong] = registry.add(histoNamesMinDCAxy3Prong[iOrig][i3Prong].data(), "", HistType::kTH2F, {axisPt, axisMinDCAxy}); + histMinDCAxyVsPt3Prong[iOrig][i3Prong] = registry.add(HistoNamesMinDcAxy3Prong[iOrig][i3Prong].data(), "", HistType::kTH2F, {axisPt, axisMinDCAxy}); for (int iBin{0}; iBin < histMinDCAxyVsPt3Prong[iOrig][i3Prong]->GetYaxis()->GetNbins(); ++iBin) { histMinDCAxyVsPt3Prong[iOrig][i3Prong]->GetYaxis()->SetBinLabel(iBin + 1, Form("%0.4f", cutsToTestMinDcaXY->at(iBin))); } - histMinTrackPtVsPt3Prong[iOrig][i3Prong] = registry.add(histoNamesMinTrackPt3Prong[iOrig][i3Prong].data(), "", HistType::kTH2F, {axisPt, axisMinTrackPt}); + histMinTrackPtVsPt3Prong[iOrig][i3Prong] = registry.add(HistoNamesMinTrackPt3Prong[iOrig][i3Prong].data(), "", HistType::kTH2F, {axisPt, axisMinTrackPt}); for (int iBin{0}; iBin < histMinTrackPtVsPt3Prong[iOrig][i3Prong]->GetYaxis()->GetNbins(); ++iBin) { histMinTrackPtVsPt3Prong[iOrig][i3Prong]->GetYaxis()->SetBinLabel(iBin + 1, Form("%0.4f", cutsToTestMinTrackPt->at(iBin))); } @@ -188,7 +188,7 @@ struct HfSelOptimisation { /// \param candOrig is candidate type (Prompt, NonPrompt, Bkg) /// \param candidate is a candidate /// \param tracks is the array of daughter tracks - template + template void testSelections2Prong(const T1& candidate, const T2& tracks) { auto pT = candidate.pt(); @@ -198,35 +198,35 @@ struct HfSelOptimisation { std::array ptTrack{tracks[0].pt(), tracks[1].pt()}; std::sort(ptTrack.begin(), ptTrack.end()); - histPt2Prong[candOrig][candType]->Fill(pT); + histPt2Prong[CandOrig][CandType]->Fill(pT); for (std::size_t iCospCut{0}; iCospCut < cutsToTestCpa->size(); ++iCospCut) { if (candidate.cpa() > cutsToTestCpa->at(iCospCut)) { - histCospVsPt2Prong[candOrig][candType]->Fill(pT, iCospCut + 1); + histCospVsPt2Prong[CandOrig][CandType]->Fill(pT, iCospCut + 1); } } for (std::size_t iDecLenCut{0}; iDecLenCut < cutsToTestDecLen->size(); ++iDecLenCut) { if (candidate.decayLength() > cutsToTestDecLen->at(iDecLenCut)) { - histDecLenVsPt2Prong[candOrig][candType]->Fill(pT, iDecLenCut + 1); + histDecLenVsPt2Prong[CandOrig][CandType]->Fill(pT, iDecLenCut + 1); } } for (std::size_t iImpParProd{0}; iImpParProd < cutsToTestImpParProd->size(); ++iImpParProd) { if (candidate.impactParameterProduct() < cutsToTestImpParProd->at(iImpParProd)) { - histImpParProdVsPt2Prong[candOrig][candType]->Fill(pT, iImpParProd + 1); + histImpParProdVsPt2Prong[CandOrig][CandType]->Fill(pT, iImpParProd + 1); } } for (std::size_t iMinDCAxy{0}; iMinDCAxy < cutsToTestMinDcaXY->size(); ++iMinDCAxy) { if (absDCA[0] > cutsToTestMinDcaXY->at(iMinDCAxy)) { - histMinDCAxyVsPt2Prong[candOrig][candType]->Fill(pT, iMinDCAxy + 1); + histMinDCAxyVsPt2Prong[CandOrig][CandType]->Fill(pT, iMinDCAxy + 1); } } for (std::size_t iMinTrackPt{0}; iMinTrackPt < cutsToTestMinTrackPt->size(); ++iMinTrackPt) { if (ptTrack[0] > cutsToTestMinTrackPt->at(iMinTrackPt)) { - histMinTrackPtVsPt2Prong[candOrig][candType]->Fill(pT, iMinTrackPt + 1); + histMinTrackPtVsPt2Prong[CandOrig][CandType]->Fill(pT, iMinTrackPt + 1); } } } @@ -236,7 +236,7 @@ struct HfSelOptimisation { /// \param candOrig is candidate type (Prompt, NonPrompt, Bkg) /// \param candidate is a candidate /// \param tracks is the array of doughter tracks - template + template void testSelections3Prong(const T1& candidate, const T2& tracks) { auto pT = candidate.pt(); @@ -246,29 +246,29 @@ struct HfSelOptimisation { std::array ptTrack{tracks[0].pt(), tracks[1].pt(), tracks[2].pt()}; std::sort(ptTrack.begin(), ptTrack.end()); - histPt3Prong[candOrig][candType]->Fill(pT); + histPt3Prong[CandOrig][CandType]->Fill(pT); for (std::size_t iCospCut{0}; iCospCut < cutsToTestCpa->size(); ++iCospCut) { if (candidate.cpa() > cutsToTestCpa->at(iCospCut)) { - histCospVsPt3Prong[candOrig][candType]->Fill(pT, iCospCut + 1); + histCospVsPt3Prong[CandOrig][CandType]->Fill(pT, iCospCut + 1); } } for (std::size_t iDecLenCut{0}; iDecLenCut < cutsToTestDecLen->size(); ++iDecLenCut) { if (candidate.decayLength() > cutsToTestDecLen->at(iDecLenCut)) { - histDecLenVsPt3Prong[candOrig][candType]->Fill(pT, iDecLenCut + 1); + histDecLenVsPt3Prong[CandOrig][CandType]->Fill(pT, iDecLenCut + 1); } } for (std::size_t iMinDCAxy{0}; iMinDCAxy < cutsToTestMinDcaXY->size(); ++iMinDCAxy) { if (absDCA[0] > cutsToTestMinDcaXY->at(iMinDCAxy)) { - histMinDCAxyVsPt3Prong[candOrig][candType]->Fill(pT, iMinDCAxy + 1); + histMinDCAxyVsPt3Prong[CandOrig][CandType]->Fill(pT, iMinDCAxy + 1); } } for (std::size_t iMinTrackPt{0}; iMinTrackPt < cutsToTestMinTrackPt->size(); ++iMinTrackPt) { if (ptTrack[0] > cutsToTestMinTrackPt->at(iMinTrackPt)) { - histMinTrackPtVsPt3Prong[candOrig][candType]->Fill(pT, iMinTrackPt + 1); + histMinTrackPtVsPt3Prong[CandOrig][CandType]->Fill(pT, iMinTrackPt + 1); } } } diff --git a/PWGHF/Utils/utilsDerivedData.h b/PWGHF/Utils/utilsDerivedData.h index ac7c10c8384..8b2b4fd431a 100644 --- a/PWGHF/Utils/utilsDerivedData.h +++ b/PWGHF/Utils/utilsDerivedData.h @@ -136,7 +136,7 @@ struct HfProducesDerivedData : o2::framework::ProducesGroup { } } - template + template void fillTablesCollision(TCollision const& collision) { if (conf->fillCollBase.value) { @@ -155,7 +155,7 @@ struct HfProducesDerivedData : o2::framework::ProducesGroup { rowCollId( collision.globalIndex()); } - if constexpr (isMC) { + if constexpr (IsMc) { if (conf->fillMcRCollId.value && collision.has_mcCollision()) { // Save rowCollBase.lastIndex() at key collision.mcCollisionId() LOGF(debug, "Rec. collision %d: Filling derived-collision index %d for MC collision %d", collision.globalIndex(), rowCollBase.lastIndex(), collision.mcCollisionId()); diff --git a/PWGHF/Utils/utilsEvSelHf.h b/PWGHF/Utils/utilsEvSelHf.h index 635678890e7..cda1d9f9766 100644 --- a/PWGHF/Utils/utilsEvSelHf.h +++ b/PWGHF/Utils/utilsEvSelHf.h @@ -264,7 +264,7 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { /// \param ccdb ccdb service needed to retrieve the needed info for zorro /// \param registry reference to the histogram registry needed for zorro /// \return bitmask with the event selection criteria not satisfied by the collision - template + template HfCollisionRejectionMask getHfCollisionRejectionMask(TCollision const& collision, float& centrality, o2::framework::Service const& ccdb, @@ -272,14 +272,14 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { { HfCollisionRejectionMask rejectionMask{}; - if constexpr (centEstimator != o2::hf_centrality::CentralityEstimator::None) { - centrality = o2::hf_centrality::getCentralityColl(collision, centEstimator); + if constexpr (CentEstimator != o2::hf_centrality::CentralityEstimator::None) { + centrality = o2::hf_centrality::getCentralityColl(collision, CentEstimator); if (centrality < centralityMin || centrality > centralityMax) { SETBIT(rejectionMask, EventRejection::Centrality); } } - if constexpr (useEvSel) { + if constexpr (UseEvSel) { /// RCT condition if (requireGoodRct && !rctChecker.checkTable(collision)) { SETBIT(rejectionMask, EventRejection::Rct); @@ -370,16 +370,16 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { return rejectionMask; } - template + template HfCollisionRejectionMask getHfCollisionRejectionMaskWithUpc(TCollision const& collision, float& centrality, o2::framework::Service const& ccdb, o2::framework::HistogramRegistry& registry, TBcs const& bcs) { - auto rejectionMaskWithUpc = getHfCollisionRejectionMask(collision, centrality, ccdb, registry); + auto rejectionMaskWithUpc = getHfCollisionRejectionMask(collision, centrality, ccdb, registry); - if (useEvSel) { + if (UseEvSel) { const SGCutParHolder sgCuts = setSgPreselection(); const auto bc = collision.template foundBC_as(); const auto bcRange = udhelpers::compatibleBCs(collision, sgCuts.NDtcoll(), bcs, sgCuts.minNBCs()); @@ -522,7 +522,7 @@ struct HfEventSelectionMc { /// \param collSlice collection of reconstructed collisions /// \param centrality centrality variable to be set in this function /// \return a bitmask with the event selections not satisfied by the analysed collision - template + template HfCollisionRejectionMask getHfMcCollisionRejectionMask(TMcCollision const& mcCollision, TCollisions const& collSlice, float& centrality) @@ -531,8 +531,8 @@ struct HfEventSelectionMc { const auto zPv = mcCollision.posZ(); const auto bc = mcCollision.template bc_as(); - if constexpr (centEstimator != o2::hf_centrality::CentralityEstimator::None) { - centrality = o2::hf_centrality::getCentralityGenColl(collSlice, centEstimator); + if constexpr (CentEstimator != o2::hf_centrality::CentralityEstimator::None) { + centrality = o2::hf_centrality::getCentralityGenColl(collSlice, CentEstimator); /// centrality selection if (centrality < centralityMin || centrality > centralityMax) { SETBIT(rejectionMask, EventRejection::Centrality); @@ -575,14 +575,14 @@ struct HfEventSelectionMc { /// \brief Fills histogram for monitoring event selections satisfied by the collision. /// \param collision analysed collision /// \param rejectionMask bitmask storing the info about which ev. selections are not satisfied by the collision - template + template void fillHistograms(TMcCollision const& mcCollision, const HfCollisionRejectionMask rejectionMask, const int nSplitColl = 0) { hGenCollisions->Fill(EventRejection::None); - if constexpr (centEstimator == o2::hf_centrality::CentralityEstimator::FT0M) { + if constexpr (CentEstimator == o2::hf_centrality::CentralityEstimator::FT0M) { if (!TESTBIT(rejectionMask, EventRejection::TimeFrameBorderCut) && !TESTBIT(rejectionMask, EventRejection::ItsRofBorderCut) && !TESTBIT(rejectionMask, EventRejection::PositionZ)) { hGenCollisionsCent->Fill(mcCollision.centFT0M()); } @@ -595,7 +595,7 @@ struct HfEventSelectionMc { hGenCollisions->Fill(reason); } - if constexpr (centEstimator == o2::hf_centrality::CentralityEstimator::FT0M) { + if constexpr (CentEstimator == o2::hf_centrality::CentralityEstimator::FT0M) { hNSplitVertices->Fill(nSplitColl); for (int nColl = 0; nColl < nSplitColl; nColl++) { hRecCollisionsCentMc->Fill(mcCollision.centFT0M()); diff --git a/PWGHF/Utils/utilsPid.h b/PWGHF/Utils/utilsPid.h index bc5024daf75..83307bc43d8 100644 --- a/PWGHF/Utils/utilsPid.h +++ b/PWGHF/Utils/utilsPid.h @@ -47,13 +47,13 @@ enum PidMethod { /// \param nSigmaTpc is the (binned) NSigma separation in TPC (if tiny = true) /// \param nSigmaTof is the (binned) NSigma separation in TOF (if tiny = true) /// \return combined NSigma of TPC and TOF -template +template TNumber combineNSigma(TNumber nSigmaTpc, TNumber nSigmaTof) { static constexpr float DefaultNSigmaTolerance = .1f; static constexpr float DefaultNSigma = -999.f + DefaultNSigmaTolerance; // -999.f is the default value set in TPCPIDResponse.h and PIDTOF.h - if constexpr (tiny) { + if constexpr (Tiny) { nSigmaTpc *= aod::pidtpc_tiny::binning::bin_width; nSigmaTof *= aod::pidtof_tiny::binning::bin_width; } @@ -76,7 +76,7 @@ TNumber combineNSigma(TNumber nSigmaTpc, TNumber nSigmaTof) /// \tparam TCursor datatype of the cursor of the prong PID table to fill /// \param track prong track /// \param rowPid cursor of the prong PID table to fill -template +template void fillProngPid(TTrack const& track, TCursor& rowPid) { @@ -84,7 +84,7 @@ void fillProngPid(TTrack const& track, TCursor& rowPid) // TODO: add here the code for a possible PID post-calibrations in MC float nSigTpc = -999.f; float nSigTof = -999.f; - if constexpr (specPid == HfProngSpecies::Pion) { + if constexpr (SpecPid == HfProngSpecies::Pion) { // pion PID if (track.hasTPC()) { nSigTpc = track.tpcNSigmaPi(); @@ -92,7 +92,7 @@ void fillProngPid(TTrack const& track, TCursor& rowPid) if (track.hasTOF()) { nSigTof = track.tofNSigmaPi(); } - } else if constexpr (specPid == HfProngSpecies::Kaon) { + } else if constexpr (SpecPid == HfProngSpecies::Kaon) { // kaon PID if (track.hasTPC()) { nSigTpc = track.tpcNSigmaKa(); @@ -100,7 +100,7 @@ void fillProngPid(TTrack const& track, TCursor& rowPid) if (track.hasTOF()) { nSigTof = track.tofNSigmaKa(); } - } else if constexpr (specPid == HfProngSpecies::Proton) { + } else if constexpr (SpecPid == HfProngSpecies::Proton) { // proton PID if (track.hasTPC()) { nSigTpc = track.tpcNSigmaPr(); From 3065eab7fa7b61f731bfcfe3ff7541525e4c4384 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Mon, 29 Sep 2025 18:46:47 +0200 Subject: [PATCH 09/25] Fix names and macro compilation --- PWGHF/HFC/Macros/DhCorrelationExtraction.cxx | 148 +++++------ PWGHF/HFC/Macros/DhCorrelationExtraction.h | 10 +- PWGHF/HFC/Macros/DhCorrelationFitter.cxx | 82 +++--- PWGHF/HFC/Macros/ExtractOutputCorrel.C | 234 +++++++++--------- PWGHF/HFC/Macros/FitCorrel.C | 185 +++++++------- .../computeFonllPlusPythiaPredictions.C | 72 +++--- 6 files changed, 368 insertions(+), 363 deletions(-) diff --git a/PWGHF/HFC/Macros/DhCorrelationExtraction.cxx b/PWGHF/HFC/Macros/DhCorrelationExtraction.cxx index 62ee854a29f..c0e56519dd7 100644 --- a/PWGHF/HFC/Macros/DhCorrelationExtraction.cxx +++ b/PWGHF/HFC/Macros/DhCorrelationExtraction.cxx @@ -45,9 +45,9 @@ DhCorrelationExtraction::DhCorrelationExtraction() : // default constructor fDirME(0x0), fDirSecPart(0x0), fCorrectedCorrHisto(0x0), - fCorrectedCorrHisto_BaselineSubtr(0x0), - fCorrectedCorrHisto_Reflected(0x0), - fCorrectedCorrHisto_Reflected_BaselineSubtr(0x0), + fCorrectedCorrHistoBaselineSubtr(0x0), + fCorrectedCorrHistoReflected(0x0), + fCorrectedCorrHistoReflectedBaselineSubtr(0x0), fDmesonSpecies(kDsToKKPi), fDmesonLabel("Ds"), fFileNameSE(""), @@ -113,9 +113,9 @@ DhCorrelationExtraction::DhCorrelationExtraction(const DhCorrelationExtraction& fDirMass(source.fDirMass), fDirSecPart(source.fDirSecPart), fCorrectedCorrHisto(source.fCorrectedCorrHisto), - fCorrectedCorrHisto_BaselineSubtr(source.fCorrectedCorrHisto_BaselineSubtr), - fCorrectedCorrHisto_Reflected(source.fCorrectedCorrHisto_Reflected), - fCorrectedCorrHisto_Reflected_BaselineSubtr(source.fCorrectedCorrHisto_Reflected_BaselineSubtr), + fCorrectedCorrHistoBaselineSubtr(source.fCorrectedCorrHistoBaselineSubtr), + fCorrectedCorrHistoReflected(source.fCorrectedCorrHistoReflected), + fCorrectedCorrHistoReflectedBaselineSubtr(source.fCorrectedCorrHistoReflectedBaselineSubtr), fDmesonSpecies(source.fDmesonSpecies), fDmesonLabel(source.fDmesonLabel), fFileNameSE(source.fFileNameSE), @@ -174,7 +174,7 @@ DhCorrelationExtraction::~DhCorrelationExtraction() { } -Bool_t DhCorrelationExtraction::SetDmesonSpecie(DmesonSpecie k) +Bool_t DhCorrelationExtraction::setDmesonSpecie(DmesonSpecie k) { if (k < 0 || k > 3) { @@ -194,7 +194,7 @@ Bool_t DhCorrelationExtraction::SetDmesonSpecie(DmesonSpecie k) return kTRUE; } -Bool_t DhCorrelationExtraction::ExtractCorrelations(Double_t ptCandMin, Double_t ptCandMax, Double_t ptHadMin, Double_t ptHadMax, TString codeName) +Bool_t DhCorrelationExtraction::extractCorrelations(Double_t ptCandMin, Double_t ptCandMax, Double_t ptHadMin, Double_t ptHadMax, TString codeName) { if (fSubtractSoftPiME) { @@ -249,13 +249,13 @@ Bool_t DhCorrelationExtraction::ExtractCorrelations(Double_t ptCandMin, Double_t for (int iPool = 0; iPool < fNpools; iPool++) { // Retrieve 2D plots for SE and ME, signal and bkg regions, for each pTbin and pool - hSeSign[iPool] = GetCorrelHisto(kSE, kSign, iPool, ptCandMin, ptCandMax, ptHadMin, ptHadMax); + hSeSign[iPool] = getCorrelHisto(kSE, kSign, iPool, ptCandMin, ptCandMax, ptHadMin, ptHadMax); std::cout << "Got SE histogram signal region" << std::endl; - hMeSign[iPool] = GetCorrelHisto(kME, kSign, iPool, ptCandMin, ptCandMax, ptHadMin, ptHadMax); + hMeSign[iPool] = getCorrelHisto(kME, kSign, iPool, ptCandMin, ptCandMax, ptHadMin, ptHadMax); std::cout << "Got ME histogram signal region" << std::endl; - hSeSideb[iPool] = GetCorrelHisto(kSE, kSideb, iPool, ptCandMin, ptCandMax, ptHadMin, ptHadMax); + hSeSideb[iPool] = getCorrelHisto(kSE, kSideb, iPool, ptCandMin, ptCandMax, ptHadMin, ptHadMax); std::cout << "Got SE histogram sdeband region" << std::endl; - hMeSideb[iPool] = GetCorrelHisto(kME, kSideb, iPool, ptCandMin, ptCandMax, ptHadMin, ptHadMax); + hMeSideb[iPool] = getCorrelHisto(kME, kSideb, iPool, ptCandMin, ptCandMax, ptHadMin, ptHadMax); std::cout << "Got ME histogram sdeband region" << std::endl; hSeSign[iPool]->Sumw2(); @@ -314,8 +314,8 @@ Bool_t DhCorrelationExtraction::ExtractCorrelations(Double_t ptCandMin, Double_t } // Normalize ME plots for the entries in (deltaEta, deltaPhi) = (0, 0) - NormalizeMEplot(hMeSign[iPool], hMeSignSoftPi[iPool]); - NormalizeMEplot(hMeSideb[iPool], hMeSidebSoftPi[iPool]); + normalizeMePlot(hMeSign[iPool], hMeSignSoftPi[iPool]); + normalizeMePlot(hMeSideb[iPool], hMeSidebSoftPi[iPool]); // Apply Event Mixing Correction hCorrSign[iPool] = reinterpret_cast(hSeSign[iPool]->Clone(Form("hCorr_Sign_Pool%d", iPool))); @@ -379,8 +379,8 @@ Bool_t DhCorrelationExtraction::ExtractCorrelations(Double_t ptCandMin, Double_t // Draw 2D plots (Signal region and Sidebands) TCanvas* c2D = new TCanvas(Form("c2D_IntPools_PtHad%.0fto%.0f", ptHadMin, ptHadMax), Form("c2D_%s_IntPools_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), ptHadMin, ptHadMax), 100, 100, 1500, 800); - SetTH2HistoStyle(h2DSign, Form("Signal region, %.0f < p^{%s}_{T} < %.0f GeV/c, %.0f < p^{assoc}_{T} < %.0f GeV/c", ptCandMin, fDmesonLabel.Data(), ptCandMax, ptHadMin, ptHadMax), "#Delta#eta", "#Delta#phi [rad]", "entries", 1.6, 1.6, 1.6, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04); - SetTH2HistoStyle(h2DSideb, Form("Sideband region, %.0f < p^{%s}_{T} < %.0f GeV/c, %.0f < p^{assoc}_{T} < %.0f GeV/c", ptCandMin, fDmesonLabel.Data(), ptCandMax, ptHadMin, ptHadMax), "#Delta#eta", "#Delta#phi [rad]", "#frac{Y_{Bkg}}{Y_{SB}} entries", 1.6, 1.6, 1.6, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04); + setTH2HistoStyle(h2DSign, Form("Signal region, %.0f < p^{%s}_{T} < %.0f GeV/c, %.0f < p^{assoc}_{T} < %.0f GeV/c", ptCandMin, fDmesonLabel.Data(), ptCandMax, ptHadMin, ptHadMax), "#Delta#eta", "#Delta#phi [rad]", "entries", 1.6, 1.6, 1.6, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04); + setTH2HistoStyle(h2DSideb, Form("Sideband region, %.0f < p^{%s}_{T} < %.0f GeV/c, %.0f < p^{assoc}_{T} < %.0f GeV/c", ptCandMin, fDmesonLabel.Data(), ptCandMax, ptHadMin, ptHadMax), "#Delta#eta", "#Delta#phi [rad]", "#frac{Y_{Bkg}}{Y_{SB}} entries", 1.6, 1.6, 1.6, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04); c2D->Divide(2, 1); c2D->cd(1); h2DSign->SetMinimum(0); @@ -393,10 +393,10 @@ Bool_t DhCorrelationExtraction::ExtractCorrelations(Double_t ptCandMin, Double_t // Get FD correlations for FD subtraction if (fFDsubtraction) { - h2DFdTemplatePrompt = GetFDTemplateHisto(kPrompt, ptCandMin, ptCandMax, ptHadMin, ptHadMax); - h2DFdTemplateNonPrompt = GetFDTemplateHisto(kFD, ptCandMin, ptCandMax, ptHadMin, ptHadMax); + h2DFdTemplatePrompt = getFdTemplateHisto(kPrompt, ptCandMin, ptCandMax, ptHadMin, ptHadMax); + h2DFdTemplateNonPrompt = getFdTemplateHisto(kFD, ptCandMin, ptCandMax, ptHadMin, ptHadMax); // h1D_BaselineSubtr - fdPromptFrac = GetFDPromptFrac(ptCandMin, ptCandMax, ptHadMin, ptHadMax); + fdPromptFrac = getFdPromptFrac(ptCandMin, ptCandMax, ptHadMin, ptHadMax); if (fRebinFDCorr) { h2DFdTemplatePrompt->Rebin2D(fRebinAxisDeltaEta, fRebinAxisDeltaPhi); @@ -488,7 +488,7 @@ Bool_t DhCorrelationExtraction::ExtractCorrelations(Double_t ptCandMin, Double_t // Correction for bias B to D topologies if (fCorrBiasBtoD) { - hModul = EvaluateMCClosModulations(ptCandMin, ptCandMax, ptHadMin, ptHadMax); + hModul = evaluateMcClosModulations(ptCandMin, ptCandMax, ptHadMin, ptHadMax); TCanvas* c1DCorrBbias = new TCanvas(Form("c1D_corrBbias_IntPools_PtCand%.0fto%.0f_PtHad%.0fto%.0f", ptCandMin, ptCandMax, ptHadMin, ptHadMax), Form("c1D_corrBbias_%s_IntPools_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), ptHadMin, ptHadMax), 100, 100, 1600, 500); c1DCorrBbias->cd(); hBeforeModulCorr = reinterpret_cast(h1DSubtrNorm->Clone("hBeforeModulCorr")); @@ -502,8 +502,8 @@ Bool_t DhCorrelationExtraction::ExtractCorrelations(Double_t ptCandMin, Double_t TFile* file = new TFile(Form("Output_CorrelationExtraction_%s_Root/SystematicCorrBiasBtoD_%s_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.root", codeName.Data(), fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax), "RECREATE"); // Open file in write mode TH1D* h1DSubtrNormClone = reinterpret_cast(h1DSubtrNorm->Clone("h1D_SubtrNorm_Clone")); - h1DSubtrNormClone = ReflectCorrHistogram(h1DSubtrNormClone); - hBeforeModulCorr = ReflectCorrHistogram(hBeforeModulCorr); + h1DSubtrNormClone = reflectCorrHistogram(h1DSubtrNormClone); + hBeforeModulCorr = reflectCorrHistogram(hBeforeModulCorr); TH1D* hSystematicCorrBiasBtoD = reinterpret_cast(h1DSubtrNormClone->Clone("hSystematicCorrBiasBtoD")); hSystematicCorrBiasBtoD->Add(h1DSubtrNormClone, hBeforeModulCorr, 1, -1); // Set bin contents to absolute values @@ -517,8 +517,8 @@ Bool_t DhCorrelationExtraction::ExtractCorrelations(Double_t ptCandMin, Double_t // Secondary particle contamination if (fSecPartContamination) { - h1DPrimaryPartCorr = GetCorrelHistoSecondaryPart(kPrimaryPart, ptCandMin, ptCandMax, ptHadMin, ptHadMax); - h1DAllPartCorr = GetCorrelHistoSecondaryPart(kAllPart, ptCandMin, ptCandMax, ptHadMin, ptHadMax); + h1DPrimaryPartCorr = getCorrelHistoSecondaryPart(kPrimaryPart, ptCandMin, ptCandMax, ptHadMin, ptHadMax); + h1DAllPartCorr = getCorrelHistoSecondaryPart(kAllPart, ptCandMin, ptCandMax, ptHadMin, ptHadMax); h1DPrimaryPartCorr->Sumw2(); h1DAllPartCorr->Sumw2(); if (fRebinSecPart) { @@ -532,7 +532,7 @@ Bool_t DhCorrelationExtraction::ExtractCorrelations(Double_t ptCandMin, Double_t TCanvas* c1D = new TCanvas(Form("c1D_CorrPrimaryPart_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f", ptCandMin, ptCandMax, ptHadMin, ptHadMax), Form("c1D_%s_CorrPrimaryPart_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), ptHadMin, ptHadMax)); c1D->cd(); - SetTH1HistoStyle(h1DSecPartFrac, Form("%.0f < p_{T} < %.0f GeV/c", ptCandMin, ptCandMax), "#Delta#phi [rad]", "#frac{primary part.}{part. selected}"); + setTH1HistoStyle(h1DSecPartFrac, Form("%.0f < p_{T} < %.0f GeV/c", ptCandMin, ptCandMax), "#Delta#phi [rad]", "#frac{primary part.}{part. selected}"); h1DSecPartFrac->Draw(); c1D->SaveAs(Form("Output_CorrelationExtraction_%s_png/CorrPrimaryPartRatio_%s_Canvas_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f.png", codeName.Data(), fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax)); c1D->SaveAs(Form("Output_CorrelationExtraction_%s_Root/CorrPrimaryPartRatio_%s_Canvas_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f.root", codeName.Data(), fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax)); @@ -589,12 +589,12 @@ Bool_t DhCorrelationExtraction::ExtractCorrelations(Double_t ptCandMin, Double_t c->SaveAs(Form("Output_CorrelationExtraction_%s_Root/CorrFDTemplate_1D_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.root", codeName.Data(), fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax)); } - Double_t baselineFd = CalculateBaseline(h1DTemplateTotal, kTRUE); + Double_t baselineFd = calculateBaseline(h1DTemplateTotal, kTRUE); Double_t baselineData; if (fSecPartContamination) { - baselineData = CalculateBaseline(h1DSubtrNormSecPart, kTRUE); + baselineData = calculateBaseline(h1DSubtrNormSecPart, kTRUE); } else { - baselineData = CalculateBaseline(h1DSubtrNorm, kTRUE); + baselineData = calculateBaseline(h1DSubtrNorm, kTRUE); } std::cout << "===================== " << std::endl; @@ -711,8 +711,8 @@ Bool_t DhCorrelationExtraction::ExtractCorrelations(Double_t ptCandMin, Double_t TH1D* hBaseline = reinterpret_cast(h1DSubtrNorm->Clone("hBaseline")); hBaseline->Sumw2(); if (fFDsubtraction) { - baselineData = CalculateBaseline(h1DSubtrFdNorm, kTRUE, kFALSE); // introduced kFALSE - baselineDataErr = CalculateBaselineError(h1DSubtrFdNorm, kTRUE, kFALSE); + baselineData = calculateBaseline(h1DSubtrFdNorm, kTRUE, kFALSE); // introduced kFALSE + baselineDataErr = calculateBaselineError(h1DSubtrFdNorm, kTRUE, kFALSE); for (int iBin = 0; iBin < hBaseline->GetNbinsX(); iBin++) { hBaseline->SetBinContent(iBin + 1, baselineData); hBaseline->SetBinError(iBin + 1, baselineDataErr); @@ -720,8 +720,8 @@ Bool_t DhCorrelationExtraction::ExtractCorrelations(Double_t ptCandMin, Double_t h1DBaselineSubtr = reinterpret_cast(h1DSubtrFdNorm->Clone("h1D_BaselineSubtr")); h1DBaselineSubtr->Add(hBaseline, -1.); } else if (fSecPartContamination) { - baselineData = CalculateBaseline(h1DSubtrNormSecPart, kTRUE, kFALSE); - baselineDataErr = CalculateBaselineError(h1DSubtrNormSecPart, kTRUE, kFALSE); + baselineData = calculateBaseline(h1DSubtrNormSecPart, kTRUE, kFALSE); + baselineDataErr = calculateBaselineError(h1DSubtrNormSecPart, kTRUE, kFALSE); for (int iBin = 0; iBin < hBaseline->GetNbinsX(); iBin++) { hBaseline->SetBinContent(iBin + 1, baselineData); hBaseline->SetBinError(iBin + 1, baselineDataErr); @@ -729,8 +729,8 @@ Bool_t DhCorrelationExtraction::ExtractCorrelations(Double_t ptCandMin, Double_t h1DBaselineSubtr = reinterpret_cast(h1DSubtrNormSecPart->Clone("h1D_BaselineSubtr")); h1DBaselineSubtr->Add(hBaseline, -1.); } else { - baselineData = CalculateBaseline(h1DSubtrNorm, kTRUE, kFALSE); - baselineDataErr = CalculateBaselineError(h1DSubtrNorm, kTRUE, kFALSE); + baselineData = calculateBaseline(h1DSubtrNorm, kTRUE, kFALSE); + baselineDataErr = calculateBaselineError(h1DSubtrNorm, kTRUE, kFALSE); for (int iBin = 0; iBin < hBaseline->GetNbinsX(); iBin++) { hBaseline->SetBinContent(iBin + 1, baselineData); hBaseline->SetBinError(iBin + 1, baselineDataErr); @@ -739,7 +739,7 @@ Bool_t DhCorrelationExtraction::ExtractCorrelations(Double_t ptCandMin, Double_t h1DBaselineSubtr->Add(hBaseline, -1.); } - fCorrectedCorrHisto_BaselineSubtr = reinterpret_cast(h1DBaselineSubtr->Clone(Form("hCorrectedCorrBaselineSubtr_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f", ptCandMin, ptCandMax, ptHadMin, ptHadMax))); + fCorrectedCorrHistoBaselineSubtr = reinterpret_cast(h1DBaselineSubtr->Clone(Form("hCorrectedCorrBaselineSubtr_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f", ptCandMin, ptCandMax, ptHadMin, ptHadMax))); TCanvas* cFinalBaselineSubtr = new TCanvas(Form("cFinal_BaselineSubtr_%.0fto%.0f", ptHadMin, ptHadMax), Form("cFinal_BaselineSubtr_%s_IntPools_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), ptHadMin, ptHadMax), 100, 100, 1200, 700); h1DBaselineSubtr->SetMarkerColor(kOrange + 8); @@ -763,11 +763,11 @@ Bool_t DhCorrelationExtraction::ExtractCorrelations(Double_t ptCandMin, Double_t // Reflected histograms if (fFDsubtraction) { - h1DReflCorr = ReflectCorrHistogram(h1DSubtrFdNorm); + h1DReflCorr = reflectCorrHistogram(h1DSubtrFdNorm); } else if (fSecPartContamination) { - h1DReflCorr = ReflectCorrHistogram(h1DSubtrNormSecPart); + h1DReflCorr = reflectCorrHistogram(h1DSubtrNormSecPart); } else { - h1DReflCorr = ReflectCorrHistogram(h1DSubtrNorm); + h1DReflCorr = reflectCorrHistogram(h1DSubtrNorm); } /* used as control using Run2 reflection function @@ -781,7 +781,7 @@ Bool_t DhCorrelationExtraction::ExtractCorrelations(Double_t ptCandMin, Double_t TCanvas* cFinalReflected = new TCanvas(Form("cFinal_Reflected_%.0fto%.0f", ptHadMin, ptHadMax), Form("cFinal_Reflected_%s_IntPools_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), ptHadMin, ptHadMax), 100, 100, 1200, 700); cFinalReflected->cd(); - SetTH1HistoStyle(h1DReflCorr, Form("%.0f < p_{T} < %.0f GeV/c", ptCandMin, ptCandMax), "#Delta#phi [rad]", "#frac{1}{N_{D}}#frac{dN^{assoc}}{d#Delta#phi} [rad^{-1}]", kFullCircle, kOrange + 8, 1.6, kOrange + 8, 3); + setTH1HistoStyle(h1DReflCorr, Form("%.0f < p_{T} < %.0f GeV/c", ptCandMin, ptCandMax), "#Delta#phi [rad]", "#frac{1}{N_{D}}#frac{dN^{assoc}}{d#Delta#phi} [rad^{-1}]", kFullCircle, kOrange + 8, 1.6, kOrange + 8, 3); h1DReflCorr->SetMinimum(0); h1DReflCorr->Draw(); cFinalReflected->SaveAs(Form("Output_CorrelationExtraction_%s_png/AzimCorrDistr_Reflected_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.png", codeName.Data(), fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax)); @@ -790,8 +790,8 @@ Bool_t DhCorrelationExtraction::ExtractCorrelations(Double_t ptCandMin, Double_t // Reflected histograms baseline subtracted TH1D* hBaselineRefl = reinterpret_cast(h1DReflCorr->Clone("hBaseline_Refl")); hBaselineRefl->Sumw2(); - baselineData = CalculateBaseline(h1DReflCorr, kFALSE, kTRUE); - baselineDataErr = CalculateBaselineError(h1DReflCorr, kFALSE, kTRUE); + baselineData = calculateBaseline(h1DReflCorr, kFALSE, kTRUE); + baselineDataErr = calculateBaselineError(h1DReflCorr, kFALSE, kTRUE); for (int iBin = 0; iBin < hBaselineRefl->GetNbinsX(); iBin++) { hBaselineRefl->SetBinContent(iBin + 1, baselineData); @@ -809,7 +809,7 @@ Bool_t DhCorrelationExtraction::ExtractCorrelations(Double_t ptCandMin, Double_t fConstZero->SetTitle(""); TCanvas* cFinalReflectedBaselineSubtr = new TCanvas(Form("cFinal_Reflected_BaselineSubtr_%.0fto%.0f", ptHadMin, ptHadMax), Form("cFinal_Reflected_BaselineSubtr_%s_IntPools_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), ptHadMin, ptHadMax), 100, 100, 1200, 700); - SetTH1HistoStyle(h1DReflCorrBaselineSubtr, Form("%.0f < p_{T} < %.0f GeV/c", ptCandMin, ptCandMax), "#Delta#phi [rad]", "#frac{1}{N_{D}}#frac{dN^{assoc}}{d#Delta#phi} [rad^{-1}]", kFullCircle, kRed + 1, 1.6, kRed + 1, 3); + setTH1HistoStyle(h1DReflCorrBaselineSubtr, Form("%.0f < p_{T} < %.0f GeV/c", ptCandMin, ptCandMax), "#Delta#phi [rad]", "#frac{1}{N_{D}}#frac{dN^{assoc}}{d#Delta#phi} [rad^{-1}]", kFullCircle, kRed + 1, 1.6, kRed + 1, 3); hBaselineRefl->SetMarkerColor(kOrange); hBaselineRefl->SetMarkerStyle(kFullSquare); hBaselineRefl->SetLineColor(kOrange); @@ -825,13 +825,13 @@ Bool_t DhCorrelationExtraction::ExtractCorrelations(Double_t ptCandMin, Double_t cFinalReflectedBaselineSubtr->SaveAs(Form("Output_CorrelationExtraction_%s_png/AzimCorrDistr_Reflected_BaselineSubtr_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.png", codeName.Data(), fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax)); cFinalReflectedBaselineSubtr->SaveAs(Form("Output_CorrelationExtraction_%s_Root/AzimCorrDistr_Reflected_BaselineSubtr_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.root", codeName.Data(), fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax)); - fCorrectedCorrHisto_Reflected = reinterpret_cast(h1DReflCorr->Clone(Form("hCorrectedCorrReflected_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f", ptCandMin, ptCandMax, ptHadMin, ptHadMax))); - fCorrectedCorrHisto_Reflected_BaselineSubtr = reinterpret_cast(h1DReflCorrBaselineSubtr->Clone(Form("hCorrectedCorrReflected_BaselineSubtr_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f", ptCandMin, ptCandMax, ptHadMin, ptHadMax))); + fCorrectedCorrHistoReflected = reinterpret_cast(h1DReflCorr->Clone(Form("hCorrectedCorrReflected_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f", ptCandMin, ptCandMax, ptHadMin, ptHadMax))); + fCorrectedCorrHistoReflectedBaselineSubtr = reinterpret_cast(h1DReflCorrBaselineSubtr->Clone(Form("hCorrectedCorrReflected_BaselineSubtr_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f", ptCandMin, ptCandMax, ptHadMin, ptHadMax))); return kTRUE; } -Bool_t DhCorrelationExtraction::ReadInputSEandME() +Bool_t DhCorrelationExtraction::readInputSeAndMe() { fFileSE = TFile::Open(fFileNameSE.Data()); @@ -861,7 +861,7 @@ Bool_t DhCorrelationExtraction::ReadInputSEandME() return kTRUE; } -Bool_t DhCorrelationExtraction::ReadInputInvMass() +Bool_t DhCorrelationExtraction::readInputInvMass() { fFileMass = TFile::Open(fFileNameMass.Data()); @@ -882,7 +882,7 @@ Bool_t DhCorrelationExtraction::ReadInputInvMass() return kTRUE; } -Bool_t DhCorrelationExtraction::ReadInputFDSubtr() +Bool_t DhCorrelationExtraction::readInputFdSubtr() { fFileFDTemplate = TFile::Open(fFileFDTemplateName.Data()); @@ -909,7 +909,7 @@ Bool_t DhCorrelationExtraction::ReadInputFDSubtr() return kTRUE; } -Bool_t DhCorrelationExtraction::ReadInputSecondaryPartContamination() +Bool_t DhCorrelationExtraction::readInputSecondaryPartContamination() { fFileSecPart = TFile::Open(fFileSecPartName.Data()); @@ -935,7 +935,7 @@ Bool_t DhCorrelationExtraction::ReadInputSecondaryPartContamination() return kTRUE; } -TH1D* DhCorrelationExtraction::EvaluateMCClosModulations(Double_t ptCandMin, Double_t ptCandMax, Double_t ptHadMin, Double_t ptHadMax) +TH1D* DhCorrelationExtraction::evaluateMcClosModulations(Double_t ptCandMin, Double_t ptCandMax, Double_t ptHadMin, Double_t ptHadMax) { TH1D* hModul = new TH1D(); @@ -958,10 +958,10 @@ TH1D* DhCorrelationExtraction::EvaluateMCClosModulations(Double_t ptCandMin, Dou printf("[INFO] Bin cand %d - Bin had %d \n", fBinPtCand, fBinPtHad); - // hRecPrompt = ReflectCorrHistogram(hRecPrompt); - // hRecNonPrompt = ReflectCorrHistogram(hRecNonPrompt); - // hGenPrompt = ReflectCorrHistogram(hGenPrompt); - // hGenNonPrompt = ReflectCorrHistogram(hGenNonPrompt); + // hRecPrompt = reflectCorrHistogram(hRecPrompt); + // hRecNonPrompt = reflectCorrHistogram(hRecNonPrompt); + // hGenPrompt = reflectCorrHistogram(hGenPrompt); + // hGenNonPrompt = reflectCorrHistogram(hGenNonPrompt); hRecNonPrompt->Sumw2(); hRecNonPrompt->Sumw2(); @@ -982,7 +982,7 @@ TH1D* DhCorrelationExtraction::EvaluateMCClosModulations(Double_t ptCandMin, Dou hRatioNonPrompt->GetYaxis()->SetRangeUser(0.2, 1.8); hRatioNonPrompt->Draw(); - Double_t fPrompt = GetFDPromptFrac(ptCandMin, ptCandMax, ptHadMin, ptHadMax); + Double_t fPrompt = getFdPromptFrac(ptCandMin, ptCandMax, ptHadMin, ptHadMax); Double_t relAmplC[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; Double_t relAmplB[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; Double_t recoKineVal[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; @@ -1012,7 +1012,7 @@ TH1D* DhCorrelationExtraction::EvaluateMCClosModulations(Double_t ptCandMin, Dou return hModul; } -TH2D* DhCorrelationExtraction::GetCorrelHisto(Int_t sEorMe, Int_t sorSb, Int_t pool, Double_t ptCandMin, Double_t ptCandMax, Double_t ptHadMin, Double_t ptHadMax) +TH2D* DhCorrelationExtraction::getCorrelHisto(Int_t sEorMe, Int_t sorSb, Int_t pool, Double_t ptCandMin, Double_t ptCandMax, Double_t ptHadMin, Double_t ptHadMax) { // TODO: Subtraction of softpion TH2D* h2D = new TH2D(); // pointer to be returned @@ -1130,7 +1130,7 @@ TH2D* DhCorrelationExtraction::GetCorrelHisto(Int_t sEorMe, Int_t sorSb, Int_t p return h2D; } -void DhCorrelationExtraction::GetSignalAndBackgroundForNorm(Double_t ptCandMin, Double_t ptCandMax) +void DhCorrelationExtraction::getSignalAndBackgroundForNorm(Double_t ptCandMin, Double_t ptCandMax) { // using results obtained from HFInvariantMassFitter.cxx class @@ -1162,21 +1162,21 @@ void DhCorrelationExtraction::GetSignalAndBackgroundForNorm(Double_t ptCandMin, std::cout << "================================= " << std::endl; std::cout << " " << std::endl; - SetSignalYieldforNorm(sgnYield); - SetBkgYield(bkgYield); + setSignalYieldforNorm(sgnYield); + setBkgYield(bkgYield); if (fUseSidebLeft && fUseSidebRight) { - SetBkgScaleFactor(bkgYield / sBsYield); - SetSBYield(sBsYield); + setBkgScaleFactor(bkgYield / sBsYield); + setSbYield(sBsYield); } else if (fUseSidebLeft && !fUseSidebRight) { - SetBkgScaleFactor(bkgYield / sblYield); - SetSBYield(sblYield); + setBkgScaleFactor(bkgYield / sblYield); + setSbYield(sblYield); } else if (!fUseSidebLeft && fUseSidebRight) { - SetBkgScaleFactor(bkgYield / sbrYield); - SetSBYield(sbrYield); + setBkgScaleFactor(bkgYield / sbrYield); + setSbYield(sbrYield); } } -TH2D* DhCorrelationExtraction::GetFDTemplateHisto(Int_t promptOrFd, Double_t ptCandMin, Double_t ptCandMax, Double_t ptHadMin, Double_t ptHadMax) +TH2D* DhCorrelationExtraction::getFdTemplateHisto(Int_t promptOrFd, Double_t ptCandMin, Double_t ptCandMax, Double_t ptHadMin, Double_t ptHadMax) { TH2D* h2D = new TH2D(); // pointer to be returned @@ -1208,7 +1208,7 @@ TH2D* DhCorrelationExtraction::GetFDTemplateHisto(Int_t promptOrFd, Double_t ptC return h2D; } -TH1D* DhCorrelationExtraction::GetCorrelHistoSecondaryPart(Int_t partType, Double_t ptCandMin, Double_t ptCandMax, Double_t ptHadMin, Double_t ptHadMax) +TH1D* DhCorrelationExtraction::getCorrelHistoSecondaryPart(Int_t partType, Double_t ptCandMin, Double_t ptCandMax, Double_t ptHadMin, Double_t ptHadMax) { TH1D* h1D = new TH1D(); // pointer to be returned @@ -1257,7 +1257,7 @@ TH1D* DhCorrelationExtraction::GetCorrelHistoSecondaryPart(Int_t partType, Doubl return h1D; } -TH1D* DhCorrelationExtraction::ReflectCorrHistogram(TH1D*& histo) +TH1D* DhCorrelationExtraction::reflectCorrHistogram(TH1D*& histo) { // nBinsPhi must be a multple of 4 in order to reflect correcty the histogram @@ -1293,7 +1293,7 @@ TH1D* DhCorrelationExtraction::ReflectCorrHistogram(TH1D*& histo) return h1D; } -TH1D* DhCorrelationExtraction::ReflectHistoRun2(TH1D* h, Double_t scale) +TH1D* DhCorrelationExtraction::reflectHistoRun2(TH1D* h, Double_t scale) { TH1D* h2 = new TH1D(Form("%sReflected", h->GetName()), Form("%sReflected", h->GetName()), h->GetNbinsX() / 2., 0., TMath::Pi()); @@ -1322,7 +1322,7 @@ TH1D* DhCorrelationExtraction::ReflectHistoRun2(TH1D* h, Double_t scale) return h2; } -Double_t DhCorrelationExtraction::GetFDPromptFrac(Double_t ptCandMin, Double_t ptCandMax, Double_t ptHadMin, Double_t ptHadMax) +Double_t DhCorrelationExtraction::getFdPromptFrac(Double_t ptCandMin, Double_t ptCandMax, Double_t ptHadMin, Double_t ptHadMax) { TH1D* h1D = new TH1D(); @@ -1341,7 +1341,7 @@ Double_t DhCorrelationExtraction::GetFDPromptFrac(Double_t ptCandMin, Double_t p return promptFraction; } -void DhCorrelationExtraction::NormalizeMEplot(TH2D*& histoME, TH2D*& histoMEsoftPi) const +void DhCorrelationExtraction::normalizeMePlot(TH2D*& histoME, TH2D*& histoMEsoftPi) const { Int_t bin0phi = histoME->GetYaxis()->FindBin(0.); @@ -1370,7 +1370,7 @@ void DhCorrelationExtraction::NormalizeMEplot(TH2D*& histoME, TH2D*& histoMEsoft histoME->Scale(1. / factorNorm); } -Double_t DhCorrelationExtraction::CalculateBaseline(TH1D*& histo, Bool_t totalRange, Bool_t reflected) +Double_t DhCorrelationExtraction::calculateBaseline(TH1D*& histo, Bool_t totalRange, Bool_t reflected) { // total range = 2*Pi @@ -1450,7 +1450,7 @@ Double_t DhCorrelationExtraction::CalculateBaseline(TH1D*& histo, Bool_t totalRa return baseline; } -Double_t DhCorrelationExtraction::CalculateBaselineError(TH1D*& histo, Bool_t totalRange, Bool_t reflected) +Double_t DhCorrelationExtraction::calculateBaselineError(TH1D*& histo, Bool_t totalRange, Bool_t reflected) { // total range = 2*Pi @@ -1508,7 +1508,7 @@ Double_t DhCorrelationExtraction::CalculateBaselineError(TH1D*& histo, Bool_t to return errBaseline; } -void DhCorrelationExtraction::SetTH1HistoStyle(TH1D*& histo, TString hTitle, TString hXaxisTitle, TString hYaxisTitle, +void DhCorrelationExtraction::setTH1HistoStyle(TH1D*& histo, TString hTitle, TString hXaxisTitle, TString hYaxisTitle, Style_t markerStyle, Color_t markerColor, Double_t markerSize, Color_t lineColor, Int_t lineWidth, Float_t hTitleXaxisOffset, Float_t hTitleYaxisOffset, Float_t hTitleXaxisSize, Float_t hTitleYaxisSize, Float_t hLabelXaxisSize, Float_t hLabelYaxisSize, @@ -1533,7 +1533,7 @@ void DhCorrelationExtraction::SetTH1HistoStyle(TH1D*& histo, TString hTitle, TSt histo->GetYaxis()->CenterTitle(centerYaxisTitle); } -void DhCorrelationExtraction::SetTH2HistoStyle(TH2D*& histo, TString hTitle, TString hXaxisTitle, TString hYaxisTitle, TString hZaxisTitle, +void DhCorrelationExtraction::setTH2HistoStyle(TH2D*& histo, TString hTitle, TString hXaxisTitle, TString hYaxisTitle, TString hZaxisTitle, Float_t hTitleXaxisOffset, Float_t hTitleYaxisOffset, Float_t hTitleZaxisOffset, Float_t hTitleXaxisSize, Float_t hTitleYaxisSize, Float_t hTitleZaxisSize, Float_t hLabelXaxisSize, Float_t hLabelYaxisSize, Float_t hLabelZaxisSize, diff --git a/PWGHF/HFC/Macros/DhCorrelationExtraction.h b/PWGHF/HFC/Macros/DhCorrelationExtraction.h index 820ee73cb26..962dc50ef0d 100644 --- a/PWGHF/HFC/Macros/DhCorrelationExtraction.h +++ b/PWGHF/HFC/Macros/DhCorrelationExtraction.h @@ -112,7 +112,7 @@ class DhCorrelationExtraction : public TObject fRebinSecPart = rebinSecPart; } void getSignalAndBackgroundForNorm(Double_t ptCandMin, Double_t ptCandMax); - void normalizeMEplot(TH2D*& histoME, TH2D*& histoMEsoftPi) const; + void normalizeMePlot(TH2D*& histoME, TH2D*& histoMEsoftPi) const; void setDebugLevel(Int_t debug) { fDebug = debug; } void setDividedSidebands(Bool_t dividedSideb, Bool_t useSidebLeft, Bool_t useSidebRight) { @@ -139,7 +139,7 @@ class DhCorrelationExtraction : public TObject Double_t getFdPromptFrac(Double_t ptCandMin, Double_t ptCandMax, Double_t ptHadMin, Double_t ptHadMax); Double_t calculateBaseline(TH1D*& histo, Bool_t totalRange = kTRUE, Bool_t reflected = kFALSE); Double_t calculateBaselineError(TH1D*& histo, Bool_t totalRange = kTRUE, Bool_t reflected = kFALSE); - Bool_t readInputSEandMe(); + Bool_t readInputSeAndMe(); Bool_t readInputInvMass(); Bool_t readInputFdSubtr(); Bool_t readInputSecondaryPartContamination(); @@ -168,9 +168,9 @@ class DhCorrelationExtraction : public TObject TDirectoryFile* fDirME; // TDirectory for ME info TDirectoryFile* fDirSecPart; // TDirectory for seondary particle correction - TH1D* fCorrectedCorrHisto; // Corrected correlation histogram - TH1D* fCorrectedCorrHistoBaselineSubtr; // Corrected correlation histogram with baseline subtracion - TH1D* fCorrectedCorrHistoReflected; // Corrected correlation histogram relected in azimuth + TH1D* fCorrectedCorrHisto; // Corrected correlation histogram + TH1D* fCorrectedCorrHistoBaselineSubtr; // Corrected correlation histogram with baseline subtracion + TH1D* fCorrectedCorrHistoReflected; // Corrected correlation histogram relected in azimuth TH1D* fCorrectedCorrHistoReflectedBaselineSubtr; // Corrected correlation histogram reflected in azimuth with baseline subtraction DmesonSpecie fDmesonSpecies; // D meson specie diff --git a/PWGHF/HFC/Macros/DhCorrelationFitter.cxx b/PWGHF/HFC/Macros/DhCorrelationFitter.cxx index 683ae0cc04a..dd77d723c1b 100644 --- a/PWGHF/HFC/Macros/DhCorrelationFitter.cxx +++ b/PWGHF/HFC/Macros/DhCorrelationFitter.cxx @@ -215,7 +215,7 @@ DhCorrelationFitter& DhCorrelationFitter::operator=(const DhCorrelationFitter& c return *this; } -void DhCorrelationFitter::SetExternalValsAndBounds(Int_t nPars, Double_t* vals, Double_t* lowBounds, Double_t* uppBounds) +void DhCorrelationFitter::setExternalValsAndBounds(Int_t nPars, Double_t* vals, Double_t* lowBounds, Double_t* uppBounds) { fNpars = nPars; @@ -233,7 +233,7 @@ void DhCorrelationFitter::SetExternalValsAndBounds(Int_t nPars, Double_t* vals, return; } -void DhCorrelationFitter::Fitting(Bool_t drawSplitTerm, Bool_t useExternalPars) +void DhCorrelationFitter::fitting(Bool_t drawSplitTerm, Bool_t useExternalPars) { // -> fFixBase = 0 : baseline free // = 1 : fix the baseline to the minimum of the histogram @@ -252,18 +252,18 @@ void DhCorrelationFitter::Fitting(Bool_t drawSplitTerm, Bool_t useExternalPars) if (fFixBase != 0 && fFixBase != 6) { Printf("[INFO] DhCorrelationFitter::Fitting, Finding baseline"); - FindBaseline(); + findBaseline(); } if (fFixBase == 0) { // set initial value of the fBaseline - fBaseline = CalculateBaseline(fHist, fIsTotal); + fBaseline = calculateBaseline(fHist, fIsTotal); } Printf("[INFO] DhCorrelationFitter::Fitting, Setting Function"); if (fTypeOfFitFunc == 7) { // case for v2 modulation - FitBaselineWv2(); // to contrain the B parameter in the fit function for the pedestal + fitBaselineWv2(); // to contrain the B parameter in the fit function for the pedestal Printf("[INFO] B parameter for v2 fit: %.3f", fBaseline); } - SetFitFunction(); + setFitFunction(); if (fFixBase != 0) { fFit->FixParameter(0, fBaseline); @@ -293,10 +293,10 @@ void DhCorrelationFitter::Fitting(Bool_t drawSplitTerm, Bool_t useExternalPars) fErrBaseline = fFit->GetParError(0); } Printf("[INFO] DhCorrelationFitter::Fitting, Calculating yields with BC"); - CalculateYieldsAboveBaseline(); + calculateYieldsAboveBaseline(); fHist->SetTitle(";#Delta#varphi (rad); #frac{1}{N_{D}}#frac{dN^{assoc}}{d#Delta#varphi} (rad^{-1})"); Printf("[INFO] DhCorrelationFitter::Fitting, Now drawing, if requested"); - SetSingleTermsForDrawing(drawSplitTerm); + setSingleTermsForDrawing(drawSplitTerm); // NS yield from bin counting double fNSyield = 0.; @@ -321,7 +321,7 @@ void DhCorrelationFitter::Fitting(Bool_t drawSplitTerm, Bool_t useExternalPars) printf("[RESULT MINE] Bin counting results: NS Yield = %.3f +- %.3f \n[RESULT MINE] Bin counting results: AS Yield: %.3f +- %.3f \n[RESULT MINE] baseline = %.3f \n", fNSyield, fNSyieldErr, fASyield, fASyieldErr, baselinBinCount); } -void DhCorrelationFitter::SetFitFunction() +void DhCorrelationFitter::setFitFunction() { // -> fitFunc = 1: const + G NS + G AS (w/o periodicity) // = 2: const + G NS + G AS (w/ periodicity) @@ -596,7 +596,7 @@ void DhCorrelationFitter::SetFitFunction() } } -void DhCorrelationFitter::SetPointsForBaseline(Int_t nBaselinePoints, Int_t* binsBaseline) +void DhCorrelationFitter::setPointsForBaseline(Int_t nBaselinePoints, Int_t* binsBaseline) { fNbasleinePoints = nBaselinePoints; @@ -610,13 +610,13 @@ void DhCorrelationFitter::SetPointsForBaseline(Int_t nBaselinePoints, Int_t* bin return; } -Double_t DhCorrelationFitter::FindBaseline() +Double_t DhCorrelationFitter::findBaseline() { // baseline free if (fFixBase == 0) { Printf("[INFO] DhCorrelationFitter::FindBasline(). The baseline option is set to free baseline: now the full fit will be done. Beware!"); - Fitting(); // TODO: not sure + fitting(); // TODO: not sure return fBaseline; } @@ -654,7 +654,7 @@ Double_t DhCorrelationFitter::FindBaseline() for (Int_t k = 1; k <= fHist->GetNbinsX(); k++) { hval[k - 1] = fHist->GetBinContent(k); } - Double_t errAv = 0., Av = 0.; + Double_t errAv = 0., av = 0.; TMath::Sort(fHist->GetNbinsX(), hval, ind, kFALSE); // KFALSE -> increasing order // Average of abs(fFixBase) lower points for (Int_t k = 0; k < npointsAv; k++) { @@ -664,13 +664,13 @@ Double_t DhCorrelationFitter::FindBaseline() npointsAv++; continue; } - Av += fHist->GetBinContent(ind[k] + 1) / (fHist->GetBinError(ind[k] + 1) * fHist->GetBinError(ind[k] + 1)); + av += fHist->GetBinContent(ind[k] + 1) / (fHist->GetBinError(ind[k] + 1) * fHist->GetBinError(ind[k] + 1)); errAv += 1. / (fHist->GetBinError(ind[k] + 1) * fHist->GetBinError(ind[k] + 1)); } - Av /= errAv; + av /= errAv; errAv = TMath::Sqrt(1. / errAv); - printf("[RESULT] Average fBaseline: %.3f +- %.3f", Av, errAv); - fBaseline = Av; + printf("[RESULT] Average fBaseline: %.3f +- %.3f", av, errAv); + fBaseline = av; fErrBaseline = errAv; if (fShiftBaselineUp) { @@ -688,23 +688,23 @@ Double_t DhCorrelationFitter::FindBaseline() // zyam at pi/2. Fix the baseline averaging the 2 points around +-pi/2 value if (fFixBase == 2) { - Double_t errAv = 0., Av = 0.; + Double_t errAv = 0., av = 0.; Int_t binPhi = fHist->FindBin(TMath::Pi() / 2.); - Av += fHist->GetBinContent(binPhi) / (fHist->GetBinError(binPhi) * fHist->GetBinError(binPhi)); + av += fHist->GetBinContent(binPhi) / (fHist->GetBinError(binPhi) * fHist->GetBinError(binPhi)); errAv += 1. / (fHist->GetBinError(binPhi) * fHist->GetBinError(binPhi)); if (!fIsReflected) { binPhi = fHist->FindBin(-TMath::Pi() / 2.); if (binPhi < 1) binPhi = 1; - Av += fHist->GetBinContent(binPhi) / (fHist->GetBinError(binPhi) * fHist->GetBinError(binPhi)); + av += fHist->GetBinContent(binPhi) / (fHist->GetBinError(binPhi) * fHist->GetBinError(binPhi)); errAv += 1. / (fHist->GetBinError(binPhi) * fHist->GetBinError(binPhi)); } else { printf("[INFO] Reflected histo: only the point at +pi/2 used to evaluate baseline"); } - Av /= errAv; + av /= errAv; errAv = TMath::Sqrt(1. / errAv); - printf("[RESULT] Average fBaseline: %.3f +- %.3f \n", Av, errAv); - fBaseline = Av; + printf("[RESULT] Average fBaseline: %.3f +- %.3f \n", av, errAv); + fBaseline = av; fErrBaseline = errAv; if (fShiftBaselineUp) { @@ -726,15 +726,15 @@ Double_t DhCorrelationFitter::FindBaseline() printf("[ERROR] No baseline points set for the baseline evaluation, SetPointsForBaseline(Int_t nBaselinePoints, Double_t* valsBaseline). Returning -1"); return -1; } - Double_t errAv = 0., Av = 0.; + Double_t errAv = 0., av = 0.; for (int i = 0; i < fNbasleinePoints; i++) { - Av += fHist->GetBinContent(fBinsBaseline[i]) / (fHist->GetBinError(fBinsBaseline[i]) * fHist->GetBinError(fBinsBaseline[i])); + av += fHist->GetBinContent(fBinsBaseline[i]) / (fHist->GetBinError(fBinsBaseline[i]) * fHist->GetBinError(fBinsBaseline[i])); errAv += 1. / (fHist->GetBinError(fBinsBaseline[i]) * fHist->GetBinError(fBinsBaseline[i])); } - Av /= errAv; + av /= errAv; errAv = TMath::Sqrt(1. / errAv); - printf("[RESULT] Average fBaseline: %.3f +- %.3f \n", Av, errAv); - fBaseline = Av; + printf("[RESULT] Average fBaseline: %.3f +- %.3f \n", av, errAv); + fBaseline = av; fErrBaseline = errAv; if (fShiftBaselineUp) { @@ -751,8 +751,8 @@ Double_t DhCorrelationFitter::FindBaseline() } if (fFixBase == 4) { - fBaseline = CalculateBaseline(fHist, fIsTotal); // TODO: add the option for total range/ reflected range to pass in input - fErrBaseline = CalculateBaselineError(fHist, fIsTotal); + fBaseline = calculateBaseline(fHist, fIsTotal); // TODO: add the option for total range/ reflected range to pass in input + fErrBaseline = calculateBaselineError(fHist, fIsTotal); if (fShiftBaselineUp) { fBaseline += fErrBaseline; @@ -771,7 +771,7 @@ Double_t DhCorrelationFitter::FindBaseline() return -1.; } -void DhCorrelationFitter::FitBaselineWv2() +void DhCorrelationFitter::fitBaselineWv2() { fBaseTransvReg = new TF1("fBaseTransvReg", [](double* x, double* p) { @@ -791,14 +791,14 @@ void DhCorrelationFitter::FitBaselineWv2() return; } -void DhCorrelationFitter::CalculateYieldsAboveBaseline() +void DhCorrelationFitter::calculateYieldsAboveBaseline() { fNSyieldBinCount = 0; fErrNSyieldBinCount = 0; fASyieldBinCount = 0; fErrASyieldBinCount = 0; - cout << "[RESULT] Baseline: " << fBaseline << " +- " << fErrBaseline << endl; + std::cout << "[RESULT] Baseline: " << fBaseline << " +- " << fErrBaseline << std::endl; Int_t binMinNS = fHist->FindBin(-1.5); // slightly more than -pi/2 if (binMinNS < 1) binMinNS = 1; // with this, it is ok even in the case of a reflected fHist (range 0 - pi) @@ -807,11 +807,11 @@ void DhCorrelationFitter::CalculateYieldsAboveBaseline() Int_t binMaxAS = 16; // fHist -> FindBin(3.14+1.5); // slightly less than +3pi/2 if (binMaxAS > fHist->GetNbinsX()) binMaxAS = fHist->GetNbinsX(); // with this, it is ok even in the case of a reflected fHist (range 0 - pi) - cout << "N bins : " << fHist->GetNbinsX() << endl; - cout << "binMinNS : " << binMinNS << endl; - cout << "binMaxNS : " << binMaxNS << endl; - cout << "binMinAS : " << binMinAS << endl; - cout << "binMaxAS : " << binMaxAS << endl; + std::cout << "N bins : " << fHist->GetNbinsX() << std::endl; + std::cout << "binMinNS : " << binMinNS << std::endl; + std::cout << "binMaxNS : " << binMaxNS << std::endl; + std::cout << "binMinAS : " << binMinAS << std::endl; + std::cout << "binMaxAS : " << binMaxAS << std::endl; // Near Side Yield from bin counting for (Int_t bmNS = binMinNS; bmNS <= binMaxNS; bmNS++) { fNSyieldBinCount += 2 * (fHist->GetBinContent(bmNS) - fBaseline) * fHist->GetBinWidth(bmNS); @@ -831,7 +831,7 @@ void DhCorrelationFitter::CalculateYieldsAboveBaseline() return; } -Double_t DhCorrelationFitter::CalculateBaseline(TH1F*& histo, Bool_t totalRange) +Double_t DhCorrelationFitter::calculateBaseline(TH1F*& histo, Bool_t totalRange) { // total range = 2*Pi @@ -904,7 +904,7 @@ Double_t DhCorrelationFitter::CalculateBaseline(TH1F*& histo, Bool_t totalRange) return baseline; } -Double_t DhCorrelationFitter::CalculateBaselineError(TH1F*& histo, Bool_t totalRange) +Double_t DhCorrelationFitter::calculateBaselineError(TH1F*& histo, Bool_t totalRange) { // total range = 2*Pi @@ -954,7 +954,7 @@ Double_t DhCorrelationFitter::CalculateBaselineError(TH1F*& histo, Bool_t totalR return errBaseline; } -void DhCorrelationFitter::SetSingleTermsForDrawing(Bool_t draw) +void DhCorrelationFitter::setSingleTermsForDrawing(Bool_t draw) { Double_t* par = 0; if (fTypeOfFitFunc == 1 || fTypeOfFitFunc == 2 || fTypeOfFitFunc == 5) { diff --git a/PWGHF/HFC/Macros/ExtractOutputCorrel.C b/PWGHF/HFC/Macros/ExtractOutputCorrel.C index e263a810ff1..21de7a234aa 100644 --- a/PWGHF/HFC/Macros/ExtractOutputCorrel.C +++ b/PWGHF/HFC/Macros/ExtractOutputCorrel.C @@ -17,14 +17,16 @@ /// \author Swapnesh Santosh Khade #include "DhCorrelationExtraction.h" -#include "Riostream.h" #include #include +#include #include #include +#include + #include #include #include @@ -51,13 +53,13 @@ void parseStringArray(const Value& jsonArray, std::vector& output) } } -void SetInputCorrelNames(DhCorrelationExtraction* plotter, TString pathFileSE, TString pathFileME, TString dirSE, TString dirME, TString histoNameCorrSignal, TString histoNameCorrSideba, TString histoNameCorrSidebaLeft, TString histoNameCorrSidebaRight); -void SetInputHistoInvMassNames(DhCorrelationExtraction* plotter, TString pathFileMass, std::vector inputMassNames); -void SetInputHistoFDSubtraction(DhCorrelationExtraction* plotter, TString pathFileFDTemplate, TString pathFileFDPromptFrac, TString histoNameFDTemplatePrompt, TString histoNameFDTemplateNonPrompt, TString histoNameRawFracPrompt); -void SetInputHistoSecPart(DhCorrelationExtraction* plotter, TString pathFileSecPart, TString dirSecPartName, TString histoNamePrimaryPart, TString histoNameAllPart); -void SetInputHistoBiasBtoD(DhCorrelationExtraction* plotter, TString pathfFilePromptMcRec, TString pathfFileNonPromptMcRec); +void setInputCorrelNames(DhCorrelationExtraction* plotter, TString pathFileSE, TString pathFileME, TString dirSE, TString dirME, TString histoNameCorrSignal, TString histoNameCorrSideba, TString histoNameCorrSidebaLeft, TString histoNameCorrSidebaRight); +void setInputHistoInvMassNames(DhCorrelationExtraction* plotter, TString pathFileMass, std::vector inputMassNames); +void setInputHistoFdSubtraction(DhCorrelationExtraction* plotter, TString pathFileFDTemplate, TString pathFileFDPromptFrac, TString histoNameFDTemplatePrompt, TString histoNameFDTemplateNonPrompt, TString histoNameRawFracPrompt); +void setInputHistoSecPart(DhCorrelationExtraction* plotter, TString pathFileSecPart, TString dirSecPartName, TString histoNamePrimaryPart, TString histoNameAllPart); +void setInputHistoBiasBtoD(DhCorrelationExtraction* plotter, TString pathfFilePromptMcRec, TString pathfFileNonPromptMcRec); -void ExtractOutputCorrel_Ds(const TString cfgFileName = "config_CorrAnalysis.json") +void extractOutputCorrelDs(const TString cfgFileName = "config_CorrAnalysis.json") { // gStyle -> SetOptStat(0); gStyle->SetPadLeftMargin(0.15); @@ -75,50 +77,50 @@ void ExtractOutputCorrel_Ds(const TString cfgFileName = "config_CorrAnalysis.jso config.ParseStream(is); fclose(configFile); - string CodeNameAnalysis = config["CodeName"].GetString(); - gSystem->Exec(Form("rm -rf Output_CorrelationExtraction_%s_Root/ Output_CorrelationExtraction_%s_png/", CodeNameAnalysis.data(), CodeNameAnalysis.data())); - gSystem->Exec(Form("mkdir Output_CorrelationExtraction_%s_Root/ Output_CorrelationExtraction_%s_png/", CodeNameAnalysis.data(), CodeNameAnalysis.data())); - - string pathFileSE = config["pathFileSE"].GetString(); - string pathFileME = config["pathFileME"].GetString(); - string pathFileMass = config["pathFileMass"].GetString(); - string pathFileFDTemplate = config["pathFileFDTemplate"].GetString(); - string pathFileFDPromptFrac = config["pathFileFDPromptFrac"].GetString(); - string pathFileSecPart = config["pathFileSecPart"].GetString(); - string pathfFilePromptMcRec = config["pathfFilePromptMcRec"].GetString(); - string pathfFileNonPromptMcRec = config["pathfFileNonPromptMcRec"].GetString(); - - string dirSE = config["InputDirSE"].GetString(); - string dirME = config["InputDirME"].GetString(); - string dirSecPart = config["InputDirSecPart"].GetString(); - string histoNameCorrSignal = config["InputHistoCorrSignalName"].GetString(); - string histoNameCorrSideba = config["InputHistoCorrSidebaName"].GetString(); - string histoNameCorrSidebaLeft = config["InputHistoCorrSidebaLeftName"].GetString(); - string histoNameCorrSidebaRight = config["InputHistoCorrSidebaRightName"].GetString(); - string histoNameFDTemplatePrompt = config["InputHistoFDTemplatePrompt"].GetString(); - string histoNameFDTemplateNonPrompt = config["InputHistoFDTemplateNonPrompt"].GetString(); - string histoNameRawFracPrompt = config["InputHistoFDPromptFrac"].GetString(); - string histoNamePrimaryPart = config["InputHistoPrimaryPart"].GetString(); - string histoNameAllPart = config["InputHistoAllPart"].GetString(); - - std::vector InputHistoMassName; + std::string codeNameAnalysis = config["CodeName"].GetString(); + gSystem->Exec(Form("rm -rf Output_CorrelationExtraction_%s_Root/ Output_CorrelationExtraction_%s_png/", codeNameAnalysis.data(), codeNameAnalysis.data())); + gSystem->Exec(Form("mkdir Output_CorrelationExtraction_%s_Root/ Output_CorrelationExtraction_%s_png/", codeNameAnalysis.data(), codeNameAnalysis.data())); + + std::string pathFileSE = config["pathFileSE"].GetString(); + std::string pathFileME = config["pathFileME"].GetString(); + std::string pathFileMass = config["pathFileMass"].GetString(); + std::string pathFileFDTemplate = config["pathFileFDTemplate"].GetString(); + std::string pathFileFDPromptFrac = config["pathFileFDPromptFrac"].GetString(); + std::string pathFileSecPart = config["pathFileSecPart"].GetString(); + std::string pathfFilePromptMcRec = config["pathfFilePromptMcRec"].GetString(); + std::string pathfFileNonPromptMcRec = config["pathfFileNonPromptMcRec"].GetString(); + + std::string dirSE = config["InputDirSE"].GetString(); + std::string dirME = config["InputDirME"].GetString(); + std::string dirSecPart = config["InputDirSecPart"].GetString(); + std::string histoNameCorrSignal = config["InputHistoCorrSignalName"].GetString(); + std::string histoNameCorrSideba = config["InputHistoCorrSidebaName"].GetString(); + std::string histoNameCorrSidebaLeft = config["InputHistoCorrSidebaLeftName"].GetString(); + std::string histoNameCorrSidebaRight = config["InputHistoCorrSidebaRightName"].GetString(); + std::string histoNameFDTemplatePrompt = config["InputHistoFDTemplatePrompt"].GetString(); + std::string histoNameFDTemplateNonPrompt = config["InputHistoFDTemplateNonPrompt"].GetString(); + std::string histoNameRawFracPrompt = config["InputHistoFDPromptFrac"].GetString(); + std::string histoNamePrimaryPart = config["InputHistoPrimaryPart"].GetString(); + std::string histoNameAllPart = config["InputHistoAllPart"].GetString(); + + std::vector inputHistoMassName; const Value& inputMassNames = config["InputHistoMassName"]; - parseStringArray(inputMassNames, InputHistoMassName); + parseStringArray(inputMassNames, inputHistoMassName); - std::cout << InputHistoMassName[0].data() << std::endl; - std::cout << InputHistoMassName[1].data() << std::endl; - std::cout << InputHistoMassName[2].data() << std::endl; + std::cout << inputHistoMassName[0].data() << std::endl; + std::cout << inputHistoMassName[1].data() << std::endl; + std::cout << inputHistoMassName[2].data() << std::endl; std::vector binsPtCandIntervals; std::vector binsPtHadIntervals; std::vector deltaEtaInterval; - const Value& PtCandValue = config["binsPtCandIntervals"]; - readArray(PtCandValue, binsPtCandIntervals); + const Value& ptCandValue = config["binsPtCandIntervals"]; + readArray(ptCandValue, binsPtCandIntervals); - const Value& PtHadValue = config["binsPtHadIntervals"]; - readArray(PtHadValue, binsPtHadIntervals); + const Value& ptHadValue = config["binsPtHadIntervals"]; + readArray(ptHadValue, binsPtHadIntervals); const Value& deltaEtaValue = config["deltaEtaInterval"]; readArray(deltaEtaValue, deltaEtaInterval); @@ -159,70 +161,70 @@ void ExtractOutputCorrel_Ds(const TString cfgFileName = "config_CorrAnalysis.jso const int nBinsPtHad = binsPtHadIntervals.size() - 1; TH1D* hCorrectedCorrel[nBinsPtCand][nBinsPtHad]; - TH1D* hCorrectedCorrel_BaselineSubtr[nBinsPtCand][nBinsPtHad]; - TH1D* hCorrectedCorrel_Reflected[nBinsPtCand][nBinsPtHad]; - TH1D* hCorrectedCorrel_Reflected_BaselineSubtr[nBinsPtCand][nBinsPtHad]; + TH1D* hCorrectedCorrelBaselineSubtr[nBinsPtCand][nBinsPtHad]; + TH1D* hCorrectedCorrelReflected[nBinsPtCand][nBinsPtHad]; + TH1D* hCorrectedCorrelReflectedBaselineSubtr[nBinsPtCand][nBinsPtHad]; // Create and set the correlation plotter class DhCorrelationExtraction* plotter = new DhCorrelationExtraction(); - Bool_t flagSpecie = plotter->SetDmesonSpecie(static_cast(specie)); - plotter->SetNpools(npools); - plotter->SetCorrectPoolsSeparately(poolByPool); // kTRUE = pool.by-pool extraction and correction; kFALSE = merged ME pools - plotter->SetFDSubtraction(applyFDCorr); - plotter->SetSecPartContamination(applySecPartCorr); - plotter->SetDeltaEtaRange(deltaEtaMin, deltaEtaMax); - plotter->SetSubtractSoftPiInMEdistr(kFALSE); - plotter->SetRebinOptions(rebinAngCorr, rebinFDCorr, rebinSecPart); - plotter->SetRebin2DcorrelHisto(rebinDeltaEta, rebinDeltaPhi); // Xaxis: deltaEta, Yaxis: deltaPhi - plotter->SetCorrBiasBtoD(applyBiasBtoDCorr); - plotter->SetDebugLevel(1); + Bool_t flagSpecie = plotter->setDmesonSpecie(static_cast(specie)); + plotter->setNpools(npools); + plotter->setCorrectPoolsSeparately(poolByPool); // kTRUE = pool.by-pool extraction and correction; kFALSE = merged ME pools + plotter->setFdSubtraction(applyFDCorr); + plotter->setSecPartContamination(applySecPartCorr); + plotter->setDeltaEtaRange(deltaEtaMin, deltaEtaMax); + plotter->setSubtractSoftPiInMEdistr(kFALSE); + plotter->setRebinOptions(rebinAngCorr, rebinFDCorr, rebinSecPart); + plotter->setRebin2DcorrelHisto(rebinDeltaEta, rebinDeltaPhi); // Xaxis: deltaEta, Yaxis: deltaPhi + plotter->setCorrBiasBtoD(applyBiasBtoDCorr); + plotter->setDebugLevel(1); if (!flagSpecie) std::cout << "[ERROR] Wrong D meson flag" << std::endl; // Set the input file config - SetInputCorrelNames(plotter, pathFileSE, pathFileME, dirSE, dirME, histoNameCorrSignal, histoNameCorrSideba, histoNameCorrSidebaLeft, histoNameCorrSidebaRight); - SetInputHistoInvMassNames(plotter, pathFileMass, InputHistoMassName); + setInputCorrelNames(plotter, pathFileSE, pathFileME, dirSE, dirME, histoNameCorrSignal, histoNameCorrSideba, histoNameCorrSidebaLeft, histoNameCorrSidebaRight); + setInputHistoInvMassNames(plotter, pathFileMass, inputHistoMassName); if (applyFDCorr) - SetInputHistoFDSubtraction(plotter, pathFileFDTemplate, pathFileFDPromptFrac, histoNameFDTemplatePrompt, histoNameFDTemplateNonPrompt, histoNameRawFracPrompt); + setInputHistoFdSubtraction(plotter, pathFileFDTemplate, pathFileFDPromptFrac, histoNameFDTemplatePrompt, histoNameFDTemplateNonPrompt, histoNameRawFracPrompt); if (applySecPartCorr) - SetInputHistoSecPart(plotter, pathFileSecPart, dirSecPart, histoNamePrimaryPart, histoNameAllPart); + setInputHistoSecPart(plotter, pathFileSecPart, dirSecPart, histoNamePrimaryPart, histoNameAllPart); if (applyBiasBtoDCorr) - SetInputHistoBiasBtoD(plotter, pathfFilePromptMcRec, pathfFileNonPromptMcRec); - Bool_t readSEandME = plotter->ReadInputSEandME(); + setInputHistoBiasBtoD(plotter, pathfFilePromptMcRec, pathfFileNonPromptMcRec); + Bool_t readSEandME = plotter->readInputSeAndMe(); if (readSEandME) std::cout << "Files SE and ME read correctly" << std::endl; - Bool_t readInvMass = plotter->ReadInputInvMass(); + Bool_t readInvMass = plotter->readInputInvMass(); if (readInvMass) std::cout << "Files inv. mass read correctly" << std::endl; if (applyFDCorr) { - Bool_t readFDSubtr = plotter->ReadInputFDSubtr(); + Bool_t readFDSubtr = plotter->readInputFdSubtr(); if (readFDSubtr) std::cout << "Files for FD subtr. read correctly" << std::endl; } if (applySecPartCorr) { - Bool_t readSecPart = plotter->ReadInputSecondaryPartContamination(); + Bool_t readSecPart = plotter->readInputSecondaryPartContamination(); if (readSecPart) std::cout << "Files for secondary part. contamination read correctly" << std::endl; } // Loop over candidate pt and assoc. particle pt for (int iBinPtCand = 0; iBinPtCand < nBinsPtCand; iBinPtCand++) { - plotter->SetDividedSidebands(isDividedSideb, useSidebLeft, useSidebRight); - plotter->GetSignalAndBackgroundForNorm(binsPtCandIntervals[iBinPtCand], binsPtCandIntervals[iBinPtCand + 1]); + plotter->setDividedSidebands(isDividedSideb, useSidebLeft, useSidebRight); + plotter->getSignalAndBackgroundForNorm(binsPtCandIntervals[iBinPtCand], binsPtCandIntervals[iBinPtCand + 1]); for (int iBinPtHad = 0; iBinPtHad < nBinsPtHad; iBinPtHad++) { - plotter->SetBinCandAndHad(iBinPtCand + 1, iBinPtHad + 1); - plotter->ExtractCorrelations(binsPtCandIntervals[iBinPtCand], binsPtCandIntervals[iBinPtCand + 1], binsPtHadIntervals[iBinPtHad], binsPtHadIntervals[iBinPtHad + 1], CodeNameAnalysis); - hCorrectedCorrel[iBinPtCand][iBinPtHad] = (TH1D*)plotter->GetCorrectedCorrHisto(); - hCorrectedCorrel_BaselineSubtr[iBinPtCand][iBinPtHad] = (TH1D*)plotter->GetCorrectedCorrHisto_BaselineSubtr(); - hCorrectedCorrel_Reflected[iBinPtCand][iBinPtHad] = (TH1D*)plotter->GetCorrectedCorrHisto_Reflected(); - hCorrectedCorrel_Reflected_BaselineSubtr[iBinPtCand][iBinPtHad] = (TH1D*)plotter->GetCorrectedCorrHisto_Reflected_BaselineSubtr(); + plotter->setBinCandAndHad(iBinPtCand + 1, iBinPtHad + 1); + plotter->extractCorrelations(binsPtCandIntervals[iBinPtCand], binsPtCandIntervals[iBinPtCand + 1], binsPtHadIntervals[iBinPtHad], binsPtHadIntervals[iBinPtHad + 1], codeNameAnalysis); + hCorrectedCorrel[iBinPtCand][iBinPtHad] = (TH1D*)plotter->getCorrectedCorrHisto(); + hCorrectedCorrelBaselineSubtr[iBinPtCand][iBinPtHad] = (TH1D*)plotter->getCorrectedCorrHistoBaselineSubtr(); + hCorrectedCorrelReflected[iBinPtCand][iBinPtHad] = (TH1D*)plotter->getCorrectedCorrHistoReflected(); + hCorrectedCorrelReflectedBaselineSubtr[iBinPtCand][iBinPtHad] = (TH1D*)plotter->getCorrectedCorrHistoReflectedBaselineSubtr(); } } // output file - TFile* outFile = new TFile(Form("Output_CorrelationExtraction_%s_Root/ExtractCorrelationsResults.root", CodeNameAnalysis.data()), "RECREATE"); + TFile* outFile = new TFile(Form("Output_CorrelationExtraction_%s_Root/ExtractCorrelationsResults.root", codeNameAnalysis.data()), "RECREATE"); outFile->cd(); for (int iBinPtCand = 0; iBinPtCand < nBinsPtCand; iBinPtCand++) { for (int iBinPtHad = 0; iBinPtHad < nBinsPtHad; iBinPtHad++) { @@ -232,95 +234,95 @@ void ExtractOutputCorrel_Ds(const TString cfgFileName = "config_CorrAnalysis.jso outFile->Close(); // output file baseline subtr. - TFile* outFile_BaselineSubtr = new TFile(Form("Output_CorrelationExtraction_%s_Root/ExtractCorrelationsResults_BaselineSubtr.root", CodeNameAnalysis.data()), "RECREATE"); - outFile_BaselineSubtr->cd(); + TFile* outFileBaselineSubtr = new TFile(Form("Output_CorrelationExtraction_%s_Root/ExtractCorrelationsResults_BaselineSubtr.root", codeNameAnalysis.data()), "RECREATE"); + outFileBaselineSubtr->cd(); for (int iBinPtCand = 0; iBinPtCand < nBinsPtCand; iBinPtCand++) { for (int iBinPtHad = 0; iBinPtHad < nBinsPtHad; iBinPtHad++) { - hCorrectedCorrel_BaselineSubtr[iBinPtCand][iBinPtHad]->Write(); + hCorrectedCorrelBaselineSubtr[iBinPtCand][iBinPtHad]->Write(); } } - outFile_BaselineSubtr->Close(); + outFileBaselineSubtr->Close(); // output file reflected - TFile* outFile_Reflected = new TFile(Form("Output_CorrelationExtraction_%s_Root/ExtractCorrelationsResults_Reflected.root", CodeNameAnalysis.data()), "RECREATE"); - outFile_Reflected->cd(); + TFile* outFileReflected = new TFile(Form("Output_CorrelationExtraction_%s_Root/ExtractCorrelationsResults_Reflected.root", codeNameAnalysis.data()), "RECREATE"); + outFileReflected->cd(); for (int iBinPtCand = 0; iBinPtCand < nBinsPtCand; iBinPtCand++) { for (int iBinPtHad = 0; iBinPtHad < nBinsPtHad; iBinPtHad++) { - hCorrectedCorrel_Reflected[iBinPtCand][iBinPtHad]->Write(); + hCorrectedCorrelReflected[iBinPtCand][iBinPtHad]->Write(); } } - outFile_Reflected->Close(); + outFileReflected->Close(); // output file reflected baseline subtr. - TFile* outFile_Reflected_BaselineSubtr = new TFile(Form("Output_CorrelationExtraction_%s_Root/ExtractCorrelationsResults_Reflected_BaselineSubtr.root", CodeNameAnalysis.data()), "RECREATE"); - outFile_Reflected_BaselineSubtr->cd(); + TFile* outFileReflectedBaselineSubtr = new TFile(Form("Output_CorrelationExtraction_%s_Root/ExtractCorrelationsResults_Reflected_BaselineSubtr.root", codeNameAnalysis.data()), "RECREATE"); + outFileReflectedBaselineSubtr->cd(); for (int iBinPtCand = 0; iBinPtCand < nBinsPtCand; iBinPtCand++) { for (int iBinPtHad = 0; iBinPtHad < nBinsPtHad; iBinPtHad++) { - hCorrectedCorrel_Reflected_BaselineSubtr[iBinPtCand][iBinPtHad]->Write(); + hCorrectedCorrelReflectedBaselineSubtr[iBinPtCand][iBinPtHad]->Write(); } } - outFile_Reflected_BaselineSubtr->Close(); + outFileReflectedBaselineSubtr->Close(); return; } -void SetInputCorrelNames(DhCorrelationExtraction* plotter, TString pathFileSE, TString pathFileME, TString dirSE, TString dirME, TString histoNameCorrSignal, TString histoNameCorrSideba, TString histoNameCorrSidebaLeft, TString histoNameCorrSidebaRight) +void setInputCorrelNames(DhCorrelationExtraction* plotter, TString pathFileSE, TString pathFileME, TString dirSE, TString dirME, TString histoNameCorrSignal, TString histoNameCorrSideba, TString histoNameCorrSidebaLeft, TString histoNameCorrSidebaRight) { // Ds paths - plotter->SetInputFilenameSE(pathFileSE.Data()); - plotter->SetInputFilenameME(pathFileME.Data()); - plotter->SetDirNameSE(dirSE.Data()); - plotter->SetDirNameME(dirME.Data()); - plotter->SetSECorrelHistoSignalName(histoNameCorrSignal.Data()); - plotter->SetSECorrelHistoSidebandName(histoNameCorrSideba.Data()); - plotter->SetMECorrelHistoSignalName(histoNameCorrSignal.Data()); - plotter->SetMECorrelHistoSidebandName(histoNameCorrSideba.Data()); - plotter->SetSECorrelHistoSidebandLeftName(histoNameCorrSidebaLeft.Data()); - plotter->SetMECorrelHistoSidebandLeftName(histoNameCorrSidebaLeft.Data()); - plotter->SetSECorrelHistoSidebandRightName(histoNameCorrSidebaRight.Data()); - plotter->SetMECorrelHistoSidebandRightName(histoNameCorrSidebaRight.Data()); + plotter->setInputFilenameSe(pathFileSE.Data()); + plotter->setInputFilenameMe(pathFileME.Data()); + plotter->setDirNameSe(dirSE.Data()); + plotter->setDirNameMe(dirME.Data()); + plotter->setSeCorrelHistoSignalName(histoNameCorrSignal.Data()); + plotter->setSeCorrelHistoSidebandName(histoNameCorrSideba.Data()); + plotter->setMeCorrelHistoSignalName(histoNameCorrSignal.Data()); + plotter->setMeCorrelHistoSidebandName(histoNameCorrSideba.Data()); + plotter->setSeCorrelHistoSidebandLeftName(histoNameCorrSidebaLeft.Data()); + plotter->setMeCorrelHistoSidebandLeftName(histoNameCorrSidebaLeft.Data()); + plotter->setSeCorrelHistoSidebandRightName(histoNameCorrSidebaRight.Data()); + plotter->setMeCorrelHistoSidebandRightName(histoNameCorrSidebaRight.Data()); return; } -void SetInputHistoInvMassNames(DhCorrelationExtraction* plotter, TString pathFileMass, std::vector inputMassNames) +void setInputHistoInvMassNames(DhCorrelationExtraction* plotter, TString pathFileMass, std::vector inputMassNames) { // to use if sgn and bkg extraction is done apart - plotter->SetInputFilenameMass(pathFileMass.Data()); - plotter->SetMassHistoNameSgn(inputMassNames[0].data()); - plotter->SetMassHistoNameBkg(inputMassNames[1].data()); - plotter->SetMassHistoNameSBs(inputMassNames[2].data()); + plotter->setInputFilenameMass(pathFileMass.Data()); + plotter->setMassHistoNameSgn(inputMassNames[0].data()); + plotter->setMassHistoNameBkg(inputMassNames[1].data()); + plotter->setMassHistoNameSBs(inputMassNames[2].data()); return; } -void SetInputHistoFDSubtraction(DhCorrelationExtraction* plotter, TString pathFileFDTemplate, TString pathFileFDPromptFrac, TString histoNameFDTemplatePrompt, TString histoNameFDTemplateNonPrompt, TString histoNameRawFracPrompt) +void setInputHistoFdSubtraction(DhCorrelationExtraction* plotter, TString pathFileFDTemplate, TString pathFileFDPromptFrac, TString histoNameFDTemplatePrompt, TString histoNameFDTemplateNonPrompt, TString histoNameRawFracPrompt) { - plotter->SetInputFilenameFDTemplate(pathFileFDTemplate.Data()); - plotter->SetInputFilenameFDPromptFrac(pathFileFDPromptFrac.Data()); - plotter->SetInputHistoNameFDTemplatePrompt(histoNameFDTemplatePrompt.Data()); - plotter->SetInputHistoNameFDTemplateNonPrompt(histoNameFDTemplateNonPrompt.Data()); - plotter->SetInputHistoNameFDPromptFrac(histoNameRawFracPrompt.Data()); + plotter->setInputFilenameFdTemplate(pathFileFDTemplate.Data()); + plotter->setInputFilenameFdPromptFrac(pathFileFDPromptFrac.Data()); + plotter->setInputHistoNameFdTemplatePrompt(histoNameFDTemplatePrompt.Data()); + plotter->setInputHistoNameFdTemplateNonPrompt(histoNameFDTemplateNonPrompt.Data()); + plotter->setInputHistoNameFdPromptFrac(histoNameRawFracPrompt.Data()); return; } -void SetInputHistoSecPart(DhCorrelationExtraction* plotter, TString pathFileSecPart, TString dirSecPartName, TString histoNamePrimaryPart, TString histoNameAllPart) +void setInputHistoSecPart(DhCorrelationExtraction* plotter, TString pathFileSecPart, TString dirSecPartName, TString histoNamePrimaryPart, TString histoNameAllPart) { - plotter->SetInputFilenameSecPart(pathFileSecPart.Data()); - plotter->SetDirNameSecPart(dirSecPartName.Data()); - plotter->SetHistoSecPartName(histoNamePrimaryPart.Data(), histoNameAllPart.Data()); + plotter->setInputFilenameSecPart(pathFileSecPart.Data()); + plotter->setDirNameSecPart(dirSecPartName.Data()); + plotter->setHistoSecPartName(histoNamePrimaryPart.Data(), histoNameAllPart.Data()); return; } -void SetInputHistoBiasBtoD(DhCorrelationExtraction* plotter, TString pathfFilePromptMcRec, TString pathfFileNonPromptMcRec) +void setInputHistoBiasBtoD(DhCorrelationExtraction* plotter, TString pathfFilePromptMcRec, TString pathfFileNonPromptMcRec) { - plotter->SetInputFilenameBiasBtoD(pathfFilePromptMcRec.Data(), pathfFileNonPromptMcRec.Data()); + plotter->setInputFilenameBiasBtoD(pathfFilePromptMcRec.Data(), pathfFileNonPromptMcRec.Data()); return; } diff --git a/PWGHF/HFC/Macros/FitCorrel.C b/PWGHF/HFC/Macros/FitCorrel.C index 7c1d64ea823..30166304f58 100644 --- a/PWGHF/HFC/Macros/FitCorrel.C +++ b/PWGHF/HFC/Macros/FitCorrel.C @@ -15,9 +15,10 @@ /// \author Swapnesh Santosh Khade #include "DhCorrelationFitter.h" -#include "Riostream.h" +#include #include +#include #include #include #include @@ -28,6 +29,8 @@ #include #include +#include + #include #include #include @@ -47,18 +50,18 @@ void readArray(const Value& jsonArray, vector& output) } } -void SetTH1HistoStyle(TH1D*& histo, TString hTitle, TString hXaxisTitle, TString hYaxisTitle, +void setTH1HistoStyle(TH1D*& histo, TString hTitle, TString hXaxisTitle, TString hYaxisTitle, Style_t markerStyle, Color_t markerColor, Double_t markerSize, Color_t lineColor, Int_t lineWidth, Float_t hTitleXaxisOffset = 1.3, Float_t hTitleYaxisOffset = 1.3, Float_t hTitleXaxisSize = 0.045, Float_t hTitleYaxisSize = 0.045, Float_t hLabelXaxisSize = 0.045, Float_t hLabelYaxisSize = 0.045, Bool_t centerXaxisTitle = false, Bool_t centerYaxisTitle = false); -void SetTH1HistoStyle(TH1F*& histo, TString hTitle, TString hXaxisTitle, TString hYaxisTitle, +void setTH1HistoStyle(TH1F*& histo, TString hTitle, TString hXaxisTitle, TString hYaxisTitle, Style_t markerStyle, Color_t markerColor, Double_t markerSize, Color_t lineColor, Int_t lineWidth, Float_t hTitleXaxisOffset = 1.3, Float_t hTitleYaxisOffset = 1.3, Float_t hTitleXaxisSize = 0.045, Float_t hTitleYaxisSize = 0.045, Float_t hLabelXaxisSize = 0.045, Float_t hLabelYaxisSize = 0.045, Bool_t centerXaxisTitle = false, Bool_t centerYaxisTitle = false); -void FitCorrel_Ds(const TString cfgFileName = "config_CorrAnalysis.json") +void fitCorrelDs(const TString cfgFileName = "config_CorrAnalysis.json") { gStyle->SetOptStat(0); gStyle->SetPadLeftMargin(0.2); @@ -77,12 +80,12 @@ void FitCorrel_Ds(const TString cfgFileName = "config_CorrAnalysis.json") config.ParseStream(is); fclose(configFile); - string CodeNameAnalysis = config["CodeName"].GetString(); - gSystem->Exec(Form("rm -rf Output_CorrelationFitting_%s_Root/ Output_CorrelationFitting_%s_png/", CodeNameAnalysis.data(), CodeNameAnalysis.data())); - gSystem->Exec(Form("mkdir Output_CorrelationFitting_%s_Root/ Output_CorrelationFitting_%s_png/", CodeNameAnalysis.data(), CodeNameAnalysis.data())); + string codeNameAnalysis = config["CodeName"].GetString(); + gSystem->Exec(Form("rm -rf Output_CorrelationFitting_%s_Root/ Output_CorrelationFitting_%s_png/", codeNameAnalysis.data(), codeNameAnalysis.data())); + gSystem->Exec(Form("mkdir Output_CorrelationFitting_%s_Root/ Output_CorrelationFitting_%s_png/", codeNameAnalysis.data(), codeNameAnalysis.data())); string inputFileNameFit = config["InputFileNameFitCorr"].GetString(); - const TString inFileName = Form("Output_CorrelationExtraction_%s_Root/%s", CodeNameAnalysis.data(), inputFileNameFit.data()); + const TString inFileName = Form("Output_CorrelationExtraction_%s_Root/%s", codeNameAnalysis.data(), inputFileNameFit.data()); bool isReflected = config["IsRiflected"].GetBool(); bool drawSystematicErrors = config["DrawSystematics"].GetBool(); @@ -94,11 +97,11 @@ void FitCorrel_Ds(const TString cfgFileName = "config_CorrAnalysis.json") std::vector binsPtHadIntervals; std::vector fitFunc; - const Value& PtCandValue = config["binsPtCandIntervals"]; - readArray(PtCandValue, binsPtCandIntervalsVec); + const Value& ptCandValue = config["binsPtCandIntervals"]; + readArray(ptCandValue, binsPtCandIntervalsVec); - const Value& PtHadValue = config["binsPtHadIntervals"]; - readArray(PtHadValue, binsPtHadIntervals); + const Value& ptHadValue = config["binsPtHadIntervals"]; + readArray(ptHadValue, binsPtHadIntervals); const int nBinsPtCand = binsPtCandIntervalsVec.size() - 1; const int nBinsPtHad = binsPtHadIntervals.size() - 1; @@ -108,8 +111,8 @@ void FitCorrel_Ds(const TString cfgFileName = "config_CorrAnalysis.json") binsPtCandIntervals[i] = binsPtCandIntervalsVec[i]; } - const Value& FitFuncValue = config["FitFunction"]; - readArray(FitFuncValue, fitFunc); + const Value& fitFuncValue = config["FitFunction"]; + readArray(fitFuncValue, fitFunc); int fixBase = config["FixBaseline"].GetInt(); int fixMean = config["FixMean"].GetInt(); @@ -146,7 +149,7 @@ void FitCorrel_Ds(const TString cfgFileName = "config_CorrAnalysis.json") TFile* inFileFitSystematicErrors = new TFile("OutputSystematicUncertainties/SystematicUncertaintesFitPhysObsMerged.root"); // Canvas - TCanvas* CanvasCorrPhi[nBinsPtHad]; + TCanvas* canvasCorrPhi[nBinsPtHad]; // Histograms TH1D* hCorrPhi[nBinsPtCand][nBinsPtHad]; @@ -158,7 +161,7 @@ void FitCorrel_Ds(const TString cfgFileName = "config_CorrAnalysis.json") std::cout << "[ERROR]: nBinsPtD != nBinsPtCand" << std::endl; return; } - double SystUncCorrelatedDs[nBinsPtD] = {20, 20, 20, 10}; // % (just the MC Closure uncertainty to put in the plot) + double systUncCorrelatedDs[nBinsPtD] = {20, 20, 20, 10}; // % (just the MC Closure uncertainty to put in the plot) // DhCorrelationFitter const double fMin{-0.5 * TMath::Pi()}, fMax{1.5 * TMath::Pi()}; // limits for the fitting function @@ -193,27 +196,27 @@ void FitCorrel_Ds(const TString cfgFileName = "config_CorrAnalysis.json") } corrFitter[iBinPtHad][iBinPtCand] = new DhCorrelationFitter(reinterpret_cast(hCorrPhi[iBinPtCand][iBinPtHad]), fMin, fMax); - corrFitter[iBinPtHad][iBinPtCand]->SetHistoIsReflected(refl); - corrFitter[iBinPtHad][iBinPtCand]->SetFixBaseline(fixBase); - corrFitter[iBinPtHad][iBinPtCand]->SetBaselineUpOrDown(shiftBaseUp, shiftBaseDown); - corrFitter[iBinPtHad][iBinPtCand]->SetPointsForBaseline(nBaselinePoints, pointsForBaseline); - corrFitter[iBinPtHad][iBinPtCand]->Setv2(v2AssocPart[iBinPtCand], v2Dmeson[iBinPtCand]); - corrFitter[iBinPtHad][iBinPtCand]->SetReflectedCorrHisto(isReflected); - - corrFitter[iBinPtHad][iBinPtCand]->SetFixMean(fixMean); - corrFitter[iBinPtHad][iBinPtCand]->SetPtRanges(binsPtCandIntervals[iBinPtCand], binsPtCandIntervals[iBinPtCand + 1], binsPtHadIntervals[iBinPtHad], binsPtHadIntervals[iBinPtHad + 1]); - corrFitter[iBinPtHad][iBinPtCand]->SetExternalValsAndBounds(npars, vals, lowBounds, uppBounds); // these are starting points and limits... + corrFitter[iBinPtHad][iBinPtCand]->setHistoIsReflected(refl); + corrFitter[iBinPtHad][iBinPtCand]->setFixBaseline(fixBase); + corrFitter[iBinPtHad][iBinPtCand]->setBaselineUpOrDown(shiftBaseUp, shiftBaseDown); + corrFitter[iBinPtHad][iBinPtCand]->setPointsForBaseline(nBaselinePoints, pointsForBaseline); + corrFitter[iBinPtHad][iBinPtCand]->setv2(v2AssocPart[iBinPtCand], v2Dmeson[iBinPtCand]); + corrFitter[iBinPtHad][iBinPtCand]->setReflectedCorrHisto(isReflected); + + corrFitter[iBinPtHad][iBinPtCand]->setFixMean(fixMean); + corrFitter[iBinPtHad][iBinPtCand]->setPtRanges(binsPtCandIntervals[iBinPtCand], binsPtCandIntervals[iBinPtCand + 1], binsPtHadIntervals[iBinPtHad], binsPtHadIntervals[iBinPtHad + 1]); + corrFitter[iBinPtHad][iBinPtCand]->setExternalValsAndBounds(npars, vals, lowBounds, uppBounds); // these are starting points and limits... } } // Plots and fit for (int iBinPtHad = 0; iBinPtHad < nBinsPtHad; iBinPtHad++) { - CanvasCorrPhi[iBinPtHad] = new TCanvas(Form("CanvasCorrPhi_PtBinAssoc%d", iBinPtHad + 1), Form("CorrPhiDs_PtBinAssoc%d", iBinPtHad + 1)); + canvasCorrPhi[iBinPtHad] = new TCanvas(Form("CanvasCorrPhi_PtBinAssoc%d", iBinPtHad + 1), Form("CorrPhiDs_PtBinAssoc%d", iBinPtHad + 1)); if (nBinsPtCand <= 4) { - CanvasCorrPhi[iBinPtHad]->Divide(2, 2); + canvasCorrPhi[iBinPtHad]->Divide(2, 2); } if (nBinsPtCand > 4 && nBinsPtCand <= 6) { - CanvasCorrPhi[iBinPtHad]->Divide(3, 2); + canvasCorrPhi[iBinPtHad]->Divide(3, 2); } // histograms with fir parameters hBaselin[iBinPtHad] = new TH1D(Form("hBaselin_PtBinAssoc%d", iBinPtHad + 1), "", nBinsPtCand, binsPtCandIntervals); @@ -226,11 +229,11 @@ void FitCorrel_Ds(const TString cfgFileName = "config_CorrAnalysis.json") hASYieldBinCount[iBinPtHad] = new TH1D(Form("hASYieldBinCount_PtBinAssoc%d", iBinPtHad + 1), "", nBinsPtCand, binsPtCandIntervals); for (int iBinPtCand = 0; iBinPtCand < nBinsPtCand; iBinPtCand++) { - SetTH1HistoStyle(hCorrPhi[iBinPtCand][iBinPtHad], "", "#Delta#phi [rad]", "#frac{1}{N_{D_{s}}}#frac{dN^{assoc}}{d#Delta#phi} [rad^{-1}]", kFullCircle, kRed + 1, 1.4, kRed + 1, 3); + setTH1HistoStyle(hCorrPhi[iBinPtCand][iBinPtHad], "", "#Delta#phi [rad]", "#frac{1}{N_{D_{s}}}#frac{dN^{assoc}}{d#Delta#phi} [rad^{-1}]", kFullCircle, kRed + 1, 1.4, kRed + 1, 3); - CanvasCorrPhi[iBinPtHad]->cd(iBinPtCand + 1); - CanvasCorrPhi[iBinPtHad]->SetTickx(); - CanvasCorrPhi[iBinPtHad]->SetTicky(); + canvasCorrPhi[iBinPtHad]->cd(iBinPtCand + 1); + canvasCorrPhi[iBinPtHad]->SetTickx(); + canvasCorrPhi[iBinPtHad]->SetTicky(); hCorrPhi[iBinPtCand][iBinPtHad]->SetStats(0); hCorrPhi[iBinPtCand][iBinPtHad]->SetMinimum(0); // hCorrPhi[iBinPtCand][iBinPtHad] -> Draw(); @@ -248,7 +251,7 @@ void FitCorrel_Ds(const TString cfgFileName = "config_CorrAnalysis.json") } hSystematicErrorsPlot[iBinPtCand][iBinPtHad]->SetBinContent(iPhi + 1, hCorrPhi[iBinPtCand][iBinPtHad]->GetBinContent(iPhi + 1)); } - SetTH1HistoStyle(hSystematicErrorsPlot[iBinPtCand][iBinPtHad], "", "#Delta#phi [rad]", "#frac{1}{N_{D_{s}}}#frac{dN^{assoc}}{d#Delta#phi} [rad^{-1}]", kFullCircle, kRed + 1, 1.4, kRed + 1, 2); + setTH1HistoStyle(hSystematicErrorsPlot[iBinPtCand][iBinPtHad], "", "#Delta#phi [rad]", "#frac{1}{N_{D_{s}}}#frac{dN^{assoc}}{d#Delta#phi} [rad^{-1}]", kFullCircle, kRed + 1, 1.4, kRed + 1, 2); hSystematicErrorsPlot[iBinPtCand][iBinPtHad]->SetLineColor(kRed - 4); hSystematicErrorsPlot[iBinPtCand][iBinPtHad]->SetFillStyle(0); // hSystematicErrorsPlot[iBinPtCand][iBinPtHad] -> Draw("E2same"); @@ -256,10 +259,10 @@ void FitCorrel_Ds(const TString cfgFileName = "config_CorrAnalysis.json") // hCorrPhi[iBinPtCand][iBinPtHad] -> Draw("same"); // Fit - corrFitter[iBinPtHad][iBinPtCand]->SetFuncType(static_cast(fitFunc[iBinPtCand])); - corrFitter[iBinPtHad][iBinPtCand]->Fitting(kTRUE, kTRUE); // the first term is for drawing the fit functions, the second argument is useExternalParams + corrFitter[iBinPtHad][iBinPtCand]->setFuncType(static_cast(fitFunc[iBinPtCand])); + corrFitter[iBinPtHad][iBinPtCand]->fitting(kTRUE, kTRUE); // the first term is for drawing the fit functions, the second argument is useExternalParams - TF1* fFit = corrFitter[iBinPtHad][iBinPtCand]->GetFitFunction(); + TF1* fFit = corrFitter[iBinPtHad][iBinPtCand]->getFitFunction(); // Title of the histogram TPaveText* pttext = new TPaveText(0.15, 0.9, 0.85, 0.95, "NDC"); @@ -269,8 +272,8 @@ void FitCorrel_Ds(const TString cfgFileName = "config_CorrAnalysis.json") // pttext -> Draw("same"); // Fill the histograms with the fit parameters - hBaselin[iBinPtHad]->SetBinContent(iBinPtCand + 1, corrFitter[iBinPtHad][iBinPtCand]->GetPedestal()); - hBaselin[iBinPtHad]->SetBinError(iBinPtCand + 1, corrFitter[iBinPtHad][iBinPtCand]->GetPedestalError()); + hBaselin[iBinPtHad]->SetBinContent(iBinPtCand + 1, corrFitter[iBinPtHad][iBinPtCand]->getPedestal()); + hBaselin[iBinPtHad]->SetBinError(iBinPtCand + 1, corrFitter[iBinPtHad][iBinPtCand]->getPedestalError()); if (iBinPtCand == 0 && removeNSPeakLowPt) { hNSYield[iBinPtHad]->SetBinContent(iBinPtCand + 1, -1); hNSYield[iBinPtHad]->SetBinError(iBinPtCand + 1, 0); @@ -281,37 +284,37 @@ void FitCorrel_Ds(const TString cfgFileName = "config_CorrAnalysis.json") hBeta[iBinPtHad]->SetBinContent(iBinPtCand + 1, -1); hBeta[iBinPtHad]->SetBinError(iBinPtCand + 1, 0); } else { - hNSYield[iBinPtHad]->SetBinContent(iBinPtCand + 1, corrFitter[iBinPtHad][iBinPtCand]->GetNSYield()); - hNSYield[iBinPtHad]->SetBinError(iBinPtCand + 1, corrFitter[iBinPtHad][iBinPtCand]->GetNSYieldError()); + hNSYield[iBinPtHad]->SetBinContent(iBinPtCand + 1, corrFitter[iBinPtHad][iBinPtCand]->getNsYield()); + hNSYield[iBinPtHad]->SetBinError(iBinPtCand + 1, corrFitter[iBinPtHad][iBinPtCand]->getNsYieldError()); if (fitFunc[iBinPtCand] != 5 && fitFunc[iBinPtCand] != 6) { - hNSSigma[iBinPtHad]->SetBinContent(iBinPtCand + 1, corrFitter[iBinPtHad][iBinPtCand]->GetNSSigma()); - hNSSigma[iBinPtHad]->SetBinError(iBinPtCand + 1, corrFitter[iBinPtHad][iBinPtCand]->GetNSSigmaError()); + hNSSigma[iBinPtHad]->SetBinContent(iBinPtCand + 1, corrFitter[iBinPtHad][iBinPtCand]->getNsSigma()); + hNSSigma[iBinPtHad]->SetBinError(iBinPtCand + 1, corrFitter[iBinPtHad][iBinPtCand]->getNsSigmaError()); } else { - hNSSigma[iBinPtHad]->SetBinContent(iBinPtCand + 1, TMath::Sqrt(1. / corrFitter[iBinPtHad][iBinPtCand]->GetNSSigma())); - Double_t errrel = corrFitter[iBinPtHad][iBinPtCand]->GetNSSigmaError() / corrFitter[iBinPtHad][iBinPtCand]->GetNSSigma() / 2.; - hNSSigma[iBinPtHad]->SetBinError(iBinPtCand + 1, errrel * TMath::Sqrt(1. / corrFitter[iBinPtHad][iBinPtCand]->GetNSSigma())); + hNSSigma[iBinPtHad]->SetBinContent(iBinPtCand + 1, TMath::Sqrt(1. / corrFitter[iBinPtHad][iBinPtCand]->getNsSigma())); + Double_t errrel = corrFitter[iBinPtHad][iBinPtCand]->getNsSigmaError() / corrFitter[iBinPtHad][iBinPtCand]->getNsSigma() / 2.; + hNSSigma[iBinPtHad]->SetBinError(iBinPtCand + 1, errrel * TMath::Sqrt(1. / corrFitter[iBinPtHad][iBinPtCand]->getNsSigma())); } } - hNSYieldBinCount[iBinPtHad]->SetBinContent(iBinPtCand + 1, corrFitter[iBinPtHad][iBinPtCand]->GetBinCountingNSYield()); - hNSYieldBinCount[iBinPtHad]->SetBinError(iBinPtCand + 1, corrFitter[iBinPtHad][iBinPtCand]->GetBinCountingNSYieldErr()); + hNSYieldBinCount[iBinPtHad]->SetBinContent(iBinPtCand + 1, corrFitter[iBinPtHad][iBinPtCand]->getBinCountingNsYield()); + hNSYieldBinCount[iBinPtHad]->SetBinError(iBinPtCand + 1, corrFitter[iBinPtHad][iBinPtCand]->getBinCountingNsYieldErr()); - hASYield[iBinPtHad]->SetBinContent(iBinPtCand + 1, corrFitter[iBinPtHad][iBinPtCand]->GetASYield()); - hASYield[iBinPtHad]->SetBinError(iBinPtCand + 1, corrFitter[iBinPtHad][iBinPtCand]->GetASYieldError()); + hASYield[iBinPtHad]->SetBinContent(iBinPtCand + 1, corrFitter[iBinPtHad][iBinPtCand]->getAsYield()); + hASYield[iBinPtHad]->SetBinError(iBinPtCand + 1, corrFitter[iBinPtHad][iBinPtCand]->getAsYieldError()); - hASYieldBinCount[iBinPtHad]->SetBinContent(iBinPtCand + 1, corrFitter[iBinPtHad][iBinPtCand]->GetBinCountingASYield()); - hASYieldBinCount[iBinPtHad]->SetBinError(iBinPtCand + 1, corrFitter[iBinPtHad][iBinPtCand]->GetBinCountingASYieldErr()); + hASYieldBinCount[iBinPtHad]->SetBinContent(iBinPtCand + 1, corrFitter[iBinPtHad][iBinPtCand]->getBinCountingAsYield()); + hASYieldBinCount[iBinPtHad]->SetBinError(iBinPtCand + 1, corrFitter[iBinPtHad][iBinPtCand]->getBinCountingAsYieldErr()); if (fitFunc[iBinPtCand] != 5 && fitFunc[iBinPtCand] != 6) { - hASSigma[iBinPtHad]->SetBinContent(iBinPtCand + 1, corrFitter[iBinPtHad][iBinPtCand]->GetASSigma()); - hASSigma[iBinPtHad]->SetBinError(iBinPtCand + 1, corrFitter[iBinPtHad][iBinPtCand]->GetASSigmaError()); + hASSigma[iBinPtHad]->SetBinContent(iBinPtCand + 1, corrFitter[iBinPtHad][iBinPtCand]->getAsSigma()); + hASSigma[iBinPtHad]->SetBinError(iBinPtCand + 1, corrFitter[iBinPtHad][iBinPtCand]->getAsSigmaError()); } else { - hASSigma[iBinPtHad]->SetBinContent(iBinPtCand + 1, TMath::Sqrt(1. / corrFitter[iBinPtHad][iBinPtCand]->GetASSigma())); - Double_t errrel = corrFitter[iBinPtHad][iBinPtCand]->GetASSigmaError() / corrFitter[iBinPtHad][iBinPtCand]->GetASSigma() / 2.; - hASSigma[iBinPtHad]->SetBinError(iBinPtCand + 1, errrel * TMath::Sqrt(1. / corrFitter[iBinPtHad][iBinPtCand]->GetASSigma())); + hASSigma[iBinPtHad]->SetBinContent(iBinPtCand + 1, TMath::Sqrt(1. / corrFitter[iBinPtHad][iBinPtCand]->getAsSigma())); + Double_t errrel = corrFitter[iBinPtHad][iBinPtCand]->getAsSigmaError() / corrFitter[iBinPtHad][iBinPtCand]->getAsSigma() / 2.; + hASSigma[iBinPtHad]->SetBinError(iBinPtCand + 1, errrel * TMath::Sqrt(1. / corrFitter[iBinPtHad][iBinPtCand]->getAsSigma())); } if (fitFunc[iBinPtCand] == 4) { // param beta for gen. gauss - hBeta[iBinPtHad]->SetBinContent(iBinPtCand + 1, corrFitter[iBinPtHad][iBinPtCand]->GetBeta()); - hBeta[iBinPtHad]->SetBinError(iBinPtCand + 1, corrFitter[iBinPtHad][iBinPtCand]->GetBetaError()); + hBeta[iBinPtHad]->SetBinContent(iBinPtCand + 1, corrFitter[iBinPtHad][iBinPtCand]->getBeta()); + hBeta[iBinPtHad]->SetBinError(iBinPtCand + 1, corrFitter[iBinPtHad][iBinPtCand]->getBetaError()); } // Draw @@ -322,7 +325,7 @@ void FitCorrel_Ds(const TString cfgFileName = "config_CorrAnalysis.json") tCorrUncDs->SetTextFont(42); tCorrUncDs->SetTextAlign(13); tCorrUncDs->SetTextColor(kRed + 1); - tCorrUncDs->AddText(0., 0., Form("#splitline{+%.0f%%}{#minus%.0f%%}", SystUncCorrelatedDs[iBinPtCand], SystUncCorrelatedDs[iBinPtCand])); + tCorrUncDs->AddText(0., 0., Form("#splitline{+%.0f%%}{#minus%.0f%%}", systUncCorrelatedDs[iBinPtCand], systUncCorrelatedDs[iBinPtCand])); TPaveText* tScaleUnc = new TPaveText(0.501, 0.292, 0.968, 0.372, "NDC"); tScaleUnc->SetFillStyle(0); @@ -342,12 +345,12 @@ void FitCorrel_Ds(const TString cfgFileName = "config_CorrAnalysis.json") if (drawSystematicErrors) tScaleUnc->Draw("same"); } - CanvasCorrPhi[iBinPtHad]->SaveAs(Form("Output_CorrelationFitting_%s_png/CorrPhiDs_PtBinAssoc%d.png", CodeNameAnalysis.data(), iBinPtHad + 1)); - CanvasCorrPhi[iBinPtHad]->SaveAs(Form("Output_CorrelationFitting_%s_Root/CorrPhiDs_PtBinAssoc%d.root", CodeNameAnalysis.data(), iBinPtHad + 1)); + canvasCorrPhi[iBinPtHad]->SaveAs(Form("Output_CorrelationFitting_%s_png/CorrPhiDs_PtBinAssoc%d.png", codeNameAnalysis.data(), iBinPtHad + 1)); + canvasCorrPhi[iBinPtHad]->SaveAs(Form("Output_CorrelationFitting_%s_Root/CorrPhiDs_PtBinAssoc%d.root", codeNameAnalysis.data(), iBinPtHad + 1)); } // histogram with fit parameter and errors - TFile* outFile = new TFile(Form("Output_CorrelationFitting_%s_Root/CorrPhiDs_FinalPlots.root", CodeNameAnalysis.data()), "RECREATE"); + TFile* outFile = new TFile(Form("Output_CorrelationFitting_%s_Root/CorrPhiDs_FinalPlots.root", codeNameAnalysis.data()), "RECREATE"); outFile->cd(); for (int iBinPtHad = 0; iBinPtHad < nBinsPtHad; iBinPtHad++) { hBaselin[iBinPtHad]->Write(); @@ -368,11 +371,11 @@ void FitCorrel_Ds(const TString cfgFileName = "config_CorrAnalysis.json") TCanvas* c3 = new TCanvas(Form("NS_sigma_PtAssoc%d", iBinPtHad + 1), Form("AS_sigma_PtAssoc%d", iBinPtHad + 1)); TCanvas* c4 = new TCanvas(Form("AS_sigma_PtAssoc%d", iBinPtHad + 1), Form("AS_sigma_PtAssoc%d", iBinPtHad + 1)); TCanvas* c5 = new TCanvas(Form("Baseline_PtAssoc%d", iBinPtHad + 1), Form("Baseline_PtAssoc%d", iBinPtHad + 1)); - SetTH1HistoStyle(hBaselin[iBinPtHad], Form("p_{T}^{assoc} > %.1f GeV/c", binsPtHadIntervals[iBinPtHad]), "p_{T} (GeV/c)", "Baseline", kFullSquare, kBlue, 1.8, kBlue, 2); - SetTH1HistoStyle(hNSYield[iBinPtHad], Form("p_{T}^{assoc} > %.1f GeV/c", binsPtHadIntervals[iBinPtHad]), "p_{T} (GeV/c)", "Y^{NS}", kFullSquare, kRed, 1.8, kRed, 2); - SetTH1HistoStyle(hASYield[iBinPtHad], Form("p_{T}^{assoc} > %.1f GeV/c", binsPtHadIntervals[iBinPtHad]), "p_{T} (GeV/c)", "Y^{AS}", kFullSquare, kMagenta, 1.8, kMagenta, 2); - SetTH1HistoStyle(hNSSigma[iBinPtHad], Form("p_{T}^{assoc} > %.1f GeV/c", binsPtHadIntervals[iBinPtHad]), "p_{T} (GeV/c)", "#sigma_{NS}", kFullSquare, kOrange + 8, 1.8, kOrange + 8, 2); - SetTH1HistoStyle(hASSigma[iBinPtHad], Form("p_{T}^{assoc} > %.1f GeV/c", binsPtHadIntervals[iBinPtHad]), "p_{T} (GeV/c)", "#sigma_{AS}", kFullSquare, kViolet - 5, 1.8, kViolet - 5, 2); + setTH1HistoStyle(hBaselin[iBinPtHad], Form("p_{T}^{assoc} > %.1f GeV/c", binsPtHadIntervals[iBinPtHad]), "p_{T} (GeV/c)", "Baseline", kFullSquare, kBlue, 1.8, kBlue, 2); + setTH1HistoStyle(hNSYield[iBinPtHad], Form("p_{T}^{assoc} > %.1f GeV/c", binsPtHadIntervals[iBinPtHad]), "p_{T} (GeV/c)", "Y^{NS}", kFullSquare, kRed, 1.8, kRed, 2); + setTH1HistoStyle(hASYield[iBinPtHad], Form("p_{T}^{assoc} > %.1f GeV/c", binsPtHadIntervals[iBinPtHad]), "p_{T} (GeV/c)", "Y^{AS}", kFullSquare, kMagenta, 1.8, kMagenta, 2); + setTH1HistoStyle(hNSSigma[iBinPtHad], Form("p_{T}^{assoc} > %.1f GeV/c", binsPtHadIntervals[iBinPtHad]), "p_{T} (GeV/c)", "#sigma_{NS}", kFullSquare, kOrange + 8, 1.8, kOrange + 8, 2); + setTH1HistoStyle(hASSigma[iBinPtHad], Form("p_{T}^{assoc} > %.1f GeV/c", binsPtHadIntervals[iBinPtHad]), "p_{T} (GeV/c)", "#sigma_{AS}", kFullSquare, kViolet - 5, 1.8, kViolet - 5, 2); c1->cd(); hNSYield[iBinPtHad]->SetMinimum(0); hNSYield[iBinPtHad]->Draw(); @@ -417,51 +420,51 @@ void FitCorrel_Ds(const TString cfgFileName = "config_CorrAnalysis.json") } c1->cd(); - SetTH1HistoStyle(hNSYieldSyst, Form("p_{T}^{assoc} > %.1f GeV/c", binsPtHadIntervals[iBinPtHad]), "p_{T} (GeV/c)", "Y^{NS}", kFullSquare, kRed, 1.8, kRed, 2); + setTH1HistoStyle(hNSYieldSyst, Form("p_{T}^{assoc} > %.1f GeV/c", binsPtHadIntervals[iBinPtHad]), "p_{T} (GeV/c)", "Y^{NS}", kFullSquare, kRed, 1.8, kRed, 2); hNSYieldSyst->SetFillStyle(0); hNSYieldSyst->Draw("E2same"); c2->cd(); - SetTH1HistoStyle(hASYieldSyst, Form("p_{T}^{assoc} > %.1f GeV/c", binsPtHadIntervals[iBinPtHad]), "p_{T} (GeV/c)", "Y^{AS}", kFullSquare, kMagenta, 1.8, kMagenta, 2); + setTH1HistoStyle(hASYieldSyst, Form("p_{T}^{assoc} > %.1f GeV/c", binsPtHadIntervals[iBinPtHad]), "p_{T} (GeV/c)", "Y^{AS}", kFullSquare, kMagenta, 1.8, kMagenta, 2); hASYieldSyst->SetFillStyle(0); hASYieldSyst->Draw("E2same"); c3->cd(); - SetTH1HistoStyle(hNSSigmaSyst, Form("p_{T}^{assoc} > %.1f GeV/c", binsPtHadIntervals[iBinPtHad]), "p_{T} (GeV/c)", "#sigma_{NS}", kFullSquare, kOrange + 8, 1.8, kOrange + 8, 2); + setTH1HistoStyle(hNSSigmaSyst, Form("p_{T}^{assoc} > %.1f GeV/c", binsPtHadIntervals[iBinPtHad]), "p_{T} (GeV/c)", "#sigma_{NS}", kFullSquare, kOrange + 8, 1.8, kOrange + 8, 2); hNSSigmaSyst->SetFillStyle(0); hNSSigmaSyst->Draw("E2same"); c4->cd(); - SetTH1HistoStyle(hASSigmaSyst, Form("p_{T}^{assoc} > %.1f GeV/c", binsPtHadIntervals[iBinPtHad]), "p_{T} (GeV/c)", "#sigma_{AS}", kFullSquare, kViolet - 5, 1.8, kViolet - 5, 2); + setTH1HistoStyle(hASSigmaSyst, Form("p_{T}^{assoc} > %.1f GeV/c", binsPtHadIntervals[iBinPtHad]), "p_{T} (GeV/c)", "#sigma_{AS}", kFullSquare, kViolet - 5, 1.8, kViolet - 5, 2); hASSigmaSyst->SetFillStyle(0); hASSigmaSyst->Draw("E2same"); c5->cd(); - SetTH1HistoStyle(hBaselinSyst, Form("p_{T}^{assoc} > %.1f GeV/c", binsPtHadIntervals[iBinPtHad]), "p_{T} (GeV/c)", "Baseline", kFullSquare, kBlue, 1.8, kBlue, 2); + setTH1HistoStyle(hBaselinSyst, Form("p_{T}^{assoc} > %.1f GeV/c", binsPtHadIntervals[iBinPtHad]), "p_{T} (GeV/c)", "Baseline", kFullSquare, kBlue, 1.8, kBlue, 2); hBaselinSyst->SetFillStyle(0); hBaselinSyst->Draw("E2same"); } - c1->SaveAs(Form("Output_CorrelationFitting_%s_png/NearSideYield_PtAssoc%d.png", CodeNameAnalysis.data(), iBinPtHad + 1)); - c2->SaveAs(Form("Output_CorrelationFitting_%s_png/AwaySideYield_PtAssoc%d.png", CodeNameAnalysis.data(), iBinPtHad + 1)); - c3->SaveAs(Form("Output_CorrelationFitting_%s_png/NearSideSigma_PtAssoc%d.png", CodeNameAnalysis.data(), iBinPtHad + 1)); - c4->SaveAs(Form("Output_CorrelationFitting_%s_png/AwaySideSigma_PtAssoc%d.png", CodeNameAnalysis.data(), iBinPtHad + 1)); - c5->SaveAs(Form("Output_CorrelationFitting_%s_png/Baseline_PtAssoc%d.png", CodeNameAnalysis.data(), iBinPtHad + 1)); - c1->SaveAs(Form("Output_CorrelationFitting_%s_Root/NearSideYield_PtBinAssoc%d.root", CodeNameAnalysis.data(), iBinPtHad + 1)); - c2->SaveAs(Form("Output_CorrelationFitting_%s_Root/AwaySideYield_PtBinAssoc%d.root", CodeNameAnalysis.data(), iBinPtHad + 1)); - c3->SaveAs(Form("Output_CorrelationFitting_%s_Root/NearSideSigma_PtBinAssoc%d.root", CodeNameAnalysis.data(), iBinPtHad + 1)); - c4->SaveAs(Form("Output_CorrelationFitting_%s_Root/AwaySideSigma_PtBinAssoc%d.root", CodeNameAnalysis.data(), iBinPtHad + 1)); - c5->SaveAs(Form("Output_CorrelationFitting_%s_Root/Baseline_PtBinAssoc%d.root", CodeNameAnalysis.data(), iBinPtHad + 1)); + c1->SaveAs(Form("Output_CorrelationFitting_%s_png/NearSideYield_PtAssoc%d.png", codeNameAnalysis.data(), iBinPtHad + 1)); + c2->SaveAs(Form("Output_CorrelationFitting_%s_png/AwaySideYield_PtAssoc%d.png", codeNameAnalysis.data(), iBinPtHad + 1)); + c3->SaveAs(Form("Output_CorrelationFitting_%s_png/NearSideSigma_PtAssoc%d.png", codeNameAnalysis.data(), iBinPtHad + 1)); + c4->SaveAs(Form("Output_CorrelationFitting_%s_png/AwaySideSigma_PtAssoc%d.png", codeNameAnalysis.data(), iBinPtHad + 1)); + c5->SaveAs(Form("Output_CorrelationFitting_%s_png/Baseline_PtAssoc%d.png", codeNameAnalysis.data(), iBinPtHad + 1)); + c1->SaveAs(Form("Output_CorrelationFitting_%s_Root/NearSideYield_PtBinAssoc%d.root", codeNameAnalysis.data(), iBinPtHad + 1)); + c2->SaveAs(Form("Output_CorrelationFitting_%s_Root/AwaySideYield_PtBinAssoc%d.root", codeNameAnalysis.data(), iBinPtHad + 1)); + c3->SaveAs(Form("Output_CorrelationFitting_%s_Root/NearSideSigma_PtBinAssoc%d.root", codeNameAnalysis.data(), iBinPtHad + 1)); + c4->SaveAs(Form("Output_CorrelationFitting_%s_Root/AwaySideSigma_PtBinAssoc%d.root", codeNameAnalysis.data(), iBinPtHad + 1)); + c5->SaveAs(Form("Output_CorrelationFitting_%s_Root/Baseline_PtBinAssoc%d.root", codeNameAnalysis.data(), iBinPtHad + 1)); } return; } -void SetTH1HistoStyle(TH1D*& histo, TString hTitle, TString hXaxisTitle, TString hYaxisTitle, +void setTH1HistoStyle(TH1D*& histo, TString hTitle, TString hXaxisTitle, TString hYaxisTitle, Style_t markerStyle, Color_t markerColor, Double_t markerSize, - Color_t lineColor, Int_t lineWidth, Float_t hTitleXaxisOffset = 1.3, Float_t hTitleYaxisOffset = 1.3, - Float_t hTitleXaxisSize = 0.045, Float_t hTitleYaxisSize = 0.045, Float_t hLabelXaxisSize = 0.045, Float_t hLabelYaxisSize = 0.045, - Bool_t centerXaxisTitle = false, Bool_t centerYaxisTitle = false) + Color_t lineColor, Int_t lineWidth, Float_t hTitleXaxisOffset, Float_t hTitleYaxisOffset, + Float_t hTitleXaxisSize, Float_t hTitleYaxisSize, Float_t hLabelXaxisSize, Float_t hLabelYaxisSize, + Bool_t centerXaxisTitle, Bool_t centerYaxisTitle) { histo->SetTitle(hTitle.Data()); @@ -484,11 +487,11 @@ void SetTH1HistoStyle(TH1D*& histo, TString hTitle, TString hXaxisTitle, TString return; } -void SetTH1HistoStyle(TH1F*& histo, TString hTitle, TString hXaxisTitle, TString hYaxisTitle, +void setTH1HistoStyle(TH1F*& histo, TString hTitle, TString hXaxisTitle, TString hYaxisTitle, Style_t markerStyle, Color_t markerColor, Double_t markerSize, - Color_t lineColor, Int_t lineWidth, Float_t hTitleXaxisOffset = 1.3, Float_t hTitleYaxisOffset = 1.3, - Float_t hTitleXaxisSize = 0.045, Float_t hTitleYaxisSize = 0.045, Float_t hLabelXaxisSize = 0.045, Float_t hLabelYaxisSize = 0.045, - Bool_t centerXaxisTitle = false, Bool_t centerYaxisTitle = false) + Color_t lineColor, Int_t lineWidth, Float_t hTitleXaxisOffset, Float_t hTitleYaxisOffset, + Float_t hTitleXaxisSize, Float_t hTitleYaxisSize, Float_t hLabelXaxisSize, Float_t hLabelYaxisSize, + Bool_t centerXaxisTitle, Bool_t centerYaxisTitle) { histo->SetTitle(hTitle.Data()); diff --git a/PWGHF/Macros/computeFonllPlusPythiaPredictions.C b/PWGHF/Macros/computeFonllPlusPythiaPredictions.C index c112f7f5d24..203ad1a5464 100644 --- a/PWGHF/Macros/computeFonllPlusPythiaPredictions.C +++ b/PWGHF/Macros/computeFonllPlusPythiaPredictions.C @@ -40,7 +40,7 @@ #endif -enum Bhadrons { +enum BHadrons { Bplus = 0, Bzero, Bs, @@ -48,7 +48,7 @@ enum Bhadrons { NBeautyHadrons }; -enum Chadrons { +enum CHadrons { Dplus = 0, Dzero, Ds, @@ -205,12 +205,12 @@ void computeFonllPlusPythiaPredictions(int nDecays, int seed, std::string inFile // initialise histograms for non-prompt charm hadrons std::map, NBeautyHadrons + 1>> hFonllPythiaNonPromptChad{}; for (auto iChad{0}; iChad < NCharmHadrons; ++iChad) { - for (auto iBhad{0}; iBhad < NBeautyHadrons; ++iBhad) { + for (auto iBHad{0}; iBHad < NBeautyHadrons; ++iBHad) { for (auto iFonll{0}; iFonll < 3; ++iFonll) { - hFonllPythiaNonPromptChad[charmHadPdgs[iChad]][iBhad][iFonll] = new TH1D( - Form("hFonll%sFrom%s%s", charmHadNames[iChad].data(), beautyHadNames[iBhad].data(), namesFonll[iFonll].data()), + hFonllPythiaNonPromptChad[charmHadPdgs[iChad]][iBHad][iFonll] = new TH1D( + Form("hFonll%sFrom%s%s", charmHadNames[iChad].data(), beautyHadNames[iBHad].data(), namesFonll[iFonll].data()), ";#it{p}_{T} (GeV/#it{c});d#sigma/d#it{p}_{T} (#it{c}/GeV)", 1000, 0., 100.); - hFonllPythiaNonPromptChad[charmHadPdgs[iChad]][iBhad][iFonll]->Sumw2(); + hFonllPythiaNonPromptChad[charmHadPdgs[iChad]][iBHad][iFonll]->Sumw2(); } } } @@ -240,53 +240,53 @@ void computeFonllPlusPythiaPredictions(int nDecays, int seed, std::string inFile float parBsp2 = -0.00091f + ((iPar == 7 || iPar == 14) ? sign * 0.00025f : 0.f); float parBsAvePt = 10.1f; - for (int iBhad{0}; iBhad < NBeautyHadrons; ++iBhad) { - fragFracFuncs[iBhad][iPar]->SetParameters(parBsA, parBsp1, parBsp2, parBsAvePt, parLbA, parLbp1, parLbp2, parLbp3); + for (int iBHad{0}; iBHad < NBeautyHadrons; ++iBHad) { + fragFracFuncs[iBHad][iPar]->SetParameters(parBsA, parBsp1, parBsp2, parBsAvePt, parLbA, parLbp1, parLbp2, parLbp3); } } } std::array beautyHadMasses{}; for (auto iFonll{0}; iFonll < 3; ++iFonll) { - for (auto iBhad{0}; iBhad < NBeautyHadrons; ++iBhad) { - beautyHadMasses[iBhad] = TDatabasePDG::Instance()->GetParticle(beautyHadPdgs[iBhad])->Mass(); + for (auto iBHad{0}; iBHad < NBeautyHadrons; ++iBHad) { + beautyHadMasses[iBHad] = TDatabasePDG::Instance()->GetParticle(beautyHadPdgs[iBHad])->Mass(); for (auto iDecay{0}; iDecay < nDecays; ++iDecay) { auto ptB = hFonllBhad[iFonll]->GetRandom(); auto yB = gRandom->Uniform(-1., 1.); // we might consider to use more realistic shape from FONLL in the future auto phiB = gRandom->Rndm() * o2::constants::math::TwoPI; auto pxB = ptB * std::cos(phiB); auto pyB = ptB * std::sin(phiB); - auto mtB = std::sqrt(beautyHadMasses[iBhad] * beautyHadMasses[iBhad] + ptB * ptB); + auto mtB = std::sqrt(beautyHadMasses[iBHad] * beautyHadMasses[iBHad] + ptB * ptB); auto pzB = mtB * std::sinh(yB); auto pB = std::sqrt(ptB * ptB + pzB * pzB); - auto eB = std::sqrt(beautyHadMasses[iBhad] * beautyHadMasses[iBhad] + pB * pB); - - Pythia8::Particle Bhad; - Bhad.id(beautyHadPdgs[iBhad]); - Bhad.status(81); - Bhad.m(beautyHadMasses[iBhad]); - Bhad.xProd(0.); - Bhad.yProd(0.); - Bhad.zProd(0.); - Bhad.tProd(0.); - Bhad.e(eB); - Bhad.px(pxB); - Bhad.py(pyB); - Bhad.pz(pzB); + auto eB = std::sqrt(beautyHadMasses[iBHad] * beautyHadMasses[iBHad] + pB * pB); + + Pythia8::Particle bHad; + bHad.id(beautyHadPdgs[iBHad]); + bHad.status(81); + bHad.m(beautyHadMasses[iBHad]); + bHad.xProd(0.); + bHad.yProd(0.); + bHad.zProd(0.); + bHad.tProd(0.); + bHad.e(eB); + bHad.px(pxB); + bHad.py(pyB); + bHad.pz(pzB); pythia.event.reset(); - pythia.event.append(Bhad); + pythia.event.append(bHad); auto idPart = pythia.event[1].id(); pythia.particleData.mayDecay(idPart, true); pythia.moreDecays(); - auto fracB = fragFracs[iBhad]; + auto fracB = fragFracs[iBHad]; if (fragFracOpt == LHCb) { - fracB = fragFracFuncs[iBhad][0]->Eval(ptB > 5.f ? ptB : 5); + fracB = fragFracFuncs[iBHad][0]->Eval(ptB > 5.f ? ptB : 5); } else if (fragFracOpt == LHCbMin) { fracB = 2.f; for (int iPar{0}; iPar < 15; ++iPar) { - auto tmpFrac = fragFracFuncs[iBhad][iPar]->Eval(ptB > 5.f ? ptB : 5); + auto tmpFrac = fragFracFuncs[iBHad][iPar]->Eval(ptB > 5.f ? ptB : 5); if (tmpFrac < fracB) { fracB = tmpFrac; } @@ -294,7 +294,7 @@ void computeFonllPlusPythiaPredictions(int nDecays, int seed, std::string inFile } else if (fragFracOpt == LHCbMax) { fracB = -1.f; for (int iPar{0}; iPar < 15; ++iPar) { - auto tmpFrac = fragFracFuncs[iBhad][iPar]->Eval(ptB > 5.f ? ptB : 5); + auto tmpFrac = fragFracFuncs[iBHad][iPar]->Eval(ptB > 5.f ? ptB : 5); if (tmpFrac > fracB) { fracB = tmpFrac; } @@ -307,7 +307,7 @@ void computeFonllPlusPythiaPredictions(int nDecays, int seed, std::string inFile } auto absPdg = std::abs(pythia.event[iPart].id()); if (std::find(charmHadPdgs.begin(), charmHadPdgs.end(), absPdg) != charmHadPdgs.end()) { // we found a charm hadron, let's fill the corresponding histogram - hFonllPythiaNonPromptChad[absPdg][iBhad][iFonll]->Fill(pythia.event[iPart].pT(), fracB); + hFonllPythiaNonPromptChad[absPdg][iBHad][iFonll]->Fill(pythia.event[iPart].pT(), fracB); } } } @@ -320,9 +320,9 @@ void computeFonllPlusPythiaPredictions(int nDecays, int seed, std::string inFile for (auto iChad{0}; iChad < NCharmHadrons; ++iChad) { hFonllPythiaNonPromptChad[charmHadPdgs[iChad]][NBeautyHadrons][iFonll] = reinterpret_cast(hFonllPythiaNonPromptChad[charmHadPdgs[iChad]][0][iFonll]->Clone(Form("hFonllNonPrompt%s%s", charmHadNames[iChad].data(), namesFonll[iFonll].data()))); hFonllPythiaNonPromptChad[charmHadPdgs[iChad]][NBeautyHadrons][iFonll]->Reset(); - for (auto iBhad{0}; iBhad < NBeautyHadrons; ++iBhad) { - hFonllPythiaNonPromptChad[charmHadPdgs[iChad]][iBhad][iFonll]->Scale(normCrossSec[iFonll] / nDecays); - hFonllPythiaNonPromptChad[charmHadPdgs[iChad]][NBeautyHadrons][iFonll]->Add(hFonllPythiaNonPromptChad[charmHadPdgs[iChad]][iBhad][iFonll]); + for (auto iBHad{0}; iBHad < NBeautyHadrons; ++iBHad) { + hFonllPythiaNonPromptChad[charmHadPdgs[iChad]][iBHad][iFonll]->Scale(normCrossSec[iFonll] / nDecays); + hFonllPythiaNonPromptChad[charmHadPdgs[iChad]][NBeautyHadrons][iFonll]->Add(hFonllPythiaNonPromptChad[charmHadPdgs[iChad]][iBHad][iFonll]); } } } @@ -338,9 +338,9 @@ void computeFonllPlusPythiaPredictions(int nDecays, int seed, std::string inFile auto dirCharmHad = new TDirectoryFile(charmHadNames[iChad].data(), charmHadNames[iChad].data()); dirCharmHad->Write(); dirCharmHad->cd(); - for (auto iBhad{0}; iBhad < NBeautyHadrons + 1; ++iBhad) { + for (auto iBHad{0}; iBHad < NBeautyHadrons + 1; ++iBHad) { for (auto iFonll{0}; iFonll < 3; ++iFonll) { - hFonllPythiaNonPromptChad[charmHadPdgs[iChad]][iBhad][iFonll]->Write(); + hFonllPythiaNonPromptChad[charmHadPdgs[iChad]][iBHad][iFonll]->Write(); } } } From 29f666536ba9b0260530f6ce85c8a978a0d2eeac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Tue, 30 Sep 2025 00:06:41 +0200 Subject: [PATCH 10/25] Fix readability in macros --- PWGHF/HFC/Macros/DhCorrelationFitter.cxx | 47 +++++++++---------- PWGHF/HFC/Macros/DhCorrelationFitter.h | 4 +- PWGHF/HFC/Macros/ExtractOutputCorrel.C | 46 +++++++++--------- PWGHF/HFC/Macros/FitCorrel.C | 19 ++++---- .../computeFonllPlusPythiaPredictions.C | 12 ++--- 5 files changed, 60 insertions(+), 68 deletions(-) diff --git a/PWGHF/HFC/Macros/DhCorrelationFitter.cxx b/PWGHF/HFC/Macros/DhCorrelationFitter.cxx index dd77d723c1b..a0788b63f15 100644 --- a/PWGHF/HFC/Macros/DhCorrelationFitter.cxx +++ b/PWGHF/HFC/Macros/DhCorrelationFitter.cxx @@ -158,20 +158,20 @@ DhCorrelationFitter::~DhCorrelationFitter() { Info("DhCorrelationFitter.cxx", "Destructor is calling"); - if (fHist) { + if (fHist != nullptr) { delete fHist; fHist = 0; } - if (fFit) { + if (fFit != nullptr) { delete fFit; fFit = 0; } - if (fGausNS) { + if (fGausNS != nullptr) { delete fGausNS; fGausNS = 0; } // if (fGausNS2) {delete fGausNS2; fGausNS2 = 0;} - if (fPed) { + if (fPed != nullptr) { delete fPed; fPed = 0; } @@ -180,8 +180,9 @@ DhCorrelationFitter::~DhCorrelationFitter() DhCorrelationFitter& DhCorrelationFitter::operator=(const DhCorrelationFitter& cfit) // assignment operator { - if (&cfit == this) + if (&cfit == this) { return *this; + } fIsReflected = cfit.fIsReflected; fTypeOfFitFunc = cfit.fTypeOfFitFunc; @@ -215,7 +216,7 @@ DhCorrelationFitter& DhCorrelationFitter::operator=(const DhCorrelationFitter& c return *this; } -void DhCorrelationFitter::setExternalValsAndBounds(Int_t nPars, Double_t* vals, Double_t* lowBounds, Double_t* uppBounds) +void DhCorrelationFitter::setExternalValsAndBounds(Int_t nPars, const Double_t* vals, const Double_t* lowBounds, const Double_t* uppBounds) { fNpars = nPars; @@ -229,8 +230,6 @@ void DhCorrelationFitter::setExternalValsAndBounds(Int_t nPars, Double_t* vals, fExtParsLowBounds[i] = lowBounds[i]; fExtParsUppBounds[i] = uppBounds[i]; } - - return; } void DhCorrelationFitter::fitting(Bool_t drawSplitTerm, Bool_t useExternalPars) @@ -247,8 +246,9 @@ void DhCorrelationFitter::fitting(Bool_t drawSplitTerm, Bool_t useExternalPars) // = 2 : AS mean fixed to pi, NS mean free // = 3 : NS mean fixed to 0, AS mean to pi - if (useExternalPars) + if (useExternalPars) { fUseExternalPars = kTRUE; + } if (fFixBase != 0 && fFixBase != 6) { Printf("[INFO] DhCorrelationFitter::Fitting, Finding baseline"); @@ -272,10 +272,12 @@ void DhCorrelationFitter::fitting(Bool_t drawSplitTerm, Bool_t useExternalPars) fFit->FixParameter(2, 0.); } if (fFixMean == 2 || fFixMean == 3) { - if (fTypeOfFitFunc != 0 && fTypeOfFitFunc != 3) + if (fTypeOfFitFunc != 0 && fTypeOfFitFunc != 3) { fFit->FixParameter(5, TMath::Pi()); - if (fTypeOfFitFunc == 3 || fTypeOfFitFunc == 6) + } + if (fTypeOfFitFunc == 3 || fTypeOfFitFunc == 6) { fFit->FixParameter(2, TMath::Pi()); + } } Printf("[INFO] DhCorrelationFitter::Fitting, Fitting"); @@ -331,7 +333,7 @@ void DhCorrelationFitter::setFitFunction() // = 6: const + VonMises AS // = 7: baseline w v2 modulation + G NS + G AS (w/ periodicity) - if (fFit) { + if (fFit != nullptr) { delete fFit; delete fGausNS; // delete fGausNS2; @@ -596,7 +598,7 @@ void DhCorrelationFitter::setFitFunction() } } -void DhCorrelationFitter::setPointsForBaseline(Int_t nBaselinePoints, Int_t* binsBaseline) +void DhCorrelationFitter::setPointsForBaseline(Int_t nBaselinePoints, const Int_t* binsBaseline) { fNbasleinePoints = nBaselinePoints; @@ -606,8 +608,6 @@ void DhCorrelationFitter::setPointsForBaseline(Int_t nBaselinePoints, Int_t* bin for (int i = 0; i < fNbasleinePoints; i++) { fBinsBaseline[i] = binsBaseline[i]; } - - return; } Double_t DhCorrelationFitter::findBaseline() @@ -694,8 +694,9 @@ Double_t DhCorrelationFitter::findBaseline() errAv += 1. / (fHist->GetBinError(binPhi) * fHist->GetBinError(binPhi)); if (!fIsReflected) { binPhi = fHist->FindBin(-TMath::Pi() / 2.); - if (binPhi < 1) + if (binPhi < 1) { binPhi = 1; + } av += fHist->GetBinContent(binPhi) / (fHist->GetBinError(binPhi) * fHist->GetBinError(binPhi)); errAv += 1. / (fHist->GetBinError(binPhi) * fHist->GetBinError(binPhi)); } else { @@ -774,7 +775,7 @@ Double_t DhCorrelationFitter::findBaseline() void DhCorrelationFitter::fitBaselineWv2() { - fBaseTransvReg = new TF1("fBaseTransvReg", [](double* x, double* p) { + fBaseTransvReg = new TF1("fBaseTransvReg", [](const double* x, const double* p) { double xx = x[0]; // x value if ((xx >= -TMath::Pi()/2 && xx <= -3*TMath::Pi()/8) || (xx >= 3*TMath::Pi()/8 && xx <= 5*TMath::Pi()/8) || (xx >= 11*TMath::Pi()/8 && xx <= 3*TMath::Pi()/2)) { // Gaussian example: p[0] = amplitude, p[1] = mean, p[2] = sigma @@ -787,8 +788,6 @@ void DhCorrelationFitter::fitBaselineWv2() TFitResultPtr rFit = fHist->Fit(fBaseTransvReg, "RIMES", "", fMinCorr, fMaxCorr); fBaseline = fBaseTransvReg->GetParameter(0); - - return; } void DhCorrelationFitter::calculateYieldsAboveBaseline() @@ -800,13 +799,15 @@ void DhCorrelationFitter::calculateYieldsAboveBaseline() fErrASyieldBinCount = 0; std::cout << "[RESULT] Baseline: " << fBaseline << " +- " << fErrBaseline << std::endl; Int_t binMinNS = fHist->FindBin(-1.5); // slightly more than -pi/2 - if (binMinNS < 1) - binMinNS = 1; // with this, it is ok even in the case of a reflected fHist (range 0 - pi) + if (binMinNS < 1) { + binMinNS = 1; // with this, it is ok even in the case of a reflected fHist (range 0 - pi) + } Int_t binMaxNS = 6; // fHist -> FindBin(1.5); // slightly less than +pi/2 Int_t binMinAS = 11; // fHist -> FindBin(1.6); // slightly more than +pi/2 Int_t binMaxAS = 16; // fHist -> FindBin(3.14+1.5); // slightly less than +3pi/2 - if (binMaxAS > fHist->GetNbinsX()) + if (binMaxAS > fHist->GetNbinsX()) { binMaxAS = fHist->GetNbinsX(); // with this, it is ok even in the case of a reflected fHist (range 0 - pi) + } std::cout << "N bins : " << fHist->GetNbinsX() << std::endl; std::cout << "binMinNS : " << binMinNS << std::endl; std::cout << "binMaxNS : " << binMaxNS << std::endl; @@ -827,8 +828,6 @@ void DhCorrelationFitter::calculateYieldsAboveBaseline() fErrASyieldBinCount = TMath::Sqrt(fErrASyieldBinCount); printf("[RESULT] Bin counting results: NS Yield = %.3f +- %.3f \n[RESULT] Bin counting results: AS Yield: %.3f +- %.3f \n", fNSyieldBinCount, fErrNSyieldBinCount, fASyieldBinCount, fErrASyieldBinCount); - - return; } Double_t DhCorrelationFitter::calculateBaseline(TH1F*& histo, Bool_t totalRange) diff --git a/PWGHF/HFC/Macros/DhCorrelationFitter.h b/PWGHF/HFC/Macros/DhCorrelationFitter.h index ee3dcbe9d39..33ae6b4929d 100644 --- a/PWGHF/HFC/Macros/DhCorrelationFitter.h +++ b/PWGHF/HFC/Macros/DhCorrelationFitter.h @@ -55,8 +55,8 @@ class DhCorrelationFitter fMinAssoPt = ptAssocMin; fMaxAssoPt = ptAssocMax; } - void setExternalValsAndBounds(Int_t nPars, Double_t* vals, Double_t* lowBounds, Double_t* uppBounds); - void setPointsForBaseline(Int_t nBaselinePoints, Int_t* binsBaseline); + void setExternalValsAndBounds(Int_t nPars, const Double_t* vals, const Double_t* lowBounds, const Double_t* uppBounds); + void setPointsForBaseline(Int_t nBaselinePoints, const Int_t* binsBaseline); void setReflectedCorrHisto(Bool_t isReflected) { fIsTotal = !isReflected; } void setBaselineUpOrDown(Bool_t baseUp, Bool_t baseDown) { diff --git a/PWGHF/HFC/Macros/ExtractOutputCorrel.C b/PWGHF/HFC/Macros/ExtractOutputCorrel.C index 21de7a234aa..c7235974633 100644 --- a/PWGHF/HFC/Macros/ExtractOutputCorrel.C +++ b/PWGHF/HFC/Macros/ExtractOutputCorrel.C @@ -37,7 +37,7 @@ using namespace rapidjson; template void readArray(const Value& jsonArray, std::vector& output) { - for (auto it = jsonArray.Begin(); it != jsonArray.End(); it++) { + for (const auto* it = jsonArray.Begin(); it != jsonArray.End(); it++) { auto value = it->template Get(); output.emplace_back(value); } @@ -180,33 +180,41 @@ void extractOutputCorrelDs(const TString cfgFileName = "config_CorrAnalysis.json plotter->setCorrBiasBtoD(applyBiasBtoDCorr); plotter->setDebugLevel(1); - if (!flagSpecie) + if (!flagSpecie) { std::cout << "[ERROR] Wrong D meson flag" << std::endl; + } // Set the input file config setInputCorrelNames(plotter, pathFileSE, pathFileME, dirSE, dirME, histoNameCorrSignal, histoNameCorrSideba, histoNameCorrSidebaLeft, histoNameCorrSidebaRight); setInputHistoInvMassNames(plotter, pathFileMass, inputHistoMassName); - if (applyFDCorr) + if (applyFDCorr) { setInputHistoFdSubtraction(plotter, pathFileFDTemplate, pathFileFDPromptFrac, histoNameFDTemplatePrompt, histoNameFDTemplateNonPrompt, histoNameRawFracPrompt); - if (applySecPartCorr) + } + if (applySecPartCorr) { setInputHistoSecPart(plotter, pathFileSecPart, dirSecPart, histoNamePrimaryPart, histoNameAllPart); - if (applyBiasBtoDCorr) + } + if (applyBiasBtoDCorr) { setInputHistoBiasBtoD(plotter, pathfFilePromptMcRec, pathfFileNonPromptMcRec); + } Bool_t readSEandME = plotter->readInputSeAndMe(); - if (readSEandME) + if (readSEandME) { std::cout << "Files SE and ME read correctly" << std::endl; + } Bool_t readInvMass = plotter->readInputInvMass(); - if (readInvMass) + if (readInvMass) { std::cout << "Files inv. mass read correctly" << std::endl; + } if (applyFDCorr) { Bool_t readFDSubtr = plotter->readInputFdSubtr(); - if (readFDSubtr) + if (readFDSubtr) { std::cout << "Files for FD subtr. read correctly" << std::endl; + } } if (applySecPartCorr) { Bool_t readSecPart = plotter->readInputSecondaryPartContamination(); - if (readSecPart) + if (readSecPart) { std::cout << "Files for secondary part. contamination read correctly" << std::endl; + } } // Loop over candidate pt and assoc. particle pt @@ -216,10 +224,10 @@ void extractOutputCorrelDs(const TString cfgFileName = "config_CorrAnalysis.json for (int iBinPtHad = 0; iBinPtHad < nBinsPtHad; iBinPtHad++) { plotter->setBinCandAndHad(iBinPtCand + 1, iBinPtHad + 1); plotter->extractCorrelations(binsPtCandIntervals[iBinPtCand], binsPtCandIntervals[iBinPtCand + 1], binsPtHadIntervals[iBinPtHad], binsPtHadIntervals[iBinPtHad + 1], codeNameAnalysis); - hCorrectedCorrel[iBinPtCand][iBinPtHad] = (TH1D*)plotter->getCorrectedCorrHisto(); - hCorrectedCorrelBaselineSubtr[iBinPtCand][iBinPtHad] = (TH1D*)plotter->getCorrectedCorrHistoBaselineSubtr(); - hCorrectedCorrelReflected[iBinPtCand][iBinPtHad] = (TH1D*)plotter->getCorrectedCorrHistoReflected(); - hCorrectedCorrelReflectedBaselineSubtr[iBinPtCand][iBinPtHad] = (TH1D*)plotter->getCorrectedCorrHistoReflectedBaselineSubtr(); + hCorrectedCorrel[iBinPtCand][iBinPtHad] = plotter->getCorrectedCorrHisto(); + hCorrectedCorrelBaselineSubtr[iBinPtCand][iBinPtHad] = plotter->getCorrectedCorrHistoBaselineSubtr(); + hCorrectedCorrelReflected[iBinPtCand][iBinPtHad] = plotter->getCorrectedCorrHistoReflected(); + hCorrectedCorrelReflectedBaselineSubtr[iBinPtCand][iBinPtHad] = plotter->getCorrectedCorrHistoReflectedBaselineSubtr(); } } @@ -262,8 +270,6 @@ void extractOutputCorrelDs(const TString cfgFileName = "config_CorrAnalysis.json } } outFileReflectedBaselineSubtr->Close(); - - return; } void setInputCorrelNames(DhCorrelationExtraction* plotter, TString pathFileSE, TString pathFileME, TString dirSE, TString dirME, TString histoNameCorrSignal, TString histoNameCorrSideba, TString histoNameCorrSidebaLeft, TString histoNameCorrSidebaRight) @@ -282,8 +288,6 @@ void setInputCorrelNames(DhCorrelationExtraction* plotter, TString pathFileSE, T plotter->setMeCorrelHistoSidebandLeftName(histoNameCorrSidebaLeft.Data()); plotter->setSeCorrelHistoSidebandRightName(histoNameCorrSidebaRight.Data()); plotter->setMeCorrelHistoSidebandRightName(histoNameCorrSidebaRight.Data()); - - return; } void setInputHistoInvMassNames(DhCorrelationExtraction* plotter, TString pathFileMass, std::vector inputMassNames) @@ -293,8 +297,6 @@ void setInputHistoInvMassNames(DhCorrelationExtraction* plotter, TString pathFil plotter->setMassHistoNameSgn(inputMassNames[0].data()); plotter->setMassHistoNameBkg(inputMassNames[1].data()); plotter->setMassHistoNameSBs(inputMassNames[2].data()); - - return; } void setInputHistoFdSubtraction(DhCorrelationExtraction* plotter, TString pathFileFDTemplate, TString pathFileFDPromptFrac, TString histoNameFDTemplatePrompt, TString histoNameFDTemplateNonPrompt, TString histoNameRawFracPrompt) @@ -305,8 +307,6 @@ void setInputHistoFdSubtraction(DhCorrelationExtraction* plotter, TString pathFi plotter->setInputHistoNameFdTemplatePrompt(histoNameFDTemplatePrompt.Data()); plotter->setInputHistoNameFdTemplateNonPrompt(histoNameFDTemplateNonPrompt.Data()); plotter->setInputHistoNameFdPromptFrac(histoNameRawFracPrompt.Data()); - - return; } void setInputHistoSecPart(DhCorrelationExtraction* plotter, TString pathFileSecPart, TString dirSecPartName, TString histoNamePrimaryPart, TString histoNameAllPart) @@ -315,14 +315,10 @@ void setInputHistoSecPart(DhCorrelationExtraction* plotter, TString pathFileSecP plotter->setInputFilenameSecPart(pathFileSecPart.Data()); plotter->setDirNameSecPart(dirSecPartName.Data()); plotter->setHistoSecPartName(histoNamePrimaryPart.Data(), histoNameAllPart.Data()); - - return; } void setInputHistoBiasBtoD(DhCorrelationExtraction* plotter, TString pathfFilePromptMcRec, TString pathfFileNonPromptMcRec) { plotter->setInputFilenameBiasBtoD(pathfFilePromptMcRec.Data(), pathfFileNonPromptMcRec.Data()); - - return; } diff --git a/PWGHF/HFC/Macros/FitCorrel.C b/PWGHF/HFC/Macros/FitCorrel.C index 30166304f58..b93d958aec2 100644 --- a/PWGHF/HFC/Macros/FitCorrel.C +++ b/PWGHF/HFC/Macros/FitCorrel.C @@ -44,7 +44,7 @@ bool removeNSPeakLowPt = false; template void readArray(const Value& jsonArray, vector& output) { - for (auto it = jsonArray.Begin(); it != jsonArray.End(); it++) { + for (const auto* it = jsonArray.Begin(); it != jsonArray.End(); it++) { auto value = it->template Get(); output.emplace_back(value); } @@ -234,7 +234,7 @@ void fitCorrelDs(const TString cfgFileName = "config_CorrAnalysis.json") canvasCorrPhi[iBinPtHad]->cd(iBinPtCand + 1); canvasCorrPhi[iBinPtHad]->SetTickx(); canvasCorrPhi[iBinPtHad]->SetTicky(); - hCorrPhi[iBinPtCand][iBinPtHad]->SetStats(0); + hCorrPhi[iBinPtCand][iBinPtHad]->SetStats(false); hCorrPhi[iBinPtCand][iBinPtHad]->SetMinimum(0); // hCorrPhi[iBinPtCand][iBinPtHad] -> Draw(); @@ -336,14 +336,17 @@ void fitCorrelDs(const TString cfgFileName = "config_CorrAnalysis.json") tScaleUnc->SetTextColor(kBlack); tScaleUnc->AddText(0., 0., "corr. unc."); - if (drawSystematicErrors) + if (drawSystematicErrors) { hSystematicErrorsPlot[iBinPtCand][iBinPtHad]->Draw("E2same"); + } hCorrPhi[iBinPtCand][iBinPtHad]->Draw("same"); pttext->Draw("same"); - if (drawSystematicErrors) + if (drawSystematicErrors) { tCorrUncDs->Draw("same"); - if (drawSystematicErrors) + } + if (drawSystematicErrors) { tScaleUnc->Draw("same"); + } } canvasCorrPhi[iBinPtHad]->SaveAs(Form("Output_CorrelationFitting_%s_png/CorrPhiDs_PtBinAssoc%d.png", codeNameAnalysis.data(), iBinPtHad + 1)); canvasCorrPhi[iBinPtHad]->SaveAs(Form("Output_CorrelationFitting_%s_Root/CorrPhiDs_PtBinAssoc%d.root", codeNameAnalysis.data(), iBinPtHad + 1)); @@ -456,8 +459,6 @@ void fitCorrelDs(const TString cfgFileName = "config_CorrAnalysis.json") c4->SaveAs(Form("Output_CorrelationFitting_%s_Root/AwaySideSigma_PtBinAssoc%d.root", codeNameAnalysis.data(), iBinPtHad + 1)); c5->SaveAs(Form("Output_CorrelationFitting_%s_Root/Baseline_PtBinAssoc%d.root", codeNameAnalysis.data(), iBinPtHad + 1)); } - - return; } void setTH1HistoStyle(TH1D*& histo, TString hTitle, TString hXaxisTitle, TString hYaxisTitle, @@ -483,8 +484,6 @@ void setTH1HistoStyle(TH1D*& histo, TString hTitle, TString hXaxisTitle, TString histo->GetYaxis()->SetLabelSize(hLabelYaxisSize); histo->GetXaxis()->CenterTitle(centerXaxisTitle); histo->GetYaxis()->CenterTitle(centerYaxisTitle); - - return; } void setTH1HistoStyle(TH1F*& histo, TString hTitle, TString hXaxisTitle, TString hYaxisTitle, @@ -510,6 +509,4 @@ void setTH1HistoStyle(TH1F*& histo, TString hTitle, TString hXaxisTitle, TString histo->GetYaxis()->SetLabelSize(hLabelYaxisSize); histo->GetXaxis()->CenterTitle(centerXaxisTitle); histo->GetYaxis()->CenterTitle(centerYaxisTitle); - - return; } diff --git a/PWGHF/Macros/computeFonllPlusPythiaPredictions.C b/PWGHF/Macros/computeFonllPlusPythiaPredictions.C index 203ad1a5464..8b410b2b1e9 100644 --- a/PWGHF/Macros/computeFonllPlusPythiaPredictions.C +++ b/PWGHF/Macros/computeFonllPlusPythiaPredictions.C @@ -180,7 +180,7 @@ void computeFonllPlusPythiaPredictions(int nDecays, int seed, std::string inFile // get histograms from FONLL auto hFonllBhad = readFonll(inFileFonllBhad); - if (!hFonllBhad[0]) { + if (hFonllBhad[0] == nullptr) { return; } @@ -331,11 +331,11 @@ void computeFonllPlusPythiaPredictions(int nDecays, int seed, std::string inFile for (auto iFonll{0}; iFonll < 3; ++iFonll) { hFonllBhad[iFonll]->Write(); } - auto dirNonPrompt = new TDirectoryFile("NonPrompt", "NonPrompt"); + auto* dirNonPrompt = new TDirectoryFile("NonPrompt", "NonPrompt"); dirNonPrompt->Write(); for (auto iChad{0}; iChad < NCharmHadrons; ++iChad) { dirNonPrompt->cd(); - auto dirCharmHad = new TDirectoryFile(charmHadNames[iChad].data(), charmHadNames[iChad].data()); + auto* dirCharmHad = new TDirectoryFile(charmHadNames[iChad].data(), charmHadNames[iChad].data()); dirCharmHad->Write(); dirCharmHad->cd(); for (auto iBHad{0}; iBHad < NBeautyHadrons + 1; ++iBHad) { @@ -346,15 +346,15 @@ void computeFonllPlusPythiaPredictions(int nDecays, int seed, std::string inFile } if (addPromptCharmHadrons) { outFile.cd(); - auto dirPrompt = new TDirectoryFile("Prompt", "Prompt"); + auto* dirPrompt = new TDirectoryFile("Prompt", "Prompt"); dirPrompt->Write(); for (auto iChad{0}; iChad < NCharmHadrons; ++iChad) { dirPrompt->cd(); - auto dirCharmHad = new TDirectoryFile(charmHadNames[iChad].data(), charmHadNames[iChad].data()); + auto* dirCharmHad = new TDirectoryFile(charmHadNames[iChad].data(), charmHadNames[iChad].data()); dirCharmHad->Write(); dirCharmHad->cd(); for (auto iFonll{0}; iFonll < 3; ++iFonll) { - if (hFonllPromptChad[charmHadPdgs[iChad]][iFonll]) { + if (hFonllPromptChad[charmHadPdgs[iChad]][iFonll] != nullptr) { hFonllPromptChad[charmHadPdgs[iChad]][iFonll]->Write(); } } From ab76bd01d249d4ed6ec3df79b7af601bdaf1ee4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Tue, 30 Sep 2025 10:51:38 +0200 Subject: [PATCH 11/25] dataCreatorCharmResoReduced.cxx: Simplify return condition --- PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx index 67a8dec5fb9..199048fb421 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx @@ -600,10 +600,7 @@ struct HfDataCreatorCharmResoReduced { bool isPion = std::abs(track.tpcNSigmaPi()) < cfgSingleTrackCuts.maxNsigmaTpcPi; bool isKaon = std::abs(track.tpcNSigmaKa()) < cfgSingleTrackCuts.maxNsigmaTpcKa; bool isProton = std::abs(track.tpcNSigmaPr()) < cfgSingleTrackCuts.maxNsigmaTpcPr; - if (!isPion && !isKaon && !isProton) { // we keep the track if is it compatible with at least one of the PID hypotheses selected - return false; - } - return true; + return (isPion || isKaon || isProton); // we keep the track if is it compatible with at least one of the PID hypotheses selected } template From a618ddc514308077798f8cffaf21099bb47e657d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Tue, 30 Sep 2025 11:44:32 +0200 Subject: [PATCH 12/25] Mass fitter: Fix nullptr dereference. Remove unused code. --- PWGHF/D2H/Macros/HFInvMassFitter.h | 3 ++- PWGHF/D2H/Macros/runMassFitter.C | 9 ++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/PWGHF/D2H/Macros/HFInvMassFitter.h b/PWGHF/D2H/Macros/HFInvMassFitter.h index c4d558da0f9..ae67091eaac 100644 --- a/PWGHF/D2H/Macros/HFInvMassFitter.h +++ b/PWGHF/D2H/Macros/HFInvMassFitter.h @@ -188,10 +188,11 @@ class HFInvMassFitter : public TNamed setInitialReflOverSgn(reflOverSgn); mFixReflOverSgn = kTRUE; } - void setTemplateReflections(const TH1* histoRefl, Int_t fitTypeRefl = DoubleGaus) + void setTemplateReflections(const TH1* histoRefl) { if (histoRefl == nullptr) { mEnableReflections = kFALSE; + return; } mHistoTemplateRefl = dynamic_cast(histoRefl->Clone("mHistoTemplateRefl")); } diff --git a/PWGHF/D2H/Macros/runMassFitter.C b/PWGHF/D2H/Macros/runMassFitter.C index 68ff814da54..544b60aa72e 100644 --- a/PWGHF/D2H/Macros/runMassFitter.C +++ b/PWGHF/D2H/Macros/runMassFitter.C @@ -378,11 +378,6 @@ int runMassFitter(const TString& configFileName) } Double_t reflOverSgn = 0; - double markerSize = 1.; - constexpr int NSliceVarBinsLarge = 15; - if (nSliceVarBins > NSliceVarBinsLarge) { - markerSize = 0.5; - } if (isMc) { HFInvMassFitter* massFitter; @@ -439,7 +434,7 @@ int runMassFitter(const TString& configFileName) massFitter->setUseLikelihoodFit(); } - auto setFixedValue = [&massFitter, &iSliceVar](bool const& isFix, std::vector const& fixManual, const TH1* histToFix, std::function setFunc, std::string const& var) -> void { + auto setFixedValue = [&iSliceVar](bool const& isFix, std::vector const& fixManual, const TH1* histToFix, std::function setFunc, std::string const& var) -> void { if (isFix) { if (fixManual.empty()) { setFunc(histToFix->GetBinContent(iSliceVar + 1)); @@ -463,7 +458,7 @@ int runMassFitter(const TString& configFileName) reflOverSgn = hMassForSgn[iSliceVar]->Integral(hMassForSgn[iSliceVar]->FindBin(massMin[iSliceVar] * 1.0001), hMassForSgn[iSliceVar]->FindBin(massMax[iSliceVar] * 0.999)); reflOverSgn = hMassForRefl[iSliceVar]->Integral(hMassForRefl[iSliceVar]->FindBin(massMin[iSliceVar] * 1.0001), hMassForRefl[iSliceVar]->FindBin(massMax[iSliceVar] * 0.999)) / reflOverSgn; massFitter->setFixReflOverSgn(reflOverSgn); - massFitter->setTemplateReflections(hMassRefl[iSliceVar], HFInvMassFitter::DoubleGaus); + massFitter->setTemplateReflections(hMassRefl[iSliceVar]); } massFitter->doFit(); From 2f65eefcc2221f180ab78c3564adbd0c399d89cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Tue, 30 Sep 2025 11:45:43 +0200 Subject: [PATCH 13/25] utilsCorrelations.h: Fix wrong mass --- PWGHF/HFC/Utils/utilsCorrelations.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/HFC/Utils/utilsCorrelations.h b/PWGHF/HFC/Utils/utilsCorrelations.h index 7e3a84687f2..3cbef6ee2de 100644 --- a/PWGHF/HFC/Utils/utilsCorrelations.h +++ b/PWGHF/HFC/Utils/utilsCorrelations.h @@ -173,7 +173,7 @@ bool matchCandAndMass(McParticleType const& particle, double& massCand) } case BIT(aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi): { - massCand = o2::constants::physics::MassSigmaCStarPlusPlus; + massCand = o2::constants::physics::MassSigmaCPlusPlus; return true; } From 3c04fecc5df81ca39fdf98a2ac206230cc69809f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Tue, 30 Sep 2025 13:17:33 +0200 Subject: [PATCH 14/25] treeCreatorLcToK0sP.cxx: Fix table filling --- PWGHF/TableProducer/treeCreatorLcToK0sP.cxx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/PWGHF/TableProducer/treeCreatorLcToK0sP.cxx b/PWGHF/TableProducer/treeCreatorLcToK0sP.cxx index 8c88c70398f..8cc336acddb 100644 --- a/PWGHF/TableProducer/treeCreatorLcToK0sP.cxx +++ b/PWGHF/TableProducer/treeCreatorLcToK0sP.cxx @@ -448,11 +448,7 @@ struct HfTreeCreatorLcToK0sP { auto bach = candidate.prong0_as(); // bachelor const int flag = candidate.flagMcMatchRec(); - if (fillOnlySignal && flag != 0) { - fillCandidate(candidate, bach, candidate.flagMcMatchRec(), candidate.originMcRec(), candidateMlScore); - } else if (fillOnlyBackground && flag == 0) { - fillCandidate(candidate, bach, candidate.flagMcMatchRec(), candidate.originMcRec(), candidateMlScore); - } else { + if ((fillOnlySignal && flag != 0) || (fillOnlyBackground && flag == 0) || (!fillOnlySignal && !fillOnlyBackground)) { fillCandidate(candidate, bach, candidate.flagMcMatchRec(), candidate.originMcRec(), candidateMlScore); } } From c9831f7e82569f8f72454d64667e393bdaafc2ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Tue, 30 Sep 2025 13:17:50 +0200 Subject: [PATCH 15/25] correlatorDsHadrons.cxx: Fix histogram filling --- PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx index 77523171e08..c632d3a5882 100644 --- a/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx @@ -920,9 +920,7 @@ struct HfCorrelatorDsHadrons { } if (std::abs(candidate.flagMcMatchRec()) == hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK) { // DsToKKPi and DsToPiKK division - if (candidate.isSelDsToKKPi() >= selectionFlagDs) { - fillHistoMcRecSig(candidate, 0.); - } else if (candidate.isSelDsToPiKK() >= selectionFlagDs) { + if (candidate.isSelDsToKKPi() >= selectionFlagDs || candidate.isSelDsToPiKK() >= selectionFlagDs) { fillHistoMcRecSig(candidate, 0.); } } else { From 282f9a7e877bf386900f825f9236a9920fea13c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Tue, 30 Sep 2025 13:22:50 +0200 Subject: [PATCH 16/25] taskMcValidation.cxx: Simplify getting rejection mask --- PWGHF/Tasks/taskMcValidation.cxx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/PWGHF/Tasks/taskMcValidation.cxx b/PWGHF/Tasks/taskMcValidation.cxx index ff5c05afe07..f96cab188e7 100644 --- a/PWGHF/Tasks/taskMcValidation.cxx +++ b/PWGHF/Tasks/taskMcValidation.cxx @@ -291,11 +291,7 @@ struct HfTaskMcValidationGen { occupancy = o2::hf_occupancy::getOccupancyGenColl(recoCollisions, OccupancyEstimator::Its); } o2::hf_evsel::HfCollisionRejectionMask rejectionMask{}; - if constexpr (CentEstimator == CentralityEstimator::FT0C) { - rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, recoCollisions, centrality); - } else if constexpr (CentEstimator == CentralityEstimator::FT0M) { - rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, recoCollisions, centrality); - } else if constexpr (CentEstimator == CentralityEstimator::None) { + if constexpr (CentEstimator == CentralityEstimator::FT0C || CentEstimator == CentralityEstimator::FT0M || CentEstimator == CentralityEstimator::None) { rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, recoCollisions, centrality); } hfEvSelMc.fillHistograms(mcCollision, rejectionMask); From 320d443fbf2ff8d2007b1c2679137ea53be23731 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Tue, 30 Sep 2025 13:38:12 +0200 Subject: [PATCH 17/25] HFInvMassFitter: Fix integer division --- PWGHF/D2H/Macros/HFInvMassFitter.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/D2H/Macros/HFInvMassFitter.cxx b/PWGHF/D2H/Macros/HFInvMassFitter.cxx index e69c9a194a6..2f1c0c29f94 100644 --- a/PWGHF/D2H/Macros/HFInvMassFitter.cxx +++ b/PWGHF/D2H/Macros/HFInvMassFitter.cxx @@ -408,7 +408,7 @@ void HFInvMassFitter::fillWorkspace(RooWorkspace& workspace) const workspace.import(*bkgFuncPow); delete bkgFuncPow; // pow * exp - RooRealVar powExpoParam1("powExpoParam1", "Parameter of PowExpo function", 1 / 2); + RooRealVar powExpoParam1("powExpoParam1", "Parameter of PowExpo function", 1. / 2.); RooRealVar powExpoParam2("powExpoParam2", "Parameter of PowExpo function", 1, -10, 10); RooRealVar massPi("massPi", "mass of pion", TDatabasePDG::Instance()->GetParticle("pi+")->Mass()); RooFormulaVar powExpoParam3("powExpoParam3", "powExpoParam1 + 1", RooArgList(powExpoParam1)); From 9007f34e53f7f26dd90eab54b1337c06df5cee82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Tue, 30 Sep 2025 16:13:41 +0200 Subject: [PATCH 18/25] Modernise macros --- PWGHF/D2H/Macros/HFInvMassFitter.h | 2 +- PWGHF/HFC/Macros/DhCorrelationExtraction.cxx | 85 ++++++++-------- PWGHF/HFC/Macros/DhCorrelationExtraction.h | 2 +- PWGHF/HFC/Macros/DhCorrelationFitter.cxx | 102 +++++++------------ PWGHF/HFC/Macros/DhCorrelationFitter.h | 14 +-- PWGHF/HFC/Macros/ExtractOutputCorrel.C | 10 +- PWGHF/HFC/Macros/FitCorrel.C | 24 ++--- 7 files changed, 102 insertions(+), 137 deletions(-) diff --git a/PWGHF/D2H/Macros/HFInvMassFitter.h b/PWGHF/D2H/Macros/HFInvMassFitter.h index ae67091eaac..1a245fe0db5 100644 --- a/PWGHF/D2H/Macros/HFInvMassFitter.h +++ b/PWGHF/D2H/Macros/HFInvMassFitter.h @@ -99,7 +99,7 @@ class HFInvMassFitter : public TNamed mParamSgn = sigmaLimit; } void setParticlePdgMass(Double_t mass) { mMassParticle = mass; } - Double_t getParticlePdgMass() const { return mMassParticle; } + [[nodiscard]] Double_t getParticlePdgMass() const { return mMassParticle; } void setInitialGaussianMean(Double_t mean) { mMass = mean; diff --git a/PWGHF/HFC/Macros/DhCorrelationExtraction.cxx b/PWGHF/HFC/Macros/DhCorrelationExtraction.cxx index c0e56519dd7..d078acc069c 100644 --- a/PWGHF/HFC/Macros/DhCorrelationExtraction.cxx +++ b/PWGHF/HFC/Macros/DhCorrelationExtraction.cxx @@ -32,22 +32,22 @@ #include DhCorrelationExtraction::DhCorrelationExtraction() : // default constructor - fFileMass(0x0), - fFileSE(0x0), - fFileME(0x0), - fFileFDTemplate(0x0), - fFileFDPromptFrac(0x0), - fFileSecPart(0x0), - fFilePromptMc(0x0), - fFileNonPromptMc(0x0), - fDirMass(0x0), - fDirSE(0x0), - fDirME(0x0), - fDirSecPart(0x0), - fCorrectedCorrHisto(0x0), - fCorrectedCorrHistoBaselineSubtr(0x0), - fCorrectedCorrHistoReflected(0x0), - fCorrectedCorrHistoReflectedBaselineSubtr(0x0), + fFileMass(nullptr), + fFileSE(nullptr), + fFileME(nullptr), + fFileFDTemplate(nullptr), + fFileFDPromptFrac(nullptr), + fFileSecPart(nullptr), + fFilePromptMc(nullptr), + fFileNonPromptMc(nullptr), + fDirMass(nullptr), + fDirSE(nullptr), + fDirME(nullptr), + fDirSecPart(nullptr), + fCorrectedCorrHisto(nullptr), + fCorrectedCorrHistoBaselineSubtr(nullptr), + fCorrectedCorrHistoReflected(nullptr), + fCorrectedCorrHistoReflectedBaselineSubtr(nullptr), fDmesonSpecies(kDsToKKPi), fDmesonLabel("Ds"), fFileNameSE(""), @@ -170,9 +170,8 @@ DhCorrelationExtraction::DhCorrelationExtraction(const DhCorrelationExtraction& } DhCorrelationExtraction::~DhCorrelationExtraction() -// destructor -{ -} + // destructor + = default; Bool_t DhCorrelationExtraction::setDmesonSpecie(DmesonSpecie k) { @@ -276,7 +275,7 @@ Bool_t DhCorrelationExtraction::extractCorrelations(Double_t ptCandMin, Double_t } if (fDebug >= 1) { - TCanvas* c = new TCanvas(Form("cSE_Original_%d_%1.1fto%1.1f", iPool, ptHadMin, ptHadMax), Form("cSE_Original_%s_pool%d_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), iPool, ptCandMin, ptCandMax, ptHadMin, ptHadMax), 100, 100, 1600, 900); + auto* c = new TCanvas(Form("cSE_Original_%d_%1.1fto%1.1f", iPool, ptHadMin, ptHadMax), Form("cSE_Original_%s_pool%d_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), iPool, ptCandMin, ptCandMax, ptHadMin, ptHadMax), 100, 100, 1600, 900); c->Divide(2, 1); c->cd(1); hSeSign[iPool]->SetMinimum(0); @@ -289,7 +288,7 @@ Bool_t DhCorrelationExtraction::extractCorrelations(Double_t ptCandMin, Double_t } if (fDebug >= 1) { - TCanvas* c = new TCanvas(Form("cME_Original_%d_%1.1fto%1.1f", iPool, ptHadMin, ptHadMax), Form("cME_Original_%s_pool%d_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), iPool, ptCandMin, ptCandMax, ptHadMin, ptHadMax), 100, 100, 1600, 900); + auto* c = new TCanvas(Form("cME_Original_%d_%1.1fto%1.1f", iPool, ptHadMin, ptHadMax), Form("cME_Original_%s_pool%d_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), iPool, ptCandMin, ptCandMax, ptHadMin, ptHadMax), 100, 100, 1600, 900); c->Divide(2, 1); c->cd(1); hMeSign[iPool]->SetMinimum(0); @@ -341,7 +340,7 @@ Bool_t DhCorrelationExtraction::extractCorrelations(Double_t ptCandMin, Double_t hCorrSideb[iPool]->SetEntries(nSideb); if (fDebug >= 1) { - TCanvas* c = new TCanvas(Form("cSEME_%d_%1.1fto%1.1f", iPool, ptHadMin, ptHadMax), Form("cSEME_%s_pool%d_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), iPool, ptCandMin, ptCandMax, ptHadMin, ptHadMax), 100, 100, 1600, 900); + auto* c = new TCanvas(Form("cSEME_%d_%1.1fto%1.1f", iPool, ptHadMin, ptHadMax), Form("cSEME_%s_pool%d_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), iPool, ptCandMin, ptCandMax, ptHadMin, ptHadMax), 100, 100, 1600, 900); c->Divide(3, 2); c->cd(1); hSeSign[iPool]->SetMinimum(0); @@ -378,7 +377,7 @@ Bool_t DhCorrelationExtraction::extractCorrelations(Double_t ptCandMin, Double_t } // end pool loop // Draw 2D plots (Signal region and Sidebands) - TCanvas* c2D = new TCanvas(Form("c2D_IntPools_PtHad%.0fto%.0f", ptHadMin, ptHadMax), Form("c2D_%s_IntPools_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), ptHadMin, ptHadMax), 100, 100, 1500, 800); + auto* c2D = new TCanvas(Form("c2D_IntPools_PtHad%.0fto%.0f", ptHadMin, ptHadMax), Form("c2D_%s_IntPools_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), ptHadMin, ptHadMax), 100, 100, 1500, 800); setTH2HistoStyle(h2DSign, Form("Signal region, %.0f < p^{%s}_{T} < %.0f GeV/c, %.0f < p^{assoc}_{T} < %.0f GeV/c", ptCandMin, fDmesonLabel.Data(), ptCandMax, ptHadMin, ptHadMax), "#Delta#eta", "#Delta#phi [rad]", "entries", 1.6, 1.6, 1.6, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04); setTH2HistoStyle(h2DSideb, Form("Sideband region, %.0f < p^{%s}_{T} < %.0f GeV/c, %.0f < p^{assoc}_{T} < %.0f GeV/c", ptCandMin, fDmesonLabel.Data(), ptCandMax, ptHadMin, ptHadMax), "#Delta#eta", "#Delta#phi [rad]", "#frac{Y_{Bkg}}{Y_{SB}} entries", 1.6, 1.6, 1.6, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04); c2D->Divide(2, 1); @@ -404,7 +403,7 @@ Bool_t DhCorrelationExtraction::extractCorrelations(Double_t ptCandMin, Double_t } if (fDebug >= 1) { - TCanvas* c = new TCanvas(Form("cFDTemplate_PtCand%.0fto%.0f_PtHad%.0fto%.0f", ptCandMin, ptCandMax, ptHadMin, ptHadMax), Form("cFDTemplate_%s_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax)); + auto* c = new TCanvas(Form("cFDTemplate_PtCand%.0fto%.0f_PtHad%.0fto%.0f", ptCandMin, ptCandMax, ptHadMin, ptHadMax), Form("cFDTemplate_%s_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax)); c->Divide(2, 1); c->cd(1); h2DFdTemplatePrompt->SetMinimum(0); @@ -417,7 +416,7 @@ Bool_t DhCorrelationExtraction::extractCorrelations(Double_t ptCandMin, Double_t } // Bkg subtraction (2D plot) - TCanvas* c2DSub = new TCanvas(Form("c2D_Subtr_IntPools_PtHAd%.0fto%.0f", ptHadMin, ptHadMax), Form("c2D_%s_Subtr_IntPools_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), ptHadMin, ptHadMax), 100, 100, 1500, 800); + auto* c2DSub = new TCanvas(Form("c2D_Subtr_IntPools_PtHAd%.0fto%.0f", ptHadMin, ptHadMax), Form("c2D_%s_Subtr_IntPools_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), ptHadMin, ptHadMax), 100, 100, 1500, 800); h2DSubtr = reinterpret_cast(h2DSign->Clone("h2D_Subtr")); h2DSubtr->Sumw2(); h2DSubtr->Add(h2DSideb, -1); @@ -443,7 +442,7 @@ Bool_t DhCorrelationExtraction::extractCorrelations(Double_t ptCandMin, Double_t h1DSubtr->SetTitle("Signal region after sideb. subt. corr."); // Draw 1D plots (Signal region, Sidebands, S-SB (subtr.)) - TCanvas* c1D = new TCanvas(Form("c1D_IntPools_PtCand%.0fto%.0f_PtHad%.0fto%.0f", ptCandMin, ptCandMax, ptHadMin, ptHadMax), Form("c1D_%s_IntPools_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), ptHadMin, ptHadMax), 100, 100, 1600, 500); + auto* c1D = new TCanvas(Form("c1D_IntPools_PtCand%.0fto%.0f_PtHad%.0fto%.0f", ptCandMin, ptCandMax, ptHadMin, ptHadMax), Form("c1D_%s_IntPools_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), ptHadMin, ptHadMax), 100, 100, 1600, 500); c1D->Divide(3, 1); c1D->cd(1); h1DSign->Draw(); @@ -473,7 +472,7 @@ Bool_t DhCorrelationExtraction::extractCorrelations(Double_t ptCandMin, Double_t h1DSidebNorm->SetMarkerColor(kBlue); h1DSidebNorm->SetLineWidth(2); h1DSidebNorm->SetTitle(Form("%.0f < p_{T} < %.0f", ptCandMin, ptCandMax)); - TCanvas* c = new TCanvas(Form("c_IntPools_PtCand%.0fto%.0f_PtHad%.0fto%.0f", ptCandMin, ptCandMax, ptHadMin, ptHadMax), ""); + auto* c = new TCanvas(Form("c_IntPools_PtCand%.0fto%.0f_PtHad%.0fto%.0f", ptCandMin, ptCandMax, ptHadMin, ptHadMax), ""); c->cd(); h1DSidebNorm->Draw(); h1DSignNorm->Draw("same"); @@ -489,7 +488,7 @@ Bool_t DhCorrelationExtraction::extractCorrelations(Double_t ptCandMin, Double_t // Correction for bias B to D topologies if (fCorrBiasBtoD) { hModul = evaluateMcClosModulations(ptCandMin, ptCandMax, ptHadMin, ptHadMax); - TCanvas* c1DCorrBbias = new TCanvas(Form("c1D_corrBbias_IntPools_PtCand%.0fto%.0f_PtHad%.0fto%.0f", ptCandMin, ptCandMax, ptHadMin, ptHadMax), Form("c1D_corrBbias_%s_IntPools_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), ptHadMin, ptHadMax), 100, 100, 1600, 500); + auto* c1DCorrBbias = new TCanvas(Form("c1D_corrBbias_IntPools_PtCand%.0fto%.0f_PtHad%.0fto%.0f", ptCandMin, ptCandMax, ptHadMin, ptHadMax), Form("c1D_corrBbias_%s_IntPools_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), ptHadMin, ptHadMax), 100, 100, 1600, 500); c1DCorrBbias->cd(); hBeforeModulCorr = reinterpret_cast(h1DSubtrNorm->Clone("hBeforeModulCorr")); hBeforeModulCorr->SetLineColor(kViolet - 3); @@ -500,7 +499,7 @@ Bool_t DhCorrelationExtraction::extractCorrelations(Double_t ptCandMin, Double_t c1DCorrBbias->SaveAs(Form("Output_CorrelationExtraction_%s_png/ComparisonCorrBiasBtoD_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.png", codeName.Data(), fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax)); c1DCorrBbias->SaveAs(Form("Output_CorrelationExtraction_%s_Root/ComparisonCorrBiasBtoD_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.root", codeName.Data(), fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax)); - TFile* file = new TFile(Form("Output_CorrelationExtraction_%s_Root/SystematicCorrBiasBtoD_%s_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.root", codeName.Data(), fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax), "RECREATE"); // Open file in write mode + auto* file = new TFile(Form("Output_CorrelationExtraction_%s_Root/SystematicCorrBiasBtoD_%s_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.root", codeName.Data(), fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax), "RECREATE"); // Open file in write mode TH1D* h1DSubtrNormClone = reinterpret_cast(h1DSubtrNorm->Clone("h1D_SubtrNorm_Clone")); h1DSubtrNormClone = reflectCorrHistogram(h1DSubtrNormClone); hBeforeModulCorr = reflectCorrHistogram(hBeforeModulCorr); @@ -530,7 +529,7 @@ Bool_t DhCorrelationExtraction::extractCorrelations(Double_t ptCandMin, Double_t h1DSecPartFrac->Sumw2(); h1DSecPartFrac->Divide(h1DPrimaryPartCorr, h1DAllPartCorr, 1., 1., "B"); - TCanvas* c1D = new TCanvas(Form("c1D_CorrPrimaryPart_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f", ptCandMin, ptCandMax, ptHadMin, ptHadMax), Form("c1D_%s_CorrPrimaryPart_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), ptHadMin, ptHadMax)); + auto* c1D = new TCanvas(Form("c1D_CorrPrimaryPart_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f", ptCandMin, ptCandMax, ptHadMin, ptHadMax), Form("c1D_%s_CorrPrimaryPart_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), ptHadMin, ptHadMax)); c1D->cd(); setTH1HistoStyle(h1DSecPartFrac, Form("%.0f < p_{T} < %.0f GeV/c", ptCandMin, ptCandMax), "#Delta#phi [rad]", "#frac{primary part.}{part. selected}"); h1DSecPartFrac->Draw(); @@ -561,7 +560,7 @@ Bool_t DhCorrelationExtraction::extractCorrelations(Double_t ptCandMin, Double_t h1DTemplateTotal->Add(h1DFdTemplateNonPrompt, 1 - fdPromptFrac); if (fDebug >= 1) { - TCanvas* c = new TCanvas(Form("cFDTemplate_1D_%1.1fto%1.1f", ptHadMin, ptHadMax), Form("cFDTemplate_%s_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax)); + auto* c = new TCanvas(Form("cFDTemplate_1D_%1.1fto%1.1f", ptHadMin, ptHadMax), Form("cFDTemplate_%s_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax)); c->cd(); h1DTemplateTotal->SetMinimum(0); h1DFdTemplateNonPrompt->SetMinimum(0); @@ -580,7 +579,7 @@ Bool_t DhCorrelationExtraction::extractCorrelations(Double_t ptCandMin, Double_t h1DFdTemplateNonPrompt->Draw(); h1DFdTemplatePrompt->Draw("same"); h1DTemplateTotal->Draw("same"); - TLegend* lFD = new TLegend(); + auto* lFD = new TLegend(); lFD->AddEntry(h1DTemplateTotal, "Total template"); lFD->AddEntry(h1DFdTemplatePrompt, "Prompt Template"); lFD->AddEntry(h1DFdTemplateNonPrompt, "Non prompt template"); @@ -620,7 +619,7 @@ Bool_t DhCorrelationExtraction::extractCorrelations(Double_t ptCandMin, Double_t h1DSubtrFdNorm->Scale(1. / fdPromptFrac); if (fDebug >= 1) { - TCanvas* c1 = new TCanvas(Form("cFDTemplateSubtr_%1.1fto%1.1f", ptHadMin, ptHadMax), Form("cFDTemplateSubtr_%s_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax), 100, 100, 1600, 900); + auto* c1 = new TCanvas(Form("cFDTemplateSubtr_%1.1fto%1.1f", ptHadMin, ptHadMax), Form("cFDTemplateSubtr_%s_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax), 100, 100, 1600, 900); c1->cd(); h1DSubtrNorm->SetLineColor(kRed); h1DSubtrNormSecPart->SetLineColor(kOrange); @@ -670,7 +669,7 @@ Bool_t DhCorrelationExtraction::extractCorrelations(Double_t ptCandMin, Double_t std::cout << "Analysis steps completed - baseline subtraction missing" << std::endl; // Draw 1D plots (Signal region, normalized) - TCanvas* cFinal = new TCanvas(Form("cFinal_%.0fto%.0f", ptHadMin, ptHadMax), Form("cFinal_%s_IntPools_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), ptHadMin, ptHadMax), 100, 100, 1200, 700); + auto* cFinal = new TCanvas(Form("cFinal_%.0fto%.0f", ptHadMin, ptHadMax), Form("cFinal_%s_IntPools_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), ptHadMin, ptHadMax), 100, 100, 1200, 700); h1DSubtrNorm->SetLineColor(kBlue + 1); h1DSubtrNorm->SetMarkerColor(kBlue + 1); h1DSubtrNorm->SetMarkerStyle(kFullCircle); @@ -691,7 +690,7 @@ Bool_t DhCorrelationExtraction::extractCorrelations(Double_t ptCandMin, Double_t if (fFDsubtraction) { h1DTemplateTotal->Draw("same"); } - TLegend* lFinal = new TLegend(); + auto* lFinal = new TLegend(); lFinal->AddEntry(h1DSubtrNorm, "Corr. after bkg subtr."); if (fFDsubtraction) { lFinal->AddEntry(h1DTemplateTotal, "CR Mode 2 total template"); @@ -741,7 +740,7 @@ Bool_t DhCorrelationExtraction::extractCorrelations(Double_t ptCandMin, Double_t fCorrectedCorrHistoBaselineSubtr = reinterpret_cast(h1DBaselineSubtr->Clone(Form("hCorrectedCorrBaselineSubtr_PtCand%.0fto%.0f_PtAssoc%.0fto%.0f", ptCandMin, ptCandMax, ptHadMin, ptHadMax))); - TCanvas* cFinalBaselineSubtr = new TCanvas(Form("cFinal_BaselineSubtr_%.0fto%.0f", ptHadMin, ptHadMax), Form("cFinal_BaselineSubtr_%s_IntPools_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), ptHadMin, ptHadMax), 100, 100, 1200, 700); + auto* cFinalBaselineSubtr = new TCanvas(Form("cFinal_BaselineSubtr_%.0fto%.0f", ptHadMin, ptHadMax), Form("cFinal_BaselineSubtr_%s_IntPools_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), ptHadMin, ptHadMax), 100, 100, 1200, 700); h1DBaselineSubtr->SetMarkerColor(kOrange + 8); h1DBaselineSubtr->SetLineColor(kOrange + 8); h1DBaselineSubtr->GetYaxis()->SetRangeUser(-0.2, 8.); @@ -779,7 +778,7 @@ Bool_t DhCorrelationExtraction::extractCorrelations(Double_t ptCandMin, Double_t h1D_ReflCorr = ReflectHistoRun2(h1D_SubtrNorm, 0.5); }*/ - TCanvas* cFinalReflected = new TCanvas(Form("cFinal_Reflected_%.0fto%.0f", ptHadMin, ptHadMax), Form("cFinal_Reflected_%s_IntPools_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), ptHadMin, ptHadMax), 100, 100, 1200, 700); + auto* cFinalReflected = new TCanvas(Form("cFinal_Reflected_%.0fto%.0f", ptHadMin, ptHadMax), Form("cFinal_Reflected_%s_IntPools_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), ptHadMin, ptHadMax), 100, 100, 1200, 700); cFinalReflected->cd(); setTH1HistoStyle(h1DReflCorr, Form("%.0f < p_{T} < %.0f GeV/c", ptCandMin, ptCandMax), "#Delta#phi [rad]", "#frac{1}{N_{D}}#frac{dN^{assoc}}{d#Delta#phi} [rad^{-1}]", kFullCircle, kOrange + 8, 1.6, kOrange + 8, 3); h1DReflCorr->SetMinimum(0); @@ -808,7 +807,7 @@ Bool_t DhCorrelationExtraction::extractCorrelations(Double_t ptCandMin, Double_t fConstZero->SetLineWidth(4); fConstZero->SetTitle(""); - TCanvas* cFinalReflectedBaselineSubtr = new TCanvas(Form("cFinal_Reflected_BaselineSubtr_%.0fto%.0f", ptHadMin, ptHadMax), Form("cFinal_Reflected_BaselineSubtr_%s_IntPools_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), ptHadMin, ptHadMax), 100, 100, 1200, 700); + auto* cFinalReflectedBaselineSubtr = new TCanvas(Form("cFinal_Reflected_BaselineSubtr_%.0fto%.0f", ptHadMin, ptHadMax), Form("cFinal_Reflected_BaselineSubtr_%s_IntPools_PtAssoc%.0fto%.0f", fDmesonLabel.Data(), ptHadMin, ptHadMax), 100, 100, 1200, 700); setTH1HistoStyle(h1DReflCorrBaselineSubtr, Form("%.0f < p_{T} < %.0f GeV/c", ptCandMin, ptCandMax), "#Delta#phi [rad]", "#frac{1}{N_{D}}#frac{dN^{assoc}}{d#Delta#phi} [rad^{-1}]", kFullCircle, kRed + 1, 1.6, kRed + 1, 3); hBaselineRefl->SetMarkerColor(kOrange); hBaselineRefl->SetMarkerStyle(kFullSquare); @@ -977,7 +976,7 @@ TH1D* DhCorrelationExtraction::evaluateMcClosModulations(Double_t ptCandMin, Dou hRatioNonPrompt->Fit(funFit, "R"); Double_t fitVal = funFit->GetParameter(0); - TCanvas* cRatioMcClosure = new TCanvas(Form("cRatio_MCClosure_PtCand%.0fto%.0f_Pthad%.0fto%.0f", ptCandMin, ptCandMax, ptHadMin, ptHadMax), Form("cRatio_MCClosure_PtCand%.0fto%.0f_Pthad%.0fto%.0f", ptCandMin, ptCandMax, ptHadMin, ptHadMax), 100, 100, 1200, 700); + auto* cRatioMcClosure = new TCanvas(Form("cRatio_MCClosure_PtCand%.0fto%.0f_Pthad%.0fto%.0f", ptCandMin, ptCandMax, ptHadMin, ptHadMax), Form("cRatio_MCClosure_PtCand%.0fto%.0f_Pthad%.0fto%.0f", ptCandMin, ptCandMax, ptHadMin, ptHadMax), 100, 100, 1200, 700); cRatioMcClosure->cd(); hRatioNonPrompt->GetYaxis()->SetRangeUser(0.2, 1.8); hRatioNonPrompt->Draw(); @@ -1017,7 +1016,7 @@ TH2D* DhCorrelationExtraction::getCorrelHisto(Int_t sEorMe, Int_t sorSb, Int_t p // TODO: Subtraction of softpion TH2D* h2D = new TH2D(); // pointer to be returned - THnSparseD* hSparse = 0x0; + THnSparseD* hSparse = nullptr; if (sEorMe == kSE) { // Same Event if (sorSb == kSign) { hSparse = reinterpret_cast(fDirSE->Get(fSECorrelSignalRegionName.Data())); @@ -1031,7 +1030,7 @@ TH2D* DhCorrelationExtraction::getCorrelHisto(Int_t sEorMe, Int_t sorSb, Int_t p } else if (fUseSidebLeft && fUseSidebRight) { hSparse = reinterpret_cast(fDirSE->Get(fSECorrelSidebandLeftName.Data())); hSparse->SetName("hSparse"); - THnSparseD* hSparseRightSideb = reinterpret_cast(fDirSE->Get(fSECorrelSidebandRightName.Data())); + auto* hSparseRightSideb = reinterpret_cast(fDirSE->Get(fSECorrelSidebandRightName.Data())); hSparse->Add(hSparseRightSideb, 1.); } } @@ -1048,7 +1047,7 @@ TH2D* DhCorrelationExtraction::getCorrelHisto(Int_t sEorMe, Int_t sorSb, Int_t p } else if (fUseSidebLeft && fUseSidebRight) { hSparse = reinterpret_cast(fDirME->Get(fMECorrelSidebandLeftName.Data())); hSparse->SetName("hSparse"); - THnSparseD* hSparseRightSideb = reinterpret_cast(fDirME->Get(fMECorrelSidebandRightName.Data())); + auto* hSparseRightSideb = reinterpret_cast(fDirME->Get(fMECorrelSidebandRightName.Data())); hSparse->Add(hSparseRightSideb, 1.); } } @@ -1213,7 +1212,7 @@ TH1D* DhCorrelationExtraction::getCorrelHistoSecondaryPart(Int_t partType, Doubl TH1D* h1D = new TH1D(); // pointer to be returned - THnSparseD* hSparse = 0x0; + THnSparseD* hSparse = nullptr; if (partType == kPrimaryPart) { // primary particles hSparse = reinterpret_cast(fDirSecPart->Get(fHistoPrimaryPartName.Data())); diff --git a/PWGHF/HFC/Macros/DhCorrelationExtraction.h b/PWGHF/HFC/Macros/DhCorrelationExtraction.h index 962dc50ef0d..aa3f2a52874 100644 --- a/PWGHF/HFC/Macros/DhCorrelationExtraction.h +++ b/PWGHF/HFC/Macros/DhCorrelationExtraction.h @@ -48,7 +48,7 @@ class DhCorrelationExtraction : public TObject DhCorrelationExtraction(); // default constructor DhCorrelationExtraction(const DhCorrelationExtraction& source); - virtual ~DhCorrelationExtraction(); + ~DhCorrelationExtraction() override; /// Methods to set the input configuration // Input files, directories and histograms diff --git a/PWGHF/HFC/Macros/DhCorrelationFitter.cxx b/PWGHF/HFC/Macros/DhCorrelationFitter.cxx index a0788b63f15..d95f7ff2eb9 100644 --- a/PWGHF/HFC/Macros/DhCorrelationFitter.cxx +++ b/PWGHF/HFC/Macros/DhCorrelationFitter.cxx @@ -47,24 +47,24 @@ DhCorrelationFitter::DhCorrelationFitter() : // default constructor fMinAssoPt(0.), fMaxAssoPt(99.), fNpars(0), - fExtParsVals(0x0), - fExtParsLowBounds(0x0), - fExtParsUppBounds(0x0), + fExtParsVals(nullptr), + fExtParsLowBounds(nullptr), + fExtParsUppBounds(nullptr), fUseExternalPars(kFALSE), fShiftBaselineUp(kFALSE), fShiftBaselineDown(kFALSE), fIsTotal(kTRUE), fNbasleinePoints(0), - fBinsBaseline(0x0), - fHist(0x0), + fBinsBaseline(nullptr), + fHist(nullptr), fMinCorr(0), fMaxCorr(0), fBaseline(0.), fErrBaseline(0.), - fFit(0x0), - fGausNS(0x0), - fGausAS(0x0), - fPed(0x0), + fFit(nullptr), + fGausNS(nullptr), + fGausAS(nullptr), + fPed(nullptr), fv2AssocPart(0.), fv2Dmeson(0.), fNSyieldBinCount(0.), @@ -84,25 +84,25 @@ DhCorrelationFitter::DhCorrelationFitter(TH1F* histoToFit, Double_t min, Double_ fMinAssoPt(0.), fMaxAssoPt(99.), fNpars(0), - fExtParsVals(0x0), - fExtParsLowBounds(0x0), - fExtParsUppBounds(0x0), + fExtParsVals(nullptr), + fExtParsLowBounds(nullptr), + fExtParsUppBounds(nullptr), fUseExternalPars(kFALSE), fShiftBaselineUp(kFALSE), fShiftBaselineDown(kFALSE), fIsTotal(kTRUE), fNbasleinePoints(0), - fBinsBaseline(0x0), - fHist(0x0), + fBinsBaseline(nullptr), + fHist(nullptr), fMinCorr(0.), fMaxCorr(0.), fBaseline(0.), fErrBaseline(0.), - fFit(0x0), - fGausNS(0x0), - fGausAS(0x0), - fPed(0x0), - fBaseTransvReg(0x0), + fFit(nullptr), + fGausNS(nullptr), + fGausAS(nullptr), + fPed(nullptr), + fBaseTransvReg(nullptr), fv2AssocPart(0.), fv2Dmeson(0.), fNSyieldBinCount(0.), @@ -115,43 +115,9 @@ DhCorrelationFitter::DhCorrelationFitter(TH1F* histoToFit, Double_t min, Double_ fMaxCorr = max; } -DhCorrelationFitter::DhCorrelationFitter(const DhCorrelationFitter& source) : // copy constructor - fIsReflected(source.fIsReflected), - fTypeOfFitFunc(source.fTypeOfFitFunc), - fFixBase(source.fFixBase), - fFixMean(source.fFixMean), - fMinCandPt(source.fMinCandPt), - fMaxCandPt(source.fMaxCandPt), - fMinAssoPt(source.fMinAssoPt), - fMaxAssoPt(source.fMaxAssoPt), - fNpars(source.fNpars), - fExtParsVals(source.fExtParsVals), - fExtParsLowBounds(source.fExtParsLowBounds), - fExtParsUppBounds(source.fExtParsUppBounds), - fUseExternalPars(source.fUseExternalPars), - fShiftBaselineUp(source.fShiftBaselineUp), - fShiftBaselineDown(source.fShiftBaselineDown), - fIsTotal(source.fIsTotal), - fNbasleinePoints(source.fNbasleinePoints), - fBinsBaseline(source.fBinsBaseline), - fHist(source.fHist), - fMinCorr(source.fMinCorr), - fMaxCorr(source.fMaxCorr), - fBaseline(source.fBaseline), - fErrBaseline(source.fErrBaseline), - fFit(source.fFit), - fGausNS(source.fGausNS), - fGausAS(source.fGausAS), - fPed(source.fPed), - fBaseTransvReg(source.fBaseTransvReg), - fv2AssocPart(source.fv2AssocPart), - fv2Dmeson(source.fv2Dmeson), - fNSyieldBinCount(source.fNSyieldBinCount), - fErrNSyieldBinCount(source.fErrNSyieldBinCount), - fASyieldBinCount(source.fASyieldBinCount), - fErrASyieldBinCount(source.fErrASyieldBinCount) -{ -} +DhCorrelationFitter::DhCorrelationFitter(const DhCorrelationFitter& source) + + = default; DhCorrelationFitter::~DhCorrelationFitter() // destructor @@ -160,20 +126,20 @@ DhCorrelationFitter::~DhCorrelationFitter() if (fHist != nullptr) { delete fHist; - fHist = 0; + fHist = nullptr; } if (fFit != nullptr) { delete fFit; - fFit = 0; + fFit = nullptr; } if (fGausNS != nullptr) { delete fGausNS; - fGausNS = 0; + fGausNS = nullptr; } // if (fGausNS2) {delete fGausNS2; fGausNS2 = 0;} if (fPed != nullptr) { delete fPed; - fPed = 0; + fPed = nullptr; } } @@ -649,8 +615,8 @@ Double_t DhCorrelationFitter::findBaseline() // fix the baseline to the weighted average of the abs(fFixBaseline) lower points if (fFixBase < 0) { Int_t npointsAv = TMath::Abs(fFixBase); - Int_t* ind = new Int_t[fHist->GetNbinsX()]; - Float_t* hval = new Float_t[fHist->GetNbinsX()]; + auto* ind = new Int_t[fHist->GetNbinsX()]; + auto* hval = new Float_t[fHist->GetNbinsX()]; for (Int_t k = 1; k <= fHist->GetNbinsX(); k++) { hval[k - 1] = fHist->GetBinContent(k); } @@ -955,7 +921,7 @@ Double_t DhCorrelationFitter::calculateBaselineError(TH1F*& histo, Bool_t totalR void DhCorrelationFitter::setSingleTermsForDrawing(Bool_t draw) { - Double_t* par = 0; + Double_t* par = nullptr; if (fTypeOfFitFunc == 1 || fTypeOfFitFunc == 2 || fTypeOfFitFunc == 5) { par = new Double_t[7]; } else if (fTypeOfFitFunc == 3 || fTypeOfFitFunc == 6) { @@ -986,7 +952,7 @@ void DhCorrelationFitter::setSingleTermsForDrawing(Bool_t draw) fGausAS->SetLineColor(kGreen); fGausAS->SetLineWidth(4); - TPaveText* pvStatTests1 = new TPaveText(0.51, 0.58, 0.85, 0.90, "NDC"); + auto* pvStatTests1 = new TPaveText(0.51, 0.58, 0.85, 0.90, "NDC"); pvStatTests1->SetFillStyle(0); pvStatTests1->SetTextSize(0.045); pvStatTests1->SetBorderSize(0); @@ -1026,7 +992,7 @@ void DhCorrelationFitter::setSingleTermsForDrawing(Bool_t draw) fGausNS->SetLineWidth(4); fGausAS->SetLineWidth(4); - TPaveText* pvStatTests1 = new TPaveText(0.51, 0.58, 0.85, 0.90, "NDC"); + auto* pvStatTests1 = new TPaveText(0.51, 0.58, 0.85, 0.90, "NDC"); pvStatTests1->SetFillStyle(0); pvStatTests1->SetTextSize(0.045); pvStatTests1->SetBorderSize(0); @@ -1076,7 +1042,7 @@ void DhCorrelationFitter::setSingleTermsForDrawing(Bool_t draw) fGausNS->SetLineWidth(4); fGausAS->SetLineWidth(4); - TPaveText* pvStatTests1 = new TPaveText(0.51, 0.58, 0.85, 0.90, "NDC"); + auto* pvStatTests1 = new TPaveText(0.51, 0.58, 0.85, 0.90, "NDC"); pvStatTests1->SetFillStyle(0); pvStatTests1->SetTextSize(0.045); pvStatTests1->SetBorderSize(0); @@ -1088,7 +1054,7 @@ void DhCorrelationFitter::setSingleTermsForDrawing(Bool_t draw) t5 = pvStatTests1->AddText(0., 0.35, Form("AS #sigma = %.3f#pm%.3f ", fFit->GetParameter("AS #sigma"), fFit->GetParError(fFit->GetParNumber("AS #sigma")))); // t6 = pvStatTests1 -> AddText(0., 0.20, Form("#beta = %.3f#pm%.3f ", fFit -> GetParameter("NS shape par"), fFit -> GetParError(fFit->GetParNumber("NS shape par")))); - TPaveText* pvStatTests2 = new TPaveText(0.51, 0.28, 0.85, 0.60, "NDC"); + auto* pvStatTests2 = new TPaveText(0.51, 0.28, 0.85, 0.60, "NDC"); pvStatTests2->SetFillStyle(0); pvStatTests2->SetTextSize(0.045); pvStatTests2->SetBorderSize(0); @@ -1128,7 +1094,7 @@ void DhCorrelationFitter::setSingleTermsForDrawing(Bool_t draw) fGausNS->SetLineWidth(4); fGausAS->SetLineWidth(4); - TPaveText* pvStatTests1 = new TPaveText(0.51, 0.58, 0.85, 0.90, "NDC"); + auto* pvStatTests1 = new TPaveText(0.51, 0.58, 0.85, 0.90, "NDC"); pvStatTests1->SetFillStyle(0); pvStatTests1->SetTextSize(0.045); pvStatTests1->SetBorderSize(0); diff --git a/PWGHF/HFC/Macros/DhCorrelationFitter.h b/PWGHF/HFC/Macros/DhCorrelationFitter.h index 33ae6b4929d..692ff6a0ad5 100644 --- a/PWGHF/HFC/Macros/DhCorrelationFitter.h +++ b/PWGHF/HFC/Macros/DhCorrelationFitter.h @@ -85,7 +85,7 @@ class DhCorrelationFitter Double_t getNsYield() { return fFit->GetParameter("NS Y"); } Double_t getAsYield() { return fFit->GetParameter("AS Y"); } Double_t getBeta() { return fFit->GetParameter(7); } - Double_t getPedestal() const { return fBaseline; } + [[nodiscard]] Double_t getPedestal() const { return fBaseline; } Double_t getv2hadron() { return fFit->GetParameter("v_{2} hadron"); } Double_t getv2Dmeson() { return fFit->GetParameter("v_{2} D meson"); } Double_t getNsSigmaError() { return fFit->GetParError(fFit->GetParNumber("NS #sigma")); } // TODO: case kConstThreeGausPeriodicity @@ -93,18 +93,18 @@ class DhCorrelationFitter Double_t getNsYieldError() { return fFit->GetParError(fFit->GetParNumber("NS Y")); } Double_t getAsYieldError() { return fFit->GetParError(fFit->GetParNumber("AS Y")); } Double_t getBetaError() { return fFit->GetParError(7); } - Double_t getPedestalError() const { return fErrBaseline; } + [[nodiscard]] Double_t getPedestalError() const { return fErrBaseline; } Double_t getv2hadronError() { return fFit->GetParError(fFit->GetParNumber("v_{2} hadron")); } Double_t getv2DmesonError() { return fFit->GetParError(fFit->GetParNumber("v_{2} D meson")); } - Double_t getBinCountingNsYield() const { return fNSyieldBinCount; } - Double_t getBinCountingAsYield() const { return fASyieldBinCount; } - Double_t getBinCountingNsYieldErr() const { return fErrNSyieldBinCount; } - Double_t getBinCountingAsYieldErr() const { return fErrASyieldBinCount; } + [[nodiscard]] Double_t getBinCountingNsYield() const { return fNSyieldBinCount; } + [[nodiscard]] Double_t getBinCountingAsYield() const { return fASyieldBinCount; } + [[nodiscard]] Double_t getBinCountingNsYieldErr() const { return fErrNSyieldBinCount; } + [[nodiscard]] Double_t getBinCountingAsYieldErr() const { return fErrASyieldBinCount; } TF1* getFitFunction() { if (fFit == nullptr) { printf("[ERROR] DhCorrelationFitter::GetFitFunction, No fit function"); - return NULL; + return nullptr; } return fFit; } diff --git a/PWGHF/HFC/Macros/ExtractOutputCorrel.C b/PWGHF/HFC/Macros/ExtractOutputCorrel.C index c7235974633..c6213349b11 100644 --- a/PWGHF/HFC/Macros/ExtractOutputCorrel.C +++ b/PWGHF/HFC/Macros/ExtractOutputCorrel.C @@ -166,7 +166,7 @@ void extractOutputCorrelDs(const TString cfgFileName = "config_CorrAnalysis.json TH1D* hCorrectedCorrelReflectedBaselineSubtr[nBinsPtCand][nBinsPtHad]; // Create and set the correlation plotter class - DhCorrelationExtraction* plotter = new DhCorrelationExtraction(); + auto* plotter = new DhCorrelationExtraction(); Bool_t flagSpecie = plotter->setDmesonSpecie(static_cast(specie)); plotter->setNpools(npools); @@ -232,7 +232,7 @@ void extractOutputCorrelDs(const TString cfgFileName = "config_CorrAnalysis.json } // output file - TFile* outFile = new TFile(Form("Output_CorrelationExtraction_%s_Root/ExtractCorrelationsResults.root", codeNameAnalysis.data()), "RECREATE"); + auto* outFile = new TFile(Form("Output_CorrelationExtraction_%s_Root/ExtractCorrelationsResults.root", codeNameAnalysis.data()), "RECREATE"); outFile->cd(); for (int iBinPtCand = 0; iBinPtCand < nBinsPtCand; iBinPtCand++) { for (int iBinPtHad = 0; iBinPtHad < nBinsPtHad; iBinPtHad++) { @@ -242,7 +242,7 @@ void extractOutputCorrelDs(const TString cfgFileName = "config_CorrAnalysis.json outFile->Close(); // output file baseline subtr. - TFile* outFileBaselineSubtr = new TFile(Form("Output_CorrelationExtraction_%s_Root/ExtractCorrelationsResults_BaselineSubtr.root", codeNameAnalysis.data()), "RECREATE"); + auto* outFileBaselineSubtr = new TFile(Form("Output_CorrelationExtraction_%s_Root/ExtractCorrelationsResults_BaselineSubtr.root", codeNameAnalysis.data()), "RECREATE"); outFileBaselineSubtr->cd(); for (int iBinPtCand = 0; iBinPtCand < nBinsPtCand; iBinPtCand++) { for (int iBinPtHad = 0; iBinPtHad < nBinsPtHad; iBinPtHad++) { @@ -252,7 +252,7 @@ void extractOutputCorrelDs(const TString cfgFileName = "config_CorrAnalysis.json outFileBaselineSubtr->Close(); // output file reflected - TFile* outFileReflected = new TFile(Form("Output_CorrelationExtraction_%s_Root/ExtractCorrelationsResults_Reflected.root", codeNameAnalysis.data()), "RECREATE"); + auto* outFileReflected = new TFile(Form("Output_CorrelationExtraction_%s_Root/ExtractCorrelationsResults_Reflected.root", codeNameAnalysis.data()), "RECREATE"); outFileReflected->cd(); for (int iBinPtCand = 0; iBinPtCand < nBinsPtCand; iBinPtCand++) { for (int iBinPtHad = 0; iBinPtHad < nBinsPtHad; iBinPtHad++) { @@ -262,7 +262,7 @@ void extractOutputCorrelDs(const TString cfgFileName = "config_CorrAnalysis.json outFileReflected->Close(); // output file reflected baseline subtr. - TFile* outFileReflectedBaselineSubtr = new TFile(Form("Output_CorrelationExtraction_%s_Root/ExtractCorrelationsResults_Reflected_BaselineSubtr.root", codeNameAnalysis.data()), "RECREATE"); + auto* outFileReflectedBaselineSubtr = new TFile(Form("Output_CorrelationExtraction_%s_Root/ExtractCorrelationsResults_Reflected_BaselineSubtr.root", codeNameAnalysis.data()), "RECREATE"); outFileReflectedBaselineSubtr->cd(); for (int iBinPtCand = 0; iBinPtCand < nBinsPtCand; iBinPtCand++) { for (int iBinPtHad = 0; iBinPtHad < nBinsPtHad; iBinPtHad++) { diff --git a/PWGHF/HFC/Macros/FitCorrel.C b/PWGHF/HFC/Macros/FitCorrel.C index b93d958aec2..3b921024a6a 100644 --- a/PWGHF/HFC/Macros/FitCorrel.C +++ b/PWGHF/HFC/Macros/FitCorrel.C @@ -144,9 +144,9 @@ void fitCorrelDs(const TString cfgFileName = "config_CorrAnalysis.json") bool refl = false; // Input file - TFile* inFile = new TFile(inFileName.Data()); - TFile* inFileSystematicErrors = new TFile("OutputSystematicUncertainties/SystematicUncertaintesAngCorrMerged.root"); - TFile* inFileFitSystematicErrors = new TFile("OutputSystematicUncertainties/SystematicUncertaintesFitPhysObsMerged.root"); + auto* inFile = new TFile(inFileName.Data()); + auto* inFileSystematicErrors = new TFile("OutputSystematicUncertainties/SystematicUncertaintesAngCorrMerged.root"); + auto* inFileFitSystematicErrors = new TFile("OutputSystematicUncertainties/SystematicUncertaintesFitPhysObsMerged.root"); // Canvas TCanvas* canvasCorrPhi[nBinsPtHad]; @@ -265,7 +265,7 @@ void fitCorrelDs(const TString cfgFileName = "config_CorrAnalysis.json") TF1* fFit = corrFitter[iBinPtHad][iBinPtCand]->getFitFunction(); // Title of the histogram - TPaveText* pttext = new TPaveText(0.15, 0.9, 0.85, 0.95, "NDC"); + auto* pttext = new TPaveText(0.15, 0.9, 0.85, 0.95, "NDC"); pttext->SetFillStyle(0); pttext->SetBorderSize(0); TText* tpT = pttext->AddText(0., 0.8, Form("%.0f < p_{T}^{D_{s}} < %.0f GeV/c, p_{T}^{assoc} > %.1f GeV/c", binsPtCandIntervals[iBinPtCand], binsPtCandIntervals[iBinPtCand + 1], binsPtHadIntervals[iBinPtHad])); @@ -318,7 +318,7 @@ void fitCorrelDs(const TString cfgFileName = "config_CorrAnalysis.json") } // Draw - TPaveText* tCorrUncDs = new TPaveText(0.413, 0.311, 0.877, 0.392, "NDC"); + auto* tCorrUncDs = new TPaveText(0.413, 0.311, 0.877, 0.392, "NDC"); tCorrUncDs->SetFillStyle(0); tCorrUncDs->SetBorderSize(0); tCorrUncDs->SetTextSize(0.05); @@ -327,7 +327,7 @@ void fitCorrelDs(const TString cfgFileName = "config_CorrAnalysis.json") tCorrUncDs->SetTextColor(kRed + 1); tCorrUncDs->AddText(0., 0., Form("#splitline{+%.0f%%}{#minus%.0f%%}", systUncCorrelatedDs[iBinPtCand], systUncCorrelatedDs[iBinPtCand])); - TPaveText* tScaleUnc = new TPaveText(0.501, 0.292, 0.968, 0.372, "NDC"); + auto* tScaleUnc = new TPaveText(0.501, 0.292, 0.968, 0.372, "NDC"); tScaleUnc->SetFillStyle(0); tScaleUnc->SetBorderSize(0); tScaleUnc->SetTextSize(0.05); @@ -353,7 +353,7 @@ void fitCorrelDs(const TString cfgFileName = "config_CorrAnalysis.json") } // histogram with fit parameter and errors - TFile* outFile = new TFile(Form("Output_CorrelationFitting_%s_Root/CorrPhiDs_FinalPlots.root", codeNameAnalysis.data()), "RECREATE"); + auto* outFile = new TFile(Form("Output_CorrelationFitting_%s_Root/CorrPhiDs_FinalPlots.root", codeNameAnalysis.data()), "RECREATE"); outFile->cd(); for (int iBinPtHad = 0; iBinPtHad < nBinsPtHad; iBinPtHad++) { hBaselin[iBinPtHad]->Write(); @@ -369,11 +369,11 @@ void fitCorrelDs(const TString cfgFileName = "config_CorrAnalysis.json") // Draw plots for (int iBinPtHad = 0; iBinPtHad < nBinsPtHad; iBinPtHad++) { - TCanvas* c1 = new TCanvas(Form("NS_yield_PtAssoc%d", iBinPtHad + 1), Form("NS_yield_PtAssoc%d", iBinPtHad + 1)); - TCanvas* c2 = new TCanvas(Form("AS_yield_PtAssoc%d", iBinPtHad + 1), Form("AS_yield_PtAssoc%d", iBinPtHad + 1)); - TCanvas* c3 = new TCanvas(Form("NS_sigma_PtAssoc%d", iBinPtHad + 1), Form("AS_sigma_PtAssoc%d", iBinPtHad + 1)); - TCanvas* c4 = new TCanvas(Form("AS_sigma_PtAssoc%d", iBinPtHad + 1), Form("AS_sigma_PtAssoc%d", iBinPtHad + 1)); - TCanvas* c5 = new TCanvas(Form("Baseline_PtAssoc%d", iBinPtHad + 1), Form("Baseline_PtAssoc%d", iBinPtHad + 1)); + auto* c1 = new TCanvas(Form("NS_yield_PtAssoc%d", iBinPtHad + 1), Form("NS_yield_PtAssoc%d", iBinPtHad + 1)); + auto* c2 = new TCanvas(Form("AS_yield_PtAssoc%d", iBinPtHad + 1), Form("AS_yield_PtAssoc%d", iBinPtHad + 1)); + auto* c3 = new TCanvas(Form("NS_sigma_PtAssoc%d", iBinPtHad + 1), Form("AS_sigma_PtAssoc%d", iBinPtHad + 1)); + auto* c4 = new TCanvas(Form("AS_sigma_PtAssoc%d", iBinPtHad + 1), Form("AS_sigma_PtAssoc%d", iBinPtHad + 1)); + auto* c5 = new TCanvas(Form("Baseline_PtAssoc%d", iBinPtHad + 1), Form("Baseline_PtAssoc%d", iBinPtHad + 1)); setTH1HistoStyle(hBaselin[iBinPtHad], Form("p_{T}^{assoc} > %.1f GeV/c", binsPtHadIntervals[iBinPtHad]), "p_{T} (GeV/c)", "Baseline", kFullSquare, kBlue, 1.8, kBlue, 2); setTH1HistoStyle(hNSYield[iBinPtHad], Form("p_{T}^{assoc} > %.1f GeV/c", binsPtHadIntervals[iBinPtHad]), "p_{T} (GeV/c)", "Y^{NS}", kFullSquare, kRed, 1.8, kRed, 2); setTH1HistoStyle(hASYield[iBinPtHad], Form("p_{T}^{assoc} > %.1f GeV/c", binsPtHadIntervals[iBinPtHad]), "p_{T} (GeV/c)", "Y^{AS}", kFullSquare, kMagenta, 1.8, kMagenta, 2); From d336e35ae74b1019103b10085b9686e7a483a22c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Tue, 30 Sep 2025 18:50:57 +0200 Subject: [PATCH 19/25] Fix misc --- PWGHF/D2H/Tasks/taskCharmPolarisation.cxx | 4 ++-- PWGHF/HFC/Macros/DhCorrelationExtraction.cxx | 2 +- PWGHF/HFC/Macros/ExtractOutputCorrel.C | 2 +- PWGHF/HFC/Tasks/taskCorrelationDsHadrons.cxx | 5 ++++- PWGHF/TableProducer/treeCreatorDsToKKPi.cxx | 7 +++++-- PWGHF/TableProducer/treeCreatorLcToK0sP.cxx | 1 - PWGHF/Utils/utilsAnalysis.h | 2 +- PWGHF/Utils/utilsTrkCandHf.h | 2 +- 8 files changed, 15 insertions(+), 10 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx b/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx index 09e6bef4e8a..32f43aa5612 100644 --- a/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx +++ b/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx @@ -1538,7 +1538,7 @@ struct HfTaskCharmPolarisation { ptBhadMother = candidate.ptBhadMotherPart(); int pdgBhadMother = candidate.pdgBhadMotherPart(); // For unknown reasons there are charm hadrons coming directly from beauty diquarks without an intermediate B-hadron which have an unreasonable correlation between the pT of the charm hadron and the beauty mother. We also remove charm hadrons from quarkonia. - if (origin == RecoDecay::OriginType::NonPrompt && (pdgBhadMother == 5101 || pdgBhadMother == 5103 || pdgBhadMother == 5201 || pdgBhadMother == 5203 || pdgBhadMother == 5301 || pdgBhadMother == 5303 || pdgBhadMother == 5401 || pdgBhadMother == 5403 || pdgBhadMother == 5503 || pdgBhadMother == 553 || pdgBhadMother == 555 || pdgBhadMother == 553 || pdgBhadMother == 557)) { // o2-linter: disable=pdg/explicit-code, magic-number (constants not in the PDG header) + if (origin == RecoDecay::OriginType::NonPrompt && (pdgBhadMother == 5101 || pdgBhadMother == 5103 || pdgBhadMother == 5201 || pdgBhadMother == 5203 || pdgBhadMother == 5301 || pdgBhadMother == 5303 || pdgBhadMother == 5401 || pdgBhadMother == 5403 || pdgBhadMother == 5503 || pdgBhadMother == 553 || pdgBhadMother == 555 || pdgBhadMother == 557)) { // o2-linter: disable=pdg/explicit-code, magic-number (constants not in the PDG header) return isCandidateInSignalRegion; } } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPKPi) { @@ -2085,7 +2085,7 @@ struct HfTaskCharmPolarisation { auto bHadMother = mcParticles.rawIteratorAt(mcParticle.idxBhadMotherPart() - mcParticles.offset()); int pdgBhadMother = std::abs(bHadMother.pdgCode()); // For unknown reasons there are charm hadrons coming directly from beauty diquarks without an intermediate B-hadron which have an unreasonable correlation between the pT of the charm hadron and the beauty mother. We also remove charm hadrons from quarkonia. - if (pdgBhadMother == 5101 || pdgBhadMother == 5103 || pdgBhadMother == 5201 || pdgBhadMother == 5203 || pdgBhadMother == 5301 || pdgBhadMother == 5303 || pdgBhadMother == 5401 || pdgBhadMother == 5403 || pdgBhadMother == 5503 || pdgBhadMother == 553 || pdgBhadMother == 555 || pdgBhadMother == 553 || pdgBhadMother == 557) { // o2-linter: disable=pdg/explicit-code, magic-number (constants not in the PDG header) + if (pdgBhadMother == 5101 || pdgBhadMother == 5103 || pdgBhadMother == 5201 || pdgBhadMother == 5203 || pdgBhadMother == 5301 || pdgBhadMother == 5303 || pdgBhadMother == 5401 || pdgBhadMother == 5403 || pdgBhadMother == 5503 || pdgBhadMother == 553 || pdgBhadMother == 555 || pdgBhadMother == 557) { // o2-linter: disable=pdg/explicit-code, magic-number (constants not in the PDG header) return; } ptBhadMother = bHadMother.pt(); diff --git a/PWGHF/HFC/Macros/DhCorrelationExtraction.cxx b/PWGHF/HFC/Macros/DhCorrelationExtraction.cxx index d078acc069c..9bc2b4fa788 100644 --- a/PWGHF/HFC/Macros/DhCorrelationExtraction.cxx +++ b/PWGHF/HFC/Macros/DhCorrelationExtraction.cxx @@ -1321,7 +1321,7 @@ TH1D* DhCorrelationExtraction::reflectHistoRun2(TH1D* h, Double_t scale) return h2; } -Double_t DhCorrelationExtraction::getFdPromptFrac(Double_t ptCandMin, Double_t ptCandMax, Double_t ptHadMin, Double_t ptHadMax) +Double_t DhCorrelationExtraction::getFdPromptFrac(Double_t ptCandMin, Double_t ptCandMax, Double_t /*ptHadMin*/, Double_t /*ptHadMax*/) { TH1D* h1D = new TH1D(); diff --git a/PWGHF/HFC/Macros/ExtractOutputCorrel.C b/PWGHF/HFC/Macros/ExtractOutputCorrel.C index c6213349b11..e5082acd3bb 100644 --- a/PWGHF/HFC/Macros/ExtractOutputCorrel.C +++ b/PWGHF/HFC/Macros/ExtractOutputCorrel.C @@ -143,7 +143,7 @@ void extractOutputCorrelDs(const TString cfgFileName = "config_CorrAnalysis.json bool useSidebLeft = config["UseSidebLeft"].GetBool(); bool useSidebRight = config["UseSidebRight"].GetBool(); - if (useSidebLeft && useSidebLeft) { + if (useSidebLeft && useSidebRight) { std::cout << "Using left and right" << std::endl; } diff --git a/PWGHF/HFC/Tasks/taskCorrelationDsHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationDsHadrons.cxx index 470875f1d50..22678cfbdf0 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationDsHadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationDsHadrons.cxx @@ -67,7 +67,10 @@ enum ResonantChannel : int8_t { Kstar0K = 2 }; -static std::unordered_map channelsResonant = {{{ResonantChannel::PhiPi, hf_decay::hf_cand_3prong::DecayChannelResonant::DsToPhiPi}, {ResonantChannel::Kstar0K, hf_decay::hf_cand_3prong::DecayChannelResonant::DsToKstar0K}}}; +namespace +{ +std::unordered_map channelsResonant = {{{ResonantChannel::PhiPi, hf_decay::hf_cand_3prong::DecayChannelResonant::DsToPhiPi}, {ResonantChannel::Kstar0K, hf_decay::hf_cand_3prong::DecayChannelResonant::DsToKstar0K}}}; +} /// Ds-Hadron correlation pair filling task, from pair tables - for real data and data-like analysis (i.e. reco-level w/o matching request via MC truth) struct HfTaskCorrelationDsHadrons { diff --git a/PWGHF/TableProducer/treeCreatorDsToKKPi.cxx b/PWGHF/TableProducer/treeCreatorDsToKKPi.cxx index 837756e42f1..6d2efb46a7e 100644 --- a/PWGHF/TableProducer/treeCreatorDsToKKPi.cxx +++ b/PWGHF/TableProducer/treeCreatorDsToKKPi.cxx @@ -254,8 +254,11 @@ enum ResonantChannel : int8_t { Kstar0K = 2 }; -static std::unordered_map> channelsResonant = {{{Mother::Ds, {{ResonantChannel::PhiPi, hf_decay::hf_cand_3prong::DecayChannelResonant::DsToPhiPi}, {ResonantChannel::Kstar0K, hf_decay::hf_cand_3prong::DecayChannelResonant::DsToKstar0K}}}, - {Mother::Dplus, {{ResonantChannel::PhiPi, hf_decay::hf_cand_3prong::DecayChannelResonant::DplusToPhiPi}, {ResonantChannel::Kstar0K, hf_decay::hf_cand_3prong::DecayChannelResonant::DplusToKstar0K}}}}}; +namespace +{ +std::unordered_map> channelsResonant = {{{Mother::Ds, {{ResonantChannel::PhiPi, hf_decay::hf_cand_3prong::DecayChannelResonant::DsToPhiPi}, {ResonantChannel::Kstar0K, hf_decay::hf_cand_3prong::DecayChannelResonant::DsToKstar0K}}}, + {Mother::Dplus, {{ResonantChannel::PhiPi, hf_decay::hf_cand_3prong::DecayChannelResonant::DplusToPhiPi}, {ResonantChannel::Kstar0K, hf_decay::hf_cand_3prong::DecayChannelResonant::DplusToKstar0K}}}}}; +} /// Writes the full information in an output TTree struct HfTreeCreatorDsToKKPi { diff --git a/PWGHF/TableProducer/treeCreatorLcToK0sP.cxx b/PWGHF/TableProducer/treeCreatorLcToK0sP.cxx index 8cc336acddb..51b959f799a 100644 --- a/PWGHF/TableProducer/treeCreatorLcToK0sP.cxx +++ b/PWGHF/TableProducer/treeCreatorLcToK0sP.cxx @@ -41,7 +41,6 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -using std::array; namespace o2::aod { diff --git a/PWGHF/Utils/utilsAnalysis.h b/PWGHF/Utils/utilsAnalysis.h index d5879647f94..dfc4ef46fdd 100644 --- a/PWGHF/Utils/utilsAnalysis.h +++ b/PWGHF/Utils/utilsAnalysis.h @@ -37,7 +37,7 @@ enum BHadMothers { NotMatched = 0, /// Convert the B hadron mother PDG for non prompt candidates to a flag /// \param flagBHad pdg of the b hadron mother /// \return integer map to specific mothers' PDG codes -BHadMothers getBHadMotherFlag(const int flagBHad) +inline BHadMothers getBHadMotherFlag(const int flagBHad) { if (std::abs(flagBHad) == o2::constants::physics::kBPlus) { return BHadMothers::BPlus; diff --git a/PWGHF/Utils/utilsTrkCandHf.h b/PWGHF/Utils/utilsTrkCandHf.h index 55e1ecc8857..20167cb82eb 100644 --- a/PWGHF/Utils/utilsTrkCandHf.h +++ b/PWGHF/Utils/utilsTrkCandHf.h @@ -50,7 +50,7 @@ void setLabelHistoCands(THisto& hCandidates) /// \brief Function to evaluate number of ones in a binary representation of the argument /// \param num is the input argument -int countOnesInBinary(const uint8_t num) +inline int countOnesInBinary(const uint8_t num) { int count{0}; constexpr std::size_t NBits{8u}; From 4be695af496ebe602fd965a4e5e5529bfd204840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Tue, 30 Sep 2025 19:12:47 +0200 Subject: [PATCH 20/25] Fix includes --- PWGHF/Core/CentralityEstimation.h | 2 + PWGHF/Core/HfMlResponseBplusToD0Pi.h | 11 ++-- PWGHF/Core/HfMlResponseBplusToJpsiKReduced.h | 9 +-- PWGHF/Core/HfMlResponseBsToJpsiPhiReduced.h | 9 +-- PWGHF/D2H/DataModel/ReducedDataModel.h | 13 ++-- PWGHF/D2H/Macros/HFInvMassFitter.cxx | 1 - PWGHF/D2H/Macros/runMassFitter.C | 13 +++- .../candidateCreatorCharmResoReduced.cxx | 3 +- .../dataCreatorCharmHadPiReduced.cxx | 2 - .../dataCreatorCharmResoReduced.cxx | 1 + PWGHF/D2H/Tasks/taskCharmResoToDV0Reduced.cxx | 2 + PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx | 2 + PWGHF/D2H/Tasks/taskLc.cxx | 1 + PWGHF/D2H/Utils/utilsSigmac.h | 2 + PWGHF/HFC/Macros/DhCorrelationExtraction.cxx | 5 ++ PWGHF/HFC/Macros/ExtractOutputCorrel.C | 4 +- PWGHF/HFC/Macros/FitCorrel.C | 8 ++- .../HFC/TableProducer/correlatorDsHadrons.cxx | 3 + .../correlatorFlowCharmHadronsReduced.cxx | 14 ++-- .../TableProducer/correlatorLcScHadrons.cxx | 1 + .../derivedDataCreatorCorrelationsReduced.cxx | 13 ++-- .../HFC/Tasks/taskCharmHadronsFemtoDream.cxx | 2 - PWGHF/HFC/Tasks/taskCorrelationDsHadrons.cxx | 2 + PWGHF/HFC/Tasks/taskFlow.cxx | 64 +++++++++++-------- PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx | 1 - PWGHF/HFL/Tasks/taskSingleElectron.cxx | 16 ++++- PWGHF/TableProducer/candidateCreatorLb.cxx | 1 - .../candidateCreatorXicToXiPiPi.cxx | 1 - PWGHF/TableProducer/mcPidTof.cxx | 1 + PWGHF/TableProducer/trackIndexSkimCreator.cxx | 3 +- PWGHF/TableProducer/treeCreatorLcToK0sP.cxx | 1 + .../treeCreatorSigmacCorrBkg.cxx | 11 +++- .../TableProducer/treeCreatorTccToD0D0Pi.cxx | 1 - 33 files changed, 141 insertions(+), 82 deletions(-) diff --git a/PWGHF/Core/CentralityEstimation.h b/PWGHF/Core/CentralityEstimation.h index 4382213dbe0..71cdc0ebffd 100644 --- a/PWGHF/Core/CentralityEstimation.h +++ b/PWGHF/Core/CentralityEstimation.h @@ -18,6 +18,8 @@ #include +#include + namespace o2::hf_centrality { // centrality selection estimators diff --git a/PWGHF/Core/HfMlResponseBplusToD0Pi.h b/PWGHF/Core/HfMlResponseBplusToD0Pi.h index 427e90fd16d..aa38b0e927a 100644 --- a/PWGHF/Core/HfMlResponseBplusToD0Pi.h +++ b/PWGHF/Core/HfMlResponseBplusToD0Pi.h @@ -21,16 +21,17 @@ #include "Tools/ML/MlResponse.h" +#include + #include #include // Fill the map of available input features // the key is the feature's name (std::string) // the value is the corresponding value in EnumInputFeatures -#define FILL_MAP_BPLUS(FEATURE) \ - { \ - #FEATURE, static_cast(InputFeaturesBplusToD0Pi::FEATURE) \ - } +#define FILL_MAP_BPLUS(FEATURE) \ + { \ + #FEATURE, static_cast(InputFeaturesBplusToD0Pi::FEATURE)} // Check if the index of mCachedIndices (index associated to a FEATURE) // matches the entry in EnumInputFeatures associated to this FEATURE @@ -63,7 +64,7 @@ // where OBJECT is named candidateD , FEATURE = GETTER and INDEX is the index of the vector #define CHECK_AND_FILL_VEC_D0_INDEX(FEATURE, GETTER1, GETTER2, INDEX) \ case static_cast(InputFeaturesBplusToD0Pi::FEATURE): { \ - if (pdgCode == o2::constants::physics::kD0) { \ + if (pdgCode == o2::constants::physics::Pdg::kD0) { \ inputFeatures.emplace_back((candidateD0.GETTER1())[INDEX]); \ } else { \ inputFeatures.emplace_back((candidateD0.GETTER2())[INDEX]); \ diff --git a/PWGHF/Core/HfMlResponseBplusToJpsiKReduced.h b/PWGHF/Core/HfMlResponseBplusToJpsiKReduced.h index ebf77e7effe..3d0d040d850 100644 --- a/PWGHF/Core/HfMlResponseBplusToJpsiKReduced.h +++ b/PWGHF/Core/HfMlResponseBplusToJpsiKReduced.h @@ -21,16 +21,17 @@ #include "Tools/ML/MlResponse.h" +#include + #include #include // Fill the map of available input features // the key is the feature's name (std::string) // the value is the corresponding value in EnumInputFeatures -#define FILL_MAP_BPLUS(FEATURE) \ - { \ - #FEATURE, static_cast(InputFeaturesBplusToJpsiKReduced::FEATURE) \ - } +#define FILL_MAP_BPLUS(FEATURE) \ + { \ + #FEATURE, static_cast(InputFeaturesBplusToJpsiKReduced::FEATURE)} // Check if the index of mCachedIndices (index associated to a FEATURE) // matches the entry in EnumInputFeatures associated to this FEATURE diff --git a/PWGHF/Core/HfMlResponseBsToJpsiPhiReduced.h b/PWGHF/Core/HfMlResponseBsToJpsiPhiReduced.h index 2af47921132..bdf0ce3cc80 100644 --- a/PWGHF/Core/HfMlResponseBsToJpsiPhiReduced.h +++ b/PWGHF/Core/HfMlResponseBsToJpsiPhiReduced.h @@ -21,16 +21,17 @@ #include "Tools/ML/MlResponse.h" +#include + #include #include // Fill the map of available input features // the key is the feature's name (std::string) // the value is the corresponding value in EnumInputFeatures -#define FILL_MAP_BS(FEATURE) \ - { \ - #FEATURE, static_cast(InputFeaturesBsToJpsiPhiReduced::FEATURE) \ - } +#define FILL_MAP_BS(FEATURE) \ + { \ + #FEATURE, static_cast(InputFeaturesBsToJpsiPhiReduced::FEATURE)} // Check if the index of mCachedIndices (index associated to a FEATURE) // matches the entry in EnumInputFeatures associated to this FEATURE diff --git a/PWGHF/D2H/DataModel/ReducedDataModel.h b/PWGHF/D2H/DataModel/ReducedDataModel.h index 549fa45ecf9..cb1c82afb41 100644 --- a/PWGHF/D2H/DataModel/ReducedDataModel.h +++ b/PWGHF/D2H/DataModel/ReducedDataModel.h @@ -25,6 +25,7 @@ #define PWGHF_D2H_DATAMODEL_REDUCEDDATAMODEL_H_ #include "PWGHF/DataModel/CandidateReconstructionTables.h" +#include "PWGHF/Utils/utilsEvSelHf.h" #include "PWGHF/Utils/utilsPid.h" #include "Common/Core/RecoDecay.h" @@ -747,14 +748,14 @@ using HfRedPidDau2 = HfRedPidDau2s::iterator; // Beauty candidates prongs namespace hf_cand_b0_reduced { -DECLARE_SOA_INDEX_COLUMN_FULL(Prong0, prong0, int, HfRed3Prongs, "_0"); //! Prong0 index -DECLARE_SOA_INDEX_COLUMN_FULL(Prong1, prong1, int, HfRedTrackBases, "_1"); //! Prong1 index -DECLARE_SOA_INDEX_COLUMN_FULL(ProngD0, prongD0, int, HfRed2Prongs, "_0"); //! ProngD0 index +DECLARE_SOA_INDEX_COLUMN_FULL(Prong0, prong0, int, HfRed3Prongs, "_0"); //! Prong0 index +DECLARE_SOA_INDEX_COLUMN_FULL(Prong1, prong1, int, HfRedTrackBases, "_1"); //! Prong1 index +DECLARE_SOA_INDEX_COLUMN_FULL(ProngD0, prongD0, int, HfRed2Prongs, "_0"); //! ProngD0 index DECLARE_SOA_INDEX_COLUMN_FULL(ProngBachPi, prongBachPi, int, HfRedTrackBases, "_1"); //! ProngBachPi index DECLARE_SOA_INDEX_COLUMN_FULL(ProngSoftPi, prongSoftPi, int, HfRedSoftPiBases, "_2"); //! ProngSoftPi index -DECLARE_SOA_COLUMN(Prong0MlScoreBkg, prong0MlScoreBkg, float); //! Bkg ML score of the D daughter -DECLARE_SOA_COLUMN(Prong0MlScorePrompt, prong0MlScorePrompt, float); //! Prompt ML score of the D daughter -DECLARE_SOA_COLUMN(Prong0MlScoreNonprompt, prong0MlScoreNonprompt, float); //! Nonprompt ML score of the D daughter +DECLARE_SOA_COLUMN(Prong0MlScoreBkg, prong0MlScoreBkg, float); //! Bkg ML score of the D daughter +DECLARE_SOA_COLUMN(Prong0MlScorePrompt, prong0MlScorePrompt, float); //! Prompt ML score of the D daughter +DECLARE_SOA_COLUMN(Prong0MlScoreNonprompt, prong0MlScoreNonprompt, float); //! Nonprompt ML score of the D daughter } // namespace hf_cand_b0_reduced DECLARE_SOA_TABLE(HfRedB0Prongs, "AOD", "HFREDB0PRONG", //! Table with B0 daughter indices diff --git a/PWGHF/D2H/Macros/HFInvMassFitter.cxx b/PWGHF/D2H/Macros/HFInvMassFitter.cxx index 2f1c0c29f94..21093bf22bd 100644 --- a/PWGHF/D2H/Macros/HFInvMassFitter.cxx +++ b/PWGHF/D2H/Macros/HFInvMassFitter.cxx @@ -37,7 +37,6 @@ #include #include #include -#include #include #include #include diff --git a/PWGHF/D2H/Macros/runMassFitter.C b/PWGHF/D2H/Macros/runMassFitter.C index 544b60aa72e..3bdbba6a013 100644 --- a/PWGHF/D2H/Macros/runMassFitter.C +++ b/PWGHF/D2H/Macros/runMassFitter.C @@ -22,16 +22,23 @@ #include "HFInvMassFitter.h" -// if .h file not found, please include your local rapidjson/document.h and rapidjson/filereadstream.h here #include #include #include -#include +#include +#include +#include +#include -#include +#include // if .h file not found, please include your local rapidjson/document.h and rapidjson/filereadstream.h here #include +#include +#include + +#include #include // for fclose +#include #include #include #include // std::string diff --git a/PWGHF/D2H/TableProducer/candidateCreatorCharmResoReduced.cxx b/PWGHF/D2H/TableProducer/candidateCreatorCharmResoReduced.cxx index 1b99908d3ea..d9074222996 100644 --- a/PWGHF/D2H/TableProducer/candidateCreatorCharmResoReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateCreatorCharmResoReduced.cxx @@ -22,6 +22,7 @@ #include "Common/Core/RecoDecay.h" +#include #include #include #include @@ -43,8 +44,8 @@ #include #include +#include #include -#include #include #include diff --git a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx index a6e80ef7948..6fb022813b9 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx @@ -26,7 +26,6 @@ #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" #include "PWGHF/Utils/utilsEvSelHf.h" -#include "PWGHF/Utils/utilsMcMatching.h" #include "PWGHF/Utils/utilsTrkCandHf.h" #include "Common/Core/RecoDecay.h" @@ -84,7 +83,6 @@ using namespace o2::aod; using namespace o2::constants::physics; using namespace o2::framework; using namespace o2::framework::expressions; -using namespace o2::hf_decay; using namespace o2::hf_trkcandsel; enum Event : uint8_t { diff --git a/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx index 199048fb421..a760434fb13 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include diff --git a/PWGHF/D2H/Tasks/taskCharmResoToDV0Reduced.cxx b/PWGHF/D2H/Tasks/taskCharmResoToDV0Reduced.cxx index e8ae3d8b903..8d795347683 100644 --- a/PWGHF/D2H/Tasks/taskCharmResoToDV0Reduced.cxx +++ b/PWGHF/D2H/Tasks/taskCharmResoToDV0Reduced.cxx @@ -30,6 +30,8 @@ #include #include +#include + #include #include #include diff --git a/PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx b/PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx index ac1acb661cf..43691d9cd98 100644 --- a/PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx +++ b/PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx @@ -39,6 +39,8 @@ #include #include +#include + #include #include #include diff --git a/PWGHF/D2H/Tasks/taskLc.cxx b/PWGHF/D2H/Tasks/taskLc.cxx index 6fee55b67e2..ccbd6c8bb45 100644 --- a/PWGHF/D2H/Tasks/taskLc.cxx +++ b/PWGHF/D2H/Tasks/taskLc.cxx @@ -45,6 +45,7 @@ #include #include +#include #include #include // std::vector diff --git a/PWGHF/D2H/Utils/utilsSigmac.h b/PWGHF/D2H/Utils/utilsSigmac.h index b1f9012c28f..4777235ee6a 100644 --- a/PWGHF/D2H/Utils/utilsSigmac.h +++ b/PWGHF/D2H/Utils/utilsSigmac.h @@ -18,6 +18,8 @@ #include "PWGHF/DataModel/CandidateReconstructionTables.h" +#include + #include namespace o2::hf_sigmac_utils diff --git a/PWGHF/HFC/Macros/DhCorrelationExtraction.cxx b/PWGHF/HFC/Macros/DhCorrelationExtraction.cxx index 9bc2b4fa788..1e886dfe2e6 100644 --- a/PWGHF/HFC/Macros/DhCorrelationExtraction.cxx +++ b/PWGHF/HFC/Macros/DhCorrelationExtraction.cxx @@ -16,6 +16,7 @@ #include "DhCorrelationExtraction.h" +#include #include #include #include @@ -24,11 +25,15 @@ #include #include #include +#include +#include #include +#include #include #include +#include #include DhCorrelationExtraction::DhCorrelationExtraction() : // default constructor diff --git a/PWGHF/HFC/Macros/ExtractOutputCorrel.C b/PWGHF/HFC/Macros/ExtractOutputCorrel.C index e5082acd3bb..4e84650524a 100644 --- a/PWGHF/HFC/Macros/ExtractOutputCorrel.C +++ b/PWGHF/HFC/Macros/ExtractOutputCorrel.C @@ -18,14 +18,16 @@ #include "DhCorrelationExtraction.h" +#include #include +#include #include #include #include #include -#include +#include #include #include diff --git a/PWGHF/HFC/Macros/FitCorrel.C b/PWGHF/HFC/Macros/FitCorrel.C index 3b921024a6a..8953163cb23 100644 --- a/PWGHF/HFC/Macros/FitCorrel.C +++ b/PWGHF/HFC/Macros/FitCorrel.C @@ -16,20 +16,24 @@ #include "DhCorrelationFitter.h" +#include #include #include #include -#include +#include #include #include #include +#include #include #include +#include #include #include -#include +#include +#include #include #include diff --git a/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx index c632d3a5882..6ca8f049673 100644 --- a/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx @@ -28,6 +28,8 @@ #include "Common/Core/RecoDecay.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/PIDResponseTOF.h" +#include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" #include @@ -44,6 +46,7 @@ #include #include #include +#include #include diff --git a/PWGHF/HFC/TableProducer/correlatorFlowCharmHadronsReduced.cxx b/PWGHF/HFC/TableProducer/correlatorFlowCharmHadronsReduced.cxx index 3d6ab204e53..96187e620a9 100644 --- a/PWGHF/HFC/TableProducer/correlatorFlowCharmHadronsReduced.cxx +++ b/PWGHF/HFC/TableProducer/correlatorFlowCharmHadronsReduced.cxx @@ -13,17 +13,11 @@ /// \brief CharmHadrons-Hadrons correlator tree creator for data analyses /// \author Marcello Di Costanzo , Politecnico and INFN Torino -#include "PWGHF/Core/HfHelper.h" -#include "PWGHF/DataModel/CandidateReconstructionTables.h" -#include "PWGHF/DataModel/CandidateSelectionTables.h" #include "PWGHF/HFC/DataModel/DerivedDataCorrelationTables.h" -#include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/TrackSelectionTables.h" +#include "Common/Core/RecoDecay.h" -#include #include -#include #include #include #include @@ -40,15 +34,15 @@ #include #include -#include +#include +#include +#include #include #include using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -using namespace o2::hf_centrality; -using namespace o2::hf_evsel; using BinningCentPosZ = ColumnBinningPolicy; using BinningMultPosZ = ColumnBinningPolicy; diff --git a/PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx index 4f0a7cdc07c..ff4092b7071 100644 --- a/PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx @@ -24,6 +24,7 @@ #include "PWGHF/HFC/DataModel/CorrelationTables.h" #include "PWGHF/HFC/Utils/utilsCorrelations.h" #include "PWGHF/Utils/utilsAnalysis.h" +#include "PWGLF/DataModel/LFStrangenessTables.h" #include "Common/CCDB/EventSelectionParams.h" #include "Common/Core/RecoDecay.h" diff --git a/PWGHF/HFC/TableProducer/derivedDataCreatorCorrelationsReduced.cxx b/PWGHF/HFC/TableProducer/derivedDataCreatorCorrelationsReduced.cxx index 4fa3d9cc68b..90253bcba3d 100644 --- a/PWGHF/HFC/TableProducer/derivedDataCreatorCorrelationsReduced.cxx +++ b/PWGHF/HFC/TableProducer/derivedDataCreatorCorrelationsReduced.cxx @@ -15,12 +15,16 @@ /// \author Stefano Politanò , CERN /// \author Wu Chuntai , CCNU, INFN Padova, and Padova University +#include "PWGHF/Core/CentralityEstimation.h" #include "PWGHF/Core/HfHelper.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" #include "PWGHF/HFC/DataModel/DerivedDataCorrelationTables.h" #include "PWGHF/Utils/utilsEvSelHf.h" +#include "Common/Core/RecoDecay.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/TrackSelectionTables.h" @@ -28,20 +32,21 @@ #include #include #include -#include #include #include #include -#include #include -#include #include #include #include #include -#include #include +#include +#include + +#include +#include #include #include diff --git a/PWGHF/HFC/Tasks/taskCharmHadronsFemtoDream.cxx b/PWGHF/HFC/Tasks/taskCharmHadronsFemtoDream.cxx index 8dfa43f0ebd..00649a158ef 100644 --- a/PWGHF/HFC/Tasks/taskCharmHadronsFemtoDream.cxx +++ b/PWGHF/HFC/Tasks/taskCharmHadronsFemtoDream.cxx @@ -42,8 +42,6 @@ #include #include -#include - #include #include #include diff --git a/PWGHF/HFC/Tasks/taskCorrelationDsHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationDsHadrons.cxx index 22678cfbdf0..f15bf117ad1 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationDsHadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationDsHadrons.cxx @@ -44,6 +44,8 @@ #include #include +#include +#include #include #include diff --git a/PWGHF/HFC/Tasks/taskFlow.cxx b/PWGHF/HFC/Tasks/taskFlow.cxx index 8c98645675e..43c77693a0b 100644 --- a/PWGHF/HFC/Tasks/taskFlow.cxx +++ b/PWGHF/HFC/Tasks/taskFlow.cxx @@ -16,48 +16,58 @@ /// \author Maja Kabus , CERN #include "PWGCF/Core/CorrelationContainer.h" -#include "PWGCF/Core/PairCuts.h" #include "PWGHF/Core/HfHelper.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" #include "PWGHF/Utils/utilsPid.h" -#include "PWGMM/Mult/DataModel/Index.h" #include "PWGMM/Mult/DataModel/bestCollisionTable.h" -#include "Common/Core/trackUtilities.h" -#include "Common/DataModel/CollisionAssociationTables.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/Core/RecoDecay.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/FT0Corrected.h" +#include "Common/DataModel/McCollisionExtra.h" #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "CCDB/CcdbApi.h" -#include "CommonConstants/MathConstants.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsCommonDataFormats/AlignParam.h" -#include "FT0Base/Geometry.h" -#include "FV0Base/Geometry.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/Logger.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/RunningWorkflowInfo.h" -#include "Framework/StepTHn.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/GlobalTrackID.h" - -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include -#include +#include +#include +#include + +#include +#include #include +#include +#include #include +#include #include +#include #include using namespace o2; diff --git a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx index 18306b50b80..8a3aed908c1 100644 --- a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx +++ b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx @@ -23,7 +23,6 @@ #include "Common/Core/RecoDecay.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" #include "EventFiltering/Zorro.h" diff --git a/PWGHF/HFL/Tasks/taskSingleElectron.cxx b/PWGHF/HFL/Tasks/taskSingleElectron.cxx index cb7dc2d4288..5315b8513fc 100644 --- a/PWGHF/HFL/Tasks/taskSingleElectron.cxx +++ b/PWGHF/HFL/Tasks/taskSingleElectron.cxx @@ -13,16 +13,26 @@ /// \brief task for electrons from heavy-flavour hadron decays /// \author Jonghan Park (Jeonbuk National University) -#include "Common/Core/RecoDecay.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/PIDResponse.h" +#include "Common/DataModel/PIDResponseTOF.h" +#include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" #include -#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include #include +#include + #include using namespace o2; diff --git a/PWGHF/TableProducer/candidateCreatorLb.cxx b/PWGHF/TableProducer/candidateCreatorLb.cxx index dbf816f5b0c..cc615c0ad72 100644 --- a/PWGHF/TableProducer/candidateCreatorLb.cxx +++ b/PWGHF/TableProducer/candidateCreatorLb.cxx @@ -47,7 +47,6 @@ #include #include #include -#include using namespace o2; using namespace o2::analysis; diff --git a/PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx b/PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx index 436350e0496..1d1dbc88e32 100644 --- a/PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx +++ b/PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx @@ -68,7 +68,6 @@ #include #include #include -#include #include using namespace o2; diff --git a/PWGHF/TableProducer/mcPidTof.cxx b/PWGHF/TableProducer/mcPidTof.cxx index e614b3bc406..db35725d07c 100644 --- a/PWGHF/TableProducer/mcPidTof.cxx +++ b/PWGHF/TableProducer/mcPidTof.cxx @@ -26,6 +26,7 @@ #include "Common/TableProducer/PID/pidTOFBase.h" #include +#include #include #include #include diff --git a/PWGHF/TableProducer/trackIndexSkimCreator.cxx b/PWGHF/TableProducer/trackIndexSkimCreator.cxx index 0caea28363a..c89194ea71d 100644 --- a/PWGHF/TableProducer/trackIndexSkimCreator.cxx +++ b/PWGHF/TableProducer/trackIndexSkimCreator.cxx @@ -67,8 +67,9 @@ #include #include +#include + #include -#include #include // std::find #include diff --git a/PWGHF/TableProducer/treeCreatorLcToK0sP.cxx b/PWGHF/TableProducer/treeCreatorLcToK0sP.cxx index 51b959f799a..c29d9ebe68c 100644 --- a/PWGHF/TableProducer/treeCreatorLcToK0sP.cxx +++ b/PWGHF/TableProducer/treeCreatorLcToK0sP.cxx @@ -36,6 +36,7 @@ #include #include #include +#include #include using namespace o2; diff --git a/PWGHF/TableProducer/treeCreatorSigmacCorrBkg.cxx b/PWGHF/TableProducer/treeCreatorSigmacCorrBkg.cxx index 4e3f627761a..22a7173e0de 100644 --- a/PWGHF/TableProducer/treeCreatorSigmacCorrBkg.cxx +++ b/PWGHF/TableProducer/treeCreatorSigmacCorrBkg.cxx @@ -19,21 +19,28 @@ #include "PWGHF/Core/DecayChannels.h" #include "PWGHF/Core/HfHelper.h" #include "PWGHF/D2H/Utils/utilsSigmac.h" +#include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" +#include "Common/Core/RecoDecay.h" + +#include #include #include #include #include #include -#include #include #include -#include #include #include +#include + +#include +#include + using namespace o2; using namespace o2::framework; // for Produces, Configuable diff --git a/PWGHF/TableProducer/treeCreatorTccToD0D0Pi.cxx b/PWGHF/TableProducer/treeCreatorTccToD0D0Pi.cxx index 85f7d998026..df19a9786e4 100644 --- a/PWGHF/TableProducer/treeCreatorTccToD0D0Pi.cxx +++ b/PWGHF/TableProducer/treeCreatorTccToD0D0Pi.cxx @@ -58,7 +58,6 @@ #include #include #include -#include #include using namespace o2; From db5c993e4dcb96ff5fc1f316f42e2be65cf1d3c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Tue, 30 Sep 2025 22:26:02 +0200 Subject: [PATCH 21/25] Fix const --- PWGHF/Core/HfHelper.h | 14 +- PWGHF/D2H/Macros/HFInvMassFitter.cxx | 70 ++-- PWGHF/D2H/Macros/runMassFitter.C | 18 +- .../candidateCreatorB0Reduced.cxx | 16 +- .../candidateCreatorBToJpsiReduced.cxx | 8 +- .../candidateCreatorBplusReduced.cxx | 8 +- .../candidateCreatorBsReduced.cxx | 8 +- .../candidateCreatorCharmResoReduced.cxx | 20 +- .../candidateCreatorLbReduced.cxx | 8 +- .../candidateSelectorB0ToDPiReduced.cxx | 2 +- .../candidateSelectorBplusToD0PiReduced.cxx | 2 +- .../candidateSelectorBsToDsPiReduced.cxx | 2 +- .../candidateSelectorLbToLcPiReduced.cxx | 2 +- .../dataCreatorCharmHadPiReduced.cxx | 90 ++--- .../dataCreatorCharmResoReduced.cxx | 36 +- .../dataCreatorJpsiHadReduced.cxx | 4 +- PWGHF/D2H/Tasks/taskB0Reduced.cxx | 20 +- PWGHF/D2H/Tasks/taskBplusReduced.cxx | 10 +- PWGHF/D2H/Tasks/taskBplusToJpsiKReduced.cxx | 4 +- PWGHF/D2H/Tasks/taskBsReduced.cxx | 10 +- PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx | 8 +- PWGHF/D2H/Tasks/taskCharmPolarisation.cxx | 160 ++++---- .../D2H/Tasks/taskCharmResoToDTrkReduced.cxx | 2 +- PWGHF/D2H/Tasks/taskCharmResoToDV0Reduced.cxx | 2 +- PWGHF/D2H/Tasks/taskD0.cxx | 8 +- .../Tasks/taskDirectedFlowCharmHadrons.cxx | 10 +- PWGHF/D2H/Tasks/taskDplus.cxx | 26 +- PWGHF/D2H/Tasks/taskDs.cxx | 44 +-- PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx | 14 +- PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx | 112 +++--- PWGHF/D2H/Tasks/taskLb.cxx | 44 +-- PWGHF/D2H/Tasks/taskLbReduced.cxx | 10 +- PWGHF/D2H/Tasks/taskLc.cxx | 14 +- PWGHF/D2H/Tasks/taskLcToK0sP.cxx | 38 +- PWGHF/D2H/Tasks/taskOmegac0ToOmegapi.cxx | 14 +- PWGHF/D2H/Tasks/taskSigmac.cxx | 46 +-- PWGHF/D2H/Tasks/taskSigmacToCascade.cxx | 44 +-- PWGHF/D2H/Tasks/taskXic.cxx | 10 +- PWGHF/D2H/Tasks/taskXic0ToXiPi.cxx | 14 +- PWGHF/D2H/Tasks/taskXicToXiPiPi.cxx | 2 +- PWGHF/D2H/Tasks/taskXicc.cxx | 2 +- PWGHF/D2H/Utils/utilsRedDataFormat.h | 6 +- PWGHF/HFC/Macros/DhCorrelationExtraction.cxx | 84 ++-- PWGHF/HFC/Macros/DhCorrelationFitter.cxx | 36 +- PWGHF/HFC/Macros/ExtractOutputCorrel.C | 90 ++--- PWGHF/HFC/Macros/FitCorrel.C | 30 +- PWGHF/HFC/TableProducer/correlatorD0D0bar.cxx | 6 +- .../correlatorD0D0barBarrelFullPid.cxx | 6 +- .../HFC/TableProducer/correlatorD0Hadrons.cxx | 38 +- .../TableProducer/correlatorDMesonPairs.cxx | 78 ++-- .../TableProducer/correlatorDplusDminus.cxx | 6 +- .../TableProducer/correlatorDplusHadrons.cxx | 50 +-- .../HFC/TableProducer/correlatorDsHadrons.cxx | 50 +-- .../correlatorDsHadronsReduced.cxx | 16 +- .../TableProducer/correlatorDstarHadrons.cxx | 6 +- .../correlatorFlowCharmHadronsReduced.cxx | 28 +- .../TableProducer/correlatorHfeHadrons.cxx | 14 +- .../HFC/TableProducer/correlatorLcHadrons.cxx | 62 +-- .../TableProducer/correlatorLcScHadrons.cxx | 52 +-- .../derivedDataCreatorCorrelationsReduced.cxx | 10 +- .../HFC/TableProducer/femtoDreamProducer.cxx | 6 +- PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx | 132 +++---- PWGHF/HFC/Tasks/taskCorrelationDDbar.cxx | 42 +- .../HFC/Tasks/taskCorrelationDMesonPairs.cxx | 32 +- .../HFC/Tasks/taskCorrelationDplusHadrons.cxx | 114 +++--- PWGHF/HFC/Tasks/taskCorrelationDsHadrons.cxx | 156 ++++---- .../HFC/Tasks/taskCorrelationDstarHadrons.cxx | 32 +- PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx | 110 +++--- PWGHF/HFC/Tasks/taskFlow.cxx | 66 ++-- .../electronSelectionWithTpcEmcal.cxx | 16 +- .../TableProducer/treeCreatorElectronDCA.cxx | 2 +- PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx | 56 +-- .../Tasks/taskMuonCharmBeautySeparation.cxx | 24 +- PWGHF/HFL/Tasks/taskSingleElectron.cxx | 6 +- PWGHF/HFL/Tasks/taskSingleMuon.cxx | 34 +- PWGHF/HFL/Tasks/taskSingleMuonMult.cxx | 38 +- PWGHF/HFL/Tasks/taskSingleMuonReader.cxx | 22 +- PWGHF/HFL/Tasks/taskSingleMuonReaderAssoc.cxx | 22 +- PWGHF/HFL/Tasks/taskSingleMuonSource.cxx | 22 +- .../TableProducer/candidateCreator2Prong.cxx | 16 +- .../TableProducer/candidateCreator3Prong.cxx | 24 +- PWGHF/TableProducer/candidateCreatorB0.cxx | 18 +- PWGHF/TableProducer/candidateCreatorBplus.cxx | 6 +- PWGHF/TableProducer/candidateCreatorBs.cxx | 18 +- .../TableProducer/candidateCreatorCascade.cxx | 4 +- PWGHF/TableProducer/candidateCreatorDstar.cxx | 2 +- PWGHF/TableProducer/candidateCreatorLb.cxx | 8 +- .../candidateCreatorSigmac0plusplus.cxx | 18 +- ...candidateCreatorSigmac0plusplusCascade.cxx | 38 +- .../candidateCreatorXic0Omegac0.cxx | 370 +++++++++--------- .../candidateCreatorXicToXiPiPi.cxx | 76 ++-- PWGHF/TableProducer/candidateCreatorXicc.cxx | 12 +- .../candidateSelectorB0ToDPi.cxx | 2 +- .../candidateSelectorBplusToD0Pi.cxx | 2 +- .../candidateSelectorBsToDsPi.cxx | 4 +- PWGHF/TableProducer/candidateSelectorD0.cxx | 4 +- .../candidateSelectorDplusToPiKPi.cxx | 4 +- .../candidateSelectorDsToKKPi.cxx | 22 +- .../candidateSelectorDstarToD0Pi.cxx | 2 +- .../candidateSelectorLbToLcPi.cxx | 18 +- PWGHF/TableProducer/candidateSelectorLc.cxx | 20 +- .../candidateSelectorLcPidMl.cxx | 32 +- .../candidateSelectorLcToK0sP.cxx | 12 +- .../candidateSelectorOmegac0ToOmegaKa.cxx | 20 +- .../candidateSelectorOmegac0ToOmegaPi.cxx | 22 +- .../candidateSelectorOmegac0Xic0ToOmegaKa.cxx | 20 +- .../TableProducer/candidateSelectorToXiPi.cxx | 24 +- .../candidateSelectorXic0ToXiPiKf.cxx | 22 +- .../candidateSelectorXicToPKPi.cxx | 8 +- .../candidateSelectorXicToXiPiPi.cxx | 4 +- .../candidateSelectorXiccToPKPiPi.cxx | 4 +- .../derivedDataCreatorB0ToDPi.cxx | 8 +- .../derivedDataCreatorBplusToD0Pi.cxx | 10 +- .../derivedDataCreatorD0ToKPi.cxx | 8 +- .../derivedDataCreatorDplusToPiKPi.cxx | 8 +- .../derivedDataCreatorDsToKKPi.cxx | 8 +- .../derivedDataCreatorDstarToD0Pi.cxx | 4 +- .../derivedDataCreatorLcToPKPi.cxx | 12 +- .../derivedDataCreatorXicToXiPiPi.cxx | 8 +- PWGHF/TableProducer/mcPidTof.cxx | 6 +- PWGHF/TableProducer/trackIndexSkimCreator.cxx | 4 +- PWGHF/TableProducer/treeCreatorB0ToDPi.cxx | 4 +- .../TableProducer/treeCreatorBplusToD0Pi.cxx | 4 +- PWGHF/TableProducer/treeCreatorBsToDsPi.cxx | 4 +- PWGHF/TableProducer/treeCreatorD0ToKPi.cxx | 16 +- .../TableProducer/treeCreatorDplusToPiKPi.cxx | 6 +- PWGHF/TableProducer/treeCreatorDsToKKPi.cxx | 6 +- .../TableProducer/treeCreatorDstarToD0Pi.cxx | 4 +- PWGHF/TableProducer/treeCreatorLcToK0sP.cxx | 2 +- PWGHF/TableProducer/treeCreatorLcToPKPi.cxx | 4 +- PWGHF/TableProducer/treeCreatorOmegacSt.cxx | 42 +- .../treeCreatorSigmacCorrBkg.cxx | 14 +- .../TableProducer/treeCreatorTccToD0D0Pi.cxx | 8 +- PWGHF/TableProducer/treeCreatorXicToPKPi.cxx | 6 +- .../TableProducer/treeCreatorXicToXiPiPi.cxx | 8 +- PWGHF/Tasks/taskLcCentrality.cxx | 4 +- PWGHF/Tasks/taskMcEfficiency.cxx | 56 +-- PWGHF/Tasks/taskMcGenPtRapShapes.cxx | 6 +- PWGHF/Tasks/taskMcValidation.cxx | 60 +-- PWGHF/Tasks/taskPidStudies.cxx | 8 +- PWGHF/Tasks/taskSelOptimisation.cxx | 4 +- 141 files changed, 1887 insertions(+), 1887 deletions(-) diff --git a/PWGHF/Core/HfHelper.h b/PWGHF/Core/HfHelper.h index 74a15898e42..85190c4e245 100644 --- a/PWGHF/Core/HfHelper.h +++ b/PWGHF/Core/HfHelper.h @@ -304,12 +304,12 @@ class HfHelper momK2 = candidate.pVectorProng2(); } - ROOT::Math::PxPyPzMVector vecPi(momPi[0], momPi[1], momPi[2], o2::constants::physics::MassPiPlus); - ROOT::Math::PxPyPzMVector vecK1(momK1[0], momK1[1], momK1[2], o2::constants::physics::MassKPlus); - ROOT::Math::PxPyPzMVector vecK2(momK2[0], momK2[1], momK2[2], o2::constants::physics::MassKPlus); - ROOT::Math::PxPyPzMVector vecPhi = vecK1 + vecK2; + ROOT::Math::PxPyPzMVector const vecPi(momPi[0], momPi[1], momPi[2], o2::constants::physics::MassPiPlus); + ROOT::Math::PxPyPzMVector const vecK1(momK1[0], momK1[1], momK1[2], o2::constants::physics::MassKPlus); + ROOT::Math::PxPyPzMVector const vecK2(momK2[0], momK2[1], momK2[2], o2::constants::physics::MassKPlus); + ROOT::Math::PxPyPzMVector const vecPhi = vecK1 + vecK2; - ROOT::Math::Boost boostToPhiRestFrame(vecPhi.BoostToCM()); + ROOT::Math::Boost const boostToPhiRestFrame(vecPhi.BoostToCM()); auto momPiPhiRestFrame = boostToPhiRestFrame(vecPi).Vect(); auto momK1PhiRestFrame = boostToPhiRestFrame(vecK1).Vect(); @@ -522,8 +522,8 @@ class HfHelper phiPi = RecoDecay::phi(candidate.pxProng2(), candidate.pyProng2()); } - double deltaEta = etaJpsi - etaPi; - double deltaPhi = RecoDecay::constrainAngle(phiJpsi - phiPi, -o2::constants::math::PI); + double const deltaEta = etaJpsi - etaPi; + double const deltaPhi = RecoDecay::constrainAngle(phiJpsi - phiPi, -o2::constants::math::PI); return RecoDecay::sqrtSumOfSquares(deltaEta, deltaPhi); } diff --git a/PWGHF/D2H/Macros/HFInvMassFitter.cxx b/PWGHF/D2H/Macros/HFInvMassFitter.cxx index 21093bf22bd..957ec2bc523 100644 --- a/PWGHF/D2H/Macros/HFInvMassFitter.cxx +++ b/PWGHF/D2H/Macros/HFInvMassFitter.cxx @@ -334,7 +334,7 @@ void HFInvMassFitter::doFit() } mTotalPdf->plotOn(mInvMassFrame, Name("Tot_c")); mReflPdf = new RooAddPdf("mReflPdf", "reflection fit function", RooArgList(*reflPdf), RooArgList(*mRooNRefl)); - RooAddPdf reflBkgPdf("reflBkgPdf", "reflBkgPdf", RooArgList(*bkgPdf, *reflPdf), RooArgList(*mRooNBkg, *mRooNRefl)); + RooAddPdf const reflBkgPdf("reflBkgPdf", "reflBkgPdf", RooArgList(*bkgPdf, *reflPdf), RooArgList(*mRooNBkg, *mRooNRefl)); reflBkgPdf.plotOn(mInvMassFrame, Normalization(1.0, RooAbsReal::RelativeExpected), LineStyle(7), LineColor(kRed + 1), Name("ReflBkg_c")); plotBkg(mTotalPdf); // plot bkg pdf in total pdf plotRefl(mTotalPdf); // plot reflection in total pdf @@ -385,30 +385,30 @@ void HFInvMassFitter::fillWorkspace(RooWorkspace& workspace) const workspace.import(*bkgFuncExpo); delete bkgFuncExpo; // bkg poly1 - RooRealVar polyParam0("polyParam0", "Parameter of Poly function", 0.5, -5., 5.); - RooRealVar polyParam1("polyParam1", "Parameter of Poly function", 0.2, -5., 5.); + RooRealVar const polyParam0("polyParam0", "Parameter of Poly function", 0.5, -5., 5.); + RooRealVar const polyParam1("polyParam1", "Parameter of Poly function", 0.2, -5., 5.); RooAbsPdf* bkgFuncPoly1 = new RooPolynomial("bkgFuncPoly1", "background fit function", mass, RooArgSet(polyParam0, polyParam1)); workspace.import(*bkgFuncPoly1); delete bkgFuncPoly1; // bkg poly2 - RooRealVar polyParam2("polyParam2", "Parameter of Poly function", 0.2, -5., 5.); + RooRealVar const polyParam2("polyParam2", "Parameter of Poly function", 0.2, -5., 5.); RooAbsPdf* bkgFuncPoly2 = new RooPolynomial("bkgFuncPoly2", "background fit function", mass, RooArgSet(polyParam0, polyParam1, polyParam2)); workspace.import(*bkgFuncPoly2); delete bkgFuncPoly2; // bkg poly3 - RooRealVar polyParam3("polyParam3", "Parameter of Poly function", 0.2, -1., 1.); + RooRealVar const polyParam3("polyParam3", "Parameter of Poly function", 0.2, -1., 1.); RooAbsPdf* bkgFuncPoly3 = new RooPolynomial("bkgFuncPoly3", "background pdf", mass, RooArgSet(polyParam0, polyParam1, polyParam2, polyParam3)); workspace.import(*bkgFuncPoly3); delete bkgFuncPoly3; // bkg power law - RooRealVar powParam1("powParam1", "Parameter of Pow function", TDatabasePDG::Instance()->GetParticle("pi+")->Mass()); - RooRealVar powParam2("powParam2", "Parameter of Pow function", 1., -10, 10); + RooRealVar const powParam1("powParam1", "Parameter of Pow function", TDatabasePDG::Instance()->GetParticle("pi+")->Mass()); + RooRealVar const powParam2("powParam2", "Parameter of Pow function", 1., -10, 10); RooAbsPdf* bkgFuncPow = new RooGenericPdf("bkgFuncPow", "bkgFuncPow", "(mass-powParam1)^powParam2", RooArgSet(mass, powParam1, powParam2)); workspace.import(*bkgFuncPow); delete bkgFuncPow; // pow * exp - RooRealVar powExpoParam1("powExpoParam1", "Parameter of PowExpo function", 1. / 2.); - RooRealVar powExpoParam2("powExpoParam2", "Parameter of PowExpo function", 1, -10, 10); + RooRealVar const powExpoParam1("powExpoParam1", "Parameter of PowExpo function", 1. / 2.); + RooRealVar const powExpoParam2("powExpoParam2", "Parameter of PowExpo function", 1, -10, 10); RooRealVar massPi("massPi", "mass of pion", TDatabasePDG::Instance()->GetParticle("pi+")->Mass()); RooFormulaVar powExpoParam3("powExpoParam3", "powExpoParam1 + 1", RooArgList(powExpoParam1)); RooFormulaVar powExpoParam4("powExpoParam4", "1./powExpoParam2", RooArgList(powExpoParam2)); @@ -453,8 +453,8 @@ void HFInvMassFitter::fillWorkspace(RooWorkspace& workspace) const sigmaDoubleGaus.setVal(mSigmaSgnDoubleGaus); sigmaDoubleGaus.setConstant(kTRUE); } - RooGaussian gaus1("gaus1", "gaus1", mass, mean, sigma); - RooGaussian gaus2("gaus2", "gaus2", mass, mean, sigmaDoubleGaus); + RooGaussian const gaus1("gaus1", "gaus1", mass, mean, sigma); + RooGaussian const gaus2("gaus2", "gaus2", mass, mean, sigmaDoubleGaus); RooRealVar fracDoubleGaus("fracDoubleGaus", "frac of two gauss", mFracDoubleGaus, 0, 1.); if (mFixedFracDoubleGaus) { fracDoubleGaus.setVal(mFracDoubleGaus); @@ -478,8 +478,8 @@ void HFInvMassFitter::fillWorkspace(RooWorkspace& workspace) const sigma.setMin(mSigmaSgn * (1 - mParamSgn)); } RooRealVar sigmaDoubleGausRatio("sigmaDoubleGausRatio", "sigmaDoubleGausRatio", sigma.getVal() * ratio.getVal()); - RooGaussian gausRatio1("gausRatio1", "gausratio1", mass, mean, sigma); - RooGaussian gausRatio2("gausRatio2", "gausratio2", mass, mean, sigmaDoubleGausRatio); + RooGaussian const gausRatio1("gausRatio1", "gausratio1", mass, mean, sigma); + RooGaussian const gausRatio2("gausRatio2", "gausratio2", mass, mean, sigmaDoubleGausRatio); RooRealVar fracDoubleGausRatio("fracDoubleGausRatio", "fraction of two gauss ratio", 0.5, 0, 1.); if (mFixedFracDoubleGaus) { fracDoubleGausRatio.setVal(mFracDoubleGaus); @@ -507,9 +507,9 @@ void HFInvMassFitter::fillWorkspace(RooWorkspace& workspace) const sigmaSec.setMax(mSecSigma * (1 + mParamSgn)); sigmaSec.setMin(mSecSigma * (1 - mParamSgn)); } - RooGaussian gausSec1("gausSec1", "gausSec1", mass, mean, sigmaSec); - RooGaussian gausSec2("gausSec2", "gausSec2", mass, meanSec, sigmaSec); - RooRealVar fracSec("fracSec", "frac of two peak", 0.5, 0, 1.); + RooGaussian const gausSec1("gausSec1", "gausSec1", mass, mean, sigmaSec); + RooGaussian const gausSec2("gausSec2", "gausSec2", mass, meanSec, sigmaSec); + RooRealVar const fracSec("fracSec", "frac of two peak", 0.5, 0, 1.); RooAbsPdf* sgnFuncDoublePeak = new RooAddPdf("sgnFuncDoublePeak", "signal pdf", RooArgList(gausSec1, gausSec2), fracSec); workspace.import(*sgnFuncDoublePeak); delete sgnFuncDoublePeak; @@ -530,24 +530,24 @@ void HFInvMassFitter::fillWorkspace(RooWorkspace& workspace) const meanReflDoubleGaus.setMin(mMassReflLowLimit); } RooRealVar sigmaReflDoubleGaus("sigmaReflDoubleGaus", "sigmaReflDoubleGaus", 0.012, 0.0, 0.25); - RooGaussian gausRefl1("gausRefl1", "gausRefl1", mass, meanRefl, sigmaRefl); - RooGaussian gausRefl2("gausRefl2", "gausRefl2", mass, meanReflDoubleGaus, sigmaReflDoubleGaus); - RooRealVar fracRefl("fracRefl", "frac of two gauss", 0.5, 0, 1.); + RooGaussian const gausRefl1("gausRefl1", "gausRefl1", mass, meanRefl, sigmaRefl); + RooGaussian const gausRefl2("gausRefl2", "gausRefl2", mass, meanReflDoubleGaus, sigmaReflDoubleGaus); + RooRealVar const fracRefl("fracRefl", "frac of two gauss", 0.5, 0, 1.); RooAbsPdf* reflFuncDoubleGaus = new RooAddPdf("reflFuncDoubleGaus", "reflection pdf", RooArgList(gausRefl1, gausRefl2), fracRefl); workspace.import(*reflFuncDoubleGaus); delete reflFuncDoubleGaus; // reflection poly3 - RooRealVar polyReflParam0("polyReflParam0", "polyReflParam0", 0.5, -1., 1.); - RooRealVar polyReflParam1("polyReflParam1", "polyReflParam1", 0.2, -1., 1.); - RooRealVar polyReflParam2("polyReflParam2", "polyReflParam2", 0.2, -1., 1.); - RooRealVar polyReflParam3("polyReflParam3", "polyReflParam3", 0.2, -1., 1.); + RooRealVar const polyReflParam0("polyReflParam0", "polyReflParam0", 0.5, -1., 1.); + RooRealVar const polyReflParam1("polyReflParam1", "polyReflParam1", 0.2, -1., 1.); + RooRealVar const polyReflParam2("polyReflParam2", "polyReflParam2", 0.2, -1., 1.); + RooRealVar const polyReflParam3("polyReflParam3", "polyReflParam3", 0.2, -1., 1.); RooAbsPdf* reflFuncPoly3 = new RooPolynomial("reflFuncPoly3", "reflection PDF", mass, RooArgSet(polyReflParam0, polyReflParam1, polyReflParam2, polyReflParam3)); workspace.import(*reflFuncPoly3); delete reflFuncPoly3; // reflection poly6 - RooRealVar polyReflParam4("polyReflParam4", "polyReflParam4", 0.2, -1., 1.); - RooRealVar polyReflParam5("polyReflParam5", "polyReflParam5", 0.2, -1., 1.); - RooRealVar polyReflParam6("polyReflParam6", "polyReflParam6", 0.2, -1., 1.); + RooRealVar const polyReflParam4("polyReflParam4", "polyReflParam4", 0.2, -1., 1.); + RooRealVar const polyReflParam5("polyReflParam5", "polyReflParam5", 0.2, -1., 1.); + RooRealVar const polyReflParam6("polyReflParam6", "polyReflParam6", 0.2, -1., 1.); RooAbsPdf* reflFuncPoly6 = new RooPolynomial("reflFuncPoly6", "reflection pdf", mass, RooArgSet(polyReflParam0, polyReflParam1, polyReflParam2, polyReflParam3, polyReflParam4, polyReflParam5, polyReflParam6)); workspace.import(*reflFuncPoly6); delete reflFuncPoly6; @@ -643,8 +643,8 @@ void HFInvMassFitter::highlightPeakRegion(const RooPlot* plot, Color_t color, Wi if (!mHighlightPeakRegion) { return; } - double yMin = plot->GetMinimum(); - double yMax = plot->GetMaximum(); + double const yMin = plot->GetMinimum(); + double const yMax = plot->GetMaximum(); const Double_t mean = mRooMeanSgn->getVal(); const Double_t sigma = mRooSigmaSgn->getVal(); const Double_t minForSgn = mean - mNSigmaForSidebands * sigma; @@ -716,9 +716,9 @@ void HFInvMassFitter::calculateSignificance(Double_t& significance, Double_t& er calculateSignal(signal, errSignal); Double_t bkg, errBkg; calculateBackground(bkg, errBkg); - Double_t sgnErrSquare = errSignal * errSignal; - Double_t bkgErrSquare = errBkg * errBkg; - Double_t totalSgnBkg = signal + bkg; + Double_t const sgnErrSquare = errSignal * errSignal; + Double_t const bkgErrSquare = errBkg * errBkg; + Double_t const totalSgnBkg = signal + bkg; significance = signal / std::sqrt(signal + bkg); errSignificance = significance * std::sqrt((sgnErrSquare + bkgErrSquare) / (mNSigmaForSidebands * totalSgnBkg * totalSgnBkg) + (bkg / totalSgnBkg) * (sgnErrSquare / signal / signal)); } @@ -726,10 +726,10 @@ void HFInvMassFitter::calculateSignificance(Double_t& significance, Double_t& er // estimate Signal void HFInvMassFitter::checkForSignal(Double_t& estimatedSignal) { - Double_t minForSgn = mMass - 4 * mSigmaSgn; - Double_t maxForSgn = mMass + 4 * mSigmaSgn; - Int_t binForMinSgn = mHistoInvMass->FindBin(minForSgn); - Int_t binForMaxSgn = mHistoInvMass->FindBin(maxForSgn); + Double_t const minForSgn = mMass - 4 * mSigmaSgn; + Double_t const maxForSgn = mMass + 4 * mSigmaSgn; + Int_t const binForMinSgn = mHistoInvMass->FindBin(minForSgn); + Int_t const binForMaxSgn = mHistoInvMass->FindBin(maxForSgn); Double_t sum = 0; for (Int_t i = binForMinSgn; i <= binForMaxSgn; i++) { diff --git a/PWGHF/D2H/Macros/runMassFitter.C b/PWGHF/D2H/Macros/runMassFitter.C index 3bdbba6a013..d83c0f7b7a5 100644 --- a/PWGHF/D2H/Macros/runMassFitter.C +++ b/PWGHF/D2H/Macros/runMassFitter.C @@ -62,7 +62,7 @@ void readArray(const Value& jsonArray, std::vector& output) void parseStringArray(const Value& jsonArray, std::vector& output) { - size_t arrayLength = jsonArray.Size(); + size_t const arrayLength = jsonArray.Size(); for (size_t i = 0; i < arrayLength; i++) { if (jsonArray[i].IsString()) { output.emplace_back(jsonArray[i].GetString()); @@ -87,11 +87,11 @@ int runMassFitter(const TString& configFileName) config.ParseStream(is); fclose(configFile); - Bool_t isMc = config["IsMC"].GetBool(); - TString inputFileName = config["InFileName"].GetString(); - TString reflFileName = config["ReflFileName"].GetString(); + Bool_t const isMc = config["IsMC"].GetBool(); + TString const inputFileName = config["InFileName"].GetString(); + TString const reflFileName = config["ReflFileName"].GetString(); TString outputFileName = config["OutFileName"].GetString(); - TString particleName = config["Particle"].GetString(); + TString const particleName = config["Particle"].GetString(); std::vector inputHistoName; std::vector promptHistoName; @@ -166,8 +166,8 @@ int runMassFitter(const TString& configFileName) const Value& rebinValue = config["Rebin"]; readArray(rebinValue, nRebin); - bool includeSecPeak = config["InclSecPeak"].GetBool(); - bool useLikelihood = config["UseLikelihood"].GetBool(); + bool const includeSecPeak = config["InclSecPeak"].GetBool(); + bool const useLikelihood = config["UseLikelihood"].GetBool(); const Value& bkgFuncValue = config["BkgFunc"]; readArray(bkgFuncValue, bkgFuncConfig); @@ -349,7 +349,7 @@ int runMassFitter(const TString& configFileName) canvasSize[1] = 500; } - Int_t nCanvasesMax = 20; // do not put more than 20 bins per canvas to make them visible + Int_t const nCanvasesMax = 20; // do not put more than 20 bins per canvas to make them visible const Int_t nCanvases = std::ceil(static_cast(nSliceVarBins) / nCanvasesMax); std::vector canvasMass(nCanvases); std::vector canvasResiduals(nCanvases); @@ -372,7 +372,7 @@ int runMassFitter(const TString& configFileName) const Int_t iCanvas = std::floor(static_cast(iSliceVar) / nCanvasesMax); hMassForFit[iSliceVar] = hMass[iSliceVar]->Rebin(nRebin[iSliceVar]); - TString ptTitle = + TString const ptTitle = Form("%0.2f < " + sliceVarName + " < %0.2f " + sliceVarUnit, sliceVarMin[iSliceVar], sliceVarMax[iSliceVar]); hMassForFit[iSliceVar]->SetTitle(Form("%s;%s;Counts per %0.1f MeV/#it{c}^{2}", ptTitle.Data(), massAxisTitle.Data(), diff --git a/PWGHF/D2H/TableProducer/candidateCreatorB0Reduced.cxx b/PWGHF/D2H/TableProducer/candidateCreatorB0Reduced.cxx index 08e436e272b..49cff73feea 100644 --- a/PWGHF/D2H/TableProducer/candidateCreatorB0Reduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateCreatorB0Reduced.cxx @@ -352,8 +352,8 @@ struct HfCandidateCreatorB0Reduced { } // invMassWindowDPiTolerance is used to apply a slightly tighter cut than in DPi pair preselection // to avoid accepting DPi pairs that were not formed in DPi pair creator - float invMass2DPiMin = (o2::constants::physics::MassB0 - myInvMassWindowDPi + invMassWindowDPiTolerance) * (o2::constants::physics::MassB0 - myInvMassWindowDPi + invMassWindowDPiTolerance); - float invMass2DPiMax = (o2::constants::physics::MassB0 + myInvMassWindowDPi - invMassWindowDPiTolerance) * (o2::constants::physics::MassB0 + myInvMassWindowDPi - invMassWindowDPiTolerance); + float const invMass2DPiMin = (o2::constants::physics::MassB0 - myInvMassWindowDPi + invMassWindowDPiTolerance) * (o2::constants::physics::MassB0 - myInvMassWindowDPi + invMassWindowDPiTolerance); + float const invMass2DPiMax = (o2::constants::physics::MassB0 + myInvMassWindowDPi - invMassWindowDPiTolerance) * (o2::constants::physics::MassB0 + myInvMassWindowDPi - invMassWindowDPiTolerance); for (const auto& collisionCounter : collisionsCounter) { registry.fill(HIST("hEvents"), 1, collisionCounter.originalCollisionCount()); @@ -386,8 +386,8 @@ struct HfCandidateCreatorB0Reduced { } // invMassWindowDPiTolerance is used to apply a slightly tighter cut than in DPi pair preselection // to avoid accepting DPi pairs that were not formed in DPi pair creator - float invMass2DPiMin = (o2::constants::physics::MassB0 - myInvMassWindowDPi + invMassWindowDPiTolerance) * (o2::constants::physics::MassB0 - myInvMassWindowDPi + invMassWindowDPiTolerance); - float invMass2DPiMax = (o2::constants::physics::MassB0 + myInvMassWindowDPi - invMassWindowDPiTolerance) * (o2::constants::physics::MassB0 + myInvMassWindowDPi - invMassWindowDPiTolerance); + float const invMass2DPiMin = (o2::constants::physics::MassB0 - myInvMassWindowDPi + invMassWindowDPiTolerance) * (o2::constants::physics::MassB0 - myInvMassWindowDPi + invMassWindowDPiTolerance); + float const invMass2DPiMax = (o2::constants::physics::MassB0 + myInvMassWindowDPi - invMassWindowDPiTolerance) * (o2::constants::physics::MassB0 + myInvMassWindowDPi - invMassWindowDPiTolerance); for (const auto& collisionCounter : collisionsCounter) { registry.fill(HIST("hEvents"), 1, collisionCounter.originalCollisionCount()); @@ -421,8 +421,8 @@ struct HfCandidateCreatorB0Reduced { } // invMassWindowDPiTolerance is used to apply a slightly tighter cut than in DPi pair preselection // to avoid accepting DPi pairs that were not formed in DPi pair creator - float invMass2DPiMin = (o2::constants::physics::MassB0 - myInvMassWindowDPi + invMassWindowDPiTolerance) * (o2::constants::physics::MassB0 - myInvMassWindowDPi + invMassWindowDPiTolerance); - float invMass2DPiMax = (o2::constants::physics::MassB0 + myInvMassWindowDPi - invMassWindowDPiTolerance) * (o2::constants::physics::MassB0 + myInvMassWindowDPi - invMassWindowDPiTolerance); + float const invMass2DPiMin = (o2::constants::physics::MassB0 - myInvMassWindowDPi + invMassWindowDPiTolerance) * (o2::constants::physics::MassB0 - myInvMassWindowDPi + invMassWindowDPiTolerance); + float const invMass2DPiMax = (o2::constants::physics::MassB0 + myInvMassWindowDPi - invMassWindowDPiTolerance) * (o2::constants::physics::MassB0 + myInvMassWindowDPi - invMassWindowDPiTolerance); for (const auto& collisionCounter : collisionsCounter) { registry.fill(HIST("hEvents"), 1, collisionCounter.originalCollisionCount()); @@ -456,8 +456,8 @@ struct HfCandidateCreatorB0Reduced { } // invMassWindowDPiTolerance is used to apply a slightly tighter cut than in DPi pair preselection // to avoid accepting DPi pairs that were not formed in DPi pair creator - float invMass2DPiMin = (o2::constants::physics::MassB0 - myInvMassWindowDPi + invMassWindowDPiTolerance) * (o2::constants::physics::MassB0 - myInvMassWindowDPi + invMassWindowDPiTolerance); - float invMass2DPiMax = (o2::constants::physics::MassB0 + myInvMassWindowDPi - invMassWindowDPiTolerance) * (o2::constants::physics::MassB0 + myInvMassWindowDPi - invMassWindowDPiTolerance); + float const invMass2DPiMin = (o2::constants::physics::MassB0 - myInvMassWindowDPi + invMassWindowDPiTolerance) * (o2::constants::physics::MassB0 - myInvMassWindowDPi + invMassWindowDPiTolerance); + float const invMass2DPiMax = (o2::constants::physics::MassB0 + myInvMassWindowDPi - invMassWindowDPiTolerance) * (o2::constants::physics::MassB0 + myInvMassWindowDPi - invMassWindowDPiTolerance); for (const auto& collisionCounter : collisionsCounter) { registry.fill(HIST("hEvents"), 1, collisionCounter.originalCollisionCount()); diff --git a/PWGHF/D2H/TableProducer/candidateCreatorBToJpsiReduced.cxx b/PWGHF/D2H/TableProducer/candidateCreatorBToJpsiReduced.cxx index 0ee3e103103..444ee4b1afe 100644 --- a/PWGHF/D2H/TableProducer/candidateCreatorBToJpsiReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateCreatorBToJpsiReduced.cxx @@ -369,8 +369,8 @@ struct HfCandidateCreatorBToJpsiReduced { } // invMassWindowJpsiHadTolerance is used to apply a slightly tighter cut than in JpsiK pair preselection // to avoid accepting JpsiK pairs that were not formed in JpsiK pair creator - double invMass2JpsiKMin = (massBplus - myInvMassWindowJpsiK + invMassWindowJpsiHadTolerance) * (massBplus - myInvMassWindowJpsiK + invMassWindowJpsiHadTolerance); - double invMass2JpsiKMax = (massBplus + myInvMassWindowJpsiK - invMassWindowJpsiHadTolerance) * (massBplus + myInvMassWindowJpsiK - invMassWindowJpsiHadTolerance); + double const invMass2JpsiKMin = (massBplus - myInvMassWindowJpsiK + invMassWindowJpsiHadTolerance) * (massBplus - myInvMassWindowJpsiK + invMassWindowJpsiHadTolerance); + double const invMass2JpsiKMax = (massBplus + myInvMassWindowJpsiK - invMassWindowJpsiHadTolerance) * (massBplus + myInvMassWindowJpsiK - invMassWindowJpsiHadTolerance); for (const auto& collisionCounter : collisionsCounter) { registry.fill(HIST("hEvents"), 1, collisionCounter.originalCollisionCount()); @@ -398,8 +398,8 @@ struct HfCandidateCreatorBToJpsiReduced { } // invMassWindowJpsiHadTolerance is used to apply a slightly tighter cut than in JpsiK pair preselection // to avoid accepting JpsiK pairs that were not formed in JpsiK pair creator - double invMass2JpsiKMin = (massBs - myInvMassWindowJpsiPhi + invMassWindowJpsiHadTolerance) * (massBs - myInvMassWindowJpsiPhi + invMassWindowJpsiHadTolerance); - double invMass2JpsiKMax = (massBs + myInvMassWindowJpsiPhi - invMassWindowJpsiHadTolerance) * (massBs + myInvMassWindowJpsiPhi - invMassWindowJpsiHadTolerance); + double const invMass2JpsiKMin = (massBs - myInvMassWindowJpsiPhi + invMassWindowJpsiHadTolerance) * (massBs - myInvMassWindowJpsiPhi + invMassWindowJpsiHadTolerance); + double const invMass2JpsiKMax = (massBs + myInvMassWindowJpsiPhi - invMassWindowJpsiHadTolerance) * (massBs + myInvMassWindowJpsiPhi - invMassWindowJpsiHadTolerance); for (const auto& collisionCounter : collisionsCounter) { registry.fill(HIST("hEvents"), 1, collisionCounter.originalCollisionCount()); diff --git a/PWGHF/D2H/TableProducer/candidateCreatorBplusReduced.cxx b/PWGHF/D2H/TableProducer/candidateCreatorBplusReduced.cxx index 57c421c6721..a5f5ba5779b 100644 --- a/PWGHF/D2H/TableProducer/candidateCreatorBplusReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateCreatorBplusReduced.cxx @@ -226,8 +226,8 @@ struct HfCandidateCreatorBplusReduced { } // invMassWindowD0PiTolerance is used to apply a slightly tighter cut than in D0Pi pair preselection // to avoid accepting D0Pi pairs that were not formed in D0Pi pair creator - double invMass2D0PiMin = (massBplus - myInvMassWindowD0Pi + invMassWindowD0PiTolerance) * (massBplus - myInvMassWindowD0Pi + invMassWindowD0PiTolerance); - double invMass2D0PiMax = (massBplus + myInvMassWindowD0Pi - invMassWindowD0PiTolerance) * (massBplus + myInvMassWindowD0Pi - invMassWindowD0PiTolerance); + double const invMass2D0PiMin = (massBplus - myInvMassWindowD0Pi + invMassWindowD0PiTolerance) * (massBplus - myInvMassWindowD0Pi + invMassWindowD0PiTolerance); + double const invMass2D0PiMax = (massBplus + myInvMassWindowD0Pi - invMassWindowD0PiTolerance) * (massBplus + myInvMassWindowD0Pi - invMassWindowD0PiTolerance); for (const auto& collisionCounter : collisionsCounter) { registry.fill(HIST("hEvents"), 1, collisionCounter.originalCollisionCount()); @@ -261,8 +261,8 @@ struct HfCandidateCreatorBplusReduced { } // invMassWindowD0PiTolerance is used to apply a slightly tighter cut than in D0Pi pair preselection // to avoid accepting D0Pi pairs that were not formed in D0Pi pair creator - float invMass2D0PiMin = (massBplus - myInvMassWindowD0Pi + invMassWindowD0PiTolerance) * (massBplus - myInvMassWindowD0Pi + invMassWindowD0PiTolerance); - float invMass2D0PiMax = (massBplus + myInvMassWindowD0Pi - invMassWindowD0PiTolerance) * (massBplus + myInvMassWindowD0Pi - invMassWindowD0PiTolerance); + float const invMass2D0PiMin = (massBplus - myInvMassWindowD0Pi + invMassWindowD0PiTolerance) * (massBplus - myInvMassWindowD0Pi + invMassWindowD0PiTolerance); + float const invMass2D0PiMax = (massBplus + myInvMassWindowD0Pi - invMassWindowD0PiTolerance) * (massBplus + myInvMassWindowD0Pi - invMassWindowD0PiTolerance); for (const auto& collisionCounter : collisionsCounter) { registry.fill(HIST("hEvents"), 1, collisionCounter.originalCollisionCount()); diff --git a/PWGHF/D2H/TableProducer/candidateCreatorBsReduced.cxx b/PWGHF/D2H/TableProducer/candidateCreatorBsReduced.cxx index f23c60e2432..3317b7383fa 100644 --- a/PWGHF/D2H/TableProducer/candidateCreatorBsReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateCreatorBsReduced.cxx @@ -227,8 +227,8 @@ struct HfCandidateCreatorBsReduced { } // invMassWindowDPiTolerance is used to apply a slightly tighter cut than in DsPi pair preselection // to avoid accepting DsPi pairs that were not formed in DsPi pair creator - float invMass2DPiMin = (massB - myInvMassWindowDPi + invMassWindowDPiTolerance) * (massB - myInvMassWindowDPi + invMassWindowDPiTolerance); - float invMass2DPiMax = (massB + myInvMassWindowDPi - invMassWindowDPiTolerance) * (massB + myInvMassWindowDPi - invMassWindowDPiTolerance); + float const invMass2DPiMin = (massB - myInvMassWindowDPi + invMassWindowDPiTolerance) * (massB - myInvMassWindowDPi + invMassWindowDPiTolerance); + float const invMass2DPiMax = (massB + myInvMassWindowDPi - invMassWindowDPiTolerance) * (massB + myInvMassWindowDPi - invMassWindowDPiTolerance); for (const auto& collisionCounter : collisionsCounter) { registry.fill(HIST("hEvents"), 1, collisionCounter.originalCollisionCount()); @@ -261,8 +261,8 @@ struct HfCandidateCreatorBsReduced { } // invMassWindowDPiTolerance is used to apply a slightly tighter cut than in DsPi pair preselection // to avoid accepting DPi pairs that were not formed in DsPi pair creator - float invMass2DPiMin = (massB - myInvMassWindowDPi + invMassWindowDPiTolerance) * (massB - myInvMassWindowDPi + invMassWindowDPiTolerance); - float invMass2DPiMax = (massB + myInvMassWindowDPi - invMassWindowDPiTolerance) * (massB + myInvMassWindowDPi - invMassWindowDPiTolerance); + float const invMass2DPiMin = (massB - myInvMassWindowDPi + invMassWindowDPiTolerance) * (massB - myInvMassWindowDPi + invMassWindowDPiTolerance); + float const invMass2DPiMax = (massB + myInvMassWindowDPi - invMassWindowDPiTolerance) * (massB + myInvMassWindowDPi - invMassWindowDPiTolerance); for (const auto& collisionCounter : collisionsCounter) { registry.fill(HIST("hEvents"), 1, collisionCounter.originalCollisionCount()); diff --git a/PWGHF/D2H/TableProducer/candidateCreatorCharmResoReduced.cxx b/PWGHF/D2H/TableProducer/candidateCreatorCharmResoReduced.cxx index d9074222996..68e3f176736 100644 --- a/PWGHF/D2H/TableProducer/candidateCreatorCharmResoReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateCreatorCharmResoReduced.cxx @@ -199,8 +199,8 @@ struct HfCandidateCreatorCharmResoReduced { { uint8_t selection = {BIT(D0Sel::SelectedD0) | BIT(D0Sel::SelectedD0Bar)}; float invMassD{0.}; - float ptD = candD.pt(); - int ptBin = findBin(cfgDmesCuts.binsPtD, ptD); + float const ptD = candD.pt(); + int const ptBin = findBin(cfgDmesCuts.binsPtD, ptD); if (ptBin == -1) { return 0; } @@ -245,7 +245,7 @@ struct HfCandidateCreatorCharmResoReduced { template bool isV0Selected(V0RedTable const& candV0) { - int ptBin = findBin(cfgV0Cuts.binsPtV0, candV0.pt()); + int const ptBin = findBin(cfgV0Cuts.binsPtV0, candV0.pt()); const float invMassLow = cfgV0Cuts.cutsV0->get(ptBin, "invMassLow"); const float invMassHigh = cfgV0Cuts.cutsV0->get(ptBin, "invMassHigh"); if (ptBin == -1) { @@ -359,19 +359,19 @@ struct HfCandidateCreatorCharmResoReduced { std::vector> pVectorCharmProngs = {candD.pVectorProng0(), candD.pVectorProng1()}; std::array pVecD = candD.pVector(); - int numFills = (cfgTrackRotation.enable) ? cfgTrackRotation.numRotations : 1; // number of times we fil the tables: default 1, but more in case of track rotation + int const numFills = (cfgTrackRotation.enable) ? cfgTrackRotation.numRotations : 1; // number of times we fil the tables: default 1, but more in case of track rotation for (int iFill{0}; iFill < numFills; ++iFill) { std::array pVecV0Tr = candV0Tr.pVector(); if (cfgTrackRotation.enable) { // let's rotate - float bkgRotAngle = cfgTrackRotation.minRotAngleMultByPi * constants::math::PI + bkgRotationAngleStep * iFill; + float const bkgRotAngle = cfgTrackRotation.minRotAngleMultByPi * constants::math::PI + bkgRotationAngleStep * iFill; pVecV0Tr = std::array{candV0Tr.px() * std::cos(bkgRotAngle) - candV0Tr.py() * std::sin(bkgRotAngle), candV0Tr.px() * std::sin(bkgRotAngle) + candV0Tr.py() * std::cos(bkgRotAngle), candV0Tr.pz()}; } float invMassReso{-1}, invMassV0Tr{-1}, invMassD{-1}; int8_t signReso{0}, isWrongSign{0}; - double ptReso = RecoDecay::pt(RecoDecay::sumOfVec(pVecV0Tr, pVecD)); + double const ptReso = RecoDecay::pt(RecoDecay::sumOfVec(pVecV0Tr, pVecD)); if constexpr (DType == DMesonType::Dplus) { invMassD = candD.invMassDplus(); @@ -712,7 +712,7 @@ struct HfCandidateCreatorCharmResoReduced { for (const auto& candD : candsD) { // selection of D candidates registry.fill(HIST("hSelections"), 1); - uint8_t selFlagD = selctionFlagBachD(candD); + uint8_t const selFlagD = selctionFlagBachD(candD); if (selFlagD == 0) { continue; } @@ -765,15 +765,15 @@ struct HfCandidateCreatorCharmResoReduced { V0TrRedTable const& candsV0Tr) { using BinningType = ColumnBinningPolicy; - BinningType corrBinning{{cfgMixedEvent.zPoolBins, cfgMixedEvent.multPoolBins}, true}; + BinningType const corrBinning{{cfgMixedEvent.zPoolBins, cfgMixedEvent.multPoolBins}, true}; auto bachTuple = std::make_tuple(candsD, candsV0Tr); - Pair pairs{corrBinning, cfgMixedEvent.numberEventsMixed, cfgMixedEvent.numberEventsToSkip, collisions, bachTuple, &cache}; + Pair const pairs{corrBinning, cfgMixedEvent.numberEventsMixed, cfgMixedEvent.numberEventsToSkip, collisions, bachTuple, &cache}; for (const auto& [collision1, bachDs, collision2, bachV0Trs] : pairs) { registry.fill(HIST("hNPvContCorr"), collision1.numContrib(), collision2.numContrib()); registry.fill(HIST("hZvertCorr"), collision1.posZ(), collision2.posZ()); for (const auto& [bachD, bachV0Tr] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(bachDs, bachV0Trs))) { // Apply analysis selections on D and V0 bachelors - uint8_t selFlagD = selctionFlagBachD(bachD); + uint8_t const selFlagD = selctionFlagBachD(bachD); if (selFlagD == 0) { continue; } diff --git a/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx b/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx index f63f3f8ecc4..77b9457ecb2 100644 --- a/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx @@ -118,11 +118,11 @@ struct HfCandidateCreatorLbReduced { myInvMassWindowLcPi = config.myInvMassWindowLcPi(); } - float deltaMin = MassLambdaB0 - myInvMassWindowLcPi + invMassWindowLcPiTolerance; - float deltaMax = MassLambdaB0 + myInvMassWindowLcPi - invMassWindowLcPiTolerance; + float const deltaMin = MassLambdaB0 - myInvMassWindowLcPi + invMassWindowLcPiTolerance; + float const deltaMax = MassLambdaB0 + myInvMassWindowLcPi - invMassWindowLcPiTolerance; - float invMass2LcPiMin = deltaMin * deltaMin; - float invMass2LcPiMax = deltaMax * deltaMax; + float const invMass2LcPiMin = deltaMin * deltaMin; + float const invMass2LcPiMax = deltaMax * deltaMax; return {invMass2LcPiMin, invMass2LcPiMax}; } diff --git a/PWGHF/D2H/TableProducer/candidateSelectorB0ToDPiReduced.cxx b/PWGHF/D2H/TableProducer/candidateSelectorB0ToDPiReduced.cxx index 4dfda7909c0..0ab8c41c82d 100644 --- a/PWGHF/D2H/TableProducer/candidateSelectorB0ToDPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateSelectorB0ToDPiReduced.cxx @@ -279,7 +279,7 @@ struct HfCandidateSelectorB0ToDPiReduced { if (applyB0Ml) { // B0 ML selections std::vector inputFeatures = getMlInputFeatures(hfCandB0, trackBachPi); - bool isSelectedMl = hfMlResponse.isSelectedMl(inputFeatures, ptCandB0, outputMl); + bool const isSelectedMl = hfMlResponse.isSelectedMl(inputFeatures, ptCandB0, outputMl); hfMlB0ToDPiCandidate(outputMl[1]); // storing ML score for signal class if (!isSelectedMl) { diff --git a/PWGHF/D2H/TableProducer/candidateSelectorBplusToD0PiReduced.cxx b/PWGHF/D2H/TableProducer/candidateSelectorBplusToD0PiReduced.cxx index 6ab03c85970..91d0b934261 100644 --- a/PWGHF/D2H/TableProducer/candidateSelectorBplusToD0PiReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateSelectorBplusToD0PiReduced.cxx @@ -231,7 +231,7 @@ struct HfCandidateSelectorBplusToD0PiReduced { if (applyBplusMl) { // B+ ML selections std::vector inputFeatures = hfMlResponse.getInputFeatures(hfCandBp, trackPi); - bool isSelectedMl = hfMlResponse.isSelectedMl(inputFeatures, ptCandBplus, outputMl); + bool const isSelectedMl = hfMlResponse.isSelectedMl(inputFeatures, ptCandBplus, outputMl); hfMlBplusToD0PiCandidate(outputMl[1]); // storing ML score for signal class if (!isSelectedMl) { diff --git a/PWGHF/D2H/TableProducer/candidateSelectorBsToDsPiReduced.cxx b/PWGHF/D2H/TableProducer/candidateSelectorBsToDsPiReduced.cxx index 6a4bd65ccda..71c9c54f589 100644 --- a/PWGHF/D2H/TableProducer/candidateSelectorBsToDsPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateSelectorBsToDsPiReduced.cxx @@ -220,7 +220,7 @@ struct HfCandidateSelectorBsToDsPiReduced { if (applyBsMl) { // Bs ML selections std::vector inputFeatures = hfMlResponse.getInputFeatures(hfCandBs, trackPi); - bool isSelectedMl = hfMlResponse.isSelectedMl(inputFeatures, ptCandBs, outputMl); + bool const isSelectedMl = hfMlResponse.isSelectedMl(inputFeatures, ptCandBs, outputMl); hfMlBsToDsPiCandidate(outputMl); if (!isSelectedMl) { diff --git a/PWGHF/D2H/TableProducer/candidateSelectorLbToLcPiReduced.cxx b/PWGHF/D2H/TableProducer/candidateSelectorLbToLcPiReduced.cxx index e99a6983c3f..d3dea0df59f 100644 --- a/PWGHF/D2H/TableProducer/candidateSelectorLbToLcPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateSelectorLbToLcPiReduced.cxx @@ -221,7 +221,7 @@ struct HfCandidateSelectorLbToLcPiReduced { if (applyLbMl) { // Lb ML selections std::vector inputFeatures = hfMlResponse.getInputFeatures(hfCandLb, trackPi); - bool isSelectedMl = hfMlResponse.isSelectedMl(inputFeatures, ptCandLb, outputMl); + bool const isSelectedMl = hfMlResponse.isSelectedMl(inputFeatures, ptCandLb, outputMl); hfMlLbToLcPiCandidate(outputMl[1]); if (!isSelectedMl) { diff --git a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx index 6fb022813b9..bc208719ee6 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx @@ -567,15 +567,15 @@ struct HfDataCreatorCharmHadPiReduced { auto particleProng2 = vecDaughtersB[2].mcParticle(); auto particleProng3 = vecDaughtersB[3].mcParticle(); // b-hadron hypothesis - std::array bHadronMotherHypos = {Pdg::kB0, Pdg::kBS, Pdg::kLambdaB0}; + std::array const bHadronMotherHypos = {Pdg::kB0, Pdg::kBS, Pdg::kLambdaB0}; // c-hadron hypothesis - std::array cHadronMotherHypos = {Pdg::kDPlus, Pdg::kDS, Pdg::kDStar, Pdg::kLambdaCPlus}; + std::array const cHadronMotherHypos = {Pdg::kDPlus, Pdg::kDS, Pdg::kDStar, Pdg::kLambdaCPlus}; for (const auto& bHadronMotherHypo : bHadronMotherHypos) { - int index0Mother = RecoDecay::getMother(particlesMc, particleProng0, bHadronMotherHypo, true); - int index1Mother = RecoDecay::getMother(particlesMc, particleProng1, bHadronMotherHypo, true); - int index2Mother = RecoDecay::getMother(particlesMc, particleProng2, bHadronMotherHypo, true); - int index3Mother = RecoDecay::getMother(particlesMc, particleProng3, bHadronMotherHypo, true); + int const index0Mother = RecoDecay::getMother(particlesMc, particleProng0, bHadronMotherHypo, true); + int const index1Mother = RecoDecay::getMother(particlesMc, particleProng1, bHadronMotherHypo, true); + int const index2Mother = RecoDecay::getMother(particlesMc, particleProng2, bHadronMotherHypo, true); + int const index3Mother = RecoDecay::getMother(particlesMc, particleProng3, bHadronMotherHypo, true); // look for common b-hadron ancestor if (index0Mother > -1 && index1Mother > -1 && index2Mother > -1 && index3Mother > -1) { @@ -593,9 +593,9 @@ struct HfDataCreatorCharmHadPiReduced { if (cHadronMotherHypo == Pdg::kDStar) { // to include D* -> D π0/γ and D* -> D0 π depthMax += 1; } - int index0CharmMother = RecoDecay::getMother(particlesMc, particleProng0, cHadronMotherHypo, true, &sign, depthMax); - int index1CharmMother = RecoDecay::getMother(particlesMc, particleProng1, cHadronMotherHypo, true, &sign, depthMax); - int index2CharmMother = RecoDecay::getMother(particlesMc, particleProng2, cHadronMotherHypo, true, &sign, depthMax); + int const index0CharmMother = RecoDecay::getMother(particlesMc, particleProng0, cHadronMotherHypo, true, &sign, depthMax); + int const index1CharmMother = RecoDecay::getMother(particlesMc, particleProng1, cHadronMotherHypo, true, &sign, depthMax); + int const index2CharmMother = RecoDecay::getMother(particlesMc, particleProng2, cHadronMotherHypo, true, &sign, depthMax); if (index0CharmMother > -1 && index1CharmMother > -1 && index2CharmMother > -1) { if (index0CharmMother == index1CharmMother && index1CharmMother == index2CharmMother) { // pdgCodeCharmMother = @@ -721,15 +721,15 @@ struct HfDataCreatorCharmHadPiReduced { auto particleProng2 = vecDaughtersB[2].mcParticle(); auto particleProng3 = vecDaughtersB[3].mcParticle(); // b-hadron hypothesis - std::array bHadronMotherHypos = {Pdg::kB0, Pdg::kBS, Pdg::kLambdaB0}; + std::array const bHadronMotherHypos = {Pdg::kB0, Pdg::kBS, Pdg::kLambdaB0}; // c-hadron hypothesis - std::array cHadronMotherHypos = {Pdg::kDPlus, Pdg::kDS, Pdg::kDStar, Pdg::kDSStar, Pdg::kLambdaCPlus}; + std::array const cHadronMotherHypos = {Pdg::kDPlus, Pdg::kDS, Pdg::kDStar, Pdg::kDSStar, Pdg::kLambdaCPlus}; for (const auto& bHadronMotherHypo : bHadronMotherHypos) { - int index0Mother = RecoDecay::getMother(particlesMc, particleProng0, bHadronMotherHypo, true); - int index1Mother = RecoDecay::getMother(particlesMc, particleProng1, bHadronMotherHypo, true); - int index2Mother = RecoDecay::getMother(particlesMc, particleProng2, bHadronMotherHypo, true); - int index3Mother = RecoDecay::getMother(particlesMc, particleProng3, bHadronMotherHypo, true); + int const index0Mother = RecoDecay::getMother(particlesMc, particleProng0, bHadronMotherHypo, true); + int const index1Mother = RecoDecay::getMother(particlesMc, particleProng1, bHadronMotherHypo, true); + int const index2Mother = RecoDecay::getMother(particlesMc, particleProng2, bHadronMotherHypo, true); + int const index3Mother = RecoDecay::getMother(particlesMc, particleProng3, bHadronMotherHypo, true); // look for common b-hadron ancestor if (index0Mother > -1 && index1Mother > -1 && index2Mother > -1 && index3Mother > -1) { @@ -747,9 +747,9 @@ struct HfDataCreatorCharmHadPiReduced { if (cHadronMotherHypo == Pdg::kDStar || cHadronMotherHypo == Pdg::kDSStar) { // to include D* -> D π0/γ, D* -> D0 π, and Ds* -> Ds π0/γ depthMax += 1; } - int index0CharmMother = RecoDecay::getMother(particlesMc, particleProng0, cHadronMotherHypo, true, &sign, depthMax); - int index1CharmMother = RecoDecay::getMother(particlesMc, particleProng1, cHadronMotherHypo, true, &sign, depthMax); - int index2CharmMother = RecoDecay::getMother(particlesMc, particleProng2, cHadronMotherHypo, true, &sign, depthMax); + int const index0CharmMother = RecoDecay::getMother(particlesMc, particleProng0, cHadronMotherHypo, true, &sign, depthMax); + int const index1CharmMother = RecoDecay::getMother(particlesMc, particleProng1, cHadronMotherHypo, true, &sign, depthMax); + int const index2CharmMother = RecoDecay::getMother(particlesMc, particleProng2, cHadronMotherHypo, true, &sign, depthMax); if (index0CharmMother > -1 && index1CharmMother > -1 && index2CharmMother > -1) { if (index0CharmMother == index1CharmMother && index1CharmMother == index2CharmMother) { // pdgCodeCharmMother = @@ -821,14 +821,14 @@ struct HfDataCreatorCharmHadPiReduced { auto particleProng1 = vecDaughtersB[1].mcParticle(); auto particleProng2 = vecDaughtersB[2].mcParticle(); // b-hadron hypothesis - std::array bHadronMotherHypos = {Pdg::kBPlus, Pdg::kB0, Pdg::kBS, Pdg::kLambdaB0}; + std::array const bHadronMotherHypos = {Pdg::kBPlus, Pdg::kB0, Pdg::kBS, Pdg::kLambdaB0}; // c-hadron hypothesis - std::array cHadronMotherHypos = {Pdg::kD0, Pdg::kDPlus, Pdg::kDS, Pdg::kDStar, 423, Pdg::kDSStar, Pdg::kLambdaCPlus}; + std::array const cHadronMotherHypos = {Pdg::kD0, Pdg::kDPlus, Pdg::kDS, Pdg::kDStar, 423, Pdg::kDSStar, Pdg::kLambdaCPlus}; for (const auto& bHadronMotherHypo : bHadronMotherHypos) { - int index0Mother = RecoDecay::getMother(particlesMc, particleProng0, bHadronMotherHypo, true); - int index1Mother = RecoDecay::getMother(particlesMc, particleProng1, bHadronMotherHypo, true); - int index2Mother = RecoDecay::getMother(particlesMc, particleProng2, bHadronMotherHypo, true); + int const index0Mother = RecoDecay::getMother(particlesMc, particleProng0, bHadronMotherHypo, true); + int const index1Mother = RecoDecay::getMother(particlesMc, particleProng1, bHadronMotherHypo, true); + int const index2Mother = RecoDecay::getMother(particlesMc, particleProng2, bHadronMotherHypo, true); // look for common b-hadron ancestor if (index0Mother > -1 && index1Mother > -1 && index2Mother > -1) { @@ -845,8 +845,8 @@ struct HfDataCreatorCharmHadPiReduced { if (cHadronMotherHypo == Pdg::kDStar || cHadronMotherHypo == Pdg::kDStar0 || cHadronMotherHypo == Pdg::kDSStar) { // to include D* -> D π0/γ, D* -> D0 π, and Ds* -> Ds π0/γ depthMax += 1; } - int index0CharmMother = RecoDecay::getMother(particlesMc, particleProng0, cHadronMotherHypo, true, &sign, depthMax); - int index1CharmMother = RecoDecay::getMother(particlesMc, particleProng1, cHadronMotherHypo, true, &sign, depthMax); + int const index0CharmMother = RecoDecay::getMother(particlesMc, particleProng0, cHadronMotherHypo, true, &sign, depthMax); + int const index1CharmMother = RecoDecay::getMother(particlesMc, particleProng1, cHadronMotherHypo, true, &sign, depthMax); if (index0CharmMother > -1 && index1CharmMother > -1) { if (index0CharmMother == index1CharmMother) { // pdgCodeCharmMother = @@ -923,15 +923,15 @@ struct HfDataCreatorCharmHadPiReduced { auto particleProng2 = vecDaughtersB[2].mcParticle(); auto particleProng3 = vecDaughtersB[3].mcParticle(); // b-hadron hypothesis - std::array bHadronMotherHypos = {Pdg::kB0, Pdg::kBS, Pdg::kLambdaB0}; + std::array const bHadronMotherHypos = {Pdg::kB0, Pdg::kBS, Pdg::kLambdaB0}; // c-hadron hypothesis - std::array cHadronMotherHypos = {Pdg::kDPlus, Pdg::kDS, Pdg::kDStar, Pdg::kLambdaCPlus}; + std::array const cHadronMotherHypos = {Pdg::kDPlus, Pdg::kDS, Pdg::kDStar, Pdg::kLambdaCPlus}; for (const auto& bHadronMotherHypo : bHadronMotherHypos) { - int index0Mother = RecoDecay::getMother(particlesMc, particleProng0, bHadronMotherHypo, true); - int index1Mother = RecoDecay::getMother(particlesMc, particleProng1, bHadronMotherHypo, true); - int index2Mother = RecoDecay::getMother(particlesMc, particleProng2, bHadronMotherHypo, true); - int index3Mother = RecoDecay::getMother(particlesMc, particleProng3, bHadronMotherHypo, true); + int const index0Mother = RecoDecay::getMother(particlesMc, particleProng0, bHadronMotherHypo, true); + int const index1Mother = RecoDecay::getMother(particlesMc, particleProng1, bHadronMotherHypo, true); + int const index2Mother = RecoDecay::getMother(particlesMc, particleProng2, bHadronMotherHypo, true); + int const index3Mother = RecoDecay::getMother(particlesMc, particleProng3, bHadronMotherHypo, true); // look for common b-hadron ancestor if (index0Mother > -1 && index1Mother > -1 && index2Mother > -1 && index3Mother > -1) { @@ -949,9 +949,9 @@ struct HfDataCreatorCharmHadPiReduced { if (cHadronMotherHypo == Pdg::kDStar) { // to include D* -> D π0/γ and D* -> D0 π depthMax += 1; } - int index0CharmMother = RecoDecay::getMother(particlesMc, particleProng0, cHadronMotherHypo, true, &sign, depthMax); - int index1CharmMother = RecoDecay::getMother(particlesMc, particleProng1, cHadronMotherHypo, true, &sign, depthMax); - int index2CharmMother = RecoDecay::getMother(particlesMc, particleProng2, cHadronMotherHypo, true, &sign, depthMax); + int const index0CharmMother = RecoDecay::getMother(particlesMc, particleProng0, cHadronMotherHypo, true, &sign, depthMax); + int const index1CharmMother = RecoDecay::getMother(particlesMc, particleProng1, cHadronMotherHypo, true, &sign, depthMax); + int const index2CharmMother = RecoDecay::getMother(particlesMc, particleProng2, cHadronMotherHypo, true, &sign, depthMax); if (index0CharmMother > -1 && index1CharmMother > -1 && index2CharmMother > -1) { if (index0CharmMother == index1CharmMother && index1CharmMother == index2CharmMother) { // pdgCodeCharmMother = @@ -1029,7 +1029,7 @@ struct HfDataCreatorCharmHadPiReduced { } // helpers for ReducedTables filling - int indexHfReducedCollision = tables.hfReducedCollision.lastIndex() + 1; + int const indexHfReducedCollision = tables.hfReducedCollision.lastIndex() + 1; // std::map where the key is the track.globalIndex() and // the value is the track index in the table of the selected pions std::map selectedTracksPion; @@ -2311,7 +2311,7 @@ struct HfDataCreatorCharmHadPiReduced { auto candsCThisColl = candsC.sliceBy(preslices.candsDplusPerCollision, thisCollId); auto trackIdsThisCollision = trackIndices.sliceBy(preslices.trackIndicesPerCollision, thisCollId); auto collsSameMcCollision = collisions.sliceBy(preslices.colPerMcCollision, collision.mcCollisionId()); - int64_t indexCollisionMaxNumContrib = getIndexCollisionMaxNumContrib(collsSameMcCollision); + int64_t const indexCollisionMaxNumContrib = getIndexCollisionMaxNumContrib(collsSameMcCollision); runDataCreation(collision, candsCThisColl, trackIdsThisCollision, tracks, particlesMc, indexCollisionMaxNumContrib, bcs); } // handle normalization by the right number of collisions @@ -2348,7 +2348,7 @@ struct HfDataCreatorCharmHadPiReduced { auto candsCThisColl = candsC.sliceBy(preslices.candsDplusPerCollisionWithMl, thisCollId); auto trackIdsThisCollision = trackIndices.sliceBy(preslices.trackIndicesPerCollision, thisCollId); auto collsSameMcCollision = collisions.sliceBy(preslices.colPerMcCollision, collision.mcCollisionId()); - int64_t indexCollisionMaxNumContrib = getIndexCollisionMaxNumContrib(collsSameMcCollision); + int64_t const indexCollisionMaxNumContrib = getIndexCollisionMaxNumContrib(collsSameMcCollision); runDataCreation(collision, candsCThisColl, trackIdsThisCollision, tracks, particlesMc, indexCollisionMaxNumContrib, bcs); } // handle normalization by the right number of collisions @@ -2386,7 +2386,7 @@ struct HfDataCreatorCharmHadPiReduced { auto candsCThisColl = candsC.sliceBy(preslices.candsDstarPerCollision, thisCollId); auto trackIdsThisCollision = trackIndices.sliceBy(preslices.trackIndicesPerCollision, thisCollId); auto collsSameMcCollision = collisions.sliceBy(preslices.colPerMcCollision, collision.mcCollisionId()); - int64_t indexCollisionMaxNumContrib = getIndexCollisionMaxNumContrib(collsSameMcCollision); + int64_t const indexCollisionMaxNumContrib = getIndexCollisionMaxNumContrib(collsSameMcCollision); runDataCreation(collision, candsCThisColl, trackIdsThisCollision, tracks, particlesMc, indexCollisionMaxNumContrib, bcs); } // handle normalization by the right number of collisions @@ -2424,7 +2424,7 @@ struct HfDataCreatorCharmHadPiReduced { auto candsCThisColl = candsC.sliceBy(preslices.candsDstarPerCollisionWithMl, thisCollId); auto trackIdsThisCollision = trackIndices.sliceBy(preslices.trackIndicesPerCollision, thisCollId); auto collsSameMcCollision = collisions.sliceBy(preslices.colPerMcCollision, collision.mcCollisionId()); - int64_t indexCollisionMaxNumContrib = getIndexCollisionMaxNumContrib(collsSameMcCollision); + int64_t const indexCollisionMaxNumContrib = getIndexCollisionMaxNumContrib(collsSameMcCollision); runDataCreation(collision, candsCThisColl, trackIdsThisCollision, tracks, particlesMc, indexCollisionMaxNumContrib, bcs); } // handle normalization by the right number of collisions @@ -2461,7 +2461,7 @@ struct HfDataCreatorCharmHadPiReduced { auto candsCThisColl = candsC.sliceBy(preslices.candsDsPerCollision, thisCollId); auto trackIdsThisCollision = trackIndices.sliceBy(preslices.trackIndicesPerCollision, thisCollId); auto collsSameMcCollision = collisions.sliceBy(preslices.colPerMcCollision, collision.mcCollisionId()); - int64_t indexCollisionMaxNumContrib = getIndexCollisionMaxNumContrib(collsSameMcCollision); + int64_t const indexCollisionMaxNumContrib = getIndexCollisionMaxNumContrib(collsSameMcCollision); runDataCreation(collision, candsCThisColl, trackIdsThisCollision, tracks, particlesMc, indexCollisionMaxNumContrib, bcs); } // handle normalization by the right number of collisions @@ -2498,7 +2498,7 @@ struct HfDataCreatorCharmHadPiReduced { auto candsCThisColl = candsC.sliceBy(preslices.candsDsPerCollisionWithMl, thisCollId); auto trackIdsThisCollision = trackIndices.sliceBy(preslices.trackIndicesPerCollision, thisCollId); auto collsSameMcCollision = collisions.sliceBy(preslices.colPerMcCollision, collision.mcCollisionId()); - int64_t indexCollisionMaxNumContrib = getIndexCollisionMaxNumContrib(collsSameMcCollision); + int64_t const indexCollisionMaxNumContrib = getIndexCollisionMaxNumContrib(collsSameMcCollision); runDataCreation(collision, candsCThisColl, trackIdsThisCollision, tracks, particlesMc, indexCollisionMaxNumContrib, bcs); } // handle normalization by the right number of collisions @@ -2535,7 +2535,7 @@ struct HfDataCreatorCharmHadPiReduced { auto candsCThisColl = candsC.sliceBy(preslices.candsD0PerCollision, thisCollId); auto trackIdsThisCollision = trackIndices.sliceBy(preslices.trackIndicesPerCollision, thisCollId); auto collsSameMcCollision = collisions.sliceBy(preslices.colPerMcCollision, collision.mcCollisionId()); - int64_t indexCollisionMaxNumContrib = getIndexCollisionMaxNumContrib(collsSameMcCollision); + int64_t const indexCollisionMaxNumContrib = getIndexCollisionMaxNumContrib(collsSameMcCollision); runDataCreation(collision, candsCThisColl, trackIdsThisCollision, tracks, particlesMc, indexCollisionMaxNumContrib, bcs); } // handle normalization by the right number of collisions @@ -2572,7 +2572,7 @@ struct HfDataCreatorCharmHadPiReduced { auto candsCThisColl = candsC.sliceBy(preslices.candsD0PerCollisionWithMl, thisCollId); auto trackIdsThisCollision = trackIndices.sliceBy(preslices.trackIndicesPerCollision, thisCollId); auto collsSameMcCollision = collisions.sliceBy(preslices.colPerMcCollision, collision.mcCollisionId()); - int64_t indexCollisionMaxNumContrib = getIndexCollisionMaxNumContrib(collsSameMcCollision); + int64_t const indexCollisionMaxNumContrib = getIndexCollisionMaxNumContrib(collsSameMcCollision); runDataCreation(collision, candsCThisColl, trackIdsThisCollision, tracks, particlesMc, indexCollisionMaxNumContrib, bcs); } // handle normalization by the right number of collisions @@ -2609,7 +2609,7 @@ struct HfDataCreatorCharmHadPiReduced { auto candsCThisColl = candsC.sliceBy(preslices.candsLcPerCollision, thisCollId); auto trackIdsThisCollision = trackIndices.sliceBy(preslices.trackIndicesPerCollision, thisCollId); auto collsSameMcCollision = collisions.sliceBy(preslices.colPerMcCollision, collision.mcCollisionId()); - int64_t indexCollisionMaxNumContrib = getIndexCollisionMaxNumContrib(collsSameMcCollision); + int64_t const indexCollisionMaxNumContrib = getIndexCollisionMaxNumContrib(collsSameMcCollision); runDataCreation(collision, candsCThisColl, trackIdsThisCollision, tracks, particlesMc, indexCollisionMaxNumContrib, bcs); } // handle normalization by the right number of collisions @@ -2646,7 +2646,7 @@ struct HfDataCreatorCharmHadPiReduced { auto candsCThisColl = candsC.sliceBy(preslices.candsLcPerCollisionWithMl, thisCollId); auto trackIdsThisCollision = trackIndices.sliceBy(preslices.trackIndicesPerCollision, thisCollId); auto collsSameMcCollision = collisions.sliceBy(preslices.colPerMcCollision, collision.mcCollisionId()); - int64_t indexCollisionMaxNumContrib = getIndexCollisionMaxNumContrib(collsSameMcCollision); + int64_t const indexCollisionMaxNumContrib = getIndexCollisionMaxNumContrib(collsSameMcCollision); runDataCreation(collision, candsCThisColl, trackIdsThisCollision, tracks, particlesMc, indexCollisionMaxNumContrib, bcs); } // handle normalization by the right number of collisions diff --git a/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx index a760434fb13..9cb426b3a31 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx @@ -351,7 +351,7 @@ struct HfDataCreatorCharmResoReduced { doprocessDstarV0MC || doprocessDstarTrackMC || doprocessDstarV0AndTrackMC || doprocessDstarV0MCWithMl || doprocessDstarTrackMCWithMl || doprocessDstarV0AndTrackMCWithMl || doprocessDplusV0MC || doprocessDplusTrackMC || doprocessDplusV0AndTrackMC || doprocessDplusV0MCWithMl || doprocessDplusTrackMCWithMl || doprocessDplusV0AndTrackMCWithMl) { // MC Rec - int nChannels = hf_decay::hf_cand_reso::DecayChannelMain::NChannelsMain; + int const nChannels = hf_decay::hf_cand_reso::DecayChannelMain::NChannelsMain; registry.add("hMCRecCounter", "Number of Reconstructed MC Matched candidates per channel", {HistType::kTH1D, {{2 * nChannels + 1, -(nChannels + 0.5), nChannels + 0.5}}}); registry.add("hMCRecDebug", "Debug of MC Reco", {HistType::kTH1D, {{551, -0.5, 550.5}}}); registry.add("hMCRecOrigin", "Origin of Matched particles", {HistType::kTH1D, {{3, -0.5, 2.5}}}); @@ -426,9 +426,9 @@ struct HfDataCreatorCharmResoReduced { // Utility to find which v0 daughter carries the largest fraction of the mother longitudinal momentum float alphaAP(std::array const& momA, std::array const& momB, std::array const& momC) { - float momTot = std::sqrt(std::pow(momA[0], 2.) + std::pow(momA[1], 2.) + std::pow(momA[2], 2.)); - float lQlPos = (momB[0] * momA[0] + momB[1] * momA[1] + momB[2] * momA[2]) / momTot; - float lQlNeg = (momC[0] * momA[0] + momC[1] * momA[1] + momC[2] * momA[2]) / momTot; + float const momTot = std::sqrt(std::pow(momA[0], 2.) + std::pow(momA[1], 2.) + std::pow(momA[2], 2.)); + float const lQlPos = (momB[0] * momA[0] + momB[1] * momA[1] + momB[2] * momA[2]) / momTot; + float const lQlNeg = (momC[0] * momA[0] + momC[1] * momA[1] + momC[2] * momA[2]) / momTot; return (lQlPos - lQlNeg) / (lQlPos + lQlNeg); } // Utility to find DCA of V0 to Primary vertex @@ -512,7 +512,7 @@ struct HfDataCreatorCharmResoReduced { return false; } // v0 cosine of pointing angle - std::array primVtx = {collision.posX(), collision.posY(), collision.posZ()}; + std::array const primVtx = {collision.posX(), collision.posY(), collision.posZ()}; candidateV0.cosPA = RecoDecay::cpa(primVtx, vtx, candidateV0.mom); if (candidateV0.cosPA < cfgV0Cuts.cosPa) { return false; @@ -521,7 +521,7 @@ struct HfDataCreatorCharmResoReduced { candidateV0.v0Type = {BIT(BachelorType::K0s) | BIT(BachelorType::Lambda) | BIT(BachelorType::AntiLambda)}; // for lambda hypotesys define if its lambda or anti-lambda candidateV0.alpha = alphaAP(candidateV0.mom, candidateV0.momPos, candidateV0.momNeg); - bool matter = candidateV0.alpha > 0; + bool const matter = candidateV0.alpha > 0; CLRBIT(candidateV0.v0Type, matter ? BachelorType::AntiLambda : BachelorType::Lambda); auto massPos = matter ? o2::constants::physics::MassProton : o2::constants::physics::MassPionCharged; auto massNeg = matter ? o2::constants::physics::MassPionCharged : o2::constants::physics::MassProton; @@ -598,9 +598,9 @@ struct HfDataCreatorCharmResoReduced { if (!track.hasTPC()) { return false; } - bool isPion = std::abs(track.tpcNSigmaPi()) < cfgSingleTrackCuts.maxNsigmaTpcPi; - bool isKaon = std::abs(track.tpcNSigmaKa()) < cfgSingleTrackCuts.maxNsigmaTpcKa; - bool isProton = std::abs(track.tpcNSigmaPr()) < cfgSingleTrackCuts.maxNsigmaTpcPr; + bool const isPion = std::abs(track.tpcNSigmaPi()) < cfgSingleTrackCuts.maxNsigmaTpcPi; + bool const isKaon = std::abs(track.tpcNSigmaKa()) < cfgSingleTrackCuts.maxNsigmaTpcKa; + bool const isProton = std::abs(track.tpcNSigmaPr()) < cfgSingleTrackCuts.maxNsigmaTpcPr; return (isPion || isKaon || isProton); // we keep the track if is it compatible with at least one of the PID hypotheses selected } @@ -677,7 +677,7 @@ struct HfDataCreatorCharmResoReduced { } // If both D* and K0s are matched, try to match resonance if (flagCharmBach != 0 && flagV0 == hf_decay::hf_cand_reso::PartialMatchMc::K0Matched) { - std::array pdgCodesDaughters = {+kPiPlus, -kKPlus, +kPiPlus, +kPiPlus, -kPiPlus}; + std::array const pdgCodesDaughters = {+kPiPlus, -kKPlus, +kPiPlus, +kPiPlus, -kPiPlus}; auto arrDaughtersReso = std::array{vecDaughtersReso[0], vecDaughtersReso[1], vecDaughtersReso[2], vecDaughtersReso[3], vecDaughtersReso[4]}; for (const auto& [decayChannelFlag, pdgCodeReso] : hf_decay::hf_cand_reso::particlesToDstarK0s) { indexRec = RecoDecay::getMatchedMCRec(particlesMc, arrDaughtersReso, pdgCodeReso, pdgCodesDaughters, true, &sign, 3, &nKinkedTracks); @@ -687,7 +687,7 @@ struct HfDataCreatorCharmResoReduced { } } } else if (flagCharmBachInterm != 0 && flagV0 == hf_decay::hf_cand_reso::PartialMatchMc::K0Matched) { - std::array pdgCodesDaughters = {+kPiPlus, -kKPlus, +kPiPlus, -kPiPlus}; + std::array const pdgCodesDaughters = {+kPiPlus, -kKPlus, +kPiPlus, -kPiPlus}; auto arrDaughtersReso = std::array{vecDaughtersReso[0], vecDaughtersReso[1], vecDaughtersReso[3], vecDaughtersReso[4]}; // Peaking background of D0K0s <- Ds* with spurious soft pion for (const auto& [decayChannelFlag, pdgCodeReso] : hf_decay::hf_cand_reso::particlesToDstarK0s) { @@ -1011,7 +1011,7 @@ struct HfDataCreatorCharmResoReduced { if (rejectCollisionsWithBadEvSel && hfRejMap != 0) { return; } - int indexHfReducedCollision = hfReducedCollision.lastIndex() + 1; + int const indexHfReducedCollision = hfReducedCollision.lastIndex() + 1; // std::map where the key is the V0.globalIndex() and // the value is the V0 index in the table of the selected v0s std::map selectedV0s; @@ -1155,7 +1155,7 @@ struct HfDataCreatorCharmResoReduced { } // propagate V0 to primary vertex (if enabled) if (propagateV0toPV) { - std::array pVecV0Orig = {candidateV0.mom[0], candidateV0.mom[1], candidateV0.mom[2]}; + std::array const pVecV0Orig = {candidateV0.mom[0], candidateV0.mom[1], candidateV0.mom[2]}; std::array dcaInfo{}; auto trackParK0 = o2::track::TrackPar(candidateV0.pos, pVecV0Orig, 0, true); trackParK0.setPID(o2::track::PID::K0); @@ -1197,8 +1197,8 @@ struct HfDataCreatorCharmResoReduced { break; // no other D meson types expected } // end of dType switch } // matched with K0s - bool isLambda = TESTBIT(candidateV0.v0Type, BachelorType::Lambda); - bool isAntiLambda = TESTBIT(candidateV0.v0Type, BachelorType::AntiLambda); + bool const isLambda = TESTBIT(candidateV0.v0Type, BachelorType::Lambda); + bool const isAntiLambda = TESTBIT(candidateV0.v0Type, BachelorType::AntiLambda); if (isLambda || isAntiLambda) { registry.fill(HIST("hMassVsPtLambda"), candidateV0.pT, candidateV0.mLambda); switch (DType) { @@ -1556,15 +1556,15 @@ struct HfDataCreatorCharmResoReduced { McCollisions const& mcCollisions, BCsInfo const&) { - bool doV0s = (PairingType == PairingType::V0Only || PairingType == PairingType::V0AndTrack); - bool doTracks = (PairingType == PairingType::TrackOnly || PairingType == PairingType::V0AndTrack); + bool const doV0s = (PairingType == PairingType::V0Only || PairingType == PairingType::V0AndTrack); + bool const doTracks = (PairingType == PairingType::TrackOnly || PairingType == PairingType::V0AndTrack); for (const auto& mcCollision : mcCollisions) { // Slice the particles table to get the particles for the current MC collision const auto mcParticlesPerMcColl = mcParticles.sliceBy(mcParticlesPerMcCollision, mcCollision.globalIndex()); // Slice the collisions table to get the collision info for the current MC collision float centrality{-1.f}; o2::hf_evsel::HfCollisionRejectionMask rejectionMask{}; - int nSplitColl = 0; + int const nSplitColl = 0; const auto collSlice = collInfos.sliceBy(colPerMcCollision, mcCollision.globalIndex()); rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, collSlice, centrality); hfEvSelMc.fillHistograms(mcCollision, rejectionMask, nSplitColl); diff --git a/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx index 02797338234..4778fcc168e 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx @@ -797,8 +797,8 @@ struct HfDataCreatorJpsiHadReduced { // --------------------------------- // reconstruct J/Psi candidate secondary vertex - o2::track::TrackParCov trackParCovJpsi{}; // FIXME: unused - std::array pVecJpsi{}; // FIXME: unused + o2::track::TrackParCov const trackParCovJpsi{}; // FIXME: unused + std::array const pVecJpsi{}; // FIXME: unused registry.fill(HIST("hFitCandidatesJpsi"), SVFitting::BeforeFit); try { if (df2.process(trackPosParCov, trackNegParCov) == 0) { diff --git a/PWGHF/D2H/Tasks/taskB0Reduced.cxx b/PWGHF/D2H/Tasks/taskB0Reduced.cxx index 58c88aabc48..8cbd55aa2f4 100644 --- a/PWGHF/D2H/Tasks/taskB0Reduced.cxx +++ b/PWGHF/D2H/Tasks/taskB0Reduced.cxx @@ -459,9 +459,9 @@ struct HfTaskB0Reduced { auto ptD = candidate.ptProng0(); auto invMassD = candD.invMassHypo0(); auto softPi = softPions.rawIteratorAt(candD.globalIndex()); - std::array posPv{candidate.posX(), candidate.posY(), candidate.posZ()}; - std::array posSvD{candD.xSecondaryVertex(), candD.ySecondaryVertex(), candD.zSecondaryVertex()}; - std::array momD{candD.pVector()}; + std::array const posPv{candidate.posX(), candidate.posY(), candidate.posZ()}; + std::array const posSvD{candD.xSecondaryVertex(), candD.ySecondaryVertex(), candD.zSecondaryVertex()}; + std::array const momD{candD.pVector()}; auto cospD = RecoDecay::cpa(posPv, posSvD, momD); auto cospXyD = RecoDecay::cpaXY(posPv, posSvD, momD); auto decLenD = RecoDecay::distance(posPv, posSvD); @@ -584,12 +584,12 @@ struct HfTaskB0Reduced { } } if (fillTree) { - float pseudoRndm = ptD * 1000. - static_cast(ptD * 1000); + float const pseudoRndm = ptD * 1000. - static_cast(ptD * 1000); if (flagMcMatchRec != 0 || (((DoMc && fillBackground) || !DoMc) && (ptCandB0 >= ptMaxForDownSample || pseudoRndm < downSampleBkgFactor))) { float prong0MlScoreBkg = -1.; float prong0MlScorePrompt = -1.; float prong0MlScoreNonprompt = -1.; - float candidateMlScoreSig = -1; + float const candidateMlScoreSig = -1; if constexpr (WithDmesMl) { prong0MlScoreBkg = candidate.prong0MlScoreBkg(); prong0MlScorePrompt = candidate.prong0MlScorePrompt(); @@ -695,9 +695,9 @@ struct HfTaskB0Reduced { auto candD = candidate.template prong0_as(); auto ptD = candidate.ptProng0(); auto invMassD = candD.invMassHypo0(); - std::array posPv{candidate.posX(), candidate.posY(), candidate.posZ()}; - std::array posSvD{candD.xSecondaryVertex(), candD.ySecondaryVertex(), candD.zSecondaryVertex()}; - std::array momD{candD.pVector()}; + std::array const posPv{candidate.posX(), candidate.posY(), candidate.posZ()}; + std::array const posSvD{candD.xSecondaryVertex(), candD.ySecondaryVertex(), candD.zSecondaryVertex()}; + std::array const momD{candD.pVector()}; auto cospD = RecoDecay::cpa(posPv, posSvD, momD); auto cospXyD = RecoDecay::cpaXY(posPv, posSvD, momD); auto decLenD = RecoDecay::distance(posPv, posSvD); @@ -838,7 +838,7 @@ struct HfTaskB0Reduced { } } if (fillTree) { - float pseudoRndm = ptD * 1000. - static_cast(ptD * 1000); + float const pseudoRndm = ptD * 1000. - static_cast(ptD * 1000); if (flagMcMatchRec != 0 || (((DoMc && fillBackground) || !DoMc) && (ptCandB0 >= ptMaxForDownSample || pseudoRndm < downSampleBkgFactor))) { float prong0MlScoreBkg = -1.; float prong0MlScorePrompt = -1.; @@ -948,7 +948,7 @@ struct HfTaskB0Reduced { std::array ptProngs = {particle.ptProng0(), particle.ptProng1()}; std::array yProngs = {particle.yProng0(), particle.yProng1()}; std::array etaProngs = {particle.etaProng0(), particle.etaProng1()}; - bool prongsInAcc = isProngInAcceptance(etaProngs[0], ptProngs[0]) && isProngInAcceptance(etaProngs[1], ptProngs[1]); + bool const prongsInAcc = isProngInAcceptance(etaProngs[0], ptProngs[0]) && isProngInAcceptance(etaProngs[1], ptProngs[1]); if (fillHistograms) { registry.fill(HIST("hPtProng0Gen"), ptParticle, ptProngs[0]); diff --git a/PWGHF/D2H/Tasks/taskBplusReduced.cxx b/PWGHF/D2H/Tasks/taskBplusReduced.cxx index 2358c730cc0..f47cc1c2c4e 100644 --- a/PWGHF/D2H/Tasks/taskBplusReduced.cxx +++ b/PWGHF/D2H/Tasks/taskBplusReduced.cxx @@ -413,9 +413,9 @@ struct HfTaskBplusReduced { auto candPi = candidate.template prong1_as(); auto ptD0 = candidate.ptProng0(); auto invMassD0 = (candPi.signed1Pt() < 0) ? candD0.invMassHypo0() : candD0.invMassHypo1(); - std::array posPv{candidate.posX(), candidate.posY(), candidate.posZ()}; - std::array posSvD{candD0.xSecondaryVertex(), candD0.ySecondaryVertex(), candD0.zSecondaryVertex()}; - std::array momD{candD0.pVector()}; + std::array const posPv{candidate.posX(), candidate.posY(), candidate.posZ()}; + std::array const posSvD{candD0.xSecondaryVertex(), candD0.ySecondaryVertex(), candD0.zSecondaryVertex()}; + std::array const momD{candD0.pVector()}; auto cpaD0 = RecoDecay::cpa(posPv, posSvD, momD); auto cpaXyD0 = RecoDecay::cpaXY(posPv, posSvD, momD); auto decLenD0 = RecoDecay::distance(posPv, posSvD); @@ -556,7 +556,7 @@ struct HfTaskBplusReduced { } } if (fillTree) { - float pseudoRndm = ptD0 * 1000. - static_cast(ptD0 * 1000); + float const pseudoRndm = ptD0 * 1000. - static_cast(ptD0 * 1000); if (ptCandBplus >= ptMaxForDownSample || pseudoRndm < downSampleBkgFactor) { float prong0MlScoreBkg = -1.; float prong0MlScorePrompt = -1.; @@ -680,7 +680,7 @@ struct HfTaskBplusReduced { std::array ptProngs = {particle.ptProng0(), particle.ptProng1()}; std::array yProngs = {particle.yProng0(), particle.yProng1()}; std::array etaProngs = {particle.etaProng0(), particle.etaProng1()}; - bool prongsInAcc = isProngInAcceptance(etaProngs[0], ptProngs[0]) && isProngInAcceptance(etaProngs[1], ptProngs[1]); + bool const prongsInAcc = isProngInAcceptance(etaProngs[0], ptProngs[0]) && isProngInAcceptance(etaProngs[1], ptProngs[1]); if (fillHistograms) { registry.fill(HIST("hPtProng0Gen"), ptParticle, ptProngs[0]); diff --git a/PWGHF/D2H/Tasks/taskBplusToJpsiKReduced.cxx b/PWGHF/D2H/Tasks/taskBplusToJpsiKReduced.cxx index 347fe6e6cca..85e89ec279e 100644 --- a/PWGHF/D2H/Tasks/taskBplusToJpsiKReduced.cxx +++ b/PWGHF/D2H/Tasks/taskBplusToJpsiKReduced.cxx @@ -406,7 +406,7 @@ struct HfTaskBplusToJpsiKReduced { } } - float pseudoRndm = ptJpsi * 1000. - static_cast(ptJpsi * 1000); + float const pseudoRndm = ptJpsi * 1000. - static_cast(ptJpsi * 1000); if (ptCandBplus >= ptMaxForDownSample || pseudoRndm < downSampleBkgFactor) { float ptMother = -1.; if constexpr (DoMc) { @@ -477,7 +477,7 @@ struct HfTaskBplusToJpsiKReduced { } std::array ptProngs = {particle.ptProng0(), particle.ptProng1()}; std::array etaProngs = {particle.etaProng0(), particle.etaProng1()}; - bool prongsInAcc = isProngInAcceptance(etaProngs[0], ptProngs[0]) && isProngInAcceptance(etaProngs[1], ptProngs[1]); + bool const prongsInAcc = isProngInAcceptance(etaProngs[0], ptProngs[0]) && isProngInAcceptance(etaProngs[1], ptProngs[1]); registry.fill(HIST("hPtJpsiGen"), ptProngs[0], ptParticle); registry.fill(HIST("hPtKGen"), ptProngs[1], ptParticle); diff --git a/PWGHF/D2H/Tasks/taskBsReduced.cxx b/PWGHF/D2H/Tasks/taskBsReduced.cxx index 901a3908e0f..44e5f5d8f82 100644 --- a/PWGHF/D2H/Tasks/taskBsReduced.cxx +++ b/PWGHF/D2H/Tasks/taskBsReduced.cxx @@ -408,9 +408,9 @@ struct HfTaskBsReduced { auto ptDs = candidate.ptProng0(); auto invMassDs = candDs.invMassHypo0() > 0 ? candDs.invMassHypo0() : candDs.invMassHypo1(); // TODO: here we are assuming that only one of the two hypotheses is filled, to be checked - std::array posPv{candidate.posX(), candidate.posY(), candidate.posZ()}; - std::array posSvDs{candDs.xSecondaryVertex(), candDs.ySecondaryVertex(), candDs.zSecondaryVertex()}; - std::array momDs{candDs.pVector()}; + std::array const posPv{candidate.posX(), candidate.posY(), candidate.posZ()}; + std::array const posSvDs{candDs.xSecondaryVertex(), candDs.ySecondaryVertex(), candDs.zSecondaryVertex()}; + std::array const momDs{candDs.pVector()}; auto cospDs = RecoDecay::cpa(posPv, posSvDs, momDs); auto cospXyDs = RecoDecay::cpaXY(posPv, posSvDs, momDs); auto decLenDs = RecoDecay::distance(posPv, posSvDs); @@ -545,7 +545,7 @@ struct HfTaskBsReduced { } } if (fillTree) { - float pseudoRndm = ptDs * 1000. - static_cast(ptDs * 1000); + float const pseudoRndm = ptDs * 1000. - static_cast(ptDs * 1000); if (flagMcMatchRec != 0 || (((DoMc && fillBackground) || !DoMc) && (ptCandBs >= ptMaxForDownSample || pseudoRndm < downSampleBkgFactor))) { float prong0MlScoreBkg = -1.; float prong0MlScorePrompt = -1.; @@ -663,7 +663,7 @@ struct HfTaskBsReduced { std::array ptProngs = {particle.ptProng0(), particle.ptProng1()}; std::array yProngs = {particle.yProng0(), particle.yProng1()}; std::array etaProngs = {particle.etaProng0(), particle.etaProng1()}; - bool prongsInAcc = isProngInAcceptance(etaProngs[0], ptProngs[0]) && isProngInAcceptance(etaProngs[1], ptProngs[1]); + bool const prongsInAcc = isProngInAcceptance(etaProngs[0], ptProngs[0]) && isProngInAcceptance(etaProngs[1], ptProngs[1]); if (fillHistograms) { registry.fill(HIST("hPtProng0Gen"), ptParticle, ptProngs[0]); diff --git a/PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx b/PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx index 76e21f2dc44..d8d977a29bf 100644 --- a/PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx +++ b/PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx @@ -376,8 +376,8 @@ struct HfTaskBsToJpsiPhiReduced { auto candJpsi = candidate.template jpsi_as(); auto candKa0 = candidate.template prong0Phi_as(); auto candKa1 = candidate.template prong1Phi_as(); - std::array pVecKa0 = {candKa0.px(), candKa0.py(), candKa0.pz()}; - std::array pVecKa1 = {candKa1.px(), candKa1.py(), candKa1.pz()}; + std::array const pVecKa0 = {candKa0.px(), candKa0.py(), candKa0.pz()}; + std::array const pVecKa1 = {candKa1.px(), candKa1.py(), candKa1.pz()}; auto ptJpsi = candidate.ptProng0(); auto invMassJpsi = candJpsi.m(); auto invMassPhi = RecoDecay::m(std::array{pVecKa0, pVecKa1}, std::array{o2::constants::physics::MassKPlus, o2::constants::physics::MassKPlus}); @@ -448,7 +448,7 @@ struct HfTaskBsToJpsiPhiReduced { } } - float pseudoRndm = ptJpsi * 1000. - static_cast(ptJpsi * 1000); + float const pseudoRndm = ptJpsi * 1000. - static_cast(ptJpsi * 1000); if (ptCandBs >= ptMaxForDownSample || pseudoRndm < downSampleBkgFactor) { float ptMother = -1.; if constexpr (DoMc) { @@ -532,7 +532,7 @@ struct HfTaskBsToJpsiPhiReduced { } std::array ptProngs = {particle.ptProng0(), particle.ptProng1()}; std::array etaProngs = {particle.etaProng0(), particle.etaProng1()}; - bool prongsInAcc = isProngInAcceptance(etaProngs[0], ptProngs[0]) && isProngInAcceptance(etaProngs[1], ptProngs[1]); + bool const prongsInAcc = isProngInAcceptance(etaProngs[0], ptProngs[0]) && isProngInAcceptance(etaProngs[1], ptProngs[1]); registry.fill(HIST("hPtJpsiGen"), ptProngs[0], ptParticle); registry.fill(HIST("hPtKGen"), ptProngs[1], ptParticle); diff --git a/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx b/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx index 32f43aa5612..60e8c1e6bb8 100644 --- a/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx +++ b/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx @@ -430,8 +430,8 @@ struct HfTaskCharmPolarisation { } } if (doprocessDstarMc || doprocessDstarMcWithMl || doprocessDstarMcInPbPb || doprocessDstarMcWithMlInPbPb || doprocessLcToPKPiMc || doprocessLcToPKPiMcWithMl || doprocessLcToPKPiBackgroundMcWithMl) { - std::vector hgenPromptAxes = {thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisCosThetaStarHelicity, thnAxisDausAcc, thnAxisResoChannelLc, thnAxisCharge}; - std::vector hgenNonPromptAxes = {thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisCosThetaStarHelicity, thnAxisPtB, thnAxisDausAcc, thnAxisResoChannelLc, thnAxisCharge}; + std::vector const hgenPromptAxes = {thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisCosThetaStarHelicity, thnAxisDausAcc, thnAxisResoChannelLc, thnAxisCharge}; + std::vector const hgenNonPromptAxes = {thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisCosThetaStarHelicity, thnAxisPtB, thnAxisDausAcc, thnAxisResoChannelLc, thnAxisCharge}; registry.add("hGenPromptHelicity", "THn for polarisation studies with cosThStar w.r.t. helicity axis and BDT scores for generated prompt D*+ candidates", HistType::kTHnSparseF, hgenPromptAxes); registry.add("hGenNonPromptHelicity", "THn for polarisation studies with cosThStar w.r.t. helicity axis and BDT scores for generated non-prompt D*+ candidates", HistType::kTHnSparseF, hgenNonPromptAxes); if (activatePartRecoDstar) { @@ -504,8 +504,8 @@ struct HfTaskCharmPolarisation { } } if (doprocessDstarMc || doprocessDstarMcWithMl || doprocessDstarMcInPbPb || doprocessDstarMcWithMlInPbPb || doprocessLcToPKPiMc || doprocessLcToPKPiMcWithMl || doprocessLcToPKPiBackgroundMcWithMl) { - std::vector hgenPromptAxes = {thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisCosThetaStarProduction, thnAxisDausAcc, thnAxisResoChannelLc, thnAxisCharge}; - std::vector hgenNonPromptAxes = {thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisCosThetaStarProduction, thnAxisPtB, thnAxisDausAcc, thnAxisResoChannelLc, thnAxisCharge}; + std::vector const hgenPromptAxes = {thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisCosThetaStarProduction, thnAxisDausAcc, thnAxisResoChannelLc, thnAxisCharge}; + std::vector const hgenNonPromptAxes = {thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisCosThetaStarProduction, thnAxisPtB, thnAxisDausAcc, thnAxisResoChannelLc, thnAxisCharge}; registry.add("hGenPromptProduction", "THn for polarisation studies with cosThStar w.r.t. production axis and BDT scores for generated prompt D*+ candidates", HistType::kTHnSparseF, hgenPromptAxes); registry.add("hGenNonPromptProduction", "THn for polarisation studies with cosThStar w.r.t. production axis and BDT scores for generated non-prompt D*+ candidates", HistType::kTHnSparseF, hgenNonPromptAxes); if (activatePartRecoDstar) { @@ -577,8 +577,8 @@ struct HfTaskCharmPolarisation { } } if (doprocessDstarMc || doprocessDstarMcWithMl || doprocessDstarMcInPbPb || doprocessDstarMcWithMlInPbPb || doprocessLcToPKPiMc || doprocessLcToPKPiMcWithMl || doprocessLcToPKPiBackgroundMcWithMl) { - std::vector hgenPromptAxes = {thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisCosThetaStarBeam, thnAxisDausAcc, thnAxisResoChannelLc, thnAxisCharge}; - std::vector hgenNonPromptAxes = {thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisCosThetaStarBeam, thnAxisPtB, thnAxisDausAcc, thnAxisResoChannelLc, thnAxisCharge}; + std::vector const hgenPromptAxes = {thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisCosThetaStarBeam, thnAxisDausAcc, thnAxisResoChannelLc, thnAxisCharge}; + std::vector const hgenNonPromptAxes = {thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisCosThetaStarBeam, thnAxisPtB, thnAxisDausAcc, thnAxisResoChannelLc, thnAxisCharge}; registry.add("hGenPromptBeam", "THn for polarisation studies with cosThStar w.r.t. beam axis and BDT scores for generated prompt D*+ candidates", HistType::kTHnSparseF, hgenPromptAxes); registry.add("hGenNonPromptBeam", "THn for polarisation studies with cosThStar w.r.t. beam axis and BDT scores for generated non-prompt D*+ candidates", HistType::kTHnSparseF, hgenNonPromptAxes); if (activatePartRecoDstar) { @@ -635,8 +635,8 @@ struct HfTaskCharmPolarisation { registry.add("hRandom", "THn for polarisation studies with cosThStar w.r.t. random axis and BDT scores", HistType::kTHnSparseF, hRandomaxes); } if (doprocessDstarMc || doprocessDstarMcWithMl || doprocessDstarMcInPbPb || doprocessDstarMcWithMlInPbPb || doprocessLcToPKPiMc || doprocessLcToPKPiMcWithMl || doprocessLcToPKPiBackgroundMcWithMl) { - std::vector hgenPromptAxes = {thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisCosThetaStarRandom, thnAxisDausAcc, thnAxisResoChannelLc, thnAxisCharge}; - std::vector hgenNonPromptAxes = {thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisCosThetaStarRandom, thnAxisPtB, thnAxisDausAcc, thnAxisResoChannelLc, thnAxisCharge}; + std::vector const hgenPromptAxes = {thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisCosThetaStarRandom, thnAxisDausAcc, thnAxisResoChannelLc, thnAxisCharge}; + std::vector const hgenNonPromptAxes = {thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisCosThetaStarRandom, thnAxisPtB, thnAxisDausAcc, thnAxisResoChannelLc, thnAxisCharge}; registry.add("hGenPromptRandom", "THn for polarisation studies with cosThStar w.r.t. random axis and BDT scores for generated prompt D*+ candidates", HistType::kTHnSparseF, hgenPromptAxes); registry.add("hGenNonPromptRandom", "THn for polarisation studies with cosThStar w.r.t. random axis and BDT scores for generated non-prompt D*+ candidates", HistType::kTHnSparseF, hgenNonPromptAxes); if (activatePartRecoDstar) { @@ -1482,7 +1482,7 @@ struct HfTaskCharmPolarisation { { float xQVec = -999.; float yQVec = -999.; - float amplQVec = -999.; + float const amplQVec = -999.; switch (qVecDetector) { case charm_polarisation::QvecEstimator::FV0A: xQVec = collision.qvecFV0ARe(); @@ -1530,13 +1530,13 @@ struct HfTaskCharmPolarisation { if constexpr (DoMc) { if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { partRecoDstar = std::abs(candidate.flagMcMatchRec()) == hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPiPi0 && std::abs(candidate.flagMcMatchRecD0()) == hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiKPi0; - bool signalDstar = std::abs(candidate.flagMcMatchRec()) == hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi && std::abs(candidate.flagMcMatchRecD0()) == hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK; + bool const signalDstar = std::abs(candidate.flagMcMatchRec()) == hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi && std::abs(candidate.flagMcMatchRecD0()) == hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK; if (!signalDstar && (!partRecoDstar || !activatePartRecoDstar)) { // this candidate is not signal and not partially reconstructed signal, skip return isCandidateInSignalRegion; } origin = candidate.originMcRec(); ptBhadMother = candidate.ptBhadMotherPart(); - int pdgBhadMother = candidate.pdgBhadMotherPart(); + int const pdgBhadMother = candidate.pdgBhadMotherPart(); // For unknown reasons there are charm hadrons coming directly from beauty diquarks without an intermediate B-hadron which have an unreasonable correlation between the pT of the charm hadron and the beauty mother. We also remove charm hadrons from quarkonia. if (origin == RecoDecay::OriginType::NonPrompt && (pdgBhadMother == 5101 || pdgBhadMother == 5103 || pdgBhadMother == 5201 || pdgBhadMother == 5203 || pdgBhadMother == 5301 || pdgBhadMother == 5303 || pdgBhadMother == 5401 || pdgBhadMother == 5403 || pdgBhadMother == 5503 || pdgBhadMother == 553 || pdgBhadMother == 555 || pdgBhadMother == 557)) { // o2-linter: disable=pdg/explicit-code, magic-number (constants not in the PDG header) return isCandidateInSignalRegion; @@ -1557,7 +1557,7 @@ struct HfTaskCharmPolarisation { /// Lc electric charge from MC truth /// This is checked when the reconstructed 3-prong candidate is matched to MC with RecoDecay::getMatchedMCRec - int8_t flagMc = candidate.flagMcMatchRec(); + int8_t const flagMc = candidate.flagMcMatchRec(); charge = std::abs(flagMc) > 0 ? flagMc / std::abs(flagMc) : 0; /// 0 should never happen, debug protection } } else { @@ -1755,9 +1755,9 @@ struct HfTaskCharmPolarisation { } /// control plots on pair masses - double invMass2KPiLc = invMassKPiLc * invMassKPiLc; - double invMass2PKLc = invMassPKLc * invMassPKLc; - double invMass2PPiLc = invMassPPiLc * invMassPPiLc; + double const invMass2KPiLc = invMassKPiLc * invMassKPiLc; + double const invMass2PKLc = invMassPKLc * invMassPKLc; + double const invMass2PPiLc = invMassPPiLc * invMassPPiLc; if (lcPKPiChannels.activateTHnLcChannelMonitor && bkgRotationId == 0) { /// fill Dalitz plot only for genuine candidates (i.e. non-rotated) registry.fill(HIST("hMass2PairsLcPKPi"), invMass2KPiLc, invMass2PKLc, invMass2PPiLc, candidate.pt()); @@ -1780,15 +1780,15 @@ struct HfTaskCharmPolarisation { continue; } - float phiRandom = gRandom->Uniform(0.f, constants::math::TwoPI); - float thetaRandom = gRandom->Uniform(0.f, constants::math::PI); - ROOT::Math::PxPyPzMVector fourVecDau = ROOT::Math::PxPyPzMVector(pxDau, pyDau, pzDau, massDau); - ROOT::Math::PxPyPzMVector fourVecMother = ROOT::Math::PxPyPzMVector(pxCharmHad, pyCharmHad, pzCharmHad, invMassCharmHad); - ROOT::Math::Boost boost{fourVecMother.BoostToCM()}; - ROOT::Math::PxPyPzMVector fourVecDauCM = boost(fourVecDau); - ROOT::Math::XYZVector threeVecDauCM = fourVecDauCM.Vect(); + float const phiRandom = gRandom->Uniform(0.f, constants::math::TwoPI); + float const thetaRandom = gRandom->Uniform(0.f, constants::math::PI); + ROOT::Math::PxPyPzMVector const fourVecDau = ROOT::Math::PxPyPzMVector(pxDau, pyDau, pzDau, massDau); + ROOT::Math::PxPyPzMVector const fourVecMother = ROOT::Math::PxPyPzMVector(pxCharmHad, pyCharmHad, pzCharmHad, invMassCharmHad); + ROOT::Math::Boost const boost{fourVecMother.BoostToCM()}; + ROOT::Math::PxPyPzMVector const fourVecDauCM = boost(fourVecDau); + ROOT::Math::XYZVector const threeVecDauCM = fourVecDauCM.Vect(); - float ptCharmHad = std::sqrt(pxCharmHad * pxCharmHad + pyCharmHad * pyCharmHad); // this definition is valid for both rotated and original candidates + float const ptCharmHad = std::sqrt(pxCharmHad * pxCharmHad + pyCharmHad * pyCharmHad); // this definition is valid for both rotated and original candidates if (!isCandidateInSignalRegion) { // it could be that only one mass hypothesis is in signal region isCandidateInSignalRegion = isInSignalRegion(invMassCharmHadForSparse); @@ -1810,15 +1810,15 @@ struct HfTaskCharmPolarisation { } // helicity - ROOT::Math::XYZVector helicityVec = fourVecMother.Vect(); + ROOT::Math::XYZVector const helicityVec = fourVecMother.Vect(); float cosThetaStarHelicity = -10.f; float phiHelicity = -10.f; // production - ROOT::Math::XYZVector normalVec = ROOT::Math::XYZVector(pyCharmHad, -pxCharmHad, 0.f); + ROOT::Math::XYZVector const normalVec = ROOT::Math::XYZVector(pyCharmHad, -pxCharmHad, 0.f); float cosThetaStarProduction = -10.f; float phiProduction = -10.f; // beam - ROOT::Math::XYZVector beamVec = ROOT::Math::XYZVector(0.f, 0.f, 1.f); + ROOT::Math::XYZVector const beamVec = ROOT::Math::XYZVector(0.f, 0.f, 1.f); float cosThetaStarBeam = -10.f; float phiBeam = -10.f; // random @@ -1831,11 +1831,11 @@ struct HfTaskCharmPolarisation { if constexpr (WithEp && !DoMc) { /// EP analysis - float xQvec = (*qVecs).at(0); - float yQvec = (*qVecs).at(1); - ROOT::Math::XYZVector qVecNorm = ROOT::Math::XYZVector(yQvec, -xQvec, 0.f); + float const xQvec = (*qVecs).at(0); + float const yQvec = (*qVecs).at(1); + ROOT::Math::XYZVector const qVecNorm = ROOT::Math::XYZVector(yQvec, -xQvec, 0.f); float cosThetaStarEP = -10.f; - float phiEP = -99.f; + float const phiEP = -99.f; if (activateTHnSparseCosThStarEP) { // EP @@ -1864,7 +1864,7 @@ struct HfTaskCharmPolarisation { } if (activateTHnSparseCosThStarRandom) { // random - ROOT::Math::XYZVector randomVec = ROOT::Math::XYZVector(std::sin(thetaRandom) * std::cos(phiRandom), std::sin(thetaRandom) * std::sin(phiRandom), std::cos(thetaRandom)); + ROOT::Math::XYZVector const randomVec = ROOT::Math::XYZVector(std::sin(thetaRandom) * std::cos(phiRandom), std::sin(thetaRandom) * std::sin(phiRandom), std::cos(thetaRandom)); cosThetaStarRandom = randomVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()); fillRecoHistos(invMassCharmHadForSparse, ptCharmHad, numPvContributors, rapidity, invMassD0, invMassKPiLc, cosThetaStarRandom, -99.f, outputMl, isRotatedCandidate, origin, ptBhadMother, resoChannelLc, absEtaTrackMin, numItsClsMin, numTpcClsMin, charge, nMuons, partRecoDstar); } @@ -1949,9 +1949,9 @@ struct HfTaskCharmPolarisation { originTriplet = RecoDecay::OriginType::Prompt; } else if (originProng0 == RecoDecay::OriginType::NonPrompt && originProng1 == RecoDecay::OriginType::NonPrompt && originProng2 == RecoDecay::OriginType::NonPrompt) { /// check if the three particles share the same B-hadron id. If yes: claim the triplet as "non-prompt" - int idBMotherProng0 = idxBhadMothersProng0.at(0); - int idBMotherProng1 = idxBhadMothersProng1.at(0); - int idBMotherProng2 = idxBhadMothersProng2.at(0); + int const idBMotherProng0 = idxBhadMothersProng0.at(0); + int const idBMotherProng1 = idxBhadMothersProng1.at(0); + int const idBMotherProng2 = idxBhadMothersProng2.at(0); if (idBMotherProng0 == idBMotherProng1 && idBMotherProng1 == idBMotherProng2) { originTriplet = RecoDecay::OriginType::NonPrompt; } @@ -1976,9 +1976,9 @@ struct HfTaskCharmPolarisation { int pdgMotherProng0 = -1; int pdgMotherProng1 = -1; int pdgMotherProng2 = -1; - bool atLeast2ProngsFromSameMother = (!idMothersProng0.empty() && !idMothersProng1.empty() && idMothersProng0.at(0) == idMothersProng1.at(0)) || - (!idMothersProng1.empty() && !idMothersProng2.empty() && idMothersProng1.at(0) == idMothersProng2.at(0)) || - (!idMothersProng0.empty() && !idMothersProng2.empty() && idMothersProng0.at(0) == idMothersProng2.at(0)); + bool const atLeast2ProngsFromSameMother = (!idMothersProng0.empty() && !idMothersProng1.empty() && idMothersProng0.at(0) == idMothersProng1.at(0)) || + (!idMothersProng1.empty() && !idMothersProng2.empty() && idMothersProng1.at(0) == idMothersProng2.at(0)) || + (!idMothersProng0.empty() && !idMothersProng2.empty() && idMothersProng0.at(0) == idMothersProng2.at(0)); if (atLeast2ProngsFromSameMother) { if (!idMothersProng0.empty()) { /// BEWARE: in case of mcCollision grouping, the idMother can anyway point to a particle in another collision (*) @@ -2002,7 +2002,7 @@ struct HfTaskCharmPolarisation { /// calculate inv. masses for pairs, depending on mass hypothesis std::array pVecPion = {}; - std::array pVecKaon = candidate.pVectorProng1(); + std::array const pVecKaon = candidate.pVectorProng1(); std::array pVecProton = {}; if (iMass == charm_polarisation::MassHyposLcToPKPi::PKPi && candidate.isSelLcToPKPi() >= selectionFlagLcToPKPi) { pVecProton = candidate.pVectorProng0(); @@ -2075,7 +2075,7 @@ struct HfTaskCharmPolarisation { bool partRecoDstar{false}; if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { partRecoDstar = (std::abs(mcParticle.flagMcMatchGen()) == hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPiPi0) && (std::abs(mcParticle.flagMcMatchGenD0()) == hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiKPi0); - bool signalDstar = (std::abs(mcParticle.flagMcMatchGen()) == hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi) && (std::abs(mcParticle.flagMcMatchGenD0()) == hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK); + bool const signalDstar = (std::abs(mcParticle.flagMcMatchGen()) == hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi) && (std::abs(mcParticle.flagMcMatchGenD0()) == hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK); if (!signalDstar && (!activatePartRecoDstar || !partRecoDstar)) { // this particle is not signal and not partially reconstructed signal, skip return; @@ -2083,7 +2083,7 @@ struct HfTaskCharmPolarisation { origin = mcParticle.originMcGen(); if (origin == RecoDecay::OriginType::NonPrompt) { auto bHadMother = mcParticles.rawIteratorAt(mcParticle.idxBhadMotherPart() - mcParticles.offset()); - int pdgBhadMother = std::abs(bHadMother.pdgCode()); + int const pdgBhadMother = std::abs(bHadMother.pdgCode()); // For unknown reasons there are charm hadrons coming directly from beauty diquarks without an intermediate B-hadron which have an unreasonable correlation between the pT of the charm hadron and the beauty mother. We also remove charm hadrons from quarkonia. if (pdgBhadMother == 5101 || pdgBhadMother == 5103 || pdgBhadMother == 5201 || pdgBhadMother == 5203 || pdgBhadMother == 5301 || pdgBhadMother == 5303 || pdgBhadMother == 5401 || pdgBhadMother == 5403 || pdgBhadMother == 5503 || pdgBhadMother == 553 || pdgBhadMother == 555 || pdgBhadMother == 557) { // o2-linter: disable=pdg/explicit-code, magic-number (constants not in the PDG header) return; @@ -2091,7 +2091,7 @@ struct HfTaskCharmPolarisation { ptBhadMother = bHadMother.pt(); } - std::array dauPdgs = {kPiPlus, o2::constants::physics::Pdg::kD0}; + std::array const dauPdgs = {kPiPlus, o2::constants::physics::Pdg::kD0}; RecoDecay::getDaughters(mcParticle, &listDaughters, dauPdgs, 1); massDau = massPi; massCharmHad = massDstar; @@ -2101,25 +2101,25 @@ struct HfTaskCharmPolarisation { } origin = mcParticle.originMcGen(); resoChannelLc = mcParticle.flagMcDecayChanGen(); - std::array dauPdgs = {kProton, -kKPlus, kPiPlus}; + std::array const dauPdgs = {kProton, -kKPlus, kPiPlus}; RecoDecay::getDaughters(mcParticle, &listDaughters, dauPdgs, 2); massDau = massProton; massCharmHad = massLc; /// electric charge from PDG code - int pdgCode = mcParticle.pdgCode(); + int const pdgCode = mcParticle.pdgCode(); charge = static_cast(pdgCode / std::abs(pdgCode)); } - float rapidity = mcParticle.y(); + float const rapidity = mcParticle.y(); if (std::abs(rapidity) > 1.f) { // we do not keep particles with |y| > 1 return; } - float pxCharmHad = mcParticle.px(); - float pyCharmHad = mcParticle.py(); - float pzCharmHad = mcParticle.pz(); - float ptCharmHad = mcParticle.pt(); + float const pxCharmHad = mcParticle.px(); + float const pyCharmHad = mcParticle.py(); + float const pzCharmHad = mcParticle.pz(); + float const ptCharmHad = mcParticle.pt(); float pxDau{-1000.f}, pyDau{-1000.f}, pzDau{-1000.f}; for (const auto& dauIdx : listDaughters) { @@ -2134,7 +2134,7 @@ struct HfTaskCharmPolarisation { } } else if (areDauInAcc) { // check also D0 daughters std::vector listDaughtersD0{}; - std::array dauPdgsD0 = {kPiPlus, -kKPlus}; + std::array const dauPdgsD0 = {kPiPlus, -kKPlus}; RecoDecay::getDaughters(mcParticle, &listDaughtersD0, dauPdgsD0, 1); for (const auto& dauIdxD0 : listDaughtersD0) { auto dauPartD0 = mcParticles.rawIteratorAt(dauIdxD0 - mcParticles.offset()); @@ -2153,32 +2153,32 @@ struct HfTaskCharmPolarisation { } } - float phiRandom = gRandom->Uniform(0.f, constants::math::TwoPI); - float thetaRandom = gRandom->Uniform(0.f, constants::math::PI); - ROOT::Math::PxPyPzMVector fourVecDau = ROOT::Math::PxPyPzMVector(pxDau, pyDau, pzDau, massDau); - ROOT::Math::PxPyPzMVector fourVecMother = ROOT::Math::PxPyPzMVector(pxCharmHad, pyCharmHad, pzCharmHad, massCharmHad); - ROOT::Math::Boost boost{fourVecMother.BoostToCM()}; - ROOT::Math::PxPyPzMVector fourVecDauCM = boost(fourVecDau); - ROOT::Math::XYZVector threeVecDauCM = fourVecDauCM.Vect(); + float const phiRandom = gRandom->Uniform(0.f, constants::math::TwoPI); + float const thetaRandom = gRandom->Uniform(0.f, constants::math::PI); + ROOT::Math::PxPyPzMVector const fourVecDau = ROOT::Math::PxPyPzMVector(pxDau, pyDau, pzDau, massDau); + ROOT::Math::PxPyPzMVector const fourVecMother = ROOT::Math::PxPyPzMVector(pxCharmHad, pyCharmHad, pzCharmHad, massCharmHad); + ROOT::Math::Boost const boost{fourVecMother.BoostToCM()}; + ROOT::Math::PxPyPzMVector const fourVecDauCM = boost(fourVecDau); + ROOT::Math::XYZVector const threeVecDauCM = fourVecDauCM.Vect(); if (activateTHnSparseCosThStarHelicity) { - ROOT::Math::XYZVector helicityVec = fourVecMother.Vect(); - float cosThetaStarHelicity = helicityVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()) / std::sqrt(helicityVec.Mag2()); + ROOT::Math::XYZVector const helicityVec = fourVecMother.Vect(); + float const cosThetaStarHelicity = helicityVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()) / std::sqrt(helicityVec.Mag2()); fillGenHistos(ptCharmHad, numPvContributors, rapidity, cosThetaStarHelicity, origin, ptBhadMother, areDauInAcc, resoChannelLc, charge, partRecoDstar); } if (activateTHnSparseCosThStarProduction) { - ROOT::Math::XYZVector normalVec = ROOT::Math::XYZVector(pyCharmHad, -pxCharmHad, 0.f); - float cosThetaStarProduction = normalVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()) / std::sqrt(normalVec.Mag2()); + ROOT::Math::XYZVector const normalVec = ROOT::Math::XYZVector(pyCharmHad, -pxCharmHad, 0.f); + float const cosThetaStarProduction = normalVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()) / std::sqrt(normalVec.Mag2()); fillGenHistos(ptCharmHad, numPvContributors, rapidity, cosThetaStarProduction, origin, ptBhadMother, areDauInAcc, resoChannelLc, charge, partRecoDstar); } if (activateTHnSparseCosThStarBeam) { - ROOT::Math::XYZVector beamVec = ROOT::Math::XYZVector(0.f, 0.f, 1.f); - float cosThetaStarBeam = beamVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()); + ROOT::Math::XYZVector const beamVec = ROOT::Math::XYZVector(0.f, 0.f, 1.f); + float const cosThetaStarBeam = beamVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()); fillGenHistos(ptCharmHad, numPvContributors, rapidity, cosThetaStarBeam, origin, ptBhadMother, areDauInAcc, resoChannelLc, charge, partRecoDstar); } if (activateTHnSparseCosThStarRandom) { - ROOT::Math::XYZVector randomVec = ROOT::Math::XYZVector(std::sin(thetaRandom) * std::cos(phiRandom), std::sin(thetaRandom) * std::sin(phiRandom), std::cos(thetaRandom)); - float cosThetaStarRandom = randomVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()); + ROOT::Math::XYZVector const randomVec = ROOT::Math::XYZVector(std::sin(thetaRandom) * std::cos(phiRandom), std::sin(thetaRandom) * std::sin(phiRandom), std::cos(thetaRandom)); + float const cosThetaStarRandom = randomVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()); fillGenHistos(ptCharmHad, numPvContributors, rapidity, cosThetaStarRandom, origin, ptBhadMother, areDauInAcc, resoChannelLc, charge, partRecoDstar); } } @@ -2194,7 +2194,7 @@ struct HfTaskCharmPolarisation { { for (const auto& collision : collisions) { auto thisCollId = collision.globalIndex(); - int numPvContributors = collision.numContrib(); + int const numPvContributors = collision.numContrib(); auto groupedDstarCandidates = dstarCandidates.sliceBy(dstarPerCollision, thisCollId); int nCands{0}, nCandsInSignalRegion{0}; @@ -2220,7 +2220,7 @@ struct HfTaskCharmPolarisation { { for (const auto& collision : collisions) { auto thisCollId = collision.globalIndex(); - int numPvContributors = collision.numContrib(); + int const numPvContributors = collision.numContrib(); auto groupedDstarCandidates = dstarCandidates.sliceBy(dstarWithMlPerCollision, thisCollId); int nCands{0}, nCandsInSignalRegion{0}; @@ -2249,7 +2249,7 @@ struct HfTaskCharmPolarisation { int numPvContributorsGen{0}; for (const auto& collision : collisions) { // loop over reco collisions associated to this gen collision auto thisCollId = collision.globalIndex(); - int numPvContributors = collision.numContrib(); + int const numPvContributors = collision.numContrib(); auto groupedDstarCandidates = dstarCandidates.sliceBy(dstarWithMcPerCollision, thisCollId); int nCands{0}, nCandsInSignalRegion{0}; @@ -2282,7 +2282,7 @@ struct HfTaskCharmPolarisation { int numPvContributorsGen{0}; for (const auto& collision : collisions) { // loop over reco collisions associated to this gen collision auto thisCollId = collision.globalIndex(); - int numPvContributors = collision.numContrib(); + int const numPvContributors = collision.numContrib(); auto groupedDstarCandidates = dstarCandidates.sliceBy(dstarWithMcAndMlPerCollision, thisCollId); int nCands{0}, nCandsInSignalRegion{0}; @@ -2318,11 +2318,11 @@ struct HfTaskCharmPolarisation { registry.fill(HIST("hCentrality"), centrality); auto thisCollId = collision.globalIndex(); - int numPvContributors = collision.numContrib(); + int const numPvContributors = collision.numContrib(); auto groupedDstarCandidates = dstarCandidates.sliceBy(dstarPerCollision, thisCollId); int nCands{0}, nCandsInSignalRegion{0}; - std::vector qVecs = getQVec(collision); + std::vector const qVecs = getQVec(collision); for (const auto& dstarCandidate : groupedDstarCandidates) { nCands++; @@ -2348,11 +2348,11 @@ struct HfTaskCharmPolarisation { registry.fill(HIST("hCentrality"), centrality); auto thisCollId = collision.globalIndex(); - int numPvContributors = collision.numContrib(); + int const numPvContributors = collision.numContrib(); auto groupedDstarCandidates = dstarCandidates.sliceBy(dstarWithMlPerCollision, thisCollId); int nCands{0}, nCandsInSignalRegion{0}; - std::vector qVecs = getQVec(collision); + std::vector const qVecs = getQVec(collision); for (const auto& dstarCandidate : groupedDstarCandidates) { nCands++; @@ -2382,7 +2382,7 @@ struct HfTaskCharmPolarisation { registry.fill(HIST("hCentrality"), centrality); auto thisCollId = collision.globalIndex(); - int numPvContributors = collision.numContrib(); + int const numPvContributors = collision.numContrib(); auto groupedDstarCandidates = dstarCandidates.sliceBy(dstarWithMcPerCollision, thisCollId); int nCands{0}, nCandsInSignalRegion{0}; @@ -2400,7 +2400,7 @@ struct HfTaskCharmPolarisation { } for (const auto& mcParticle : mcParticles) { const auto& recoCollsPerMcColl = collisions.sliceBy(colPerMcCollision, mcParticle.mcCollision().globalIndex()); - float cent = o2::hf_centrality::getCentralityGenColl(recoCollsPerMcColl, centEstimator); + float const cent = o2::hf_centrality::getCentralityGenColl(recoCollsPerMcColl, centEstimator); runMcGenPolarisationAnalysis(mcParticle, mcParticles, numPvContributorsGen, ¢); } } @@ -2423,7 +2423,7 @@ struct HfTaskCharmPolarisation { registry.fill(HIST("hCentrality"), centrality); auto thisCollId = collision.globalIndex(); - int numPvContributors = collision.numContrib(); + int const numPvContributors = collision.numContrib(); auto groupedDstarCandidates = dstarCandidates.sliceBy(dstarWithMcAndMlPerCollision, thisCollId); int nCands{0}, nCandsInSignalRegion{0}; @@ -2441,7 +2441,7 @@ struct HfTaskCharmPolarisation { } for (const auto& mcParticle : mcParticles) { const auto& recoCollsPerMcColl = collisions.sliceBy(colPerMcCollision, mcParticle.mcCollision().globalIndex()); - float cent = o2::hf_centrality::getCentralityGenColl(recoCollsPerMcColl, centEstimator); + float const cent = o2::hf_centrality::getCentralityGenColl(recoCollsPerMcColl, centEstimator); runMcGenPolarisationAnalysis(mcParticle, mcParticles, numPvContributorsGen, ¢); } } @@ -2458,7 +2458,7 @@ struct HfTaskCharmPolarisation { { for (const auto& collision : collisions) { auto thisCollId = collision.globalIndex(); - int numPvContributors = collision.numContrib(); + int const numPvContributors = collision.numContrib(); auto groupedLcCandidates = lcCandidates.sliceBy(lcToPKPiPerCollision, thisCollId); int nCands{0}, nCandsInSignalRegion{0}; @@ -2485,7 +2485,7 @@ struct HfTaskCharmPolarisation { { for (const auto& collision : collisions) { auto thisCollId = collision.globalIndex(); - int numPvContributors = collision.numContrib(); + int const numPvContributors = collision.numContrib(); auto groupedLcCandidates = lcCandidates.sliceBy(lcToPKPiWithMlPerCollision, thisCollId); int nCands{0}, nCandsInSignalRegion{0}; @@ -2515,7 +2515,7 @@ struct HfTaskCharmPolarisation { int numPvContributorsGen{0}; for (const auto& collision : collisions) { // loop over reco collisions associated to this gen collision auto thisCollId = collision.globalIndex(); - int numPvContributors = collision.numContrib(); + int const numPvContributors = collision.numContrib(); auto groupedLcCandidates = lcCandidates.sliceBy(lcToPKPiWithMcAndMlPerCollision, thisCollId); int nCands{0}, nCandsInSignalRegion{0}; @@ -2548,7 +2548,7 @@ struct HfTaskCharmPolarisation { int numPvContributorsGen{0}; for (const auto& collision : collisions) { // loop over reco collisions associated to this gen collision auto thisCollId = collision.globalIndex(); - int numPvContributors = collision.numContrib(); + int const numPvContributors = collision.numContrib(); auto groupedLcCandidates = lcCandidates.sliceBy(lcToPKPiWithMcAndMlPerCollision, thisCollId); int nCands{0}, nCandsInSignalRegion{0}; diff --git a/PWGHF/D2H/Tasks/taskCharmResoToDTrkReduced.cxx b/PWGHF/D2H/Tasks/taskCharmResoToDTrkReduced.cxx index f393d9693a7..be096e1da49 100644 --- a/PWGHF/D2H/Tasks/taskCharmResoToDTrkReduced.cxx +++ b/PWGHF/D2H/Tasks/taskCharmResoToDTrkReduced.cxx @@ -395,7 +395,7 @@ struct HfTaskCharmResoToDTrkReduced { auto flag = particle.flagMcMatchGen(); std::array ptProngs = {particle.ptProng0(), particle.ptProng1()}; std::array etaProngs = {particle.etaProng0(), particle.etaProng1()}; - bool prongsInAcc = isProngInAcceptance(etaProngs[0], ptProngs[0]) && isProngInAcceptance(etaProngs[1], ptProngs[1]); + bool const prongsInAcc = isProngInAcceptance(etaProngs[0], ptProngs[0]) && isProngInAcceptance(etaProngs[1], ptProngs[1]); if (Channel == DecayChannel::D0Kplus && !hf_decay::hf_cand_reso::particlesToD0Kplus.contains(static_cast(std::abs(flag)))) { continue; diff --git a/PWGHF/D2H/Tasks/taskCharmResoToDV0Reduced.cxx b/PWGHF/D2H/Tasks/taskCharmResoToDV0Reduced.cxx index 8d795347683..4c01573ace8 100644 --- a/PWGHF/D2H/Tasks/taskCharmResoToDV0Reduced.cxx +++ b/PWGHF/D2H/Tasks/taskCharmResoToDV0Reduced.cxx @@ -452,7 +452,7 @@ struct HfTaskCharmResoToDV0Reduced { auto flag = particle.flagMcMatchGen(); std::array ptProngs = {particle.ptProng0(), particle.ptProng1()}; std::array etaProngs = {particle.etaProng0(), particle.etaProng1()}; - bool prongsInAcc = isProngInAcceptance(etaProngs[0], ptProngs[0]) && isProngInAcceptance(etaProngs[1], ptProngs[1]); + bool const prongsInAcc = isProngInAcceptance(etaProngs[0], ptProngs[0]) && isProngInAcceptance(etaProngs[1], ptProngs[1]); if (Channel == DecayChannel::DstarK0s && !hf_decay::hf_cand_reso::particlesToDstarK0s.contains(static_cast(std::abs(flag)))) { continue; diff --git a/PWGHF/D2H/Tasks/taskD0.cxx b/PWGHF/D2H/Tasks/taskD0.cxx index 5506a58cd88..e5ed97171b1 100644 --- a/PWGHF/D2H/Tasks/taskD0.cxx +++ b/PWGHF/D2H/Tasks/taskD0.cxx @@ -397,8 +397,8 @@ struct HfTaskD0 { auto trackPos = candidate.template prong0_as(); // positive daughter auto trackNeg = candidate.template prong1_as(); // negative daughter - int minItsClustersOfProngs = std::min(trackPos.itsNCls(), trackNeg.itsNCls()); - int minTpcCrossedRowsOfProngs = std::min(trackPos.tpcNClsCrossedRows(), trackNeg.tpcNClsCrossedRows()); + int const minItsClustersOfProngs = std::min(trackPos.itsNCls(), trackNeg.itsNCls()); + int const minTpcCrossedRowsOfProngs = std::min(trackPos.tpcNClsCrossedRows(), trackNeg.tpcNClsCrossedRows()); if constexpr (ApplyMl) { if (storeCentrality && storeOccupancy) { if (candidate.isSelD0() >= selectionFlagD0) { @@ -660,8 +660,8 @@ struct HfTaskD0 { auto ctCandidate = hfHelper.ctD0(candidate); auto cpaCandidate = candidate.cpa(); auto cpaxyCandidate = candidate.cpaXY(); - int minItsClustersOfProngs = std::min(trackPos.itsNCls(), trackNeg.itsNCls()); - int minTpcCrossedRowsOfProngs = std::min(trackPos.tpcNClsCrossedRows(), trackNeg.tpcNClsCrossedRows()); + int const minItsClustersOfProngs = std::min(trackPos.itsNCls(), trackNeg.itsNCls()); + int const minTpcCrossedRowsOfProngs = std::min(trackPos.tpcNClsCrossedRows(), trackNeg.tpcNClsCrossedRows()); if (candidate.isSelD0() >= selectionFlagD0) { registry.fill(HIST("hMassSigBkgD0"), massD0, ptCandidate, rapidityCandidate); if (candidate.flagMcMatchRec() == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { diff --git a/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx b/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx index 159d24a7541..417c03ab8a6 100644 --- a/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx +++ b/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx @@ -206,7 +206,7 @@ struct HfTaskDirectedFlowCharmHadrons { T1 const& candidates, Trk const& /*tracks*/) { - double cent = getCentrality(collision); + double const cent = getCentrality(collision); if (cent < centralityMin || cent > centralityMax) { return; } @@ -303,11 +303,11 @@ struct HfTaskDirectedFlowCharmHadrons { } } - double ptCand = candidate.pt(); + double const ptCand = candidate.pt(); double etaCand = candidate.eta(); - double phiCand = candidate.phi(); - double cosNPhi = std::cos(phiCand); - double sinNPhi = std::sin(phiCand); + double const phiCand = candidate.phi(); + double const cosNPhi = std::cos(phiCand); + double const sinNPhi = std::sin(phiCand); if (userap) { etaCand = rapCand; diff --git a/PWGHF/D2H/Tasks/taskDplus.cxx b/PWGHF/D2H/Tasks/taskDplus.cxx index 8f0e5332375..7a4851d4766 100644 --- a/PWGHF/D2H/Tasks/taskDplus.cxx +++ b/PWGHF/D2H/Tasks/taskDplus.cxx @@ -130,17 +130,17 @@ struct HfTaskDplus { LOGP(fatal, "Only one process function should be enabled! Please check your configuration!"); } auto vbins = static_cast>(binsPt); - AxisSpec thnAxisPt = {vbins, "#it{p}_{T} (GeV/#it{c})"}; - AxisSpec thnAxisMass = {600, 1.67, 2.27, "inv. mass (K#pi#pi) (GeV/#it{c}^{2})"}; - AxisSpec thnAxisY = {thnConfigAxisY, "y"}; - AxisSpec thnAxisMlScore0 = {thnConfigAxisMlScore0, "Score 0"}; - AxisSpec thnAxisMlScore1 = {thnConfigAxisMlScore1, "Score 1"}; - AxisSpec thnAxisMlScore2 = {thnConfigAxisMlScore2, "Score 2"}; - AxisSpec thnAxisPtBHad{thnConfigAxisPtBHad, "#it{p}_{T,B} (GeV/#it{c})"}; - AxisSpec thnAxisFlagBHad{thnConfigAxisFlagBHad, "B Hadron flag"}; - AxisSpec thnAxisCent{thnConfigAxisCent, "Centrality"}; - AxisSpec thnAxisOccupancy{thnConfigAxisOccupancy, "Occupancy"}; - AxisSpec thnAxisPvContributors{thnConfigAxisPvContributors, "PV contributors"}; + AxisSpec const thnAxisPt = {vbins, "#it{p}_{T} (GeV/#it{c})"}; + AxisSpec const thnAxisMass = {600, 1.67, 2.27, "inv. mass (K#pi#pi) (GeV/#it{c}^{2})"}; + AxisSpec const thnAxisY = {thnConfigAxisY, "y"}; + AxisSpec const thnAxisMlScore0 = {thnConfigAxisMlScore0, "Score 0"}; + AxisSpec const thnAxisMlScore1 = {thnConfigAxisMlScore1, "Score 1"}; + AxisSpec const thnAxisMlScore2 = {thnConfigAxisMlScore2, "Score 2"}; + AxisSpec const thnAxisPtBHad{thnConfigAxisPtBHad, "#it{p}_{T,B} (GeV/#it{c})"}; + AxisSpec const thnAxisFlagBHad{thnConfigAxisFlagBHad, "B Hadron flag"}; + AxisSpec const thnAxisCent{thnConfigAxisCent, "Centrality"}; + AxisSpec const thnAxisOccupancy{thnConfigAxisOccupancy, "Occupancy"}; + AxisSpec const thnAxisPvContributors{thnConfigAxisPvContributors, "PV contributors"}; registry.add("hMass", "3-prong candidates;inv. mass (#pi K #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{350, 1.7, 2.05}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("hEta", "3-prong candidates;candidate #it{#eta};entries", {HistType::kTH2F, {{100, -2., 2.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); @@ -247,7 +247,7 @@ struct HfTaskDplus { template void fillHisto(const T1& candidate) { - float pt = candidate.pt(); + float const pt = candidate.pt(); registry.fill(HIST("hMass"), hfHelper.invMassDplusToPiKPi(candidate), pt); registry.fill(HIST("hPt"), pt); registry.fill(HIST("hEta"), candidate.eta(), pt); @@ -486,7 +486,7 @@ struct HfTaskDplus { float occ{-1.f}; float numPvContr{-1.f}; float ptBhad{-1.f}; - int flagBHad{-1}; + int const flagBHad{-1}; if constexpr (!FillMl) { for (const auto& candidate : selectedDPlusCandidates) { if ((yCandRecoMax >= 0. && std::abs(hfHelper.yDplus(candidate)) > yCandRecoMax)) { diff --git a/PWGHF/D2H/Tasks/taskDs.cxx b/PWGHF/D2H/Tasks/taskDs.cxx index e7af652fa98..eb93b29ba17 100644 --- a/PWGHF/D2H/Tasks/taskDs.cxx +++ b/PWGHF/D2H/Tasks/taskDs.cxx @@ -202,17 +202,17 @@ struct HfTaskDs { LOGP(fatal, "Invalid value of decayChannel"); } - AxisSpec ptbins{axisPt, "#it{p}_{T} (GeV/#it{c})"}; - AxisSpec ptBHad{axisPtBHad, "#it{p}_{T}(B) (GeV/#it{c})"}; - AxisSpec flagBHad{axisFlagBHad, "B Hadron flag"}; + AxisSpec const ptbins{axisPt, "#it{p}_{T} (GeV/#it{c})"}; + AxisSpec const ptBHad{axisPtBHad, "#it{p}_{T}(B) (GeV/#it{c})"}; + AxisSpec const flagBHad{axisFlagBHad, "B Hadron flag"}; AxisSpec ybins = {100, -5., 5, "#it{y}"}; - AxisSpec massbins = {600, 1.67, 2.27, "inv. mass (KK#pi) (GeV/#it{c}^{2})"}; - AxisSpec centralitybins = {axisCentrality, "Centrality"}; - AxisSpec npvcontributorsbins = {axisNPvContributors, "NPvContributors"}; - AxisSpec mlscore0bins = {axisMlScore0, "Score 0"}; - AxisSpec mlscore1bins = {axisMlScore1, "Score 1"}; - AxisSpec mlscore2bins = {axisMlScore2, "Score 2"}; - AxisSpec occupancybins = {axisOccupancy, "Occupancy"}; + AxisSpec const massbins = {600, 1.67, 2.27, "inv. mass (KK#pi) (GeV/#it{c}^{2})"}; + AxisSpec const centralitybins = {axisCentrality, "Centrality"}; + AxisSpec const npvcontributorsbins = {axisNPvContributors, "NPvContributors"}; + AxisSpec const mlscore0bins = {axisMlScore0, "Score 0"}; + AxisSpec const mlscore1bins = {axisMlScore1, "Score 1"}; + AxisSpec const mlscore2bins = {axisMlScore2, "Score 2"}; + AxisSpec const occupancybins = {axisOccupancy, "Occupancy"}; histosPtr[DataType::Data]["hNPvContribAll"] = registry.add((folders[DataType::Data] + "hNPvContribAll").c_str(), "3-prong candidates;NPvContributors;Centrality;Entries", HistType::kTH2F, {axisNPvContributors, {100, 0., 100}}); @@ -352,8 +352,8 @@ struct HfTaskDs { template bool isCandInSignalRegion(const CandDs& candidate, bool isDs) { - bool isKKPi = candidate.isSelDsToKKPi() >= selectionFlagDs; - float invMass = isKKPi ? hfHelper.invMassDsToKKPi(candidate) : hfHelper.invMassDsToPiKK(candidate); + bool const isKKPi = candidate.isSelDsToKKPi() >= selectionFlagDs; + float const invMass = isKKPi ? hfHelper.invMassDsToKKPi(candidate) : hfHelper.invMassDsToPiKK(candidate); if (isDs && (invMass < massDsSignalMin || invMass > massDsSignalMax)) { return false; } @@ -371,8 +371,8 @@ struct HfTaskDs { { auto multFT0A = collision.multFT0A() - nProngsContributorsPV; auto multFT0C = collision.multFT0C() - nProngsContributorsPV; - float multZeqFT0A = hVtxZFT0A->Interpolate(0.0) * multFT0A / hVtxZFT0A->Interpolate(collision.posZ()); - float multZeqFT0C = hVtxZFT0C->Interpolate(0.0) * multFT0C / hVtxZFT0C->Interpolate(collision.posZ()); + float const multZeqFT0A = hVtxZFT0A->Interpolate(0.0) * multFT0A / hVtxZFT0A->Interpolate(collision.posZ()); + float const multZeqFT0C = hVtxZFT0C->Interpolate(0.0) * multFT0C / hVtxZFT0C->Interpolate(collision.posZ()); return multZeqFT0A + multZeqFT0C; } @@ -383,7 +383,7 @@ struct HfTaskDs { float getZEqMultColl(const Coll& collision, uint8_t nProngsContributorsPV) { auto multNTracksPV = collision.multNTracksPV() - nProngsContributorsPV; - float multZeqNTracksPV = hVtxZNTracks->Interpolate(0.0) * multNTracksPV / hVtxZNTracks->Interpolate(collision.posZ()); + float const multZeqNTracksPV = hVtxZNTracks->Interpolate(0.0) * multNTracksPV / hVtxZNTracks->Interpolate(collision.posZ()); return multZeqNTracksPV; } @@ -713,7 +713,7 @@ struct HfTaskDs { for (const auto& recCol : recoCollsPerMcColl) { maxNumContrib = recCol.numContrib() > maxNumContrib ? recCol.numContrib() : maxNumContrib; } - float cent = o2::hf_centrality::getCentralityGenColl(recoCollsPerMcColl); + float const cent = o2::hf_centrality::getCentralityGenColl(recoCollsPerMcColl); float occ{-1.}; if (storeOccupancy && occEstimator != o2::hf_occupancy::OccupancyEstimator::None) { occ = o2::hf_occupancy::getOccupancyGenColl(recoCollsPerMcColl, occEstimator); @@ -738,8 +738,8 @@ struct HfTaskDs { std::get(histosPtr[DataType::McDsNonPrompt]["hPtGen"])->Fill(pt); // gen. level pT std::get(histosPtr[DataType::McDsNonPrompt]["hEtaGen"])->Fill(particle.eta()); auto bHadMother = mcParticles.rawIteratorAt(particle.idxBhadMotherPart() - mcParticles.offset()); - int flagGenB = getBHadMotherFlag(bHadMother.pdgCode()); - float ptGenB = bHadMother.pt(); + int const flagGenB = getBHadMotherFlag(bHadMother.pdgCode()); + float const ptGenB = bHadMother.pt(); if (storeOccupancy && occEstimator != o2::hf_occupancy::OccupancyEstimator::None) { std::get(histosPtr[DataType::McDsNonPrompt]["hSparseGen"])->Fill(pt, y, maxNumContrib, cent, occ, ptGenB, flagGenB); } else { @@ -764,8 +764,8 @@ struct HfTaskDs { std::get(histosPtr[DataType::McDplusNonPrompt]["hPtGen"])->Fill(pt); // gen. level pT std::get(histosPtr[DataType::McDplusNonPrompt]["hEtaGen"])->Fill(particle.eta()); auto bHadMother = mcParticles.rawIteratorAt(particle.idxBhadMotherPart() - mcParticles.offset()); - int flagGenB = getBHadMotherFlag(bHadMother.pdgCode()); - float ptGenB = bHadMother.pt(); + int const flagGenB = getBHadMotherFlag(bHadMother.pdgCode()); + float const ptGenB = bHadMother.pt(); if (storeOccupancy && occEstimator != o2::hf_occupancy::OccupancyEstimator::None) { std::get(histosPtr[DataType::McDplusNonPrompt]["hSparseGen"])->Fill(pt, y, maxNumContrib, cent, occ, ptGenB, flagGenB); } else { @@ -784,8 +784,8 @@ struct HfTaskDs { std::array& nCandsInSignalRegionDsPerType, std::array& nCandsInSignalRegionDplusPerType) { - int numPvContributors = collision.numContrib(); - float centrality = evaluateCentralityColl(collision); + int const numPvContributors = collision.numContrib(); + float const centrality = evaluateCentralityColl(collision); std::get(histosPtr[DataType::Data]["hNPvContribAll"])->Fill(numPvContributors, centrality); for (int i = 0; i < DataType::kDataTypes; i++) { if (i == DataType::McBkg && !fillMcBkgHistos) { diff --git a/PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx b/PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx index 43691d9cd98..35b9f9dee4a 100644 --- a/PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx +++ b/PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx @@ -121,16 +121,16 @@ struct HfTaskDstarToD0Pi { } auto vecPtBins = (std::vector)ptBins; - AxisSpec axisImpactParam = {binningImpactParam, "impact parameter (cm)"}; - AxisSpec axisDecayLength = {binningDecayLength, " decay length (cm)"}; - AxisSpec axisNormDecayLength = {binningNormDecayLength, "normalised decay length (cm)"}; + AxisSpec const axisImpactParam = {binningImpactParam, "impact parameter (cm)"}; + AxisSpec const axisDecayLength = {binningDecayLength, " decay length (cm)"}; + AxisSpec const axisNormDecayLength = {binningNormDecayLength, "normalised decay length (cm)"}; AxisSpec axisCentrality = {binningCentrality, "centrality (%)"}; AxisSpec axisDeltaInvMass = {binningDeltaInvMass, "#Delta #it{M}_{inv} D*"}; AxisSpec axisBDTScorePrompt = {binningSigBDTScore, "BDT Score for Prompt Cand"}; AxisSpec axisBDTScoreNonPrompt = {binningSigBDTScore, "BDT Score for Non-Prompt Cand"}; AxisSpec axisBDTScoreBackground = {binningBkgBDTScore, "BDT Score for Background Cand"}; AxisSpec axisPvContrib = {binningPvContrib, "PV Contribution"}; - AxisSpec axisPt = {vecPtBins, "#it{p}_{T} (GeV/#it{c})"}; + AxisSpec const axisPt = {vecPtBins, "#it{p}_{T} (GeV/#it{c})"}; axesPtVsCentVsBDTVsPvContrib = {axisPt, axisCentrality, axisBDTScoreBackground, axisBDTScorePrompt, axisBDTScoreNonPrompt, axisPvContrib}; axesPtVsCentVsPvContrib = {axisPt, axisCentrality, axisPvContrib}; @@ -265,9 +265,9 @@ struct HfTaskDstarToD0Pi { // if weights to be applied if (useWeight) { ccdbApi.init(ccdbUrl); - std::map metadata; + std::map const metadata; // Retrieve the file from CCDB - bool isFileAvailable = ccdbApi.retrieveBlob(ccdbPathForWeight, ".", metadata, timestampCCDB, false, weightFileName); + bool const isFileAvailable = ccdbApi.retrieveBlob(ccdbPathForWeight, ".", metadata, timestampCCDB, false, weightFileName); if (!isFileAvailable) { LOGF(fatal, "Failed to retrieve weight file from CCDB: %s", ccdbPathForWeight.value.c_str()); return; @@ -280,7 +280,7 @@ struct HfTaskDstarToD0Pi { // Ensure hWeights is properly sized hWeights.resize(nWeights); for (int ithWeight = 0; ithWeight < nWeights; ++ithWeight) { - std::string histName = "hMult" + std::to_string(ithWeight + 1) + "_Weight"; + std::string const histName = "hMult" + std::to_string(ithWeight + 1) + "_Weight"; hWeights[ithWeight] = reinterpret_cast(weightFile->Get(histName.c_str())); if (hWeights[ithWeight] == nullptr) { LOGF(fatal, "Histogram %s not found in weight file!", histName.c_str()); diff --git a/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx b/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx index 00de5c93c75..a7c954f9720 100644 --- a/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx +++ b/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx @@ -323,14 +323,14 @@ struct HfTaskFlowCharmHadrons { const float ampl) { // TODO: add possibility to consider different weights for the tracks, at the moment only pT is considered; - float pXTrack0 = cand.pxProng0(); - float pYTrack0 = cand.pyProng0(); - float pTTrack0 = cand.ptProng0(); - float phiTrack0 = std::atan2(pYTrack0, pXTrack0); - float pXTrack1 = cand.pxProng1(); - float pYTrack1 = cand.pyProng1(); - float pTTrack1 = cand.ptProng1(); - float phiTrack1 = std::atan2(pYTrack1, pXTrack1); + float const pXTrack0 = cand.pxProng0(); + float const pYTrack0 = cand.pyProng0(); + float const pTTrack0 = cand.ptProng0(); + float const phiTrack0 = std::atan2(pYTrack0, pXTrack0); + float const pXTrack1 = cand.pxProng1(); + float const pYTrack1 = cand.pyProng1(); + float const pTTrack1 = cand.ptProng1(); + float const phiTrack1 = std::atan2(pYTrack1, pXTrack1); tracksQx.push_back(std::cos(harmonic * phiTrack0) * pTTrack0 / ampl); tracksQy.push_back(std::sin(harmonic * phiTrack0) * pTTrack0 / ampl); @@ -338,10 +338,10 @@ struct HfTaskFlowCharmHadrons { tracksQy.push_back(std::sin(harmonic * phiTrack1) * pTTrack1 / ampl); if constexpr (Channel != DecayChannel::D0ToPiK && Channel != DecayChannel::D0ToKPi) { - float pXTrack2 = cand.pxProng2(); - float pYTrack2 = cand.pyProng2(); - float pTTrack2 = cand.ptProng2(); - float phiTrack2 = std::atan2(pYTrack2, pXTrack2); + float const pXTrack2 = cand.pxProng2(); + float const pYTrack2 = cand.pyProng2(); + float const pTTrack2 = cand.ptProng2(); + float const phiTrack2 = std::atan2(pYTrack2, pXTrack2); tracksQx.push_back(std::cos(harmonic * phiTrack2) * pTTrack2 / ampl); tracksQy.push_back(std::sin(harmonic * phiTrack2) * pTTrack2 / ampl); } @@ -359,22 +359,22 @@ struct HfTaskFlowCharmHadrons { float ampl) { // add possibility to consider different weights for the tracks, at the moment only pT is considered; - float pXTrack0 = cand.pxPosV0Dau(); - float pYTrack0 = cand.pyPosV0Dau(); - float pTTrack0 = std::hypot(pXTrack0, pYTrack0); - float phiTrack0 = std::atan2(pXTrack0, pYTrack0); - float pXTrack1 = cand.pxNegV0Dau(); - float pYTrack1 = cand.pyNegV0Dau(); - float pTTrack1 = std::hypot(pXTrack1, pYTrack1); - float phiTrack1 = std::atan2(pXTrack1, pYTrack1); - float pYTrack2 = cand.pxBachFromCasc(); - float pXTrack2 = cand.pyBachFromCasc(); - float pTTrack2 = std::hypot(pXTrack2, pYTrack2); - float phiTrack2 = std::atan2(pXTrack2, pYTrack2); - float pXTrack3 = cand.pxBachFromCharmBaryon(); - float pYTrack3 = cand.pyBachFromCharmBaryon(); - float pTTrack3 = std::hypot(pXTrack3, pYTrack3); - float phiTrack3 = std::atan2(pXTrack3, pYTrack3); + float const pXTrack0 = cand.pxPosV0Dau(); + float const pYTrack0 = cand.pyPosV0Dau(); + float const pTTrack0 = std::hypot(pXTrack0, pYTrack0); + float const phiTrack0 = std::atan2(pXTrack0, pYTrack0); + float const pXTrack1 = cand.pxNegV0Dau(); + float const pYTrack1 = cand.pyNegV0Dau(); + float const pTTrack1 = std::hypot(pXTrack1, pYTrack1); + float const phiTrack1 = std::atan2(pXTrack1, pYTrack1); + float const pYTrack2 = cand.pxBachFromCasc(); + float const pXTrack2 = cand.pyBachFromCasc(); + float const pTTrack2 = std::hypot(pXTrack2, pYTrack2); + float const phiTrack2 = std::atan2(pXTrack2, pYTrack2); + float const pXTrack3 = cand.pxBachFromCharmBaryon(); + float const pYTrack3 = cand.pyBachFromCharmBaryon(); + float const pTTrack3 = std::hypot(pXTrack3, pYTrack3); + float const phiTrack3 = std::atan2(pXTrack3, pYTrack3); tracksQx.push_back(std::cos(harmonic * phiTrack0) * pTTrack0 / ampl); tracksQy.push_back(std::sin(harmonic * phiTrack0) * pTTrack0 / ampl); @@ -556,8 +556,8 @@ struct HfTaskFlowCharmHadrons { std::vector qVecs = getQvec(collision); float xQVec = qVecs[0]; float yQVec = qVecs[1]; - float amplQVec = qVecs[2]; - float evtPl = epHelper.GetEventPlane(xQVec, yQVec, harmonic); + float const amplQVec = qVecs[2]; + float const evtPl = epHelper.GetEventPlane(xQVec, yQVec, harmonic); int nProngs = 3; for (const auto& candidate : candidates) { @@ -693,14 +693,14 @@ struct HfTaskFlowCharmHadrons { } } - float cosNPhi = std::cos(harmonic * phiCand); - float sinNPhi = std::sin(harmonic * phiCand); - float scalprodCand = cosNPhi * xQVec + sinNPhi * yQVec; - float cosDeltaPhi = std::cos(harmonic * (phiCand - evtPl)); + float const cosNPhi = std::cos(harmonic * phiCand); + float const sinNPhi = std::sin(harmonic * phiCand); + float const scalprodCand = cosNPhi * xQVec + sinNPhi * yQVec; + float const cosDeltaPhi = std::cos(harmonic * (phiCand - evtPl)); if (fillMassPtMlTree && storeMl) { if (downSampleFactor < 1.) { - float pseudoRndm = ptCand * 1000. - static_cast(ptCand * 1000); + float const pseudoRndm = ptCand * 1000. - static_cast(ptCand * 1000); if (ptCand < ptDownSampleMax && pseudoRndm >= downSampleFactor) { continue; } @@ -839,20 +839,20 @@ struct HfTaskFlowCharmHadrons { aod::BCsWithTimestamps const& bcs) { float centrality{-1.f}; - float xQVecFT0a = collision.qvecFT0ARe(); - float yQVecFT0a = collision.qvecFT0AIm(); - float xQVecFT0c = collision.qvecFT0CRe(); - float yQVecFT0c = collision.qvecFT0CIm(); - float xQVecFT0m = collision.qvecFT0MRe(); - float yQVecFT0m = collision.qvecFT0MIm(); - float xQVecFV0a = collision.qvecFV0ARe(); - float yQVecFV0a = collision.qvecFV0AIm(); - float xQVecBPos = collision.qvecBPosRe(); - float yQVecBPos = collision.qvecBPosIm(); - float xQVecBNeg = collision.qvecBNegRe(); - float yQVecBNeg = collision.qvecBNegIm(); - float xQVecBTot = collision.qvecBTotRe(); - float yQVecBTot = collision.qvecBTotIm(); + float const xQVecFT0a = collision.qvecFT0ARe(); + float const yQVecFT0a = collision.qvecFT0AIm(); + float const xQVecFT0c = collision.qvecFT0CRe(); + float const yQVecFT0c = collision.qvecFT0CIm(); + float const xQVecFT0m = collision.qvecFT0MRe(); + float const yQVecFT0m = collision.qvecFT0MIm(); + float const xQVecFV0a = collision.qvecFV0ARe(); + float const yQVecFV0a = collision.qvecFV0AIm(); + float const xQVecBPos = collision.qvecBPosRe(); + float const yQVecBPos = collision.qvecBPosIm(); + float const xQVecBNeg = collision.qvecBNegRe(); + float const yQVecBNeg = collision.qvecBNegIm(); + float const xQVecBTot = collision.qvecBTotRe(); + float const yQVecBTot = collision.qvecBTotIm(); centrality = o2::hf_centrality::getCentralityColl(collision, o2::hf_centrality::CentralityEstimator::FT0C); if (storeResoOccu) { @@ -890,13 +890,13 @@ struct HfTaskFlowCharmHadrons { registry.fill(HIST("spReso/hSpResoTPCposTPCneg"), centrality, xQVecBPos * xQVecBNeg + yQVecBPos * yQVecBNeg); if (saveEpResoHisto) { - float epFT0a = epHelper.GetEventPlane(xQVecFT0a, yQVecFT0a, harmonic); - float epFT0c = epHelper.GetEventPlane(xQVecFT0c, yQVecFT0c, harmonic); - float epFT0m = epHelper.GetEventPlane(xQVecFT0m, yQVecFT0m, harmonic); - float epFV0a = epHelper.GetEventPlane(xQVecFV0a, yQVecFV0a, harmonic); - float epBPoss = epHelper.GetEventPlane(xQVecBPos, yQVecBPos, harmonic); - float epBNegs = epHelper.GetEventPlane(xQVecBNeg, yQVecBNeg, harmonic); - float epBTots = epHelper.GetEventPlane(xQVecBTot, yQVecBTot, harmonic); + float const epFT0a = epHelper.GetEventPlane(xQVecFT0a, yQVecFT0a, harmonic); + float const epFT0c = epHelper.GetEventPlane(xQVecFT0c, yQVecFT0c, harmonic); + float const epFT0m = epHelper.GetEventPlane(xQVecFT0m, yQVecFT0m, harmonic); + float const epFV0a = epHelper.GetEventPlane(xQVecFV0a, yQVecFV0a, harmonic); + float const epBPoss = epHelper.GetEventPlane(xQVecBPos, yQVecBPos, harmonic); + float const epBNegs = epHelper.GetEventPlane(xQVecBNeg, yQVecBNeg, harmonic); + float const epBTots = epHelper.GetEventPlane(xQVecBTot, yQVecBTot, harmonic); registry.fill(HIST("epReso/hEpResoFT0cFT0a"), centrality, std::cos(harmonic * getDeltaPsiInRange(epFT0c, epFT0a))); registry.fill(HIST("epReso/hEpResoFT0cFV0a"), centrality, std::cos(harmonic * getDeltaPsiInRange(epFT0c, epFV0a))); diff --git a/PWGHF/D2H/Tasks/taskLb.cxx b/PWGHF/D2H/Tasks/taskLb.cxx index f92a4754d12..feb4444386d 100644 --- a/PWGHF/D2H/Tasks/taskLb.cxx +++ b/PWGHF/D2H/Tasks/taskLb.cxx @@ -83,15 +83,15 @@ struct HfTaskLb { bool passesImpactParameterResolution(float pT, float d0Resolution) { - float expectedResolution(0.001 + 0.0052 * std::exp(-0.655 * pT)); + float const expectedResolution(0.001 + 0.0052 * std::exp(-0.655 * pT)); return (d0Resolution <= expectedResolution * 1.5); } // Compares to pT dependent cut on impact parameter resolution float logLikelihoodRatioSingleTrackDCA(float dca, float reso, float lengthParameter) { reso *= resoCorrectionFactor; // In case real resolution is worse - float numerator = 1. / lengthParameter * std::exp(-dca / lengthParameter); - float denominator = (1. - largeLifetimeBG) * TMath::Gaus(dca, 0., reso, true) + largeLifetimeBG / 0.2; // flat distribution to 2 mm + float const numerator = 1. / lengthParameter * std::exp(-dca / lengthParameter); + float const denominator = (1. - largeLifetimeBG) * TMath::Gaus(dca, 0., reso, true) + largeLifetimeBG / 0.2; // flat distribution to 2 mm return std::log(numerator / denominator); } // Creates the single track log likelihood assuming an exonential law for the secondaries @@ -187,8 +187,8 @@ struct HfTaskLb { soa::Join const& candidatesLc, TracksWExt const&) { - float massKStar892 = 0.892; - float massDelta1232 = 1.232; + float const massKStar892 = 0.892; + float const massDelta1232 = 1.232; std::array dca = {0.f, 0.f, 0.f}; std::array dcaResolution = {0.f, 0.f, 0.f}; @@ -202,9 +202,9 @@ struct HfTaskLb { registry.get(HIST("hIPs"))->Fill(candidateLc.pt(), candidateLc.impactParameter0()); registry.get(HIST("hIPs"))->Fill(candidateLc.pt(), candidateLc.impactParameter1()); registry.get(HIST("hIPs"))->Fill(candidateLc.pt(), candidateLc.impactParameter2()); - float reso0 = candidateLc.errorImpactParameter0(); // 0.0023166 *pow(track0.pt(), -0.788); - float reso1 = candidateLc.errorImpactParameter1(); - float reso2 = candidateLc.errorImpactParameter2(); + float const reso0 = candidateLc.errorImpactParameter0(); // 0.0023166 *pow(track0.pt(), -0.788); + float const reso1 = candidateLc.errorImpactParameter1(); + float const reso2 = candidateLc.errorImpactParameter2(); registry.get(HIST("hIPResolution"))->Fill(track0.pt(), reso0); registry.get(HIST("hIPResolution"))->Fill(track1.pt(), reso1); registry.get(HIST("hIPResolution"))->Fill(track2.pt(), reso2); @@ -223,7 +223,7 @@ struct HfTaskLb { candidateLc.impactParameter1(), candidateLc.impactParameter2()}; - bool exceedsMaxDca = std::any_of(dca.begin(), dca.end(), [&](float val) { + bool const exceedsMaxDca = std::any_of(dca.begin(), dca.end(), [&](float val) { return val > maximumImpactParameterForLambdaCCrossChecks; }); @@ -246,12 +246,12 @@ struct HfTaskLb { registry.get(HIST("hIPsAfterCut"))->Fill(candidateLc.pt(), candidateLc.impactParameter2()); if (candidateLc.isSelLcToPKPi() != 0) { registry.get(HIST("hPtinvMassLc"))->Fill(candidateLc.pt(), hfHelper.invMassLcToPKPi(candidateLc)); - float mRecoKstar = RecoDecay::m(std::array{track1.pVector(), track2.pVector()}, std::array{o2::constants::physics::MassKPlus, o2::constants::physics::MassPiPlus}); - float mRecoDelta1232 = RecoDecay::m(std::array{track0.pVector(), track2.pVector()}, std::array{o2::constants::physics::MassProton, o2::constants::physics::MassPiPlus}); - float mRecoLambda1520 = RecoDecay::m(std::array{track0.pVector(), track1.pVector()}, std::array{o2::constants::physics::MassProton, o2::constants::physics::MassKPlus}); - float mDiffKStar892 = std::abs(mRecoKstar - massKStar892); - float mDiffDelta1232 = std::abs(mRecoDelta1232 - massDelta1232); - float mDiffLambda1520 = std::abs(mRecoLambda1520 - o2::constants::physics::MassLambda1520); + float const mRecoKstar = RecoDecay::m(std::array{track1.pVector(), track2.pVector()}, std::array{o2::constants::physics::MassKPlus, o2::constants::physics::MassPiPlus}); + float const mRecoDelta1232 = RecoDecay::m(std::array{track0.pVector(), track2.pVector()}, std::array{o2::constants::physics::MassProton, o2::constants::physics::MassPiPlus}); + float const mRecoLambda1520 = RecoDecay::m(std::array{track0.pVector(), track1.pVector()}, std::array{o2::constants::physics::MassProton, o2::constants::physics::MassKPlus}); + float const mDiffKStar892 = std::abs(mRecoKstar - massKStar892); + float const mDiffDelta1232 = std::abs(mRecoDelta1232 - massDelta1232); + float const mDiffLambda1520 = std::abs(mRecoLambda1520 - o2::constants::physics::MassLambda1520); if (mDiffKStar892 < mDiffKStar892Max || mDiffDelta1232 < mDiffDelta1232Max || mDiffLambda1520 < mDiffLambda1520Max) { registry.get(HIST("hPtinvMassLcReso"))->Fill(candidateLc.pt(), hfHelper.invMassLcToPKPi(candidateLc)); } @@ -273,12 +273,12 @@ struct HfTaskLb { } if (candidateLc.isSelLcToPiKP() != 0) { registry.get(HIST("hPtinvMassLc"))->Fill(candidateLc.pt(), hfHelper.invMassLcToPiKP(candidateLc)); - float mRecoKstar = RecoDecay::m(std::array{track1.pVector(), track0.pVector()}, std::array{o2::constants::physics::MassKPlus, o2::constants::physics::MassPiPlus}); - float mRecoDelta1232 = RecoDecay::m(std::array{track2.pVector(), track0.pVector()}, std::array{o2::constants::physics::MassProton, o2::constants::physics::MassPiPlus}); - float mRecoLambda1520 = RecoDecay::m(std::array{track2.pVector(), track1.pVector()}, std::array{o2::constants::physics::MassProton, o2::constants::physics::MassKPlus}); - float mDiffKStar892 = std::abs(mRecoKstar - massKStar892); - float mDiffDelta1232 = std::abs(mRecoDelta1232 - massDelta1232); - float mDiffLambda1520 = std::abs(mRecoLambda1520 - o2::constants::physics::MassLambda1520); + float const mRecoKstar = RecoDecay::m(std::array{track1.pVector(), track0.pVector()}, std::array{o2::constants::physics::MassKPlus, o2::constants::physics::MassPiPlus}); + float const mRecoDelta1232 = RecoDecay::m(std::array{track2.pVector(), track0.pVector()}, std::array{o2::constants::physics::MassProton, o2::constants::physics::MassPiPlus}); + float const mRecoLambda1520 = RecoDecay::m(std::array{track2.pVector(), track1.pVector()}, std::array{o2::constants::physics::MassProton, o2::constants::physics::MassKPlus}); + float const mDiffKStar892 = std::abs(mRecoKstar - massKStar892); + float const mDiffDelta1232 = std::abs(mRecoDelta1232 - massDelta1232); + float const mDiffLambda1520 = std::abs(mRecoLambda1520 - o2::constants::physics::MassLambda1520); if (mDiffKStar892 < mDiffKStar892Max || mDiffDelta1232 < mDiffDelta1232Max || mDiffLambda1520 < mDiffLambda1520Max) { registry.get(HIST("hPtinvMassLcReso"))->Fill(candidateLc.pt(), hfHelper.invMassLcToPiKP(candidateLc)); } @@ -326,7 +326,7 @@ struct HfTaskLb { if (likelihoodRatio < minLikelihoodRatio) { continue; // Larger likelihood means more likely to be signal } - float lbMass = hfHelper.invMassLbToLcPi(candidate); + float const lbMass = hfHelper.invMassLbToLcPi(candidate); registry.get(HIST("hPtinvMassLb"))->Fill(candidate.pt(), lbMass); registry.fill(HIST("hMass"), hfHelper.invMassLbToLcPi(candidate), candidate.pt()); diff --git a/PWGHF/D2H/Tasks/taskLbReduced.cxx b/PWGHF/D2H/Tasks/taskLbReduced.cxx index 798f04ac3f7..f47e06d84c5 100644 --- a/PWGHF/D2H/Tasks/taskLbReduced.cxx +++ b/PWGHF/D2H/Tasks/taskLbReduced.cxx @@ -398,9 +398,9 @@ struct HfTaskLbReduced { auto ptLc = candidate.ptProng0(); auto invMassLc = candLc.invMassHypo0() > 0 ? candLc.invMassHypo0() : candLc.invMassHypo1(); // TODO: here we are assuming that only one of the two hypotheses is filled, to be checked - std::array posPv{candidate.posX(), candidate.posY(), candidate.posZ()}; - std::array posSvLc{candLc.xSecondaryVertex(), candLc.ySecondaryVertex(), candLc.zSecondaryVertex()}; - std::array momLc{candLc.pVector()}; + std::array const posPv{candidate.posX(), candidate.posY(), candidate.posZ()}; + std::array const posSvLc{candLc.xSecondaryVertex(), candLc.ySecondaryVertex(), candLc.zSecondaryVertex()}; + std::array const momLc{candLc.pVector()}; auto cospLc = RecoDecay::cpa(posPv, posSvLc, momLc); auto cospXyLc = RecoDecay::cpaXY(posPv, posSvLc, momLc); auto decLenLc = RecoDecay::distance(posPv, posSvLc); @@ -539,7 +539,7 @@ struct HfTaskLbReduced { } } if (fillTree) { - float pseudoRndm = ptLc * 1000. - static_cast(ptLc * 1000); + float const pseudoRndm = ptLc * 1000. - static_cast(ptLc * 1000); if (flagMcMatchRec != 0 || (((DoMc && fillBackground) || !DoMc) && (ptCandLb >= ptMaxForDownSample || pseudoRndm < downSampleBkgFactor))) { float prong0MlScoreBkg = -1.; float prong0MlScorePrompt = -1.; @@ -649,7 +649,7 @@ struct HfTaskLbReduced { std::array ptProngs = {particle.ptProng0(), particle.ptProng1()}; std::array yProngs = {particle.yProng0(), particle.yProng1()}; std::array etaProngs = {particle.etaProng0(), particle.etaProng1()}; - bool prongsInAcc = isProngInAcceptance(etaProngs[0], ptProngs[0]) && isProngInAcceptance(etaProngs[1], ptProngs[1]); + bool const prongsInAcc = isProngInAcceptance(etaProngs[0], ptProngs[0]) && isProngInAcceptance(etaProngs[1], ptProngs[1]); if (fillHistograms) { registry.fill(HIST("hPtProng0Gen"), ptParticle, ptProngs[0]); diff --git a/PWGHF/D2H/Tasks/taskLc.cxx b/PWGHF/D2H/Tasks/taskLc.cxx index ccbd6c8bb45..8c391447428 100644 --- a/PWGHF/D2H/Tasks/taskLc.cxx +++ b/PWGHF/D2H/Tasks/taskLc.cxx @@ -332,10 +332,10 @@ struct HfTaskLc { const AxisSpec thnAxisOccupancy{thnConfigAxisOccupancy, "Occupancy"}; const AxisSpec thnAxisProperLifetime{thnConfigAxisProperLifetime, "T_{proper} (ps)"}; - bool isDataWithMl = doprocessDataWithMl || doprocessDataWithMlWithFT0C || doprocessDataWithMlWithFT0M; - bool isMcWithMl = doprocessMcWithMl || doprocessMcWithMlWithFT0C || doprocessMcWithMlWithFT0M; - bool isDataStd = doprocessDataStd || doprocessDataStdWithFT0C || doprocessDataStdWithFT0M; - bool isMcStd = doprocessMcStd || doprocessMcStdWithFT0C || doprocessMcStdWithFT0M; + bool const isDataWithMl = doprocessDataWithMl || doprocessDataWithMlWithFT0C || doprocessDataWithMlWithFT0M; + bool const isMcWithMl = doprocessMcWithMl || doprocessMcWithMlWithFT0C || doprocessMcWithMlWithFT0M; + bool const isDataStd = doprocessDataStd || doprocessDataStdWithFT0C || doprocessDataStdWithFT0M; + bool const isMcStd = doprocessMcStd || doprocessMcStdWithFT0C || doprocessMcStdWithFT0M; std::vector axesStd, axesWithBdt, axesGen; @@ -555,7 +555,7 @@ struct HfTaskLc { registry.fill(HIST("MC/reconstructed/nonprompt/hDecLenErrSigNonPrompt"), candidate.errorDecayLength(), pt); } if (fillTHn) { - float cent = evaluateCentralityColl(collision); + float const cent = evaluateCentralityColl(collision); float occ{-1.}; if (storeOccupancy && occEstimator != o2::hf_occupancy::OccupancyEstimator::None) { occ = o2::hf_occupancy::getOccupancyColl(collision, occEstimator); @@ -646,7 +646,7 @@ struct HfTaskLc { for (const auto& recCol : recoCollsPerMcColl) { numPvContributors = recCol.numContrib() > numPvContributors ? recCol.numContrib() : numPvContributors; } - float cent = o2::hf_centrality::getCentralityGenColl(recoCollsPerMcColl); + float const cent = o2::hf_centrality::getCentralityGenColl(recoCollsPerMcColl); float occ{-1.}; if (storeOccupancy && occEstimator != o2::hf_occupancy::OccupancyEstimator::None) { occ = o2::hf_occupancy::getOccupancyGenColl(recoCollsPerMcColl, occEstimator); @@ -778,7 +778,7 @@ struct HfTaskLc { registry.fill(HIST("Data/hDecLenErr"), candidate.errorDecayLength(), pt); if (fillTHn) { - float cent = evaluateCentralityColl(collision); + float const cent = evaluateCentralityColl(collision); float occ{-1.}; if (storeOccupancy && occEstimator != o2::hf_occupancy::OccupancyEstimator::None) { occ = o2::hf_occupancy::getOccupancyColl(collision, occEstimator); diff --git a/PWGHF/D2H/Tasks/taskLcToK0sP.cxx b/PWGHF/D2H/Tasks/taskLcToK0sP.cxx index f107452344a..955331e6d3f 100644 --- a/PWGHF/D2H/Tasks/taskLcToK0sP.cxx +++ b/PWGHF/D2H/Tasks/taskLcToK0sP.cxx @@ -62,25 +62,25 @@ struct HfTaskLcToK0sP { void init(InitContext& context) { // axes - AxisSpec axisBinsPt = {binsPt, "#it{p}_{T} (GeV/#it{c})"}; - AxisSpec axisPt = {300, 0.0f, 30.0f, "#it{p}_{T} (GeV/#it{c})"}; - AxisSpec axisEta = {500, -2.0f, 2.0f, "#it{#eta}"}; - AxisSpec axisPhi = {100, 0.f, 6.3f, "#it{#phi}"}; - AxisSpec axisMassCand = {600, 1.98f, 2.58f, "inv. mass (p K_{S}^{0}) (GeV/#it{c}^{2})"}; - AxisSpec axisd0 = {500, -0.5f, 0.5f, "DCAxy (cm)"}; - AxisSpec axisd0V0Daughters = {1000, -5.0f, 5.0f, "DCAxy (cm)"}; - AxisSpec axisV0CPA = {500, 0.98f, 1.0001f, "v0 cos pointing angle"}; - AxisSpec axisV0Radius = {1000, 0.f, 40.f, "V0 radius (cm)"}; - AxisSpec axisV0DCADaughters = {200, 0.f, 2.f, "DCA (cm)"}; - AxisSpec axisMassK0Short = {500, 0.4f, 0.6f, "#it{m}(K_{S}^{0}) (GeV/#it{c}^{2})"}; - AxisSpec axisMassLambda = {500, 1.0f, 1.2f, "#it{m}(#Lambda) (GeV/#it{c}^{2})"}; - AxisSpec axisMassGamma = {500, 0.0f, 0.4f, "#it{m}(#gamma) (GeV/#it{c}^{2})"}; - AxisSpec axisCPACand = {110, -1.1f, 1.1f, "candiate cos pointing angle"}; - AxisSpec axisDecLength = {200, 0.f, 2.0f, "decay length (cm)"}; - AxisSpec axisProperLifetime = {100, 0.f, 0.2f, "#it{c#tau} (cm)"}; - AxisSpec axisProperLifetimeV0 = {1000, 0.f, 80.f, "#it{c#tau} (cm)"}; - AxisSpec axisNSigma = {100, -6.f, 6.f, "n#it{#sigma}_{p}"}; - AxisSpec axisPidP = {100, 0.f, 10.0f, "#it{p} (GeV/#it{c})"}; + AxisSpec const axisBinsPt = {binsPt, "#it{p}_{T} (GeV/#it{c})"}; + AxisSpec const axisPt = {300, 0.0f, 30.0f, "#it{p}_{T} (GeV/#it{c})"}; + AxisSpec const axisEta = {500, -2.0f, 2.0f, "#it{#eta}"}; + AxisSpec const axisPhi = {100, 0.f, 6.3f, "#it{#phi}"}; + AxisSpec const axisMassCand = {600, 1.98f, 2.58f, "inv. mass (p K_{S}^{0}) (GeV/#it{c}^{2})"}; + AxisSpec const axisd0 = {500, -0.5f, 0.5f, "DCAxy (cm)"}; + AxisSpec const axisd0V0Daughters = {1000, -5.0f, 5.0f, "DCAxy (cm)"}; + AxisSpec const axisV0CPA = {500, 0.98f, 1.0001f, "v0 cos pointing angle"}; + AxisSpec const axisV0Radius = {1000, 0.f, 40.f, "V0 radius (cm)"}; + AxisSpec const axisV0DCADaughters = {200, 0.f, 2.f, "DCA (cm)"}; + AxisSpec const axisMassK0Short = {500, 0.4f, 0.6f, "#it{m}(K_{S}^{0}) (GeV/#it{c}^{2})"}; + AxisSpec const axisMassLambda = {500, 1.0f, 1.2f, "#it{m}(#Lambda) (GeV/#it{c}^{2})"}; + AxisSpec const axisMassGamma = {500, 0.0f, 0.4f, "#it{m}(#gamma) (GeV/#it{c}^{2})"}; + AxisSpec const axisCPACand = {110, -1.1f, 1.1f, "candiate cos pointing angle"}; + AxisSpec const axisDecLength = {200, 0.f, 2.0f, "decay length (cm)"}; + AxisSpec const axisProperLifetime = {100, 0.f, 0.2f, "#it{c#tau} (cm)"}; + AxisSpec const axisProperLifetimeV0 = {1000, 0.f, 80.f, "#it{c#tau} (cm)"}; + AxisSpec const axisNSigma = {100, -6.f, 6.f, "n#it{#sigma}_{p}"}; + AxisSpec const axisPidP = {100, 0.f, 10.0f, "#it{p} (GeV/#it{c})"}; // data registry.add("hPtCand", "cascade candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {axisPt}}); registry.add("hEtaCand", "cascade candidates;candidate #it{#eta};entries", {HistType::kTH1F, {axisEta}}); diff --git a/PWGHF/D2H/Tasks/taskOmegac0ToOmegapi.cxx b/PWGHF/D2H/Tasks/taskOmegac0ToOmegapi.cxx index c2b8dd976a7..f3941a83889 100644 --- a/PWGHF/D2H/Tasks/taskOmegac0ToOmegapi.cxx +++ b/PWGHF/D2H/Tasks/taskOmegac0ToOmegapi.cxx @@ -214,7 +214,7 @@ struct HfTaskOmegac0ToOmegapi { continue; } - float cent = evaluateCentralityColl(collision); + float const cent = evaluateCentralityColl(collision); if constexpr (ApplyMl) { registry.fill(HIST("hReco"), candidate.invMassCharmBaryon(), candidate.ptCharmBaryon(), candidate.kfRapOmegac(), @@ -262,7 +262,7 @@ struct HfTaskOmegac0ToOmegapi { if (particle.originMcGen() == RecoDecay::OriginType::Prompt) { registry.fill(HIST("hMcGen"), ptGen, -1., yGen, RecoDecay::OriginType::Prompt); } else { - float ptGenB = mcParticles.rawIteratorAt(particle.idxBhadMotherPart()).pt(); + float const ptGenB = mcParticles.rawIteratorAt(particle.idxBhadMotherPart()).pt(); registry.fill(HIST("hMcGen"), ptGen, ptGenB, yGen, RecoDecay::OriginType::NonPrompt); } } @@ -282,8 +282,8 @@ struct HfTaskOmegac0ToOmegapi { } auto collision = candidate.template collision_as(); - uint16_t numPvContributors = collision.numContrib(); - float mcCent = evaluateCentralityColl(collision.template mcCollision_as()); + uint16_t const numPvContributors = collision.numContrib(); + float const mcCent = evaluateCentralityColl(collision.template mcCollision_as()); if constexpr (ApplyMl) { registry.fill(HIST("hReco"), candidate.invMassCharmBaryon(), candidate.ptCharmBaryon(), candidate.kfRapOmegac(), mcCent, numPvContributors, candidate.ptBhadMotherPart(), candidate.originMcRec(), candidate.flagMcMatchRec(), candidate.mlProbOmegac()[0]); @@ -309,12 +309,12 @@ struct HfTaskOmegac0ToOmegapi { maxNumContrib = recCol.numContrib() > maxNumContrib ? recCol.numContrib() : maxNumContrib; } - float mcCent = evaluateCentralityColl(mcCollision); + float const mcCent = evaluateCentralityColl(mcCollision); if (particle.originMcGen() == RecoDecay::OriginType::Prompt) { registry.fill(HIST("hMcGen"), ptGen, -1., yGen, RecoDecay::OriginType::Prompt, mcCent, maxNumContrib); } else { - float ptGenB = mcParticles.rawIteratorAt(particle.idxBhadMotherPart()).pt(); + float const ptGenB = mcParticles.rawIteratorAt(particle.idxBhadMotherPart()).pt(); registry.fill(HIST("hMcGen"), ptGen, ptGenB, yGen, RecoDecay::OriginType::NonPrompt, mcCent, maxNumContrib); } @@ -325,7 +325,7 @@ struct HfTaskOmegac0ToOmegapi { if (particle.originMcGen() == RecoDecay::OriginType::Prompt) { registry.fill(HIST("hMcGenWithRecoColl"), ptGen, -1., yGen, RecoDecay::OriginType::Prompt, mcCent, maxNumContrib); } else { - float ptGenB = mcParticles.rawIteratorAt(particle.idxBhadMotherPart()).pt(); + float const ptGenB = mcParticles.rawIteratorAt(particle.idxBhadMotherPart()).pt(); registry.fill(HIST("hMcGenWithRecoColl"), ptGen, ptGenB, yGen, RecoDecay::OriginType::NonPrompt, mcCent, maxNumContrib); } } diff --git a/PWGHF/D2H/Tasks/taskSigmac.cxx b/PWGHF/D2H/Tasks/taskSigmac.cxx index e47f1133334..e6e9fbe4e1f 100644 --- a/PWGHF/D2H/Tasks/taskSigmac.cxx +++ b/PWGHF/D2H/Tasks/taskSigmac.cxx @@ -545,7 +545,7 @@ struct HfTaskSigmac { /// loop over Λc+ candidates w/o Σc0,++ mass-window cut for (const auto& candidateLc : candidatesLc) { double massLc(-1.); - double ptLc(candidateLc.pt()); + double const ptLc(candidateLc.pt()); double decLengthLc(candidateLc.decayLength()), decLengthXYLc(candidateLc.decayLengthXY()); double cpaLc(candidateLc.cpa()), cpaXYLc(candidateLc.cpaXY()); if (candidateLc.isSelLcToPKPi() >= 1) { @@ -602,10 +602,10 @@ struct HfTaskSigmac { for (const auto& particle : mcParticlesSc) { /// reject immediately particles different from Σc0,++ - bool isSc0Gen = (std::abs(particle.flagMcMatchGen()) == BIT(aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi)); - bool isScStar0Gen = (std::abs(particle.flagMcMatchGen()) == BIT(aod::hf_cand_sigmac::DecayType::ScStar0ToPKPiPi)); - bool isScPlusPlusGen = (std::abs(particle.flagMcMatchGen()) == BIT(aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi)); - bool isScStarPlusPlusGen = (std::abs(particle.flagMcMatchGen()) == BIT(aod::hf_cand_sigmac::DecayType::ScStarPlusPlusToPKPiPi)); + bool const isSc0Gen = (std::abs(particle.flagMcMatchGen()) == BIT(aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi)); + bool const isScStar0Gen = (std::abs(particle.flagMcMatchGen()) == BIT(aod::hf_cand_sigmac::DecayType::ScStar0ToPKPiPi)); + bool const isScPlusPlusGen = (std::abs(particle.flagMcMatchGen()) == BIT(aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi)); + bool const isScStarPlusPlusGen = (std::abs(particle.flagMcMatchGen()) == BIT(aod::hf_cand_sigmac::DecayType::ScStarPlusPlusToPKPiPi)); if (!isSc0Gen && !isScPlusPlusGen && !isScStar0Gen && !isScStarPlusPlusGen) { continue; } @@ -708,7 +708,7 @@ struct HfTaskSigmac { registry.fill(HIST("MC/generated/hPtGenLcFromSc0PlusPlusSig"), ptGenLc, origin, channel); registry.fill(HIST("MC/generated/hEtaGenLcFromSc0PlusPlusSig"), etaGenLc, origin, channel); registry.fill(HIST("MC/generated/hPhiGenLcFromSc0PlusPlusSig"), phiGenLc, origin, channel); /// Generated Λc+ ← Σc0,++ signal - int8_t particleAntiparticle = particle.particleAntiparticle(); + int8_t const particleAntiparticle = particle.particleAntiparticle(); if (origin == RecoDecay::OriginType::Prompt) { registry.fill(HIST("MC/generated/hnSigmaCGen"), ptGenSc, ptGenScBMother, origin, channel, ptGenLc, 0, sigmacSpecies, particleAntiparticle); } else { @@ -743,7 +743,7 @@ struct HfTaskSigmac { registry.fill(HIST("MC/generated/hPtGenLcFromSc0PlusPlusSig"), ptGenLc, origin, channel); registry.fill(HIST("MC/generated/hEtaGenLcFromSc0PlusPlusSig"), etaGenLc, origin, channel); registry.fill(HIST("MC/generated/hPhiGenLcFromSc0PlusPlusSig"), phiGenLc, origin, channel); /// Generated Λc+ ← Σc0,++ signal - int8_t particleAntiparticle = particle.particleAntiparticle(); + int8_t const particleAntiparticle = particle.particleAntiparticle(); if (origin == RecoDecay::OriginType::Prompt) { registry.fill(HIST("MC/generated/hnSigmaCGen"), ptGenSc, ptGenScBMother, origin, channel, ptGenLc, 2, sigmacSpecies, particleAntiparticle); } else { @@ -769,8 +769,8 @@ struct HfTaskSigmac { continue; } double ptGenLc(particle.pt()), ptGenLcBMother(-1.); - int origin = particle.originMcGen(); - int channel = particle.flagMcDecayChanGen(); + int const origin = particle.originMcGen(); + int const channel = particle.flagMcDecayChanGen(); if (origin == RecoDecay::OriginType::Prompt) { registry.fill(HIST("MC/generated/hnLambdaCGen"), ptGenLc, ptGenLcBMother, origin, channel); } else { @@ -798,10 +798,10 @@ struct HfTaskSigmac { // candidateLc.flagMcDecayChanRec(); - bool isTrueSc0Reco = std::abs(candSc.flagMcMatchRec()) == BIT(aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi); - bool isTrueScStar0Reco = std::abs(candSc.flagMcMatchRec()) == BIT(aod::hf_cand_sigmac::DecayType::ScStar0ToPKPiPi); - bool isTrueScPlusPlusReco = std::abs(candSc.flagMcMatchRec()) == BIT(aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi); - bool isTrueScStarPlusPlusReco = std::abs(candSc.flagMcMatchRec()) == BIT(aod::hf_cand_sigmac::DecayType::ScStarPlusPlusToPKPiPi); + bool const isTrueSc0Reco = std::abs(candSc.flagMcMatchRec()) == BIT(aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi); + bool const isTrueScStar0Reco = std::abs(candSc.flagMcMatchRec()) == BIT(aod::hf_cand_sigmac::DecayType::ScStar0ToPKPiPi); + bool const isTrueScPlusPlusReco = std::abs(candSc.flagMcMatchRec()) == BIT(aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi); + bool const isTrueScStarPlusPlusReco = std::abs(candSc.flagMcMatchRec()) == BIT(aod::hf_cand_sigmac::DecayType::ScStarPlusPlusToPKPiPi); int sigmacSpecies = -1; if ((isTrueSc0Reco || isTrueScStar0Reco) && (chargeSc == o2::aod::hf_cand_sigmac::ChargeNull)) { /// Reconstructed Σc0 signal @@ -820,7 +820,7 @@ struct HfTaskSigmac { // Get the corresponding MC particle for Lc auto arrayDaughtersLc = std::array{candidateLc.template prong0_as(), candidateLc.template prong1_as(), candidateLc.template prong2_as()}; int8_t sign = 0; - int indexMcLcRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersLc, o2::constants::physics::Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2); + int const indexMcLcRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersLc, o2::constants::physics::Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2); auto particleLc = mcParticles.rawIteratorAt(indexMcLcRec); // Get the corresponding MC particle for soft pion auto particleSoftPi = candSc.prong1_as().mcParticle(); @@ -835,7 +835,7 @@ struct HfTaskSigmac { double ptGenSc(particleSc.pt()), ptGenLc(particleLc.pt()), ptGenSoftPi(particleSoftPi.pt()); double decLengthLc(candidateLc.decayLength()), decLengthXYLc(candidateLc.decayLengthXY()); double cpaLc(candidateLc.cpa()), cpaXYLc(candidateLc.cpaXY()); - int origin = candSc.originMcRec(); + int const origin = candSc.originMcRec(); auto channel = candidateLc.flagMcDecayChanRec(); /// 0: direct; 1: Λc± → p± K*; 2: Λc± → Δ(1232)±± K∓; 3: Λc± → Λ(1520) π± /// candidate Λc+ → pK-π+ (and charge conjugate) within the range of M(pK-π+) chosen in the Σc0,++ builder @@ -896,7 +896,7 @@ struct HfTaskSigmac { /// THn for candidate Σc0,++ cut variation if (enableTHn) { - int8_t particleAntiparticle = candSc.particleAntiparticle(); + int8_t const particleAntiparticle = candSc.particleAntiparticle(); const float softPiAbsDcaXY = std::abs(candSc.softPiDcaXY()); const float softPiAbsDcaZ = std::abs(candSc.softPiDcaZ()); if constexpr (UseMl) { @@ -981,7 +981,7 @@ struct HfTaskSigmac { /// THn for candidate Σc0,++ cut variation if (enableTHn) { - int8_t particleAntiparticle = candSc.particleAntiparticle(); + int8_t const particleAntiparticle = candSc.particleAntiparticle(); const float softPiAbsDcaXY = std::abs(candSc.softPiDcaXY()); const float softPiAbsDcaZ = std::abs(candSc.softPiDcaZ()); if constexpr (UseMl) { @@ -1026,7 +1026,7 @@ struct HfTaskSigmac { // Get the corresponding MC particle for Lc auto arrayDaughtersLc = std::array{candidateLc.template prong0_as(), candidateLc.template prong1_as(), candidateLc.template prong2_as()}; int8_t sign = 0; - int indexMcLcRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersLc, o2::constants::physics::Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2); + int const indexMcLcRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersLc, o2::constants::physics::Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2); auto particleLc = mcParticles.rawIteratorAt(indexMcLcRec); // Get the corresponding MC particle for soft pion auto particleSoftPi = candSc.prong1_as().mcParticle(); @@ -1041,7 +1041,7 @@ struct HfTaskSigmac { double ptGenSc(particleSc.pt()), ptGenLc(particleLc.pt()), ptGenSoftPi(particleSoftPi.pt()); double decLengthLc(candidateLc.decayLength()), decLengthXYLc(candidateLc.decayLengthXY()); double cpaLc(candidateLc.cpa()), cpaXYLc(candidateLc.cpaXY()); - int origin = candSc.originMcRec(); + int const origin = candSc.originMcRec(); auto channel = candidateLc.flagMcDecayChanRec(); /// 0: direct; 1: Λc± → p± K*; 2: Λc± → Δ(1232)±± K∓; 3: Λc± → Λ(1520) π±; FIXME: DecayChannelResonant /// candidate Λc+ → pK-π+ (and charge conjugate) within the range of M(pK-π+) chosen in the Σc0,++ builder @@ -1102,7 +1102,7 @@ struct HfTaskSigmac { /// THn for candidate Σc0,++ cut variation if (enableTHn) { - int8_t particleAntiparticle = candSc.particleAntiparticle(); + int8_t const particleAntiparticle = candSc.particleAntiparticle(); const float softPiAbsDcaXY = std::abs(candSc.softPiDcaXY()); const float softPiAbsDcaZ = std::abs(candSc.softPiDcaZ()); if constexpr (UseMl) { @@ -1185,7 +1185,7 @@ struct HfTaskSigmac { /// THn for candidate Σc0,++ cut variation if (enableTHn) { - int8_t particleAntiparticle = candSc.particleAntiparticle(); + int8_t const particleAntiparticle = candSc.particleAntiparticle(); const float softPiAbsDcaXY = std::abs(candSc.softPiDcaXY()); const float softPiAbsDcaZ = std::abs(candSc.softPiDcaZ()); if constexpr (UseMl) { @@ -1224,10 +1224,10 @@ struct HfTaskSigmac { continue; } double massLc(-1.); - double ptLc(candidateLc.pt()); + double const ptLc(candidateLc.pt()); double decLengthLc(candidateLc.decayLength()), decLengthXYLc(candidateLc.decayLengthXY()); double cpaLc(candidateLc.cpa()), cpaXYLc(candidateLc.cpaXY()); - int origin = candidateLc.originMcRec(); + int const origin = candidateLc.originMcRec(); auto channel = candidateLc.flagMcDecayChanRec(); /// 0: direct; 1: Λc± → p± K*; 2: Λc± → Δ(1232)±± K∓; 3: Λc± → Λ(1520) π± int pdgAbs = -1; if (candidateLc.template prong0_as().has_mcParticle()) { diff --git a/PWGHF/D2H/Tasks/taskSigmacToCascade.cxx b/PWGHF/D2H/Tasks/taskSigmacToCascade.cxx index fc527254dac..5d6a27f7141 100644 --- a/PWGHF/D2H/Tasks/taskSigmacToCascade.cxx +++ b/PWGHF/D2H/Tasks/taskSigmacToCascade.cxx @@ -67,26 +67,26 @@ struct HfTaskSigmacToCascade { void init(InitContext&) { // axes - AxisSpec axisBinsPt = {binsPt, "#it{p}_{T} (GeV/#it{c})"}; - AxisSpec axisPt = {300, 0.0f, 30.0f, "#it{p}_{T} (GeV/#it{c})"}; - AxisSpec axisEta = {500, -2.0f, 2.0f, "#it{#eta}"}; - AxisSpec axisY = {500, -2.0f, 2.0f, "y"}; - AxisSpec axisPhi = {100, 0.f, 6.3f, "#it{#phi}"}; - AxisSpec axisMassCand = {600, 1.98f, 2.58f, "inv. mass (p K_{S}^{0}) (GeV/#it{c}^{2})"}; - AxisSpec axisd0 = {500, -0.5f, 0.5f, "DCAxy (cm)"}; - AxisSpec axisd0V0Daughters = {1000, -5.0f, 5.0f, "DCAxy (cm)"}; - AxisSpec axisV0CPA = {500, 0.98f, 1.0001f, "v0 cos pointing angle"}; - AxisSpec axisV0Radius = {1000, 0.f, 40.f, "V0 radius (cm)"}; - AxisSpec axisV0DCADaughters = {200, 0.f, 2.f, "DCA (cm)"}; - AxisSpec axisMassK0Short = {500, 0.4f, 0.6f, "#it{m}(K_{S}^{0}) (GeV/#it{c}^{2})"}; - AxisSpec axisMassLambda = {500, 1.0f, 1.2f, "#it{m}(#Lambda) (GeV/#it{c}^{2})"}; - AxisSpec axisMassGamma = {500, 0.0f, 0.4f, "#it{m}(#gamma) (GeV/#it{c}^{2})"}; - AxisSpec axisCPACand = {110, -1.1f, 1.1f, "candiate cos pointing angle"}; - AxisSpec axisDecLength = {200, 0.f, 2.0f, "decay length (cm)"}; - AxisSpec axisProperLifetime = {100, 0.f, 0.2f, "#it{c#tau} (cm)"}; - AxisSpec axisProperLifetimeV0 = {1000, 0.f, 80.f, "#it{c#tau} (cm)"}; - AxisSpec axisNSigma = {100, -6.f, 6.f, "n#it{#sigma}_{p}"}; - AxisSpec axisPidP = {100, 0.f, 10.0f, "#it{p} (GeV/#it{c})"}; + AxisSpec const axisBinsPt = {binsPt, "#it{p}_{T} (GeV/#it{c})"}; + AxisSpec const axisPt = {300, 0.0f, 30.0f, "#it{p}_{T} (GeV/#it{c})"}; + AxisSpec const axisEta = {500, -2.0f, 2.0f, "#it{#eta}"}; + AxisSpec const axisY = {500, -2.0f, 2.0f, "y"}; + AxisSpec const axisPhi = {100, 0.f, 6.3f, "#it{#phi}"}; + AxisSpec const axisMassCand = {600, 1.98f, 2.58f, "inv. mass (p K_{S}^{0}) (GeV/#it{c}^{2})"}; + AxisSpec const axisd0 = {500, -0.5f, 0.5f, "DCAxy (cm)"}; + AxisSpec const axisd0V0Daughters = {1000, -5.0f, 5.0f, "DCAxy (cm)"}; + AxisSpec const axisV0CPA = {500, 0.98f, 1.0001f, "v0 cos pointing angle"}; + AxisSpec const axisV0Radius = {1000, 0.f, 40.f, "V0 radius (cm)"}; + AxisSpec const axisV0DCADaughters = {200, 0.f, 2.f, "DCA (cm)"}; + AxisSpec const axisMassK0Short = {500, 0.4f, 0.6f, "#it{m}(K_{S}^{0}) (GeV/#it{c}^{2})"}; + AxisSpec const axisMassLambda = {500, 1.0f, 1.2f, "#it{m}(#Lambda) (GeV/#it{c}^{2})"}; + AxisSpec const axisMassGamma = {500, 0.0f, 0.4f, "#it{m}(#gamma) (GeV/#it{c}^{2})"}; + AxisSpec const axisCPACand = {110, -1.1f, 1.1f, "candiate cos pointing angle"}; + AxisSpec const axisDecLength = {200, 0.f, 2.0f, "decay length (cm)"}; + AxisSpec const axisProperLifetime = {100, 0.f, 0.2f, "#it{c#tau} (cm)"}; + AxisSpec const axisProperLifetimeV0 = {1000, 0.f, 80.f, "#it{c#tau} (cm)"}; + AxisSpec const axisNSigma = {100, -6.f, 6.f, "n#it{#sigma}_{p}"}; + AxisSpec const axisPidP = {100, 0.f, 10.0f, "#it{p} (GeV/#it{c})"}; const AxisSpec axisDeltaMassSigmaC{configAxisDeltaMassSigmaC, "#it{M}(pK_{S}^{0}#pi) - #it{M}(pK_{S}^{0}) (GeV/#it{c}^{2})"}; // data @@ -142,8 +142,8 @@ struct HfTaskSigmacToCascade { const auto& candidateLc = candSc.prongLc_as(); float massSc(-1.), massLc(-1.), deltaMass(-1.); float ptSc(candSc.pt()), ptLc(candidateLc.pt()); - float etaSc(candSc.eta()) /*, etaLc(candidateLc.eta())*/; - float phiSc(candSc.phi()) /*, phiLc(candidateLc.phi())*/; + float const etaSc(candSc.eta()) /*, etaLc(candidateLc.eta())*/; + float const phiSc(candSc.phi()) /*, phiLc(candidateLc.phi())*/; float ptSoftPi(candSc.prong1().pt()), etaSoftPi(candSc.prong1().eta()), phiSoftPi(candSc.prong1().phi()); double decLengthLc(candidateLc.decayLength()), decLengthXYLc(candidateLc.decayLengthXY()); float cpaLc(candidateLc.cpa()), cpaXYLc(candidateLc.cpaXY()); diff --git a/PWGHF/D2H/Tasks/taskXic.cxx b/PWGHF/D2H/Tasks/taskXic.cxx index f8f9ff97299..4d517f9fdfb 100644 --- a/PWGHF/D2H/Tasks/taskXic.cxx +++ b/PWGHF/D2H/Tasks/taskXic.cxx @@ -119,10 +119,10 @@ struct HfTaskXic { LOGP(fatal, "no or more than one process function enabled! Please check your configuration!"); } - AxisSpec axisPPid = {100, 0.f, 10.0f, "#it{p} (GeV/#it{c})"}; - AxisSpec axisNSigmaPr = {100, -6.f, 6.f, "n#it{#sigma}_{p}"}; - AxisSpec axisNSigmaPi = {100, -6.f, 6.f, "n#it{#sigma}_{#pi}"}; - AxisSpec axisNSigmaKa = {100, -6.f, 6.f, "n#it{#sigma}_{K}"}; + AxisSpec const axisPPid = {100, 0.f, 10.0f, "#it{p} (GeV/#it{c})"}; + AxisSpec const axisNSigmaPr = {100, -6.f, 6.f, "n#it{#sigma}_{p}"}; + AxisSpec const axisNSigmaPi = {100, -6.f, 6.f, "n#it{#sigma}_{#pi}"}; + AxisSpec const axisNSigmaKa = {100, -6.f, 6.f, "n#it{#sigma}_{K}"}; auto vbins = (std::vector)binsPt; // histo in pt bins registry.add("Data/hMassVsPt", "3-prong candidates;inv. mass (p K #pi) (GeV/#it{c}^{2});;entries", {HistType::kTH2F, {{500, 2., 3.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); @@ -477,7 +477,7 @@ struct HfTaskXic { registry.fill(HIST("MC/reconstructed/signal/hEtaVsPtRecSig"), candidate.eta(), ptCandidate); /// reconstructed signal prompt - int origin = candidate.originMcRec(); + int const origin = candidate.originMcRec(); if (origin == RecoDecay::OriginType::Prompt) { if ((candidate.isSelXicToPKPi() >= selectionFlagXic) && pdgCodeProng0 == kProton) { registry.fill(HIST("MC/reconstructed/prompt/hMassRecSigPrompt"), massXicToPKPi); diff --git a/PWGHF/D2H/Tasks/taskXic0ToXiPi.cxx b/PWGHF/D2H/Tasks/taskXic0ToXiPi.cxx index 1404a9941b0..55bfe924842 100644 --- a/PWGHF/D2H/Tasks/taskXic0ToXiPi.cxx +++ b/PWGHF/D2H/Tasks/taskXic0ToXiPi.cxx @@ -116,7 +116,7 @@ struct HfTaskXic0ToXiPi { const AxisSpec thnAxisNumPvContr{thnConfigAxisNumPvContr, "Number of PV contributors"}; if (doprocessMcWithKFParticle || doprocessMcWithKFParticleMl) { - std::vector axesAcc = {thnAxisGenPtD, thnAxisGenPtB, thnAxisY, thnAxisOrigin, thnAxisNumPvContr}; + std::vector const axesAcc = {thnAxisGenPtD, thnAxisGenPtB, thnAxisY, thnAxisOrigin, thnAxisNumPvContr}; registry.add("hSparseAcc", "Thn for generated Xic0 from charm and beauty", HistType::kTHnSparseD, axesAcc); registry.get(HIST("hSparseAcc"))->Sumw2(); } @@ -141,8 +141,8 @@ struct HfTaskXic0ToXiPi { const AxisSpec thnAxisPromptScore{thnConfigAxisPromptScore, "BDT score prompt."}; const AxisSpec thnAxisCent{thnConfigAxisCent, "Centrality."}; const AxisSpec thnAxisPtPion{thnConfigAxisPtPion, "Pt of Pion from Xic0."}; - std::vector axesWithBdtCent = {thnAxisPromptScore, thnAxisMass, thnAxisPt, thnAxisY, thnAxisCent, thnAxisPtPion, thnConfigAxisNumPvContr}; - std::vector axesWithCent = {thnAxisMass, thnAxisPt, thnAxisY, thnAxisCent, thnAxisPtPion, thnConfigAxisNumPvContr}; + std::vector const axesWithBdtCent = {thnAxisPromptScore, thnAxisMass, thnAxisPt, thnAxisY, thnAxisCent, thnAxisPtPion, thnConfigAxisNumPvContr}; + std::vector const axesWithCent = {thnAxisMass, thnAxisPt, thnAxisY, thnAxisCent, thnAxisPtPion, thnConfigAxisNumPvContr}; registry.add("hBdtScoreVsMassVsPtVsYVsCentVsPtPion", "Thn for Xic0 candidates with BDT&Cent&pTpi", HistType::kTHnSparseD, axesWithBdtCent); registry.add("hMassVsPtVsYVsCentVsPtPion", "Thn for Xic0 candidates with Cent&pTpi", HistType::kTHnSparseD, axesWithCent); registry.get(HIST("hBdtScoreVsMassVsPtVsYVsCentVsPtPion"))->Sumw2(); @@ -194,8 +194,8 @@ struct HfTaskXic0ToXiPi { auto const& collision = candidate.template collision_as(); centrality = o2::hf_centrality::getCentralityColl(collision); } - double kfptXic = RecoDecay::sqrtSumOfSquares(candidate.pxCharmBaryon(), candidate.pyCharmBaryon()); - double kfptPiFromXic = RecoDecay::sqrtSumOfSquares(candidate.pxBachFromCharmBaryon(), candidate.pyBachFromCharmBaryon()); + double const kfptXic = RecoDecay::sqrtSumOfSquares(candidate.pxCharmBaryon(), candidate.pyCharmBaryon()); + double const kfptPiFromXic = RecoDecay::sqrtSumOfSquares(candidate.pxBachFromCharmBaryon(), candidate.pyBachFromCharmBaryon()); if constexpr (ApplyMl) { registry.fill(HIST("hBdtScoreVsMassVsPtVsYVsCentVsPtPion"), candidate.mlProbToXiPi()[0], @@ -235,7 +235,7 @@ struct HfTaskXic0ToXiPi { } auto numPvContributors = candidate.template collision_as().numContrib(); - double kfptXic = RecoDecay::sqrtSumOfSquares(candidate.pxCharmBaryon(), candidate.pyCharmBaryon()); + double const kfptXic = RecoDecay::sqrtSumOfSquares(candidate.pxCharmBaryon(), candidate.pyCharmBaryon()); if constexpr (ApplyMl) { registry.fill(HIST("hBdtScoreVsMassVsPtVsPtBVsYVsOriginVsXic0Type"), candidate.mlProbToXiPi()[0], @@ -281,7 +281,7 @@ struct HfTaskXic0ToXiPi { RecoDecay::OriginType::Prompt, maxNumContrib); } else { - float ptGenB = mcParticles.rawIteratorAt(particle.idxBhadMotherPart()).pt(); + float const ptGenB = mcParticles.rawIteratorAt(particle.idxBhadMotherPart()).pt(); registry.fill(HIST("hSparseAcc"), ptGen, ptGenB, diff --git a/PWGHF/D2H/Tasks/taskXicToXiPiPi.cxx b/PWGHF/D2H/Tasks/taskXicToXiPiPi.cxx index 58ba6805cee..79853e9dc46 100644 --- a/PWGHF/D2H/Tasks/taskXicToXiPiPi.cxx +++ b/PWGHF/D2H/Tasks/taskXicToXiPiPi.cxx @@ -298,7 +298,7 @@ struct HfTaskXicToXiPiPi { double outputBkg = -99.; // bkg score double outputPrompt = -99.; // prompt score double outputFD = -99.; // non-prompt score - int scoreSize = candidate.mlProbXicToXiPiPi().size(); + int const scoreSize = candidate.mlProbXicToXiPiPi().size(); if (scoreSize > 0) { outputBkg = candidate.mlProbXicToXiPiPi()[0]; outputPrompt = candidate.mlProbXicToXiPiPi()[1]; diff --git a/PWGHF/D2H/Tasks/taskXicc.cxx b/PWGHF/D2H/Tasks/taskXicc.cxx index d4caed562fc..2c8e6fcd789 100644 --- a/PWGHF/D2H/Tasks/taskXicc.cxx +++ b/PWGHF/D2H/Tasks/taskXicc.cxx @@ -43,7 +43,7 @@ using namespace o2::framework::expressions; void customize(std::vector& workflowOptions) { - ConfigParamSpec optionDoMC{"doMC", VariantType::Bool, true, {"Fill MC histograms."}}; + ConfigParamSpec const optionDoMC{"doMC", VariantType::Bool, true, {"Fill MC histograms."}}; workflowOptions.push_back(optionDoMC); } diff --git a/PWGHF/D2H/Utils/utilsRedDataFormat.h b/PWGHF/D2H/Utils/utilsRedDataFormat.h index 5956385e994..b188bee7645 100644 --- a/PWGHF/D2H/Utils/utilsRedDataFormat.h +++ b/PWGHF/D2H/Utils/utilsRedDataFormat.h @@ -63,7 +63,7 @@ namespace o2::pid_tpc_tof_utils template float getTpcTofNSigmaPi1(const T1& prong1) { - float defaultNSigma = -999.f; // -999.f is the default value set in TPCPIDResponse.h and PIDTOF.h + float const defaultNSigma = -999.f; // -999.f is the default value set in TPCPIDResponse.h and PIDTOF.h bool hasTpc = prong1.hasTPC(); bool hasTof = prong1.hasTOF(); @@ -87,7 +87,7 @@ float getTpcTofNSigmaPi1(const T1& prong1) template float getTpcTofNSigmaSoftPi(const T1& prongSoftPi) { - float defaultNSigma = -999.f; // -999.f is the default value set in TPCPIDResponse.h and PIDTOF.h + float const defaultNSigma = -999.f; // -999.f is the default value set in TPCPIDResponse.h and PIDTOF.h bool hasTpc = prongSoftPi.hasTPC(); bool hasTof = prongSoftPi.hasTOF(); @@ -112,7 +112,7 @@ float getTpcTofNSigmaSoftPi(const T1& prongSoftPi) template float getTpcTofNSigmaKa1(const T1& prong1) { - float defaultNSigma = -999.f; // -999.f is the default value set in TPCPIDResponse.h and PIDTOF.h + float const defaultNSigma = -999.f; // -999.f is the default value set in TPCPIDResponse.h and PIDTOF.h bool hasTpc = prong1.hasTPC(); bool hasTof = prong1.hasTOF(); diff --git a/PWGHF/HFC/Macros/DhCorrelationExtraction.cxx b/PWGHF/HFC/Macros/DhCorrelationExtraction.cxx index 1e886dfe2e6..ebf50d0f10e 100644 --- a/PWGHF/HFC/Macros/DhCorrelationExtraction.cxx +++ b/PWGHF/HFC/Macros/DhCorrelationExtraction.cxx @@ -543,7 +543,7 @@ Bool_t DhCorrelationExtraction::extractCorrelations(Double_t ptCandMin, Double_t h1DSubtrNormSecPart = reinterpret_cast(h1DSubtrNorm->Clone("h1D_SubtrNorm_SecPart")); h1DSubtrNormSecPart->Sumw2(); - Int_t nBinsPhi = h1DSubtrNormSecPart->GetNbinsX(); + Int_t const nBinsPhi = h1DSubtrNormSecPart->GetNbinsX(); if (nBinsPhi != h1DSecPartFrac->GetNbinsX()) { std::cout << "[ERROR]: nBinsPhi different between h1D_SubtrNorm and h1D_SecPartFrac" << std::endl; return kFALSE; @@ -593,7 +593,7 @@ Bool_t DhCorrelationExtraction::extractCorrelations(Double_t ptCandMin, Double_t c->SaveAs(Form("Output_CorrelationExtraction_%s_Root/CorrFDTemplate_1D_%s_Canvas_PtCand%.0fto%.0f_PoolInt_PtAssoc%.0fto%.0f.root", codeName.Data(), fDmesonLabel.Data(), ptCandMin, ptCandMax, ptHadMin, ptHadMax)); } - Double_t baselineFd = calculateBaseline(h1DTemplateTotal, kTRUE); + Double_t const baselineFd = calculateBaseline(h1DTemplateTotal, kTRUE); Double_t baselineData; if (fSecPartContamination) { baselineData = calculateBaseline(h1DSubtrNormSecPart, kTRUE); @@ -607,7 +607,7 @@ Bool_t DhCorrelationExtraction::extractCorrelations(Double_t ptCandMin, Double_t std::cout << "===================== " << std::endl; std::cout << " " << std::endl; - Double_t baselinediff = baselineData - baselineFd; + Double_t const baselinediff = baselineData - baselineFd; TH1D* hBaselineDiff = reinterpret_cast(h1DFdTemplateNonPrompt->Clone("hBaselineDiff")); for (int iBin = 0; iBin < hBaselineDiff->GetNbinsX(); iBin++) { hBaselineDiff->SetBinContent(iBin + 1, baselinediff); @@ -979,14 +979,14 @@ TH1D* DhCorrelationExtraction::evaluateMcClosModulations(Double_t ptCandMin, Dou TF1* funFit = new TF1("funFit", "[0]", TMath::Pi() * 3. / 8., TMath::Pi() * 3 / 2); hRatioNonPrompt->Fit(funFit, "R"); - Double_t fitVal = funFit->GetParameter(0); + Double_t const fitVal = funFit->GetParameter(0); auto* cRatioMcClosure = new TCanvas(Form("cRatio_MCClosure_PtCand%.0fto%.0f_Pthad%.0fto%.0f", ptCandMin, ptCandMax, ptHadMin, ptHadMax), Form("cRatio_MCClosure_PtCand%.0fto%.0f_Pthad%.0fto%.0f", ptCandMin, ptCandMax, ptHadMin, ptHadMax), 100, 100, 1200, 700); cRatioMcClosure->cd(); hRatioNonPrompt->GetYaxis()->SetRangeUser(0.2, 1.8); hRatioNonPrompt->Draw(); - Double_t fPrompt = getFdPromptFrac(ptCandMin, ptCandMax, ptHadMin, ptHadMax); + Double_t const fPrompt = getFdPromptFrac(ptCandMin, ptCandMax, ptHadMin, ptHadMax); Double_t relAmplC[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; Double_t relAmplB[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; Double_t recoKineVal[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; @@ -1074,10 +1074,10 @@ TH2D* DhCorrelationExtraction::getCorrelHisto(Int_t sEorMe, Int_t sorSb, Int_t p } }*/ - Int_t binExtPtCandMin = hSparse->GetAxis(2)->FindBin(ptCandMin + 0.01); // axis2: ptCand, the 0.01 to avoid bin edges! - Int_t binExtPtCandMax = hSparse->GetAxis(2)->FindBin(ptCandMax - 0.01); - Int_t binExtPtHadMin = hSparse->GetAxis(3)->FindBin(ptHadMin + 0.01); // axis3: ptHad - Int_t binExtPtHadMax = hSparse->GetAxis(3)->FindBin(ptHadMax - 0.01); + Int_t const binExtPtCandMin = hSparse->GetAxis(2)->FindBin(ptCandMin + 0.01); // axis2: ptCand, the 0.01 to avoid bin edges! + Int_t const binExtPtCandMax = hSparse->GetAxis(2)->FindBin(ptCandMax - 0.01); + Int_t const binExtPtHadMin = hSparse->GetAxis(3)->FindBin(ptHadMin + 0.01); // axis3: ptHad + Int_t const binExtPtHadMax = hSparse->GetAxis(3)->FindBin(ptHadMax - 0.01); Int_t binExtPoolMin; Int_t binExtPoolMax; if (fCorrectPoolsSeparately) { @@ -1144,16 +1144,16 @@ void DhCorrelationExtraction::getSignalAndBackgroundForNorm(Double_t ptCandMin, TH1F* hMassFitSBLYield = reinterpret_cast(fFileMass->Get("hBackgroundSidebandLeft")); TH1F* hMassFitSBRYield = reinterpret_cast(fFileMass->Get("hBackgroundSidebandRight")); - Int_t ptCandBin = hMassFitSgnYield->FindBin(ptCandMin + 0.01); + Int_t const ptCandBin = hMassFitSgnYield->FindBin(ptCandMin + 0.01); if (ptCandBin != hMassFitSgnYield->FindBin(ptCandMax - 0.01)) { std::cout << "[ERROR] Pt bin in invariant mass histogram not univocally defined " << std::endl; } - Float_t sgnYield = hMassFitSgnYield->GetBinContent(ptCandBin); - Float_t bkgYield = hMassFitBkgYield->GetBinContent(ptCandBin); - Float_t sBsYield = hMassFitSBsYield->GetBinContent(ptCandBin); - Float_t sblYield = hMassFitSBLYield->GetBinContent(ptCandBin); - Float_t sbrYield = hMassFitSBRYield->GetBinContent(ptCandBin); + Float_t const sgnYield = hMassFitSgnYield->GetBinContent(ptCandBin); + Float_t const bkgYield = hMassFitBkgYield->GetBinContent(ptCandBin); + Float_t const sBsYield = hMassFitSBsYield->GetBinContent(ptCandBin); + Float_t const sblYield = hMassFitSBLYield->GetBinContent(ptCandBin); + Float_t const sbrYield = hMassFitSBRYield->GetBinContent(ptCandBin); std::cout << "================================= " << std::endl; std::cout << "Getting invariant mass parameters " << std::endl; @@ -1224,10 +1224,10 @@ TH1D* DhCorrelationExtraction::getCorrelHistoSecondaryPart(Int_t partType, Doubl } else { // all selected particles hSparse = reinterpret_cast(fDirSecPart->Get(fHistoAllPartName.Data())); } - Int_t binExtPtCandMin = hSparse->GetAxis(2)->FindBin(ptCandMin + 0.01); // axis2: ptCand, the 0.01 to avoid bin edges! - Int_t binExtPtCandMax = hSparse->GetAxis(2)->FindBin(ptCandMax - 0.01); - Int_t binExtPtHadMin = hSparse->GetAxis(3)->FindBin(ptHadMin + 0.01); // axis3: ptHad - Int_t binExtPtHadMax = hSparse->GetAxis(3)->FindBin(ptHadMax - 0.01); + Int_t const binExtPtCandMin = hSparse->GetAxis(2)->FindBin(ptCandMin + 0.01); // axis2: ptCand, the 0.01 to avoid bin edges! + Int_t const binExtPtCandMax = hSparse->GetAxis(2)->FindBin(ptCandMax - 0.01); + Int_t const binExtPtHadMin = hSparse->GetAxis(3)->FindBin(ptHadMin + 0.01); // axis3: ptHad + Int_t const binExtPtHadMax = hSparse->GetAxis(3)->FindBin(ptHadMax - 0.01); Int_t binExtPoolMin; Int_t binExtPoolMax; if (partType == kAllPart) { @@ -1265,10 +1265,10 @@ TH1D* DhCorrelationExtraction::reflectCorrHistogram(TH1D*& histo) { // nBinsPhi must be a multple of 4 in order to reflect correcty the histogram - Int_t nBinsPhi = histo->GetNbinsX(); - Int_t nBinsPhiRefl = nBinsPhi / 2; - Int_t bin0Phi = nBinsPhi / 4 + 1; - Int_t binPiPhi = 3 * nBinsPhi / 4; + Int_t const nBinsPhi = histo->GetNbinsX(); + Int_t const nBinsPhiRefl = nBinsPhi / 2; + Int_t const bin0Phi = nBinsPhi / 4 + 1; + Int_t const binPiPhi = 3 * nBinsPhi / 4; TH1D* h1D = new TH1D("h1D_Reflected", "", nBinsPhiRefl, 0., TMath::Pi()); // pointer to be returned h1D->Sumw2(); @@ -1302,9 +1302,9 @@ TH1D* DhCorrelationExtraction::reflectHistoRun2(TH1D* h, Double_t scale) TH1D* h2 = new TH1D(Form("%sReflected", h->GetName()), Form("%sReflected", h->GetName()), h->GetNbinsX() / 2., 0., TMath::Pi()); for (Int_t j = 1; j <= h->GetNbinsX(); j++) { - Double_t x = h->GetBinCenter(j); - Double_t y0 = h->GetBinContent(j); - Double_t ey0 = h->GetBinError(j); + Double_t const x = h->GetBinCenter(j); + Double_t const y0 = h->GetBinContent(j); + Double_t const ey0 = h->GetBinError(j); Int_t j2; if (x > 0 && x < TMath::Pi()) { j2 = h2->FindBin(x); @@ -1316,8 +1316,8 @@ TH1D* DhCorrelationExtraction::reflectHistoRun2(TH1D* h, Double_t scale) printf("Point %d excluded \n", j); continue; } - Double_t y = h2->GetBinContent(j2); - Double_t ey = h2->GetBinError(j2); + Double_t const y = h2->GetBinContent(j2); + Double_t const ey = h2->GetBinError(j2); h2->SetBinContent(j2, (y + y0)); h2->SetBinError(j2, TMath::Sqrt(ey0 * ey0 + ey * ey)); } @@ -1332,8 +1332,8 @@ Double_t DhCorrelationExtraction::getFdPromptFrac(Double_t ptCandMin, Double_t p TH1D* h1D = new TH1D(); h1D = reinterpret_cast(fFileFDPromptFrac->Get(fHistoFDPromptFracName.Data())); - Int_t binPtCandMin = h1D->GetXaxis()->FindBin(ptCandMin + 0.01); - Int_t binPtCandMax = h1D->GetXaxis()->FindBin(ptCandMax - 0.01); + Int_t const binPtCandMin = h1D->GetXaxis()->FindBin(ptCandMin + 0.01); + Int_t const binPtCandMax = h1D->GetXaxis()->FindBin(ptCandMax - 0.01); Double_t promptFraction; if (binPtCandMin == binPtCandMax) { promptFraction = h1D->GetBinContent(binPtCandMin); @@ -1348,8 +1348,8 @@ Double_t DhCorrelationExtraction::getFdPromptFrac(Double_t ptCandMin, Double_t p void DhCorrelationExtraction::normalizeMePlot(TH2D*& histoME, TH2D*& histoMEsoftPi) const { - Int_t bin0phi = histoME->GetYaxis()->FindBin(0.); - Int_t bin0eta = histoME->GetXaxis()->FindBin(0.); + Int_t const bin0phi = histoME->GetYaxis()->FindBin(0.); + Int_t const bin0eta = histoME->GetXaxis()->FindBin(0.); // evaluate the normalization (from ALL tracks, including possible fake softpions) -> **histoME indeed includes bin1+bin2 of THnSparse, i.e. all the tracks** Double_t factorNorm = 0; @@ -1381,11 +1381,11 @@ Double_t DhCorrelationExtraction::calculateBaseline(TH1D*& histo, Bool_t totalRa // half range = Pi , for histogram reflected under symmetric assumption Double_t baseline, errBaseline; - Int_t nBinsPhi = histo->GetNbinsX(); - Int_t binPhiHalf = nBinsPhi / 2; - Int_t binPhiHalfMinus1 = nBinsPhi / 2 - 1; - Int_t binPhiHalfPlus1 = nBinsPhi / 2 + 1; - Int_t binPhiHalfPlus2 = nBinsPhi / 2 + 1; + Int_t const nBinsPhi = histo->GetNbinsX(); + Int_t const binPhiHalf = nBinsPhi / 2; + Int_t const binPhiHalfMinus1 = nBinsPhi / 2 - 1; + Int_t const binPhiHalfPlus1 = nBinsPhi / 2 + 1; + Int_t const binPhiHalfPlus2 = nBinsPhi / 2 + 1; if (totalRange) { // baseline evaluated considering: the two first points, the last two points and four points in the middle (corresponding to the outer points) @@ -1461,11 +1461,11 @@ Double_t DhCorrelationExtraction::calculateBaselineError(TH1D*& histo, Bool_t to // half range = Pi , for histogram reflected under symmetric assumption Double_t errBaseline; - Int_t nBinsPhi = histo->GetNbinsX(); - Int_t binPhiHalf = nBinsPhi / 2; - Int_t binPhiHalfMinus1 = nBinsPhi / 2 - 1; - Int_t binPhiHalfPlus1 = nBinsPhi / 2 + 1; - Int_t binPhiHalfPlus2 = nBinsPhi / 2 + 1; + Int_t const nBinsPhi = histo->GetNbinsX(); + Int_t const binPhiHalf = nBinsPhi / 2; + Int_t const binPhiHalfMinus1 = nBinsPhi / 2 - 1; + Int_t const binPhiHalfPlus1 = nBinsPhi / 2 + 1; + Int_t const binPhiHalfPlus2 = nBinsPhi / 2 + 1; if (totalRange) { // baseline evaluated considering: the two first points, the last two points and four points in the middle (corresponding to the outer points) diff --git a/PWGHF/HFC/Macros/DhCorrelationFitter.cxx b/PWGHF/HFC/Macros/DhCorrelationFitter.cxx index d95f7ff2eb9..a69a1ab4a2e 100644 --- a/PWGHF/HFC/Macros/DhCorrelationFitter.cxx +++ b/PWGHF/HFC/Macros/DhCorrelationFitter.cxx @@ -248,9 +248,9 @@ void DhCorrelationFitter::fitting(Bool_t drawSplitTerm, Bool_t useExternalPars) Printf("[INFO] DhCorrelationFitter::Fitting, Fitting"); TVirtualFitter::SetMaxIterations(20000); - TFitResultPtr fitptr = fHist->Fit(fFit, "RIMES", "", fMinCorr, fMaxCorr); - TMatrixD cor = fitptr->GetCorrelationMatrix(); - TMatrixD cov = fitptr->GetCovarianceMatrix(); + TFitResultPtr const fitptr = fHist->Fit(fFit, "RIMES", "", fMinCorr, fMaxCorr); + TMatrixD const cor = fitptr->GetCorrelationMatrix(); + TMatrixD const cov = fitptr->GetCovarianceMatrix(); printf("[INFO] Correlation Matrix - The final one! \n"); cor.Print(); gMinuit->mnmatu(1); @@ -742,7 +742,7 @@ void DhCorrelationFitter::fitBaselineWv2() { fBaseTransvReg = new TF1("fBaseTransvReg", [](const double* x, const double* p) { - double xx = x[0]; // x value + double const xx = x[0]; // x value if ((xx >= -TMath::Pi()/2 && xx <= -3*TMath::Pi()/8) || (xx >= 3*TMath::Pi()/8 && xx <= 5*TMath::Pi()/8) || (xx >= 11*TMath::Pi()/8 && xx <= 3*TMath::Pi()/2)) { // Gaussian example: p[0] = amplitude, p[1] = mean, p[2] = sigma return p[0]*(1+2*p[1]*p[2]*TMath::Cos(2*xx)); @@ -752,7 +752,7 @@ void DhCorrelationFitter::fitBaselineWv2() fBaseTransvReg->FixParameter(1, fv2AssocPart); fBaseTransvReg->FixParameter(2, fv2Dmeson); - TFitResultPtr rFit = fHist->Fit(fBaseTransvReg, "RIMES", "", fMinCorr, fMaxCorr); + TFitResultPtr const rFit = fHist->Fit(fBaseTransvReg, "RIMES", "", fMinCorr, fMaxCorr); fBaseline = fBaseTransvReg->GetParameter(0); } @@ -768,9 +768,9 @@ void DhCorrelationFitter::calculateYieldsAboveBaseline() if (binMinNS < 1) { binMinNS = 1; // with this, it is ok even in the case of a reflected fHist (range 0 - pi) } - Int_t binMaxNS = 6; // fHist -> FindBin(1.5); // slightly less than +pi/2 - Int_t binMinAS = 11; // fHist -> FindBin(1.6); // slightly more than +pi/2 - Int_t binMaxAS = 16; // fHist -> FindBin(3.14+1.5); // slightly less than +3pi/2 + Int_t const binMaxNS = 6; // fHist -> FindBin(1.5); // slightly less than +pi/2 + Int_t const binMinAS = 11; // fHist -> FindBin(1.6); // slightly more than +pi/2 + Int_t binMaxAS = 16; // fHist -> FindBin(3.14+1.5); // slightly less than +3pi/2 if (binMaxAS > fHist->GetNbinsX()) { binMaxAS = fHist->GetNbinsX(); // with this, it is ok even in the case of a reflected fHist (range 0 - pi) } @@ -803,11 +803,11 @@ Double_t DhCorrelationFitter::calculateBaseline(TH1F*& histo, Bool_t totalRange) // half range = Pi , for histogram reflected under symmetric assumption Double_t baseline, errBaseline; - Int_t nBinsPhi = histo->GetNbinsX(); - Int_t binPhiHalf = nBinsPhi / 2; - Int_t binPhiHalfMinus1 = nBinsPhi / 2 - 1; - Int_t binPhiHalfPlus1 = nBinsPhi / 2 + 1; - Int_t binPhiHalfPlus2 = nBinsPhi / 2 + 1; + Int_t const nBinsPhi = histo->GetNbinsX(); + Int_t const binPhiHalf = nBinsPhi / 2; + Int_t const binPhiHalfMinus1 = nBinsPhi / 2 - 1; + Int_t const binPhiHalfPlus1 = nBinsPhi / 2 + 1; + Int_t const binPhiHalfPlus2 = nBinsPhi / 2 + 1; if (totalRange) { printf("[INFO] Using total deltaPhi range \n"); @@ -876,11 +876,11 @@ Double_t DhCorrelationFitter::calculateBaselineError(TH1F*& histo, Bool_t totalR // half range = Pi , for histogram reflected under symmetric assumption Double_t errBaseline; - Int_t nBinsPhi = histo->GetNbinsX(); - Int_t binPhiHalf = nBinsPhi / 2; - Int_t binPhiHalfMinus1 = nBinsPhi / 2 - 1; - Int_t binPhiHalfPlus1 = nBinsPhi / 2 + 1; - Int_t binPhiHalfPlus2 = nBinsPhi / 2 + 1; + Int_t const nBinsPhi = histo->GetNbinsX(); + Int_t const binPhiHalf = nBinsPhi / 2; + Int_t const binPhiHalfMinus1 = nBinsPhi / 2 - 1; + Int_t const binPhiHalfPlus1 = nBinsPhi / 2 + 1; + Int_t const binPhiHalfPlus2 = nBinsPhi / 2 + 1; if (totalRange) { // baseline evaluated considering: the two first points, the last two points and four points in the middle (corresponding to the outer points) diff --git a/PWGHF/HFC/Macros/ExtractOutputCorrel.C b/PWGHF/HFC/Macros/ExtractOutputCorrel.C index 4e84650524a..db8dc9158d5 100644 --- a/PWGHF/HFC/Macros/ExtractOutputCorrel.C +++ b/PWGHF/HFC/Macros/ExtractOutputCorrel.C @@ -47,7 +47,7 @@ void readArray(const Value& jsonArray, std::vector& output) void parseStringArray(const Value& jsonArray, std::vector& output) { - size_t arrayLength = jsonArray.Size(); + size_t const arrayLength = jsonArray.Size(); for (size_t i = 0; i < arrayLength; i++) { if (jsonArray[i].IsString()) { output.emplace_back(jsonArray[i].GetString()); @@ -83,27 +83,27 @@ void extractOutputCorrelDs(const TString cfgFileName = "config_CorrAnalysis.json gSystem->Exec(Form("rm -rf Output_CorrelationExtraction_%s_Root/ Output_CorrelationExtraction_%s_png/", codeNameAnalysis.data(), codeNameAnalysis.data())); gSystem->Exec(Form("mkdir Output_CorrelationExtraction_%s_Root/ Output_CorrelationExtraction_%s_png/", codeNameAnalysis.data(), codeNameAnalysis.data())); - std::string pathFileSE = config["pathFileSE"].GetString(); - std::string pathFileME = config["pathFileME"].GetString(); - std::string pathFileMass = config["pathFileMass"].GetString(); - std::string pathFileFDTemplate = config["pathFileFDTemplate"].GetString(); - std::string pathFileFDPromptFrac = config["pathFileFDPromptFrac"].GetString(); - std::string pathFileSecPart = config["pathFileSecPart"].GetString(); - std::string pathfFilePromptMcRec = config["pathfFilePromptMcRec"].GetString(); - std::string pathfFileNonPromptMcRec = config["pathfFileNonPromptMcRec"].GetString(); - - std::string dirSE = config["InputDirSE"].GetString(); - std::string dirME = config["InputDirME"].GetString(); - std::string dirSecPart = config["InputDirSecPart"].GetString(); - std::string histoNameCorrSignal = config["InputHistoCorrSignalName"].GetString(); - std::string histoNameCorrSideba = config["InputHistoCorrSidebaName"].GetString(); - std::string histoNameCorrSidebaLeft = config["InputHistoCorrSidebaLeftName"].GetString(); - std::string histoNameCorrSidebaRight = config["InputHistoCorrSidebaRightName"].GetString(); - std::string histoNameFDTemplatePrompt = config["InputHistoFDTemplatePrompt"].GetString(); - std::string histoNameFDTemplateNonPrompt = config["InputHistoFDTemplateNonPrompt"].GetString(); - std::string histoNameRawFracPrompt = config["InputHistoFDPromptFrac"].GetString(); - std::string histoNamePrimaryPart = config["InputHistoPrimaryPart"].GetString(); - std::string histoNameAllPart = config["InputHistoAllPart"].GetString(); + std::string const pathFileSE = config["pathFileSE"].GetString(); + std::string const pathFileME = config["pathFileME"].GetString(); + std::string const pathFileMass = config["pathFileMass"].GetString(); + std::string const pathFileFDTemplate = config["pathFileFDTemplate"].GetString(); + std::string const pathFileFDPromptFrac = config["pathFileFDPromptFrac"].GetString(); + std::string const pathFileSecPart = config["pathFileSecPart"].GetString(); + std::string const pathfFilePromptMcRec = config["pathfFilePromptMcRec"].GetString(); + std::string const pathfFileNonPromptMcRec = config["pathfFileNonPromptMcRec"].GetString(); + + std::string const dirSE = config["InputDirSE"].GetString(); + std::string const dirME = config["InputDirME"].GetString(); + std::string const dirSecPart = config["InputDirSecPart"].GetString(); + std::string const histoNameCorrSignal = config["InputHistoCorrSignalName"].GetString(); + std::string const histoNameCorrSideba = config["InputHistoCorrSidebaName"].GetString(); + std::string const histoNameCorrSidebaLeft = config["InputHistoCorrSidebaLeftName"].GetString(); + std::string const histoNameCorrSidebaRight = config["InputHistoCorrSidebaRightName"].GetString(); + std::string const histoNameFDTemplatePrompt = config["InputHistoFDTemplatePrompt"].GetString(); + std::string const histoNameFDTemplateNonPrompt = config["InputHistoFDTemplateNonPrompt"].GetString(); + std::string const histoNameRawFracPrompt = config["InputHistoFDPromptFrac"].GetString(); + std::string const histoNamePrimaryPart = config["InputHistoPrimaryPart"].GetString(); + std::string const histoNameAllPart = config["InputHistoAllPart"].GetString(); std::vector inputHistoMassName; @@ -126,24 +126,24 @@ void extractOutputCorrelDs(const TString cfgFileName = "config_CorrAnalysis.json const Value& deltaEtaValue = config["deltaEtaInterval"]; readArray(deltaEtaValue, deltaEtaInterval); - double deltaEtaMin = deltaEtaInterval[0]; - double deltaEtaMax = deltaEtaInterval[1]; - - int specie = config["DmesonSpecie"].GetInt(); - bool rebinAngCorr = config["RebinAngCorr"].GetBool(); - bool rebinFDCorr = config["RebinFDCorr"].GetBool(); - bool rebinSecPart = config["RebinSecPart"].GetBool(); - int rebinDeltaPhi = config["nRebinDeltaPhi"].GetInt(); - int rebinDeltaEta = config["nRebinDeltaEta"].GetInt(); - - int npools = config["NumberOfPools"].GetInt(); - bool poolByPool = config["CorrectPoolsSeparately"].GetBool(); - bool applySecPartCorr = config["ApplySecPartCorr"].GetBool(); - bool applyBiasBtoDCorr = config["ApplyBiasBtoDCorr"].GetBool(); - bool applyFDCorr = config["ApplyFDCorr"].GetBool(); - bool isDividedSideb = config["IsDividedSideb"].GetBool(); - bool useSidebLeft = config["UseSidebLeft"].GetBool(); - bool useSidebRight = config["UseSidebRight"].GetBool(); + double const deltaEtaMin = deltaEtaInterval[0]; + double const deltaEtaMax = deltaEtaInterval[1]; + + int const specie = config["DmesonSpecie"].GetInt(); + bool const rebinAngCorr = config["RebinAngCorr"].GetBool(); + bool const rebinFDCorr = config["RebinFDCorr"].GetBool(); + bool const rebinSecPart = config["RebinSecPart"].GetBool(); + int const rebinDeltaPhi = config["nRebinDeltaPhi"].GetInt(); + int const rebinDeltaEta = config["nRebinDeltaEta"].GetInt(); + + int const npools = config["NumberOfPools"].GetInt(); + bool const poolByPool = config["CorrectPoolsSeparately"].GetBool(); + bool const applySecPartCorr = config["ApplySecPartCorr"].GetBool(); + bool const applyBiasBtoDCorr = config["ApplyBiasBtoDCorr"].GetBool(); + bool const applyFDCorr = config["ApplyFDCorr"].GetBool(); + bool const isDividedSideb = config["IsDividedSideb"].GetBool(); + bool const useSidebLeft = config["UseSidebLeft"].GetBool(); + bool const useSidebRight = config["UseSidebRight"].GetBool(); if (useSidebLeft && useSidebRight) { std::cout << "Using left and right" << std::endl; @@ -170,7 +170,7 @@ void extractOutputCorrelDs(const TString cfgFileName = "config_CorrAnalysis.json // Create and set the correlation plotter class auto* plotter = new DhCorrelationExtraction(); - Bool_t flagSpecie = plotter->setDmesonSpecie(static_cast(specie)); + Bool_t const flagSpecie = plotter->setDmesonSpecie(static_cast(specie)); plotter->setNpools(npools); plotter->setCorrectPoolsSeparately(poolByPool); // kTRUE = pool.by-pool extraction and correction; kFALSE = merged ME pools plotter->setFdSubtraction(applyFDCorr); @@ -198,22 +198,22 @@ void extractOutputCorrelDs(const TString cfgFileName = "config_CorrAnalysis.json if (applyBiasBtoDCorr) { setInputHistoBiasBtoD(plotter, pathfFilePromptMcRec, pathfFileNonPromptMcRec); } - Bool_t readSEandME = plotter->readInputSeAndMe(); + Bool_t const readSEandME = plotter->readInputSeAndMe(); if (readSEandME) { std::cout << "Files SE and ME read correctly" << std::endl; } - Bool_t readInvMass = plotter->readInputInvMass(); + Bool_t const readInvMass = plotter->readInputInvMass(); if (readInvMass) { std::cout << "Files inv. mass read correctly" << std::endl; } if (applyFDCorr) { - Bool_t readFDSubtr = plotter->readInputFdSubtr(); + Bool_t const readFDSubtr = plotter->readInputFdSubtr(); if (readFDSubtr) { std::cout << "Files for FD subtr. read correctly" << std::endl; } } if (applySecPartCorr) { - Bool_t readSecPart = plotter->readInputSecondaryPartContamination(); + Bool_t const readSecPart = plotter->readInputSecondaryPartContamination(); if (readSecPart) { std::cout << "Files for secondary part. contamination read correctly" << std::endl; } diff --git a/PWGHF/HFC/Macros/FitCorrel.C b/PWGHF/HFC/Macros/FitCorrel.C index 8953163cb23..11e5b0c5742 100644 --- a/PWGHF/HFC/Macros/FitCorrel.C +++ b/PWGHF/HFC/Macros/FitCorrel.C @@ -91,11 +91,11 @@ void fitCorrelDs(const TString cfgFileName = "config_CorrAnalysis.json") string inputFileNameFit = config["InputFileNameFitCorr"].GetString(); const TString inFileName = Form("Output_CorrelationExtraction_%s_Root/%s", codeNameAnalysis.data(), inputFileNameFit.data()); - bool isReflected = config["IsRiflected"].GetBool(); - bool drawSystematicErrors = config["DrawSystematics"].GetBool(); - bool sameSystematics = config["SameSystematics"].GetBool(); - bool shiftBaseUp = config["ShiftBaseUp"].GetBool(); - bool shiftBaseDown = config["ShiftBaseDown"].GetBool(); + bool const isReflected = config["IsRiflected"].GetBool(); + bool const drawSystematicErrors = config["DrawSystematics"].GetBool(); + bool const sameSystematics = config["SameSystematics"].GetBool(); + bool const shiftBaseUp = config["ShiftBaseUp"].GetBool(); + bool const shiftBaseDown = config["ShiftBaseDown"].GetBool(); std::vector binsPtCandIntervalsVec; std::vector binsPtHadIntervals; @@ -118,10 +118,10 @@ void fitCorrelDs(const TString cfgFileName = "config_CorrAnalysis.json") const Value& fitFuncValue = config["FitFunction"]; readArray(fitFuncValue, fitFunc); - int fixBase = config["FixBaseline"].GetInt(); - int fixMean = config["FixMean"].GetInt(); + int const fixBase = config["FixBaseline"].GetInt(); + int const fixMean = config["FixMean"].GetInt(); - int nBaselinePoints = config["nBaselinePoints"].GetInt(); + int const nBaselinePoints = config["nBaselinePoints"].GetInt(); vector pointsForBaselineVec; const Value& pointsForBaselineValue = config["binsForBaseline"]; readArray(pointsForBaselineValue, pointsForBaselineVec); @@ -145,7 +145,7 @@ void fitCorrelDs(const TString cfgFileName = "config_CorrAnalysis.json") std::cout << " " << std::endl; // TODO: reflections - bool refl = false; + bool const refl = false; // Input file auto* inFile = new TFile(inFileName.Data()); @@ -165,7 +165,7 @@ void fitCorrelDs(const TString cfgFileName = "config_CorrAnalysis.json") std::cout << "[ERROR]: nBinsPtD != nBinsPtCand" << std::endl; return; } - double systUncCorrelatedDs[nBinsPtD] = {20, 20, 20, 10}; // % (just the MC Closure uncertainty to put in the plot) + double const systUncCorrelatedDs[nBinsPtD] = {20, 20, 20, 10}; // % (just the MC Closure uncertainty to put in the plot) // DhCorrelationFitter const double fMin{-0.5 * TMath::Pi()}, fMax{1.5 * TMath::Pi()}; // limits for the fitting function @@ -177,8 +177,8 @@ void fitCorrelDs(const TString cfgFileName = "config_CorrAnalysis.json") Double_t lowBounds[npars] = {0., 0., -1., 0., 0., 2., 0., 0.5, 0., 0.}; Double_t uppBounds[npars] = {9999., 999., 1., 3.14 / 3., 999., 4., 3.14 / 2., 3.5, 0.5, 0.5}; - Double_t v2AssocPart[nBinsPtD] = {0.15, 0.15, 0.15, 0.15}; - Double_t v2Dmeson[nBinsPtD] = {0.175, 0.09, 0.04, 0.04}; + Double_t const v2AssocPart[nBinsPtD] = {0.15, 0.15, 0.15, 0.15}; + Double_t const v2Dmeson[nBinsPtD] = {0.175, 0.09, 0.04, 0.04}; // Output histograms TH1D* hBaselin[nBinsPtHad]; @@ -243,7 +243,7 @@ void fitCorrelDs(const TString cfgFileName = "config_CorrAnalysis.json") // hCorrPhi[iBinPtCand][iBinPtHad] -> Draw(); // draw systematic errors - int nBinsPhi = hCorrPhi[iBinPtCand][iBinPtHad]->GetNbinsX(); + int const nBinsPhi = hCorrPhi[iBinPtCand][iBinPtHad]->GetNbinsX(); if (drawSystematicErrors) { hSystematicErrors[iBinPtCand][iBinPtHad] = reinterpret_cast(inFileSystematicErrors->Get(Form("hSystematicErrorsMerged_PtBin%d_PtBinAssoc%d", iBinPtCand + 1, iBinPtHad + 1))); hSystematicErrorsPlot[iBinPtCand][iBinPtHad] = reinterpret_cast(hCorrPhi[iBinPtCand][iBinPtHad]->Clone(Form("hSystematicErrorsPlot_PtBin%d_PtBinAssoc%d", iBinPtCand + 1, iBinPtHad + 1))); @@ -296,7 +296,7 @@ void fitCorrelDs(const TString cfgFileName = "config_CorrAnalysis.json") hNSSigma[iBinPtHad]->SetBinError(iBinPtCand + 1, corrFitter[iBinPtHad][iBinPtCand]->getNsSigmaError()); } else { hNSSigma[iBinPtHad]->SetBinContent(iBinPtCand + 1, TMath::Sqrt(1. / corrFitter[iBinPtHad][iBinPtCand]->getNsSigma())); - Double_t errrel = corrFitter[iBinPtHad][iBinPtCand]->getNsSigmaError() / corrFitter[iBinPtHad][iBinPtCand]->getNsSigma() / 2.; + Double_t const errrel = corrFitter[iBinPtHad][iBinPtCand]->getNsSigmaError() / corrFitter[iBinPtHad][iBinPtCand]->getNsSigma() / 2.; hNSSigma[iBinPtHad]->SetBinError(iBinPtCand + 1, errrel * TMath::Sqrt(1. / corrFitter[iBinPtHad][iBinPtCand]->getNsSigma())); } } @@ -313,7 +313,7 @@ void fitCorrelDs(const TString cfgFileName = "config_CorrAnalysis.json") hASSigma[iBinPtHad]->SetBinError(iBinPtCand + 1, corrFitter[iBinPtHad][iBinPtCand]->getAsSigmaError()); } else { hASSigma[iBinPtHad]->SetBinContent(iBinPtCand + 1, TMath::Sqrt(1. / corrFitter[iBinPtHad][iBinPtCand]->getAsSigma())); - Double_t errrel = corrFitter[iBinPtHad][iBinPtCand]->getAsSigmaError() / corrFitter[iBinPtHad][iBinPtCand]->getAsSigma() / 2.; + Double_t const errrel = corrFitter[iBinPtHad][iBinPtCand]->getAsSigmaError() / corrFitter[iBinPtHad][iBinPtCand]->getAsSigma() / 2.; hASSigma[iBinPtHad]->SetBinError(iBinPtCand + 1, errrel * TMath::Sqrt(1. / corrFitter[iBinPtHad][iBinPtCand]->getAsSigma())); } if (fitFunc[iBinPtCand] == 4) { // param beta for gen. gauss diff --git a/PWGHF/HFC/TableProducer/correlatorD0D0bar.cxx b/PWGHF/HFC/TableProducer/correlatorD0D0bar.cxx index d9e3949d889..62b9f6b08ea 100644 --- a/PWGHF/HFC/TableProducer/correlatorD0D0bar.cxx +++ b/PWGHF/HFC/TableProducer/correlatorD0D0bar.cxx @@ -415,7 +415,7 @@ struct HfCorrelatorD0D0bar { if (std::abs(particle1.pdgCode()) != Pdg::kD0) { continue; } - double yD = RecoDecay::y(particle1.pVector(), MassD0); + double const yD = RecoDecay::y(particle1.pVector(), MassD0); if (yCandMax >= 0. && std::abs(yD) > yCandMax) { continue; } @@ -507,13 +507,13 @@ struct HfCorrelatorD0D0bar { if (std::abs(particle1.pdgCode()) != PDG_t::kCharm) { // search c or cbar particles continue; } - int partMothPDG = particle1.mothers_as().front().pdgCode(); + int const partMothPDG = particle1.mothers_as().front().pdgCode(); // check whether mothers of quark c/cbar are still '4'/'-4' particles - in that case the c/cbar quark comes from its own fragmentation, skip it if (partMothPDG == particle1.pdgCode()) { continue; } counterCCbarBeforeEtasel++; // count c or cbar (before kinematic selection) - double yC = RecoDecay::y(particle1.pVector(), MassCharm); + double const yC = RecoDecay::y(particle1.pVector(), MassCharm); if (yCandMax >= 0. && std::abs(yC) > yCandMax) { continue; } diff --git a/PWGHF/HFC/TableProducer/correlatorD0D0barBarrelFullPid.cxx b/PWGHF/HFC/TableProducer/correlatorD0D0barBarrelFullPid.cxx index 955e2d091e8..d43a90b79d2 100644 --- a/PWGHF/HFC/TableProducer/correlatorD0D0barBarrelFullPid.cxx +++ b/PWGHF/HFC/TableProducer/correlatorD0D0barBarrelFullPid.cxx @@ -416,7 +416,7 @@ struct HfCorrelatorD0D0barBarrelFullPid { if (std::abs(particle1.pdgCode()) != Pdg::kD0) { continue; } - double yD = RecoDecay::y(particle1.pVector(), MassD0); + double const yD = RecoDecay::y(particle1.pVector(), MassD0); if (yCandMax >= 0. && std::abs(yD) > yCandMax) { continue; } @@ -508,13 +508,13 @@ struct HfCorrelatorD0D0barBarrelFullPid { if (std::abs(particle1.pdgCode()) != PDG_t::kCharm) { // search c or cbar particles continue; } - int partMothPDG = particle1.mothers_as().front().pdgCode(); + int const partMothPDG = particle1.mothers_as().front().pdgCode(); // check whether mothers of quark c/cbar are still '4'/'-4' particles - in that case the c/cbar quark comes from its own fragmentation, skip it if (partMothPDG == particle1.pdgCode()) { continue; } counterCCbarBeforeEtasel++; // count c or cbar (before kinematic selection) - double yC = RecoDecay::y(particle1.pVector(), MassCharm); + double const yC = RecoDecay::y(particle1.pVector(), MassCharm); if (yCandMax >= 0. && std::abs(yC) > yCandMax) { continue; } diff --git a/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx b/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx index 421c10fabb4..ab1618e8b82 100644 --- a/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx @@ -184,7 +184,7 @@ struct HfCorrelatorD0HadronsSelection { if (std::abs(particle.pdgCode()) != Pdg::kD0) { continue; } - double yD = RecoDecay::y(particle.pVector(), MassD0); + double const yD = RecoDecay::y(particle.pVector(), MassD0); if (std::abs(yD) > yCandMax || particle.pt() < ptCandMin) { continue; } @@ -269,19 +269,19 @@ struct HfCorrelatorD0Hadrons { massK = MassKPlus; AxisSpec axisMassD = {binsMassD, "inv. mass (#pi K) (GeV/#it{c}^{2})"}; - AxisSpec axisEta = {binsEta, "#it{#eta}"}; - AxisSpec axisPhi = {binsPhi, "#it{#varphi}"}; - AxisSpec axisRapidity = {100, -5., 5., "Rapidity"}; + AxisSpec const axisEta = {binsEta, "#it{#eta}"}; + AxisSpec const axisPhi = {binsPhi, "#it{#varphi}"}; + AxisSpec const axisRapidity = {100, -5., 5., "Rapidity"}; AxisSpec axisPtD = {(std::vector)binsPtD, "#it{p}_{T} (GeV/#it{c})"}; AxisSpec axisPtHadron = {(std::vector)binsPtHadron, "#it{p}_{T} Hadron (GeV/#it{c})"}; - AxisSpec axisMultiplicity = {binsMultiplicity, "Multiplicity"}; + AxisSpec const axisMultiplicity = {binsMultiplicity, "Multiplicity"}; AxisSpec axisMultFT0M = {binsMultFT0M, "MultiplicityFT0M"}; - AxisSpec axisPosZ = {binsPosZ, "PosZ"}; - AxisSpec axisPoolBin = {binsPoolBin, "PoolBin"}; - AxisSpec axisStatus = {4, -0.5, 3.5, "Selection status"}; - AxisSpec axisSignalStatus = {200, 0., 200., "Signal status"}; + AxisSpec const axisPosZ = {binsPosZ, "PosZ"}; + AxisSpec const axisPoolBin = {binsPoolBin, "PoolBin"}; + AxisSpec const axisStatus = {4, -0.5, 3.5, "Selection status"}; + AxisSpec const axisSignalStatus = {200, 0., 200., "Signal status"}; AxisSpec axisEvtCount = {1, -0.5, 0.5}; - AxisSpec axisTrkCount = {5, 0., 5.}; + AxisSpec const axisTrkCount = {5, 0., 5.}; AxisSpec axisBdtScoreBkg = {100, 0., 1., "Bdt score background"}; AxisSpec axisBdtScorePrompt = {100, 0., 1., "Bdt score prompt"}; AxisSpec axisOrigin = {10, 0., 10., "Candidate origin"}; @@ -727,7 +727,7 @@ struct HfCorrelatorD0Hadrons { void processMcGen(SelectedCollisionsMcGen::iterator const& mcCollision, SelectedParticlesMcGen const& mcParticles) { - BinningTypeMcGen corrBinningMcGen{{zPoolBins, multPoolBinsMcGen}, true}; + BinningTypeMcGen const corrBinningMcGen{{zPoolBins, multPoolBinsMcGen}, true}; int poolBin = corrBinningMcGen.getBin(std::make_tuple(mcCollision.posZ(), mcCollision.multMCFT0A())); registry.fill(HIST("hCollisionPoolBin"), poolBin); registry.fill(HIST("hEvtCountGen"), 0); @@ -745,7 +745,7 @@ struct HfCorrelatorD0Hadrons { continue; } if (std::abs(particleTrigg.flagMcMatchGen()) == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { - double yD = RecoDecay::y(particleTrigg.pVector(), MassD0); + double const yD = RecoDecay::y(particleTrigg.pVector(), MassD0); if (yCandMax >= 0. && std::abs(yD) > yCandMax) { continue; } @@ -835,7 +835,7 @@ struct HfCorrelatorD0Hadrons { } auto tracksTuple = std::make_tuple(candidates, tracks); - Pair pairData{corrBinning, numberEventsMixed, -1, collisions, tracksTuple, &cache}; + Pair const pairData{corrBinning, numberEventsMixed, -1, collisions, tracksTuple, &cache}; for (const auto& [c1, tracks1, c2, tracks2] : pairData) { if (tracks1.size() == 0) { @@ -843,7 +843,7 @@ struct HfCorrelatorD0Hadrons { } // LOGF(info, "Mixed event collisions: Index = (%d, %d), tracks Size: (%d, %d), Z Vertex: (%f, %f), Pool Bin: (%d, %d)", c1.globalIndex(), c2.globalIndex(), tracks1.size(), tracks2.size(), c1.posZ(), c2.posZ(), corrBinning.getBin(std::make_tuple(c1.posZ(), c1.multFT0M())),corrBinning.getBin(std::make_tuple(c2.posZ(), c2.multFT0M()))); // For debug int poolBin = corrBinning.getBin(std::make_tuple(c2.posZ(), c2.multFT0M())); - int poolBinD0 = corrBinning.getBin(std::make_tuple(c1.posZ(), c1.multFT0M())); + int const poolBinD0 = corrBinning.getBin(std::make_tuple(c1.posZ(), c1.multFT0M())); registry.fill(HIST("hTracksPoolBin"), poolBin); registry.fill(HIST("hD0PoolBin"), poolBinD0); for (const auto& [candidate, particleAssoc] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { @@ -915,7 +915,7 @@ struct HfCorrelatorD0Hadrons { aod::McParticles const& mcParticles) { auto tracksTuple = std::make_tuple(candidates, tracks); - Pair pairMcRec{corrBinning, numberEventsMixed, -1, collisions, tracksTuple, &cache}; + Pair const pairMcRec{corrBinning, numberEventsMixed, -1, collisions, tracksTuple, &cache}; bool isD0Prompt = false; bool flagD0 = false; bool flagD0bar = false; @@ -923,7 +923,7 @@ struct HfCorrelatorD0Hadrons { int trackOrigin = 0; for (const auto& [c1, tracks1, c2, tracks2] : pairMcRec) { int poolBin = corrBinning.getBin(std::make_tuple(c2.posZ(), c2.multFT0M())); - int poolBinD0 = corrBinning.getBin(std::make_tuple(c1.posZ(), c1.multFT0M())); + int const poolBinD0 = corrBinning.getBin(std::make_tuple(c1.posZ(), c1.multFT0M())); registry.fill(HIST("hTracksPoolBin"), poolBin); registry.fill(HIST("hD0PoolBin"), poolBinD0); registry.fill(HIST("hMultFT0M"), c1.multFT0M()); @@ -1044,9 +1044,9 @@ struct HfCorrelatorD0Hadrons { void processMcGenMixedEvent(SelectedCollisionsMcGen const& collisions, SelectedParticlesMcGen const& mcParticles) { - BinningTypeMcGen corrBinningMcGen{{zPoolBins, multPoolBinsMcGen}, true}; + BinningTypeMcGen const corrBinningMcGen{{zPoolBins, multPoolBinsMcGen}, true}; auto tracksTuple = std::make_tuple(mcParticles, mcParticles); - Pair pairMcGen{corrBinningMcGen, numberEventsMixed, -1, collisions, tracksTuple, &cache}; + Pair const pairMcGen{corrBinningMcGen, numberEventsMixed, -1, collisions, tracksTuple, &cache}; for (const auto& [c1, tracks1, c2, tracks2] : pairMcGen) { int poolBin = corrBinningMcGen.getBin(std::make_tuple(c1.posZ(), c1.multMCFT0A())); @@ -1055,7 +1055,7 @@ struct HfCorrelatorD0Hadrons { continue; } if (std::abs(particleTrigg.flagMcMatchGen()) == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { - double yD = RecoDecay::y(particleTrigg.pVector(), MassD0); + double const yD = RecoDecay::y(particleTrigg.pVector(), MassD0); if (std::abs(yD) >= yCandMax || particleTrigg.pt() <= ptCandMin || std::abs(particleAssoc.eta()) >= etaTrackMax || particleAssoc.pt() <= ptTrackMin) { continue; } diff --git a/PWGHF/HFC/TableProducer/correlatorDMesonPairs.cxx b/PWGHF/HFC/TableProducer/correlatorDMesonPairs.cxx index 9ea0c350f66..5a62565d230 100644 --- a/PWGHF/HFC/TableProducer/correlatorDMesonPairs.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDMesonPairs.cxx @@ -223,7 +223,7 @@ struct HfCorrelatorDMesonPairs { labels[23] = "# of True D+Dbar Pairs"; labels[24] = "# of True Dbar+D Pairs"; - AxisSpec axisSelStatus = {kNBinsSelStatus, 0.5, kNBinsSelStatus + 0.5, ""}; + AxisSpec const axisSelStatus = {kNBinsSelStatus, 0.5, kNBinsSelStatus + 0.5, ""}; registry.add("hSelectionStatus", "D Meson candidates;selection status;entries", HistType::kTH1F, {axisSelStatus}); registry.add("hSelectionStatusMcGen", "D Meson candidates MC Gen;selection status;entries", HistType::kTH1F, {axisSelStatus}); @@ -245,7 +245,7 @@ struct HfCorrelatorDMesonPairs { labelsMatching[6] = "# of matched Dbar Cand 2"; labelsMatching[7] = "# of unmatched Cand 2"; - AxisSpec axisMatching = {kNBinsMatching, 0.5, kNBinsMatching + 0.5, ""}; + AxisSpec const axisMatching = {kNBinsMatching, 0.5, kNBinsMatching + 0.5, ""}; registry.add("hMatchingMcRec", "D Meson candidates; MC matching status;entries", HistType::kTH1F, {axisMatching}); registry.add("hMatchingMcGen", "D Meson candidates; MC matching status;entries", HistType::kTH1F, {axisMatching}); @@ -264,7 +264,7 @@ struct HfCorrelatorDMesonPairs { labelsSinglePart[4] = "# of true D"; labelsSinglePart[5] = "# of true Dbar"; - AxisSpec axisSinglePart = {kNBinsSinglePart, 0.5, kNBinsSinglePart + 0.5, ""}; + AxisSpec const axisSinglePart = {kNBinsSinglePart, 0.5, kNBinsSinglePart + 0.5, ""}; registry.add("hStatusSinglePart", "D Meson candidates; MC matching status;entries", HistType::kTH1F, {axisSinglePart}); registry.add("hStatusSinglePartMcGen", "D Meson candidates; MC matching status;entries", HistType::kTH1F, {axisSinglePart}); @@ -273,7 +273,7 @@ struct HfCorrelatorDMesonPairs { registry.get(HIST("hStatusSinglePartMcGen"))->GetXaxis()->SetBinLabel(iBin + 1, labelsSinglePart[iBin].data()); } - AxisSpec axisInputD0 = {200, -0.5, 199.5}; + AxisSpec const axisInputD0 = {200, -0.5, 199.5}; registry.add("hInputCheckD0", "Check on input D0 meson candidates/event", {HistType::kTH1F, {axisInputD0}}); registry.add("hInputCheckD0bar", "Check on input D0bar meson candidates/event", {HistType::kTH1F, {axisInputD0}}); registry.add("hInputCheckD0AndD0bar", "Check on input D0 & D0bar meson candidates/event", {HistType::kTH1F, {axisInputD0}}); @@ -416,8 +416,8 @@ struct HfCorrelatorDMesonPairs { int nDevent = 0, nDbarevent = 0, nDDbarevent = 0, nDorDbarevent = 0; for (const auto& candidate : selectedD0Candidates) { // Get counters per event - bool isSignalD0 = std::abs(hfHelper.invMassD0ToPiK(candidate) - MassD0) < massCut; - bool isSignalD0bar = std::abs(hfHelper.invMassD0barToKPi(candidate) - MassD0Bar) < massCut; + bool const isSignalD0 = std::abs(hfHelper.invMassD0ToPiK(candidate) - MassD0) < massCut; + bool const isSignalD0bar = std::abs(hfHelper.invMassD0barToKPi(candidate) - MassD0Bar) < massCut; if (selectSignalRegionOnly && !(isSignalD0 || isSignalD0bar)) { continue; } @@ -430,8 +430,8 @@ struct HfCorrelatorDMesonPairs { continue; } - bool isDCand1 = isD(candidateType1); - bool isDbarCand1 = isDbar(candidateType1); + bool const isDCand1 = isD(candidateType1); + bool const isDbarCand1 = isDbar(candidateType1); if (isDCand1) { nDevent++; } @@ -598,15 +598,15 @@ struct HfCorrelatorDMesonPairs { auto prong0Cand1 = candidate1.template prong0_as(); auto prong1Cand1 = candidate1.template prong1_as(); - bool isSignalD0Cand1 = std::abs(hfHelper.invMassD0ToPiK(candidate1) - MassD0) < massCut; - bool isSignalD0barCand1 = std::abs(hfHelper.invMassD0barToKPi(candidate1) - MassD0Bar) < massCut; + bool const isSignalD0Cand1 = std::abs(hfHelper.invMassD0ToPiK(candidate1) - MassD0) < massCut; + bool const isSignalD0barCand1 = std::abs(hfHelper.invMassD0barToKPi(candidate1) - MassD0Bar) < massCut; if (selectSignalRegionOnly && !(isSignalD0Cand1 || isSignalD0barCand1)) { continue; } auto candidateType1 = assignCandidateTypeD0(candidate1); // Candidate type attribution - bool isDCand1 = isD(candidateType1); - bool isDbarCand1 = isDbar(candidateType1); + bool const isDCand1 = isD(candidateType1); + bool const isDbarCand1 = isDbar(candidateType1); bool isSelectedMlD0Cand1 = false; bool isSelectedMlD0barCand1 = false; @@ -674,15 +674,15 @@ struct HfCorrelatorDMesonPairs { continue; } - bool isSignalD0Cand2 = std::abs(hfHelper.invMassD0ToPiK(candidate2) - MassD0) < massCut; - bool isSignalD0barCand2 = std::abs(hfHelper.invMassD0barToKPi(candidate2) - MassD0Bar) < massCut; + bool const isSignalD0Cand2 = std::abs(hfHelper.invMassD0ToPiK(candidate2) - MassD0) < massCut; + bool const isSignalD0barCand2 = std::abs(hfHelper.invMassD0barToKPi(candidate2) - MassD0Bar) < massCut; if (selectSignalRegionOnly && !(isSignalD0Cand2 || isSignalD0barCand2)) { continue; } auto candidateType2 = assignCandidateTypeD0(candidate2); // Candidate type attribution - bool isDCand2 = isD(candidateType2); - bool isDbarCand2 = isDbar(candidateType2); + bool const isDCand2 = isD(candidateType2); + bool const isDbarCand2 = isDbar(candidateType2); bool isSelectedMlD0Cand2 = false; bool isSelectedMlD0barCand2 = false; @@ -743,8 +743,8 @@ struct HfCorrelatorDMesonPairs { auto ptCandidate1 = candidate1.pt(); auto yCandidate1 = hfHelper.yD0(candidate1); auto phiCandidate1 = candidate1.phi(); - float massD0Cand1 = hfHelper.invMassD0ToPiK(candidate1); - float massD0barCand1 = hfHelper.invMassD0barToKPi(candidate1); + float const massD0Cand1 = hfHelper.invMassD0ToPiK(candidate1); + float const massD0barCand1 = hfHelper.invMassD0barToKPi(candidate1); auto prong0Cand1 = candidate1.template prong0_as(); auto prong1Cand1 = candidate1.template prong1_as(); @@ -754,8 +754,8 @@ struct HfCorrelatorDMesonPairs { if (ptCandMin >= 0. && candidate1.pt() < ptCandMin) { continue; } - bool isSignalD0Cand1 = std::abs(massD0Cand1 - MassD0) < massCut; - bool isSignalD0barCand1 = std::abs(massD0barCand1 - MassD0Bar) < massCut; + bool const isSignalD0Cand1 = std::abs(massD0Cand1 - MassD0) < massCut; + bool const isSignalD0barCand1 = std::abs(massD0barCand1 - MassD0Bar) < massCut; if (selectSignalRegionOnly && !(isSignalD0Cand1 || isSignalD0barCand1)) { continue; } @@ -765,10 +765,10 @@ struct HfCorrelatorDMesonPairs { auto candidateType1 = assignCandidateTypeD0(candidate1); // Candidate type attribution - bool isDCand1 = isD(candidateType1); - bool isDbarCand1 = isDbar(candidateType1); - bool isTrueDCand1 = isTrueD(candidateType1); - bool isTrueDbarCand1 = isTrueDbar(candidateType1); + bool const isDCand1 = isD(candidateType1); + bool const isDbarCand1 = isDbar(candidateType1); + bool const isTrueDCand1 = isTrueD(candidateType1); + bool const isTrueDbarCand1 = isTrueDbar(candidateType1); int8_t matchedRec1 = candidate1.flagMcMatchRec(); int8_t originRec1 = candidate1.originMcRec(); @@ -858,8 +858,8 @@ struct HfCorrelatorDMesonPairs { auto ptCandidate2 = candidate2.pt(); auto yCandidate2 = hfHelper.yD0(candidate2); auto phiCandidate2 = candidate2.phi(); - float massD0Cand2 = hfHelper.invMassD0ToPiK(candidate2); - float massD0barCand2 = hfHelper.invMassD0barToKPi(candidate2); + float const massD0Cand2 = hfHelper.invMassD0ToPiK(candidate2); + float const massD0barCand2 = hfHelper.invMassD0barToKPi(candidate2); auto prong0Cand2 = candidate2.template prong0_as(); auto prong1Cand2 = candidate2.template prong1_as(); @@ -869,8 +869,8 @@ struct HfCorrelatorDMesonPairs { if (ptCandMin >= 0. && candidate2.pt() < ptCandMin) { continue; } - bool isSignalD0Cand2 = std::abs(massD0Cand2 - MassD0) < massCut; - bool isSignalD0barCand2 = std::abs(massD0barCand2 - MassD0Bar) < massCut; + bool const isSignalD0Cand2 = std::abs(massD0Cand2 - MassD0) < massCut; + bool const isSignalD0barCand2 = std::abs(massD0barCand2 - MassD0Bar) < massCut; if (selectSignalRegionOnly && !(isSignalD0Cand2 || isSignalD0barCand2)) { continue; } @@ -882,10 +882,10 @@ struct HfCorrelatorDMesonPairs { } auto candidateType2 = assignCandidateTypeD0(candidate2); // Candidate type attribution - bool isDCand2 = isD(candidateType2); - bool isDbarCand2 = isDbar(candidateType2); - bool isTrueDCand2 = isTrueD(candidateType2); - bool isTrueDbarCand2 = isTrueDbar(candidateType2); + bool const isDCand2 = isD(candidateType2); + bool const isDbarCand2 = isDbar(candidateType2); + bool const isTrueDCand2 = isTrueD(candidateType2); + bool const isTrueDbarCand2 = isTrueDbar(candidateType2); int8_t matchedRec2 = candidate2.flagMcMatchRec(); int8_t originRec2 = candidate2.originMcRec(); @@ -937,7 +937,7 @@ struct HfCorrelatorDMesonPairs { { int numPvContributorsGen{0}; for (const auto& collision : collisions) { // loop over reco collisions associated to this gen collision - int numPvContributors = collision.numContrib(); + int const numPvContributors = collision.numContrib(); if (numPvContributors > numPvContributorsGen) { // we take the associated reconstructed collision with higher number of PV contributors numPvContributorsGen = numPvContributors; @@ -957,8 +957,8 @@ struct HfCorrelatorDMesonPairs { continue; } auto particleType = assignParticleTypeD0Gen(particle); // Candidate type attribution - bool isDParticle = isTrueD(particleType); - bool isDbarParticle = isTrueDbar(particleType); + bool const isDParticle = isTrueD(particleType); + bool const isDbarParticle = isTrueDbar(particleType); if (isDParticle) { nDevent++; } @@ -1006,8 +1006,8 @@ struct HfCorrelatorDMesonPairs { registry.fill(HIST("hPtCandAfterCutMcGen"), particle1.pt()); auto particleType1 = assignParticleTypeD0Gen(particle1); // Candidate sign attribution - bool isDParticle1 = isTrueD(particleType1); - bool isDbarParticle1 = isTrueDbar(particleType1); + bool const isDParticle1 = isTrueD(particleType1); + bool const isDbarParticle1 = isTrueDbar(particleType1); // check if it's MC matched int8_t matchedGen1 = particle1.flagMcMatchGen(); @@ -1048,8 +1048,8 @@ struct HfCorrelatorDMesonPairs { } // Candidate sign attribution. auto particleType2 = assignParticleTypeD0Gen(particle2); - bool isDParticle2 = isTrueD(particleType2); - bool isDbarParticle2 = isTrueDbar(particleType2); + bool const isDParticle2 = isTrueD(particleType2); + bool const isDbarParticle2 = isTrueDbar(particleType2); // check if it's MC matched int8_t matchedGen2 = particle2.flagMcMatchGen(); diff --git a/PWGHF/HFC/TableProducer/correlatorDplusDminus.cxx b/PWGHF/HFC/TableProducer/correlatorDplusDminus.cxx index ad7fd59f989..277f07d0eec 100644 --- a/PWGHF/HFC/TableProducer/correlatorDplusDminus.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDplusDminus.cxx @@ -398,7 +398,7 @@ struct HfCorrelatorDplusDminus { if (std::abs(particle1.pdgCode()) != Pdg::kDPlus) { continue; } - double yD = RecoDecay::y(particle1.pVector(), MassDPlus); + double const yD = RecoDecay::y(particle1.pVector(), MassDPlus); if (yCandMax >= 0. && std::abs(yD) > yCandMax) { continue; } @@ -489,13 +489,13 @@ struct HfCorrelatorDplusDminus { if (std::abs(particle1.pdgCode()) != PDG_t::kCharm) { // search c or cbar particles continue; } - int partMothPDG = particle1.mothers_as().front().pdgCode(); + int const partMothPDG = particle1.mothers_as().front().pdgCode(); // check whether mothers of quark c/cbar are still '4'/'-4' particles - in that case the c/cbar quark comes from its own fragmentation, skip it if (partMothPDG == particle1.pdgCode()) { continue; } counterCCbarBeforeEtasel++; // count c or cbar (before kinematic selection) - double yC = RecoDecay::y(particle1.pVector(), MassCharm); + double const yC = RecoDecay::y(particle1.pVector(), MassCharm); if (yCandMax >= 0. && std::abs(yC) > yCandMax) { continue; } diff --git a/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx index d0fa0fd2d2c..2b7908f4dd5 100644 --- a/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx @@ -157,7 +157,7 @@ struct HfCorrelatorDplusHadronsDplusSelection { if (std::abs(particle1.pdgCode()) != Pdg::kDPlus) { continue; } - double yD = RecoDecay::y(particle1.pVector(), MassDPlus); + double const yD = RecoDecay::y(particle1.pVector(), MassDPlus); if (std::abs(yD) >= yCandMax || particle1.pt() <= ptCandMin) { continue; } @@ -240,17 +240,17 @@ struct HfCorrelatorDplusHadrons { void init(InitContext&) { AxisSpec axisMassD = {binsMassD, "inv. mass (pi^{+}K^{-}#pi^{+}) (GeV/#it{c}^{2})"}; - AxisSpec axisEta = {binsEta, "#it{#eta}"}; - AxisSpec axisPhi = {binsPhi, "#it{#varphi}"}; + AxisSpec const axisEta = {binsEta, "#it{#eta}"}; + AxisSpec const axisPhi = {binsPhi, "#it{#varphi}"}; AxisSpec axisPtD = {(std::vector)binsPtD, "#it{p}_{T} (GeV/#it{c})"}; AxisSpec axisPtHadron = {(std::vector)binsPtHadron, "#it{p}_{T} Hadron (GeV/#it{c})"}; - AxisSpec axisMultiplicity = {binsMultiplicity, "Multiplicity"}; + AxisSpec const axisMultiplicity = {binsMultiplicity, "Multiplicity"}; AxisSpec axisMultFT0M = {binsMultFT0M, "MultiplicityFT0M"}; - AxisSpec axisPosZ = {binsZVtx, "PosZ"}; - AxisSpec axisBdtScore = {binsBdtScore, "Bdt score"}; - AxisSpec axisPoolBin = {binsPoolBin, "PoolBin"}; - AxisSpec axisStatus = {15, 0.5, 15.5, "Selection status"}; - AxisSpec axisRapidity = {100, -2, 2, "Rapidity"}; + AxisSpec const axisPosZ = {binsZVtx, "PosZ"}; + AxisSpec const axisBdtScore = {binsBdtScore, "Bdt score"}; + AxisSpec const axisPoolBin = {binsPoolBin, "PoolBin"}; + AxisSpec const axisStatus = {15, 0.5, 15.5, "Selection status"}; + AxisSpec const axisRapidity = {100, -2, 2, "Rapidity"}; registry.add("hPtCand", "Dplus,Hadron candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {axisPtD}}); registry.add("hPtProng0", "Dplus,Hadron candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {axisPtD}}); @@ -341,7 +341,7 @@ struct HfCorrelatorDplusHadrons { if (std::abs(hfHelper.yDplus(candidate)) >= yCandMax || candidate.pt() <= ptCandMin || candidate.pt() >= ptCandMax) { continue; } - int effBinD = o2::analysis::findBin(binsPtEfficiencyD, candidate.pt()); + int const effBinD = o2::analysis::findBin(binsPtEfficiencyD, candidate.pt()); double efficiencyWeightD = 1.; if (applyEfficiency) { efficiencyWeightD = 1. / efficiencyD->at(effBinD); @@ -421,7 +421,7 @@ struct HfCorrelatorDplusHadrons { } registry.fill(HIST("hMultiplicity"), nTracks); - float multiplicityFT0M = collision.multFT0M(); + float const multiplicityFT0M = collision.multFT0M(); // MC reco level bool isDplusPrompt = false; @@ -433,7 +433,7 @@ struct HfCorrelatorDplusHadrons { continue; } // efficiency weight determination - int effBinD = o2::analysis::findBin(binsPtEfficiencyD, candidate.pt()); + int const effBinD = o2::analysis::findBin(binsPtEfficiencyD, candidate.pt()); double efficiencyWeightD = 1.; if (applyEfficiency) { efficiencyWeightD = 1. / efficiencyD->at(effBinD); @@ -536,7 +536,7 @@ struct HfCorrelatorDplusHadrons { int counterDplusHadron = 0; registry.fill(HIST("hMCEvtCount"), 0); - BinningTypeMcGen corrBinningMcGen{{binsZVtx, binsMultiplicityMc}, true}; + BinningTypeMcGen const corrBinningMcGen{{binsZVtx, binsMultiplicityMc}, true}; int poolBin = corrBinningMcGen.getBin(std::make_tuple(mcCollision.posZ(), mcCollision.multMCFT0A())); registry.fill(HIST("hMultFT0AMcGen"), mcCollision.multMCFT0A()); @@ -551,7 +551,7 @@ struct HfCorrelatorDplusHadrons { if (std::abs(particle1.flagMcMatchGen()) != hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi) { continue; } - double yD = RecoDecay::y(particle1.pVector(), MassDPlus); + double const yD = RecoDecay::y(particle1.pVector(), MassDPlus); if (std::abs(yD) >= yCandMax || particle1.pt() <= ptCandMin) { continue; } @@ -572,7 +572,7 @@ struct HfCorrelatorDplusHadrons { // prompt and non-prompt division std::vector listDaughters{}; - std::array arrDaughDplusPDG = {+kPiPlus, -kKPlus, kPiPlus}; + std::array const arrDaughDplusPDG = {+kPiPlus, -kKPlus, kPiPlus}; std::array prongsId{}; listDaughters.clear(); RecoDecay::getDaughters(particle1, &listDaughters, arrDaughDplusPDG, 2); @@ -626,7 +626,7 @@ struct HfCorrelatorDplusHadrons { TracksData const& tracks) { auto tracksTuple = std::make_tuple(candidates, tracks); - Pair pairData{corrBinning, 5, -1, collisions, tracksTuple, &cache}; + Pair const pairData{corrBinning, 5, -1, collisions, tracksTuple, &cache}; for (const auto& [c1, tracks1, c2, tracks2] : pairData) { // LOGF(info, "Mixed event collisions: Index = (%d, %d), tracks Size: (%d, %d), Z Vertex: (%f, %f), Pool Bin: (%d, %d)", c1.globalIndex(), c2.globalIndex(), tracks1.size(), tracks2.size(), c1.posZ(), c2.posZ(), corrBinning.getBin(std::make_tuple(c1.posZ(), c1.multFT0M())),corrBinning.getBin(std::make_tuple(c2.posZ(), c2.multFT0M()))); // For debug @@ -648,16 +648,16 @@ struct HfCorrelatorDplusHadrons { TracksWithMc const& tracks, aod::McParticles const& mcParticles) { - BinningType corrBinning{{binsZVtx, binsMultiplicityMc}, true}; + BinningType const corrBinning{{binsZVtx, binsMultiplicityMc}, true}; for (const auto& candidate : candidates) { if (std::abs(hfHelper.yDplus(candidate)) > yCandMax || candidate.pt() < ptCandMin || candidate.pt() > ptCandMax) { continue; } // Dplus flag - bool isDplusSignal = std::abs(candidate.flagMcMatchRec()) == hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi; + bool const isDplusSignal = std::abs(candidate.flagMcMatchRec()) == hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi; // prompt and non-prompt division - bool isDplusPrompt = candidate.originMcRec() == RecoDecay::OriginType::Prompt; - bool isDplusNonPrompt = candidate.originMcRec() == RecoDecay::OriginType::NonPrompt; + bool const isDplusPrompt = candidate.originMcRec() == RecoDecay::OriginType::Prompt; + bool const isDplusNonPrompt = candidate.originMcRec() == RecoDecay::OriginType::NonPrompt; if (isDplusSignal) { if (isDplusPrompt) { registry.fill(HIST("hPtCandMcRecSigPrompt"), candidate.pt()); @@ -673,11 +673,11 @@ struct HfCorrelatorDplusHadrons { } } auto tracksTuple = std::make_tuple(candidates, tracks); - Pair pairMcRec{corrBinning, numberEventsMixed, -1, collisions, tracksTuple, &cache}; + Pair const pairMcRec{corrBinning, numberEventsMixed, -1, collisions, tracksTuple, &cache}; for (const auto& [c1, tracks1, c2, tracks2] : pairMcRec) { int poolBin = corrBinning.getBin(std::make_tuple(c2.posZ(), c2.multFT0M())); - int poolBinDplus = corrBinning.getBin(std::make_tuple(c1.posZ(), c1.multFT0M())); + int const poolBinDplus = corrBinning.getBin(std::make_tuple(c1.posZ(), c1.multFT0M())); registry.fill(HIST("hMultFT0M"), c1.multFT0M()); registry.fill(HIST("hZVtx"), c1.posZ()); registry.fill(HIST("hTracksPoolBin"), poolBin); // note that the selections here are not yet applied @@ -722,16 +722,16 @@ struct HfCorrelatorDplusHadrons { void processMcGenMixedEvent(SelCollisionsWithDplusMc const& collisions, CandDplusMcGen const& mcParticles) { - BinningTypeMcGen corrBinningMcGen{{binsZVtx, binsMultiplicityMc}, true}; + BinningTypeMcGen const corrBinningMcGen{{binsZVtx, binsMultiplicityMc}, true}; auto tracksTuple = std::make_tuple(mcParticles, mcParticles); - Pair pairMcGen{corrBinningMcGen, numberEventsMixed, -1, collisions, tracksTuple, &cache}; + Pair const pairMcGen{corrBinningMcGen, numberEventsMixed, -1, collisions, tracksTuple, &cache}; for (const auto& [c1, tracks1, c2, tracks2] : pairMcGen) { int poolBin = corrBinningMcGen.getBin(std::make_tuple(c1.posZ(), c1.multMCFT0A())); for (const auto& [candidate, particleAssoc] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { if (std::abs(candidate.pdgCode()) != Pdg::kDPlus) { continue; } - double yD = RecoDecay::y(candidate.pVector(), MassDPlus); + double const yD = RecoDecay::y(candidate.pVector(), MassDPlus); if (std::abs(yD) > yCandGenMax || candidate.pt() < ptCandMin || candidate.pt() > ptCandMax) { continue; } diff --git a/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx index 6ca8f049673..7d40e1e4db1 100644 --- a/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx @@ -254,11 +254,11 @@ struct HfCorrelatorDsHadrons { AxisSpec axisPhi = {binsPhi, "#it{#varphi}"}; AxisSpec axisPtD = {(std::vector)binsPtD, "#it{p}_{T} (GeV/#it{c})"}; AxisSpec axisPtHadron = {(std::vector)binsPtHadron, "#it{p}_{T} Hadron (GeV/#it{c})"}; - AxisSpec axisMultiplicity = {binsMultiplicity, "Multiplicity"}; + AxisSpec const axisMultiplicity = {binsMultiplicity, "Multiplicity"}; AxisSpec axisMultFT0M = {binsMultFT0M, "MultiplicityFT0M"}; - AxisSpec axisPosZ = {binsPosZ, "PosZ"}; - AxisSpec axisPoolBin = {binsPoolBin, "PoolBin"}; - AxisSpec axisStatus = {15, 0.5, 15.5, "Selection status"}; + AxisSpec const axisPosZ = {binsPosZ, "PosZ"}; + AxisSpec const axisPoolBin = {binsPoolBin, "PoolBin"}; + AxisSpec const axisStatus = {15, 0.5, 15.5, "Selection status"}; // Histograms for data analysis registry.add("hCollisionPoolBin", "Ds candidates collision pool bin", {HistType::kTH1F, {axisPoolBin}}); @@ -413,12 +413,12 @@ struct HfCorrelatorDsHadrons { CandDsData const& candidates, MyTracksData const& tracks) { - BinningType corrBinning{{zPoolBins, multPoolBins}, true}; + BinningType const corrBinning{{zPoolBins, multPoolBins}, true}; registry.fill(HIST("hZVtx"), collision.posZ()); registry.fill(HIST("hMultFT0M"), collision.multFT0M()); int poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.multFT0M())); registry.fill(HIST("hCollisionPoolBin"), poolBin); - int nTracks = tracks.size(); + int const nTracks = tracks.size(); registry.fill(HIST("hMultiplicity"), nTracks); // Ds fill histograms and Ds-Hadron correlation for DsToKKPi @@ -431,7 +431,7 @@ struct HfCorrelatorDsHadrons { efficiencyWeightD = 1. / efficiencyD->at(o2::analysis::findBin(binsPtEfficiencyD, candidate.pt())); } auto prong0 = candidate.template prong0_as(); - int chargeDs = prong0.sign(); + int const chargeDs = prong0.sign(); std::vector outputMl = {-1., -1., -1.}; fillHisto(candidate); if (candidate.isSelDsToKKPi() >= selectionFlagDs) { @@ -497,7 +497,7 @@ struct HfCorrelatorDsHadrons { TracksWithMc const& tracks, aod::McParticles const& mcParticles) { - BinningType corrBinning{{zPoolBins, multPoolBins}, true}; + BinningType const corrBinning{{zPoolBins, multPoolBins}, true}; registry.fill(HIST("hZVtx"), collision.posZ()); registry.fill(HIST("hMultFT0M"), collision.multFT0M()); int poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.multFT0M())); @@ -509,7 +509,7 @@ struct HfCorrelatorDsHadrons { bool isCorrectInvMassHypo = false; bool isDecayChan = false; bool isAlreadyFilledEvent = false; - float multiplicityFT0M = collision.multFT0M(); + float const multiplicityFT0M = collision.multFT0M(); for (const auto& candidate : candidates) { // prompt and non-prompt division isDsPrompt = candidate.originMcRec() == RecoDecay::OriginType::Prompt; @@ -531,7 +531,7 @@ struct HfCorrelatorDsHadrons { std::vector outputMl = {-1., -1., -1.}; auto prong0 = candidate.template prong0_as(); - int chargeDs = prong0.sign(); + int const chargeDs = prong0.sign(); if (isDsSignal && isDecayChan && isCorrectInvMassHypo) { fillHistoMcRecSig(candidate, multiplicityFT0M); @@ -654,7 +654,7 @@ struct HfCorrelatorDsHadrons { soa::Join const& collisions, CandDsMcGen const& mcParticles) { - BinningTypeMcGen corrBinningMcGen{{zPoolBins, multPoolBins}, true}; + BinningTypeMcGen const corrBinningMcGen{{zPoolBins, multPoolBins}, true}; for (const auto& mcCollision : mcCollisions) { @@ -700,7 +700,7 @@ struct HfCorrelatorDsHadrons { for (const auto& particle : groupedMcParticles) { // check if the particle is Ds if ((std::abs(particle.flagMcMatchGen()) == hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK) && (particle.flagMcDecayChanGen() == channelsResonant[decayChannel])) { - double yD = RecoDecay::y(particle.pVector(), MassDS); + double const yD = RecoDecay::y(particle.pVector(), MassDS); if (std::abs(yD) > yCandGenMax || particle.pt() < ptCandMin || particle.pt() > ptCandMax) { continue; } @@ -709,7 +709,7 @@ struct HfCorrelatorDsHadrons { isDsPrompt = particle.originMcGen() == RecoDecay::OriginType::Prompt; isDecayChan = particle.flagMcDecayChanGen() == channelsResonant[decayChannel]; std::vector listDaughters{}; - std::array arrDaughDsPDG = {+kKPlus, -kKPlus, kPiPlus}; + std::array const arrDaughDsPDG = {+kKPlus, -kKPlus, kPiPlus}; std::array prongsId{}; listDaughters.clear(); RecoDecay::getDaughters(particle, &listDaughters, arrDaughDsPDG, 2); @@ -801,7 +801,7 @@ struct HfCorrelatorDsHadrons { for (const auto& candidate : candsDsThisColl) { std::vector outputMl = {-1., -1., -1.}; auto prong0 = candidate.template prong0_as(); - int chargeDs = prong0.sign(); + int const chargeDs = prong0.sign(); // candidate selected if (candidate.isSelDsToKKPi() >= selectionFlagDs) { for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { @@ -842,14 +842,14 @@ struct HfCorrelatorDsHadrons { CandDsData const& candidates, MyTracksData const& tracks) { - BinningType corrBinning{{zPoolBins, multPoolBins}, true}; + BinningType const corrBinning{{zPoolBins, multPoolBins}, true}; for (const auto& collision : collisions) { registry.fill(HIST("hMultFT0M"), collision.multFT0M()); registry.fill(HIST("hZVtx"), collision.posZ()); } auto tracksTuple = std::make_tuple(candidates, tracks); - Pair pairData{corrBinning, numberEventsMixed, -1, collisions, tracksTuple, &cache}; + Pair const pairData{corrBinning, numberEventsMixed, -1, collisions, tracksTuple, &cache}; for (const auto& [c1, tracks1, c2, tracks2] : pairData) { if (tracks1.size() == 0) { @@ -858,7 +858,7 @@ struct HfCorrelatorDsHadrons { // LOGF(info, "Mixed event collisions: Index = (%d, %d), tracks Size: (%d, %d), Z Vertex: (%f, %f), Pool Bin: (%d, %d)", c1.globalIndex(), c2.globalIndex(), tracks1.size(), tracks2.size(), c1.posZ(), c2.posZ(), corrBinning.getBin(std::make_tuple(c1.posZ(), c1.multFT0M())), corrBinning.getBin(std::make_tuple(c2.posZ(), c2.multFT0M()))); int poolBin = corrBinning.getBin(std::make_tuple(c2.posZ(), c2.multFT0M())); - int poolBinDs = corrBinning.getBin(std::make_tuple(c1.posZ(), c1.multFT0M())); + int const poolBinDs = corrBinning.getBin(std::make_tuple(c1.posZ(), c1.multFT0M())); registry.fill(HIST("hTracksPoolBin"), poolBin); // note that the selections here are not yet applied registry.fill(HIST("hDsPoolBin"), poolBinDs); // note that the selections here are not yet applied for (const auto& [cand, pAssoc] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { @@ -872,7 +872,7 @@ struct HfCorrelatorDsHadrons { continue; } auto prong0 = cand.template prong0_as(); - int chargeDs = prong0.sign(); + int const chargeDs = prong0.sign(); std::vector outputMl = {-1., -1., -1.}; // DsToKKPi and DsToPiKK division if (cand.isSelDsToKKPi() >= selectionFlagDs) { @@ -916,7 +916,7 @@ struct HfCorrelatorDsHadrons { TracksWithMc const& tracks, aod::McParticles const& mcParticles) { - BinningType corrBinning{{zPoolBins, multPoolBins}, true}; + BinningType const corrBinning{{zPoolBins, multPoolBins}, true}; for (const auto& candidate : candidates) { if (std::abs(hfHelper.yDs(candidate)) > yCandMax || candidate.pt() < ptCandMin || candidate.pt() > ptCandMax) { continue; @@ -931,7 +931,7 @@ struct HfCorrelatorDsHadrons { } } auto tracksTuple = std::make_tuple(candidates, tracks); - Pair pairMcRec{corrBinning, numberEventsMixed, -1, collisions, tracksTuple, &cache}; + Pair const pairMcRec{corrBinning, numberEventsMixed, -1, collisions, tracksTuple, &cache}; bool isDsPrompt = false; bool isDsSignal = false; @@ -940,7 +940,7 @@ struct HfCorrelatorDsHadrons { int trackOrigin = 0; for (const auto& [c1, tracks1, c2, tracks2] : pairMcRec) { int poolBin = corrBinning.getBin(std::make_tuple(c2.posZ(), c2.multFT0M())); - int poolBinDs = corrBinning.getBin(std::make_tuple(c1.posZ(), c1.multFT0M())); + int const poolBinDs = corrBinning.getBin(std::make_tuple(c1.posZ(), c1.multFT0M())); registry.fill(HIST("hMultFT0M"), c1.multFT0M()); registry.fill(HIST("hZVtx"), c1.posZ()); registry.fill(HIST("hTracksPoolBin"), poolBin); // note that the selections here are not yet applied @@ -953,7 +953,7 @@ struct HfCorrelatorDsHadrons { continue; } auto prong0 = candidate.template prong0_as(); - int chargeDs = prong0.sign(); + int const chargeDs = prong0.sign(); std::vector outputMl = {-1., -1., -1.}; // prompt and non-prompt division isDsPrompt = candidate.originMcRec() == RecoDecay::OriginType::Prompt; @@ -1005,14 +1005,14 @@ struct HfCorrelatorDsHadrons { void processMcGenME(SelCollisionsMc const& collisions, CandDsMcGen const& mcParticles) { - BinningTypeMcGen corrBinningMcGen{{zPoolBins, multPoolBins}, true}; + BinningTypeMcGen const corrBinningMcGen{{zPoolBins, multPoolBins}, true}; auto tracksTuple = std::make_tuple(mcParticles, mcParticles); - Pair pairMcGen{corrBinningMcGen, numberEventsMixed, -1, collisions, tracksTuple, &cache}; + Pair const pairMcGen{corrBinningMcGen, numberEventsMixed, -1, collisions, tracksTuple, &cache}; for (const auto& [c1, tracks1, c2, tracks2] : pairMcGen) { int poolBin = corrBinningMcGen.getBin(std::make_tuple(c1.posZ(), c1.multMCFT0A())); for (const auto& [candidate, particleAssoc] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { if ((std::abs(candidate.flagMcMatchGen()) == hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK) && (candidate.flagMcDecayChanGen() == decayChannel)) { - double yD = RecoDecay::y(candidate.pVector(), MassDS); + double const yD = RecoDecay::y(candidate.pVector(), MassDS); if (std::abs(yD) > yCandGenMax || candidate.pt() < ptCandMin || candidate.pt() > ptCandMax) { continue; } diff --git a/PWGHF/HFC/TableProducer/correlatorDsHadronsReduced.cxx b/PWGHF/HFC/TableProducer/correlatorDsHadronsReduced.cxx index ece87ee21ad..f7aa4fbc31b 100644 --- a/PWGHF/HFC/TableProducer/correlatorDsHadronsReduced.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDsHadronsReduced.cxx @@ -83,9 +83,9 @@ struct HfCorrelatorDsHadronsReduced { void init(InitContext&) { - AxisSpec axisMultFT0M = {binsMultFT0M, "MultiplicityFT0M"}; - AxisSpec axisPosZ = {binsPosZ, "PosZ"}; - AxisSpec axisPoolBin = {binsPoolBin, "PoolBin"}; + AxisSpec const axisMultFT0M = {binsMultFT0M, "MultiplicityFT0M"}; + AxisSpec const axisPosZ = {binsPosZ, "PosZ"}; + AxisSpec const axisPoolBin = {binsPoolBin, "PoolBin"}; AxisSpec axisEta = {binsEta, "#it{#eta}"}; AxisSpec axisPhi = {binsPhi, "#it{#varphi}"}; AxisSpec axisPtD = {(std::vector)binsPtD, "#it{p}_{T} (GeV/#it{c})"}; @@ -110,7 +110,7 @@ struct HfCorrelatorDsHadronsReduced { soa::Join const& tracks) { - BinningTypeDerived corrBinning{{zPoolBins, multPoolBins}, true}; + BinningTypeDerived const corrBinning{{zPoolBins, multPoolBins}, true}; for (const auto& collision : collisions) { int poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.multiplicity())); @@ -156,10 +156,10 @@ struct HfCorrelatorDsHadronsReduced { aod::AssocTrackReds const& tracks) { - BinningTypeDerived corrBinning{{zPoolBins, multPoolBins}, true}; + BinningTypeDerived const corrBinning{{zPoolBins, multPoolBins}, true}; for (const auto& collision : collisions) { - int poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.multiplicity())); + int const poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.multiplicity())); registry.fill(HIST("hCollisionPoolBin"), poolBin); registry.fill(HIST("hMultFT0M"), collision.multiplicity()); registry.fill(HIST("hZVtx"), collision.posZ()); @@ -182,7 +182,7 @@ struct HfCorrelatorDsHadronsReduced { auto tracksTuple = std::make_tuple(candidates, tracks); - Pair pairData{corrBinning, numberEventsMixed, -1, collisions, tracksTuple, &cache}; + Pair const pairData{corrBinning, numberEventsMixed, -1, collisions, tracksTuple, &cache}; for (const auto& [c1, tracks1, c2, tracks2] : pairData) { if (tracks1.size() == 0) { @@ -190,7 +190,7 @@ struct HfCorrelatorDsHadronsReduced { } int poolBin = corrBinning.getBin(std::make_tuple(c2.posZ(), c2.multiplicity())); - int poolBinDs = corrBinning.getBin(std::make_tuple(c1.posZ(), c1.multiplicity())); + int const poolBinDs = corrBinning.getBin(std::make_tuple(c1.posZ(), c1.multiplicity())); if (poolBin != poolBinDs) { LOGF(info, "Error, poolBins are diffrent"); diff --git a/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx index 48a21874511..b24806c1b5c 100644 --- a/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx @@ -196,7 +196,7 @@ struct HfCorrelatorDstarHadrons { LOGP(fatal, "One and only one process function must be enabled at a time."); } - AxisSpec axisSpecMultFT0M{binsMultiplicity, "Multiplicity in FT0M", "multFT0M"}; + AxisSpec const axisSpecMultFT0M{binsMultiplicity, "Multiplicity in FT0M", "multFT0M"}; invMassDstarParticle = -999.0; invMassD0Particle = -999.0; @@ -260,7 +260,7 @@ struct HfCorrelatorDstarHadrons { invMassD0Particle = cand.invMassD0Bar(); } auto ptDstar = cand.pt(); - int corrBinPtDstar = o2::analysis::findBin(binsPtCorrelations, ptDstar); + int const corrBinPtDstar = o2::analysis::findBin(binsPtCorrelations, ptDstar); auto deltaM = cand.invMassDstar() - cand.invMassD0(); if (deltaM > signalRegionLefBound->at(corrBinPtDstar) && deltaM < signalRegionRightBound->at(corrBinPtDstar)) { // Signal Region @@ -361,7 +361,7 @@ struct HfCorrelatorDstarHadrons { { auto dstarHadronTuple = std::make_tuple(candidates, tracks); - Pair pairData{binningScheme, 5, -1, collisions, dstarHadronTuple, &cache}; + Pair const pairData{binningScheme, 5, -1, collisions, dstarHadronTuple, &cache}; for (const auto& [c1, candidatesPerCol, c2, tracksPerCol] : pairData) { auto bc = c2.bc_as(); diff --git a/PWGHF/HFC/TableProducer/correlatorFlowCharmHadronsReduced.cxx b/PWGHF/HFC/TableProducer/correlatorFlowCharmHadronsReduced.cxx index 96187e620a9..f1d2fc578b4 100644 --- a/PWGHF/HFC/TableProducer/correlatorFlowCharmHadronsReduced.cxx +++ b/PWGHF/HFC/TableProducer/correlatorFlowCharmHadronsReduced.cxx @@ -261,19 +261,19 @@ struct HfCorrelatorFlowCharmHadronsReduced { TBinningType binPolicy) { auto collision = pair.template hfcRedCorrColl_as(); - double ptTrig = trigCand.ptTrig(); + double const ptTrig = trigCand.ptTrig(); if constexpr (requires { trigCand.bdtScore0Trig(); }) { // ML selection on bkg score for Charm-Had case if (!isSelBdtBkgScoreCut(trigCand, ptTrig)) { return; } } if (downSamplePairs < 1.) { - float pseudoRndm = ptTrig * 1000. - static_cast(ptTrig * 1000); + float const pseudoRndm = ptTrig * 1000. - static_cast(ptTrig * 1000); if (ptTrig < ptMaxForDownSample && collision.centrality() < centMaxForDownSample && pseudoRndm >= downSamplePairs) { return; } } - int poolBin = getPoolBin(collision, binPolicy); + int const poolBin = getPoolBin(collision, binPolicy); registry.fill(HIST("hPoolBinTrigSE"), poolBin); registry.fill(HIST("hPoolBinAssocSE"), poolBin); if constexpr (FillTables) { @@ -310,8 +310,8 @@ struct HfCorrelatorFlowCharmHadronsReduced { if (trigCands.size() == 0 || assocTracks.size() == 0) { continue; } - int poolBinTrig = getPoolBin(trigColl, binPolicy); - int poolBinAssoc = getPoolBin(assocColl, binPolicy); + int const poolBinTrig = getPoolBin(trigColl, binPolicy); + int const poolBinAssoc = getPoolBin(assocColl, binPolicy); if (poolBinAssoc != poolBinTrig) { LOGF(info, "Error, poolBins are different"); continue; @@ -321,25 +321,25 @@ struct HfCorrelatorFlowCharmHadronsReduced { for (const auto& [trigCand, assocTrack] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(trigCands, assocTracks))) { // LOGF(info, "Mixed event tracks pair: (%d, %d) from events (%d, %d), track event: (%d, %d)", trigCand.index(), assocTrack.index(), trigColl.index(), assocColl.index(), trigCand.hfcRedFlowCollId(), assocTrack.hfcRedFlowCollId()); - double deltaEta = getEta(assocTrack) - getEta(trigCand); + double const deltaEta = getEta(assocTrack) - getEta(trigCand); if (std::abs(deltaEta) < deltaEtaAbsMin || std::abs(deltaEta) > deltaEtaAbsMax) { continue; } - double ptTrig = getPt(trigCand); + double const ptTrig = getPt(trigCand); if constexpr (requires { trigCand.bdtScore0Trig(); }) { // ML selection on bkg score for Charm-Had case if (!isSelBdtBkgScoreCut(trigCand, ptTrig)) { continue; } } - double ptAssoc = getPt(assocTrack); + double const ptAssoc = getPt(assocTrack); if (downSamplePairs < 1.) { - float pseudoRndm = ptAssoc * 1000. - static_cast(ptAssoc * 1000); + float const pseudoRndm = ptAssoc * 1000. - static_cast(ptAssoc * 1000); if (ptTrig < ptMaxForDownSample && trigColl.centrality() < centMaxForDownSample && assocColl.centrality() < centMaxForDownSample && pseudoRndm >= downSamplePairs) { continue; } } - double deltaPhi = RecoDecay::constrainAngle(getPhi(assocTrack) - getPhi(trigCand), -o2::constants::math::PIHalf); + double const deltaPhi = RecoDecay::constrainAngle(getPhi(assocTrack) - getPhi(trigCand), -o2::constants::math::PIHalf); if constexpr (FillTables) { if constexpr (requires { trigCand.bdtScore0Trig(); }) { // Separate Charm-Had and Had-Had cases rowPairMECharmHads(poolBinTrig, ptTrig, ptAssoc, deltaEta, deltaPhi, @@ -429,7 +429,7 @@ struct HfCorrelatorFlowCharmHadronsReduced { AssocTracks const& tracks) { auto pairsTuple = std::make_tuple(candidates, tracks); - Pair pairs{binPolicyPosZCent, numberEventsMixed, -1, collisions, pairsTuple, &cache}; + Pair const pairs{binPolicyPosZCent, numberEventsMixed, -1, collisions, pairsTuple, &cache}; if (fillSparses && fillTables) { fillMixedEvent(pairs, binPolicyPosZCent); } else if (fillSparses) { @@ -445,7 +445,7 @@ struct HfCorrelatorFlowCharmHadronsReduced { AssocTracks const& tracks) { auto pairsTuple = std::make_tuple(candidates, tracks); - Pair pairs{binPolicyPosZMult, numberEventsMixed, -1, collisions, pairsTuple, &cache}; + Pair const pairs{binPolicyPosZMult, numberEventsMixed, -1, collisions, pairsTuple, &cache}; if (fillSparses && fillTables) { fillMixedEvent(pairs, binPolicyPosZMult); } else if (fillSparses) { @@ -460,7 +460,7 @@ struct HfCorrelatorFlowCharmHadronsReduced { AssocTracks const& tracks) { auto tracksTuple = std::make_tuple(tracks); - SameKindPair pairs{binPolicyPosZCent, numberEventsMixed, -1, collisions, tracksTuple, &cache}; + SameKindPair const pairs{binPolicyPosZCent, numberEventsMixed, -1, collisions, tracksTuple, &cache}; if (fillSparses && fillTables) { fillMixedEvent(pairs, binPolicyPosZCent); } else if (fillSparses) { @@ -475,7 +475,7 @@ struct HfCorrelatorFlowCharmHadronsReduced { AssocTracks const& tracks) { auto tracksTuple = std::make_tuple(tracks); - SameKindPair pairs{binPolicyPosZMult, numberEventsMixed, -1, collisions, tracksTuple, &cache}; + SameKindPair const pairs{binPolicyPosZMult, numberEventsMixed, -1, collisions, tracksTuple, &cache}; if (fillSparses && fillTables) { fillMixedEvent(pairs, binPolicyPosZMult); } else if (fillSparses) { diff --git a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx index 7e6a59092ce..d0d3a1707bd 100644 --- a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx @@ -113,11 +113,11 @@ struct HfCorrelatorHfeHadrons { void init(InitContext&) { - AxisSpec axisPosZ = {binsPosZ, "Pos Z"}; + AxisSpec const axisPosZ = {binsPosZ, "Pos Z"}; AxisSpec axisDeltaEta = {binsDeltaEta, "#Delta #eta = #eta_{Electron}- #eta_{Hadron}"}; AxisSpec axisDeltaPhi = {binsDeltaPhi, "#Delta #varphi = #varphi_{Electron}- #varphi_{Hadron}"}; AxisSpec axisPt = {binsPt, "#it{p_{T}}(GeV/#it{c})"}; - AxisSpec axisPoolBin = {binsPoolBin, "PoolBin"}; + AxisSpec const axisPoolBin = {binsPoolBin, "PoolBin"}; AxisSpec axisNSigma = {binsNSigma, "it{#sigma_{TPC}}"}; registry.add("hZvertex", "z vertex", {HistType::kTH1D, {axisPosZ}}); @@ -385,7 +385,7 @@ struct HfCorrelatorHfeHadrons { void processMcGen(McGenTableCollision const& mcCollision, aod::McParticles const& mcParticles, aod::HfMcGenSelEl const& electron) { - BinningTypeMcGen corrBinningMcGen{{zBins, multBinsMcGen}, true}; + BinningTypeMcGen const corrBinningMcGen{{zBins, multBinsMcGen}, true}; int poolBin = corrBinningMcGen.getBin(std::make_tuple(mcCollision.posZ(), mcCollision.multMCFT0A())); for (const auto& particleMc : mcParticles) { @@ -462,7 +462,7 @@ struct HfCorrelatorHfeHadrons { void processDataMixedEvent(TableCollisions const& collision, aod::HfCorrSelEl const& electron, TableTracks const& tracks) { auto tracksTuple = std::make_tuple(electron, tracks); - Pair pair{corrBinning, numberEventsMixed, -1, collision, tracksTuple, &cache}; + Pair const pair{corrBinning, numberEventsMixed, -1, collision, tracksTuple, &cache}; // loop over the rows of the new table for (const auto& [c1, tracks1, c2, tracks2] : pair) { @@ -477,7 +477,7 @@ struct HfCorrelatorHfeHadrons { void processMcRecMixedEvent(McTableCollisions const& mccollision, aod::HfCorrSelEl const& electron, McTableTracks const& mcTracks) { auto tracksTuple = std::make_tuple(electron, mcTracks); - Pair pairMcRec{corrBinning, numberEventsMixed, -1, mccollision, tracksTuple, &cache}; + Pair const pairMcRec{corrBinning, numberEventsMixed, -1, mccollision, tracksTuple, &cache}; // loop over the rows of the new table for (const auto& [c1, tracks1, c2, tracks2] : pairMcRec) { @@ -489,10 +489,10 @@ struct HfCorrelatorHfeHadrons { void processMcGenMixedEvent(McGenTableCollisions const& mcCollision, aod::HfMcGenSelEl const& electrons, aod::McParticles const& mcParticles) { - BinningTypeMcGen corrBinningMcGen{{zBins, multBinsMcGen}, true}; + BinningTypeMcGen const corrBinningMcGen{{zBins, multBinsMcGen}, true}; auto tracksTuple = std::make_tuple(electrons, mcParticles); - Pair pairMcGen{corrBinningMcGen, 5, -1, mcCollision, tracksTuple, &cache}; + Pair const pairMcGen{corrBinningMcGen, 5, -1, mcCollision, tracksTuple, &cache}; // loop over the rows of the new table double ptElectronMix = -999; diff --git a/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx index 7abeb5201b1..59360564a88 100644 --- a/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx @@ -178,7 +178,7 @@ struct HfCorrelatorLcHadronsSelection { isLcFound = false; continue; } - double yL = RecoDecay::y(particle.pVector(), MassLambdaCPlus); + double const yL = RecoDecay::y(particle.pVector(), MassLambdaCPlus); if (std::abs(yL) > yCandMax || particle.pt() < ptCandMin) { isLcFound = false; continue; @@ -288,17 +288,17 @@ struct HfCorrelatorLcHadrons { void init(InitContext&) { AxisSpec axisMassLc = {binsMassLc, "inv. mass (p K #pi) (GeV/#it{c}^{2})"}; - AxisSpec axisEta = {binsEta, "#it{eta}"}; - AxisSpec axisPhi = {binsPhi, "#it{#varphi}"}; + AxisSpec const axisEta = {binsEta, "#it{eta}"}; + AxisSpec const axisPhi = {binsPhi, "#it{#varphi}"}; AxisSpec axisPtLc = {(std::vector)binsPtLc, "#it{p}_{T} (GeV/#it{c})"}; AxisSpec axisPtHadron = {(std::vector)binsPtHadron, "#it{p}_{T} Hadron (GeV/#it{c})"}; AxisSpec axisPtTrack = {500, 0, 50, "#it{p}_{T} Hadron (GeV/#it{c})"}; - AxisSpec axisMultiplicity = {binsMultiplicity, "Multiplicity"}; + AxisSpec const axisMultiplicity = {binsMultiplicity, "Multiplicity"}; AxisSpec axisMultFT0M = {binsMultFT0M, "MultiplicityFT0M"}; - AxisSpec axisPosZ = {binsZVtx, "PosZ"}; - AxisSpec axisBdtScore = {binsBdtScore, "Bdt score"}; - AxisSpec axisPoolBin = {binsPoolBin, "PoolBin"}; - AxisSpec axisRapidity = {100, -2, 2, "Rapidity"}; + AxisSpec const axisPosZ = {binsZVtx, "PosZ"}; + AxisSpec const axisBdtScore = {binsBdtScore, "Bdt score"}; + AxisSpec const axisPoolBin = {binsPoolBin, "PoolBin"}; + AxisSpec const axisRapidity = {100, -2, 2, "Rapidity"}; AxisSpec axisSign = {2, -1, 1, "Sign"}; AxisSpec axisCent = {binsCentFt0m, "Centrality"}; @@ -421,7 +421,7 @@ struct HfCorrelatorLcHadrons { efficiencyWeightLc = 1. / efficiencyLc->at(o2::analysis::findBin(binsPtEfficiencyLc, candidate.pt())); } auto trackPos1 = candidate.template prong0_as(); // positive daughter (negative for the antiparticles) - int8_t chargeLc = trackPos1.sign(); // charge of 1st prong will be the charge of Lc candidate + int8_t const chargeLc = trackPos1.sign(); // charge of 1st prong will be the charge of Lc candidate registry.fill(HIST("hPtCand"), candidate.pt()); registry.fill(HIST("hPtProng0"), candidate.ptProng0()); @@ -564,7 +564,7 @@ struct HfCorrelatorLcHadrons { } registry.fill(HIST("hMultiplicity"), nTracks); - float multiplicityFT0M = collision.multFT0M(); + float const multiplicityFT0M = collision.multFT0M(); // Mc reco level bool isLcPrompt = false; bool isLcNonPrompt = false; @@ -581,7 +581,7 @@ struct HfCorrelatorLcHadrons { } auto trackPos1 = candidate.template prong0_as(); // positive daughter (negative for the antiparticles) auto trackPos2 = candidate.template prong2_as(); - int8_t chargeLc = trackPos1.sign(); // charge of 1st prong will be the charge of Lc candidate + int8_t const chargeLc = trackPos1.sign(); // charge of 1st prong will be the charge of Lc candidate isLcSignal = std::abs(candidate.flagMcMatchRec()) == hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi; isLcPrompt = candidate.originMcRec() == RecoDecay::OriginType::Prompt; isLcNonPrompt = candidate.originMcRec() == RecoDecay::OriginType::NonPrompt; @@ -821,7 +821,7 @@ struct HfCorrelatorLcHadrons { int counterLcHadron = 0; registry.fill(HIST("hMcEvtCount"), 0); - BinningTypeMcGen corrBinningMcGen{{binsZVtx, binsMultiplicityMc}, true}; + BinningTypeMcGen const corrBinningMcGen{{binsZVtx, binsMultiplicityMc}, true}; int poolBin = corrBinningMcGen.getBin(std::make_tuple(mcCollision.posZ(), mcCollision.multMCFT0A())); registry.fill(HIST("hMultFT0AMcGen"), mcCollision.multMCFT0A()); @@ -842,7 +842,7 @@ struct HfCorrelatorLcHadrons { if (std::abs(particle.flagMcMatchGen()) != hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) { continue; } - double yL = RecoDecay::y(particle.pVector(), MassLambdaCPlus); + double const yL = RecoDecay::y(particle.pVector(), MassLambdaCPlus); if (std::abs(yL) > yCandGenMax || particle.pt() < ptCandMin) { continue; } @@ -862,7 +862,7 @@ struct HfCorrelatorLcHadrons { // prompt and non-prompt division std::vector listDaughters{}; - std::array arrDaughLcPDG = {kProton, -kKPlus, kPiPlus}; + std::array const arrDaughLcPDG = {kProton, -kKPlus, kPiPlus}; std::array prongsId{}; listDaughters.clear(); RecoDecay::getDaughters(particle, &listDaughters, arrDaughLcPDG, 2); @@ -908,8 +908,8 @@ struct HfCorrelatorLcHadrons { } } - int8_t chargeLc = pdg->GetParticle(particle.pdgCode())->Charge(); // Retrieve charge - int8_t chargeAssoc = pdg->GetParticle(particleAssoc.pdgCode())->Charge(); // Retrieve charge + int8_t const chargeLc = pdg->GetParticle(particle.pdgCode())->Charge(); // Retrieve charge + int8_t const chargeAssoc = pdg->GetParticle(particleAssoc.pdgCode())->Charge(); // Retrieve charge int trackOrigin = RecoDecay::getCharmHadronOrigin(mcParticles, particleAssoc, true); registry.fill(HIST("hPtParticleAssocMcGen"), particleAssoc.pt()); @@ -935,7 +935,7 @@ struct HfCorrelatorLcHadrons { TracksData const& tracks) { auto tracksTuple = std::make_tuple(candidates, tracks); - Pair pairData{corrBinning, numberEventsMixed, -1, collisions, tracksTuple, &cache}; + Pair const pairData{corrBinning, numberEventsMixed, -1, collisions, tracksTuple, &cache}; for (const auto& [c1, tracks1, c2, tracks2] : pairData) { int poolBin = corrBinning.getBin(std::make_tuple(c2.posZ(), c2.multFT0M())); @@ -951,7 +951,7 @@ struct HfCorrelatorLcHadrons { } auto trackPos1 = trigLc.template prong0_as(); // positive daughter (negative for the antiparticles) - int8_t chargeLc = trackPos1.sign(); // charge of 1st prong will be the charge of Lc candidate + int8_t const chargeLc = trackPos1.sign(); // charge of 1st prong will be the charge of Lc candidate float cent = 100.0; // will be updated later @@ -1007,16 +1007,16 @@ struct HfCorrelatorLcHadrons { TracksWithMc const& tracks, aod::McParticles const& mcParticles) { - BinningType corrBinning{{binsZVtx, binsMultiplicityMc}, true}; + BinningType const corrBinning{{binsZVtx, binsMultiplicityMc}, true}; for (const auto& candidate : candidates) { if (std::abs(hfHelper.yLc(candidate)) > yCandMax || candidate.pt() < ptCandMin || candidate.pt() > ptCandMax) { continue; } // Lc flag - bool isLcSignal = std::abs(candidate.flagMcMatchRec()) == hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi; + bool const isLcSignal = std::abs(candidate.flagMcMatchRec()) == hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi; // prompt and non-prompt division - bool isLcPrompt = candidate.originMcRec() == RecoDecay::OriginType::Prompt; - bool isLcNonPrompt = candidate.originMcRec() == RecoDecay::OriginType::NonPrompt; + bool const isLcPrompt = candidate.originMcRec() == RecoDecay::OriginType::Prompt; + bool const isLcNonPrompt = candidate.originMcRec() == RecoDecay::OriginType::NonPrompt; if (isLcSignal) { if (candidate.isSelLcToPKPi() >= selectionFlagLc) { if (isLcPrompt) { @@ -1043,11 +1043,11 @@ struct HfCorrelatorLcHadrons { } } auto tracksTuple = std::make_tuple(candidates, tracks); - Pair pairMcRec{corrBinning, numberEventsMixed, -1, collisions, tracksTuple, &cache}; + Pair const pairMcRec{corrBinning, numberEventsMixed, -1, collisions, tracksTuple, &cache}; for (const auto& [c1, tracks1, c2, tracks2] : pairMcRec) { int poolBin = corrBinning.getBin(std::make_tuple(c2.posZ(), c2.multFT0M())); - int poolBinLc = corrBinning.getBin(std::make_tuple(c1.posZ(), c1.multFT0M())); + int const poolBinLc = corrBinning.getBin(std::make_tuple(c1.posZ(), c1.multFT0M())); registry.fill(HIST("hMultFT0M"), c1.multFT0M()); registry.fill(HIST("hZvtx"), c1.posZ()); registry.fill(HIST("hTracksPoolBin"), poolBin); @@ -1071,7 +1071,7 @@ struct HfCorrelatorLcHadrons { } } auto trackPos1 = candidate.template prong0_as(); // positive daughter (negative for the antiparticles) - int8_t chargeLc = trackPos1.sign(); // charge of 1st prong will be the charge of Lc candidate + int8_t const chargeLc = trackPos1.sign(); // charge of 1st prong will be the charge of Lc candidate if (pAssoc.has_mcParticle()) { auto mcParticle = pAssoc.template mcParticle_as(); @@ -1128,16 +1128,16 @@ struct HfCorrelatorLcHadrons { void processMcGenMixedEvent(SelCollisionsWithLcMc const& collisions, CandidatesLcMcGen const& mcParticles) { - BinningTypeMcGen corrBinningMcGen{{binsZVtx, binsMultiplicityMc}, true}; + BinningTypeMcGen const corrBinningMcGen{{binsZVtx, binsMultiplicityMc}, true}; auto tracksTuple = std::make_tuple(mcParticles, mcParticles); - Pair pairMcGen{corrBinningMcGen, numberEventsMixed, -1, collisions, tracksTuple, &cache}; + Pair const pairMcGen{corrBinningMcGen, numberEventsMixed, -1, collisions, tracksTuple, &cache}; for (const auto& [c1, tracks1, c2, tracks2] : pairMcGen) { int poolBin = corrBinningMcGen.getBin(std::make_tuple(c1.posZ(), c1.multMCFT0A())); for (const auto& [candidate, particleAssoc] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { if (std::abs(candidate.pdgCode()) != Pdg::kLambdaCPlus) { continue; } - double yL = RecoDecay::y(candidate.pVector(), MassLambdaCPlus); + double const yL = RecoDecay::y(candidate.pVector(), MassLambdaCPlus); if (std::abs(yL) > yCandGenMax || candidate.pt() < ptCandMin || candidate.pt() > ptCandMax) { continue; } @@ -1153,9 +1153,9 @@ struct HfCorrelatorLcHadrons { if (pidTrkApplied && (std::abs(particleAssoc.pdgCode()) != kProton)) { continue; // proton PID } - int8_t chargeLc = pdg->GetParticle(candidate.pdgCode())->Charge(); // Retrieve charge - int8_t chargeAssoc = pdg->GetParticle(particleAssoc.pdgCode())->Charge(); // Retrieve charge - float cent = 100.0; // will be updated later + int8_t const chargeLc = pdg->GetParticle(candidate.pdgCode())->Charge(); // Retrieve charge + int8_t const chargeAssoc = pdg->GetParticle(particleAssoc.pdgCode())->Charge(); // Retrieve charge + float cent = 100.0; // will be updated later int trackOrigin = RecoDecay::getCharmHadronOrigin(mcParticles, particleAssoc, true); bool isLcPrompt = candidate.originMcGen() == RecoDecay::OriginType::Prompt; diff --git a/PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx index ff4092b7071..c0ef835a7da 100644 --- a/PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx @@ -118,7 +118,7 @@ struct HfCorrelatorLcScHadronsSelection { for (const auto& candidate : candidates) { if constexpr (IsCandSc) { - int8_t chargeCand = candidate.charge(); + int8_t const chargeCand = candidate.charge(); if (chargeCand == chargeZero) { yCand = hfHelper.ySc0(candidate); @@ -160,7 +160,7 @@ struct HfCorrelatorLcScHadronsSelection { continue; } - double yCand = RecoDecay::y(particle.pVector(), massCand); + double const yCand = RecoDecay::y(particle.pVector(), massCand); if (std::abs(yCand) > yCandMax || particle.pt() < ptCandMin) { isCandFound = false; continue; @@ -358,17 +358,17 @@ struct HfCorrelatorLcScHadrons { void init(InitContext&) { AxisSpec axisCandMass = {binsCandMass, "inv. mass (p K #pi) (GeV/#it{c}^{2})"}; - AxisSpec axisEta = {binsEta, "#it{eta}"}; - AxisSpec axisPhi = {binsPhi, "#it{#varphi}"}; + AxisSpec const axisEta = {binsEta, "#it{eta}"}; + AxisSpec const axisPhi = {binsPhi, "#it{#varphi}"}; AxisSpec axisPtLc = {static_cast>(binsPtLc), "#it{p}_{T} (GeV/#it{c})"}; AxisSpec axisPtHadron = {static_cast>(binsPtHadron), "#it{p}_{T} Hadron (GeV/#it{c})"}; AxisSpec axisPtTrack = {500, 0, 50, "#it{p}_{T} Hadron (GeV/#it{c})"}; - AxisSpec axisMultiplicity = {binsMultiplicity, "Multiplicity"}; + AxisSpec const axisMultiplicity = {binsMultiplicity, "Multiplicity"}; AxisSpec axisMultFT0M = {binsMultFT0M, "MultiplicityFT0M"}; - AxisSpec axisPosZ = {binsZVtx, "PosZ"}; - AxisSpec axisBdtScore = {binsBdtScore, "Bdt score"}; - AxisSpec axisPoolBin = {binsPoolBin, "PoolBin"}; - AxisSpec axisRapidity = {100, -2, 2, "Rapidity"}; + AxisSpec const axisPosZ = {binsZVtx, "PosZ"}; + AxisSpec const axisBdtScore = {binsBdtScore, "Bdt score"}; + AxisSpec const axisPoolBin = {binsPoolBin, "PoolBin"}; + AxisSpec const axisRapidity = {100, -2, 2, "Rapidity"}; AxisSpec axisSign = {5, -2.5, 2.5, "Sign"}; AxisSpec axisPtV0 = {500, 0., 50.0, "#it{p}_{T} (GeV/#it{c})"}; AxisSpec axisMassV0 = {200, 0.9f, 1.2f, "inv. mass (p #pi) (GeV/#it{c}^{2})"}; @@ -457,7 +457,7 @@ struct HfCorrelatorLcScHadrons { { double y = -999.; if constexpr (IsCandSc) { - int8_t chargeCand = candidate.charge(); + int8_t const chargeCand = candidate.charge(); if (chargeCand == ChargeZero) { y = hfHelper.ySc0(candidate); @@ -669,7 +669,7 @@ struct HfCorrelatorLcScHadrons { { bool isPhysicalPrimary = false; int trackOrigin = -1; - float cent = 100.0; // will be updated later + float const cent = 100.0; // will be updated later entryCandHadronPair(getDeltaPhi(track.phi(), candidate.phi()), track.eta() - candidate.eta(), @@ -712,7 +712,7 @@ struct HfCorrelatorLcScHadrons { int nTracks = 0; int64_t timeStamp = 0; bool skipMixedEventTableFilling = false; - float multiplicityFT0M = collision.multFT0M(); + float const multiplicityFT0M = collision.multFT0M(); int gCollisionId = collision.globalIndex(); if (candidates.size() == 0) { return; @@ -1000,7 +1000,7 @@ struct HfCorrelatorLcScHadrons { bool selLcPiKP = false; auto tracksTuple = std::make_tuple(candidates, tracks); - Pair pairData{corrBinning, numberEventsMixed, -1, collisions, tracksTuple, &cache}; + Pair const pairData{corrBinning, numberEventsMixed, -1, collisions, tracksTuple, &cache}; for (const auto& [c1, tracks1, c2, tracks2] : pairData) { poolBin = corrBinning.getBin(std::make_tuple(c2.posZ(), c2.multFT0M())); @@ -1112,7 +1112,7 @@ struct HfCorrelatorLcScHadrons { static constexpr std::size_t PDGChargeScale{3u}; registry.fill(HIST("hMcEvtCount"), 0); - BinningTypeMcGen corrBinningMcGen{{binsZVtx, binsMultiplicityMc}, true}; + BinningTypeMcGen const corrBinningMcGen{{binsZVtx, binsMultiplicityMc}, true}; poolBin = corrBinningMcGen.getBin(std::make_tuple(mcCollision.posZ(), mcCollision.multMCFT0A())); registry.fill(HIST("hMultFT0AMcGen"), mcCollision.multMCFT0A()); @@ -1124,11 +1124,11 @@ struct HfCorrelatorLcScHadrons { for (const auto& particle : mcParticles) { double massCand = -999.0; - bool isCandFound = IsCandSc ? matchCandAndMass(particle, massCand) : matchCandAndMass(particle, massCand); + bool const isCandFound = IsCandSc ? matchCandAndMass(particle, massCand) : matchCandAndMass(particle, massCand); if (!isCandFound) { continue; } - double yCand = RecoDecay::y(particle.pVector(), massCand); + double const yCand = RecoDecay::y(particle.pVector(), massCand); if (std::abs(yCand) > yCandGenMax || particle.pt() < ptCandMin) { continue; @@ -1162,14 +1162,14 @@ struct HfCorrelatorLcScHadrons { if (IsCandSc) { if (massCand == o2::constants::physics::MassSigmaC0 || massCand == o2::constants::physics::MassSigmaCStar0) { - std::array arrDaughSc0PDG = {kProton, -kKPlus, kPiPlus, kPiMinus}; + std::array const arrDaughSc0PDG = {kProton, -kKPlus, kPiPlus, kPiMinus}; RecoDecay::getDaughters(particle, &listDaughters, arrDaughSc0PDG, 2); } else { - std::array arrDaughScPlusPDG = {kProton, -kKPlus, kPiPlus, kPiPlus}; + std::array const arrDaughScPlusPDG = {kProton, -kKPlus, kPiPlus, kPiPlus}; RecoDecay::getDaughters(particle, &listDaughters, arrDaughScPlusPDG, 2); } } else { - std::array arrDaughLcPDG = {kProton, -kKPlus, kPiPlus}; + std::array const arrDaughLcPDG = {kProton, -kKPlus, kPiPlus}; RecoDecay::getDaughters(particle, &listDaughters, arrDaughLcPDG, 2); } @@ -1221,7 +1221,7 @@ struct HfCorrelatorLcScHadrons { int8_t chargeAssoc = pdg->GetParticle(particleAssoc.pdgCode())->Charge(); // Retrieve charge chargeAssoc = chargeAssoc / std::abs(chargeAssoc); registry.fill(HIST("hPtParticleAssocMcGen"), particleAssoc.pt()); - float cent = 100.0; // will be updated later + float const cent = 100.0; // will be updated later entryCandHadronPair(getDeltaPhi(particleAssoc.phi(), particle.phi()), particleAssoc.eta() - particle.eta(), @@ -1343,16 +1343,16 @@ struct HfCorrelatorLcScHadrons { void processMcGenMixedEvent(SelCollisionsMc const& collisions, CandidatesLcMcGen const& mcParticles) { - BinningTypeMcGen corrBinningMcGen{{binsZVtx, binsMultiplicityMc}, true}; + BinningTypeMcGen const corrBinningMcGen{{binsZVtx, binsMultiplicityMc}, true}; auto tracksTuple = std::make_tuple(mcParticles, mcParticles); - Pair pairMcGen{corrBinningMcGen, numberEventsMixed, -1, collisions, tracksTuple, &cache}; + Pair const pairMcGen{corrBinningMcGen, numberEventsMixed, -1, collisions, tracksTuple, &cache}; for (const auto& [c1, tracks1, c2, tracks2] : pairMcGen) { poolBin = corrBinningMcGen.getBin(std::make_tuple(c1.posZ(), c1.multMCFT0A())); for (const auto& [candidate, particleAssoc] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { if (std::abs(candidate.pdgCode()) != Pdg::kLambdaCPlus) { continue; } - double yL = RecoDecay::y(candidate.pVector(), MassLambdaCPlus); + double const yL = RecoDecay::y(candidate.pVector(), MassLambdaCPlus); if (std::abs(yL) > yCandGenMax || candidate.pt() < ptCandMin || candidate.pt() > ptCandMax) { continue; } @@ -1368,9 +1368,9 @@ struct HfCorrelatorLcScHadrons { if (pidTrkApplied && (std::abs(particleAssoc.pdgCode()) != kProton)) { continue; // proton PID } - int8_t chargeLc = pdg->GetParticle(candidate.pdgCode())->Charge(); // Retrieve charge - int8_t chargeAssoc = pdg->GetParticle(particleAssoc.pdgCode())->Charge(); // Retrieve charge - float cent = 100.0; // will be updated later + int8_t const chargeLc = pdg->GetParticle(candidate.pdgCode())->Charge(); // Retrieve charge + int8_t const chargeAssoc = pdg->GetParticle(particleAssoc.pdgCode())->Charge(); // Retrieve charge + float cent = 100.0; // will be updated later int trackOrigin = RecoDecay::getCharmHadronOrigin(mcParticles, particleAssoc, true); bool isPrompt = candidate.originMcGen() == RecoDecay::OriginType::Prompt; diff --git a/PWGHF/HFC/TableProducer/derivedDataCreatorCorrelationsReduced.cxx b/PWGHF/HFC/TableProducer/derivedDataCreatorCorrelationsReduced.cxx index 90253bcba3d..0ae49453a27 100644 --- a/PWGHF/HFC/TableProducer/derivedDataCreatorCorrelationsReduced.cxx +++ b/PWGHF/HFC/TableProducer/derivedDataCreatorCorrelationsReduced.cxx @@ -288,7 +288,7 @@ struct HfDerivedDataCreatorCorrelationsReduced { return false; } - int trackGlobalIndex = assTrk.globalIndex(); + int const trackGlobalIndex = assTrk.globalIndex(); if constexpr (CandType == CandidateType::Hadron) { if (!cand.isGlobalTrackWoDCA() || cand.tpcNClsCrossedRows() < tpcNClsCrossedRowsMin) { return false; @@ -333,7 +333,7 @@ struct HfDerivedDataCreatorCorrelationsReduced { for (const auto& assTrk : assTrks) { double assTrkPt = assTrk.pt(); if (usePtDiffDcaXYCut) { - float dcaXYTrkCut = funcDcaXYPtCutPrimTrk->Eval(assTrkPt); + float const dcaXYTrkCut = funcDcaXYPtCutPrimTrk->Eval(assTrkPt); if (std::fabs(assTrk.dcaXY()) > dcaXYTrkCut) { continue; } @@ -344,7 +344,7 @@ struct HfDerivedDataCreatorCorrelationsReduced { continue; } if (downSampleTrksFactor < 1.) { - float pseudoRndm = assTrkPt * 1000. - static_cast(assTrkPt * 1000); + float const pseudoRndm = assTrkPt * 1000. - static_cast(assTrkPt * 1000); if (assTrkPt < ptMaxForDownSample && collCentrality < centMaxForDownSample && pseudoRndm >= downSampleTrksFactor) { continue; } @@ -396,13 +396,13 @@ struct HfDerivedDataCreatorCorrelationsReduced { } double assTrkPt = assTrk.pt(); if (usePtDiffDcaXYCut) { - float dcaXYTrkCut = funcDcaXYPtCutPrimTrk->Eval(assTrkPt); + float const dcaXYTrkCut = funcDcaXYPtCutPrimTrk->Eval(assTrkPt); if (std::fabs(assTrk.dcaXY()) > dcaXYTrkCut) { continue; } } if (!first && downSampleTrksFactor < 1.) { // skip downsampling for the first track to avoid empty tables - float pseudoRndm = assTrkPt * 1000. - static_cast(assTrkPt * 1000); + float const pseudoRndm = assTrkPt * 1000. - static_cast(assTrkPt * 1000); if (assTrkPt < ptMaxForDownSample && collCentrality < centMaxForDownSample && pseudoRndm >= downSampleTrksFactor) { continue; } diff --git a/PWGHF/HFC/TableProducer/femtoDreamProducer.cxx b/PWGHF/HFC/TableProducer/femtoDreamProducer.cxx index 004886dfeb3..f5cc68a3996 100644 --- a/PWGHF/HFC/TableProducer/femtoDreamProducer.cxx +++ b/PWGHF/HFC/TableProducer/femtoDreamProducer.cxx @@ -202,7 +202,7 @@ struct HfFemtoDreamProducer { LOGP(fatal, "One and only one process function must be enabled at a time."); } - int cutBits = 8 * sizeof(o2::aod::femtodreamparticle::cutContainerType); + int const cutBits = 8 * sizeof(o2::aod::femtodreamparticle::cutContainerType); trackRegistry.add("AnalysisQA/CutCounter", "; Bit; Counter", kTH1F, {{cutBits + 1, -0.5, cutBits + 0.5}}); // event QA histograms @@ -247,7 +247,7 @@ struct HfFemtoDreamProducer { hfEvSel.addHistograms(qaRegistry); // collision monitoring - int64_t now = std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(); + int64_t const now = std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(); ccdb->setCreatedNotAfter(now); if (applyMlMode == FillMlFromNewBDT) { @@ -378,7 +378,7 @@ struct HfFemtoDreamProducer { bool fillTracksForCharmHadron(CollisionType const& col, TrackType const& tracks) { - std::vector childIDs = {0, 0}; // these IDs are necessary to keep track of the children + std::vector const childIDs = {0, 0}; // these IDs are necessary to keep track of the children // std::vector tmpIDtrack; // this vector keeps track of the matching of the primary track table row <-> aod::track table global index bool fIsTrackFilled = false; diff --git a/PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx index e053d3d576a..78aa10b08b9 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx @@ -150,14 +150,14 @@ struct HfTaskCorrelationD0Hadrons { { AxisSpec axisMassD = {binsMassD, "inv. mass (#pi K) (GeV/#it{c}^{2})"}; AxisSpec axisDeltaEta = {binsEta, "#it{#eta}^{Hadron}-#it{#eta}^{D}"}; - AxisSpec axisEta = {binsEta, "#it{#eta}"}; + AxisSpec const axisEta = {binsEta, "#it{#eta}"}; AxisSpec axisDeltaPhi = {binsPhi, "#it{#varphi}^{Hadron}-#it{#varphi}^{D} (rad)"}; AxisSpec axisPtD = {(std::vector)binsPtD, "#it{p}_{T}^{D} (GeV/#it{c})"}; AxisSpec axisPtHadron = {(std::vector)binsPtHadron, "#it{p}_{T}^{Hadron} (GeV/#it{c})"}; AxisSpec axisPoolBin = {binsPoolBin, "poolBin"}; - AxisSpec axisBdtScore = {binsBdtScore, "Bdt score"}; - AxisSpec axisMultFT0M = {binsMultFT0M, "MultiplicityFT0M"}; - AxisSpec axisPosZ = {binsPosZ, "PosZ"}; + AxisSpec const axisBdtScore = {binsBdtScore, "Bdt score"}; + AxisSpec const axisMultFT0M = {binsMultFT0M, "MultiplicityFT0M"}; + AxisSpec const axisPosZ = {binsPosZ, "PosZ"}; AxisSpec axisD0Prompt = {2, -0.5, 1.5, "Prompt D0"}; AxisSpec axisCorrelationState = {2, 0., 2., "correlationState"}; @@ -306,12 +306,12 @@ struct HfTaskCorrelationD0Hadrons { aod::D0CandRecoInfo const& candidates) { for (const auto& candidate : candidates) { - float ptD = candidate.ptD(); - float bdtScorePromptD0 = candidate.mlScorePromptD0(); - float bdtScoreBkgD0 = candidate.mlScoreBkgD0(); - float bdtScorePromptD0bar = candidate.mlScorePromptD0bar(); - float bdtScoreBkgD0bar = candidate.mlScoreBkgD0bar(); - int effBinD = o2::analysis::findBin(binsPtEfficiencyD, ptD); + float const ptD = candidate.ptD(); + float const bdtScorePromptD0 = candidate.mlScorePromptD0(); + float const bdtScoreBkgD0 = candidate.mlScoreBkgD0(); + float const bdtScorePromptD0bar = candidate.mlScorePromptD0bar(); + float const bdtScoreBkgD0bar = candidate.mlScoreBkgD0bar(); + int const effBinD = o2::analysis::findBin(binsPtEfficiencyD, ptD); registry.fill(HIST("hBdtScorePromptD0"), bdtScorePromptD0); registry.fill(HIST("hBdtScoreBkgD0"), bdtScoreBkgD0); @@ -326,24 +326,24 @@ struct HfTaskCorrelationD0Hadrons { for (const auto& pairEntry : pairEntries) { // define variables for widely used quantities - double deltaPhi = pairEntry.deltaPhi(); - double deltaEta = pairEntry.deltaEta(); - double ptD = pairEntry.ptD(); - double ptHadron = pairEntry.ptHadron(); - double massD = pairEntry.mD(); - double massDbar = pairEntry.mDbar(); - int signalStatus = pairEntry.signalStatus(); - int effBinD = o2::analysis::findBin(binsPtEfficiencyD, ptD); - int ptBinD = o2::analysis::findBin(binsCorrelations, ptD); - int poolBin = pairEntry.poolBin(); - float trackDcaXY = pairEntry.trackDcaXY(); - float trackDcaZ = pairEntry.trackDcaZ(); - int trackTpcCrossedRows = pairEntry.trackTPCNClsCrossedRows(); - bool isAutoCorrelated = pairEntry.isAutoCorrelated(); - float bdtScorePromptD0 = pairEntry.mlScorePromptD0(); - float bdtScoreBkgD0 = pairEntry.mlScoreBkgD0(); - float bdtScorePromptD0bar = pairEntry.mlScorePromptD0bar(); - float bdtScoreBkgD0bar = pairEntry.mlScoreBkgD0bar(); + double const deltaPhi = pairEntry.deltaPhi(); + double const deltaEta = pairEntry.deltaEta(); + double const ptD = pairEntry.ptD(); + double const ptHadron = pairEntry.ptHadron(); + double const massD = pairEntry.mD(); + double const massDbar = pairEntry.mDbar(); + int const signalStatus = pairEntry.signalStatus(); + int const effBinD = o2::analysis::findBin(binsPtEfficiencyD, ptD); + int const ptBinD = o2::analysis::findBin(binsCorrelations, ptD); + int const poolBin = pairEntry.poolBin(); + float const trackDcaXY = pairEntry.trackDcaXY(); + float const trackDcaZ = pairEntry.trackDcaZ(); + int const trackTpcCrossedRows = pairEntry.trackTPCNClsCrossedRows(); + bool const isAutoCorrelated = pairEntry.isAutoCorrelated(); + float const bdtScorePromptD0 = pairEntry.mlScorePromptD0(); + float const bdtScoreBkgD0 = pairEntry.mlScoreBkgD0(); + float const bdtScorePromptD0bar = pairEntry.mlScorePromptD0bar(); + float const bdtScoreBkgD0bar = pairEntry.mlScoreBkgD0bar(); // reject entries outside pT ranges of interest if (ptBinD < 0 || effBinD < 0) { continue; @@ -369,7 +369,7 @@ struct HfTaskCorrelationD0Hadrons { if (ptHadron < leadingParticlePtMin) { continue; } - Region region = getRegion(deltaPhi); + Region const region = getRegion(deltaPhi); switch (region) { case Toward: @@ -465,12 +465,12 @@ struct HfTaskCorrelationD0Hadrons { soa::Join const& candidates) { for (const auto& candidate : candidates) { - float ptD = candidate.ptD(); - float bdtScorePromptD0 = candidate.mlScorePromptD0(); - float bdtScoreBkgD0 = candidate.mlScoreBkgD0(); - float bdtScorePromptD0bar = candidate.mlScorePromptD0bar(); - float bdtScoreBkgD0bar = candidate.mlScoreBkgD0bar(); - int effBinD = o2::analysis::findBin(binsPtEfficiencyD, ptD); + float const ptD = candidate.ptD(); + float const bdtScorePromptD0 = candidate.mlScorePromptD0(); + float const bdtScoreBkgD0 = candidate.mlScoreBkgD0(); + float const bdtScorePromptD0bar = candidate.mlScorePromptD0bar(); + float const bdtScoreBkgD0bar = candidate.mlScoreBkgD0bar(); + int const effBinD = o2::analysis::findBin(binsPtEfficiencyD, ptD); registry.fill(HIST("hBdtScorePromptD0"), bdtScorePromptD0); registry.fill(HIST("hBdtScoreBkgD0"), bdtScoreBkgD0); @@ -485,26 +485,26 @@ struct HfTaskCorrelationD0Hadrons { for (const auto& pairEntry : pairEntries) { // define variables for widely used quantities - double deltaPhi = pairEntry.deltaPhi(); - double deltaEta = pairEntry.deltaEta(); - double ptD = pairEntry.ptD(); - double ptHadron = pairEntry.ptHadron(); - double massD = pairEntry.mD(); - double massDbar = pairEntry.mDbar(); - int signalStatus = pairEntry.signalStatus(); - int ptBinD = o2::analysis::findBin(binsCorrelations, ptD); - int poolBin = pairEntry.poolBin(); - float trackDcaXY = pairEntry.trackDcaXY(); - float trackDcaZ = pairEntry.trackDcaZ(); - int trackTpcCrossedRows = pairEntry.trackTPCNClsCrossedRows(); - bool isAutoCorrelated = pairEntry.isAutoCorrelated(); - float bdtScorePromptD0 = pairEntry.mlScorePromptD0(); - float bdtScoreBkgD0 = pairEntry.mlScoreBkgD0(); - float bdtScorePromptD0bar = pairEntry.mlScorePromptD0bar(); - float bdtScoreBkgD0bar = pairEntry.mlScoreBkgD0bar(); - bool isPhysicalPrimary = pairEntry.isPhysicalPrimary(); - bool isD0Prompt = pairEntry.isPrompt(); - int statusPromptHadron = pairEntry.trackOrigin(); + double const deltaPhi = pairEntry.deltaPhi(); + double const deltaEta = pairEntry.deltaEta(); + double const ptD = pairEntry.ptD(); + double const ptHadron = pairEntry.ptHadron(); + double const massD = pairEntry.mD(); + double const massDbar = pairEntry.mDbar(); + int const signalStatus = pairEntry.signalStatus(); + int const ptBinD = o2::analysis::findBin(binsCorrelations, ptD); + int const poolBin = pairEntry.poolBin(); + float const trackDcaXY = pairEntry.trackDcaXY(); + float const trackDcaZ = pairEntry.trackDcaZ(); + int const trackTpcCrossedRows = pairEntry.trackTPCNClsCrossedRows(); + bool const isAutoCorrelated = pairEntry.isAutoCorrelated(); + float const bdtScorePromptD0 = pairEntry.mlScorePromptD0(); + float const bdtScoreBkgD0 = pairEntry.mlScoreBkgD0(); + float const bdtScorePromptD0bar = pairEntry.mlScorePromptD0bar(); + float const bdtScoreBkgD0bar = pairEntry.mlScoreBkgD0bar(); + bool const isPhysicalPrimary = pairEntry.isPhysicalPrimary(); + bool const isD0Prompt = pairEntry.isPrompt(); + int const statusPromptHadron = pairEntry.trackOrigin(); if (bdtScorePromptD0 < mlOutputPromptD0->at(ptBinD) || bdtScoreBkgD0 > mlOutputBkgD0->at(ptBinD) || bdtScorePromptD0bar < mlOutputPromptD0bar->at(ptBinD) || bdtScoreBkgD0bar > mlOutputBkgD0bar->at(ptBinD)) { @@ -522,7 +522,7 @@ struct HfTaskCorrelationD0Hadrons { if (ptHadron < leadingParticlePtMin) { continue; } - Region region = getRegion(deltaPhi); + Region const region = getRegion(deltaPhi); switch (region) { case Toward: registry.fill(HIST("hTowardRec"), massD, ptD, isAutoCorrelated, efficiencyWeight); @@ -736,15 +736,15 @@ struct HfTaskCorrelationD0Hadrons { { for (const auto& pairEntry : pairEntries) { // define variables for widely used quantities - double deltaPhi = pairEntry.deltaPhi(); - double deltaEta = pairEntry.deltaEta(); - double ptD = pairEntry.ptD(); - double ptHadron = pairEntry.ptHadron(); - int poolBin = pairEntry.poolBin(); - double massD = pairEntry.mD(); - bool isAutoCorrelated = pairEntry.isAutoCorrelated(); - int statusPromptHadron = pairEntry.trackOrigin(); - bool isD0Prompt = pairEntry.isPrompt(); + double const deltaPhi = pairEntry.deltaPhi(); + double const deltaEta = pairEntry.deltaEta(); + double const ptD = pairEntry.ptD(); + double const ptHadron = pairEntry.ptHadron(); + int const poolBin = pairEntry.poolBin(); + double const massD = pairEntry.mD(); + bool const isAutoCorrelated = pairEntry.isAutoCorrelated(); + int const statusPromptHadron = pairEntry.trackOrigin(); + bool const isD0Prompt = pairEntry.isPrompt(); // reject entries outside pT ranges of interest if (o2::analysis::findBin(binsCorrelations, ptD) < 0) { @@ -755,7 +755,7 @@ struct HfTaskCorrelationD0Hadrons { if (ptHadron < leadingParticlePtMin) { continue; } - Region region = getRegion(deltaPhi); + Region const region = getRegion(deltaPhi); switch (region) { case Toward: registry.fill(HIST("hTowardGen"), massD, ptD, isAutoCorrelated); diff --git a/PWGHF/HFC/Tasks/taskCorrelationDDbar.cxx b/PWGHF/HFC/Tasks/taskCorrelationDDbar.cxx index 6f3328d96de..652d49d29dc 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationDDbar.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationDDbar.cxx @@ -171,7 +171,7 @@ struct HfTaskCorrelationDDbar { void init(InitContext&) { // redefinition of pT axes for THnSparse holding correlation entries - int nBinspTaxis = binsPtCorrelations->size() - 1; + int const nBinspTaxis = binsPtCorrelations->size() - 1; const double* valuespTaxis = binsPtCorrelations->data(); for (int i = 2; i <= 3; i++) { @@ -246,15 +246,15 @@ struct HfTaskCorrelationDDbar { { for (const auto& pairEntry : pairEntries) { // define variables for widely used quantities - double deltaPhi = pairEntry.deltaPhi(); - double deltaEta = pairEntry.deltaEta(); - double ptD = pairEntry.ptD(); - double ptDbar = pairEntry.ptDbar(); - double massD = pairEntry.mD(); - double massDbar = pairEntry.mDbar(); + double const deltaPhi = pairEntry.deltaPhi(); + double const deltaEta = pairEntry.deltaEta(); + double const ptD = pairEntry.ptD(); + double const ptDbar = pairEntry.ptDbar(); + double const massD = pairEntry.mD(); + double const massDbar = pairEntry.mDbar(); - int pTBinD = o2::analysis::findBin(binsPtCorrelations, ptD); - int pTBinDbar = o2::analysis::findBin(binsPtCorrelations, ptDbar); + int const pTBinD = o2::analysis::findBin(binsPtCorrelations, ptD); + int const pTBinDbar = o2::analysis::findBin(binsPtCorrelations, ptDbar); double efficiencyWeight = 1.; if (applyEfficiency != 0) { @@ -303,15 +303,15 @@ struct HfTaskCorrelationDDbar { { for (const auto& pairEntry : pairEntries) { // define variables for widely used quantities - double deltaPhi = pairEntry.deltaPhi(); - double deltaEta = pairEntry.deltaEta(); - double ptD = pairEntry.ptD(); - double ptDbar = pairEntry.ptDbar(); - double massD = pairEntry.mD(); - double massDbar = pairEntry.mDbar(); + double const deltaPhi = pairEntry.deltaPhi(); + double const deltaEta = pairEntry.deltaEta(); + double const ptD = pairEntry.ptD(); + double const ptDbar = pairEntry.ptDbar(); + double const massD = pairEntry.mD(); + double const massDbar = pairEntry.mDbar(); - int pTBinD = o2::analysis::findBin(binsPtCorrelations, ptD); - int pTBinDbar = o2::analysis::findBin(binsPtCorrelations, ptDbar); + int const pTBinD = o2::analysis::findBin(binsPtCorrelations, ptD); + int const pTBinDbar = o2::analysis::findBin(binsPtCorrelations, ptDbar); double efficiencyWeight = 1.; if (applyEfficiency != 0) { @@ -450,10 +450,10 @@ struct HfTaskCorrelationDDbar { { for (const auto& pairEntry : pairEntries) { // define variables for widely used quantities - double deltaPhi = pairEntry.deltaPhi(); - double deltaEta = pairEntry.deltaEta(); - double ptD = pairEntry.ptD(); - double ptDbar = pairEntry.ptDbar(); + double const deltaPhi = pairEntry.deltaPhi(); + double const deltaEta = pairEntry.deltaEta(); + double const ptD = pairEntry.ptD(); + double const ptDbar = pairEntry.ptDbar(); // reject entries outside pT ranges of interest if (o2::analysis::findBin(binsPtCorrelations, ptD) == -1 || o2::analysis::findBin(binsPtCorrelations, ptDbar) == -1) { diff --git a/PWGHF/HFC/Tasks/taskCorrelationDMesonPairs.cxx b/PWGHF/HFC/Tasks/taskCorrelationDMesonPairs.cxx index af5b60e03d7..955c2f559bc 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationDMesonPairs.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationDMesonPairs.cxx @@ -109,14 +109,14 @@ struct HfTaskCorrelationDMesonPairs { { for (const auto& pairEntry : pairEntries) { // define variables for widely used quantities - float ptCand1 = pairEntry.ptCand1(); - float ptCand2 = pairEntry.ptCand2(); - float massDCand1 = pairEntry.mDCand1(); - float massDbarCand1 = pairEntry.mDbarCand1(); - float massDCand2 = pairEntry.mDCand2(); - float massDbarCand2 = pairEntry.mDbarCand2(); - float yCand1 = pairEntry.yCand1(); - float yCand2 = pairEntry.yCand2(); + float const ptCand1 = pairEntry.ptCand1(); + float const ptCand2 = pairEntry.ptCand2(); + float const massDCand1 = pairEntry.mDCand1(); + float const massDbarCand1 = pairEntry.mDbarCand1(); + float const massDCand2 = pairEntry.mDCand2(); + float const massDbarCand2 = pairEntry.mDbarCand2(); + float const yCand1 = pairEntry.yCand1(); + float const yCand2 = pairEntry.yCand2(); auto pairType = pairEntry.pairType(); auto d0Type1 = getD0Type(pairEntry.candidateType1()); auto d0Type2 = getD0Type(pairEntry.candidateType2()); @@ -142,14 +142,14 @@ struct HfTaskCorrelationDMesonPairs { { for (const auto& pairEntry : pairEntries) { // define variables for widely used quantities - double ptParticle1 = pairEntry.ptCand1(); - double ptParticle2 = pairEntry.ptCand2(); - float massDParticle1 = pairEntry.mDCand1(); - float massDbarParticle1 = pairEntry.mDbarCand1(); - float massDParticle2 = pairEntry.mDCand2(); - float massDbarParticle2 = pairEntry.mDbarCand2(); - float yParticle1 = pairEntry.yCand1(); - float yParticle2 = pairEntry.yCand2(); + double const ptParticle1 = pairEntry.ptCand1(); + double const ptParticle2 = pairEntry.ptCand2(); + float const massDParticle1 = pairEntry.mDCand1(); + float const massDbarParticle1 = pairEntry.mDbarCand1(); + float const massDParticle2 = pairEntry.mDCand2(); + float const massDbarParticle2 = pairEntry.mDbarCand2(); + float const yParticle1 = pairEntry.yCand1(); + float const yParticle2 = pairEntry.yCand2(); auto pairType = pairEntry.pairType(); auto d0Type1 = getD0Type(pairEntry.candidateType1()); auto d0Type2 = getD0Type(pairEntry.candidateType2()); diff --git a/PWGHF/HFC/Tasks/taskCorrelationDplusHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationDplusHadrons.cxx index fa5c3f05cfe..aa8a6ea4d42 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationDplusHadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationDplusHadrons.cxx @@ -186,13 +186,13 @@ struct HfTaskCorrelationDplusHadrons { AxisSpec axisMassD = {binsMassD, "inv. mass (#pi^{+}K^{-}#pi^{+}) (GeV/#it{c}^{2})"}; AxisSpec axisPtCorr = {(std::vector)binsPtCorrelations, "#it{p}_{T}^{D} (GeV/#it{c})"}; AxisSpec axisPtD = {(std::vector)binsPtEfficiencyD, "#it{p}_{T}^{D} (GeV/#it{c})"}; - AxisSpec axisMultFT0M = {binsMultFT0M, "MultiplicityFT0M"}; + AxisSpec const axisMultFT0M = {binsMultFT0M, "MultiplicityFT0M"}; AxisSpec axisDeltaEta = {binsEta, "#it{#eta}^{Hadron}-#it{#eta}^{D}"}; AxisSpec axisDeltaPhi = {binsPhi, "#it{#varphi}^{Hadron}-#it{#varphi}^{D} (rad)"}; AxisSpec axisPtHadron = {(std::vector)binsPtHadron, "#it{p}_{T}^{Hadron} (GeV/#it{c})"}; AxisSpec axisPoolBin = {binsPoolBin, "poolBin"}; AxisSpec axisDplusPrompt = {2, -0.5, 1.5, "Prompt D+"}; - AxisSpec axisBdtScore = {binsBdtScore, "Bdt score"}; + AxisSpec const axisBdtScore = {binsBdtScore, "Bdt score"}; // Histograms for data analysis registry.add("hBdtScorePrompt", "D+ BDT prompt score", {HistType::kTH1F, {axisBdtScore}}); @@ -330,13 +330,13 @@ struct HfTaskCorrelationDplusHadrons { void processData(DplusHadronPairFullWithMl const& pairEntries, aod::DplusRecoInfo const& candidates) { for (const auto& candidate : candidates) { - float massD = candidate.mD(); - float ptD = candidate.ptD(); - float bdtScorePrompt = candidate.mlScorePrompt(); - float bdtScoreNonPrompt = candidate.mlScoreNonPrompt(); - float bdtScoreBkg = candidate.mlScoreBkg(); - int effBinD = o2::analysis::findBin(binsPtEfficiencyD, ptD); - float bdtScorePromptOrNonPrompt = isPromptAnalysis ? bdtScorePrompt : bdtScoreNonPrompt; + float const massD = candidate.mD(); + float const ptD = candidate.ptD(); + float const bdtScorePrompt = candidate.mlScorePrompt(); + float const bdtScoreNonPrompt = candidate.mlScoreNonPrompt(); + float const bdtScoreBkg = candidate.mlScoreBkg(); + int const effBinD = o2::analysis::findBin(binsPtEfficiencyD, ptD); + float const bdtScorePromptOrNonPrompt = isPromptAnalysis ? bdtScorePrompt : bdtScoreNonPrompt; // reject entries outside pT ranges of interest if (ptD < binsPtEfficiencyD->front() || ptD > binsPtEfficiencyD->back()) { @@ -361,21 +361,21 @@ struct HfTaskCorrelationDplusHadrons { for (const auto& pairEntry : pairEntries) { // define variables for widely used quantities - float deltaPhi = pairEntry.deltaPhi(); - float deltaEta = pairEntry.deltaEta(); - float ptD = pairEntry.ptD(); - float ptHadron = pairEntry.ptHadron(); - float bdtScorePrompt = pairEntry.mlScorePrompt(); - float bdtScoreNonPrompt = pairEntry.mlScoreNonPrompt(); - float bdtScoreBkg = pairEntry.mlScoreBkg(); - float trackDcaXY = pairEntry.trackDcaXY(); - float trackDcaZ = pairEntry.trackDcaZ(); - int trackTpcCrossedRows = pairEntry.trackTPCNClsCrossedRows(); - int poolBin = pairEntry.poolBin(); - double massD = pairEntry.mD(); - int effBinD = o2::analysis::findBin(binsPtEfficiencyD, ptD); - int pTBinD = o2::analysis::findBin(binsPtCorrelations, ptD); - float bdtScorePromptOrNonPrompt = isPromptAnalysis ? bdtScorePrompt : bdtScoreNonPrompt; + float const deltaPhi = pairEntry.deltaPhi(); + float const deltaEta = pairEntry.deltaEta(); + float const ptD = pairEntry.ptD(); + float const ptHadron = pairEntry.ptHadron(); + float const bdtScorePrompt = pairEntry.mlScorePrompt(); + float const bdtScoreNonPrompt = pairEntry.mlScoreNonPrompt(); + float const bdtScoreBkg = pairEntry.mlScoreBkg(); + float const trackDcaXY = pairEntry.trackDcaXY(); + float const trackDcaZ = pairEntry.trackDcaZ(); + int const trackTpcCrossedRows = pairEntry.trackTPCNClsCrossedRows(); + int const poolBin = pairEntry.poolBin(); + double const massD = pairEntry.mD(); + int const effBinD = o2::analysis::findBin(binsPtEfficiencyD, ptD); + int const pTBinD = o2::analysis::findBin(binsPtCorrelations, ptD); + float const bdtScorePromptOrNonPrompt = isPromptAnalysis ? bdtScorePrompt : bdtScoreNonPrompt; // reject entries outside pT ranges of interest if (ptD < binsPtEfficiencyD->front() || ptD > binsPtEfficiencyD->back()) { @@ -432,14 +432,14 @@ struct HfTaskCorrelationDplusHadrons { soa::Join const& candidates) { for (const auto& candidate : candidates) { - float massD = candidate.mD(); - float ptD = candidate.ptD(); - float bdtScorePrompt = candidate.mlScorePrompt(); - float bdtScoreNonPrompt = candidate.mlScoreNonPrompt(); - float bdtScoreBkg = candidate.mlScoreBkg(); - int effBinD = o2::analysis::findBin(binsPtEfficiencyD, ptD); - bool isDplusPrompt = candidate.isPrompt(); - float bdtScorePromptOrNonPrompt = isPromptAnalysis ? bdtScorePrompt : bdtScoreNonPrompt; + float const massD = candidate.mD(); + float const ptD = candidate.ptD(); + float const bdtScorePrompt = candidate.mlScorePrompt(); + float const bdtScoreNonPrompt = candidate.mlScoreNonPrompt(); + float const bdtScoreBkg = candidate.mlScoreBkg(); + int const effBinD = o2::analysis::findBin(binsPtEfficiencyD, ptD); + bool const isDplusPrompt = candidate.isPrompt(); + float const bdtScorePromptOrNonPrompt = isPromptAnalysis ? bdtScorePrompt : bdtScoreNonPrompt; // reject entries outside pT ranges of interest if (ptD < binsPtEfficiencyD->front() || ptD > binsPtEfficiencyD->back()) { @@ -477,24 +477,24 @@ struct HfTaskCorrelationDplusHadrons { for (const auto& pairEntry : pairEntries) { // define variables for widely used quantities - float deltaPhi = pairEntry.deltaPhi(); - float deltaEta = pairEntry.deltaEta(); - float ptD = pairEntry.ptD(); - float ptHadron = pairEntry.ptHadron(); - float massD = pairEntry.mD(); - float bdtScorePrompt = pairEntry.mlScorePrompt(); - float bdtScoreNonPrompt = pairEntry.mlScoreNonPrompt(); - float bdtScoreBkg = pairEntry.mlScoreBkg(); - bool isPhysicalPrimary = pairEntry.isPhysicalPrimary(); - float trackDcaXY = pairEntry.trackDcaXY(); - float trackDcaZ = pairEntry.trackDcaZ(); - int trackTpcCrossedRows = pairEntry.trackTPCNClsCrossedRows(); - bool isDplusPrompt = pairEntry.isPrompt(); - int originHadron = pairEntry.trackOrigin(); - int poolBin = pairEntry.poolBin(); - int effBinD = o2::analysis::findBin(binsPtEfficiencyD, ptD); - int pTBinD = o2::analysis::findBin(binsPtCorrelations, ptD); - float bdtScorePromptOrNonPrompt = isPromptAnalysis ? bdtScorePrompt : bdtScoreNonPrompt; + float const deltaPhi = pairEntry.deltaPhi(); + float const deltaEta = pairEntry.deltaEta(); + float const ptD = pairEntry.ptD(); + float const ptHadron = pairEntry.ptHadron(); + float const massD = pairEntry.mD(); + float const bdtScorePrompt = pairEntry.mlScorePrompt(); + float const bdtScoreNonPrompt = pairEntry.mlScoreNonPrompt(); + float const bdtScoreBkg = pairEntry.mlScoreBkg(); + bool const isPhysicalPrimary = pairEntry.isPhysicalPrimary(); + float const trackDcaXY = pairEntry.trackDcaXY(); + float const trackDcaZ = pairEntry.trackDcaZ(); + int const trackTpcCrossedRows = pairEntry.trackTPCNClsCrossedRows(); + bool const isDplusPrompt = pairEntry.isPrompt(); + int const originHadron = pairEntry.trackOrigin(); + int const poolBin = pairEntry.poolBin(); + int const effBinD = o2::analysis::findBin(binsPtEfficiencyD, ptD); + int const pTBinD = o2::analysis::findBin(binsPtCorrelations, ptD); + float const bdtScorePromptOrNonPrompt = isPromptAnalysis ? bdtScorePrompt : bdtScoreNonPrompt; // reject entries outside pT ranges of interest if (ptD < binsPtEfficiencyD->front() || ptD > binsPtEfficiencyD->back()) { @@ -576,13 +576,13 @@ struct HfTaskCorrelationDplusHadrons { { for (const auto& pairEntry : pairEntries) { // define variables for widely used quantities - float deltaPhi = pairEntry.deltaPhi(); - float deltaEta = pairEntry.deltaEta(); - float ptD = pairEntry.ptD(); - float ptHadron = pairEntry.ptHadron(); - int poolBin = pairEntry.poolBin(); - int originHadron = pairEntry.trackOrigin(); - bool isDplusPrompt = pairEntry.isPrompt(); + float const deltaPhi = pairEntry.deltaPhi(); + float const deltaEta = pairEntry.deltaEta(); + float const ptD = pairEntry.ptD(); + float const ptHadron = pairEntry.ptHadron(); + int const poolBin = pairEntry.poolBin(); + int const originHadron = pairEntry.trackOrigin(); + bool const isDplusPrompt = pairEntry.isPrompt(); registry.fill(HIST("hCorrel2DVsPtMcGen"), deltaPhi, deltaEta, ptD, ptHadron, poolBin); registry.fill(HIST("hDeltaEtaPtIntMcGen"), deltaEta); diff --git a/PWGHF/HFC/Tasks/taskCorrelationDsHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationDsHadrons.cxx index f15bf117ad1..450258ab02b 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationDsHadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationDsHadrons.cxx @@ -179,8 +179,8 @@ struct HfTaskCorrelationDsHadrons { AxisSpec axisPtD = {(std::vector)binsPtD, "#it{p}_{T}^{D} (GeV/#it{c})"}; AxisSpec axisPtHadron = {(std::vector)binsPtHadron, "#it{p}_{T}^{Hadron} (GeV/#it{c})"}; AxisSpec axisPoolBin = {binsPoolBin, "poolBin"}; - AxisSpec axisBdtScore = {binsBdtScore, "Bdt score"}; - AxisSpec axisMultFT0M = {binsMultFT0M, "MultiplicityFT0M"}; + AxisSpec const axisBdtScore = {binsBdtScore, "Bdt score"}; + AxisSpec const axisMultFT0M = {binsMultFT0M, "MultiplicityFT0M"}; AxisSpec axisPosZ = {binsPosZ, "PosZ"}; AxisSpec axisNumPvContr = {binsNumPvContr, "Num PV contributors"}; AxisSpec axisDsPrompt = {2, -0.5, 1.5, "Prompt Ds"}; @@ -416,12 +416,12 @@ struct HfTaskCorrelationDsHadrons { aod::DsCandRecoInfo const& candidates) { for (const auto& candidate : candidates) { - float massD = candidate.mD(); - float ptD = candidate.signedPtD(); - float bdtScorePrompt = candidate.mlScorePrompt(); - float bdtScoreBkg = candidate.mlScoreBkg(); + float const massD = candidate.mD(); + float const ptD = candidate.signedPtD(); + float const bdtScorePrompt = candidate.mlScorePrompt(); + float const bdtScoreBkg = candidate.mlScoreBkg(); int multPvContrib = candidate.numPvContrib(); - int ptBinD = o2::analysis::findBin(binsPtD, std::abs(ptD)); + int const ptBinD = o2::analysis::findBin(binsPtD, std::abs(ptD)); if (!isSelectedCandidate(ptBinD, bdtScorePrompt, bdtScoreBkg)) { continue; @@ -442,18 +442,18 @@ struct HfTaskCorrelationDsHadrons { for (const auto& pairEntry : pairEntries) { // define variables for widely used quantities float deltaPhi = pairEntry.deltaPhi(); - float deltaEta = pairEntry.deltaEta(); - float ptD = pairEntry.signedPtD(); - float ptHadron = pairEntry.signedPtHadron(); - float massD = pairEntry.mD(); - float bdtScorePrompt = pairEntry.mlScorePrompt(); - float bdtScoreBkg = pairEntry.mlScoreBkg(); - float trackDcaXY = pairEntry.trackDcaXY(); - float trackDcaZ = pairEntry.trackDcaZ(); + float const deltaEta = pairEntry.deltaEta(); + float const ptD = pairEntry.signedPtD(); + float const ptHadron = pairEntry.signedPtHadron(); + float const massD = pairEntry.mD(); + float const bdtScorePrompt = pairEntry.mlScorePrompt(); + float const bdtScoreBkg = pairEntry.mlScoreBkg(); + float const trackDcaXY = pairEntry.trackDcaXY(); + float const trackDcaZ = pairEntry.trackDcaZ(); int multPvContrib = pairEntry.numPvContrib(); - int trackTpcCrossedRows = pairEntry.trackTPCNClsCrossedRows(); - int poolBin = pairEntry.poolBin(); - int ptBinD = o2::analysis::findBin(binsPtD, std::abs(ptD)); + int const trackTpcCrossedRows = pairEntry.trackTPCNClsCrossedRows(); + int const poolBin = pairEntry.poolBin(); + int const ptBinD = o2::analysis::findBin(binsPtD, std::abs(ptD)); if (!isSelectedCandidate(ptBinD, bdtScorePrompt, bdtScoreBkg)) { continue; @@ -527,13 +527,13 @@ struct HfTaskCorrelationDsHadrons { soa::Join const& candidates) { for (const auto& candidate : candidates) { - float massD = candidate.mD(); - float ptD = candidate.signedPtD(); - float bdtScorePrompt = candidate.mlScorePrompt(); - float bdtScoreBkg = candidate.mlScoreBkg(); - int ptBinD = o2::analysis::findBin(binsPtD, std::abs(ptD)); + float const massD = candidate.mD(); + float const ptD = candidate.signedPtD(); + float const bdtScorePrompt = candidate.mlScorePrompt(); + float const bdtScoreBkg = candidate.mlScoreBkg(); + int const ptBinD = o2::analysis::findBin(binsPtD, std::abs(ptD)); int multPvContrib = candidate.numPvContrib(); - bool isDsPrompt = candidate.isPrompt(); + bool const isDsPrompt = candidate.isPrompt(); if (!isSelectedCandidate(ptBinD, bdtScorePrompt, bdtScoreBkg)) { continue; @@ -560,21 +560,21 @@ struct HfTaskCorrelationDsHadrons { for (const auto& pairEntry : pairEntries) { // define variables for widely used quantities float deltaPhi = pairEntry.deltaPhi(); - float deltaEta = pairEntry.deltaEta(); - float ptD = pairEntry.signedPtD(); - float ptHadron = pairEntry.signedPtHadron(); - float massD = pairEntry.mD(); - float bdtScorePrompt = pairEntry.mlScorePrompt(); - float bdtScoreBkg = pairEntry.mlScoreBkg(); - float trackDcaXY = pairEntry.trackDcaXY(); - float trackDcaZ = pairEntry.trackDcaZ(); + float const deltaEta = pairEntry.deltaEta(); + float const ptD = pairEntry.signedPtD(); + float const ptHadron = pairEntry.signedPtHadron(); + float const massD = pairEntry.mD(); + float const bdtScorePrompt = pairEntry.mlScorePrompt(); + float const bdtScoreBkg = pairEntry.mlScoreBkg(); + float const trackDcaXY = pairEntry.trackDcaXY(); + float const trackDcaZ = pairEntry.trackDcaZ(); int multPvContrib = pairEntry.numPvContrib(); - int trackTpcCrossedRows = pairEntry.trackTPCNClsCrossedRows(); - int poolBin = pairEntry.poolBin(); - int statusDsPrompt = static_cast(pairEntry.isPrompt()); - int statusPromptHadron = pairEntry.trackOrigin(); - int ptBinD = o2::analysis::findBin(binsPtD, std::abs(ptD)); - bool isPhysicalPrimary = pairEntry.isPhysicalPrimary(); + int const trackTpcCrossedRows = pairEntry.trackTPCNClsCrossedRows(); + int const poolBin = pairEntry.poolBin(); + int const statusDsPrompt = static_cast(pairEntry.isPrompt()); + int const statusPromptHadron = pairEntry.trackOrigin(); + int const ptBinD = o2::analysis::findBin(binsPtD, std::abs(ptD)); + bool const isPhysicalPrimary = pairEntry.isPhysicalPrimary(); if (!isSelectedCandidate(ptBinD, bdtScorePrompt, bdtScoreBkg)) { continue; @@ -629,13 +629,13 @@ struct HfTaskCorrelationDsHadrons { { for (const auto& pairEntry : pairEntries) { // define variables for widely used quantities - float deltaPhi = pairEntry.deltaPhi(); - float deltaEta = pairEntry.deltaEta(); - float ptD = pairEntry.signedPtD(); - float ptHadron = pairEntry.signedPtHadron(); - int poolBin = pairEntry.poolBin(); - int statusPromptHadron = pairEntry.trackOrigin(); - bool isDsPrompt = pairEntry.isPrompt(); + float const deltaPhi = pairEntry.deltaPhi(); + float const deltaEta = pairEntry.deltaEta(); + float const ptD = pairEntry.signedPtD(); + float const ptHadron = pairEntry.signedPtHadron(); + int const poolBin = pairEntry.poolBin(); + int const statusPromptHadron = pairEntry.trackOrigin(); + bool const isDsPrompt = pairEntry.isPrompt(); registry.fill(HIST("hCorrel2DVsPtMcGen"), deltaPhi, deltaEta, std::abs(ptD), std::abs(ptHadron), poolBin); registry.fill(HIST("hDeltaEtaPtIntMcGen"), deltaEta); @@ -660,18 +660,18 @@ struct HfTaskCorrelationDsHadrons { for (const auto& pairEntry : pairEntries) { // define variables for widely used quantities float deltaPhi = pairEntry.deltaPhi(); - float deltaEta = pairEntry.deltaEta(); - float ptD = pairEntry.signedPtD(); - float ptHadron = pairEntry.signedPtHadron(); - float massD = pairEntry.mD(); - float bdtScorePrompt = pairEntry.mlScorePrompt(); - float bdtScoreBkg = pairEntry.mlScoreBkg(); - float trackDcaXY = pairEntry.trackDcaXY(); - float trackDcaZ = pairEntry.trackDcaZ(); + float const deltaEta = pairEntry.deltaEta(); + float const ptD = pairEntry.signedPtD(); + float const ptHadron = pairEntry.signedPtHadron(); + float const massD = pairEntry.mD(); + float const bdtScorePrompt = pairEntry.mlScorePrompt(); + float const bdtScoreBkg = pairEntry.mlScoreBkg(); + float const trackDcaXY = pairEntry.trackDcaXY(); + float const trackDcaZ = pairEntry.trackDcaZ(); int multPvContrib = pairEntry.numPvContrib(); - int trackTpcCrossedRows = pairEntry.trackTPCNClsCrossedRows(); - int poolBin = pairEntry.poolBin(); - int ptBinD = o2::analysis::findBin(binsPtD, std::abs(ptD)); + int const trackTpcCrossedRows = pairEntry.trackTPCNClsCrossedRows(); + int const poolBin = pairEntry.poolBin(); + int const ptBinD = o2::analysis::findBin(binsPtD, std::abs(ptD)); if (!isSelectedCandidate(ptBinD, bdtScorePrompt, bdtScoreBkg)) { continue; @@ -745,13 +745,13 @@ struct HfTaskCorrelationDsHadrons { for (const auto& pairEntry : pairEntries) { // define variables for widely used quantities float deltaPhi = pairEntry.deltaPhi(); - float deltaEta = pairEntry.deltaEta(); - float ptD = pairEntry.signedPtD(); - float ptHadron = pairEntry.signedPtHadron(); - float massD = pairEntry.mD(); + float const deltaEta = pairEntry.deltaEta(); + float const ptD = pairEntry.signedPtD(); + float const ptHadron = pairEntry.signedPtHadron(); + float const massD = pairEntry.mD(); int multPvContrib = pairEntry.numPvContrib(); - int poolBin = pairEntry.poolBin(); - int ptBinD = o2::analysis::findBin(binsPtD, std::abs(ptD)); + int const poolBin = pairEntry.poolBin(); + int const ptBinD = o2::analysis::findBin(binsPtD, std::abs(ptD)); double efficiencyWeight = 1.; if (useHighDimHistoForEff) { @@ -818,21 +818,21 @@ struct HfTaskCorrelationDsHadrons { for (const auto& pairEntry : pairEntries) { // define variables for widely used quantities float deltaPhi = pairEntry.deltaPhi(); - float deltaEta = pairEntry.deltaEta(); - float ptD = pairEntry.signedPtD(); - float ptHadron = pairEntry.signedPtHadron(); - float massD = pairEntry.mD(); - float bdtScorePrompt = pairEntry.mlScorePrompt(); - float bdtScoreBkg = pairEntry.mlScoreBkg(); - float trackDcaXY = pairEntry.trackDcaXY(); - float trackDcaZ = pairEntry.trackDcaZ(); + float const deltaEta = pairEntry.deltaEta(); + float const ptD = pairEntry.signedPtD(); + float const ptHadron = pairEntry.signedPtHadron(); + float const massD = pairEntry.mD(); + float const bdtScorePrompt = pairEntry.mlScorePrompt(); + float const bdtScoreBkg = pairEntry.mlScoreBkg(); + float const trackDcaXY = pairEntry.trackDcaXY(); + float const trackDcaZ = pairEntry.trackDcaZ(); int multPvContrib = pairEntry.numPvContrib(); - int trackTpcCrossedRows = pairEntry.trackTPCNClsCrossedRows(); - int poolBin = pairEntry.poolBin(); - int statusDsPrompt = static_cast(pairEntry.isPrompt()); - int statusPromptHadron = pairEntry.trackOrigin(); - int ptBinD = o2::analysis::findBin(binsPtD, std::abs(ptD)); - bool isPhysicalPrimary = pairEntry.isPhysicalPrimary(); + int const trackTpcCrossedRows = pairEntry.trackTPCNClsCrossedRows(); + int const poolBin = pairEntry.poolBin(); + int const statusDsPrompt = static_cast(pairEntry.isPrompt()); + int const statusPromptHadron = pairEntry.trackOrigin(); + int const ptBinD = o2::analysis::findBin(binsPtD, std::abs(ptD)); + bool const isPhysicalPrimary = pairEntry.isPhysicalPrimary(); if (!isSelectedCandidate(ptBinD, bdtScorePrompt, bdtScoreBkg)) { continue; @@ -1150,7 +1150,7 @@ struct HfTaskCorrelationDsHadrons { } } if (separateTrackOrigins) { - int trackOrigin = RecoDecay::getCharmHadronOrigin(mcParticles, mcParticle, true); + int const trackOrigin = RecoDecay::getCharmHadronOrigin(mcParticles, mcParticle, true); if (trackOrigin == RecoDecay::OriginType::Prompt) { // charm orgin registry.fill(HIST("hPtPrmPromptPartMcGen"), mcParticle.pt()); } else if (trackOrigin == RecoDecay::OriginType::NonPrompt) { // beauty origin @@ -1203,7 +1203,7 @@ struct HfTaskCorrelationDsHadrons { } // check track origin if (separateTrackOrigins) { - int trackOrigin = RecoDecay::getCharmHadronOrigin(mcParticles, mcParticle, true); + int const trackOrigin = RecoDecay::getCharmHadronOrigin(mcParticles, mcParticle, true); if (trackOrigin == RecoDecay::OriginType::Prompt) { // charm orgin registry.fill(HIST("hPtPrmPromptPartMcRec"), track.pt()); } else if (trackOrigin == RecoDecay::OriginType::NonPrompt) { // beauty origin diff --git a/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx index 0a62f162630..0b354abecee 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx @@ -97,11 +97,11 @@ struct HfTaskCorrelationDstarHadrons { { auto axisPtDstar = (std::vector)binsPtEfficiency; - AxisSpec axisSpecPtDstar = {axisPtDstar}; - AxisSpec axisSpecDeltaPhi = {nBinsDeltaPhi, -o2::constants::math::PIHalf, 3. * o2::constants::math::PIHalf}; - AxisSpec axisSpecDeltaEta = {deltaEtaBinEdges}; - AxisSpec axisSpecPtHadron = {ptHadronBinsEdges}; - AxisSpec axisSpecPoolBin = {9, 0., 9.}; + AxisSpec const axisSpecPtDstar = {axisPtDstar}; + AxisSpec const axisSpecDeltaPhi = {nBinsDeltaPhi, -o2::constants::math::PIHalf, 3. * o2::constants::math::PIHalf}; + AxisSpec const axisSpecDeltaEta = {deltaEtaBinEdges}; + AxisSpec const axisSpecPtHadron = {ptHadronBinsEdges}; + AxisSpec const axisSpecPoolBin = {9, 0., 9.}; registry.add("hCorrel2DVsPtSignalRegion", stringDHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtD + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {axisSpecDeltaPhi, axisSpecDeltaEta, axisSpecPtDstar, axisSpecPtHadron, axisSpecPoolBin}}, true); registry.add("hCorrel2DPtIntSignalRegion", stringDHadron + stringSignal + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2D, {axisSpecDeltaPhi, axisSpecDeltaEta}}, true); @@ -116,16 +116,16 @@ struct HfTaskCorrelationDstarHadrons { void processData(aod::DstarHadronPair const& dstarHPairs) { for (const auto& dstarHPair : dstarHPairs) { - float deltaPhi = dstarHPair.deltaPhi(); - float deltaEta = dstarHPair.deltaEta(); - float ptDstar = dstarHPair.ptDstar(); - float ptTrack = dstarHPair.ptTrack(); - int poolBin = dstarHPair.poolBin(); - float deltaM = dstarHPair.deltaM(); - - int effBinPtDstar = o2::analysis::findBin(binsPtEfficiency, ptDstar); + float const deltaPhi = dstarHPair.deltaPhi(); + float const deltaEta = dstarHPair.deltaEta(); + float const ptDstar = dstarHPair.ptDstar(); + float const ptTrack = dstarHPair.ptTrack(); + int const poolBin = dstarHPair.poolBin(); + float const deltaM = dstarHPair.deltaM(); + + int const effBinPtDstar = o2::analysis::findBin(binsPtEfficiency, ptDstar); // LOG(info) << "efficiency index " << effBinPtDstar; - int corrBinPtDstar = o2::analysis::findBin(binsPtCorrelations, ptDstar); + int const corrBinPtDstar = o2::analysis::findBin(binsPtCorrelations, ptDstar); // LOG(info) << "correlation index " << corrBinPtDstar; // reject candidate if outside pT ranges of interst @@ -137,10 +137,10 @@ struct HfTaskCorrelationDstarHadrons { // ptTrack = 10.5; // } float netEfficiencyWeight = 1.0; - float efficiencyWeightTracks = 1.0; + float const efficiencyWeightTracks = 1.0; if (applyEfficiency) { - float efficiencyWeightDstar = efficiencyDstar->at(effBinPtDstar); + float const efficiencyWeightDstar = efficiencyDstar->at(effBinPtDstar); // LOG(info)<<"efficiencyWeightDstar "<)binsPtCorrelations, "#it{p}_{T}^{#Lambda_c} (GeV/#it{c})"}; AxisSpec axisPtLc = {(std::vector)binsPtEfficiencyLc, "#it{p}_{T}^{#Lambda_c} (GeV/#it{c})"}; - AxisSpec axisMultFT0M = {binsMultFT0M, "MultiplicityFT0M"}; + AxisSpec const axisMultFT0M = {binsMultFT0M, "MultiplicityFT0M"}; AxisSpec axisDeltaEta = {binsEta, "#it{#eta}^{Hadron}-#it{#eta}^{#Lambda_c}"}; AxisSpec axisDeltaPhi = {binsPhi, "#it{#varphi}^{Hadron}-#it{#varphi}^{#Lambda_c} (rad)"}; AxisSpec axisPtHadron = {(std::vector)binsPtHadron, "#it{p}_{T}^{Hadron} (GeV/#it{c})"}; AxisSpec axisPoolBin = {binsPoolBin, "poolBin"}; AxisSpec axisLcPrompt = {2, -0.5, 1.5, "Prompt #Lambda_c"}; - AxisSpec axisBdtScore = {binsBdtScore, "Bdt score"}; + AxisSpec const axisBdtScore = {binsBdtScore, "Bdt score"}; AxisSpec axisCorrelationState = {2, 0., 2., ""}; AxisSpec axisSignPair = {4, 1., 5.}; AxisSpec axisCentFT0M = {binsCentFt0m, "Centrality percentile (FT0M)"}; @@ -415,11 +415,11 @@ struct HfTaskCorrelationLcHadrons { void processData(LcHadronPairFullWithMl const& pairEntries, aod::LcRecoInfo const& candidates) { for (const auto& candidate : candidates) { - float massLc = candidate.mLc(); - float ptLc = std::abs(candidate.ptLc()); - float bdtScorePrompt = candidate.mlScorePrompt(); - float bdtScoreBkg = candidate.mlScoreBkg(); - int effBinLc = o2::analysis::findBin(binsPtEfficiencyLc, ptLc); + float const massLc = candidate.mLc(); + float const ptLc = std::abs(candidate.ptLc()); + float const bdtScorePrompt = candidate.mlScorePrompt(); + float const bdtScoreBkg = candidate.mlScoreBkg(); + int const effBinLc = o2::analysis::findBin(binsPtEfficiencyLc, ptLc); // reject entries outside Pt ranges of interest if (ptLc < binsPtEfficiencyLc->front() || ptLc > binsPtEfficiencyLc->back()) { @@ -444,24 +444,24 @@ struct HfTaskCorrelationLcHadrons { for (const auto& pairEntry : pairEntries) { // define variables for widely used quantities - float deltaPhi = pairEntry.deltaPhi(); + float const deltaPhi = pairEntry.deltaPhi(); float cent = 0.; if (useCentrality) { cent = pairEntry.cent(); } - float deltaEta = pairEntry.deltaEta(); - double ptLc = std::abs(pairEntry.ptLc()); - double ptHadron = std::abs(pairEntry.ptHadron()); - float bdtScorePrompt = pairEntry.mlScorePrompt(); - float bdtScoreBkg = pairEntry.mlScoreBkg(); - float trackDcaXY = pairEntry.trackDcaXY(); - float trackDcaZ = pairEntry.trackDcaZ(); - int trackTpcCrossedRows = pairEntry.trackTPCNClsCrossedRows(); - int poolBin = pairEntry.poolBin(); - double massLc = pairEntry.mLc(); - int effBinLc = o2::analysis::findBin(binsPtEfficiencyLc, ptLc); - int ptBinLc = o2::analysis::findBin(binsPtCorrelations, ptLc); - bool isAutoCorrelated = pairEntry.isAutoCorrelated(); + float const deltaEta = pairEntry.deltaEta(); + double const ptLc = std::abs(pairEntry.ptLc()); + double const ptHadron = std::abs(pairEntry.ptHadron()); + float const bdtScorePrompt = pairEntry.mlScorePrompt(); + float const bdtScoreBkg = pairEntry.mlScoreBkg(); + float const trackDcaXY = pairEntry.trackDcaXY(); + float const trackDcaZ = pairEntry.trackDcaZ(); + int const trackTpcCrossedRows = pairEntry.trackTPCNClsCrossedRows(); + int const poolBin = pairEntry.poolBin(); + double const massLc = pairEntry.mLc(); + int const effBinLc = o2::analysis::findBin(binsPtEfficiencyLc, ptLc); + int const ptBinLc = o2::analysis::findBin(binsPtCorrelations, ptLc); + bool const isAutoCorrelated = pairEntry.isAutoCorrelated(); int signPair = 0; // reject entries outside Pt ranges of interest if (ptBinLc < 0 || effBinLc < 0) { @@ -488,7 +488,7 @@ struct HfTaskCorrelationLcHadrons { if (ptHadron < leadingParticlePtMin) { continue; } - Region region = getRegion(deltaPhi); + Region const region = getRegion(deltaPhi); switch (region) { case Toward: registry.fill(HIST("hToward"), massLc, ptLc, isAutoCorrelated, efficiencyWeight); @@ -559,12 +559,12 @@ struct HfTaskCorrelationLcHadrons { soa::Join const& candidates) { for (const auto& candidate : candidates) { - float massLc = candidate.mLc(); - float ptLc = std::abs(candidate.ptLc()); - float bdtScorePrompt = candidate.mlScorePrompt(); - float bdtScoreBkg = candidate.mlScoreBkg(); - int effBinLc = o2::analysis::findBin(binsPtEfficiencyLc, ptLc); - bool isLcPrompt = candidate.isPrompt(); + float const massLc = candidate.mLc(); + float const ptLc = std::abs(candidate.ptLc()); + float const bdtScorePrompt = candidate.mlScorePrompt(); + float const bdtScoreBkg = candidate.mlScoreBkg(); + int const effBinLc = o2::analysis::findBin(binsPtEfficiencyLc, ptLc); + bool const isLcPrompt = candidate.isPrompt(); // reject entries outside pT ranges of interest if (ptLc < binsPtEfficiencyLc->front() || ptLc > binsPtEfficiencyLc->back()) { @@ -602,23 +602,23 @@ struct HfTaskCorrelationLcHadrons { for (const auto& pairEntry : pairEntries) { // define variables for widely used quantities - float deltaPhi = pairEntry.deltaPhi(); - float deltaEta = pairEntry.deltaEta(); - float ptLc = std::abs(pairEntry.ptLc()); - float ptHadron = std::abs(pairEntry.ptHadron()); - float massLc = pairEntry.mLc(); - float bdtScorePrompt = pairEntry.mlScorePrompt(); - float bdtScoreBkg = pairEntry.mlScoreBkg(); - bool isPhysicalPrimary = pairEntry.isPhysicalPrimary(); - float trackDcaXY = pairEntry.trackDcaXY(); - float trackDcaZ = pairEntry.trackDcaZ(); - int trackTpcCrossedRows = pairEntry.trackTPCNClsCrossedRows(); - int statusLcPrompt = static_cast(pairEntry.isPrompt()); - int statusPromptHadron = pairEntry.trackOrigin(); - int poolBin = pairEntry.poolBin(); - int effBinLc = o2::analysis::findBin(binsPtEfficiencyLc, ptLc); - int ptBinLc = o2::analysis::findBin(binsPtCorrelations, ptLc); - bool isAutoCorrelated = pairEntry.isAutoCorrelated(); + float const deltaPhi = pairEntry.deltaPhi(); + float const deltaEta = pairEntry.deltaEta(); + float const ptLc = std::abs(pairEntry.ptLc()); + float const ptHadron = std::abs(pairEntry.ptHadron()); + float const massLc = pairEntry.mLc(); + float const bdtScorePrompt = pairEntry.mlScorePrompt(); + float const bdtScoreBkg = pairEntry.mlScoreBkg(); + bool const isPhysicalPrimary = pairEntry.isPhysicalPrimary(); + float const trackDcaXY = pairEntry.trackDcaXY(); + float const trackDcaZ = pairEntry.trackDcaZ(); + int const trackTpcCrossedRows = pairEntry.trackTPCNClsCrossedRows(); + int const statusLcPrompt = static_cast(pairEntry.isPrompt()); + int const statusPromptHadron = pairEntry.trackOrigin(); + int const poolBin = pairEntry.poolBin(); + int const effBinLc = o2::analysis::findBin(binsPtEfficiencyLc, ptLc); + int const ptBinLc = o2::analysis::findBin(binsPtCorrelations, ptLc); + bool const isAutoCorrelated = pairEntry.isAutoCorrelated(); int signPair = 0; // reject entries outside pT ranges of interest @@ -653,7 +653,7 @@ struct HfTaskCorrelationLcHadrons { if (ptHadron < leadingParticlePtMin) { continue; } - Region region = getRegion(deltaPhi); + Region const region = getRegion(deltaPhi); switch (region) { case Toward: registry.fill(HIST("hTowardRec"), massLc, ptLc, isAutoCorrelated, efficiencyWeight); @@ -757,14 +757,14 @@ struct HfTaskCorrelationLcHadrons { { for (const auto& pairEntry : pairEntries) { // define variables for widely used quantities - float deltaPhi = pairEntry.deltaPhi(); - float deltaEta = pairEntry.deltaEta(); - float ptLc = std::abs(pairEntry.ptLc()); - float ptHadron = std::abs(pairEntry.ptHadron()); - int poolBin = pairEntry.poolBin(); - int statusPromptHadron = pairEntry.trackOrigin(); - bool isLcPrompt = pairEntry.isPrompt(); - bool isAutoCorrelated = pairEntry.isAutoCorrelated(); + float const deltaPhi = pairEntry.deltaPhi(); + float const deltaEta = pairEntry.deltaEta(); + float const ptLc = std::abs(pairEntry.ptLc()); + float const ptHadron = std::abs(pairEntry.ptHadron()); + int const poolBin = pairEntry.poolBin(); + int const statusPromptHadron = pairEntry.trackOrigin(); + bool const isLcPrompt = pairEntry.isPrompt(); + bool const isAutoCorrelated = pairEntry.isAutoCorrelated(); int signPair = 0; if (isTowardTransverseAway) { @@ -772,7 +772,7 @@ struct HfTaskCorrelationLcHadrons { if (ptHadron < leadingParticlePtMin) { continue; } - Region region = getRegion(deltaPhi); + Region const region = getRegion(deltaPhi); switch (region) { case Toward: registry.fill(HIST("hTowardRec"), o2::constants::physics::MassLambdaCPlus, ptLc, isAutoCorrelated); diff --git a/PWGHF/HFC/Tasks/taskFlow.cxx b/PWGHF/HFC/Tasks/taskFlow.cxx index 43c77693a0b..f3a74f14e79 100644 --- a/PWGHF/HFC/Tasks/taskFlow.cxx +++ b/PWGHF/HFC/Tasks/taskFlow.cxx @@ -453,16 +453,16 @@ struct HfTaskFlow { // Declaration of correlation containers and their respective axis // ========================= - std::vector corrAxis = {{axisDeltaEta, "#Delta#eta"}, - {axisPtAssoc, "p_{T} (GeV/c)"}, - {axisPtTrigger, "p_{T} (GeV/c)"}, - {axisMultiplicity, "multiplicity"}, - {axisDeltaPhi, "#Delta#varphi (rad)"}, - {axisVertex, "z-vtx (cm)"}}; - std::vector effAxis = {{axisEtaEfficiency, "#eta"}, - {axisPtEfficiency, "p_{T} (GeV/c)"}, - {axisVertexEfficiency, "z-vtx (cm)"}}; - std::vector userAxis = {{axisMass, "m_{inv} (GeV/c^{2})"}}; + std::vector const corrAxis = {{axisDeltaEta, "#Delta#eta"}, + {axisPtAssoc, "p_{T} (GeV/c)"}, + {axisPtTrigger, "p_{T} (GeV/c)"}, + {axisMultiplicity, "multiplicity"}, + {axisDeltaPhi, "#Delta#varphi (rad)"}, + {axisVertex, "z-vtx (cm)"}}; + std::vector const effAxis = {{axisEtaEfficiency, "#eta"}, + {axisPtEfficiency, "p_{T} (GeV/c)"}, + {axisVertexEfficiency, "z-vtx (cm)"}}; + std::vector const userAxis = {{axisMass, "m_{inv} (GeV/c^{2})"}}; fv0Det = o2::fv0::Geometry::instance(o2::fv0::Geometry::eUninitialized); @@ -708,7 +708,7 @@ struct HfTaskFlow { double getPhiFV0(unsigned int chno) const { int cellsInLeft[] = {0, 1, 2, 3, 8, 9, 10, 11, 16, 17, 18, 19, 24, 25, 26, 27, 32, 40, 33, 41, 34, 42, 35, 43}; - bool isChnoInLeft = std::find(std::begin(cellsInLeft), std::end(cellsInLeft), chno) != std::end(cellsInLeft); + bool const isChnoInLeft = std::find(std::begin(cellsInLeft), std::end(cellsInLeft), chno) != std::end(cellsInLeft); float offsetX, offsetY; if (isChnoInLeft) { offsetX = (*offsetFV0)[0].getX(); @@ -744,7 +744,7 @@ struct HfTaskFlow { double getEtaFV0(unsigned int chno) const { int cellsInLeft[] = {0, 1, 2, 3, 8, 9, 10, 11, 16, 17, 18, 19, 24, 25, 26, 27, 32, 40, 33, 41, 34, 42, 35, 43}; - bool isChnoInLeft = std::find(std::begin(cellsInLeft), std::end(cellsInLeft), chno) != std::end(cellsInLeft); + bool const isChnoInLeft = std::find(std::begin(cellsInLeft), std::end(cellsInLeft), chno) != std::end(cellsInLeft); float offsetX, offsetY, offsetZ; if (isChnoInLeft) { offsetX = (*offsetFV0)[0].getX(); @@ -983,9 +983,9 @@ struct HfTaskFlow { loopCounter++; - float eta1 = track1.eta(); - float pt1 = track1.pt(); - float phi1 = track1.phi(); + float const eta1 = track1.eta(); + float const pt1 = track1.pt(); + float const phi1 = track1.phi(); // TODO: add getter for NUE trigger efficiency here @@ -1100,8 +1100,8 @@ struct HfTaskFlow { } } - float eta2 = track2.eta(); - float pt2 = track2.pt(); + float const eta2 = track2.eta(); + float const pt2 = track2.pt(); float phi2 = track2.phi(); o2::math_utils::bringTo02Pi(phi2); @@ -1169,9 +1169,9 @@ struct HfTaskFlow { loopCounter++; - float eta1 = track1.eta(); - float pt1 = track1.pt(); - float phi1 = track1.phi(); + float const eta1 = track1.eta(); + float const pt1 = track1.pt(); + float const phi1 = track1.phi(); bool fillingHFcontainer = false; double invmass = 0; @@ -1253,8 +1253,8 @@ struct HfTaskFlow { } } - float eta2 = reassociatedMftTrack.eta(); - float pt2 = reassociatedMftTrack.pt(); + float const eta2 = reassociatedMftTrack.eta(); + float const pt2 = reassociatedMftTrack.pt(); float phi2 = reassociatedMftTrack.phi(); o2::math_utils::bringTo02Pi(phi2); @@ -1312,8 +1312,8 @@ struct HfTaskFlow { loopCounter++; - float eta1 = track1.eta(); - float pt1 = track1.pt(); + float const eta1 = track1.eta(); + float const pt1 = track1.pt(); float phi1 = track1.phi(); if constexpr (std::is_same_v) { o2::math_utils::bringTo02Pi(phi1); @@ -1488,8 +1488,8 @@ struct HfTaskFlow { } } - float eta1 = reassociatedMftTrack.eta(); - float pt1 = reassociatedMftTrack.pt(); + float const eta1 = reassociatedMftTrack.eta(); + float const pt1 = reassociatedMftTrack.pt(); float phi1 = reassociatedMftTrack.phi(); o2::math_utils::bringTo02Pi(phi1); @@ -1577,9 +1577,9 @@ struct HfTaskFlow { // The first one that I call "Data" should work for data and mc rec using BinningTypeData = FlexibleBinningPolicy, aod::collision::PosZ, decltype(getMultiplicity)>; - BinningTypeData binningWithTracksSize{{getMultiplicity}, {binsMixingVertex, binsMixingMultiplicity}, true}; + BinningTypeData const binningWithTracksSize{{getMultiplicity}, {binsMixingVertex, binsMixingMultiplicity}, true}; auto tracksTuple = std::make_tuple(tracks1, tracks2); - Pair pair{binningWithTracksSize, configTask.nMixedEvents, -1, collisions, tracksTuple, &cache}; + Pair const pair{binningWithTracksSize, configTask.nMixedEvents, -1, collisions, tracksTuple, &cache}; for (const auto& [collision1, tracks1, collision2, tracks2] : pair) { @@ -1610,7 +1610,7 @@ struct HfTaskFlow { }; using MixedBinning = FlexibleBinningPolicy, aod::collision::PosZ, decltype(getMultiplicity)>; - MixedBinning binningOnVtxAndMult{{getMultiplicity}, {binsMixingVertex, binsMixingMultiplicity}, true}; + MixedBinning const binningOnVtxAndMult{{getMultiplicity}, {binsMixingVertex, binsMixingMultiplicity}, true}; for (auto const& [collision1, collision2] : soa::selfCombinations(binningOnVtxAndMult, configTask.nMixedEvents, -1, collisions, collisions)) { @@ -1696,9 +1696,9 @@ struct HfTaskFlow { { using BinningTypeMcTruth = FlexibleBinningPolicy, aod::mccollision::PosZ, decltype(getPartsSize)>; - BinningTypeMcTruth binningWithTracksSize{{getPartsSize}, {binsMixingVertex, binsMixingMultiplicity}, true}; + BinningTypeMcTruth const binningWithTracksSize{{getPartsSize}, {binsMixingVertex, binsMixingMultiplicity}, true}; auto tracksTuple = std::make_tuple(tracks1, tracks2); - Pair pair{binningWithTracksSize, configTask.nMixedEvents, -1, mcCollisions, tracksTuple, &cache}; + Pair const pair{binningWithTracksSize, configTask.nMixedEvents, -1, mcCollisions, tracksTuple, &cache}; for (const auto& [collision1, tracks1, collision2, tracks2] : pair) { @@ -2273,7 +2273,7 @@ struct HfTaskFlow { { const auto multiplicity = mcCollision.multMCPVz(); - BinningPolicyBase<2> baseBinning{{axisVertex, axisMultiplicity}, true}; + BinningPolicyBase<2> const baseBinning{{axisVertex, axisMultiplicity}, true}; sameEventHfMc->fillEvent(multiplicity, CorrelationContainer::kCFStepAll); fillCorrelations(sameEventHfMc, CorrelationContainer::CFStep::kCFStepAll, mcParticles2Prong, mcParticles, multiplicity, mcCollision.posZ(), true); @@ -2290,7 +2290,7 @@ struct HfTaskFlow { { const auto multiplicity = mcCollision.multMCPVz(); - BinningPolicyBase<2> baseBinning{{axisVertex, axisMultiplicity}, true}; + BinningPolicyBase<2> const baseBinning{{axisVertex, axisMultiplicity}, true}; sameEventHfMc->fillEvent(multiplicity, CorrelationContainer::kCFStepAll); fillCorrelations(sameEventHfMc, CorrelationContainer::CFStep::kCFStepAll, mcParticles3Prong, mcParticles, multiplicity, mcCollision.posZ(), true); diff --git a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx index 76b66668fe7..0ffff07c55b 100644 --- a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx +++ b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx @@ -163,7 +163,7 @@ struct HfElectronSelectionWithTpcEmcal { void init(o2::framework::InitContext&) { - AxisSpec axisPosZ = {binsPosZ, "Pos Z"}; + AxisSpec const axisPosZ = {binsPosZ, "Pos Z"}; AxisSpec axisMass = {binsMass, "Mass (GeV/#it{c}^{2}); entries"}; AxisSpec axisPt = {binsPt, "#it{p_{T}}(GeV/#it{c})"}; AxisSpec axisEta = {binsEta, "#it{#eta}"}; @@ -315,16 +315,16 @@ struct HfElectronSelectionWithTpcEmcal { pdgE2 = kPositron; } - KFPTrack kfpTrack = createKFPTrackFromTrack(electron); - KFPTrack kfpAssociatedTrack = createKFPTrackFromTrack(pTrack); - KFParticle kfTrack(kfpTrack, pdgE1); - KFParticle kfAssociatedTrack(kfpAssociatedTrack, pdgE2); + KFPTrack const kfpTrack = createKFPTrackFromTrack(electron); + KFPTrack const kfpAssociatedTrack = createKFPTrackFromTrack(pTrack); + KFParticle const kfTrack(kfpTrack, pdgE1); + KFParticle const kfAssociatedTrack(kfpAssociatedTrack, pdgE2); const KFParticle* electronPairs[2] = {&kfTrack, &kfAssociatedTrack}; kfNonHfe.SetConstructMethod(2); kfNonHfe.Construct(electronPairs, 2); - int ndf = kfNonHfe.GetNDF(); - double chi2recg = kfNonHfe.GetChi2() / ndf; + int const ndf = kfNonHfe.GetNDF(); + double const chi2recg = kfNonHfe.GetChi2() / ndf; if (ndf < 1.0) { continue; } @@ -452,7 +452,7 @@ struct HfElectronSelectionWithTpcEmcal { float deltaPhiMatch = -999.; float deltaEtaMatch = -999.; float eop = -999; - bool isEMcal = false; + bool const isEMcal = false; float trackRapidity = track.rapidity(MassElectron); diff --git a/PWGHF/HFL/TableProducer/treeCreatorElectronDCA.cxx b/PWGHF/HFL/TableProducer/treeCreatorElectronDCA.cxx index 8f462ae24e6..acd38174698 100644 --- a/PWGHF/HFL/TableProducer/treeCreatorElectronDCA.cxx +++ b/PWGHF/HFL/TableProducer/treeCreatorElectronDCA.cxx @@ -117,7 +117,7 @@ struct HfTreeCreatorElectronDCA { auto motherTracks = mcTrack.mothers_as(); int numberOfMothers = motherTracks.size(); // Categorise the electron sources - int firstMotherPDG = motherTracks[0].pdgCode(); + int const firstMotherPDG = motherTracks[0].pdgCode(); if (firstMotherPDG == kGamma) { isConversion = true; } diff --git a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx index 8a3aed908c1..b3fda8eb2f5 100644 --- a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx +++ b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx @@ -304,19 +304,19 @@ struct HfTaskElectronWeakBoson { { double energySum = 0.0; double isoEnergy = 10.0; - double etaAssCluster = cluster.eta(); - double phiAssCluster = cluster.phi(); + double const etaAssCluster = cluster.eta(); + double const phiAssCluster = cluster.phi(); for (const auto& associateCluster : clusters) { // Calculate angular distances - double dEta = associateCluster.eta() - etaAssCluster; + double const dEta = associateCluster.eta() - etaAssCluster; double dPhi = associateCluster.phi() - phiAssCluster; // Normalize φ difference dPhi = RecoDecay::constrainAngle(dPhi, -o2::constants::math::PI); // Calculate ΔR - double deltaR = std::sqrt(dEta * dEta + dPhi * dPhi); + double const deltaR = std::sqrt(dEta * dEta + dPhi * dPhi); // Sum energy within isolation cone if (deltaR < rIsolation) { @@ -344,11 +344,11 @@ struct HfTaskElectronWeakBoson { for (const auto& track : tracks) { - double dEta = track.eta() - etaEle; + double const dEta = track.eta() - etaEle; double dPhi = track.phi() - phiEle; dPhi = RecoDecay::constrainAngle(dPhi, -o2::constants::math::PI); - double deltaR = std::sqrt(dEta * dEta + dPhi * dPhi); + double const deltaR = std::sqrt(dEta * dEta + dPhi * dPhi); if (deltaR < rIsolation) { trackCount++; @@ -390,12 +390,12 @@ struct HfTaskElectronWeakBoson { pdgAss = kPositron; } - KFPTrack kfpTrackAssEle = createKFPTrackFromTrack(track); - KFParticle kfpAssEle(kfpTrackAssEle, pdgAss); + KFPTrack const kfpTrackAssEle = createKFPTrackFromTrack(track); + KFParticle const kfpAssEle(kfpTrackAssEle, pdgAss); // reco by RecoDecay auto child1 = RecoDecayPtEtaPhi::pVector(kfpIsoEle.GetPt() * correctionPtElectron, kfpIsoEle.GetEta(), kfpIsoEle.GetPhi()); auto child2 = RecoDecayPtEtaPhi::pVector(kfpAssEle.GetPt() * correctionPtElectron, kfpAssEle.GetEta(), kfpAssEle.GetPhi()); - double invMassEE = RecoDecay::m(std::array{child1, child2}, std::array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron}); + double const invMassEE = RecoDecay::m(std::array{child1, child2}, std::array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron}); registry.fill(HIST("hInvMassZee"), centrality, track.sign() * charge, kfpIsoEle.GetPt(), invMassEE); @@ -405,7 +405,7 @@ struct HfTaskElectronWeakBoson { zeeKF.SetConstructMethod(kfConstructMethod); zeeKF.Construct(electronPairs, 2); // LOG(info) << "Invarimass cal by KF particle Chi2/NDF = " << zeeKF.GetChi2()/zeeKF.GetNDF(); - float chiSqNdf = zeeKF.GetChi2() / zeeKF.GetNDF(); + float const chiSqNdf = zeeKF.GetChi2() / zeeKF.GetNDF(); if (zeeKF.GetNDF() < 1) { continue; } @@ -442,8 +442,8 @@ struct HfTaskElectronWeakBoson { // Get BC for this collision auto bc = collision.bc_as(); - uint64_t globalBC = bc.globalBC(); - int runNumber = bc.runNumber(); + uint64_t const globalBC = bc.globalBC(); + int const runNumber = bc.runNumber(); // Initialize Zorro for the first event (once per run) static bool isFirstEvent = true; @@ -451,7 +451,7 @@ struct HfTaskElectronWeakBoson { if ((isFirstEvent || runNumber != lastRunNumber) && cfgSkimmedProcessing) { LOGF(info, "Initializing Zorro for run %d", runNumber); - uint64_t currentTimestamp = bc.timestamp(); + uint64_t const currentTimestamp = bc.timestamp(); // debug for timestamp LOGF(info, "Using CCDB path: %s, timestamp: %llu", cfgCCDBPath.value.c_str(), currentTimestamp); @@ -464,7 +464,7 @@ struct HfTaskElectronWeakBoson { // initialize magnetic field auto* grpo = ccdb->getForTimeStamp(ccdbPathGrpMag, currentTimestamp); o2::base::Propagator::initFieldFromGRP(grpo); - double magneticField = o2::base::Propagator::Instance()->getNominalBz(); + double const magneticField = o2::base::Propagator::Instance()->getNominalBz(); LOG(info) << "magneticField = " << magneticField; if (magneticField != 0.0) { KFParticle::SetField(magneticField); @@ -590,24 +590,24 @@ struct HfTaskElectronWeakBoson { continue; } - float m02Emc = match.emcalcluster_as().m02(); - float energyEmc = match.emcalcluster_as().energy(); - double phiEmc = match.emcalcluster_as().phi(); - double etaEmc = match.emcalcluster_as().eta(); - double timeEmc = match.emcalcluster_as().time(); + float const m02Emc = match.emcalcluster_as().m02(); + float const energyEmc = match.emcalcluster_as().energy(); + double const phiEmc = match.emcalcluster_as().phi(); + double const etaEmc = match.emcalcluster_as().eta(); + double const timeEmc = match.emcalcluster_as().time(); // LOG(info) << "tr phi0 = " << match.track_as().phi(); // LOG(info) << "tr phi1 = " << track.phi(); // LOG(info) << "emc phi = " << phiEmc; if (nMatch == 0) { - double dEta = match.track_as().trackEtaEmcal() - etaEmc; + double const dEta = match.track_as().trackEtaEmcal() - etaEmc; double dPhi = match.track_as().trackPhiEmcal() - phiEmc; dPhi = RecoDecay::constrainAngle(dPhi, -o2::constants::math::PI); registry.fill(HIST("hMatchPhi"), phiEmc, match.track_as().trackPhiEmcal()); registry.fill(HIST("hMatchEta"), etaEmc, match.track_as().trackEtaEmcal()); - double r = RecoDecay::sqrtSumOfSquares(dPhi, dEta); + double const r = RecoDecay::sqrtSumOfSquares(dPhi, dEta); // LOG(info) << "r match = " << r; if (r < rMin) { rMin = r; @@ -658,8 +658,8 @@ struct HfTaskElectronWeakBoson { if (match.track_as().sign() > 0) { pdgIso = kPositron; } - KFPTrack kfpTrackIsoEle = createKFPTrackFromTrack(match.track_as()); - KFParticle kfpIsoEle(kfpTrackIsoEle, pdgIso); + KFPTrack const kfpTrackIsoEle = createKFPTrackFromTrack(match.track_as()); + KFParticle const kfpIsoEle(kfpTrackIsoEle, pdgIso); recoMassZee(kfpIsoEle, match.track_as().sign(), centrality, tracks); } // end of pt cut for e from Z @@ -724,8 +724,8 @@ struct HfTaskElectronWeakBoson { continue; } // calculate Z-h correlation - double deltaPhi = RecoDecay::constrainAngle(trackAss.phi - zBoson.phi, -o2::constants::math::PIHalf); - double ptRatio = trackAss.pt / zBoson.pt; + double const deltaPhi = RecoDecay::constrainAngle(trackAss.phi - zBoson.phi, -o2::constants::math::PIHalf); + double const ptRatio = trackAss.pt / zBoson.pt; registry.fill(HIST("hZHadronDphi"), centrality, zBoson.charge, zBoson.pt, deltaPhi, ptRatio, trackAss.pt); } } @@ -737,10 +737,10 @@ struct HfTaskElectronWeakBoson { for (const auto& trackPos : selectedPositronsIso) { auto child1 = RecoDecayPtEtaPhi::pVector(trackEle.pt, trackEle.eta, trackEle.phi); auto child2 = RecoDecayPtEtaPhi::pVector(trackPos.pt, trackPos.eta, trackPos.phi); - double invMass = RecoDecay::m(std::array{child1, child2}, std::array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron}); + double const invMass = RecoDecay::m(std::array{child1, child2}, std::array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron}); if (invMass > massZMinQA) { - float sectorneg = trackEle.phi / o2::constants::math::SectorSpanRad; - float sectorpos = trackPos.phi / o2::constants::math::SectorSpanRad; + float const sectorneg = trackEle.phi / o2::constants::math::SectorSpanRad; + float const sectorpos = trackPos.phi / o2::constants::math::SectorSpanRad; // LOG(info) << "TPC sector= " << sectorneg << " ; " << sectorpos; registry.fill(HIST("hInvMassZeeQA"), invMass, trackEle.pt, trackPos.pt, trackEle.dcaxyTrk, trackPos.dcaxyTrk, trackPos.dcazTrk, trackEle.nclusterTPC, trackPos.nclusterTPC, trackEle.nclusterITS, trackPos.nclusterITS, sectorneg, sectorpos, trackEle.eop, trackPos.eop, trackEle.energyIso, trackPos.energyIso, trackEle.momIso, trackPos.momIso, trackEle.ntrackIso, trackPos.ntrackIso); } diff --git a/PWGHF/HFL/Tasks/taskMuonCharmBeautySeparation.cxx b/PWGHF/HFL/Tasks/taskMuonCharmBeautySeparation.cxx index 355465f8c9f..818928f5055 100644 --- a/PWGHF/HFL/Tasks/taskMuonCharmBeautySeparation.cxx +++ b/PWGHF/HFL/Tasks/taskMuonCharmBeautySeparation.cxx @@ -35,19 +35,19 @@ struct HfTaskMuonCharmBeautySeparation { void init(InitContext&) { - AxisSpec trackTypeAxis = {6, -0.5, 5.5, "Track Type"}; - AxisSpec ptRecoAxis = {1500, 0, 15, "#it{p}_{T}_{Reco}"}; - AxisSpec dcaxAxis = {1000, -5.0, 5.0, "DCA {x or y} (cm)"}; - AxisSpec dcaAxis = {1000, 0.0, 100.0, "DCA {xy} (cm)"}; - AxisSpec zvtxAxis = {400, -20.0, 20.0, "zvtx (cm)"}; - AxisSpec etaRecoAxis = {150, -5, -2, "#eta_{Reco}"}; - AxisSpec rAbsAxis = {100, 0, 100, "R_{abs}"}; - AxisSpec pdcaAxis = {450, 0, 450, "p_{DCA}"}; - AxisSpec chi2GlobalAxis = {170, -1.5, 150.5, "#chi^{2} global"}; - AxisSpec chi2MCHMFTAxis = {170, -1.5, 150.5, "#chi^{2} MCH-MFT"}; - AxisSpec chi2MCHMIDAxis = {170, -1.5, 150.5, "#chi^{2} MCH-MID"}; + AxisSpec const trackTypeAxis = {6, -0.5, 5.5, "Track Type"}; + AxisSpec const ptRecoAxis = {1500, 0, 15, "#it{p}_{T}_{Reco}"}; + AxisSpec const dcaxAxis = {1000, -5.0, 5.0, "DCA {x or y} (cm)"}; + AxisSpec const dcaAxis = {1000, 0.0, 100.0, "DCA {xy} (cm)"}; + AxisSpec const zvtxAxis = {400, -20.0, 20.0, "zvtx (cm)"}; + AxisSpec const etaRecoAxis = {150, -5, -2, "#eta_{Reco}"}; + AxisSpec const rAbsAxis = {100, 0, 100, "R_{abs}"}; + AxisSpec const pdcaAxis = {450, 0, 450, "p_{DCA}"}; + AxisSpec const chi2GlobalAxis = {170, -1.5, 150.5, "#chi^{2} global"}; + AxisSpec const chi2MCHMFTAxis = {170, -1.5, 150.5, "#chi^{2} MCH-MFT"}; + AxisSpec const chi2MCHMIDAxis = {170, -1.5, 150.5, "#chi^{2} MCH-MID"}; - HistogramConfigSpec histVariable({HistType::kTHnSparseF, {ptRecoAxis, dcaxAxis, dcaxAxis, dcaAxis, zvtxAxis}}); + HistogramConfigSpec const histVariable({HistType::kTHnSparseF, {ptRecoAxis, dcaxAxis, dcaxAxis, dcaAxis, zvtxAxis}}); registry.add("hBasicDist", "", histVariable); registry.add("hTrackType", "hTrackType", {HistType::kTH1F, {trackTypeAxis}}); registry.add("hZvtx", "Zvtx in cm", {HistType::kTH1F, {zvtxAxis}}); diff --git a/PWGHF/HFL/Tasks/taskSingleElectron.cxx b/PWGHF/HFL/Tasks/taskSingleElectron.cxx index 5315b8513fc..b53043cff80 100644 --- a/PWGHF/HFL/Tasks/taskSingleElectron.cxx +++ b/PWGHF/HFL/Tasks/taskSingleElectron.cxx @@ -424,7 +424,7 @@ struct HfTaskSingleElectron { void processData(soa::Filtered::iterator const& collision, TracksEl const& tracks) { - float flagAnalysedEvt = 0.5; + float const flagAnalysedEvt = 0.5; if (!collision.sel8()) { return; @@ -483,7 +483,7 @@ struct HfTaskSingleElectron { McTracksEl const& tracks, aod::McParticles const&) { - float flagAnalysedEvt = 0.5; + float const flagAnalysedEvt = 0.5; if (!collision.sel8()) { return; @@ -517,7 +517,7 @@ struct HfTaskSingleElectron { int mpdg; // electron source pdg code double mpt; // electron source pt - int source = getElecSource(track, mpt, mpdg); + int const source = getElecSource(track, mpt, mpdg); if (source == DirectBeauty || source == BeautyCharm) { histos.fill(HIST("hPdgB"), mpdg); diff --git a/PWGHF/HFL/Tasks/taskSingleMuon.cxx b/PWGHF/HFL/Tasks/taskSingleMuon.cxx index 9b38f3f45a6..95c6e6d70e8 100644 --- a/PWGHF/HFL/Tasks/taskSingleMuon.cxx +++ b/PWGHF/HFL/Tasks/taskSingleMuon.cxx @@ -88,24 +88,24 @@ struct HfTaskSingleMuon { void init(InitContext&) { - AxisSpec axisPt{200, 0., 200., "#it{p}_{T} (GeV/#it{c})"}; - AxisSpec axisEta{250, -5., 0., "#it{#eta}"}; - AxisSpec axisDCA{500, 0., 5., "#it{DCA}_{xy} (cm)"}; - AxisSpec axisChi2MatchMCHMFT{100, 0., 100., "MCH-MFT matching #chi^{2}"}; - AxisSpec axisSign{5, -2.5, 2.5, "Charge"}; - AxisSpec axisPDca{100000, 0, 100000, "#it{p} #times DCA (GeV/#it{c} * cm)"}; - AxisSpec axisVtxZ{80, -20., 20., "#it{z}_{vtx} (cm)"}; - AxisSpec axisDCAx{1000, -5., 5., "#it{DCA}_{x or y} (cm)"}; - AxisSpec axisPtDif{200, -2., 2., "#it{p}_{T} diff (GeV/#it{c})"}; - AxisSpec axisEtaDif{200, -2., 2., "#it{#eta} diff"}; - AxisSpec axisDeltaPt{60, -30, 30, "#Delta #it{p}_{T} (GeV/#it{c})"}; + AxisSpec const axisPt{200, 0., 200., "#it{p}_{T} (GeV/#it{c})"}; + AxisSpec const axisEta{250, -5., 0., "#it{#eta}"}; + AxisSpec const axisDCA{500, 0., 5., "#it{DCA}_{xy} (cm)"}; + AxisSpec const axisChi2MatchMCHMFT{100, 0., 100., "MCH-MFT matching #chi^{2}"}; + AxisSpec const axisSign{5, -2.5, 2.5, "Charge"}; + AxisSpec const axisPDca{100000, 0, 100000, "#it{p} #times DCA (GeV/#it{c} * cm)"}; + AxisSpec const axisVtxZ{80, -20., 20., "#it{z}_{vtx} (cm)"}; + AxisSpec const axisDCAx{1000, -5., 5., "#it{DCA}_{x or y} (cm)"}; + AxisSpec const axisPtDif{200, -2., 2., "#it{p}_{T} diff (GeV/#it{c})"}; + AxisSpec const axisEtaDif{200, -2., 2., "#it{#eta} diff"}; + AxisSpec const axisDeltaPt{60, -30, 30, "#Delta #it{p}_{T} (GeV/#it{c})"}; - HistogramConfigSpec hTHnMu{HistType::kTHnSparseF, {axisPt, axisEta, axisDCA, axisPDca, axisSign, axisChi2MatchMCHMFT}, 6}; - HistogramConfigSpec h2PtMc{HistType::kTH2F, {axisPt, axisPtDif}}; - HistogramConfigSpec h2EtaMc{HistType::kTH2F, {axisEta, axisEtaDif}}; - HistogramConfigSpec h2DCA{HistType::kTH2F, {axisDCAx, axisDCAx}}; - HistogramConfigSpec h3DeltaPt{HistType::kTH3F, {axisPt, axisEta, axisDeltaPt}}; - HistogramConfigSpec hVtxZ{HistType::kTH1F, {axisVtxZ}}; + HistogramConfigSpec const hTHnMu{HistType::kTHnSparseF, {axisPt, axisEta, axisDCA, axisPDca, axisSign, axisChi2MatchMCHMFT}, 6}; + HistogramConfigSpec const h2PtMc{HistType::kTH2F, {axisPt, axisPtDif}}; + HistogramConfigSpec const h2EtaMc{HistType::kTH2F, {axisEta, axisEtaDif}}; + HistogramConfigSpec const h2DCA{HistType::kTH2F, {axisDCAx, axisDCAx}}; + HistogramConfigSpec const h3DeltaPt{HistType::kTH3F, {axisPt, axisEta, axisDeltaPt}}; + HistogramConfigSpec const hVtxZ{HistType::kTH1F, {axisVtxZ}}; registry.add("hMuBeforeCuts", "", hTHnMu); registry.add("hMuAfterCuts", "", hTHnMu); diff --git a/PWGHF/HFL/Tasks/taskSingleMuonMult.cxx b/PWGHF/HFL/Tasks/taskSingleMuonMult.cxx index b51635dda6b..f755dfac5e2 100644 --- a/PWGHF/HFL/Tasks/taskSingleMuonMult.cxx +++ b/PWGHF/HFL/Tasks/taskSingleMuonMult.cxx @@ -88,25 +88,25 @@ struct HfTaskSingleMuonMult { void init(InitContext&) { - AxisSpec axisCent = {101, -0.5, 100.5, "centrality"}; - AxisSpec axisEvent{NEventSelection, 0, NEventSelection, "Event Selection"}; - AxisSpec axisVtxZ{80, -20., 20., "#it{z}_{vtx} (cm)"}; - AxisSpec axisMuon{NMuonSelection, 0, NMuonSelection, "Muon Selection"}; - AxisSpec axisNCh{500, 0.5, 500.5, "#it{N}_{ch}"}; - AxisSpec axisNMu{20, -0.5, 19.5, "#it{N}_{#mu}"}; - AxisSpec axisPt{1000, 0., 500., "#it{p}_{T} (GeV/#it{c})"}; - AxisSpec axisEta{250, -5., 5., "#it{#eta}"}; - AxisSpec axisTheta{500, 170., 180., "#it{#theta}"}; - AxisSpec axisRAbsorb{1000, 0., 100., "#it{R}_{Absorb} (cm)"}; - AxisSpec axisDCA{500, 0., 5., "#it{DCA}_{xy} (cm)"}; - AxisSpec axisChi2MatchMCHMFT{1000, 0., 1000., "MCH-MFT matching #chi^{2}"}; - AxisSpec axisSign{5, -2.5, 2.5, "Charge"}; - AxisSpec axisPDca{100000, 0, 100000, "#it{p} #times DCA (GeV/#it{c} * cm)"}; - AxisSpec axisDCAx{1000, -5., 5., "#it{DCA}_{x or y} (cm)"}; - AxisSpec axisEtaDif{200, -2., 2., "#it{#eta} diff"}; - AxisSpec axisDeltaPt{10000, -50, 50, "#Delta #it{p}_{T} (GeV/#it{c})"}; - AxisSpec axisTrackType{8, -1.5, 6.5, "TrackType"}; - AxisSpec axisPtDif{200, -2., 2., "#it{p}_{T} diff (GeV/#it{c})"}; + AxisSpec const axisCent = {101, -0.5, 100.5, "centrality"}; + AxisSpec const axisEvent{NEventSelection, 0, NEventSelection, "Event Selection"}; + AxisSpec const axisVtxZ{80, -20., 20., "#it{z}_{vtx} (cm)"}; + AxisSpec const axisMuon{NMuonSelection, 0, NMuonSelection, "Muon Selection"}; + AxisSpec const axisNCh{500, 0.5, 500.5, "#it{N}_{ch}"}; + AxisSpec const axisNMu{20, -0.5, 19.5, "#it{N}_{#mu}"}; + AxisSpec const axisPt{1000, 0., 500., "#it{p}_{T} (GeV/#it{c})"}; + AxisSpec const axisEta{250, -5., 5., "#it{#eta}"}; + AxisSpec const axisTheta{500, 170., 180., "#it{#theta}"}; + AxisSpec const axisRAbsorb{1000, 0., 100., "#it{R}_{Absorb} (cm)"}; + AxisSpec const axisDCA{500, 0., 5., "#it{DCA}_{xy} (cm)"}; + AxisSpec const axisChi2MatchMCHMFT{1000, 0., 1000., "MCH-MFT matching #chi^{2}"}; + AxisSpec const axisSign{5, -2.5, 2.5, "Charge"}; + AxisSpec const axisPDca{100000, 0, 100000, "#it{p} #times DCA (GeV/#it{c} * cm)"}; + AxisSpec const axisDCAx{1000, -5., 5., "#it{DCA}_{x or y} (cm)"}; + AxisSpec const axisEtaDif{200, -2., 2., "#it{#eta} diff"}; + AxisSpec const axisDeltaPt{10000, -50, 50, "#Delta #it{p}_{T} (GeV/#it{c})"}; + AxisSpec const axisTrackType{8, -1.5, 6.5, "TrackType"}; + AxisSpec const axisPtDif{200, -2., 2., "#it{p}_{T} diff (GeV/#it{c})"}; registry.add("hCentrality", "Centrality Percentile", {HistType::kTH1F, {axisCent}}); registry.add("hEventSel", " Number of Events", {HistType::kTH1F, {axisEvent}}); diff --git a/PWGHF/HFL/Tasks/taskSingleMuonReader.cxx b/PWGHF/HFL/Tasks/taskSingleMuonReader.cxx index 4ffad84b25f..0db3d4a3350 100644 --- a/PWGHF/HFL/Tasks/taskSingleMuonReader.cxx +++ b/PWGHF/HFL/Tasks/taskSingleMuonReader.cxx @@ -69,17 +69,17 @@ struct HfTaskSingleMuonReader { void init(InitContext&) { - AxisSpec axisPt{200, 0., 100., "#it{p}_{T} (GeV/#it{c})"}; - AxisSpec axisEta{100, -4., -2., "#it{#eta}"}; - AxisSpec axisDCA{2000, 0., 2., "#it{DCA}_{xy} (cm)"}; - AxisSpec axisChi2MatchMCHMFT{100, 0., 100., "MCH-MFT matching #chi^{2}"}; - AxisSpec axisSign{5, -2.5, 2.5, "Charge"}; - AxisSpec axisRabs{1000, 0, 100, "R at Absorber End (cm)"}; - AxisSpec axisDeltaPt{10000, -50, 50, "#Delta #it{p}_{T} (GeV/#it{c})"}; - AxisSpec axisVtxZ{80, -20., 20., "#it{z}_{vtx} (cm)"}; - - HistogramConfigSpec hTHnMu{HistType::kTHnSparseF, {axisPt, axisEta, axisDCA, axisRabs, axisSign, axisChi2MatchMCHMFT, axisDeltaPt}, 7}; - HistogramConfigSpec hVtxZ{HistType::kTH1F, {axisVtxZ}}; + AxisSpec const axisPt{200, 0., 100., "#it{p}_{T} (GeV/#it{c})"}; + AxisSpec const axisEta{100, -4., -2., "#it{#eta}"}; + AxisSpec const axisDCA{2000, 0., 2., "#it{DCA}_{xy} (cm)"}; + AxisSpec const axisChi2MatchMCHMFT{100, 0., 100., "MCH-MFT matching #chi^{2}"}; + AxisSpec const axisSign{5, -2.5, 2.5, "Charge"}; + AxisSpec const axisRabs{1000, 0, 100, "R at Absorber End (cm)"}; + AxisSpec const axisDeltaPt{10000, -50, 50, "#Delta #it{p}_{T} (GeV/#it{c})"}; + AxisSpec const axisVtxZ{80, -20., 20., "#it{z}_{vtx} (cm)"}; + + HistogramConfigSpec const hTHnMu{HistType::kTHnSparseF, {axisPt, axisEta, axisDCA, axisRabs, axisSign, axisChi2MatchMCHMFT, axisDeltaPt}, 7}; + HistogramConfigSpec const hVtxZ{HistType::kTH1F, {axisVtxZ}}; registry.add("hMuAfterCuts", "", hTHnMu); if (fillMcHist) { diff --git a/PWGHF/HFL/Tasks/taskSingleMuonReaderAssoc.cxx b/PWGHF/HFL/Tasks/taskSingleMuonReaderAssoc.cxx index 5ba3915dc9d..1185268b0a6 100644 --- a/PWGHF/HFL/Tasks/taskSingleMuonReaderAssoc.cxx +++ b/PWGHF/HFL/Tasks/taskSingleMuonReaderAssoc.cxx @@ -62,17 +62,17 @@ struct HfTaskSingleMuonReaderAssoc { void init(InitContext&) { - AxisSpec axisPt{200, 0., 100., "#it{p}_{T} (GeV/#it{c})"}; - AxisSpec axisEta{100, -4., -2., "#it{#eta}"}; - AxisSpec axisDCA{2000, 0., 2., "#it{DCA}_{xy} (cm)"}; - AxisSpec axisChi2MatchMCHMFT{100, 0., 100., "MCH-MFT matching #chi^{2}"}; - AxisSpec axisSign{5, -2.5, 2.5, "Charge"}; - AxisSpec axisRabs{1000, 0, 100, "R at Absorber End (cm)"}; - AxisSpec axisDeltaPt{10000, -50, 50, "#Delta #it{p}_{T} (GeV/#it{c})"}; - AxisSpec axisVtxZ{80, -20., 20., "#it{z}_{vtx} (cm)"}; - - HistogramConfigSpec hTHnMu{HistType::kTHnSparseF, {axisPt, axisEta, axisDCA, axisRabs, axisSign, axisChi2MatchMCHMFT, axisDeltaPt}, 7}; - HistogramConfigSpec hVtxZ{HistType::kTH1F, {axisVtxZ}}; + AxisSpec const axisPt{200, 0., 100., "#it{p}_{T} (GeV/#it{c})"}; + AxisSpec const axisEta{100, -4., -2., "#it{#eta}"}; + AxisSpec const axisDCA{2000, 0., 2., "#it{DCA}_{xy} (cm)"}; + AxisSpec const axisChi2MatchMCHMFT{100, 0., 100., "MCH-MFT matching #chi^{2}"}; + AxisSpec const axisSign{5, -2.5, 2.5, "Charge"}; + AxisSpec const axisRabs{1000, 0, 100, "R at Absorber End (cm)"}; + AxisSpec const axisDeltaPt{10000, -50, 50, "#Delta #it{p}_{T} (GeV/#it{c})"}; + AxisSpec const axisVtxZ{80, -20., 20., "#it{z}_{vtx} (cm)"}; + + HistogramConfigSpec const hTHnMu{HistType::kTHnSparseF, {axisPt, axisEta, axisDCA, axisRabs, axisSign, axisChi2MatchMCHMFT, axisDeltaPt}, 7}; + HistogramConfigSpec const hVtxZ{HistType::kTH1F, {axisVtxZ}}; registry.add("hMuAfterCuts", "", hTHnMu); if (fillMcHist) { diff --git a/PWGHF/HFL/Tasks/taskSingleMuonSource.cxx b/PWGHF/HFL/Tasks/taskSingleMuonSource.cxx index 3f577ce0034..20c3db63117 100644 --- a/PWGHF/HFL/Tasks/taskSingleMuonSource.cxx +++ b/PWGHF/HFL/Tasks/taskSingleMuonSource.cxx @@ -103,17 +103,17 @@ struct HfTaskSingleMuonSource { "Hadron", "Unidentified"}; - AxisSpec axisColNumber{1, 0.5, 1.5, "Selected collisions"}; - AxisSpec axisDCA{5000, 0., 5., "DCA (cm)"}; - AxisSpec axisChi2{500, 0., 100., "#chi^{2} of MCH-MFT matching"}; - AxisSpec axisPt{200, 0., 100., "#it{p}_{T,reco} (GeV/#it{c})"}; - AxisSpec axisDeltaPt{1000, -50., 50., "#Delta #it{p}_{T} (GeV/#it{c})"}; - - HistogramConfigSpec h1ColNumber{HistType::kTH1F, {axisColNumber}}; - HistogramConfigSpec h1Pt{HistType::kTH1F, {axisPt}}; - HistogramConfigSpec h2PtDCA{HistType::kTH2F, {axisPt, axisDCA}}; - HistogramConfigSpec h2PtChi2{HistType::kTH2F, {axisPt, axisChi2}}; - HistogramConfigSpec h2PtDeltaPt{HistType::kTH2F, {axisPt, axisDeltaPt}}; + AxisSpec const axisColNumber{1, 0.5, 1.5, "Selected collisions"}; + AxisSpec const axisDCA{5000, 0., 5., "DCA (cm)"}; + AxisSpec const axisChi2{500, 0., 100., "#chi^{2} of MCH-MFT matching"}; + AxisSpec const axisPt{200, 0., 100., "#it{p}_{T,reco} (GeV/#it{c})"}; + AxisSpec const axisDeltaPt{1000, -50., 50., "#Delta #it{p}_{T} (GeV/#it{c})"}; + + HistogramConfigSpec const h1ColNumber{HistType::kTH1F, {axisColNumber}}; + HistogramConfigSpec const h1Pt{HistType::kTH1F, {axisPt}}; + HistogramConfigSpec const h2PtDCA{HistType::kTH2F, {axisPt, axisDCA}}; + HistogramConfigSpec const h2PtChi2{HistType::kTH2F, {axisPt, axisChi2}}; + HistogramConfigSpec const h2PtDeltaPt{HistType::kTH2F, {axisPt, axisDeltaPt}}; registry.add("h1ColNumber", "", h1ColNumber); for (const auto& src : muonSources) { diff --git a/PWGHF/TableProducer/candidateCreator2Prong.cxx b/PWGHF/TableProducer/candidateCreator2Prong.cxx index 9964cd60d85..dc93fc318bc 100644 --- a/PWGHF/TableProducer/candidateCreator2Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator2Prong.cxx @@ -431,19 +431,19 @@ struct HfCandidateCreator2Prong { kfpVertex.SetCovarianceMatrix(rowTrackIndexProng2.pvRefitSigmaX2(), rowTrackIndexProng2.pvRefitSigmaXY(), rowTrackIndexProng2.pvRefitSigmaY2(), rowTrackIndexProng2.pvRefitSigmaXZ(), rowTrackIndexProng2.pvRefitSigmaYZ(), rowTrackIndexProng2.pvRefitSigmaZ2()); } kfpVertex.GetCovarianceMatrix(covMatrixPV); - KFParticle kfpV(kfpVertex); + KFParticle const kfpV(kfpVertex); registry.fill(HIST("hCovPVXX"), covMatrixPV[0]); registry.fill(HIST("hCovPVYY"), covMatrixPV[2]); registry.fill(HIST("hCovPVXZ"), covMatrixPV[3]); registry.fill(HIST("hCovPVZZ"), covMatrixPV[5]); - KFPTrack kfpTrack0 = createKFPTrackFromTrack(track0); - KFPTrack kfpTrack1 = createKFPTrackFromTrack(track1); + KFPTrack const kfpTrack0 = createKFPTrackFromTrack(track0); + KFPTrack const kfpTrack1 = createKFPTrackFromTrack(track1); - KFParticle kfPosPion(kfpTrack0, kPiPlus); - KFParticle kfNegPion(kfpTrack1, kPiPlus); - KFParticle kfPosKaon(kfpTrack0, kKPlus); - KFParticle kfNegKaon(kfpTrack1, kKPlus); + KFParticle const kfPosPion(kfpTrack0, kPiPlus); + KFParticle const kfNegPion(kfpTrack1, kPiPlus); + KFParticle const kfPosKaon(kfpTrack0, kKPlus); + KFParticle const kfNegKaon(kfpTrack1, kKPlus); float impactParameter0XY = 0., errImpactParameter0XY = 0., impactParameter1XY = 0., errImpactParameter1XY = 0.; if (!kfPosPion.GetDistanceFromVertexXY(kfpV, impactParameter0XY, errImpactParameter0XY)) { @@ -918,7 +918,7 @@ struct HfCandidateCreator2ProngExpressions { // D0(bar) → π+ K−, π+ K− π0, π+ π−, π+ π− π0, K+ K− for (const auto& [channelMain, finalState] : daughtersD0Main) { - std::array arrPdgDaughtersMain2Prongs = std::array{finalState[0], finalState[1]}; + std::array const arrPdgDaughtersMain2Prongs = std::array{finalState[0], finalState[1]}; if (finalState.size() == 3) { // o2-linter: disable=magic-number (partially reconstructed 3-prong decays) if (matchKinkedDecayTopology && matchInteractionsWithMaterial) { indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kD0, arrPdgDaughtersMain2Prongs, true, &sign, FinalStateDepth, &nKinkedTracks, &nInteractionsWithMaterial); diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index a75b38f7fc4..d2a852eeed9 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -494,17 +494,17 @@ struct HfCandidateCreator3Prong { registry.fill(HIST("hCovPVXZ"), covMatrixPV[3]); registry.fill(HIST("hCovPVZZ"), covMatrixPV[5]); - KFPTrack kfpTrack0 = createKFPTrackFromTrack(track0); - KFPTrack kfpTrack1 = createKFPTrackFromTrack(track1); - KFPTrack kfpTrack2 = createKFPTrackFromTrack(track2); - - KFParticle kfFirstProton(kfpTrack0, kProton); - KFParticle kfFirstPion(kfpTrack0, kPiPlus); - KFParticle kfFirstKaon(kfpTrack0, kKPlus); - KFParticle kfSecondKaon(kfpTrack1, kKPlus); - KFParticle kfThirdProton(kfpTrack2, kProton); - KFParticle kfThirdPion(kfpTrack2, kPiPlus); - KFParticle kfThirdKaon(kfpTrack2, kKPlus); + KFPTrack const kfpTrack0 = createKFPTrackFromTrack(track0); + KFPTrack const kfpTrack1 = createKFPTrackFromTrack(track1); + KFPTrack const kfpTrack2 = createKFPTrackFromTrack(track2); + + KFParticle const kfFirstProton(kfpTrack0, kProton); + KFParticle const kfFirstPion(kfpTrack0, kPiPlus); + KFParticle const kfFirstKaon(kfpTrack0, kKPlus); + KFParticle const kfSecondKaon(kfpTrack1, kKPlus); + KFParticle const kfThirdProton(kfpTrack2, kProton); + KFParticle const kfThirdPion(kfpTrack2, kPiPlus); + KFParticle const kfThirdKaon(kfpTrack2, kKPlus); float impactParameter0XY = 0., errImpactParameter0XY = 0., impactParameter1XY = 0., errImpactParameter1XY = 0., impactParameter2XY = 0., errImpactParameter2XY = 0.; if (!kfFirstProton.GetDistanceFromVertexXY(kfpV, impactParameter0XY, errImpactParameter0XY)) { @@ -1080,7 +1080,7 @@ struct HfCandidateCreator3ProngExpressions { } auto finalStates = getDecayChannelsMain(pdgMother); for (const auto& [channelMain, finalState] : finalStates) { - std::array arrPdgDaughtersMain3Prongs = std::array{finalState[0], finalState[1], finalState[2]}; + std::array const arrPdgDaughtersMain3Prongs = std::array{finalState[0], finalState[1], finalState[2]}; if (finalState.size() > 3) { // o2-linter: disable=magic-number (partially reconstructed decays with 4 or 5 final state particles) if (matchKinkedDecayTopology && matchInteractionsWithMaterial) { indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdgMother, arrPdgDaughtersMain3Prongs, true, &sign, depthMainMax, &nKinkedTracks, &nInteractionsWithMaterial); diff --git a/PWGHF/TableProducer/candidateCreatorB0.cxx b/PWGHF/TableProducer/candidateCreatorB0.cxx index 92e7e2d0c3a..5097623643f 100644 --- a/PWGHF/TableProducer/candidateCreatorB0.cxx +++ b/PWGHF/TableProducer/candidateCreatorB0.cxx @@ -288,14 +288,14 @@ struct HfCandidateCreatorB0 { df3.getTrack(2).getPxPyPzGlo(pVec2); // D∓ → π∓ K± π∓ - std::array pVecPiK = RecoDecay::pVec(pVec0, pVec1); + std::array const pVecPiK = RecoDecay::pVec(pVec0, pVec1); std::array pVecD = RecoDecay::pVec(pVec0, pVec1, pVec2); auto trackParCovPiK = o2::dataformats::V0(df3.getPCACandidatePos(), pVecPiK, df3.calcPCACovMatrixFlat(), trackParCov0, trackParCov1); auto trackParCovD = o2::dataformats::V0(df3.getPCACandidatePos(), pVecD, df3.calcPCACovMatrixFlat(), trackParCovPiK, trackParCov2); - int indexTrack0 = track0.globalIndex(); - int indexTrack1 = track1.globalIndex(); - int indexTrack2 = track2.globalIndex(); + int const indexTrack0 = track0.globalIndex(); + int const indexTrack1 = track1.globalIndex(); + int const indexTrack2 = track2.globalIndex(); auto trackIdsThisCollision = trackIndices.sliceBy(trackIndicesPerCollision, thisCollId); @@ -457,13 +457,13 @@ struct HfCandidateCreatorB0Expressions { auto particleProng2 = arrayDaughtersB0[2].mcParticle(); auto particleProng3 = arrayDaughtersB0[3].mcParticle(); // b-hadron hypothesis - std::array bHadronMotherHypos = {Pdg::kB0, Pdg::kBS, Pdg::kLambdaB0}; + std::array const bHadronMotherHypos = {Pdg::kB0, Pdg::kBS, Pdg::kLambdaB0}; for (const auto& bHadronMotherHypo : bHadronMotherHypos) { - int index0Mother = RecoDecay::getMother(mcParticles, particleProng0, bHadronMotherHypo, true); - int index1Mother = RecoDecay::getMother(mcParticles, particleProng1, bHadronMotherHypo, true); - int index2Mother = RecoDecay::getMother(mcParticles, particleProng2, bHadronMotherHypo, true); - int index3Mother = RecoDecay::getMother(mcParticles, particleProng3, bHadronMotherHypo, true); + int const index0Mother = RecoDecay::getMother(mcParticles, particleProng0, bHadronMotherHypo, true); + int const index1Mother = RecoDecay::getMother(mcParticles, particleProng1, bHadronMotherHypo, true); + int const index2Mother = RecoDecay::getMother(mcParticles, particleProng2, bHadronMotherHypo, true); + int const index3Mother = RecoDecay::getMother(mcParticles, particleProng3, bHadronMotherHypo, true); // look for common b-hadron ancestor if (index0Mother > -1 && index0Mother == index1Mother && index1Mother == index2Mother && index2Mother == index3Mother) { diff --git a/PWGHF/TableProducer/candidateCreatorBplus.cxx b/PWGHF/TableProducer/candidateCreatorBplus.cxx index d9dc956c301..8dcefe55c9c 100644 --- a/PWGHF/TableProducer/candidateCreatorBplus.cxx +++ b/PWGHF/TableProducer/candidateCreatorBplus.cxx @@ -268,13 +268,13 @@ struct HfCandidateCreatorBplus { df.getTrack(0).getPxPyPzGlo(pVec0); df.getTrack(1).getPxPyPzGlo(pVec1); // Get D0 momentum - std::array pVecD = RecoDecay::pVec(pVec0, pVec1); + std::array const pVecD = RecoDecay::pVec(pVec0, pVec1); // build a D0 neutral track auto trackD0 = o2::dataformats::V0(vertexD0, pVecD, df.calcPCACovMatrixFlat(), trackParCovProng0, trackParCovProng1); - int indexTrack0 = prong0.globalIndex(); - int indexTrack1 = prong1.globalIndex(); + int const indexTrack0 = prong0.globalIndex(); + int const indexTrack1 = prong1.globalIndex(); auto trackIdsThisCollision = trackIndices.sliceBy(trackIndicesPerCollision, thisCollId); diff --git a/PWGHF/TableProducer/candidateCreatorBs.cxx b/PWGHF/TableProducer/candidateCreatorBs.cxx index 812169965b1..41c41d7dcaa 100644 --- a/PWGHF/TableProducer/candidateCreatorBs.cxx +++ b/PWGHF/TableProducer/candidateCreatorBs.cxx @@ -268,16 +268,16 @@ struct HfCandidateCreatorBs { df3.getTrack(2).getPxPyPzGlo(pVec2); // Ds∓ → K∓ K± π∓ - std::array pVecKK = RecoDecay::pVec(pVec0, pVec1); + std::array const pVecKK = RecoDecay::pVec(pVec0, pVec1); std::array pVecDs = RecoDecay::pVec(pVec0, pVec1, pVec2); auto trackParCovKK = o2::dataformats::V0(df3.getPCACandidatePos(), pVecKK, df3.calcPCACovMatrixFlat(), trackParCov0, trackParCov1); auto trackParCovDs = o2::dataformats::V0(df3.getPCACandidatePos(), pVecDs, df3.calcPCACovMatrixFlat(), trackParCovKK, trackParCov2); - int indexTrack0 = track0.globalIndex(); - int indexTrack1 = track1.globalIndex(); - int indexTrack2 = track2.globalIndex(); + int const indexTrack0 = track0.globalIndex(); + int const indexTrack1 = track1.globalIndex(); + int const indexTrack2 = track2.globalIndex(); auto trackIdsThisCollision = trackIndices.sliceBy(trackIndicesPerCollision, thisCollId); @@ -459,13 +459,13 @@ struct HfCandidateCreatorBsExpressions { auto particleProng2 = arrayDaughtersBs[2].mcParticle(); auto particleProng3 = arrayDaughtersBs[3].mcParticle(); // b-hadron hypothesis - std::array bHadronMotherHypos = {Pdg::kB0, Pdg::kBPlus, Pdg::kBS, Pdg::kLambdaB0}; + std::array const bHadronMotherHypos = {Pdg::kB0, Pdg::kBPlus, Pdg::kBS, Pdg::kLambdaB0}; for (const auto& bHadronMotherHypo : bHadronMotherHypos) { - int index0Mother = RecoDecay::getMother(mcParticles, particleProng0, bHadronMotherHypo, true); - int index1Mother = RecoDecay::getMother(mcParticles, particleProng1, bHadronMotherHypo, true); - int index2Mother = RecoDecay::getMother(mcParticles, particleProng2, bHadronMotherHypo, true); - int index3Mother = RecoDecay::getMother(mcParticles, particleProng3, bHadronMotherHypo, true); + int const index0Mother = RecoDecay::getMother(mcParticles, particleProng0, bHadronMotherHypo, true); + int const index1Mother = RecoDecay::getMother(mcParticles, particleProng1, bHadronMotherHypo, true); + int const index2Mother = RecoDecay::getMother(mcParticles, particleProng2, bHadronMotherHypo, true); + int const index3Mother = RecoDecay::getMother(mcParticles, particleProng3, bHadronMotherHypo, true); // look for common b-hadron ancestor if (index0Mother > -1 && index0Mother == index1Mother && index1Mother == index2Mother && index2Mother == index3Mother) { diff --git a/PWGHF/TableProducer/candidateCreatorCascade.cxx b/PWGHF/TableProducer/candidateCreatorCascade.cxx index 0a24495b54d..781b50c3412 100644 --- a/PWGHF/TableProducer/candidateCreatorCascade.cxx +++ b/PWGHF/TableProducer/candidateCreatorCascade.cxx @@ -222,7 +222,7 @@ struct HfCandidateCreatorCascade { dcaNegToPV = v0row.dcanegtopv(); v0cosPA = v0row.v0cosPA(); - int momIndSize = 6; + int const momIndSize = 6; constexpr int MomInd[6] = {9, 13, 14, 18, 19, 20}; // cov matrix elements for momentum component for (int i = 0; i < momIndSize; i++) { covV[MomInd[i]] = v0row.momentumCovMat()[i]; @@ -504,7 +504,7 @@ struct HfCandidateCreatorCascadeMc { } } - int indexK0SRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersV0, kK0Short, std::array{+kPiPlus, -kPiPlus}, false, &sign, 1); + int const indexK0SRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersV0, kK0Short, std::array{+kPiPlus, -kPiPlus}, false, &sign, 1); if (indexK0SRec >= 0) { // we have already positively checked the K0s // then we check the Lc indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersLc, Pdg::kLambdaCPlus, std::array{+kProton, +kPiPlus, -kPiPlus}, true, &sign, 3); // 3-levels Lc --> p + K0 --> p + K0s --> p + pi+ pi- diff --git a/PWGHF/TableProducer/candidateCreatorDstar.cxx b/PWGHF/TableProducer/candidateCreatorDstar.cxx index e0837ed94c8..47a05c41c37 100644 --- a/PWGHF/TableProducer/candidateCreatorDstar.cxx +++ b/PWGHF/TableProducer/candidateCreatorDstar.cxx @@ -768,7 +768,7 @@ struct HfCandidateCreatorDstarExpressions { // D*± → D0(bar) π± std::vector listIndexDaughters{}; - bool isDstarToDzeroPi = RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kDStar, std::array{+Pdg::kD0, +kPiPlus}, true, &signDstar, 1, &listIndexDaughters); + bool const isDstarToDzeroPi = RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kDStar, std::array{+Pdg::kD0, +kPiPlus}, true, &signDstar, 1, &listIndexDaughters); // D0(bar) → π± K∓ if (isDstarToDzeroPi) { diff --git a/PWGHF/TableProducer/candidateCreatorLb.cxx b/PWGHF/TableProducer/candidateCreatorLb.cxx index cc615c0ad72..b3fcad95b9b 100644 --- a/PWGHF/TableProducer/candidateCreatorLb.cxx +++ b/PWGHF/TableProducer/candidateCreatorLb.cxx @@ -172,14 +172,14 @@ struct HfCandidateCreatorLb { trackParVar1.propagateTo(secondaryVertex[0], bz); trackParVar2.propagateTo(secondaryVertex[0], bz); - std::array pvecpK = RecoDecay::pVec(track0.pVector(), track1.pVector()); + std::array const pvecpK = RecoDecay::pVec(track0.pVector(), track1.pVector()); std::array pvecLc = RecoDecay::pVec(pvecpK, track2.pVector()); auto trackpK = o2::dataformats::V0(df3.getPCACandidatePos(), pvecpK, df3.calcPCACovMatrixFlat(), trackParVar0, trackParVar1); auto trackLc = o2::dataformats::V0(df3.getPCACandidatePos(), pvecLc, df3.calcPCACovMatrixFlat(), trackpK, trackParVar2); - int index0Lc = track0.globalIndex(); - int index1Lc = track1.globalIndex(); - int index2Lc = track2.globalIndex(); + int const index0Lc = track0.globalIndex(); + int const index1Lc = track1.globalIndex(); + int const index2Lc = track2.globalIndex(); // int charge = track0.sign() + track1.sign() + track2.sign(); for (const auto& trackPion : tracks) { diff --git a/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx b/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx index cb0cadd5a1b..b95b69e4937 100644 --- a/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx +++ b/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx @@ -217,7 +217,7 @@ struct HfCandidateCreatorSigmac0plusplus { // define mass window for Lc float mPKPiCandLcMax = -1; float mPiKPCandLcMax = -1; - int const pTBin = findBin(binsPt, candLc.pt()); + int pTBin = findBin(binsPt, candLc.pt()); if (pTBin != -1) { mPKPiCandLcMax = cutsMassLcMax->get(pTBin, "max pKpi mass Lc"); mPiKPCandLcMax = cutsMassLcMax->get(pTBin, "max piKp mass Lc"); @@ -244,19 +244,19 @@ struct HfCandidateCreatorSigmac0plusplus { ////////////////////////////////////////////////////////////////////////////////////// /// Exclude the current candidate soft pion if it corresponds already to a candidate Lc prong - int const indexProng0 = candLc.template prong0_as().globalIndex(); - int const indexProng1 = candLc.template prong1_as().globalIndex(); - int const indexProng2 = candLc.template prong2_as().globalIndex(); - int const indexSoftPi = trackSoftPi.globalIndex(); + int indexProng0 = candLc.template prong0_as().globalIndex(); + int indexProng1 = candLc.template prong1_as().globalIndex(); + int indexProng2 = candLc.template prong2_as().globalIndex(); + int indexSoftPi = trackSoftPi.globalIndex(); if (indexSoftPi == indexProng0 || indexSoftPi == indexProng1 || indexSoftPi == indexProng2) { continue; } histos.fill(HIST("hCounter"), 6); /// determine the Σc candidate charge - int const chargeLc = candLc.template prong0_as().sign() + candLc.template prong1_as().sign() + candLc.template prong2_as().sign(); - int const chargeSoftPi = trackSoftPi.sign(); - int8_t const chargeSigmac = chargeLc + chargeSoftPi; + int chargeLc = candLc.template prong0_as().sign() + candLc.template prong1_as().sign() + candLc.template prong2_as().sign(); + int chargeSoftPi = trackSoftPi.sign(); + int8_t chargeSigmac = chargeLc + chargeSoftPi; if (std::abs(chargeSigmac) != o2::aod::hf_cand_sigmac::ChargeNull && std::abs(chargeSigmac) != o2::aod::hf_cand_sigmac::ChargePlusPlus) { /// this shall never happen LOG(fatal) << ">>> Sc candidate with charge +1 built, not possible! Charge Lc: " << chargeLc << ", charge soft pion: " << chargeSoftPi; @@ -446,7 +446,7 @@ struct HfCandidateSigmac0plusplusMc { int8_t isParticleAntiparticle(PART const& particle, int pdgSigmac) { - int const pdgCode = particle.pdgCode(); + int pdgCode = particle.pdgCode(); if (pdgCode == pdgSigmac) { // particle return aod::hf_cand_sigmac::Particle; diff --git a/PWGHF/TableProducer/candidateCreatorSigmac0plusplusCascade.cxx b/PWGHF/TableProducer/candidateCreatorSigmac0plusplusCascade.cxx index eefea4cd0ab..c63bbf09ce4 100644 --- a/PWGHF/TableProducer/candidateCreatorSigmac0plusplusCascade.cxx +++ b/PWGHF/TableProducer/candidateCreatorSigmac0plusplusCascade.cxx @@ -91,25 +91,25 @@ struct HfCandidateCreatorSigmac0plusplusCascade { void init(InitContext&) { // axes - AxisSpec axisBinsPt = {binsPt, "#it{p}_{T} (GeV/#it{c})"}; - AxisSpec axisPt = {300, 0.0f, 30.0f, "#it{p}_{T} (GeV/#it{c})"}; - AxisSpec axisEta = {500, -2.0f, 2.0f, "#it{#eta}"}; - AxisSpec axisPhi = {100, 0.f, 6.3f, "#it{#phi}"}; - AxisSpec axisMassCand = {600, 1.98f, 2.58f, "inv. mass (p K_{S}^{0}) (GeV/#it{c}^{2})"}; - AxisSpec axisd0 = {500, -0.5f, 0.5f, "DCAxy (cm)"}; - AxisSpec axisd0V0Daughters = {1000, -5.0f, 5.0f, "DCAxy (cm)"}; - AxisSpec axisV0CPA = {500, 0.98f, 1.0001f, "v0 cos pointing angle"}; - AxisSpec axisV0Radius = {1000, 0.f, 40.f, "V0 radius (cm)"}; - AxisSpec axisV0DCADaughters = {200, 0.f, 2.f, "DCA (cm)"}; - AxisSpec axisMassK0Short = {500, 0.4f, 0.6f, "#it{m}(K_{S}^{0}) (GeV/#it{c}^{2})"}; - AxisSpec axisMassLambda = {500, 1.0f, 1.2f, "#it{m}(#Lambda) (GeV/#it{c}^{2})"}; - AxisSpec axisMassGamma = {500, 0.0f, 0.4f, "#it{m}(#gamma) (GeV/#it{c}^{2})"}; - AxisSpec axisCPACand = {110, -1.1f, 1.1f, "candiate cos pointing angle"}; - AxisSpec axisDecLength = {200, 0.f, 2.0f, "decay length (cm)"}; - AxisSpec axisProperLifetime = {100, 0.f, 0.2f, "#it{c#tau} (cm)"}; - AxisSpec axisProperLifetimeV0 = {1000, 0.f, 80.f, "#it{c#tau} (cm)"}; - AxisSpec axisNSigma = {100, -6.f, 6.f, "n#it{#sigma}_{p}"}; - AxisSpec axisPidP = {100, 0.f, 10.0f, "#it{p} (GeV/#it{c})"}; + AxisSpec const axisBinsPt = {binsPt, "#it{p}_{T} (GeV/#it{c})"}; + AxisSpec const axisPt = {300, 0.0f, 30.0f, "#it{p}_{T} (GeV/#it{c})"}; + AxisSpec const axisEta = {500, -2.0f, 2.0f, "#it{#eta}"}; + AxisSpec const axisPhi = {100, 0.f, 6.3f, "#it{#phi}"}; + AxisSpec const axisMassCand = {600, 1.98f, 2.58f, "inv. mass (p K_{S}^{0}) (GeV/#it{c}^{2})"}; + AxisSpec const axisd0 = {500, -0.5f, 0.5f, "DCAxy (cm)"}; + AxisSpec const axisd0V0Daughters = {1000, -5.0f, 5.0f, "DCAxy (cm)"}; + AxisSpec const axisV0CPA = {500, 0.98f, 1.0001f, "v0 cos pointing angle"}; + AxisSpec const axisV0Radius = {1000, 0.f, 40.f, "V0 radius (cm)"}; + AxisSpec const axisV0DCADaughters = {200, 0.f, 2.f, "DCA (cm)"}; + AxisSpec const axisMassK0Short = {500, 0.4f, 0.6f, "#it{m}(K_{S}^{0}) (GeV/#it{c}^{2})"}; + AxisSpec const axisMassLambda = {500, 1.0f, 1.2f, "#it{m}(#Lambda) (GeV/#it{c}^{2})"}; + AxisSpec const axisMassGamma = {500, 0.0f, 0.4f, "#it{m}(#gamma) (GeV/#it{c}^{2})"}; + AxisSpec const axisCPACand = {110, -1.1f, 1.1f, "candiate cos pointing angle"}; + AxisSpec const axisDecLength = {200, 0.f, 2.0f, "decay length (cm)"}; + AxisSpec const axisProperLifetime = {100, 0.f, 0.2f, "#it{c#tau} (cm)"}; + AxisSpec const axisProperLifetimeV0 = {1000, 0.f, 80.f, "#it{c#tau} (cm)"}; + AxisSpec const axisNSigma = {100, -6.f, 6.f, "n#it{#sigma}_{p}"}; + AxisSpec const axisPidP = {100, 0.f, 10.0f, "#it{p} (GeV/#it{c})"}; auto h = registry.add("candidateStat", "", kTH1D, {{3, 0.5, 3.5}}); h->GetXaxis()->SetBinLabel(1, "Lc candidates"); diff --git a/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx b/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx index bdaeade98a7..f658e183b10 100644 --- a/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx +++ b/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx @@ -492,7 +492,7 @@ struct HfCandidateCreatorXic0Omegac0 { // info from LF table std::array vertexCasc = {casc.x(), casc.y(), casc.z()}; - std::array pVecCasc = {casc.px(), casc.py(), casc.pz()}; + std::array const pVecCasc = {casc.px(), casc.py(), casc.pz()}; std::array covCasc = {0.}; constexpr int NumCovElements = 6; constexpr int MomInd[NumCovElements] = {9, 13, 14, 18, 19, 20}; // cov matrix elements for momentum component @@ -547,11 +547,11 @@ struct HfCandidateCreatorXic0Omegac0 { df.getTrack(1).getPxPyPzGlo(pVecCharmBachelorAsD); std::array pVecCharmBaryon = {pVecCascAsD[0] + pVecCharmBachelorAsD[0], pVecCascAsD[1] + pVecCharmBachelorAsD[1], pVecCascAsD[2] + pVecCharmBachelorAsD[2]}; - std::array coordVtxCharmBaryon = df.getPCACandidatePos(); + std::array const coordVtxCharmBaryon = df.getPCACandidatePos(); std::array covVtxCharmBaryon = df.calcPCACovMatrixFlat(); // pseudorapidity - float pseudorapCharmBachelor = trackCharmBachelor.eta(); + float const pseudorapCharmBachelor = trackCharmBachelor.eta(); // primary vertex of the collision auto primaryVertex = getPrimaryVertex(collision); // get the associated covariance matrix with auto covMatrixPV = primaryVertex.getCov(); @@ -567,20 +567,20 @@ struct HfCandidateCreatorXic0Omegac0 { o2::base::Propagator::Instance()->propagateToDCABxByBz(primaryVertex, trackParVarV0Dau0, 2.f, matCorr, &impactParameterV0Dau0); o2::base::Propagator::Instance()->propagateToDCABxByBz(primaryVertex, trackParVarV0Dau1, 2.f, matCorr, &impactParameterV0Dau1); o2::base::Propagator::Instance()->propagateToDCABxByBz(primaryVertex, trackParVarCascDauCharged, 2.f, matCorr, &impactParameterCascDauCharged); - float dcaxyV0Dau0 = impactParameterV0Dau0.getY(); - float dcaxyV0Dau1 = impactParameterV0Dau1.getY(); - float dcaxyCascBachelor = impactParameterCascDauCharged.getY(); - float dcazV0Dau0 = impactParameterV0Dau0.getZ(); - float dcazV0Dau1 = impactParameterV0Dau1.getZ(); - float dcazCascBachelor = impactParameterCascDauCharged.getZ(); + float const dcaxyV0Dau0 = impactParameterV0Dau0.getY(); + float const dcaxyV0Dau1 = impactParameterV0Dau1.getY(); + float const dcaxyCascBachelor = impactParameterCascDauCharged.getY(); + float const dcazV0Dau0 = impactParameterV0Dau0.getZ(); + float const dcazV0Dau1 = impactParameterV0Dau1.getZ(); + float const dcazCascBachelor = impactParameterCascDauCharged.getZ(); // impact parameters o2::dataformats::DCA impactParameterCasc; o2::dataformats::DCA impactParameterCharmBachelor; o2::base::Propagator::Instance()->propagateToDCABxByBz(primaryVertex, trackCasc, 2.f, matCorr, &impactParameterCasc); o2::base::Propagator::Instance()->propagateToDCABxByBz(primaryVertex, trackParVarCharmBachelor, 2.f, matCorr, &impactParameterCharmBachelor); - float impactParBachFromCharmBaryonXY = impactParameterCharmBachelor.getY(); - float impactParBachFromCharmBaryonZ = impactParameterCharmBachelor.getZ(); + float const impactParBachFromCharmBaryonXY = impactParameterCharmBachelor.getY(); + float const impactParBachFromCharmBaryonZ = impactParameterCharmBachelor.getZ(); // invariant mass under the hypothesis of particles ID corresponding to the decay chain float mLambda = casc.mLambda(); // from LF table, V0 mass under lambda hypothesis @@ -602,41 +602,41 @@ struct HfCandidateCreatorXic0Omegac0 { // computing cosPA float cpaV0 = casc.v0cosPA(collision.posX(), collision.posY(), collision.posZ()); - float cpaCharmBaryon = RecoDecay::cpa(pvCoord, coordVtxCharmBaryon, pVecCharmBaryon); + float const cpaCharmBaryon = RecoDecay::cpa(pvCoord, coordVtxCharmBaryon, pVecCharmBaryon); float cpaCasc = casc.casccosPA(collision.posX(), collision.posY(), collision.posZ()); - float cpaxyV0 = RecoDecay::cpaXY(pvCoord, vertexV0, pVecV0); - float cpaxyCharmBaryon = RecoDecay::cpaXY(pvCoord, coordVtxCharmBaryon, pVecCharmBaryon); - float cpaxyCasc = RecoDecay::cpaXY(pvCoord, vertexCasc, pVecCasc); + float const cpaxyV0 = RecoDecay::cpaXY(pvCoord, vertexV0, pVecV0); + float const cpaxyCharmBaryon = RecoDecay::cpaXY(pvCoord, coordVtxCharmBaryon, pVecCharmBaryon); + float const cpaxyCasc = RecoDecay::cpaXY(pvCoord, vertexCasc, pVecCasc); // computing decay length and ctau - float decLenCharmBaryon = RecoDecay::distance(pvCoord, coordVtxCharmBaryon); - float decLenCascade = RecoDecay::distance(coordVtxCharmBaryon, vertexCasc); - float decLenV0 = RecoDecay::distance(vertexCasc, vertexV0); + float const decLenCharmBaryon = RecoDecay::distance(pvCoord, coordVtxCharmBaryon); + float const decLenCascade = RecoDecay::distance(coordVtxCharmBaryon, vertexCasc); + float const decLenV0 = RecoDecay::distance(vertexCasc, vertexV0); double phiCharmBaryon, thetaCharmBaryon; getPointDirection(std::array{primaryVertex.getX(), primaryVertex.getY(), primaryVertex.getZ()}, coordVtxCharmBaryon, phiCharmBaryon, thetaCharmBaryon); auto errorDecayLengthCharmBaryon = std::sqrt(getRotatedCovMatrixXX(primaryVertex.getCov(), phiCharmBaryon, thetaCharmBaryon) + getRotatedCovMatrixXX(covVtxCharmBaryon, phiCharmBaryon, thetaCharmBaryon)); auto errorDecayLengthXYCharmBaryon = std::sqrt(getRotatedCovMatrixXX(primaryVertex.getCov(), phiCharmBaryon, 0.) + getRotatedCovMatrixXX(covVtxCharmBaryon, phiCharmBaryon, 0.)); - float ctOmegac = RecoDecay::ct(pVecCharmBaryon, decLenCharmBaryon, MassOmegaC0); - float ctXic = RecoDecay::ct(pVecCharmBaryon, decLenCharmBaryon, MassXiC0); + float const ctOmegac = RecoDecay::ct(pVecCharmBaryon, decLenCharmBaryon, MassOmegaC0); + float const ctXic = RecoDecay::ct(pVecCharmBaryon, decLenCharmBaryon, MassXiC0); float ctCascade = 0.; if constexpr (DecayChannel == hf_cand_casc_lf::DecayType2Prong::XiczeroOmegaczeroToXiPi) { ctCascade = RecoDecay::ct(pVecCasc, decLenCascade, MassXiMinus); } else { ctCascade = RecoDecay::ct(pVecCasc, decLenCascade, MassOmegaMinus); } - float ctV0 = RecoDecay::ct(pVecV0, decLenV0, MassLambda0); + float const ctV0 = RecoDecay::ct(pVecV0, decLenV0, MassLambda0); // computing eta - float pseudorapCharmBaryon = RecoDecay::eta(pVecCharmBaryon); - float pseudorapCascade = RecoDecay::eta(pVecCasc); - float pseudorapV0 = RecoDecay::eta(pVecV0); + float const pseudorapCharmBaryon = RecoDecay::eta(pVecCharmBaryon); + float const pseudorapCascade = RecoDecay::eta(pVecCasc); + float const pseudorapV0 = RecoDecay::eta(pVecV0); // DCA between daughters float dcaCascDau = casc.dcacascdaughters(); float dcaV0Dau = casc.dcaV0daughters(); - float dcaCharmBaryonDau = std::sqrt(df.getChi2AtPCACandidate()); + float const dcaCharmBaryonDau = std::sqrt(df.getChi2AtPCACandidate()); // fill test histograms hInvMassCharmBaryon->Fill(mCharmBaryon); @@ -776,7 +776,7 @@ struct HfCandidateCreatorXic0Omegac0 { auto trackCharmBachelor = tracks.rawIteratorAt(trackCharmBachelorId); auto cascAodElement = cand.cascade_as(); hCascadesCounter->Fill(0); - int v0index = cascAodElement.v0Id(); + int const v0index = cascAodElement.v0Id(); if (!cascAodElement.has_kfCascData()) { continue; } @@ -797,18 +797,18 @@ struct HfCandidateCreatorXic0Omegac0 { // kaon <- casc TrackParCov auto omegaDauChargedTrackParCov = getTrackParCov(trackCascDauCharged); // convert tracks into KFParticle object - KFPTrack kfTrack0 = createKFPTrackFromTrack(trackV0Dau0); - KFPTrack kfTrack1 = createKFPTrackFromTrack(trackV0Dau1); - KFPTrack kfTrackBach = createKFPTrackFromTrack(trackCascDauCharged); - - KFParticle kfPosPr(kfTrack0, kProton); - KFParticle kfNegPi(kfTrack1, kPiMinus); - KFParticle kfNegKa(kfTrackBach, kKMinus); - KFParticle kfNegPiRej(kfTrackBach, kPiMinus); // rej - KFParticle kfPosPi(kfTrack0, kPiPlus); - KFParticle kfNegPr(kfTrack1, kProton); - KFParticle kfPosKa(kfTrackBach, kKPlus); - KFParticle kfPosPiRej(kfTrackBach, kPiPlus); // rej + KFPTrack const kfTrack0 = createKFPTrackFromTrack(trackV0Dau0); + KFPTrack const kfTrack1 = createKFPTrackFromTrack(trackV0Dau1); + KFPTrack const kfTrackBach = createKFPTrackFromTrack(trackCascDauCharged); + + KFParticle const kfPosPr(kfTrack0, kProton); + KFParticle const kfNegPi(kfTrack1, kPiMinus); + KFParticle const kfNegKa(kfTrackBach, kKMinus); + KFParticle const kfNegPiRej(kfTrackBach, kPiMinus); // rej + KFParticle const kfPosPi(kfTrack0, kPiPlus); + KFParticle const kfNegPr(kfTrack1, kProton); + KFParticle const kfPosKa(kfTrackBach, kKPlus); + KFParticle const kfPosPiRej(kfTrackBach, kPiPlus); // rej KFParticle kfBachKaon; KFParticle kfPos; @@ -853,7 +853,7 @@ struct HfCandidateCreatorXic0Omegac0 { KFParticle kfV0MassConstrained = kfV0; kfV0MassConstrained.SetNonlinearMassConstraint(o2::constants::physics::MassLambda); // set mass constrain to Lambda if (kfUseV0MassConstraint) { - KFParticle kfV0 = kfV0MassConstrained; + KFParticle const kfV0 = kfV0MassConstrained; } kfV0.TransportToDecayVertex(); @@ -892,7 +892,7 @@ struct HfCandidateCreatorXic0Omegac0 { kfOmegaMassConstrained.SetNonlinearMassConstraint(o2::constants::physics::MassOmegaMinus); // set mass constrain to OmegaMinus if (kfUseCascadeMassConstraint) { // set mass constraint if requested - KFParticle kfOmega = kfOmegaMassConstrained; + KFParticle const kfOmega = kfOmegaMassConstrained; } registry.fill(HIST("hInvMassOmegaMinus"), massCasc); kfOmega.TransportToDecayVertex(); @@ -901,8 +901,8 @@ struct HfCandidateCreatorXic0Omegac0 { //__________________________________________ //*>~<* step 3 : reconstruc Omegac0 with KF // Create KF charm bach Pion from track - KFPTrack kfTrackBachPion = createKFPTrackFromTrack(trackCharmBachelor); - KFParticle kfBachPion(kfTrackBachPion, kPiPlus); + KFPTrack const kfTrackBachPion = createKFPTrackFromTrack(trackCharmBachelor); + KFParticle const kfBachPion(kfTrackBachPion, kPiPlus); const KFParticle* omegaC0Daugthers[2] = {&kfBachPion, &kfOmega}; // construct OmegaC0 @@ -924,8 +924,8 @@ struct HfCandidateCreatorXic0Omegac0 { hCandidateCounter->Fill(2); kfOmegaC0.TransportToDecayVertex(); // PV - KFPVertex kfVertex = createKFPVertexFromCollision(collision); - KFParticle kfPV(kfVertex); + KFPVertex const kfVertex = createKFPVertexFromCollision(collision); + KFParticle const kfPV(kfVertex); // set production vertex; kfNeg.SetProductionVertex(kfV0); @@ -967,8 +967,8 @@ struct HfCandidateCreatorXic0Omegac0 { //-------------------------- V0 info--------------------------- // pseudorapidity - float pseudorapV0Dau0 = kfPos.GetEta(); - float pseudorapV0Dau1 = kfNeg.GetEta(); + float const pseudorapV0Dau0 = kfPos.GetEta(); + float const pseudorapV0Dau1 = kfNeg.GetEta(); // info from from KFParticle std::array pVecV0 = {kfV0.GetPx(), kfV0.GetPy(), kfV0.GetPz()}; // pVec stands for vector containing the 3-momentum components @@ -978,7 +978,7 @@ struct HfCandidateCreatorXic0Omegac0 { //-------------------reconstruct cascade track------------------ // pseudorapidity - float pseudorapCascBachelor = kfBachKaonToOmega.GetEta(); + float const pseudorapCascBachelor = kfBachKaonToOmega.GetEta(); // info from KFParticle std::array vertexCasc = {kfOmega.GetX(), kfOmega.GetY(), kfOmega.GetZ()}; @@ -993,7 +993,7 @@ struct HfCandidateCreatorXic0Omegac0 { pVecCharmBachelorAsD[2] = kfBachPionToOmegaC.GetPz(); std::array pVecCharmBaryon = {kfOmegaC0.GetPx(), kfOmegaC0.GetPy(), kfOmegaC0.GetPz()}; - std::array coordVtxCharmBaryon = {kfOmegaC0.GetX(), kfOmegaC0.GetY(), kfOmegaC0.GetZ()}; + std::array const coordVtxCharmBaryon = {kfOmegaC0.GetX(), kfOmegaC0.GetY(), kfOmegaC0.GetZ()}; auto* covVtxCharmBaryon = kfOmegaC0.CovarianceMatrix(); float covMatrixPV[6]; kfVertex.GetCovarianceMatrix(covMatrixPV); @@ -1008,12 +1008,12 @@ struct HfCandidateCreatorXic0Omegac0 { float dcaxyV0Dau0 = impactParameterV0Dau0[0]; float dcaxyV0Dau1 = impactParameterV0Dau1[0]; float dcaxyCascBachelor = impactParameterKaFromCasc[0]; - float dcazV0Dau0 = impactParameterV0Dau0[1]; - float dcazV0Dau1 = impactParameterV0Dau1[1]; - float dcazCascBachelor = impactParameterKaFromCasc[1]; + float const dcazV0Dau0 = impactParameterV0Dau0[1]; + float const dcazV0Dau1 = impactParameterV0Dau1[1]; + float const dcazCascBachelor = impactParameterKaFromCasc[1]; // pseudorapidity - float pseudorapCharmBachelor = kfBachPionToOmegaC.GetEta(); + float const pseudorapCharmBachelor = kfBachPionToOmegaC.GetEta(); // impact parameters o2::dataformats::DCA impactParameterCasc; @@ -1024,9 +1024,9 @@ struct HfCandidateCreatorXic0Omegac0 { float impactParBachFromCharmBaryonZ = impactParameterCharmBachelor.getZ(); // computing decay length and ctau - float decLenCharmBaryon = RecoDecay::distance(pvCoord, coordVtxCharmBaryon); - float decLenCascade = RecoDecay::distance(coordVtxCharmBaryon, vertexCasc); - float decLenV0 = RecoDecay::distance(vertexCasc, vertexV0); + float const decLenCharmBaryon = RecoDecay::distance(pvCoord, coordVtxCharmBaryon); + float const decLenCascade = RecoDecay::distance(coordVtxCharmBaryon, vertexCasc); + float const decLenV0 = RecoDecay::distance(vertexCasc, vertexV0); double phiCharmBaryon, thetaCharmBaryon; getPointDirection(std::array{kfV0.GetX(), kfV0.GetY(), kfV0.GetZ()}, coordVtxCharmBaryon, phiCharmBaryon, thetaCharmBaryon); @@ -1265,7 +1265,7 @@ struct HfCandidateCreatorXic0Omegac0 { auto trackCharmBachelor = tracks.rawIteratorAt(trackCharmBachelorId); auto cascAodElement = cand.cascade_as(); hCascadesCounter->Fill(0); - int v0index = cascAodElement.v0Id(); + int const v0index = cascAodElement.v0Id(); if (!cascAodElement.has_kfCascData()) { continue; } @@ -1287,16 +1287,16 @@ struct HfCandidateCreatorXic0Omegac0 { auto xiDauChargedTrackParCov = getTrackParCov(trackCascDauCharged); // convert tracks into KFParticle object - KFPTrack kfTrack0 = createKFPTrackFromTrack(trackV0Dau0); - KFPTrack kfTrack1 = createKFPTrackFromTrack(trackV0Dau1); - KFPTrack kfTrackBach = createKFPTrackFromTrack(trackCascDauCharged); + KFPTrack const kfTrack0 = createKFPTrackFromTrack(trackV0Dau0); + KFPTrack const kfTrack1 = createKFPTrackFromTrack(trackV0Dau1); + KFPTrack const kfTrackBach = createKFPTrackFromTrack(trackCascDauCharged); - KFParticle kfPosPr(kfTrack0, kProton); - KFParticle kfNegPi(kfTrack1, kPiMinus); - KFParticle kfNegBachPi(kfTrackBach, kPiMinus); - KFParticle kfPosPi(kfTrack0, kPiPlus); - KFParticle kfNegPr(kfTrack1, kProton); - KFParticle kfPosBachPi(kfTrackBach, kPiPlus); + KFParticle const kfPosPr(kfTrack0, kProton); + KFParticle const kfNegPi(kfTrack1, kPiMinus); + KFParticle const kfNegBachPi(kfTrackBach, kPiMinus); + KFParticle const kfPosPi(kfTrack0, kPiPlus); + KFParticle const kfNegPr(kfTrack1, kProton); + KFParticle const kfPosBachPi(kfTrackBach, kPiPlus); KFParticle kfBachPion; KFParticle kfPos; @@ -1380,7 +1380,7 @@ struct HfCandidateCreatorXic0Omegac0 { kfXiMassConstrained.SetNonlinearMassConstraint(o2::constants::physics::MassXiMinus); // set mass constrain to XiMinus if (kfUseCascadeMassConstraint) { // set mass constraint if requested - KFParticle kfXi = kfXiMassConstrained; + KFParticle const kfXi = kfXiMassConstrained; } registry.fill(HIST("hInvMassXiMinus"), massCasc); kfXi.TransportToDecayVertex(); @@ -1388,8 +1388,8 @@ struct HfCandidateCreatorXic0Omegac0 { //__________________________________________ //*>~<* step 3 : reconstruc Xic0 with KF // Create KF charm bach Pion from track - KFPTrack kfTrackBachPion = createKFPTrackFromTrack(trackCharmBachelor); - KFParticle kfCharmBachPion(kfTrackBachPion, kPiPlus); + KFPTrack const kfTrackBachPion = createKFPTrackFromTrack(trackCharmBachelor); + KFParticle const kfCharmBachPion(kfTrackBachPion, kPiPlus); const KFParticle* xiC0Daugthers[2] = {&kfCharmBachPion, &kfXi}; // construct XiC0 @@ -1415,11 +1415,11 @@ struct HfCandidateCreatorXic0Omegac0 { hCandidateCounter->Fill(2); kfXiC0.TransportToDecayVertex(); // PV - KFPVertex kfVertex = createKFPVertexFromCollision(collision); - KFParticle kfPV(kfVertex); + KFPVertex const kfVertex = createKFPVertexFromCollision(collision); + KFParticle const kfPV(kfVertex); - KFParticle kfPosOrigin = kfPos; - KFParticle kfNegOrigin = kfNeg; + KFParticle const kfPosOrigin = kfPos; + KFParticle const kfNegOrigin = kfNeg; // set production vertex; kfNeg.SetProductionVertex(kfV0); kfPos.SetProductionVertex(kfV0); @@ -1460,8 +1460,8 @@ struct HfCandidateCreatorXic0Omegac0 { //-------------------------- V0 info--------------------------- // pseudorapidity - float pseudorapV0Dau0 = kfPos.GetEta(); - float pseudorapV0Dau1 = kfNeg.GetEta(); + float const pseudorapV0Dau0 = kfPos.GetEta(); + float const pseudorapV0Dau1 = kfNeg.GetEta(); // info from from KFParticle std::array pVecV0 = {kfV0.GetPx(), kfV0.GetPy(), kfV0.GetPz()}; // pVec stands for vector containing the 3-momentum components @@ -1471,7 +1471,7 @@ struct HfCandidateCreatorXic0Omegac0 { //-------------------reconstruct cascade track------------------ // pseudorapidity - float pseudorapCascBachelor = kfBachPionToXi.GetEta(); + float const pseudorapCascBachelor = kfBachPionToXi.GetEta(); // info from KFParticle std::array vertexCasc = {kfXi.GetX(), kfXi.GetY(), kfXi.GetZ()}; @@ -1495,12 +1495,12 @@ struct HfCandidateCreatorXic0Omegac0 { o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, trackParCovV0Dau0, 2.f, matCorr, &impactParameterV0Dau0); o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, trackParCovV0Dau1, 2.f, matCorr, &impactParameterV0Dau1); o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, xiDauChargedTrackParCov, 2.f, matCorr, &impactParameterPiFromCasc); - float dcaxyV0Dau0 = impactParameterV0Dau0[0]; - float dcaxyV0Dau1 = impactParameterV0Dau1[0]; - float dcaxyCascBachelor = impactParameterPiFromCasc[0]; + float const dcaxyV0Dau0 = impactParameterV0Dau0[0]; + float const dcaxyV0Dau1 = impactParameterV0Dau1[0]; + float const dcaxyCascBachelor = impactParameterPiFromCasc[0]; // pseudorapidity - float pseudorapCharmBachelor = kfCharmBachPionToXiC.GetEta(); + float const pseudorapCharmBachelor = kfCharmBachPionToXiC.GetEta(); // fill test histograms hInvMassCharmBaryon->Fill(massXiC0); @@ -1701,10 +1701,10 @@ struct HfCandidateCreatorXic0Omegac0 { auto kaFromOmegaCharge = trackKaFromOmega.sign(); auto signOmega = casc.sign(); - KFPTrack kfpTrackKaFromCharm = createKFPTrackFromTrack(trackKaFromCharm); - KFPTrack kfpTrackKaFromOmega = createKFPTrackFromTrack(trackKaFromOmega); - KFPTrack kfpTrackV0DauPos = createKFPTrackFromTrack(trackV0DauPos); - KFPTrack kfpTrackV0DauNeg = createKFPTrackFromTrack(trackV0DauNeg); + KFPTrack const kfpTrackKaFromCharm = createKFPTrackFromTrack(trackKaFromCharm); + KFPTrack const kfpTrackKaFromOmega = createKFPTrackFromTrack(trackKaFromOmega); + KFPTrack const kfpTrackV0DauPos = createKFPTrackFromTrack(trackV0DauPos); + KFPTrack const kfpTrackV0DauNeg = createKFPTrackFromTrack(trackV0DauNeg); KFParticle kfPrFromV0(kfpTrackV0DauPos, kProton); KFParticle kfPiFromV0(kfpTrackV0DauNeg, kPiMinus); @@ -1843,10 +1843,10 @@ struct HfCandidateCreatorXic0Omegac0 { hCandidateCounter->Fill(2); // initialize primary vertex - KFPVertex kfpVertex = createKFPVertexFromCollision(collision); + KFPVertex const kfpVertex = createKFPVertexFromCollision(collision); float covMatrixPV[6]; kfpVertex.GetCovarianceMatrix(covMatrixPV); - KFParticle kfPv(kfpVertex); // for calculation of DCAs to PV + KFParticle const kfPv(kfpVertex); // for calculation of DCAs to PV // fill test histograms hInvMassCharmBaryon->Fill(massOmegaKa); @@ -1895,40 +1895,40 @@ struct HfCandidateCreatorXic0Omegac0 { kfOmega.GetDistanceFromVertexXY(kfPv, impactParameterOmegaXY, errImpactParameterOmegaXY); // calculate cosine of pointing angle - float cosPaV0ToPv = cpaFromKF(kfV0, kfPv); - float cosPaCascToPv = cpaFromKF(kfOmega, kfPv); - float cosPaOmegaKaToPv = cpaFromKF(kfOmegaKa, kfPv); - float cosPaXYV0ToPv = cpaXYFromKF(kfV0, kfPv); - float cosPaXYCascToPv = cpaXYFromKF(kfOmega, kfPv); - float cosPaXYOmegaKaToPv = cpaXYFromKF(kfOmegaKa, kfPv); - float cosPaV0ToCasc = cpaFromKF(kfV0, kfOmega); - float cosPaCascToOmegaKa = cpaFromKF(kfOmega, kfOmegaKa); - float cosPaXYV0ToCasc = cpaXYFromKF(kfV0, kfOmega); - float cosPaXYCascToOmegaKa = cpaXYFromKF(kfOmega, kfOmegaKa); + float const cosPaV0ToPv = cpaFromKF(kfV0, kfPv); + float const cosPaCascToPv = cpaFromKF(kfOmega, kfPv); + float const cosPaOmegaKaToPv = cpaFromKF(kfOmegaKa, kfPv); + float const cosPaXYV0ToPv = cpaXYFromKF(kfV0, kfPv); + float const cosPaXYCascToPv = cpaXYFromKF(kfOmega, kfPv); + float const cosPaXYOmegaKaToPv = cpaXYFromKF(kfOmegaKa, kfPv); + float const cosPaV0ToCasc = cpaFromKF(kfV0, kfOmega); + float const cosPaCascToOmegaKa = cpaFromKF(kfOmega, kfOmegaKa); + float const cosPaXYV0ToCasc = cpaXYFromKF(kfV0, kfOmega); + float const cosPaXYCascToOmegaKa = cpaXYFromKF(kfOmega, kfOmegaKa); // Get Chi2Geo/NDF - float chi2GeoV0 = kfV0.GetChi2() / kfV0.GetNDF(); - float chi2GeoCasc = kfOmega.GetChi2() / kfOmega.GetNDF(); - float chi2GeoOmegaKa = kfOmegaKa.GetChi2() / kfOmegaKa.GetNDF(); + float const chi2GeoV0 = kfV0.GetChi2() / kfV0.GetNDF(); + float const chi2GeoCasc = kfOmega.GetChi2() / kfOmega.GetNDF(); + float const chi2GeoOmegaKa = kfOmegaKa.GetChi2() / kfOmegaKa.GetNDF(); // Get Chi2Topo/NDF - float chi2NdfTopoV0ToCasc = kfV0ToOmega.GetChi2() / kfV0ToOmega.GetNDF(); - float chi2NdfTopoKaToCasc = kfKaToOmega.GetChi2() / kfKaToOmega.GetNDF(); - float chi2NdfTopoKaFromOmegaKaToOmegaKa = kfKaFromCharmToOmegaKa.GetChi2() / kfKaFromCharmToOmegaKa.GetNDF(); - float chi2NdfTopoCascToOmegaKa = kfOmegaToOmegaKa.GetChi2() / kfOmegaToOmegaKa.GetNDF(); - float chi2NdfTopoV0ToPv = kfV0ToPv.GetChi2() / kfV0ToPv.GetNDF(); - float chi2NdfTopoCascToPv = kfOmegaToPv.GetChi2() / kfOmegaToPv.GetNDF(); - float chi2NdfTopoOmegaKaToPv = kfCharmToPv.GetChi2() / kfCharmToPv.GetNDF(); - float chi2NdfTopoKaFromOmegaKaToPv = kfKaFromCharmToPv.GetChi2() / kfKaFromCharmToPv.GetNDF(); + float const chi2NdfTopoV0ToCasc = kfV0ToOmega.GetChi2() / kfV0ToOmega.GetNDF(); + float const chi2NdfTopoKaToCasc = kfKaToOmega.GetChi2() / kfKaToOmega.GetNDF(); + float const chi2NdfTopoKaFromOmegaKaToOmegaKa = kfKaFromCharmToOmegaKa.GetChi2() / kfKaFromCharmToOmegaKa.GetNDF(); + float const chi2NdfTopoCascToOmegaKa = kfOmegaToOmegaKa.GetChi2() / kfOmegaToOmegaKa.GetNDF(); + float const chi2NdfTopoV0ToPv = kfV0ToPv.GetChi2() / kfV0ToPv.GetNDF(); + float const chi2NdfTopoCascToPv = kfOmegaToPv.GetChi2() / kfOmegaToPv.GetNDF(); + float const chi2NdfTopoOmegaKaToPv = kfCharmToPv.GetChi2() / kfCharmToPv.GetNDF(); + float const chi2NdfTopoKaFromOmegaKaToPv = kfKaFromCharmToPv.GetChi2() / kfKaFromCharmToPv.GetNDF(); // Get MassChi2/NDF auto v0Chi2OverNdfm = kfV0MassConstrained.GetChi2() / kfV0MassConstrained.GetNDF(); auto cascChi2OverNdfm = kfOmegaMassConstrained.GetChi2() / kfOmegaMassConstrained.GetNDF(); // KF ldl - float ldlV0 = ldlFromKF(kfV0, kfPv); - float ldlCasc = ldlFromKF(kfOmega, kfPv); - float ldlOmegaKa = ldlFromKF(kfOmegaKa, kfPv); + float const ldlV0 = ldlFromKF(kfV0, kfPv); + float const ldlCasc = ldlFromKF(kfOmega, kfPv); + float const ldlOmegaKa = ldlFromKF(kfOmegaKa, kfPv); // KF decay length float decayLxyLam, errDecayLxyLam; @@ -1939,18 +1939,18 @@ struct HfCandidateCreatorXic0Omegac0 { kfCharmToPv.GetDecayLengthXY(decayLxyOmegaKa, errDecayLxyOmegaKa); // KF pT - float ptOmegaKa = kfOmegaKa.GetPt(); - float ptKaFromCharm = kfKaFromCharm.GetPt(); - float ptOmega = kfOmega.GetPt(); + float const ptOmegaKa = kfOmegaKa.GetPt(); + float const ptKaFromCharm = kfKaFromCharm.GetPt(); + float const ptOmega = kfOmega.GetPt(); // KF cosThetaStar - float cosThetaStarKaFromOmegac = cosThetaStarFromKF(0, 4332, 321, 3334, kfKaFromCharmToOmegaKa, kfOmegaToOmegaKa); - float cosThetaStarKaFromXic = cosThetaStarFromKF(0, 4132, 321, 3334, kfKaFromCharmToOmegaKa, kfOmegaToOmegaKa); + float const cosThetaStarKaFromOmegac = cosThetaStarFromKF(0, 4332, 321, 3334, kfKaFromCharmToOmegaKa, kfOmegaToOmegaKa); + float const cosThetaStarKaFromXic = cosThetaStarFromKF(0, 4132, 321, 3334, kfKaFromCharmToOmegaKa, kfOmegaToOmegaKa); // KF ct - float ctV0 = kfV0ToOmega.GetLifeTime(); - float ctCasc = kfOmegaToOmegaKa.GetLifeTime(); - float ctOmegaKa = kfCharmToPv.GetLifeTime(); + float const ctV0 = kfV0ToOmega.GetLifeTime(); + float const ctCasc = kfOmegaToOmegaKa.GetLifeTime(); + float const ctOmegaKa = kfCharmToPv.GetLifeTime(); hCandidateCounter->Fill(3); @@ -2351,10 +2351,10 @@ struct HfCandidateCreatorXic0Omegac0Mc { // QA if (doprocessMcXicToXiPiKfQa) { - AxisSpec axisPt{20, 0., 20.}; - AxisSpec axisDelta{1000, -0.5, 0.5}; - AxisSpec axisPull{2000, -10., 10.}; - AxisSpec axisPtRes{400, -0.2, 0.2}; + AxisSpec const axisPt{20, 0., 20.}; + AxisSpec const axisDelta{1000, -0.5, 0.5}; + AxisSpec const axisPull{2000, -10., 10.}; + AxisSpec const axisPtRes{400, -0.2, 0.2}; // mass over pt registry.add("hV0MassPullVsPt", "m_{PULL}(V0) vs. p_{T}", HistType::kTH2D, {axisPt, axisPull}); registry.add("hXiMassPullVsPt", "m_{PULL}(#Xi^{-}) vs. p_{T}", HistType::kTH2D, {axisPt, axisPull}); @@ -2790,8 +2790,8 @@ struct HfCandidateCreatorXic0Omegac0Mc { debugGenLambda = 0; origin = RecoDecay::OriginType::None; std::vector idxBhadMothers{}; - float kRapidityCutTight = 0.5; - float kRapidityCutLoose = 0.8; + float const kRapidityCutTight = 0.5; + float const kRapidityCutLoose = 0.8; // Reject particles from background events if (particle.fromBackgroundEvent() && rejectBackground) { @@ -3014,36 +3014,36 @@ struct HfCandidateCreatorXic0Omegac0Mc { if (indexRec > -1 && signV0 == 1) { auto mcV0 = mcParticles.rawIteratorAt(indexRec - mcParticles.offset()); - float v0MassPull = (candidate.invMassLambda() - MassLambda0) / candidate.invMassV0Err(); + float const v0MassPull = (candidate.invMassLambda() - MassLambda0) / candidate.invMassV0Err(); registry.fill(HIST("hV0MassPullVsPt"), candidate.v0Pt(), v0MassPull); - float v0DauPosXDelta = candidate.v0DauPosX() - mcV0DauPos.vx(); - float v0DauPosYDelta = candidate.v0DauPosY() - mcV0DauPos.vy(); - float v0DauPosZDelta = candidate.v0DauPosZ() - mcV0DauPos.vz(); - float v0DauPosPt = mcV0DauPos.pt(); - float v0DauPosXPull = v0DauPosXDelta / candidate.v0DauPosXError(); - float v0DauPosYPull = v0DauPosYDelta / candidate.v0DauPosYError(); - float v0DauPosZPull = v0DauPosZDelta / candidate.v0DauPosZError(); - - float v0DauNegXDelta = candidate.v0DauNegX() - mcV0DauNeg.vx(); - float v0DauNegYDelta = candidate.v0DauNegY() - mcV0DauNeg.vy(); - float v0DauNegZDelta = candidate.v0DauNegZ() - mcV0DauNeg.vz(); - float v0DauNegPt = mcV0DauNeg.pt(); - float v0DauNegXPull = v0DauNegXDelta / candidate.v0DauNegXError(); - float v0DauNegYPull = v0DauNegYDelta / candidate.v0DauNegYError(); - float v0DauNegZPull = v0DauNegZDelta / candidate.v0DauNegZError(); - - float v0XDelta = candidate.v0VtxX() - mcV0DauNeg.vx(); - float v0YDelta = candidate.v0VtxY() - mcV0DauNeg.vy(); - float v0ZDelta = candidate.v0VtxZ() - mcV0DauNeg.vz(); - float v0Pt = mcV0.pt(); - float v0XPull = v0XDelta / candidate.v0XError(); - float v0YPull = v0YDelta / candidate.v0YError(); - float v0ZPull = v0ZDelta / candidate.v0ZError(); - - float lambdaXDelta = candidate.v0X() - mcV0DauNeg.vx(); - float lambdaYDelta = candidate.v0Y() - mcV0DauNeg.vy(); - float lambdaZDelta = candidate.v0Z() - mcV0DauNeg.vz(); + float const v0DauPosXDelta = candidate.v0DauPosX() - mcV0DauPos.vx(); + float const v0DauPosYDelta = candidate.v0DauPosY() - mcV0DauPos.vy(); + float const v0DauPosZDelta = candidate.v0DauPosZ() - mcV0DauPos.vz(); + float const v0DauPosPt = mcV0DauPos.pt(); + float const v0DauPosXPull = v0DauPosXDelta / candidate.v0DauPosXError(); + float const v0DauPosYPull = v0DauPosYDelta / candidate.v0DauPosYError(); + float const v0DauPosZPull = v0DauPosZDelta / candidate.v0DauPosZError(); + + float const v0DauNegXDelta = candidate.v0DauNegX() - mcV0DauNeg.vx(); + float const v0DauNegYDelta = candidate.v0DauNegY() - mcV0DauNeg.vy(); + float const v0DauNegZDelta = candidate.v0DauNegZ() - mcV0DauNeg.vz(); + float const v0DauNegPt = mcV0DauNeg.pt(); + float const v0DauNegXPull = v0DauNegXDelta / candidate.v0DauNegXError(); + float const v0DauNegYPull = v0DauNegYDelta / candidate.v0DauNegYError(); + float const v0DauNegZPull = v0DauNegZDelta / candidate.v0DauNegZError(); + + float const v0XDelta = candidate.v0VtxX() - mcV0DauNeg.vx(); + float const v0YDelta = candidate.v0VtxY() - mcV0DauNeg.vy(); + float const v0ZDelta = candidate.v0VtxZ() - mcV0DauNeg.vz(); + float const v0Pt = mcV0.pt(); + float const v0XPull = v0XDelta / candidate.v0XError(); + float const v0YPull = v0YDelta / candidate.v0YError(); + float const v0ZPull = v0ZDelta / candidate.v0ZError(); + + float const lambdaXDelta = candidate.v0X() - mcV0DauNeg.vx(); + float const lambdaYDelta = candidate.v0Y() - mcV0DauNeg.vy(); + float const lambdaZDelta = candidate.v0Z() - mcV0DauNeg.vz(); registry.fill(HIST("hV0DauPosXDelta"), v0DauPosXDelta); registry.fill(HIST("hV0DauPosYDelta"), v0DauPosYDelta); registry.fill(HIST("hV0DauPosZDelta"), v0DauPosZDelta); @@ -3094,30 +3094,30 @@ struct HfCandidateCreatorXic0Omegac0Mc { indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersCasc, +kXiMinus, std::array{+kPiMinus, +kProton, +kPiMinus}, true, &signCasc, 2); if (indexRec > -1 && signCasc == 1) { // QA - float xiMassPull = (candidate.invMassCascade() - MassXiMinus) / candidate.invMassXiErr(); + float const xiMassPull = (candidate.invMassCascade() - MassXiMinus) / candidate.invMassXiErr(); registry.fill(HIST("hXiMassPullVsPt"), candidate.xiPt(), xiMassPull); - float xiBachelorXDelta = candidate.xiBachelorX() - mcXiBachelor.vx(); - float xiBachelorYDelta = candidate.xiBachelorY() - mcXiBachelor.vy(); - float xiBachelorZDelta = candidate.xiBachelorZ() - mcXiBachelor.vz(); - float xiBachelorPt = mcXiBachelor.pt(); - float xiBachelorXPull = xiBachelorXDelta / candidate.xiBachelorXError(); - float xiBachelorYPull = xiBachelorYDelta / candidate.xiBachelorYError(); - float xiBachelorZPull = xiBachelorZDelta / candidate.xiBachelorZError(); + float const xiBachelorXDelta = candidate.xiBachelorX() - mcXiBachelor.vx(); + float const xiBachelorYDelta = candidate.xiBachelorY() - mcXiBachelor.vy(); + float const xiBachelorZDelta = candidate.xiBachelorZ() - mcXiBachelor.vz(); + float const xiBachelorPt = mcXiBachelor.pt(); + float const xiBachelorXPull = xiBachelorXDelta / candidate.xiBachelorXError(); + float const xiBachelorYPull = xiBachelorYDelta / candidate.xiBachelorYError(); + float const xiBachelorZPull = xiBachelorZDelta / candidate.xiBachelorZError(); auto mcXi = mcParticles.rawIteratorAt(indexRec - mcParticles.offset()); - float xiXDelta = candidate.xiX() - mcXiBachelor.vx(); - float xiYDelta = candidate.xiY() - mcXiBachelor.vy(); - float xiZDelta = candidate.xiZ() - mcXiBachelor.vz(); - float xiPt = mcXi.pt(); - float xiXPull = xiXDelta / candidate.xiXError(); - float xiYPull = xiYDelta / candidate.xiYError(); - float xiZPull = xiZDelta / candidate.xiZError(); + float const xiXDelta = candidate.xiX() - mcXiBachelor.vx(); + float const xiYDelta = candidate.xiY() - mcXiBachelor.vy(); + float const xiZDelta = candidate.xiZ() - mcXiBachelor.vz(); + float const xiPt = mcXi.pt(); + float const xiXPull = xiXDelta / candidate.xiXError(); + float const xiYPull = xiYDelta / candidate.xiYError(); + float const xiZPull = xiZDelta / candidate.xiZError(); - float cascXDelta = candidate.xDecayVtxCascade() - mcXiBachelor.vx(); - float cascYDelta = candidate.yDecayVtxCascade() - mcXiBachelor.vy(); - float cascZDelta = candidate.zDecayVtxCascade() - mcXiBachelor.vz(); + float const cascXDelta = candidate.xDecayVtxCascade() - mcXiBachelor.vx(); + float const cascYDelta = candidate.yDecayVtxCascade() - mcXiBachelor.vy(); + float const cascZDelta = candidate.zDecayVtxCascade() - mcXiBachelor.vz(); registry.fill(HIST("hXiBachelorXDelta"), xiBachelorXDelta); registry.fill(HIST("hXiBachelorYDelta"), xiBachelorYDelta); @@ -3156,24 +3156,24 @@ struct HfCandidateCreatorXic0Omegac0Mc { indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, +kXiC0, std::array{+kPiPlus, +kPiMinus, +kProton, +kPiMinus}, true, &sign, 3); if (indexRec > -1 && sign == 1) { auto mcXic0 = mcParticles.rawIteratorAt(indexRec - mcParticles.offset()); - float xic0MassPull = (candidate.invMassCharmBaryon() - MassXiC0) / candidate.invMassXic0Err(); + float const xic0MassPull = (candidate.invMassCharmBaryon() - MassXiC0) / candidate.invMassXic0Err(); registry.fill(HIST("hXic0MassPullVsPt"), candidate.xic0Pt(), xic0MassPull); - float xic0BachelorXDelta = candidate.xic0BachelorX() - mcXic0Bachelor.vx(); - float xic0BachelorYDelta = candidate.xic0BachelorY() - mcXic0Bachelor.vy(); - float xic0BachelorZDelta = candidate.xic0BachelorZ() - mcXic0Bachelor.vz(); - float xic0BachelorPt = mcXic0Bachelor.pt(); - float xic0BachelorXPull = xic0BachelorXDelta / candidate.xic0BachelorXError(); - float xic0BachelorYPull = xic0BachelorYDelta / candidate.xic0BachelorYError(); - float xic0BachelorZPull = xic0BachelorZDelta / candidate.xic0BachelorZError(); - - float xic0XDelta = candidate.xDecayVtxCharmBaryon() - mcXic0Bachelor.vx(); - float xic0YDelta = candidate.yDecayVtxCharmBaryon() - mcXic0Bachelor.vy(); - float xic0ZDelta = candidate.zDecayVtxCharmBaryon() - mcXic0Bachelor.vz(); - float xic0Pt = mcXic0.pt(); - float xic0XPull = xic0XDelta / candidate.xic0XError(); - float xic0YPull = xic0YDelta / candidate.xic0YError(); - float xic0ZPull = xic0ZDelta / candidate.xic0ZError(); + float const xic0BachelorXDelta = candidate.xic0BachelorX() - mcXic0Bachelor.vx(); + float const xic0BachelorYDelta = candidate.xic0BachelorY() - mcXic0Bachelor.vy(); + float const xic0BachelorZDelta = candidate.xic0BachelorZ() - mcXic0Bachelor.vz(); + float const xic0BachelorPt = mcXic0Bachelor.pt(); + float const xic0BachelorXPull = xic0BachelorXDelta / candidate.xic0BachelorXError(); + float const xic0BachelorYPull = xic0BachelorYDelta / candidate.xic0BachelorYError(); + float const xic0BachelorZPull = xic0BachelorZDelta / candidate.xic0BachelorZError(); + + float const xic0XDelta = candidate.xDecayVtxCharmBaryon() - mcXic0Bachelor.vx(); + float const xic0YDelta = candidate.yDecayVtxCharmBaryon() - mcXic0Bachelor.vy(); + float const xic0ZDelta = candidate.zDecayVtxCharmBaryon() - mcXic0Bachelor.vz(); + float const xic0Pt = mcXic0.pt(); + float const xic0XPull = xic0XDelta / candidate.xic0XError(); + float const xic0YPull = xic0YDelta / candidate.xic0YError(); + float const xic0ZPull = xic0ZDelta / candidate.xic0ZError(); registry.fill(HIST("hXic0BachelorXDelta"), xic0BachelorXDelta); registry.fill(HIST("hXic0BachelorYDelta"), xic0BachelorYDelta); registry.fill(HIST("hXic0BachelorZDelta"), xic0BachelorZDelta); diff --git a/PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx b/PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx index 1d1dbc88e32..6a183d21c2f 100644 --- a/PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx +++ b/PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx @@ -248,10 +248,10 @@ struct HfCandidateCreatorXicToXiPiPi { df.setBz(bz); //--------------------------info of V0 and cascades track from LF-tables--------------------------- - std::array vertexV0 = {casc.xlambda(), casc.ylambda(), casc.zlambda()}; - std::array pVecV0 = {casc.pxlambda(), casc.pylambda(), casc.pzlambda()}; - std::array vertexCasc = {casc.x(), casc.y(), casc.z()}; - std::array pVecCasc = {casc.px(), casc.py(), casc.pz()}; + std::array const vertexV0 = {casc.xlambda(), casc.ylambda(), casc.zlambda()}; + std::array const pVecV0 = {casc.pxlambda(), casc.pylambda(), casc.pzlambda()}; + std::array const vertexCasc = {casc.x(), casc.y(), casc.z()}; + std::array const pVecCasc = {casc.px(), casc.py(), casc.pz()}; std::array covCasc = {0.}; //----------------create cascade track------------------------------------------------------------ @@ -290,7 +290,7 @@ struct HfCandidateCreatorXicToXiPiPi { //----------------------------calculate physical properties----------------------- // Charge of charm baryon - int8_t signXic = casc.sign() < 0 ? +1 : -1; + int8_t const signXic = casc.sign() < 0 ? +1 : -1; // get SV properties const auto& secondaryVertex = df.getPCACandidate(); @@ -325,13 +325,13 @@ struct HfCandidateCreatorXicToXiPiPi { trackParCovCharmBachelor1.propagateToDCA(primaryVertex, bz, &impactParameter1); // calculate cosine of pointing angle - std::array pvCoord = {collision.posX(), collision.posY(), collision.posZ()}; + std::array const pvCoord = {collision.posX(), collision.posY(), collision.posZ()}; float cpaLambda = casc.v0cosPA(collision.posX(), collision.posY(), collision.posZ()); - float cpaXYLambda = RecoDecay::cpaXY(pvCoord, vertexV0, pVecV0); + float const cpaXYLambda = RecoDecay::cpaXY(pvCoord, vertexV0, pVecV0); float cpaXi = casc.casccosPA(collision.posX(), collision.posY(), collision.posZ()); - float cpaXYXi = RecoDecay::cpaXY(pvCoord, vertexCasc, pVecCasc); - float cpaLambdaToXi = RecoDecay::cpa(vertexCasc, vertexV0, pVecV0); - float cpaXYLambdaToXi = RecoDecay::cpaXY(vertexCasc, vertexV0, pVecV0); + float const cpaXYXi = RecoDecay::cpaXY(pvCoord, vertexCasc, pVecCasc); + float const cpaLambdaToXi = RecoDecay::cpa(vertexCasc, vertexV0, pVecV0); + float const cpaXYLambdaToXi = RecoDecay::cpaXY(vertexCasc, vertexV0, pVecV0); // get invariant mass of Xi-pi pairs auto arrayMomentaXiPi0 = std::array{pVecXi, pVecPi0}; @@ -346,14 +346,14 @@ struct HfCandidateCreatorXicToXiPiPi { auto errorDecayLengthXY = std::sqrt(getRotatedCovMatrixXX(covMatrixPV, phi, 0.) + getRotatedCovMatrixXX(covMatrixSV, phi, 0.)); //--------------------- get PID information----------------------- - float nSigTpcPiFromXicPlus0 = trackCharmBachelor0.tpcNSigmaPi(); - float nSigTofPiFromXicPlus0 = trackCharmBachelor0.tofNSigmaPi(); - float nSigTpcPiFromXicPlus1 = trackCharmBachelor1.tpcNSigmaPi(); - float nSigTofPiFromXicPlus1 = trackCharmBachelor1.tofNSigmaPi(); + float const nSigTpcPiFromXicPlus0 = trackCharmBachelor0.tpcNSigmaPi(); + float const nSigTofPiFromXicPlus0 = trackCharmBachelor0.tofNSigmaPi(); + float const nSigTpcPiFromXicPlus1 = trackCharmBachelor1.tpcNSigmaPi(); + float const nSigTofPiFromXicPlus1 = trackCharmBachelor1.tofNSigmaPi(); // Bachelor pion auto trackPionFromXi = casc.bachelor_as(); - float nSigTpcBachelorPi = trackPionFromXi.tpcNSigmaPi(); - float nSigTofBachelorPi = trackPionFromXi.tofNSigmaPi(); + float const nSigTpcBachelorPi = trackPionFromXi.tpcNSigmaPi(); + float const nSigTofBachelorPi = trackPionFromXi.tofNSigmaPi(); // Lambda daughters auto trackPosLambdaDaughter = casc.posTrack_as(); auto trackNegLambdaDaughter = casc.negTrack_as(); @@ -481,21 +481,21 @@ struct HfCandidateCreatorXicToXiPiPi { KFParticle::SetField(bz); //----------------------info of V0 and cascade tracks from LF-table------------------ - std::array vertexV0 = {casc.xlambda(), casc.ylambda(), casc.zlambda()}; - std::array pVecV0 = {casc.pxlambda(), casc.pylambda(), casc.pzlambda()}; - std::array vertexCasc = {casc.x(), casc.y(), casc.z()}; - std::array pVecCasc = {casc.px(), casc.py(), casc.pz()}; + std::array const vertexV0 = {casc.xlambda(), casc.ylambda(), casc.zlambda()}; + std::array const pVecV0 = {casc.pxlambda(), casc.pylambda(), casc.pzlambda()}; + std::array const vertexCasc = {casc.x(), casc.y(), casc.z()}; + std::array const pVecCasc = {casc.px(), casc.py(), casc.pz()}; //----------------------Create XicPlus as KFParticle object------------------------------------------- // initialize primary vertex - KFPVertex kfpVertex = createKFPVertexFromCollision(collision); + KFPVertex const kfpVertex = createKFPVertexFromCollision(collision); float covMatrixPV[6]; kfpVertex.GetCovarianceMatrix(covMatrixPV); - KFParticle kfPv(kfpVertex); // for calculation of DCAs to PV + KFParticle const kfPv(kfpVertex); // for calculation of DCAs to PV // convert pion tracks into KFParticle object - KFPTrack kfpTrackCharmBachelor0 = createKFPTrackFromTrack(trackCharmBachelor0); - KFPTrack kfpTrackCharmBachelor1 = createKFPTrackFromTrack(trackCharmBachelor1); + KFPTrack const kfpTrackCharmBachelor0 = createKFPTrackFromTrack(trackCharmBachelor0); + KFPTrack const kfpTrackCharmBachelor1 = createKFPTrackFromTrack(trackCharmBachelor1); KFParticle kfCharmBachelor0(kfpTrackCharmBachelor0, kPiPlus); KFParticle kfCharmBachelor1(kfpTrackCharmBachelor1, kPiPlus); @@ -507,7 +507,7 @@ struct HfCandidateCreatorXicToXiPiPi { std::copy(xyzpxpypz.begin(), xyzpxpypz.end(), parPosMom); // create KFParticle KFParticle kfXi; - float massXi = casc.mXi(); + float const massXi = casc.mXi(); kfXi.Create(parPosMom, casc.kfTrackCovMat(), casc.sign(), massXi); if (useXiMassConstraint) { kfXi.SetNonlinearMassConstraint(MassXiMinus); @@ -526,7 +526,7 @@ struct HfCandidateCreatorXicToXiPiPi { registry.fill(HIST("hCandCounter"), VertexFit); // get chi2 values - float chi2GeoXicPlus = kfXicPlus.GetChi2() / kfXicPlus.GetNDF(); + float const chi2GeoXicPlus = kfXicPlus.GetChi2() / kfXicPlus.GetNDF(); float chi2PrimXi = kfXi.GetDeviationFromVertex(kfPv); float chi2PrimPi0 = kfCharmBachelor0.GetDeviationFromVertex(kfPv); float chi2PrimPi1 = kfCharmBachelor1.GetDeviationFromVertex(kfPv); @@ -543,7 +543,7 @@ struct HfCandidateCreatorXicToXiPiPi { //---------------------calculate physical parameters of XicPlus candidate---------------------- // sign of charm baryon - int8_t signXic = casc.sign() < 0 ? +1 : -1; + int8_t const signXic = casc.sign() < 0 ? +1 : -1; // transport XicPlus daughters to XicPlus decay vertex (secondary vertex) float secondaryVertex[3] = {0.}; @@ -563,13 +563,13 @@ struct HfCandidateCreatorXicToXiPiPi { kfXi.GetDistanceFromVertexXY(kfPv, impactParameterXiXY, errImpactParameterXiXY); // calculate cosine of pointing angle - std::array pvCoord = {collision.posX(), collision.posY(), collision.posZ()}; + std::array const pvCoord = {collision.posX(), collision.posY(), collision.posZ()}; float cpaLambda = casc.v0cosPA(collision.posX(), collision.posY(), collision.posZ()); - float cpaXYLambda = RecoDecay::cpaXY(pvCoord, vertexV0, pVecV0); + float const cpaXYLambda = RecoDecay::cpaXY(pvCoord, vertexV0, pVecV0); float cpaXi = casc.casccosPA(collision.posX(), collision.posY(), collision.posZ()); - float cpaXYXi = RecoDecay::cpaXY(pvCoord, vertexCasc, pVecCasc); - float cpaLambdaToXi = RecoDecay::cpa(vertexCasc, vertexV0, pVecV0); - float cpaXYLambdaToXi = RecoDecay::cpaXY(vertexCasc, vertexV0, pVecV0); + float const cpaXYXi = RecoDecay::cpaXY(pvCoord, vertexCasc, pVecCasc); + float const cpaLambdaToXi = RecoDecay::cpa(vertexCasc, vertexV0, pVecV0); + float const cpaXYLambdaToXi = RecoDecay::cpaXY(vertexCasc, vertexV0, pVecV0); // get chi2 deviation of Pi0-Pi1, Pi0-Xi, Pi1-Xi float chi2DevPi0Pi1 = kfCharmBachelor0.GetDeviationFromParticle(kfCharmBachelor1); @@ -621,14 +621,14 @@ struct HfCandidateCreatorXicToXiPiPi { float kfDecayLengthXYNormalised = ldlXYFromKF(kfXicPlus, kfPv); //--------------------- get PID information----------------------- - float nSigTpcPiFromXicPlus0 = trackCharmBachelor0.tpcNSigmaPi(); - float nSigTofPiFromXicPlus0 = trackCharmBachelor0.tofNSigmaPi(); - float nSigTpcPiFromXicPlus1 = trackCharmBachelor1.tpcNSigmaPi(); - float nSigTofPiFromXicPlus1 = trackCharmBachelor1.tofNSigmaPi(); + float const nSigTpcPiFromXicPlus0 = trackCharmBachelor0.tpcNSigmaPi(); + float const nSigTofPiFromXicPlus0 = trackCharmBachelor0.tofNSigmaPi(); + float const nSigTpcPiFromXicPlus1 = trackCharmBachelor1.tpcNSigmaPi(); + float const nSigTofPiFromXicPlus1 = trackCharmBachelor1.tofNSigmaPi(); // Bachelor pion auto trackPionFromXi = casc.bachelor_as(); - float nSigTpcBachelorPi = trackPionFromXi.tpcNSigmaPi(); - float nSigTofBachelorPi = trackPionFromXi.tofNSigmaPi(); + float const nSigTpcBachelorPi = trackPionFromXi.tpcNSigmaPi(); + float const nSigTofBachelorPi = trackPionFromXi.tofNSigmaPi(); // Lambda daughters auto trackPosLambdaDaughter = casc.posTrack_as(); auto trackNegLambdaDaughter = casc.negTrack_as(); diff --git a/PWGHF/TableProducer/candidateCreatorXicc.cxx b/PWGHF/TableProducer/candidateCreatorXicc.cxx index b5c9dd0a2da..380bae1445f 100644 --- a/PWGHF/TableProducer/candidateCreatorXicc.cxx +++ b/PWGHF/TableProducer/candidateCreatorXicc.cxx @@ -53,7 +53,7 @@ using namespace o2::framework::expressions; void customize(std::vector& workflowOptions) { - ConfigParamSpec optionDoMC{"doMC", VariantType::Bool, true, {"Perform MC matching."}}; + ConfigParamSpec const optionDoMC{"doMC", VariantType::Bool, true, {"Perform MC matching."}}; workflowOptions.push_back(optionDoMC); } @@ -147,15 +147,15 @@ struct HfCandidateCreatorXicc { trackParVar1.propagateTo(secondaryVertex[0], bz); trackParVar2.propagateTo(secondaryVertex[0], bz); - std::array pvecpK = RecoDecay::pVec(track0.pVector(), track1.pVector()); + std::array const pvecpK = RecoDecay::pVec(track0.pVector(), track1.pVector()); std::array pvecxic = RecoDecay::pVec(pvecpK, track2.pVector()); auto trackpK = o2::dataformats::V0(df3.getPCACandidatePos(), pvecpK, df3.calcPCACovMatrixFlat(), trackParVar0, trackParVar1); auto trackxic = o2::dataformats::V0(df3.getPCACandidatePos(), pvecxic, df3.calcPCACovMatrixFlat(), trackpK, trackParVar2); - int index0Xic = track0.globalIndex(); - int index1Xic = track1.globalIndex(); - int index2Xic = track2.globalIndex(); - int charge = track0.sign() + track1.sign() + track2.sign(); + int const index0Xic = track0.globalIndex(); + int const index1Xic = track1.globalIndex(); + int const index2Xic = track2.globalIndex(); + int const charge = track0.sign() + track1.sign() + track2.sign(); for (const auto& trackpion : tracks) { if (trackpion.pt() < cutPtPionMin) { diff --git a/PWGHF/TableProducer/candidateSelectorB0ToDPi.cxx b/PWGHF/TableProducer/candidateSelectorB0ToDPi.cxx index 1d571950ef7..dfcd47e3e1a 100644 --- a/PWGHF/TableProducer/candidateSelectorB0ToDPi.cxx +++ b/PWGHF/TableProducer/candidateSelectorB0ToDPi.cxx @@ -230,7 +230,7 @@ struct HfCandidateSelectorB0ToDPi { if (applyB0Ml) { // B0 ML selections std::vector inputFeatures = hfMlResponse.getInputFeatures(hfCandB0, trackPi, &mlScoresD); - bool isSelectedMl = hfMlResponse.isSelectedMl(inputFeatures, ptCandB0, outputMl); + bool const isSelectedMl = hfMlResponse.isSelectedMl(inputFeatures, ptCandB0, outputMl); hfMlB0ToDPiCandidate(outputMl[1]); // storing ML score for signal class if (!isSelectedMl) { diff --git a/PWGHF/TableProducer/candidateSelectorBplusToD0Pi.cxx b/PWGHF/TableProducer/candidateSelectorBplusToD0Pi.cxx index d3ecf73fc2f..0a8e6503230 100644 --- a/PWGHF/TableProducer/candidateSelectorBplusToD0Pi.cxx +++ b/PWGHF/TableProducer/candidateSelectorBplusToD0Pi.cxx @@ -241,7 +241,7 @@ struct HfCandidateSelectorBplusToD0Pi { pdgCode = -1 * pdgCode; } std::vector inputFeatures = hfMlResponse.getInputFeatures(hfCandBp, hfCandD, pdgCode, trackPi); - bool isSelectedMl = hfMlResponse.isSelectedMl(inputFeatures, ptCandBplus, outputMl); + bool const isSelectedMl = hfMlResponse.isSelectedMl(inputFeatures, ptCandBplus, outputMl); hfMlBplusToD0PiCandidate(outputMl[1]); // storing ML score for signal class if (!isSelectedMl) { diff --git a/PWGHF/TableProducer/candidateSelectorBsToDsPi.cxx b/PWGHF/TableProducer/candidateSelectorBsToDsPi.cxx index f653b5a3673..5e66076e670 100644 --- a/PWGHF/TableProducer/candidateSelectorBsToDsPi.cxx +++ b/PWGHF/TableProducer/candidateSelectorBsToDsPi.cxx @@ -197,7 +197,7 @@ struct HfCandidateSelectorBsToDsPi { // track-level PID selection if (usePid) { auto trackPi = hfCandBs.prong1_as(); - int pidTrackPi = selectorPion.statusTpcAndTof(trackPi); + int const pidTrackPi = selectorPion.statusTpcAndTof(trackPi); if (!hfHelper.selectionBsToDsPiPid(pidTrackPi, acceptPIDNotApplicable.value)) { hfSelBsToDsPiCandidate(statusBsToDsPi); if (applyMl) { @@ -223,7 +223,7 @@ struct HfCandidateSelectorBsToDsPi { hfCandBs.maxNormalisedDeltaIP(), hfCandBs.impactParameterProduct()}; - bool isSelectedMl = hfMlResponse.isSelectedMl(inputFeatures, ptCandBs, outputMl); + bool const isSelectedMl = hfMlResponse.isSelectedMl(inputFeatures, ptCandBs, outputMl); hfMlBsToDsPiCandidate(outputMl); if (!isSelectedMl) { diff --git a/PWGHF/TableProducer/candidateSelectorD0.cxx b/PWGHF/TableProducer/candidateSelectorD0.cxx index a4471492fa8..48344fb7fa1 100644 --- a/PWGHF/TableProducer/candidateSelectorD0.cxx +++ b/PWGHF/TableProducer/candidateSelectorD0.cxx @@ -357,9 +357,9 @@ struct HfCandidateSelectorD0 { // need to add special cuts (additional cuts on decay length and d0 norm) // conjugate-dependent topological selection for D0 - bool topolD0 = selectionTopolConjugate(candidate, trackPos, trackNeg); + bool const topolD0 = selectionTopolConjugate(candidate, trackPos, trackNeg); // conjugate-dependent topological selection for D0bar - bool topolD0bar = selectionTopolConjugate(candidate, trackNeg, trackPos); + bool const topolD0bar = selectionTopolConjugate(candidate, trackNeg, trackPos); if (!topolD0 && !topolD0bar) { hfSelD0Candidate(statusD0, statusD0bar, statusHFFlag, statusTopol, statusCand, statusPID); diff --git a/PWGHF/TableProducer/candidateSelectorDplusToPiKPi.cxx b/PWGHF/TableProducer/candidateSelectorDplusToPiKPi.cxx index 485d324d7f6..1cb7e8d9a59 100644 --- a/PWGHF/TableProducer/candidateSelectorDplusToPiKPi.cxx +++ b/PWGHF/TableProducer/candidateSelectorDplusToPiKPi.cxx @@ -154,7 +154,7 @@ struct HfCandidateSelectorDplusToPiKPi { bool selection(const T1& candidate, const T2& trackPion1, const T2& trackKaon, const T2& trackPion2) { auto ptCand = candidate.pt(); - int pTBin = findBin(binsPt, ptCand); + int const pTBin = findBin(binsPt, ptCand); if (pTBin == -1) { return false; } @@ -302,7 +302,7 @@ struct HfCandidateSelectorDplusToPiKPi { if (applyMl) { // ML selections std::vector inputFeatures = hfMlResponse.getInputFeatures(candidate); - bool isSelectedMl = hfMlResponse.isSelectedMl(inputFeatures, ptCand, outputMl); + bool const isSelectedMl = hfMlResponse.isSelectedMl(inputFeatures, ptCand, outputMl); hfMlDplusToPiKPiCandidate(outputMl); if (!isSelectedMl) { diff --git a/PWGHF/TableProducer/candidateSelectorDsToKKPi.cxx b/PWGHF/TableProducer/candidateSelectorDsToKKPi.cxx index 98168f58aba..5f1f534cc27 100644 --- a/PWGHF/TableProducer/candidateSelectorDsToKKPi.cxx +++ b/PWGHF/TableProducer/candidateSelectorDsToKKPi.cxx @@ -163,7 +163,7 @@ struct HfCandidateSelectorDsToKKPi { bool selection(const T1& candidate) { auto candpT = candidate.pt(); - int pTBin = findBin(binsPt, candpT); + int const pTBin = findBin(binsPt, candpT); if (pTBin == -1) { return false; } @@ -207,7 +207,7 @@ struct HfCandidateSelectorDsToKKPi { template bool selectionKKPi(const T1& candidate, const T2& trackKaon1, const T2& trackKaon2, const T2& trackPion) { - int pTBin = findBin(binsPt, candidate.pt()); + int const pTBin = findBin(binsPt, candidate.pt()); if (pTBin == -1) { return false; } @@ -239,7 +239,7 @@ struct HfCandidateSelectorDsToKKPi { template bool selectionPiKK(const T1& candidate, const T2& trackPion, const T2& trackKaon1, const T2& trackKaon2) { - int pTBin = findBin(binsPt, candidate.pt()); + int const pTBin = findBin(binsPt, candidate.pt()); if (pTBin == -1) { return false; } @@ -304,8 +304,8 @@ struct HfCandidateSelectorDsToKKPi { continue; } - bool topolDsToKKPi = selectionKKPi(candidate, trackPos1, trackNeg, trackPos2); - bool topolDsToPiKK = selectionPiKK(candidate, trackPos1, trackNeg, trackPos2); + bool const topolDsToKKPi = selectionKKPi(candidate, trackPos1, trackNeg, trackPos2); + bool const topolDsToPiKK = selectionPiKK(candidate, trackPos1, trackNeg, trackPos2); if (!topolDsToKKPi && !topolDsToPiKK) { hfSelDsToKKPiCandidate(statusDsToKKPi, statusDsToPiKK); if (applyMl) { @@ -344,13 +344,13 @@ struct HfCandidateSelectorDsToKKPi { pidTrackNegKaon = selectorKaon.statusTpcOrTof(trackNeg, candidate.nSigTpcKa1(), candidate.nSigTofKa1()); } - bool pidDsToKKPi = pidTrackPos1Kaon != TrackSelectorPID::Rejected && - pidTrackNegKaon != TrackSelectorPID::Rejected && - pidTrackPos2Pion != TrackSelectorPID::Rejected; + bool const pidDsToKKPi = pidTrackPos1Kaon != TrackSelectorPID::Rejected && + pidTrackNegKaon != TrackSelectorPID::Rejected && + pidTrackPos2Pion != TrackSelectorPID::Rejected; - bool pidDsToPiKK = pidTrackPos1Pion != TrackSelectorPID::Rejected && - pidTrackNegKaon != TrackSelectorPID::Rejected && - pidTrackPos2Kaon != TrackSelectorPID::Rejected; + bool const pidDsToPiKK = pidTrackPos1Pion != TrackSelectorPID::Rejected && + pidTrackNegKaon != TrackSelectorPID::Rejected && + pidTrackPos2Kaon != TrackSelectorPID::Rejected; if (!pidDsToKKPi && !pidDsToPiKK) { hfSelDsToKKPiCandidate(statusDsToKKPi, statusDsToPiKK); diff --git a/PWGHF/TableProducer/candidateSelectorDstarToD0Pi.cxx b/PWGHF/TableProducer/candidateSelectorDstarToD0Pi.cxx index b720e3da614..ae30c15f231 100644 --- a/PWGHF/TableProducer/candidateSelectorDstarToD0Pi.cxx +++ b/PWGHF/TableProducer/candidateSelectorDstarToD0Pi.cxx @@ -393,7 +393,7 @@ struct HfCandidateSelectorDstarToD0Pi { // need to add special cuts (additional cuts on decay length and d0 norm) // conjugate-dependent topological selection for Dstar - bool topoDstar = selectionTopolConjugate(candDstar); + bool const topoDstar = selectionTopolConjugate(candDstar); if (!topoDstar) { hfSelDstarCandidate(statusDstar, statusD0Flag, statusTopol, statusCand, statusPID); if (applyMl) { diff --git a/PWGHF/TableProducer/candidateSelectorLbToLcPi.cxx b/PWGHF/TableProducer/candidateSelectorLbToLcPi.cxx index 9b60e8d67fb..f698e250b27 100644 --- a/PWGHF/TableProducer/candidateSelectorLbToLcPi.cxx +++ b/PWGHF/TableProducer/candidateSelectorLbToLcPi.cxx @@ -69,7 +69,7 @@ struct HfCandidateSelectorLbToLcPi { bool passesImpactParameterResolution(float pT, float d0Resolution) { - float expectedResolution(0.001 + 0.0052 * std::exp(-0.655 * pT)); + float const expectedResolution(0.001 + 0.0052 * std::exp(-0.655 * pT)); return d0Resolution <= expectedResolution * 1.5; } // Compares to pT dependent cut on impact parameter resolution @@ -78,7 +78,7 @@ struct HfCandidateSelectorLbToLcPi { bool selectionTopol(const T1& hfCandLb, const T2& hfCandLc, const T3& trackPi) { auto candpT = hfCandLb.pt(); - int pTBin = findBin(binsPt, candpT); + int const pTBin = findBin(binsPt, candpT); if (pTBin == -1) { // LOGF(debug, "Lb topol selection failed at getpTBin"); return false; @@ -155,10 +155,10 @@ struct HfCandidateSelectorLbToLcPi { } // distance between Lb and Lc decay - float diffXVert = hfCandLb.xSecondaryVertex() - hfCandLc.xSecondaryVertex(); - float diffYVert = hfCandLb.ySecondaryVertex() - hfCandLc.ySecondaryVertex(); - float diffZVert = hfCandLb.zSecondaryVertex() - hfCandLc.zSecondaryVertex(); - float vertexDistance = std::sqrt(diffXVert * diffXVert + diffYVert * diffYVert + diffZVert * diffZVert); + float const diffXVert = hfCandLb.xSecondaryVertex() - hfCandLc.xSecondaryVertex(); + float const diffYVert = hfCandLb.ySecondaryVertex() - hfCandLc.ySecondaryVertex(); + float const diffZVert = hfCandLb.zSecondaryVertex() - hfCandLc.zSecondaryVertex(); + float const vertexDistance = std::sqrt(diffXVert * diffXVert + diffYVert * diffYVert + diffZVert * diffZVert); return vertexDistance <= maxVertexDistanceLbLc; } @@ -178,9 +178,9 @@ struct HfCandidateSelectorLbToLcPi { auto track0 = candLc.prong0_as(); auto track1 = candLc.prong1_as(); auto track2 = candLc.prong2_as(); - float reso0 = candLc.errorImpactParameter0(); - float reso1 = candLc.errorImpactParameter1(); - float reso2 = candLc.errorImpactParameter2(); + float const reso0 = candLc.errorImpactParameter0(); + float const reso1 = candLc.errorImpactParameter1(); + float const reso2 = candLc.errorImpactParameter2(); if (!passesImpactParameterResolution(track0.pt(), reso0) || !passesImpactParameterResolution(track1.pt(), reso1) || !passesImpactParameterResolution(track2.pt(), reso2) || !passesImpactParameterResolution(trackPi.pt(), hfCandLb.errorImpactParameter1())) { hfSelLbToLcPiCandidate(statusLb); continue; diff --git a/PWGHF/TableProducer/candidateSelectorLc.cxx b/PWGHF/TableProducer/candidateSelectorLc.cxx index da9ed2fe089..ded5f282810 100644 --- a/PWGHF/TableProducer/candidateSelectorLc.cxx +++ b/PWGHF/TableProducer/candidateSelectorLc.cxx @@ -212,7 +212,7 @@ struct HfCandidateSelectorLc { { auto candpT = candidate.pt(); - int pTBin = findBin(binsPt, candpT); + int const pTBin = findBin(binsPt, candpT); if (pTBin == -1) { return false; } @@ -290,7 +290,7 @@ struct HfCandidateSelectorLc { { auto candpT = candidate.pt(); - int pTBin = findBin(binsPt, candpT); + int const pTBin = findBin(binsPt, candpT); if (pTBin == -1) { return false; } @@ -475,7 +475,7 @@ struct HfCandidateSelectorLc { // implement filter bit 4 cut - should be done before this task at the track selection level // track quality selection - bool trackQualitySel = isSelectedCandidateProngQuality(trackPos1, trackNeg, trackPos2); + bool const trackQualitySel = isSelectedCandidateProngQuality(trackPos1, trackNeg, trackPos2); if (!trackQualitySel) { hfSelLcCandidate(statusLcToPKPi, statusLcToPiKP); if (applyMl) { @@ -494,8 +494,8 @@ struct HfCandidateSelectorLc { } // conjugate-dependent topological selection for Lc - bool topolLcToPKPi = selectionTopolConjugate(candidate, trackPos1, trackNeg, trackPos2); - bool topolLcToPiKP = selectionTopolConjugate(candidate, trackPos2, trackNeg, trackPos1); + bool const topolLcToPKPi = selectionTopolConjugate(candidate, trackPos1, trackNeg, trackPos2); + bool const topolLcToPiKP = selectionTopolConjugate(candidate, trackPos2, trackNeg, trackPos1); if (!topolLcToPKPi && !topolLcToPiKP) { hfSelLcCandidate(statusLcToPKPi, statusLcToPiKP); @@ -545,11 +545,11 @@ struct HfCandidateSelectorLc { } if constexpr (UseBayesPid) { - TrackSelectorPID::Status pidBayesTrackPos1Proton = selectorProton.statusBayes(trackPos1); - TrackSelectorPID::Status pidBayesTrackPos2Proton = selectorProton.statusBayes(trackPos2); - TrackSelectorPID::Status pidBayesTrackPos1Pion = selectorPion.statusBayes(trackPos1); - TrackSelectorPID::Status pidBayesTrackPos2Pion = selectorPion.statusBayes(trackPos2); - TrackSelectorPID::Status pidBayesTrackNegKaon = selectorKaon.statusBayes(trackNeg); + TrackSelectorPID::Status const pidBayesTrackPos1Proton = selectorProton.statusBayes(trackPos1); + TrackSelectorPID::Status const pidBayesTrackPos2Proton = selectorProton.statusBayes(trackPos2); + TrackSelectorPID::Status const pidBayesTrackPos1Pion = selectorPion.statusBayes(trackPos1); + TrackSelectorPID::Status const pidBayesTrackPos2Pion = selectorPion.statusBayes(trackPos2); + TrackSelectorPID::Status const pidBayesTrackNegKaon = selectorKaon.statusBayes(trackNeg); if (!isSelectedPID(pidBayesTrackPos1Proton, pidBayesTrackNegKaon, pidBayesTrackPos2Pion)) { pidBayesLcToPKPi = 0; // reject LcToPKPi diff --git a/PWGHF/TableProducer/candidateSelectorLcPidMl.cxx b/PWGHF/TableProducer/candidateSelectorLcPidMl.cxx index b9298145bc1..ce791afe7b1 100644 --- a/PWGHF/TableProducer/candidateSelectorLcPidMl.cxx +++ b/PWGHF/TableProducer/candidateSelectorLcPidMl.cxx @@ -118,7 +118,7 @@ struct HfCandidateSelectorLcPidMl { selectorKaon = selectorPion; selectorProton = selectorPion; - AxisSpec bdtAxis{100, 0.f, 1.f}; + AxisSpec const bdtAxis{100, 0.f, 1.f}; if (applyML && activateQA) { registry.add("hLcBDTScoreBkg", "BDT background score distribution for Lc;BDT background score;counts", HistType::kTH1F, {bdtAxis}); registry.add("hLcBDTScorePrompt", "BDT prompt score distribution for Lc;BDT prompt score;counts", HistType::kTH1F, {bdtAxis}); @@ -128,7 +128,7 @@ struct HfCandidateSelectorLcPidMl { ccdbApi.init(url); // init ONNX runtime session - std::map metadata; + std::map const metadata; std::map headers; bool retrieveSuccess = true; if (applyML) { @@ -147,7 +147,7 @@ struct HfCandidateSelectorLcPidMl { if (retrieveSuccess) { auto session = model.getSession(); std::vector> inputShapes; - Ort::AllocatorWithDefaultOptions tmpAllocator; + Ort::AllocatorWithDefaultOptions const tmpAllocator; for (size_t i = 0; i < session->GetInputCount(); ++i) { inputShapes.emplace_back(session->GetInputTypeInfo(i).GetTensorTypeAndShapeInfo().GetShape()); } @@ -196,11 +196,11 @@ struct HfCandidateSelectorLcPidMl { pidLcToPiKP = 1; } else { // track-level PID selection - TrackSelectorPID::Status pidTrackPos1Proton = selectorProton.statusTpcOrTof(trackPos1, candidate.nSigTpcPr0(), candidate.nSigTofPr0()); - TrackSelectorPID::Status pidTrackPos2Proton = selectorProton.statusTpcOrTof(trackPos2, candidate.nSigTpcPr2(), candidate.nSigTofPr2()); - TrackSelectorPID::Status pidTrackPos1Pion = selectorPion.statusTpcOrTof(trackPos1, candidate.nSigTpcPi0(), candidate.nSigTofPi0()); - TrackSelectorPID::Status pidTrackPos2Pion = selectorPion.statusTpcOrTof(trackPos2, candidate.nSigTpcPi2(), candidate.nSigTofPi2()); - TrackSelectorPID::Status pidTrackNegKaon = selectorKaon.statusTpcOrTof(trackNeg, candidate.nSigTpcKa1(), candidate.nSigTofKa1()); + TrackSelectorPID::Status const pidTrackPos1Proton = selectorProton.statusTpcOrTof(trackPos1, candidate.nSigTpcPr0(), candidate.nSigTofPr0()); + TrackSelectorPID::Status const pidTrackPos2Proton = selectorProton.statusTpcOrTof(trackPos2, candidate.nSigTpcPr2(), candidate.nSigTofPr2()); + TrackSelectorPID::Status const pidTrackPos1Pion = selectorPion.statusTpcOrTof(trackPos1, candidate.nSigTpcPi0(), candidate.nSigTofPi0()); + TrackSelectorPID::Status const pidTrackPos2Pion = selectorPion.statusTpcOrTof(trackPos2, candidate.nSigTpcPi2(), candidate.nSigTofPi2()); + TrackSelectorPID::Status const pidTrackNegKaon = selectorKaon.statusTpcOrTof(trackNeg, candidate.nSigTpcKa1(), candidate.nSigTofKa1()); if (pidTrackPos1Proton == TrackSelectorPID::Accepted && pidTrackNegKaon == TrackSelectorPID::Accepted && @@ -227,11 +227,11 @@ struct HfCandidateSelectorLcPidMl { pidBayesLcToPKPi = 1; pidBayesLcToPiKP = 1; } else { - int pidBayesTrackPos1Proton = selectorProton.statusBayes(trackPos1); - int pidBayesTrackPos2Proton = selectorProton.statusBayes(trackPos2); - int pidBayesTrackPos1Pion = selectorPion.statusBayes(trackPos1); - int pidBayesTrackPos2Pion = selectorPion.statusBayes(trackPos2); - int pidBayesTrackNegKaon = selectorKaon.statusBayes(trackNeg); + int const pidBayesTrackPos1Proton = selectorProton.statusBayes(trackPos1); + int const pidBayesTrackPos2Proton = selectorProton.statusBayes(trackPos2); + int const pidBayesTrackPos1Pion = selectorPion.statusBayes(trackPos1); + int const pidBayesTrackPos2Pion = selectorPion.statusBayes(trackPos2); + int const pidBayesTrackNegKaon = selectorKaon.statusBayes(trackNeg); if (pidBayesTrackPos1Proton == TrackSelectorPID::Accepted && pidBayesTrackNegKaon == TrackSelectorPID::Accepted && @@ -277,9 +277,9 @@ struct HfCandidateSelectorLcPidMl { continue; } - std::array pVecPos1 = trackPos1.pVector(); - std::array pVecNeg = trackNeg.pVector(); - std::array pVecPos2 = trackPos2.pVector(); + std::array const pVecPos1 = trackPos1.pVector(); + std::array const pVecNeg = trackNeg.pVector(); + std::array const pVecPos2 = trackPos2.pVector(); const float massPi = o2::constants::physics::MassPiPlus; const float massK = o2::constants::physics::MassKPlus; const float massProton = o2::constants::physics::MassProton; diff --git a/PWGHF/TableProducer/candidateSelectorLcToK0sP.cxx b/PWGHF/TableProducer/candidateSelectorLcToK0sP.cxx index decf738d984..ae017847cf4 100644 --- a/PWGHF/TableProducer/candidateSelectorLcToK0sP.cxx +++ b/PWGHF/TableProducer/candidateSelectorLcToK0sP.cxx @@ -141,8 +141,8 @@ struct HfCandidateSelectorLcToK0sP { hfMlResponse.init(); // load histograms for ML score - AxisSpec axisScore = {100, 0, 1, "score"}; - AxisSpec axisBinsPt = {binsPtMl, "#it{p}_{T} (GeV/#it{c})"}; + AxisSpec const axisScore = {100, 0, 1, "score"}; + AxisSpec const axisBinsPt = {binsPtMl, "#it{p}_{T} (GeV/#it{c})"}; for (int classMl = 0; classMl < nClassesMl; classMl++) { hModelScore.push_back(registry.add(Form("hMlScoreClass%d", classMl), "Model score distribution for Lc;Model score;counts", HistType::kTH1F, {axisScore})); hModelScoreVsPtCand.push_back(registry.add(Form("hMlScoreClass%dVsPtCand", classMl), "Model score distribution for Lc;Model score;counts", HistType::kTH2F, {axisScore, axisBinsPt})); @@ -157,7 +157,7 @@ struct HfCandidateSelectorLcToK0sP { bool selectionTopol(const T& hfCandCascade) { auto candPt = hfCandCascade.pt(); - int ptBin = findBin(binsPt, candPt); + int const ptBin = findBin(binsPt, candPt); if (ptBin == -1) { return false; } @@ -245,7 +245,7 @@ struct HfCandidateSelectorLcToK0sP { auto ptCand = hfCandCascade.pt(); std::vector inputFeatures = hfMlResponse.getInputFeatures(hfCandCascade, bach); - bool isSelectedMl = hfMlResponse.isSelectedMl(inputFeatures, ptCand, outputMl); + bool const isSelectedMl = hfMlResponse.isSelectedMl(inputFeatures, ptCand, outputMl); for (int classMl = 0; classMl < nClassesMl; classMl++) { hModelScore[classMl]->Fill(outputMl[classMl]); @@ -285,7 +285,7 @@ struct HfCandidateSelectorLcToK0sP { } if (applyMl) { - bool isSelectedMlLcToK0sP = selectionMl(candidate, bach, outputMl); + bool const isSelectedMlLcToK0sP = selectionMl(candidate, bach, outputMl); hfMlLcToK0sPCandidate(outputMl); if (!isSelectedMlLcToK0sP) { @@ -328,7 +328,7 @@ struct HfCandidateSelectorLcToK0sP { } if (applyMl) { - bool isSelectedMlLcToK0sP = selectionMl(candidate, bach, outputMl); + bool const isSelectedMlLcToK0sP = selectionMl(candidate, bach, outputMl); hfMlLcToK0sPCandidate(outputMl); if (!isSelectedMlLcToK0sP) { diff --git a/PWGHF/TableProducer/candidateSelectorOmegac0ToOmegaKa.cxx b/PWGHF/TableProducer/candidateSelectorOmegac0ToOmegaKa.cxx index d65b56a40a9..0f514d9aa05 100644 --- a/PWGHF/TableProducer/candidateSelectorOmegac0ToOmegaKa.cxx +++ b/PWGHF/TableProducer/candidateSelectorOmegac0ToOmegaKa.cxx @@ -231,7 +231,7 @@ struct HfCandidateSelectorToOmegaKa { auto trackPiFromLam = trackV0NegDau; auto trackPrFromLam = trackV0PosDau; - int8_t signDecay = candidate.signDecay(); // sign of pi <- cascade + int8_t const signDecay = candidate.signDecay(); // sign of pi <- cascade if (signDecay > 0) { trackPiFromLam = trackV0PosDau; @@ -242,10 +242,10 @@ struct HfCandidateSelectorToOmegaKa { } // eta selection - double etaV0PosDau = candidate.etaV0PosDau(); - double etaV0NegDau = candidate.etaV0NegDau(); - double etaKaFromCasc = candidate.etaBachFromCasc(); - double etaKaFromCharmBaryon = candidate.etaBachFromCharmBaryon(); + double const etaV0PosDau = candidate.etaV0PosDau(); + double const etaV0NegDau = candidate.etaV0NegDau(); + double const etaKaFromCasc = candidate.etaBachFromCasc(); + double const etaKaFromCharmBaryon = candidate.etaBachFromCharmBaryon(); if (std::abs(etaV0PosDau) > etaTrackLFDauMax) { resultSelections = false; registry.fill(HIST("hSelEtaPosV0Dau"), 0); @@ -367,8 +367,8 @@ struct HfCandidateSelectorToOmegaKa { } // pT selections - double ptKaFromCasc = RecoDecay::sqrtSumOfSquares(candidate.pxBachFromCasc(), candidate.pyBachFromCasc()); - double ptKaFromCharmBaryon = RecoDecay::sqrtSumOfSquares(candidate.pxBachFromCharmBaryon(), candidate.pyBachFromCharmBaryon()); + double const ptKaFromCasc = RecoDecay::sqrtSumOfSquares(candidate.pxBachFromCasc(), candidate.pyBachFromCasc()); + double const ptKaFromCharmBaryon = RecoDecay::sqrtSumOfSquares(candidate.pxBachFromCharmBaryon(), candidate.pyBachFromCharmBaryon()); if (std::abs(ptKaFromCasc) < ptKaFromCascMin) { resultSelections = false; registry.fill(HIST("hSelPtKaFromCasc"), 0); @@ -500,9 +500,9 @@ struct HfCandidateSelectorToOmegaKa { bool statusInvMassCascade = false; bool statusInvMassCharmBaryon = false; - double invMassLambda = candidate.invMassLambda(); - double invMassCascade = candidate.invMassCascade(); - double invMassCharmBaryon = candidate.invMassCharmBaryon(); + double const invMassLambda = candidate.invMassLambda(); + double const invMassCascade = candidate.invMassCascade(); + double const invMassCharmBaryon = candidate.invMassCharmBaryon(); if (std::abs(invMassLambda - o2::constants::physics::MassLambda0) < v0MassWindow) { statusInvMassLambda = true; diff --git a/PWGHF/TableProducer/candidateSelectorOmegac0ToOmegaPi.cxx b/PWGHF/TableProducer/candidateSelectorOmegac0ToOmegaPi.cxx index 4fc0976c463..d05c87196be 100644 --- a/PWGHF/TableProducer/candidateSelectorOmegac0ToOmegaPi.cxx +++ b/PWGHF/TableProducer/candidateSelectorOmegac0ToOmegaPi.cxx @@ -303,7 +303,7 @@ struct HfCandidateSelectorToOmegaPi { { auto candpT = hfCandOmegac.ptCharmBaryon(); auto pionPtFromOmegac = hfCandOmegac.ptPiFromCharmBaryon(); - int pTBin = findBin(binsPt, candpT); + int const pTBin = findBin(binsPt, candpT); if (pTBin == -1) { return false; } @@ -357,7 +357,7 @@ struct HfCandidateSelectorToOmegaPi { auto trackPrFromLam = trackV0PosDau; auto ptCand = candidate.ptCharmBaryon(); - int8_t signDecay = candidate.signDecay(); // sign of pi <- cascade + int8_t const signDecay = candidate.signDecay(); // sign of pi <- cascade if (signDecay > 0) { trackPiFromLam = trackV0PosDau; @@ -382,10 +382,10 @@ struct HfCandidateSelectorToOmegaPi { } // eta selection - double etaV0PosDau = candidate.etaV0PosDau(); - double etaV0NegDau = candidate.etaV0NegDau(); - double etaKaFromCasc = candidate.etaBachFromCasc(); - double etaPiFromCharmBaryon = candidate.etaBachFromCharmBaryon(); + double const etaV0PosDau = candidate.etaV0PosDau(); + double const etaV0NegDau = candidate.etaV0NegDau(); + double const etaKaFromCasc = candidate.etaBachFromCasc(); + double const etaPiFromCharmBaryon = candidate.etaBachFromCharmBaryon(); if (std::abs(etaV0PosDau) > etaTrackLFDauMax) { resultSelections = false; registry.fill(HIST("hSelEtaPosV0Dau"), 0); @@ -507,8 +507,8 @@ struct HfCandidateSelectorToOmegaPi { } // pT selections - double ptKaFromCasc = RecoDecay::sqrtSumOfSquares(candidate.pxBachFromCasc(), candidate.pyBachFromCasc()); - double ptPiFromCharmBaryon = RecoDecay::sqrtSumOfSquares(candidate.pxBachFromCharmBaryon(), candidate.pyBachFromCharmBaryon()); + double const ptKaFromCasc = RecoDecay::sqrtSumOfSquares(candidate.pxBachFromCasc(), candidate.pyBachFromCasc()); + double const ptPiFromCharmBaryon = RecoDecay::sqrtSumOfSquares(candidate.pxBachFromCharmBaryon(), candidate.pyBachFromCharmBaryon()); if (std::abs(ptKaFromCasc) < ptKaFromCascMin) { resultSelections = false; registry.fill(HIST("hSelPtKaFromCasc"), 0); @@ -718,9 +718,9 @@ struct HfCandidateSelectorToOmegaPi { } // invariant mass cuts - double invMassLambda = candidate.invMassLambda(); - double invMassCascade = candidate.invMassCascade(); - double invMassCharmBaryon = candidate.invMassCharmBaryon(); + double const invMassLambda = candidate.invMassLambda(); + double const invMassCascade = candidate.invMassCascade(); + double const invMassCharmBaryon = candidate.invMassCharmBaryon(); if (std::abs(invMassLambda - o2::constants::physics::MassLambda0) < v0MassWindow) { statusInvMassLambda = true; diff --git a/PWGHF/TableProducer/candidateSelectorOmegac0Xic0ToOmegaKa.cxx b/PWGHF/TableProducer/candidateSelectorOmegac0Xic0ToOmegaKa.cxx index 39939f7e095..1dd9ad697e3 100644 --- a/PWGHF/TableProducer/candidateSelectorOmegac0Xic0ToOmegaKa.cxx +++ b/PWGHF/TableProducer/candidateSelectorOmegac0Xic0ToOmegaKa.cxx @@ -191,7 +191,7 @@ struct HfCandidateSelectorToOmegaKa { const AxisSpec thnAxisMass{thnConfigAxisMass, "inv. mass (#Omega#Ka) (GeV/#it{c}^{2})"}; const AxisSpec thnAxisPt{thnConfigAxisPt, "#it{p}_{T} (GeV/#it{c})"}; const AxisSpec thnAxisPtKaon{thnConfigAxisPtKaon, "Pt of Kaon from Omegac0."}; - std::vector axes = {thnAxisMass, thnAxisPt, thnAxisPtKaon}; + std::vector const axes = {thnAxisMass, thnAxisPt, thnAxisPtKaon}; registry.add("hMassVsPtVsPtKaon", "Thn for Omegac0 or Xic candidates with InvmassOmegaKa&pT&pTKa", HistType::kTHnSparseF, axes); registry.get(HIST("hMassVsPtVsPtKaon"))->Sumw2(); @@ -266,7 +266,7 @@ struct HfCandidateSelectorToOmegaKa { { auto candpT = hfCandOmegaKa.kfPtOmegaKa(); auto kaPtFromOmegaKa = hfCandOmegaKa.kfPtKaFromOmegaKa(); - int pTBin = findBin(binsPt, candpT); + int const pTBin = findBin(binsPt, candpT); if (pTBin == -1) { return false; } @@ -320,7 +320,7 @@ struct HfCandidateSelectorToOmegaKa { auto trackPiFromLam = trackV0NegDau; auto trackPrFromLam = trackV0PosDau; - int8_t signDecay = candidate.signDecay(); // sign of pi <- cascade + int8_t const signDecay = candidate.signDecay(); // sign of pi <- cascade if (signDecay > 0) { trackPiFromLam = trackV0PosDau; @@ -336,10 +336,10 @@ struct HfCandidateSelectorToOmegaKa { } // eta selection - double etaV0DauPr = candidate.etaV0DauPr(); - double etaV0DauPi = candidate.etaV0DauPi(); - double etaKaFromCasc = candidate.etaBachFromCasc(); - double etaKaFromCharmBaryon = candidate.etaBachFromCharmBaryon(); + double const etaV0DauPr = candidate.etaV0DauPr(); + double const etaV0DauPi = candidate.etaV0DauPi(); + double const etaKaFromCasc = candidate.etaBachFromCasc(); + double const etaKaFromCharmBaryon = candidate.etaBachFromCharmBaryon(); if (std::abs(etaV0DauPr) > etaTrackLFDauMax) { resultSelections = false; registry.fill(HIST("hSelEtaPosV0Dau"), 0); @@ -618,9 +618,9 @@ struct HfCandidateSelectorToOmegaKa { } // invariant mass cuts - double invMassLambda = candidate.invMassLambda(); - double invMassCascade = candidate.invMassCascade(); - double invMassCharmBaryon = candidate.invMassCharmBaryon(); + double const invMassLambda = candidate.invMassLambda(); + double const invMassCascade = candidate.invMassCascade(); + double const invMassCharmBaryon = candidate.invMassCharmBaryon(); if (std::abs(invMassLambda - o2::constants::physics::MassLambda0) < v0MassWindow) { statusInvMassLambda = true; diff --git a/PWGHF/TableProducer/candidateSelectorToXiPi.cxx b/PWGHF/TableProducer/candidateSelectorToXiPi.cxx index 4372e3cb40a..3a53c0532f9 100644 --- a/PWGHF/TableProducer/candidateSelectorToXiPi.cxx +++ b/PWGHF/TableProducer/candidateSelectorToXiPi.cxx @@ -196,8 +196,8 @@ struct HfCandidateSelectorToXiPi { TracksSelLf const& lfTracks) { - double massLambdaFromPDG = o2::constants::physics::MassLambda0; - double massXiFromPDG = o2::constants::physics::MassXiMinus; + double const massLambdaFromPDG = o2::constants::physics::MassLambda0; + double const massXiFromPDG = o2::constants::physics::MassXiMinus; // looping over charm baryon candidates for (const auto& candidate : candidates) { @@ -216,7 +216,7 @@ struct HfCandidateSelectorToXiPi { auto trackPiFromLam = trackV0NegDau; auto trackPrFromLam = trackV0PosDau; - int8_t signDecay = candidate.signDecay(); // sign of pi <- cascade + int8_t const signDecay = candidate.signDecay(); // sign of pi <- cascade if (signDecay > 0) { trackPiFromLam = trackV0PosDau; @@ -227,10 +227,10 @@ struct HfCandidateSelectorToXiPi { } // eta selection - double etaV0PosDau = candidate.etaV0PosDau(); - double etaV0NegDau = candidate.etaV0NegDau(); - double etaPiFromCasc = candidate.etaBachFromCasc(); - double etaPiFromCharmBaryon = candidate.etaBachFromCharmBaryon(); + double const etaV0PosDau = candidate.etaV0PosDau(); + double const etaV0NegDau = candidate.etaV0NegDau(); + double const etaPiFromCasc = candidate.etaBachFromCasc(); + double const etaPiFromCharmBaryon = candidate.etaBachFromCharmBaryon(); if (std::abs(etaV0PosDau) > etaTrackLFDauMax) { resultSelections = false; registry.fill(HIST("hSelEtaPosV0Dau"), 0); @@ -352,8 +352,8 @@ struct HfCandidateSelectorToXiPi { } // pT selections - double ptPiFromCasc = RecoDecay::sqrtSumOfSquares(candidate.pxBachFromCasc(), candidate.pyBachFromCasc()); - double ptPiFromCharmBaryon = RecoDecay::sqrtSumOfSquares(candidate.pxBachFromCharmBaryon(), candidate.pyBachFromCharmBaryon()); + double const ptPiFromCasc = RecoDecay::sqrtSumOfSquares(candidate.pxBachFromCasc(), candidate.pyBachFromCasc()); + double const ptPiFromCharmBaryon = RecoDecay::sqrtSumOfSquares(candidate.pxBachFromCharmBaryon(), candidate.pyBachFromCharmBaryon()); if (std::abs(ptPiFromCasc) < ptPiFromCascMin) { resultSelections = false; registry.fill(HIST("hSelPtPiFromCasc"), 0); @@ -485,9 +485,9 @@ struct HfCandidateSelectorToXiPi { bool statusInvMassCascade = false; bool statusInvMassCharmBaryon = false; - double invMassLambda = candidate.invMassLambda(); - double invMassCascade = candidate.invMassCascade(); - double invMassCharmBaryon = candidate.invMassCharmBaryon(); + double const invMassLambda = candidate.invMassLambda(); + double const invMassCascade = candidate.invMassCascade(); + double const invMassCharmBaryon = candidate.invMassCharmBaryon(); if (std::abs(invMassLambda - massLambdaFromPDG) < v0MassWindow) { statusInvMassLambda = true; diff --git a/PWGHF/TableProducer/candidateSelectorXic0ToXiPiKf.cxx b/PWGHF/TableProducer/candidateSelectorXic0ToXiPiKf.cxx index 341328ebb97..f40b2c030e5 100644 --- a/PWGHF/TableProducer/candidateSelectorXic0ToXiPiKf.cxx +++ b/PWGHF/TableProducer/candidateSelectorXic0ToXiPiKf.cxx @@ -226,7 +226,7 @@ struct HfCandidateSelectorXic0ToXiPiKf { auto trackPiFromLam = trackV0NegDau; auto trackPrFromLam = trackV0PosDau; - int8_t signDecay = candidate.signDecay(); // sign of pi <- cascade + int8_t const signDecay = candidate.signDecay(); // sign of pi <- cascade if (signDecay > 0) { trackPiFromLam = trackV0PosDau; @@ -237,14 +237,14 @@ struct HfCandidateSelectorXic0ToXiPiKf { } // eta selection - double etaV0PosDau = candidate.etaV0PosDau(); - double etaV0NegDau = candidate.etaV0NegDau(); - double etaPiFromCasc = candidate.etaBachFromCasc(); - double etaPiFromCharmBaryon = candidate.etaBachFromCharmBaryon(); + double const etaV0PosDau = candidate.etaV0PosDau(); + double const etaV0NegDau = candidate.etaV0NegDau(); + double const etaPiFromCasc = candidate.etaBachFromCasc(); + double const etaPiFromCharmBaryon = candidate.etaBachFromCharmBaryon(); if (std::abs(etaV0PosDau) > etaTrackLFDauMax || std::abs(etaV0NegDau) > etaTrackLFDauMax || std::abs(etaPiFromCasc) > etaTrackLFDauMax || std::abs(etaPiFromCharmBaryon) > etaTrackCharmBachMax) { resultSelections = false; } - double ptPiFromCasc = RecoDecay::sqrtSumOfSquares(candidate.pxBachFromCasc(), candidate.pyBachFromCasc()); + double const ptPiFromCasc = RecoDecay::sqrtSumOfSquares(candidate.pxBachFromCasc(), candidate.pyBachFromCasc()); if (std::abs(ptPiFromCasc) < ptPiFromCascMin) { resultSelections = false; registry.fill(HIST("hSelPtPiFromCasc"), 0); @@ -384,9 +384,9 @@ struct HfCandidateSelectorXic0ToXiPiKf { bool statusInvMassCascade = false; bool statusInvMassCharmBaryon = false; - double invMassLambda = candidate.invMassLambda(); - double invMassCascade = candidate.invMassCascade(); - double invMassCharmBaryon = candidate.invMassCharmBaryon(); + double const invMassLambda = candidate.invMassLambda(); + double const invMassCascade = candidate.invMassCascade(); + double const invMassCharmBaryon = candidate.invMassCharmBaryon(); if (resultSelections) { resultSelections = selectionTopolKf(candidate); @@ -483,12 +483,12 @@ struct HfCandidateSelectorXic0ToXiPiKf { { auto candpT = RecoDecay::pt(candidate.pxCharmBaryon(), candidate.pyCharmBaryon()); - int pTBin = findBin(binsPt, candpT); + int const pTBin = findBin(binsPt, candpT); if (pTBin == -1) { return false; } - double ptPiFromCharmBaryon = RecoDecay::sqrtSumOfSquares(candidate.pxBachFromCharmBaryon(), candidate.pyBachFromCharmBaryon()); + double const ptPiFromCharmBaryon = RecoDecay::sqrtSumOfSquares(candidate.pxBachFromCharmBaryon(), candidate.pyBachFromCharmBaryon()); if (ptPiFromCharmBaryon <= cuts->get(pTBin, "ptPiFromCharmBaryon")) { return false; } diff --git a/PWGHF/TableProducer/candidateSelectorXicToPKPi.cxx b/PWGHF/TableProducer/candidateSelectorXicToPKPi.cxx index 3da2a9de721..2ed4e2b329f 100644 --- a/PWGHF/TableProducer/candidateSelectorXicToPKPi.cxx +++ b/PWGHF/TableProducer/candidateSelectorXicToPKPi.cxx @@ -148,7 +148,7 @@ struct HfCandidateSelectorXicToPKPi { bool selectionTopol(const T& candidate) { auto candpT = candidate.pt(); - int pTBin = findBin(binsPt, candpT); + int const pTBin = findBin(binsPt, candpT); if (pTBin == -1) { return false; } @@ -212,7 +212,7 @@ struct HfCandidateSelectorXicToPKPi { { auto candpT = candidate.pt(); - int pTBin = findBin(binsPt, candpT); + int const pTBin = findBin(binsPt, candpT); if (pTBin == -1) { return false; } @@ -283,8 +283,8 @@ struct HfCandidateSelectorXicToPKPi { // conjugate-dependent topplogical selection for Xic - bool topolXicToPKPi = selectionTopolConjugate(candidate, trackPos1, trackNeg, trackPos2); - bool topolXicToPiKP = selectionTopolConjugate(candidate, trackPos2, trackNeg, trackPos1); + bool const topolXicToPKPi = selectionTopolConjugate(candidate, trackPos1, trackNeg, trackPos2); + bool const topolXicToPiKP = selectionTopolConjugate(candidate, trackPos2, trackNeg, trackPos1); if (!topolXicToPKPi && !topolXicToPiKP) { hfSelXicToPKPiCandidate(statusXicToPKPi, statusXicToPiKP); diff --git a/PWGHF/TableProducer/candidateSelectorXicToXiPiPi.cxx b/PWGHF/TableProducer/candidateSelectorXicToXiPiPi.cxx index ea5aa8009fa..b5f5c2cb64c 100644 --- a/PWGHF/TableProducer/candidateSelectorXicToXiPiPi.cxx +++ b/PWGHF/TableProducer/candidateSelectorXicToXiPiPi.cxx @@ -386,7 +386,7 @@ struct HfCandidateSelectorXicToXiPiPi { // check whether candidate is in analyzed pT range auto ptCandXic = hfCandXic.pt(); - int pTBin = findBin(binsPt, ptCandXic); + int const pTBin = findBin(binsPt, ptCandXic); if (pTBin == -1) { return false; } @@ -671,7 +671,7 @@ struct HfCandidateSelectorXicToXiPiPi { bool const isMatchedSignal = false) { bool isSelectedMlXicToXiPiPi = false; - float ptCandXic = hfCandXic.pt(); + float const ptCandXic = hfCandXic.pt(); std::vector inputFeaturesXicToXiPiPi = hfMlResponse.getInputFeatures(hfCandXic); isSelectedMlXicToXiPiPi = hfMlResponse.isSelectedMl(inputFeaturesXicToXiPiPi, ptCandXic, outputMlXicToXiPiPi); diff --git a/PWGHF/TableProducer/candidateSelectorXiccToPKPiPi.cxx b/PWGHF/TableProducer/candidateSelectorXiccToPKPiPi.cxx index 669d1331569..24057d1e59b 100644 --- a/PWGHF/TableProducer/candidateSelectorXiccToPKPiPi.cxx +++ b/PWGHF/TableProducer/candidateSelectorXiccToPKPiPi.cxx @@ -80,7 +80,7 @@ struct HfCandidateSelectorXiccToPKPiPi { bool selectionTopol(const T1& hfCandXicc, const T2& hfCandXic, const T3& trackPi) { auto candpT = hfCandXicc.pt(); - int pTBin = findBin(binsPt, candpT); + int const pTBin = findBin(binsPt, candpT); if (pTBin == -1) { return false; } @@ -179,7 +179,7 @@ struct HfCandidateSelectorXiccToPKPiPi { pidPi = 1; } else { // track-level PID selection - int pidPion = selectorPion.statusTpcOrTof(trackPi); + int const pidPion = selectorPion.statusTpcOrTof(trackPi); if (pidPion == TrackSelectorPID::Accepted) { pidPi = 1; } diff --git a/PWGHF/TableProducer/derivedDataCreatorB0ToDPi.cxx b/PWGHF/TableProducer/derivedDataCreatorB0ToDPi.cxx index 960dbc272a4..862e3da3d38 100644 --- a/PWGHF/TableProducer/derivedDataCreatorB0ToDPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorB0ToDPi.cxx @@ -296,7 +296,7 @@ struct HfDerivedDataCreatorB0ToDPi { continue; } if (downSampleBkgFactor < 1.) { - float pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); + float const pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); if (candidate.pt() < ptMaxForDownSample && pseudoRndm >= downSampleBkgFactor) { continue; } @@ -310,9 +310,9 @@ struct HfDerivedDataCreatorB0ToDPi { } auto prongCharm = candidate.template prong0_as(); auto prongBachelor = candidate.template prong1_as(); - double ct = hfHelper.ctB0(candidate); - double y = hfHelper.yB0(candidate); - float massB0ToDPi = hfHelper.invMassB0ToDPi(candidate); + double const ct = hfHelper.ctB0(candidate); + double const y = hfHelper.yB0(candidate); + float const massB0ToDPi = hfHelper.invMassB0ToDPi(candidate); float mlScoreB0ToDPi{-1.f}; std::vector mlScoresDplus; std::copy(prongCharm.mlProbDplusToPiKPi().begin(), prongCharm.mlProbDplusToPiKPi().end(), std::back_inserter(mlScoresDplus)); diff --git a/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx b/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx index b05bb4f967d..6e33f7b4f1d 100644 --- a/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx @@ -299,7 +299,7 @@ struct HfDerivedDataCreatorBplusToD0Pi { continue; } if (downSampleBkgFactor < 1.) { - float pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); + float const pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); if (candidate.pt() < ptMaxForDownSample && pseudoRndm >= downSampleBkgFactor) { continue; } @@ -313,12 +313,12 @@ struct HfDerivedDataCreatorBplusToD0Pi { } auto prongCharm = candidate.template prong0_as(); auto prongBachelor = candidate.template prong1_as(); - double ct = hfHelper.ctBplus(candidate); - double y = hfHelper.yBplus(candidate); - float massBplusToD0Pi = hfHelper.invMassBplusToD0Pi(candidate); + double const ct = hfHelper.ctBplus(candidate); + double const y = hfHelper.yBplus(candidate); + float const massBplusToD0Pi = hfHelper.invMassBplusToD0Pi(candidate); float mlScoreBplusToD0Pi{-1.f}; std::vector mlScoresD0; - bool isD0 = prongBachelor.sign() < 0; + bool const isD0 = prongBachelor.sign() < 0; if (isD0) { // is D0 std::copy(prongCharm.mlProbD0().begin(), prongCharm.mlProbD0().end(), std::back_inserter(mlScoresD0)); } else { // is D0bar diff --git a/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx index d80e75330ce..ece7eba03c4 100644 --- a/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx @@ -289,7 +289,7 @@ struct HfDerivedDataCreatorD0ToKPi { continue; } if (downSampleBkgFactor < 1.) { - float pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); + float const pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); if (candidate.pt() < ptMaxForDownSample && pseudoRndm >= downSampleBkgFactor) { continue; } @@ -302,15 +302,15 @@ struct HfDerivedDataCreatorD0ToKPi { } } else { if (downSampleBkgFactor < 1.) { - float pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); + float const pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); if (candidate.pt() < ptMaxForDownSample && pseudoRndm >= downSampleBkgFactor) { continue; } } } - double ct = hfHelper.ctD0(candidate); - double y = hfHelper.yD0(candidate); + double const ct = hfHelper.ctD0(candidate); + double const y = hfHelper.yD0(candidate); float massD0, massD0bar; float topolChi2PerNdf = -999.; if constexpr (ReconstructionType == aod::hf_cand::VertexerType::KfParticle) { diff --git a/PWGHF/TableProducer/derivedDataCreatorDplusToPiKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorDplusToPiKPi.cxx index c71f1966ed4..c8bf7a1ee3b 100644 --- a/PWGHF/TableProducer/derivedDataCreatorDplusToPiKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorDplusToPiKPi.cxx @@ -270,7 +270,7 @@ struct HfDerivedDataCreatorDplusToPiKPi { continue; } if (downSampleBkgFactor < 1.) { - float pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); + float const pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); if (candidate.pt() < ptMaxForDownSample && pseudoRndm >= downSampleBkgFactor) { continue; } @@ -282,9 +282,9 @@ struct HfDerivedDataCreatorDplusToPiKPi { } } } - double ct = hfHelper.ctDplus(candidate); - double y = hfHelper.yDplus(candidate); - float massDplusToPiKPi = hfHelper.invMassDplusToPiKPi(candidate); + double const ct = hfHelper.ctDplus(candidate); + double const y = hfHelper.yDplus(candidate); + float const massDplusToPiKPi = hfHelper.invMassDplusToPiKPi(candidate); std::vector mlScoresDplusToPiKPi; if constexpr (IsMl) { std::copy(candidate.mlProbDplusToPiKPi().begin(), candidate.mlProbDplusToPiKPi().end(), std::back_inserter(mlScoresDplusToPiKPi)); diff --git a/PWGHF/TableProducer/derivedDataCreatorDsToKKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorDsToKKPi.cxx index 7a8a4e9cd12..5eb404e57ab 100644 --- a/PWGHF/TableProducer/derivedDataCreatorDsToKKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorDsToKKPi.cxx @@ -276,7 +276,7 @@ struct HfDerivedDataCreatorDsToKKPi { continue; } if (downSampleBkgFactor < 1.) { - float pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); + float const pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); if (candidate.pt() < ptMaxForDownSample && pseudoRndm >= downSampleBkgFactor) { continue; } @@ -288,9 +288,9 @@ struct HfDerivedDataCreatorDsToKKPi { } } } - double ct = hfHelper.ctDs(candidate); - double y = hfHelper.yDs(candidate); - float massDsToKKPi = hfHelper.invMassDsToKKPi(candidate); + double const ct = hfHelper.ctDs(candidate); + double const y = hfHelper.yDs(candidate); + float const massDsToKKPi = hfHelper.invMassDsToKKPi(candidate); std::vector mlScoresDsToKKPi; if constexpr (IsMl) { std::copy(candidate.mlProbDsToKKPi().begin(), candidate.mlProbDsToKKPi().end(), std::back_inserter(mlScoresDsToKKPi)); diff --git a/PWGHF/TableProducer/derivedDataCreatorDstarToD0Pi.cxx b/PWGHF/TableProducer/derivedDataCreatorDstarToD0Pi.cxx index 3374904bf91..dfbfce30e68 100644 --- a/PWGHF/TableProducer/derivedDataCreatorDstarToD0Pi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorDstarToD0Pi.cxx @@ -267,7 +267,7 @@ struct HfDerivedDataCreatorDstarToD0Pi { continue; } if (downSampleBkgFactor < 1.) { - float pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); + float const pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); if (candidate.pt() < ptMaxForDownSample && pseudoRndm >= downSampleBkgFactor) { continue; } @@ -282,7 +282,7 @@ struct HfDerivedDataCreatorDstarToD0Pi { auto prong0 = candidate.template prong0_as(); auto prong1 = candidate.template prong1_as(); auto prongSoftPi = candidate.template prongPi_as(); - double y = candidate.y(o2::constants::physics::MassDStar); + double const y = candidate.y(o2::constants::physics::MassDStar); int flagSign = -1; double massDstar = 0, invMassD0 = 0; std::vector mlScoresDstarToD0Pi; diff --git a/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx index 2576f072622..86688ca2bb5 100644 --- a/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx @@ -269,7 +269,7 @@ struct HfDerivedDataCreatorLcToPKPi { continue; } if (downSampleBkgFactor < 1.) { - float pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); + float const pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); if (candidate.pt() < ptMaxForDownSample && pseudoRndm >= downSampleBkgFactor) { continue; } @@ -282,16 +282,16 @@ struct HfDerivedDataCreatorLcToPKPi { } } else { if (downSampleBkgFactor < 1.) { - float pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); + float const pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); if (candidate.pt() < ptMaxForDownSample && pseudoRndm >= downSampleBkgFactor) { continue; } } } - double ct = hfHelper.ctLc(candidate); - double y = hfHelper.yLc(candidate); - float massLcToPKPi = hfHelper.invMassLcToPKPi(candidate); - float massLcToPiKP = hfHelper.invMassLcToPiKP(candidate); + double const ct = hfHelper.ctLc(candidate); + double const y = hfHelper.yLc(candidate); + float const massLcToPKPi = hfHelper.invMassLcToPKPi(candidate); + float const massLcToPiKP = hfHelper.invMassLcToPiKP(candidate); std::vector mlScoresLcToPKPi, mlScoresLcToPiKP; if constexpr (IsMl) { std::copy(candidate.mlProbLcToPKPi().begin(), candidate.mlProbLcToPKPi().end(), std::back_inserter(mlScoresLcToPKPi)); diff --git a/PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx b/PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx index a6ef21c011e..6dc0fac79d3 100644 --- a/PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorXicToXiPiPi.cxx @@ -272,7 +272,7 @@ struct HfDerivedDataCreatorXicToXiPiPi { continue; } if (downSampleBkgFactor < 1.) { - float pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); + float const pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); if (candidate.pt() < ptMaxForDownSample && pseudoRndm >= downSampleBkgFactor) { continue; } @@ -284,9 +284,9 @@ struct HfDerivedDataCreatorXicToXiPiPi { } } } - float massXicToXiPiPi = candidate.invMassXicPlus(); - double ct = hfHelper.ctXic(candidate); - double y = hfHelper.yXic(candidate); + float const massXicToXiPiPi = candidate.invMassXicPlus(); + double const ct = hfHelper.ctXic(candidate); + double const y = hfHelper.yXic(candidate); std::vector mlScoresXicToXiPiPi; if constexpr (IsMl) { std::copy(candidate.mlProbXicToXiPiPi().begin(), candidate.mlProbXicToXiPiPi().end(), std::back_inserter(mlScoresXicToXiPiPi)); diff --git a/PWGHF/TableProducer/mcPidTof.cxx b/PWGHF/TableProducer/mcPidTof.cxx index db35725d07c..f3b6aac8bbf 100644 --- a/PWGHF/TableProducer/mcPidTof.cxx +++ b/PWGHF/TableProducer/mcPidTof.cxx @@ -938,9 +938,9 @@ struct McPidTof { } float shift{0.f}, scaleWidth{0.f}; - int nPoints = gMcPostCalibMean[pidId]->GetN(); - double ptMin = gMcPostCalibMean[pidId]->GetX()[0]; - double ptMax = gMcPostCalibMean[pidId]->GetX()[nPoints - 1]; + int const nPoints = gMcPostCalibMean[pidId]->GetN(); + double const ptMin = gMcPostCalibMean[pidId]->GetX()[0]; + double const ptMax = gMcPostCalibMean[pidId]->GetX()[nPoints - 1]; if (trackPt < ptMin) { shift = gMcPostCalibMean[pidId]->Eval(ptMin); scaleWidth = gMcPostCalibSigma[pidId]->Eval(ptMin); diff --git a/PWGHF/TableProducer/trackIndexSkimCreator.cxx b/PWGHF/TableProducer/trackIndexSkimCreator.cxx index c89194ea71d..0bcb60aec6e 100644 --- a/PWGHF/TableProducer/trackIndexSkimCreator.cxx +++ b/PWGHF/TableProducer/trackIndexSkimCreator.cxx @@ -2676,8 +2676,8 @@ struct HfTrackIndexSkimCreator { } // 3-prong preselections - int8_t isIdentifiedPidTrackNeg1 = trackIndexNeg1.isIdentifiedPid(); - int8_t isIdentifiedPidTrackNeg2 = trackIndexNeg2.isIdentifiedPid(); + int8_t const isIdentifiedPidTrackNeg1 = trackIndexNeg1.isIdentifiedPid(); + int8_t const isIdentifiedPidTrackNeg2 = trackIndexNeg2.isIdentifiedPid(); applyPreselection3Prong(pVecTrackNeg1, pVecTrackPos1, pVecTrackNeg2, isIdentifiedPidTrackNeg1, isIdentifiedPidTrackNeg2, cutStatus3Prong, whichHypo3Prong, isSelected3ProngCand); if (!config.debug && isSelected3ProngCand == 0) { continue; diff --git a/PWGHF/TableProducer/treeCreatorB0ToDPi.cxx b/PWGHF/TableProducer/treeCreatorB0ToDPi.cxx index d3b2fabd1e3..b354d7e5595 100644 --- a/PWGHF/TableProducer/treeCreatorB0ToDPi.cxx +++ b/PWGHF/TableProducer/treeCreatorB0ToDPi.cxx @@ -312,7 +312,7 @@ struct HfTreeCreatorB0ToDPi { } for (const auto& candidate : candidates) { if (fillOnlyBackground) { - float pseudoRndm = candidate.ptProng1() * 1000. - static_cast(candidate.ptProng1() * 1000); + float const pseudoRndm = candidate.ptProng1() * 1000. - static_cast(candidate.ptProng1() * 1000); if (candidate.pt() < ptMaxForDownSample && pseudoRndm >= downSampleBkgFactor) { continue; } @@ -352,7 +352,7 @@ struct HfTreeCreatorB0ToDPi { rowCandidateLite.reserve(recBg.size()); } for (const auto& candidate : recBg) { - float pseudoRndm = candidate.ptProng1() * 1000. - static_cast(candidate.ptProng1() * 1000); + float const pseudoRndm = candidate.ptProng1() * 1000. - static_cast(candidate.ptProng1() * 1000); if (candidate.pt() < ptMaxForDownSample && pseudoRndm >= downSampleBkgFactor) { continue; } diff --git a/PWGHF/TableProducer/treeCreatorBplusToD0Pi.cxx b/PWGHF/TableProducer/treeCreatorBplusToD0Pi.cxx index cd3d5f2f1a7..a0e7b2a3597 100644 --- a/PWGHF/TableProducer/treeCreatorBplusToD0Pi.cxx +++ b/PWGHF/TableProducer/treeCreatorBplusToD0Pi.cxx @@ -402,7 +402,7 @@ struct HfTreeCreatorBplusToD0Pi { } for (const auto& candidate : candidates) { if (fillOnlyBackground) { - float pseudoRndm = candidate.ptProng1() * 1000. - static_cast(candidate.ptProng1() * 1000); + float const pseudoRndm = candidate.ptProng1() * 1000. - static_cast(candidate.ptProng1() * 1000); if (candidate.pt() < ptMaxForDownSample && pseudoRndm >= downSampleBkgFactor) { continue; } @@ -442,7 +442,7 @@ struct HfTreeCreatorBplusToD0Pi { rowCandidateLite.reserve(recBg.size()); } for (const auto& candidate : recBg) { - float pseudoRndm = candidate.ptProng1() * 1000. - static_cast(candidate.ptProng1() * 1000); + float const pseudoRndm = candidate.ptProng1() * 1000. - static_cast(candidate.ptProng1() * 1000); if (candidate.pt() < ptMaxForDownSample && pseudoRndm >= downSampleBkgFactor) { continue; } diff --git a/PWGHF/TableProducer/treeCreatorBsToDsPi.cxx b/PWGHF/TableProducer/treeCreatorBsToDsPi.cxx index cef73bc0a90..594aae65cd1 100644 --- a/PWGHF/TableProducer/treeCreatorBsToDsPi.cxx +++ b/PWGHF/TableProducer/treeCreatorBsToDsPi.cxx @@ -302,7 +302,7 @@ struct HfTreeCreatorBsToDsPi { } for (const auto& candidate : candidates) { if (fillOnlyBackground && downSampleBkgFactor < 1.) { - float pseudoRndm = candidate.ptProng1() * 1000. - static_cast(candidate.ptProng1() * 1000); + float const pseudoRndm = candidate.ptProng1() * 1000. - static_cast(candidate.ptProng1() * 1000); if (pseudoRndm >= downSampleBkgFactor && candidate.pt() < ptMaxForDownSample) { continue; } @@ -342,7 +342,7 @@ struct HfTreeCreatorBsToDsPi { rowCandidateLite.reserve(recBg.size()); } for (const auto& candidate : recBg) { - float pseudoRndm = candidate.ptProng1() * 1000. - static_cast(candidate.ptProng1() * 1000); + float const pseudoRndm = candidate.ptProng1() * 1000. - static_cast(candidate.ptProng1() * 1000); if (candidate.pt() < ptMaxForDownSample && pseudoRndm >= downSampleBkgFactor) { continue; } diff --git a/PWGHF/TableProducer/treeCreatorD0ToKPi.cxx b/PWGHF/TableProducer/treeCreatorD0ToKPi.cxx index 9dcd3921713..dc962e7ed49 100644 --- a/PWGHF/TableProducer/treeCreatorD0ToKPi.cxx +++ b/PWGHF/TableProducer/treeCreatorD0ToKPi.cxx @@ -429,14 +429,14 @@ struct HfTreeCreatorD0ToKPi { } for (const auto& candidate : candidates) { if (downSampleBkgFactor < 1.) { - float pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); + float const pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); if (candidate.pt() < ptMaxForDownSample && pseudoRndm >= downSampleBkgFactor) { continue; } } - double yD = hfHelper.yD0(candidate); - double eD = hfHelper.eD0(candidate); - double ctD = hfHelper.ctD0(candidate); + double const yD = hfHelper.yD0(candidate); + double const eD = hfHelper.eD0(candidate); + double const ctD = hfHelper.ctD0(candidate); float massD0, massD0bar; float topolChi2PerNdf = -999.; if constexpr (ReconstructionType == aod::hf_cand::VertexerType::KfParticle) { @@ -521,7 +521,7 @@ struct HfTreeCreatorD0ToKPi { continue; } if (downSampleBkgFactor < 1.) { - float pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); + float const pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); if (candidate.pt() < ptMaxForDownSample && pseudoRndm >= downSampleBkgFactor) { continue; } @@ -535,9 +535,9 @@ struct HfTreeCreatorD0ToKPi { continue; } } - double yD = hfHelper.yD0(candidate); - double eD = hfHelper.eD0(candidate); - double ctD = hfHelper.ctD0(candidate); + double const yD = hfHelper.yD0(candidate); + double const eD = hfHelper.eD0(candidate); + double const ctD = hfHelper.ctD0(candidate); float massD0, massD0bar; float topolChi2PerNdf = -999.; if constexpr (ReconstructionType == aod::hf_cand::VertexerType::KfParticle) { diff --git a/PWGHF/TableProducer/treeCreatorDplusToPiKPi.cxx b/PWGHF/TableProducer/treeCreatorDplusToPiKPi.cxx index 4741a2ea185..dcee30bf93b 100644 --- a/PWGHF/TableProducer/treeCreatorDplusToPiKPi.cxx +++ b/PWGHF/TableProducer/treeCreatorDplusToPiKPi.cxx @@ -478,7 +478,7 @@ struct HfTreeCreatorDplusToPiKPi { } for (const auto& candidate : candidates) { if (downSampleBkgFactor < 1.) { - float pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); + float const pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); if (candidate.pt() < ptMaxForDownSample && pseudoRndm >= downSampleBkgFactor) { continue; } @@ -507,7 +507,7 @@ struct HfTreeCreatorDplusToPiKPi { } for (const auto& candidate : candidates) { if (downSampleBkgFactor < 1.) { - float pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); + float const pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); if (candidate.pt() < ptMaxForDownSample && pseudoRndm >= downSampleBkgFactor) { continue; } @@ -539,7 +539,7 @@ struct HfTreeCreatorDplusToPiKPi { } for (const auto& candidate : candidates) { if (downSampleBkgFactor < 1.) { - float pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); + float const pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); if (candidate.pt() < ptMaxForDownSample && pseudoRndm >= downSampleBkgFactor) { continue; } diff --git a/PWGHF/TableProducer/treeCreatorDsToKKPi.cxx b/PWGHF/TableProducer/treeCreatorDsToKKPi.cxx index 6d2efb46a7e..a68b673f732 100644 --- a/PWGHF/TableProducer/treeCreatorDsToKKPi.cxx +++ b/PWGHF/TableProducer/treeCreatorDsToKKPi.cxx @@ -518,7 +518,7 @@ struct HfTreeCreatorDsToKKPi { for (const auto& candidate : selectedDsToKKPiCand) { if (downSampleBkgFactor < 1.) { - float pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); + float const pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); if (candidate.pt() < ptMaxForDownSample && pseudoRndm >= downSampleBkgFactor) { continue; } @@ -528,7 +528,7 @@ struct HfTreeCreatorDsToKKPi { for (const auto& candidate : selectedDsToPiKKCand) { if (downSampleBkgFactor < 1.) { - float pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); + float const pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); if (candidate.pt() < ptMaxForDownSample && pseudoRndm >= downSampleBkgFactor) { continue; } @@ -574,7 +574,7 @@ struct HfTreeCreatorDsToKKPi { for (const auto& candidate : reconstructedCandBkg) { if (downSampleBkgFactor < 1.) { - float pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); + float const pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); if (candidate.pt() < ptMaxForDownSample && pseudoRndm >= downSampleBkgFactor) { continue; } diff --git a/PWGHF/TableProducer/treeCreatorDstarToD0Pi.cxx b/PWGHF/TableProducer/treeCreatorDstarToD0Pi.cxx index ec27ddefe35..f7055dfa8d0 100644 --- a/PWGHF/TableProducer/treeCreatorDstarToD0Pi.cxx +++ b/PWGHF/TableProducer/treeCreatorDstarToD0Pi.cxx @@ -495,7 +495,7 @@ struct HfTreeCreatorDstarToD0Pi { } for (const auto& candidate : candidates) { if (downSampleBkgFactor < 1.) { - float pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); + float const pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); if (candidate.pt() < ptMaxForDownSample && pseudoRndm >= downSampleBkgFactor) { continue; } @@ -536,7 +536,7 @@ struct HfTreeCreatorDstarToD0Pi { } for (const auto& candidate : reconstructedCandBkg) { if (downSampleBkgFactor < 1.) { - float pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); + float const pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); if (candidate.pt() < ptMaxForDownSample && pseudoRndm >= downSampleBkgFactor) { continue; } diff --git a/PWGHF/TableProducer/treeCreatorLcToK0sP.cxx b/PWGHF/TableProducer/treeCreatorLcToK0sP.cxx index c29d9ebe68c..d80e3729507 100644 --- a/PWGHF/TableProducer/treeCreatorLcToK0sP.cxx +++ b/PWGHF/TableProducer/treeCreatorLcToK0sP.cxx @@ -499,7 +499,7 @@ struct HfTreeCreatorLcToK0sP { auto candidateMlScore = candidateMlScores.rawIteratorAt(iCand); ++iCand; auto bach = candidate.prong0_as(); // bachelor - double pseudoRndm = bach.pt() * 1000. - static_cast(bach.pt() * 1000); + double const pseudoRndm = bach.pt() * 1000. - static_cast(bach.pt() * 1000); if (candidate.isSelLcToK0sP() >= 1 && pseudoRndm < downSampleBkgFactor) { fillCandidate(candidate, bach, 0, 0, candidateMlScore); } diff --git a/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx b/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx index 0f69ed17d62..f1986fe72e3 100644 --- a/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx +++ b/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx @@ -933,7 +933,7 @@ struct HfTreeCreatorLcToPKPi { float ptProng0 = candidate.ptProng0(); auto collision = candidate.template collision_as(); auto fillTable = [&](int candFlag) { - double pseudoRndm = ptProng0 * 1000. - static_cast(ptProng0 * 1000); + double const pseudoRndm = ptProng0 * 1000. - static_cast(ptProng0 * 1000); const int functionSelection = candFlag == 0 ? candidate.isSelLcToPKPi() : candidate.isSelLcToPiKP(); const int sigbgstatus = determineSignalBgStatus(candidate, candFlag); const bool isMcCandidateSignal = (sigbgstatus == Prompt) || (sigbgstatus == NonPrompt); @@ -1122,7 +1122,7 @@ struct HfTreeCreatorLcToPKPi { float ptProng0 = candidate.ptProng0(); auto collision = candidate.template collision_as(); auto fillTable = [&](int candFlag) { - double pseudoRndm = ptProng0 * 1000. - static_cast(ptProng0 * 1000); + double const pseudoRndm = ptProng0 * 1000. - static_cast(ptProng0 * 1000); const int functionSelection = candFlag == 0 ? candidate.isSelLcToPKPi() : candidate.isSelLcToPiKP(); if (functionSelection >= selectionFlagLc && (candidate.pt() > downSampleBkgPtMax || (pseudoRndm < downSampleBkgFactor && candidate.pt() < downSampleBkgPtMax))) { if (fillCandidateLiteTable) { diff --git a/PWGHF/TableProducer/treeCreatorOmegacSt.cxx b/PWGHF/TableProducer/treeCreatorOmegacSt.cxx index 37093d354f6..d4b76a1b631 100644 --- a/PWGHF/TableProducer/treeCreatorOmegacSt.cxx +++ b/PWGHF/TableProducer/treeCreatorOmegacSt.cxx @@ -392,19 +392,19 @@ struct HfTreeCreatorOmegacSt { decayChannel = -1; // LOG(warning) << "Decay channel not recognized!"; } if (decayChannel != -1) { - int idxDaughter = (decayChannel == o2::aod::hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaPi) ? idxPionDaughter : idxKaonDaughter; + int const idxDaughter = (decayChannel == o2::aod::hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaPi) ? idxPionDaughter : idxKaonDaughter; auto particle = mcParticles.rawIteratorAt(idxDaughter); origin = RecoDecay::getCharmHadronOrigin(mcParticles, particle, false, &idxBhadMothers); const auto& cascDaughter = mcParticles.iteratorAt(idxCascDaughter); const auto& mcColl = mcParticle.mcCollision(); - std::array primaryVertexPosGen = {mcColl.posX(), mcColl.posY(), mcColl.posZ()}; - std::array secondaryVertexGen = {cascDaughter.vx(), cascDaughter.vy(), cascDaughter.vz()}; + std::array const primaryVertexPosGen = {mcColl.posX(), mcColl.posY(), mcColl.posZ()}; + std::array const secondaryVertexGen = {cascDaughter.vx(), cascDaughter.vy(), cascDaughter.vz()}; float decayLengthCascGen = -1.; float decayLengthXYCascGen = -1.; if (cascDaughter.has_daughters()) { const auto& cascDecayDaughter = cascDaughter.daughters_as().iteratorAt(0); - std::array tertiaryVertexGen = {cascDecayDaughter.vx(), cascDecayDaughter.vy(), cascDecayDaughter.vz()}; + std::array const tertiaryVertexGen = {cascDecayDaughter.vx(), cascDecayDaughter.vy(), cascDecayDaughter.vz()}; decayLengthCascGen = RecoDecay::distance(tertiaryVertexGen, primaryVertexPosGen); decayLengthXYCascGen = RecoDecay::distanceXY(tertiaryVertexGen, primaryVertexPosGen); } @@ -468,7 +468,7 @@ struct HfTreeCreatorOmegacSt { } uint32_t toiMask = 0; if (skimmedProcessing) { - bool sel = zorro.isSelected(bc.globalBC()); + bool const sel = zorro.isSelected(bc.globalBC()); if (sel) { std::vector toivect = zorro.getTriggerOfInterestResults(); for (size_t i{0}; i < toivect.size(); i++) { @@ -531,15 +531,15 @@ struct HfTreeCreatorOmegacSt { } hCandidatesPrPi->Fill(SVFitting::FitOk); - std::array massesV0Daughters{o2::constants::physics::MassProton, o2::constants::physics::MassPiMinus}; + std::array const massesV0Daughters{o2::constants::physics::MassProton, o2::constants::physics::MassPiMinus}; std::array, NDaughters> momentaV0Daughters{}; - o2::track::TrackPar trackParV0Pr = df2.getTrackParamAtPCA(0); + o2::track::TrackPar const trackParV0Pr = df2.getTrackParamAtPCA(0); trackParV0Pr.getPxPyPzGlo(momentaV0Daughters[0]); - o2::track::TrackPar trackParV0Pi = df2.getTrackParamAtPCA(1); + o2::track::TrackPar const trackParV0Pi = df2.getTrackParamAtPCA(1); trackParV0Pi.getPxPyPzGlo(momentaV0Daughters[1]); const auto massV0 = RecoDecay::m(momentaV0Daughters, massesV0Daughters); - o2::track::TrackParCov trackParCovV0 = df2.createParentTrackParCov(0); + o2::track::TrackParCov const trackParCovV0 = df2.createParentTrackParCov(0); hCandidatesV0Pi->Fill(SVFitting::BeforeFit); try { if (!df2.process(trackParCovV0, getTrackParCov(bachelor))) { @@ -555,20 +555,20 @@ struct HfTreeCreatorOmegacSt { const auto& secondaryVertex = df2.getPCACandidate(); const auto decayLengthCasc = RecoDecay::distance(secondaryVertex, primaryVertexPos); const auto decayLengthCascXY = RecoDecay::distanceXY(secondaryVertex, primaryVertexPos); - o2::track::TrackPar trackParV0 = df2.getTrackParamAtPCA(0); - o2::track::TrackPar trackParBachelor = df2.getTrackParamAtPCA(1); + o2::track::TrackPar const trackParV0 = df2.getTrackParamAtPCA(0); + o2::track::TrackPar const trackParBachelor = df2.getTrackParamAtPCA(1); std::array, NDaughters> momentaCascDaughters{}; trackParV0.getPxPyPzGlo(momentaCascDaughters[0]); trackParBachelor.getPxPyPzGlo(momentaCascDaughters[1]); - o2::track::TrackParCov trackParCovCascUntracked = df2.createParentTrackParCov(0); + o2::track::TrackParCov const trackParCovCascUntracked = df2.createParentTrackParCov(0); std::array pCasc{}; trackParCovCascUntracked.getPxPyPzGlo(pCasc); const auto cpaCasc = RecoDecay::cpa(primaryVertexPos, df2.getPCACandidate(), pCasc); const auto cpaXYCasc = RecoDecay::cpaXY(primaryVertexPos, df2.getPCACandidate(), pCasc); - std::array massesXiDaughters = {o2::constants::physics::MassLambda0, o2::constants::physics::MassPiPlus}; + std::array const massesXiDaughters = {o2::constants::physics::MassLambda0, o2::constants::physics::MassPiPlus}; const auto massXi = RecoDecay::m(momentaCascDaughters, massesXiDaughters); - std::array massesOmegaDaughters = {o2::constants::physics::MassLambda0, o2::constants::physics::MassKPlus}; + std::array const massesOmegaDaughters = {o2::constants::physics::MassLambda0, o2::constants::physics::MassKPlus}; const auto massOmega = RecoDecay::m(momentaCascDaughters, massesOmegaDaughters); registry.fill(HIST("hDca"), std::sqrt(impactParameterCasc.getR2())); @@ -586,9 +586,9 @@ struct HfTreeCreatorOmegacSt { (std::abs(v0TrackPr.tpcNSigmaPr()) < maxNSigmaV0Pr) && (std::abs(v0TrackPi.tpcNSigmaPi()) < maxNSigmaV0Pi)) { - std::array massesOmegacToOmegaPi{o2::constants::physics::MassOmegaMinus, o2::constants::physics::MassPiPlus}; - std::array massesOmegacToOmegaK{o2::constants::physics::MassOmegaMinus, o2::constants::physics::MassKPlus}; - std::array massesXicDaughters{o2::constants::physics::MassXiMinus, o2::constants::physics::MassPiPlus}; + std::array const massesOmegacToOmegaPi{o2::constants::physics::MassOmegaMinus, o2::constants::physics::MassPiPlus}; + std::array const massesOmegacToOmegaK{o2::constants::physics::MassOmegaMinus, o2::constants::physics::MassKPlus}; + std::array const massesXicDaughters{o2::constants::physics::MassXiMinus, o2::constants::physics::MassPiPlus}; std::array, NDaughters> momenta{}; auto trackParCovPr = getTrackParCov(v0TrackPr); @@ -889,11 +889,11 @@ struct HfTreeCreatorOmegacSt { LOG(debug) << "cascade with PDG code: " << pdgCode; if (std::abs(pdgCode) == kOmegaMinus) { LOG(debug) << "found Omega, looking for pions"; - std::array masses{o2::constants::physics::MassOmegaMinus, o2::constants::physics::MassPiPlus}; + std::array const masses{o2::constants::physics::MassOmegaMinus, o2::constants::physics::MassPiPlus}; std::array, NDaughters> momenta{}; - std::array primaryVertexPos = {primaryVertex.getX(), primaryVertex.getY(), primaryVertex.getZ()}; + std::array const primaryVertexPos = {primaryVertex.getX(), primaryVertex.getY(), primaryVertex.getZ()}; const auto& mcColl = mother.mcCollision(); - std::array primaryVertexPosGen = {mcColl.posX(), mcColl.posY(), mcColl.posZ()}; + std::array const primaryVertexPosGen = {mcColl.posX(), mcColl.posY(), mcColl.posZ()}; for (const auto& track : tracks) { if (!track.has_mcParticle()) { @@ -927,7 +927,7 @@ struct HfTreeCreatorOmegacSt { registry.fill(HIST("hDecayLengthId"), decayLength * 1e4); registry.fill(HIST("hDecayLengthScaledId"), decayLength * o2::constants::physics::MassOmegaC0 / RecoDecay::p(momenta[0], momenta[1]) * 1e4); - std::array secondaryVertexGen = {mother.vx(), mother.vy(), mother.vz()}; + std::array const secondaryVertexGen = {mother.vx(), mother.vy(), mother.vz()}; const auto decayLengthGen = RecoDecay::distance(secondaryVertexGen, primaryVertexPosGen); registry.fill(HIST("hDecayLengthGen"), decayLengthGen * 1e4); registry.fill(HIST("hDecayLengthScaledGen"), decayLengthGen * o2::constants::physics::MassOmegaC0 / RecoDecay::p(momenta[0], momenta[1]) * 1e4); diff --git a/PWGHF/TableProducer/treeCreatorSigmacCorrBkg.cxx b/PWGHF/TableProducer/treeCreatorSigmacCorrBkg.cxx index 22a7173e0de..9a4cec7ef9e 100644 --- a/PWGHF/TableProducer/treeCreatorSigmacCorrBkg.cxx +++ b/PWGHF/TableProducer/treeCreatorSigmacCorrBkg.cxx @@ -148,10 +148,10 @@ struct HfTreeCreatorSigmacCorrBkg { /// tag immediately the Σc0,++(2455) and Σc0,++(2520) signal auto flagMcDecayChanScAbs = std::abs(candidateSc.flagMcMatchRec()); - bool isTrueSigmac0 = (flagMcDecayChanScAbs == BIT(aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi)); - bool isTrueSigmacPlusPlus = (flagMcDecayChanScAbs == BIT(aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi)); - bool isTrueSigmacStar0 = (flagMcDecayChanScAbs == BIT(aod::hf_cand_sigmac::DecayType::ScStar0ToPKPiPi)); - bool isTrueSigmacStarPlusPlus = (flagMcDecayChanScAbs == BIT(aod::hf_cand_sigmac::DecayType::ScStarPlusPlusToPKPiPi)); + bool const isTrueSigmac0 = (flagMcDecayChanScAbs == BIT(aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi)); + bool const isTrueSigmacPlusPlus = (flagMcDecayChanScAbs == BIT(aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi)); + bool const isTrueSigmacStar0 = (flagMcDecayChanScAbs == BIT(aod::hf_cand_sigmac::DecayType::ScStar0ToPKPiPi)); + bool const isTrueSigmacStarPlusPlus = (flagMcDecayChanScAbs == BIT(aod::hf_cand_sigmac::DecayType::ScStarPlusPlusToPKPiPi)); if (isTrueSigmac0) { /// fill the output for the signal fillTable(candidateSc, candLcDauSc, o2::constants::physics::Pdg::kSigmaC0); @@ -202,7 +202,7 @@ struct HfTreeCreatorSigmacCorrBkg { /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// check if the candidate Lc and soft pion daugthers are not real Lc or pion - bool isLambdac = std::abs(candLcDauSc.flagMcMatchRec()) == hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi; + bool const isLambdac = std::abs(candLcDauSc.flagMcMatchRec()) == hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi; bool isPion = false; if (candSoftPiDauSc.has_mcParticle()) { isPion = std::abs(candSoftPiDauSc.template mcParticle_as().pdgCode()) == kPiPlus; @@ -268,7 +268,7 @@ struct HfTreeCreatorSigmacCorrBkg { candLcDauSc.template prong1_as(), candLcDauSc.template prong2_as()}; int8_t signLambdac = 0; - int indexRecLc = RecoDecay::getMatchedMCRec(particles, arrayDaughtersLambdac, o2::constants::physics::Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &signLambdac, 2); + int const indexRecLc = RecoDecay::getMatchedMCRec(particles, arrayDaughtersLambdac, o2::constants::physics::Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &signLambdac, 2); if (indexRecLc < 0) { /// this should never happen, since we check above that the isLambdac==true LOG(fatal) << "Generated Lambdac not found. Not expected. Aborting."; @@ -278,7 +278,7 @@ struct HfTreeCreatorSigmacCorrBkg { /// we should always enter here, since the Λc± is coming from a Λc±(2595, 2625) decay for (auto iMother = particleLc.mothersIds().front(); iMother <= particleLc.mothersIds().back(); ++iMother) { auto mother = particles.rawIteratorAt(iMother); - int pdgCodeMotherAbs = std::abs(mother.pdgCode()); + int const pdgCodeMotherAbs = std::abs(mother.pdgCode()); if (pdgCodeMotherAbs == o2::constants::physics::Pdg::kSigmaC0 || pdgCodeMotherAbs == o2::constants::physics::Pdg::kSigmaCPlusPlus) { /// the Λc± comes from a Σc0,++(2455) /// ==> we found a Λc±(2595, 2625) → Σc0,++(2455) π+,- decay! diff --git a/PWGHF/TableProducer/treeCreatorTccToD0D0Pi.cxx b/PWGHF/TableProducer/treeCreatorTccToD0D0Pi.cxx index df19a9786e4..2791be74e04 100644 --- a/PWGHF/TableProducer/treeCreatorTccToD0D0Pi.cxx +++ b/PWGHF/TableProducer/treeCreatorTccToD0D0Pi.cxx @@ -400,8 +400,8 @@ struct HfTreeCreatorTccToD0D0Pi { auto trackD1Prong0 = tracks.rawIteratorAt(candidateD1.prong0Id()); // positive daughter for D1 auto trackD1Prong1 = tracks.rawIteratorAt(candidateD1.prong1Id()); // negative daughter for D1 - std::array pVecD1Prong0{trackD1Prong0.pVector()}; - std::array pVecD1Prong1{trackD1Prong1.pVector()}; + std::array const pVecD1Prong0{trackD1Prong0.pVector()}; + std::array const pVecD1Prong1{trackD1Prong1.pVector()}; std::array pVecD1 = RecoDecay::pVec(pVecD1Prong0, pVecD1Prong1); for (auto candidateD2 = candidateD1 + 1; candidateD2 != candwD0ThisColl.end(); ++candidateD2) { @@ -416,8 +416,8 @@ struct HfTreeCreatorTccToD0D0Pi { auto trackD2Prong0 = tracks.rawIteratorAt(candidateD2.prong0Id()); // positive daughter for D2 auto trackD2Prong1 = tracks.rawIteratorAt(candidateD2.prong1Id()); // negative daughter for D2 - std::array pVecD2Prong0{trackD2Prong0.pVector()}; - std::array pVecD2Prong1{trackD2Prong1.pVector()}; + std::array const pVecD2Prong0{trackD2Prong0.pVector()}; + std::array const pVecD2Prong1{trackD2Prong1.pVector()}; std::array pVecD2 = RecoDecay::pVec(pVecD2Prong0, pVecD2Prong1); if (buildVertex) { diff --git a/PWGHF/TableProducer/treeCreatorXicToPKPi.cxx b/PWGHF/TableProducer/treeCreatorXicToPKPi.cxx index 9876f4f1f98..b7b2e74a89c 100644 --- a/PWGHF/TableProducer/treeCreatorXicToPKPi.cxx +++ b/PWGHF/TableProducer/treeCreatorXicToPKPi.cxx @@ -418,7 +418,7 @@ struct HfTreeCreatorXicToPKPi { for (const auto& candidate : selectedXicToPKPiCand) { if (downSampleBkgFactor < 1.) { - float pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); + float const pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); if (candidate.pt() < ptMaxForDownSample && pseudoRndm >= downSampleBkgFactor) { continue; } @@ -428,7 +428,7 @@ struct HfTreeCreatorXicToPKPi { for (const auto& candidate : selectedXicToPiKPCand) { if (downSampleBkgFactor < 1.) { - float pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); + float const pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); if (candidate.pt() < ptMaxForDownSample && pseudoRndm >= downSampleBkgFactor) { continue; } @@ -475,7 +475,7 @@ struct HfTreeCreatorXicToPKPi { for (const auto& candidate : reconstructedCandBkg) { if (downSampleBkgFactor < 1.) { - float pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); + float const pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); if (candidate.pt() < ptMaxForDownSample && pseudoRndm >= downSampleBkgFactor) { continue; } diff --git a/PWGHF/TableProducer/treeCreatorXicToXiPiPi.cxx b/PWGHF/TableProducer/treeCreatorXicToXiPiPi.cxx index c681fb2c9ef..8cd92bef0c5 100644 --- a/PWGHF/TableProducer/treeCreatorXicToXiPiPi.cxx +++ b/PWGHF/TableProducer/treeCreatorXicToXiPiPi.cxx @@ -647,7 +647,7 @@ struct HfTreeCreatorXicToXiPiPi { } for (const auto& candidate : candidates) { if (fillOnlyBackground && downSampleBkgFactor < 1.) { - float pseudoRndm = candidate.ptProng1() * 1000. - static_cast(candidate.ptProng1() * 1000); + float const pseudoRndm = candidate.ptProng1() * 1000. - static_cast(candidate.ptProng1() * 1000); if (pseudoRndm >= downSampleBkgFactor && candidate.pt() < ptMaxForDownSample) { continue; } @@ -667,7 +667,7 @@ struct HfTreeCreatorXicToXiPiPi { } for (const auto& candidate : candidates) { if (fillOnlyBackground && downSampleBkgFactor < 1.) { - float pseudoRndm = candidate.ptProng1() * 1000. - static_cast(candidate.ptProng1() * 1000); + float const pseudoRndm = candidate.ptProng1() * 1000. - static_cast(candidate.ptProng1() * 1000); if (pseudoRndm >= downSampleBkgFactor && candidate.pt() < ptMaxForDownSample) { continue; } @@ -697,7 +697,7 @@ struct HfTreeCreatorXicToXiPiPi { rowCandidateFull.reserve(recBg.size()); } for (const auto& candidate : recBg) { - float pseudoRndm = candidate.ptProng1() * 1000. - static_cast(candidate.ptProng1() * 1000); + float const pseudoRndm = candidate.ptProng1() * 1000. - static_cast(candidate.ptProng1() * 1000); if (candidate.pt() < ptMaxForDownSample && pseudoRndm >= downSampleBkgFactor) { continue; } @@ -751,7 +751,7 @@ struct HfTreeCreatorXicToXiPiPi { rowCandidateFull.reserve(recBgKf.size()); } for (const auto& candidate : recBgKf) { - float pseudoRndm = candidate.ptProng1() * 1000. - static_cast(candidate.ptProng1() * 1000); + float const pseudoRndm = candidate.ptProng1() * 1000. - static_cast(candidate.ptProng1() * 1000); if (candidate.pt() < ptMaxForDownSample && pseudoRndm >= downSampleBkgFactor) { continue; } diff --git a/PWGHF/Tasks/taskLcCentrality.cxx b/PWGHF/Tasks/taskLcCentrality.cxx index c97f395879e..96d4c03c2f3 100644 --- a/PWGHF/Tasks/taskLcCentrality.cxx +++ b/PWGHF/Tasks/taskLcCentrality.cxx @@ -45,7 +45,7 @@ using namespace o2::framework::expressions; void customize(std::vector& workflowOptions) { - ConfigParamSpec optionDoMC{"doMC", VariantType::Bool, true, {"Fill MC histograms."}}; + ConfigParamSpec const optionDoMC{"doMC", VariantType::Bool, true, {"Fill MC histograms."}}; workflowOptions.push_back(optionDoMC); } @@ -91,7 +91,7 @@ struct HfTaskLcCentrality { void process(soa::Join::iterator const& collision, soa::Filtered> const& candidates) { - float centrality = collision.centRun2V0M(); + float const centrality = collision.centRun2V0M(); registry.fill(HIST("hCentrality"), centrality); for (const auto& candidate : candidates) { diff --git a/PWGHF/Tasks/taskMcEfficiency.cxx b/PWGHF/Tasks/taskMcEfficiency.cxx index 9a9fe7a1283..9cea8501366 100644 --- a/PWGHF/Tasks/taskMcEfficiency.cxx +++ b/PWGHF/Tasks/taskMcEfficiency.cxx @@ -203,7 +203,7 @@ struct HfTaskMcEfficiency { int origin = RecoDecay::OriginType::None; if constexpr (Mc) { /// info MC used int8_t sign = 0; - int indexRec = RecoDecay::getMatchedMCRec(mcParticles, std::array{trackPos, trackNeg, trackThird}, pdgCode, pdgDaughters, true, &sign, 2); + int const indexRec = RecoDecay::getMatchedMCRec(mcParticles, std::array{trackPos, trackNeg, trackThird}, pdgCode, pdgDaughters, true, &sign, 2); if (indexRec < 0) { continue; @@ -250,8 +250,8 @@ struct HfTaskMcEfficiency { float massHypo1 = -1; float massHypo2 = -1; - float cpa = candidate.cpa(); - float pt = candidate.pt(); + float const cpa = candidate.cpa(); + float const pt = candidate.pt(); // bool selected = false; /// all candidates @@ -303,8 +303,8 @@ struct HfTaskMcEfficiency { // duplicates std::array prongIds = {candidate.prong0Id(), candidate.prong1Id(), candidate.prong2Id()}; std::sort(prongIds.begin(), prongIds.end()); - std::string concat = std::to_string(prongIds[0]) + std::to_string(prongIds[1]) + std::to_string(prongIds[2]); - std::size_t hash = std::hash{}(concat); /// unique value for the 'concat' string + std::string const concat = std::to_string(prongIds[0]) + std::to_string(prongIds[1]) + std::to_string(prongIds[2]); + std::size_t const hash = std::hash{}(concat); /// unique value for the 'concat' string if (duplicates.find(hash) != duplicates.end()) { if (isHypoMass1TrackStep) { hCandidates->Fill(kHFStepTrackedDuplicates, pt, massHypo1, pdgCode, cpa, collisionMatched, origin); @@ -371,8 +371,8 @@ struct HfTaskMcEfficiency { } float mass = -1; - float cpa = candidate.cpa(); - float pt = candidate.pt(); + float const cpa = candidate.cpa(); + float const pt = candidate.pt(); bool selected = false; if (pdgCode == Pdg::kD0) { mass = hfHelper.invMassD0ToPiK(candidate); @@ -465,7 +465,7 @@ struct HfTaskMcEfficiency { continue; } - int origin = RecoDecay::getCharmHadronOrigin(mcParticles, mcParticle); + int const origin = RecoDecay::getCharmHadronOrigin(mcParticles, mcParticle); hCandidates->Fill(kHFStepMC, mcParticle.pt(), mass, pdgCode, 1.0, true, origin); @@ -600,13 +600,13 @@ struct HfTaskMcEfficiency { /// check if we end-up with the correct final state using MC info int8_t sign = 0; - std::unique_ptr> listIndexDaughters(new std::vector{}); + std::unique_ptr> const listIndexDaughters(new std::vector{}); if (!RecoDecay::isMatchedMCGen(mcParticles, mcParticle, pdgCode, pdgDaughters, true, &sign, 2, listIndexDaughters.get())) { /// check if we have Λc± → p± K∓ π± (either direct or resonant), or D± → π± K∓ π± (either direct or resonant) or Ds± → K± K∓ π± (either direct or resonant) continue; } - int origin = RecoDecay::getCharmHadronOrigin(mcParticles, mcParticle); + int const origin = RecoDecay::getCharmHadronOrigin(mcParticles, mcParticle); hCandidates->Fill(kHFStepMC, mcParticle.pt(), mass, pdgCode * sign, 1.0, true, origin); @@ -711,7 +711,7 @@ struct HfTaskMcEfficiency { void processDataD0(soa::Join const& candidates, TracksWithSelection const& tracks) { - std::vector pdgCodes{Pdg::kD0Bar, Pdg::kD0}; + std::vector const pdgCodes{Pdg::kD0Bar, Pdg::kD0}; candidate2ProngLoop(candidates, tracks, tracks, pdgCodes); // NOTE third argument has to be provided but is not used as template argument is } PROCESS_SWITCH(HfTaskMcEfficiency, processDataD0, "Process D0 data (no MC information needed)", false); @@ -719,7 +719,7 @@ struct HfTaskMcEfficiency { void processDataDplus(soa::Join const& candidates, TracksWithSelection const& tracks) { - std::vector pdgCodes{Pdg::kDPlus}; + std::vector const pdgCodes{Pdg::kDPlus}; candidate3ProngLoop(candidates, tracks, tracks, pdgCodes); } PROCESS_SWITCH(HfTaskMcEfficiency, processDataDplus, "Process D+ data (no MC information needed)", false); @@ -727,7 +727,7 @@ struct HfTaskMcEfficiency { void processDataDs(soa::Join const& candidates, TracksWithSelection const& tracks) { - std::vector pdgCodes{Pdg::kDS}; + std::vector const pdgCodes{Pdg::kDS}; candidate3ProngLoop(candidates, tracks, tracks, pdgCodes); } PROCESS_SWITCH(HfTaskMcEfficiency, processDataDs, "Process Ds+ data (no MC information needed)", false); @@ -735,7 +735,7 @@ struct HfTaskMcEfficiency { void processDataLc(soa::Join const& candidates, TracksWithSelection const& tracks) { - std::vector pdgCodes{Pdg::kLambdaCPlus}; + std::vector const pdgCodes{Pdg::kLambdaCPlus}; candidate3ProngLoop(candidates, tracks, tracks, pdgCodes); } PROCESS_SWITCH(HfTaskMcEfficiency, processDataLc, "Process Lc data (no MC information needed)", false); @@ -743,7 +743,7 @@ struct HfTaskMcEfficiency { void processDataXic(soa::Join const& candidates, TracksWithSelection const& tracks) { - std::vector pdgCodes{Pdg::kXiCPlus}; + std::vector const pdgCodes{Pdg::kXiCPlus}; candidate3ProngLoop(candidates, tracks, tracks, pdgCodes); } PROCESS_SWITCH(HfTaskMcEfficiency, processDataXic, "Process Xic data (no MC information needed)", false); @@ -751,7 +751,7 @@ struct HfTaskMcEfficiency { void processDataDplusDs(soa::Join const& candidates, TracksWithSelection const& tracks) { - std::vector pdgCodes{Pdg::kDPlus, Pdg::kDS}; + std::vector const pdgCodes{Pdg::kDPlus, Pdg::kDS}; candidate3ProngLoop(candidates, tracks, tracks, pdgCodes); } PROCESS_SWITCH(HfTaskMcEfficiency, processDataDplusDs, "Process D+ and Ds+ data (no MC information needed)", false); @@ -759,7 +759,7 @@ struct HfTaskMcEfficiency { void processDataDplusDsLc(soa::Join const& candidates, TracksWithSelection const& tracks) { - std::vector pdgCodes{Pdg::kDPlus, Pdg::kDS, Pdg::kLambdaCPlus}; + std::vector const pdgCodes{Pdg::kDPlus, Pdg::kDS, Pdg::kLambdaCPlus}; candidate3ProngLoop(candidates, tracks, tracks, pdgCodes); } PROCESS_SWITCH(HfTaskMcEfficiency, processDataDplusDsLc, "Process D+, Ds+, and Lc data (no MC information needed)", false); @@ -767,7 +767,7 @@ struct HfTaskMcEfficiency { void processDataDplusLc(soa::Join const& candidates, TracksWithSelection const& tracks) { - std::vector pdgCodes{Pdg::kDPlus, Pdg::kLambdaCPlus}; + std::vector const pdgCodes{Pdg::kDPlus, Pdg::kLambdaCPlus}; candidate3ProngLoop(candidates, tracks, tracks, pdgCodes); } PROCESS_SWITCH(HfTaskMcEfficiency, processDataDplusLc, "Process D+ and Lc data (no MC information needed)", false); @@ -775,7 +775,7 @@ struct HfTaskMcEfficiency { void processDataDsLc(soa::Join const& candidates, TracksWithSelection const& tracks) { - std::vector pdgCodes{Pdg::kDPlus, Pdg::kDS, Pdg::kLambdaCPlus}; + std::vector const pdgCodes{Pdg::kDPlus, Pdg::kDS, Pdg::kLambdaCPlus}; candidate3ProngLoop(candidates, tracks, tracks, pdgCodes); } PROCESS_SWITCH(HfTaskMcEfficiency, processDataDsLc, "Process Ds+ and Lc data (no MC information needed)", false); @@ -786,7 +786,7 @@ struct HfTaskMcEfficiency { aod::McParticles const& mcParticles, aod::McCollisionLabels const& colls) { - std::vector pdgCodes{Pdg::kD0Bar, Pdg::kD0}; + std::vector const pdgCodes{Pdg::kD0Bar, Pdg::kD0}; candidate2ProngMcLoop(candidates, tracks, mcParticles, colls, pdgCodes); } PROCESS_SWITCH(HfTaskMcEfficiency, processMcD0, "Process MC for D0 signal", true); @@ -796,7 +796,7 @@ struct HfTaskMcEfficiency { aod::McParticles const& mcParticles, aod::McCollisionLabels const& colls) { - std::vector pdgCodes{Pdg::kDPlus}; + std::vector const pdgCodes{Pdg::kDPlus}; candidate3ProngMcLoop(candidates, tracks, mcParticles, colls, pdgCodes); } PROCESS_SWITCH(HfTaskMcEfficiency, processMcDplus, "Process MC for D+ signal", false); @@ -806,7 +806,7 @@ struct HfTaskMcEfficiency { aod::McParticles const& mcParticles, aod::McCollisionLabels const& colls) { - std::vector pdgCodes{Pdg::kDS}; + std::vector const pdgCodes{Pdg::kDS}; candidate3ProngMcLoop(candidates, tracks, mcParticles, colls, pdgCodes); } PROCESS_SWITCH(HfTaskMcEfficiency, processMcDs, "Process MC for Ds+ signal", false); @@ -816,7 +816,7 @@ struct HfTaskMcEfficiency { aod::McParticles const& mcParticles, aod::McCollisionLabels const& colls) { - std::vector pdgCodes{Pdg::kLambdaCPlus}; + std::vector const pdgCodes{Pdg::kLambdaCPlus}; candidate3ProngMcLoop(candidates, tracks, mcParticles, colls, pdgCodes); } PROCESS_SWITCH(HfTaskMcEfficiency, processMcLc, "Process MC for Lc signal", false); @@ -826,7 +826,7 @@ struct HfTaskMcEfficiency { aod::McParticles const& mcParticles, aod::McCollisionLabels const& colls) { - std::vector pdgCodes{Pdg::kXiCPlus}; + std::vector const pdgCodes{Pdg::kXiCPlus}; candidate3ProngMcLoop(candidates, tracks, mcParticles, colls, pdgCodes); } PROCESS_SWITCH(HfTaskMcEfficiency, processMcXic, "Process MC for Xic signal", false); @@ -836,7 +836,7 @@ struct HfTaskMcEfficiency { aod::McParticles const& mcParticles, aod::McCollisionLabels const& colls) { - std::vector pdgCodes{Pdg::kDPlus, Pdg::kDS}; + std::vector const pdgCodes{Pdg::kDPlus, Pdg::kDS}; candidate3ProngMcLoop(candidates, tracks, mcParticles, colls, pdgCodes); } PROCESS_SWITCH(HfTaskMcEfficiency, processMcDplusDs, "Process MC for D+ and Ds+ signals", false); @@ -846,7 +846,7 @@ struct HfTaskMcEfficiency { aod::McParticles const& mcParticles, aod::McCollisionLabels const& colls) { - std::vector pdgCodes{Pdg::kDPlus, Pdg::kDS, Pdg::kLambdaCPlus}; + std::vector const pdgCodes{Pdg::kDPlus, Pdg::kDS, Pdg::kLambdaCPlus}; candidate3ProngMcLoop(candidates, tracks, mcParticles, colls, pdgCodes); } PROCESS_SWITCH(HfTaskMcEfficiency, processMcDplusDsLc, "Process MC for D+, Ds+, and Lc signals", false); @@ -856,7 +856,7 @@ struct HfTaskMcEfficiency { aod::McParticles const& mcParticles, aod::McCollisionLabels const& colls) { - std::vector pdgCodes{Pdg::kDPlus, Pdg::kLambdaCPlus}; + std::vector const pdgCodes{Pdg::kDPlus, Pdg::kLambdaCPlus}; candidate3ProngMcLoop(candidates, tracks, mcParticles, colls, pdgCodes); } PROCESS_SWITCH(HfTaskMcEfficiency, processMcDplusLc, "Process MC for D+ and Lc signals", false); @@ -866,7 +866,7 @@ struct HfTaskMcEfficiency { aod::McParticles const& mcParticles, aod::McCollisionLabels const& colls) { - std::vector pdgCodes{Pdg::kDS, Pdg::kLambdaCPlus}; + std::vector const pdgCodes{Pdg::kDS, Pdg::kLambdaCPlus}; candidate3ProngMcLoop(candidates, tracks, mcParticles, colls, pdgCodes); } PROCESS_SWITCH(HfTaskMcEfficiency, processMcDsLc, "Process MC for Ds+ and Lc signals", false); diff --git a/PWGHF/Tasks/taskMcGenPtRapShapes.cxx b/PWGHF/Tasks/taskMcGenPtRapShapes.cxx index 7b33ad2afd5..849b32b2c66 100644 --- a/PWGHF/Tasks/taskMcGenPtRapShapes.cxx +++ b/PWGHF/Tasks/taskMcGenPtRapShapes.cxx @@ -81,9 +81,9 @@ struct HfTaskMcGenPtRapShapes { void process(aod::McParticles const& mcParticles) { for (auto const& mcParticle : mcParticles) { - int absPdgCode = std::abs(mcParticle.pdgCode()); - float pt = mcParticle.pt(); - float rap = mcParticle.y(); + int const absPdgCode = std::abs(mcParticle.pdgCode()); + float const pt = mcParticle.pt(); + float const rap = mcParticle.y(); const auto* itCharm = std::find(PdgCodesCharm.begin(), PdgCodesCharm.end(), absPdgCode); const auto* itBeauty = std::find(PdgCodesBeauty.begin(), PdgCodesBeauty.end(), absPdgCode); if (itCharm != PdgCodesCharm.end()) { diff --git a/PWGHF/Tasks/taskMcValidation.cxx b/PWGHF/Tasks/taskMcValidation.cxx index f96cab188e7..650452250db 100644 --- a/PWGHF/Tasks/taskMcValidation.cxx +++ b/PWGHF/Tasks/taskMcValidation.cxx @@ -314,7 +314,7 @@ struct HfTaskMcValidationGen { continue; } - int particlePdgCode = particle.pdgCode(); + int const particlePdgCode = particle.pdgCode(); bool isDiffFromMothers = true; for (const auto& mother : particle.template mothers_as()) { if (particlePdgCode == mother.pdgCode()) { @@ -459,8 +459,8 @@ struct HfTaskMcValidationGen { if (std::abs(pxDiff) > 0.001 || std::abs(pyDiff) > 0.001 || std::abs(pzDiff) > 0.001) { momentumCheck = false; } - double pDiff = RecoDecay::p(pxDiff, pyDiff, pzDiff); - double ptDiff = RecoDecay::pt(pxDiff, pyDiff); + double const pDiff = RecoDecay::p(pxDiff, pyDiff, pzDiff); + double const ptDiff = RecoDecay::pt(pxDiff, pyDiff); registry.fill(HIST("hMomentumCheck"), static_cast(momentumCheck)); registry.fill(HIST("hPxDiffMotherDaughterGen"), pxDiff); registry.fill(HIST("hPyDiffMotherDaughterGen"), pyDiff); @@ -479,8 +479,8 @@ struct HfTaskMcValidationGen { } auto daughter0 = particle.template daughters_as().begin(); - double vertexDau[3] = {daughter0.vx(), daughter0.vy(), daughter0.vz()}; - double vertexPrimary[3] = {mcCollision.posX(), mcCollision.posY(), mcCollision.posZ()}; + double const vertexDau[3] = {daughter0.vx(), daughter0.vy(), daughter0.vz()}; + double const vertexPrimary[3] = {mcCollision.posX(), mcCollision.posY(), mcCollision.posZ()}; auto decayLength = RecoDecay::distance(vertexPrimary, vertexDau); if (iD < NCharmMesonChannels) { if (origin == RecoDecay::OriginType::Prompt) { // Prompt charm mesons @@ -725,20 +725,20 @@ struct HfTaskMcValidationRec { histDeltaPz[whichHad]->Fill(candidate.pz() - mother.pz()); // Compare Secondary vertex and decay length with MC auto daughter0 = mother.template daughters_as().begin(); - double vertexDau[3] = {daughter0.vx(), daughter0.vy(), daughter0.vz()}; - double vertexMoth[3] = {mother.vx(), mother.vy(), mother.vz()}; + double const vertexDau[3] = {daughter0.vx(), daughter0.vy(), daughter0.vz()}; + double const vertexMoth[3] = {mother.vx(), mother.vy(), mother.vz()}; auto decayLength = RecoDecay::distance(vertexMoth, vertexDau); histDeltaSecondaryVertexX[whichHad]->Fill(candidate.xSecondaryVertex() - vertexDau[0]); histDeltaSecondaryVertexY[whichHad]->Fill(candidate.ySecondaryVertex() - vertexDau[1]); histDeltaSecondaryVertexZ[whichHad]->Fill(candidate.zSecondaryVertex() - vertexDau[2]); histDeltaDecayLength[whichHad]->Fill(candidate.decayLength() - decayLength); - std::array momDau0 = {candidate.pxProng0(), - candidate.pyProng0(), - candidate.pzProng0()}; - std::array momDau1 = {candidate.pxProng1(), - candidate.pyProng1(), - candidate.pzProng1()}; + std::array const momDau0 = {candidate.pxProng0(), + candidate.pyProng0(), + candidate.pzProng0()}; + std::array const momDau1 = {candidate.pxProng1(), + candidate.pyProng1(), + candidate.pzProng1()}; histPtCentReco[whichHad][whichOrigin]->Fill(candidate.pt(), centrality); if (storeOccupancy) { histPtOccReco[whichHad][whichOrigin]->Fill(candidate.pt(), occupancy); @@ -907,14 +907,14 @@ struct HfTaskMcValidationRec { nGoodContributors++; } } - float frac = (nContributors > 0) ? static_cast(nGoodContributors) / nContributors : 1.; + float const frac = (nContributors > 0) ? static_cast(nGoodContributors) / nContributors : 1.; registry.fill(HIST("TrackToCollChecks/histFracGoodContributors"), frac); - uint64_t mostProbableBC = collision.bc().globalBC(); + uint64_t const mostProbableBC = collision.bc().globalBC(); for (auto collision2 = collision + 1; collision2 != collisions.end(); ++collision2) { - uint64_t mostProbableBC2 = collision2.bc().globalBC(); + uint64_t const mostProbableBC2 = collision2.bc().globalBC(); if (mostProbableBC2 == mostProbableBC) { - float radColl1 = std::sqrt(collision.posX() * collision.posX() + collision.posY() * collision.posY()); - float radColl2 = std::sqrt(collision2.posX() * collision2.posX() + collision2.posY() * collision2.posY()); + float const radColl1 = std::sqrt(collision.posX() * collision.posX() + collision.posY() * collision.posY()); + float const radColl2 = std::sqrt(collision2.posX() * collision2.posX() + collision2.posY() * collision2.posY()); int nFromBeautyColl1 = 0, nFromBeautyColl2 = 0; for (const auto& trackColl1 : tracksColl1) { if (trackColl1.has_mcParticle() && trackColl1.isPVContributor()) { @@ -945,13 +945,13 @@ struct HfTaskMcValidationRec { for (const auto& track : tracksFilteredGlobalTrackWoDCA) { // check number of ITS hits int nITSlayers = 0; - uint8_t itsHitMap = track.itsClusterMap(); + uint8_t const itsHitMap = track.itsClusterMap(); for (int iLayer = 0; iLayer < 7; ++iLayer) { if (TESTBIT(itsHitMap, iLayer)) { nITSlayers++; } } - uint index = uint(track.collisionId() >= 0); + uint const index = uint(track.collisionId() >= 0); if (track.has_mcParticle()) { auto particle = track.mcParticle(); // get corresponding MC particle to check origin auto mcCollision = particle.mcCollision_as(); @@ -960,7 +960,7 @@ struct HfTaskMcValidationRec { } auto origin = RecoDecay::getCharmHadronOrigin(mcParticles, particle, true); histTracks->Fill(origin, track.pt()); - bool isAmbiguous = (track.compatibleCollIds().size() != 1); + bool const isAmbiguous = (track.compatibleCollIds().size() != 1); if (isAmbiguous) { registry.fill(HIST("TrackToCollChecks/histAmbiguousTrackNumCollisions"), track.compatibleCollIds().size()); histAmbiguousTracks->Fill(origin, track.pt()); @@ -1077,7 +1077,7 @@ struct HfTaskMcValidationRec { for (const auto& collision : collisions) { // apply event selection float centrality{105.f}; - int occupancy = collision.trackOccupancyInTimeRange(); + int const occupancy = collision.trackOccupancyInTimeRange(); hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); // only needed to update centrality, no bitmask selection applied if (!collision.has_mcCollision()) { return; @@ -1096,7 +1096,7 @@ struct HfTaskMcValidationRec { for (const auto& cand2Prong : grouped2ProngCandidates) { // determine which kind of candidate it is - bool isD0Sel = TESTBIT(cand2Prong.hfflag(), o2::aod::hf_cand_2prong::DecayType::D0ToPiK); + bool const isD0Sel = TESTBIT(cand2Prong.hfflag(), o2::aod::hf_cand_2prong::DecayType::D0ToPiK); if (!isD0Sel) { continue; } @@ -1127,10 +1127,10 @@ struct HfTaskMcValidationRec { // determine which kind of candidate it is // FIXME: add D* and decays with cascades - bool isDPlusSel = TESTBIT(cand3Prong.hfflag(), hf_cand_3prong::DecayType::DplusToPiKPi); - bool isDsSel = TESTBIT(cand3Prong.hfflag(), hf_cand_3prong::DecayType::DsToKKPi); - bool isLcSel = TESTBIT(cand3Prong.hfflag(), hf_cand_3prong::DecayType::LcToPKPi); - bool isXicSel = TESTBIT(cand3Prong.hfflag(), hf_cand_3prong::DecayType::XicToPKPi); + bool const isDPlusSel = TESTBIT(cand3Prong.hfflag(), hf_cand_3prong::DecayType::DplusToPiKPi); + bool const isDsSel = TESTBIT(cand3Prong.hfflag(), hf_cand_3prong::DecayType::DsToKKPi); + bool const isLcSel = TESTBIT(cand3Prong.hfflag(), hf_cand_3prong::DecayType::LcToPKPi); + bool const isXicSel = TESTBIT(cand3Prong.hfflag(), hf_cand_3prong::DecayType::XicToPKPi); if (!isDPlusSel && !isDsSel && !isLcSel && !isXicSel) { continue; } @@ -1169,9 +1169,9 @@ struct HfTaskMcValidationRec { } auto mother = mcParticles.rawIteratorAt(indexParticle); fillHisto(cand3Prong, mother, whichHad, whichOrigin, centrality, occupancy); - std::array momDau2 = {cand3Prong.pxProng2(), - cand3Prong.pyProng2(), - cand3Prong.pzProng2()}; + std::array const momDau2 = {cand3Prong.pxProng2(), + cand3Prong.pyProng2(), + cand3Prong.pzProng2()}; histPtDau[whichHad][whichOrigin][2]->Fill(RecoDecay::pt(momDau2)); histEtaDau[whichHad][whichOrigin][2]->Fill(RecoDecay::eta(momDau2)); histImpactParameterDau[whichHad][whichOrigin][2]->Fill(cand3Prong.impactParameter2()); diff --git a/PWGHF/Tasks/taskPidStudies.cxx b/PWGHF/Tasks/taskPidStudies.cxx index 5103f2ad573..75878f4f9a6 100644 --- a/PWGHF/Tasks/taskPidStudies.cxx +++ b/PWGHF/Tasks/taskPidStudies.cxx @@ -225,7 +225,7 @@ struct HfTaskPidStudies { ccdb->setLocalObjectValidityChecking(); hfEvSel.addHistograms(registry); - std::shared_ptr hTrackSel = registry.add("hTrackSel", "Track selection;;Counts", {HistType::kTH1F, {{TrackCuts::NCuts, 0, TrackCuts::NCuts}}}); + std::shared_ptr const hTrackSel = registry.add("hTrackSel", "Track selection;;Counts", {HistType::kTH1F, {{TrackCuts::NCuts, 0, TrackCuts::NCuts}}}); // Set Labels for hTrackSel hTrackSel->GetXaxis()->SetBinLabel(TrackCuts::All + 1, "All"); @@ -241,7 +241,7 @@ struct HfTaskPidStudies { template void fillTree(Cand const& candidate, const int flag) { - float pseudoRndm = candidate.pt() * 1000. - static_cast(candidate.pt() * 1000); + float const pseudoRndm = candidate.pt() * 1000. - static_cast(candidate.pt() * 1000); if (candidate.pt() < ptMaxForDownSample && pseudoRndm > downSampleBkgFactor) { return; } @@ -522,7 +522,7 @@ struct HfTaskPidStudies { continue; } if (isSelectedV0AsK0s(v0) || isSelectedV0AsLambda(v0)) { - int matched = isMatched(v0); + int const matched = isMatched(v0); if (matched != Particle::NotMatched) { fillTree(v0, matched); } @@ -565,7 +565,7 @@ struct HfTaskPidStudies { continue; } if (isSelectedCascAsOmega(casc)) { - int matched = isMatched(casc); + int const matched = isMatched(casc); if (matched != Particle::NotMatched) { fillTree(casc, matched); } diff --git a/PWGHF/Tasks/taskSelOptimisation.cxx b/PWGHF/Tasks/taskSelOptimisation.cxx index dbb14b1c9c0..77fae9bf1e0 100644 --- a/PWGHF/Tasks/taskSelOptimisation.cxx +++ b/PWGHF/Tasks/taskSelOptimisation.cxx @@ -282,7 +282,7 @@ struct HfSelOptimisation { auto trackPos = cand2Prong.prong0_as(); // positive daughter auto trackNeg = cand2Prong.prong1_as(); // negative daughter - std::array tracks = {trackPos, trackNeg}; + std::array const tracks = {trackPos, trackNeg}; bool isPrompt = false, isNonPrompt = false, isBkg = false; for (int iDecay{0}; iDecay < n2Prong; ++iDecay) { @@ -338,7 +338,7 @@ struct HfSelOptimisation { auto trackFirst = cand3Prong.prong0_as(); // first daughter auto trackSecond = cand3Prong.prong1_as(); // second daughter auto trackThird = cand3Prong.prong2_as(); // third daughter - std::array tracks = {trackFirst, trackSecond, trackThird}; + std::array const tracks = {trackFirst, trackSecond, trackThird}; bool isPrompt = false, isNonPrompt = false, isBkg = false; for (int iDecay{0}; iDecay < n3Prong; ++iDecay) { From c5e72f89660667afae15ff71f087ddc2e6e5632e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Thu, 2 Oct 2025 12:24:54 +0200 Subject: [PATCH 22/25] taskElectronWeakBoson.cxx: Reapply fixes after merge. --- PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx | 94 ++++++++++++----------- 1 file changed, 49 insertions(+), 45 deletions(-) diff --git a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx index 7d06f3f525d..3559f74475a 100644 --- a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx +++ b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx @@ -23,7 +23,6 @@ #include "Common/Core/RecoDecay.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" #include "EventFiltering/Zorro.h" @@ -328,19 +327,19 @@ struct HfTaskElectronWeakBoson { { double energySum = 0.0; double isoEnergy = 10.0; - double etaAssCluster = cluster.eta(); - double phiAssCluster = cluster.phi(); + double const etaAssCluster = cluster.eta(); + double const phiAssCluster = cluster.phi(); for (const auto& associateCluster : clusters) { // Calculate angular distances - double dEta = associateCluster.eta() - etaAssCluster; + double const dEta = associateCluster.eta() - etaAssCluster; double dPhi = associateCluster.phi() - phiAssCluster; // Normalize φ difference dPhi = RecoDecay::constrainAngle(dPhi, -o2::constants::math::PI); // Calculate ΔR - double deltaR = std::sqrt(dEta * dEta + dPhi * dPhi); + double const deltaR = std::sqrt(dEta * dEta + dPhi * dPhi); // Sum energy within isolation cone if (deltaR < rIsolation) { @@ -368,11 +367,11 @@ struct HfTaskElectronWeakBoson { for (const auto& track : tracks) { - double dEta = track.eta() - etaEle; + double const dEta = track.eta() - etaEle; double dPhi = track.phi() - phiEle; dPhi = RecoDecay::constrainAngle(dPhi, -o2::constants::math::PI); - double deltaR = std::sqrt(dEta * dEta + dPhi * dPhi); + double const deltaR = std::sqrt(dEta * dEta + dPhi * dPhi); if (deltaR < rIsolation) { trackCount++; @@ -389,7 +388,7 @@ struct HfTaskElectronWeakBoson { return std::make_pair(trackCount - 1, isoMomentum); } - void recoMassZee(KFParticle kfpIsoEle, + void recoMassZee(const KFParticle& kfpIsoEle, int charge, float centrality, TrackEle const& tracks) @@ -418,12 +417,12 @@ struct HfTaskElectronWeakBoson { continue; } - KFPTrack kfpTrackAssEle = createKFPTrackFromTrack(track); - KFParticle kfpAssEle(kfpTrackAssEle, pdgAss); + KFPTrack const kfpTrackAssEle = createKFPTrackFromTrack(track); + KFParticle const kfpAssEle(kfpTrackAssEle, pdgAss); // reco by RecoDecay auto child1 = RecoDecayPtEtaPhi::pVector(kfpIsoEle.GetPt() * correctionPtElectron, kfpIsoEle.GetEta(), kfpIsoEle.GetPhi()); auto child2 = RecoDecayPtEtaPhi::pVector(kfpAssEle.GetPt() * correctionPtElectron, kfpAssEle.GetEta(), kfpAssEle.GetPhi()); - double invMassEE = RecoDecay::m(std::array{child1, child2}, std::array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron}); + double const invMassEE = RecoDecay::m(std::array{child1, child2}, std::array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron}); registry.fill(HIST("hInvMassZee"), centrality, track.sign() * charge, kfpIsoEle.GetPt(), invMassEE); @@ -433,7 +432,7 @@ struct HfTaskElectronWeakBoson { zeeKF.SetConstructMethod(kfConstructMethod); zeeKF.Construct(electronPairs, 2); // LOG(info) << "Invarimass cal by KF particle Chi2/NDF = " << zeeKF.GetChi2()/zeeKF.GetNDF(); - float chiSqNdf = zeeKF.GetChi2() / zeeKF.GetNDF(); + float const chiSqNdf = zeeKF.GetChi2() / zeeKF.GetNDF(); if (zeeKF.GetNDF() < 1) { continue; } @@ -470,8 +469,8 @@ struct HfTaskElectronWeakBoson { // Get BC for this collision auto bc = collision.bc_as(); - uint64_t globalBC = bc.globalBC(); - int runNumber = bc.runNumber(); + uint64_t const globalBC = bc.globalBC(); + int const runNumber = bc.runNumber(); // Initialize Zorro for the first event (once per run) static bool isFirstEvent = true; @@ -479,7 +478,7 @@ struct HfTaskElectronWeakBoson { if ((isFirstEvent || runNumber != lastRunNumber) && cfgSkimmedProcessing) { LOGF(info, "Initializing Zorro for run %d", runNumber); - uint64_t currentTimestamp = bc.timestamp(); + uint64_t const currentTimestamp = bc.timestamp(); // debug for timestamp LOGF(info, "Using CCDB path: %s, timestamp: %llu", cfgCCDBPath.value.c_str(), currentTimestamp); @@ -490,12 +489,13 @@ struct HfTaskElectronWeakBoson { lastRunNumber = runNumber; // initialize magnetic field - o2::parameters::GRPMagField* grpo = ccdb->getForTimeStamp(ccdbPathGrpMag, currentTimestamp); + auto* grpo = ccdb->getForTimeStamp(ccdbPathGrpMag, currentTimestamp); o2::base::Propagator::initFieldFromGRP(grpo); - double magneticField = o2::base::Propagator::Instance()->getNominalBz(); + double const magneticField = o2::base::Propagator::Instance()->getNominalBz(); LOG(info) << "magneticField = " << magneticField; - if (magneticField) + if (magneticField != 0.0) { KFParticle::SetField(magneticField); + } } // Check if this is a triggered event using Zorro @@ -610,30 +610,31 @@ struct HfTaskElectronWeakBoson { bool isIsolated = false; bool isIsolatedTr = false; - if (tracksofcluster.size() && isEMCacceptance) { + if ((tracksofcluster.size() != 0) && isEMCacceptance) { int nMatch = 0; for (const auto& match : tracksofcluster) { - if (match.emcalcluster_as().time() < timeEmcMin || match.emcalcluster_as().time() > timeEmcMax) + if (match.emcalcluster_as().time() < timeEmcMin || match.emcalcluster_as().time() > timeEmcMax) { continue; + } - float m02Emc = match.emcalcluster_as().m02(); - float energyEmc = match.emcalcluster_as().energy(); - double phiEmc = match.emcalcluster_as().phi(); - double etaEmc = match.emcalcluster_as().eta(); - double timeEmc = match.emcalcluster_as().time(); + float const m02Emc = match.emcalcluster_as().m02(); + float const energyEmc = match.emcalcluster_as().energy(); + double const phiEmc = match.emcalcluster_as().phi(); + double const etaEmc = match.emcalcluster_as().eta(); + double const timeEmc = match.emcalcluster_as().time(); // LOG(info) << "tr phi0 = " << match.track_as().phi(); // LOG(info) << "tr phi1 = " << track.phi(); // LOG(info) << "emc phi = " << phiEmc; if (nMatch == 0) { - double dEta = match.track_as().trackEtaEmcal() - etaEmc; + double const dEta = match.track_as().trackEtaEmcal() - etaEmc; double dPhi = match.track_as().trackPhiEmcal() - phiEmc; dPhi = RecoDecay::constrainAngle(dPhi, -o2::constants::math::PI); registry.fill(HIST("hMatchPhi"), phiEmc, match.track_as().trackPhiEmcal()); registry.fill(HIST("hMatchEta"), etaEmc, match.track_as().trackEtaEmcal()); - double r = RecoDecay::sqrtSumOfSquares(dPhi, dEta); + double const r = RecoDecay::sqrtSumOfSquares(dPhi, dEta); // LOG(info) << "r match = " << r; if (r < rMin) { rMin = r; @@ -644,8 +645,9 @@ struct HfTaskElectronWeakBoson { registry.fill(HIST("hEMCtime"), timeEmc); registry.fill(HIST("hEnergy"), energyEmc); - if (std::abs(dPhi) > rMatchMax || std::abs(dEta) > rMatchMax) + if (std::abs(dPhi) > rMatchMax || std::abs(dEta) > rMatchMax) { continue; + } registry.fill(HIST("hTrMatchR"), match.track_as().pt(), r); registry.fill(HIST("hEnergyNcell"), energyEmc, match.emcalcluster_as().nCells()); @@ -668,10 +670,12 @@ struct HfTaskElectronWeakBoson { if (match.track_as().tpcNSigmaEl() > nsigTpcMin && match.track_as().tpcNSigmaEl() < nsigTpcMax) { registry.fill(HIST("hEop"), match.track_as().pt(), eop); - if (eop > eopMin && eop < eopMax && isoEnergy < energyIsolationMax) + if (eop > eopMin && eop < eopMax && isoEnergy < energyIsolationMax) { isIsolated = true; - if (eop > eopMin && eop < eopMax && trackCount < trackIsolationMax && isoMomentum < momentumIsolationMax) + } + if (eop > eopMin && eop < eopMax && trackCount < trackIsolationMax && isoMomentum < momentumIsolationMax) { isIsolatedTr = true; + } if (isIsolated && isIsolatedTr) { registry.fill(HIST("hEopIsolation"), match.track_as().pt(), eop); @@ -681,8 +685,8 @@ struct HfTaskElectronWeakBoson { if (match.track_as().sign() > 0) { pdgIso = kPositron; } - KFPTrack kfpTrackIsoEle = createKFPTrackFromTrack(match.track_as()); - KFParticle kfpIsoEle(kfpTrackIsoEle, pdgIso); + KFPTrack const kfpTrackIsoEle = createKFPTrackFromTrack(match.track_as()); + KFParticle const kfpIsoEle(kfpTrackIsoEle, pdgIso); recoMassZee(kfpIsoEle, match.track_as().sign(), centrality, tracks); } // end of pt cut for e from Z @@ -732,7 +736,7 @@ struct HfTaskElectronWeakBoson { } // end of track loop // Z-hadron - if (reconstructedZ.size() > 0) { + if (!reconstructedZ.empty()) { for (const auto& zBoson : reconstructedZ) { // Z boson selection if (zBoson.mass < massZMin || zBoson.mass > massZMax) { @@ -747,23 +751,23 @@ struct HfTaskElectronWeakBoson { continue; } // calculate Z-h correlation - double deltaPhi = RecoDecay::constrainAngle(trackAss.phi - zBoson.phi, -o2::constants::math::PIHalf); - double ptRatio = trackAss.pt / zBoson.pt; + double const deltaPhi = RecoDecay::constrainAngle(trackAss.phi - zBoson.phi, -o2::constants::math::PIHalf); + double const ptRatio = trackAss.pt / zBoson.pt; registry.fill(HIST("hZHadronDphi"), centrality, zBoson.charge, zBoson.pt, deltaPhi, ptRatio, trackAss.pt); } } } // end of Z-hadron correlation // Z->ee QA if (enableZeeRecoQA) { - if (selectedElectronsIso.size() > 0 && selectedPositronsIso.size() > 0) { + if (!selectedElectronsIso.empty() && !selectedPositronsIso.empty()) { // signal for (const auto& trackEle : selectedElectronsIso) { auto child1 = RecoDecayPtEtaPhi::pVector(trackEle.pt, trackEle.eta, trackEle.phi); - float sectorneg = trackEle.phi / o2::constants::math::SectorSpanRad; + float const sectorneg = trackEle.phi / o2::constants::math::SectorSpanRad; for (const auto& trackPos : selectedPositronsIso) { auto child2 = RecoDecayPtEtaPhi::pVector(trackPos.pt, trackPos.eta, trackPos.phi); - double invMass = RecoDecay::m(std::array{child1, child2}, std::array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron}); - float sectorpos = trackPos.phi / o2::constants::math::SectorSpanRad; + double const invMass = RecoDecay::m(std::array{child1, child2}, std::array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron}); + float const sectorpos = trackPos.phi / o2::constants::math::SectorSpanRad; if (invMass > massZMinQA) { registry.fill(HIST("hInvMassZeeQA"), invMass, trackEle.pt, trackPos.pt, trackEle.dcaxyTrk, trackPos.dcaxyTrk, trackPos.dcazTrk, trackEle.nclusterTPC, trackPos.nclusterTPC, trackEle.nclusterITS, trackPos.nclusterITS, sectorneg, sectorpos, trackEle.eop, trackPos.eop, trackEle.energyIso, trackPos.energyIso, trackEle.momIso, trackPos.momIso, trackEle.ntrackIso, trackPos.ntrackIso); } @@ -773,12 +777,12 @@ struct HfTaskElectronWeakBoson { for (size_t i = 0; i < selectedElectronsIso.size(); ++i) { const auto& trackEle = selectedElectronsIso[i]; auto child1 = RecoDecayPtEtaPhi::pVector(trackEle.pt, trackEle.eta, trackEle.phi); - float sectorneg = trackEle.phi / o2::constants::math::SectorSpanRad; + float const sectorneg = trackEle.phi / o2::constants::math::SectorSpanRad; for (size_t j = i + 1; j < selectedElectronsIso.size(); ++j) { const auto& trackEle2 = selectedElectronsIso[j]; auto child2 = RecoDecayPtEtaPhi::pVector(trackEle2.pt, trackEle2.eta, trackEle2.phi); - float sectorpos = trackEle2.phi / o2::constants::math::SectorSpanRad; - double invMass = RecoDecay::m(std::array{child1, child2}, std::array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron}); + float const sectorpos = trackEle2.phi / o2::constants::math::SectorSpanRad; + double const invMass = RecoDecay::m(std::array{child1, child2}, std::array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron}); if (invMass > massZMinQA) { registry.fill(HIST("hInvMassZeeQAbg"), invMass, trackEle.pt, trackEle2.pt, trackEle.dcaxyTrk, trackEle2.dcaxyTrk, trackEle2.dcazTrk, trackEle.nclusterTPC, trackEle2.nclusterTPC, trackEle.nclusterITS, trackEle2.nclusterITS, sectorneg, sectorpos, trackEle.eop, trackEle2.eop, trackEle.energyIso, trackEle2.energyIso, trackEle.momIso, trackEle2.momIso, trackEle.ntrackIso, trackEle2.ntrackIso); } @@ -788,12 +792,12 @@ struct HfTaskElectronWeakBoson { for (size_t i = 0; i < selectedPositronsIso.size(); ++i) { const auto& trackPos = selectedPositronsIso[i]; auto child1 = RecoDecayPtEtaPhi::pVector(trackPos.pt, trackPos.eta, trackPos.phi); - float sectorneg = trackPos.phi / o2::constants::math::SectorSpanRad; + float const sectorneg = trackPos.phi / o2::constants::math::SectorSpanRad; for (size_t j = i + 1; j < selectedPositronsIso.size(); ++j) { const auto& trackPos2 = selectedPositronsIso[j]; auto child2 = RecoDecayPtEtaPhi::pVector(trackPos2.pt, trackPos2.eta, trackPos2.phi); - float sectorpos = trackPos2.phi / o2::constants::math::SectorSpanRad; - double invMass = RecoDecay::m(std::array{child1, child2}, std::array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron}); + float const sectorpos = trackPos2.phi / o2::constants::math::SectorSpanRad; + double const invMass = RecoDecay::m(std::array{child1, child2}, std::array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron}); if (invMass > massZMinQA) { registry.fill(HIST("hInvMassZeeQAbg"), invMass, trackPos.pt, trackPos2.pt, trackPos.dcaxyTrk, trackPos2.dcaxyTrk, trackPos2.dcazTrk, trackPos.nclusterTPC, trackPos2.nclusterTPC, trackPos.nclusterITS, trackPos2.nclusterITS, sectorneg, sectorpos, trackPos.eop, trackPos2.eop, trackPos.energyIso, trackPos2.energyIso, trackPos.momIso, trackPos2.momIso, trackPos.ntrackIso, trackPos2.ntrackIso); } From 82bb54a1f20294a76fa8d5efd226f0a76bed41be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Thu, 2 Oct 2025 13:34:10 +0200 Subject: [PATCH 23/25] Fix names in correlatorLcScHadrons.cxx --- PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx index c0ef835a7da..e7557429c3a 100644 --- a/PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx @@ -532,7 +532,7 @@ struct HfCorrelatorLcScHadrons { return true; } - template + template void fillV0Histograms(CollType const& collV0, V0 const& v0s, TrackType const&) { for (const auto& v0 : v0s) { @@ -566,7 +566,7 @@ struct HfCorrelatorLcScHadrons { } } } - if constexpr (isMcRec) { + if constexpr (IsMcRec) { if (!v0.has_mcParticle() || !posTrackV0.has_mcParticle() || !negTrackV0.has_mcParticle()) { continue; } @@ -1390,7 +1390,7 @@ struct HfCorrelatorLcScHadrons { PROCESS_SWITCH(HfCorrelatorLcScHadrons, processMcGenMixedEvent, "Process Mixed Event McGen", false); void processDataLambdaV0(soa::Join::iterator const& collision, - TracksData const& tracks, aod::V0Datas const& V0s) + TracksData const& tracks, aod::V0Datas const& v0s) { registry.fill(HIST("hEventLambdaV0"), 0.5); if (!eventSelV0(collision)) { @@ -1398,12 +1398,12 @@ struct HfCorrelatorLcScHadrons { } registry.fill(HIST("hEventLambdaV0"), 1.5); - fillV0Histograms(collision, V0s, tracks); + fillV0Histograms(collision, v0s, tracks); } PROCESS_SWITCH(HfCorrelatorLcScHadrons, processDataLambdaV0, "Data process for v0 lambda", false); void processMcLambdaV0(soa::Join::iterator const& collision, - TracksWithMc const& tracks, soa::Join const& V0s, aod::McParticles const&) + TracksWithMc const& tracks, soa::Join const& v0s, aod::McParticles const&) { registry.fill(HIST("hEventLambdaV0"), 0.5); if (!eventSelV0(collision)) { @@ -1411,7 +1411,7 @@ struct HfCorrelatorLcScHadrons { } registry.fill(HIST("hEventLambdaV0"), 1.5); - fillV0Histograms(collision, V0s, tracks); + fillV0Histograms(collision, v0s, tracks); } PROCESS_SWITCH(HfCorrelatorLcScHadrons, processMcLambdaV0, "Mc process for v0 lambda", false); }; From 097b0095d84393842157f648458a7c858cef797f Mon Sep 17 00:00:00 2001 From: ALICE Builder Date: Thu, 2 Oct 2025 13:39:26 +0200 Subject: [PATCH 24/25] Please consider the following formatting changes to #13206 (#134) --- PWGHF/Core/HfMlResponseBplusToD0Pi.h | 7 ++++--- PWGHF/Core/HfMlResponseBplusToJpsiKReduced.h | 7 ++++--- PWGHF/Core/HfMlResponseBsToJpsiPhiReduced.h | 7 ++++--- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/PWGHF/Core/HfMlResponseBplusToD0Pi.h b/PWGHF/Core/HfMlResponseBplusToD0Pi.h index aa38b0e927a..9593101719e 100644 --- a/PWGHF/Core/HfMlResponseBplusToD0Pi.h +++ b/PWGHF/Core/HfMlResponseBplusToD0Pi.h @@ -29,9 +29,10 @@ // Fill the map of available input features // the key is the feature's name (std::string) // the value is the corresponding value in EnumInputFeatures -#define FILL_MAP_BPLUS(FEATURE) \ - { \ - #FEATURE, static_cast(InputFeaturesBplusToD0Pi::FEATURE)} +#define FILL_MAP_BPLUS(FEATURE) \ + { \ + #FEATURE, static_cast(InputFeaturesBplusToD0Pi::FEATURE) \ + } // Check if the index of mCachedIndices (index associated to a FEATURE) // matches the entry in EnumInputFeatures associated to this FEATURE diff --git a/PWGHF/Core/HfMlResponseBplusToJpsiKReduced.h b/PWGHF/Core/HfMlResponseBplusToJpsiKReduced.h index 3d0d040d850..85830fcb55b 100644 --- a/PWGHF/Core/HfMlResponseBplusToJpsiKReduced.h +++ b/PWGHF/Core/HfMlResponseBplusToJpsiKReduced.h @@ -29,9 +29,10 @@ // Fill the map of available input features // the key is the feature's name (std::string) // the value is the corresponding value in EnumInputFeatures -#define FILL_MAP_BPLUS(FEATURE) \ - { \ - #FEATURE, static_cast(InputFeaturesBplusToJpsiKReduced::FEATURE)} +#define FILL_MAP_BPLUS(FEATURE) \ + { \ + #FEATURE, static_cast(InputFeaturesBplusToJpsiKReduced::FEATURE) \ + } // Check if the index of mCachedIndices (index associated to a FEATURE) // matches the entry in EnumInputFeatures associated to this FEATURE diff --git a/PWGHF/Core/HfMlResponseBsToJpsiPhiReduced.h b/PWGHF/Core/HfMlResponseBsToJpsiPhiReduced.h index bdf0ce3cc80..ee9fb5956c7 100644 --- a/PWGHF/Core/HfMlResponseBsToJpsiPhiReduced.h +++ b/PWGHF/Core/HfMlResponseBsToJpsiPhiReduced.h @@ -29,9 +29,10 @@ // Fill the map of available input features // the key is the feature's name (std::string) // the value is the corresponding value in EnumInputFeatures -#define FILL_MAP_BS(FEATURE) \ - { \ - #FEATURE, static_cast(InputFeaturesBsToJpsiPhiReduced::FEATURE)} +#define FILL_MAP_BS(FEATURE) \ + { \ + #FEATURE, static_cast(InputFeaturesBsToJpsiPhiReduced::FEATURE) \ + } // Check if the index of mCachedIndices (index associated to a FEATURE) // matches the entry in EnumInputFeatures associated to this FEATURE From d0c56ec630e32159f03f3a98d009fd71096e252f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Mon, 6 Oct 2025 20:14:05 +0200 Subject: [PATCH 25/25] Consistent order --- PWGHF/Core/SelectorCuts.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/Core/SelectorCuts.h b/PWGHF/Core/SelectorCuts.h index d4c09c83d87..2feeb313af6 100644 --- a/PWGHF/Core/SelectorCuts.h +++ b/PWGHF/Core/SelectorCuts.h @@ -40,7 +40,7 @@ constexpr double BinsPtTrack[NBinsPtTrack + 1] = { 2.0, 3.0, 1000.0}; -auto const vecBinsPtTrack = std::vector{BinsPtTrack, BinsPtTrack + NBinsPtTrack + 1}; +const auto vecBinsPtTrack = std::vector{BinsPtTrack, BinsPtTrack + NBinsPtTrack + 1}; // default values for the dca_xy and dca_z cuts of displaced tracks constexpr double CutsTrack[NBinsPtTrack][NCutVarsTrack] = {{0.0000, 10., 0.0000, 100.}, /* 0 < pt < 0.5 */