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
4 changes: 4 additions & 0 deletions PWGLF/Utils/inelGt.h
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 PWGLF/Utils/inelGt.h

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 @@ -14,11 +14,15 @@
/// \since 07/05/2024
/// \brief Utilities for counting charged particles in |eta| region and define the INEL > N selection in the MC at the generated level
/// Based on cascqaanalysis.cxx
///

Check failure on line 17 in PWGLF/Utils/inelGt.h

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \author is missing, incorrect or misplaced.

#ifndef PWGLF_UTILS_INELGT_H_
#define PWGLF_UTILS_INELGT_H_

#include "Framework/O2DatabasePDGPlugin.h"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

O2DatabasePDGPlugin is not used.


#include "TParticlePDG.h"
Comment on lines +22 to +24
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please include external headers with angled brackets.


#include <vector>

namespace o2
Expand All @@ -37,7 +41,7 @@
{
// INEL > N (at least N+1 charged particles in |eta| < 1.0)
EtaCharge etaCharge;
std::vector<EtaCharge> ParticlesEtaAndCharge(particles.size());

Check failure on line 44 in PWGLF/Utils/inelGt.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
unsigned int nParticles = 0;
for (const auto& particle : particles) {
if (particle.isPhysicalPrimary() == 0) {
Expand Down Expand Up @@ -65,7 +69,7 @@
ParticlesEtaAndCharge.resize(nParticles);

auto etaChargeConditionFunc = [](EtaCharge elem) {
return ((TMath::Abs(elem.eta) < 1.0) && (TMath::Abs(elem.charge) > 0.001));

Check failure on line 72 in PWGLF/Utils/inelGt.h

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.

Check failure on line 72 in PWGLF/Utils/inelGt.h

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
};

if (std::count_if(ParticlesEtaAndCharge.begin(), ParticlesEtaAndCharge.end(), etaChargeConditionFunc) > nChToSatisfySelection) {
Expand Down Expand Up @@ -109,7 +113,7 @@
continue;
}
// is charged
if (abs(p->Charge()) == 0) {

Check failure on line 116 in PWGLF/Utils/inelGt.h

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
continue;
}
// in acceptance
Expand Down Expand Up @@ -137,10 +141,10 @@
}
// is neutral
if (requireNeutral) {
if (std::abs(p->Charge()) > 1e-3)

Check failure on line 144 in PWGLF/Utils/inelGt.h

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;
} else {
if (std::abs(p->Charge()) <= 1e-3)

Check failure on line 147 in PWGLF/Utils/inelGt.h

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;
}
// in acceptance
Expand Down
Loading