diff --git a/PWGCF/EbyEFluctuations/Tasks/v0ptHadPiKaProt.cxx b/PWGCF/EbyEFluctuations/Tasks/v0ptHadPiKaProt.cxx index a0099221620..f6e53913d2c 100644 --- a/PWGCF/EbyEFluctuations/Tasks/v0ptHadPiKaProt.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/v0ptHadPiKaProt.cxx @@ -69,7 +69,7 @@ struct V0ptHadPiKaProt { // ITS response o2::aod::ITSResponse itsResponse; // Connect to ccdb - Service ccdb; + Service ccdb{}; Configurable ccdbNoLaterThan{"ccdbNoLaterThan", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; Configurable ccdbUrl{"ccdbUrl", "https://alice-ccdb.cern.ch", "url of the ccdb repository"}; @@ -243,34 +243,34 @@ struct V0ptHadPiKaProt { Preslice perCollision = aod::track::collisionId; Preslice perMcCollision = aod::mcparticle::mcCollisionId; - std::array tofNsigmaCut; - std::array itsNsigmaCut; - std::array tpcNsigmaCut; + std::array tofNsigmaCut{}; + std::array itsNsigmaCut{}; + std::array tpcNsigmaCut{}; // Equivalent of the AliRoot task UserCreateOutputObjects void init(o2::framework::InitContext&) { // Get nSigma values of TPC, TOF, ITS for various particles from the matrix "nSigmas" - tpcNsigmaCut[kPionUpCut] = nSigmas->getData()[kTPC][kPionUpCut]; - tpcNsigmaCut[kKaonUpCut] = nSigmas->getData()[kTPC][kKaonUpCut]; - tpcNsigmaCut[kProtonUpCut] = nSigmas->getData()[kTPC][kProtonUpCut]; - tpcNsigmaCut[kPionLowCut] = nSigmas->getData()[kTPC][kPionLowCut]; - tpcNsigmaCut[kKaonLowCut] = nSigmas->getData()[kTPC][kKaonLowCut]; - tpcNsigmaCut[kProtonLowCut] = nSigmas->getData()[kTPC][kProtonLowCut]; - - tofNsigmaCut[kPionUpCut] = nSigmas->getData()[kTOF][kPionUpCut]; - tofNsigmaCut[kKaonUpCut] = nSigmas->getData()[kTOF][kKaonUpCut]; - tofNsigmaCut[kProtonUpCut] = nSigmas->getData()[kTOF][kProtonUpCut]; - tofNsigmaCut[kPionLowCut] = nSigmas->getData()[kTOF][kPionLowCut]; - tofNsigmaCut[kKaonLowCut] = nSigmas->getData()[kTOF][kKaonLowCut]; - tofNsigmaCut[kProtonLowCut] = nSigmas->getData()[kTOF][kProtonLowCut]; - - itsNsigmaCut[kPionUpCut] = nSigmas->getData()[kITS][kPionUpCut]; - itsNsigmaCut[kKaonUpCut] = nSigmas->getData()[kITS][kKaonUpCut]; - itsNsigmaCut[kProtonUpCut] = nSigmas->getData()[kITS][kProtonUpCut]; - itsNsigmaCut[kPionLowCut] = nSigmas->getData()[kITS][kPionLowCut]; - itsNsigmaCut[kKaonLowCut] = nSigmas->getData()[kITS][kKaonLowCut]; - itsNsigmaCut[kProtonLowCut] = nSigmas->getData()[kITS][kProtonLowCut]; + tpcNsigmaCut[kPionUpCut] = nSigmas.value[kTPC][kPionUpCut]; + tpcNsigmaCut[kKaonUpCut] = nSigmas.value[kTPC][kKaonUpCut]; + tpcNsigmaCut[kProtonUpCut] = nSigmas.value[kTPC][kProtonUpCut]; + tpcNsigmaCut[kPionLowCut] = nSigmas.value[kTPC][kPionLowCut]; + tpcNsigmaCut[kKaonLowCut] = nSigmas.value[kTPC][kKaonLowCut]; + tpcNsigmaCut[kProtonLowCut] = nSigmas.value[kTPC][kProtonLowCut]; + + tofNsigmaCut[kPionUpCut] = nSigmas.value[kTOF][kPionUpCut]; + tofNsigmaCut[kKaonUpCut] = nSigmas.value[kTOF][kKaonUpCut]; + tofNsigmaCut[kProtonUpCut] = nSigmas.value[kTOF][kProtonUpCut]; + tofNsigmaCut[kPionLowCut] = nSigmas.value[kTOF][kPionLowCut]; + tofNsigmaCut[kKaonLowCut] = nSigmas.value[kTOF][kKaonLowCut]; + tofNsigmaCut[kProtonLowCut] = nSigmas.value[kTOF][kProtonLowCut]; + + itsNsigmaCut[kPionUpCut] = nSigmas.value[kITS][kPionUpCut]; + itsNsigmaCut[kKaonUpCut] = nSigmas.value[kITS][kKaonUpCut]; + itsNsigmaCut[kProtonUpCut] = nSigmas.value[kITS][kProtonUpCut]; + itsNsigmaCut[kPionLowCut] = nSigmas.value[kITS][kPionLowCut]; + itsNsigmaCut[kKaonLowCut] = nSigmas.value[kITS][kKaonLowCut]; + itsNsigmaCut[kProtonLowCut] = nSigmas.value[kITS][kProtonLowCut]; // Loading phi weight histograms from CCDB if (cfgLoadPhiWeights) { @@ -1237,7 +1237,7 @@ struct V0ptHadPiKaProt { if (std::abs(mcCollision.posZ()) < cfgCutVertex) { histos.fill(HIST("MCGenerated/hMC"), 1.5); } - auto cent = 0; + auto cent = 0.f; int nchInel = 0; for (const auto& mcParticle : mcParticles) { diff --git a/PWGCF/GenericFramework/Tasks/flowGfwLightIons.cxx b/PWGCF/GenericFramework/Tasks/flowGfwLightIons.cxx index fe3af2d3855..2de2e02f819 100644 --- a/PWGCF/GenericFramework/Tasks/flowGfwLightIons.cxx +++ b/PWGCF/GenericFramework/Tasks/flowGfwLightIons.cxx @@ -186,11 +186,11 @@ struct FlowGfwLightIons { Configurable cfgCorrConfig{"cfgCorrConfig", {{"refP {2} refN {-2}", "refP {3} refN {-3}", "refP {4} refN {-4}", "refFull {2 -2}", "refFull {2 2 -2 -2}"}, {"ChGap22", "ChGap32", "ChGap42", "ChFull22", "ChFull24"}, {0, 0, 0, 0, 0}, {15, 1, 1, 0, 0}}, "Configurations for each correlation to calculate"}; // Connect to ccdb - Service ccdb; + Service ccdb{}; struct Config { TH1D* mEfficiency = nullptr; - GFWWeights* mAcceptance; + GFWWeights* mAcceptance{}; bool correctionsLoaded = false; } cfg; @@ -260,26 +260,25 @@ struct FlowGfwLightIons { std::vector corrconfigs; TRandom3* fRndm = new TRandom3(0); - TAxis* fSecondAxis; + TAxis* fSecondAxis{}; int lastRun = -1; std::vector::iterator firstRunOfCurrentFill; std::vector runNumbers; // Density dependent eff correction std::vector funcEff; - TH1D* hFindPtBin; - TF1* funcV2; - TF1* funcV3; - TF1* funcV4; + TH1D* hFindPtBin{}; + TF1* funcV2{}; + TF1* funcV3{}; + TF1* funcV4{}; struct DensityCorr { - double psi2Est; - double psi3Est; - double psi4Est; - double v2; - double v3; - double v4; - int density; - DensityCorr() : psi2Est(0.), psi3Est(0.), psi4Est(0.), v2(0.), v3(0.), v4(0.), density(0) {} + double psi2Est{0.}; + double psi3Est{0.}; + double psi4Est{0.}; + double v2{0.}; + double v3{0.}; + double v4{0.}; + int density{0}; }; // region indices for consistency flag @@ -353,9 +352,10 @@ struct FlowGfwLightIons { firstRunOfCurrentFill = o2::analysis::gfw::firstRunsOfFill.begin(); for (int i = 0; i < 4; ++i) { // o2-linter: disable=magic-number (maximum of 4 subevents) - if (cfgPtPtGaps->getData()[i][0] < -1. || cfgPtPtGaps->getData()[i][1] < -1.) + if (cfgPtPtGaps.value[i][0] < -1. || cfgPtPtGaps.value[i][1] < -1.) { continue; - o2::analysis::gfw::etagapsPtPt.push_back(std::make_pair(cfgPtPtGaps->getData()[i][0], cfgPtPtGaps->getData()[i][1])); + } + o2::analysis::gfw::etagapsPtPt.push_back(std::make_pair(cfgPtPtGaps.value[i][0], cfgPtPtGaps.value[i][1])); } for (const auto& [etamin, etamax] : o2::analysis::gfw::etagapsPtPt) { @@ -369,7 +369,7 @@ struct FlowGfwLightIons { std::string sCentralityEstimator = centNamesMap[cfgCentEstimator] + " centrality (%)"; AxisSpec centAxis = {o2::analysis::gfw::centbinning, sCentralityEstimator.c_str()}; std::vector nchbinning; - int nchskip = (o2::analysis::gfw::nchup - o2::analysis::gfw::nchlow) / o2::analysis::gfw::nchbins; + int nchskip = static_cast((o2::analysis::gfw::nchup - o2::analysis::gfw::nchlow) / o2::analysis::gfw::nchbins); for (int i = 0; i <= o2::analysis::gfw::nchbins; ++i) { nchbinning.push_back(nchskip * i + o2::analysis::gfw::nchlow + 0.5); } diff --git a/PWGCF/MultiparticleCorrelations/Tasks/threeParticleCorrelations.cxx b/PWGCF/MultiparticleCorrelations/Tasks/threeParticleCorrelations.cxx index 0decae5c8c5..585648965ac 100644 --- a/PWGCF/MultiparticleCorrelations/Tasks/threeParticleCorrelations.cxx +++ b/PWGCF/MultiparticleCorrelations/Tasks/threeParticleCorrelations.cxx @@ -1292,7 +1292,10 @@ struct ThreeParticleCorrelations { double dPhiStarMean = 0; // Start of the TPC radius loop - for (double r = rMin; r <= rMax; r += 0.01) { + const double step = 0.01; + const int nSteps = static_cast(std::round((rMax - rMin) / step)); + for (int i = 0; i <= nSteps; ++i) { + const double r = rMin + i * step; dPhiStar = RecoDecay::constrainAngle(dPhi + std::asin(phaseProton * r) - std::asin(phaseTrack * r), -constants::math::PIHalf); if (r == rMin) { // TPC inner radius diff --git a/PWGCF/TwoParticleCorrelations/Tasks/diHadronCor.cxx b/PWGCF/TwoParticleCorrelations/Tasks/diHadronCor.cxx index 300feda8977..42a35f0f879 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/diHadronCor.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/diHadronCor.cxx @@ -588,7 +588,10 @@ struct DiHadronCor { bool bIsBelow = false; if (std::abs(dPhiStarLow) < kLimit || std::abs(dPhiStarHigh) < kLimit || dPhiStarLow * dPhiStarHigh < 0) { - for (double rad(cfgRadiusLow); rad < cfgRadiusHigh; rad += 0.01) { + const double stepR = 0.01; + const int nSteps = static_cast(std::round((cfgRadiusHigh - cfgRadiusLow) / stepR)); + for (int i = 0; i < nSteps; ++i) { + const double rad = cfgRadiusLow + i * stepR; double dPhiStar = getDPhiStar(track1, track2, rad, magneticField); if (std::abs(dPhiStar) < kLimit) { bIsBelow = true; @@ -691,7 +694,10 @@ struct DiHadronCor { bool bIsBelow = false; if (std::abs(dPhiStarLow) < kLimit || std::abs(dPhiStarHigh) < kLimit || dPhiStarLow * dPhiStarHigh < 0) { - for (double rad(cfgRadiusLow); rad < cfgRadiusHigh; rad += 0.01) { + const double stepR = 0.01; + const int nSteps = static_cast(std::round((cfgRadiusHigh - cfgRadiusLow) / stepR)); + for (int i = 0; i < nSteps; ++i) { + const double rad = cfgRadiusLow + i * stepR; double dPhiStar = getDPhiStar(track1, track2, rad, magneticField); if (std::abs(dPhiStar) < kLimit) { bIsBelow = true; diff --git a/PWGCF/TwoParticleCorrelations/Tasks/etaDihadron.cxx b/PWGCF/TwoParticleCorrelations/Tasks/etaDihadron.cxx index 6554a778834..b7b6110c6b2 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/etaDihadron.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/etaDihadron.cxx @@ -572,7 +572,10 @@ struct EtaDihadron { bool bIsBelow = false; if (std::abs(dPhiStarLow) < kLimit || std::abs(dPhiStarHigh) < kLimit || dPhiStarLow * dPhiStarHigh < 0) { - for (double rad(cfgRadiusLow); rad < cfgRadiusHigh; rad += 0.01) { + const double stepR = 0.01; + const int nSteps = static_cast(std::round((cfgRadiusHigh - cfgRadiusLow) / stepR)); + for (int i = 0; i < nSteps; ++i) { + const double rad = cfgRadiusLow + i * stepR; double dPhiStar = getDPhiStar(track1, track2, rad, magneticField); if (std::abs(dPhiStar) < kLimit) { bIsBelow = true; @@ -675,7 +678,10 @@ struct EtaDihadron { bool bIsBelow = false; if (std::abs(dPhiStarLow) < kLimit || std::abs(dPhiStarHigh) < kLimit || dPhiStarLow * dPhiStarHigh < 0) { - for (double rad(cfgRadiusLow); rad < cfgRadiusHigh; rad += 0.01) { + const double stepR = 0.01; + const int nSteps = static_cast(std::round((cfgRadiusHigh - cfgRadiusLow) / stepR)); + for (int i = 0; i < nSteps; ++i) { + const double rad = cfgRadiusLow + i * stepR; double dPhiStar = getDPhiStar(track1, track2, rad, magneticField); if (std::abs(dPhiStar) < kLimit) { bIsBelow = true; diff --git a/PWGCF/TwoParticleCorrelations/Tasks/longRangeDihadronCor.cxx b/PWGCF/TwoParticleCorrelations/Tasks/longRangeDihadronCor.cxx index d5b28b63b60..d1416e9a09c 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/longRangeDihadronCor.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/longRangeDihadronCor.cxx @@ -363,26 +363,26 @@ struct LongRangeDihadronCor { LOGF(info, "Starting init"); // filling tpc nSigmas array - tpcNsigmaCut[kPionUp] = cfgPIDConfig.nSigmas->getData()[kTPC][kPionUp]; - tpcNsigmaCut[kKaonUp] = cfgPIDConfig.nSigmas->getData()[kTPC][kKaonUp]; - tpcNsigmaCut[kProtonUp] = cfgPIDConfig.nSigmas->getData()[kTPC][kProtonUp]; - tpcNsigmaCut[kPionLow] = cfgPIDConfig.nSigmas->getData()[kTPC][kPionLow]; - tpcNsigmaCut[kKaonLow] = cfgPIDConfig.nSigmas->getData()[kTPC][kKaonLow]; - tpcNsigmaCut[kProtonLow] = cfgPIDConfig.nSigmas->getData()[kTPC][kProtonLow]; + tpcNsigmaCut[kPionUp] = cfgPIDConfig.nSigmas.value[kTPC][kPionUp]; + tpcNsigmaCut[kKaonUp] = cfgPIDConfig.nSigmas.value[kTPC][kKaonUp]; + tpcNsigmaCut[kProtonUp] = cfgPIDConfig.nSigmas.value[kTPC][kProtonUp]; + tpcNsigmaCut[kPionLow] = cfgPIDConfig.nSigmas.value[kTPC][kPionLow]; + tpcNsigmaCut[kKaonLow] = cfgPIDConfig.nSigmas.value[kTPC][kKaonLow]; + tpcNsigmaCut[kProtonLow] = cfgPIDConfig.nSigmas.value[kTPC][kProtonLow]; // filling tof nSigmas array - tofNsigmaCut[kPionUp] = cfgPIDConfig.nSigmas->getData()[kTOF][kPionUp]; - tofNsigmaCut[kKaonUp] = cfgPIDConfig.nSigmas->getData()[kTOF][kKaonUp]; - tofNsigmaCut[kProtonUp] = cfgPIDConfig.nSigmas->getData()[kTOF][kProtonUp]; - tofNsigmaCut[kPionLow] = cfgPIDConfig.nSigmas->getData()[kTOF][kPionLow]; - tofNsigmaCut[kKaonLow] = cfgPIDConfig.nSigmas->getData()[kTOF][kKaonLow]; - tofNsigmaCut[kProtonLow] = cfgPIDConfig.nSigmas->getData()[kTOF][kProtonLow]; + tofNsigmaCut[kPionUp] = cfgPIDConfig.nSigmas.value[kTOF][kPionUp]; + tofNsigmaCut[kKaonUp] = cfgPIDConfig.nSigmas.value[kTOF][kKaonUp]; + tofNsigmaCut[kProtonUp] = cfgPIDConfig.nSigmas.value[kTOF][kProtonUp]; + tofNsigmaCut[kPionLow] = cfgPIDConfig.nSigmas.value[kTOF][kPionLow]; + tofNsigmaCut[kKaonLow] = cfgPIDConfig.nSigmas.value[kTOF][kKaonLow]; + tofNsigmaCut[kProtonLow] = cfgPIDConfig.nSigmas.value[kTOF][kProtonLow]; // filling its nSigmas array - itsNsigmaCut[kPionUp] = cfgPIDConfig.nSigmas->getData()[kITS][kPionUp]; - itsNsigmaCut[kKaonUp] = cfgPIDConfig.nSigmas->getData()[kITS][kKaonUp]; - itsNsigmaCut[kProtonUp] = cfgPIDConfig.nSigmas->getData()[kITS][kProtonUp]; - itsNsigmaCut[kPionLow] = cfgPIDConfig.nSigmas->getData()[kITS][kPionLow]; - itsNsigmaCut[kKaonLow] = cfgPIDConfig.nSigmas->getData()[kITS][kKaonLow]; - itsNsigmaCut[kProtonLow] = cfgPIDConfig.nSigmas->getData()[kITS][kProtonLow]; + itsNsigmaCut[kPionUp] = cfgPIDConfig.nSigmas.value[kITS][kPionUp]; + itsNsigmaCut[kKaonUp] = cfgPIDConfig.nSigmas.value[kITS][kKaonUp]; + itsNsigmaCut[kProtonUp] = cfgPIDConfig.nSigmas.value[kITS][kProtonUp]; + itsNsigmaCut[kPionLow] = cfgPIDConfig.nSigmas.value[kITS][kPionLow]; + itsNsigmaCut[kKaonLow] = cfgPIDConfig.nSigmas.value[kITS][kKaonLow]; + itsNsigmaCut[kProtonLow] = cfgPIDConfig.nSigmas.value[kITS][kProtonLow]; // Event Counter if ((doprocessSameTpcFt0a || doprocessSameTpcFt0c || doprocessSameFt0aFt0c || doprocessSemiMcSameTpcFt0c || doprocessSemiMcSameTpcFt0a) && cfgGeneral.cfgUseAdditionalEventCut) { @@ -895,7 +895,7 @@ struct LongRangeDihadronCor { getChannel(ft0, iCh, chanelid, ampl, corType, MixedEvent + 1); auto phi = getPhiFT0(chanelid, corType); auto eta = getEtaFT0(chanelid, corType); - for (float ihit = 0; ihit < ampl; ihit++) { + for (int ihit = 0; ihit < ampl; ihit++) { cfgCumulantConfig.fGFW->Fill(eta, 1, phi, 1., 1); } }