Skip to content

Commit a274dff

Browse files
authored
[Common,PWGCF] EventPlaneHelper: invoke geometry invariant helper once (#16444)
1 parent c5f5e88 commit a274dff

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

Common/Core/EventPlaneHelper.cxx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ double EventPlaneHelper::GetPhiFV0(int chno, o2::fv0::Geometry* fv0geom)
6161
return TMath::ATan2(chPos.y + offsetY, chPos.x + offsetX);
6262
}
6363

64-
double EventPlaneHelper::GetPhiFT0(int chno, o2::ft0::Geometry ft0geom)
64+
double EventPlaneHelper::GetPhiFT0(int chno, const o2::ft0::Geometry& ft0geom)
6565
{
6666
/* Calculate the azimuthal angle in FT0 for the channel number 'chno'. The offset
6767
of FT0-A is taken into account if chno is between 0 and 95. */
@@ -74,14 +74,12 @@ double EventPlaneHelper::GetPhiFT0(int chno, o2::ft0::Geometry ft0geom)
7474
offsetY = mOffsetFT0AY;
7575
}
7676

77-
ft0geom.calculateChannelCenter();
7877
auto chPos = ft0geom.getChannelCenter(chno);
79-
/// printf("Channel id: %d X: %.3f Y: %.3f\n", chno, chPos.X(), chPos.Y());
8078

8179
return TMath::ATan2(chPos.Y() + offsetY, chPos.X() + offsetX);
8280
}
8381

84-
void EventPlaneHelper::SumQvectors(int det, int chno, float ampl, int nmod, TComplex& Qvec, float& sum, o2::ft0::Geometry ft0geom, o2::fv0::Geometry* fv0geom)
82+
void EventPlaneHelper::SumQvectors(int det, int chno, float ampl, int nmod, TComplex& Qvec, float& sum, const o2::ft0::Geometry& ft0geom, o2::fv0::Geometry* fv0geom)
8583
{
8684
/* Calculate the complex Q-vector for the provided detector and channel number,
8785
before adding it to the total Q-vector given as argument. */

Common/Core/EventPlaneHelper.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@ class EventPlaneHelper
6060
}
6161

6262
// Methods to calculate the azimuthal angles for each part of FIT, given the channel number.
63-
double GetPhiFT0(int chno, o2::ft0::Geometry ft0geom);
63+
double GetPhiFT0(int chno, const o2::ft0::Geometry& ft0geom);
6464
double GetPhiFV0(int chno, o2::fv0::Geometry* fv0geom);
6565

6666
// Method to get the Q-vector and sum of amplitudes for any channel in FIT, given
6767
// the detector and amplitude.
68-
void SumQvectors(int det, int chno, float ampl, int nmod, TComplex& Qvec, float& sum, o2::ft0::Geometry ft0geom, o2::fv0::Geometry* fv0geom);
68+
void SumQvectors(int det, int chno, float ampl, int nmod, TComplex& Qvec, float& sum, const o2::ft0::Geometry& ft0geom, o2::fv0::Geometry* fv0geom);
6969

7070
// Method to get the bin corresponding to a centrality percentile, according to the
7171
// centClasses[] array defined in Tasks/qVectorsQA.cxx.

Common/TableProducer/qVectorsTable.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ struct qVectorsTable {
256256
AxisSpec axisChID = {220, 0, 220};
257257

258258
fv0geom = o2::fv0::Geometry::instance(o2::fv0::Geometry::eUninitialized);
259+
ft0geom.calculateChannelCenter();
259260

260261
histosQA.add("ChTracks", "", {HistType::kTHnSparseF, {axisPt, axisEta, axisPhi, axixCent}});
261262
histosQA.add("FT0Amp", "", {HistType::kTH2F, {axisFITamp, axisChID}});

PWGCF/JCorran/Tasks/jEPFlowAnalysis.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,7 @@ struct JEPFlowAnalysis {
495495
rctChecker.init(rctCut.cfgEvtRCTFlagCheckerLabel, rctCut.cfgEvtRCTFlagCheckerZDCCheck, rctCut.cfgEvtRCTFlagCheckerLimitAcceptAsBad);
496496

497497
fv0geom = o2::fv0::Geometry::instance(o2::fv0::Geometry::eUninitialized);
498+
ft0geom.calculateChannelCenter();
498499

499500
detId = getdetId(cfgDetName);
500501
refAId = getdetId(cfgRefAName);

0 commit comments

Comments
 (0)