Skip to content

[PWGLF] fixed all O2 linter warnings and added eventcorrection histograms - #17498

Merged
mpuccio merged 1 commit into
AliceO2Group:masterfrom
bhattdurgesh921-sys:master
Aug 18, 2026
Merged

[PWGLF] fixed all O2 linter warnings and added eventcorrection histograms#17498
mpuccio merged 1 commit into
AliceO2Group:masterfrom
bhattdurgesh921-sys:master

Conversation

@bhattdurgesh921-sys

Copy link
Copy Markdown
Contributor

Dear @vkucera @dmallick2 ,
n this PR, we have addressed and fixed all the O2 linter warnings. We have also added the histograms required for the event-loss calculation.

Thank you for your review and feedback.

@github-actions

Copy link
Copy Markdown

O2 linter results: ❌ 0 errors, ⚠️ 0 warnings, 🔕 0 disabled

@github-actions github-actions Bot changed the title fixed all O2 linter warnings and added eventcorrection histograms [PWGLF] fixed all O2 linter warnings and added eventcorrection histograms Aug 18, 2026
@mpuccio
mpuccio enabled auto-merge (squash) August 18, 2026 13:03

@vkucera vkucera left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hi @bhattdurgesh921-sys , thanks a lot for the fixes. Please see my suggestions.

Comment on lines -63 to +65
constexpr float massProton = o2::constants::physics::MassProton;
constexpr float massPion = o2::constants::physics::MassPionCharged;
constexpr float minAbsCharge = 1e-3f;
constexpr float MassProton = o2::constants::physics::MassProton;
constexpr float MassPion = o2::constants::physics::MassPionCharged;
constexpr float MinAbsCharge = 1e-3f;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The constants defined here are not needed. You can use the existing ones directly.

constexpr float MassProton = o2::constants::physics::MassProton;
constexpr float MassPion = o2::constants::physics::MassPionCharged;
constexpr float MinAbsCharge = 1e-3f;
const std::array<float, 2> kProtonPionMasses{MassProton, MassPion};

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The k prefix is used only in ROOT, not in O2.

Suggested change
const std::array<float, 2> kProtonPionMasses{MassProton, MassPion};
const std::array<float, 2> protonPionMasses{MassProton, MassPion};

Comment on lines -1639 to +1650
const bool hasAcceptedReco = acceptedMcCollisionIds.contains(mcCollision.globalIndex());
const auto itCent = acceptedMcCollisionRecoCent.find(mcCollision.globalIndex());
const bool hasAcceptedReco = (itCent != acceptedMcCollisionRecoCent.end());

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This looks like a regression. unordered_map does have contains.

@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/code-check for 93e65bb at 2026-08-18 18:37:

## sw/BUILD/O2Physics-code-check-latest/log
--
========== List of issues found ==========
++ echo 'Found 1 errors and 0 warnings.'
Found 1 errors and 0 warnings.
++ [[ 1 -gt 0 ]]
++ cat /sw/BUILD/e77050ea2ac7906b5cb657a24512f3c89004dd38/O2Physics-code-check/errors.txt
PWGLF/Tasks/Resonances/deltaAnalysis.cxx:53:1: error: included header unordered_set is not used directly [misc-include-cleaner,-warnings-as-errors]
++ [[ 0 -gt 0 ]]
++ [[ 1 -gt 0 ]]
++ exit 1
--

Full log here.

@mpuccio
mpuccio merged commit 7363989 into AliceO2Group:master Aug 18, 2026
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

4 participants