Skip to content

Commit af3c71c

Browse files
NucleiTask - Fix O2Lint errors
1 parent 8f94641 commit af3c71c

3 files changed

Lines changed: 41 additions & 49 deletions

File tree

PWGLF/DataModel/LFNucleiTables.h

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ DECLARE_SOA_COLUMN(Beta, beta, float);
110110
// TPC and ITS QA
111111
DECLARE_SOA_COLUMN(PidForTracking, pidForTracking, uint8_t);
112112
DECLARE_SOA_COLUMN(ItsNCls, itsNCls, int16_t);
113-
DECLARE_SOA_COLUMN(TpcChi2Ncl, tpcChi2NCl, float);
113+
DECLARE_SOA_COLUMN(TpcChi2NCl, tpcChi2NCl, float);
114114
DECLARE_SOA_COLUMN(ItsChi2NCl, itsChi2NCl, float);
115115
DECLARE_SOA_COLUMN(TpcPassed, tpcPassed, bool);
116116
DECLARE_SOA_COLUMN(ItsPassed, itsPassed, bool);
@@ -160,14 +160,6 @@ DECLARE_SOA_DYNAMIC_COLUMN(TofExpMom, tofExpMom,
160160
[](bool /*b*/) -> float { return 0.f; });
161161
} // namespace dummy
162162

163-
/*
164-
namespace fullMC
165-
{
166-
DECLARE_SOA_INDEX_COLUMN(LfNuclEvent, lfCandNucleusFullEvent);
167-
DECLARE_SOA_COLUMN(PdgCode, pdgCode, int);
168-
}
169-
*/
170-
171163
DECLARE_SOA_TABLE(LfCandNucleus, "AOD", "LFNUCL",
172164
o2::soa::Index<>,
173165
full::LfNuclEventId,
@@ -190,7 +182,7 @@ DECLARE_SOA_TABLE(LfCandNucleus, "AOD", "LFNUCL",
190182
track::TPCNClsFindable,
191183
track::TPCNClsFindableMinusFound,
192184
track::TPCNClsFindableMinusCrossedRows,
193-
full::TpcChi2Ncl,
185+
full::TpcChi2NCl,
194186
full::ItsChi2NCl,
195187
track::ITSClusterMap,
196188
full::IsPVContributor,
@@ -223,7 +215,7 @@ DECLARE_SOA_TABLE_VERSIONED(LfCandNucleusDummy, "AOD", "LFNUCL", 1,
223215
track::TPCNClsFindable,
224216
track::TPCNClsFindableMinusFound,
225217
track::TPCNClsFindableMinusCrossedRows,
226-
full::TpcChi2Ncl,
218+
full::TpcChi2NCl,
227219
full::ItsChi2NCl,
228220
track::ITSClusterMap,
229221
full::IsPVContributor,

PWGLF/TableProducer/Nuspex/LFTreeCreatorNuclei.cxx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ struct LfTreeCreatorNuclei {
9494
Configurable<float> cfgHighCutVertex{"cfgHighCutVertex", 10.0f, "Accepted z-vertex range"};
9595
Configurable<float> cfgLowCutVertex{"cfgLowCutVertex", -10.0f, "Accepted z-vertex range"};
9696
Configurable<bool> useSel8{"useSel8", true, "Use Sel8 for run3 Event Selection"};
97-
Configurable<bool> Tttrigger{"Tttrigger", false, "Use TVX for Event Selection (default w/ Sel8)"};
97+
Configurable<bool> TvxTrigger{"TvxTrigger", false, "Use TVX for Event Selection (default w/ Sel8)"};
9898
Configurable<bool> removeTFBorder{"removeTFBorder", false, "Remove TimeFrame border (default w/ Sel8)"};
9999
Configurable<bool> removeITSROFBorder{"removeITSROFBorder", false, "Remove ITS Read-Out Frame border (default w/ Sel8)"};
100100

@@ -115,10 +115,10 @@ struct LfTreeCreatorNuclei {
115115
Filter collisionFilter = (aod::collision::posZ < cfgHighCutVertex && aod::collision::posZ > cfgLowCutVertex);
116116

117117
Filter etaFilter = (nabs(aod::track::eta) < cfgCutEta);
118-
Filter trackFilter = (trackSelType.value == 0 && requireGlobalTrackWoDCAInFilter()) ||
119-
(trackSelType.value == 1 && requireGlobalTrackInFilter()) ||
120-
(trackSelType.value == 2) ||
121-
(trackSelType.value == 3);
118+
Filter trackFilter = (trackSelType.value == 0 && requireGlobalTrackWoDCAInFilter()) || // o2-linter: disable=magic-number (filters)
119+
(trackSelType.value == 1 && requireGlobalTrackInFilter()) || // o2-linter: disable=magic-number (filters)
120+
(trackSelType.value == 2) || // o2-linter: disable=magic-number (filters)
121+
(trackSelType.value == 3); // o2-linter: disable=magic-number (filters)
122122
Filter DCAcutFilter = (nabs(aod::track::dcaXY) < cfgCutDCAxy) && (nabs(aod::track::dcaZ) < cfgCutDCAz);
123123
using EventCandidates = soa::Join<aod::Collisions, aod::EvSels, aod::Mults, aod::CentFT0Ms, aod::CentFV0As>;
124124
using TrackCandidates = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA, aod::TrackSelection, aod::TrackSelectionExtension,
@@ -135,7 +135,7 @@ struct LfTreeCreatorNuclei {
135135
bool checkQuality(CollisionType const& /*collision*/, TrackType const& tracks)
136136
{
137137
bool out = kFALSE;
138-
for (auto& track : tracks) {
138+
for (const auto& track : tracks) {
139139

140140
if (track.itsNClsInnerBarrel() < nITSInnerBarrelHits) {
141141
continue;
@@ -214,7 +214,7 @@ struct LfTreeCreatorNuclei {
214214
if constexpr (isMC) {
215215
tableCandidateMC.reserve(tracks.size());
216216
}
217-
for (auto& track : tracks) {
217+
for (const auto& track : tracks) {
218218
if (track.itsNClsInnerBarrel() < nITSInnerBarrelHits) {
219219
continue;
220220
}
@@ -313,7 +313,7 @@ struct LfTreeCreatorNuclei {
313313
hEvents.fill(HIST("eventSelection"), 0);
314314

315315
if (!collision.selection_bit(aod::evsel::kIsTriggerTVX)) {
316-
if (Tttrigger)
316+
if (TvxTrigger)
317317
continue;
318318
} else {
319319
hEvents.fill(HIST("eventSelection"), 1);
@@ -349,7 +349,7 @@ struct LfTreeCreatorNuclei {
349349
hEvents.fill(HIST("eventSelection"), 6);
350350

351351
// Fill the norm. column with good events with |z| < 10 cm before skimming
352-
if (collision.posZ() < 10 && collision.posZ() > -10) {
352+
if (collision.posZ() < 10 && collision.posZ() > -10) { // o2-linter: disable=magic-number (10 cm vertex cut)
353353
hEvents.fill(HIST("eventSelection"), 7);
354354
}
355355

@@ -371,7 +371,7 @@ struct LfTreeCreatorNuclei {
371371
hEvents.fill(HIST("eventSelection"), 0);
372372

373373
if (!collision.selection_bit(aod::evsel::kIsTriggerTVX)) {
374-
if (Tttrigger)
374+
if (TvxTrigger)
375375
continue;
376376
} else {
377377
hEvents.fill(HIST("eventSelection"), 1);

PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -242,10 +242,10 @@ struct LFNucleiBATask {
242242
Configurable<bool> enableCentrality{"enableCentrality", true, "Flag to enable centrality 3D histos)"};
243243

244244
// ITS to TPC - Fake hit loop
245-
static constexpr int kFakeLoop = 10; // Fixed O2Linter error
245+
static constexpr int IntFakeLoop = 10; // Fixed O2Linter error
246246
// TPC low/high momentum range
247-
static constexpr float kCfgTpcClasses[] = {0.5f, 0.1f};
248-
static constexpr float kCfgKaonCut = 5.f;
247+
static constexpr float CfgTpcClasses[] = {0.5f, 0.1f};
248+
static constexpr float CfgKaonCut = 5.f;
249249

250250
// PDG codes and masses used in this analysis
251251
static constexpr int PDGPion = PDG_t::kPiPlus;
@@ -263,7 +263,7 @@ struct LFNucleiBATask {
263263
static constexpr float MassAlphaVal = o2::constants::physics::MassAlpha;
264264

265265
// PDG of Mothers
266-
static constexpr int kPdgMotherList[] = {
266+
static constexpr int PdgMotherList[] = {
267267
PDG_t::kPiPlus,
268268
PDG_t::kKPlus,
269269
PDG_t::kK0Short,
@@ -276,9 +276,9 @@ struct LFNucleiBATask {
276276
o2::constants::physics::Pdg::kHyperTriton,
277277
o2::constants::physics::Pdg::kAlpha};
278278

279-
static constexpr int kNumMotherList = sizeof(kPdgMotherList) / sizeof(kPdgMotherList[0]);
279+
static constexpr int NumMotherList = sizeof(PdgMotherList) / sizeof(PdgMotherList[0]);
280280

281-
static constexpr const char* kMotherNames[kNumMotherList] = {
281+
static constexpr const char* kMotherNames[NumMotherList] = {
282282
"#pi^{+}",
283283
"K^{+}",
284284
"K^{0}_{S}",
@@ -1084,7 +1084,7 @@ struct LFNucleiBATask {
10841084
histos.add<TH2>("tracks/proton/dca/before/hDCAxyVsPtProtonTrueMaterial", "DCAxy vs Pt (p); #it{p}_{T} (GeV/#it{c}); DCAxy (cm)", HistType::kTH2F, {{ptAxis}, {dcaxyAxis}});
10851085

10861086
histos.add<TH1>("tracks/proton/dca/before/hNumMothers", "N mothers per particle; N mothers;counts", HistType::kTH1I, {{7, 1.0, 8.0}});
1087-
histos.add<TH3>("tracks/proton/dca/before/hMomTrueMaterial", "MC mothers;mother index;mother type; mother #it{p}_{T}", HistType::kTH3F, {{2, -2.0, 2.0}, {kNumMotherList + 2, -1.5, static_cast<double>(kNumMotherList) + 0.5}, {150, 0.0, 15.0}});
1087+
histos.add<TH3>("tracks/proton/dca/before/hMomTrueMaterial", "MC mothers;mother index;mother type; mother #it{p}_{T}", HistType::kTH3F, {{2, -2.0, 2.0}, {NumMotherList + 2, -1.5, static_cast<double>(NumMotherList) + 0.5}, {150, 0.0, 15.0}});
10881088

10891089
std::shared_ptr<TH3> hTempPr = histos.get<TH3>(HIST("tracks/proton/dca/before/hMomTrueMaterial"));
10901090
TH3* hPdgPr = hTempPr.get();
@@ -1096,7 +1096,7 @@ struct LFNucleiBATask {
10961096
TAxis* ayPdgPr = hPdgPr->GetYaxis();
10971097
ayPdgPr->SetBinLabel(1, "undef.");
10981098
ayPdgPr->SetBinLabel(2, "other");
1099-
for (int i = 0; i < kNumMotherList; i++) {
1099+
for (int i = 0; i < NumMotherList; i++) {
11001100
ayPdgPr->SetBinLabel(i + 3, kMotherNames[i]);
11011101
}
11021102

@@ -1156,7 +1156,7 @@ struct LFNucleiBATask {
11561156
histos.add<TH2>("tracks/deuteron/dca/before/hDCAxyVsPtDeuteronTrueMaterial", "DCAxy vs Pt (d); #it{p}_{T} (GeV/#it{c}); DCAxy (cm)", HistType::kTH2F, {{ptAxis}, {dcaxyAxis}});
11571157

11581158
histos.add<TH1>("tracks/deuteron/dca/before/hNumMothers", "N mothers per particle; N mothers;counts", HistType::kTH1I, {{7, 1.0, 8.0}});
1159-
histos.add<TH3>("tracks/deuteron/dca/before/hMomTrueMaterial", "MC mothers;mother index;mother type; mother #it{p}_{T}", HistType::kTH3F, {{2, -2.0, 2.0}, {kNumMotherList + 2, -1.5, static_cast<double>(kNumMotherList) + 0.5}, {150, 0.0, 15.0}});
1159+
histos.add<TH3>("tracks/deuteron/dca/before/hMomTrueMaterial", "MC mothers;mother index;mother type; mother #it{p}_{T}", HistType::kTH3F, {{2, -2.0, 2.0}, {NumMotherList + 2, -1.5, static_cast<double>(NumMotherList) + 0.5}, {150, 0.0, 15.0}});
11601160

11611161
std::shared_ptr<TH3> hTempDe = histos.get<TH3>(HIST("tracks/deuteron/dca/before/hMomTrueMaterial"));
11621162
TH3* hPdgDe = hTempDe.get();
@@ -1168,7 +1168,7 @@ struct LFNucleiBATask {
11681168
TAxis* ayPdgDe = hPdgDe->GetYaxis();
11691169
ayPdgDe->SetBinLabel(1, "undef.");
11701170
ayPdgDe->SetBinLabel(2, "other");
1171-
for (int i = 0; i < kNumMotherList; i++) {
1171+
for (int i = 0; i < NumMotherList; i++) {
11721172
ayPdgDe->SetBinLabel(i + 3, kMotherNames[i]);
11731173
}
11741174

@@ -1330,7 +1330,7 @@ struct LFNucleiBATask {
13301330
histos.add<TH2>("tracks/helium/dca/before/hDCAxyVsPtHeliumTrueMaterial", "DCAxy vs Pt (He); #it{p}_{T} (GeV/#it{c}); DCAxy (cm)", HistType::kTH2F, {{ptZHeAxis}, {dcaxyAxis}});
13311331

13321332
histos.add<TH1>("tracks/helium/dca/before/hNumMothers", "N mothers per particle; N mothers;counts", HistType::kTH1I, {{7, 1.0, 8.0}});
1333-
histos.add<TH3>("tracks/helium/dca/before/hMomTrueMaterial", "MC mothers;mother index;mother type; mother #it{p}_{T}", HistType::kTH3F, {{2, -2.0, 2.0}, {kNumMotherList + 2, -1.5, static_cast<double>(kNumMotherList) + 0.5}, {150, 0.0, 15.0}});
1333+
histos.add<TH3>("tracks/helium/dca/before/hMomTrueMaterial", "MC mothers;mother index;mother type; mother #it{p}_{T}", HistType::kTH3F, {{2, -2.0, 2.0}, {NumMotherList + 2, -1.5, static_cast<double>(NumMotherList) + 0.5}, {150, 0.0, 15.0}});
13341334

13351335
// Fix for getting TH3 pointer
13361336
std::shared_ptr<TH3> hTempHe = histos.get<TH3>(HIST("tracks/helium/dca/before/hMomTrueMaterial"));
@@ -1343,7 +1343,7 @@ struct LFNucleiBATask {
13431343
TAxis* ayPdgHe = hPdgHe->GetYaxis();
13441344
ayPdgHe->SetBinLabel(1, "undef.");
13451345
ayPdgHe->SetBinLabel(2, "other");
1346-
for (int i = 0; i < kNumMotherList; i++) {
1346+
for (int i = 0; i < NumMotherList; i++) {
13471347
ayPdgHe->SetBinLabel(i + 3, kMotherNames[i]);
13481348
}
13491349

@@ -3431,7 +3431,7 @@ struct LFNucleiBATask {
34313431
}
34323432

34333433
genPt = track.mcParticle().pt();
3434-
for (int i = 0; i < kFakeLoop; i++) { // From ITS to TPC
3434+
for (int i = 0; i < IntFakeLoop; i++) { // From ITS to TPC
34353435
if (track.mcMask() & 1 << i) {
34363436
hasFakeHit = true;
34373437
break;
@@ -3469,8 +3469,8 @@ struct LFNucleiBATask {
34693469
int motherSpeciesBin = -1;
34703470
if (pdgMom != -1) {
34713471
motherSpeciesBin = 0;
3472-
for (int j = 0; j < kNumMotherList; j++) {
3473-
if (std::abs(kPdgMotherList[j]) == std::abs(pdgMom)) {
3472+
for (int j = 0; j < NumMotherList; j++) {
3473+
if (std::abs(PdgMotherList[j]) == std::abs(pdgMom)) {
34743474
motherSpeciesBin = j + 1;
34753475
break;
34763476
}
@@ -3566,8 +3566,8 @@ struct LFNucleiBATask {
35663566
int motherSpeciesBin = -1;
35673567
if (pdgMom != -1) {
35683568
motherSpeciesBin = 0;
3569-
for (int j = 0; j < kNumMotherList; j++) {
3570-
if (std::abs(kPdgMotherList[j]) == std::abs(pdgMom)) {
3569+
for (int j = 0; j < NumMotherList; j++) {
3570+
if (std::abs(PdgMotherList[j]) == std::abs(pdgMom)) {
35713571
motherSpeciesBin = j + 1;
35723572
break;
35733573
}
@@ -3725,8 +3725,8 @@ struct LFNucleiBATask {
37253725
int motherSpeciesBin = -1;
37263726
if (pdgMom != -1) {
37273727
motherSpeciesBin = 0;
3728-
for (int j = 0; j < kNumMotherList; j++) {
3729-
if (std::abs(kPdgMotherList[j]) == std::abs(pdgMom)) {
3728+
for (int j = 0; j < NumMotherList; j++) {
3729+
if (std::abs(PdgMotherList[j]) == std::abs(pdgMom)) {
37303730
motherSpeciesBin = j + 1;
37313731
break;
37323732
}
@@ -4176,26 +4176,26 @@ struct LFNucleiBATask {
41764176
debugHistos.fill(HIST("debug/qa/h2TPCncrVsPtPos"), track.tpcInnerParam(), track.tpcNClsCrossedRows());
41774177
debugHistos.fill(HIST("debug/qa/h2TPCncrVsTPCsignalPos"), track.tpcSignal(), track.tpcNClsCrossedRows());
41784178

4179-
if (track.tpcInnerParam() < kCfgTpcClasses[0]) {
4179+
if (track.tpcInnerParam() < CfgTpcClasses[0]) {
41804180
debugHistos.fill(HIST("debug/qa/h1TPCncrLowPPos"), track.tpcNClsCrossedRows());
41814181
}
4182-
if ((track.tpcInnerParam() >= kCfgTpcClasses[0]) && (track.tpcInnerParam() < kCfgTpcClasses[1])) {
4182+
if ((track.tpcInnerParam() >= CfgTpcClasses[0]) && (track.tpcInnerParam() < CfgTpcClasses[1])) {
41834183
debugHistos.fill(HIST("debug/qa/h1TPCncrMidPPos"), track.tpcNClsCrossedRows());
41844184
}
4185-
if (track.tpcInnerParam() >= kCfgTpcClasses[1]) {
4185+
if (track.tpcInnerParam() >= CfgTpcClasses[1]) {
41864186
debugHistos.fill(HIST("debug/qa/h1TPCncrHighPPos"), track.tpcNClsCrossedRows());
41874187
}
41884188
} else {
41894189
debugHistos.fill(HIST("debug/qa/h2TPCncrVsPtNeg"), track.tpcInnerParam(), track.tpcNClsCrossedRows());
41904190
debugHistos.fill(HIST("debug/qa/h2TPCncrVsTPCsignalNeg"), track.tpcSignal(), track.tpcNClsCrossedRows());
41914191

4192-
if (track.tpcInnerParam() < kCfgTpcClasses[0]) {
4192+
if (track.tpcInnerParam() < CfgTpcClasses[0]) {
41934193
debugHistos.fill(HIST("debug/qa/h1TPCncrLowPNeg"), track.tpcNClsCrossedRows());
41944194
}
4195-
if ((track.tpcInnerParam() >= kCfgTpcClasses[0]) && (track.tpcInnerParam() < kCfgTpcClasses[1])) {
4195+
if ((track.tpcInnerParam() >= CfgTpcClasses[0]) && (track.tpcInnerParam() < CfgTpcClasses[1])) {
41964196
debugHistos.fill(HIST("debug/qa/h1TPCncrMidPNeg"), track.tpcNClsCrossedRows());
41974197
}
4198-
if (track.tpcInnerParam() >= kCfgTpcClasses[1]) {
4198+
if (track.tpcInnerParam() >= CfgTpcClasses[1]) {
41994199
debugHistos.fill(HIST("debug/qa/h1TPCncrHighPNeg"), track.tpcNClsCrossedRows());
42004200
}
42014201
}
@@ -4208,7 +4208,7 @@ struct LFNucleiBATask {
42084208
histos.fill(HIST("tracks/eff/h2pVsTPCmomentum"), track.tpcInnerParam(), track.p());
42094209

42104210
if (filterOptions.enableFiltering) {
4211-
if (track.tpcNSigmaKa() < kCfgKaonCut)
4211+
if (track.tpcNSigmaKa() < CfgKaonCut)
42124212
continue;
42134213
}
42144214

@@ -5200,7 +5200,7 @@ struct LFNucleiBATask {
52005200
track.passedTPCRefit() &&
52015201
track.hasTPC();
52025202

5203-
for (int i = 0; i < kFakeLoop; i++) { // From ITS to TPC
5203+
for (int i = 0; i < IntFakeLoop; i++) { // From ITS to TPC
52045204
if (track.mcMask() & 1 << i) {
52055205
hasFakeHit = true;
52065206
break;
@@ -6709,7 +6709,7 @@ struct LFNucleiBATask {
67096709
for (const auto& mcPart : mcParticles) {
67106710
if (!mcPart.isPhysicalPrimary())
67116711
continue;
6712-
if (std::abs(mcPart.y()) >= kCfgTpcClasses[0])
6712+
if (std::abs(mcPart.y()) >= CfgTpcClasses[0])
67136713
continue;
67146714

67156715
const float pt = mcPart.pt();

0 commit comments

Comments
 (0)