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
7 changes: 3 additions & 4 deletions PWGLF/Tasks/Nuspex/identifiedraa.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
histos.add("CentralityAfterEvSel", "CentralityAfterEvSel", kTH1D, {axisCent});
histos.add("VtxZ", "VtxZ", kTH1D, {{60, -30, 30}});
histos.add("TrackCut", "TrackCut", kTH1D, {{20, -0.5, 19.5}});
for (int i = 0; i < 6; i++) {

Check failure on line 96 in PWGLF/Tasks/Nuspex/identifiedraa.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.
histos.add(pt_num[i].data(), "Efficiency Numerator", kTH1D, {axisPt});
histos.add(pt_den[i].data(), "Efficiency Denominator", kTH1D, {axisPt});
histos.add(matching_num[i].data(), "Matching Numerator", kTH1D, {axisPt});
Expand All @@ -115,7 +115,7 @@
template <std::size_t i, typename T1, typename T2>
void fillHistograms_MC(T1 const& tracks, T2 const& mcParticles)
{
for (auto& track : tracks) {

Check failure on line 118 in PWGLF/Tasks/Nuspex/identifiedraa.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.
const auto mcParticle = track.template mcParticle_as<aod::McParticles_000>();
for (int j = 0; j < 16; j++) {
if (globalTrackswoPrim.IsSelected(track, static_cast<TrackSelection::TrackCuts>(j))) {
Expand All @@ -130,13 +130,13 @@
}
float mass;
if ((i == 0) || (i == 1)) {
mass = 0.13957; // pion mass

Check failure on line 133 in PWGLF/Tasks/Nuspex/identifiedraa.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-mass]

Avoid hard-coded particle masses. Use o2::constants::physics::Mass... instead.
}
if ((i == 2) || (i == 3)) {
mass = 0.49367; // kaon mass

Check failure on line 136 in PWGLF/Tasks/Nuspex/identifiedraa.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-mass]

Avoid hard-coded particle masses. Use o2::constants::physics::Mass... instead.
}
if ((i == 4) || (i == 5)) {
mass = 0.93827; // proton mass

Check failure on line 139 in PWGLF/Tasks/Nuspex/identifiedraa.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-mass]

Avoid hard-coded particle masses. Use o2::constants::physics::Mass... instead.
}
const float energy = std::sqrt(mass * mass + track.p() * track.p());
if (std::abs(0.5f * std::log((energy + track.pz()) / (energy - track.pz()))) > 0.5) {
Expand Down Expand Up @@ -184,7 +184,7 @@
}
}
}
for (auto& particle : mcParticles) {

Check failure on line 187 in PWGLF/Tasks/Nuspex/identifiedraa.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.
// if (std::abs(particle.eta()) > 0.8) {
// continue;
// }
Expand Down Expand Up @@ -222,7 +222,8 @@
template <std::size_t i, typename T>
void fillHistogramsData(T const& tracks)
{
static_assert(i < 6, "Index i out of bounds");
for (auto& track : tracks) {

Check failure on line 226 in PWGLF/Tasks/Nuspex/identifiedraa.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.
if (std::abs(track.eta()) > 0.8) {
continue;
}
Expand All @@ -235,13 +236,11 @@
continue;
}
}
float mass;
if constexpr ((i == 0) || (i == 1)) {
mass = 0.13957; // pion mass
} else if constexpr ((i == 2) || (i == 3)) {
float mass{0.13957};

Check failure on line 239 in PWGLF/Tasks/Nuspex/identifiedraa.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-mass]

Avoid hard-coded particle masses. Use o2::constants::physics::Mass... instead.
if constexpr ((i == 2) || (i == 3)) {
mass = 0.49367; // kaon mass

Check failure on line 241 in PWGLF/Tasks/Nuspex/identifiedraa.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-mass]

Avoid hard-coded particle masses. Use o2::constants::physics::Mass... instead.
} else if constexpr ((i == 4) || (i == 5)) {
mass = 0.93827; // proton mass

Check failure on line 243 in PWGLF/Tasks/Nuspex/identifiedraa.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-mass]

Avoid hard-coded particle masses. Use o2::constants::physics::Mass... instead.
}
const float energy = std::sqrt(mass * mass + track.p() * track.p());
if (std::abs(0.5f * std::log((energy + track.pz()) / (energy - track.pz()))) > 0.5) {
Expand Down
Loading