diff --git a/PWGEM/Dilepton/Core/DielectronCut.cxx b/PWGEM/Dilepton/Core/DielectronCut.cxx index 65d952e38c0..006a0fa5252 100644 --- a/PWGEM/Dilepton/Core/DielectronCut.cxx +++ b/PWGEM/Dilepton/Core/DielectronCut.cxx @@ -63,7 +63,7 @@ void DielectronCut::SetPairOpAng(float minOpAng, float maxOpAng) } void DielectronCut::SetMaxMeePhiVDep(std::function phivDepCut, float min_phiv, float max_phiv) { - mMaxMeePhiVDep = phivDepCut; + mMaxMeePhiVDep = std::move(phivDepCut); mMinPhivPair = min_phiv; mMaxPhivPair = max_phiv; LOG(info) << "Dielectron Cut, set max mee phiv dep: " << mMaxMeePhiVDep(2.5); @@ -194,7 +194,7 @@ void DielectronCut::SetTrackMaxDcaZ(float maxDcaZ) void DielectronCut::SetTrackMaxDcaXYPtDep(std::function ptDepCut) { - mMaxDcaXYPtDep = ptDepCut; + mMaxDcaXYPtDep = std::move(ptDepCut); LOG(info) << "Dielectron Cut, set max DCA xy pt dep: " << mMaxDcaXYPtDep(1.0); } void DielectronCut::ApplyPhiV(bool flag) diff --git a/PWGEM/Dilepton/Core/DielectronCut.h b/PWGEM/Dilepton/Core/DielectronCut.h index 8e076108213..8ac890a6783 100644 --- a/PWGEM/Dilepton/Core/DielectronCut.h +++ b/PWGEM/Dilepton/Core/DielectronCut.h @@ -537,7 +537,7 @@ class DielectronCut : public TNamed // mPIDMlResponse = mlResponse; // } - void SetMLThresholds(const std::vector bins, const std::vector cuts) + void SetMLThresholds(const std::vector& bins, const std::vector& cuts) { if (bins.size() != cuts.size() + 1) { LOG(fatal) << "cuts.size() + 1 mutst be exactly the same as bins.size(). Check your bins and thresholds."; diff --git a/PWGEM/Dilepton/Core/Dilepton.h b/PWGEM/Dilepton/Core/Dilepton.h index 148ed2d99c6..6bc38cdfb29 100644 --- a/PWGEM/Dilepton/Core/Dilepton.h +++ b/PWGEM/Dilepton/Core/Dilepton.h @@ -881,7 +881,7 @@ struct Dilepton { } template - bool fillPairInfo(TCollision const& collision, TTrack1 const& t1, TTrack2 const& t2, TCut const& cut, TAllTracks const&, const std::vector weightvector) + bool fillPairInfo(TCollision const& collision, TTrack1 const& t1, TTrack2 const& t2, TCut const& cut, TAllTracks const&, const std::vector& weightvector) { if constexpr (ev_id == 0) { if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { diff --git a/PWGEM/Dilepton/Core/DileptonSV.h b/PWGEM/Dilepton/Core/DileptonSV.h index 8e34fe9f1c6..d59725ef917 100644 --- a/PWGEM/Dilepton/Core/DileptonSV.h +++ b/PWGEM/Dilepton/Core/DileptonSV.h @@ -1107,7 +1107,7 @@ struct DileptonSV { } template - bool fillPairInfo(TCollision const& collision, TTrack1 const& t1, TTrack2 const& t2, TCut const& cut, TAllTracks const&, const std::vector weightvector) + bool fillPairInfo(TCollision const& collision, TTrack1 const& t1, TTrack2 const& t2, TCut const& cut, TAllTracks const&, const std::vector& weightvector) { dileptonSV candidate; if constexpr (ev_id == 0) { diff --git a/PWGEM/Dilepton/Core/DimuonCut.cxx b/PWGEM/Dilepton/Core/DimuonCut.cxx index 36f768b124f..1c9cd3f70fa 100644 --- a/PWGEM/Dilepton/Core/DimuonCut.cxx +++ b/PWGEM/Dilepton/Core/DimuonCut.cxx @@ -20,6 +20,7 @@ #include #include +#include #include ClassImp(DimuonCut); @@ -98,7 +99,7 @@ void DimuonCut::SetMatchingChi2MCHMFT(float min, float max) } void DimuonCut::SetMaxMatchingChi2MCHMFTPtDep(std::function PtDepCut) { - mMaxMatchingChi2MCHMFTPtDep = PtDepCut; + mMaxMatchingChi2MCHMFTPtDep = std::move(PtDepCut); LOG(info) << "Dimuon Cut, set matching chi2 MFT-MCH range: " << mMaxMatchingChi2MCHMFTPtDep(0.5); } void DimuonCut::SetMaxDiffMatchingChi2MCHMFT(float diff) @@ -143,13 +144,13 @@ void DimuonCut::EnableTTCA(const bool flag) } void DimuonCut::SetMaxPDCARabsDep(std::function RabsDepCut) { - mMaxPDCARabsDep = RabsDepCut; + mMaxPDCARabsDep = std::move(RabsDepCut); LOG(info) << "Dimuon Cut, set max pDCA as a function of Rabs: " << mMaxPDCARabsDep(10.0); } void DimuonCut::SetMFTHitMap(bool flag, std::vector hitMap) { mApplyMFTHitMap = flag; - mRequiredMFTDisks = hitMap; + mRequiredMFTDisks = std::move(hitMap); if (mApplyMFTHitMap) { for (const auto& iDisk : mRequiredMFTDisks) { LOG(info) << "Dimuon Cut, require MFT hit on Disk: " << iDisk; diff --git a/PWGEM/Dilepton/TableProducer/skimmerPrimaryMuon.cxx b/PWGEM/Dilepton/TableProducer/skimmerPrimaryMuon.cxx index 27ad0708be0..8394e40fc57 100644 --- a/PWGEM/Dilepton/TableProducer/skimmerPrimaryMuon.cxx +++ b/PWGEM/Dilepton/TableProducer/skimmerPrimaryMuon.cxx @@ -294,7 +294,7 @@ struct skimmerPrimaryMuon { } template - bool fillFwdTrackTable(TCollision const& collision, TFwdTrack fwdtrack, TMFTTracksCov const& mftCovs, const bool isAmbiguous) + bool fillFwdTrackTable(TCollision const& collision, const TFwdTrack& fwdtrack, TMFTTracksCov const& mftCovs, const bool isAmbiguous) { if (fwdtrack.chi2MatchMCHMID() < 0.f) { // this should never happen. only for protection. return false; diff --git a/PWGEM/Dilepton/Tasks/MCtemplates.cxx b/PWGEM/Dilepton/Tasks/MCtemplates.cxx index d44dd156c62..9c69ee77dbd 100644 --- a/PWGEM/Dilepton/Tasks/MCtemplates.cxx +++ b/PWGEM/Dilepton/Tasks/MCtemplates.cxx @@ -109,7 +109,7 @@ constexpr static uint32_t gkTrackFillMap = VarManager::ObjTypes::ReducedTrack | constexpr static uint32_t gkTrackFillMapWithCov = VarManager::ObjTypes::ReducedTrack | VarManager::ObjTypes::ReducedTrackBarrel | VarManager::ObjTypes::ReducedTrackBarrelCov | VarManager::ObjTypes::ReducedTrackBarrelPID; constexpr static uint32_t gkParticleMCFillMap = VarManager::ObjTypes::ParticleMC; -void DefineHistograms(HistogramManager* histMan, TString histClasses, Configurable configVar); // defines histograms for all tasks +void DefineHistograms(HistogramManager* histMan, const TString& histClasses, const Configurable& configVar); // defines histograms for all tasks struct AnalysisEventSelection { Produces eventSel; @@ -698,7 +698,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) adaptAnalysisTask(cfgc)}; } -void DefineHistograms(HistogramManager* histMan, TString histClasses, Configurable configVar) +void DefineHistograms(HistogramManager* histMan, const TString& histClasses, const Configurable& configVar) { // // Define here the histograms for all the classes required in analysis. diff --git a/PWGEM/Dilepton/Tasks/emEfficiencyEE.cxx b/PWGEM/Dilepton/Tasks/emEfficiencyEE.cxx index d223c5d2c1c..9cf9385ac71 100644 --- a/PWGEM/Dilepton/Tasks/emEfficiencyEE.cxx +++ b/PWGEM/Dilepton/Tasks/emEfficiencyEE.cxx @@ -118,7 +118,7 @@ constexpr static uint32_t gkMCEventFillMap = VarManager::ObjTypes::ReducedEventM constexpr static uint32_t gkTrackFillMap = VarManager::ObjTypes::ReducedTrack | VarManager::ObjTypes::ReducedTrackBarrel | VarManager::ObjTypes::ReducedTrackBarrelCov | VarManager::ObjTypes::ReducedTrackBarrelPID; constexpr static uint32_t gkParticleMCFillMap = VarManager::ObjTypes::ParticleMC; -void DefineHistograms(HistogramManager* histMan, TString histClasses, Configurable configVar); // defines histograms for all tasks +void DefineHistograms(HistogramManager* histMan, const TString& histClasses, const Configurable& configVar); // defines histograms for all tasks void SetBinsLinear(std::vector& fBins, const double min, const double max, const unsigned int steps); struct AnalysisEventSelection { @@ -324,7 +324,7 @@ struct AnalysisEventQa { { Int_t midrap = 0; - for (auto mctrack : groupedMCTracks) { + for (const auto& mctrack : groupedMCTracks) { if (TMath::Abs(mctrack.eta()) < 0.5 && mctrack.isPhysicalPrimary() && (TMath::Abs(mctrack.pdgCode()) == 211 || mctrack.pdgCode() == 111)) { midrap++; } @@ -779,7 +779,7 @@ struct AnalysisTrackSelection { } template - void runDataFillMore(TEvents const& events, TEventsMC eventsMC, TTracks const& tracks, TTracksMC const& tracksMC, TAmbigTracks const& ambiTracksMid) + void runDataFillMore(TEvents const& events, const TEventsMC& eventsMC, TTracks const& tracks, TTracksMC const& tracksMC, TAmbigTracks const& ambiTracksMid) { VarManager::ResetValues(0, VarManager::kNEventWiseVariables); @@ -2012,7 +2012,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) adaptAnalysisTask(cfgc)}; } -void DefineHistograms(HistogramManager* histMan, TString histClasses, Configurable configVar) +void DefineHistograms(HistogramManager* histMan, const TString& histClasses, const Configurable& configVar) { // // Define here the histograms for all the classes required in analysis. diff --git a/PWGEM/Dilepton/Tasks/lmeeLFCocktail.cxx b/PWGEM/Dilepton/Tasks/lmeeLFCocktail.cxx index 56bd936d9f3..b77c15dc37c 100644 --- a/PWGEM/Dilepton/Tasks/lmeeLFCocktail.cxx +++ b/PWGEM/Dilepton/Tasks/lmeeLFCocktail.cxx @@ -127,7 +127,7 @@ struct lmeelfcocktail { return true; } - bool isAcceptedSingle(ROOT::Math::PtEtaPhiMVector p1) + bool isAcceptedSingle(const ROOT::Math::PtEtaPhiMVector& p1) { if (p1.Pt() < fConfigMinPt) return false; @@ -138,7 +138,7 @@ struct lmeelfcocktail { return true; } - bool isAcceptedPair(ROOT::Math::PtEtaPhiMVector p1, ROOT::Math::PtEtaPhiMVector p2) + bool isAcceptedPair(const ROOT::Math::PtEtaPhiMVector& p1, const ROOT::Math::PtEtaPhiMVector& p2) { if (!isAcceptedSingle(p1)) { return false; @@ -167,7 +167,7 @@ struct lmeelfcocktail { } template - bool isAcceptedPair(T& p1, T& p2) + bool isAcceptedPair(const T& p1, const T& p2) { ROOT::Math::PtEtaPhiMVector v1(p1.ptSmeared(), p1.etaSmeared(), p1.phiSmeared(), o2::constants::physics::MassElectron); ROOT::Math::PtEtaPhiMVector v2(p2.ptSmeared(), p2.etaSmeared(), p2.phiSmeared(), o2::constants::physics::MassElectron); @@ -175,13 +175,13 @@ struct lmeelfcocktail { } template - bool isAcceptedSingle(T& p1) + bool isAcceptedSingle(const T& p1) { ROOT::Math::PtEtaPhiMVector v1(p1.ptSmeared(), p1.etaSmeared(), p1.phiSmeared(), o2::constants::physics::MassElectron); return isAcceptedSingle(v1); } - void addHistogram1D_stage(TString histname, AxisSpec axis, int& i, TString s) + void addHistogram1D_stage(const TString& histname, const AxisSpec& axis, int& i, const TString& s) { i++; TString name = s + histname; @@ -201,14 +201,14 @@ struct lmeelfcocktail { } } - void addHistogram1D(TString histname, AxisSpec axis, int& i) + void addHistogram1D(const TString& histname, const AxisSpec& axis, int& i) { - for (auto s : stage) { + for (const auto& s : stage) { addHistogram1D_stage(histname, axis, i, s); } } - void addHistogram1D_mother(TString histname, AxisSpec axis, int& i) // mother histograms only for gen. level, no decay channels + void addHistogram1D_mother(const TString& histname, const AxisSpec& axis, int& i) // mother histograms only for gen. level, no decay channels { i++; TString name = stage[0] + histname; @@ -222,7 +222,7 @@ struct lmeelfcocktail { } } - void addHistogram2D_stage(TString histname, AxisSpec axis1, AxisSpec axis2, int& i, TString s) + void addHistogram2D_stage(const TString& histname, const AxisSpec& axis1, const AxisSpec& axis2, int& i, const TString& s) { i++; TString name = s + histname; @@ -242,15 +242,15 @@ struct lmeelfcocktail { } } - void addHistogram2D(TString histname, AxisSpec axis1, AxisSpec axis2, int& i) + void addHistogram2D(const TString& histname, const AxisSpec& axis1, const AxisSpec& axis2, int& i) { - for (auto s : stage) { + for (const auto& s : stage) { addHistogram2D_stage(histname, axis1, axis2, i, s); } } template - void addHistogramND_stage(TString histname, TAxes const& axes, int& i, TString s) + void addHistogramND_stage(const TString& histname, TAxes const& axes, int& i, const TString& s) { i++; TString name = s + histname; @@ -271,34 +271,34 @@ struct lmeelfcocktail { } template - void addHistogramND(TString histname, TAxes const& axes, int& i) + void addHistogramND(const TString& histname, TAxes const& axes, int& i) { - for (auto s : stage) { + for (const auto& s : stage) { addHistogramND_stage(histname, axes, i, s); } } - void fillHistogram1D(TString histname, int s, int pdg, int other_daughter_pdg, float value, float weight) + void fillHistogram1D(const TString& histname, int s, int pdg, int other_daughter_pdg, float value, float weight) { histograms1D[histogramId[stage[s] + histname]]->Fill(value, weight); histograms1D[histogramId[stage[s] + mesons[pdg].name + histname]]->Fill(value, weight); histograms1D[histogramId[stage[s] + mesons[pdg].name + decays[other_daughter_pdg] + histname]]->Fill(value, weight); } - void fillHistogram1D_mother(TString histname, int pdg, float value, float weight) + void fillHistogram1D_mother(const TString& histname, int pdg, float value, float weight) { histograms1D[histogramId[stage[0] + histname]]->Fill(value, weight); histograms1D[histogramId[stage[0] + mesons[pdg].name + histname]]->Fill(value, weight); } - void fillHistogram2D(TString histname, int s, int pdg, int other_daughter_pdg, float value1, float value2, float weight) + void fillHistogram2D(const TString& histname, int s, int pdg, int other_daughter_pdg, float value1, float value2, float weight) { histograms2D[histogramId[stage[s] + histname]]->Fill(value1, value2, weight); histograms2D[histogramId[stage[s] + mesons[pdg].name + histname]]->Fill(value1, value2, weight); histograms2D[histogramId[stage[s] + mesons[pdg].name + decays[other_daughter_pdg] + histname]]->Fill(value1, value2, weight); } - void fillHistogramND(TString histname, int s, int pdg, int other_daughter_pdg, double* values, double weight) + void fillHistogramND(const TString& histname, int s, int pdg, int other_daughter_pdg, double* values, double weight) { histogramsND[histogramId[stage[s] + histname]]->Fill(values, weight); histogramsND[histogramId[stage[s] + mesons[pdg].name + histname]]->Fill(values, weight); diff --git a/PWGEM/Dilepton/Tasks/matchingMFT.cxx b/PWGEM/Dilepton/Tasks/matchingMFT.cxx index eab695fe25b..6d95d3abaa2 100644 --- a/PWGEM/Dilepton/Tasks/matchingMFT.cxx +++ b/PWGEM/Dilepton/Tasks/matchingMFT.cxx @@ -515,7 +515,7 @@ struct matchingMFT { } template - void fillHistograms(TCollision const& collision, TFwdTrack fwdtrack, TFwdTracks const&, TMFTTracks const&, TMFTTracksCov const& mftCovs) + void fillHistograms(TCollision const& collision, const TFwdTrack& fwdtrack, TFwdTracks const&, TMFTTracks const&, TMFTTracksCov const& mftCovs) { if (fwdtrack.trackType() != o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack) { // only for protection return; diff --git a/PWGEM/Dilepton/Tasks/tableReaderBarrel.cxx b/PWGEM/Dilepton/Tasks/tableReaderBarrel.cxx index db992926fd0..46cfe0d6e90 100644 --- a/PWGEM/Dilepton/Tasks/tableReaderBarrel.cxx +++ b/PWGEM/Dilepton/Tasks/tableReaderBarrel.cxx @@ -119,7 +119,7 @@ constexpr static uint32_t gkTrackFillMapWithColl = VarManager::ObjTypes::Reduced constexpr static int pairTypeEE = VarManager::kDecayToEE; // Global function used to define needed histogram classes -void DefineHistograms(HistogramManager* histMan, TString histClasses, Configurable configVar); // defines histograms for all tasks +void DefineHistograms(HistogramManager* histMan, const TString& histClasses, const Configurable& configVar); // defines histograms for all tasks struct AnalysisEventSelection { Produces eventSel; @@ -1235,7 +1235,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) adaptAnalysisTask(cfgc)}; } -void DefineHistograms(HistogramManager* histMan, TString histClasses, Configurable configVar) +void DefineHistograms(HistogramManager* histMan, const TString& histClasses, const Configurable& configVar) { // // Define here the histograms for all the classes required in analysis. diff --git a/PWGEM/Dilepton/Utils/MomentumSmearer.h b/PWGEM/Dilepton/Utils/MomentumSmearer.h index 59bb41f948c..878f3403109 100644 --- a/PWGEM/Dilepton/Utils/MomentumSmearer.h +++ b/PWGEM/Dilepton/Utils/MomentumSmearer.h @@ -32,6 +32,7 @@ #include #include +#include #include class MomentumSmearer @@ -43,11 +44,11 @@ class MomentumSmearer /// Constructor with resolution histograms MomentumSmearer(TString resFileName, TString resPtHistName, TString resEtaHistName, TString resPhiPosHistName, TString resPhiNegHistName) { - setResFileName(resFileName); - setResPtHistName(resPtHistName); - setResEtaHistName(resEtaHistName); - setResPhiPosHistName(resPhiPosHistName); - setResPhiNegHistName(resPhiNegHistName); + setResFileName(std::move(resFileName)); + setResPtHistName(std::move(resPtHistName)); + setResEtaHistName(std::move(resEtaHistName)); + setResPhiPosHistName(std::move(resPhiPosHistName)); + setResPhiNegHistName(std::move(resPhiNegHistName)); setEffFileName(""); setEffHistName(""); setDCAFileName(""); @@ -58,8 +59,8 @@ class MomentumSmearer /// Constructor with resolution ND sparse histogram MomentumSmearer(TString resFileName, TString resNDHistName) { - setResFileName(resFileName); - setResNDHistName(resNDHistName); + setResFileName(std::move(resFileName)); + setResNDHistName(std::move(resNDHistName)); setResPtHistName(""); setResEtaHistName(""); setResPhiPosHistName(""); @@ -75,13 +76,13 @@ class MomentumSmearer /// Constructor with resolution histograms and efficiency MomentumSmearer(TString resFileName, TString resPtHistName, TString resEtaHistName, TString resPhiPosHistName, TString resPhiNegHistName, TString effFileName, TString effHistName) { - setResFileName(resFileName); - setResPtHistName(resPtHistName); - setResEtaHistName(resEtaHistName); - setResPhiPosHistName(resPhiPosHistName); - setResPhiNegHistName(resPhiNegHistName); - setEffFileName(effFileName); - setEffHistName(effHistName); + setResFileName(std::move(resFileName)); + setResPtHistName(std::move(resPtHistName)); + setResEtaHistName(std::move(resEtaHistName)); + setResPhiPosHistName(std::move(resPhiPosHistName)); + setResPhiNegHistName(std::move(resPhiNegHistName)); + setEffFileName(std::move(effFileName)); + setEffHistName(std::move(effHistName)); setDCAFileName(""); setDCAHistName(""); init(); @@ -90,15 +91,15 @@ class MomentumSmearer /// Constructor with resolution histograms and efficiency and dca MomentumSmearer(TString resFileName, TString resPtHistName, TString resEtaHistName, TString resPhiPosHistName, TString resPhiNegHistName, TString effFileName, TString effHistName, TString dcaFileName, TString dcaHistName) { - setResFileName(resFileName); - setResPtHistName(resPtHistName); - setResEtaHistName(resEtaHistName); - setResPhiPosHistName(resPhiPosHistName); - setResPhiNegHistName(resPhiNegHistName); - setEffFileName(effFileName); - setEffHistName(effHistName); - setDCAFileName(dcaFileName); - setDCAHistName(dcaHistName); + setResFileName(std::move(resFileName)); + setResPtHistName(std::move(resPtHistName)); + setResEtaHistName(std::move(resEtaHistName)); + setResPhiPosHistName(std::move(resPhiPosHistName)); + setResPhiNegHistName(std::move(resPhiNegHistName)); + setEffFileName(std::move(effFileName)); + setEffHistName(std::move(effHistName)); + setDCAFileName(std::move(dcaFileName)); + setDCAHistName(std::move(dcaHistName)); init(); } @@ -560,19 +561,19 @@ class MomentumSmearer // setters void setNDSmearing(bool flag) { fDoNDSmearing = flag; } - void setResFileName(TString resFileName) { fResFileName = resFileName; } - void setResNDHistName(TString resNDHistName) { fResNDHistName = resNDHistName; } - void setResPtHistName(TString resPtHistName) { fResPtHistName = resPtHistName; } - void setResEtaHistName(TString resEtaHistName) { fResEtaHistName = resEtaHistName; } - void setResPhiPosHistName(TString resPhiPosHistName) { fResPhiPosHistName = resPhiPosHistName; } - void setResPhiNegHistName(TString resPhiNegHistName) { fResPhiNegHistName = resPhiNegHistName; } - void setEffFileName(TString effFileName) { fEffFileName = effFileName; } - void setEffHistName(TString effHistName) { fEffHistName = effHistName; } - void setDCAFileName(TString dcaFileName) { fDCAFileName = dcaFileName; } - void setDCAHistName(TString dcaHistName) { fDCAHistName = dcaHistName; } - void setCcdbPathRes(TString ccdbPathRes) { fCcdbPathRes = ccdbPathRes; } - void setCcdbPathEff(TString ccdbPathEff) { fCcdbPathEff = ccdbPathEff; } - void setCcdbPathDCA(TString ccdbPathDCA) { fCcdbPathDCA = ccdbPathDCA; } + void setResFileName(TString resFileName) { fResFileName = std::move(resFileName); } + void setResNDHistName(TString resNDHistName) { fResNDHistName = std::move(resNDHistName); } + void setResPtHistName(TString resPtHistName) { fResPtHistName = std::move(resPtHistName); } + void setResEtaHistName(TString resEtaHistName) { fResEtaHistName = std::move(resEtaHistName); } + void setResPhiPosHistName(TString resPhiPosHistName) { fResPhiPosHistName = std::move(resPhiPosHistName); } + void setResPhiNegHistName(TString resPhiNegHistName) { fResPhiNegHistName = std::move(resPhiNegHistName); } + void setEffFileName(TString effFileName) { fEffFileName = std::move(effFileName); } + void setEffHistName(TString effHistName) { fEffHistName = std::move(effHistName); } + void setDCAFileName(TString dcaFileName) { fDCAFileName = std::move(dcaFileName); } + void setDCAHistName(TString dcaHistName) { fDCAHistName = std::move(dcaHistName); } + void setCcdbPathRes(TString ccdbPathRes) { fCcdbPathRes = std::move(ccdbPathRes); } + void setCcdbPathEff(TString ccdbPathEff) { fCcdbPathEff = std::move(ccdbPathEff); } + void setCcdbPathDCA(TString ccdbPathDCA) { fCcdbPathDCA = std::move(ccdbPathDCA); } void setCcdb(o2::framework::Service ccdb) { fCcdb = ccdb; diff --git a/PWGEM/PhotonMeson/Legacy/gammaConversions.h b/PWGEM/PhotonMeson/Legacy/gammaConversions.h index 085ffe7c137..7733277880a 100644 --- a/PWGEM/PhotonMeson/Legacy/gammaConversions.h +++ b/PWGEM/PhotonMeson/Legacy/gammaConversions.h @@ -34,9 +34,9 @@ typedef std::map mapStringHistPtr; // define this in order to have a constructor of the HistogramSpec which copies the name into the title and to have dataOnly flag struct MyHistogramSpec { MyHistogramSpec(char const* const name_, char const* const title_, o2::framework::HistogramConfigSpec config_, bool callSumw2_ = false, bool dataOnly_ = false) - : m{name_, title_, config_, callSumw2_}, fDataOnly(dataOnly_) {} + : m{name_, title_, std::move(config_), callSumw2_}, fDataOnly(dataOnly_) {} MyHistogramSpec(char const* const name_, o2::framework::HistogramConfigSpec config_, bool callSumw2_ = false, bool dataOnly_ = false) - : m{name_, name_, config_, callSumw2_}, fDataOnly(dataOnly_) {} + : m{name_, name_, std::move(config_), callSumw2_}, fDataOnly(dataOnly_) {} o2::framework::HistogramSpec m{}; bool fDataOnly{false}; }; diff --git a/PWGEM/PhotonMeson/Legacy/gammaConversionsTruthOnlyMc.cxx b/PWGEM/PhotonMeson/Legacy/gammaConversionsTruthOnlyMc.cxx index 94ad627191a..c40ce692e52 100644 --- a/PWGEM/PhotonMeson/Legacy/gammaConversionsTruthOnlyMc.cxx +++ b/PWGEM/PhotonMeson/Legacy/gammaConversionsTruthOnlyMc.cxx @@ -91,7 +91,7 @@ struct gammaConversionsTruthOnlyMc { } } template - void fillAsymmetryHistograms(MCGAMMA const& theMcConvGamma, MCDAUONE const theFirstDaughter, MCDAUTWO theSecondDaughter) + void fillAsymmetryHistograms(MCGAMMA const& theMcConvGamma, MCDAUONE const& theFirstDaughter, const MCDAUTWO& theSecondDaughter) { float lConversionRadius = theMcConvGamma.v0Radius(); float lGammaMomentum = theMcConvGamma.p(); diff --git a/PWGEM/PhotonMeson/Tasks/phosQC.cxx b/PWGEM/PhotonMeson/Tasks/phosQC.cxx index 7dbc1684f9a..b4302803248 100644 --- a/PWGEM/PhotonMeson/Tasks/phosQC.cxx +++ b/PWGEM/PhotonMeson/Tasks/phosQC.cxx @@ -77,7 +77,7 @@ struct phosQC { // for Clusters for (auto& cut : fPHOSCuts) { - std::string cutname = cut.getName(); + const std::string& cutname = cut.getName(); THashList* list = reinterpret_cast(fMainList->FindObject("Cluster")->FindObject(cutname.c_str())); o2::aod::pwgem::photon::histogram::DefineHistograms(list, "Cluster", "PHOS"); } diff --git a/PWGEM/Tasks/phosCluQA.cxx b/PWGEM/Tasks/phosCluQA.cxx index 62d171a7690..94c332a2208 100644 --- a/PWGEM/Tasks/phosCluQA.cxx +++ b/PWGEM/Tasks/phosCluQA.cxx @@ -730,7 +730,7 @@ struct phosCluQA { // If several collisions appear in BC, choose one with largers number of contributors std::map colMap; - for (auto cl : colls) { + for (const auto& cl : colls) { auto colbc = colMap.find(cl.bc_as().globalBC()); if (colbc == colMap.end()) { // single collision per BC colMap[cl.bc_as().globalBC()] = 1; diff --git a/PWGEM/Tasks/phosNbar.cxx b/PWGEM/Tasks/phosNbar.cxx index 6cf0d3d082b..8b0f99c8120 100644 --- a/PWGEM/Tasks/phosNbar.cxx +++ b/PWGEM/Tasks/phosNbar.cxx @@ -248,7 +248,7 @@ struct phosNbar { if constexpr (isMC) { // check current collision Id for clusters int cluMcBCId = -1; - for (auto clu : clusters) { + for (const auto& clu : clusters) { auto mcList = clu.labels(); // const std::vector int nParents = mcList.size(); for (int iParent = 0; iParent < nParents; iParent++) { // Not found nbar parent yiet @@ -265,7 +265,7 @@ struct phosNbar { } // Scan MC particles in current MC event if (mcParticles->begin() != mcParticles->end()) { - for (auto part : *mcParticles) { + for (const auto& part : *mcParticles) { if (part.mcCollision().bcId() != cluMcBCId) { continue; if (part.pdgCode() == -3112) { // Sigma+ @@ -384,7 +384,7 @@ struct phosNbar { return; // do not fill Mixed, do not update stack of events } for (auto tr : piEvent) { - for (auto nbarMixEv : mixNbarEvts[mixIndex]) { + for (const auto& nbarMixEv : mixNbarEvts[mixIndex]) { for (auto nbar : nbarMixEv) { double dca = 999.; switch (mPairingMethod) { @@ -417,7 +417,7 @@ struct phosNbar { } } } - for (auto trMixEvent : mixTrackEvts[mixIndex]) { + for (const auto& trMixEvent : mixTrackEvts[mixIndex]) { for (auto tr : trMixEvent) { for (auto nbar : nbarEvent) { double dca = 999.; diff --git a/PWGEM/Tasks/phosTrigQA.cxx b/PWGEM/Tasks/phosTrigQA.cxx index 6cea670f118..c7e351672ab 100644 --- a/PWGEM/Tasks/phosTrigQA.cxx +++ b/PWGEM/Tasks/phosTrigQA.cxx @@ -181,7 +181,7 @@ struct phosTrigQA { // If several collisions appear in BC, choose one with largers number of contributors std::map colMap; - for (auto cl : colls) { + for (const auto& cl : colls) { auto colbc = colMap.find(cl.bc().globalBC()); if (colbc == colMap.end()) { // single collision per BC colMap[cl.bc().globalBC()] = 1;