diff --git a/PWGCF/TwoParticleCorrelations/Tasks/lambdaSpinPolarization.cxx b/PWGCF/TwoParticleCorrelations/Tasks/lambdaSpinPolarization.cxx index a0d3ddcd6fd..8906ab8532b 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/lambdaSpinPolarization.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/lambdaSpinPolarization.cxx @@ -30,11 +30,9 @@ #include #include #include -#include #include #include #include -#include #include #include #include @@ -45,7 +43,6 @@ #include #include -#include #include #include #include @@ -1389,7 +1386,7 @@ struct LambdaSpinPolarization { uint64_t pairOrderSeed = 0; std::array, 4> kinWeightMaps{}; - std::vector legAxesRef{}; + std::vector legAxesRef; bool kinWeightsLoaded = false; struct SharedDauCand { @@ -1450,8 +1447,8 @@ struct LambdaSpinPolarization { { for (auto const& cand : event) { const int64_t seq = seqBase + static_cast(slots.size()); - slots.push_back(Slot{cand, NoSeq}); - auto [it, isNew] = cells[cand.species()].try_emplace(cellKey(cand), Cell{seq, seq}); + slots.push_back(Slot{.cand = cand, .next = NoSeq}); + auto [it, isNew] = cells[cand.species()].try_emplace(cellKey(cand), Cell{.head = seq, .tail = seq}); if (!isNew) { slot(it->second.tail).next = seq; it->second.tail = seq; @@ -1554,16 +1551,16 @@ struct LambdaSpinPolarization { Grid grid{}; int maxEvents = 0; - std::deque slots{}; - std::deque nPerEvent{}; + std::deque slots; + std::deque nPerEvent; int64_t seqBase = 0; std::array, 2> cells{}; }; - std::vector mePools{}; - std::vector mePoolsGen{}; - TAxis mePoolAxisCent{}; - TAxis mePoolAxisVz{}; + std::vector mePools; + std::vector mePoolsGen; + TAxis mePoolAxisCent; + TAxis mePoolAxisVz; void init(InitContext const&) { @@ -1589,7 +1586,8 @@ struct LambdaSpinPolarization { legAxesRef.emplace_back(static_cast(edges.size()) - 1, edges.data()); } - if (!(cMassHistMin.value < cMassAccMin.value && cMassAccMax.value < cMassHistMax.value)) { + const bool massAxesContainWindow = cMassHistMin.value < cMassAccMin.value && cMassAccMax.value < cMassHistMax.value; + if (!massAxesContainWindow) { LOGF(fatal, "The mass axes [%.4f, %.4f] must be wider than the accepted mass window [%.4f, %.4f]", cMassHistMin.value, cMassHistMax.value, cMassAccMin.value, cMassAccMax.value); } for (auto const& edge : {cMassAccMin.value, cMassAccMax.value}) { @@ -1610,18 +1608,18 @@ struct LambdaSpinPolarization { mePoolAxisCent.Set(static_cast(centEdges.size()) - 1, centEdges.data()); mePoolAxisVz.Set(static_cast(vzEdges.size()) - 1, vzEdges.data()); - static constexpr std::array PoolSizeSteps = {1., 2., 5.}; - static constexpr double PoolSizeDecade = 10.; - const double depth = std::max(1, cMEPoolDepth.value); + static constexpr std::array PoolSizeSteps = {1, 2, 5}; + static constexpr int64_t PoolSizeDecade = 10; + const int64_t depth = std::max(1, cMEPoolDepth.value); std::vector poolSizeEdges = {0.}; - for (double decade = 1.; decade < depth; decade *= PoolSizeDecade) { + for (int64_t decade = 1; decade < depth; decade *= PoolSizeDecade) { for (auto const& step : PoolSizeSteps) { if (step * decade < depth) { - poolSizeEdges.push_back(step * decade); + poolSizeEdges.push_back(static_cast(step * decade)); } } } - poolSizeEdges.push_back(depth); + poolSizeEdges.push_back(static_cast(depth)); const AxisSpec axisPoolSize(poolSizeEdges, "events in the pool"); std::vector mixQaDirs; @@ -1658,7 +1656,7 @@ struct LambdaSpinPolarization { grid.nRap = std::max(1, static_cast(std::ceil((cMaxRap.value - cMinRap.value) / grid.cellRap))); grid.nPhi = std::max(1, static_cast(std::floor(TwoPI / cMaxDeltaPhi.value))); grid.cellPhi = TwoPI / static_cast(grid.nPhi); - const auto nPools = static_cast(mePoolAxisCent.GetNbins() * mePoolAxisVz.GetNbins()); + const auto nPools = static_cast(mePoolAxisCent.GetNbins()) * static_cast(mePoolAxisVz.GetNbins()); if (doprocessDataRecoMixed) { mePools.assign(nPools, RollingPool(grid, cMEPoolDepth.value)); } @@ -1968,7 +1966,7 @@ struct LambdaSpinPolarization { return; } auto const* guard = dynamic_cast(list->FindObject("kinWeightGuardStatus")); - if (guard && !TString(guard->GetTitle()).BeginsWith("OK")) { + if (guard != nullptr && !TString(guard->GetTitle()).BeginsWith("OK")) { LOGF(fatal, "Kinematic weights at %s are flagged by their builder: %s", cKinWeightCcdbPath.value.c_str(), guard->GetTitle()); return; } @@ -1979,7 +1977,7 @@ struct LambdaSpinPolarization { LOGF(fatal, "Kinematic weights: %s is missing, or its axes differ from KinW/*/hLeg2_%s (pT, y, phi) of this configuration", name.c_str(), std::string(PairTag[i]).c_str()); return; } - kinWeightMaps[i].reset(static_cast(map->Clone())); + kinWeightMaps[i].reset(dynamic_cast(map->Clone())); } auto const* form = dynamic_cast(list->FindObject("kinWeightForm")); kinWeightsLoaded = true;