Skip to content
Merged
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
7 changes: 4 additions & 3 deletions Common/TableProducer/qVectorsTable.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@
///

// C++/ROOT includes.
#include <TComplex.h>
#include <TH3F.h>

#include <chrono>
#include <string>
#include <vector>
#include <unordered_map>
#include <TComplex.h>
#include <TH3F.h>
#include <vector>

// o2Physics includes.
#include "Framework/AnalysisDataModel.h"
Expand Down Expand Up @@ -172,13 +173,13 @@
for (DeviceSpec const& device : workflows.devices) {
for (auto const& input : device.inputs) {
if (input.matcher.binding == "Qvectors") {
for (auto det : useDetector) {

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

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
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) {

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

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
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 @@ -261,7 +262,7 @@
fullPath += "/FT0";
auto objft0Gain = getForTsOrRun<std::vector<float>>(fullPath, timestamp, runnumber);
if (!objft0Gain || cfgCorrLevel == 0) {
for (auto i{0u}; i < 208; i++) {

Check failure on line 265 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 @@ -272,7 +273,7 @@
fullPath += "/FV0";
auto objfv0Gain = getForTsOrRun<std::vector<float>>(fullPath, timestamp, runnumber);
if (!objfv0Gain || cfgCorrLevel == 0) {
for (auto i{0u}; i < 48; i++) {

Check failure on line 276 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 @@ -352,7 +353,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 356 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 @@ -375,7 +376,7 @@
helperEP.SumQvectors(0, FT0CchId, ampl / FT0RelGainConst[FT0CchId], nmode, QvecFT0M, sumAmplFT0M, ft0geom, fv0geom);
}

if (sumAmplFT0C > 1e-8) {

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

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

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

if (sumAmplFV0A > 1e-8) {

Check failure on line 423 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 @@ -436,7 +437,7 @@
int nTrkTPCneg = 0;
int nTrkTPCall = 0;

for (auto& trk : track) {

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

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
if (!SelTrack(trk)) {
continue;
}
Expand All @@ -451,7 +452,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 455 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
Loading