Skip to content

Commit 32e4f43

Browse files
committed
[PWGHF] D+-h corr, checks on MCClosure test
1 parent 0786066 commit 32e4f43

3 files changed

Lines changed: 85 additions & 6 deletions

File tree

‎PWGHF/HFC/DataModel/CorrelationTables.h‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,21 @@ DECLARE_SOA_TABLE(TrkRecInfoDplus, "AOD", "TRKRECINFODPLUS", //! Tracks Reconstr
497497
aod::hf_correlation_dplus_hadron::TrackDcaZ,
498498
aod::hf_correlation_dplus_hadron::TrackTPCNClsCrossedRows);
499499

500+
// definition of columns and tables for the beauty-mother information of the charm-hadron trigger (MC only), usable by any D-hadron correlation analysis
501+
namespace hf_correlation_b_mother
502+
{
503+
DECLARE_SOA_COLUMN(PtB, ptB, float); //! Generated pT of the beauty mother of the charm hadron (-1 if not from beauty)
504+
DECLARE_SOA_COLUMN(DeltaPhiBtoD, deltaPhiBtoD, float); //! phi(charm hadron) - phi(B mother, generated) in [-pihalf, 3.*pihalf) (-999 if not from beauty)
505+
} // namespace hf_correlation_b_mother
506+
507+
DECLARE_SOA_TABLE(BMotherPairInfo, "AOD", "BMOTHERPAIRINFO", //! Charm-hadron-hadron pairs beauty-mother information, joinable with the pair table
508+
aod::hf_correlation_b_mother::PtB,
509+
aod::hf_correlation_b_mother::DeltaPhiBtoD);
510+
511+
DECLARE_SOA_TABLE(BMotherCandInfo, "AOD", "BMOTHERCANDINFO", //! Charm-hadron candidates beauty-mother information, joinable with the candidate table
512+
aod::hf_correlation_b_mother::PtB,
513+
aod::hf_correlation_b_mother::DeltaPhiBtoD);
514+
500515
// definition of columns and tables for Dstar-Hadron correlation pair
501516
namespace hf_correlation_dstar_hadron
502517
{

‎PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx‎

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "PWGHF/DataModel/TrackIndexSkimmingTables.h"
2323
#include "PWGHF/HFC/DataModel/CorrelationTables.h"
2424
#include "PWGHF/HFC/DataModel/DerivedDataCorrelationTables.h"
25+
#include "PWGHF/HFC/Utils/utilsCorrelations.h"
2526
#include "PWGHF/Utils/utilsAnalysis.h"
2627

2728
#include "Common/CCDB/EventSelectionParams.h"
@@ -186,9 +187,12 @@ struct HfCorrelatorDplusHadrons {
186187
Produces<aod::HcCandSelInfos> candSelInfo;
187188
Produces<aod::AssocTrackReds> assocTrackReduced;
188189
Produces<aod::AssocTrackSels> assocTrackSelInfo;
190+
Produces<aod::BMotherPairInfo> entryDplusHadronBMotherInfo;
191+
Produces<aod::BMotherCandInfo> entryDplusCandBMotherInfo;
189192

190193
static constexpr std::size_t NDaughters{3u};
191-
static constexpr float EtaDaughtersMax = 0.8f; // Eta cut on daughters of D+ meson as Run2
194+
static constexpr float EtaDaughtersMax = 0.8f; // Eta cut on daughters of D+ meson as Run2
195+
static constexpr int8_t DepthMaxDplusDaughters{2}; // max. depth of the D+ daughters in the decay chain (resonant channels)
192196

193197
Configurable<int> selectionFlagDplus{"selectionFlagDplus", 7, "Selection Flag for Dplus"}; // 7 corresponds to topo+PID cuts
194198
Configurable<int> numberEventsMixed{"numberEventsMixed", 5, "Number of events mixed in ME process"};
@@ -401,6 +405,9 @@ struct HfCorrelatorDplusHadrons {
401405
// Count triggers
402406
registry.fill(HIST("hcountDplustriggersMCGen"), 0, particle.pt());
403407

408+
// beauty-mother information
409+
const auto [ptB, deltaPhiBtoD] = hf_correlations::getBMotherInfoMcGen(particle, particlesToLoop);
410+
404411
for (const auto& particleAssoc : groupedMcParticles) {
405412

406413
if (std::abs(particleAssoc.eta()) > etaTrackMax ||
@@ -447,6 +454,7 @@ struct HfCorrelatorDplusHadrons {
447454
entryDplusHadronGenInfo(isDplusPrompt,
448455
particleAssoc.isPhysicalPrimary(),
449456
trackOrigin);
457+
entryDplusHadronBMotherInfo(ptB, deltaPhiBtoD);
450458
}
451459
}
452460
}
@@ -552,7 +560,7 @@ struct HfCorrelatorDplusHadrons {
552560

553561
int indexHfcReducedCollision = collReduced.lastIndex() + 1;
554562

555-
// Ds fill histograms and Dplus candidates information stored
563+
// Dplus candidates information stored
556564
for (const auto& candidate : candsDplusThisColl) {
557565
std::vector<float> outputMl = {-1., -1., -1.};
558566
// candidate selected
@@ -631,6 +639,8 @@ struct HfCorrelatorDplusHadrons {
631639
bool isDplusNonPrompt = candidate.originMcRec() == RecoDecay::OriginType::NonPrompt;
632640

633641
std::vector<float> outputMl = {-1., -1., -1.};
642+
// beauty-mother information (generated B, reconstructed D+)
643+
const auto [ptB, deltaPhiBtoD] = hf_correlations::getBMotherInfoMcRec<TracksWithMc>(candidate, mcParticles, Pdg::kDPlus, DepthMaxDplusDaughters);
634644

635645
// fill invariant mass plots from Dplus signal and background candidates
636646
registry.fill(HIST("hMassDplusMcRec"), HfHelper::invMassDplusToPiKPi(candidate), efficiencyWeightD);
@@ -663,6 +673,7 @@ struct HfCorrelatorDplusHadrons {
663673
registry.fill(HIST("hMassDplusMcRecSig"), HfHelper::invMassDplusToPiKPi(candidate), candidate.pt(), efficiencyWeightD);
664674
entryDplusCandRecoInfo(HfHelper::invMassDplusToPiKPi(candidate), candidate.pt(), outputMl[0], outputMl[1], outputMl[2]);
665675
entryDplusCandGenInfo(isDplusPrompt);
676+
entryDplusCandBMotherInfo(ptB, deltaPhiBtoD);
666677
} else {
667678
registry.fill(HIST("hPtCandMcRecBkg"), candidate.pt());
668679
registry.fill(HIST("hEtaMcRecBkg"), candidate.eta());
@@ -691,6 +702,7 @@ struct HfCorrelatorDplusHadrons {
691702
track.pt(), poolBin);
692703
entryDplusHadronRecoInfo(HfHelper::invMassDplusToPiKPi(candidate), isDplusSignal);
693704
entryDplusHadronMlInfo(outputMl[0], outputMl[1], outputMl[2]);
705+
entryDplusHadronBMotherInfo(ptB, deltaPhiBtoD);
694706
if (track.has_mcParticle()) {
695707
auto mcParticle = track.template mcParticle_as<aod::McParticles>();
696708
isPhysicalPrimary = mcParticle.isPhysicalPrimary();
@@ -866,6 +878,8 @@ struct HfCorrelatorDplusHadrons {
866878
poolBin);
867879
entryDplusHadronRecoInfo(HfHelper::invMassDplusToPiKPi(candidate), isDplusSignal);
868880
entryDplusHadronGenInfo(isDplusPrompt, isPhysicalPrimary, trackOrigin);
881+
const auto [ptB, deltaPhiBtoD] = hf_correlations::getBMotherInfoMcRec<TracksWithMc>(candidate, mcParticles, Pdg::kDPlus, DepthMaxDplusDaughters);
882+
entryDplusHadronBMotherInfo(ptB, deltaPhiBtoD);
869883
for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) {
870884
outputMl[iclass] = candidate.mlProbDplusToPiKPi()[classMl->at(iclass)];
871885
}
@@ -910,6 +924,8 @@ struct HfCorrelatorDplusHadrons {
910924
poolBin);
911925
entryDplusHadronRecoInfo(MassDPlus, true);
912926
entryDplusHadronGenInfo(isDplusPrompt, particleAssoc.isPhysicalPrimary(), trackOrigin);
927+
const auto [ptB, deltaPhiBtoD] = hf_correlations::getBMotherInfoMcGen(candidate, mcParticles);
928+
entryDplusHadronBMotherInfo(ptB, deltaPhiBtoD);
913929
}
914930
}
915931
}

‎PWGHF/HFC/Tasks/taskCorrelationDplusHadrons.cxx‎

Lines changed: 52 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ struct HfTaskCorrelationDplusHadrons {
141141
Configurable<int> nTpcCrossedRaws{"nTpcCrossedRaws", 70, "Number of crossed TPC Rows"};
142142
Configurable<float> cutCollPosZMc{"cutCollPosZMc", 10., "max z-vertex position for collision acceptance"};
143143
Configurable<bool> storeMassAxis{"storeMassAxis", false, "Store Mass axis in THnSparse"};
144+
Configurable<bool> storeBMotherInfo{"storeBMotherInfo", false, "Store generated pT(B mother) and phi(D+) - phi(B mother) of non-prompt D+ in MC Rec histograms"};
145+
Configurable<std::vector<double>> binsPtBMother{"binsPtBMother", std::vector<double>{0., 2., 4., 6., 8., 12., 16., 24., 36., 50., 99.}, "pT bin limits for the B mother of non-prompt D+"};
144146
// CCDB configuration
145147
Configurable<std::string> ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};
146148
Configurable<std::string> associatedEffCcdbPath{"associatedEffCcdbPath", "", "CCDB path for associated efficiency"};
@@ -164,8 +166,9 @@ struct HfTaskCorrelationDplusHadrons {
164166
kCandidateStepMcRecoInAcceptance,
165167
kCandidateNSteps };
166168

167-
using DplusHadronPair = soa::Join<aod::DplusHadronPair, aod::DplusHadronRecoInfo, aod::DplusHadronGenInfo>;
169+
using DplusHadronPairWithBMother = soa::Join<aod::DplusHadronPair, aod::DplusHadronRecoInfo, aod::DplusHadronGenInfo, aod::BMotherPairInfo>;
168170
using DplusHadronPairFullWithMl = soa::Join<aod::DplusHadronPair, aod::DplusHadronRecoInfo, aod::DplusHadronGenInfo, aod::DplusHadronMlInfo, aod::TrkRecInfoDplus>;
171+
using DplusHadronPairFullWithMlAndBMother = soa::Join<aod::DplusHadronPair, aod::DplusHadronRecoInfo, aod::DplusHadronGenInfo, aod::DplusHadronMlInfo, aod::TrkRecInfoDplus, aod::BMotherPairInfo>;
169172
using CandDplusMcReco = soa::Filtered<soa::Join<aod::HfCand3Prong, aod::HfSelDplusToPiKPi, aod::HfMlDplusToPiKPi, aod::HfCand3ProngMcRec>>;
170173
using CandDplusMcGen = soa::Join<aod::McParticles, aod::HfCand3ProngMcGen>;
171174
using TracksWithMc = soa::Filtered<soa::Join<aod::TracksWDca, aod::TrackSelection, aod::TracksExtra, o2::aod::McTrackLabels>>; // trackFilter applied
@@ -179,6 +182,7 @@ struct HfTaskCorrelationDplusHadrons {
179182
ConfigurableAxis binsPhi{"binsPhi", {64, -PIHalf, 3. * PIHalf}, "#it{#varphi}"};
180183
ConfigurableAxis binsMultFT0M{"binsMultFT0M", {600, 0., 8000.}, "Multiplicity as FT0M signal amplitude"};
181184
ConfigurableAxis binsPoolBin{"binsPoolBin", {9, 0., 9.}, "PoolBin"};
185+
ConfigurableAxis binsDeltaPhiBMother{"binsDeltaPhiBMother", {64, -PIHalf, 3. * PIHalf}, "#it{#varphi}^{D}-#it{#varphi}^{B}"};
182186

183187
HistogramRegistry registry{"registry", {}, OutputObjHandlingPolicy::AnalysisObject};
184188

@@ -195,6 +199,8 @@ struct HfTaskCorrelationDplusHadrons {
195199
AxisSpec axisPoolBin = {binsPoolBin, "poolBin"};
196200
AxisSpec axisDplusPrompt = {2, -0.5, 1.5, "Prompt D+"};
197201
AxisSpec const axisBdtScore = {binsBdtScore, "Bdt score"};
202+
AxisSpec axisPtBMother = {(std::vector<double>)binsPtBMother, "#it{p}_{T}^{B} (GeV/#it{c})"};
203+
AxisSpec axisDeltaPhiBMother = {binsDeltaPhiBMother, "#it{#varphi}^{D}-#it{#varphi}^{B} (rad)"};
198204

199205
// Histograms for data analysis
200206
registry.add("hBdtScorePrompt", "D+ BDT prompt score", {HistType::kTH1F, {axisBdtScore}});
@@ -259,6 +265,17 @@ struct HfTaskCorrelationDplusHadrons {
259265
registry.get<THnSparse>(HIST("hCorrel2DVsPtSidebandRightMcRec"))->Sumw2();
260266
registry.get<THnSparse>(HIST("hCorrel2DVsPtSignalRegionMcRec"))->Sumw2();
261267
registry.get<THnSparse>(HIST("hCorrel2DVsPtPhysicalPrimaryMcRec"))->Sumw2();
268+
269+
// beauty-mother information of non-prompt D+ (generated B, reconstructed D+)
270+
if (storeBMotherInfo) {
271+
registry.add("hMassNonPromptDplusVsPtVsPtBMother", "D+ non prompt candidates mass Vs Pt Vs Pt B mother", {HistType::kTH3F, {{axisMassD}, {axisPtD}, {axisPtBMother}}});
272+
registry.add("hDeltaPhiBMotherVsPtVsPtBMother", "D+ non prompt candidates #varphi^{D}-#varphi^{B} Vs Pt Vs Pt B mother", {HistType::kTH3F, {{axisDeltaPhiBMother}, {axisPtD}, {axisPtBMother}}});
273+
registry.add("hCorrel2DVsPtNonPromptDplusPhysicalPrimaryMcRecBMother", stringDHadron + "non-prompt D (only true primary particles)" + stringSignal, {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtD}, {axisPtHadron}, {axisPtBMother}, {axisDeltaPhiBMother}}});
274+
registry.add("hCorrel2DVsPtSignalRegionNonPromptDplusNonPromptHadronMcRecBMother", stringDHadron + "signal region NonPromptD - NonPrompt Track MC reco", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtD}, {axisPtHadron}, {axisPtBMother}, {axisDeltaPhiBMother}}});
275+
276+
registry.get<THnSparse>(HIST("hCorrel2DVsPtNonPromptDplusPhysicalPrimaryMcRecBMother"))->Sumw2();
277+
registry.get<THnSparse>(HIST("hCorrel2DVsPtSignalRegionNonPromptDplusNonPromptHadronMcRecBMother"))->Sumw2();
278+
}
262279
}
263280
// Histograms for MC Gen analysis
264281
if (fillHistoMcGen) {
@@ -274,6 +291,15 @@ struct HfTaskCorrelationDplusHadrons {
274291
registry.get<THnSparse>(HIST("hCorrel2DVsPtMcGen"))->Sumw2();
275292
registry.get<THnSparse>(HIST("hCorrel2DVsPtMcGenPrompt"))->Sumw2();
276293
registry.get<THnSparse>(HIST("hCorrel2DVsPtMcGenNonPrompt"))->Sumw2();
294+
295+
// beauty-mother information of non-prompt D+, same axes as the MC Rec counterparts to allow Rec/Gen ratios
296+
if (storeBMotherInfo) {
297+
registry.add("hCorrel2DVsPtMcGenNonPromptBMother", stringDHadron + " NonPrompt MC Gen", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtD}, {axisPtHadron}, {axisPtBMother}, {axisDeltaPhiBMother}}});
298+
registry.add("hCorrel2DVsPtMcGenNonPromptDNonPromptHadronBMother", stringDHadron + " non prompt D non prompt h MC Gen", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtD}, {axisPtHadron}, {axisPtBMother}, {axisDeltaPhiBMother}}});
299+
300+
registry.get<THnSparse>(HIST("hCorrel2DVsPtMcGenNonPromptBMother"))->Sumw2();
301+
registry.get<THnSparse>(HIST("hCorrel2DVsPtMcGenNonPromptDNonPromptHadronBMother"))->Sumw2();
302+
}
277303
}
278304
// Histograms for efficiencies
279305
registry.add("Efficiency/hPtCandMcRecPrompt", stringMCRecoDPrompt + stringPtD, {HistType::kTH1F, {axisPtD}});
@@ -439,8 +465,8 @@ struct HfTaskCorrelationDplusHadrons {
439465
PROCESS_SWITCH(HfTaskCorrelationDplusHadrons, processData, "Process data", false);
440466

441467
/// D-Hadron correlation pair filling task, from pair tables - for MC reco-level analysis (candidates matched to true signal only, but also bkg sources are studied)
442-
void processMcRec(DplusHadronPairFullWithMl const& pairEntries,
443-
soa::Join<aod::DplusRecoInfo, aod::DplusGenInfo> const& candidates)
468+
void processMcRec(DplusHadronPairFullWithMlAndBMother const& pairEntries,
469+
soa::Join<aod::DplusRecoInfo, aod::DplusGenInfo, aod::BMotherCandInfo> const& candidates)
444470
{
445471
for (const auto& candidate : candidates) {
446472
float const massD = candidate.mD();
@@ -482,6 +508,10 @@ struct HfTaskCorrelationDplusHadrons {
482508
registry.fill(HIST("hMassNonPromptDplusVsPt"), massD, ptD, efficiencyWeightD);
483509
registry.fill(HIST("hBdtScorePrompt"), bdtScorePrompt);
484510
registry.fill(HIST("hBdtScoreBkg"), bdtScoreBkg);
511+
if (storeBMotherInfo) {
512+
registry.fill(HIST("hMassNonPromptDplusVsPtVsPtBMother"), massD, ptD, candidate.ptB(), efficiencyWeightD);
513+
registry.fill(HIST("hDeltaPhiBMotherVsPtVsPtBMother"), candidate.deltaPhiBtoD(), ptD, candidate.ptB(), efficiencyWeightD);
514+
}
485515
}
486516
}
487517
}
@@ -556,6 +586,15 @@ struct HfTaskCorrelationDplusHadrons {
556586
} else if (!isDplusPrompt && originHadron == RecoDecay::OriginType::NonPrompt) {
557587
registry.fill(HIST("hCorrel2DVsPtSignalRegionNonPromptDplusNonPromptHadronMcRec"), deltaPhi, deltaEta, ptD, ptHadron, poolBin, efficiencyWeight);
558588
}
589+
// beauty-mother information, only for true non-prompt D+, to study the structures in the MC Closure test
590+
if (storeBMotherInfo && pairEntry.signalStatus() && !isDplusPrompt) {
591+
float const ptB = pairEntry.ptB();
592+
float const deltaPhiBtoD = pairEntry.deltaPhiBtoD();
593+
registry.fill(HIST("hCorrel2DVsPtNonPromptDplusPhysicalPrimaryMcRecBMother"), deltaPhi, deltaEta, ptD, ptHadron, ptB, deltaPhiBtoD, efficiencyWeight);
594+
if (originHadron == RecoDecay::OriginType::NonPrompt) {
595+
registry.fill(HIST("hCorrel2DVsPtSignalRegionNonPromptDplusNonPromptHadronMcRecBMother"), deltaPhi, deltaEta, ptD, ptHadron, ptB, deltaPhiBtoD, efficiencyWeight);
596+
}
597+
}
559598
}
560599
}
561600
// in sideband left region
@@ -583,7 +622,7 @@ struct HfTaskCorrelationDplusHadrons {
583622
PROCESS_SWITCH(HfTaskCorrelationDplusHadrons, processMcRec, "Process MC Reco mode", true);
584623

585624
/// D-Hadron correlation pair filling task, from pair tables - for MC gen-level analysis (no filter/selection, only true signal)
586-
void processMcGen(DplusHadronPair const& pairEntries)
625+
void processMcGen(DplusHadronPairWithBMother const& pairEntries)
587626
{
588627
for (const auto& pairEntry : pairEntries) {
589628
// define variables for widely used quantities
@@ -608,6 +647,15 @@ struct HfTaskCorrelationDplusHadrons {
608647
if (originHadron == RecoDecay::OriginType::NonPrompt) {
609648
registry.fill(HIST("hCorrel2DVsPtMcGenNonPromptDNonPromptHadron"), deltaPhi, deltaEta, ptD, ptHadron, poolBin);
610649
}
650+
// beauty-mother information
651+
if (storeBMotherInfo) {
652+
float const ptB = pairEntry.ptB();
653+
float const deltaPhiBtoD = pairEntry.deltaPhiBtoD();
654+
registry.fill(HIST("hCorrel2DVsPtMcGenNonPromptBMother"), deltaPhi, deltaEta, ptD, ptHadron, ptB, deltaPhiBtoD);
655+
if (originHadron == RecoDecay::OriginType::NonPrompt) {
656+
registry.fill(HIST("hCorrel2DVsPtMcGenNonPromptDNonPromptHadronBMother"), deltaPhi, deltaEta, ptD, ptHadron, ptB, deltaPhiBtoD);
657+
}
658+
}
611659
}
612660
}
613661
}

0 commit comments

Comments
 (0)