[PWGCF] Fix bug in FV0 eta calculation#12423
[PWGCF] Fix bug in FV0 eta calculation#12423victor-gonzalez merged 1 commit intoAliceO2Group:masterfrom
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.
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.
Have a look at my additional comment in case you want to consider it for future iterations
fv0detgeometry pointeraddHistosfunction instead of usingaddClone