From 630295eb1c3e4e4537e25e797c42541d03d4a8cd Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Tue, 23 Jul 2024 21:39:33 +0200 Subject: [PATCH 1/4] Cleanup / better object handling --- Generators/include/Generators/FlowMapper.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/Generators/include/Generators/FlowMapper.h b/Generators/include/Generators/FlowMapper.h index ede2ccea0bebb..ce6eabe76b59a 100644 --- a/Generators/include/Generators/FlowMapper.h +++ b/Generators/include/Generators/FlowMapper.h @@ -45,14 +45,11 @@ class FlowMapper // Constructor FlowMapper(); - void Setv2VsPt(TH1D hv2VsPtProvided); - void SetEccVsB(TH1D hEccVsBProvided); - void SetNBinsPhi(long mBinsPhiProvided) { mBinsPhi = mBinsPhiProvided; }; void SetPrecision(long mPrecisionProvided) { mPrecision = mPrecisionProvided; }; void SetDerivative(long mDerivativeProvided) { mDerivative = mDerivativeProvided; }; - void CreateLUT(); // to be called if all is set + void CreateLUT(TH1D *mhv2vsPt, TH1D *mhEccVsB); Double_t MapPhi(Double_t lPhiInput, Double_t b, Double_t pt); @@ -60,9 +57,6 @@ class FlowMapper double mPrecision = 1e-6; // precision threshold for numerical inversion success double mDerivative = 1e-4; // delta-X for derivative calculation - std::unique_ptr mhv2vsPt; // input v2 vs pT from measurement - std::unique_ptr mhEccVsB; // ecc vs B (from Glauber MC or elsewhere) - // Cumulative function to be inverted std::unique_ptr mCumulative; From 234920c5b2db376f8c60165d10eb3f2df320799f Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Tue, 23 Jul 2024 21:40:58 +0200 Subject: [PATCH 2/4] Improve handling of input --- Generators/src/FlowMapper.cxx | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/Generators/src/FlowMapper.cxx b/Generators/src/FlowMapper.cxx index 7cfeb6bbe3d94..050d292d41aab 100644 --- a/Generators/src/FlowMapper.cxx +++ b/Generators/src/FlowMapper.cxx @@ -30,24 +30,14 @@ FlowMapper::FlowMapper() mBinsPhi = 4000; // a first guess } -void FlowMapper::Setv2VsPt(TH1D hv2VsPtProvided) -{ - // Sets the v2 vs pT to be used. - mhv2vsPt = std::make_unique(hv2VsPtProvided); -} -void FlowMapper::SetEccVsB(TH1D hEccVsBProvided) -{ - // Sets the v2 vs pT to be used. - mhEccVsB = std::make_unique(hEccVsBProvided); -} -void FlowMapper::CreateLUT() +void FlowMapper::CreateLUT(TH1D *mhv2vsPt, TH1D *mhEccVsB) { if (!mhv2vsPt) { - LOG(fatal) << "You did not specify a v2 vs pT histogram!"; + LOG(fatal) << "You did not specify a valid v2 vs pT histogram!"; return; } if (!mhEccVsB) { - LOG(fatal) << "You did not specify an ecc vs B histogram!"; + LOG(fatal) << "You did not specify a valid ecc vs B histogram!"; return; } LOG(info) << "Proceeding to creating a look-up table..."; @@ -71,6 +61,7 @@ void FlowMapper::CreateLUT() // std::make_unique("hSign", "Sign of electric charge;charge sign", 3, -1.5, 1.5); mhLUT = std::make_unique("mhLUT", "", nbinsB, binsB.data(), nbinsPt, binsPt.data(), nbinsPhi, binsPhi.data()); + mhLUT->SetDirectory(0); // just in case context is incorrect // loop over each centrality (b) bin for (int ic = 0; ic < nbinsB; ic++) { @@ -147,4 +138,4 @@ Double_t FlowMapper::MapPhi(Double_t lPhiInput, Double_t b, Double_t pt) } /* namespace eventgen */ } /* namespace o2 */ -ClassImp(o2::eventgen::FlowMapper); \ No newline at end of file +ClassImp(o2::eventgen::FlowMapper); From c0681d06baa5caa27b2aa9f03beed3674e0ce1d7 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Tue, 23 Jul 2024 19:43:51 +0000 Subject: [PATCH 3/4] Please consider the following formatting changes --- Generators/include/Generators/FlowMapper.h | 2 +- Generators/src/FlowMapper.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Generators/include/Generators/FlowMapper.h b/Generators/include/Generators/FlowMapper.h index ce6eabe76b59a..c0635defd767d 100644 --- a/Generators/include/Generators/FlowMapper.h +++ b/Generators/include/Generators/FlowMapper.h @@ -49,7 +49,7 @@ class FlowMapper void SetPrecision(long mPrecisionProvided) { mPrecision = mPrecisionProvided; }; void SetDerivative(long mDerivativeProvided) { mDerivative = mDerivativeProvided; }; - void CreateLUT(TH1D *mhv2vsPt, TH1D *mhEccVsB); + void CreateLUT(TH1D* mhv2vsPt, TH1D* mhEccVsB); Double_t MapPhi(Double_t lPhiInput, Double_t b, Double_t pt); diff --git a/Generators/src/FlowMapper.cxx b/Generators/src/FlowMapper.cxx index 050d292d41aab..d5f4d2683b509 100644 --- a/Generators/src/FlowMapper.cxx +++ b/Generators/src/FlowMapper.cxx @@ -30,7 +30,7 @@ FlowMapper::FlowMapper() mBinsPhi = 4000; // a first guess } -void FlowMapper::CreateLUT(TH1D *mhv2vsPt, TH1D *mhEccVsB) +void FlowMapper::CreateLUT(TH1D* mhv2vsPt, TH1D* mhEccVsB) { if (!mhv2vsPt) { LOG(fatal) << "You did not specify a valid v2 vs pT histogram!"; From dcbe350418f15aa21bbfe4c5fe7e4f44ebf4f1b4 Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Tue, 30 Jul 2024 16:52:13 +0200 Subject: [PATCH 4/4] Fix fullCI error --- Generators/src/FlowMapper.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Generators/src/FlowMapper.cxx b/Generators/src/FlowMapper.cxx index d5f4d2683b509..d3d84cf34bd0b 100644 --- a/Generators/src/FlowMapper.cxx +++ b/Generators/src/FlowMapper.cxx @@ -61,7 +61,7 @@ void FlowMapper::CreateLUT(TH1D* mhv2vsPt, TH1D* mhEccVsB) // std::make_unique("hSign", "Sign of electric charge;charge sign", 3, -1.5, 1.5); mhLUT = std::make_unique("mhLUT", "", nbinsB, binsB.data(), nbinsPt, binsPt.data(), nbinsPhi, binsPhi.data()); - mhLUT->SetDirectory(0); // just in case context is incorrect + mhLUT->SetDirectory(nullptr); // just in case context is incorrect // loop over each centrality (b) bin for (int ic = 0; ic < nbinsB; ic++) {