Skip to content

[PWGHF] Adding D0/Lc analysis task - #17808

Open
laszlogyulai wants to merge 14 commits into
AliceO2Group:masterfrom
laszlogyulai:master
Open

[PWGHF] Adding D0/Lc analysis task#17808
laszlogyulai wants to merge 14 commits into
AliceO2Group:masterfrom
laszlogyulai:master

Conversation

@laszlogyulai

Copy link
Copy Markdown

Adding a new analysis task for calculating the D0/Lambda_c yield ratio as a function of flattenicity

@github-actions github-actions Bot added the pwghf PWG-HF label Sep 7, 2026
@github-actions github-actions Bot changed the title Adding D0/Lc analysis task [PWGHF] Adding D0/Lc analysis task Sep 7, 2026
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

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

@laszlogyulai

Copy link
Copy Markdown
Author

Dear codeowners,

Is it possible to overcome the "magic number" errors in the O2 linter / O2 linter (pull_request_target) check? In my opinion it would unnecessarily complicate the existing code. You can see an example of such a solution in the PWGLF/Tasks/GlobalEventProperties/flattenicityPikp.cxx file (lines 1814-1908)

@vkucera

vkucera commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

Dear codeowners,

Is it possible to overcome the "magic number" errors in the O2 linter / O2 linter (pull_request_target) check? In my opinion it would unnecessarily complicate the existing code. You can see an example of such a solution in the PWGLF/Tasks/GlobalEventProperties/flattenicityPikp.cxx file (lines 1814-1908)

The way to "overcome" it is to write it in a better way. From what I can see, you map some number to other numbers. So how about using a map or an array, for example?

Please consider the following formatting changes to AliceO2Group#17808
@laszlogyulai

Copy link
Copy Markdown
Author

Dear codeowners,
Is it possible to overcome the "magic number" errors in the O2 linter / O2 linter (pull_request_target) check? In my opinion it would unnecessarily complicate the existing code. You can see an example of such a solution in the PWGLF/Tasks/GlobalEventProperties/flattenicityPikp.cxx file (lines 1814-1908)

The way to "overcome" it is to write it in a better way. From what I can see, you map some number to other numbers. So how about using a map or an array, for example?

Dear Vit,

Thank you for the nice and easy solution to the issue. Everything should be fine now.

@vkucera

vkucera commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

Dear codeowners,
Is it possible to overcome the "magic number" errors in the O2 linter / O2 linter (pull_request_target) check? In my opinion it would unnecessarily complicate the existing code. You can see an example of such a solution in the PWGLF/Tasks/GlobalEventProperties/flattenicityPikp.cxx file (lines 1814-1908)

The way to "overcome" it is to write it in a better way. From what I can see, you map some number to other numbers. So how about using a map or an array, for example?

Dear Vit,

Thank you for the nice and easy solution to the issue. Everything should be fine now.

Thanks @laszlogyulai for the implementation. It looks indeed much better now.

Comment on lines +65 to +66
std::array<float, nCellsFV0> rhoLatticeFV0{0};
std::array<float, nCellsFV0> fv0AmplitudeWoCalib{0};

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.

Suggested change
std::array<float, nCellsFV0> rhoLatticeFV0{0};
std::array<float, nCellsFV0> fv0AmplitudeWoCalib{0};
std::array<float, nCellsFV0> rhoLatticeFV0{};
std::array<float, nCellsFV0> fv0AmplitudeWoCalib{};

static const int CinnerFV0 = 32;
std::array<float, nCellsFV0> rhoLatticeFV0{0};
std::array<float, nCellsFV0> fv0AmplitudeWoCalib{0};
float calib[48] = {1.01697, 1.122, 1.03854, 1.108, 1.11634, 1.14971, 1.19321, 1.06866, 0.954675, 0.952695, 0.969853, 0.957557, 0.989784, 1.01549, 1.02182, 0.976005, 1.01865, 1.06871, 1.06264, 1.02969, 1.07378, 1.06622, 1.15057, 1.0433, 0.83654, 0.847178, 0.890027, 0.920814, 0.888271, 1.04662, 0.8869, 0.856348, 0.863181, 0.906312, 0.902166, 1.00122, 1.03303, 0.887866, 0.892437, 0.906278, 0.884976, 0.864251, 0.917221, 1.10618, 1.04028, 0.893184, 0.915734, 0.892676};

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.

Why is this not a std::array?

@vkucera

vkucera commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

Since you are adding a new file, please fix also the warnings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pwghf PWG-HF

Development

Successfully merging this pull request may close these issues.

3 participants