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
10 changes: 10 additions & 0 deletions Common/DataModel/Qvectors.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ DECLARE_SOA_COLUMN(LabelsTPCpos, labelsTPCpos, std::vector<int>);
DECLARE_SOA_COLUMN(LabelsTPCneg, labelsTPCneg, std::vector<int>);
DECLARE_SOA_COLUMN(LabelsTPCall, labelsTPCall, std::vector<int>);

// Normalized amplitudes for Event-shape Engineering
DECLARE_SOA_COLUMN(QVecRedFT0C, qVecRedFT0C, float);
DECLARE_SOA_COLUMN(QVecRedTpcPos, qVecRedTpcPos, float);
DECLARE_SOA_COLUMN(QVecRedTpcNeg, qVecRedTpcNeg, float);
DECLARE_SOA_COLUMN(QVecRedTpcAll, qVecRedTpcAll, float);

// Deprecated, will be removed in future after transition time //
DECLARE_SOA_COLUMN(QvecBPosReVec, qvecBPosReVec, std::vector<float>);
DECLARE_SOA_COLUMN(QvecBPosImVec, qvecBPosImVec, std::vector<float>);
Expand Down Expand Up @@ -121,6 +127,8 @@ DECLARE_SOA_TABLE(QvectorTPCposVecs, "AOD", "QVECTORSTPCPVEC", qvec::IsCalibrate
DECLARE_SOA_TABLE(QvectorTPCnegVecs, "AOD", "QVECTORSTPCNVEC", qvec::IsCalibrated, qvec::QvecTPCnegReVec, qvec::QvecTPCnegImVec, qvec::NTrkTPCneg, qvec::LabelsTPCneg);
DECLARE_SOA_TABLE(QvectorTPCallVecs, "AOD", "QVECTORSTPCAVEC", qvec::IsCalibrated, qvec::QvecTPCallReVec, qvec::QvecTPCallImVec, qvec::NTrkTPCall, qvec::LabelsTPCall);

DECLARE_SOA_TABLE(QvectorsReds, "AOD", "QVECTORSRED", qvec::QVecRedFT0C, qvec::QVecRedTpcPos, qvec::QVecRedTpcNeg, qvec::QVecRedTpcAll);

using QvectorFT0C = QvectorFT0Cs::iterator;
using QvectorFT0A = QvectorFT0As::iterator;
using QvectorFT0M = QvectorFT0Ms::iterator;
Expand All @@ -137,6 +145,8 @@ using QvectorTPCposVec = QvectorTPCposVecs::iterator;
using QvectorTPCnegVec = QvectorTPCnegVecs::iterator;
using QvectorTPCallVec = QvectorTPCallVecs::iterator;

using QvectorRed = QvectorsReds::iterator;

// Deprecated, will be removed in future after transition time //
DECLARE_SOA_TABLE(QvectorBPoss, "AOD", "QVECTORSBPOS", qvec::IsCalibrated, qvec::QvecBPosRe, qvec::QvecBPosIm, qvec::NTrkBPos, qvec::LabelsBPos);
DECLARE_SOA_TABLE(QvectorBNegs, "AOD", "QVECTORSBNEG", qvec::IsCalibrated, qvec::QvecBNegRe, qvec::QvecBNegIm, qvec::NTrkBNeg, qvec::LabelsBNeg);
Expand Down
23 changes: 23 additions & 0 deletions Common/TableProducer/qVectorsTable.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
Configurable<bool> cfgUseTPCpos{"cfgUseTPCpos", false, "Initial value for using TPCpos. By default obtained from DataModel."};
Configurable<bool> cfgUseTPCneg{"cfgUseTPCneg", false, "Initial value for using TPCneg. By default obtained from DataModel."};
Configurable<bool> cfgUseTPCall{"cfgUseTPCall", false, "Initial value for using TPCall. By default obtained from DataModel."};
Configurable<bool> cfgProduceRedQVecs{"cfgProduceRedQVecs", false, "Produce reduced Q-vectors for Event-Shape Engineering"};

// Table.
Produces<aod::Qvectors> qVector;
Expand All @@ -129,6 +130,8 @@
Produces<aod::QvectorTPCnegVecs> qVectorTPCnegVec;
Produces<aod::QvectorTPCallVecs> qVectorTPCallVec;

Produces<aod::QvectorsReds> qVectorRed;

std::vector<float> FT0RelGainConst{};
std::vector<float> FV0RelGainConst{};

Expand Down Expand Up @@ -286,7 +289,7 @@
fullPath += "/FT0";
const auto objft0Gain = getForTsOrRun<std::vector<float>>(fullPath, timestamp, runnumber);
if (!objft0Gain || cfgCorrLevel == 0) {
for (auto i{0u}; i < 208; i++) {

Check failure on line 292 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.
FT0RelGainConst.push_back(1.);
}
} else {
Expand All @@ -297,7 +300,7 @@
fullPath += "/FV0";
const auto objfv0Gain = getForTsOrRun<std::vector<float>>(fullPath, timestamp, runnumber);
if (!objfv0Gain || cfgCorrLevel == 0) {
for (auto i{0u}; i < 48; i++) {

Check failure on line 303 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.
FV0RelGainConst.push_back(1.);
}
} else {
Expand Down Expand Up @@ -377,7 +380,7 @@
helperEP.SumQvectors(0, FT0AchId, ampl / FT0RelGainConst[FT0AchId], nmode, QvecDet, sumAmplFT0A, ft0geom, fv0geom);
helperEP.SumQvectors(0, FT0AchId, ampl / FT0RelGainConst[FT0AchId], nmode, QvecFT0M, sumAmplFT0M, ft0geom, fv0geom);
}
if (sumAmplFT0A > 1e-8) {

Check failure on line 383 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.
QvecDet /= sumAmplFT0A;
qVectFT0A[0] = QvecDet.Re();
qVectFT0A[1] = QvecDet.Im();
Expand All @@ -400,7 +403,7 @@
helperEP.SumQvectors(0, FT0CchId, ampl / FT0RelGainConst[FT0CchId], nmode, QvecFT0M, sumAmplFT0M, ft0geom, fv0geom);
}

if (sumAmplFT0C > 1e-8) {

Check failure on line 406 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.
QvecDet /= sumAmplFT0C;
qVectFT0C[0] = QvecDet.Re();
qVectFT0C[1] = QvecDet.Im();
Expand All @@ -413,7 +416,7 @@
qVectFT0C[1] = -999.;
}

if (sumAmplFT0M > 1e-8 && useDetector["QvectorFT0Ms"]) {

Check failure on line 419 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.
QvecFT0M /= sumAmplFT0M;
qVectFT0M[0] = QvecFT0M.Re();
qVectFT0M[1] = QvecFT0M.Im();
Expand Down Expand Up @@ -444,7 +447,7 @@
helperEP.SumQvectors(1, FV0AchId, ampl / FV0RelGainConst[FV0AchId], nmode, QvecDet, sumAmplFV0A, ft0geom, fv0geom);
}

if (sumAmplFV0A > 1e-8) {

Check failure on line 450 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.
QvecDet /= sumAmplFV0A;
qVectFV0A[0] = QvecDet.Re();
qVectFV0A[1] = QvecDet.Im();
Expand Down Expand Up @@ -476,7 +479,7 @@
qVectTPCall[1] += trk.pt() * std::sin(trk.phi() * nmode);
TrkTPCallLabel.push_back(trk.globalIndex());
nTrkTPCall++;
if (std::abs(trk.eta()) < 0.1) {

Check failure on line 482 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.
continue;
}
if (trk.eta() > 0 && (useDetector["QvectorTPCposs"] || useDetector["QvectorBPoss"])) {
Expand Down Expand Up @@ -515,15 +518,15 @@
qVectTPCall[1] = 999.;
}

for (auto i{0u}; i < 4; i++) {

Check failure on line 521 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.
QvecRe.push_back(qVectFT0C[0]);
QvecIm.push_back(qVectFT0C[1]);
}
for (auto i{0u}; i < 4; i++) {

Check failure on line 525 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.
QvecRe.push_back(qVectFT0A[0]);
QvecIm.push_back(qVectFT0A[1]);
}
for (auto i{0u}; i < 4; i++) {

Check failure on line 529 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.
QvecRe.push_back(qVectFT0M[0]);
QvecIm.push_back(qVectFT0M[1]);
}
Expand Down Expand Up @@ -728,6 +731,26 @@
if (useDetector["QvectorTPCalls"])
qVectorTPCall(IsCalibrated, qvecReTPCall.at(0), qvecImTPCall.at(0), qvecAmp[kTPCall], TrkTPCallLabel);

double qVecRedFT0C{-999.}, qVecRedTpcPos{-999.}, qVecRedTpcNeg{-999.}, qVecRedTpcAll{-999.};
if (cfgProduceRedQVecs) {
// Correct normalization to remove multiplicity dependence,
// taking into account that the Q-vector is normalized by 1/M
// and the EsE reduced Q-vector must be normalized to 1/sqrt(M)
if (useDetector["QvectorFT0Cs"]) {
qVecRedFT0C = TMath::Sqrt(qvecReFT0C.at(0) * qvecReFT0C.at(0) + qvecImFT0C.at(0) * qvecImFT0C.at(0)) * TMath::Sqrt(qvecAmp[kFT0C]);
}
if (useDetector["QvectorTPCposs"]) {
qVecRedTpcPos = TMath::Sqrt(qvecReTPCpos.at(0) * qvecReTPCpos.at(0) + qvecImTPCpos.at(0) * qvecImTPCpos.at(0)) * TMath::Sqrt(qvecAmp[kTPCpos]);
}
if (useDetector["QvectorTPCnegs"]) {
qVecRedTpcNeg = TMath::Sqrt(qvecReTPCneg.at(0) * qvecReTPCneg.at(0) + qvecImTPCneg.at(0) * qvecImTPCneg.at(0)) * TMath::Sqrt(qvecAmp[kTPCneg]);
}
if (useDetector["QvectorTPCalls"]) {
qVecRedTpcAll = TMath::Sqrt(qvecReTPCall.at(0) * qvecReTPCall.at(0) + qvecImTPCall.at(0) * qvecImTPCall.at(0)) * TMath::Sqrt(qvecAmp[kTPCall]);
}
}
qVectorRed(qVecRedFT0C, qVecRedTpcPos, qVecRedTpcNeg, qVecRedTpcAll);

qVectorFT0CVec(IsCalibrated, qvecReFT0C, qvecImFT0C, qvecAmp[kFT0C]);
qVectorFT0AVec(IsCalibrated, qvecReFT0A, qvecImFT0A, qvecAmp[kFT0A]);
qVectorFT0MVec(IsCalibrated, qvecReFT0M, qvecImFT0M, qvecAmp[kFT0M]);
Expand Down
Loading
Loading