Skip to content

Commit 1ac0b0b

Browse files
ddobrigkchiarazampolli
authored andcommitted
Flow mapper tool: improve handling of input objects (#13320)
(cherry picked from commit 6d6ac03)
1 parent bafc417 commit 1ac0b0b

File tree

2 files changed

+6
-21
lines changed

2 files changed

+6
-21
lines changed

Generators/include/Generators/FlowMapper.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,24 +45,18 @@ class FlowMapper
4545
// Constructor
4646
FlowMapper();
4747

48-
void Setv2VsPt(TH1D hv2VsPtProvided);
49-
void SetEccVsB(TH1D hEccVsBProvided);
50-
5148
void SetNBinsPhi(long mBinsPhiProvided) { mBinsPhi = mBinsPhiProvided; };
5249
void SetPrecision(long mPrecisionProvided) { mPrecision = mPrecisionProvided; };
5350
void SetDerivative(long mDerivativeProvided) { mDerivative = mDerivativeProvided; };
5451

55-
void CreateLUT(); // to be called if all is set
52+
void CreateLUT(TH1D* mhv2vsPt, TH1D* mhEccVsB);
5653

5754
Double_t MapPhi(Double_t lPhiInput, Double_t b, Double_t pt);
5855

5956
long mBinsPhi; // number of phi bins to use
6057
double mPrecision = 1e-6; // precision threshold for numerical inversion success
6158
double mDerivative = 1e-4; // delta-X for derivative calculation
6259

63-
std::unique_ptr<TH1D> mhv2vsPt; // input v2 vs pT from measurement
64-
std::unique_ptr<TH1D> mhEccVsB; // ecc vs B (from Glauber MC or elsewhere)
65-
6660
// Cumulative function to be inverted
6761
std::unique_ptr<TF1> mCumulative;
6862

Generators/src/FlowMapper.cxx

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,14 @@ FlowMapper::FlowMapper()
3030
mBinsPhi = 4000; // a first guess
3131
}
3232

33-
void FlowMapper::Setv2VsPt(TH1D hv2VsPtProvided)
34-
{
35-
// Sets the v2 vs pT to be used.
36-
mhv2vsPt = std::make_unique<TH1D>(hv2VsPtProvided);
37-
}
38-
void FlowMapper::SetEccVsB(TH1D hEccVsBProvided)
39-
{
40-
// Sets the v2 vs pT to be used.
41-
mhEccVsB = std::make_unique<TH1D>(hEccVsBProvided);
42-
}
43-
void FlowMapper::CreateLUT()
33+
void FlowMapper::CreateLUT(TH1D* mhv2vsPt, TH1D* mhEccVsB)
4434
{
4535
if (!mhv2vsPt) {
46-
LOG(fatal) << "You did not specify a v2 vs pT histogram!";
36+
LOG(fatal) << "You did not specify a valid v2 vs pT histogram!";
4737
return;
4838
}
4939
if (!mhEccVsB) {
50-
LOG(fatal) << "You did not specify an ecc vs B histogram!";
40+
LOG(fatal) << "You did not specify a valid ecc vs B histogram!";
5141
return;
5242
}
5343
LOG(info) << "Proceeding to creating a look-up table...";
@@ -71,6 +61,7 @@ void FlowMapper::CreateLUT()
7161
// std::make_unique<TH1F>("hSign", "Sign of electric charge;charge sign", 3, -1.5, 1.5);
7262

7363
mhLUT = std::make_unique<TH3D>("mhLUT", "", nbinsB, binsB.data(), nbinsPt, binsPt.data(), nbinsPhi, binsPhi.data());
64+
mhLUT->SetDirectory(nullptr); // just in case context is incorrect
7465

7566
// loop over each centrality (b) bin
7667
for (int ic = 0; ic < nbinsB; ic++) {
@@ -147,4 +138,4 @@ Double_t FlowMapper::MapPhi(Double_t lPhiInput, Double_t b, Double_t pt)
147138
} /* namespace eventgen */
148139
} /* namespace o2 */
149140

150-
ClassImp(o2::eventgen::FlowMapper);
141+
ClassImp(o2::eventgen::FlowMapper);

0 commit comments

Comments
 (0)