diff --git a/PWGMM/Mult/Tasks/dndeta-mft-pbpb.cxx b/PWGMM/Mult/Tasks/dndeta-mft-pbpb.cxx index b3532dfef0d..a800b3a1002 100644 --- a/PWGMM/Mult/Tasks/dndeta-mft-pbpb.cxx +++ b/PWGMM/Mult/Tasks/dndeta-mft-pbpb.cxx @@ -68,7 +68,11 @@ struct PseudorapidityDensityMFT { {}, 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"}; @@ -84,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; @@ -96,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, @@ -175,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"); @@ -192,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}}}}); @@ -235,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"); @@ -253,9 +262,9 @@ struct PseudorapidityDensityMFT { {HistType::kTH1F, {{1000, 0, 100}}}, 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}}}); @@ -280,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}}}); @@ -313,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"); @@ -343,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) { @@ -351,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"); @@ -393,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.}}}}); @@ -443,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}}}); @@ -483,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}}}); } } @@ -506,7 +515,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 & @@ -516,7 +525,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; @@ -529,29 +538,31 @@ struct PseudorapidityDensityMFT { /// Filtered tables using filtColls = soa::Filtered>; using filtColl = - soa::Filtered>::iterator; + soa::Filtered>::iterator; using filtCollsCent = - soa::Filtered>; + soa::Filtered>; using filtCollCent = soa::Filtered< - soa::Join>::iterator; + soa::Join>::iterator; using CollsGenCentSmallG = - o2::soa::SmallGroups>; + o2::soa::SmallGroups>; using filtCollsGenCentSmallG = - soa::SmallGroups>; + soa::SmallGroups>; using filtCollsGenCent = - soa::Filtered>; + soa::Filtered>; using filtMcGenColls = soa::Filtered; using filtMcGenColl = soa::Filtered::iterator; using filtMftTracks = soa::Filtered; using filtMcMftTracks = soa::Filtered; using filtBestTracks = soa::Filtered; using filtBestTracksJ = - soa::Filtered>; + 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()) @@ -577,10 +588,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(), @@ -622,11 +634,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; @@ -679,9 +692,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; } @@ -691,7 +706,8 @@ struct PseudorapidityDensityMFT { } template - bool isGoodEvent(C const &collision) { + bool isGoodEvent(C const& collision) + { if constexpr (fillHis) { registry.fill(HIST("hEvtSel"), 0); } @@ -752,7 +768,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) { @@ -762,9 +779,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; } @@ -804,14 +822,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); @@ -835,8 +854,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(); @@ -858,7 +878,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 { @@ -868,8 +888,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(); @@ -890,8 +911,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 { @@ -900,8 +921,9 @@ struct PseudorapidityDensityMFT { } /// @brief process fnc. to run on DATA and REC MC w/o centrality selection - void processDataInclusive(filtColls::iterator const &collision, - filtMftTracks const &tracks) { + void processDataInclusive(filtColls::iterator const& collision, + filtMftTracks const& tracks) + { processData(collision, tracks); } @@ -909,8 +931,9 @@ struct PseudorapidityDensityMFT { false); /// @brief process fnc. to run on DATA and REC MC w/ FT0C centrality selection - void processDataCent(filtCollsCent::iterator const &collision, - filtMftTracks const &tracks) { + void processDataCent(filtCollsCent::iterator const& collision, + filtMftTracks const& tracks) + { processData(collision, tracks); } @@ -920,8 +943,9 @@ struct PseudorapidityDensityMFT { /// @brief process fnc. to run on DATA and REC MC based on BestCollisionsFwd /// table w/o centrality selection void processDatawBestTracksInclusive( - filtColls::iterator const &collision, filtMftTracks const &tracks, - soa::SmallGroups const &besttracks) { + filtColls::iterator const& collision, filtMftTracks const& tracks, + soa::SmallGroups const& besttracks) + { processDatawBestTracks(collision, tracks, besttracks); } @@ -931,8 +955,9 @@ struct PseudorapidityDensityMFT { /// @brief process fnc. to run on DATA and REC MC based on BestCollisionsFwd /// table w/ FT0C centrality selection void processDatawBestTracksCent( - filtCollsCent::iterator const &collision, filtMftTracks const &tracks, - soa::SmallGroups const &besttracks) { + filtCollsCent::iterator const& collision, filtMftTracks const& tracks, + soa::SmallGroups const& besttracks) + { processDatawBestTracks(collision, tracks, besttracks); } @@ -948,13 +973,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(); @@ -982,10 +1008,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"), @@ -1017,7 +1043,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()) { @@ -1051,10 +1077,10 @@ struct PseudorapidityDensityMFT { /// @brief process fnc. to run on MC w/o centrality selection void processMCInclusive( - filtMcGenColls::iterator const &mccollision, - soa::SmallGroups> const - &collisions, - filtParticles const &particles, filtMcMftTracks const &tracks) { + filtMcGenColls::iterator const& mccollision, + soa::SmallGroups> const& collisions, + filtParticles const& particles, filtMcMftTracks const& tracks) + { processMC(mccollision, collisions, particles, tracks); } @@ -1064,10 +1090,10 @@ struct PseudorapidityDensityMFT { /// @brief process fnc. to run on MC w FT0C centrality selection void processMCCent( - filtMcGenColls::iterator const &mccollision, - soa::SmallGroups> const - &collisions, - filtParticles const &particles, filtMcMftTracks const &tracks) { + filtMcGenColls::iterator const& mccollision, + soa::SmallGroups> const& collisions, + filtParticles const& particles, filtMcMftTracks const& tracks) + { processMC(mccollision, collisions, particles, tracks); } @@ -1076,20 +1102,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(); @@ -1115,12 +1142,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, @@ -1162,15 +1189,15 @@ struct PseudorapidityDensityMFT { /// @brief process fnc. to run on MC (inclusive, using aod::BestCollisionsFwd /// tracks) void processMCwBestTracksInclusive( - filtMcGenColls::iterator const &mccollision, - soa::SmallGroups> const - &collisions, - filtParticles const &particles, filtMcMftTracks const &tracks, - // aod::BestCollisionsFwd const - // &besttracks - filtBestTracks const &besttracks) { + filtMcGenColls::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, @@ -1179,13 +1206,13 @@ struct PseudorapidityDensityMFT { /// @brief process fnc. to run on MC (FT0C centrality, using /// aod::BestCollisionsFwd tracks) void processMCwBestTracksCent( - filtMcGenColls::iterator const &mccollision, - soa::SmallGroups> const - &collisions, - filtParticles const &particles, filtMcMftTracks const &tracks, - filtBestTracks const &besttracks) { + filtMcGenColls::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, @@ -1194,19 +1221,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; } @@ -1221,10 +1248,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; } @@ -1242,8 +1269,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; } @@ -1259,9 +1286,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 @@ -1288,9 +1315,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(), @@ -1305,9 +1332,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); } @@ -1318,10 +1346,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); } @@ -1333,11 +1361,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; } @@ -1352,8 +1381,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; } @@ -1367,7 +1396,7 @@ struct PseudorapidityDensityMFT { } } - for (auto const &track : besttracks) { + for (auto const& track : besttracks) { auto itrack = track.mfttrack_as(); if (!isTrackSelected(itrack)) { continue; @@ -1396,47 +1425,48 @@ 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, - filtMcGenColls const &mcCollisions, filtParticles const & /*particles*/, - MFTTracksLabeled const &tracks, aod::AmbiguousMFTTracks const &atracks) { - for (const auto &collision : collisions) { + typename soa::SmallGroups> const& collisions, + filtMcGenColls 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(); @@ -1453,9 +1483,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; @@ -1476,10 +1506,10 @@ struct PseudorapidityDensityMFT { /// @brief process function for QA checks (inclusive) void processMcQAInclusive( - soa::SmallGroups> const - &collisions, - filtMcGenColls const &mcCollisions, filtParticles const &particles, - MFTTracksLabeled const &tracks, aod::AmbiguousMFTTracks const &atracks) { + soa::SmallGroups> const& collisions, + filtMcGenColls const& mcCollisions, filtParticles const& particles, + MFTTracksLabeled const& tracks, aod::AmbiguousMFTTracks const& atracks) + { processMcQA(collisions, mcCollisions, particles, tracks, atracks); } @@ -1489,10 +1519,10 @@ struct PseudorapidityDensityMFT { /// @brief process function for QA checks (in FT0 bins) void processMcQACent( - soa::SmallGroups> const - &collisions, - filtMcGenColls const &mcCollisions, filtParticles const &particles, - MFTTracksLabeled const &tracks, aod::AmbiguousMFTTracks const &atracks) { + soa::SmallGroups> const& collisions, + filtMcGenColls const& mcCollisions, filtParticles const& particles, + MFTTracksLabeled const& tracks, aod::AmbiguousMFTTracks const& atracks) + { processMcQA(collisions, mcCollisions, particles, tracks, atracks); } @@ -1501,6 +1531,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)}; }