From 1d03538f03d0957d21926aebdd1d4ad3ab0da777 Mon Sep 17 00:00:00 2001 From: Gyula Bencedi Date: Thu, 7 Aug 2025 21:58:36 +0200 Subject: [PATCH] Fix minor linter issues --- PWGMM/Mult/Tasks/dndetaMFTPbPb.cxx | 120 +++++++++++------------------ 1 file changed, 46 insertions(+), 74 deletions(-) diff --git a/PWGMM/Mult/Tasks/dndetaMFTPbPb.cxx b/PWGMM/Mult/Tasks/dndetaMFTPbPb.cxx index ed386e6a6fd..7a8c4cfb23e 100644 --- a/PWGMM/Mult/Tasks/dndetaMFTPbPb.cxx +++ b/PWGMM/Mult/Tasks/dndetaMFTPbPb.cxx @@ -57,6 +57,8 @@ using namespace o2::constants::physics; using namespace o2::constants::math; using namespace pwgmm::mult; +auto static constexpr kMinCharge = 3.f; + AxisSpec ptAxis = {1001, -0.005, 10.005}; AxisSpec multAxis = {701, -0.5, 700.5, "N_{trk}"}; AxisSpec zAxis = {60, -30., 30.}; @@ -102,79 +104,49 @@ struct DndetaMFTPbPb { struct : ConfigurableGroup { Configurable usephiCut{"usephiCut", false, "use azimuthal angle cut"}; - Configurable phiCut{"phiCut", 0.1f, - "Cut on azimuthal angle of MFT tracks"}; + Configurable phiCut{"phiCut", 0.1f, "Cut on azimuthal angle of MFT tracks"}; Configurable minPhi{"minPhi", 0.f, ""}; Configurable maxPhi{"maxPhi", 6.2832, ""}; Configurable minEta{"minEta", -3.6f, ""}; Configurable maxEta{"maxEta", -2.5f, ""}; - Configurable minNclusterMft{"minNclusterMft", 5, - "minimum number of MFT clusters"}; + Configurable minNclusterMft{"minNclusterMft", 5, "minimum number of MFT clusters"}; Configurable useChi2Cut{"useChi2Cut", false, "use track chi2 cut"}; Configurable maxChi2NCl{"maxChi2NCl", 1000.f, "maximum chi2 per MFT clusters"}; Configurable usePtCut{"usePtCut", false, "use track pT cut"}; Configurable minPt{"minPt", 0., "minimum pT of the MFT tracks"}; - Configurable requireCA{ - "requireCA", false, "Use Cellular Automaton track-finding algorithm"}; + Configurable requireCA{"requireCA", false, "Use Cellular Automaton track-finding algorithm"}; Configurable maxDCAxy{"maxDCAxy", 2.0f, "Cut on dcaXY"}; } trackCuts; struct : ConfigurableGroup { Configurable maxZvtx{"maxZvtx", 10.0f, "maximum cut on z-vtx (cm)"}; Configurable minZvtx{"minZvtx", -10.0f, "minimum cut on z-vtx (cm)"}; - Configurable useZDiffCut{"useZDiffCut", false, - "use Zvtx reco-mc diff. cut"}; - Configurable maxZvtxDiff{ - "maxZvtxDiff", 1.0f, - "max allowed Z vtx difference for reconstruced collisions (cm)"}; + Configurable useZDiffCut{"useZDiffCut", false, "use Zvtx reco-mc diff. cut"}; + Configurable maxZvtxDiff{"maxZvtxDiff", 1.0f, "max allowed Z vtx difference for reconstruced collisions (cm)"}; Configurable requireIsGoodZvtxFT0VsPV{"requireIsGoodZvtxFT0VsPV", true, "require events with PV position along z consistent (within 1 cm) between PV reconstructed using tracks and PV using FT0 A-C time difference"}; Configurable requireRejectSameBunchPileup{"requireRejectSameBunchPileup", true, "reject collisions in case of pileup with another collision in the same foundBC"}; Configurable requireNoCollInTimeRangeStrict{"requireNoCollInTimeRangeStrict", false, " requireNoCollInTimeRangeStrict"}; Configurable requireNoCollInRofStrict{"requireNoCollInRofStrict", false, "requireNoCollInRofStrict"}; Configurable requireNoCollInRofStandard{"requireNoCollInRofStandard", false, "requireNoCollInRofStandard"}; Configurable requireNoHighMultCollInPrevRof{"requireNoHighMultCollInPrevRof", false, "requireNoHighMultCollInPrevRof"}; - Configurable requireNoCollInTimeRangeStd{ - "requireNoCollInTimeRangeStd", true, - "reject collisions corrupted by the cannibalism, with other collisions " - "within +/- 10 microseconds"}; - Configurable requireNoCollInTimeRangeNarrow{ - "requireNoCollInTimeRangeNarrow", false, - "reject collisions corrupted by the cannibalism, with other collisions " - "within +/- 10 microseconds"}; - Configurable occupancyEstimator{ - "occupancyEstimator", 1, - "Occupancy estimator: 1 = trackOccupancyInTimeRange, 2 = " - "ft0cOccupancyInTimeRange"}; - Configurable minOccupancy{ - "minOccupancy", -1, "minimum occupancy from neighbouring collisions"}; - Configurable maxOccupancy{ - "maxOccupancy", -1, "maximum occupancy from neighbouring collisions"}; + Configurable requireNoCollInTimeRangeStd{"requireNoCollInTimeRangeStd", true, "reject collisions corrupted by the cannibalism, with other collisions within +/- 10 microseconds"}; + Configurable requireNoCollInTimeRangeNarrow{"requireNoCollInTimeRangeNarrow", false, "reject collisions corrupted by the cannibalism, with other collisions within +/- 10 microseconds"}; + Configurable occupancyEstimator{"occupancyEstimator", 1, "Occupancy estimator: 1 = trackOccupancyInTimeRange, 2 = ft0cOccupancyInTimeRange"}; + Configurable minOccupancy{"minOccupancy", -1, "minimum occupancy from neighbouring collisions"}; + Configurable maxOccupancy{"maxOccupancy", -1, "maximum occupancy from neighbouring collisions"}; Configurable minIR{"minIR", -1, "minimum IR (kHz) collisions"}; Configurable maxIR{"maxIR", -1, "maximum IR (kHz) collisions"}; } eventCuts; - ConfigurableAxis occupancyBins{"occupancyBins", - {VARIABLE_WIDTH, 0.0f, 250.0f, 500.0f, 750.0f, - 1000.0f, 1500.0f, 2000.0f, 3000.0f, 4500.0f, - 6000.0f, 8000.0f, 10000.0f, 50000.0f}, - "Occupancy"}; - ConfigurableAxis centralityBins{ - "centralityBins", - {VARIABLE_WIDTH, 0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100}, - "Centrality"}; + ConfigurableAxis occupancyBins{"occupancyBins", {VARIABLE_WIDTH, 0.0f, 250.0f, 500.0f, 750.0f, 1000.0f, 1500.0f, 2000.0f, 3000.0f, 4500.0f, 6000.0f, 8000.0f, 10000.0f, 50000.0f}, "Occupancy"}; + ConfigurableAxis centralityBins{"centralityBins", {VARIABLE_WIDTH, 0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100}, "Centrality"}; ConfigurableAxis irBins{"irBins", {500, 0, 50}, "Interaction rate (kHz)"}; Service pdg; 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", "http://alice-ccdb.cern.ch", - "url of the ccdb repository"}; + 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", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; int mRunNumber{-1}; uint64_t mSOR{0}; @@ -1061,7 +1033,7 @@ struct DndetaMFTPbPb { if (p != nullptr) { charge = p->Charge(); } - return std::abs(charge) >= 3.; + return std::abs(charge) >= kMinCharge; } template @@ -1371,27 +1343,27 @@ struct DndetaMFTPbPb { bool gtZeroColl = false; int gtOneColl = 0; - float cgen = -1; + float cGen = -1; if constexpr (has_reco_cent) { - float crec_min = 105.f; + float crecMin = 105.f; for (const auto& collision : collisions) { if (isGoodEvent(collision)) { float c = getRecoCent(collision); - if (c < crec_min) { - crec_min = c; + if (c < crecMin) { + crecMin = c; } } } - if (cgen < 0) - cgen = crec_min; + if (cGen < 0) + cGen = crecMin; } - float occgen = -1.; + float occGen = -1.; for (const auto& collision : collisions) { if (isGoodEvent(collision)) { float o = getOccupancy(collision, eventCuts.occupancyEstimator); - if (o > occgen) { - occgen = o; + if (o > occGen) { + occGen = o; } } } @@ -1449,9 +1421,9 @@ struct DndetaMFTPbPb { } if constexpr (has_reco_cent) { - registry.fill(HIST("Events/Centrality/EvtEffGen"), 3., cgen, occgen); + registry.fill(HIST("Events/Centrality/EvtEffGen"), 3., cGen, occGen); } else { - registry.fill(HIST("Events/EvtEffGen"), 3., occgen); + registry.fill(HIST("Events/EvtEffGen"), 3., occGen); } auto perCollMCsample = mcSample->sliceByCached( @@ -1461,7 +1433,7 @@ struct DndetaMFTPbPb { if (gtOneColl > 1) { if constexpr (has_reco_cent) { - qaregistry.fill(HIST("Events/Centrality/SplitMult"), nchrg, zvtxMC, cgen); + qaregistry.fill(HIST("Events/Centrality/SplitMult"), nchrg, zvtxMC, cGen); } else { qaregistry.fill(HIST("Events/SplitMult"), nchrg, zvtxMC); } @@ -1470,17 +1442,17 @@ struct DndetaMFTPbPb { auto nCharged = countPart(particles); if constexpr (has_reco_cent) { registry.fill(HIST("Events/Centrality/NtrkZvtxGen_t"), nCharged, zvtxMC, - cgen); + cGen); } else { registry.fill(HIST("Events/NtrkZvtxGen_t"), nCharged, zvtxMC); } - fillHistMC>(particles, cgen, occgen, zvtxMC, gtZeroColl); + fillHistMC>(particles, cGen, occGen, zvtxMC, gtZeroColl); if (collisions.size() == 0) { if constexpr (has_reco_cent) { qaregistry.fill(HIST("Events/Centrality/NotFoundEventZvtx"), - mcCollision.posZ(), cgen); + mcCollision.posZ(), cGen); } else { qaregistry.fill(HIST("Events/NotFoundEventZvtx"), mcCollision.posZ()); } @@ -1574,27 +1546,27 @@ struct DndetaMFTPbPb { FiltBestTracks const& besttracks) { bool gtZeroColl = false; - float cgen = -1; + float cGen = -1; if constexpr (has_reco_cent) { - float crec_min = 105.f; + float crecMin = 105.f; for (const auto& collision : collisions) { if (isGoodEvent(collision)) { float c = getRecoCent(collision); - if (c < crec_min) { - crec_min = c; + if (c < crecMin) { + crecMin = c; } } } - if (cgen < 0) - cgen = crec_min; + if (cGen < 0) + cGen = crecMin; } - float occgen = -1.; + float occGen = -1.; for (const auto& collision : collisions) { if (isGoodEvent(collision)) { float o = getOccupancy(collision, eventCuts.occupancyEstimator); - if (o > occgen) { - occgen = o; + if (o > occGen) { + occGen = o; } } } @@ -1637,26 +1609,26 @@ struct DndetaMFTPbPb { } if constexpr (has_reco_cent) { - registry.fill(HIST("Events/Centrality/EvtEffGen"), 3., cgen, occgen); + registry.fill(HIST("Events/Centrality/EvtEffGen"), 3., cGen, occGen); } else { - registry.fill(HIST("Events/EvtEffGen"), 3., occgen); + registry.fill(HIST("Events/EvtEffGen"), 3., occGen); } auto zvtxMC = mcCollision.posZ(); auto nCharged = countPart(particles); if constexpr (has_reco_cent) { registry.fill(HIST("Events/Centrality/NtrkZvtxGen_t"), nCharged, zvtxMC, - cgen); + cGen); } else { registry.fill(HIST("Events/NtrkZvtxGen_t"), nCharged, zvtxMC); } - fillHistMC>(particles, cgen, occgen, zvtxMC, gtZeroColl); + fillHistMC>(particles, cGen, occGen, zvtxMC, gtZeroColl); if (collisions.size() == 0) { if constexpr (has_reco_cent) { qaregistry.fill(HIST("Events/Centrality/NotFoundEventZvtx"), - mcCollision.posZ(), cgen); + mcCollision.posZ(), cGen); } else { qaregistry.fill(HIST("Events/NotFoundEventZvtx"), mcCollision.posZ()); }