-
Notifications
You must be signed in to change notification settings - Fork 529
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
[PWGHF] Extend information of sparses for efficiency evaluation. Refactor analysis utilities. #9153
Conversation
Please consider the following formatting changes to AliceO2Group#9153
There is quite some duplication with #9142. It would be best to factor the common code out into utility headers, especially the enumerators and the occupancy helper functions. |
Please consider the following formatting changes to AliceO2Group#9153
Hi @vkucera, @fgrosa, I modified the PR according to your suggestion to reduce code duplication. First, I moved the |
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.
Hi @Marcellocosti it looks very good to me, thanks! It can be merged in my opinion, let's see if it looks good to @vkucera as well.
PWGHF/Utils/utilsEvSelHf.h
Outdated
/// \param collSlice collection of reconstructed collisions associated to a generated one | ||
/// \return generated MC collision occupancy | ||
template <typename CCs> | ||
int getOccupancyGenColl(CCs const& collSlice, int occEstimator = 1) |
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.
int getOccupancyGenColl(CCs const& collSlice, int occEstimator = 1) | |
int getOccupancyGenColl(CCs const& collSlice, int occEstimator = OccupancyEstimator::Its) |
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 the nice refactorisation. Please see my suggestions for improvements and safety fixes.
/// \param centEstimator integer to select the centrality estimator | ||
/// \return collision centrality | ||
template <typename Coll> | ||
float getCentralityColl(const Coll& collision, int centEstimator) |
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.
float getCentralityColl(const Coll& collision, int centEstimator) | |
float getCentralityColl(const Coll& collision, CentralityEstimator centEstimator) |
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.
The most common use-case of this function is when the centEstimator
argument is a Configurable<int>
type defined in the user tasks. As far as I am aware, casting is not defined from Configurable<int>
types to enum
types, so I don't know how to implement this conversion. Do you have any suggestion?
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.
Use centEstimator.value
as argument of calling getCentralityColl
.
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.
If I understood correctly, centEstimator
is a Configurable<int>
type, centEstimator.value
extracts an int
value. But then I manage to get a working version only by passing to the function static_cast<o2::hf_centrality::CentralityEstimator>(centEstimator.value)
since the casting from the int
to an enum
type is not automatic.
Dear @vkucera, I have implemented your suggestions apart from the conversion of the |
Hi @vkucera could you please check if the latest version is ok for you and possibly approve it? This PR is urgent for QM approvals. Thanks! |
In this PR, occupancy and centrality axes are added to existing sparses. Plus, the information on the B hadron mother pdg and pt is stored for nonprompt candidates. Finally, sparse histograms are added for generated MC candidates.
Refactor utility methods and enumerators:
getCentralityColl
getCentralityGenColl
getBHadMotherFlag
getOccupancyColl
getOccupancyGenColl
BHadMothers
OccupancyEstimator