Skip to content
Merged
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
20 changes: 10 additions & 10 deletions Common/TableProducer/qVectorsTable.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -193,13 +193,13 @@
for (DeviceSpec const& device : workflows.devices) {
for (auto const& input : device.inputs) {
if (input.matcher.binding == "Qvectors") {
for (auto det : useDetector) {
for (auto const& det : useDetector) {
useDetector[det.first.data()] = true;
}
LOGF(info, "Using all detectors.");
goto allDetectorsInUse; // Added to break from nested loop if all detectors are in use.
}
for (auto det : useDetector) {
for (auto const& det : useDetector) {
std::string table_name_with_vector = det.first; // for replacing s with Vecs at the end.
if (input.matcher.binding == det.first || input.matcher.binding == table_name_with_vector.replace(table_name_with_vector.size() - 1, 1, "Vecs")) {
useDetector[det.first.data()] = true;
Expand Down Expand Up @@ -295,7 +295,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 298 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 @@ -306,7 +306,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 309 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 @@ -386,7 +386,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 389 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 @@ -409,7 +409,7 @@
helperEP.SumQvectors(0, FT0CchId, ampl / FT0RelGainConst[FT0CchId], nmode, QvecFT0M, sumAmplFT0M, ft0geom, fv0geom);
}

if (sumAmplFT0C > 1e-8) {

Check failure on line 412 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 @@ -422,7 +422,7 @@
qVectFT0C[1] = -999.;
}

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

Check failure on line 425 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 @@ -453,7 +453,7 @@
helperEP.SumQvectors(1, FV0AchId, ampl / FV0RelGainConst[FV0AchId], nmode, QvecDet, sumAmplFV0A, ft0geom, fv0geom);
}

if (sumAmplFV0A > 1e-8) {

Check failure on line 456 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 All @@ -470,7 +470,7 @@
int nTrkTPCneg = 0;
int nTrkTPCall = 0;

for (auto& trk : track) {
for (auto const& trk : track) {
if (!SelTrack(trk)) {
continue;
}
Expand All @@ -485,7 +485,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 488 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 @@ -524,15 +524,15 @@
qVectTPCall[1] = 999.;
}

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

Check failure on line 527 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 531 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 535 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 @@ -674,13 +674,13 @@
auto coeffshiftxTPCall = shiftprofile.at(nmode - 2)->GetBinContent(shiftprofile.at(nmode - 2)->FindBin(cent, 2 * kTPCall, ishift - 0.5));
auto coeffshiftyTPCall = shiftprofile.at(nmode - 2)->GetBinContent(shiftprofile.at(nmode - 2)->FindBin(cent, 2 * kTPCall + 1, ishift - 0.5));

deltapsiFT0C += ((1 / (1.0 * ishift)) * (-coeffshiftxFT0C * TMath::Cos(ishift * static_cast<float>(nmode) * psidefFT0C) + coeffshiftyFT0C * TMath::Sin(ishift * static_cast<float>(nmode) * psidefFT0C)));
deltapsiFT0A += ((1 / (1.0 * ishift)) * (-coeffshiftxFT0A * TMath::Cos(ishift * static_cast<float>(nmode) * psidefFT0A) + coeffshiftyFT0A * TMath::Sin(ishift * static_cast<float>(nmode) * psidefFT0A)));
deltapsiFT0M += ((1 / (1.0 * ishift)) * (-coeffshiftxFT0M * TMath::Cos(ishift * static_cast<float>(nmode) * psidefFT0M) + coeffshiftyFT0M * TMath::Sin(ishift * static_cast<float>(nmode) * psidefFT0M)));
deltapsiFV0A += ((1 / (1.0 * ishift)) * (-coeffshiftxFV0A * TMath::Cos(ishift * static_cast<float>(nmode) * psidefFV0A) + coeffshiftyFV0A * TMath::Sin(ishift * static_cast<float>(nmode) * psidefFV0A)));
deltapsiTPCpos += ((1 / (1.0 * ishift)) * (-coeffshiftxTPCpos * TMath::Cos(ishift * static_cast<float>(nmode) * psidefTPCpos) + coeffshiftyTPCpos * TMath::Sin(ishift * static_cast<float>(nmode) * psidefTPCpos)));
deltapsiTPCneg += ((1 / (1.0 * ishift)) * (-coeffshiftxTPCneg * TMath::Cos(ishift * static_cast<float>(nmode) * psidefTPCneg) + coeffshiftyTPCneg * TMath::Sin(ishift * static_cast<float>(nmode) * psidefTPCneg)));
deltapsiTPCall += ((1 / (1.0 * ishift)) * (-coeffshiftxTPCall * TMath::Cos(ishift * static_cast<float>(nmode) * psidefTPCall) + coeffshiftyTPCall * TMath::Sin(ishift * static_cast<float>(nmode) * psidefTPCall)));
deltapsiFT0C += ((2. / (1.0 * ishift)) * (-coeffshiftxFT0C * TMath::Cos(ishift * static_cast<float>(nmode) * psidefFT0C) + coeffshiftyFT0C * TMath::Sin(ishift * static_cast<float>(nmode) * psidefFT0C))) / static_cast<float>(nmode);
deltapsiFT0A += ((2. / (1.0 * ishift)) * (-coeffshiftxFT0A * TMath::Cos(ishift * static_cast<float>(nmode) * psidefFT0A) + coeffshiftyFT0A * TMath::Sin(ishift * static_cast<float>(nmode) * psidefFT0A))) / static_cast<float>(nmode);
deltapsiFT0M += ((2. / (1.0 * ishift)) * (-coeffshiftxFT0M * TMath::Cos(ishift * static_cast<float>(nmode) * psidefFT0M) + coeffshiftyFT0M * TMath::Sin(ishift * static_cast<float>(nmode) * psidefFT0M))) / static_cast<float>(nmode);
deltapsiFV0A += ((2. / (1.0 * ishift)) * (-coeffshiftxFV0A * TMath::Cos(ishift * static_cast<float>(nmode) * psidefFV0A) + coeffshiftyFV0A * TMath::Sin(ishift * static_cast<float>(nmode) * psidefFV0A))) / static_cast<float>(nmode);
deltapsiTPCpos += ((2. / (1.0 * ishift)) * (-coeffshiftxTPCpos * TMath::Cos(ishift * static_cast<float>(nmode) * psidefTPCpos) + coeffshiftyTPCpos * TMath::Sin(ishift * static_cast<float>(nmode) * psidefTPCpos))) / static_cast<float>(nmode);
deltapsiTPCneg += ((2. / (1.0 * ishift)) * (-coeffshiftxTPCneg * TMath::Cos(ishift * static_cast<float>(nmode) * psidefTPCneg) + coeffshiftyTPCneg * TMath::Sin(ishift * static_cast<float>(nmode) * psidefTPCneg))) / static_cast<float>(nmode);
deltapsiTPCall += ((2. / (1.0 * ishift)) * (-coeffshiftxTPCall * TMath::Cos(ishift * static_cast<float>(nmode) * psidefTPCall) + coeffshiftyTPCall * TMath::Sin(ishift * static_cast<float>(nmode) * psidefTPCall))) / static_cast<float>(nmode);
}

qvecReShiftedFT0C.push_back(qvecRe[(kTPCall + 1) * 4 * id + kFT0C * 4 + 3] * TMath::Cos(deltapsiFT0C) - qvecIm[(kTPCall + 1) * 4 * id + kFT0C * 4 + 3] * TMath::Sin(deltapsiFT0C));
Expand Down
2 changes: 2 additions & 0 deletions Common/Tasks/qVectorsCorrection.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,8 @@ struct qVectorsCorrection {
{
histosQA.fill(HIST("histCentFull"), qVec.cent());
if (cfgAddEvtSel) {
if (std::abs(qVec.posZ()) > 10.)
return;
switch (cfgEvtSel) {
case 0: // Sel8
if (!qVec.sel8())
Expand Down
Loading