Skip to content

Commit e453690

Browse files
authored
[PWGHF] D+-h corr: add pTB to MC process functions (#18279)
1 parent 02b7f9f commit e453690

6 files changed

Lines changed: 165 additions & 22 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_info_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_info_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_info_b_mother::PtB,
509+
aod::hf_correlation_info_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_info_b_mother::PtB,
513+
aod::hf_correlation_info_b_mother::DeltaPhiBtoD);
514+
500515
// definition of columns and tables for Dstar-Hadron correlation pair
501516
namespace hf_correlation_dstar_hadron
502517
{

‎PWGHF/HFC/DataModel/DerivedDataCorrelationTables.h‎

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,17 @@ using HfcRedCollision = HfcRedCollisions::iterator;
4747

4848
namespace hf_candidate_reduced
4949
{
50-
DECLARE_SOA_INDEX_COLUMN(HfcRedCollision, hfcRedCollision); //! ReducedCollision index
51-
DECLARE_SOA_COLUMN(Prong0Id, prong0Id, int); //! Prong 0 index
52-
DECLARE_SOA_COLUMN(Prong1Id, prong1Id, int); //! Prong 1 index
53-
DECLARE_SOA_COLUMN(Prong2Id, prong2Id, int); //! Prong2 index
54-
DECLARE_SOA_COLUMN(PhiCand, phiCand, float); //! Phi of the candidate
55-
DECLARE_SOA_COLUMN(EtaCand, etaCand, float); //! Eta of the candidate
56-
DECLARE_SOA_COLUMN(PtCand, ptCand, float); //! Pt of the candidate
57-
DECLARE_SOA_COLUMN(InvMass, invMass, float); //! Invariant mass of charm candidate
58-
DECLARE_SOA_COLUMN(BdtScorePrompt, bdtScorePrompt, float); //! BDT output score for prompt hypothesis
59-
DECLARE_SOA_COLUMN(BdtScoreBkg, bdtScoreBkg, float); //! BDT output score for background hypothesis
50+
DECLARE_SOA_INDEX_COLUMN(HfcRedCollision, hfcRedCollision); //! ReducedCollision index
51+
DECLARE_SOA_COLUMN(Prong0Id, prong0Id, int); //! Prong 0 index
52+
DECLARE_SOA_COLUMN(Prong1Id, prong1Id, int); //! Prong 1 index
53+
DECLARE_SOA_COLUMN(Prong2Id, prong2Id, int); //! Prong2 index
54+
DECLARE_SOA_COLUMN(PhiCand, phiCand, float); //! Phi of the candidate
55+
DECLARE_SOA_COLUMN(EtaCand, etaCand, float); //! Eta of the candidate
56+
DECLARE_SOA_COLUMN(PtCand, ptCand, float); //! Pt of the candidate
57+
DECLARE_SOA_COLUMN(InvMass, invMass, float); //! Invariant mass of charm candidate
58+
DECLARE_SOA_COLUMN(BdtScorePrompt, bdtScorePrompt, float); //! BDT output score for prompt hypothesis
59+
DECLARE_SOA_COLUMN(BdtScoreNonPrompt, bdtScoreNonPrompt, float); //! BDT output score for non-prompt hypothesis
60+
DECLARE_SOA_COLUMN(BdtScoreBkg, bdtScoreBkg, float); //! BDT output score for background hypothesis
6061
} // namespace hf_candidate_reduced
6162
DECLARE_SOA_TABLE(HcCandReduceds, "AOD", "HCCANDREDUCED", //! Table with charm hadron candidate info
6263
soa::Index<>,
@@ -72,8 +73,9 @@ DECLARE_SOA_TABLE(HcCandReduceds, "AOD", "HCCANDREDUCED", //! Table with charm h
7273
DECLARE_SOA_TABLE(HcCandSelInfos, "AOD", "HCCANDSELINFO", //! Table with charm hadron candidate selection info
7374
soa::Index<>,
7475
aod::hf_candidate_reduced::HfcRedCollisionId,
76+
aod::hf_candidate_reduced::BdtScoreBkg,
7577
aod::hf_candidate_reduced::BdtScorePrompt,
76-
aod::hf_candidate_reduced::BdtScoreBkg);
78+
aod::hf_candidate_reduced::BdtScoreNonPrompt);
7779

7880
namespace hf_assoc_track_reduced
7981
{

‎PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx‎

Lines changed: 20 additions & 3 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
@@ -561,7 +569,8 @@ struct HfCorrelatorDplusHadrons {
561569
outputMl[iclass] = candidate.mlProbDplusToPiKPi()[classMl->at(iclass)];
562570
}
563571
candReduced(indexHfcReducedCollision, candidate.phi(), candidate.eta(), candidate.pt(), HfHelper::invMassDplusToPiKPi(candidate), candidate.prong0Id(), candidate.prong1Id(), candidate.prong2Id());
564-
candSelInfo(indexHfcReducedCollision, outputMl[0], outputMl[2]);
572+
// Check compatibility with the candidate selector options: BdtScoreBkg, BdtScorePrompt, BdtScoreNonPrompt
573+
candSelInfo(indexHfcReducedCollision, outputMl[0], outputMl[1], outputMl[2]);
565574
}
566575
}
567576

@@ -631,6 +640,8 @@ struct HfCorrelatorDplusHadrons {
631640
bool isDplusNonPrompt = candidate.originMcRec() == RecoDecay::OriginType::NonPrompt;
632641

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

635646
// fill invariant mass plots from Dplus signal and background candidates
636647
registry.fill(HIST("hMassDplusMcRec"), HfHelper::invMassDplusToPiKPi(candidate), efficiencyWeightD);
@@ -663,6 +674,7 @@ struct HfCorrelatorDplusHadrons {
663674
registry.fill(HIST("hMassDplusMcRecSig"), HfHelper::invMassDplusToPiKPi(candidate), candidate.pt(), efficiencyWeightD);
664675
entryDplusCandRecoInfo(HfHelper::invMassDplusToPiKPi(candidate), candidate.pt(), outputMl[0], outputMl[1], outputMl[2]);
665676
entryDplusCandGenInfo(isDplusPrompt);
677+
entryDplusCandBMotherInfo(ptB, deltaPhiBtoD);
666678
} else {
667679
registry.fill(HIST("hPtCandMcRecBkg"), candidate.pt());
668680
registry.fill(HIST("hEtaMcRecBkg"), candidate.eta());
@@ -691,6 +703,7 @@ struct HfCorrelatorDplusHadrons {
691703
track.pt(), poolBin);
692704
entryDplusHadronRecoInfo(HfHelper::invMassDplusToPiKPi(candidate), isDplusSignal);
693705
entryDplusHadronMlInfo(outputMl[0], outputMl[1], outputMl[2]);
706+
entryDplusHadronBMotherInfo(ptB, deltaPhiBtoD);
694707
if (track.has_mcParticle()) {
695708
auto mcParticle = track.template mcParticle_as<aod::McParticles>();
696709
isPhysicalPrimary = mcParticle.isPhysicalPrimary();
@@ -866,6 +879,8 @@ struct HfCorrelatorDplusHadrons {
866879
poolBin);
867880
entryDplusHadronRecoInfo(HfHelper::invMassDplusToPiKPi(candidate), isDplusSignal);
868881
entryDplusHadronGenInfo(isDplusPrompt, isPhysicalPrimary, trackOrigin);
882+
const auto [ptB, deltaPhiBtoD] = hf_correlations::getBMotherInfoMcRec<TracksWithMc>(candidate, mcParticles, Pdg::kDPlus, DepthMaxDplusDaughters);
883+
entryDplusHadronBMotherInfo(ptB, deltaPhiBtoD);
869884
for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) {
870885
outputMl[iclass] = candidate.mlProbDplusToPiKPi()[classMl->at(iclass)];
871886
}
@@ -910,6 +925,8 @@ struct HfCorrelatorDplusHadrons {
910925
poolBin);
911926
entryDplusHadronRecoInfo(MassDPlus, true);
912927
entryDplusHadronGenInfo(isDplusPrompt, particleAssoc.isPhysicalPrimary(), trackOrigin);
928+
const auto [ptB, deltaPhiBtoD] = hf_correlations::getBMotherInfoMcGen(candidate, mcParticles);
929+
entryDplusHadronBMotherInfo(ptB, deltaPhiBtoD);
913930
}
914931
}
915932
}

‎PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,6 @@ struct HfCorrelatorDsHadrons {
673673
entryTrackRecoInfo(track.dcaXY(), track.dcaZ(), track.tpcNClsCrossedRows());
674674
} else if (isCorrectInvMassHypo && candidate.isSelDsToPiKK() >= selectionFlagDs) {
675675
// if (track.has_mcParticle()) {
676-
auto mcParticle = track.template mcParticle_as<aod::McParticles>();
677676
entryDsHadronPair(getDeltaPhi(track.phi(), candidate.phi()),
678677
track.eta() - candidate.eta(),
679678
candidate.pt() * chargeDs,
@@ -859,13 +858,14 @@ struct HfCorrelatorDsHadrons {
859858
outputMl[iclass] = candidate.mlProbDsToKKPi()[classMl->at(iclass)];
860859
}
861860
candReduced(indexHfcReducedCollision, candidate.phi(), candidate.eta(), candidate.pt() * chargeDs, HfHelper::invMassDsToKKPi(candidate), candidate.prong0Id(), candidate.prong1Id(), candidate.prong2Id());
862-
candSelInfo(indexHfcReducedCollision, outputMl[0], outputMl[2]);
861+
// Check compatibility with the candidate selector options; candSelInfo considers BdtScoreBkg, BdtScorePrompt, BdtScoreNonPrompt
862+
candSelInfo(indexHfcReducedCollision, outputMl[2], outputMl[0], outputMl[1]); // bkg, prompt, non-prompt (Ds convention: outputMl[0] = prompt, outputMl[2] = bkg)
863863
} else if (candidate.isSelDsToPiKK() >= selectionFlagDs) {
864864
for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) {
865865
outputMl[iclass] = candidate.mlProbDsToPiKK()[classMl->at(iclass)];
866866
}
867867
candReduced(indexHfcReducedCollision, candidate.phi(), candidate.eta(), candidate.pt() * chargeDs, HfHelper::invMassDsToPiKK(candidate), candidate.prong0Id(), candidate.prong1Id(), candidate.prong2Id());
868-
candSelInfo(indexHfcReducedCollision, outputMl[0], outputMl[2]);
868+
candSelInfo(indexHfcReducedCollision, outputMl[2], outputMl[0], outputMl[1]); // bkg, prompt, non-prompt (Ds convention: outputMl[0] = prompt, outputMl[2] = bkg)
869869
}
870870
}
871871

0 commit comments

Comments
 (0)