Skip to content

Commit db53d05

Browse files
committed
Fix: fix index access
1 parent 3283b9a commit db53d05

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

PWGCF/Femto/Core/collisionBuilder.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ struct ConfCollisionBits : o2::framework::ConfigurableGroup {
8282
o2::framework::Configurable<std::vector<float>> sphericityMax{"sphericityMax", {}, "Maximum sphericity"};
8383
o2::framework::Configurable<std::vector<std::string>> triggers{"triggers", {}, "List of all triggers to be used"};
8484
o2::framework::Configurable<datatypes::QvecDetectorType> qvecDetector{"qvecDetector", 0, "Detector used to estimate the Q-vector: 0 -> FT0C, 1 -> FT0A"};
85-
o2::framework::Configurable<datatypes::QvecHarmonicType> qvecHarmonic{"qvecHarmonic", 2, "Harmonic n of the Q-vector and event plane angle Psi_n: 1 -> direct, 2 -> elliptic, 3 -> triangular"};
85+
o2::framework::Configurable<datatypes::QvecHarmonicType> qvecHarmonic{"qvecHarmonic", 2, "Harmonic n of the Q-vector and event plane angle Psi_n: 2 -> elliptic, 3 -> triangular"};
8686
};
8787

8888
struct ConfCcdb : o2::framework::ConfigurableGroup {
@@ -370,12 +370,16 @@ class CollisionSelection : public baseselection::BaseSelection<float, o2::analys
370370
void setEventPlane(T const& col)
371371
{
372372
auto harmonic = static_cast<float>(mQvecHarmonic);
373+
int index = static_cast<int>(mQvecHarmonic) - 2; // get index in the qvector vector
374+
if (index >= 2) {
375+
LOG(fatal) << "At the moment harmonics up to 3 are supported!";
376+
}
373377
switch (mQvecDetector) {
374378
case modes::QvecDetector::kFT0C:
375-
mEventPlane = RecoDecay::constrainAngle((std::atan2(col.qvecFT0CImVec()[0], col.qvecFT0CReVec()[0])) / harmonic, 0, harmonic); // constrain between 0 and 2pi/harmonic
379+
mEventPlane = RecoDecay::constrainAngle((std::atan2(col.qvecFT0CImVec()[index], col.qvecFT0CReVec()[index])) / harmonic, 0, harmonic); // constrain between 0 and 2pi/harmonic
376380
break;
377381
case modes::QvecDetector::kFT0A:
378-
mEventPlane = RecoDecay::constrainAngle((std::atan2(col.qvecFT0AImVec()[0], col.qvecFT0AReVec()[0])) / harmonic, 0, harmonic); // constrain between 0 and 2pi/harmonic
382+
mEventPlane = RecoDecay::constrainAngle((std::atan2(col.qvecFT0AImVec()[index], col.qvecFT0AReVec()[index])) / harmonic, 0, harmonic); // constrain between 0 and 2pi/harmonic
379383
break;
380384
}
381385
}

PWGCF/Femto/Core/modes.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,6 @@ enum class QvecDetector : o2::analysis::femto::datatypes::QvecDetectorType {
184184
};
185185

186186
enum class QvecHarmonic : o2::analysis::femto::datatypes::QvecHarmonicType {
187-
kN1 = 1,
188187
kN2 = 2,
189188
kN3 = 3
190189
};

0 commit comments

Comments
 (0)