From ea6a5c61b497bbf1a68cd94ab5dddba77819f7a2 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Wed, 11 Dec 2024 08:37:19 +0000 Subject: [PATCH] Please consider the following formatting changes --- PWGMM/Mult/Tasks/dndeta-mft-pbpb.cxx | 451 ++++++++++++++------------- 1 file changed, 242 insertions(+), 209 deletions(-) diff --git a/PWGMM/Mult/Tasks/dndeta-mft-pbpb.cxx b/PWGMM/Mult/Tasks/dndeta-mft-pbpb.cxx index 51239d43989..6b3c36c7b75 100644 --- a/PWGMM/Mult/Tasks/dndeta-mft-pbpb.cxx +++ b/PWGMM/Mult/Tasks/dndeta-mft-pbpb.cxx @@ -64,9 +64,15 @@ struct PseudorapidityDensityMFT { // Histogram registry HistogramRegistry registry{ - "registry", {}, OutputObjHandlingPolicy::AnalysisObject}; + "registry", + {}, + OutputObjHandlingPolicy::AnalysisObject}; HistogramRegistry QAregistry{ - "QAregistry", {}, OutputObjHandlingPolicy::AnalysisObject, false, true}; + "QAregistry", + {}, + OutputObjHandlingPolicy::AnalysisObject, + false, + true}; // analysis specific conf. Configurable usePhiCut{"usePhiCut", false, "use azimuthal angle cut"}; @@ -82,8 +88,8 @@ struct PseudorapidityDensityMFT { Configurable cfg_min_pt{"cfg_min_pt", 0., "minimum pT of the MFT tracks"}; Configurable cfg_require_ca{ - "cfg_require_ca", false, - "Use Cellular Automaton track-finding algorithm"}; + "cfg_require_ca", false, + "Use Cellular Automaton track-finding algorithm"}; Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 2.0f, "Cut on dcaXY"}; } trkcuts; @@ -94,57 +100,62 @@ struct PseudorapidityDensityMFT { Configurable useZDiffCut{"useZvtxDiffCut", false, "use Zvtx reco-mc diff. cut"}; Configurable maxZvtxDiff{ - "maxZvtxDiff", 1.0f, - "max allowed Z vtx difference for reconstruced collisions (cm)"}; + "maxZvtxDiff", 1.0f, + "max allowed Z vtx difference for reconstruced collisions (cm)"}; Configurable requireNoCollInTimeRangeStd{ - "requireNoCollInTimeRangeStd", false, - "reject collisions corrupted by the cannibalism, with other collisions " - "within +/- 10 microseconds"}; + "requireNoCollInTimeRangeStd", false, + "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"}; + "requireNoCollInTimeRangeNarrow", false, + "reject collisions corrupted by the cannibalism, with other collisions " + "within +/- 10 microseconds"}; 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"}; Configurable minOccupancy{ - "minOccupancy", -1, "minimum occupancy from neighbouring collisions"}; + "minOccupancy", -1, "minimum occupancy from neighbouring collisions"}; Configurable maxOccupancy{ - "maxOccupancy", -1, "maximum occupancy from neighbouring collisions"}; + "maxOccupancy", -1, "maximum occupancy from neighbouring collisions"}; ConfigurableAxis CentBins{ - "CentBins", - {VARIABLE_WIDTH, 0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100}, - ""}; + "CentBins", + {VARIABLE_WIDTH, 0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100}, + ""}; Service pdg; /// @brief init function, definition of histograms - void init(InitContext &) { + void init(InitContext&) + { if (static_cast(doprocessDataInclusive) + - static_cast(doprocessDatawBestTracksInclusive) > + static_cast(doprocessDatawBestTracksInclusive) > 1) { - LOGP(fatal, "Either processDataInclusive OR " - "processDatawBestTracksInclusive should be enabled!"); + LOGP(fatal, + "Either processDataInclusive OR " + "processDatawBestTracksInclusive should be enabled!"); } if (static_cast(doprocessDataCent) + - static_cast(doprocessDatawBestTracksCent) > + static_cast(doprocessDatawBestTracksCent) > 1) { - LOGP(fatal, "Either processDataCent OR processDatawBestTracksCent should " - "be enabled!"); + LOGP(fatal, + "Either processDataCent OR processDatawBestTracksCent should " + "be enabled!"); } if (static_cast(doprocessMCInclusive) + - static_cast(doprocessMCwBestTracksInclusive) > + static_cast(doprocessMCwBestTracksInclusive) > 1) { - LOGP(fatal, "Either processMCInclusive OR processMCwBestTracksInclusive " - "should be enabled!"); + LOGP(fatal, + "Either processMCInclusive OR processMCwBestTracksInclusive " + "should be enabled!"); } if (static_cast(doprocessMCCent) + - static_cast(doprocessMCwBestTracksCent) > + static_cast(doprocessMCwBestTracksCent) > 1) { - LOGP(fatal, "Either processMCCent OR processMCwBestTracksCent should be " - "enabled!"); + LOGP(fatal, + "Either processMCCent OR processMCwBestTracksCent should be " + "enabled!"); } auto hev = registry.add("hEvtSel", "hEvtSel", HistType::kTH1F, @@ -173,7 +184,7 @@ struct PseudorapidityDensityMFT { ";status;events", {HistType::kTH1F, {{2, 0.5, 2.5}}}}); auto hstat = registry.get(HIST("Events/Selection")); - auto *x = hstat->GetXaxis(); + auto* x = hstat->GetXaxis(); x->SetBinLabel(1, "All"); x->SetBinLabel(2, "Selected"); @@ -190,7 +201,7 @@ struct PseudorapidityDensityMFT { "; #chi^{2}; #it{#eta};", {HistType::kTH2F, {{600, 0, 20}, {100, -8, 8}}}}); QAregistry.add( - {"Tracks/Chi2", "; #chi^{2};", {HistType::kTH1F, {{600, 0, 20}}}}); + {"Tracks/Chi2", "; #chi^{2};", {HistType::kTH1F, {{600, 0, 20}}}}); QAregistry.add({"Tracks/NclustersEta", "; nClusters; #eta;", {HistType::kTH2F, {{7, 4, 10}, {100, -8, 8}}}}); @@ -233,7 +244,7 @@ struct PseudorapidityDensityMFT { ";status;centrality;events", {HistType::kTH2F, {{2, 0.5, 2.5}, CentAxis}}}); auto hstat = registry.get(HIST("Events/Centrality/Selection")); - auto *x = hstat->GetXaxis(); + auto* x = hstat->GetXaxis(); x->SetBinLabel(1, "All"); x->SetBinLabel(2, "Selected"); @@ -251,9 +262,9 @@ struct PseudorapidityDensityMFT { {HistType::kTH1F, {CentAxis}}, true}); QAregistry.add( - {"Tracks/Centrality/Chi2Eta", - "; #chi^{2}; #it{#eta}; centrality", - {HistType::kTH3F, {{600, 0, 20}, {100, -8, 8}, CentAxis}}}); + {"Tracks/Centrality/Chi2Eta", + "; #chi^{2}; #it{#eta}; centrality", + {HistType::kTH3F, {{600, 0, 20}, {100, -8, 8}, CentAxis}}}); QAregistry.add({"Tracks/Centrality/Chi2", "; #chi^{2}; centrality", {HistType::kTH2F, {{600, 0, 20}, CentAxis}}}); @@ -278,9 +289,9 @@ struct PseudorapidityDensityMFT { "; #varphi; #eta; centrality", {HistType::kTH3F, {PhiAxis, EtaAxis, CentAxis}}}); QAregistry.add( - {"Tracks/Centrality/NclustersEtaBest", - "; nClusters; #eta; centrality", - {HistType::kTH3F, {{7, 4, 10}, {100, -8, 8}, CentAxis}}}); + {"Tracks/Centrality/NclustersEtaBest", + "; nClusters; #eta; centrality", + {HistType::kTH3F, {{7, 4, 10}, {100, -8, 8}, CentAxis}}}); QAregistry.add({"Tracks/Centrality/TrackAmbDegree", " ; N_{coll}^{comp}", {HistType::kTH2F, {{51, -0.5, 50.5}, CentAxis}}}); @@ -311,7 +322,7 @@ struct PseudorapidityDensityMFT { ";status;events", {HistType::kTH1F, {{3, 0.5, 3.5}}}}); auto heff = registry.get(HIST("Events/EvtEffGen")); - auto *x = heff->GetXaxis(); + auto* x = heff->GetXaxis(); x->SetBinLabel(1, "All reconstructed"); x->SetBinLabel(2, "Selected reconstructed"); x->SetBinLabel(3, "All generated"); @@ -341,7 +352,7 @@ struct PseudorapidityDensityMFT { " ; Z_{rec} - Z_{gen} (cm)", {HistType::kTH1F, {DeltaZAxis}}}); QAregistry.add( - {"Events/SplitMult", " ; N_{gen}", {HistType::kTH1F, {MultAxis}}}); + {"Events/SplitMult", " ; N_{gen}", {HistType::kTH1F, {MultAxis}}}); } if (doprocessMCCent || doprocessMCwBestTracksCent) { @@ -349,7 +360,7 @@ struct PseudorapidityDensityMFT { ";status;events", {HistType::kTH2F, {{3, 0.5, 3.5}, CentAxis}}}); auto heff = registry.get(HIST("Events/Centrality/EvtEffGen")); - auto *x = heff->GetXaxis(); + auto* x = heff->GetXaxis(); x->SetBinLabel(1, "All reconstructed"); x->SetBinLabel(2, "Selected reconstructed"); x->SetBinLabel(3, "All generated"); @@ -391,24 +402,24 @@ struct PseudorapidityDensityMFT { if (doprocessTrkEffIdxInlusive) { QAregistry.add( - {"Tracks/hPtPhiEtaZvtxEffGen", - "hPtPhiEtaZvtxEffGen", - {HistType::kTHnSparseF, {PtAxis, PhiAxis, EtaAxis, ZAxis}}}); + {"Tracks/hPtPhiEtaZvtxEffGen", + "hPtPhiEtaZvtxEffGen", + {HistType::kTHnSparseF, {PtAxis, PhiAxis, EtaAxis, ZAxis}}}); QAregistry.add( - {"Tracks/hPtPhiEtaZvtxEffRec", - "hPtPhiEtaZvtxEffRec", - {HistType::kTHnSparseF, {PtAxis, PhiAxis, EtaAxis, ZAxis}}}); + {"Tracks/hPtPhiEtaZvtxEffRec", + "hPtPhiEtaZvtxEffRec", + {HistType::kTHnSparseF, {PtAxis, PhiAxis, EtaAxis, ZAxis}}}); QAregistry.add({"Tracks/hPhiEtaDuplicates", " ; p_{T} (GeV/c);", {HistType::kTH2F, {PhiAxis, EtaAxis}}}); QAregistry.add( - {"Tracks/hPtPhiEtaZvtxEffDuplicates", - "hPtPhiEtaZvtxEffDuplicates", - {HistType::kTHnSparseF, {PtAxis, PhiAxis, EtaAxis, ZAxis}}}); + {"Tracks/hPtPhiEtaZvtxEffDuplicates", + "hPtPhiEtaZvtxEffDuplicates", + {HistType::kTHnSparseF, {PtAxis, PhiAxis, EtaAxis, ZAxis}}}); QAregistry.add( - {"Tracks/hPtPhiEtaZvtxEffGenDuplicates", - "hPtPhiEtaZvtxEffGenDuplicates", - {HistType::kTHnSparseF, {PtAxis, PhiAxis, EtaAxis, ZAxis}}}); + {"Tracks/hPtPhiEtaZvtxEffGenDuplicates", + "hPtPhiEtaZvtxEffGenDuplicates", + {HistType::kTHnSparseF, {PtAxis, PhiAxis, EtaAxis, ZAxis}}}); QAregistry.add({"Tracks/NmftTrkPerPart", "; #it{N}_{mft tracks per particle};", {HistType::kTH1F, {{200, -0.5, 200.}}}}); @@ -441,13 +452,13 @@ struct PseudorapidityDensityMFT { if (doprocessTrkEffBestInclusive) { QAregistry.add( - {"Tracks/hPtPhiEtaZvtxEffBestGen", - "hPtPhiEtaZvtxEffGen", - {HistType::kTHnSparseF, {PtAxis, PhiAxis, EtaAxis, ZAxis}}}); + {"Tracks/hPtPhiEtaZvtxEffBestGen", + "hPtPhiEtaZvtxEffGen", + {HistType::kTHnSparseF, {PtAxis, PhiAxis, EtaAxis, ZAxis}}}); QAregistry.add( - {"Tracks/hPtPhiEtaZvtxEffBestRec", - "hPtPhiEtaZvtxEffRec", - {HistType::kTHnSparseF, {PtAxis, PhiAxis, EtaAxis, ZAxis}}}); + {"Tracks/hPtPhiEtaZvtxEffBestRec", + "hPtPhiEtaZvtxEffRec", + {HistType::kTHnSparseF, {PtAxis, PhiAxis, EtaAxis, ZAxis}}}); QAregistry.add({"Tracks/hPtEffBestFakeRec", " ; p_{T} (GeV/c);", {HistType::kTH1F, {PtAxis}}}); @@ -481,16 +492,16 @@ struct PseudorapidityDensityMFT { if (doprocessMcQACent) { QAregistry.add( - {"Events/Centrality/hRecPerGenColls", - "; #it{N}_{reco collisions} / #it{N}_{gen collisions}; centrality", - {HistType::kTH2F, {{200, 0., 2.}, CentAxis}}}); + {"Events/Centrality/hRecPerGenColls", + "; #it{N}_{reco collisions} / #it{N}_{gen collisions}; centrality", + {HistType::kTH2F, {{200, 0., 2.}, CentAxis}}}); QAregistry.add({"Tracks/Centrality/hNmftTrks", "; #it{N}_{mft tracks}; centrality", {HistType::kTH2F, {{200, -0.5, 200.}, CentAxis}}}); QAregistry.add( - {"Tracks/Centrality/hFracAmbiguousMftTrks", - "; #it{N}_{ambiguous tracks} / #it{N}_{tracks}; centrality", - {HistType::kTH2F, {{100, 0., 1.}, CentAxis}}}); + {"Tracks/Centrality/hFracAmbiguousMftTrks", + "; #it{N}_{ambiguous tracks} / #it{N}_{tracks}; centrality", + {HistType::kTH2F, {{100, 0., 1.}, CentAxis}}}); } } @@ -499,7 +510,7 @@ struct PseudorapidityDensityMFT { (aod::fwdtrack::eta > trkcuts.cfg_eta_min); Filter filtATrackID = (aod::fwdtrack::bestCollisionId >= 0); Filter filtATrackDCA = - (nabs(aod::fwdtrack::bestDCAXY) < trkcuts.cfg_max_dcaxy); + (nabs(aod::fwdtrack::bestDCAXY) < trkcuts.cfg_max_dcaxy); /// Filters - mc particles Filter primaries = (aod::mcparticle::flags & @@ -509,7 +520,7 @@ struct PseudorapidityDensityMFT { /// Joined tables using FullBCs = soa::Join; using CollBCs = - soa::Join; + soa::Join; using Colls = soa::Join; using Coll = Colls::iterator; using CollsCent = soa::Join; @@ -525,7 +536,9 @@ struct PseudorapidityDensityMFT { using filtBestTracks = soa::Filtered; using filtParticles = soa::Filtered; - template bool isTrackSelected(const T &track) { + template + bool isTrackSelected(const T& track) + { if (track.eta() < trkcuts.cfg_eta_min || track.eta() > trkcuts.cfg_eta_max) return false; if (trkcuts.cfg_require_ca && !track.isCA()) @@ -551,10 +564,11 @@ struct PseudorapidityDensityMFT { } template - int countTracks(T const &tracks, float z, float c, float occ) { + int countTracks(T const& tracks, float z, float c, float occ) + { auto nTrk = 0; if (tracks.size() > 0) { - for (auto &track : tracks) { + for (auto& track : tracks) { if (fillHis) { if constexpr (C::template contains()) { QAregistry.fill(HIST("Tracks/Centrality/Chi2Eta"), track.chi2(), @@ -596,11 +610,12 @@ struct PseudorapidityDensityMFT { } template - int countBestTracks(T const & /*tracks*/, B const &besttracks, float z, - float c, float occ) { + int countBestTracks(T const& /*tracks*/, B const& besttracks, float z, + float c, float occ) + { auto nATrk = 0; if (besttracks.size() > 0) { - for (auto &atrack : besttracks) { + for (auto& atrack : besttracks) { auto itrack = atrack.template mfttrack_as(); if (!isTrackSelected(itrack)) { continue; @@ -653,9 +668,11 @@ struct PseudorapidityDensityMFT { return nATrk; } - template int countPart(P const &particles) { + template + int countPart(P const& particles) + { auto nCharged = 0; - for (auto &particle : particles) { + for (auto& particle : particles) { if (!isChrgParticle(particle.pdgCode())) { continue; } @@ -665,7 +682,8 @@ struct PseudorapidityDensityMFT { } template - bool isGoodEvent(C const &collision) { + bool isGoodEvent(C const& collision) + { if constexpr (fillHis) { registry.fill(HIST("hEvtSel"), 0); } @@ -726,7 +744,8 @@ struct PseudorapidityDensityMFT { /// @brief Selection of charged particles /// @return true: charged; false: not charged - bool isChrgParticle(int code) { + bool isChrgParticle(int code) + { auto p = pdg->GetParticle(code); auto charge = 0.; if (p != nullptr) { @@ -736,9 +755,10 @@ struct PseudorapidityDensityMFT { } template - void fillHist_MC(P const &particles, float cent, float zvtx, - bool const atLeastOne) { - for (auto &particle : particles) { + void fillHist_MC(P const& particles, float cent, float zvtx, + bool const atLeastOne) + { + for (auto& particle : particles) { if (!isChrgParticle(particle.pdgCode())) { continue; } @@ -778,14 +798,15 @@ struct PseudorapidityDensityMFT { } /// @brief process fnc. for general event statistics - void processTagging(FullBCs const &bcs, CollsCent const &collisions) { + void processTagging(FullBCs const& bcs, CollsCent const& collisions) + { std::vector::iterator> cols; - for (auto &bc : bcs) { + for (auto& bc : bcs) { if ((bc.selection_bit(aod::evsel::kIsBBT0A) && bc.selection_bit(aod::evsel::kIsBBT0C)) != 0) { registry.fill(HIST("hBcSel"), 0); cols.clear(); - for (auto &collision : collisions) { + for (auto& collision : collisions) { if (collision.has_foundBC()) { if (collision.foundBCId() == bc.globalIndex()) { cols.emplace_back(collision); @@ -809,8 +830,9 @@ struct PseudorapidityDensityMFT { "Collect event sample stats", true); template - void processData(typename C::iterator const &collision, - filtMftTracks const &tracks) { + void processData(typename C::iterator const& collision, + filtMftTracks const& tracks) + { float c = -1; if constexpr (C::template contains()) { c = collision.centFT0C(); @@ -832,7 +854,7 @@ struct PseudorapidityDensityMFT { } auto nTrk = countTracks( - tracks, z, c, occ); //!@note here we obtain eta-z and phi-eta + tracks, z, c, occ); //!@note here we obtain eta-z and phi-eta if constexpr (C::template contains()) { registry.fill(HIST("Events/Centrality/NtrkZvtx"), nTrk, z, c); } else { @@ -842,8 +864,9 @@ struct PseudorapidityDensityMFT { template void processDatawBestTracks( - typename C::iterator const &collision, filtMftTracks const &tracks, - soa::SmallGroups const &besttracks) { + typename C::iterator const& collision, filtMftTracks const& tracks, + soa::SmallGroups const& besttracks) + { float c = -1; if constexpr (C::template contains()) { c = collision.centFT0C(); @@ -864,8 +887,8 @@ struct PseudorapidityDensityMFT { } auto nBestTrks = - countBestTracks(tracks, besttracks, z, c, - occ); //!@note here we obtain eta-z and phi-eta + countBestTracks(tracks, besttracks, z, c, + occ); //!@note here we obtain eta-z and phi-eta if constexpr (C::template contains()) { registry.fill(HIST("Events/Centrality/NtrkZvtxBest"), nBestTrks, z, c); } else { @@ -874,8 +897,9 @@ struct PseudorapidityDensityMFT { } /// @brief process fnc. to run on DATA and REC MC w/o centrality selection - void processDataInclusive(Colls::iterator const &collision, - filtMftTracks const &tracks) { + void processDataInclusive(Colls::iterator const& collision, + filtMftTracks const& tracks) + { processData(collision, tracks); } @@ -883,8 +907,9 @@ struct PseudorapidityDensityMFT { false); /// @brief process fnc. to run on DATA and REC MC w/ FT0C centrality selection - void processDataCent(CollsCent::iterator const &collision, - filtMftTracks const &tracks) { + void processDataCent(CollsCent::iterator const& collision, + filtMftTracks const& tracks) + { processData(collision, tracks); } @@ -894,8 +919,9 @@ struct PseudorapidityDensityMFT { /// @brief process fnc. to run on DATA and REC MC based on BestCollisionsFwd /// table w/o centrality selection void processDatawBestTracksInclusive( - Colls::iterator const &collision, filtMftTracks const &tracks, - soa::SmallGroups const &besttracks) { + Colls::iterator const& collision, filtMftTracks const& tracks, + soa::SmallGroups const& besttracks) + { processDatawBestTracks(collision, tracks, besttracks); } @@ -905,8 +931,9 @@ struct PseudorapidityDensityMFT { /// @brief process fnc. to run on DATA and REC MC based on BestCollisionsFwd /// table w/ FT0C centrality selection void processDatawBestTracksCent( - CollsCent::iterator const &collision, filtMftTracks const &tracks, - soa::SmallGroups const &besttracks) { + CollsCent::iterator const& collision, filtMftTracks const& tracks, + soa::SmallGroups const& besttracks) + { processDatawBestTracks(collision, tracks, besttracks); } @@ -922,13 +949,14 @@ struct PseudorapidityDensityMFT { /// @param parts subscribe to filtered MC particle table template void processMC( - typename MC::iterator const &mcCollision, - soa::SmallGroups> const &collisions, - filtParticles const &particles, filtMcMftTracks const &tracks) { + typename MC::iterator const& mcCollision, + soa::SmallGroups> const& collisions, + filtParticles const& particles, filtMcMftTracks const& tracks) + { float c_gen = -1; bool atLeastOne = false; int moreThanOne = 0; - for (auto &collision : collisions) { + for (auto& collision : collisions) { float c_rec = -1; if constexpr (C::template contains()) { c_rec = collision.centFT0C(); @@ -956,10 +984,10 @@ struct PseudorapidityDensityMFT { } auto perCollisionSample = - tracks.sliceBy(perCol, collision.globalIndex()); + tracks.sliceBy(perCol, collision.globalIndex()); auto nTrkRec = - countTracks(perCollisionSample, z, c_rec, - collision.trackOccupancyInTimeRange()); + countTracks(perCollisionSample, z, c_rec, + collision.trackOccupancyInTimeRange()); if constexpr (C::template contains()) { QAregistry.fill(HIST("Events/Centrality/ZvtxDiff"), @@ -991,7 +1019,7 @@ struct PseudorapidityDensityMFT { } auto perCollMCsample = mcSample->sliceByCached( - aod::mcparticle::mcCollisionId, mcCollision.globalIndex(), cache); + aod::mcparticle::mcCollisionId, mcCollision.globalIndex(), cache); auto Nchrg = countPart(perCollMCsample); if (moreThanOne > 1) { if constexpr (C::template contains()) { @@ -1025,10 +1053,10 @@ struct PseudorapidityDensityMFT { /// @brief process fnc. to run on MC w/o centrality selection void processMCInclusive( - aod::McCollisions::iterator const &mccollision, - soa::SmallGroups> const - &collisions, - filtParticles const &particles, filtMcMftTracks const &tracks) { + aod::McCollisions::iterator const& mccollision, + soa::SmallGroups> const& collisions, + filtParticles const& particles, filtMcMftTracks const& tracks) + { processMC(mccollision, collisions, particles, tracks); } @@ -1038,10 +1066,10 @@ struct PseudorapidityDensityMFT { /// @brief process fnc. to run on MC w FT0C centrality selection void processMCCent( - aod::McCollisions::iterator const &mccollision, - soa::SmallGroups> const - &collisions, - filtParticles const &particles, filtMcMftTracks const &tracks) { + aod::McCollisions::iterator const& mccollision, + soa::SmallGroups> const& collisions, + filtParticles const& particles, filtMcMftTracks const& tracks) + { processMC(mccollision, collisions, particles, tracks); } @@ -1050,20 +1078,21 @@ struct PseudorapidityDensityMFT { "Count MC particles in FT0C bins", false); PresliceUnsorted perColU = - aod::fwdtrack::bestCollisionId; + aod::fwdtrack::bestCollisionId; /// @brief process template function to run on MC truth using /// aod::BestCollisionsFwd tracks template void processMCwBestTracks( - typename MC::iterator const &mcCollision, - soa::SmallGroups> const &collisions, - filtParticles const &particles, filtMcMftTracks const &tracks, - filtBestTracks const &besttracks) { + typename MC::iterator const& mcCollision, + soa::SmallGroups> const& collisions, + filtParticles const& particles, filtMcMftTracks const& tracks, + filtBestTracks const& besttracks) + { float c_gen = -1; bool atLeastOne = false; int moreThanOne = 0; - for (auto &collision : collisions) { + for (auto& collision : collisions) { float c_rec = -1; if constexpr (C::template contains()) { c_rec = collision.centFT0C(); @@ -1089,12 +1118,12 @@ struct PseudorapidityDensityMFT { } auto perCollisionSample = - tracks.sliceBy(perCol, collision.globalIndex()); + tracks.sliceBy(perCol, collision.globalIndex()); auto perCollisionASample = - besttracks.sliceBy(perColU, collision.globalIndex()); + besttracks.sliceBy(perColU, collision.globalIndex()); auto nTrkRec = countBestTracks( - perCollisionSample, perCollisionASample, z, c_rec, - collision.trackOccupancyInTimeRange()); + perCollisionSample, perCollisionASample, z, c_rec, + collision.trackOccupancyInTimeRange()); if constexpr (C::template contains()) { registry.fill(HIST("Events/Centrality/NtrkZvtxGen"), nTrkRec, z, @@ -1136,15 +1165,15 @@ struct PseudorapidityDensityMFT { /// @brief process fnc. to run on MC (inclusive, using aod::BestCollisionsFwd /// tracks) void processMCwBestTracksInclusive( - aod::McCollisions::iterator const &mccollision, - soa::SmallGroups> const - &collisions, - filtParticles const &particles, filtMcMftTracks const &tracks, - // aod::BestCollisionsFwd const - // &besttracks - filtBestTracks const &besttracks) { + aod::McCollisions::iterator const& mccollision, + soa::SmallGroups> const& collisions, + filtParticles const& particles, filtMcMftTracks const& tracks, + // aod::BestCollisionsFwd const + // &besttracks + filtBestTracks const& besttracks) + { processMCwBestTracks( - mccollision, collisions, particles, tracks, besttracks); + mccollision, collisions, particles, tracks, besttracks); } PROCESS_SWITCH(PseudorapidityDensityMFT, processMCwBestTracksInclusive, @@ -1153,13 +1182,13 @@ struct PseudorapidityDensityMFT { /// @brief process fnc. to run on MC (FT0C centrality, using /// aod::BestCollisionsFwd tracks) void processMCwBestTracksCent( - aod::McCollisions::iterator const &mccollision, - soa::SmallGroups> const - &collisions, - filtParticles const &particles, filtMcMftTracks const &tracks, - filtBestTracks const &besttracks) { + aod::McCollisions::iterator const& mccollision, + soa::SmallGroups> const& collisions, + filtParticles const& particles, filtMcMftTracks const& tracks, + filtBestTracks const& besttracks) + { processMCwBestTracks( - mccollision, collisions, particles, tracks, besttracks); + mccollision, collisions, particles, tracks, besttracks); } PROCESS_SWITCH(PseudorapidityDensityMFT, processMCwBestTracksCent, @@ -1168,19 +1197,19 @@ struct PseudorapidityDensityMFT { using ParticlesI = soa::Join; Partition primariesI = - ((aod::mcparticle::flags & - (uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary) == - (uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary); + ((aod::mcparticle::flags & + (uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary) == + (uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary); /// @brief process template function to calculate tracking efficiency (indexed /// as particle-to-MFT-tracks) template void processTrkEffIdx( - typename soa::Filtered> const - &collisions, - MC const & /*mccollisions*/, ParticlesI const & /*particles*/, - MFTTracksLabeled const &tracks) { - for (auto &collision : collisions) { + typename soa::Filtered> const& collisions, + MC const& /*mccollisions*/, ParticlesI const& /*particles*/, + MFTTracksLabeled const& tracks) + { + for (auto& collision : collisions) { if (!isGoodEvent(collision)) { continue; } @@ -1195,10 +1224,10 @@ struct PseudorapidityDensityMFT { auto mcCollision = collision.mcCollision(); auto particlesPerCol = primariesI->sliceByCached( - aod::mcparticle::mcCollisionId, mcCollision.globalIndex(), cache); + aod::mcparticle::mcCollisionId, mcCollision.globalIndex(), cache); particlesPerCol.bindExternalIndices(&tracks); - for (auto &particle : particlesPerCol) { + for (auto& particle : particlesPerCol) { if (!isChrgParticle(particle.pdgCode())) { continue; } @@ -1216,8 +1245,8 @@ struct PseudorapidityDensityMFT { auto iscounted = false; auto ncnt = 0; auto relatedTracks = - particle.template mfttracks_as(); - for (auto &track : relatedTracks) { + particle.template mfttracks_as(); + for (auto& track : relatedTracks) { if (!isTrackSelected(track)) { continue; } @@ -1233,9 +1262,9 @@ struct PseudorapidityDensityMFT { QAregistry.fill(HIST("Tracks/Centrality/hPhiEtaDuplicates"), track.phi(), track.eta(), c_rec); QAregistry.fill( - HIST("Tracks/Centrality/hPtPhiEtaZvtxEffDuplicates"), - particle.pt(), particle.phi(), particle.eta(), - mcCollision.posZ(), c_rec); + HIST("Tracks/Centrality/hPtPhiEtaZvtxEffDuplicates"), + particle.pt(), particle.phi(), particle.eta(), + mcCollision.posZ(), c_rec); } } else { if (!iscounted) { // primaries @@ -1262,9 +1291,9 @@ struct PseudorapidityDensityMFT { if (relatedTracks.size() > 1) { if constexpr (C::template contains()) { QAregistry.fill( - HIST("Tracks/Centrality/hPtPhiEtaZvtxEffGenDuplicates"), - particle.pt(), particle.phi(), particle.eta(), - mcCollision.posZ(), c_rec); + HIST("Tracks/Centrality/hPtPhiEtaZvtxEffGenDuplicates"), + particle.pt(), particle.phi(), particle.eta(), + mcCollision.posZ(), c_rec); } else { QAregistry.fill(HIST("Tracks/hPtPhiEtaZvtxEffGenDuplicates"), particle.pt(), particle.phi(), particle.eta(), @@ -1279,9 +1308,10 @@ struct PseudorapidityDensityMFT { /// @brief process function to calculate tracking efficiency (inclusive, /// indexed) void processTrkEffIdxInlusive( - soa::Filtered> const &collisions, - aod::McCollisions const &mccollisions, ParticlesI const &particles, - MFTTracksLabeled const &tracks) { + soa::Filtered> const& collisions, + aod::McCollisions const& mccollisions, ParticlesI const& particles, + MFTTracksLabeled const& tracks) + { processTrkEffIdx(collisions, mccollisions, particles, tracks); } @@ -1292,10 +1322,10 @@ struct PseudorapidityDensityMFT { /// @brief process function to calculate tracking efficiency (FT0 bins, /// indexed) void processTrkEffIdxCent( - soa::Filtered> const - &collisions, - aod::McCollisions const &mccollisions, ParticlesI const &particles, - MFTTracksLabeled const &tracks) { + soa::Filtered> const& collisions, + aod::McCollisions const& mccollisions, ParticlesI const& particles, + MFTTracksLabeled const& tracks) + { processTrkEffIdx(collisions, mccollisions, particles, tracks); } @@ -1307,11 +1337,12 @@ struct PseudorapidityDensityMFT { /// on BestCollisionsFwd in FT0C bins template void processTrkEffBest( - typename soa::Filtered< - soa::Join>::iterator const &collision, - MC const & /*mccollisions*/, filtParticles const &particles, - filtMcMftTracks const & /*tracks*/, - soa::SmallGroups const &besttracks) { + typename soa::Filtered< + soa::Join>::iterator const& collision, + MC const& /*mccollisions*/, filtParticles const& particles, + filtMcMftTracks const& /*tracks*/, + soa::SmallGroups const& besttracks) + { if (!isGoodEvent(collision)) { return; } @@ -1326,8 +1357,8 @@ struct PseudorapidityDensityMFT { auto mcCollision = collision.mcCollision(); auto particlesPerCol = particles.sliceByCached( - aod::mcparticle::mcCollisionId, mcCollision.globalIndex(), cache); - for (auto &particle : particlesPerCol) { + aod::mcparticle::mcCollisionId, mcCollision.globalIndex(), cache); + for (auto& particle : particlesPerCol) { if (!isChrgParticle(particle.pdgCode())) { continue; } @@ -1341,7 +1372,7 @@ struct PseudorapidityDensityMFT { } } - for (auto const &track : besttracks) { + for (auto const& track : besttracks) { auto itrack = track.mfttrack_as(); if (!isTrackSelected(itrack)) { continue; @@ -1370,58 +1401,59 @@ struct PseudorapidityDensityMFT { /// @brief process function to calculate tracking efficiency (inclusive, based /// on BestCollisionsFwd) void processTrkEffBestInclusive( - soa::Filtered>::iterator const - &collision, - aod::McCollisions const &mccollisions, filtParticles const &particles, - filtMcMftTracks const &tracks, - soa::SmallGroups const &besttracks) { + soa::Filtered>::iterator const& collision, + aod::McCollisions const& mccollisions, filtParticles const& particles, + filtMcMftTracks const& tracks, + soa::SmallGroups const& besttracks) + { processTrkEffBest(collision, mccollisions, particles, tracks, besttracks); } PROCESS_SWITCH( - PseudorapidityDensityMFT, processTrkEffBestInclusive, - "Process tracking efficiency (inclusive, based on BestCollisionsFwd)", - false); + PseudorapidityDensityMFT, processTrkEffBestInclusive, + "Process tracking efficiency (inclusive, based on BestCollisionsFwd)", + false); /// @brief process function to calculate tracking efficiency (in FT0 bins, /// based on BestCollisionsFwd) void processTrkEffBestCent( - soa::Filtered>:: - iterator const &collision, - aod::McCollisions const &mccollisions, filtParticles const &particles, - filtMcMftTracks const &tracks, - soa::SmallGroups const &besttracks) { + soa::Filtered>:: + iterator const& collision, + aod::McCollisions const& mccollisions, filtParticles const& particles, + filtMcMftTracks const& tracks, + soa::SmallGroups const& besttracks) + { processTrkEffBest( - collision, mccollisions, particles, tracks, besttracks); + collision, mccollisions, particles, tracks, besttracks); } PROCESS_SWITCH( - PseudorapidityDensityMFT, processTrkEffBestCent, - "Process tracking efficiency (in FT0 bins, based on BestCollisionsFwd)", - false); + PseudorapidityDensityMFT, processTrkEffBestCent, + "Process tracking efficiency (in FT0 bins, based on BestCollisionsFwd)", + false); Preslice filtTrkperCol = o2::aod::fwdtrack::collisionId; /// @brief process template function for MC QA checks template void processMcQA( - typename soa::SmallGroups> const - &collisions, - aod::McCollisions const &mcCollisions, - filtParticles const & /*particles*/, MFTTracksLabeled const &tracks, - aod::AmbiguousMFTTracks const &atracks) { - for (const auto &collision : collisions) { + typename soa::SmallGroups> const& collisions, + aod::McCollisions const& mcCollisions, + filtParticles const& /*particles*/, MFTTracksLabeled const& tracks, + aod::AmbiguousMFTTracks const& atracks) + { + for (const auto& collision : collisions) { float c_rec = -1; if constexpr (C::template contains()) { c_rec = collision.centFT0C(); QAregistry.fill( - HIST("Events/Centrality/hRecPerGenColls"), - static_cast(collisions.size()) / mcCollisions.size(), c_rec); + HIST("Events/Centrality/hRecPerGenColls"), + static_cast(collisions.size()) / mcCollisions.size(), c_rec); } else { QAregistry.fill(HIST("Events/hRecPerGenColls"), static_cast(collisions.size()) / - mcCollisions.size()); + mcCollisions.size()); } if (!isGoodEvent(collision)) { @@ -1430,9 +1462,9 @@ struct PseudorapidityDensityMFT { auto trkPerColl = tracks.sliceBy(filtTrkperCol, collision.globalIndex()); uint Ntracks{0u}, Natracks{0u}; - for (const auto &track : trkPerColl) { + for (const auto& track : trkPerColl) { Ntracks++; - for (const auto &atrack : atracks) { + for (const auto& atrack : atracks) { if (atrack.mfttrackId() == track.globalIndex()) { Natracks++; break; @@ -1453,10 +1485,10 @@ struct PseudorapidityDensityMFT { /// @brief process function for QA checks (inclusive) void processMcQAInclusive( - soa::SmallGroups> const - &collisions, - aod::McCollisions const &mcCollisions, filtParticles const &particles, - MFTTracksLabeled const &tracks, aod::AmbiguousMFTTracks const &atracks) { + soa::SmallGroups> const& collisions, + aod::McCollisions const& mcCollisions, filtParticles const& particles, + MFTTracksLabeled const& tracks, aod::AmbiguousMFTTracks const& atracks) + { processMcQA(collisions, mcCollisions, particles, tracks, atracks); } @@ -1465,10 +1497,10 @@ struct PseudorapidityDensityMFT { /// @brief process function for QA checks (in FT0 bins) void processMcQACent( - soa::SmallGroups> const - &collisions, - aod::McCollisions const &mcCollisions, filtParticles const &particles, - MFTTracksLabeled const &tracks, aod::AmbiguousMFTTracks const &atracks) { + soa::SmallGroups> const& collisions, + aod::McCollisions const& mcCollisions, filtParticles const& particles, + MFTTracksLabeled const& tracks, aod::AmbiguousMFTTracks const& atracks) + { processMcQA(collisions, mcCollisions, particles, tracks, atracks); } @@ -1477,6 +1509,7 @@ struct PseudorapidityDensityMFT { "Process MC QA checks (in FT0 bins)", false); }; -WorkflowSpec defineDataProcessing(ConfigContext const &cfgc) { +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ return WorkflowSpec{adaptAnalysisTask(cfgc)}; }