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
15 changes: 7 additions & 8 deletions PWGLF/Tasks/QC/mcParticlePrediction.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

// Particles
static const std::vector<std::string> parameterNames{"Enable"};
static constexpr int nParameters = 1;

Check failure on line 40 in PWGLF/Tasks/QC/mcParticlePrediction.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/constexpr-constant]

Use UpperCamelCase for names of constexpr constants. Names of special constants may be prefixed with "k".
static const int defaultParticles[PIDExtended::NIDsTot][nParameters]{{0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {1}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}};
bool enabledParticlesArray[PIDExtended::NIDsTot];

Expand All @@ -64,9 +64,9 @@
static constexpr estID V0C = 17; // (Run2)
static constexpr estID V0AC = 18; // (Run2 V0M)
static constexpr estID ImpactParameter = 19; // (Run2 V0M)
static constexpr estID nEstimators = 20;

Check failure on line 67 in PWGLF/Tasks/QC/mcParticlePrediction.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/constexpr-constant]

Use UpperCamelCase for names of constexpr constants. Names of special constants may be prefixed with "k".

static constexpr const char* estimatorNames[nEstimators] = {"FT0A",

Check failure on line 69 in PWGLF/Tasks/QC/mcParticlePrediction.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/constexpr-constant]

Use UpperCamelCase for names of constexpr constants. Names of special constants may be prefixed with "k".
"FT0C",
"FT0AC",
"FV0A",
Expand Down Expand Up @@ -127,11 +127,11 @@
std::array<std::shared_ptr<TH2>, Estimators::nEstimators> hestimatorsVsETA08;
std::array<std::shared_ptr<TH2>, Estimators::nEstimators> hestimatorsVsImpactParameter;
std::array<std::shared_ptr<TH2>, Estimators::nEstimators> hestimatorsRecoEvGenVsReco;
std::array<std::shared_ptr<TH2>, Estimators::nEstimators> hestimatorsRecoEvGenVsReco_BCMC;

Check failure on line 130 in PWGLF/Tasks/QC/mcParticlePrediction.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
std::array<std::shared_ptr<TH2>, Estimators::nEstimators> hestimatorsRecoEvGenVsRecoITS;
std::array<std::shared_ptr<TH2>, Estimators::nEstimators> hestimatorsRecoEvRecoVsITS;
std::array<std::shared_ptr<TH2>, Estimators::nEstimators> hestimatorsRecoEvRecoVsRecoITS;
std::array<std::shared_ptr<TH2>, Estimators::nEstimators> hestimatorsRecoEvRecoVsRecoITS_BCMC;

Check failure on line 134 in PWGLF/Tasks/QC/mcParticlePrediction.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
std::array<std::shared_ptr<TH2>, Estimators::nEstimators> hestimatorsRecoEvRecoVsFT0A;
std::array<std::shared_ptr<TH2>, Estimators::nEstimators> hestimatorsRecoEvRecoVsBCId;
std::array<std::shared_ptr<TH2>, Estimators::nEstimators> hestimatorsRecoEvVsBCId;
Expand All @@ -139,7 +139,7 @@
std::array<std::array<std::shared_ptr<TH2>, PIDExtended::NIDsTot>, Estimators::nEstimators> hpt;
std::array<std::array<std::shared_ptr<TH1>, PIDExtended::NIDsTot>, Estimators::nEstimators> hyield;

struct mcParticlePrediction {

Check failure on line 142 in PWGLF/Tasks/QC/mcParticlePrediction.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/struct]

Use UpperCamelCase for names of structs.

// Histograms
HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject};
Expand Down Expand Up @@ -265,8 +265,8 @@
if (!enabledEstimatorsArray[i]) {
continue;
}
AxisSpec axisThisEstimator = axisMultiplicity;
if(i == Estimators::ImpactParameter){
AxisSpec axisThisEstimator = axisMultiplicity;
if (i == Estimators::ImpactParameter) {
axisThisEstimator = axisImpactParameter;
}
const char* name = Estimators::estimatorNames[i];
Expand All @@ -277,8 +277,8 @@
auto hist = histos.add<TH2>(Form("%s%s", h.c_str(), name),
name,
kTH2D,
{isImpactParameterX?axisImpactParameter:axisMultiplicity,
isImpactParameterY?axisImpactParameter:axisMultiplicity});
{isImpactParameterX ? axisImpactParameter : axisMultiplicity,
isImpactParameterY ? axisImpactParameter : axisMultiplicity});
hist->GetXaxis()->SetTitle(Form("Multiplicity %s", name));
hist->GetYaxis()->SetTitle(Form("Multiplicity %s", ytitle));
return hist;
Expand All @@ -293,10 +293,9 @@
hestimatorsVsETA08[i] = make2DH("multiplicity/vsETA08/", Estimators::estimatorNames[Estimators::ETA08], (i == Estimators::ImpactParameter));
}
if (enableVsImpactParameterHistograms) {
hestimatorsVsImpactParameter[i] = make2DH("multiplicity/vsImpactParameter/", Estimators::estimatorNames[Estimators::ImpactParameter],(i == Estimators::ImpactParameter), true);
hestimatorsVsImpactParameter[i] = make2DH("multiplicity/vsImpactParameter/", Estimators::estimatorNames[Estimators::ImpactParameter], (i == Estimators::ImpactParameter), true);
}


hvertexPosZ[i] = histos.add<TH2>(Form("multiplicity/posZ/%s", name), name, kTH2D, {{200, -20, 20, "pos Z"}, axisThisEstimator});
hvertexPosZ[i]->GetYaxis()->SetTitle(Form("Multiplicity %s", name));

Expand Down Expand Up @@ -347,8 +346,8 @@
if (!enabledEstimatorsArray[j]) {
continue;
}
AxisSpec axisThisEstimator = axisMultiplicity;
if(j == Estimators::ImpactParameter){
AxisSpec axisThisEstimator = axisMultiplicity;
if (j == Estimators::ImpactParameter) {
axisThisEstimator = axisImpactParameter;
}
const char* name = Estimators::estimatorNames[j];
Expand Down Expand Up @@ -437,7 +436,7 @@
}

histos.fill(HIST("collisions/generated"), 1);
if (std::abs(mcCollision.posZ()) > 10.f) {

Check failure on line 439 in PWGLF/Tasks/QC/mcParticlePrediction.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.
return;
}
histos.fill(HIST("collisions/generated"), 2);
Expand Down Expand Up @@ -488,7 +487,7 @@
}
}

if (std::abs(particle.y()) > 0.5) {

Check failure on line 490 in PWGLF/Tasks/QC/mcParticlePrediction.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;
}

Expand Down Expand Up @@ -654,10 +653,10 @@
float nMultRecoMCBC[Estimators::nEstimators] = {0};
if (mcBC.has_ft0()) {
const auto& ft0 = mcBC.ft0();
for (auto amplitude : ft0.amplitudeA()) {

Check failure on line 656 in PWGLF/Tasks/QC/mcParticlePrediction.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.
nMultRecoMCBC[Estimators::FT0A] += amplitude;
}
for (auto amplitude : ft0.amplitudeC()) {

Check failure on line 659 in PWGLF/Tasks/QC/mcParticlePrediction.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.
nMultRecoMCBC[Estimators::FT0C] += amplitude;
}
nMultRecoMCBC[Estimators::FT0AC] = nMultRecoMCBC[Estimators::FT0A] + nMultRecoMCBC[Estimators::FT0C];
Expand Down
Loading