From 8998841ae7c5af50a71abc0c5544cc3019dfe11c Mon Sep 17 00:00:00 2001 From: Oleksii Lubynets Date: Sun, 28 Dec 2025 22:32:06 +0100 Subject: [PATCH] address clang-tidy issues --- .../TableProducer/candidateCreator3Prong.cxx | 72 +++++++++--------- PWGHF/TableProducer/candidateSelectorLc.cxx | 30 ++++---- PWGHF/TableProducer/treeCreatorLcToPKPi.cxx | 76 +++++++++---------- 3 files changed, 89 insertions(+), 89 deletions(-) diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index bb03518d889..a66a2be7ae3 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -111,10 +111,10 @@ struct HfCandidateCreator3Prong { Configurable propagateToPCA{"propagateToPCA", true, "create tracks version propagated to PCA"}; Configurable useAbsDCA{"useAbsDCA", false, "Minimise abs. distance rather than chi2"}; Configurable useWeightedFinalPCA{"useWeightedFinalPCA", false, "Recalculate vertex position using track covariances, effective only if useAbsDCA is true"}; - Configurable maxR{"maxR", 200., "reject PCA's above this radius"}; - Configurable maxDZIni{"maxDZIni", 4., "reject (if>0) PCA candidate if tracks DZ exceeds threshold"}; - Configurable minParamChange{"minParamChange", 1.e-3, "stop iterations if largest change of any X is smaller than this"}; - Configurable minRelChi2Change{"minRelChi2Change", 0.9, "stop iterations is chi2/chi2old > this"}; + Configurable maxR{"maxR", 200., "reject PCA's above this radius"}; + Configurable maxDZIni{"maxDZIni", 4., "reject (if>0) PCA candidate if tracks DZ exceeds threshold"}; + Configurable minParamChange{"minParamChange", 1.e-3, "stop iterations if largest change of any X is smaller than this"}; + Configurable minRelChi2Change{"minRelChi2Change", 0.9, "stop iterations is chi2/chi2old > this"}; Configurable fillHistograms{"fillHistograms", true, "do validation plots"}; // magnetic field setting from CCDB Configurable isRun2{"isRun2", false, "enable Run 2 or Run 3 GRP objects for magnetic field"}; @@ -138,7 +138,7 @@ struct HfCandidateCreator3Prong { int runNumber{0}; double bz{0.}; - const float toMicrometers = 10000.; // from cm to µm + constexpr static float CentiToMicro{10000.f}; // from cm to µm constexpr static float UndefValueFloat{-999.f}; using FilteredHf3Prongs = soa::Filtered; @@ -307,7 +307,7 @@ struct HfCandidateCreator3Prong { // df.setBz(bz); /// put it outside the 'if'! Otherwise we have a difference wrt bz Configurable (< 1 permille) in Run2 conv. data // df.print(); } - df.setBz(bz); + df.setBz(static_cast(bz)); // reconstruct the 3-prong secondary vertex hCandidates->Fill(SVFitting::BeforeFit); @@ -371,15 +371,15 @@ struct HfCandidateCreator3Prong { trackParVar0.propagateToDCA(primaryVertex, bz, &impactParameter0); trackParVar1.propagateToDCA(primaryVertex, bz, &impactParameter1); trackParVar2.propagateToDCA(primaryVertex, bz, &impactParameter2); - registry.fill(HIST("hDcaXYProngs"), track0.pt(), impactParameter0.getY() * toMicrometers); - registry.fill(HIST("hDcaXYProngs"), track1.pt(), impactParameter1.getY() * toMicrometers); - registry.fill(HIST("hDcaXYProngs"), track2.pt(), impactParameter2.getY() * toMicrometers); - registry.fill(HIST("hDcaZProngs"), track0.pt(), impactParameter0.getZ() * toMicrometers); - registry.fill(HIST("hDcaZProngs"), track1.pt(), impactParameter1.getZ() * toMicrometers); - registry.fill(HIST("hDcaZProngs"), track2.pt(), impactParameter2.getZ() * toMicrometers); + registry.fill(HIST("hDcaXYProngs"), track0.pt(), impactParameter0.getY() * CentiToMicro); + registry.fill(HIST("hDcaXYProngs"), track1.pt(), impactParameter1.getY() * CentiToMicro); + registry.fill(HIST("hDcaXYProngs"), track2.pt(), impactParameter2.getY() * CentiToMicro); + registry.fill(HIST("hDcaZProngs"), track0.pt(), impactParameter0.getZ() * CentiToMicro); + registry.fill(HIST("hDcaZProngs"), track1.pt(), impactParameter1.getZ() * CentiToMicro); + registry.fill(HIST("hDcaZProngs"), track2.pt(), impactParameter2.getZ() * CentiToMicro); // get uncertainty of the decay length - double phi, theta; + double phi{}, theta{}; getPointDirection(std::array{primaryVertex.getX(), primaryVertex.getY(), primaryVertex.getZ()}, secondaryVertex, phi, theta); auto errorDecayLength = std::sqrt(getRotatedCovMatrixXX(covMatrixPV, phi, theta) + getRotatedCovMatrixXX(covMatrixPCA, phi, theta)); auto errorDecayLengthXY = std::sqrt(getRotatedCovMatrixXX(covMatrixPV, phi, 0.) + getRotatedCovMatrixXX(covMatrixPCA, phi, 0.)); @@ -481,7 +481,7 @@ struct HfCandidateCreator3Prong { } float covMatrixPV[6]; - KFParticle::SetField(bz); + KFParticle::SetField(static_cast(bz)); KFPVertex kfpVertex = createKFPVertexFromCollision(collision); if constexpr (DoPvRefit) { @@ -513,22 +513,22 @@ struct HfCandidateCreator3Prong { float impactParameter0XY = 0., errImpactParameter0XY = 0., impactParameter1XY = 0., errImpactParameter1XY = 0., impactParameter2XY = 0., errImpactParameter2XY = 0.; if (!kfFirstProton.GetDistanceFromVertexXY(kfpV, impactParameter0XY, errImpactParameter0XY)) { - registry.fill(HIST("hDcaXYProngs"), track0.pt(), impactParameter0XY * toMicrometers); - registry.fill(HIST("hDcaZProngs"), track0.pt(), std::sqrt(kfFirstProton.GetDistanceFromVertex(kfpV) * kfFirstProton.GetDistanceFromVertex(kfpV) - impactParameter0XY * impactParameter0XY) * toMicrometers); + registry.fill(HIST("hDcaXYProngs"), track0.pt(), impactParameter0XY * CentiToMicro); + registry.fill(HIST("hDcaZProngs"), track0.pt(), std::sqrt(kfFirstProton.GetDistanceFromVertex(kfpV) * kfFirstProton.GetDistanceFromVertex(kfpV) - impactParameter0XY * impactParameter0XY) * CentiToMicro); } else { registry.fill(HIST("hDcaXYProngs"), track0.pt(), UndefValueFloat); registry.fill(HIST("hDcaZProngs"), track0.pt(), UndefValueFloat); } if (!kfSecondKaon.GetDistanceFromVertexXY(kfpV, impactParameter1XY, errImpactParameter1XY)) { - registry.fill(HIST("hDcaXYProngs"), track1.pt(), impactParameter1XY * toMicrometers); - registry.fill(HIST("hDcaZProngs"), track1.pt(), std::sqrt(kfSecondKaon.GetDistanceFromVertex(kfpV) * kfSecondKaon.GetDistanceFromVertex(kfpV) - impactParameter1XY * impactParameter1XY) * toMicrometers); + registry.fill(HIST("hDcaXYProngs"), track1.pt(), impactParameter1XY * CentiToMicro); + registry.fill(HIST("hDcaZProngs"), track1.pt(), std::sqrt(kfSecondKaon.GetDistanceFromVertex(kfpV) * kfSecondKaon.GetDistanceFromVertex(kfpV) - impactParameter1XY * impactParameter1XY) * CentiToMicro); } else { registry.fill(HIST("hDcaXYProngs"), track1.pt(), UndefValueFloat); registry.fill(HIST("hDcaZProngs"), track1.pt(), UndefValueFloat); } if (!kfThirdProton.GetDistanceFromVertexXY(kfpV, impactParameter2XY, errImpactParameter2XY)) { - registry.fill(HIST("hDcaXYProngs"), track2.pt(), impactParameter2XY * toMicrometers); - registry.fill(HIST("hDcaZProngs"), track2.pt(), std::sqrt(kfThirdProton.GetDistanceFromVertex(kfpV) * kfThirdProton.GetDistanceFromVertex(kfpV) - impactParameter2XY * impactParameter2XY) * toMicrometers); + registry.fill(HIST("hDcaXYProngs"), track2.pt(), impactParameter2XY * CentiToMicro); + registry.fill(HIST("hDcaZProngs"), track2.pt(), std::sqrt(kfThirdProton.GetDistanceFromVertex(kfpV) * kfThirdProton.GetDistanceFromVertex(kfpV) - impactParameter2XY * impactParameter2XY) * CentiToMicro); } else { registry.fill(HIST("hDcaXYProngs"), track2.pt(), UndefValueFloat); registry.fill(HIST("hDcaZProngs"), track2.pt(), UndefValueFloat); @@ -604,14 +604,14 @@ struct HfCandidateCreator3Prong { const float massPiK = kfPairPiK.GetMass(); if (applyInvMassConstraint) { // constraints applied after minv getters - to preserve unbiased values of minv - kfCandPKPi.SetNonlinearMassConstraint(createLc ? MassLambdaCPlus : MassXiCPlus); - kfCandPiKP.SetNonlinearMassConstraint(createLc ? MassLambdaCPlus : MassXiCPlus); + kfCandPKPi.SetNonlinearMassConstraint(createLc ? static_cast(MassLambdaCPlus) : static_cast(MassXiCPlus)); + kfCandPiKP.SetNonlinearMassConstraint(createLc ? static_cast(MassLambdaCPlus) : static_cast(MassXiCPlus)); kfCandPiKPi.SetNonlinearMassConstraint(MassDPlus); kfCandKKPi.SetNonlinearMassConstraint(MassDS); kfCandPiKK.SetNonlinearMassConstraint(MassDS); } - const float chi2geo = kfCandPKPi.Chi2() / kfCandPKPi.NDF(); + const float chi2geo = kfCandPKPi.Chi2() / static_cast(kfCandPKPi.NDF()); const std::pair ldl = kfCalculateLdL(kfCandPKPi, kfpV); std::array pProng0 = kfCalculateProngMomentumInSecondaryVertex(kfFirstProton, kfCandPiKP); @@ -624,7 +624,7 @@ struct HfCandidateCreator3Prong { registry.fill(HIST("hCovSVZZ"), kfCandPKPi.Covariance(2, 2)); auto* covMatrixSV = kfCandPKPi.CovarianceMatrix(); - double phi, theta; + 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)); auto errorDecayLengthXY = std::sqrt(getRotatedCovMatrixXX(covMatrixPV, phi, 0.) + getRotatedCovMatrixXX(covMatrixSV, phi, 0.)); @@ -647,7 +647,7 @@ struct HfCandidateCreator3Prong { kfpV.GetX(), kfpV.GetY(), kfpV.GetZ(), kfCandPKPi.GetX(), kfCandPKPi.GetY(), kfCandPKPi.GetZ(), errorDecayLength, errorDecayLengthXY, - kfCandPKPi.GetChi2() / kfCandPKPi.GetNDF(), + kfCandPKPi.GetChi2() / static_cast(kfCandPKPi.GetNDF()), pProng0.at(0), pProng0.at(1), pProng0.at(2), pProng1.at(0), pProng1.at(1), pProng1.at(2), pProng2.at(0), pProng2.at(1), pProng2.at(2), @@ -904,7 +904,7 @@ struct HfCandidateCreator3Prong { const auto bc = collision.template foundBC_as(); const auto ir = hfEvSel.getInteractionRate(bc, ccdb); // Hz /// monitor the satisfied event selections - hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy, ir); + hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy, static_cast(ir)); } /// end loop over collisions } @@ -923,7 +923,7 @@ struct HfCandidateCreator3Prong { const auto bc = collision.template foundBC_as(); const auto ir = hfEvSel.getInteractionRate(bc, ccdb); // Hz /// monitor the satisfied event selections - hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy, ir); + hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy, static_cast(ir)); } /// end loop over collisions } @@ -942,7 +942,7 @@ struct HfCandidateCreator3Prong { const auto bc = collision.template foundBC_as(); const auto ir = hfEvSel.getInteractionRate(bc, ccdb); // Hz /// monitor the satisfied event selections - hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy, ir); + hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy, static_cast(ir)); } /// end loop over collisions } @@ -966,7 +966,7 @@ struct HfCandidateCreator3Prong { const auto bc = collision.template foundBC_as(); const auto ir = hfEvSel.getInteractionRate(bc, ccdb); // Hz /// monitor the satisfied event selections - hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy, ir); + hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy, static_cast(ir)); } /// end loop over collisions } @@ -1132,7 +1132,7 @@ struct HfCandidateCreator3ProngExpressions { return; } if (indexRec > -1) { - flagChannelMain = sign * channelMain; + flagChannelMain = sign * static_cast(channelMain); /// swapping for D+, Ds->Kpipi; Lc, Xic->pKpi if (std::abs(flagChannelMain) == DecayChannelMain::DplusToPiKK || std::abs(flagChannelMain) == DecayChannelMain::DsToPiKK || std::abs(flagChannelMain) == DecayChannelMain::LcToPKPi || std::abs(flagChannelMain) == DecayChannelMain::XicToPKPi) { @@ -1185,7 +1185,7 @@ struct HfCandidateCreator3ProngExpressions { indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDPlus, arrPdgDaughtersDplusToPiKPi, true, &sign, 2); } if (indexRec > -1) { - flagChannelMain = sign * DecayChannelMain::DplusToPiKPi; + flagChannelMain = sign * static_cast(DecayChannelMain::DplusToPiKPi); } } @@ -1215,7 +1215,7 @@ struct HfCandidateCreator3ProngExpressions { } } if (indexRec > -1) { - flagChannelMain = sign * (isDplus ? DecayChannelMain::DplusToPiKK : DecayChannelMain::DsToPiKK); + flagChannelMain = sign * (isDplus ? static_cast(DecayChannelMain::DplusToPiKK) : static_cast(DecayChannelMain::DsToPiKK)); if (arrayDaughters[0].has_mcParticle()) { swapping = static_cast(std::abs(arrayDaughters[0].mcParticle().pdgCode()) == kPiPlus); } @@ -1243,7 +1243,7 @@ struct HfCandidateCreator3ProngExpressions { indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDStar, arrPdgDaughtersDstarToPiKPi, true, &sign, 2); } if (indexRec > -1) { - flagChannelMain = sign * DecayChannelMain::DstarToPiKPi; + flagChannelMain = sign * static_cast(DecayChannelMain::DstarToPiKPi); flagChannelResonant = 0; } } @@ -1261,7 +1261,7 @@ struct HfCandidateCreator3ProngExpressions { indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kLambdaCPlus, arrPdgDaughtersLcToPKPi, true, &sign, 2); } if (indexRec > -1) { - flagChannelMain = sign * DecayChannelMain::LcToPKPi; + flagChannelMain = sign * static_cast(DecayChannelMain::LcToPKPi); // Flagging the different Λc± → p± K∓ π± decay channels if (arrayDaughters[0].has_mcParticle()) { @@ -1297,7 +1297,7 @@ struct HfCandidateCreator3ProngExpressions { indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kXiCPlus, arrPdgDaughtersXicToPKPi, true, &sign, 2); } if (indexRec > -1) { - flagChannelMain = sign * DecayChannelMain::XicToPKPi; + flagChannelMain = sign * static_cast(DecayChannelMain::XicToPKPi); flagChannelResonant = 0; // TODO if (arrayDaughters[0].has_mcParticle()) { swapping = static_cast(std::abs(arrayDaughters[0].mcParticle().pdgCode()) == kPiPlus); @@ -1309,7 +1309,7 @@ struct HfCandidateCreator3ProngExpressions { // Check whether the particle is non-prompt (from a b quark). if (flagChannelMain != 0) { auto particle = mcParticles.rawIteratorAt(indexRec); - origin = RecoDecay::getCharmHadronOrigin(mcParticles, particle, false, &idxBhadMothers); + origin = static_cast(RecoDecay::getCharmHadronOrigin(mcParticles, particle, false, &idxBhadMothers)); } if (origin == RecoDecay::OriginType::NonPrompt) { auto bHadMother = mcParticles.rawIteratorAt(idxBhadMothers[0]); diff --git a/PWGHF/TableProducer/candidateSelectorLc.cxx b/PWGHF/TableProducer/candidateSelectorLc.cxx index b372780c1f3..31a6730ab26 100644 --- a/PWGHF/TableProducer/candidateSelectorLc.cxx +++ b/PWGHF/TableProducer/candidateSelectorLc.cxx @@ -62,18 +62,18 @@ struct HfCandidateSelectorLc { Configurable ptCandMax{"ptCandMax", 36., "Upper bound of candidate pT"}; Configurable usePid{"usePid", true, "Bool to use or not the PID based on nSigma cut at filtering level"}; // TPC PID - Configurable ptPidTpcMin{"ptPidTpcMin", 0.1, "Lower bound of track pT for TPC PID"}; - Configurable ptPidTpcMax{"ptPidTpcMax", 1., "Upper bound of track pT for TPC PID"}; - Configurable nSigmaTpcMax{"nSigmaTpcMax", 3., "Nsigma cut on TPC only"}; - Configurable nSigmaTpcCombinedMax{"nSigmaTpcCombinedMax", 5., "Nsigma cut on TPC combined with TOF"}; + Configurable ptPidTpcMin{"ptPidTpcMin", 0.1, "Lower bound of track pT for TPC PID"}; + Configurable ptPidTpcMax{"ptPidTpcMax", 1., "Upper bound of track pT for TPC PID"}; + Configurable nSigmaTpcMax{"nSigmaTpcMax", 3., "Nsigma cut on TPC only"}; + Configurable nSigmaTpcCombinedMax{"nSigmaTpcCombinedMax", 5., "Nsigma cut on TPC combined with TOF"}; // TOF PID - Configurable ptPidTofMin{"ptPidTofMin", 0.5, "Lower bound of track pT for TOF PID"}; - Configurable ptPidTofMax{"ptPidTofMax", 2.5, "Upper bound of track pT for TOF PID"}; - Configurable nSigmaTofMax{"nSigmaTofMax", 3., "Nsigma cut on TOF only"}; - Configurable nSigmaTofCombinedMax{"nSigmaTofCombinedMax", 5., "Nsigma cut on TOF combined with TPC"}; + Configurable ptPidTofMin{"ptPidTofMin", 0.5, "Lower bound of track pT for TOF PID"}; + Configurable ptPidTofMax{"ptPidTofMax", 2.5, "Upper bound of track pT for TOF PID"}; + Configurable nSigmaTofMax{"nSigmaTofMax", 3., "Nsigma cut on TOF only"}; + Configurable nSigmaTofCombinedMax{"nSigmaTofCombinedMax", 5., "Nsigma cut on TOF combined with TPC"}; // Bayesian PID - Configurable ptPidBayesMin{"ptPidBayesMin", 0., "Lower bound of track pT for Bayesian PID"}; - Configurable ptPidBayesMax{"ptPidBayesMax", 100, "Upper bound of track pT for Bayesian PID"}; + Configurable ptPidBayesMin{"ptPidBayesMin", 0., "Lower bound of track pT for Bayesian PID"}; + Configurable ptPidBayesMax{"ptPidBayesMax", 100, "Upper bound of track pT for Bayesian PID"}; // Combined PID options Configurable usePidTpcAndTof{"usePidTpcAndTof", false, "Bool to decide how to combine TPC and TOF PID: true = both (if present, only one otherwise); false = one is enough"}; // TPC quality track cuts @@ -518,11 +518,11 @@ struct HfCandidateSelectorLc { if (usePid) { // track-level PID selection - TrackSelectorPID::Status pidTrackPos1Proton; - TrackSelectorPID::Status pidTrackPos2Proton; - TrackSelectorPID::Status pidTrackPos1Pion; - TrackSelectorPID::Status pidTrackPos2Pion; - TrackSelectorPID::Status pidTrackNegKaon; + TrackSelectorPID::Status pidTrackPos1Proton{}; + TrackSelectorPID::Status pidTrackPos2Proton{}; + TrackSelectorPID::Status pidTrackPos1Pion{}; + TrackSelectorPID::Status pidTrackPos2Pion{}; + TrackSelectorPID::Status pidTrackNegKaon{}; if (usePidTpcAndTof) { pidTrackPos1Proton = selectorProton.statusTpcAndTof(trackPos1, candidate.nSigTpcPr0(), candidate.nSigTofPr0()); pidTrackPos2Proton = selectorProton.statusTpcAndTof(trackPos2, candidate.nSigTpcPr2(), candidate.nSigTofPr2()); diff --git a/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx b/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx index 97264a2336a..afc3960ba98 100644 --- a/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx +++ b/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx @@ -544,7 +544,7 @@ struct HfTreeCreatorLcToPKPi { /// \param candidatesSize size of the candidates table /// \param isMc boolean flag whether MC or data is processed template - void reserveTables(size_t candidatesSize, bool isMc) + void reserveTables(int64_t candidatesSize, bool isMc) { if constexpr (ReconstructionType == aod::hf_cand::VertexerType::DCAFitter) { if (fillCandidateLiteTable) { @@ -814,22 +814,22 @@ struct HfTreeCreatorLcToPKPi { int functionSelection, int sigbgstatus) { - float chi2primProton; - float chi2primPion; - float dcaProtonKaon; - float dcaPionKaon; - float chi2GeoProtonKaon; - float chi2GeoPionKaon; - float mass; - float valueTpcNSigmaPr; + float chi2primProton{}; + float chi2primPion{}; + float dcaProtonKaon{}; + float dcaPionKaon{}; + float chi2GeoProtonKaon{}; + float chi2GeoPionKaon{}; + float mass{}; + float valueTpcNSigmaPr{}; const float valueTpcNSigmaKa = candidate.nSigTpcKa1(); - float valueTpcNSigmaPi; - float valueTofNSigmaPr; + float valueTpcNSigmaPi{}; + float valueTofNSigmaPr{}; const float valueTofNSigmaKa = candidate.nSigTofKa1(); - float valueTofNSigmaPi; - float valueTpcTofNSigmaPr; + float valueTofNSigmaPi{}; + float valueTpcTofNSigmaPr{}; const float valueTpcTofNSigmaKa = candidate.tpcTofNSigmaKa1(); - float valueTpcTofNSigmaPi; + float valueTpcTofNSigmaPi{}; if (candFlag == 0) { chi2primProton = candidate.kfChi2PrimProng0(); chi2primPion = candidate.kfChi2PrimProng2(); @@ -883,8 +883,8 @@ struct HfTreeCreatorLcToPKPi { const float deltaP = std::sqrt(pt * pt * deltaPt * deltaPt + candidate.kfPz() * candidate.kfPz() * candidate.kfErrorPz() * candidate.kfErrorPz()) / p; - const float lifetime = decayLength * MassLambdaCPlus / LightSpeedCm2PS / p; - const float deltaT = dl * MassLambdaCPlus / LightSpeedCm2PS / p; + const float lifetime = decayLength * static_cast(MassLambdaCPlus) / LightSpeedCm2PS / p; + const float deltaT = dl * static_cast(MassLambdaCPlus) / LightSpeedCm2PS / p; rowCandidateKF( svX, svY, svZ, svErrX, svErrY, svErrZ, pvErrX, pvErrY, pvErrZ, @@ -924,17 +924,17 @@ struct HfTreeCreatorLcToPKPi { fillEventProperties(collisions); - const size_t candidatesSize = candidates.size(); + const int64_t candidatesSize = static_cast(candidates.size()); reserveTables(candidatesSize, IsMc); int iCand{0}; for (const auto& candidate : candidates) { - auto candidateMlScore = candidateMlScores.rawIteratorAt(iCand); + const auto candidateMlScore = candidateMlScores.rawIteratorAt(iCand); ++iCand; - float ptProng0 = candidate.ptProng0(); - auto collision = candidate.template collision_as(); + const float ptProng0 = candidate.ptProng0(); + const auto collision = candidate.template collision_as(); auto fillTable = [&](int candFlag) { - double const pseudoRndm = ptProng0 * 1000. - static_cast(ptProng0 * 1000); + double const pseudoRndm = ptProng0 * 1000. - static_cast(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); @@ -954,7 +954,7 @@ struct HfTreeCreatorLcToPKPi { fillKFTable(candidate, collision, candFlag, functionSelection, sigbgstatus); } if (fillCandidateMcTable) { - float p, pt, svX, svY, svZ, pvX, pvY, pvZ, decayLength, lifetime; + float p{}, pt{}, svX{}, svY{}, svZ{}, pvX{}, pvY{}, pvZ{}, decayLength{}, lifetime{}; if (!isMcCandidateSignal) { p = UndefValueFloat; pt = UndefValueFloat; @@ -967,13 +967,13 @@ struct HfTreeCreatorLcToPKPi { decayLength = UndefValueFloat; lifetime = UndefValueFloat; } else { - auto mcParticleProng0 = candidate.template prong0_as>().template mcParticle_as>(); - auto indexMother = RecoDecay::getMother(particles, mcParticleProng0, o2::constants::physics::Pdg::kLambdaCPlus, true); - auto particleMother = particles.rawIteratorAt(indexMother); - auto mcCollision = particleMother.template mcCollision_as(); + const auto mcParticleProng0 = candidate.template prong0_as>().template mcParticle_as>(); + const auto indexMother = RecoDecay::getMother(particles, mcParticleProng0, o2::constants::physics::Pdg::kLambdaCPlus, true); + const auto particleMother = particles.rawIteratorAt(indexMother); + const auto mcCollision = particleMother.template mcCollision_as(); p = particleMother.p(); pt = particleMother.pt(); - const float p2m = p / MassLambdaCPlus; + const float p2m = p / static_cast(MassLambdaCPlus); const float gamma = std::sqrt(1 + p2m * p2m); // mother's particle Lorentz factor pvX = mcCollision.posX(); pvY = mcCollision.posY(); @@ -981,7 +981,7 @@ struct HfTreeCreatorLcToPKPi { svX = mcParticleProng0.vx(); svY = mcParticleProng0.vy(); svZ = mcParticleProng0.vz(); - decayLength = RecoDecay::distance(std::array{svX, svY, svZ}, std::array{pvX, pvY, pvZ}); + decayLength = static_cast(RecoDecay::distance(std::array{svX, svY, svZ}, std::array{pvX, pvY, pvZ})); lifetime = mcParticleProng0.vt() * NanoToPico / gamma; // from ns to ps * from lab time to proper time } rowCandidateMC( @@ -1000,10 +1000,10 @@ struct HfTreeCreatorLcToPKPi { rowCandidateFullParticles.reserve(particles.size()); for (const auto& particle : particles) { if (std::abs(particle.flagMcMatchGen()) == o2::hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) { - auto mcDaughter0 = particle.template daughters_as>().begin(); - auto mcCollision = particle.template mcCollision_as(); - auto p = particle.p(); - const float p2m = p / MassLambdaCPlus; + const auto mcDaughter0 = particle.template daughters_as>().begin(); + const auto mcCollision = particle.template mcCollision_as(); + const auto p = particle.p(); + const float p2m = p / static_cast(MassLambdaCPlus); const float gamma = std::sqrt(1 + p2m * p2m); // mother's particle Lorentz factor const float pvX = mcCollision.posX(); const float pvY = mcCollision.posY(); @@ -1011,7 +1011,7 @@ struct HfTreeCreatorLcToPKPi { const float svX = mcDaughter0.vx(); const float svY = mcDaughter0.vy(); const float svZ = mcDaughter0.vz(); - const float l = RecoDecay::distance(std::array{svX, svY, svZ}, std::array{pvX, pvY, pvZ}); + const float l = static_cast(RecoDecay::distance(std::array{svX, svY, svZ}, std::array{pvX, pvY, pvZ})); const float t = mcDaughter0.vt() * NanoToPico / gamma; // from ns to ps * from lab time to proper time rowCandidateFullParticles( particle.pt(), @@ -1111,19 +1111,19 @@ struct HfTreeCreatorLcToPKPi { fillEventProperties(collisions); - const size_t candidatesSize = candidates.size(); + const size_t candidatesSize = static_cast(candidates.size()); reserveTables(candidatesSize, IsMc); // Filling candidate properties int iCand{0}; for (const auto& candidate : candidates) { - auto candidateMlScore = candidateMlScores.rawIteratorAt(iCand); + const auto candidateMlScore = candidateMlScores.rawIteratorAt(iCand); ++iCand; - float ptProng0 = candidate.ptProng0(); - auto collision = candidate.template collision_as(); + const float ptProng0 = candidate.ptProng0(); + const auto collision = candidate.template collision_as(); auto fillTable = [&](int candFlag) { - double const pseudoRndm = ptProng0 * 1000. - static_cast(ptProng0 * 1000); + double const pseudoRndm = ptProng0 * 1000. - static_cast(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) {