Skip to content

Commit 890ba48

Browse files
committed
Fixing O2 linter for producer and pPhi task
1 parent 951e261 commit 890ba48

3 files changed

Lines changed: 503 additions & 517 deletions

File tree

PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include <string>
2222
#include <vector>
2323
#include <cmath>
24-
#include <iostream>
2524

2625
#include "PWGCF/FemtoUniverse/DataModel/FemtoDerived.h"
2726
#include "Common/DataModel/TrackSelectionTables.h"
@@ -31,7 +30,7 @@
3130
#include "ReconstructionDataFormats/PID.h"
3231
#include "Framework/HistogramRegistry.h"
3332

34-
using namespace o2::framework;
33+
//using namespace o2::framework;
3534

3635
namespace o2::analysis::femtoUniverse
3736
{
@@ -110,7 +109,7 @@ class FemtoUniverseTrackSelection : public FemtoUniverseObjectSelection<float, f
110109
{
111110
std::vector<int> tmpPids = pids; /// necessary due to some features of the configurable
112111
for (o2::track::PID pid : tmpPids) {
113-
mPIDspecies.push_back(pid);
112+
kPIDspecies.push_back(pid);
114113
}
115114
}
116115

@@ -161,7 +160,7 @@ class FemtoUniverseTrackSelection : public FemtoUniverseObjectSelection<float, f
161160
static std::string getSelectionName(femtoUniverseTrackSelection::TrackSel iSel, std::string_view prefix = "", std::string_view suffix = "")
162161
{
163162
std::string outString = static_cast<std::string>(prefix);
164-
outString += static_cast<std::string>(mSelectionNames[iSel]);
163+
outString += static_cast<std::string>(kSelectionNames[iSel]);
165164
outString += suffix;
166165
return outString;
167166
}
@@ -172,7 +171,7 @@ class FemtoUniverseTrackSelection : public FemtoUniverseObjectSelection<float, f
172171
static int findSelectionIndex(const std::string_view& obs, std::string_view prefix = "")
173172
{
174173
for (int index = 0; index < kNtrackSelection; index++) {
175-
std::string comp = static_cast<std::string>(prefix) + static_cast<std::string>(mSelectionNames[index]);
174+
std::string comp = static_cast<std::string>(prefix) + static_cast<std::string>(kSelectionNames[index]);
176175
std::string_view cmp{comp};
177176
if (obs.compare(cmp) == 0)
178177
return index;
@@ -184,7 +183,7 @@ class FemtoUniverseTrackSelection : public FemtoUniverseObjectSelection<float, f
184183
/// \param iSel Track selection variable whose type is returned
185184
static femtoUniverseSelection::SelectionType getSelectionType(femtoUniverseTrackSelection::TrackSel iSel)
186185
{
187-
return mSelectionTypes[iSel];
186+
return kSelectionTypes[iSel];
188187
}
189188

190189
/// Helper function to obtain the helper string of a given selection criterion for consistent description of the configurables
@@ -193,7 +192,7 @@ class FemtoUniverseTrackSelection : public FemtoUniverseObjectSelection<float, f
193192
static std::string getSelectionHelper(femtoUniverseTrackSelection::TrackSel iSel, std::string_view prefix = "")
194193
{
195194
std::string outString = static_cast<std::string>(prefix);
196-
outString += static_cast<std::string>(mSelectionHelper[iSel]);
195+
outString += static_cast<std::string>(kSelectionHelper[iSel]);
197196
return outString;
198197
}
199198

@@ -242,9 +241,9 @@ class FemtoUniverseTrackSelection : public FemtoUniverseObjectSelection<float, f
242241
float nSigmaPIDMax;
243242
float nSigmaPIDOffsetTPC;
244243
float nSigmaPIDOffsetTOF;
245-
std::vector<o2::track::PID> mPIDspecies; ///< All the particle species for which the n_sigma values need to be stored
244+
std::vector<o2::track::PID> kPIDspecies; ///< All the particle species for which the n_sigma values need to be stored
246245
static constexpr int kNtrackSelection = 14;
247-
static constexpr std::string_view mSelectionNames[kNtrackSelection] = {"Sign",
246+
static constexpr std::string_view kSelectionNames[kNtrackSelection] = {"Sign",
248247
"PtMin",
249248
"PtMax",
250249
"EtaMax",
@@ -259,7 +258,7 @@ class FemtoUniverseTrackSelection : public FemtoUniverseObjectSelection<float, f
259258
"DCAMin",
260259
"PIDnSigmaMax"}; ///< Name of the different selections
261260

262-
static constexpr femtoUniverseSelection::SelectionType mSelectionTypes[kNtrackSelection]{femtoUniverseSelection::kEqual,
261+
static constexpr femtoUniverseSelection::SelectionType kSelectionTypes[kNtrackSelection]{femtoUniverseSelection::kEqual,
263262
femtoUniverseSelection::kLowerLimit,
264263
femtoUniverseSelection::kUpperLimit,
265264
femtoUniverseSelection::kAbsUpperLimit,
@@ -274,7 +273,7 @@ class FemtoUniverseTrackSelection : public FemtoUniverseObjectSelection<float, f
274273
femtoUniverseSelection::kAbsUpperLimit,
275274
femtoUniverseSelection::kAbsUpperLimit}; ///< Map to match a variable with its type
276275

277-
static constexpr std::string_view mSelectionHelper[kNtrackSelection] = {"Sign of the track",
276+
static constexpr std::string_view kSelectionHelper[kNtrackSelection] = {"Sign of the track",
278277
"Minimal pT (GeV/c)",
279278
"Maximal pT (GeV/c)",
280279
"Maximal eta",
@@ -305,7 +304,7 @@ void FemtoUniverseTrackSelection::init(HistogramRegistry* registry)
305304

306305
mHistogramRegistry->add((folderName + "/hPt").c_str(), "; #it{p}_{T} (GeV/#it{c}); Entries", kTH1F, {{240, 0, 6}});
307306
mHistogramRegistry->add((folderName + "/hEta").c_str(), "; #eta; Entries", kTH1F, {{200, -1.5, 1.5}});
308-
mHistogramRegistry->add((folderName + "/hPhi").c_str(), "; #phi; Entries", kTH1F, {{200, 0, 2. * M_PI}});
307+
mHistogramRegistry->add((folderName + "/hPhi").c_str(), "; #phi; Entries", kTH1F, {{200, 0, o2::constants::math::TwoPI}});
309308
mHistogramRegistry->add((folderName + "/hTPCfindable").c_str(), "; TPC findable clusters; Entries", kTH1F, {{163, -0.5, 162.5}});
310309
mHistogramRegistry->add((folderName + "/hTPCfound").c_str(), "; TPC found clusters; Entries", kTH1F, {{163, -0.5, 162.5}});
311310
mHistogramRegistry->add((folderName + "/hTPCcrossedOverFindalbe").c_str(), "; TPC ratio findable; Entries", kTH1F, {{100, 0.5, 1.5}});
@@ -397,7 +396,7 @@ bool FemtoUniverseTrackSelection::isSelectedMinimal(T const& track)
397396
const auto dca = track.dcaXY(); // Accordingly to FemtoUniverse in AliPhysics as well as LF analysis,
398397
// only dcaXY should be checked; NOT std::sqrt(pow(dcaXY, 2.) + pow(dcaZ, 2.))
399398
std::vector<float> pidTPC, pidTOF;
400-
for (auto it : mPIDspecies) {
399+
for (auto it : kPIDspecies) {
401400
pidTPC.push_back(getNsigmaTPC(track, it));
402401
pidTOF.push_back(getNsigmaTOF(track, it));
403402
}
@@ -474,10 +473,10 @@ std::array<cutContainerType, 2> FemtoUniverseTrackSelection::getCutContainer(T c
474473
const auto itsNClsIB = track.itsNClsInnerBarrel();
475474
const auto dcaXY = track.dcaXY();
476475
const auto dcaZ = track.dcaZ();
477-
const auto dca = std::sqrt(pow(dcaXY, 2.) + pow(dcaZ, 2.));
476+
const auto dca = std::sqrt(std::pow(dcaXY, 2.) + std::pow(dcaZ, 2.));
478477

479478
std::vector<float> pidTPC, pidTOF;
480-
for (auto it : mPIDspecies) {
479+
for (auto it : kPIDspecies) {
481480
pidTPC.push_back(getNsigmaTPC(track, it));
482481
pidTOF.push_back(getNsigmaTOF(track, it));
483482
}
@@ -487,7 +486,7 @@ std::array<cutContainerType, 2> FemtoUniverseTrackSelection::getCutContainer(T c
487486
const auto selVariable = sel.getSelectionVariable();
488487
if (selVariable == femtoUniverseTrackSelection::kPIDnSigmaMax) {
489488
/// PID needs to be handled a bit differently since we may need more than one species
490-
for (size_t i = 0; i < mPIDspecies.size(); ++i) {
489+
for (size_t i = 0; i < kPIDspecies.size(); ++i) {
491490
auto pidTPCVal = pidTPC.at(i) - nSigmaPIDOffsetTPC;
492491
auto pidTOFVal = pidTOF.at(i) - nSigmaPIDOffsetTOF;
493492
auto pidComb = std::sqrt(pidTPCVal * pidTPCVal + pidTOFVal * pidTOFVal);
@@ -561,7 +560,7 @@ void FemtoUniverseTrackSelection::fillQA(T const& track)
561560
mHistogramRegistry->fill(HIST(o2::aod::femtouniverseparticle::ParticleTypeName[part]) + HIST("/") + HIST(o2::aod::femtouniverseparticle::TrackTypeName[tracktype]) + HIST("/hITSclustersIB"), track.itsNClsInnerBarrel());
562561
mHistogramRegistry->fill(HIST(o2::aod::femtouniverseparticle::ParticleTypeName[part]) + HIST("/") + HIST(o2::aod::femtouniverseparticle::TrackTypeName[tracktype]) + HIST("/hDCAxy"), track.pt(), track.dcaXY());
563562
mHistogramRegistry->fill(HIST(o2::aod::femtouniverseparticle::ParticleTypeName[part]) + HIST("/") + HIST(o2::aod::femtouniverseparticle::TrackTypeName[tracktype]) + HIST("/hDCAz"), track.pt(), track.dcaZ());
564-
mHistogramRegistry->fill(HIST(o2::aod::femtouniverseparticle::ParticleTypeName[part]) + HIST("/") + HIST(o2::aod::femtouniverseparticle::TrackTypeName[tracktype]) + HIST("/hDCA"), track.pt(), std::sqrt(pow(track.dcaXY(), 2.) + pow(track.dcaZ(), 2.)));
563+
mHistogramRegistry->fill(HIST(o2::aod::femtouniverseparticle::ParticleTypeName[part]) + HIST("/") + HIST(o2::aod::femtouniverseparticle::TrackTypeName[tracktype]) + HIST("/hDCA"), track.pt(), std::sqrt(std::pow(track.dcaXY(), 2.) + std::pow(track.dcaZ(), 2.)));
565564
mHistogramRegistry->fill(HIST(o2::aod::femtouniverseparticle::ParticleTypeName[part]) + HIST("/") + HIST(o2::aod::femtouniverseparticle::TrackTypeName[tracktype]) + HIST("/hTPCdEdX"), track.p(), track.tpcSignal());
566565
mHistogramRegistry->fill(HIST(o2::aod::femtouniverseparticle::ParticleTypeName[part]) + HIST("/") + HIST(o2::aod::femtouniverseparticle::TrackTypeName[tracktype]) + HIST("/nSigmaTPC_el"), track.p(), track.tpcNSigmaEl());
567566
mHistogramRegistry->fill(HIST(o2::aod::femtouniverseparticle::ParticleTypeName[part]) + HIST("/") + HIST(o2::aod::femtouniverseparticle::TrackTypeName[tracktype]) + HIST("/nSigmaTPC_pi"), track.p(), track.tpcNSigmaPi());

0 commit comments

Comments
 (0)