Skip to content

Commit 4af39fa

Browse files
DelloStrittoLuigi Dello Stritto
andauthored
[PWGHF] Add histo with Reco MC collision centrality (#9413)
Co-authored-by: Luigi Dello Stritto <ldellost@alicecerno2.cern.ch>
1 parent 12f7a1e commit 4af39fa

File tree

6 files changed

+33
-6
lines changed

6 files changed

+33
-6
lines changed

PWGHF/TableProducer/candidateCreator2Prong.cxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -805,17 +805,19 @@ struct HfCandidateCreator2ProngExpressions {
805805
// Slice the collisions table to get the collision info for the current MC collision
806806
float centrality{-1.f};
807807
uint16_t rejectionMask{0};
808+
int nSplitColl = 0;
808809
if constexpr (centEstimator == CentralityEstimator::FT0C) {
809810
const auto collSlice = collInfos.sliceBy(colPerMcCollisionFT0C, mcCollision.globalIndex());
810811
rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask<BCsInfo, centEstimator>(mcCollision, collSlice, centrality);
811812
} else if constexpr (centEstimator == CentralityEstimator::FT0M) {
812813
const auto collSlice = collInfos.sliceBy(colPerMcCollisionFT0M, mcCollision.globalIndex());
814+
nSplitColl = collSlice.size();
813815
rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask<BCsInfo, centEstimator>(mcCollision, collSlice, centrality);
814816
} else if constexpr (centEstimator == CentralityEstimator::None) {
815817
const auto collSlice = collInfos.sliceBy(colPerMcCollision, mcCollision.globalIndex());
816818
rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask<BCsInfo, centEstimator>(mcCollision, collSlice, centrality);
817819
}
818-
hfEvSelMc.fillHistograms<centEstimator>(mcCollision, rejectionMask);
820+
hfEvSelMc.fillHistograms<centEstimator>(mcCollision, rejectionMask, nSplitColl);
819821
if (rejectionMask != 0) {
820822
// at least one event selection not satisfied --> reject all particles from this collision
821823
for (unsigned int i = 0; i < mcParticlesPerMcColl.size(); ++i) {

PWGHF/TableProducer/candidateCreator3Prong.cxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1006,17 +1006,19 @@ struct HfCandidateCreator3ProngExpressions {
10061006
// Slice the collisions table to get the collision info for the current MC collision
10071007
float centrality{-1.f};
10081008
uint16_t rejectionMask{0};
1009+
int nSplitColl = 0;
10091010
if constexpr (centEstimator == CentralityEstimator::FT0C) {
10101011
const auto collSlice = collInfos.sliceBy(colPerMcCollisionFT0C, mcCollision.globalIndex());
10111012
rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask<BCsInfo, centEstimator>(mcCollision, collSlice, centrality);
10121013
} else if constexpr (centEstimator == CentralityEstimator::FT0M) {
10131014
const auto collSlice = collInfos.sliceBy(colPerMcCollisionFT0M, mcCollision.globalIndex());
1015+
nSplitColl = collSlice.size();
10141016
rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask<BCsInfo, centEstimator>(mcCollision, collSlice, centrality);
10151017
} else if constexpr (centEstimator == CentralityEstimator::None) {
10161018
const auto collSlice = collInfos.sliceBy(colPerMcCollision, mcCollision.globalIndex());
10171019
rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask<BCsInfo, centEstimator>(mcCollision, collSlice, centrality);
10181020
}
1019-
hfEvSelMc.fillHistograms<centEstimator>(mcCollision, rejectionMask);
1021+
hfEvSelMc.fillHistograms<centEstimator>(mcCollision, rejectionMask, nSplitColl);
10201022
if (rejectionMask != 0) {
10211023
// at least one event selection not satisfied --> reject all gen particles from this collision
10221024
for (unsigned int i = 0; i < mcParticlesPerMcColl.size(); ++i) {

PWGHF/TableProducer/candidateCreatorCascade.cxx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
/// \author Chiara Zampolli, <Chiara.Zampolli@cern.ch>, CERN
1616
/// Paul Buehler, <paul.buehler@oeaw.ac.at>, Vienna
1717

18+
#include <string>
19+
#include <memory>
20+
#include <vector>
21+
1822
#include <TPDGCode.h>
1923

2024
#include "CommonConstants/PhysicsConstants.h"
@@ -539,17 +543,19 @@ struct HfCandidateCreatorCascadeMc {
539543
// Slice the collisions table to get the collision info for the current MC collision
540544
float centrality{-1.f};
541545
uint16_t rejectionMask{0};
546+
int nSplitColl = 0;
542547
if constexpr (centEstimator == CentralityEstimator::FT0C) {
543548
const auto collSlice = collInfos.sliceBy(colPerMcCollisionFT0C, mcCollision.globalIndex());
544549
rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask<BCsInfo, centEstimator>(mcCollision, collSlice, centrality);
545550
} else if constexpr (centEstimator == CentralityEstimator::FT0M) {
546551
const auto collSlice = collInfos.sliceBy(colPerMcCollisionFT0M, mcCollision.globalIndex());
552+
nSplitColl = collSlice.size();
547553
rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask<BCsInfo, centEstimator>(mcCollision, collSlice, centrality);
548554
} else if constexpr (centEstimator == CentralityEstimator::None) {
549555
const auto collSlice = collInfos.sliceBy(colPerMcCollision, mcCollision.globalIndex());
550556
rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask<BCsInfo, centEstimator>(mcCollision, collSlice, centrality);
551557
}
552-
hfEvSelMc.fillHistograms<centEstimator>(mcCollision, rejectionMask);
558+
hfEvSelMc.fillHistograms<centEstimator>(mcCollision, rejectionMask, nSplitColl);
553559
if (rejectionMask != 0) {
554560
// at least one event selection not satisfied --> reject all particles from this collision
555561
for (unsigned int i = 0; i < mcParticlesPerMcColl.size(); ++i) {

PWGHF/TableProducer/candidateCreatorDstar.cxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,17 +635,19 @@ struct HfCandidateCreatorDstarExpressions {
635635
// Slice the collisions table to get the collision info for the current MC collision
636636
float centrality{-1.f};
637637
uint16_t rejectionMask{0};
638+
int nSplitColl = 0;
638639
if constexpr (centEstimator == CentralityEstimator::FT0C) {
639640
const auto collSlice = collInfos.sliceBy(colPerMcCollisionFT0C, mcCollision.globalIndex());
640641
rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask<BCsInfo, centEstimator>(mcCollision, collSlice, centrality);
641642
} else if constexpr (centEstimator == CentralityEstimator::FT0M) {
642643
const auto collSlice = collInfos.sliceBy(colPerMcCollisionFT0M, mcCollision.globalIndex());
644+
nSplitColl = collSlice.size();
643645
rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask<BCsInfo, centEstimator>(mcCollision, collSlice, centrality);
644646
} else if constexpr (centEstimator == CentralityEstimator::None) {
645647
const auto collSlice = collInfos.sliceBy(colPerMcCollision, mcCollision.globalIndex());
646648
rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask<BCsInfo, centEstimator>(mcCollision, collSlice, centrality);
647649
}
648-
hfEvSelMc.fillHistograms<centEstimator>(mcCollision, rejectionMask);
650+
hfEvSelMc.fillHistograms<centEstimator>(mcCollision, rejectionMask, nSplitColl);
649651
if (rejectionMask != 0) {
650652
// at least one event selection not satisfied --> reject all particles from this collision
651653
for (unsigned int i = 0; i < mcParticlesPerMcColl.size(); ++i) {

PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2039,17 +2039,19 @@ struct HfCandidateCreatorXic0Omegac0Mc {
20392039
// Slice the collisions table to get the collision info for the current MC collision
20402040
float centrality{-1.f};
20412041
uint16_t rejectionMask{0};
2042+
int nSplitColl = 0;
20422043
if constexpr (centEstimator == CentralityEstimator::FT0C) {
20432044
const auto collSlice = collsWithMcLabels.sliceBy(colPerMcCollisionFT0C, mcCollision.globalIndex());
20442045
rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask<BCsInfo, centEstimator>(mcCollision, collSlice, centrality);
20452046
} else if constexpr (centEstimator == CentralityEstimator::FT0M) {
20462047
const auto collSlice = collsWithMcLabels.sliceBy(colPerMcCollisionFT0M, mcCollision.globalIndex());
2048+
nSplitColl = collSlice.size();
20472049
rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask<BCsInfo, centEstimator>(mcCollision, collSlice, centrality);
20482050
} else if constexpr (centEstimator == CentralityEstimator::None) {
20492051
const auto collSlice = collsWithMcLabels.sliceBy(colPerMcCollision, mcCollision.globalIndex());
20502052
rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask<BCsInfo, centEstimator>(mcCollision, collSlice, centrality);
20512053
}
2052-
hfEvSelMc.fillHistograms<centEstimator>(mcCollision, rejectionMask);
2054+
hfEvSelMc.fillHistograms<centEstimator>(mcCollision, rejectionMask, nSplitColl);
20532055
if (rejectionMask != 0) {
20542056
/// at least one event selection not satisfied --> reject all particles from this collision
20552057
for (unsigned int i = 0; i < mcParticlesPerMcColl.size(); ++i) {

PWGHF/Utils/utilsEvSelHf.h

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,10 @@ struct HfEventSelectionMc {
345345
// histogram names
346346
static constexpr char nameHistGenCollisionsCent[] = "hGenCollisionsCent";
347347
std::shared_ptr<TH1> hGenCollisionsCent;
348+
static constexpr char nameHistRecCollisionsCentMc[] = "hRecCollisionsCentMc";
349+
std::shared_ptr<TH1> hRecCollisionsCentMc;
350+
static constexpr char nameHistNSplitVertices[] = "hNSplitVertices";
351+
std::shared_ptr<TH1> hNSplitVertices;
348352
static constexpr char nameHistParticles[] = "hParticles";
349353
std::shared_ptr<TH1> hParticles;
350354

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

@@ -444,6 +450,13 @@ struct HfEventSelectionMc {
444450
}
445451
hParticles->Fill(reason);
446452
}
453+
454+
if constexpr (centEstimator == o2::hf_centrality::CentralityEstimator::FT0M) {
455+
hNSplitVertices->Fill(nSplitColl);
456+
for (int nColl = 0; nColl < nSplitColl; nColl++) {
457+
hRecCollisionsCentMc->Fill(mcCollision.centFT0M());
458+
}
459+
}
447460
}
448461
};
449462
} // namespace o2::hf_evsel

0 commit comments

Comments
 (0)