Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions Common/Core/EventPlaneHelper.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
return TMath::ATan2(chPos.y + offsetY, chPos.x + offsetX);
}

double EventPlaneHelper::GetPhiFT0(int chno, o2::ft0::Geometry ft0geom)
double EventPlaneHelper::GetPhiFT0(int chno, const o2::ft0::Geometry& ft0geom)
{
/* Calculate the azimuthal angle in FT0 for the channel number 'chno'. The offset
of FT0-A is taken into account if chno is between 0 and 95. */
Expand All @@ -69,19 +69,17 @@
float offsetX = 0.;
float offsetY = 0.; // No offset for FT0-C (default case).

if (chno < 96) { // Channel in FT0-A, non-zero offset must be applied. // LOKI: make general.

Check failure on line 72 in Common/Core/EventPlaneHelper.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
offsetX = mOffsetFT0AX;
offsetY = mOffsetFT0AY;
}

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

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

void EventPlaneHelper::SumQvectors(int det, int chno, float ampl, int nmod, TComplex& Qvec, float& sum, o2::ft0::Geometry ft0geom, o2::fv0::Geometry* fv0geom)
void EventPlaneHelper::SumQvectors(int det, int chno, float ampl, int nmod, TComplex& Qvec, float& sum, const o2::ft0::Geometry& ft0geom, o2::fv0::Geometry* fv0geom)
{
/* Calculate the complex Q-vector for the provided detector and channel number,
before adding it to the total Q-vector given as argument. */
Expand All @@ -95,14 +93,14 @@
phi = GetPhiFV0(chno, fv0geom);
break;
default:
printf("'int det' value does not correspond to any accepted case.\n");

Check failure on line 96 in Common/Core/EventPlaneHelper.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
break;
}

/// printf("Phi: %.3f\n", phi);

if (phi < -900) {

Check failure on line 102 in Common/Core/EventPlaneHelper.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
printf("Error on phi. Skip\n");

Check failure on line 103 in Common/Core/EventPlaneHelper.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
return;
} // TODO: ensure proper safety check.
Qvec += TComplex(ampl * TMath::Cos(phi * nmod), ampl * TMath::Sin(phi * nmod));
Expand All @@ -113,7 +111,7 @@
{
const float centClasses[] = {0., 5., 10., 20., 30., 40., 50., 60., 80.};

for (int i = 0; i < 9; i++) {

Check failure on line 114 in Common/Core/EventPlaneHelper.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
if (cent >= centClasses[i]) {
continue;
} else {
Expand All @@ -138,10 +136,10 @@
qy = (qy - corrections[2] * qx) / (1.0 - corrections[3] * corrections[2]);

// Rescaling of the Qx-Qy into a circle.
if (std::fabs(corrections[4]) > 1e-8) {

Check failure on line 139 in Common/Core/EventPlaneHelper.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
qx /= corrections[4];
}
if (std::fabs(corrections[5]) > 1e-8) {

Check failure on line 142 in Common/Core/EventPlaneHelper.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
qy /= corrections[5];
}
}
Expand All @@ -160,9 +158,9 @@

void EventPlaneHelper::DoRescale(float& qx, float& qy, float ap, float am)
{
if (std::fabs(ap) > 1e-8)

Check failure on line 161 in Common/Core/EventPlaneHelper.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
qx /= ap;
if (std::fabs(am) > 1e-8)

Check failure on line 163 in Common/Core/EventPlaneHelper.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
qy /= am;
}

Expand Down
4 changes: 2 additions & 2 deletions Common/Core/EventPlaneHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ class EventPlaneHelper
}

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

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

// Method to get the bin corresponding to a centrality percentile, according to the
// centClasses[] array defined in Tasks/qVectorsQA.cxx.
Expand Down
1 change: 1 addition & 0 deletions Common/TableProducer/qVectorsTable.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@
AxisSpec axisChID = {220, 0, 220};

fv0geom = o2::fv0::Geometry::instance(o2::fv0::Geometry::eUninitialized);
ft0geom.calculateChannelCenter();

histosQA.add("ChTracks", "", {HistType::kTHnSparseF, {axisPt, axisEta, axisPhi, axixCent}});
histosQA.add("FT0Amp", "", {HistType::kTH2F, {axisFITamp, axisChID}});
Expand Down Expand Up @@ -497,7 +498,7 @@
auto psiDefTPCNeg = std::atan2(qVecIm[kTPCNeg * nCorrections + kRescale], qVecRe[kTPCNeg * nCorrections + kRescale]) / static_cast<float>(nMode);
auto psiDefTPCAll = std::atan2(qVecIm[kTPCAll * nCorrections + kRescale], qVecRe[kTPCAll * nCorrections + kRescale]) / static_cast<float>(nMode);

for (int iShift = 1; iShift <= 10; iShift++) {

Check failure on line 501 in Common/TableProducer/qVectorsTable.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
auto coeffShiftXFT0C = shiftProfile.at(nMode - 2)->GetBinContent(shiftProfile.at(nMode - 2)->FindBin(cent, 2 * kFT0C, iShift - 0.5));
auto coeffShiftYFT0C = shiftProfile.at(nMode - 2)->GetBinContent(shiftProfile.at(nMode - 2)->FindBin(cent, 2 * kFT0C + 1, iShift - 0.5));
auto coeffShiftXFT0A = shiftProfile.at(nMode - 2)->GetBinContent(shiftProfile.at(nMode - 2)->FindBin(cent, 2 * kFT0A, iShift - 0.5));
Expand Down
1 change: 1 addition & 0 deletions PWGCF/JCorran/Tasks/jEPFlowAnalysis.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ struct JEPFlowAnalysis {
ccdb->setCreatedNotAfter(std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count());

fv0geom = o2::fv0::Geometry::instance(o2::fv0::Geometry::eUninitialized);
ft0geom.calculateChannelCenter();

detId = getdetId(cfgDetName);
refAId = getdetId(cfgRefAName);
Expand Down
Loading