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
3 changes: 2 additions & 1 deletion 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,7 +14,7 @@
/// \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_
Expand All @@ -23,6 +23,7 @@

#include "TParticlePDG.h"

#include <cmath>
#include <vector>

namespace o2
Expand All @@ -41,7 +42,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 45 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 @@ -69,7 +70,7 @@
ParticlesEtaAndCharge.resize(nParticles);

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

Check failure on line 73 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.
};

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

Check failure on line 117 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 @@ -141,10 +142,10 @@
}
// is neutral
if (requireNeutral) {
if (std::abs(p->Charge()) > 1e-3)

Check failure on line 145 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 148 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