Skip to content

Commit 9040ae4

Browse files
authored
[PWGHF] include number of contributors histos in correlatorDMesonPair.cxx (#8452)
1 parent 99559b9 commit 9040ae4

File tree

1 file changed

+24
-7
lines changed

1 file changed

+24
-7
lines changed

PWGHF/HFC/TableProducer/correlatorDMesonPairs.cxx

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
///
1515
/// \author Andrea Tavira García <tavira-garcia@ijclab.in2p3.fr>, IJCLab Orsay
1616

17+
#include <string>
18+
#include <vector>
19+
1720
#include "Framework/AnalysisTask.h"
1821
#include "Framework/HistogramRegistry.h"
1922
#include "Framework/runDataProcessing.h"
@@ -79,9 +82,10 @@ struct HfCorrelatorDMesonPairs {
7982

8083
HistogramConfigSpec hTH1Pt{HistType::kTH1F, {{180, 0., 36.}}};
8184
HistogramConfigSpec hTH1Y{HistType::kTH1F, {{100, -5., 5.}}};
85+
HistogramConfigSpec hTH1NContrib{HistType::kTH1F, {{120, -0.5, 119.5}}};
8286
HistogramConfigSpec hTH1Phi{HistType::kTH1F, {{32, 0., o2::constants::math::TwoPI}}};
8387
HistogramConfigSpec hTH2Pid{HistType::kTH2F, {{500, 0., 10.}, {400, -20., 20.}}};
84-
HistogramConfigSpec hTH2PtVsY{HistType::kTH2F, {{360, 0., 36.}, {20, -1., 1.}}};
88+
HistogramConfigSpec hTH3PtVsYVsNContrib{HistType::kTH3F, {{360, 0., 36.}, {20, -1., 1.}, {120, -0.5, 119.5}}};
8589

8690
HistogramRegistry registry{
8791
"registry",
@@ -97,9 +101,11 @@ struct HfCorrelatorDMesonPairs {
97101
{"hPtCandAfterCutMcGen", "D meson candidates after pT cut;candidate #it{p}_{T} (GeV/#it{c});entries", hTH1Pt},
98102
{"hEtaMcGen", "D meson candidates MC Gen;candidate #it{#eta};entries", hTH1Y},
99103
{"hPhiMcGen", "D meson candidates MC Gen;candidate #it{#varphi};entries", hTH1Phi},
100-
{"hPtVsYMcGen", "D meson candidates MC Gen;candidate #it{p}_{T} (GeV/#it{c});#it{y}", hTH2PtVsY},
104+
{"hPtVsYVsNContribMcGen", "D meson candidates MC Gen;candidate #it{p}_{T} (GeV/#it{c});#it{y};Number of contributors", hTH3PtVsYVsNContrib},
105+
{"hNContribMcGen", "D meson candidates MC Gen;Number of contributors", hTH1NContrib},
101106
// MC Rec plots
102-
{"hPtVsYMcRec", "D meson candidates MC Rec;candidate #it{p}_{T} (GeV/#it{c});#it{y}", hTH2PtVsY},
107+
{"hPtVsYVsNContribMcRec", "D meson candidates MC Rec;candidate #it{p}_{T} (GeV/#it{c});#it{y};Number of contributors", hTH3PtVsYVsNContrib},
108+
{"hNContribMcRec", "D meson candidates MC Rec;Number of contributors", hTH1NContrib},
103109
// PID plots ----- Not definitively here
104110
{"PID/hTofNSigmaPi", "(TOFsignal-time#pi)/tofSigPid;p[GeV/c];(TOFsignal-time#pi)/tofSigPid", hTH2Pid},
105111
{"PID/hTofNSigmaKa", "(TOFsignal-timeK)/tofSigPid;p[GeV/c];(TOFsignal-timeK)/tofSigPid", hTH2Pid},
@@ -559,7 +565,8 @@ struct HfCorrelatorDMesonPairs {
559565
if (isDCand1) {
560566
if (isTrueDCand1) {
561567
registry.fill(HIST("hMass"), hfHelper.invMassD0ToPiK(candidate1), candidate1.pt());
562-
registry.fill(HIST("hPtVsYMcRec"), candidate1.pt(), hfHelper.yD0(candidate1));
568+
registry.fill(HIST("hPtVsYVsNContribMcRec"), candidate1.pt(), hfHelper.yD0(candidate1), collision.numContrib());
569+
registry.fill(HIST("hNContribMcRec"), collision.numContrib());
563570
if (originRec1 == 1) {
564571
registry.fill(HIST("hMassMcRecPrompt"), hfHelper.invMassD0ToPiK(candidate1), candidate1.pt());
565572
} else if (originRec1 == 2) {
@@ -572,7 +579,8 @@ struct HfCorrelatorDMesonPairs {
572579
if (isDbarCand1) {
573580
if (isTrueDbarCand1) {
574581
registry.fill(HIST("hMass"), hfHelper.invMassD0barToKPi(candidate1), candidate1.pt());
575-
registry.fill(HIST("hPtVsYMcRec"), candidate1.pt(), hfHelper.yD0(candidate1));
582+
registry.fill(HIST("hPtVsYVsNContribMcRec"), candidate1.pt(), hfHelper.yD0(candidate1), collision.numContrib());
583+
registry.fill(HIST("hNContribMcRec"), collision.numContrib());
576584
if (originRec1 == 1) {
577585
registry.fill(HIST("hMassMcRecPrompt"), hfHelper.invMassD0barToKPi(candidate1), candidate1.pt());
578586
} else if (originRec1 == 2) {
@@ -665,8 +673,16 @@ struct HfCorrelatorDMesonPairs {
665673

666674
PROCESS_SWITCH(HfCorrelatorDMesonPairs, processMcRec, "Process Mc reco mode", false);
667675

668-
void processMcGen(aod::McCollision const&, McParticlesPlus2Prong const& mcParticles)
676+
void processMcGen(aod::McCollision const&, soa::SmallGroups<soa::Join<aod::McCollisionLabels, aod::Collisions>> const& collisions, McParticlesPlus2Prong const& mcParticles)
669677
{
678+
int numPvContributorsGen{0};
679+
for (const auto& collision : collisions) { // loop over reco collisions associated to this gen collision
680+
int numPvContributors = collision.numContrib();
681+
682+
if (numPvContributors > numPvContributorsGen) { // we take the associated reconstructed collision with higher number of PV contributors
683+
numPvContributorsGen = numPvContributors;
684+
}
685+
}
670686
// Get counters per event
671687
int nDevent = 0, nDbarevent = 0, nDDbarevent = 0, nDorDbarevent = 0;
672688
for (const auto& particle : mcParticles) {
@@ -750,7 +766,8 @@ struct HfCorrelatorDMesonPairs {
750766
registry.fill(HIST("hStatusSinglePartMcGen"), 4);
751767
}
752768

753-
registry.fill(HIST("hPtVsYMcGen"), particle1.pt(), particle1.y());
769+
registry.fill(HIST("hPtVsYVsNContribMcGen"), particle1.pt(), particle1.y(), numPvContributorsGen);
770+
registry.fill(HIST("hNContribMcGen"), numPvContributorsGen);
754771

755772
for (auto particle2 = particle1 + 1; particle2 != mcParticles.end(); ++particle2) {
756773
// check if the particle is D0 or D0bar

0 commit comments

Comments
 (0)