-
Notifications
You must be signed in to change notification settings - Fork 613
[PWGCF] Fix bug in FV0 eta calculation #12423
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
1) Fix the initialisation of `fv0det` geometry pointer 2) Add `addHistos` function instead of using `addClone`
|
O2 linter results: ❌ 0 errors, |
|
|
||
| static constexpr std::string_view kCorrType[] = {"Ft0aGlobal/", "Ft0cGlobal/", "Fv0Global/", "MftGlobal/", "Fv0Mft/"}; | ||
| static constexpr std::string_view kEvntType[] = {"SE/", "ME/"}; | ||
|
|
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.
Thanks for considering my suggestions!
I have an additional one for security and error avoidance in case you want to also consider it
I would suggest not trusting on remembering the meaning of 0 or 3 or of the position in the template parameters
Two additional enums can be defined
enum KindOfMixing {
kSE,
kME
};
enum KindOfMultiplicity {
kFT0AGLOBAL,
kFT0CGLOBAL,
kFV0GLOBAL,
kMFTGLOBAL,
kFV0MFT
};
and the functions can be templated with this types, for instance
template <KindOfMultiplicity corrType, KindOfMixing evntType>
void addHistos(...)
Now if always the named constants are used the compiler will advice if there is a misuse at any point
addHistos<kFT0GLOBAL, kSE>(...)
will compile correctly but
addHistos<kSE, kFT0GLOBAL>(...)
will give an error
The chosen names are, of course, representative
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 additional comment in case you want to consider it for future iterations
fv0detgeometry pointeraddHistosfunction instead of usingaddClone