From 592558099f7fb9c50798ca717698e9595b259cb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Tue, 1 Sep 2026 17:40:05 +0200 Subject: [PATCH] Use `const&` and `std::move` to avoid copies Mostly done automatically by Clang-Tidy. --- .../Tasks/NetProtonCumulants.cxx | 2 +- .../Tasks/RobustFluctuationObservables.cxx | 6 ++-- .../Tasks/kaonIsospinFluctuations.cxx | 36 +++++++++---------- .../Tasks/radialFlowDecorr.cxx | 8 ++--- .../Tasks/v0ptHadPiKaProt.cxx | 6 ++-- PWGCF/Femto3D/Tasks/femto3dPairTask.cxx | 4 +-- PWGCF/Femto3D/Tasks/femto3dPairTaskMC.cxx | 32 +++++++++-------- PWGCF/Femto3D/Tools/checkPacking.cxx | 2 +- .../Core/femtoDreamCollisionSelection.h | 3 +- PWGCF/FemtoDream/Core/femtoDreamContainer.h | 19 +++++----- .../Core/femtoDreamContainerThreeBody.h | 4 +-- .../FemtoDream/Core/femtoDreamParticleHisto.h | 6 ++-- .../femtoDreamProducerReducedTask.cxx | 2 +- .../TableProducer/femtoDreamProducerTask.cxx | 4 +-- ...toDreamProducerTaskForSpecificAnalysis.cxx | 14 ++++---- .../femtoDreamProducerTaskReso.cxx | 4 +-- .../Tasks/femtoDreamPairTaskTrackCascade.cxx | 4 +-- .../Tasks/femtoDreamPairTaskTrackTrack.cxx | 10 +++--- .../Tasks/femtoDreamPairTaskTrackV0.cxx | 2 +- .../Tasks/femtoDreamPairTaskV0Reso.cxx | 2 +- .../Tasks/femtoDreamPairTaskV0V0.cxx | 6 ++-- ...femtoDreamTripletTaskTrackTrackCascade.cxx | 4 +-- .../femtoDreamTripletTaskTrackTrackTrack.cxx | 6 ++-- ...mtoDreamTripletTaskTrackTrackTrackPbPb.cxx | 6 ++-- .../femtoDreamTripletTaskTrackTrackV0.cxx | 6 ++-- .../femtoDreamTripletTaskTrackTrackV0PbPb.cxx | 6 ++-- .../Tasks/femtodreamPairCascadeCascade.cxx | 2 +- PWGCF/FemtoDream/Utils/femtoDreamCutCulator.h | 4 +-- .../Core/FemtoUniverse3DContainer.h | 2 +- .../Core/FemtoUniverseAngularContainer.h | 4 +-- .../Core/FemtoUniverseContainer.h | 4 +-- .../Core/FemtoUniverseCutculator.h | 4 +-- .../Core/FemtoUniverseEfficiencyCorrection.h | 2 +- .../Core/FemtoUniverseFemtoContainer.h | 4 +-- .../Core/FemtoUniverseParticleHisto.h | 8 ++--- PWGCF/FemtoUniverse/Core/femtoUtils.h | 4 +-- .../femtoUniverseProducerReducedTask.cxx | 2 +- .../femtoUniversePairTaskTrackNucleus.cxx | 6 ++-- .../Tasks/femtoUniversePairTaskTrackTrack.cxx | 6 ++-- ...ersePairTaskTrackTrack3DMultKtExtended.cxx | 6 ++-- ...emtoUniversePairTaskTrackTrackExtended.cxx | 8 ++--- .../femtoUniversePairTaskTrackTrackMC.cxx | 6 ++-- ...femtoUniversePairTaskTrackTrackMcTruth.cxx | 6 ++-- ...irTaskTrackTrackSpherHarMultKtExtended.cxx | 10 +++--- ...TrackTrackSpherHarMultKtExtendedItsPid.cxx | 6 ++-- .../femtoUniversePairTaskTrackV0Helicity.cxx | 4 +-- .../TableProducer/femtoWorldProducerTask.cxx | 2 +- .../Tasks/femtoWorldPairTaskPionPion.cxx | 2 +- PWGCF/Flow/Tasks/flowAnalysisGF.cxx | 14 ++++---- PWGCF/Flow/Tasks/flowDirectedFlowTask.cxx | 2 +- PWGCF/Flow/Tasks/flowEfficiencyCasc.cxx | 2 +- PWGCF/Flow/Tasks/flowEsePHe3.cxx | 16 ++++----- PWGCF/Flow/Tasks/flowFlucGfwPp.cxx | 28 +++++++-------- PWGCF/Flow/Tasks/flowGfwEse.cxx | 24 ++++++------- PWGCF/Flow/Tasks/flowGfwOmegaXi.cxx | 10 +++--- PWGCF/Flow/Tasks/flowGfwTask.cxx | 8 ++--- PWGCF/Flow/Tasks/flowPbpbPikp.cxx | 14 ++++---- PWGCF/Flow/Tasks/flowPidCme.cxx | 6 ++-- PWGCF/Flow/Tasks/flowPtEfficiency.cxx | 2 +- PWGCF/Flow/Tasks/flowQa.cxx | 6 ++-- PWGCF/Flow/Tasks/flowRunbyRun.cxx | 6 ++-- PWGCF/Flow/Tasks/flowSP.cxx | 20 +++++------ PWGCF/Flow/Tasks/flowTask.cxx | 10 +++--- PWGCF/Flow/Tasks/resonancesGfwFlow.cxx | 22 ++++++------ PWGCF/GenericFramework/Core/FlowContainer.cxx | 5 +-- PWGCF/GenericFramework/Core/FlowContainer.h | 2 +- .../GenericFramework/Core/FlowPtContainer.cxx | 4 +-- PWGCF/GenericFramework/Core/FlowPtContainer.h | 4 +-- PWGCF/GenericFramework/Core/GFW.cxx | 16 ++++----- PWGCF/GenericFramework/Core/GFW.h | 12 +++---- PWGCF/GenericFramework/Core/GFWCumulant.cxx | 3 +- PWGCF/GenericFramework/Core/GFWPowerArray.cxx | 13 +++---- PWGCF/GenericFramework/Core/GFWPowerArray.h | 2 +- PWGCF/GenericFramework/Core/GFWWeights.cxx | 2 +- PWGCF/GenericFramework/Core/GFWWeights.h | 2 +- .../Tasks/flowGfwLightIons.cxx | 24 ++++++------- PWGCF/JCorran/Tasks/jEPDzeroFlowAnalysis.cxx | 2 +- .../Tasks/multiparticle-correlations-ar.cxx | 12 +++---- PWGCF/TableProducer/dptDptFilter.h | 17 ++++----- PWGCF/Tasks/correlations.cxx | 2 +- PWGCF/Tasks/dptDptCorrelations.cxx | 6 ++-- PWGCF/Tutorial/CFTutorialTask0.cxx | 2 +- PWGCF/Tutorial/CFTutorialTask1.cxx | 2 +- PWGCF/Tutorial/CFTutorialTask2.cxx | 2 +- PWGCF/Tutorial/CFTutorialTask3.cxx | 4 +-- PWGCF/Tutorial/CFTutorialTask4.cxx | 4 +-- PWGCF/Tutorial/CFTutorialTask5.cxx | 4 +-- .../Core/EventSelectionFilterAndAnalysis.cxx | 8 ++--- .../Core/EventSelectionFilterAndAnalysis.h | 5 +-- .../Core/PIDSelectionFilterAndAnalysis.cxx | 12 +++---- .../Core/PIDSelectionFilterAndAnalysis.h | 21 +++++------ .../Core/SkimmingConfigurableCuts.h | 6 ++-- .../Core/TrackSelectionFilterAndAnalysis.cxx | 8 ++--- .../Core/TrackSelectionFilterAndAnalysis.h | 25 ++++++------- .../twoParticleCorrelationsFiltering.cxx | 4 +-- .../twoParticleCorrelationsFullSkimming.cxx | 6 ++-- ...oParticleCorrelationsNotStoredSkimming.cxx | 6 ++-- .../Tasks/cascDiHadronCorr.cxx | 22 ++++++------ .../Tasks/diHadronCor.cxx | 16 ++++----- .../Tasks/dptDptEfficiencyAndQc.cxx | 6 ++-- .../Tasks/etaDihadron.cxx | 16 ++++----- .../Tasks/flowDecorrelation.cxx | 14 ++++---- .../Tasks/longRangeDihadronCor.cxx | 14 ++++---- .../Tasks/longrangeCorrelation.cxx | 2 +- .../Tasks/neutronProtonCorrZdc.cxx | 2 +- .../Tasks/particleOriginAnalysis.cxx | 2 +- .../Tasks/pidDiHadron.cxx | 16 ++++----- .../Tasks/r2p2-4-id.cxx | 16 ++++----- .../Tasks/twoParticleCorrelationPp.cxx | 6 ++-- .../Tasks/twoParticleCorrelations.cxx | 12 +++---- .../Tasks/twoParticleCorrelationsMpi.cxx | 2 +- 111 files changed, 450 insertions(+), 439 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/NetProtonCumulants.cxx b/PWGCF/EbyEFluctuations/Tasks/NetProtonCumulants.cxx index d9e1f132bfa..68f4b4bc7a8 100644 --- a/PWGCF/EbyEFluctuations/Tasks/NetProtonCumulants.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/NetProtonCumulants.cxx @@ -126,7 +126,7 @@ struct NetProtonCumulants_Table_QA { //! centrality cut if (cent > 0.0f && cent < 90.0f) { - for (auto track : inputTracks) { //! Loop over tracks + for (const auto& track : inputTracks) { //! Loop over tracks histos.fill(HIST("hPtAll"), track.pt()); histos.fill(HIST("hEtaAll"), track.eta()); histos.fill(HIST("hPhiAll"), track.phi()); diff --git a/PWGCF/EbyEFluctuations/Tasks/RobustFluctuationObservables.cxx b/PWGCF/EbyEFluctuations/Tasks/RobustFluctuationObservables.cxx index ef3bc2bfeec..c1bc5143b58 100644 --- a/PWGCF/EbyEFluctuations/Tasks/RobustFluctuationObservables.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/RobustFluctuationObservables.cxx @@ -2309,7 +2309,7 @@ struct RobustFluctuationObservables { } // end of processRobustFluctuationObservables() // shortcut function to fill 2D histograms - void fillHistForThisCut(string cutName, int multNTracksPV, int multTrk, int nTracksGlobalAccepted, double multT0A, double multT0C, double multV0A, double /*t0cCentr*/, int bc) + void fillHistForThisCut(const string& cutName, int multNTracksPV, int multTrk, int nTracksGlobalAccepted, double multT0A, double multT0C, double multV0A, double /*t0cCentr*/, int bc) { // registry.get(HIST("eta"))->Fill(track.eta()); // arrPointers[histId][cutId]->Fill(xval, yval, weight); @@ -2348,7 +2348,7 @@ struct RobustFluctuationObservables { // } } - void fillPtHistos(string strTrackType, float pt, int charge, float w, bool noTF, bool noROF) + void fillPtHistos(const string& strTrackType, float pt, int charge, float w, bool noTF, bool noROF) { fillPtHistosThisCut(strTrackType, "allBC", pt, charge, w); @@ -2369,7 +2369,7 @@ struct RobustFluctuationObservables { fillPtHistosThisCut(strTrackType, "noTFandROFborder", pt, charge, w); } - void fillPtHistosThisCut(string strTrackType, string strEvSelType, float pt, int charge, float w) + void fillPtHistosThisCut(const string& strTrackType, const string& strEvSelType, float pt, int charge, float w) { string strPre = strTrackType + "/" + strEvSelType; diff --git a/PWGCF/EbyEFluctuations/Tasks/kaonIsospinFluctuations.cxx b/PWGCF/EbyEFluctuations/Tasks/kaonIsospinFluctuations.cxx index 0f3a0a3c0d7..14ff6c33833 100644 --- a/PWGCF/EbyEFluctuations/Tasks/kaonIsospinFluctuations.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/kaonIsospinFluctuations.cxx @@ -1016,7 +1016,7 @@ struct KaonIsospinFluctuations { //_______________________________Identification Funtions Depending on the tpcInnerParam _______________________________ // tpc Selections template - bool selPionTPCInnerParam(T track) + bool selPionTPCInnerParam(const T& track) { if (vetoIdOthersTPC(track)) { if (0.05 <= track.tpcInnerParam() && track.tpcInnerParam() < 0.70 && std::abs(track.tpcNSigmaPi()) < cfgPiNSigmaTPCLowP) { @@ -1030,7 +1030,7 @@ struct KaonIsospinFluctuations { } template - bool selKaonTPCInnerParam(T track) + bool selKaonTPCInnerParam(const T& track) { if (vetoIdOthersTPC(track)) { if (0.05 <= track.tpcInnerParam() && track.tpcInnerParam() < 0.70 && std::abs(track.tpcNSigmaKa()) < cfgKaNSigmaTPCLowP) { @@ -1044,7 +1044,7 @@ struct KaonIsospinFluctuations { } template - bool selProtonTPCInnerParam(T track) + bool selProtonTPCInnerParam(const T& track) { if (vetoIdOthersTPC(track)) { if (0.05 <= track.tpcInnerParam() && track.tpcInnerParam() < 1.60 && std::abs(track.tpcNSigmaPr()) < cfgPrNSigmaTPCLowP) { @@ -1058,7 +1058,7 @@ struct KaonIsospinFluctuations { } template - bool selDeuteronTPCInnerParam(T track) + bool selDeuteronTPCInnerParam(const T& track) { if (vetoIdOthersTPC(track)) { if (0.05 <= track.tpcInnerParam() && track.tpcInnerParam() < 1.80 && std::abs(track.tpcNSigmaDe()) < 3.0) { @@ -1072,7 +1072,7 @@ struct KaonIsospinFluctuations { } template - bool selElectronTPCInnerParam(T track) + bool selElectronTPCInnerParam(const T& track) { if (track.tpcNSigmaEl() < 3.0 && track.tpcNSigmaPi() > 3.0 && track.tpcNSigmaKa() > 3.0 && track.tpcNSigmaPr() > 3.0 && track.tpcNSigmaDe() > 3.0) { return true; @@ -1084,7 +1084,7 @@ struct KaonIsospinFluctuations { // TOF Selections // Pion template - bool selPionTOF(T track) + bool selPionTOF(const T& track) { if (vetoIdOthersTOF(track)) { if (track.p() <= 0.75 && std::abs(track.tpcNSigmaPi()) < cfgPiNSigmaTPCLowP && std::abs(track.tofNSigmaPi()) < cfgPiNSigmaTOFLowP) { @@ -1099,7 +1099,7 @@ struct KaonIsospinFluctuations { // Kaon template - bool selKaonTOF(T track) + bool selKaonTOF(const T& track) { if (vetoIdOthersTOF(track)) { if (track.p() <= 0.75 && std::abs(track.tpcNSigmaKa()) < cfgKaNSigmaTPCLowP && std::abs(track.tofNSigmaKa()) < cfgKaNSigmaTOFLowP) { @@ -1119,7 +1119,7 @@ struct KaonIsospinFluctuations { // Proton template - bool selProtonTOF(T track) + bool selProtonTOF(const T& track) { if (vetoIdOthersTOF(track)) { if (track.p() <= 1.30 && std::abs(track.tpcNSigmaPr()) < cfgPrNSigmaTPCLowP && std::abs(track.tofNSigmaPr()) < cfgPrNSigmaTOFLowP) { @@ -1140,7 +1140,7 @@ struct KaonIsospinFluctuations { // Deuteron template - bool selDeuteronTOF(T track) + bool selDeuteronTOF(const T& track) { if (vetoIdOthersTOF(track)) { if (track.p() <= 3.10 && std::abs(track.tpcNSigmaDe()) < 3.0 && std::abs(track.tofNSigmaDe()) < 3.0) { @@ -1156,7 +1156,7 @@ struct KaonIsospinFluctuations { // Electron template - bool selElectronTOF(T track) + bool selElectronTOF(const T& track) { if ((std::pow(track.tpcNSigmaEl(), 2) + std::pow(track.tofNSigmaEl(), 2)) < 9.00 && vetoIdOthersTOF(track)) { return true; @@ -1168,7 +1168,7 @@ struct KaonIsospinFluctuations { //______________________________Identification Functions________________________________________________________________ // Pion template - bool selPion(T track, int& IdMethod) + bool selPion(const T& track, int& IdMethod) { if (cfgDoPdependentId) { return selPiPdependent(track, IdMethod); @@ -1187,7 +1187,7 @@ struct KaonIsospinFluctuations { // Kaon template - bool selKaon(T track, int& IdMethod) + bool selKaon(const T& track, int& IdMethod) { if (cfgDoPdependentId) { return selKaPdependent(track, IdMethod); @@ -1206,7 +1206,7 @@ struct KaonIsospinFluctuations { // Proton template - bool selProton(T track, int& IdMethod) + bool selProton(const T& track, int& IdMethod) { if (cfgDoPdependentId) { return selPrPdependent(track, IdMethod); @@ -1225,7 +1225,7 @@ struct KaonIsospinFluctuations { // Deuteron template - bool selDeuteron(T track, int& IdMethod) + bool selDeuteron(const T& track, int& IdMethod) { if (cfgDoPdependentId) { return false; @@ -1244,7 +1244,7 @@ struct KaonIsospinFluctuations { // Electron template - bool selElectron(T track, int& IdMethod) + bool selElectron(const T& track, int& IdMethod) { if (cfgDoPdependentId) { return false; @@ -1310,7 +1310,7 @@ struct KaonIsospinFluctuations { } template - bool selK0s(T v0) + bool selK0s(const T& v0) { if (k0sSelCut.cfgK0sMLow < v0.mK0Short() && v0.mK0Short() < k0sSelCut.cfgK0sMHigh && k0sSelCut.cfgK0sLowPt < v0.pt() && v0.pt() < k0sSelCut.cfgK0sHighPt && @@ -1323,7 +1323,7 @@ struct KaonIsospinFluctuations { } template - void findRepeatedEntries(std::vector ParticleList, T hist) + void findRepeatedEntries(std::vector ParticleList, const T& hist) { for (uint ii = 0; ii < ParticleList.size(); ii++) { int nCommonCount = 0; // checking the repeat number of track @@ -1441,7 +1441,7 @@ struct KaonIsospinFluctuations { } template - void fillTrackQA(T track) + void fillTrackQA(const T& track) { // FullTrack recoTracks.fill(HIST(HistRegDire[Mode]) + HIST("h01_p"), track.p()); diff --git a/PWGCF/EbyEFluctuations/Tasks/radialFlowDecorr.cxx b/PWGCF/EbyEFluctuations/Tasks/radialFlowDecorr.cxx index cded5d14896..5dad493b413 100644 --- a/PWGCF/EbyEFluctuations/Tasks/radialFlowDecorr.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/radialFlowDecorr.cxx @@ -1205,7 +1205,7 @@ struct RadialFlowDecorr { LOGF(info, "Loading Eff/Fake maps from TList for all species..."); auto loadEffFakeForPID = [&](PIDIdx pidType) { - std::string suffix = pidSuffix[pidType]; + const std::string& suffix = pidSuffix[pidType]; std::string hEffNumName = "h3_RecoMatchedToPrimary" + suffix; std::string hEffDenName = "h3_AllPrimary" + suffix; std::string hFakeNumSecName = "h3_RecoUnMatchedToPrimary_Secondary" + suffix; @@ -1262,7 +1262,7 @@ struct RadialFlowDecorr { } LOGF(info, "Performing 2D Gaussian fits on PID maps from CCDB..."); auto loadPIDMeans = [&](PIDIdx pidType) { - std::string suffix = pidSuffix[pidType]; + const std::string& suffix = pidSuffix[pidType]; std::string hName = "h3DnsigmaTpcVsTofBefCut_Cent" + suffix; auto* h3 = reinterpret_cast(pidList->FindObject(hName.c_str())); if (!h3) { @@ -1327,7 +1327,7 @@ struct RadialFlowDecorr { if (lstDataFlat) { for (int i = 0; i < KNsp; ++i) { - std::string suffix = pidSuffix[i]; + const std::string& suffix = pidSuffix[i]; std::string hName; if (cfgEff && cfgFlat) { @@ -1356,7 +1356,7 @@ struct RadialFlowDecorr { if (lstMCFlat) { auto loadFlatForPID = [&](PIDIdx pidType) { - std::string suffix = pidSuffix[pidType]; + const std::string& suffix = pidSuffix[pidType]; std::string hFlatSrcName; if (cfgEff && cfgFlat) { hFlatSrcName = "MCReco/hEtaPhiRecoWtd" + suffix; diff --git a/PWGCF/EbyEFluctuations/Tasks/v0ptHadPiKaProt.cxx b/PWGCF/EbyEFluctuations/Tasks/v0ptHadPiKaProt.cxx index cad391d55a1..019fd1855ea 100644 --- a/PWGCF/EbyEFluctuations/Tasks/v0ptHadPiKaProt.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/v0ptHadPiKaProt.cxx @@ -990,7 +990,7 @@ struct V0ptHadPiKaProt { } template - int getNsigmaPID(TTrack track) + int getNsigmaPID(const TTrack& track) { // Computing Nsigma arrays for pion, kaon, and protons std::array nSigmaTPC = {track.tpcNSigmaPi(), track.tpcNSigmaKa(), track.tpcNSigmaPr()}; @@ -1041,7 +1041,7 @@ struct V0ptHadPiKaProt { // additional multiplicity correlation based event selection cuts template - bool eventSelectedSmallion(TCollision collision, const int multTrk, const float centrality) + bool eventSelectedSmallion(const TCollision& collision, const int multTrk, const float centrality) { auto multNTracksPV = collision.multNTracksPV(); @@ -1083,7 +1083,7 @@ struct V0ptHadPiKaProt { } template - bool eventSelectionDefaultCuts(TCollision coll) + bool eventSelectionDefaultCuts(const TCollision& coll) { histos.fill(HIST("hEventStatData"), 0.5); if (!coll.sel8()) { diff --git a/PWGCF/Femto3D/Tasks/femto3dPairTask.cxx b/PWGCF/Femto3D/Tasks/femto3dPairTask.cxx index 183c2e24d05..4d08256aa4b 100644 --- a/PWGCF/Femto3D/Tasks/femto3dPairTask.cxx +++ b/PWGCF/Femto3D/Tasks/femto3dPairTask.cxx @@ -356,8 +356,8 @@ struct FemtoCorrelations { if (_fill3dCF && multBin > SEhistos_3D.size()) LOGF(fatal, "multBin value passed to the mixTracks function exceeds the configured number of Cent. bins (3D)"); - for (auto ii : tracks1) { - for (auto iii : tracks2) { + for (const auto& ii : tracks1) { + for (const auto& iii : tracks2) { Pair->SetPair(ii, iii); float pair_kT = Pair->GetKt(); diff --git a/PWGCF/Femto3D/Tasks/femto3dPairTaskMC.cxx b/PWGCF/Femto3D/Tasks/femto3dPairTaskMC.cxx index 827494f94f3..f1c96a319cd 100644 --- a/PWGCF/Femto3D/Tasks/femto3dPairTaskMC.cxx +++ b/PWGCF/Femto3D/Tasks/femto3dPairTaskMC.cxx @@ -118,14 +118,16 @@ struct FemtoCorrelationsMC { using FilteredTracks = soa::Join; // using FilteredTracks = soa::Join; - typedef std::shared_ptr::iterator> trkType; - typedef std::shared_ptr::iterator> colType; + using TrackType = const soa::Filtered::iterator; + using TrackTypePtr = std::shared_ptr; + using ColType = const soa::Filtered::iterator; + using ColTypePtr = std::shared_ptr; - std::map> selectedtracks_1; - std::map> selectedtracks_2; - std::map, std::vector> mixbins; + std::map> selectedtracks_1; + std::map> selectedtracks_2; + std::map, std::vector> mixbins; - std::unique_ptr> Pair = std::make_unique>(); + std::unique_ptr> Pair = std::make_unique>(); Filter pFilter = o2::aod::singletrackselector::p > _min_P&& o2::aod::singletrackselector::p < _max_P; Filter etaFilter = nabs(o2::aod::singletrackselector::eta) < _eta; @@ -283,8 +285,8 @@ struct FemtoCorrelationsMC { template void fillEtaPhi(Type const& tracks1, Type const& tracks2, unsigned int centBin) { // template for particles from the same collision non-identical - for (auto ii : tracks1) { - for (auto iii : tracks2) { + for (const auto& ii : tracks1) { + for (const auto& iii : tracks2) { Pair->SetPair(ii, iii); float pair_kT = Pair->GetKt(); @@ -307,8 +309,8 @@ struct FemtoCorrelationsMC { template void fillResMatrix(Type const& tracks1, Type const& tracks2, unsigned int centBin) { // template for ME - for (auto ii : tracks1) { - for (auto iii : tracks2) { + for (const auto& ii : tracks1) { + for (const auto& iii : tracks2) { Pair->SetPair(ii, iii); float pair_kT = Pair->GetKt(); @@ -344,7 +346,7 @@ struct FemtoCorrelationsMC { int trackPDG, trackOrigin; - for (auto track : tracks) { + for (const auto& track : tracks) { if (std::fabs(track.template singleCollSel_as>().posZ()) > _vertexZ) continue; if (track.tpcFractionSharedCls() > _tpcFractionSharedCls || track.itsNCls() < _itsNCls) @@ -385,7 +387,7 @@ struct FemtoCorrelationsMC { if (trackPDG == 11 || trackPDG == 13 || trackPDG == 211 || trackPDG == 321 || trackPDG == 2212 || trackPDG == 1000010020) Purity_histos_1[centBin][trackPDG]->Fill(track.p()); - selectedtracks_1[track.singleCollSelId()].push_back(std::make_shared(track)); // filling the map: eventID <-> selected particles1 + selectedtracks_1[track.singleCollSelId()].push_back(std::make_shared(track)); // filling the map: eventID <-> selected particles1 } if (IsIdentical) { @@ -406,11 +408,11 @@ struct FemtoCorrelationsMC { if (trackPDG == 11 || trackPDG == 13 || trackPDG == 211 || trackPDG == 321 || trackPDG == 2212 || trackPDG == 1000010020) Purity_histos_2[centBin][trackPDG]->Fill(track.p()); - selectedtracks_2[track.singleCollSelId()].push_back(std::make_shared(track)); // filling the map: eventID <-> selected particles2 + selectedtracks_2[track.singleCollSelId()].push_back(std::make_shared(track)); // filling the map: eventID <-> selected particles2 } } - for (auto collision : collisions) { + for (const auto& collision : collisions) { if (collision.multPerc() < *_centBins.value.begin() || collision.multPerc() >= *(_centBins.value.end() - 1)) continue; if (collision.hadronicRate() < _IRcut.value.first || collision.hadronicRate() >= _IRcut.value.second) @@ -440,7 +442,7 @@ struct FemtoCorrelationsMC { int vertexBinToMix = std::floor((collision.posZ() + _vertexZ) / (2 * _vertexZ / _vertexNbinsToMix)); float centBinToMix = o2::aod::singletrackselector::getBinIndex(collision.multPerc(), _centBins, _multNsubBins); - mixbins[std::pair{vertexBinToMix, centBinToMix}].push_back(std::make_shared(collision)); + mixbins[std::pair{vertexBinToMix, centBinToMix}].push_back(std::make_shared(collision)); } //====================================== filling deta(dphi*) & res. matrix starts here ====================================== diff --git a/PWGCF/Femto3D/Tools/checkPacking.cxx b/PWGCF/Femto3D/Tools/checkPacking.cxx index 50a1c4cd60a..085f9825d31 100644 --- a/PWGCF/Femto3D/Tools/checkPacking.cxx +++ b/PWGCF/Femto3D/Tools/checkPacking.cxx @@ -30,7 +30,7 @@ using namespace o2; template -bool process(const TString outputName, const int nevents = 100000) +bool process(const TString& outputName, const int nevents = 100000) { class Container { diff --git a/PWGCF/FemtoDream/Core/femtoDreamCollisionSelection.h b/PWGCF/FemtoDream/Core/femtoDreamCollisionSelection.h index 542de338734..c958a4d9af0 100644 --- a/PWGCF/FemtoDream/Core/femtoDreamCollisionSelection.h +++ b/PWGCF/FemtoDream/Core/femtoDreamCollisionSelection.h @@ -31,6 +31,7 @@ #include #include #include +#include #include namespace o2::analysis::femtoDream @@ -420,7 +421,7 @@ class FemtoDreamCollisionSelection // add a param : bool doFillHisto ? int myqnBin(float centrality, float centMax, bool doFillCent, std::vector qnBinSeparator, float qn, const int numQnBins, float centBinWidth = 1.f) { - auto twoDSeparator = getQnBinSeparator2D(qnBinSeparator, numQnBins); + auto twoDSeparator = getQnBinSeparator2D(std::move(qnBinSeparator), numQnBins); if (twoDSeparator.empty() || twoDSeparator[0][0] == -999.) { LOGP(warning, "ConfQnBinSeparator not set, using default fallback!"); return -999; // safe fallback diff --git a/PWGCF/FemtoDream/Core/femtoDreamContainer.h b/PWGCF/FemtoDream/Core/femtoDreamContainer.h index a245e9b22e5..98daa9eb00f 100644 --- a/PWGCF/FemtoDream/Core/femtoDreamContainer.h +++ b/PWGCF/FemtoDream/Core/femtoDreamContainer.h @@ -32,6 +32,7 @@ #include #include +#include #include namespace o2::analysis::femtoDream @@ -75,7 +76,7 @@ class FemtoDreamContainer /// \param mTAxis axis object for the mT axis template - void init_base(std::string folderName, std::string femtoObs, + void init_base(const std::string& folderName, const std::string& femtoObs, T& femtoObsAxis, T& pTAxis, T& kTAxis, T& mTAxis, T& multAxis, T& multPercentileAxis, T& /*kstarAxis4D*/, T& mTAxis4D, T& multAxis4D, T& multPercentileAxis4D, bool use4dplots, bool extendedplots, T& mP2Axis) @@ -108,7 +109,7 @@ class FemtoDreamContainer /// \param folderName Name of the directory in the output file (no suffix for reconstructed data/ Monte Carlo; "_MC" for Monte Carlo Truth) /// \param femtoObsAxis axis object for the femto observable axis template - void init_MC(std::string folderName, std::string femtoObs, T femtoObsAxis, T multAxis, T mTAxis, bool smearingByOrigin) + void init_MC(const std::string& folderName, const std::string& femtoObs, T femtoObsAxis, T multAxis, T mTAxis, bool smearingByOrigin) { mHistogramRegistry->add((folderName + "/relPairDist_ReconNoFake").c_str(), ("; " + femtoObs + "; Entries").c_str(), o2::framework::HistType::kTH1F, {femtoObsAxis}); mHistogramRegistry->add((folderName + "/relPairkstarmT_ReconNoFake").c_str(), ("; " + femtoObs + "; #it{m}_{T} (GeV/#it{c}^{2})").c_str(), o2::framework::HistType::kTH2F, {femtoObsAxis, mTAxis}); @@ -161,7 +162,7 @@ class FemtoDreamContainer framework::AxisSpec multAxis4D = {multBins4D, "Multiplicity"}; framework::AxisSpec multPercentileAxis4D = {multPercentileBins4D, "Multiplicity Percentile (%)"}; - framework::AxisSpec mP2Axis = {invMassBin, "Mass (GeV)"}; + framework::AxisSpec mP2Axis = {std::move(invMassBin), "Mass (GeV)"}; std::string folderName = static_cast(mFolderSuffix[mEventType]) + static_cast(o2::aod::femtodreamMCparticle::MCTypeName[o2::aod::femtodreamMCparticle::MCType::kRecon]); @@ -182,8 +183,8 @@ class FemtoDreamContainer /// Initialize the histograms for pairs in divided qn or phi-psi bins template - void init_base_EP(std::string folderName, std::string femtoObs, - T& femtoObsAxis, T& mTAxi4D, T& multPercentileAxis4D, T& epObsAxis, std::string epObs) + void init_base_EP(const std::string& folderName, const std::string& femtoObs, + T& femtoObsAxis, T& mTAxi4D, T& multPercentileAxis4D, T& epObsAxis, const std::string& epObs) { mHistogramRegistry->add((folderName + "/relPairkstarmTMultMultPercentileQn").c_str(), ("; " + femtoObs + "; #it{m}_{T} (GeV/#it{c}); Centrality;" + epObs).c_str(), o2::framework::HistType::kTHnSparseF, {femtoObsAxis, mTAxi4D, multPercentileAxis4D, epObsAxis}); } @@ -219,14 +220,14 @@ class FemtoDreamContainer /// Initialize the histograms for pairs with 3D component in divided qn bins template - void init_base_3Dqn(std::string folderName, std::string femtoDKout, std::string femtoDKside, std::string femtoDKlong, + void init_base_3Dqn(const std::string& folderName, const std::string& femtoDKout, const std::string& femtoDKside, const std::string& femtoDKlong, T& femtoDKoutAxis, T& femtoDKsideAxis, T& femtoDKlongAxis, T& mTAxi4D, T& multPercentileAxis4D, T& qnAxis, T& pairPhiAxis) { mHistogramRegistry->add((folderName + "/relPair3dRmTMultPercentileQnPairphi").c_str(), ("; " + femtoDKout + femtoDKside + femtoDKlong + "; #it{m}_{T} (GeV/#it{c}); Centrality; qn; #varphi_{pair} - #Psi_{EP}").c_str(), o2::framework::HistType::kTHnSparseF, {femtoDKoutAxis, femtoDKsideAxis, femtoDKlongAxis, mTAxi4D, multPercentileAxis4D, qnAxis, pairPhiAxis}); } template - void init_3Dqn_MC(std::string folderName, std::string femtoDKout, std::string femtoDKside, std::string femtoDKlong, + void init_3Dqn_MC(const std::string& folderName, const std::string& femtoDKout, const std::string& femtoDKside, const std::string& femtoDKlong, T& femtoDKoutAxis, T& femtoDKsideAxis, T& femtoDKlongAxis, bool smearingByOrigin = false) { mHistogramRegistry->add((folderName + "/hNoMCtruthPairsCounter").c_str(), "; Counter; Entries", o2::framework::HistType::kTH1I, {{1, 0, 1}}); @@ -257,8 +258,8 @@ class FemtoDreamContainer framework::AxisSpec DKlongAxis = {DKlongBins, femtoObsDKlong}; framework::AxisSpec mTAxis4D = {mTBins4D, "#it{m}_{T} (GeV/#it{c})"}; framework::AxisSpec multPercentileAxis4D = {multPercentileBins4D, "Centralty(%)"}; - framework::AxisSpec qnAxis = {qnBins, "qn"}; - framework::AxisSpec pairPhiAxis = {pairPhiBins, "#varphi_{pair} - #Psi_{EP} (rad)"}; + framework::AxisSpec qnAxis = {std::move(qnBins), "qn"}; + framework::AxisSpec pairPhiAxis = {std::move(pairPhiBins), "#varphi_{pair} - #Psi_{EP} (rad)"}; std::string folderName = static_cast(mFolderSuffix[mEventType]) + static_cast(o2::aod::femtodreamMCparticle::MCTypeName[o2::aod::femtodreamMCparticle::MCType::kRecon]) + static_cast("_3Dqn"); diff --git a/PWGCF/FemtoDream/Core/femtoDreamContainerThreeBody.h b/PWGCF/FemtoDream/Core/femtoDreamContainerThreeBody.h index b82ff3f1b59..b291cbe82d7 100644 --- a/PWGCF/FemtoDream/Core/femtoDreamContainerThreeBody.h +++ b/PWGCF/FemtoDream/Core/femtoDreamContainerThreeBody.h @@ -68,7 +68,7 @@ class FemtoDreamContainerThreeBody /// \param femtoObsAxis axis object for the femto observable axis /// \param multAxis axis object for the multiplicity axis template - void init_base(std::string folderName, std::string femtoObs, T femtoObsAxis, T multAxis) + void init_base(const std::string& folderName, const std::string& femtoObs, T femtoObsAxis, T multAxis) { mHistogramRegistry->add((folderName + "/relTripletDist").c_str(), ("; " + femtoObs + "; Entries").c_str(), o2::framework::HistType::kTH1F, {femtoObsAxis}); @@ -85,7 +85,7 @@ class FemtoDreamContainerThreeBody /// \param folderName Name of the directory in the output file (no suffix for reconstructed data/ Monte Carlo; "_MC" for Monte Carlo Truth) /// \param femtoObsAxis axis object for the femto observable axis template - void init_MC(std::string folderName, std::string femtoObs, T femtoObsAxis, T multAxis) + void init_MC(const std::string& folderName, const std::string& femtoObs, T femtoObsAxis, T multAxis) { mHistogramRegistry->add((folderName + "/relTripletDist_ReconNoFake").c_str(), ("; " + femtoObs + "; Entries").c_str(), o2::framework::HistType::kTH1F, {femtoObsAxis}); mHistogramRegistry->add((folderName + "/relTripletQ3Mult_ReconNoFake").c_str(), ("; " + femtoObs + "; Multiplicity").c_str(), o2::framework::HistType::kTH2F, {femtoObsAxis, multAxis}); diff --git a/PWGCF/FemtoDream/Core/femtoDreamParticleHisto.h b/PWGCF/FemtoDream/Core/femtoDreamParticleHisto.h index f28116655df..096b9bb7b28 100644 --- a/PWGCF/FemtoDream/Core/femtoDreamParticleHisto.h +++ b/PWGCF/FemtoDream/Core/femtoDreamParticleHisto.h @@ -57,7 +57,7 @@ class FemtoDreamParticleHisto /// \param tempFitVarpTAxis axis object for the pT axis in the pT vs. tempFitVar plots /// \param tempFitVarAxis axis object for the tempFitVar axis template - void init_base(std::string folderName, std::string tempFitVarAxisTitle, T& pTAxis, T& tempFitVarAxis, T& InvMassAxis, T& /*multAxis*/) + void init_base(const std::string& folderName, const std::string& tempFitVarAxisTitle, T& pTAxis, T& tempFitVarAxis, T& InvMassAxis, T& /*multAxis*/) { std::string folderSuffix = static_cast(o2::aod::femtodreamMCparticle::MCTypeName[mc]).c_str(); /// Histograms of the kinematic properties @@ -99,7 +99,7 @@ class FemtoDreamParticleHisto // comment template - void init_debug(std::string folderName, T& multAxis, T& multPercentileAxis, T& pTAxis, T& etaAxis, T& phiAxis, T& tempFitVarAxis, T& dcazAxis, T& NsigmaTPCAxis, T& NsigmaTOFAxis, T& NsigmaTPCTOFAxis, T& NsigmaITSAxis, T& InvMassCompetingAxis, bool correlatedPlots) + void init_debug(const std::string& folderName, T& multAxis, T& multPercentileAxis, T& pTAxis, T& etaAxis, T& phiAxis, T& tempFitVarAxis, T& dcazAxis, T& NsigmaTPCAxis, T& NsigmaTOFAxis, T& NsigmaTPCTOFAxis, T& NsigmaITSAxis, T& InvMassCompetingAxis, bool correlatedPlots) { std::string folderSuffix = static_cast(o2::aod::femtodreamMCparticle::MCTypeName[mc]).c_str(); @@ -207,7 +207,7 @@ class FemtoDreamParticleHisto /// \param tempFitVarpTAxis axis object for the pT axis in the pT vs. tempFitVar plots /// \param tempFitVarAxis axis object for the tempFitVar axis template - void init_MC(std::string folderName, std::string /*tempFitVarAxisTitle*/, T& tempFitVarpTAxis, T& tempFitVarAxis, T& dcazAxis, T& multAxis, bool isDebug) + void init_MC(const std::string& folderName, const std::string& /*tempFitVarAxisTitle*/, T& tempFitVarpTAxis, T& tempFitVarAxis, T& dcazAxis, T& multAxis, bool isDebug) { /// Particle-type specific histograms std::string folderSuffix = static_cast(o2::aod::femtodreamMCparticle::MCTypeName[o2::aod::femtodreamMCparticle::MCType::kTruth]).c_str(); diff --git a/PWGCF/FemtoDream/TableProducer/femtoDreamProducerReducedTask.cxx b/PWGCF/FemtoDream/TableProducer/femtoDreamProducerReducedTask.cxx index a35faf8c8a7..8d401c41226 100644 --- a/PWGCF/FemtoDream/TableProducer/femtoDreamProducerReducedTask.cxx +++ b/PWGCF/FemtoDream/TableProducer/femtoDreamProducerReducedTask.cxx @@ -161,7 +161,7 @@ struct femtoDreamProducerReducedTask { } /// Function to retrieve the nominal magnetic field in kG (0.1T) and convert it directly to T - void getMagneticFieldTesla(aod::BCsWithTimestamps::iterator bc) + void getMagneticFieldTesla(const aod::BCsWithTimestamps::iterator& bc) { // TODO done only once (and not per run). Will be replaced by CCDBConfigurable // get magnetic field for run diff --git a/PWGCF/FemtoDream/TableProducer/femtoDreamProducerTask.cxx b/PWGCF/FemtoDream/TableProducer/femtoDreamProducerTask.cxx index bb88a135cb2..675419459da 100644 --- a/PWGCF/FemtoDream/TableProducer/femtoDreamProducerTask.cxx +++ b/PWGCF/FemtoDream/TableProducer/femtoDreamProducerTask.cxx @@ -487,7 +487,7 @@ struct femtoDreamProducerTask { } /// Function to retrieve the nominal magnetic field in kG (0.1T) and convert it directly to T - void initCCDB_Mag_Trig(aod::BCsWithTimestamps::iterator bc) + void initCCDB_Mag_Trig(const aod::BCsWithTimestamps::iterator& bc) { // TODO done only once (and not per run). Will be replaced by CCDBConfigurable // get magnetic field for run @@ -669,7 +669,7 @@ struct femtoDreamProducerTask { // list of mothers is not empty } else if (particleMC.getProcess() == 4 && particleMC.getGenStatusCode() == -1 && !motherparticlesMC.empty()) { // get direct mother - auto motherparticleMC = motherparticlesMC.front(); + const auto& motherparticleMC = motherparticlesMC.front(); pdgCodeMother = motherparticleMC.pdgCode(); TrackRegistry.fill(HIST("AnalysisQA/Mother"), pdgCodeMother); particleOrigin = checkDaughterType(fdparttype, motherparticleMC.pdgCode(), pdgCode); diff --git a/PWGCF/FemtoDream/TableProducer/femtoDreamProducerTaskForSpecificAnalysis.cxx b/PWGCF/FemtoDream/TableProducer/femtoDreamProducerTaskForSpecificAnalysis.cxx index d808767c9db..5e8b6290672 100644 --- a/PWGCF/FemtoDream/TableProducer/femtoDreamProducerTaskForSpecificAnalysis.cxx +++ b/PWGCF/FemtoDream/TableProducer/femtoDreamProducerTaskForSpecificAnalysis.cxx @@ -371,7 +371,7 @@ struct FemtoDreamProducerTaskForSpecificAnalysis { /// @param groupSelectedV0s partition for the second particle passed by the process function /// @param parts femtoDreamParticles table template - void createSpecifiedDerivedData(const o2::aod::FDCollision& col, PartitionType groupSelectedTracks, PartitionType groupSelectedV0s, PartType parts) + void createSpecifiedDerivedData(const o2::aod::FDCollision& col, const PartitionType& groupSelectedTracks, const PartitionType& groupSelectedV0s, const PartType& parts) { /// check tracks int tracksCount = 0; @@ -512,7 +512,7 @@ struct FemtoDreamProducerTaskForSpecificAnalysis { /// @param groupSelectedV0s partition for the second particle passed by the process function /// @param parts femtoDreamParticles table template - void createSpecifiedDerivedDataTrkCascade(const o2::aod::FDCollision& col, PartitionType groupSelectedTracks, PartitionType groupSelectedCascades, PartType parts) + void createSpecifiedDerivedDataTrkCascade(const o2::aod::FDCollision& col, const PartitionType& groupSelectedTracks, const PartitionType& groupSelectedCascades, const PartType& parts) { /// check tracks @@ -592,7 +592,7 @@ struct FemtoDreamProducerTaskForSpecificAnalysis { /// @param groupSelectedV0s partition for the second particle passed by the process function /// @param parts femtoDreamParticles table template - void createSpecifiedDerivedDataV0Cascade(const o2::aod::FDCollision& col, PartitionType groupSelectedV0s, PartitionType groupSelectedCascades, PartType parts) + void createSpecifiedDerivedDataV0Cascade(const o2::aod::FDCollision& col, const PartitionType& groupSelectedV0s, const PartitionType& groupSelectedCascades, const PartType& parts) { /// check V0s @@ -634,7 +634,7 @@ struct FemtoDreamProducerTaskForSpecificAnalysis { PROCESS_SWITCH(FemtoDreamProducerTaskForSpecificAnalysis, processCollisionsWithNV0sAndNCascades, "Enable producing data with ppp collisions for data", false); template - void createSpecifiedDerivedDataV0Phi(const o2::aod::FDCollision& col, PartitionType groupSelectedV0s, PartitionType groupSelectedResos, PartType parts) + void createSpecifiedDerivedDataV0Phi(const o2::aod::FDCollision& col, const PartitionType& groupSelectedV0s, const PartitionType& groupSelectedResos, const PartType& parts) { // check v0's int v0Count = 0; @@ -792,7 +792,7 @@ struct FemtoDreamProducerTaskForSpecificAnalysis { PROCESS_SWITCH(FemtoDreamProducerTaskForSpecificAnalysis, processCollisionsWithNV0AndNPhi, "Enable producing data with pp collisions for data v0-reso", true); template - void createSpecifiedDerivedDataK0ShortKStar(const o2::aod::FDCollision& col, PartitionType groupSelectedV0s, PartitionType groupSelectedResos, PartType parts) + void createSpecifiedDerivedDataK0ShortKStar(const o2::aod::FDCollision& col, const PartitionType& groupSelectedV0s, const PartitionType& groupSelectedResos, const PartType& parts) { // check v0's int v0Count = 0; @@ -954,7 +954,7 @@ struct FemtoDreamProducerTaskForSpecificAnalysis { /// For that, this function is created. /// For eventual future changes of femtoDreamProducerTaskReso.cxx, createSpecifiedDerivedDataK0ShortKStar() is kept as it is template - void createSpecifiedDerivedDataK0ShortKStarLegacy(const o2::aod::FDCollision& col, PartitionType groupSelectedV0s, PartitionType groupSelectedResos, PartType parts) + void createSpecifiedDerivedDataK0ShortKStarLegacy(const o2::aod::FDCollision& col, const PartitionType& groupSelectedV0s, const PartitionType& groupSelectedResos, const PartType& parts) { // check v0's int v0Count = 0; @@ -1119,7 +1119,7 @@ struct FemtoDreamProducerTaskForSpecificAnalysis { PROCESS_SWITCH(FemtoDreamProducerTaskForSpecificAnalysis, createSpecifiedDerivedDataNK0ShortNKStarLegacy, "Enable producing data with pp collisions for data K0Short-KStar with kV0Child/KResoChild daughter types", false); template - void createSpecifiedDerivedDataK0ShortKStarFromMothers(const o2::aod::FDCollision& col, PartitionType groupSelectedV0s, PartitionType groupSelectedResos, PartType parts) + void createSpecifiedDerivedDataK0ShortKStarFromMothers(const o2::aod::FDCollision& col, const PartitionType& groupSelectedV0s, const PartitionType& groupSelectedResos, const PartType& parts) { // check v0's int v0Count = 0; diff --git a/PWGCF/FemtoDream/TableProducer/femtoDreamProducerTaskReso.cxx b/PWGCF/FemtoDream/TableProducer/femtoDreamProducerTaskReso.cxx index 03779b09ed9..3bab4b2fb72 100644 --- a/PWGCF/FemtoDream/TableProducer/femtoDreamProducerTaskReso.cxx +++ b/PWGCF/FemtoDream/TableProducer/femtoDreamProducerTaskReso.cxx @@ -733,7 +733,7 @@ struct FemtoDreamProducerTaskReso { } /// Function to retrieve the nominal magnetic field in kG (0.1T) and convert it directly to T - void initCcdbMagTrig(aod::BCsWithTimestamps::iterator bc) + void initCcdbMagTrig(const aod::BCsWithTimestamps::iterator& bc) { // TODO done only once (and not per run). Will be replaced by CCDBConfigurable // get magnetic field for run @@ -925,7 +925,7 @@ struct FemtoDreamProducerTaskReso { // list of mothers is not empty } else if (particleMC.getProcess() == ProcessDirectMother && particleMC.getGenStatusCode() == GenStatusTransport && !motherparticlesMC.empty()) { // get direct mother - auto motherparticleMC = motherparticlesMC.front(); + const auto& motherparticleMC = motherparticlesMC.front(); pdgCodeMother = motherparticleMC.pdgCode(); trackRegistry.fill(HIST("AnalysisQA/Mother"), pdgCodeMother); particleOrigin = checkDaughterType(fdparttype, motherparticleMC.pdgCode(), pdgCode); diff --git a/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskTrackCascade.cxx b/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskTrackCascade.cxx index 35c5b4a64a1..1c793e973e3 100644 --- a/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskTrackCascade.cxx +++ b/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskTrackCascade.cxx @@ -262,7 +262,7 @@ struct femtoDreamPairTaskTrackCascade { } template - bool checkChildCuts(PartType posChild, PartType negChild, PartType bachChild) + bool checkChildCuts(const PartType& posChild, const PartType& negChild, const PartType& bachChild) { bool passCuts = true; @@ -375,7 +375,7 @@ struct femtoDreamPairTaskTrackCascade { PROCESS_SWITCH(femtoDreamPairTaskTrackCascade, processSameEventMC, "Enable processing same event with Monte Carlo", false); template - void doMixedEvent(CollisionType const& cols, PartType const& parts, PartitionType& part1, PartitionType& part2, BinningType policy) + void doMixedEvent(CollisionType const& cols, PartType const& parts, PartitionType& part1, PartitionType& part2, const BinningType& policy) { // Partition PartitionMaskedCol = ncheckbit(aod::femtodreamcollision::bitmaskTrackOne, BitMask) && ncheckbit(aod::femtodreamcollision::bitmaskTrackTwo, BitMask);// && aod::femtodreamcollision::downsample == true; // PartitionMaskedCol.bindTable(cols); diff --git a/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskTrackTrack.cxx b/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskTrackTrack.cxx index 5c087e14033..22e69c80e49 100644 --- a/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskTrackTrack.cxx +++ b/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskTrackTrack.cxx @@ -398,7 +398,7 @@ struct femtoDreamPairTaskTrackTrack { }; template - void fillCollision(CollisionType col) + void fillCollision(const CollisionType& col) { eventHisto.fillQA(col); } @@ -414,7 +414,7 @@ struct femtoDreamPairTaskTrackTrack { /// @param magFieldTesla magnetic field of the collision /// @param multCol multiplicity of the collision template - void doSameEvent(PartitionType SliceTrk1, PartitionType SliceTrk2, PartType parts, Collision col) + void doSameEvent(const PartitionType& SliceTrk1, const PartitionType& SliceTrk2, const PartType& parts, const Collision& col) { for (auto& part : SliceTrk1) { trackHistoPartOne.fillQA(part, aod::femtodreamparticle::kPt, col.multNtr(), col.multV0M()); @@ -536,7 +536,7 @@ struct femtoDreamPairTaskTrackTrack { PROCESS_SWITCH(femtoDreamPairTaskTrackTrack, processSameEventMCMasked, "Enable processing same event for Monte Carlo with masked collisions", false); template - void doMixedEvent_NotMasked(CollisionType& cols, PartType& parts, PartitionType& part1, PartitionType& part2, BinningType policy) + void doMixedEvent_NotMasked(CollisionType& cols, PartType& parts, PartitionType& part1, PartitionType& part2, const BinningType& policy) { for (auto const& [collision1, collision2] : soa::selfCombinations(policy, Mixing.Depth.value, -1, cols, cols)) { auto SliceTrk1 = part1->sliceByCached(aod::femtodreamparticle::fdCollisionId, collision1.globalIndex(), cache); @@ -705,7 +705,7 @@ struct femtoDreamPairTaskTrackTrack { /// This function processes the same event in divided qn bins /// col.multV0M() get the event centrality from ft0c for PbPb data template - void doSameEventEP(PartitionType SliceTrk1, PartitionType SliceTrk2, PartType parts, Collision col) + void doSameEventEP(const PartitionType& SliceTrk1, const PartitionType& SliceTrk2, const PartType& parts, const Collision& col) { if (EPCal.storeEvtTrkInfo) { for (auto& part : SliceTrk1) { @@ -830,7 +830,7 @@ struct femtoDreamPairTaskTrackTrack { PROCESS_SWITCH(femtoDreamPairTaskTrackTrack, processSameEventEPMC, "Enable processing same event of 3D for Monte Carlo", false); template - void doMixedEvent_NotMaskedEP(CollisionType& cols, PartType& parts, PartitionType& part1, PartitionType& part2, BinningType policy) + void doMixedEvent_NotMaskedEP(CollisionType& cols, PartType& parts, PartitionType& part1, PartitionType& part2, const BinningType& policy) { for (auto const& [collision1, collision2] : soa::selfCombinations(policy, Mixing.Depth.value, -1, cols, cols)) { auto SliceTrk1 = part1->sliceByCached(aod::femtodreamparticle::fdCollisionId, collision1.globalIndex(), cache); diff --git a/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskTrackV0.cxx b/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskTrackV0.cxx index 9fec3723f24..da2559e82ba 100644 --- a/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskTrackV0.cxx +++ b/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskTrackV0.cxx @@ -388,7 +388,7 @@ struct femtoDreamPairTaskTrackV0 { PROCESS_SWITCH(femtoDreamPairTaskTrackV0, processSameEventMCMasked, "Enable processing same event MC with masks", false); template - void doMixedEvent_Masked(CollisionType const& cols, PartType const& parts, PartitionType& part1, PartitionType& part2, BinningType policy) + void doMixedEvent_Masked(CollisionType const& cols, PartType const& parts, PartitionType& part1, PartitionType& part2, const BinningType& policy) { if (Option.MixEventWithPairs.value) { diff --git a/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskV0Reso.cxx b/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskV0Reso.cxx index 905d692bee0..290682891c7 100644 --- a/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskV0Reso.cxx +++ b/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskV0Reso.cxx @@ -367,7 +367,7 @@ struct FemtoDreamPairTaskV0Reso { } template - void doMixedEvent(CollisionType const& cols, PartType const& parts, PartitionType& part1, PartitionType& part2, BinningType policy) + void doMixedEvent(CollisionType const& cols, PartType const& parts, PartitionType& part1, PartitionType& part2, const BinningType& policy) { if (Option.mixEventWithPairs.value) { diff --git a/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskV0V0.cxx b/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskV0V0.cxx index 234b44a8a38..82ba66ed43e 100644 --- a/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskV0V0.cxx +++ b/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskV0V0.cxx @@ -261,7 +261,7 @@ struct femtoDreamPairTaskV0V0 { }; template - void fillCollision(CollisionType col) + void fillCollision(const CollisionType& col) { eventHisto.fillQA(col); } @@ -277,7 +277,7 @@ struct femtoDreamPairTaskV0V0 { /// @param magFieldTesla magnetic field of the collision /// @param multCol multiplicity of the collision template - void doSameEvent(PartitionType SliceV01, PartitionType SliceV02, PartType parts, Collision col) + void doSameEvent(const PartitionType& SliceV01, const PartitionType& SliceV02, const PartType& parts, const Collision& col) { for (auto& v0 : SliceV01) { const auto& posChild = parts.iteratorAt(v0.index() - 2); @@ -365,7 +365,7 @@ struct femtoDreamPairTaskV0V0 { PROCESS_SWITCH(femtoDreamPairTaskV0V0, processSameEvent, "Enable processing same event", true); template - void doMixedEvent_NotMasked(CollisionType& cols, PartType& parts, PartitionType& part1, PartitionType& part2, BinningType policy) + void doMixedEvent_NotMasked(CollisionType& cols, PartType& parts, PartitionType& part1, PartitionType& part2, const BinningType& policy) { for (auto const& [collision1, collision2] : soa::selfCombinations(policy, Mixing.Depth.value, -1, cols, cols)) { auto SliceV01 = part1->sliceByCached(aod::femtodreamparticle::fdCollisionId, collision1.globalIndex(), cache); diff --git a/PWGCF/FemtoDream/Tasks/femtoDreamTripletTaskTrackTrackCascade.cxx b/PWGCF/FemtoDream/Tasks/femtoDreamTripletTaskTrackTrackCascade.cxx index 7460651def8..d1e127065f0 100644 --- a/PWGCF/FemtoDream/Tasks/femtoDreamTripletTaskTrackTrackCascade.cxx +++ b/PWGCF/FemtoDream/Tasks/femtoDreamTripletTaskTrackTrackCascade.cxx @@ -248,7 +248,7 @@ struct femtoDreamTripletTaskTrackTrackCascade { /// @param magFieldTesla magnetic field of the collision /// @param multCol multiplicity of the collision template - void doSameEvent(PartitionType groupSelectedTracks, PartitionType groupSelectedCascades, PartType parts, float magFieldTesla, int multCol, float centCol) + void doSameEvent(const PartitionType& groupSelectedTracks, const PartitionType& groupSelectedCascades, const PartType& parts, float magFieldTesla, int multCol, float centCol) { /// Histograming tracks for (auto& part : groupSelectedTracks) { @@ -357,7 +357,7 @@ struct femtoDreamTripletTaskTrackTrackCascade { /// \param magFieldTesla magnetic field of the collision /// \param multCol multiplicity of the collision template - void doMixedEvent(PartitionType groupPartsOne, PartitionType groupPartsTwo, PartitionType groupPartsThree, PartType parts, float magFieldTesla, int multCol) + void doMixedEvent(const PartitionType& groupPartsOne, const PartitionType& groupPartsTwo, const PartitionType& groupPartsThree, const PartType& parts, float magFieldTesla, int multCol) { for (auto& [T1, T2, casc] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo, groupPartsThree))) { const auto& posChild = parts.iteratorAt(casc.globalIndex() - 3); diff --git a/PWGCF/FemtoDream/Tasks/femtoDreamTripletTaskTrackTrackTrack.cxx b/PWGCF/FemtoDream/Tasks/femtoDreamTripletTaskTrackTrackTrack.cxx index 7af5db93467..1b5bf143300 100644 --- a/PWGCF/FemtoDream/Tasks/femtoDreamTripletTaskTrackTrackTrack.cxx +++ b/PWGCF/FemtoDream/Tasks/femtoDreamTripletTaskTrackTrackTrack.cxx @@ -218,7 +218,7 @@ struct femtoDreamTripletTaskTrackTrackTrack { } template - void fillCollision(CollisionType col) + void fillCollision(const CollisionType& col) { ThreeBodyQARegistry.fill(HIST("TripletTaskQA/hSECollisionBins"), colBinning.getBin({col.posZ(), col.multNtr()})); eventHisto.fillQA(col); @@ -233,7 +233,7 @@ struct femtoDreamTripletTaskTrackTrackTrack { /// @param magFieldTesla magnetic field of the collision /// @param multCol multiplicity of the collision template - void doSameEvent(PartitionType groupSelectedParts, PartType parts, float magFieldTesla, int multCol, float centCol) + void doSameEvent(const PartitionType& groupSelectedParts, const PartType& parts, float magFieldTesla, int multCol, float centCol) { /// Histogramming same event int numberOfTracksPassingSelection = 0; @@ -371,7 +371,7 @@ struct femtoDreamTripletTaskTrackTrackTrack { /// \param magFieldTesla magnetic field of the collision /// \param multCol multiplicity of the collision template - void doMixedEvent(PartitionType groupPartsOne, PartitionType groupPartsTwo, PartitionType groupPartsThree, PartType parts, float magFieldTesla, int multCol) + void doMixedEvent(const PartitionType& groupPartsOne, const PartitionType& groupPartsTwo, const PartitionType& groupPartsThree, const PartType& parts, float magFieldTesla, int multCol) { for (auto& [p1, p2, p3] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo, groupPartsThree))) { diff --git a/PWGCF/FemtoDream/Tasks/femtoDreamTripletTaskTrackTrackTrackPbPb.cxx b/PWGCF/FemtoDream/Tasks/femtoDreamTripletTaskTrackTrackTrackPbPb.cxx index a92d54332f8..8be1593da40 100644 --- a/PWGCF/FemtoDream/Tasks/femtoDreamTripletTaskTrackTrackTrackPbPb.cxx +++ b/PWGCF/FemtoDream/Tasks/femtoDreamTripletTaskTrackTrackTrackPbPb.cxx @@ -226,7 +226,7 @@ struct femtoDreamTripletTaskTrackTrackTrackPbPb { } template - void fillCollision(CollisionType col) + void fillCollision(const CollisionType& col) { ThreeBodyQARegistry.fill(HIST("TripletTaskQA/hSECollisionBins"), colBinning.getBin({col.posZ(), col.multNtr()})); eventHisto.fillQA(col); @@ -241,7 +241,7 @@ struct femtoDreamTripletTaskTrackTrackTrackPbPb { /// @param magFieldTesla magnetic field of the collision /// @param multCol multiplicity of the collision template - void doSameEvent(PartitionType groupSelectedParts, PartType parts, float magFieldTesla, int multCol, float centCol) + void doSameEvent(const PartitionType& groupSelectedParts, const PartType& parts, float magFieldTesla, int multCol, float centCol) { /// Histogramming same event int numberOfTracksPassingSelection = 0; @@ -379,7 +379,7 @@ struct femtoDreamTripletTaskTrackTrackTrackPbPb { /// \param magFieldTesla magnetic field of the collision /// \param multCol multiplicity of the collision template - void doMixedEvent(PartitionType groupPartsOne, PartitionType groupPartsTwo, PartitionType groupPartsThree, PartType parts, float magFieldTesla, int multCol) + void doMixedEvent(const PartitionType& groupPartsOne, const PartitionType& groupPartsTwo, const PartitionType& groupPartsThree, const PartType& parts, float magFieldTesla, int multCol) { for (auto& [p1, p2, p3] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo, groupPartsThree))) { diff --git a/PWGCF/FemtoDream/Tasks/femtoDreamTripletTaskTrackTrackV0.cxx b/PWGCF/FemtoDream/Tasks/femtoDreamTripletTaskTrackTrackV0.cxx index ce37fa91140..84bcb611cae 100644 --- a/PWGCF/FemtoDream/Tasks/femtoDreamTripletTaskTrackTrackV0.cxx +++ b/PWGCF/FemtoDream/Tasks/femtoDreamTripletTaskTrackTrackV0.cxx @@ -300,7 +300,7 @@ struct femtoDreamTripletTaskTrackTrackV0 { } template - void fillCollision(CollisionType col) + void fillCollision(const CollisionType& col) { ThreeBodyQARegistry.fill(HIST("TripletTaskQA/hSECollisionBins"), colBinning.getBin({col.posZ(), col.multNtr()})); eventHisto.fillQA(col); @@ -315,7 +315,7 @@ struct femtoDreamTripletTaskTrackTrackV0 { /// @param magFieldTesla magnetic field of the collision /// @param multCol multiplicity of the collision template - void doSameEvent(PartitionType groupSelectedTracks, PartitionType groupSelectedV0s, PartType parts, float magFieldTesla, int multCol, float centCol) + void doSameEvent(const PartitionType& groupSelectedTracks, const PartitionType& groupSelectedV0s, const PartType& parts, float magFieldTesla, int multCol, float centCol) { /// Histograming tracks for (auto& part : groupSelectedTracks) { @@ -543,7 +543,7 @@ struct femtoDreamTripletTaskTrackTrackV0 { /// \param magFieldTesla magnetic field of the collision /// \param multCol multiplicity of the collision template - void doMixedEvent(PartitionType groupPartsOne, PartitionType groupPartsTwo, PartitionType groupPartsThree, PartType parts, float magFieldTesla, int multCol) + void doMixedEvent(const PartitionType& groupPartsOne, const PartitionType& groupPartsTwo, const PartitionType& groupPartsThree, const PartType& parts, float magFieldTesla, int multCol) { for (auto& [T1, T2, V0] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo, groupPartsThree))) { const auto& posChild = parts.iteratorAt(V0.globalIndex() - 2); diff --git a/PWGCF/FemtoDream/Tasks/femtoDreamTripletTaskTrackTrackV0PbPb.cxx b/PWGCF/FemtoDream/Tasks/femtoDreamTripletTaskTrackTrackV0PbPb.cxx index f58c1deaf6e..e74ec599d5c 100644 --- a/PWGCF/FemtoDream/Tasks/femtoDreamTripletTaskTrackTrackV0PbPb.cxx +++ b/PWGCF/FemtoDream/Tasks/femtoDreamTripletTaskTrackTrackV0PbPb.cxx @@ -316,7 +316,7 @@ struct FemtoDreamTripletTaskTrackTrackV0PbPb { } template - void fillCollision(CollisionType col) + void fillCollision(const CollisionType& col) { threeBodyQARegistry.fill(HIST("TripletTaskQA/hSECollisionBins"), colBinning.getBin({col.posZ(), col.multNtr()})); eventHisto.fillQA(col); @@ -331,7 +331,7 @@ struct FemtoDreamTripletTaskTrackTrackV0PbPb { /// @param magFieldTesla magnetic field of the collision /// @param multCol multiplicity of the collision template - void doSameEvent(PartitionType groupSelectedTracks, PartitionType groupselectedV0s, PartType parts, float magFieldTesla, int multCol, float centCol) + void doSameEvent(const PartitionType& groupSelectedTracks, const PartitionType& groupselectedV0s, const PartType& parts, float magFieldTesla, int multCol, float centCol) { /// Histograming tracks for (const auto& part : groupSelectedTracks) { @@ -570,7 +570,7 @@ struct FemtoDreamTripletTaskTrackTrackV0PbPb { /// \param magFieldTesla magnetic field of the collision /// \param multCol multiplicity of the collision template - void doMixedEvent(PartitionType groupPartsOne, PartitionType groupPartsTwo, PartitionType groupPartsThree, PartType parts, float magFieldTesla, int multCol) + void doMixedEvent(const PartitionType& groupPartsOne, const PartitionType& groupPartsTwo, const PartitionType& groupPartsThree, const PartType& parts, float magFieldTesla, int multCol) { for (const auto& [T1, T2, V0] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo, groupPartsThree))) { const auto& posChild = parts.iteratorAt(V0.globalIndex() - 2); diff --git a/PWGCF/FemtoDream/Tasks/femtodreamPairCascadeCascade.cxx b/PWGCF/FemtoDream/Tasks/femtodreamPairCascadeCascade.cxx index ca4e27c7327..e68ed83f7d3 100644 --- a/PWGCF/FemtoDream/Tasks/femtodreamPairCascadeCascade.cxx +++ b/PWGCF/FemtoDream/Tasks/femtodreamPairCascadeCascade.cxx @@ -373,7 +373,7 @@ struct FemtoDreamPairCascadeCascade { // Mixed events template - void doMixedEvent(CollisionType const& cols, PartType const& parts, PartitionType& part1, PartitionType& part2, BinningType binPolicy) + void doMixedEvent(CollisionType const& cols, PartType const& parts, PartitionType& part1, PartitionType& part2, const BinningType& binPolicy) { for (auto const& [collision1, collision2] : soa::selfCombinations(binPolicy, Mixing.depth.value, -1, cols, cols)) { // make sure that tracks in same events are not mixed diff --git a/PWGCF/FemtoDream/Utils/femtoDreamCutCulator.h b/PWGCF/FemtoDream/Utils/femtoDreamCutCulator.h index 5e41fb5187f..a57164aafe6 100644 --- a/PWGCF/FemtoDream/Utils/femtoDreamCutCulator.h +++ b/PWGCF/FemtoDream/Utils/femtoDreamCutCulator.h @@ -80,7 +80,7 @@ class FemtoDreamCutculator /// returns an std::vector in the proper format \param name Name of the /// selection in the dpl-config.json \return std::vector that can be directly /// passed to the FemtoDreamTrack/V0/../Selection - std::vector setSelection(std::string name) + std::vector setSelection(const std::string& name) { try { boost::property_tree::ptree& selections = mConfigTree.get_child(name); @@ -357,7 +357,7 @@ class FemtoDreamCutculator /// This is the function called by the executable that then outputs the full /// selection bit-wise container incorporating the user choice of selections - void analyseCuts(std::string choice, bool SysChecks = false, float sign = 1) + void analyseCuts(const std::string& choice, bool SysChecks = false, float sign = 1) { aod::femtodreamparticle::cutContainerType output = -1; if (choice == std::string("T")) { diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverse3DContainer.h b/PWGCF/FemtoUniverse/Core/FemtoUniverse3DContainer.h index 5ebc096a908..1348d2f383c 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverse3DContainer.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverse3DContainer.h @@ -75,7 +75,7 @@ class FemtoUniverse3DContainer /// \param use3dplots Flag to fill 3D plots /// \param isiden Identical or non-identical particle pair template - void initBase(std::string folderName, std::string femtoObs1D, std::string femtoObsKout, std::string femtoObsKside, std::string femtoObsKlong, T femtoObsAxis1D, T femtoObsAxisOut, T femtoObsAxisSide, T femtoObsAxisLong, T multAxis, T kTAxis, T mTAxis, T multAxis3D, T mTAxis3D, bool use3dplots, bool isiden) + void initBase(const std::string& folderName, const std::string& femtoObs1D, const std::string& femtoObsKout, const std::string& femtoObsKside, const std::string& femtoObsKlong, T femtoObsAxis1D, T femtoObsAxisOut, T femtoObsAxisSide, T femtoObsAxisLong, T multAxis, T kTAxis, T mTAxis, T multAxis3D, T mTAxis3D, bool use3dplots, bool isiden) { mHistogramRegistry->add((folderName + "/relPairMom3D").c_str(), ("; " + femtoObsKout + "; " + femtoObsKside + "; " + femtoObsKlong).c_str(), o2::framework::HistType::kTH3F, {femtoObsAxisOut, femtoObsAxisSide, femtoObsAxisLong}); mHistogramRegistry->add((folderName + "/relPairMomOut").c_str(), ("; " + femtoObsKout + "; Entries").c_str(), o2::framework::HistType::kTH1F, {femtoObsAxisOut}); diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseAngularContainer.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseAngularContainer.h index 096446333e6..d6c9ae7c43c 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseAngularContainer.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseAngularContainer.h @@ -71,7 +71,7 @@ class FemtoUniverseAngularContainer /// \param kTAxis axis object for the kT axis /// \param mTAxis axis object for the mT axis template - void initBase(std::string folderName, std::string /*femtoObs*/, T /*femtoObsAxis*/, T /*multAxis*/, T /*kTAxis*/, T /*mTAxis*/, T /*multAxis3D*/, T /*mTAxis3D*/, T etaAxis, T phiAxis, bool use3dplots) + void initBase(const std::string& folderName, const std::string& /*femtoObs*/, T /*femtoObsAxis*/, T /*multAxis*/, T /*kTAxis*/, T /*mTAxis*/, T /*multAxis3D*/, T /*mTAxis3D*/, T etaAxis, T phiAxis, bool use3dplots) { mHistogramRegistry->add((folderName + "/DeltaEtaDeltaPhi").c_str(), "; #Delta#varphi (rad); #Delta#eta", o2::framework::HistType::kTH2F, {phiAxis, etaAxis}); if (use3dplots) { @@ -85,7 +85,7 @@ class FemtoUniverseAngularContainer /// \param folderName Name of the directory in the output file (no suffix for reconstructed data/ Monte Carlo; "_MC" for Monte Carlo Truth) /// \param femtoObsAxis axis object for the femto observable axis template - void initMC(std::string /*folderName*/, std::string /*femtoObs*/, T /*femtoObsAxis*/, T /*multAxis*/, T /*mTAxis*/) + void initMC(const std::string& /*folderName*/, const std::string& /*femtoObs*/, T /*femtoObsAxis*/, T /*multAxis*/, T /*mTAxis*/) { } diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseContainer.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseContainer.h index 6de1e014233..e471117d25f 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseContainer.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseContainer.h @@ -71,7 +71,7 @@ class FemtoUniverseContainer /// \param kTAxis axis object for the kT axis /// \param mTAxis axis object for the mT axis template - void initBase(std::string folderName, std::string femtoObs, T femtoObsAxis, T multAxis, T kTAxis, T mTAxis, T multAxis3D, T mTAxis3D, T etaAxis, T phiAxis, bool use3dplots) + void initBase(const std::string& folderName, const std::string& femtoObs, T femtoObsAxis, T multAxis, T kTAxis, T mTAxis, T multAxis3D, T mTAxis3D, T etaAxis, T phiAxis, bool use3dplots) { mHistogramRegistry->add((folderName + "/relPairDist").c_str(), ("; " + femtoObs + "; Entries").c_str(), o2::framework::HistType::kTH1F, {femtoObsAxis}); mHistogramRegistry->add((folderName + "/relPairkT").c_str(), "; #it{k}_{T} (GeV/#it{c}); Entries", o2::framework::HistType::kTH1F, {kTAxis}); @@ -97,7 +97,7 @@ class FemtoUniverseContainer /// \param folderName Name of the directory in the output file (no suffix for reconstructed data/ Monte Carlo; "_MC" for Monte Carlo Truth) /// \param femtoObsAxis axis object for the femto observable axis template - void initMC(std::string folderName, std::string femtoObs, T femtoObsAxis, T multAxis, T mTAxis) + void initMC(const std::string& folderName, const std::string& femtoObs, T femtoObsAxis, T multAxis, T mTAxis) { mHistogramRegistry->add((folderName + "/relPairDist_ReconNoFake").c_str(), ("; " + femtoObs + "; Entries").c_str(), o2::framework::HistType::kTH1F, {femtoObsAxis}); mHistogramRegistry->add((folderName + "/relPairkstarmT_ReconNoFake").c_str(), ("; " + femtoObs + "; #it{m}_{T} (GeV/#it{c}^{2})").c_str(), o2::framework::HistType::kTH2F, {femtoObsAxis, mTAxis}); diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseCutculator.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseCutculator.h index aa59d49f1fc..8d0865e0887 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseCutculator.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseCutculator.h @@ -78,7 +78,7 @@ class FemtoUniverseCutculator /// returns an std::vector in the proper format \param name Name of the /// selection in the dpl-config.json \return std::vector that can be directly /// passed to the FemtoUniverseTrack/V0/../Selection - std::vector setSelection(std::string name) + std::vector setSelection(const std::string& name) { try { boost::property_tree::ptree& selections = mConfigTree.get_child(name); @@ -313,7 +313,7 @@ class FemtoUniverseCutculator /// This is the function called by the executable that then outputs the full /// selection bit-wise container incorporating the user choice of selections - void analyseCuts(std::string choice, bool SysChecks = false, float sign = 1) + void analyseCuts(const std::string& choice, bool SysChecks = false, float sign = 1) { aod::femtouniverseparticle::CutContainerType output = -1; if (choice == std::string("T")) { diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseEfficiencyCorrection.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseEfficiencyCorrection.h index 23506574426..29ea922550e 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseEfficiencyCorrection.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseEfficiencyCorrection.h @@ -70,7 +70,7 @@ class EfficiencyCorrection { } - auto init(framework::HistogramRegistry* registry, std::vector axisSpecs) -> void + auto init(framework::HistogramRegistry* registry, const std::vector& axisSpecs) -> void { shouldFillHistograms = config->confEffCorFillHist; shouldSetMultToConst = config->confEffCorSetMultToConst; diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseFemtoContainer.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseFemtoContainer.h index 26909742bc7..d862f8f2056 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseFemtoContainer.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseFemtoContainer.h @@ -70,7 +70,7 @@ class FemtoUniverseFemtoContainer /// \param kTAxis axis object for the kT axis /// \param mTAxis axis object for the mT axis template - void initBase(std::string folderName, std::string femtoObs, T femtoObsAxis, T multAxis, T kTAxis, T mTAxis, T multAxis3D, T mTAxis3D, bool use3dplots) + void initBase(const std::string& folderName, const std::string& femtoObs, T femtoObsAxis, T multAxis, T kTAxis, T mTAxis, T multAxis3D, T mTAxis3D, bool use3dplots) { kHistogramRegistry->add((folderName + "/relPairDist").c_str(), ("; " + femtoObs + "; Entries").c_str(), o2::framework::HistType::kTH1F, {femtoObsAxis}); kHistogramRegistry->add((folderName + "/relPairkT").c_str(), "; #it{k}_{T} (GeV/#it{c}); Entries", o2::framework::HistType::kTH1F, {kTAxis}); @@ -93,7 +93,7 @@ class FemtoUniverseFemtoContainer /// \param folderName Name of the directory in the output file (no suffix for reconstructed data/ Monte Carlo; "_MC" for Monte Carlo Truth) /// \param femtoObsAxis axis object for the femto observable axis template - void initMC(std::string folderName, std::string femtoObs, T femtoObsAxis, T multAxis, T mTAxis) + void initMC(const std::string& folderName, const std::string& femtoObs, T femtoObsAxis, T multAxis, T mTAxis) { kHistogramRegistry->add((folderName + "/relPairDist_ReconNoFake").c_str(), ("; " + femtoObs + "; Entries").c_str(), o2::framework::HistType::kTH1F, {femtoObsAxis}); kHistogramRegistry->add((folderName + "/relPairkstarmT_ReconNoFake").c_str(), ("; " + femtoObs + "; #it{m}_{T} (GeV/#it{c}^{2})").c_str(), o2::framework::HistType::kTH2F, {femtoObsAxis, mTAxis}); diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseParticleHisto.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseParticleHisto.h index 02f5a330340..0426ccef44f 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseParticleHisto.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseParticleHisto.h @@ -55,7 +55,7 @@ class FemtoUniverseParticleHisto /// \param tempFitVarpTAxis axis object for the pT axis in the pT vs. tempFitVar plots /// \param tempFitVarAxis axis object for the tempFitVar axis template - void init_base(std::string folderName, std::string tempFitVarAxisTitle, T& tempFitVarpTAxis, T& tempFitVarAxis) // o2-linter: disable=name/function-variable + void init_base(const std::string& folderName, const std::string& tempFitVarAxisTitle, T& tempFitVarpTAxis, T& tempFitVarAxis) // o2-linter: disable=name/function-variable { std::string folderSuffix = static_cast(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]).c_str(); /// Histograms of the kinematic properties @@ -72,7 +72,7 @@ class FemtoUniverseParticleHisto // comment template - void init_debug(std::string folderName, T& tempFitVarMomAxis, bool isFillITSNsigma) // o2-linter: disable=name/function-variable + void init_debug(const std::string& folderName, T& tempFitVarMomAxis, bool isFillITSNsigma) // o2-linter: disable=name/function-variable { std::string folderSuffix = static_cast(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]).c_str(); if constexpr (mParticleType == o2::aod::femtouniverseparticle::ParticleType::kTrack || mParticleType == o2::aod::femtouniverseparticle::ParticleType::kV0Child || mParticleType == o2::aod::femtouniverseparticle::ParticleType::kCascadeBachelor || mParticleType == o2::aod::femtouniverseparticle::ParticleType::kMCTruthTrack) { @@ -146,7 +146,7 @@ class FemtoUniverseParticleHisto /// \param tempFitVarpTAxis axis object for the pT axis in the pT vs. tempFitVar plots /// \param tempFitVarAxis axis object for the tempFitVar axis template - void init_MC(std::string folderName, std::string /*tempFitVarAxisTitle*/, T& tempFitVarpTAxis, T& tempFitVarAxis, bool isDebug) // o2-linter: disable=name/function-variable + void init_MC(const std::string& folderName, const std::string& /*tempFitVarAxisTitle*/, T& tempFitVarpTAxis, T& tempFitVarAxis, bool isDebug) // o2-linter: disable=name/function-variable { /// Particle-type specific histograms std::string folderSuffix = static_cast(o2::aod::femtouniverse_mc_particle::MCTypeName[o2::aod::femtouniverse_mc_particle::MCType::kTruth]).c_str(); @@ -222,7 +222,7 @@ class FemtoUniverseParticleHisto /// \param tempFitVarBins binning of the tempFitVar (DCA_xy in case of tracks, CPA in case of V0s, etc.) /// \param isMC add Monte Carlo truth histograms to the output file template - void init(o2::framework::HistogramRegistry* registry, T& tempFitVarpTBins, T& tempFitVarBins, bool isMC, int pdgCode, bool isDebug = false, std::optional flexibleFolder = std::nullopt, bool isFillITSNsigma = false) + void init(o2::framework::HistogramRegistry* registry, T& tempFitVarpTBins, T& tempFitVarBins, bool isMC, int pdgCode, bool isDebug = false, const std::optional& flexibleFolder = std::nullopt, bool isFillITSNsigma = false) { mPDG = pdgCode; if (registry) { diff --git a/PWGCF/FemtoUniverse/Core/femtoUtils.h b/PWGCF/FemtoUniverse/Core/femtoUtils.h index daeef089442..e451cf06c35 100644 --- a/PWGCF/FemtoUniverse/Core/femtoUtils.h +++ b/PWGCF/FemtoUniverse/Core/femtoUtils.h @@ -61,7 +61,7 @@ bool isPIDSelected(aod::femtouniverseparticle::CutContainerType pidcut, int vSpecies, int nSpecies, float nSigma, - std::vector vNsigma, + const std::vector& vNsigma, KDetector iDet) { int iNsigma = getPIDselection(nSigma, vNsigma); @@ -85,7 +85,7 @@ bool isFullPIDSelected(aod::femtouniverseparticle::CutContainerType const& pidCu float pidThresh, int vSpecies, int nSpecies, - std::vector vNsigma, + const std::vector& vNsigma, float nSigmaTPC, float nSigmaTPCTOF) { diff --git a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerReducedTask.cxx b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerReducedTask.cxx index a0eb1fe69d1..627000c53d0 100644 --- a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerReducedTask.cxx +++ b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerReducedTask.cxx @@ -162,7 +162,7 @@ struct femtoUniverseProducerReducedTask { } /// Function to retrieve the nominal magnetic field in kG (0.1T) and convert it directly to T - void getMagneticFieldTesla(aod::BCsWithTimestamps::iterator bc) + void getMagneticFieldTesla(const aod::BCsWithTimestamps::iterator& bc) { // TODO done only once (and not per run). Will be replaced by CCDBConfigurable // get magnetic field for run diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx index 1580b4bcfe7..51f8ac5fd31 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx @@ -491,7 +491,7 @@ struct FemtoUniversePairTaskTrackNucleus { } template - void fillCollision(CollisionType col) + void fillCollision(const CollisionType& col) { mixQARegistry.fill(HIST("MixingQA/hSECollisionBins"), colBinning.getBin({col.posZ(), col.multV0M()})); eventHisto.fillQA(col); @@ -510,7 +510,7 @@ struct FemtoUniversePairTaskTrackNucleus { /// \param pairType describes charge of correlation pair (plus-plus (1), minus-minus (2), plus-minus (3), minus-plus (4)) /// \param fillQA enables filling of QA histograms template - void doSameEvent(PartitionType groupTrack, PartitionType groupNucleus, PartType parts, float magFieldTesla, int multCol, int pairType, bool /*fillQA*/) + void doSameEvent(const PartitionType& groupTrack, const PartitionType& groupNucleus, const PartType& parts, float magFieldTesla, int multCol, int pairType, bool /*fillQA*/) { for (const auto& part : groupTrack) { if (!isParticleNsigma((int8_t)1, part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(part, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(part, o2::track::PID::Deuteron), part.tpcSignal())) { @@ -680,7 +680,7 @@ struct FemtoUniversePairTaskTrackNucleus { /// \param multCol multiplicity of the collision /// \param pairType describes charge of correlation pair (plus-minus (1), plus-plus (2), minus-minus (3)) template - void doMixedEvent(PartitionType groupTrack, PartitionType groupNucleus, PartType parts, float magFieldTesla, int multCol, int pairType) + void doMixedEvent(const PartitionType& groupTrack, const PartitionType& groupNucleus, const PartType& parts, float magFieldTesla, int multCol, int pairType) { for (const auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupTrack, groupNucleus))) { diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrack.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrack.cxx index 1678d2747b5..6874668ca40 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrack.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrack.cxx @@ -185,7 +185,7 @@ struct FemtoUniversePairTaskTrackTrack { } template - void fillCollision(CollisionType col) + void fillCollision(const CollisionType& col) { mixQaRegistry.fill(HIST("MixingQA/hSECollisionBins"), colBinning.getBin({col.posZ(), col.multNtr()})); eventHisto.fillQA(col); @@ -202,7 +202,7 @@ struct FemtoUniversePairTaskTrackTrack { /// @param magFieldTesla magnetic field of the collision /// @param multCol multiplicity of the collision template - void doSameEvent(PartitionType groupPartsOne, PartitionType groupPartsTwo, PartType parts, float magFieldTesla, int multCol) + void doSameEvent(const PartitionType& groupPartsOne, const PartitionType& groupPartsTwo, const PartType& parts, float magFieldTesla, int multCol) { /// Histogramming same event @@ -325,7 +325,7 @@ struct FemtoUniversePairTaskTrackTrack { /// \param magFieldTesla magnetic field of the collision /// \param multCol multiplicity of the collision template - void doMixedEvent(PartitionType groupPartsOne, PartitionType groupPartsTwo, PartType parts, float magFieldTesla, int multCol) + void doMixedEvent(const PartitionType& groupPartsOne, const PartitionType& groupPartsTwo, const PartType& parts, float magFieldTesla, int multCol) { for (const auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrack3DMultKtExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrack3DMultKtExtended.cxx index 3474825dfc9..70f923f112b 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrack3DMultKtExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrack3DMultKtExtended.cxx @@ -450,7 +450,7 @@ struct femtoUniversePairTaskTrackTrack3DMultKtExtended { } template - void fillCollision(CollisionType col, bool IsCent) + void fillCollision(const CollisionType& col, bool IsCent) { if (IsCent) { MixQaRegistry.fill(HIST("MixingQA/hSECollisionBins"), colBinningCent.getBin({col.posZ(), col.multV0M()})); @@ -471,7 +471,7 @@ struct femtoUniversePairTaskTrackTrack3DMultKtExtended { /// @param magFieldTesla magnetic field of the collision /// @param multCol multiplicity of the collision template - void doSameEvent(PartitionType groupPartsOne, PartitionType groupPartsTwo, PartType parts, float magFieldTesla, int multCol, int ContType, bool fillQA, [[maybe_unused]] MCParticles mcParts = nullptr) + void doSameEvent(const PartitionType& groupPartsOne, const PartitionType& groupPartsTwo, const PartType& parts, float magFieldTesla, int multCol, int ContType, bool fillQA, [[maybe_unused]] const MCParticles& mcParts = nullptr) { /// Histogramming same event @@ -718,7 +718,7 @@ struct femtoUniversePairTaskTrackTrack3DMultKtExtended { /// \param magFieldTesla magnetic field of the collision /// \param multCol multiplicity of the collision template - void doMixedEvent(PartitionType groupPartsOne, PartitionType groupPartsTwo, PartType parts, float magFieldTesla, int multCol, int ContType) + void doMixedEvent(const PartitionType& groupPartsOne, const PartitionType& groupPartsTwo, const PartType& parts, float magFieldTesla, int multCol, int ContType) { for (const auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackExtended.cxx index 971ac763115..324bf757704 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackExtended.cxx @@ -373,7 +373,7 @@ struct FemtoUniversePairTaskTrackTrackExtended { } template - void fillCollision(CollisionType col) + void fillCollision(const CollisionType& col) { mixQaRegistry.fill(HIST("MixingQA/hSECollisionBins"), colBinning.getBin({col.posZ(), col.multNtr()})); eventHisto.fillQA(col); @@ -381,7 +381,7 @@ struct FemtoUniversePairTaskTrackTrackExtended { template requires IsOneOrTwo - auto doMCTruth(auto parts, int partPDG, int partCharge) -> void + auto doMCTruth(const auto& parts, int partPDG, int partCharge) -> void { for (const auto& particle : parts) { auto pdgCode = static_cast(particle.pidCut()); @@ -413,7 +413,7 @@ struct FemtoUniversePairTaskTrackTrackExtended { /// @param magFieldTesla magnetic field of the collision /// @param multCol multiplicity of the collision template - void doSameEvent(PartitionType groupPartsOne, PartitionType groupPartsTwo, PartType parts, float magFieldTesla, int multCol) + void doSameEvent(const PartitionType& groupPartsOne, const PartitionType& groupPartsTwo, const PartType& parts, float magFieldTesla, int multCol) { // variables for particle swapping bool swpart = fNeventsProcessed % 2; @@ -648,7 +648,7 @@ struct FemtoUniversePairTaskTrackTrackExtended { /// \param magFieldTesla magnetic field of the collision /// \param multCol multiplicity of the collision template - void doMixedEvent(PartitionType groupPartsOne, PartitionType groupPartsTwo, PartType parts, float magFieldTesla, int multCol) + void doMixedEvent(const PartitionType& groupPartsOne, const PartitionType& groupPartsTwo, const PartType& parts, float magFieldTesla, int multCol) { // variables for particle swapping diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMC.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMC.cxx index 145393dc438..4b4fa24fff5 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMC.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMC.cxx @@ -411,7 +411,7 @@ struct femtoUniversePairTaskTrackTrackMC { } template - void fillCollision(CollisionType col) + void fillCollision(const CollisionType& col) { MixQaRegistry.fill(HIST("MixingQA/hSECollisionBins"), colBinning.getBin({col.posZ(), col.multNtr()})); eventHisto.fillQA(col); @@ -428,7 +428,7 @@ struct femtoUniversePairTaskTrackTrackMC { /// @param magFieldTesla magnetic field of the collision /// @param multCol multiplicity of the collision template - void doSameEvent(PartitionType groupPartsOne, PartitionType groupPartsTwo, PartType parts, float magFieldTesla, int multCol, int ContType, bool fillQA) + void doSameEvent(const PartitionType& groupPartsOne, const PartitionType& groupPartsTwo, const PartType& parts, float magFieldTesla, int multCol, int ContType, bool fillQA) { /// Histogramming same event @@ -596,7 +596,7 @@ struct femtoUniversePairTaskTrackTrackMC { /// \param magFieldTesla magnetic field of the collision /// \param multCol multiplicity of the collision template - void doMixedEvent(PartitionType groupPartsOne, PartitionType groupPartsTwo, PartType parts, float magFieldTesla, int multCol, int ContType) + void doMixedEvent(const PartitionType& groupPartsOne, const PartitionType& groupPartsTwo, const PartType& parts, float magFieldTesla, int multCol, int ContType) { for (auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMcTruth.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMcTruth.cxx index 30666e44c8b..0d3634683c1 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMcTruth.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMcTruth.cxx @@ -148,7 +148,7 @@ struct FemtoUniversePairTaskTrackTrackMcTruth { } template - void fillCollision(CollisionType col) + void fillCollision(const CollisionType& col) { mixQaRegistry.fill(HIST("MixingQA/hSECollisionBins"), colBinning.getBin({col.posZ(), col.multNtr()})); eventHisto.fillQA(col); @@ -165,7 +165,7 @@ struct FemtoUniversePairTaskTrackTrackMcTruth { /// @param magFieldTesla magnetic field of the collision /// @param multCol multiplicity of the collision template - void doSameEvent(PartitionType groupPartsOne, PartitionType groupPartsTwo, PartType parts, float /*magFieldTesla*/, int multCol) + void doSameEvent(const PartitionType& groupPartsOne, const PartitionType& groupPartsTwo, const PartType& parts, float /*magFieldTesla*/, int multCol) { bool swpart = fNeventsProcessed % 2; fNeventsProcessed++; @@ -257,7 +257,7 @@ struct FemtoUniversePairTaskTrackTrackMcTruth { /// \param magFieldTesla magnetic field of the collision /// \param multCol multiplicity of the collision template - void doMixedEvent(PartitionType groupPartsOne, PartitionType groupPartsTwo, PartType /*parts*/, float /*magFieldTesla*/, int multCol) + void doMixedEvent(const PartitionType& groupPartsOne, const PartitionType& groupPartsTwo, const PartType& /*parts*/, float /*magFieldTesla*/, int multCol) { bool swpart = fNeventsProcessed % 2; fNeventsProcessed++; diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx index aebb0d52cf4..465df0a76a6 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx @@ -563,7 +563,7 @@ struct FemtoUniversePairTaskTrackTrackSpherHarMultKtExtended { } template - void fillCollision(CollisionType col, bool IsCent) + void fillCollision(const CollisionType& col, bool IsCent) { if (IsCent) { mixQaRegistry.fill(HIST("MixingQA/hSECollisionBins"), colBinningCent.getBin({col.posZ(), col.multV0M()})); @@ -584,7 +584,7 @@ struct FemtoUniversePairTaskTrackTrackSpherHarMultKtExtended { /// @param magFieldTesla magnetic field of the collision /// @param multCol multiplicity of the collision template - void doSameEvent(PartitionType groupPartsOne, PartitionType groupPartsTwo, PartType parts, float magFieldTesla, int multCol, PairType contType, bool fillQA) + void doSameEvent(const PartitionType& groupPartsOne, const PartitionType& groupPartsTwo, const PartType& parts, float magFieldTesla, int multCol, PairType contType, bool fillQA) { /// Histogramming same event if ((contType == PairType::PlusMinus || contType == PairType::PlusPlus) && fillQA) { @@ -892,7 +892,7 @@ struct FemtoUniversePairTaskTrackTrackSpherHarMultKtExtended { /// @param magFieldTesla magnetic field of the collision /// @param multCol multiplicity of the collision template - void doSameEventMCTruth(PartitionType groupPartsOne, PartitionType groupPartsTwo, int multCol, PairType contType, bool fillQA) + void doSameEventMCTruth(const PartitionType& groupPartsOne, const PartitionType& groupPartsTwo, int multCol, PairType contType, bool fillQA) { randgen = new TRandom2(0); @@ -1045,7 +1045,7 @@ struct FemtoUniversePairTaskTrackTrackSpherHarMultKtExtended { /// \param magFieldTesla magnetic field of the collision /// \param multCol multiplicity of the collision template - void doMixedEvent(PartitionType groupPartsOne, PartitionType groupPartsTwo, float magFieldTesla, int multCol, PairType contType) + void doMixedEvent(const PartitionType& groupPartsOne, const PartitionType& groupPartsTwo, float magFieldTesla, int multCol, PairType contType) { for (const auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { @@ -1389,7 +1389,7 @@ struct FemtoUniversePairTaskTrackTrackSpherHarMultKtExtended { /// \param magFieldTesla magnetic field of the collision /// \param multCol multiplicity of the collision template - void doMixedEventMCTruth(PartitionType groupPartsOne, PartitionType groupPartsTwo, int multCol, PairType contType) + void doMixedEventMCTruth(const PartitionType& groupPartsOne, const PartitionType& groupPartsTwo, int multCol, PairType contType) { randgen = new TRandom2(0); for (const auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtendedItsPid.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtendedItsPid.cxx index f23e05027a4..1c0c0cd0472 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtendedItsPid.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtendedItsPid.cxx @@ -553,7 +553,7 @@ struct FemtoUniversePairTaskTrackTrackSpherHarMultKtExtendedItsPid { } template - void fillCollision(CollisionType col, bool IsCent) + void fillCollision(const CollisionType& col, bool IsCent) { if (IsCent) { mixQaRegistry.fill(HIST("MixingQA/hSECollisionBins"), colBinningCent.getBin({col.posZ(), col.multV0M()})); @@ -574,7 +574,7 @@ struct FemtoUniversePairTaskTrackTrackSpherHarMultKtExtendedItsPid { /// @param magFieldTesla magnetic field of the collision /// @param multCol multiplicity of the collision template - void doSameEvent(PartitionType groupPartsOne, PartitionType groupPartsTwo, PartType parts, float magFieldTesla, int multCol, PairType contType, bool fillQA) + void doSameEvent(const PartitionType& groupPartsOne, const PartitionType& groupPartsTwo, const PartType& parts, float magFieldTesla, int multCol, PairType contType, bool fillQA) { /// Histogramming same event if ((contType == PairType::PlusMinus || contType == PairType::PlusPlus) && fillQA) { @@ -829,7 +829,7 @@ struct FemtoUniversePairTaskTrackTrackSpherHarMultKtExtendedItsPid { /// \param magFieldTesla magnetic field of the collision /// \param multCol multiplicity of the collision template - void doMixedEvent(PartitionType groupPartsOne, PartitionType groupPartsTwo, float magFieldTesla, int multCol, PairType contType) + void doMixedEvent(const PartitionType& groupPartsOne, const PartitionType& groupPartsTwo, float magFieldTesla, int multCol, PairType contType) { for (const auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Helicity.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Helicity.cxx index 5b0bdbae389..e59dfd95745 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Helicity.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Helicity.cxx @@ -471,7 +471,7 @@ struct FemtoUniversePairTaskTrackV0Helicity { /// This function processes the same event for Track-V0 template - void doSameEvent(FilteredFDCollision const& col, PartType const& parts, PartitionType& groupPartsOne, PartitionType& groupPartsTwo, int helRange, [[maybe_unused]] MCParticles mcParts = nullptr) + void doSameEvent(FilteredFDCollision const& col, PartType const& parts, PartitionType& groupPartsOne, PartitionType& groupPartsTwo, int helRange, [[maybe_unused]] const MCParticles& mcParts = nullptr) { const auto& magFieldTesla = col.magField(); @@ -864,7 +864,7 @@ struct FemtoUniversePairTaskTrackV0Helicity { /// This function processes the mixed event for track - V0 template - void doMixedEvent(FilteredFDCollisions const& cols, PartType const& parts, PartitionType& partitionOne, PartitionType& partitionTwo, int helRange, [[maybe_unused]] MCParticles mcParts = nullptr) + void doMixedEvent(FilteredFDCollisions const& cols, PartType const& parts, PartitionType& partitionOne, PartitionType& partitionTwo, int helRange, [[maybe_unused]] const MCParticles& mcParts = nullptr) { ColumnBinningPolicy colBinningMult{{confVtxBins, confMultBins}, true}; ColumnBinningPolicy colBinningCent{{confVtxBins, confMultBins}, true}; diff --git a/PWGCF/FemtoWorld/TableProducer/femtoWorldProducerTask.cxx b/PWGCF/FemtoWorld/TableProducer/femtoWorldProducerTask.cxx index 3a41924c7b3..0460e749cb0 100644 --- a/PWGCF/FemtoWorld/TableProducer/femtoWorldProducerTask.cxx +++ b/PWGCF/FemtoWorld/TableProducer/femtoWorldProducerTask.cxx @@ -348,7 +348,7 @@ struct femtoWorldProducerTask { } /// Function to retrieve the nominal mgnetic field in kG (0.1T) and convert it directly to T - void getMagneticFieldTesla(aod::BCsWithTimestamps::iterator bc) + void getMagneticFieldTesla(const aod::BCsWithTimestamps::iterator& bc) { // TODO done only once (and not per run). Will be replaced by CCDBConfigurable // get magnetic field for run diff --git a/PWGCF/FemtoWorld/Tasks/femtoWorldPairTaskPionPion.cxx b/PWGCF/FemtoWorld/Tasks/femtoWorldPairTaskPionPion.cxx index c3c0d0a9dcb..5dd434d6b97 100644 --- a/PWGCF/FemtoWorld/Tasks/femtoWorldPairTaskPionPion.cxx +++ b/PWGCF/FemtoWorld/Tasks/femtoWorldPairTaskPionPion.cxx @@ -269,7 +269,7 @@ struct femtoWorldPairTaskPionPion { // Function to build combinations template - void CombineParticles(T1 groupPartsOne, T1 groupPartsTwo, T2 cont, T3 parts, T4 magFieldTesla, int multCol, int sameOrMixed) + void CombineParticles(const T1& groupPartsOne, const T1& groupPartsTwo, T2 cont, const T3& parts, T4 magFieldTesla, int multCol, int sameOrMixed) { if (sameOrMixed == 1) { for (auto& [p1, p2] : combinations(groupPartsOne, groupPartsTwo)) { diff --git a/PWGCF/Flow/Tasks/flowAnalysisGF.cxx b/PWGCF/Flow/Tasks/flowAnalysisGF.cxx index 551f54545b9..ff45727cfb8 100644 --- a/PWGCF/Flow/Tasks/flowAnalysisGF.cxx +++ b/PWGCF/Flow/Tasks/flowAnalysisGF.cxx @@ -415,7 +415,7 @@ struct flowAnalysisGF { } template - bool eventSelected(TCollision collision, const int& multTrk, const float& centrality) + bool eventSelected(const TCollision& collision, const int& multTrk, const float& centrality) { if (cfgTVXinTRD) { if (collision.alias_bit(kTVXinTRD)) { @@ -487,7 +487,7 @@ struct flowAnalysisGF { } template - bool trackSelected(TTrack track, const int& field) + bool trackSelected(const TTrack& track, const int& field) { double phimodn = track.phi(); if (field < 0) // for negative polarity field @@ -545,7 +545,7 @@ struct flowAnalysisGF { } template - void processCollision(datatype dt, TCollision const& collision, TTracks tracks, const float& centrality, const int& field) + void processCollision(datatype dt, TCollision const& collision, const TTracks& tracks, const float& centrality, const int& field) { if (tracks.size() < 1) @@ -648,7 +648,7 @@ struct flowAnalysisGF { } template - inline void FillGFW(TrackObject track, float weff, float wacc) + inline void FillGFW(const TrackObject& track, float weff, float wacc) { fFCpt->fill(weff, track.pt()); bool WithinPtPOI = (ptpoilow < track.pt()) && (track.pt() < ptpoiup); // within POI pT range @@ -663,7 +663,7 @@ struct flowAnalysisGF { } template - inline void FillTrackQA(TrackObject track, const float vtxz) + inline void FillTrackQA(const TrackObject& track, const float vtxz) { if constexpr (framework::has_type_v) { registry.fill(HIST("trackMCGen/phi_eta_vtxZ_gen"), track.phi(), track.eta(), vtxz); @@ -685,7 +685,7 @@ struct flowAnalysisGF { } template - inline void FillEventQA(CollisionObject collision, TracksObject tracks) + inline void FillEventQA(const CollisionObject& collision, const TracksObject& tracks) { if constexpr (framework::has_type_v) { @@ -700,7 +700,7 @@ struct flowAnalysisGF { } template - inline void RunProcess(CollisionObject collision, TracksObject tracks) + inline void RunProcess(const CollisionObject& collision, const TracksObject& tracks) { float centrality; diff --git a/PWGCF/Flow/Tasks/flowDirectedFlowTask.cxx b/PWGCF/Flow/Tasks/flowDirectedFlowTask.cxx index c91f1b567e9..23f18f3acba 100644 --- a/PWGCF/Flow/Tasks/flowDirectedFlowTask.cxx +++ b/PWGCF/Flow/Tasks/flowDirectedFlowTask.cxx @@ -218,7 +218,7 @@ struct flowDirectedFlowTask { } template - bool eventSelected(TCollision collision) + bool eventSelected(const TCollision& collision) { if (!collision.sel8()) { return 0; diff --git a/PWGCF/Flow/Tasks/flowEfficiencyCasc.cxx b/PWGCF/Flow/Tasks/flowEfficiencyCasc.cxx index 9a67d39f461..abf517ed95c 100644 --- a/PWGCF/Flow/Tasks/flowEfficiencyCasc.cxx +++ b/PWGCF/Flow/Tasks/flowEfficiencyCasc.cxx @@ -145,7 +145,7 @@ struct FlowEfficiencyCasc { registry.add("QAhisto/Casc/hqadcaCascV0dauafter", "", {HistType::kTH1D, {{100, 0, 1}}}); } template - bool eventSelected(TCollision collision) + bool eventSelected(const TCollision& collision) { if (collision.alias_bit(kTVXinTRD)) { // TRD triggered diff --git a/PWGCF/Flow/Tasks/flowEsePHe3.cxx b/PWGCF/Flow/Tasks/flowEsePHe3.cxx index 6e90802ef9d..a1ddcf4d45b 100644 --- a/PWGCF/Flow/Tasks/flowEsePHe3.cxx +++ b/PWGCF/Flow/Tasks/flowEsePHe3.cxx @@ -432,7 +432,7 @@ struct FlowEsePHe3 { Produces eseTable; template - float getNSigmaTPCSelfBB(const TrackType track, uint8_t POI) + float getNSigmaTPCSelfBB(const TrackType& track, uint8_t POI) { bool heliumPID = track.pidForTracking() == o2::track::PID::Helium3 || track.pidForTracking() == o2::track::PID::Alpha; float correctedTpcInnerParam = (heliumPID && cfgCompensatePIDinTracking) ? track.tpcInnerParam() / 2 : track.tpcInnerParam(); @@ -479,7 +479,7 @@ struct FlowEsePHe3 { } template - float getNSigmaTPC(const TrackType track, uint8_t POI) + float getNSigmaTPC(const TrackType& track, uint8_t POI) { switch (POI) { case ese_parameters::kProton: { @@ -518,7 +518,7 @@ struct FlowEsePHe3 { } template - float getNSigmaTOF(const TrackType track, uint8_t POI) + float getNSigmaTOF(const TrackType& track, uint8_t POI) { switch (POI) { case ese_parameters::kProton: { @@ -548,7 +548,7 @@ struct FlowEsePHe3 { } template - float getNSigmaITS(const TrackType track, uint8_t POI) + float getNSigmaITS(const TrackType& track, uint8_t POI) { switch (POI) { case ese_parameters::kProton: { @@ -720,7 +720,7 @@ struct FlowEsePHe3 { } template - bool trackSelBasic(const TrackType track) + bool trackSelBasic(const TrackType& track) { if ((track.pt() < cfgMinPtPID) || (track.pt() > cfgMaxPtPID)) return false; @@ -775,7 +775,7 @@ struct FlowEsePHe3 { } template - void fillEventQAhistBe(const CollType collision, const int multTrk, const float centrality) + void fillEventQAhistBe(const CollType& collision, const int multTrk, const float centrality) { histsESE.fill(HIST("EventQA/hist_globalTracks_centT0C_before"), centrality, multTrk); histsESE.fill(HIST("EventQA/hist_PVTracks_centT0C_before"), centrality, collision.multNTracksPV()); @@ -787,7 +787,7 @@ struct FlowEsePHe3 { } template - void fillEventQAhistAf(const CollType collision, const int multTrk, const float centrality) + void fillEventQAhistAf(const CollType& collision, const int multTrk, const float centrality) { histsESE.fill(HIST("EventQA/hist_globalTracks_centT0C_after"), centrality, multTrk); histsESE.fill(HIST("EventQA/hist_PVTracks_centT0C_after"), centrality, collision.multNTracksPV()); @@ -799,7 +799,7 @@ struct FlowEsePHe3 { } template - void fillTrackQAhist(const TrackType track) + void fillTrackQAhist(const TrackType& track) { bool heliumPID = track.pidForTracking() == o2::track::PID::Helium3 || track.pidForTracking() == o2::track::PID::Alpha; float correctedTpcInnerParam = (heliumPID && cfgCompensatePIDinTracking) ? track.tpcInnerParam() / 2 : track.tpcInnerParam(); diff --git a/PWGCF/Flow/Tasks/flowFlucGfwPp.cxx b/PWGCF/Flow/Tasks/flowFlucGfwPp.cxx index a5eea73cf9e..ef7b945af75 100644 --- a/PWGCF/Flow/Tasks/flowFlucGfwPp.cxx +++ b/PWGCF/Flow/Tasks/flowFlucGfwPp.cxx @@ -695,7 +695,7 @@ struct FlowFlucGfwPp { } template - double getAcceptance(TTrack track, const double& vtxz) + double getAcceptance(const TTrack& track, const double& vtxz) { double wacc = 1; if (cfg.mAcceptance) @@ -704,7 +704,7 @@ struct FlowFlucGfwPp { } template - double getEfficiency(TTrack track) + double getEfficiency(const TTrack& track) { double eff = 1.; if (cfg.mEfficiency) { @@ -726,7 +726,7 @@ struct FlowFlucGfwPp { } template - bool eventSelected(TCollision collision, const int& multTrk, const float& centrality, const int& run) + bool eventSelected(const TCollision& collision, const int& multTrk, const float& centrality, const int& run) { if (cfgTVXinTRD) { if (collision.alias_bit(kTVXinTRD)) { @@ -843,7 +843,7 @@ struct FlowFlucGfwPp { } template - bool trackSelected(TTrack track) + bool trackSelected(const TTrack& track) { if (cfgDCAxyNSigma && (std::fabs(track.dcaXY()) > fPtDepDCAxy->Eval(track.pt()))) return false; @@ -856,7 +856,7 @@ struct FlowFlucGfwPp { }; template - void fillWeights(const TTrack track, const double vtxz, const int& run) + void fillWeights(const TTrack& track, const double vtxz, const int& run) { if (cfgRunByRun) th3sList[run][hNUAref]->Fill(track.phi(), track.eta(), vtxz); @@ -981,7 +981,7 @@ struct FlowFlucGfwPp { }; template - bool selTrack(const TrackType track) + bool selTrack(const TrackType& track) { if (track.pt() < cfgMinPtOnTPC) return false; @@ -1098,7 +1098,7 @@ struct FlowFlucGfwPp { // add a param : bool doFillHisto ? int myqnBin(float centrality, float centMax, float qn, std::vector qnBinSprt, const int numQnBins, float centBinWidth = 1.f) { - auto twoDSeparator = getQnBinSeparator2D(qnBinSprt, numQnBins); + auto twoDSeparator = getQnBinSeparator2D(std::move(qnBinSprt), numQnBins); if (twoDSeparator.empty() || twoDSeparator[0][0] == kInvalidQnSeparator) { LOGP(warning, "ConfQnBinSeparator not set, using default fallback!"); return kInvalidQnBin; // safe fallback @@ -1125,7 +1125,7 @@ struct FlowFlucGfwPp { } template - void processCollision(TCollision collision, TTracks tracks, const XAxis& xaxis, const int& run, const int& qPtmp) + void processCollision(const TCollision& collision, const TTracks& tracks, const XAxis& xaxis, const int& run, const int& qPtmp) { if (tracks.size() < 1) return; @@ -1186,7 +1186,7 @@ struct FlowFlucGfwPp { } template - void processGenCollision(TCollision collision, TParticles particles, const int& mcCollisionId, const XAxis& xaxis, const int& run, const int& qPtmp) + void processGenCollision(const TCollision& collision, const TParticles& particles, const int& mcCollisionId, const XAxis& xaxis, const int& run, const int& qPtmp) { if (xaxis.multiplicity < cfgFixedMultMin || xaxis.multiplicity > cfgFixedMultMax) return; @@ -1243,7 +1243,7 @@ struct FlowFlucGfwPp { } template - void fillAcceptedTracks(TTrack track, AcceptedTracks& acceptedTracks) + void fillAcceptedTracks(const TTrack& track, AcceptedTracks& acceptedTracks) { if (posRegionIndex >= 0 && track.eta() > o2::analysis::gfwflowflucpp::regions.GetEtaMin()[posRegionIndex] && track.eta() < o2::analysis::gfwflowflucpp::regions.GetEtaMax()[posRegionIndex]) ++acceptedTracks.nPos; @@ -1334,7 +1334,7 @@ struct FlowFlucGfwPp { } template - inline void fillGFW(TTrack track, const double& vtxz) + inline void fillGFW(const TTrack& track, const double& vtxz) { bool withinPtRef = (track.pt() > o2::analysis::gfwflowflucpp::ptreflow && track.pt() < o2::analysis::gfwflowflucpp::ptrefup); bool withinPtPOI = (track.pt() > o2::analysis::gfwflowflucpp::ptpoilow && track.pt() < o2::analysis::gfwflowflucpp::ptpoiup); @@ -1355,7 +1355,7 @@ struct FlowFlucGfwPp { } template - inline void fillTrackQA(TTrack track, const float vtxz) + inline void fillTrackQA(const TTrack& track, const float vtxz) { if constexpr (dt == kGen) { registry.fill(HIST("MCGen/trackQA/phi_eta_vtxZ"), track.phi(), track.eta(), vtxz); @@ -1380,7 +1380,7 @@ struct FlowFlucGfwPp { } template - float getCentrality(TCollision collision) + float getCentrality(const TCollision& collision) { switch (cfgCentEstimator) { case kCentFT0C: @@ -1401,7 +1401,7 @@ struct FlowFlucGfwPp { } template - inline void fillEventQA(TCollision collision, XAxis xaxis) + inline void fillEventQA(const TCollision& collision, XAxis xaxis) { if constexpr (framework::has_type_v) { registry.fill(HIST("eventQA/") + HIST(FillTimeName[ft]) + HIST("globalTracks_centT0C"), collision.centFT0C(), xaxis.multiplicity); diff --git a/PWGCF/Flow/Tasks/flowGfwEse.cxx b/PWGCF/Flow/Tasks/flowGfwEse.cxx index 307168d24d3..af7e0bb725f 100644 --- a/PWGCF/Flow/Tasks/flowGfwEse.cxx +++ b/PWGCF/Flow/Tasks/flowGfwEse.cxx @@ -618,7 +618,7 @@ struct FlowGfwEse { } template - double getAcceptance(TTrack track, const double& vtxz) + double getAcceptance(const TTrack& track, const double& vtxz) { double wacc = 1; if (cfg.mAcceptance) @@ -627,7 +627,7 @@ struct FlowGfwEse { } template - double getEfficiency(TTrack track) + double getEfficiency(const TTrack& track) { double eff = 1.; if (cfg.mEfficiency) @@ -639,7 +639,7 @@ struct FlowGfwEse { } template - bool eventSelected(TCollision collision, const int& multTrk, const float& centrality, const int& run) + bool eventSelected(const TCollision& collision, const int& multTrk, const float& centrality, const int& run) { if (cfgTVXinTRD) { if (collision.alias_bit(kTVXinTRD)) { @@ -742,7 +742,7 @@ struct FlowGfwEse { } template - bool trackSelected(TTrack track) + bool trackSelected(const TTrack& track) { if (cfgDCAxyNSigma && (std::fabs(track.dcaXY()) > fPtDepDCAxy->Eval(track.pt()))) return false; @@ -755,7 +755,7 @@ struct FlowGfwEse { }; template - void fillWeights(const TTrack track, const double vtxz, const int& run) + void fillWeights(const TTrack& track, const double vtxz, const int& run) { if (cfgRunByRun) th3sList[run][hNUAref]->Fill(track.phi(), track.eta(), vtxz); @@ -850,7 +850,7 @@ struct FlowGfwEse { }; template - void processCollision(TCollision collision, TTracks tracks, const XAxis& xaxis, const int& run) + void processCollision(const TCollision& collision, const TTracks& tracks, const XAxis& xaxis, const int& run) { if (tracks.size() < 1) return; @@ -950,7 +950,7 @@ struct FlowGfwEse { } template - void fillAcceptedTracks(TTrack track, AcceptedTracks& acceptedTracks) + void fillAcceptedTracks(const TTrack& track, AcceptedTracks& acceptedTracks) { if (posRegionIndex >= 0 && track.eta() > o2::analysis::gfwflowese::regions.GetEtaMin()[posRegionIndex] && track.eta() < o2::analysis::gfwflowese::regions.GetEtaMax()[posRegionIndex]) ++acceptedTracks.nPos; @@ -1038,7 +1038,7 @@ struct FlowGfwEse { } template - inline void fillGFW(TTrack track, const double& vtxz, DensityCorr densitycorrections) + inline void fillGFW(const TTrack& track, const double& vtxz, DensityCorr densitycorrections) { bool withinPtRef = (track.pt() > o2::analysis::gfwflowese::ptreflow && track.pt() < o2::analysis::gfwflowese::ptrefup); bool withinPtPOI = (track.pt() > o2::analysis::gfwflowese::ptpoilow && track.pt() < o2::analysis::gfwflowese::ptpoiup); @@ -1070,7 +1070,7 @@ struct FlowGfwEse { } template - inline void fillPtSums(TTrack track) + inline void fillPtSums(const TTrack& track) { double weff = (dt == kGen) ? 1. : getEfficiency(track); if (weff < 0) @@ -1081,7 +1081,7 @@ struct FlowGfwEse { } template - inline void fillTrackQA(TTrack track, const float vtxz) + inline void fillTrackQA(const TTrack& track, const float vtxz) { if constexpr (dt == kGen) { registry.fill(HIST("MCGen/trackQA/phi_eta_vtxZ"), track.phi(), track.eta(), vtxz); @@ -1106,7 +1106,7 @@ struct FlowGfwEse { } template - float getCentrality(TCollision collision) + float getCentrality(const TCollision& collision) { switch (cfgCentEstimator) { case kCentFT0C: @@ -1129,7 +1129,7 @@ struct FlowGfwEse { } template - inline void fillEventQA(TCollision collision, XAxis xaxis) + inline void fillEventQA(const TCollision& collision, XAxis xaxis) { if constexpr (framework::has_type_v) { registry.fill(HIST("eventQA/") + HIST(FillTimeName[ft]) + HIST("globalTracks_centT0C"), collision.centFT0C(), xaxis.multiplicity); diff --git a/PWGCF/Flow/Tasks/flowGfwOmegaXi.cxx b/PWGCF/Flow/Tasks/flowGfwOmegaXi.cxx index f277ede1018..1f886490fcb 100644 --- a/PWGCF/Flow/Tasks/flowGfwOmegaXi.cxx +++ b/PWGCF/Flow/Tasks/flowGfwOmegaXi.cxx @@ -784,7 +784,7 @@ struct FlowGfwOmegaXi { } // input shared_ptr - void fillProfile(const GFW::CorrConfig& corrconf, std::shared_ptr TProfile, const double& cent) + void fillProfile(const GFW::CorrConfig& corrconf, const std::shared_ptr& TProfile, const double& cent) { double dnx, val; dnx = fGFW->Calculate(corrconf, 0, kTRUE).real(); @@ -889,7 +889,7 @@ struct FlowGfwOmegaXi { } // input shared_ptr - void fillProfilepTMass(const GFW::CorrConfig& corrconf, std::shared_ptr TProfile3D, const int& ptbin, const int& PDGCode, const float& cent) + void fillProfilepTMass(const GFW::CorrConfig& corrconf, const std::shared_ptr& TProfile3D, const int& ptbin, const int& PDGCode, const float& cent) { int nMassBins = 0; int nptbins = 0; @@ -955,7 +955,7 @@ struct FlowGfwOmegaXi { } template - bool setCurrentParticleWeights(float& weight_nue, float& weight_nua, TrackObject track, float vtxz, int ispecies) + bool setCurrentParticleWeights(float& weight_nue, float& weight_nua, const TrackObject& track, float vtxz, int ispecies) { float eff = 1.; int nspecies = 5; @@ -979,7 +979,7 @@ struct FlowGfwOmegaXi { } template - bool setCurrentLocalDensityWeights(float& weight_loc, TrackObject track, double locDensity, int ispecies) + bool setCurrentLocalDensityWeights(float& weight_loc, const TrackObject& track, double locDensity, int ispecies) { auto cfgLocDenPara = (std::vector>){cfgLocDenParaK0s, cfgLocDenParaLambda, cfgLocDenParaXi, cfgLocDenParaOmega}; int ptbin = fXiPtAxis->FindBin(track.pt()); @@ -997,7 +997,7 @@ struct FlowGfwOmegaXi { // event selection template - bool eventSelected(TCollision collision, const float centrality, float interactionRate = -1) + bool eventSelected(const TCollision& collision, const float centrality, float interactionRate = -1) { if (evtSeleOpts.cfgDoTVXinTRD.value && collision.alias_bit(kTVXinTRD)) { // TRD triggered diff --git a/PWGCF/Flow/Tasks/flowGfwTask.cxx b/PWGCF/Flow/Tasks/flowGfwTask.cxx index 898861b8996..3e43254956c 100644 --- a/PWGCF/Flow/Tasks/flowGfwTask.cxx +++ b/PWGCF/Flow/Tasks/flowGfwTask.cxx @@ -662,7 +662,7 @@ struct FlowGfwTask { return; } - void fillProfile(const GFW::CorrConfig& corrconf, std::shared_ptr tarName, const double& cent) + void fillProfile(const GFW::CorrConfig& corrconf, const std::shared_ptr& tarName, const double& cent) { double dnx, val; dnx = fGFW->Calculate(corrconf, 0, kTRUE).real(); @@ -762,7 +762,7 @@ struct FlowGfwTask { } template - bool eventSelected(o2::aod::mult::MultNTracksPV, TCollision collision, const int multTrk, const float centrality) + bool eventSelected(o2::aod::mult::MultNTracksPV, const TCollision& collision, const int multTrk, const float centrality) { if (cfgNoTimeFrameBorder) { if (!collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder)) { @@ -867,7 +867,7 @@ struct FlowGfwTask { } template - bool trackSelected(TTrack track, const int field) + bool trackSelected(const TTrack& track, const int field) { double phimodn = track.phi(); if (field < 0) // for negative polarity field @@ -887,7 +887,7 @@ struct FlowGfwTask { } template - bool trackSelected(TTrack track) + bool trackSelected(const TTrack& track) { if (cfgDCAzPt && (std::fabs(track.dcaZ()) > (0.004f + 0.013f / track.pt()))) return false; diff --git a/PWGCF/Flow/Tasks/flowPbpbPikp.cxx b/PWGCF/Flow/Tasks/flowPbpbPikp.cxx index de29ae33e9f..8abf37f3f09 100644 --- a/PWGCF/Flow/Tasks/flowPbpbPikp.cxx +++ b/PWGCF/Flow/Tasks/flowPbpbPikp.cxx @@ -150,7 +150,7 @@ struct FlowPbpbPikp { std::vector eventCuts; Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex; - Filter trackFilter = (nabs(aod::track::dcaXY) < cfgCutDCAxy) && (nabs(aod::track::dcaZ) < cfgCutDCAz) && (nabs(aod::track::eta) < cfgCutEta) && (aod::track::pt > cfgCutPtPOIMin) && (aod::track::pt < cfgCutPtPOIMax) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true)) && (aod::track::tpcChi2NCl < cfgCutChi2prTPCcls); + Filter trackFilter = (nabs(aod::track::dcaXY) < cfgCutDCAxy) && (nabs(aod::track::dcaZ) < cfgCutDCAz) && (nabs(aod::track::eta) < cfgCutEta) && (aod::track::pt > cfgCutPtPOIMin) && (aod::track::pt < cfgCutPtPOIMax) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t)true)) && (aod::track::tpcChi2NCl < cfgCutChi2prTPCcls); using AodCollisions = soa::Filtered>; using AodTracksWithoutBayes = soa::Filtered>; @@ -474,7 +474,7 @@ struct FlowPbpbPikp { } template - void fillQA(const TCollision collision, const TTrack track, int pidIndex, double wacc) + void fillQA(const TCollision& collision, const TTrack& track, int pidIndex, double wacc) { histos.fill(HIST("partCount"), pidIndex - 1, collision.centFT0C(), track.pt()); switch (pidIndex) { @@ -521,7 +521,7 @@ struct FlowPbpbPikp { } // end of fillQA template - int getNsigmaPIDTpcTof(TTrack track) + int getNsigmaPIDTpcTof(const TTrack& track) { // Computing Nsigma arrays for pion, kaon, and protons std::array nSigmaTPC = {track.tpcNSigmaPi(), track.tpcNSigmaKa(), track.tpcNSigmaPr()}; @@ -552,7 +552,7 @@ struct FlowPbpbPikp { } template - int getNsigmaPIDAssymmetric(TTrack track) + int getNsigmaPIDAssymmetric(const TTrack& track) { // Computing Nsigma arrays for pion, kaon, and protons std::array nSigmaTPC = {track.tpcNSigmaPi(), track.tpcNSigmaKa(), track.tpcNSigmaPr()}; @@ -706,7 +706,7 @@ struct FlowPbpbPikp { } template - double getAcceptance(TTrack track, const TCollision collision, int index) + double getAcceptance(const TTrack& track, const TCollision& collision, int index) { // 0 = ref, 1 = ch, 2 = pi, 3 = ka, 4 = pr if (index < 0 || index >= kCount_OutputSpecies) { return 1; @@ -735,7 +735,7 @@ struct FlowPbpbPikp { } template - void fillWeights(const TTrack track, const TCollision collision, const int& pid_index, const int& run) + void fillWeights(const TTrack& track, const TCollision& collision, const int& pid_index, const int& run) { double cent = collision.centFT0C(); double vtxz = collision.posZ(); @@ -783,7 +783,7 @@ struct FlowPbpbPikp { } template - bool selectionEvent(TCollision collision, const int mult, const float cent) + bool selectionEvent(const TCollision& collision, const int mult, const float cent) { histos.fill(HIST("hEventCount"), kFilteredEvents); if (!collision.sel8()) { diff --git a/PWGCF/Flow/Tasks/flowPidCme.cxx b/PWGCF/Flow/Tasks/flowPidCme.cxx index 46cbb863bde..1194b1d517c 100644 --- a/PWGCF/Flow/Tasks/flowPidCme.cxx +++ b/PWGCF/Flow/Tasks/flowPidCme.cxx @@ -230,14 +230,14 @@ struct FillPIDcolums { }; template - bool selTrackPid(const TrackType track) + bool selTrackPid(const TrackType& track) { if ((track.pt() < cfgMinPtPID) || (track.pt() > cfgMaxPtPID)) return false; if (std::abs(track.eta()) > cfgMaxEtaPID) return false; if (cfgRequireGlobalTrack) { - if (!(track.isGlobalTrackSDD() == (uint8_t) true)) + if (!(track.isGlobalTrackSDD() == (uint8_t)true)) return false; } if (cfgUseCostomTrackCuts) { @@ -2624,7 +2624,7 @@ struct FlowPidCme { } template - bool selTrack(const TrackType track, float centrality) + bool selTrack(const TrackType& track, float centrality) { if (cfgkOpenDebugPIDCME) { LOGF(info, "====================Entering track selection============================="); diff --git a/PWGCF/Flow/Tasks/flowPtEfficiency.cxx b/PWGCF/Flow/Tasks/flowPtEfficiency.cxx index fadb727ba77..e22a4c36566 100644 --- a/PWGCF/Flow/Tasks/flowPtEfficiency.cxx +++ b/PWGCF/Flow/Tasks/flowPtEfficiency.cxx @@ -391,7 +391,7 @@ struct FlowPtEfficiency { } template - bool trackSelected(TTrack track) + bool trackSelected(const TTrack& track) { if (cfgkIsTrackGlobal && !track.isGlobalTrack()) { return false; diff --git a/PWGCF/Flow/Tasks/flowQa.cxx b/PWGCF/Flow/Tasks/flowQa.cxx index ff8c227fa28..2221f27a321 100644 --- a/PWGCF/Flow/Tasks/flowQa.cxx +++ b/PWGCF/Flow/Tasks/flowQa.cxx @@ -494,7 +494,7 @@ struct FlowQa { } template - bool eventSelected(TCollision collision) + bool eventSelected(const TCollision& collision) { registry.fill(HIST("hEventCountSpecific"), 0.5); if (cfgEvSelkNoSameBunchPileup && !collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { @@ -546,7 +546,7 @@ struct FlowQa { } template - void eventCounterQA(TCollision collision) + void eventCounterQA(const TCollision& collision) { registry.fill(HIST("hEventCountTentative"), 0.5); // Regradless of the event selection, fill the event counter histograms @@ -568,7 +568,7 @@ struct FlowQa { } template - bool trackSelected(TTrack track) + bool trackSelected(const TTrack& track) { // track type selection bool passTrackTypeSelection = false; diff --git a/PWGCF/Flow/Tasks/flowRunbyRun.cxx b/PWGCF/Flow/Tasks/flowRunbyRun.cxx index 149ec2b87e2..bf4bb37d581 100644 --- a/PWGCF/Flow/Tasks/flowRunbyRun.cxx +++ b/PWGCF/Flow/Tasks/flowRunbyRun.cxx @@ -285,7 +285,7 @@ struct FlowRunbyRun { } template - void fillProfile(const GFW::CorrConfig& corrconf, std::shared_ptr profile, const double& cent) + void fillProfile(const GFW::CorrConfig& corrconf, const std::shared_ptr& profile, const double& cent) { double dnx, val; dnx = fGFW->Calculate(corrconf, 0, kTRUE).real(); @@ -441,7 +441,7 @@ struct FlowRunbyRun { } template - bool eventSelected(TCollision collision, const int multTrk, const float centrality, const int runNumber) + bool eventSelected(const TCollision& collision, const int multTrk, const float centrality, const int runNumber) { th1sList[runNumber][hEventCountSpecific]->Fill(0.5); if (cfgEvSelkNoSameBunchPileup && !collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { @@ -519,7 +519,7 @@ struct FlowRunbyRun { } template - bool trackSelected(TTrack track) + bool trackSelected(const TTrack& track) { if (cfgCutDCAzPtDepEnabled && (std::fabs(track.dcaZ()) > (0.004f + 0.013f / track.pt()))) return false; diff --git a/PWGCF/Flow/Tasks/flowSP.cxx b/PWGCF/Flow/Tasks/flowSP.cxx index 33e6969ef60..9e04b351488 100644 --- a/PWGCF/Flow/Tasks/flowSP.cxx +++ b/PWGCF/Flow/Tasks/flowSP.cxx @@ -774,7 +774,7 @@ struct FlowSP { } template - ParticleType getTrackPID(TrackObject track) + ParticleType getTrackPID(const TrackObject& track) { float usedNSigmaPi = -1; @@ -978,7 +978,7 @@ struct FlowSP { } template - bool eventSelected(TCollision collision, const int& multTrk) + bool eventSelected(const TCollision& collision, const int& multTrk) { if (!collision.sel8()) return 0; @@ -1081,7 +1081,7 @@ struct FlowSP { } template - bool trackSelected(TrackObject track, const int& field) + bool trackSelected(const TrackObject& track, const int& field) { if (std::fabs(track.eta()) > cfg.cTrackSelsEta) return false; @@ -1137,7 +1137,7 @@ struct FlowSP { } template - inline void fillEventQA(CollisionObject collision, TracksObject tracks) + inline void fillEventQA(const CollisionObject& collision, const TracksObject& tracks) { if (!cfg.cFillEventQA) return; @@ -1182,7 +1182,7 @@ struct FlowSP { } template - inline void fillHistograms(TrackObject track) + inline void fillHistograms(const TrackObject& track) { double weight = spm.wacc[ct][pt] * spm.weff[ct][pt] * spm.centWeight; float scale = 1.0; @@ -1251,7 +1251,7 @@ struct FlowSP { } template - inline void fillTrackQA(TrackObject track) + inline void fillTrackQA(const TrackObject& track) { if (!cfg.cFillTrackQA) return; @@ -1280,7 +1280,7 @@ struct FlowSP { } template - inline void fillPIDQA(TrackObject track) + inline void fillPIDQA(const TrackObject& track) { if (!cfg.cFillTrackQA) return; @@ -1297,7 +1297,7 @@ struct FlowSP { } template - inline void fillMCPtHistos(TrackObject track, int pdgCode) + inline void fillMCPtHistos(const TrackObject& track, int pdgCode) { static constexpr std::string_view Mode[] = {"Gen/", "Reco/"}; @@ -1333,7 +1333,7 @@ struct FlowSP { } template - inline void fillPrimaryHistos(McParticleObject mcparticle) + inline void fillPrimaryHistos(const McParticleObject& mcparticle) { if (!mcparticle.isPhysicalPrimary()) { @@ -1344,7 +1344,7 @@ struct FlowSP { } template - void fillAllQA(TrackObject track) + void fillAllQA(const TrackObject& track) { fillTrackQA(track); fillPIDQA(track); diff --git a/PWGCF/Flow/Tasks/flowTask.cxx b/PWGCF/Flow/Tasks/flowTask.cxx index cc52045a35b..447ceeaa5d6 100644 --- a/PWGCF/Flow/Tasks/flowTask.cxx +++ b/PWGCF/Flow/Tasks/flowTask.cxx @@ -861,7 +861,7 @@ struct FlowTask { } template - inline void fillPtSums(TTrack track, float weff) + inline void fillPtSums(const TTrack& track, float weff) { if (std::abs(track.eta()) < cfgEtaVnPt) { (dt == kGen) ? fFCptgen->fill(1., track.pt()) : fFCpt->fill(weff, track.pt()); @@ -986,7 +986,7 @@ struct FlowTask { } template - bool eventSelected(TCollision collision, const int multTrk, const float centrality) + bool eventSelected(const TCollision& collision, const int multTrk, const float centrality) { registry.fill(HIST("hEventCountSpecific"), 0.5); if (cfgEvSelkNoSameBunchPileup && !collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { @@ -1109,7 +1109,7 @@ struct FlowTask { } template - bool trackSelected(TTrack track) + bool trackSelected(const TTrack& track) { if (cfgTrackCuts->getData()[kDCAxyNSigma][kTrCutObs] && (std::fabs(track.dcaXY()) > cfgFuncParas.fPtDepDCAxy->Eval(track.pt()))) return false; @@ -1119,7 +1119,7 @@ struct FlowTask { } template - bool trackSelectedForNch(TTrack track) + bool trackSelectedForNch(const TTrack& track) { if (cfgTrackCuts->getData()[kDCAxyNSigma][kTrCutNch] && (std::fabs(track.dcaXY()) > cfgFuncParas.fPtDepDCAxyForNch->Eval(track.pt()))) return false; @@ -1129,7 +1129,7 @@ struct FlowTask { } template - bool rejectionTPCoverlap(TTrack track, const int field) + bool rejectionTPCoverlap(const TTrack& track, const int field) { double phimodn = track.phi(); if (field < 0) // for negative polarity field diff --git a/PWGCF/Flow/Tasks/resonancesGfwFlow.cxx b/PWGCF/Flow/Tasks/resonancesGfwFlow.cxx index 5749da5843c..9909d54112d 100644 --- a/PWGCF/Flow/Tasks/resonancesGfwFlow.cxx +++ b/PWGCF/Flow/Tasks/resonancesGfwFlow.cxx @@ -241,7 +241,7 @@ struct ResonancesGfwFlow { ConfigurableAxis axisParticles{"axisParticles", {3, 0, 3}, "axis for different hadrons"}; Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex; - Filter trackFilter = (nabs(aod::track::dcaXY) < cfgCutDCAxy) && (nabs(aod::track::dcaZ) < cfgCutDCAz) && (nabs(aod::track::eta) < cfgCutEta) && (aod::track::pt > cfgCutPtPOIMin) && (aod::track::pt < cfgCutPtPOIMax) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true)) && (aod::track::tpcChi2NCl < cfgCutChi2prTPCcls); + Filter trackFilter = (nabs(aod::track::dcaXY) < cfgCutDCAxy) && (nabs(aod::track::dcaZ) < cfgCutDCAz) && (nabs(aod::track::eta) < cfgCutEta) && (aod::track::pt > cfgCutPtPOIMin) && (aod::track::pt < cfgCutPtPOIMax) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t)true)) && (aod::track::tpcChi2NCl < cfgCutChi2prTPCcls); using AodCollisions = soa::Filtered>; using AodTracksWithoutBayes = soa::Filtered>; @@ -575,7 +575,7 @@ struct ResonancesGfwFlow { return nIndex; } - void fillProfileBoot(const GFW::CorrConfig& corrconf, std::shared_ptr profile, const double& cent) + void fillProfileBoot(const GFW::CorrConfig& corrconf, const std::shared_ptr& profile, const double& cent) { double dnx, val; if (!corrconf.pTDif) { @@ -590,7 +590,7 @@ struct ResonancesGfwFlow { return; } - void fillProfileBoot3D(const GFW::CorrConfig& corrconf, std::shared_ptr profile, const double& cent, TAxis* partaxis) + void fillProfileBoot3D(const GFW::CorrConfig& corrconf, const std::shared_ptr& profile, const double& cent, TAxis* partaxis) { double dnx, val; for (int i = 1; i <= fPtAxis->GetNbins(); i++) { @@ -672,7 +672,7 @@ struct ResonancesGfwFlow { } template - int getNsigmaPIDTpcTof(TTrack track) + int getNsigmaPIDTpcTof(const TTrack& track) { // Computing Nsigma arrays for pion, kaon, and protons std::array nSigmaTPC = {track.tpcNSigmaPi(), track.tpcNSigmaKa(), track.tpcNSigmaPr()}; @@ -703,7 +703,7 @@ struct ResonancesGfwFlow { } template - int getNsigmaPIDAssymmetric(TTrack track) + int getNsigmaPIDAssymmetric(const TTrack& track) { // Computing Nsigma arrays for pion, kaon, and protons std::array nSigmaTPC = {track.tpcNSigmaPi(), track.tpcNSigmaKa(), track.tpcNSigmaPr()}; @@ -796,7 +796,7 @@ struct ResonancesGfwFlow { } template - double getAcceptance(TTrack track, const TCollision collision, int pid_index_reso) + double getAcceptance(const TTrack& track, const TCollision& collision, int pid_index_reso) { // 0 = k0, 1 = lambda, 2 = phi, 3 = anti-lambda, 4 = ref if (pid_index_reso < 0 || pid_index_reso >= kCount_OutputSpecies) { return 1; @@ -825,7 +825,7 @@ struct ResonancesGfwFlow { } template - double getAcceptancePhi(vector mom, const TCollision collision, int pid_index_reso) + double getAcceptancePhi(const vector& mom, const TCollision& collision, int pid_index_reso) { // 0 = k0, 1 = lambda, 2 = phi, 3 = anti-lambda, 4 = ref if (pid_index_reso < 0 || pid_index_reso >= kCount_OutputSpecies) { return 1; @@ -856,7 +856,7 @@ struct ResonancesGfwFlow { } template - void fillWeights(const TTrack track, const TCollision collision, const int& pid_index_reso) + void fillWeights(const TTrack& track, const TCollision& collision, const int& pid_index_reso) { double cent = collision.centFT0C(); double vtxz = collision.posZ(); @@ -922,7 +922,7 @@ struct ResonancesGfwFlow { } template - void resurrectPhi(TTrack trackplus, TTrack trackminus, const TCollision collision, vector plusdaug, vector minusdaug, vector mom, double plusmass, const ConstStr& hist) + void resurrectPhi(const TTrack& trackplus, const TTrack& trackminus, const TCollision& collision, vector plusdaug, vector minusdaug, vector mom, double plusmass, const ConstStr& hist) { for (auto const& [partplus, partminus] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(trackplus, trackminus))) { histos.fill(HIST("hPhiCount"), 0.5); @@ -982,7 +982,7 @@ struct ResonancesGfwFlow { } template - void likeSignPhi(TTrack track, const TCollision collision, double plusmass, const ConstStr& hist) + void likeSignPhi(const TTrack& track, const TCollision& collision, double plusmass, const ConstStr& hist) { ROOT::Math::PxPyPzMVector daug1, daug2, mom; for (auto const& [part1, part2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(track, track))) { @@ -1188,7 +1188,7 @@ struct ResonancesGfwFlow { } template - bool selectionEvent(TCollision collision, const int mult, const float cent) + bool selectionEvent(const TCollision& collision, const int mult, const float cent) { histos.fill(HIST("hEventCount"), kFilteredEvents); if (!collision.sel8()) { diff --git a/PWGCF/GenericFramework/Core/FlowContainer.cxx b/PWGCF/GenericFramework/Core/FlowContainer.cxx index daa553374f2..2ad206770c0 100644 --- a/PWGCF/GenericFramework/Core/FlowContainer.cxx +++ b/PWGCF/GenericFramework/Core/FlowContainer.cxx @@ -31,6 +31,7 @@ #include #include +#include #include ClassImp(FlowContainer); @@ -66,7 +67,7 @@ FlowContainer::~FlowContainer() delete fProf; delete fProfRand; }; -void FlowContainer::Initialize(TObjArray* inputList, const o2::framework::AxisSpec axis, int nRandom) +void FlowContainer::Initialize(TObjArray* inputList, const o2::framework::AxisSpec& axis, int nRandom) { std::vector multiBins = axis.binEdges; int nMultiBins = axis.nBins.value_or(0); @@ -381,7 +382,7 @@ bool FlowContainer::CreateStatisticsProfile(StatisticsType StatType, int arg) } void FlowContainer::SetIDName(TString newname) { - fIDName = newname; + fIDName = std::move(newname); } TProfile* FlowContainer::GetCorrXXVsMulti(const char* order, int l_pti) { diff --git a/PWGCF/GenericFramework/Core/FlowContainer.h b/PWGCF/GenericFramework/Core/FlowContainer.h index 941442a941e..5ec68e6f6b1 100644 --- a/PWGCF/GenericFramework/Core/FlowContainer.h +++ b/PWGCF/GenericFramework/Core/FlowContainer.h @@ -40,7 +40,7 @@ class FlowContainer : public TNamed enum StatisticsType { kSingleSample, kJackKnife, kBootstrap }; - void Initialize(TObjArray* inputList, const o2::framework::AxisSpec axis, int nRandomized = 0); + void Initialize(TObjArray* inputList, const o2::framework::AxisSpec& axis, int nRandomized = 0); void Initialize(TObjArray* inputList, int nMultiBins, double MultiMin, double MultiMax, int nRandomized = 0); bool CreateBinsFromAxis(TAxis* inax); void SetXAxis(TAxis* inax); diff --git a/PWGCF/GenericFramework/Core/FlowPtContainer.cxx b/PWGCF/GenericFramework/Core/FlowPtContainer.cxx index b65c19b9047..15fee5da902 100644 --- a/PWGCF/GenericFramework/Core/FlowPtContainer.cxx +++ b/PWGCF/GenericFramework/Core/FlowPtContainer.cxx @@ -132,7 +132,7 @@ FlowPtContainer::FlowPtContainer(const char* name, const char* title) : TNamed(n arr(), warr(), subevents() {} -void FlowPtContainer::initialise(const o2::framework::AxisSpec axis, const int& maxOrder, const GFWCorrConfigs& configs, const int& nsub) +void FlowPtContainer::initialise(const o2::framework::AxisSpec& axis, const int& maxOrder, const GFWCorrConfigs& configs, const int& nsub) { arr.resize(3 * 3 * 3 * 3); warr.resize(3 * 3 * 3 * 3); @@ -406,7 +406,7 @@ void FlowPtContainer::initialise(int nbinsx, double xlow, double xhigh, const in } LOGF(info, "Container %s initialized with m = %i\n", this->GetName(), mpar); }; -void FlowPtContainer::initialiseSubevent(const o2::framework::AxisSpec axis, const int& maxOrder, const int& nsubev, const int& nsub) +void FlowPtContainer::initialiseSubevent(const o2::framework::AxisSpec& axis, const int& maxOrder, const int& nsubev, const int& nsub) { if (nsubev < 1) { LOGF(fatal, "Need at least one subevent"); diff --git a/PWGCF/GenericFramework/Core/FlowPtContainer.h b/PWGCF/GenericFramework/Core/FlowPtContainer.h index f6641d108f0..863e1ffb918 100644 --- a/PWGCF/GenericFramework/Core/FlowPtContainer.h +++ b/PWGCF/GenericFramework/Core/FlowPtContainer.h @@ -49,11 +49,11 @@ class FlowPtContainer : public TNamed explicit FlowPtContainer(const char* name); ~FlowPtContainer(); FlowPtContainer(const char* name, const char* title); - void initialise(const o2::framework::AxisSpec axis, const int& maxOrder, const o2::analysis::genericframework::GFWCorrConfigs& configs, const int& nsub = 10); + void initialise(const o2::framework::AxisSpec& axis, const int& maxOrder, const o2::analysis::genericframework::GFWCorrConfigs& configs, const int& nsub = 10); void initialise(int nbinsx, double* xbins, const int& maxOrder, const o2::analysis::genericframework::GFWCorrConfigs& configs, const int& nsub = 10); void initialise(int nbinsx, double xlow, double xhigh, const int& maxOrder, const o2::analysis::genericframework::GFWCorrConfigs& configs, const int& nsub = 10); // initial pt-pt correlations with two subevents - void initialiseSubevent(const o2::framework::AxisSpec axis, const int& maxOrder, const int& nsubev = 2, const int& nsub = 10); + void initialiseSubevent(const o2::framework::AxisSpec& axis, const int& maxOrder, const int& nsubev = 2, const int& nsub = 10); void initialiseSubevent(int nbinsx, double* xbins, const int& maxOrder, const int& nsubev = 2, const int& nsub = 10); void initialiseSubevent(int nbinsx, double xlow, double xhigh, const int& maxOrder, const int& nsubev = 2, const int& nsub = 10); void fill(const double& w, const double& pt); diff --git a/PWGCF/GenericFramework/Core/GFW.cxx b/PWGCF/GenericFramework/Core/GFW.cxx index 823d93c5d39..3faf5142531 100644 --- a/PWGCF/GenericFramework/Core/GFW.cxx +++ b/PWGCF/GenericFramework/Core/GFW.cxx @@ -31,7 +31,7 @@ GFW::~GFW() for (auto pItr = fCumulants.begin(); pItr != fCumulants.end(); ++pItr) pItr->DestroyComplexVectorArray(); }; -void GFW::AddRegion(string refName, double lEtaMin, double lEtaMax, int lNpT, int BitMask) +void GFW::AddRegion(const string& refName, double lEtaMin, double lEtaMax, int lNpT, int BitMask) { if (lNpT < 1) { printf("Number of pT bins cannot be less than 1! Not adding anything.\n"); @@ -56,9 +56,9 @@ void GFW::AddRegion(string refName, double lEtaMin, double lEtaMax, int lNpT, in lOneRegion.BitMask = BitMask; // Bit mask AddRegion(lOneRegion); }; -void GFW::AddRegion(string refName, vector lNparVec, double lEtaMin, double lEtaMax, int lNpT, int BitMask) +void GFW::AddRegion(const string& refName, const vector& lNparVec, double lEtaMin, double lEtaMax, int lNpT, int BitMask) { - AddRegion(refName, lEtaMin, lEtaMax, lNpT, BitMask); + AddRegion(std::move(refName), lEtaMin, lEtaMax, lNpT, BitMask); (fRegions.end() - 1)->Nhar = static_cast(lNparVec.size()); (fRegions.end() - 1)->NparVec = lNparVec; (fRegions.end() - 1)->powsDefined = true; @@ -68,14 +68,14 @@ void GFW::AddRegion(string refName, int lNhar, int lNpar, double lEtaMin, double vector tVec = {}; for (int i = 0; i < lNhar; i++) tVec.push_back(lNpar); - AddRegion(refName, tVec, lEtaMin, lEtaMax, lNpT, BitMask); + AddRegion(std::move(refName), tVec, lEtaMin, lEtaMax, lNpT, BitMask); }; void GFW::AddRegion(string refName, int lNhar, int* lNparVec, double lEtaMin, double lEtaMax, int lNpT, int BitMask) { vector tVec = {}; for (int i = 0; i < lNhar; i++) tVec.push_back(lNparVec[i]); - AddRegion(refName, tVec, lEtaMin, lEtaMax, lNpT, BitMask); + AddRegion(std::move(refName), tVec, lEtaMin, lEtaMax, lNpT, BitMask); }; int GFW::CreateRegions() { @@ -246,7 +246,7 @@ GFW::CorrConfig GFW::GetCorrelatorConfig(string config, string head, bool ptdif) while (s_tokenize(harstr, ts, dummys, " ")) ReturnConfig.Hars.at(counter - 1).push_back(stoi(ts)); } - ReturnConfig.Head = head; + ReturnConfig.Head = std::move(head); ReturnConfig.pTDif = ptdif; // ReturnConfig.pTbin = ptbin; fListOfCFGs.push_back(ReturnConfig); @@ -325,7 +325,7 @@ void GFW::InitializePowerArrays() vector>> harSets(static_cast(fRegions.size())); for (const CorrConfig& lConf : fListOfCFGs) { auto HarPerReg = GetHarmonicsSingleConfig(lConf); - for (auto oneHar : HarPerReg) + for (const auto& oneHar : HarPerReg) harSets[oneHar.first].push_back(oneHar.second); } // Now, loop through all combinations of different harmonics for each region and calculate power arrays @@ -343,7 +343,7 @@ complex GFW::Calculate(int poi, vector hars) GFWCumulant* qpoi = &fCumulants.at(poi); return RecursiveCorr(qpoi, qpoi, qpoi, 0, hars); }; -int GFW::FindRegionByName(string refName) +int GFW::FindRegionByName(const string& refName) { for (int i = 0; i < static_cast(fRegions.size()); i++) if (fRegions.at(i).rName == refName) diff --git a/PWGCF/GenericFramework/Core/GFW.h b/PWGCF/GenericFramework/Core/GFW.h index 3263e5c4836..481f5ce6bff 100644 --- a/PWGCF/GenericFramework/Core/GFW.h +++ b/PWGCF/GenericFramework/Core/GFW.h @@ -53,10 +53,10 @@ class GFW ~GFW(); std::vector fRegions; std::vector fCumulants; - void AddRegion(std::string refName, double lEtaMin, double lEtaMax, int lNpT, int BitMask); - void AddRegion(std::string refName, std::vector lNparVec, double lEtaMin, double lEtaMax, int lNpT, int BitMask); // Legacy - void AddRegion(std::string refName, int lNhar, int lNpar, double lEtaMin, double lEtaMax, int lNpT, int BitMask); // Legacy support, all powers are the same - void AddRegion(std::string refName, int lNhar, int* lNparVec, double lEtaMin, double lEtaMax, int lNpT, int BitMask); // Legacy support, array instead of a vector + void AddRegion(const std::string& refName, double lEtaMin, double lEtaMax, int lNpT, int BitMask); + void AddRegion(const std::string& refName, const std::vector& lNparVec, double lEtaMin, double lEtaMax, int lNpT, int BitMask); // Legacy + void AddRegion(std::string refName, int lNhar, int lNpar, double lEtaMin, double lEtaMax, int lNpT, int BitMask); // Legacy support, all powers are the same + void AddRegion(std::string refName, int lNhar, int* lNparVec, double lEtaMin, double lEtaMax, int lNpT, int BitMask); // Legacy support, array instead of a vector int CreateRegions(); void Fill(double eta, int ptin, double phi, double weight, int mask, double secondWeight = -1); void Clear(); @@ -71,9 +71,9 @@ class GFW std::complex TwoRec(int n1, int n2, int p1, int p2, int ptbin, GFWCumulant*, GFWCumulant*, GFWCumulant*); std::complex RecursiveCorr(GFWCumulant* qpoi, GFWCumulant* qref, GFWCumulant* qol, int ptbin, std::vector& hars, std::vector& pows); // POI, Ref. flow, overlapping region std::complex RecursiveCorr(GFWCumulant* qpoi, GFWCumulant* qref, GFWCumulant* qol, int ptbin, std::vector& hars); // POI, Ref. flow, overlapping region - void AddRegion(Region inreg) { fRegions.push_back(inreg); } + void AddRegion(const Region& inreg) { fRegions.push_back(inreg); } Region GetRegion(int index) { return fRegions.at(index); } - int FindRegionByName(std::string refName); + int FindRegionByName(const std::string& refName); std::vector>> GetHarmonicsSingleConfig(const CorrConfig&); // Calculating functions: std::complex Calculate(int poi, int ref, std::vector hars, int ptbin = 0); // For differential, need POI and reference diff --git a/PWGCF/GenericFramework/Core/GFWCumulant.cxx b/PWGCF/GenericFramework/Core/GFWCumulant.cxx index 3a8b1c4d172..f3168eb4bf9 100644 --- a/PWGCF/GenericFramework/Core/GFWCumulant.cxx +++ b/PWGCF/GenericFramework/Core/GFWCumulant.cxx @@ -13,6 +13,7 @@ #include #include +#include #include using std::complex; @@ -103,7 +104,7 @@ void GFWCumulant::CreateComplexVectorArrayVarPower(int N, vector PowVec, in fPow = 0; fPt = Pt; fFilledPts = new bool[Pt]; - fPowVec = PowVec; + fPowVec = std::move(PowVec); fQvector = new complex**[fPt]; for (int i = 0; i < fPt; i++) { fQvector[i] = new complex*[fN]; diff --git a/PWGCF/GenericFramework/Core/GFWPowerArray.cxx b/PWGCF/GenericFramework/Core/GFWPowerArray.cxx index c3aeaf43edb..d8c988b111e 100644 --- a/PWGCF/GenericFramework/Core/GFWPowerArray.cxx +++ b/PWGCF/GenericFramework/Core/GFWPowerArray.cxx @@ -15,6 +15,7 @@ #include #include #include +#include #include using std::string; @@ -33,13 +34,13 @@ int GFWPowerArray::getHighestHarmonic(const HarSet& inhar) }; HarSet GFWPowerArray::TrimVec(HarSet hars, int ind) { - HarSet retVec = hars; + HarSet retVec = std::move(hars); retVec.erase(retVec.begin() + ind); return retVec; }; HarSet GFWPowerArray::AddConstant(HarSet hars, int offset) { - HarSet retVec = hars; + HarSet retVec = std::move(hars); for (int& val : retVec) val += offset; return retVec; @@ -72,19 +73,19 @@ void GFWPowerArray::PrintVector(const HarSet& singleSet) printf(", %i", singleSet[i]); printf("}\n"); } -HarSet GFWPowerArray::GetPowerArray(vector inHarmonics) +HarSet GFWPowerArray::GetPowerArray(const vector& inHarmonics) { // First, find maximum number of particle correlations ( = max power) and maximum (sum of) harmonics int MaxHar = 0; int nMaxPart = 0; - for (HarSet singleSet : inHarmonics) { + for (const HarSet& singleSet : inHarmonics) { int harSum = getHighestHarmonic(singleSet); MaxHar = harSum > MaxHar ? harSum : MaxHar; } // Make a vector with MaxHar+1 entries (entry 0 for sum=0) HarSet retVec = HarSet(MaxHar + 1); // Then loop over all combinations and calculate max powers - for (HarSet singleSet : inHarmonics) { + for (const HarSet& singleSet : inHarmonics) { int lNPart = static_cast(singleSet.size()); // Total number of particles correlated RecursiveFunction(retVec, singleSet, 0, lNPart); // Harmonic sum = 0 is a special case. In principle all 0 cases with non-zero harmonics are captured by the function above, but to calculate normalization, we set all harmonics to 0. This means that sum=0 power is the max number of harmonics/particles being correlated @@ -107,7 +108,7 @@ void GFWPowerArray::PowerArrayTest() HarSet{2, 2}, HarSet{3, 3}}; printf("Input harmonics are:\n"); - for (HarSet inSet : AllHars) + for (const HarSet& inSet : AllHars) PrintVector(inSet); printf("The configuration of powers must then be:\n"); auto vc = GetPowerArray(AllHars); diff --git a/PWGCF/GenericFramework/Core/GFWPowerArray.h b/PWGCF/GenericFramework/Core/GFWPowerArray.h index 30d5444e727..7f83a72a3b7 100644 --- a/PWGCF/GenericFramework/Core/GFWPowerArray.h +++ b/PWGCF/GenericFramework/Core/GFWPowerArray.h @@ -23,7 +23,7 @@ typedef std::vector HarSet; class GFWPowerArray { public: - static HarSet GetPowerArray(std::vector inHarmonics); + static HarSet GetPowerArray(const std::vector& inHarmonics); static void PowerArrayTest(); private: diff --git a/PWGCF/GenericFramework/Core/GFWWeights.cxx b/PWGCF/GenericFramework/Core/GFWWeights.cxx index a0074866f5a..7373995c3e2 100644 --- a/PWGCF/GenericFramework/Core/GFWWeights.cxx +++ b/PWGCF/GenericFramework/Core/GFWWeights.cxx @@ -297,7 +297,7 @@ void GFWWeights::createNUE(bool IntegrateOverCentrality) return; } }; -void GFWWeights::readAndMerge(TString filelinks, TString listName, bool addData, bool addRec, bool addGen) +void GFWWeights::readAndMerge(const TString& filelinks, const TString& listName, bool addData, bool addRec, bool addGen) { FILE* flist = fopen(filelinks.Data(), "r"); char str[150]; diff --git a/PWGCF/GenericFramework/Core/GFWWeights.h b/PWGCF/GenericFramework/Core/GFWWeights.h index 9cecbd337e6..bcec7463647 100644 --- a/PWGCF/GenericFramework/Core/GFWWeights.h +++ b/PWGCF/GenericFramework/Core/GFWWeights.h @@ -51,7 +51,7 @@ class GFWWeights : public TNamed double getIntegratedEfficiency(double pt); void setDataFilled(bool newval) { fDataFilled = newval; } void setMCFilled(bool newval) { fMCFilled = newval; } - void readAndMerge(TString filelinks, TString listName = "OutputList", bool addData = kTRUE, bool addRec = kTRUE, bool addGen = kTRUE); + void readAndMerge(const TString& filelinks, const TString& listName = "OutputList", bool addData = kTRUE, bool addRec = kTRUE, bool addGen = kTRUE); void setPtBins(int Nbins, double* bins); Long64_t Merge(TCollection* collist); void rebinNUA(int nX = 1, int nY = 2, int nZ = 5); diff --git a/PWGCF/GenericFramework/Tasks/flowGfwLightIons.cxx b/PWGCF/GenericFramework/Tasks/flowGfwLightIons.cxx index 3cee62515b7..02db3917bf4 100644 --- a/PWGCF/GenericFramework/Tasks/flowGfwLightIons.cxx +++ b/PWGCF/GenericFramework/Tasks/flowGfwLightIons.cxx @@ -667,7 +667,7 @@ struct FlowGfwLightIons { } template - double getAcceptance(TTrack track, const double& vtxz) + double getAcceptance(const TTrack& track, const double& vtxz) { double wacc = 1; if (cfg.mAcceptance) @@ -676,7 +676,7 @@ struct FlowGfwLightIons { } template - double getEfficiency(TTrack track) + double getEfficiency(const TTrack& track) { double eff = 1.; if (cfg.mEfficiency) @@ -688,7 +688,7 @@ struct FlowGfwLightIons { } template - bool eventSelected(TCollision collision, const int& multTrk, const float& centrality, const int& run) + bool eventSelected(const TCollision& collision, const int& multTrk, const float& centrality, const int& run) { if (cfgEventCutFlags.cfgTVXinTRD) { if (collision.alias_bit(kTVXinTRD)) { @@ -829,7 +829,7 @@ struct FlowGfwLightIons { } template - bool trackSelected(TTrack track) + bool trackSelected(const TTrack& track) { if (cfgDCAxyNSigma && (std::fabs(track.dcaXY()) > fPtDepDCAxy->Eval(track.pt()))) return false; @@ -842,7 +842,7 @@ struct FlowGfwLightIons { }; template - void fillWeights(const TTrack track, const double vtxz, const int& run) + void fillWeights(const TTrack& track, const double vtxz, const int& run) { if (cfgRunByRun) th3sList[run][hNUAref]->Fill(track.phi(), track.eta(), vtxz); @@ -966,7 +966,7 @@ struct FlowGfwLightIons { }; template - void processCollision(TCollision collision, TTracks tracks, const XAxis& xaxis, const int& run) + void processCollision(const TCollision& collision, const TTracks& tracks, const XAxis& xaxis, const int& run) { if (tracks.size() < 1) return; @@ -1071,7 +1071,7 @@ struct FlowGfwLightIons { } template - void fillAcceptedTracks(TTrack track, AcceptedTracks& acceptedTracks) + void fillAcceptedTracks(const TTrack& track, AcceptedTracks& acceptedTracks) { if (posRegionIndex >= 0 && track.eta() > o2::analysis::gfw::regions.GetEtaMin()[posRegionIndex] && track.eta() < o2::analysis::gfw::regions.GetEtaMax()[posRegionIndex]) ++acceptedTracks.nPos; @@ -1159,7 +1159,7 @@ struct FlowGfwLightIons { } template - inline void fillGFW(TTrack track, const double& vtxz, DensityCorr densitycorrections) + inline void fillGFW(const TTrack& track, const double& vtxz, DensityCorr densitycorrections) { bool withinPtRef = (track.pt() > o2::analysis::gfw::ptreflow && track.pt() < o2::analysis::gfw::ptrefup); bool withinPtPOI = (track.pt() > o2::analysis::gfw::ptpoilow && track.pt() < o2::analysis::gfw::ptpoiup); @@ -1191,7 +1191,7 @@ struct FlowGfwLightIons { } template - inline void fillPtSums(TTrack track) + inline void fillPtSums(const TTrack& track) { if (track.pt() < o2::analysis::gfw::ptreflow || track.pt() > o2::analysis::gfw::ptrefup) return; @@ -1225,7 +1225,7 @@ struct FlowGfwLightIons { } template - inline void fillTrackQA(TTrack track, const float vtxz) + inline void fillTrackQA(const TTrack& track, const float vtxz) { if constexpr (dt == kGen) { registry.fill(HIST("MCGen/trackQA/phi_eta_vtxZ"), track.phi(), track.eta(), vtxz); @@ -1250,7 +1250,7 @@ struct FlowGfwLightIons { } template - float getCentrality(TCollision collision) + float getCentrality(const TCollision& collision) { switch (cfgCentEstimator) { case kCentFT0C: @@ -1273,7 +1273,7 @@ struct FlowGfwLightIons { } template - inline void fillEventQA(TCollision collision, XAxis xaxis) + inline void fillEventQA(const TCollision& collision, XAxis xaxis) { if constexpr (framework::has_type_v) { registry.fill(HIST("eventQA/") + HIST(FillTimeName[ft]) + HIST("globalTracks_centT0C"), collision.centFT0C(), xaxis.multiplicity); diff --git a/PWGCF/JCorran/Tasks/jEPDzeroFlowAnalysis.cxx b/PWGCF/JCorran/Tasks/jEPDzeroFlowAnalysis.cxx index 0240170f245..baeedae8cf0 100644 --- a/PWGCF/JCorran/Tasks/jEPDzeroFlowAnalysis.cxx +++ b/PWGCF/JCorran/Tasks/jEPDzeroFlowAnalysis.cxx @@ -119,7 +119,7 @@ struct jEPDzeroFlowAnalysis { } template - bool eventSelected(TCollision collision) + bool eventSelected(const TCollision& collision) { if (!collision.sel8()) { return false; diff --git a/PWGCF/MultiparticleCorrelations/Tasks/multiparticle-correlations-ar.cxx b/PWGCF/MultiparticleCorrelations/Tasks/multiparticle-correlations-ar.cxx index 284259d9988..2814c562225 100644 --- a/PWGCF/MultiparticleCorrelations/Tasks/multiparticle-correlations-ar.cxx +++ b/PWGCF/MultiparticleCorrelations/Tasks/multiparticle-correlations-ar.cxx @@ -216,7 +216,7 @@ inline float abs(float vx, float vy, float vz) } // generice function for checking if the value of a variable passes a cut -inline bool SurviveCut(LabeledArray ConfigValue, float Value) +inline bool SurviveCut(const LabeledArray& ConfigValue, float Value) { uint32_t row = 0; bool flag = true; @@ -616,7 +616,7 @@ struct MultiParticleCorrelationsARTask { for (auto SC : cfgSC.value) { Correlators = MapSCToCor(SC); fMapScToCor.insert({SC, Correlators}); - for (auto cor : Correlators) { + for (const auto& cor : Correlators) { if (std::find(fCorrelators.begin(), fCorrelators.end(), cor) != fCorrelators.end()) { continue; @@ -749,7 +749,7 @@ struct MultiParticleCorrelationsARTask { // function for checking if collision survives event cuts template - bool SurviveEventCuts(CollisionObject collision, TrackObject tracks) + bool SurviveEventCuts(const CollisionObject& collision, const TrackObject& tracks) { // Check if event survives event cuts, where we can get the values for the variables immediately @@ -780,7 +780,7 @@ struct MultiParticleCorrelationsARTask { // function for checking if track survices trach cuts template - bool SurviveTrackCuts(TrackObject track) + bool SurviveTrackCuts(const TrackObject& track) { // if all SurviveCut return true, the function will return true // if at least one fails, it will return false @@ -797,7 +797,7 @@ struct MultiParticleCorrelationsARTask { } template - void FillAzimuthalAngle(TrackObject track) + void FillAzimuthalAngle(const TrackObject& track) { double angle = track.phi(); double weight = GetWeight(track); @@ -817,7 +817,7 @@ struct MultiParticleCorrelationsARTask { }; template - double GetWeight(TrackObject /*track*/) + double GetWeight(const TrackObject& /*track*/) { // for efficiency corrections, tbi return 1.; diff --git a/PWGCF/TableProducer/dptDptFilter.h b/PWGCF/TableProducer/dptDptFilter.h index 3d85ab3a79d..ba712975084 100644 --- a/PWGCF/TableProducer/dptDptFilter.h +++ b/PWGCF/TableProducer/dptDptFilter.h @@ -60,6 +60,7 @@ #include #include #include +#include #include namespace o2 @@ -560,7 +561,7 @@ struct DptDptTrackSelection { } DptDptTrackSelection(TrackSelection* stdTs, std::function ptDepCut, TList* outputList, const char* name) : stdTrackSelection(stdTs), - maxDcazPtDep(ptDepCut) + maxDcazPtDep(std::move(ptDepCut)) { passedHistogram = new TH1F(name, name, ptbins, ptlow, ptup); outputList->Add(passedHistogram); @@ -577,7 +578,7 @@ struct DptDptTrackSelection { } void setMaxDcazPtDep(std::function ptDepCut) { - maxDcazPtDep = ptDepCut; + maxDcazPtDep = std::move(ptDepCut); } void setRequirePvContributor(bool pvc = true) { @@ -1210,7 +1211,7 @@ inline float extractMultiplicity(CollisionObject const& collision, CentMultEstim /// \brief Centrality/multiplicity percentile template requires(o2::aod::HasRun2Centrality) -float getCentMultPercentile(CollisionObject collision) +float getCentMultPercentile(const CollisionObject& collision) { switch (fCentMultEstimator) { case CentMultV0M: @@ -1226,7 +1227,7 @@ float getCentMultPercentile(CollisionObject collision) template requires(o2::aod::HasCentrality) -float getCentMultPercentile(CollisionObject collision) +float getCentMultPercentile(const CollisionObject& collision) { switch (fCentMultEstimator) { case CentMultFV0A: @@ -1246,9 +1247,9 @@ float getCentMultPercentile(CollisionObject collision) /// \brief Centrality selection when there is centrality/multiplicity information template -inline bool centralitySelectionMult(CollisionObject collision, float& centmult) +inline bool centralitySelectionMult(const CollisionObject& collision, float& centmult) { - float mult = getCentMultPercentile(collision); + float mult = getCentMultPercentile(std::move(collision)); if (mult < ValidPercentileUpLimit && ValidPercentileLowLimit < mult) { centmult = mult; collisionFlags.set(CollSelCENTRALITYBIT); @@ -1365,7 +1366,7 @@ inline bool isCollisionNotExcluded() /// \brief select on the collision occupancy /// \return true if collison passes the occupancy cut false otherwise template -inline bool selectOnOccupancy(CollisionObject collision) +inline bool selectOnOccupancy(const CollisionObject& collision) { switch (fOccupancyEstimation) { case OccupancyNOOCC: @@ -1583,7 +1584,7 @@ struct TpcExcludeTrack { } } - void setCuts(std::string pLowCut, std::string pUpCut, std::string nLowCut, std::string nUpCut) + void setCuts(const std::string& pLowCut, const std::string& pUpCut, const std::string& nLowCut, const std::string& nUpCut) { LOGF(info, "Setting the TPC exclusion cuts: pLow=%s, pUp=%s, nLow=%s, nUp=%s", pLowCut, pUpCut, nLowCut, nUpCut); positiveLowCut = new TF1("posLowCut", pLowCut.c_str(), ptlow, ptup); diff --git a/PWGCF/Tasks/correlations.cxx b/PWGCF/Tasks/correlations.cxx index f8dce2e6257..e2ecfbe4bef 100644 --- a/PWGCF/Tasks/correlations.cxx +++ b/PWGCF/Tasks/correlations.cxx @@ -461,7 +461,7 @@ struct CorrelationTask { } template - bool fillCollisionAOD(TTarget target, TCollision collision, float multiplicity) + bool fillCollisionAOD(TTarget target, const TCollision& collision, float multiplicity) { target->fillEvent(multiplicity, CorrelationContainer::kCFStepAll); diff --git a/PWGCF/Tasks/dptDptCorrelations.cxx b/PWGCF/Tasks/dptDptCorrelations.cxx index 0868ab02905..4ec5b4125f9 100644 --- a/PWGCF/Tasks/dptDptCorrelations.cxx +++ b/PWGCF/Tasks/dptDptCorrelations.cxx @@ -1023,7 +1023,7 @@ struct DptDptCorrelations { std::vector cfgnames = {"cfgElectronPIDSelection", "cfgMuonPIDSelection", "cfgPionPIDSelection", "cfgKaonPIDSelection", "cfgProtonPIDSelection"}; std::vector spids = {0, 1, 2, 3, 4}; for (uint i = 0; i < cfgnames.size(); ++i) { - auto includeIt = [&pidselector, &initContext](int spid, auto name) { + auto includeIt = [&pidselector, &initContext](int spid, const auto& name) { bool mUseIt = false; bool mExcludeIt = false; if (getTaskOptionValue(initContext, "dpt-dpt-filter-tracks", TString::Format("%s.mUseIt", name.c_str()).Data(), mUseIt, false) && @@ -1097,7 +1097,7 @@ struct DptDptCorrelations { } for (int i = 0; i < ncmranges; ++i) { - auto initializeCEInstance = [&fGlobalOutputList](auto dce, auto name, bool im, bool corr) { + auto initializeCEInstance = [&fGlobalOutputList](auto dce, const auto& name, bool im, bool corr) { /* crete the output list for the passed centrality/multiplicity range */ TList* fOutputList = new TList(); fOutputList->SetName(name); @@ -1187,7 +1187,7 @@ struct DptDptCorrelations { /// \brief Get the data collecting engine index corresponding to the passed collision template - int getDCEindex(FilteredCollision collision) + int getDCEindex(const FilteredCollision& collision) { int ixDCE = -1; float cm = collision.centmult(); diff --git a/PWGCF/Tutorial/CFTutorialTask0.cxx b/PWGCF/Tutorial/CFTutorialTask0.cxx index 35d4763dca4..c1acd7899f7 100644 --- a/PWGCF/Tutorial/CFTutorialTask0.cxx +++ b/PWGCF/Tutorial/CFTutorialTask0.cxx @@ -60,7 +60,7 @@ struct CFTutorialTask0 { } histos.fill(HIST("hZvtx_after_sel"), coll.posZ()); - for (auto track : inputTracks) { // Loop over tracks + for (const auto& track : inputTracks) { // Loop over tracks histos.fill(HIST("hP"), track.p()); histos.fill(HIST("hPt"), track.pt()); } diff --git a/PWGCF/Tutorial/CFTutorialTask1.cxx b/PWGCF/Tutorial/CFTutorialTask1.cxx index e4d30fe5f12..403e4518ed0 100644 --- a/PWGCF/Tutorial/CFTutorialTask1.cxx +++ b/PWGCF/Tutorial/CFTutorialTask1.cxx @@ -78,7 +78,7 @@ struct CFTutorialTask1 { } histos.fill(HIST("hZvtx_after_sel"), coll.posZ()); - for (auto track : inputTracks) { // Loop over tracks + for (const auto& track : inputTracks) { // Loop over tracks if (fabs(track.eta()) > 0.8) { continue; } diff --git a/PWGCF/Tutorial/CFTutorialTask2.cxx b/PWGCF/Tutorial/CFTutorialTask2.cxx index c8ba5cca9ff..c4dc0de477a 100644 --- a/PWGCF/Tutorial/CFTutorialTask2.cxx +++ b/PWGCF/Tutorial/CFTutorialTask2.cxx @@ -91,7 +91,7 @@ struct CFTutorialTask2 { { histos.fill(HIST("hZvtx"), coll.posZ()); - for (auto track : inputTracks) { + for (const auto& track : inputTracks) { if (fabs(track.tpcNSigmaPr()) > ConfMinNSigmaTPCCut) { // TPCNSigmaPr is a dynamic column and it is not compatible with Filters continue; } diff --git a/PWGCF/Tutorial/CFTutorialTask3.cxx b/PWGCF/Tutorial/CFTutorialTask3.cxx index 4ece0be89e1..d1a9d200e22 100644 --- a/PWGCF/Tutorial/CFTutorialTask3.cxx +++ b/PWGCF/Tutorial/CFTutorialTask3.cxx @@ -100,7 +100,7 @@ struct CFTutorialTask3 { auto groupNegative = negative->sliceByCached(aod::track::collisionId, coll.globalIndex(), cache); histos.fill(HIST("hZvtx"), coll.posZ()); - for (auto track : groupPositive) { + for (const auto& track : groupPositive) { histos.fill(HIST("hChargePos"), track.sign()); histos.fill(HIST("hP"), track.p()); histos.fill(HIST("hPt"), track.pt()); @@ -108,7 +108,7 @@ struct CFTutorialTask3 { histos.fill(HIST("hNsigmaTPCP"), track.p(), track.tpcNSigmaPi()); } - for (auto track : groupNegative) { + for (const auto& track : groupNegative) { histos.fill(HIST("hChargeNeg"), track.sign()); histos.fill(HIST("hP"), track.p()); histos.fill(HIST("hPt"), track.pt()); diff --git a/PWGCF/Tutorial/CFTutorialTask4.cxx b/PWGCF/Tutorial/CFTutorialTask4.cxx index 22056bb0957..b523c49770d 100644 --- a/PWGCF/Tutorial/CFTutorialTask4.cxx +++ b/PWGCF/Tutorial/CFTutorialTask4.cxx @@ -106,7 +106,7 @@ struct CFTutorialTask4 { auto groupNegative = negative->sliceByCached(aod::track::collisionId, coll.globalIndex(), cache); histos.fill(HIST("hZvtx"), coll.posZ()); - for (auto track : groupPositive) { + for (const auto& track : groupPositive) { histos.fill(HIST("hChargePos"), track.sign()); histos.fill(HIST("hP"), track.p()); histos.fill(HIST("hPt"), track.pt()); @@ -114,7 +114,7 @@ struct CFTutorialTask4 { histos.fill(HIST("hNsigmaTPCP"), track.p(), track.tpcNSigmaPi()); } - for (auto track : groupNegative) { + for (const auto& track : groupNegative) { histos.fill(HIST("hChargeNeg"), track.sign()); histos.fill(HIST("hP"), track.p()); histos.fill(HIST("hPt"), track.pt()); diff --git a/PWGCF/Tutorial/CFTutorialTask5.cxx b/PWGCF/Tutorial/CFTutorialTask5.cxx index a3d087ef42f..065fd3da043 100644 --- a/PWGCF/Tutorial/CFTutorialTask5.cxx +++ b/PWGCF/Tutorial/CFTutorialTask5.cxx @@ -116,7 +116,7 @@ struct CFTutorialTask5 { auto groupNegative = negative->sliceByCached(aod::track::collisionId, coll.globalIndex(), cache); histos.fill(HIST("hZvtx"), coll.posZ()); - for (auto track : groupPositive) { + for (const auto& track : groupPositive) { histos.fill(HIST("hChargePos"), track.sign()); histos.fill(HIST("hP"), track.p()); histos.fill(HIST("hPt"), track.pt()); @@ -124,7 +124,7 @@ struct CFTutorialTask5 { histos.fill(HIST("hNsigmaTPCP"), track.p(), track.tpcNSigmaPi()); } - for (auto track : groupNegative) { + for (const auto& track : groupNegative) { histos.fill(HIST("hChargeNeg"), track.sign()); histos.fill(HIST("hP"), track.p()); histos.fill(HIST("hPt"), track.pt()); diff --git a/PWGCF/TwoParticleCorrelations/Core/EventSelectionFilterAndAnalysis.cxx b/PWGCF/TwoParticleCorrelations/Core/EventSelectionFilterAndAnalysis.cxx index cf70ab289db..3d8090a56c1 100644 --- a/PWGCF/TwoParticleCorrelations/Core/EventSelectionFilterAndAnalysis.cxx +++ b/PWGCF/TwoParticleCorrelations/Core/EventSelectionFilterAndAnalysis.cxx @@ -38,7 +38,7 @@ using namespace o2; using namespace o2::analysis::PWGCF; using namespace boost; -EventSelectionConfigurable::EventSelectionConfigurable(std::vector bfieldsel, +EventSelectionConfigurable::EventSelectionConfigurable(const std::vector& bfieldsel, std::vector multsel, std::vector trigsel, std::vector zvtxsel, @@ -49,7 +49,7 @@ EventSelectionConfigurable::EventSelectionConfigurable(std::vector mZVertexSel(""), mPileUpRejection("") { - auto storeCutString = [](auto& selvector, std::string selname) { + auto storeCutString = [](auto& selvector, const std::string& selname) { if (selvector.size() != 0) { if (selvector.size() == 1) { if (selvector[0].size() != 0) { @@ -61,7 +61,7 @@ EventSelectionConfigurable::EventSelectionConfigurable(std::vector TString scut = selname + "{cwv{"; bool def = true; bool firstvar = true; - for (auto cut : selvector) { + for (const auto& cut : selvector) { if (def) { scut += cut + ':'; def = false; @@ -141,7 +141,7 @@ EventSelectionFilterAndAnalysis::EventSelectionFilterAndAnalysis(const EventSele TString cutString = "eventsel{"; bool first = true; - auto appendCut = [&cutString, &first](std::string str) { + auto appendCut = [&cutString, &first](const std::string& str) { if (str.size() > 0) { if (first) { cutString += str; diff --git a/PWGCF/TwoParticleCorrelations/Core/EventSelectionFilterAndAnalysis.h b/PWGCF/TwoParticleCorrelations/Core/EventSelectionFilterAndAnalysis.h index fb7ba6b35f0..5030f011be7 100644 --- a/PWGCF/TwoParticleCorrelations/Core/EventSelectionFilterAndAnalysis.h +++ b/PWGCF/TwoParticleCorrelations/Core/EventSelectionFilterAndAnalysis.h @@ -25,6 +25,7 @@ #include #include +#include #include namespace o2 @@ -47,10 +48,10 @@ class EventSelectionConfigurable std::string trigsel = "", std::string zvtxsel = "", std::string pileuprej = "") - : mBFiledSel(bfieldsel), mMultSel{multsel}, mTriggerSel{trigsel}, mZVertexSel{zvtxsel}, mPileUpRejection{pileuprej} + : mBFiledSel(std::move(bfieldsel)), mMultSel{std::move(multsel)}, mTriggerSel{std::move(trigsel)}, mZVertexSel{std::move(zvtxsel)}, mPileUpRejection{std::move(pileuprej)} { } - EventSelectionConfigurable(std::vector bfieldsel, + EventSelectionConfigurable(const std::vector& bfieldsel, std::vector multsel, std::vector trigsel, std::vector zvtxsel, diff --git a/PWGCF/TwoParticleCorrelations/Core/PIDSelectionFilterAndAnalysis.cxx b/PWGCF/TwoParticleCorrelations/Core/PIDSelectionFilterAndAnalysis.cxx index b35b36dc202..3e1c7419742 100644 --- a/PWGCF/TwoParticleCorrelations/Core/PIDSelectionFilterAndAnalysis.cxx +++ b/PWGCF/TwoParticleCorrelations/Core/PIDSelectionFilterAndAnalysis.cxx @@ -59,7 +59,7 @@ PIDSelectionConfigurable::PIDSelectionConfigurable(std::vector pidt mPidBaySel_ka{}, mPidBaySel_pr{} { - auto storeCutString = [](auto& selvector, std::string selname) { + auto storeCutString = [](auto& selvector, const std::string& selname) { if (selvector.size() != 0) { if (selvector.size() == 1) { if (selvector[0].size() != 0) { @@ -71,7 +71,7 @@ PIDSelectionConfigurable::PIDSelectionConfigurable(std::vector pidt TString scut = selname + "{cwv{"; bool def = true; bool firstvar = true; - for (auto cut : selvector) { + for (const auto& cut : selvector) { if (def) { scut += cut + ':'; def = false; @@ -151,7 +151,7 @@ PIDSelectionFilterAndAnalysis::PIDSelectionFilterAndAnalysis(const PIDSelectionC TString cutString = "pidsel{"; bool first = true; - auto appendCut = [&cutString, &first](std::string str) { + auto appendCut = [&cutString, &first](const std::string& str) { if (str.size() > 0) { if (first) { cutString += str; @@ -213,7 +213,7 @@ PIDSelectionFilterAndAnalysis::~PIDSelectionFilterAndAnalysis() int PIDSelectionFilterAndAnalysis::CalculateMaskLength() { int length = 0; - auto addLength = [&](auto bricklst) { + auto addLength = [&](const auto& bricklst) { for (auto brick : bricklst) { if (brick != nullptr) { length += brick->Length(); @@ -261,7 +261,7 @@ void PIDSelectionFilterAndAnalysis::ConstructCutFromString(const TString& cutstr LOGF(fatal, "PIDSelectionFilterAndAnalysis::::ConstructCutFromString. Wrong RE: %s, try pidsel{tpcsel{tpcpi{cwv{rg{-3.0,3.0}:rg{-2.0,2.0},rg{-3.0,5.0}}}}} for instance", cutstr.Data()); } LOGF(info, "Captured %s", m[1].str().c_str()); - auto handleDetectorLevel = [](std::string detector, auto& bricklst, std::string cut) { + auto handleDetectorLevel = [](const std::string& detector, auto& bricklst, const std::string& cut) { std::set allowed = {"lim", "th", "rg", "xrg", "cwv", "mrg"}; TString lev3str = cut; while (lev3str.Length() != 0) { @@ -329,7 +329,7 @@ void PIDSelectionFilterAndAnalysis::StoreArmedMask() mOptArmedMask.clear(); mForcedArmedMask = 0UL; int bit = 0; - auto armedList = [&](auto bricklst) { + auto armedList = [&](const auto& bricklst) { auto armedBrick = [&](auto brick, bool opt = false) { if (brick != nullptr) { std::vector res = brick->IsArmed(); diff --git a/PWGCF/TwoParticleCorrelations/Core/PIDSelectionFilterAndAnalysis.h b/PWGCF/TwoParticleCorrelations/Core/PIDSelectionFilterAndAnalysis.h index 421edf90781..9c6d4d5ead0 100644 --- a/PWGCF/TwoParticleCorrelations/Core/PIDSelectionFilterAndAnalysis.h +++ b/PWGCF/TwoParticleCorrelations/Core/PIDSelectionFilterAndAnalysis.h @@ -21,6 +21,7 @@ #include #include +#include #include #undef INCORPORATEBAYESIANPID @@ -53,16 +54,16 @@ class PIDSelectionConfigurable #else PIDSelectionConfigurable(std::string pidtpcel = "", std::string pidtpcmu = "", std::string pidtpcpi = "", std::string pidtpcka = "", std::string pidtpcpr = "", std::string pidtofel = "", std::string pidtofmu = "", std::string pidtofpi = "", std::string pidtofka = "", std::string pidtofpr = "") - : mPidTpcSel_el{pidtpcel}, - mPidTpcSel_mu{pidtpcmu}, - mPidTpcSel_pi{pidtpcpi}, - mPidTpcSel_ka{pidtpcka}, - mPidTpcSel_pr{pidtpcpr}, - mPidTofSel_el{pidtofel}, - mPidTofSel_mu{pidtofmu}, - mPidTofSel_pi{pidtofpi}, - mPidTofSel_ka{pidtofka}, - mPidTofSel_pr{pidtofpr} + : mPidTpcSel_el{std::move(pidtpcel)}, + mPidTpcSel_mu{std::move(pidtpcmu)}, + mPidTpcSel_pi{std::move(pidtpcpi)}, + mPidTpcSel_ka{std::move(pidtpcka)}, + mPidTpcSel_pr{std::move(pidtpcpr)}, + mPidTofSel_el{std::move(pidtofel)}, + mPidTofSel_mu{std::move(pidtofmu)}, + mPidTofSel_pi{std::move(pidtofpi)}, + mPidTofSel_ka{std::move(pidtofka)}, + mPidTofSel_pr{std::move(pidtofpr)} { } PIDSelectionConfigurable(std::vector pidtpcel, std::vector pidtpcmu, std::vector pidtpcpi, std::vector pidtpcka, std::vector pidtpcpr, diff --git a/PWGCF/TwoParticleCorrelations/Core/SkimmingConfigurableCuts.h b/PWGCF/TwoParticleCorrelations/Core/SkimmingConfigurableCuts.h index 68d7f9671a4..8c3ca4f2094 100644 --- a/PWGCF/TwoParticleCorrelations/Core/SkimmingConfigurableCuts.h +++ b/PWGCF/TwoParticleCorrelations/Core/SkimmingConfigurableCuts.h @@ -572,9 +572,9 @@ class TrackSelectionBrick : public SpecialCutBrick void SetMaxDcaXY(float maxDcaXY) { mMaxDcaXY = maxDcaXY; } void SetMaxDcaZ(float maxDcaZ) { mMaxDcaZ = maxDcaZ; } - void SetMaxDcaXYPtDep(std::function ptDepCut) { mMaxDcaXYPtDep = ptDepCut; } - void SetRequireHitsInITSLayers(int8_t minNRequiredHits, std::set requiredLayers) { mRequiredITSHits.push_back(std::make_pair(minNRequiredHits, requiredLayers)); } - void SetRequireNoHitsInITSLayers(std::set excludedLayers) { mRequiredITSHits.push_back(std::make_pair(-1, excludedLayers)); } + void SetMaxDcaXYPtDep(std::function ptDepCut) { mMaxDcaXYPtDep = std::move(ptDepCut); } + void SetRequireHitsInITSLayers(int8_t minNRequiredHits, const std::set& requiredLayers) { mRequiredITSHits.push_back(std::make_pair(minNRequiredHits, requiredLayers)); } + void SetRequireNoHitsInITSLayers(const std::set& excludedLayers) { mRequiredITSHits.push_back(std::make_pair(-1, excludedLayers)); } void ResetITSRequirements() { mRequiredITSHits.clear(); } void DisableNClustersTPCCheck(bool disable = true) { mCheckNClustersTPC = not disable; } diff --git a/PWGCF/TwoParticleCorrelations/Core/TrackSelectionFilterAndAnalysis.cxx b/PWGCF/TwoParticleCorrelations/Core/TrackSelectionFilterAndAnalysis.cxx index 695acf9e762..65b9149c6ca 100644 --- a/PWGCF/TwoParticleCorrelations/Core/TrackSelectionFilterAndAnalysis.cxx +++ b/PWGCF/TwoParticleCorrelations/Core/TrackSelectionFilterAndAnalysis.cxx @@ -36,7 +36,7 @@ using namespace o2::analysis::PWGCF; using namespace boost; /// \brief Constructor adapted to hyperloop -TrackSelectionConfigurable::TrackSelectionConfigurable(std::vector ttype, +TrackSelectionConfigurable::TrackSelectionConfigurable(const std::vector& ttype, std::vector nclstpc, std::vector nxrtpc, std::vector nclsits, @@ -59,7 +59,7 @@ TrackSelectionConfigurable::TrackSelectionConfigurable(std::vector mPtRange{}, mEtaRange{} { - auto storeCutString = [](auto& selvector, std::string selname) { + auto storeCutString = [](auto& selvector, const std::string& selname) { if (selvector.size() != 0) { if (selvector.size() == 1) { if (selvector[0].size() != 0) { @@ -71,7 +71,7 @@ TrackSelectionConfigurable::TrackSelectionConfigurable(std::vector TString scut = selname + "{cwv{"; bool def = true; bool firstvar = true; - for (auto cut : selvector) { + for (const auto& cut : selvector) { if (def) { scut += cut + ':'; def = false; @@ -191,7 +191,7 @@ TrackSelectionFilterAndAnalysis::TrackSelectionFilterAndAnalysis(const TrackSele cutString += ";"; bool first = true; - auto appendCut = [&cutString, &first](std::string str) { + auto appendCut = [&cutString, &first](const std::string& str) { if (str.size() > 0) { if (first) { cutString += str; diff --git a/PWGCF/TwoParticleCorrelations/Core/TrackSelectionFilterAndAnalysis.h b/PWGCF/TwoParticleCorrelations/Core/TrackSelectionFilterAndAnalysis.h index 75ad4aed4e1..f1ebbfe9084 100644 --- a/PWGCF/TwoParticleCorrelations/Core/TrackSelectionFilterAndAnalysis.h +++ b/PWGCF/TwoParticleCorrelations/Core/TrackSelectionFilterAndAnalysis.h @@ -23,6 +23,7 @@ #include #include +#include #include namespace o2 @@ -51,20 +52,20 @@ class TrackSelectionConfigurable std::string dcaz = "", std::string ptrange = "", std::string etarange = "") - : mTrackTypes{ttype}, - mNClustersTPC{nclstpc}, - mNCrossedRowsTPC{nxrtpc}, - mNClustersITS{nclsits}, - mMaxChi2PerClusterTPC{chi2clustpc}, - mMaxChi2PerClusterITS{chi2clusits}, - mMinNCrossedRowsOverFindableClustersTPC{xrofctpc}, - mMaxDcaXY{dcaxy}, - mMaxDcaZ{dcaz}, - mPtRange{ptrange}, - mEtaRange{etarange} + : mTrackTypes{std::move(ttype)}, + mNClustersTPC{std::move(nclstpc)}, + mNCrossedRowsTPC{std::move(nxrtpc)}, + mNClustersITS{std::move(nclsits)}, + mMaxChi2PerClusterTPC{std::move(chi2clustpc)}, + mMaxChi2PerClusterITS{std::move(chi2clusits)}, + mMinNCrossedRowsOverFindableClustersTPC{std::move(xrofctpc)}, + mMaxDcaXY{std::move(dcaxy)}, + mMaxDcaZ{std::move(dcaz)}, + mPtRange{std::move(ptrange)}, + mEtaRange{std::move(etarange)} { } - TrackSelectionConfigurable(std::vector ttype, + TrackSelectionConfigurable(const std::vector& ttype, std::vector nclstpc, std::vector nxrtpc, std::vector nclsits, diff --git a/PWGCF/TwoParticleCorrelations/TableProducer/twoParticleCorrelationsFiltering.cxx b/PWGCF/TwoParticleCorrelations/TableProducer/twoParticleCorrelationsFiltering.cxx index 7d5bff3b422..1733559dd0b 100644 --- a/PWGCF/TwoParticleCorrelations/TableProducer/twoParticleCorrelationsFiltering.cxx +++ b/PWGCF/TwoParticleCorrelations/TableProducer/twoParticleCorrelationsFiltering.cxx @@ -118,7 +118,7 @@ struct TwoParticleCorrelationsFilter { { using namespace twopfilter; LOGF(TWOPFILTERLOGCOLLISIONS, "Received collision with mask 0x%016lx and %ld tracks", collision.selflags(), tracks.size()); - auto passOptions = [](auto options, auto mask) { + auto passOptions = [](const auto& options, auto mask) { bool all = true; for (auto option : options) { all = all && ((option & mask) != 0UL); @@ -149,7 +149,7 @@ struct TwoParticleCorrelationsFilter { { using namespace twopfilter; LOGF(TWOPFILTERLOGCOLLISIONS, "Received collision with mask 0x%016lx and %ld tracks", collision.selflags(), tracks.size()); - auto passOptions = [](auto options, auto mask) { + auto passOptions = [](const auto& options, auto mask) { bool all = true; for (auto option : options) { all = all && ((option & mask) != 0UL); diff --git a/PWGCF/TwoParticleCorrelations/TableProducer/twoParticleCorrelationsFullSkimming.cxx b/PWGCF/TwoParticleCorrelations/TableProducer/twoParticleCorrelationsFullSkimming.cxx index 0441cbb8022..8f2bb9d9650 100644 --- a/PWGCF/TwoParticleCorrelations/TableProducer/twoParticleCorrelationsFullSkimming.cxx +++ b/PWGCF/TwoParticleCorrelations/TableProducer/twoParticleCorrelationsFullSkimming.cxx @@ -66,7 +66,7 @@ PWGCF::FilterAndAnalysisFramework* fFilterFramework = nullptr; using namespace cfskim; -void setEventCutsLabels(std::shared_ptr h) +void setEventCutsLabels(const std::shared_ptr& h) { using namespace aod::run2; @@ -98,7 +98,7 @@ void setEventCutsLabels(std::shared_ptr h) } } -void reportEventCuts(std::shared_ptr h, uint32_t eventcuts) +void reportEventCuts(const std::shared_ptr& h, uint32_t eventcuts) { using namespace aod::run2; auto entries = h->GetEntries(); @@ -127,7 +127,7 @@ struct TwoParticleCorrelationsSkimming { int bfield = 0; HistogramRegistry historeg; - int getMagneticField(std::string ccdbpath, uint64_t timestamp) + int getMagneticField(const std::string& ccdbpath, uint64_t timestamp) { // TODO done only once (and not per run). Will be replaced by CCDBConfigurable static o2::parameters::GRPObject* grpo = nullptr; diff --git a/PWGCF/TwoParticleCorrelations/TableProducer/twoParticleCorrelationsNotStoredSkimming.cxx b/PWGCF/TwoParticleCorrelations/TableProducer/twoParticleCorrelationsNotStoredSkimming.cxx index 31f15080d39..797103d4451 100644 --- a/PWGCF/TwoParticleCorrelations/TableProducer/twoParticleCorrelationsNotStoredSkimming.cxx +++ b/PWGCF/TwoParticleCorrelations/TableProducer/twoParticleCorrelationsNotStoredSkimming.cxx @@ -66,7 +66,7 @@ PWGCF::FilterAndAnalysisFramework* fFilterFramework = nullptr; using namespace cfskim; -void setEventCutsLabels(std::shared_ptr h) +void setEventCutsLabels(const std::shared_ptr& h) { using namespace aod::run2; @@ -98,7 +98,7 @@ void setEventCutsLabels(std::shared_ptr h) } } -void reportEventCuts(std::shared_ptr h, uint32_t eventcuts) +void reportEventCuts(const std::shared_ptr& h, uint32_t eventcuts) { using namespace aod::run2; auto entries = h->GetEntries(); @@ -124,7 +124,7 @@ struct TwoParticleCorrelationsCollisionSkimming { int bfield = 0; HistogramRegistry historeg; - int getMagneticField(std::string ccdbpath, uint64_t timestamp) + int getMagneticField(const std::string& ccdbpath, uint64_t timestamp) { // TODO done only once (and not per run). Will be replaced by CCDBConfigurable static o2::parameters::GRPObject* grpo = nullptr; diff --git a/PWGCF/TwoParticleCorrelations/Tasks/cascDiHadronCorr.cxx b/PWGCF/TwoParticleCorrelations/Tasks/cascDiHadronCorr.cxx index ed9a3c4a56c..b5e515105c6 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/cascDiHadronCorr.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/cascDiHadronCorr.cxx @@ -473,7 +473,7 @@ struct CascDiHadronCorr { } template - bool trackSelected(TTrack track) + bool trackSelected(const TTrack& track) { if (std::abs(track.eta()) > cfgCutEta) { return false; @@ -488,7 +488,7 @@ struct CascDiHadronCorr { } template - bool cascSelected(TTrackCasc casc, float posX, float posY, float posZ) + bool cascSelected(const TTrackCasc& casc, float posX, float posY, float posZ) { if (std::abs(casc.eta()) > cfgCutEta) { return false; @@ -631,7 +631,7 @@ struct CascDiHadronCorr { } template - bool genTrackSelected(TTrack track) + bool genTrackSelected(const TTrack& track) { if (!track.isPhysicalPrimary()) { return false; @@ -707,7 +707,7 @@ struct CascDiHadronCorr { // fill multiple histograms template - void fillYield(TCollision collision, TTracks tracks) // function to fill the yield and etaphi histograms. + void fillYield(const TCollision& collision, const TTracks& tracks) // function to fill the yield and etaphi histograms. { float weff1 = 1; float vtxz = collision.posZ(); @@ -749,7 +749,7 @@ struct CascDiHadronCorr { } template - void fillCorrelations(TTracks tracks1, TCollision currentCollision, float posZ, int bin, float eventWeight) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms (use buffer, only for mixevent) + void fillCorrelations(const TTracks& tracks1, const TCollision& currentCollision, float posZ, int bin, float eventWeight) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms (use buffer, only for mixevent) { float triggerWeight = 1.0f; float associatedWeight = 1.0f; @@ -797,7 +797,7 @@ struct CascDiHadronCorr { } template - void fillCorrelationsCasc(TTracks tracks1, TCollision currentCollision, float posX, float posY, float posZ, int bin, float eventWeight) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms (use buffer, only for mixevent) + void fillCorrelationsCasc(const TTracks& tracks1, const TCollision& currentCollision, float posX, float posY, float posZ, int bin, float eventWeight) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms (use buffer, only for mixevent) { float triggerWeight = 1.0f; float associatedWeight = 1.0f; @@ -848,7 +848,7 @@ struct CascDiHadronCorr { } template - void fillCorrelations(TTracks tracks1, TTracksAssoc tracks2, float posZ, int system, int magneticField, float cent, float eventWeight) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms + void fillCorrelations(const TTracks& tracks1, const TTracksAssoc& tracks2, float posZ, int system, int magneticField, float cent, float eventWeight) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms { // Cache efficiency for particles (too many FindBin lookups) if (mEfficiency) { @@ -933,7 +933,7 @@ struct CascDiHadronCorr { } template - void fillCorrelationsCasc(TTracks tracks1, TTracksAssoc tracks2, float posX, float posY, float posZ, int system, int magneticField, float cent, float eventWeight) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms + void fillCorrelationsCasc(const TTracks& tracks1, const TTracksAssoc& tracks2, float posX, float posY, float posZ, int system, int magneticField, float cent, float eventWeight) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms { // Cache efficiency for particles (too many FindBin lookups) if (mEfficiency) { @@ -1038,7 +1038,7 @@ struct CascDiHadronCorr { } template - void fillCorrelationsExcludeSoloTracks(TTracks tracks1, TTracksAssoc tracks2, float posZ, int magneticField, float cent, float eventWeight) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms + void fillCorrelationsExcludeSoloTracks(const TTracks& tracks1, const TTracksAssoc& tracks2, float posZ, int magneticField, float cent, float eventWeight) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms { std::vector tracksSkipIndices; std::vector tracks2SkipIndices; @@ -1134,7 +1134,7 @@ struct CascDiHadronCorr { } template - void fillMCCorrelations(TTracks tracks1, TTracksAssoc tracks2, float posZ, int system, float eventWeight) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms + void fillMCCorrelations(const TTracks& tracks1, const TTracksAssoc& tracks2, float posZ, int system, float eventWeight) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms { double fSampleIndex = gRandom->Uniform(0, cfgSampleSize); @@ -1182,7 +1182,7 @@ struct CascDiHadronCorr { } template - bool eventSelected(TCollision collision, const int multTrk, const float centrality, const bool fillCounter) + bool eventSelected(const TCollision& collision, const int multTrk, const float centrality, const bool fillCounter) { registry.fill(HIST("hEventCountSpecific"), 0.5); if (cfgEvSelkNoSameBunchPileup && !collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { diff --git a/PWGCF/TwoParticleCorrelations/Tasks/diHadronCor.cxx b/PWGCF/TwoParticleCorrelations/Tasks/diHadronCor.cxx index 99de5feb14e..f51782e6577 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/diHadronCor.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/diHadronCor.cxx @@ -160,7 +160,7 @@ struct DiHadronCor { // make the filters and cuts. Filter collisionFilter = (nabs(aod::collision::posZ) < cfgCutVtxZ); - Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta) && (aod::track::pt > cfgCutPtMin) && (aod::track::pt < cfgCutPtMax) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true)) && (aod::track::tpcChi2NCl < cfgCutChi2prTPCcls) && (nabs(aod::track::dcaZ) < cfgCutDCAz); + Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta) && (aod::track::pt > cfgCutPtMin) && (aod::track::pt < cfgCutPtMax) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t)true)) && (aod::track::tpcChi2NCl < cfgCutChi2prTPCcls) && (nabs(aod::track::dcaZ) < cfgCutDCAz); using FilteredCollisions = soa::Filtered>; using FilteredTracks = soa::Filtered>; using FilteredTracksWithMCLabels = soa::Filtered>; @@ -387,13 +387,13 @@ struct DiHadronCor { } template - bool trackSelected(TTrack track) + bool trackSelected(const TTrack& track) { return ((track.tpcNClsFound() >= cfgCutTPCclu) && (track.tpcNClsCrossedRows() >= cfgCutTPCCrossedRows) && (track.itsNCls() >= cfgCutITSclu)); } template - bool genTrackSelected(TTrack track) + bool genTrackSelected(const TTrack& track) { if (!track.isPhysicalPrimary()) { return false; @@ -469,7 +469,7 @@ struct DiHadronCor { // fill multiple histograms template - void fillYield(TCollision collision, TTracks tracks) // function to fill the yield and etaphi histograms. + void fillYield(const TCollision& collision, const TTracks& tracks) // function to fill the yield and etaphi histograms. { float weff1 = 1; float vtxz = collision.posZ(); @@ -511,7 +511,7 @@ struct DiHadronCor { } template - void fillCorrelations(TTracks tracks1, TTracksAssoc tracks2, float posZ, int system, int magneticField, float cent, float eventWeight) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms + void fillCorrelations(const TTracks& tracks1, const TTracksAssoc& tracks2, float posZ, int system, int magneticField, float cent, float eventWeight) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms { // Cache efficiency for particles (too many FindBin lookups) if (mEfficiency) { @@ -600,7 +600,7 @@ struct DiHadronCor { } template - void fillCorrelationsExcludeSoloTracks(TTracks tracks1, TTracksAssoc tracks2, float posZ, int magneticField, float cent, float eventWeight) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms + void fillCorrelationsExcludeSoloTracks(const TTracks& tracks1, const TTracksAssoc& tracks2, float posZ, int magneticField, float cent, float eventWeight) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms { std::vector tracksSkipIndices; std::vector tracks2SkipIndices; @@ -696,7 +696,7 @@ struct DiHadronCor { } template - void fillMCCorrelations(TTracks tracks1, TTracksAssoc tracks2, float posZ, int system, float eventWeight) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms + void fillMCCorrelations(const TTracks& tracks1, const TTracksAssoc& tracks2, float posZ, int system, float eventWeight) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms { int fSampleIndex = gRandom->Uniform(0, cfgSampleSize); @@ -744,7 +744,7 @@ struct DiHadronCor { } template - bool eventSelected(TCollision collision, const int multTrk, const float centrality, const bool fillCounter) + bool eventSelected(const TCollision& collision, const int multTrk, const float centrality, const bool fillCounter) { registry.fill(HIST("hEventCountSpecific"), 0.5); if (cfgEvSelkNoSameBunchPileup && !collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { diff --git a/PWGCF/TwoParticleCorrelations/Tasks/dptDptEfficiencyAndQc.cxx b/PWGCF/TwoParticleCorrelations/Tasks/dptDptEfficiencyAndQc.cxx index e8899bbd173..ed0478eb294 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/dptDptEfficiencyAndQc.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/dptDptEfficiencyAndQc.cxx @@ -1095,7 +1095,7 @@ struct DptDptEfficiencyAndQc { std::vector cfgnames = {"cfgElectronPIDSelection", "cfgMuonPIDSelection", "cfgPionPIDSelection", "cfgKaonPIDSelection", "cfgProtonPIDSelection"}; std::vector spids = {0, 1, 2, 3, 4}; for (uint i = 0; i < cfgnames.size(); ++i) { - auto includeIt = [&initContext](int spid, auto name) { + auto includeIt = [&initContext](int spid, const auto& name) { bool mUseIt = false; bool mExcludeIt = false; if (getTaskOptionValue(initContext, "dpt-dpt-filter-tracks", TString::Format("%s.mUseIt", name.c_str()).Data(), mUseIt, false) && @@ -1186,7 +1186,7 @@ struct DptDptEfficiencyAndQc { } /* in reverse order for proper order in results file */ for (uint i = 0; i < ncmranges; ++i) { - auto initializeCEInstance = [&](auto dce, auto name, auto& registry, bool reclevel, bool genlevel) { + auto initializeCEInstance = [&](auto dce, const auto& name, auto& registry, bool reclevel, bool genlevel) { /* crete the output list for the passed centrality/multiplicity range */ /* init the data collection instance */ if (reclevel) { @@ -1242,7 +1242,7 @@ struct DptDptEfficiencyAndQc { /// \brief Get the data collecting engine index corresponding to the passed collision template - int getDCEindex(FilteredCollision collision) + int getDCEindex(const FilteredCollision& collision) { if (!useCentrality.value) { return 0; diff --git a/PWGCF/TwoParticleCorrelations/Tasks/etaDihadron.cxx b/PWGCF/TwoParticleCorrelations/Tasks/etaDihadron.cxx index fc26117acc0..ea041d44f09 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/etaDihadron.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/etaDihadron.cxx @@ -159,7 +159,7 @@ struct EtaDihadron { // make the filters and cuts. Filter collisionFilter = (nabs(aod::collision::posZ) < cfgCutVtxZ); - Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta) && (aod::track::pt > cfgCutPtMin) && (aod::track::pt < cfgCutPtMax) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true)) && (aod::track::tpcChi2NCl < cfgCutChi2prTPCcls) && (nabs(aod::track::dcaZ) < cfgCutDCAz); + Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta) && (aod::track::pt > cfgCutPtMin) && (aod::track::pt < cfgCutPtMax) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t)true)) && (aod::track::tpcChi2NCl < cfgCutChi2prTPCcls) && (nabs(aod::track::dcaZ) < cfgCutDCAz); using FilteredCollisions = soa::Filtered>; using FilteredTracks = soa::Filtered>; using FilteredTracksWithMCLabels = soa::Filtered>; @@ -386,13 +386,13 @@ struct EtaDihadron { } template - bool trackSelected(TTrack track) + bool trackSelected(const TTrack& track) { return ((track.tpcNClsFound() >= cfgCutTPCclu) && (track.tpcNClsCrossedRows() >= cfgCutTPCCrossedRows) && (track.itsNCls() >= cfgCutITSclu)); } template - bool genTrackSelected(TTrack track) + bool genTrackSelected(const TTrack& track) { if (!track.isPhysicalPrimary()) { return false; @@ -468,7 +468,7 @@ struct EtaDihadron { // fill multiple histograms template - void fillYield(TCollision collision, TTracks tracks) // function to fill the yield and etaphi histograms. + void fillYield(const TCollision& collision, const TTracks& tracks) // function to fill the yield and etaphi histograms. { float weff1 = 1; float vtxz = collision.posZ(); @@ -510,7 +510,7 @@ struct EtaDihadron { } template - void fillCorrelations(TTracks tracks1, TTracksAssoc tracks2, float posZ, int system, int magneticField, float cent, float eventWeight) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms + void fillCorrelations(const TTracks& tracks1, const TTracksAssoc& tracks2, float posZ, int system, int magneticField, float cent, float eventWeight) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms { // Cache efficiency for particles (too many FindBin lookups) if (mEfficiency) { @@ -599,7 +599,7 @@ struct EtaDihadron { } template - void fillCorrelationsExcludeSoloTracks(TTracks tracks1, TTracksAssoc tracks2, float posZ, int magneticField, float cent, float eventWeight) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms + void fillCorrelationsExcludeSoloTracks(const TTracks& tracks1, const TTracksAssoc& tracks2, float posZ, int magneticField, float cent, float eventWeight) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms { std::vector tracksSkipIndices; std::vector tracks2SkipIndices; @@ -695,7 +695,7 @@ struct EtaDihadron { } template - void fillMCCorrelations(TTracks tracks1, TTracksAssoc tracks2, float posZ, int system, float eventWeight) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms + void fillMCCorrelations(const TTracks& tracks1, const TTracksAssoc& tracks2, float posZ, int system, float eventWeight) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms { int fSampleIndex = gRandom->Uniform(0, cfgSampleSize); @@ -743,7 +743,7 @@ struct EtaDihadron { } template - bool eventSelected(TCollision collision, const int multTrk, const float centrality, const bool fillCounter) + bool eventSelected(const TCollision& collision, const int multTrk, const float centrality, const bool fillCounter) { registry.fill(HIST("hEventCountSpecific"), 0.5); if (cfgEvSelkNoSameBunchPileup && !collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { diff --git a/PWGCF/TwoParticleCorrelations/Tasks/flowDecorrelation.cxx b/PWGCF/TwoParticleCorrelations/Tasks/flowDecorrelation.cxx index 0e55c1fa1d9..73e3b3f9cf5 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/flowDecorrelation.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/flowDecorrelation.cxx @@ -613,7 +613,7 @@ struct FlowDecorrelation { } template - bool trackSelected(TTrack track) + bool trackSelected(const TTrack& track) { return ((track.tpcNClsFound() >= cfgGeneralCuts.cfgCutTPCclu) && (track.tpcNClsCrossedRows() >= cfgGeneralCuts.cfgCutTPCCrossedRows) && (track.itsNCls() >= cfgGeneralCuts.cfgCutITSclu)); } @@ -715,7 +715,7 @@ struct FlowDecorrelation { // fill multiple histograms template - void fillYield(TCollision collision, TTracks tracks) // function to fill the yield and etaphi histograms. + void fillYield(const TCollision& collision, const TTracks& tracks) // function to fill the yield and etaphi histograms. { float weff1 = 1; float vtxz = collision.posZ(); @@ -762,7 +762,7 @@ struct FlowDecorrelation { } template - void fillCorrelationsTPCFIT(TTracks tracks1, TFT0s const& ft0, float posZ, int system, int corType, float cent, float eventWeight) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms + void fillCorrelationsTPCFIT(const TTracks& tracks1, TFT0s const& ft0, float posZ, int system, int corType, float cent, float eventWeight) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms { if (system == SameEvent) { if (!cfgCentTableUnavailable) @@ -899,7 +899,7 @@ struct FlowDecorrelation { } template - void fillCorrelationsTPCFV0(TTracks tracks1, TFT0s const& fv0, float posZ, int system, float cent, float eventWeight) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms + void fillCorrelationsTPCFV0(const TTracks& tracks1, TFT0s const& fv0, float posZ, int system, float cent, float eventWeight) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms { if (system == SameEvent) { if (!cfgCentTableUnavailable) @@ -952,7 +952,7 @@ struct FlowDecorrelation { } template - bool eventSelected(TCollision collision, const int multTrk, const float centrality, const bool fillCounter) + bool eventSelected(const TCollision& collision, const int multTrk, const float centrality, const bool fillCounter) { registry.fill(HIST("hEventCountSpecific"), 0.5); if (cfgEvSelkNoSameBunchPileup && !collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { @@ -1452,7 +1452,7 @@ struct FlowDecorrelation { PROCESS_SWITCH(FlowDecorrelation, processMixedFt0aFt0c, "Process mixed events for FT0A-FT0C correlation", false); template - void fillCorrelationsTPCMFT(TTracks tracks1, TTracksAssoc tracks2, float posZ, int system, float cent, float eventWeight) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms + void fillCorrelationsTPCMFT(const TTracks& tracks1, const TTracksAssoc& tracks2, float posZ, int system, float cent, float eventWeight) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms { if (system == SameEvent) { if (!cfgCentTableUnavailable) @@ -1714,7 +1714,7 @@ struct FlowDecorrelation { PROCESS_SWITCH(FlowDecorrelation, processMixedTpcFv0, "Process mixed events for TPC-FV0 correlation", false); template - void fillMCCorrelations(TTracks tracks1, TTracksAssoc tracks2, float posZ, int system, float eventWeight, int corType) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms + void fillMCCorrelations(const TTracks& tracks1, const TTracksAssoc& tracks2, float posZ, int system, float eventWeight, int corType) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms { int fSampleIndex = gRandom->Uniform(0, cfgSampleSize); double tpcEtaAcceptance = 0.9; diff --git a/PWGCF/TwoParticleCorrelations/Tasks/longRangeDihadronCor.cxx b/PWGCF/TwoParticleCorrelations/Tasks/longRangeDihadronCor.cxx index c716056e223..5baea7d44b4 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/longRangeDihadronCor.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/longRangeDihadronCor.cxx @@ -671,13 +671,13 @@ struct LongRangeDihadronCor { } template - bool trackSelected(TTrack track) + bool trackSelected(const TTrack& track) { return ((track.tpcNClsFound() >= cfgGeneral.cfgCutTPCclu) && (track.tpcNClsCrossedRows() >= cfgGeneral.cfgCutTPCCrossedRows) && (track.itsNCls() >= cfgGeneral.cfgCutITSclu)); } template - int getNsigmaPID(TTrack track) + int getNsigmaPID(const TTrack& track) { // Computing Nsigma arrays for pion, kaon, and protons std::array nSigmaTPC = {track.tpcNSigmaPi(), track.tpcNSigmaKa(), track.tpcNSigmaPr()}; @@ -902,7 +902,7 @@ struct LongRangeDihadronCor { // fill multiple histograms template - void fillYield(TCollision collision, TTracks tracks) // function to fill the yield and etaphi histograms. + void fillYield(const TCollision& collision, const TTracks& tracks) // function to fill the yield and etaphi histograms. { float weff1 = 1; float vtxz = collision.posZ(); @@ -970,7 +970,7 @@ struct LongRangeDihadronCor { } template - void fillCorrelationsTPCFT0(TTracks tracks1, TFT0s const& ft0, float posZ, int system, int corType, float cent, float eventWeight) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms + void fillCorrelationsTPCFT0(const TTracks& tracks1, TFT0s const& ft0, float posZ, int system, int corType, float cent, float eventWeight) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms { if (system == SameEvent) { if (!cfgGeneral.cfgCentTableUnavailable) @@ -1132,7 +1132,7 @@ struct LongRangeDihadronCor { } template - void fillMCCorrelations(TTracks tracks1, TTracksAssoc tracks2, float posZ, int system, float eventWeight, int corType) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms + void fillMCCorrelations(const TTracks& tracks1, const TTracksAssoc& tracks2, float posZ, int system, float eventWeight, int corType) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms { int fSampleIndex = gRandom->Uniform(0, cfgGeneral.cfgSampleSize); double tpcEtaAcceptance = 0.8001; @@ -1206,7 +1206,7 @@ struct LongRangeDihadronCor { } template - void fillSemiMcCorrelations(TTracks tracks1, TFT0s const& ft0, float posZ, int system, int corType, float cent, float eventWeight) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms + void fillSemiMcCorrelations(const TTracks& tracks1, TFT0s const& ft0, float posZ, int system, int corType, float cent, float eventWeight) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms { if (system == SameEvent) { if (!cfgGeneral.cfgCentTableUnavailable) @@ -1305,7 +1305,7 @@ struct LongRangeDihadronCor { } template - bool eventSelected(TCollision collision, const int multTrk, const float centrality, const bool fillCounter) + bool eventSelected(const TCollision& collision, const int multTrk, const float centrality, const bool fillCounter) { registry.fill(HIST("hEventCountSpecific"), 0.5); if (cfgGeneral.cfgEvSelkNoSameBunchPileup && !collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { diff --git a/PWGCF/TwoParticleCorrelations/Tasks/longrangeCorrelation.cxx b/PWGCF/TwoParticleCorrelations/Tasks/longrangeCorrelation.cxx index c646439fd28..ccb73d62d14 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/longrangeCorrelation.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/longrangeCorrelation.cxx @@ -470,7 +470,7 @@ struct LongrangeCorrelation { } template - int getTrackPID(TTrack track) + int getTrackPID(const TTrack& track) { // Computing Nsigma arrays for pion, kaon, and protons std::array nSigmaTPC = {track.tpcNSigmaPi(), track.tpcNSigmaKa(), track.tpcNSigmaPr()}; diff --git a/PWGCF/TwoParticleCorrelations/Tasks/neutronProtonCorrZdc.cxx b/PWGCF/TwoParticleCorrelations/Tasks/neutronProtonCorrZdc.cxx index 30ea2b53197..b7c6e137bd6 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/neutronProtonCorrZdc.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/neutronProtonCorrZdc.cxx @@ -203,7 +203,7 @@ struct NeutronProtonCorrZdc { } template - bool eventSelected(TCollision coll, const float centrality) + bool eventSelected(const TCollision& coll, const float centrality) { if (!coll.sel8()) return 0; diff --git a/PWGCF/TwoParticleCorrelations/Tasks/particleOriginAnalysis.cxx b/PWGCF/TwoParticleCorrelations/Tasks/particleOriginAnalysis.cxx index e36f77c5683..cc30bd1655b 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/particleOriginAnalysis.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/particleOriginAnalysis.cxx @@ -178,7 +178,7 @@ struct ParticleOriginAnalysis { std::vector cfgnames = {"cfgElectronPIDSelection", "cfgMuonPIDSelection", "cfgPionPIDSelection", "cfgKaonPIDSelection", "cfgProtonPIDSelection"}; std::vector spids = {0, 1, 2, 3, 4}; for (uint i = 0; i < cfgnames.size(); ++i) { - auto includeIt = [&pidselector, &initContext](int spid, auto name) { + auto includeIt = [&pidselector, &initContext](int spid, const auto& name) { bool mUseIt = false; bool mExcludeIt = false; if (getTaskOptionValue(initContext, "dpt-dpt-filter-tracks", TString::Format("%s.mUseIt", name.c_str()).Data(), mUseIt, false) && diff --git a/PWGCF/TwoParticleCorrelations/Tasks/pidDiHadron.cxx b/PWGCF/TwoParticleCorrelations/Tasks/pidDiHadron.cxx index b3efdcc4480..40ce655fb4e 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/pidDiHadron.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/pidDiHadron.cxx @@ -198,7 +198,7 @@ struct PidDiHadron { // make the filters and cuts. Filter collisionFilter = (nabs(aod::collision::posZ) < cfgCutVertex); - Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta) && (aod::track::pt > cfgCutPtPOIMin) && (aod::track::pt < cfgCutPtPOIMax) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true)) && (aod::track::tpcChi2NCl < cfgCutChi2prTPCcls) && (nabs(aod::track::dcaZ) < cfgCutDCAz); + Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta) && (aod::track::pt > cfgCutPtPOIMin) && (aod::track::pt < cfgCutPtPOIMax) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t)true)) && (aod::track::tpcChi2NCl < cfgCutChi2prTPCcls) && (nabs(aod::track::dcaZ) < cfgCutDCAz); using FilteredCollisions = soa::Filtered>; using FilteredTracks = soa::Filtered>; @@ -638,7 +638,7 @@ struct PidDiHadron { } template - bool trackSelected(TTrack track) + bool trackSelected(const TTrack& track) { if (cfgFuncParas.cfgDCAxyNSigma && (std::fabs(track.dcaXY()) > cfgFuncParas.fPtDepDCAxy->Eval(track.pt()))) return false; @@ -675,7 +675,7 @@ struct PidDiHadron { } template - int getNsigmaPID(TTrack track) + int getNsigmaPID(const TTrack& track) { // Computing Nsigma arrays for pion, kaon, and protons std::array nSigmaTPC = {track.tpcNSigmaPi(), track.tpcNSigmaKa(), track.tpcNSigmaPr()}; @@ -784,7 +784,7 @@ struct PidDiHadron { // fill multiple histograms template - void fillYield(TCollision collision, TTracks tracks) // function to fill the yield and etaphi histograms. + void fillYield(const TCollision& collision, const TTracks& tracks) // function to fill the yield and etaphi histograms. { float weff1 = 1; float vtxz = collision.posZ(); @@ -804,7 +804,7 @@ struct PidDiHadron { } template - void fillNsigmaAfterCut(TTrack track1, Int_t pid) // function to fill the QA after Nsigma selection + void fillNsigmaAfterCut(const TTrack& track1, Int_t pid) // function to fill the QA after Nsigma selection { switch (pid) { case 1: // For Pions @@ -867,7 +867,7 @@ struct PidDiHadron { } template - void fillCorrelations(TTracks tracks1, TTracksAssoc tracks2, float posZ, int system, int magneticField, float cent, float eventWeight) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms + void fillCorrelations(const TTracks& tracks1, const TTracksAssoc& tracks2, float posZ, int system, int magneticField, float cent, float eventWeight) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms { // Cache efficiency for particles (too many FindBin lookups) if (mEfficiency) { @@ -1005,7 +1005,7 @@ struct PidDiHadron { } template - void fillCorrelationsReso(TV0Tracks tracks1, TTracksAssoc tracks2, float posZ, float posY, float posX, int system, int magneticField, float cent, float eventWeight) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms + void fillCorrelationsReso(const TV0Tracks& tracks1, const TTracksAssoc& tracks2, float posZ, float posY, float posX, int system, int magneticField, float cent, float eventWeight) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms { // Cache efficiency for particles (too many FindBin lookups) if (mEfficiency) { @@ -1105,7 +1105,7 @@ struct PidDiHadron { } template - bool selectionEvent(TCollision collision, const int mult, const float cent, const bool fillCounter) + bool selectionEvent(const TCollision& collision, const int mult, const float cent, const bool fillCounter) { if (fillCounter) histos.fill(HIST("hEventCount"), kFilteredEvents); diff --git a/PWGCF/TwoParticleCorrelations/Tasks/r2p2-4-id.cxx b/PWGCF/TwoParticleCorrelations/Tasks/r2p2-4-id.cxx index 3601f1f7fe4..26d6604a9d7 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/r2p2-4-id.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/r2p2-4-id.cxx @@ -128,7 +128,7 @@ struct FillFlagsTable { void processData(soa::Join const& tracks) { int8_t etabin, phibin, binNpid; - for (auto track : tracks) { + for (const auto& track : tracks) { etabin = (track.eta() + 0.8) * 15; // 15= 24/1.6 phibin = 36 * track.phi() / (2 * constants::math::PI); if ((etabin < 0) || (etabin >= 24) || (phibin < 0) || (phibin >= 36)) { @@ -181,7 +181,7 @@ struct FillFlagsTable { void processMC(soa::Join const& recotracks, aod::McParticles const& gentracks) { int8_t etabin, phibin, binNpid; - for (auto track : recotracks) { + for (const auto& track : recotracks) { if (track.has_mcParticle()) { etabin = (track.eta() + 0.8) * 15; // 15= 24/1.6 phibin = 36 * track.phi() / (2 * constants::math::PI); @@ -257,7 +257,7 @@ struct FillFlagsTable { } ftable(binNpid); } - for (auto track : gentracks) { + for (const auto& track : gentracks) { switch (abs(track.pdgCode())) { case 211: histos.fill(HIST("genptpi"), track.pt()); @@ -399,14 +399,14 @@ struct r2p24id { if ((iftrack2 && ((mult1 < 1) || (mult2 < 1))) || ((!iftrack2) && (mult1 < 2))) // Reject Collisions without sufficient particles return; - for (auto track1 : tracks) { + for (const auto& track1 : tracks) { histos.fill(HIST("h1d_n1_phi"), track1.phi()); histos.fill(HIST("h1d_n1_eta"), track1.eta()); histos.fill(HIST("h1d_n1_pt"), track1.pt()); } histos.fill(HIST("h1i_n1_multPM"), mult1 + mult2); - for (auto track1 : tracks1) { + for (const auto& track1 : tracks1) { //---Single Particle Distribution (particle1)---------------------------------------- sign1 = (track1.sign() + 1) / 2; hist.h1d_1p[0][sign1]->Fill(track1.pt(), 1.0 / (2.0 * constants::math::PI * track1.pt())); // h1d_n1_pt*1 @@ -415,7 +415,7 @@ struct r2p24id { //----------------------------------------------------------------------- } if (iftrack2) { - for (auto track2 : tracks2) { + for (const auto& track2 : tracks2) { //---Single Particle Distribution (particle2)---------------------------------------- sign2 = (track2.sign() + 1) / 2; hist.h1d_1p[1][sign2]->Fill(track2.pt(), 1.0 / (2.0 * constants::math::PI * track2.pt())); // h1d_n1_pt*2 @@ -424,12 +424,12 @@ struct r2p24id { //----------------------------------------------------------------------- } } - for (auto track1 : tracks1) { + for (const auto& track1 : tracks1) { sign1 = (track1.sign() + 1) / 2; etabin1 = (track1.eta() + 0.8) * 15; // 15= 24/1.6 phibin1 = 36 * track1.phi() / (2 * constants::math::PI); - for (auto track2 : tracks2) { + for (const auto& track2 : tracks2) { if (track1.index() == track2.index()) continue; diff --git a/PWGCF/TwoParticleCorrelations/Tasks/twoParticleCorrelationPp.cxx b/PWGCF/TwoParticleCorrelations/Tasks/twoParticleCorrelationPp.cxx index 125fe4db09f..5a94ee3811a 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/twoParticleCorrelationPp.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/twoParticleCorrelationPp.cxx @@ -178,7 +178,7 @@ struct TwoParticleCorrelationPp { using BinningType = ColumnBinningPolicy; template - bool isEventSelected(TCollision collision) + bool isEventSelected(const TCollision& collision) { if (evSel8 && !collision.sel8()) { return false; @@ -269,7 +269,7 @@ struct TwoParticleCorrelationPp { } template - void fillQA(TTracks tracks, float multiplicity) + void fillQA(const TTracks& tracks, float multiplicity) { for (const auto& track : tracks) { histos.fill(HIST("yields"), multiplicity, track.pt(), track.eta()); @@ -286,7 +286,7 @@ struct TwoParticleCorrelationPp { } template - void fillCorrelations(TTarget target, TTracks tracks1, TTracks tracks2, float multiplicity, float posZ, int system) + void fillCorrelations(TTarget target, const TTracks& tracks1, const TTracks& tracks2, float multiplicity, float posZ, int system) { for (const auto& track1 : tracks1) { if (isTrackCut(track1) == false) { diff --git a/PWGCF/TwoParticleCorrelations/Tasks/twoParticleCorrelations.cxx b/PWGCF/TwoParticleCorrelations/Tasks/twoParticleCorrelations.cxx index 697207eb531..0e8c2bdb003 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/twoParticleCorrelations.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/twoParticleCorrelations.cxx @@ -235,14 +235,14 @@ struct twoParticleCorrelations { return fhN2_vsDEtaDPhi[0][0]->GetBin(deltaeta_ix + 1, deltaphi_ix + 1); } - void storeTrackCorrections(std::vector corrs) + void storeTrackCorrections(const std::vector& corrs) { LOGF(info, "Stored NUA&NUE corrections for %d track species", corrs.size()); fhNuaNue_vsZEtaPhiPt = corrs; ccdbstored = true; } - void storePtAverages(std::vector ptavgs) + void storePtAverages(const std::vector& ptavgs) { LOGF(info, "Stored pT average for %d track species", ptavgs.size()); fhPtAvg_vsEtaPhi = ptavgs; @@ -415,7 +415,7 @@ struct twoParticleCorrelations { } } - void init(TList* fOutputList, std::vector idnames) + void init(TList* fOutputList, const std::vector& idnames) { LOGF(info, "Correlations processing engine::init()"); using namespace twopcorrelations; @@ -425,7 +425,7 @@ struct twoParticleCorrelations { TH1::AddDirectory(kFALSE); /* load the species names */ - for (auto id : idnames) { + for (const auto& id : idnames) { LOGF(info, "Adding particle species %s", id.c_str()); tname.push_back(std::string(id.c_str())); } @@ -787,7 +787,7 @@ struct twoParticleCorrelations { /// \brief Get the data collecting engine index corresponding to the passed collision template - int getDCEindex(FilteredCollision collision) + int getDCEindex(const FilteredCollision& collision) { int ixDCE = -1; float cm = collision.centmult()[fMultiplicityIndex]; @@ -837,7 +837,7 @@ struct twoParticleCorrelations { { using namespace twopcorrelations; LOGF(TWOPCORRLOGCOLLISIONS, "Received collision with mask 0x%016lx and %ld tracks", collision.selflags(), tracks.size()); - auto passOptions = [](auto options, auto mask) { + auto passOptions = [](const auto& options, auto mask) { bool all = true; for (auto option : options) { all = all && ((option & mask) != 0UL); diff --git a/PWGCF/TwoParticleCorrelations/Tasks/twoParticleCorrelationsMpi.cxx b/PWGCF/TwoParticleCorrelations/Tasks/twoParticleCorrelationsMpi.cxx index 908ce848d7d..c7eac870dc3 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/twoParticleCorrelationsMpi.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/twoParticleCorrelationsMpi.cxx @@ -1305,7 +1305,7 @@ struct TwoParticleCorrelationsMpi { std::vector discardedPairFills; discardedTriggerFills.reserve(tracks.size()); discardedPairFills.reserve(tracks.size() * tracks.size()); - fillCorrelations(target, tracks, tracks, multiplicity, posZ, magField, 1.0f, &estimate, &discardedTriggerFills, &discardedPairFills, -1.f, false, false); + fillCorrelations(std::move(target), tracks, tracks, multiplicity, posZ, magField, 1.0f, &estimate, &discardedTriggerFills, &discardedPairFills, -1.f, false, false); finalizeEventSeedEstimate(estimate); return estimate.nuncSeeds(); }