Skip to content

Commit fab7b5f

Browse files
committed
femtoflow pass o2linter and megalinter
1 parent cebfdcb commit fab7b5f

File tree

9 files changed

+190
-187
lines changed

9 files changed

+190
-187
lines changed

PWGCF/Femto/Core/FemtoFlowAngularContainer.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -223,15 +223,15 @@ class FemtoFlowAngularContainer
223223
setPairBase<o2::aod::femtoflow_mc_particle::MCType::kRecon>(femtoObs, mT, part1, part2, mult, use3dplots, weight);
224224

225225
if constexpr (isMC) {
226-
if (part1.has_fdMCParticle() && part2.has_fdMCParticle()) {
226+
if (part1.has_fDMCParticle() && part2.has_fDMCParticle()) {
227227
// calculate the femto observable and the mT with MC truth information
228228
if constexpr (FemtoObs == femto_flow_angular_container::Observable::kstar) {
229-
femtoObsMC = FemtoFlowMath::getkstar(part1.fdMCParticle(), mMassOne, part2.fdMCParticle(), mMassTwo);
229+
femtoObsMC = FemtoFlowMath::getkstar(part1.fDMCParticle(), mMassOne, part2.fDMCParticle(), mMassTwo);
230230
}
231-
const float mTMC = FemtoFlowMath::getmT(part1.fdMCParticle(), mMassOne, part2.fdMCParticle(), mMassTwo);
231+
const float mTMC = FemtoFlowMath::getmT(part1.fDMCParticle(), mMassOne, part2.fDMCParticle(), mMassTwo);
232232

233-
if (std::abs(part1.fdMCParticle().pdgMCTruth()) == std::abs(mPDGOne) && std::abs(part2.fdMCParticle().pdgMCTruth()) == std::abs(mPDGTwo)) { // Note: all pair-histogramms are filled with MC truth information ONLY in case of non-fake candidates
234-
setPairBase<o2::aod::femtoflow_mc_particle::MCType::kTruth>(femtoObsMC, mTMC, part1.fdMCParticle(), part2.fdMCParticle(), mult, use3dplots, weight);
233+
if (std::abs(part1.fDMCParticle().pdgMCTruth()) == std::abs(mPDGOne) && std::abs(part2.fDMCParticle().pdgMCTruth()) == std::abs(mPDGTwo)) { // Note: all pair-histogramms are filled with MC truth information ONLY in case of non-fake candidates
234+
setPairBase<o2::aod::femtoflow_mc_particle::MCType::kTruth>(femtoObsMC, mTMC, part1.fDMCParticle(), part2.fDMCParticle(), mult, use3dplots, weight);
235235
setPairMC(femtoObsMC, femtoObs, mT, mult);
236236
} else {
237237
}

PWGCF/Femto/Core/FemtoFlowFemtoContainer.h

Lines changed: 76 additions & 76 deletions
Large diffs are not rendered by default.

PWGCF/Femto/Core/FemtoFlowObjectSelection.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ class FemtoFlowObjectSelection
130130
break;
131131
}
132132

133-
for (auto& sel : mSelections) {
133+
for (const auto& sel : mSelections) {
134134
if (sel.getSelectionVariable() == selVar) {
135135
switch (sel.getSelectionType()) {
136136
case (femto_flow_selection::SelectionType::kUpperLimit):
@@ -173,7 +173,7 @@ class FemtoFlowObjectSelection
173173
std::vector<FemtoFlowSelection<selValDataType, selVariable>> getSelections(selVariable selVar)
174174
{
175175
std::vector<FemtoFlowSelection<selValDataType, selVariable>> selValVec;
176-
for (auto& it : mSelections) {
176+
for (const auto& it : mSelections) {
177177
if (it.getSelectionVariable() == selVar) {
178178
selValVec.push_back(it);
179179
}
@@ -186,7 +186,7 @@ class FemtoFlowObjectSelection
186186
std::vector<selVariable> getSelectionVariables()
187187
{
188188
std::vector<selVariable> selVarVec;
189-
for (auto& it : mSelections) {
189+
for (const auto& it : mSelections) {
190190
auto selVar = it.getSelectionVariable();
191191
if (std::none_of(
192192
selVarVec.begin(),

PWGCF/Femto/Core/FemtoFlowParticleHisto.h

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class FemtoFlowParticleHisto
5353
/// \param tempFitVarpTAxis axis object for the pT axis in the pT vs. tempFitVar plots
5454
/// \param tempFitVarAxis axis object for the tempFitVar axis
5555
template <o2::aod::femtoflow_mc_particle::MCType mc, typename T>
56-
void init_base(std::string folderName, std::string tempFitVarAxisTitle, T& tempFitVarpTAxis, T& tempFitVarAxis) // o2-linter: disable=name/function-variable
56+
void initBase(std::string folderName, std::string tempFitVarAxisTitle, T& tempFitVarpTAxis, T& tempFitVarAxis) // o2-linter: disable=name/function-variable
5757
{
5858
using namespace o2::framework;
5959

@@ -72,7 +72,7 @@ class FemtoFlowParticleHisto
7272

7373
// comment
7474
template <o2::aod::femtoflow_mc_particle::MCType mc>
75-
void init_debug(std::string folderName) // o2-linter: disable=name/function-variable
75+
void initDebug(std::string folderName) // o2-linter: disable=name/function-variable
7676
{
7777
using namespace o2::framework;
7878

@@ -137,7 +137,7 @@ class FemtoFlowParticleHisto
137137
/// \param tempFitVarpTAxis axis object for the pT axis in the pT vs. tempFitVar plots
138138
/// \param tempFitVarAxis axis object for the tempFitVar axis
139139
template <typename T>
140-
void init_MC(std::string folderName, std::string /*tempFitVarAxisTitle*/, T& tempFitVarpTAxis, T& tempFitVarAxis, bool isDebug) // o2-linter: disable=name/function-variable
140+
void initMC(std::string folderName, std::string /*tempFitVarAxisTitle*/, T& tempFitVarpTAxis, T& tempFitVarAxis, bool isDebug) // o2-linter: disable=name/function-variable
141141
{
142142
using namespace o2::framework;
143143

@@ -203,8 +203,8 @@ class FemtoFlowParticleHisto
203203
}
204204

205205
/// Templated function for the initialization of the QA histograms
206-
/// Always calls init_base to initialize the histograms with data/ Monte Carlo reconstructed
207-
/// In case of Monte Carlo, calls init_base again for Monte Carlo truth and the specialized function init_MC for additional Monte Carlo histogramms
206+
/// Always calls initBase to initialize the histograms with data/ Monte Carlo reconstructed
207+
/// In case of Monte Carlo, calls initBase again for Monte Carlo truth and the specialized function initMC for additional Monte Carlo histogramms
208208
/// \tparam T type of the axis binning
209209
/// \param registry Histogram registry to be passed
210210
/// \param tempFitVarpTBins binning of the pT axis in the pT vs. tempFitVar
@@ -248,14 +248,14 @@ class FemtoFlowParticleHisto
248248
// std::string folderName = (static_cast<std::string>(o2::aod::femtoflowparticle::ParticleTypeName[kParticleType]).c_str() + static_cast<std::string>(kFolderSuffix[kFolderSuffixType])).c_str();
249249
std::string folderName = flexibleFolder.value_or((static_cast<std::string>(o2::aod::femtoflowparticle::ParticleTypeName[kParticleType]) + static_cast<std::string>(kFolderSuffix[kFolderSuffixType])));
250250

251-
// Fill here the actual histogramms by calling init_base and init_MC
252-
init_base<o2::aod::femtoflow_mc_particle::MCType::kRecon>(folderName, tempFitVarAxisTitle, tempFitVarpTAxis, tempFitVarAxis);
251+
// Fill here the actual histogramms by calling initBase and initMC
252+
initBase<o2::aod::femtoflow_mc_particle::MCType::kRecon>(folderName, tempFitVarAxisTitle, tempFitVarpTAxis, tempFitVarAxis);
253253
if (isDebug) {
254-
init_debug<o2::aod::femtoflow_mc_particle::MCType::kRecon>(folderName);
254+
initDebug<o2::aod::femtoflow_mc_particle::MCType::kRecon>(folderName);
255255
}
256256
if (isMC) {
257-
init_base<o2::aod::femtoflow_mc_particle::MCType::kTruth>(folderName, tempFitVarAxisTitle, tempFitVarpTAxis, tempFitVarAxis);
258-
init_MC(folderName, tempFitVarAxisTitle, tempFitVarpTAxis, tempFitVarAxis, isDebug);
257+
initBase<o2::aod::femtoflow_mc_particle::MCType::kTruth>(folderName, tempFitVarAxisTitle, tempFitVarpTAxis, tempFitVarAxis);
258+
initMC(folderName, tempFitVarAxisTitle, tempFitVarpTAxis, tempFitVarAxis, isDebug);
259259
}
260260
}
261261
}
@@ -265,7 +265,7 @@ class FemtoFlowParticleHisto
265265
/// \tparam T Data type of the particle
266266
/// \param part Particle
267267
template <o2::aod::femtoflow_mc_particle::MCType mc, typename T, typename H>
268-
void fillQA_base(T const& part, H const& histFolder) // o2-linter: disable=name/function-variable
268+
void fillQABase(T const& part, H const& histFolder) // o2-linter: disable=name/function-variable
269269
{
270270
using namespace o2::framework;
271271

@@ -282,7 +282,7 @@ class FemtoFlowParticleHisto
282282
}
283283

284284
template <o2::aod::femtoflow_mc_particle::MCType mc, typename T, typename H>
285-
void fillQA_debug(T const& part, H const& histFolder) // o2-linter: disable=name/function-variable
285+
void fillQADebug(T const& part, H const& histFolder) // o2-linter: disable=name/function-variable
286286
{
287287
using namespace o2::framework;
288288

@@ -347,7 +347,7 @@ class FemtoFlowParticleHisto
347347
/// \param mctruthorigin Origin of the associated mc Truth particle
348348
/// \param pdgcode PDG of the associated mc Truth particle associated to the reconstructed particle part
349349
template <bool isDebug, typename T, typename H>
350-
void fillQA_MC(T const& part, int mctruthorigin, int pdgcode, H const& histFolder) // o2-linter: disable=name/function-variable
350+
void fillQAMC(T const& part, int mctruthorigin, int pdgcode, H const& histFolder) // o2-linter: disable=name/function-variable
351351
{
352352
using namespace o2::framework;
353353

@@ -363,35 +363,35 @@ class FemtoFlowParticleHisto
363363
if constexpr (isDebug) {
364364
switch (mctruthorigin) {
365365
case (o2::aod::femtoflow_mc_particle::kPrimary):
366-
// mHistogramRegistry->fill(histFolder + HIST("_MC/Debug/hPDGmother_Primary"), part.fdMCParticle().motherPDG());
366+
// mHistogramRegistry->fill(histFolder + HIST("_MC/Debug/hPDGmother_Primary"), part.fDMCParticle().motherPDG());
367367
mHistogramRegistry->fill(histFolder + HIST("_MC/hDCAxy_Primary"), part.pt(), part.tempFitVar());
368368
break;
369369
case (o2::aod::femtoflow_mc_particle::kDaughter):
370-
// mHistogramRegistry->fill(histFolder + HIST("_MC/Debug/hPDGmother_Daughter"), part.fdMCParticle().motherPDG());
370+
// mHistogramRegistry->fill(histFolder + HIST("_MC/Debug/hPDGmother_Daughter"), part.fDMCParticle().motherPDG());
371371
mHistogramRegistry->fill(histFolder + HIST("_MC/hDCAxy_Daughter"), part.pt(), part.tempFitVar());
372372
break;
373373
case (o2::aod::femtoflow_mc_particle::kMaterial):
374-
// mHistogramRegistry->fill(histFolder + HIST("_MC/Debug/hPDGmother_Material"), part.fdMCParticle().motherPDG());
374+
// mHistogramRegistry->fill(histFolder + HIST("_MC/Debug/hPDGmother_Material"), part.fDMCParticle().motherPDG());
375375
mHistogramRegistry->fill(histFolder + HIST("_MC/hDCAxy_Material"), part.pt(), part.tempFitVar());
376376
break;
377377
case (o2::aod::femtoflow_mc_particle::kWrongCollision):
378-
// mHistogramRegistry->fill(histFolder + HIST("_MC/Debug/hPDGmother_WrongCollision"), part.fdMCParticle().motherPDG());
378+
// mHistogramRegistry->fill(histFolder + HIST("_MC/Debug/hPDGmother_WrongCollision"), part.fDMCParticle().motherPDG());
379379
mHistogramRegistry->fill(histFolder + HIST("_MC/hDCAxy_WrongCollision"), part.pt(), part.tempFitVar());
380380
break;
381381
case (o2::aod::femtoflow_mc_particle::kFake):
382-
// mHistogramRegistry->fill(histFolder + HIST("_MC/Debug/hPDGmother_Fake"), part.fdMCParticle().motherPDG());
382+
// mHistogramRegistry->fill(histFolder + HIST("_MC/Debug/hPDGmother_Fake"), part.fDMCParticle().motherPDG());
383383
mHistogramRegistry->fill(histFolder + HIST("_MC/hDCAxy_Fake"), part.pt(), part.tempFitVar());
384384
break;
385385
case (o2::aod::femtoflow_mc_particle::kDaughterLambda):
386-
// mHistogramRegistry->fill(histFolder + HIST("_MC/Debug/hPDGmother_DaughterLambda"), part.fdMCParticle().motherPDG());
386+
// mHistogramRegistry->fill(histFolder + HIST("_MC/Debug/hPDGmother_DaughterLambda"), part.fDMCParticle().motherPDG());
387387
mHistogramRegistry->fill(histFolder + HIST("_MC/hDCAxy_DaughterLambda"), part.pt(), part.tempFitVar());
388388
break;
389389
case (o2::aod::femtoflow_mc_particle::kDaughterSigmaplus):
390-
// mHistogramRegistry->fill(histFolder + HIST("_MC/Debug/hPDGmother_DaughterSigmaplus"), part.fdMCParticle().motherPDG());
390+
// mHistogramRegistry->fill(histFolder + HIST("_MC/Debug/hPDGmother_DaughterSigmaplus"), part.fDMCParticle().motherPDG());
391391
mHistogramRegistry->fill(histFolder + HIST("_MC/hDCAxy_DaughterSigmaplus"), part.pt(), part.tempFitVar());
392392
break;
393393
case (o2::aod::femtoflow_mc_particle::kElse):
394-
// mHistogramRegistry->fill(histFolder + HIST("_MC/Debug/hPDGmother_Else"), part.fdMCParticle().motherPDG());
394+
// mHistogramRegistry->fill(histFolder + HIST("_MC/Debug/hPDGmother_Else"), part.fDMCParticle().motherPDG());
395395
mHistogramRegistry->fill(histFolder + HIST("_MC/hDCAxy_Else"), part.pt(), part.tempFitVar());
396396
break;
397397
default:
@@ -445,33 +445,33 @@ class FemtoFlowParticleHisto
445445
}
446446

447447
template <typename T, typename H>
448-
void fillQA_MC_MisIden(T const& part, int pdgcode, int confPDG, H const& histFolder) // o2-linter: disable=name/function-variable
448+
void fillQAMCMisIden(T const& part, int pdgcode, int confPDG, H const& histFolder) // o2-linter: disable=name/function-variable
449449
{
450450
using namespace o2::framework;
451451

452452
if (mHistogramRegistry) {
453453
if constexpr (kParticleType == o2::aod::femtoflowparticle::ParticleType::kTrack) {
454454
if (confPDG == mConfPDGCodePart[0]) {
455-
binPDG = 0;
455+
binPart = 0;
456456
} else if (confPDG == mConfPDGCodePart[1]) {
457-
binPDG = 1;
457+
binPart = 1;
458458
} else if (confPDG == mConfPDGCodePart[2]) {
459-
binPDG = 2;
459+
binPart = 2;
460460
} else {
461-
binPDG = 3;
461+
binPart = 3;
462462
}
463463
if (std::abs(pdgcode) == PDG_t::kPiPlus) {
464464
mHistogramRegistry->fill(histFolder + HIST("_MC/hMisidentification"),
465-
binPDG, 0, part.pt());
465+
binPart, 0, part.pt());
466466
} else if (std::abs(pdgcode) == PDG_t::kKPlus) {
467467
mHistogramRegistry->fill(histFolder + HIST("_MC/hMisidentification"),
468-
binPDG, 1, part.pt());
468+
binPart, 1, part.pt());
469469
} else if (std::abs(pdgcode) == PDG_t::kProton) {
470470
mHistogramRegistry->fill(histFolder + HIST("_MC/hMisidentification"),
471-
binPDG, 2, part.pt());
471+
binPart, 2, part.pt());
472472
} else {
473473
mHistogramRegistry->fill(histFolder + HIST("_MC/hMisidentification"),
474-
binPDG, 3, part.pt());
474+
binPart, 3, part.pt());
475475
}
476476
}
477477
} else {
@@ -480,8 +480,8 @@ class FemtoFlowParticleHisto
480480
}
481481

482482
/// Templated function to fill particle histograms for data/ Monte Carlo reconstructed and Monte Carlo truth
483-
/// Always calls fillQA_base fill histogramms with data/ Monte Carlo reconstructed
484-
/// In case of Monte Carlo, calls fillQA_base with Monte Carlo truth info and specialized function fillQA_MC for additional histogramms
483+
/// Always calls fillQABase fill histogramms with data/ Monte Carlo reconstructed
484+
/// In case of Monte Carlo, calls fillQABase with Monte Carlo truth info and specialized function fillQAMC for additional histogramms
485485
/// \tparam T particle type
486486
/// \tparam isMC fills the additional histograms for Monte Carlo truth
487487
/// \param part particle for which the histograms should be filled
@@ -500,14 +500,14 @@ class FemtoFlowParticleHisto
500500

501501
std::string tempFitVarName;
502502
if (mHistogramRegistry) {
503-
fillQA_base<o2::aod::femtoflow_mc_particle::MCType::kRecon>(part, histFolder);
503+
fillQABase<o2::aod::femtoflow_mc_particle::MCType::kRecon>(part, histFolder);
504504
if constexpr (isDebug) {
505-
fillQA_debug<o2::aod::femtoflow_mc_particle::MCType::kRecon>(part, histFolder);
505+
fillQADebug<o2::aod::femtoflow_mc_particle::MCType::kRecon>(part, histFolder);
506506
}
507507
if constexpr (isMC) {
508-
if (part.has_fdMCParticle()) {
509-
fillQA_base<o2::aod::femtoflow_mc_particle::MCType::kTruth>(part.fdMCParticle(), histFolder);
510-
fillQA_MC<isDebug>(part, (part.fdMCParticle()).partOriginMCTruth(), (part.fdMCParticle()).pdgMCTruth(), histFolder);
508+
if (part.has_fDMCParticle()) {
509+
fillQABase<o2::aod::femtoflow_mc_particle::MCType::kTruth>(part.fDMCParticle(), histFolder);
510+
fillQAMC<isDebug>(part, (part.fDMCParticle()).partOriginMCTruth(), (part.fDMCParticle()).pdgMCTruth(), histFolder);
511511
} else {
512512
mHistogramRegistry->fill(histFolder + HIST("_MC/hNoMCtruthCounter"), 0);
513513
}
@@ -516,8 +516,8 @@ class FemtoFlowParticleHisto
516516
}
517517

518518
/// Templated function to fill particle histograms for data/ Monte Carlo reconstructed and Monte Carlo truth
519-
/// Always calls fillQA_base fill histogramms with data/ Monte Carlo reconstructed
520-
/// In case of Monte Carlo, calls fillQA_base with Monte Carlo truth info and specialized function fillQA_MC for additional histogramms
519+
/// Always calls fillQABase fill histogramms with data/ Monte Carlo reconstructed
520+
/// In case of Monte Carlo, calls fillQABase with Monte Carlo truth info and specialized function fillQAMC for additional histogramms
521521
/// \tparam T particle type
522522
/// \tparam isMC fills the additional histograms for Monte Carlo truth
523523
/// \param part particle for which the histograms should be filled
@@ -537,8 +537,8 @@ class FemtoFlowParticleHisto
537537
std::string tempFitVarName;
538538
if (mHistogramRegistry) {
539539
if constexpr (isMC) {
540-
if (part.has_fdMCParticle()) {
541-
fillQA_MC_MisIden(part, (part.fdMCParticle()).pdgMCTruth(), confPDG, histFolder);
540+
if (part.has_fDMCParticle()) {
541+
fillQAMCMisIden(part, (part.fDMCParticle()).pdgMCTruth(), confPDG, histFolder);
542542
}
543543
}
544544
}
@@ -551,7 +551,7 @@ class FemtoFlowParticleHisto
551551
static constexpr std::string_view kFolderSuffix[5] = {"_debug", "_one", "_two", "_pos", "_neg"}; ///< Suffix for the folder name in case of analyses of pairs of the same kind (T-T, V-V, C-C) // o2-linter: disable=name/constexpr-constant
552552
int mConfPDGCodePart[4] = {211, 321, 2212, 9999}; ///< PDG code as per analysis
553553
int mPDG = 0; ///< PDG code of the selected particle
554-
int binPDG = 0;
554+
int binPart = 0;
555555
};
556556
} // namespace o2::analysis::femto_flow
557557

PWGCF/Femto/Core/FemtoFlowSelection.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,20 +61,20 @@ class FemtoFlowSelection
6161

6262
/// Get the value used for the selection
6363
/// \return Value used for the selection
64-
selValDataType getSelectionValue() { return mSelVal; }
64+
selValDataType getSelectionValue() const { return mSelVal; }
6565

6666
/// Get the variable used for the selection
6767
/// \return variable used for the selection
68-
selVariableDataType getSelectionVariable() { return mSelVar; }
68+
selVariableDataType getSelectionVariable() const { return mSelVar; }
6969

7070
/// Get the type of selection to be employed
7171
/// \return Type of selection to be employed
72-
femto_flow_selection::SelectionType getSelectionType() { return mSelType; }
72+
femto_flow_selection::SelectionType getSelectionType() const { return mSelType; }
7373

7474
/// Check whether the selection is fulfilled or not
7575
/// \param observable Value of the variable to be checked
7676
/// \return Whether the selection is fulfilled or not
77-
bool isSelected(selValDataType observable)
77+
bool isSelected(selValDataType observable) const
7878
{
7979
switch (mSelType) {
8080
case (femto_flow_selection::SelectionType::kUpperLimit):
@@ -101,7 +101,7 @@ class FemtoFlowSelection
101101
/// \param cutContainer Bit-wise container for the systematic variations
102102
/// \param counter Position in the bit-wise container for the systematic variations to be modified
103103
template <typename T>
104-
void checkSelectionSetBit(selValDataType observable, T& cutContainer, size_t& counter)
104+
void checkSelectionSetBit(selValDataType observable, T& cutContainer, size_t& counter) const
105105
{
106106
/// If the selection is fulfilled the bit at the specified position (counter) within the bit-wise container is set to 1
107107
if (isSelected(observable)) {
@@ -111,7 +111,7 @@ class FemtoFlowSelection
111111
}
112112

113113
template <typename T>
114-
void checkSelectionSetBitPID(selValDataType observable, T& cutContainer)
114+
void checkSelectionSetBitPID(selValDataType observable, T& cutContainer) const
115115
{
116116
/// If the selection is fulfilled the bit at the specified position (counter) within the bit-wise container is set to 1
117117
if (isSelected(observable)) {

0 commit comments

Comments
 (0)