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
16 changes: 8 additions & 8 deletions PWGEM/Dilepton/Tasks/mcParticlePredictionsOTF.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 PWGEM/Dilepton/Tasks/mcParticlePredictionsOTF.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/workflow-file]

Name of a workflow file must match the name of the main struct in it (without the PWG prefix). (Class implementation files should be in "Core" directories.)

Check failure on line 1 in PWGEM/Dilepton/Tasks/mcParticlePredictionsOTF.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Provide mandatory file documentation.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand All @@ -13,7 +13,7 @@
/// \file mcParticlePrediction.cxx
/// \author Sebastian Scheid, s.scheid@cern.ch
/// \brief Task to build the predictions from the models based on the generated particles
///

Check failure on line 16 in PWGEM/Dilepton/Tasks/mcParticlePredictionsOTF.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \file is missing, incorrect or misplaced.

#include "Framework/AnalysisTask.h"
#include "Framework/HistogramRegistry.h"
Expand All @@ -22,14 +22,14 @@
using namespace o2;
using namespace o2::framework;

struct otfParticlePrediction {

Check failure on line 25 in PWGEM/Dilepton/Tasks/mcParticlePredictionsOTF.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/struct]

Use UpperCamelCase for names of structs.
// histogram registry
HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject};
// define configurables
ConfigurableAxis binsEta{"binsEta", {100, -5, 5}, "Binning of the Eta axis"};
ConfigurableAxis binsPt{"binsPt", {100, 0, 10}, "Binning of the Pt axis"};

Configurable<float> maxEtaParticle{"maxEtaParticle", 5.f, "Max eta of particles considered"};
Configurable<float> maxYParticle{"maxYParticle", 5.f, "Max rapidity of particles considered"};

// init function
void init(InitContext&)
Expand All @@ -55,36 +55,36 @@

for (const auto& particle : mcParticles) {
auto pdg = std::abs(particle.pdgCode());
if (std::abs(particle.eta()) > maxEtaParticle) {
if (std::abs(particle.y()) > maxYParticle) {
continue;
}
// if (!(particle.isPhysicalPrimary())) {
// continue;
// }
if (pdg < 100) {

Check failure on line 64 in PWGEM/Dilepton/Tasks/mcParticlePredictionsOTF.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;
}
if (pdg > 1000) {

Check failure on line 67 in PWGEM/Dilepton/Tasks/mcParticlePredictionsOTF.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;
}
switch (pdg) {
case 111:
histos.fill(HIST("particles/generated/pi0"), particle.pt(), particle.eta());
histos.fill(HIST("particles/generated/pi0"), particle.pt(), particle.y());
break;
case 221:
histos.fill(HIST("particles/generated/eta"), particle.pt(), particle.eta());
histos.fill(HIST("particles/generated/eta"), particle.pt(), particle.y());
break;
case 331:
histos.fill(HIST("particles/generated/etaP"), particle.pt(), particle.eta());
histos.fill(HIST("particles/generated/etaP"), particle.pt(), particle.y());
break;
case 223:
histos.fill(HIST("particles/generated/omega"), particle.pt(), particle.eta());
histos.fill(HIST("particles/generated/omega"), particle.pt(), particle.y());
break;
case 113:
histos.fill(HIST("particles/generated/rho"), particle.pt(), particle.eta());
histos.fill(HIST("particles/generated/rho"), particle.pt(), particle.y());
break;
case 333:
histos.fill(HIST("particles/generated/phi"), particle.pt(), particle.eta());
histos.fill(HIST("particles/generated/phi"), particle.pt(), particle.y());
break;
default:
break;
Expand Down
Loading