-
Notifications
You must be signed in to change notification settings - Fork 628
[PWGCF] Identified BF Added purity histograms for genereated particles, added track time histograms #10890
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
[PWGCF] Please consider the following formatting changes to AliceO2Group#10890
[PWGCF] Please consider the following formatting changes to AliceO2Group#10890
|
I have fixed the code that is giving the "Magic Number" O2 Linter error, and when I run O2 Linter locally it doesn't find any issues, but here it does. |
Because your branch is outdated. |
[PWGCF] Please consider the following formatting changes to AliceO2Group#10890
|
|
||
| std::vector<int> recoIdMethods = {0, 1, 2}; // Reconstructed PID Methods, 0 is no PID, 1 is calculated PID, 2 is MC PID | ||
| std::vector<int> trackTypes = {0, 1, 2, 3}; | ||
| int two = 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is does not help to understand what is the meaning of the value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am doing a check using remainder in integer division of the particle ID value by 2. Even ID values are positive charged particles and odd ID values are negative charged particles. The error was specifically that I was doing the division by the integer 2 instead of a variable. I am unsure what I should name this variable to make it more descriptive as it is just the number 2 used for this check. Is there a standard naming convention for this situation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the point @vkucera wanted to make is, there is the same magic in using 0 than in using trackType[0]
Both have the same opacity when reading the code and are prone to errors, difficult to maintain and hard to evolve
What about, for example,
constexpr int kEvenOddBase = 2;
constexpr int kPositiveTrackId = 0;
constexpr int kNegativeTrackId = 1;
and then
if (pid % kEvenOddBase == kPositiveTrackId) {
.......
}
Have in mind that if the constexpr variables are defined in the scope of a struct they have to be declared as static
victor-gonzalez
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have a look at my comment for the future iterations
…s, added track time histograms (AliceO2Group#10890) Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
…s, added track time histograms (AliceO2Group#10890) Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
…s, added track time histograms (AliceO2Group#10890) Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
…s, added track time histograms (AliceO2Group#10890) Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
No description provided.