From c1e0b73c8672608f5e3b9a44025c5c68b2d196b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Fri, 1 Sep 2023 21:01:23 +0200 Subject: [PATCH 1/9] Fix missing std:: because of pollution from CCDBDownloader.h --- Common/Tools/handleParamTPCResponse.cxx | 2 +- PWGEM/PhotonMeson/TableProducer/createPCM.cxx | 4 ++-- PWGHF/TableProducer/candidateSelectorLcToK0sP.cxx | 2 +- PWGLF/DataModel/LFHyperhelium4Tables.h | 4 ++-- Tools/KFparticle/qaKFParticle.cxx | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Common/Tools/handleParamTPCResponse.cxx b/Common/Tools/handleParamTPCResponse.cxx index 868c5f0c0c8..64741503fae 100644 --- a/Common/Tools/handleParamTPCResponse.cxx +++ b/Common/Tools/handleParamTPCResponse.cxx @@ -251,7 +251,7 @@ int main(int argc, char* argv[]) // Request interactive confirmation to upload LOG(info) << "Continue with object upload anyway? (Y/n)"; std::string confirm; - cin >> confirm; + std::cin >> confirm; if (boost::iequals(confirm.substr(0, 1), "y")) { LOG(info) << "Continuing with object upload"; } else { diff --git a/PWGEM/PhotonMeson/TableProducer/createPCM.cxx b/PWGEM/PhotonMeson/TableProducer/createPCM.cxx index 4ada0021954..a3bc6dfda2f 100644 --- a/PWGEM/PhotonMeson/TableProducer/createPCM.cxx +++ b/PWGEM/PhotonMeson/TableProducer/createPCM.cxx @@ -373,8 +373,8 @@ struct createPCM { // Partition orphan_negTracks = o2::aod::track::signed1Pt < 0.f && o2::aod::track::collisionId < int32_t(0); Partition posTracks = o2::aod::track::signed1Pt > 0.f; Partition negTracks = o2::aod::track::signed1Pt < 0.f; - vectorsliceByCached(o2::aod::track::collisionId, 0, cache))> negTracks_sw; - vectorsliceByCached(o2::aod::track::collisionId, 0, cache))> posTracks_sw; + std::vectorsliceByCached(o2::aod::track::collisionId, 0, cache))> negTracks_sw; + std::vectorsliceByCached(o2::aod::track::collisionId, 0, cache))> posTracks_sw; void processSA(MyFilteredTracks const& tracks, aod::Collisions const& collisions, aod::BCsWithTimestamps const&) { diff --git a/PWGHF/TableProducer/candidateSelectorLcToK0sP.cxx b/PWGHF/TableProducer/candidateSelectorLcToK0sP.cxx index 80f4c5e9ee9..78d17948cf7 100644 --- a/PWGHF/TableProducer/candidateSelectorLcToK0sP.cxx +++ b/PWGHF/TableProducer/candidateSelectorLcToK0sP.cxx @@ -143,7 +143,7 @@ struct HfCandidateSelectorLcToK0sP { TrackSelectorPr selectorProtonHighP; o2::analysis::HfMlResponse hfMlResponse; - std::vector selectedInputFeatures{vector(MLInputFeatures::NInputFeatures, false)}; + std::vector selectedInputFeatures{std::vector(MLInputFeatures::NInputFeatures, false)}; o2::ccdb::CcdbApi ccdbApi; diff --git a/PWGLF/DataModel/LFHyperhelium4Tables.h b/PWGLF/DataModel/LFHyperhelium4Tables.h index 882c272cf69..8d7d5f4d379 100644 --- a/PWGLF/DataModel/LFHyperhelium4Tables.h +++ b/PWGLF/DataModel/LFHyperhelium4Tables.h @@ -88,9 +88,9 @@ DECLARE_SOA_DYNAMIC_COLUMN(PtPion, ptPion, //! pT of prong 0 (identified as prot DECLARE_SOA_DYNAMIC_COLUMN(DecayRadius, decayRadius, //! decay radius (2D, centered at zero) [](float x, float y) -> float { return RecoDecay::sqrtSumOfSquares(x, y); }); DECLARE_SOA_DYNAMIC_COLUMN(M, m, //! mass under hyperhelium-4 hypo - [](float pxp0, float pyp0, float pzp0, float pxp1, float pyp1, float pzp1, float pxp2, float pyp2, float pzp2) -> float { return RecoDecay::m(array{array{pxp0, pyp0, pzp0}, array{pxp1, pyp1, pzp1}, array{pxp2, pyp2, pzp2}}, array{o2::constants::physics::MassHelium3, o2::constants::physics::MassProton, o2::constants::physics::MassPionCharged}); }); + [](float pxp0, float pyp0, float pzp0, float pxp1, float pyp1, float pzp1, float pxp2, float pyp2, float pzp2) -> float { return RecoDecay::m(std::array{std::array{pxp0, pyp0, pzp0}, std::array{pxp1, pyp1, pzp1}, std::array{pxp2, pyp2, pzp2}}, std::array{o2::constants::physics::MassHelium3, o2::constants::physics::MassProton, o2::constants::physics::MassPionCharged}); }); DECLARE_SOA_DYNAMIC_COLUMN(YHyHe4, yHyHe4, //! y -> FIXME add Hyperhelium4 mass to physics constants - [](float Px, float Py, float Pz) -> float { return RecoDecay::y(array{Px, Py, Pz}, 3.929); }); + [](float Px, float Py, float Pz) -> float { return RecoDecay::y(std::array{Px, Py, Pz}, 3.929); }); // Standard expression columns - note correct momentum for the He3 daughter DECLARE_SOA_EXPRESSION_COLUMN(Px, px, //! px diff --git a/Tools/KFparticle/qaKFParticle.cxx b/Tools/KFparticle/qaKFParticle.cxx index dba1960c387..0726aad3483 100644 --- a/Tools/KFparticle/qaKFParticle.cxx +++ b/Tools/KFparticle/qaKFParticle.cxx @@ -961,7 +961,7 @@ struct qaKFParticle { int sourceD0 = 0; int sourceD0Bar = 0; - auto indexRec = RecoDecay::getMatchedMCRec(mcParticles, std::array{track1, track2}, 421, array{211, -321}, true, &sign); + auto indexRec = RecoDecay::getMatchedMCRec(mcParticles, std::array{track1, track2}, 421, std::array{211, -321}, true, &sign); if (indexRec > -1) { auto particle = mcParticles.rawIteratorAt(indexRec); flag = RecoDecay::getCharmHadronOrigin(mcParticles, particle); From 67acaeaf9d3eadcbdd2f38096a578a6d554e9203 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Fri, 1 Sep 2023 21:48:06 +0200 Subject: [PATCH 2/9] Remove std namespace from HistogramsLibrary.h --- PWGEM/PhotonMeson/Core/HistogramsLibrary.h | 1 - 1 file changed, 1 deletion(-) diff --git a/PWGEM/PhotonMeson/Core/HistogramsLibrary.h b/PWGEM/PhotonMeson/Core/HistogramsLibrary.h index 4b00039a466..bcff1f91b9c 100644 --- a/PWGEM/PhotonMeson/Core/HistogramsLibrary.h +++ b/PWGEM/PhotonMeson/Core/HistogramsLibrary.h @@ -17,7 +17,6 @@ #include #include -using namespace std; #include #include #include From dc8383de984ddacf80fc2966c9bcb2966586d58c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Fri, 1 Sep 2023 22:08:59 +0200 Subject: [PATCH 3/9] Remove std namespace pollution from GFW and GFWPowerArray --- PWGCF/GenericFramework/GFW.cxx | 6 +++ PWGCF/GenericFramework/GFW.h | 61 ++++++++++++------------ PWGCF/GenericFramework/GFWPowerArray.cxx | 4 ++ PWGCF/GenericFramework/GFWPowerArray.h | 9 ++-- 4 files changed, 44 insertions(+), 36 deletions(-) diff --git a/PWGCF/GenericFramework/GFW.cxx b/PWGCF/GenericFramework/GFW.cxx index 221b4324438..c7d5bf7d0d1 100644 --- a/PWGCF/GenericFramework/GFW.cxx +++ b/PWGCF/GenericFramework/GFW.cxx @@ -18,6 +18,12 @@ If used, modified, or distributed, please aknowledge the author of this code. */ #include "GFW.h" + +using std::complex; +using std::string; +using std::vector; +using std::pair; + GFW::GFW() : fInitialized(false) {} GFW::~GFW() diff --git a/PWGCF/GenericFramework/GFW.h b/PWGCF/GenericFramework/GFW.h index a9d575caea7..0bb08e35bbd 100644 --- a/PWGCF/GenericFramework/GFW.h +++ b/PWGCF/GenericFramework/GFW.h @@ -18,6 +18,7 @@ If used, modified, or distributed, please aknowledge the author of this code. */ #ifndef PWGCF_GENERICFRAMEWORK_GFW_H_ #define PWGCF_GENERICFRAMEWORK_GFW_H_ + #include "GFWCumulant.h" #include "GFWPowerArray.h" #include @@ -25,19 +26,17 @@ If used, modified, or distributed, please aknowledge the author of this code. #include #include #include -using std::complex; -using std::string; -using std::vector; + class GFW { public: struct Region { int Nhar, NpT; - vector NparVec{}; + std::vector NparVec{}; double EtaMin = -999; double EtaMax = -999; int BitMask = 1; - string rName = ""; + std::string rName = ""; bool powsDefined = false; bool operator<(const Region& a) const { @@ -46,47 +45,47 @@ class GFW void PrintStructure() { printf("%s: eta [%f.. %f].", rName.c_str(), EtaMin, EtaMax); } }; struct CorrConfig { - vector> Regs{}; - vector> Hars{}; - vector Overlap; - vector ptInd; + std::vector> Regs{}; + std::vector> Hars{}; + std::vector Overlap; + std::vector ptInd; bool pTDif = false; - string Head = ""; + std::string Head = ""; }; GFW(); ~GFW(); - vector fRegions; - vector fCumulants; - void AddRegion(string refName, double lEtaMin, double lEtaMax, int lNpT, int BitMask); - void AddRegion(string refName, vector lNparVec, double lEtaMin, double lEtaMax, int lNpT, int BitMask); // Legacy - void AddRegion(string refName, int lNhar, int lNpar, double lEtaMin, double lEtaMax, int lNpT, int BitMask); // Legacy support, all powers are the same - void AddRegion(string refName, int lNhar, int* lNparVec, double lEtaMin, double lEtaMax, int lNpT, int BitMask); // Legacy support, array instead of a vector + 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 int CreateRegions(); void Fill(double eta, int ptin, double phi, double weight, int mask, double secondWeight = -1); void Clear(); GFWCumulant GetCumulant(int index) { return fCumulants.at(index); } - CorrConfig GetCorrelatorConfig(string config, string head = "", bool ptdif = false); - complex Calculate(CorrConfig corconf, int ptbin, bool SetHarmsToZero); + CorrConfig GetCorrelatorConfig(std::string config, std::string head = "", bool ptdif = false); + std::complex Calculate(CorrConfig corconf, int ptbin, bool SetHarmsToZero); void InitializePowerArrays(); protected: bool fInitialized; - vector fListOfCFGs; - complex TwoRec(int n1, int n2, int p1, int p2, int ptbin, GFWCumulant*, GFWCumulant*, GFWCumulant*); - complex RecursiveCorr(GFWCumulant* qpoi, GFWCumulant* qref, GFWCumulant* qol, int ptbin, vector& hars, vector& pows); // POI, Ref. flow, overlapping region - complex RecursiveCorr(GFWCumulant* qpoi, GFWCumulant* qref, GFWCumulant* qol, int ptbin, vector& hars); // POI, Ref. flow, overlapping region + std::vector fListOfCFGs; + 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); } Region GetRegion(int index) { return fRegions.at(index); } - int FindRegionByName(string refName); - vector>> GetHarmonicsSingleConfig(const CorrConfig&); + int FindRegionByName(std::string refName); + std::vector>> GetHarmonicsSingleConfig(const CorrConfig&); // Calculating functions: - complex Calculate(int poi, int ref, vector hars, int ptbin = 0); // For differential, need POI and reference - complex Calculate(int poi, vector hars); // For integrated case + std::complex Calculate(int poi, int ref, std::vector hars, int ptbin = 0); // For differential, need POI and reference + std::complex Calculate(int poi, std::vector hars); // For integrated case // Operations on strings. Equivalent to TString operations, but one to rid of root dependence - int s_index(string& instr, const string& pattern, const int& spos = 0); - bool s_contains(string& instr, const string& pattern); - void s_replace(string& instr, const string& pattern1, const string& pattern2, const int& spos = 0); - void s_replace_all(string& instr, const string& pattern1, const string& pattern2); - bool s_tokenize(string& instr, string& substr, int& spos, const string& delim); + int s_index(std::string& instr, const std::string& pattern, const int& spos = 0); + bool s_contains(std::string& instr, const std::string& pattern); + void s_replace(std::string& instr, const std::string& pattern1, const std::string& pattern2, const int& spos = 0); + void s_replace_all(std::string& instr, const std::string& pattern1, const std::string& pattern2); + bool s_tokenize(std::string& instr, std::string& substr, int& spos, const std::string& delim); }; #endif // PWGCF_GENERICFRAMEWORK_GFW_H_ diff --git a/PWGCF/GenericFramework/GFWPowerArray.cxx b/PWGCF/GenericFramework/GFWPowerArray.cxx index 197e836ed05..82291e507a2 100644 --- a/PWGCF/GenericFramework/GFWPowerArray.cxx +++ b/PWGCF/GenericFramework/GFWPowerArray.cxx @@ -10,6 +10,10 @@ // or submit itself to any jurisdiction. #include "GFWPowerArray.h" + +using std::string; +using std::vector; + int GFWPowerArray::getHighestHarmonic(const HarSet& inhar) { // Highest possible harmonic: sum of same-sign harmonics diff --git a/PWGCF/GenericFramework/GFWPowerArray.h b/PWGCF/GenericFramework/GFWPowerArray.h index 9562d601e5c..12d7361fbc2 100644 --- a/PWGCF/GenericFramework/GFWPowerArray.h +++ b/PWGCF/GenericFramework/GFWPowerArray.h @@ -11,17 +11,16 @@ #ifndef PWGCF_GENERICFRAMEWORK_GFWPOWERARRAY_H_ #define PWGCF_GENERICFRAMEWORK_GFWPOWERARRAY_H_ + #include #include #include -using namespace std; -using std::string; -using std::vector; -typedef vector HarSet; + +typedef std::vector HarSet; class GFWPowerArray { public: - static HarSet GetPowerArray(vector inHarmonics); + static HarSet GetPowerArray(std::vector inHarmonics); static void PowerArrayTest(); private: From e3580da01bea60e44b19e413826066ac33f137b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Fri, 1 Sep 2023 22:12:04 +0200 Subject: [PATCH 4/9] Remove std namespace pollution from HFInvMassFitter --- PWGHF/D2H/Macros/HFInvMassFitter.h | 1 - 1 file changed, 1 deletion(-) diff --git a/PWGHF/D2H/Macros/HFInvMassFitter.h b/PWGHF/D2H/Macros/HFInvMassFitter.h index 5ad8799ed91..07dbca26971 100644 --- a/PWGHF/D2H/Macros/HFInvMassFitter.h +++ b/PWGHF/D2H/Macros/HFInvMassFitter.h @@ -37,7 +37,6 @@ #include using namespace RooFit; -using namespace std; class TF1; class TH1F; From 435b1270c0fe14b4650b9674fb37fd08b88604a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Fri, 1 Sep 2023 22:41:24 +0200 Subject: [PATCH 5/9] Clean GFWCumulant --- PWGCF/GenericFramework/GFWCumulant.cxx | 5 +++++ PWGCF/GenericFramework/GFWCumulant.h | 14 +++++++------- PWGDQ/Tasks/dqFlow.cxx | 1 + 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/PWGCF/GenericFramework/GFWCumulant.cxx b/PWGCF/GenericFramework/GFWCumulant.cxx index 6ced53f6334..a82e3bcd08b 100644 --- a/PWGCF/GenericFramework/GFWCumulant.cxx +++ b/PWGCF/GenericFramework/GFWCumulant.cxx @@ -16,7 +16,12 @@ A part of A container to store Q vectors for one subevent with an extra layer to recursively calculate particle correlations. If used, modified, or distributed, please aknowledge the author of this code. */ + #include "GFWCumulant.h" + +using std::complex; +using std::vector; + GFWCumulant::GFWCumulant() : fQvector(0), fUsed(kBlank), fNEntries(-1), diff --git a/PWGCF/GenericFramework/GFWCumulant.h b/PWGCF/GenericFramework/GFWCumulant.h index 7aff3c4acf9..70341e8e625 100644 --- a/PWGCF/GenericFramework/GFWCumulant.h +++ b/PWGCF/GenericFramework/GFWCumulant.h @@ -18,11 +18,11 @@ If used, modified, or distributed, please aknowledge the author of this code. */ #ifndef PWGCF_GENERICFRAMEWORK_GFWCUMULANT_H_ #define PWGCF_GENERICFRAMEWORK_GFWCUMULANT_H_ + #include #include #include -using std::complex; -using std::vector; + class GFWCumulant { public: @@ -42,22 +42,22 @@ class GFWCumulant int GetN() { return fNEntries; } bool IsPtBinFilled(int ptb); void CreateComplexVectorArray(int N = 1, int P = 1, int Pt = 1); - void CreateComplexVectorArrayVarPower(int N = 1, vector Pvec = {1}, int Pt = 1); + void CreateComplexVectorArrayVarPower(int N = 1, std::vector Pvec = {1}, int Pt = 1); int PW(int ind) { return fPowVec.at(ind); }; // No checks to speed up, be carefull!!! void DestroyComplexVectorArray(); - complex Vec(int, int, int ptbin = 0); // envelope class to summarize pt-dif. Q-vec getter + std::complex Vec(int, int, int ptbin = 0); // envelope class to summarize pt-dif. Q-vec getter protected: - complex*** fQvector; + std::complex*** fQvector; uint fUsed; int fNEntries; // Q-vectors. Could be done recursively, but maybe defining each one of them explicitly is easier to read int fN; //! Harmonics int fPow; //! Power - vector fPowVec; //! Powers array + std::vector fPowVec; //! Powers array int fPt; //! fPt bins bool* fFilledPts; bool fInitialized; // Arrays are initialized - complex fNullQ = 0; + std::complex fNullQ = 0; }; #endif // PWGCF_GENERICFRAMEWORK_GFWCUMULANT_H_ diff --git a/PWGDQ/Tasks/dqFlow.cxx b/PWGDQ/Tasks/dqFlow.cxx index 5867bb01fef..fe9f314a58b 100644 --- a/PWGDQ/Tasks/dqFlow.cxx +++ b/PWGDQ/Tasks/dqFlow.cxx @@ -48,6 +48,7 @@ using std::cout; using std::endl; using std::string; +using std::complex; using namespace o2; using namespace o2::framework; From ce9af082a0ced1de86667dd2f643c1a968619b57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Fri, 1 Sep 2023 22:41:41 +0200 Subject: [PATCH 6/9] Clean MCSignal --- PWGDQ/Core/MCSignal.cxx | 3 +++ PWGDQ/Core/MCSignal.h | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/PWGDQ/Core/MCSignal.cxx b/PWGDQ/Core/MCSignal.cxx index 9d9e8520dfb..a86b0f8aa8d 100644 --- a/PWGDQ/Core/MCSignal.cxx +++ b/PWGDQ/Core/MCSignal.cxx @@ -11,6 +11,9 @@ #include "PWGDQ/Core/MCSignal.h" +using std::cout; +using std::endl; + ClassImp(MCSignal); //________________________________________________________________________________________________ diff --git a/PWGDQ/Core/MCSignal.h b/PWGDQ/Core/MCSignal.h index 665c3a0811b..eb12c883ba1 100644 --- a/PWGDQ/Core/MCSignal.h +++ b/PWGDQ/Core/MCSignal.h @@ -61,8 +61,6 @@ process(aod::McParticles const& mcTracks) { #include #include -using std::cout; -using std::endl; class MCSignal : public TNamed { From c5011accc2e523aa707c32627a875c6780eee833 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Fri, 1 Sep 2023 22:47:04 +0200 Subject: [PATCH 7/9] Clean VarManager --- PWGDQ/Core/VarManager.cxx | 4 +++ PWGDQ/Core/VarManager.h | 75 +++++++++++++++++++-------------------- 2 files changed, 40 insertions(+), 39 deletions(-) diff --git a/PWGDQ/Core/VarManager.cxx b/PWGDQ/Core/VarManager.cxx index ba8604f6c8d..ebbac5a8f6d 100644 --- a/PWGDQ/Core/VarManager.cxx +++ b/PWGDQ/Core/VarManager.cxx @@ -14,6 +14,10 @@ #include +using std::cout; +using std::endl; +using namespace o2::constants::physics; + ClassImp(VarManager); TString VarManager::fgVariableNames[VarManager::kNVars] = {""}; diff --git a/PWGDQ/Core/VarManager.h b/PWGDQ/Core/VarManager.h index c4b548edd9a..72d795ea0cb 100644 --- a/PWGDQ/Core/VarManager.h +++ b/PWGDQ/Core/VarManager.h @@ -53,12 +53,9 @@ #include "KFParticleBase.h" #include "KFVertex.h" -using std::cout; -using std::endl; using SMatrix55 = ROOT::Math::SMatrix>; using SMatrix5 = ROOT::Math::SVector; using Vec3D = ROOT::Math::SVector; -using namespace o2::constants::physics; //_________________________________________________________________________ class VarManager : public TObject @@ -1227,20 +1224,20 @@ void VarManager::FillPair(T1 const& t1, T2 const& t2, float* values) values = fgValues; } - float m1 = MassElectron; - float m2 = MassElectron; + float m1 = o2::constants::physics::MassElectron; + float m2 = o2::constants::physics::MassElectron; if constexpr (pairType == kDecayToMuMu) { - m1 = MassMuon; - m2 = MassMuon; + m1 = o2::constants::physics::MassMuon; + m2 = o2::constants::physics::MassMuon; } if constexpr (pairType == kDecayToPiPi) { - m1 = MassPionCharged; - m2 = MassPionCharged; + m1 = o2::constants::physics::MassPionCharged; + m2 = o2::constants::physics::MassPionCharged; } if constexpr (pairType == kElectronMuon) { - m2 = MassMuon; + m2 = o2::constants::physics::MassMuon; } ROOT::Math::PtEtaPhiMVector v1(t1.pt(), t1.eta(), t1.phi(), m1); @@ -1433,20 +1430,20 @@ void VarManager::FillPairME(T1 const& t1, T2 const& t2, float* values) values = fgValues; } - float m1 = MassElectron; - float m2 = MassElectron; + float m1 = o2::constants::physics::MassElectron; + float m2 = o2::constants::physics::MassElectron; if constexpr (pairType == kDecayToMuMu) { - m1 = MassMuon; - m2 = MassMuon; + m1 = o2::constants::physics::MassMuon; + m2 = o2::constants::physics::MassMuon; } if constexpr (pairType == kDecayToPiPi) { - m1 = MassPionCharged; - m2 = MassPionCharged; + m1 = o2::constants::physics::MassPionCharged; + m2 = o2::constants::physics::MassPionCharged; } if constexpr (pairType == kElectronMuon) { - m2 = MassMuon; + m2 = o2::constants::physics::MassMuon; } ROOT::Math::PtEtaPhiMVector v1(t1.pt(), t1.eta(), t1.phi(), m1); @@ -1466,20 +1463,20 @@ void VarManager::FillPairMC(T1 const& t1, T2 const& t2, float* values, PairCandi values = fgValues; } - float m1 = MassElectron; - float m2 = MassElectron; + float m1 = o2::constants::physics::MassElectron; + float m2 = o2::constants::physics::MassElectron; if (pairType == kDecayToMuMu) { - m1 = MassMuon; - m2 = MassMuon; + m1 = o2::constants::physics::MassMuon; + m2 = o2::constants::physics::MassMuon; } if (pairType == kDecayToPiPi) { - m1 = MassPionCharged; - m2 = MassPionCharged; + m1 = o2::constants::physics::MassPionCharged; + m2 = o2::constants::physics::MassPionCharged; } if (pairType == kElectronMuon) { - m2 = MassMuon; + m2 = o2::constants::physics::MassMuon; } // TODO : implement resolution smearing. @@ -1564,8 +1561,8 @@ void VarManager::FillPairVertexing(C const& collision, T const& t1, T const& t2, return; } - float m1 = MassElectron; - float m2 = MassElectron; + float m1 = o2::constants::physics::MassElectron; + float m2 = o2::constants::physics::MassElectron; Vec3D secondaryVertex; float bz = 0; std::array pvec0; @@ -1597,8 +1594,8 @@ void VarManager::FillPairVertexing(C const& collision, T const& t1, T const& t2, trackParVar1.propagateToDCA(primaryVertex, bz, &impactParameter1); } else if constexpr (pairType == kDecayToMuMu && muonHasCov) { // Get pca candidate from forward DCA fitter - m1 = MassMuon; - m2 = MassMuon; + m1 = o2::constants::physics::MassMuon; + m2 = o2::constants::physics::MassMuon; secondaryVertex = fgFitterTwoProngFwd.getPCACandidate(); bz = fgFitterTwoProngFwd.getBz(); @@ -1749,8 +1746,8 @@ void VarManager::FillDileptonTrackVertexing(C const& collision, T1 const& lepton int procCodeJpsi = 0; if constexpr ((candidateType == kBcToThreeMuons) && muonHasCov) { - mlepton = MassMuon; - mtrack = MassMuon; + mlepton = o2::constants::physics::MassMuon; + mtrack = o2::constants::physics::MassMuon; double chi21 = lepton1.chi2(); double chi22 = lepton2.chi2(); @@ -1778,8 +1775,8 @@ void VarManager::FillDileptonTrackVertexing(C const& collision, T1 const& lepton procCode = VarManager::fgFitterThreeProngFwd.process(pars1, pars2, pars3); procCodeJpsi = VarManager::fgFitterTwoProngFwd.process(pars1, pars2); } else if constexpr ((candidateType == kBtoJpsiEEK) && trackHasCov) { - mlepton = MassElectron; - mtrack = MassKaonCharged; + mlepton = o2::constants::physics::MassElectron; + mtrack = o2::constants::physics::MassKaonCharged; std::array lepton1pars = {lepton1.y(), lepton1.z(), lepton1.snp(), lepton1.tgl(), lepton1.signed1Pt()}; std::array lepton1covs = {lepton1.cYY(), lepton1.cZY(), lepton1.cZZ(), lepton1.cSnpY(), lepton1.cSnpZ(), lepton1.cSnpSnp(), lepton1.cTglY(), lepton1.cTglZ(), lepton1.cTglSnp(), lepton1.cTglTgl(), @@ -1931,20 +1928,20 @@ void VarManager::FillPairVn(T1 const& t1, T2 const& t2, float* values) values = fgValues; } - float m1 = MassElectron; - float m2 = MassElectron; + float m1 = o2::constants::physics::MassElectron; + float m2 = o2::constants::physics::MassElectron; if constexpr (pairType == kDecayToMuMu) { - m1 = MassMuon; - m2 = MassMuon; + m1 = o2::constants::physics::MassMuon; + m2 = o2::constants::physics::MassMuon; } if constexpr (pairType == kDecayToPiPi) { - m1 = MassPionCharged; - m2 = MassPionCharged; + m1 = o2::constants::physics::MassPionCharged; + m2 = o2::constants::physics::MassPionCharged; } if constexpr (pairType == kElectronMuon) { - m2 = MassMuon; + m2 = o2::constants::physics::MassMuon; } // Fill dilepton information From e4fe9461989e388da8f3072440f214b27c83514c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Fri, 1 Sep 2023 23:59:17 +0200 Subject: [PATCH 8/9] Fix use of o2::constants::math --- DPG/Tasks/AOTTrack/qaMatchEff.cxx | 1 + EventFiltering/PWGHF/HFFilterHelpers.h | 2 +- PWGCF/FemtoUniverse/Core/FemtoUniverseAngularContainer.h | 8 ++++---- PWGCF/FemtoUniverse/Core/FemtoUniverseContainer.h | 8 ++++---- PWGCF/FemtoWorld/Core/FemtoWorldContainer.h | 9 ++++----- PWGCF/FemtoWorld/Core/FemtoWorldPionContainer.h | 9 ++++----- PWGEM/PhotonMeson/Utils/gammaConvDefinitions.h | 8 ++++---- PWGLF/Tasks/cascadecorrelations.cxx | 1 + PWGLF/Tasks/hStrangeCorrelation.cxx | 1 + Tutorials/src/propagatedTracks.cxx | 1 + 10 files changed, 25 insertions(+), 23 deletions(-) diff --git a/DPG/Tasks/AOTTrack/qaMatchEff.cxx b/DPG/Tasks/AOTTrack/qaMatchEff.cxx index d5b0ffb3f74..f38149ffc35 100644 --- a/DPG/Tasks/AOTTrack/qaMatchEff.cxx +++ b/DPG/Tasks/AOTTrack/qaMatchEff.cxx @@ -31,6 +31,7 @@ // // base namespaces using namespace o2; +using namespace o2::constants::math; using namespace o2::framework; using namespace o2::framework::expressions; using std::array; diff --git a/EventFiltering/PWGHF/HFFilterHelpers.h b/EventFiltering/PWGHF/HFFilterHelpers.h index 5c50a55b9a4..498408f7d4f 100644 --- a/EventFiltering/PWGHF/HFFilterHelpers.h +++ b/EventFiltering/PWGHF/HFFilterHelpers.h @@ -156,7 +156,7 @@ static const o2::framework::AxisSpec nSigmaAxis{100, -10.f, 10.f}; static const o2::framework::AxisSpec alphaAxis{100, -1.f, 1.f}; static const o2::framework::AxisSpec qtAxis{100, 0.f, 0.25f}; static const o2::framework::AxisSpec bdtAxis{100, 0.f, 1.f}; -static const o2::framework::AxisSpec phiAxis{36, 0., TwoPI}; +static const o2::framework::AxisSpec phiAxis{36, 0., o2::constants::math::TwoPI}; static const std::array massAxisC = {o2::framework::AxisSpec{100, 1.65f, 2.05f}, o2::framework::AxisSpec{100, 1.65f, 2.05f}, o2::framework::AxisSpec{100, 1.75f, 2.15f}, o2::framework::AxisSpec{100, 2.05f, 2.45f}, o2::framework::AxisSpec{100, 2.25f, 2.65f}, o2::framework::AxisSpec{100, 0.139f, 0.159f}, o2::framework::AxisSpec{100, 0.f, 0.25f}, o2::framework::AxisSpec{100, 0.f, 0.25f}, o2::framework::AxisSpec{100, 0.48f, 0.88f}, o2::framework::AxisSpec{100, 0.48f, 0.88f}, o2::framework::AxisSpec{100, 1.1f, 1.4f}, o2::framework::AxisSpec{100, 2.3f, 2.9f}, o2::framework::AxisSpec{100, 2.3f, 2.9f}}; static const std::array massAxisB = {o2::framework::AxisSpec{240, 4.8f, 6.0f}, o2::framework::AxisSpec{240, 4.8f, 6.0f}, o2::framework::AxisSpec{240, 4.8f, 6.0f}, o2::framework::AxisSpec{240, 4.8f, 6.0f}, o2::framework::AxisSpec{240, 5.0f, 6.2f}, o2::framework::AxisSpec{240, 5.0f, 6.2f}}; diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseAngularContainer.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseAngularContainer.h index cd7ebdcc1e4..0e888a0cb2e 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseAngularContainer.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseAngularContainer.h @@ -120,8 +120,8 @@ class FemtoUniverseAngularContainer framework::AxisSpec mTAxis3D = {mTBins3D, "#it{m}_{T} (GeV/#it{c})"}; // angular correlations - mPhiLow = (-static_cast(phiBins / 4) + 0.5) * 2. * PI / phiBins; - mPhiHigh = 2 * PI + (-static_cast(phiBins / 4) + 0.5) * 2. * PI / phiBins; + mPhiLow = (-static_cast(phiBins / 4) + 0.5) * 2. * o2::constants::math::PI / phiBins; + mPhiHigh = 2 * o2::constants::math::PI + (-static_cast(phiBins / 4) + 0.5) * 2. * o2::constants::math::PI / phiBins; framework::AxisSpec phiAxis = {phiBins, mPhiLow, mPhiHigh}; framework::AxisSpec etaAxis = {etaBins, -2.0, 2.0}; @@ -159,10 +159,10 @@ class FemtoUniverseAngularContainer delta_phi = part1.phi() - part2.phi(); while (delta_phi < mPhiLow) { - delta_phi += TwoPI; + delta_phi += o2::constants::math::TwoPI; } while (delta_phi > mPhiHigh) { - delta_phi -= TwoPI; + delta_phi -= o2::constants::math::TwoPI; } mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/DeltaEtaDeltaPhi"), delta_phi, delta_eta); diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseContainer.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseContainer.h index b4cec25ba00..c54bd819589 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseContainer.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseContainer.h @@ -135,8 +135,8 @@ class FemtoUniverseContainer framework::AxisSpec mTAxis3D = {mTBins3D, "#it{m}_{T} (GeV/#it{c})"}; // angular correlations - mPhiLow = (-static_cast(phiBins / 4) + 0.5) * 2. * PI / phiBins; - mPhiHigh = 2 * PI + (-static_cast(phiBins / 4) + 0.5) * 2. * PI / phiBins; + mPhiLow = (-static_cast(phiBins / 4) + 0.5) * 2. * o2::constants::math::PI / phiBins; + mPhiHigh = 2 * o2::constants::math::PI + (-static_cast(phiBins / 4) + 0.5) * 2. * o2::constants::math::PI / phiBins; framework::AxisSpec phiAxis = {phiBins, mPhiLow, mPhiHigh}; framework::AxisSpec etaAxis = {etaBins, -2.0, 2.0}; @@ -175,10 +175,10 @@ class FemtoUniverseContainer delta_phi = part1.phi() - part2.phi(); while (delta_phi < mPhiLow) { - delta_phi += TwoPI; + delta_phi += o2::constants::math::TwoPI; } while (delta_phi > mPhiHigh) { - delta_phi -= TwoPI; + delta_phi -= o2::constants::math::TwoPI; } mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/relPairDist"), femtoObs); diff --git a/PWGCF/FemtoWorld/Core/FemtoWorldContainer.h b/PWGCF/FemtoWorld/Core/FemtoWorldContainer.h index b85dd0b5fcd..a80af060d56 100644 --- a/PWGCF/FemtoWorld/Core/FemtoWorldContainer.h +++ b/PWGCF/FemtoWorld/Core/FemtoWorldContainer.h @@ -32,7 +32,6 @@ #include "TRandom.h" using namespace o2::framework; -using namespace o2::constants::math; namespace o2::analysis::femtoWorld { @@ -87,8 +86,8 @@ class FemtoWorldContainer framework::AxisSpec kTAxis = {kTBins, "#it{k}_{T} (GeV/#it{c})"}; framework::AxisSpec mTAxis = {mTBins, "#it{m}_{T} (GeV/#it{c}^{2})"}; - mPhiLow = (-static_cast(phiBins / 4) + 0.5) * 2. * PI / phiBins; - mPhiHigh = 2 * PI + (-static_cast(phiBins / 4) + 0.5) * 2. * PI / phiBins; + mPhiLow = (-static_cast(phiBins / 4) + 0.5) * 2. * o2::constants::math::PI / phiBins; + mPhiHigh = 2 * o2::constants::math::PI + (-static_cast(phiBins / 4) + 0.5) * 2. * o2::constants::math::PI / phiBins; framework::AxisSpec phiAxis = {phiBins, mPhiLow, mPhiHigh}; framework::AxisSpec etaAxis = {etaBins, -2.0, 2.0}; @@ -154,10 +153,10 @@ class FemtoWorldContainer double delta_phi = part1.phi() - part2.phi(); while (delta_phi < mPhiLow) { - delta_phi += TwoPI; + delta_phi += o2::constants::math::TwoPI; } while (delta_phi > mPhiHigh) { - delta_phi -= TwoPI; + delta_phi -= o2::constants::math::TwoPI; } TLorentzVector part1Vec; part1Vec.SetPtEtaPhiM(part1.pt(), part1.eta(), part1.phi(), mMassOne); diff --git a/PWGCF/FemtoWorld/Core/FemtoWorldPionContainer.h b/PWGCF/FemtoWorld/Core/FemtoWorldPionContainer.h index 4273c0cf3b9..9c68ac7c76e 100644 --- a/PWGCF/FemtoWorld/Core/FemtoWorldPionContainer.h +++ b/PWGCF/FemtoWorld/Core/FemtoWorldPionContainer.h @@ -32,7 +32,6 @@ #include "TRandom.h" using namespace o2::framework; -using namespace o2::constants::math; namespace o2::analysis::femtoWorld { @@ -91,8 +90,8 @@ class FemtoWorldPionContainer framework::AxisSpec kTAxis = {kTBins, "#it{k}_{T} (GeV/#it{c})"}; framework::AxisSpec mTAxis = {mTBins, "#it{m}_{T} (GeV/#it{c}^{2})"}; - mPhiLow = (-static_cast(phiBins / 4) + 0.5) * 2. * PI / phiBins; - mPhiHigh = 2 * PI + (-static_cast(phiBins / 4) + 0.5) * 2. * PI / phiBins; + mPhiLow = (-static_cast(phiBins / 4) + 0.5) * 2. * o2::constants::math::PI / phiBins; + mPhiHigh = 2 * o2::constants::math::PI + (-static_cast(phiBins / 4) + 0.5) * 2. * o2::constants::math::PI / phiBins; framework::AxisSpec phiAxis = {phiBins, mPhiLow, mPhiHigh}; framework::AxisSpec etaAxis = {etaBins, -2.0, 2.0}; @@ -141,10 +140,10 @@ class FemtoWorldPionContainer double delta_phi = part1.phi() - part2.phi(); while (delta_phi < mPhiLow) { - delta_phi += TwoPI; + delta_phi += o2::constants::math::TwoPI; } while (delta_phi > mPhiHigh) { - delta_phi -= TwoPI; + delta_phi -= o2::constants::math::TwoPI; } TLorentzVector part1Vec; part1Vec.SetPtEtaPhiM(part1.pt(), part1.eta(), part1.phi(), mMassOne); diff --git a/PWGEM/PhotonMeson/Utils/gammaConvDefinitions.h b/PWGEM/PhotonMeson/Utils/gammaConvDefinitions.h index 4f9efd0d3fd..a9257d90ee4 100644 --- a/PWGEM/PhotonMeson/Utils/gammaConvDefinitions.h +++ b/PWGEM/PhotonMeson/Utils/gammaConvDefinitions.h @@ -23,16 +23,16 @@ AxisSpec const gAxis_zColl{800, -50.f, 50.f}; AxisSpec const gAxis_pT{800, 0.f, 25.f}; AxisSpec const gAxis_pT_armenteros{400, 0.f, 1.f}; AxisSpec const gAxis_pT2d{400, 0.f, 25.f}; -AxisSpec const gAxis_eta{800, -PIHalf, PIHalf}; -AxisSpec const gAxis_eta2d{400, -PIHalf, PIHalf}; -AxisSpec const gAxis_phi{800, 0.f, TwoPI}; +AxisSpec const gAxis_eta{800, -o2::constants::math::PIHalf, o2::constants::math::PIHalf}; +AxisSpec const gAxis_eta2d{400, -o2::constants::math::PIHalf, o2::constants::math::PIHalf}; +AxisSpec const gAxis_phi{800, 0.f, o2::constants::math::TwoPI}; AxisSpec const gAxis_r{800, 0.f, 200.f}; AxisSpec const gAxis_r_extended{800, 0.f, 500.f}; AxisSpec const gAxis_dr{200, -100.f, 100.f}; AxisSpec const gAxis_r2d{400, 0.f, 250.f}; AxisSpec const gAxis_z2d{1000, -250.f, 250.f}; AxisSpec const gAxis_TPCdEdxSig{401, -10.025f, 10.025f}; -AxisSpec const gAxis_radRes{800, -PI, PI}; +AxisSpec const gAxis_radRes{800, -o2::constants::math::PI, o2::constants::math::PI}; AxisSpec const gAxis_xyz{2400, -300.f, 300.f}; AxisSpec const gAxis_chi2{501, -1.f, 500.f}; AxisSpec gAxis_pT_log{800, 0.01f, 25.f}; diff --git a/PWGLF/Tasks/cascadecorrelations.cxx b/PWGLF/Tasks/cascadecorrelations.cxx index 06f7a53787c..7d1a4a20b92 100644 --- a/PWGLF/Tasks/cascadecorrelations.cxx +++ b/PWGLF/Tasks/cascadecorrelations.cxx @@ -41,6 +41,7 @@ #include using namespace o2; +using namespace o2::constants::math; using namespace o2::framework; using namespace o2::framework::expressions; using std::array; diff --git a/PWGLF/Tasks/hStrangeCorrelation.cxx b/PWGLF/Tasks/hStrangeCorrelation.cxx index d06df20ce8e..f7b453868e6 100644 --- a/PWGLF/Tasks/hStrangeCorrelation.cxx +++ b/PWGLF/Tasks/hStrangeCorrelation.cxx @@ -33,6 +33,7 @@ #include "Framework/StaticFor.h" using namespace o2; +using namespace o2::constants::math; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/Tutorials/src/propagatedTracks.cxx b/Tutorials/src/propagatedTracks.cxx index e1f3a9f7242..eb27376dfa5 100644 --- a/Tutorials/src/propagatedTracks.cxx +++ b/Tutorials/src/propagatedTracks.cxx @@ -28,6 +28,7 @@ #include "Framework/runDataProcessing.h" using namespace o2; +using namespace o2::constants::math; using namespace o2::framework; using namespace o2::framework::expressions; From 12a27bc950be1abb3121e32fa952faf8072dc9f2 Mon Sep 17 00:00:00 2001 From: ALICE Builder Date: Mon, 4 Sep 2023 13:33:57 +0200 Subject: [PATCH 9/9] Please consider the following formatting changes (#25) --- PWGCF/GenericFramework/GFW.cxx | 2 +- PWGCF/GenericFramework/GFW.h | 8 ++++---- PWGDQ/Tasks/dqFlow.cxx | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/PWGCF/GenericFramework/GFW.cxx b/PWGCF/GenericFramework/GFW.cxx index c7d5bf7d0d1..1541aaf8993 100644 --- a/PWGCF/GenericFramework/GFW.cxx +++ b/PWGCF/GenericFramework/GFW.cxx @@ -20,9 +20,9 @@ If used, modified, or distributed, please aknowledge the author of this code. #include "GFW.h" using std::complex; +using std::pair; using std::string; using std::vector; -using std::pair; GFW::GFW() : fInitialized(false) {} diff --git a/PWGCF/GenericFramework/GFW.h b/PWGCF/GenericFramework/GFW.h index 0bb08e35bbd..2b20ff7f2ad 100644 --- a/PWGCF/GenericFramework/GFW.h +++ b/PWGCF/GenericFramework/GFW.h @@ -57,9 +57,9 @@ class 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(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 int CreateRegions(); void Fill(double eta, int ptin, double phi, double weight, int mask, double secondWeight = -1); void Clear(); @@ -73,7 +73,7 @@ class GFW std::vector fListOfCFGs; 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 + 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); } Region GetRegion(int index) { return fRegions.at(index); } int FindRegionByName(std::string refName); diff --git a/PWGDQ/Tasks/dqFlow.cxx b/PWGDQ/Tasks/dqFlow.cxx index fe9f314a58b..07ea30e70e7 100644 --- a/PWGDQ/Tasks/dqFlow.cxx +++ b/PWGDQ/Tasks/dqFlow.cxx @@ -45,10 +45,10 @@ #include "Common/DataModel/TrackSelectionTables.h" #include "Common/DataModel/Centrality.h" +using std::complex; using std::cout; using std::endl; using std::string; -using std::complex; using namespace o2; using namespace o2::framework;