Skip to content

Commit

Permalink
Add histo with Reco MC collision centrality
Browse files Browse the repository at this point in the history
  • Loading branch information
Luigi Dello Stritto committed Jan 20, 2025
1 parent aaf048c commit 7e86ecc
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 6 deletions.
4 changes: 3 additions & 1 deletion PWGHF/TableProducer/candidateCreator2Prong.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -805,17 +805,19 @@ struct HfCandidateCreator2ProngExpressions {
// Slice the collisions table to get the collision info for the current MC collision
float centrality{-1.f};
uint16_t rejectionMask{0};
int nSplitColl = 0;
if constexpr (centEstimator == CentralityEstimator::FT0C) {
const auto collSlice = collInfos.sliceBy(colPerMcCollisionFT0C, mcCollision.globalIndex());
rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask<BCsInfo, centEstimator>(mcCollision, collSlice, centrality);
} else if constexpr (centEstimator == CentralityEstimator::FT0M) {
const auto collSlice = collInfos.sliceBy(colPerMcCollisionFT0M, mcCollision.globalIndex());
nSplitColl = collSlice.size();
rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask<BCsInfo, centEstimator>(mcCollision, collSlice, centrality);
} else if constexpr (centEstimator == CentralityEstimator::None) {
const auto collSlice = collInfos.sliceBy(colPerMcCollision, mcCollision.globalIndex());
rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask<BCsInfo, centEstimator>(mcCollision, collSlice, centrality);
}
hfEvSelMc.fillHistograms<centEstimator>(mcCollision, rejectionMask);
hfEvSelMc.fillHistograms<centEstimator>(mcCollision, rejectionMask, nSplitColl);
if (rejectionMask != 0) {
// at least one event selection not satisfied --> reject all particles from this collision
for (unsigned int i = 0; i < mcParticlesPerMcColl.size(); ++i) {
Expand Down
4 changes: 3 additions & 1 deletion PWGHF/TableProducer/candidateCreator3Prong.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -684,17 +684,19 @@ struct HfCandidateCreator3ProngExpressions {
// Slice the collisions table to get the collision info for the current MC collision
float centrality{-1.f};
uint16_t rejectionMask{0};
int nSplitColl = 0;
if constexpr (centEstimator == CentralityEstimator::FT0C) {
const auto collSlice = collInfos.sliceBy(colPerMcCollisionFT0C, mcCollision.globalIndex());
rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask<BCsInfo, centEstimator>(mcCollision, collSlice, centrality);
} else if constexpr (centEstimator == CentralityEstimator::FT0M) {
const auto collSlice = collInfos.sliceBy(colPerMcCollisionFT0M, mcCollision.globalIndex());
nSplitColl = collSlice.size();
rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask<BCsInfo, centEstimator>(mcCollision, collSlice, centrality);
} else if constexpr (centEstimator == CentralityEstimator::None) {
const auto collSlice = collInfos.sliceBy(colPerMcCollision, mcCollision.globalIndex());
rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask<BCsInfo, centEstimator>(mcCollision, collSlice, centrality);
}
hfEvSelMc.fillHistograms<centEstimator>(mcCollision, rejectionMask);
hfEvSelMc.fillHistograms<centEstimator>(mcCollision, rejectionMask, nSplitColl);
if (rejectionMask != 0) {
// at least one event selection not satisfied --> reject all gen particles from this collision
for (unsigned int i = 0; i < mcParticlesPerMcColl.size(); ++i) {
Expand Down
4 changes: 3 additions & 1 deletion PWGHF/TableProducer/candidateCreatorCascade.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -539,17 +539,19 @@ struct HfCandidateCreatorCascadeMc {
// Slice the collisions table to get the collision info for the current MC collision
float centrality{-1.f};
uint16_t rejectionMask{0};
int nSplitColl = 0;
if constexpr (centEstimator == CentralityEstimator::FT0C) {
const auto collSlice = collInfos.sliceBy(colPerMcCollisionFT0C, mcCollision.globalIndex());
rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask<BCsInfo, centEstimator>(mcCollision, collSlice, centrality);
} else if constexpr (centEstimator == CentralityEstimator::FT0M) {
const auto collSlice = collInfos.sliceBy(colPerMcCollisionFT0M, mcCollision.globalIndex());
nSplitColl = collSlice.size();
rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask<BCsInfo, centEstimator>(mcCollision, collSlice, centrality);
} else if constexpr (centEstimator == CentralityEstimator::None) {
const auto collSlice = collInfos.sliceBy(colPerMcCollision, mcCollision.globalIndex());
rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask<BCsInfo, centEstimator>(mcCollision, collSlice, centrality);
}
hfEvSelMc.fillHistograms<centEstimator>(mcCollision, rejectionMask);
hfEvSelMc.fillHistograms<centEstimator>(mcCollision, rejectionMask, nSplitColl);
if (rejectionMask != 0) {
// at least one event selection not satisfied --> reject all particles from this collision
for (unsigned int i = 0; i < mcParticlesPerMcColl.size(); ++i) {
Expand Down
4 changes: 3 additions & 1 deletion PWGHF/TableProducer/candidateCreatorDstar.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -635,17 +635,19 @@ struct HfCandidateCreatorDstarExpressions {
// Slice the collisions table to get the collision info for the current MC collision
float centrality{-1.f};
uint16_t rejectionMask{0};
int nSplitColl = 0;
if constexpr (centEstimator == CentralityEstimator::FT0C) {
const auto collSlice = collInfos.sliceBy(colPerMcCollisionFT0C, mcCollision.globalIndex());
rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask<BCsInfo, centEstimator>(mcCollision, collSlice, centrality);
} else if constexpr (centEstimator == CentralityEstimator::FT0M) {
const auto collSlice = collInfos.sliceBy(colPerMcCollisionFT0M, mcCollision.globalIndex());
nSplitColl = collSlice.size();
rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask<BCsInfo, centEstimator>(mcCollision, collSlice, centrality);
} else if constexpr (centEstimator == CentralityEstimator::None) {
const auto collSlice = collInfos.sliceBy(colPerMcCollision, mcCollision.globalIndex());
rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask<BCsInfo, centEstimator>(mcCollision, collSlice, centrality);
}
hfEvSelMc.fillHistograms<centEstimator>(mcCollision, rejectionMask);
hfEvSelMc.fillHistograms<centEstimator>(mcCollision, rejectionMask, nSplitColl);
if (rejectionMask != 0) {
// at least one event selection not satisfied --> reject all particles from this collision
for (unsigned int i = 0; i < mcParticlesPerMcColl.size(); ++i) {
Expand Down
4 changes: 3 additions & 1 deletion PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2039,17 +2039,19 @@ struct HfCandidateCreatorXic0Omegac0Mc {
// Slice the collisions table to get the collision info for the current MC collision
float centrality{-1.f};
uint16_t rejectionMask{0};
int nSplitColl = 0;
if constexpr (centEstimator == CentralityEstimator::FT0C) {
const auto collSlice = collsWithMcLabels.sliceBy(colPerMcCollisionFT0C, mcCollision.globalIndex());
rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask<BCsInfo, centEstimator>(mcCollision, collSlice, centrality);
} else if constexpr (centEstimator == CentralityEstimator::FT0M) {
const auto collSlice = collsWithMcLabels.sliceBy(colPerMcCollisionFT0M, mcCollision.globalIndex());
nSplitColl = collSlice.size();
rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask<BCsInfo, centEstimator>(mcCollision, collSlice, centrality);
} else if constexpr (centEstimator == CentralityEstimator::None) {
const auto collSlice = collsWithMcLabels.sliceBy(colPerMcCollision, mcCollision.globalIndex());
rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask<BCsInfo, centEstimator>(mcCollision, collSlice, centrality);
}
hfEvSelMc.fillHistograms<centEstimator>(mcCollision, rejectionMask);
hfEvSelMc.fillHistograms<centEstimator>(mcCollision, rejectionMask, nSplitColl);
if (rejectionMask != 0) {
/// at least one event selection not satisfied --> reject all particles from this collision
for (unsigned int i = 0; i < mcParticlesPerMcColl.size(); ++i) {
Expand Down
16 changes: 15 additions & 1 deletion PWGHF/Utils/utilsEvSelHf.h
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,10 @@ struct HfEventSelectionMc {
// histogram names
static constexpr char nameHistGenCollisionsCent[] = "hGenCollisionsCent";
std::shared_ptr<TH1> hGenCollisionsCent;
static constexpr char nameHistRecCollisionsCentMc[] = "hRecCollisionsCentMc";
std::shared_ptr<TH1> hRecCollisionsCentMc;
static constexpr char nameHistNSplitVertices[] = "hNSplitVertices";
std::shared_ptr<TH1> hNSplitVertices;
static constexpr char nameHistParticles[] = "hParticles";
std::shared_ptr<TH1> hParticles;

Expand All @@ -353,6 +357,8 @@ struct HfEventSelectionMc {
void addHistograms(o2::framework::HistogramRegistry& registry)
{
hGenCollisionsCent = registry.add<TH1>(nameHistGenCollisionsCent, "HF event counter;T0M;# of generated collisions", {o2::framework::HistType::kTH1D, {{100, 0., 100.}}});
hRecCollisionsCentMc = registry.add<TH1>(nameHistRecCollisionsCentMc, "HF event counter;T0M;# of reconstructed collisions", {o2::framework::HistType::kTH1D, {{100, 0., 100.}}});
hNSplitVertices = registry.add<TH1>(nameHistNSplitVertices, "HF split vertices counter;;# of reconstructed collisions per mc collision", {o2::framework::HistType::kTH1D, {{4, 1., 5.}}});
hParticles = registry.add<TH1>(nameHistParticles, "HF particle counter;;# of accepted particles", {o2::framework::HistType::kTH1D, {axisEvents}});
// Puts labels on the collision monitoring histogram.
setEventRejectionLabels(hParticles);
Expand Down Expand Up @@ -428,7 +434,7 @@ struct HfEventSelectionMc {
/// \param collision analysed collision
/// \param rejectionMask bitmask storing the info about which ev. selections are not satisfied by the collision
template <o2::hf_centrality::CentralityEstimator centEstimator, typename Coll>
void fillHistograms(Coll const& mcCollision, const uint16_t rejectionMask)
void fillHistograms(Coll const& mcCollision, const uint16_t rejectionMask, int nSplitColl = 0)
{
hParticles->Fill(EventRejection::None);

Expand All @@ -444,6 +450,14 @@ struct HfEventSelectionMc {
}
hParticles->Fill(reason);
}

if constexpr (centEstimator == o2::hf_centrality::CentralityEstimator::FT0M) {
hNSplitVertices->Fill(nSplitColl);
for (int nColl = 0; nColl < nSplitColl; nColl++) {
hRecCollisionsCentMc->Fill(mcCollision.centFT0M());
}
}

}
};
} // namespace o2::hf_evsel
Expand Down

0 comments on commit 7e86ecc

Please sign in to comment.