diff --git a/PWGHF/TableProducer/candidateCreator2Prong.cxx b/PWGHF/TableProducer/candidateCreator2Prong.cxx index d12acd58271..c04cc7e11fd 100644 --- a/PWGHF/TableProducer/candidateCreator2Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator2Prong.cxx @@ -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(mcCollision, collSlice, centrality); } else if constexpr (centEstimator == CentralityEstimator::FT0M) { const auto collSlice = collInfos.sliceBy(colPerMcCollisionFT0M, mcCollision.globalIndex()); + nSplitColl = collSlice.size(); rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, collSlice, centrality); } else if constexpr (centEstimator == CentralityEstimator::None) { const auto collSlice = collInfos.sliceBy(colPerMcCollision, mcCollision.globalIndex()); rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, collSlice, centrality); } - hfEvSelMc.fillHistograms(mcCollision, rejectionMask); + hfEvSelMc.fillHistograms(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) { diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index d59cf2989b2..6764984e3ab 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -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(mcCollision, collSlice, centrality); } else if constexpr (centEstimator == CentralityEstimator::FT0M) { const auto collSlice = collInfos.sliceBy(colPerMcCollisionFT0M, mcCollision.globalIndex()); + nSplitColl = collSlice.size(); rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, collSlice, centrality); } else if constexpr (centEstimator == CentralityEstimator::None) { const auto collSlice = collInfos.sliceBy(colPerMcCollision, mcCollision.globalIndex()); rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, collSlice, centrality); } - hfEvSelMc.fillHistograms(mcCollision, rejectionMask); + hfEvSelMc.fillHistograms(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) { diff --git a/PWGHF/TableProducer/candidateCreatorCascade.cxx b/PWGHF/TableProducer/candidateCreatorCascade.cxx index 288713aafbd..c9c1b57ca5c 100644 --- a/PWGHF/TableProducer/candidateCreatorCascade.cxx +++ b/PWGHF/TableProducer/candidateCreatorCascade.cxx @@ -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(mcCollision, collSlice, centrality); } else if constexpr (centEstimator == CentralityEstimator::FT0M) { const auto collSlice = collInfos.sliceBy(colPerMcCollisionFT0M, mcCollision.globalIndex()); + nSplitColl = collSlice.size(); rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, collSlice, centrality); } else if constexpr (centEstimator == CentralityEstimator::None) { const auto collSlice = collInfos.sliceBy(colPerMcCollision, mcCollision.globalIndex()); rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, collSlice, centrality); } - hfEvSelMc.fillHistograms(mcCollision, rejectionMask); + hfEvSelMc.fillHistograms(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) { diff --git a/PWGHF/TableProducer/candidateCreatorDstar.cxx b/PWGHF/TableProducer/candidateCreatorDstar.cxx index 6bfc79b3b66..b4a6cddfcfc 100644 --- a/PWGHF/TableProducer/candidateCreatorDstar.cxx +++ b/PWGHF/TableProducer/candidateCreatorDstar.cxx @@ -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(mcCollision, collSlice, centrality); } else if constexpr (centEstimator == CentralityEstimator::FT0M) { const auto collSlice = collInfos.sliceBy(colPerMcCollisionFT0M, mcCollision.globalIndex()); + nSplitColl = collSlice.size(); rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, collSlice, centrality); } else if constexpr (centEstimator == CentralityEstimator::None) { const auto collSlice = collInfos.sliceBy(colPerMcCollision, mcCollision.globalIndex()); rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, collSlice, centrality); } - hfEvSelMc.fillHistograms(mcCollision, rejectionMask); + hfEvSelMc.fillHistograms(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) { diff --git a/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx b/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx index 8c1a0aadec1..064bf143c66 100644 --- a/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx +++ b/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx @@ -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(mcCollision, collSlice, centrality); } else if constexpr (centEstimator == CentralityEstimator::FT0M) { const auto collSlice = collsWithMcLabels.sliceBy(colPerMcCollisionFT0M, mcCollision.globalIndex()); + nSplitColl = collSlice.size(); rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, collSlice, centrality); } else if constexpr (centEstimator == CentralityEstimator::None) { const auto collSlice = collsWithMcLabels.sliceBy(colPerMcCollision, mcCollision.globalIndex()); rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, collSlice, centrality); } - hfEvSelMc.fillHistograms(mcCollision, rejectionMask); + hfEvSelMc.fillHistograms(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) { diff --git a/PWGHF/Utils/utilsEvSelHf.h b/PWGHF/Utils/utilsEvSelHf.h index 5bb535c9827..c73794fc312 100644 --- a/PWGHF/Utils/utilsEvSelHf.h +++ b/PWGHF/Utils/utilsEvSelHf.h @@ -345,6 +345,10 @@ struct HfEventSelectionMc { // histogram names static constexpr char nameHistGenCollisionsCent[] = "hGenCollisionsCent"; std::shared_ptr hGenCollisionsCent; + static constexpr char nameHistRecCollisionsCentMc[] = "hRecCollisionsCentMc"; + std::shared_ptr hRecCollisionsCentMc; + static constexpr char nameHistNSplitVertices[] = "hNSplitVertices"; + std::shared_ptr hNSplitVertices; static constexpr char nameHistParticles[] = "hParticles"; std::shared_ptr hParticles; @@ -353,6 +357,8 @@ struct HfEventSelectionMc { void addHistograms(o2::framework::HistogramRegistry& registry) { hGenCollisionsCent = registry.add(nameHistGenCollisionsCent, "HF event counter;T0M;# of generated collisions", {o2::framework::HistType::kTH1D, {{100, 0., 100.}}}); + hRecCollisionsCentMc = registry.add(nameHistRecCollisionsCentMc, "HF event counter;T0M;# of reconstructed collisions", {o2::framework::HistType::kTH1D, {{100, 0., 100.}}}); + hNSplitVertices = registry.add(nameHistNSplitVertices, "HF split vertices counter;;# of reconstructed collisions per mc collision", {o2::framework::HistType::kTH1D, {{4, 1., 5.}}}); hParticles = registry.add(nameHistParticles, "HF particle counter;;# of accepted particles", {o2::framework::HistType::kTH1D, {axisEvents}}); // Puts labels on the collision monitoring histogram. setEventRejectionLabels(hParticles); @@ -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 - 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); @@ -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