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
10 changes: 6 additions & 4 deletions ALICE3/Tasks/alice3-lutmaker.cxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.

Check failure on line 1 in ALICE3/Tasks/alice3-lutmaker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-task]

Specify task name only when it cannot be derived from the struct name. Only append to the default name.

Check failure on line 1 in ALICE3/Tasks/alice3-lutmaker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/file-cpp]

Use lowerCamelCase or UpperCamelCase for names of C++ files. See the O2 naming conventions for details.

Check failure on line 1 in ALICE3/Tasks/alice3-lutmaker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Provide mandatory file documentation.

Check failure on line 1 in ALICE3/Tasks/alice3-lutmaker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[o2-workflow-options]

Do not use workflow options to customise workflow topology composition in defineDataProcessing. Use process function switches or metadata instead.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand All @@ -11,7 +11,7 @@

/// \author Nicolo' Jacazio <nicolo.jacazio@cern.ch>, CERN
/// \brief Task to extract LUTs for the fast simulation from full simulation
/// \since 27/04/2021

Check failure on line 14 in ALICE3/Tasks/alice3-lutmaker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \file is missing, incorrect or misplaced.

// O2 includes
#include "Framework/AnalysisTask.h"
Expand All @@ -25,11 +25,11 @@
void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
{
std::vector<ConfigParamSpec> options{
{"lut-el", VariantType::Int, 1, {"LUT input for the Electron PDG code"}},
{"lut-mu", VariantType::Int, 1, {"LUT input for the Muon PDG code"}},
{"lut-el", VariantType::Int, 0, {"LUT input for the Electron PDG code"}},
{"lut-mu", VariantType::Int, 0, {"LUT input for the Muon PDG code"}},
{"lut-pi", VariantType::Int, 1, {"LUT input for the Pion PDG code"}},
{"lut-ka", VariantType::Int, 1, {"LUT input for the Kaon PDG code"}},
{"lut-pr", VariantType::Int, 1, {"LUT input for the Proton PDG code"}},
{"lut-ka", VariantType::Int, 0, {"LUT input for the Kaon PDG code"}},
{"lut-pr", VariantType::Int, 0, {"LUT input for the Proton PDG code"}},
{"lut-tr", VariantType::Int, 0, {"LUT input for the Triton PDG code"}},
{"lut-de", VariantType::Int, 0, {"LUT input for the Deuteron PDG code"}},
{"lut-he", VariantType::Int, 0, {"LUT input for the Helium3 PDG code"}}};
Expand All @@ -40,10 +40,10 @@

template <o2::track::pid_constants::ID particle>
struct Alice3LutMaker {
static constexpr int nSpecies = 8;

Check failure on line 43 in ALICE3/Tasks/alice3-lutmaker.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 int PDGs[nSpecies] = {kElectron, kMuonMinus, kPiPlus, kKPlus, kProton, 1000010020, 1000010030, 1000020030};
static_assert(particle < nSpecies && "Maximum of particles reached");
static constexpr int pdg = PDGs[particle];

Check failure on line 46 in ALICE3/Tasks/alice3-lutmaker.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".
Configurable<bool> addQA{"addQA", false, "Flag to use add QA plots to show the covariance matrix elements"};
Configurable<bool> selPrim{"selPrim", false, "If true selects primaries, if not select all particles"};

Expand All @@ -68,7 +68,7 @@
const TString commonTitle = Form(" PDG %i", pdg);
AxisSpec axisPt{ptBins, ptMin, ptMax, "#it{p}_{T} GeV/#it{c}"};
if (ptLog) {
if (axisPt.binEdges.size() > 2) {

Check failure on line 71 in ALICE3/Tasks/alice3-lutmaker.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.
LOG(fatal) << "Cannot make a variabled bin width axis logaritmic";
}
const double min = axisPt.binEdges[0];
Expand All @@ -78,7 +78,7 @@
const double width = (max - min) / nbins;
for (int bin = 0; bin < nbins + 1; bin++) {
float val = min + (bin + 0.5) * width;
axisPt.binEdges.push_back(pow(10., val));

Check failure on line 81 in ALICE3/Tasks/alice3-lutmaker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
}
axisPt.nBins = std::nullopt;
}
Expand Down Expand Up @@ -153,6 +153,7 @@
histos.add("QA/CovMat_sigmaSnp", "sigmaSnp" + commonTitle, kTH3F, {axisPt, axisEta, axissigmaSnp});
histos.add("QA/CovMat_sigmaTgl", "sigmaTgl" + commonTitle, kTH3F, {axisPt, axisEta, axissigmaTgl});
histos.add("QA/CovMat_sigma1Pt", "sigma1Pt" + commonTitle, kTH3F, {axisPt, axisEta, axissigma1Pt});
histos.add("QA/sigma1Pt", "sigma1Pt" + commonTitle, kTH3F, {axisPt, axisEta, axissigma1Pt});
histos.add("QA/CovMat_rhoZY", "rhoZY" + commonTitle, kTH3F, {axisPt, axisEta, axisrhoZY});
histos.add("QA/CovMat_rhoSnpY", "rhoSnpY" + commonTitle, kTH3F, {axisPt, axisEta, axisrhoSnpY});
histos.add("QA/CovMat_rhoSnpZ", "rhoSnpZ" + commonTitle, kTH3F, {axisPt, axisEta, axisrhoSnpZ});
Expand Down Expand Up @@ -262,6 +263,7 @@
histos.fill(HIST("QA/CovMat_sigmaSnp"), mcParticle.pt(), mcParticle.eta(), track.sigmaSnp());
histos.fill(HIST("QA/CovMat_sigmaTgl"), mcParticle.pt(), mcParticle.eta(), track.sigmaTgl());
histos.fill(HIST("QA/CovMat_sigma1Pt"), mcParticle.pt(), mcParticle.eta(), track.sigma1Pt());
histos.fill(HIST("QA/sigma1Pt"), mcParticle.pt(), mcParticle.eta(), std::abs(track.signed1Pt()) - 1. / mcParticle.pt());
histos.fill(HIST("QA/CovMat_rhoZY"), mcParticle.pt(), mcParticle.eta(), track.rhoZY());
histos.fill(HIST("QA/CovMat_rhoSnpY"), mcParticle.pt(), mcParticle.eta(), track.rhoSnpY());
histos.fill(HIST("QA/CovMat_rhoSnpZ"), mcParticle.pt(), mcParticle.eta(), track.rhoSnpZ());
Expand Down Expand Up @@ -312,7 +314,7 @@
{
WorkflowSpec w;
if (cfgc.options().get<int>("lut-el")) {
w.push_back(adaptAnalysisTask<Alice3LutMaker<o2::track::PID::Electron>>(cfgc, TaskName{"alice3-lutmaker-electron"}));

Check failure on line 317 in ALICE3/Tasks/alice3-lutmaker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-task]

Specified task name alice3-lutmaker-electron produces device name alice3-lutmaker-electron which does not match the device name alice3-lut-maker from the struct name Alice3LutMaker. (Matching struct name Alice3LutmakerElectron)
}
if (cfgc.options().get<int>("lut-mu")) {
w.push_back(adaptAnalysisTask<Alice3LutMaker<o2::track::PID::Muon>>(cfgc, TaskName{"alice3-lutmaker-muon"}));
Expand Down
Loading