Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions PWGHF/HFC/DataModel/CorrelationTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,21 @@ DECLARE_SOA_TABLE(TrkRecInfoDplus, "AOD", "TRKRECINFODPLUS", //! Tracks Reconstr
aod::hf_correlation_dplus_hadron::TrackDcaZ,
aod::hf_correlation_dplus_hadron::TrackTPCNClsCrossedRows);

// definition of columns and tables for the beauty-mother information of the charm-hadron trigger (MC only), usable by any D-hadron correlation analysis
namespace hf_correlation_info_b_mother
{
DECLARE_SOA_COLUMN(PtB, ptB, float); //! Generated pT of the beauty mother of the charm hadron (-1 if not from beauty)
DECLARE_SOA_COLUMN(DeltaPhiBtoD, deltaPhiBtoD, float); //! phi(charm hadron) - phi(B mother, generated) in [-pihalf, 3.*pihalf) (-999 if not from beauty)
} // namespace hf_correlation_info_b_mother

DECLARE_SOA_TABLE(BMotherPairInfo, "AOD", "BMOTHERPAIRINFO", //! Charm-hadron-hadron pairs beauty-mother information, joinable with the pair table
aod::hf_correlation_info_b_mother::PtB,
aod::hf_correlation_info_b_mother::DeltaPhiBtoD);

DECLARE_SOA_TABLE(BMotherCandInfo, "AOD", "BMOTHERCANDINFO", //! Charm-hadron candidates beauty-mother information, joinable with the candidate table
aod::hf_correlation_info_b_mother::PtB,
aod::hf_correlation_info_b_mother::DeltaPhiBtoD);

// definition of columns and tables for Dstar-Hadron correlation pair
namespace hf_correlation_dstar_hadron
{
Expand Down
24 changes: 13 additions & 11 deletions PWGHF/HFC/DataModel/DerivedDataCorrelationTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,17 @@ using HfcRedCollision = HfcRedCollisions::iterator;

namespace hf_candidate_reduced
{
DECLARE_SOA_INDEX_COLUMN(HfcRedCollision, hfcRedCollision); //! ReducedCollision index
DECLARE_SOA_COLUMN(Prong0Id, prong0Id, int); //! Prong 0 index
DECLARE_SOA_COLUMN(Prong1Id, prong1Id, int); //! Prong 1 index
DECLARE_SOA_COLUMN(Prong2Id, prong2Id, int); //! Prong2 index
DECLARE_SOA_COLUMN(PhiCand, phiCand, float); //! Phi of the candidate
DECLARE_SOA_COLUMN(EtaCand, etaCand, float); //! Eta of the candidate
DECLARE_SOA_COLUMN(PtCand, ptCand, float); //! Pt of the candidate
DECLARE_SOA_COLUMN(InvMass, invMass, float); //! Invariant mass of charm candidate
DECLARE_SOA_COLUMN(BdtScorePrompt, bdtScorePrompt, float); //! BDT output score for prompt hypothesis
DECLARE_SOA_COLUMN(BdtScoreBkg, bdtScoreBkg, float); //! BDT output score for background hypothesis
DECLARE_SOA_INDEX_COLUMN(HfcRedCollision, hfcRedCollision); //! ReducedCollision index
DECLARE_SOA_COLUMN(Prong0Id, prong0Id, int); //! Prong 0 index
DECLARE_SOA_COLUMN(Prong1Id, prong1Id, int); //! Prong 1 index
DECLARE_SOA_COLUMN(Prong2Id, prong2Id, int); //! Prong2 index
DECLARE_SOA_COLUMN(PhiCand, phiCand, float); //! Phi of the candidate
DECLARE_SOA_COLUMN(EtaCand, etaCand, float); //! Eta of the candidate
DECLARE_SOA_COLUMN(PtCand, ptCand, float); //! Pt of the candidate
DECLARE_SOA_COLUMN(InvMass, invMass, float); //! Invariant mass of charm candidate
DECLARE_SOA_COLUMN(BdtScorePrompt, bdtScorePrompt, float); //! BDT output score for prompt hypothesis
DECLARE_SOA_COLUMN(BdtScoreNonPrompt, bdtScoreNonPrompt, float); //! BDT output score for non-prompt hypothesis
DECLARE_SOA_COLUMN(BdtScoreBkg, bdtScoreBkg, float); //! BDT output score for background hypothesis
} // namespace hf_candidate_reduced
DECLARE_SOA_TABLE(HcCandReduceds, "AOD", "HCCANDREDUCED", //! Table with charm hadron candidate info
soa::Index<>,
Expand All @@ -72,8 +73,9 @@ DECLARE_SOA_TABLE(HcCandReduceds, "AOD", "HCCANDREDUCED", //! Table with charm h
DECLARE_SOA_TABLE(HcCandSelInfos, "AOD", "HCCANDSELINFO", //! Table with charm hadron candidate selection info
soa::Index<>,
aod::hf_candidate_reduced::HfcRedCollisionId,
aod::hf_candidate_reduced::BdtScoreBkg,
aod::hf_candidate_reduced::BdtScorePrompt,
aod::hf_candidate_reduced::BdtScoreBkg);
aod::hf_candidate_reduced::BdtScoreNonPrompt);

namespace hf_assoc_track_reduced
{
Expand Down
23 changes: 20 additions & 3 deletions PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "PWGHF/DataModel/TrackIndexSkimmingTables.h"
#include "PWGHF/HFC/DataModel/CorrelationTables.h"
#include "PWGHF/HFC/DataModel/DerivedDataCorrelationTables.h"
#include "PWGHF/HFC/Utils/utilsCorrelations.h"
#include "PWGHF/Utils/utilsAnalysis.h"

#include "Common/CCDB/EventSelectionParams.h"
Expand Down Expand Up @@ -186,9 +187,12 @@ struct HfCorrelatorDplusHadrons {
Produces<aod::HcCandSelInfos> candSelInfo;
Produces<aod::AssocTrackReds> assocTrackReduced;
Produces<aod::AssocTrackSels> assocTrackSelInfo;
Produces<aod::BMotherPairInfo> entryDplusHadronBMotherInfo;
Produces<aod::BMotherCandInfo> entryDplusCandBMotherInfo;

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

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

// beauty-mother information
const auto [ptB, deltaPhiBtoD] = hf_correlations::getBMotherInfoMcGen(particle, particlesToLoop);

for (const auto& particleAssoc : groupedMcParticles) {

if (std::abs(particleAssoc.eta()) > etaTrackMax ||
Expand Down Expand Up @@ -447,6 +454,7 @@ struct HfCorrelatorDplusHadrons {
entryDplusHadronGenInfo(isDplusPrompt,
particleAssoc.isPhysicalPrimary(),
trackOrigin);
entryDplusHadronBMotherInfo(ptB, deltaPhiBtoD);
}
}
}
Expand Down Expand Up @@ -552,7 +560,7 @@ struct HfCorrelatorDplusHadrons {

int indexHfcReducedCollision = collReduced.lastIndex() + 1;

// Ds fill histograms and Dplus candidates information stored
// Dplus candidates information stored
for (const auto& candidate : candsDplusThisColl) {
std::vector<float> outputMl = {-1., -1., -1.};
// candidate selected
Expand All @@ -561,7 +569,8 @@ struct HfCorrelatorDplusHadrons {
outputMl[iclass] = candidate.mlProbDplusToPiKPi()[classMl->at(iclass)];
}
candReduced(indexHfcReducedCollision, candidate.phi(), candidate.eta(), candidate.pt(), HfHelper::invMassDplusToPiKPi(candidate), candidate.prong0Id(), candidate.prong1Id(), candidate.prong2Id());
candSelInfo(indexHfcReducedCollision, outputMl[0], outputMl[2]);
// Check compatibility with the candidate selector options: BdtScoreBkg, BdtScorePrompt, BdtScoreNonPrompt
candSelInfo(indexHfcReducedCollision, outputMl[0], outputMl[1], outputMl[2]);
}
}

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

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

// fill invariant mass plots from Dplus signal and background candidates
registry.fill(HIST("hMassDplusMcRec"), HfHelper::invMassDplusToPiKPi(candidate), efficiencyWeightD);
Expand Down Expand Up @@ -663,6 +674,7 @@ struct HfCorrelatorDplusHadrons {
registry.fill(HIST("hMassDplusMcRecSig"), HfHelper::invMassDplusToPiKPi(candidate), candidate.pt(), efficiencyWeightD);
entryDplusCandRecoInfo(HfHelper::invMassDplusToPiKPi(candidate), candidate.pt(), outputMl[0], outputMl[1], outputMl[2]);
entryDplusCandGenInfo(isDplusPrompt);
entryDplusCandBMotherInfo(ptB, deltaPhiBtoD);
} else {
registry.fill(HIST("hPtCandMcRecBkg"), candidate.pt());
registry.fill(HIST("hEtaMcRecBkg"), candidate.eta());
Expand Down Expand Up @@ -691,6 +703,7 @@ struct HfCorrelatorDplusHadrons {
track.pt(), poolBin);
entryDplusHadronRecoInfo(HfHelper::invMassDplusToPiKPi(candidate), isDplusSignal);
entryDplusHadronMlInfo(outputMl[0], outputMl[1], outputMl[2]);
entryDplusHadronBMotherInfo(ptB, deltaPhiBtoD);
if (track.has_mcParticle()) {
auto mcParticle = track.template mcParticle_as<aod::McParticles>();
isPhysicalPrimary = mcParticle.isPhysicalPrimary();
Expand Down Expand Up @@ -866,6 +879,8 @@ struct HfCorrelatorDplusHadrons {
poolBin);
entryDplusHadronRecoInfo(HfHelper::invMassDplusToPiKPi(candidate), isDplusSignal);
entryDplusHadronGenInfo(isDplusPrompt, isPhysicalPrimary, trackOrigin);
const auto [ptB, deltaPhiBtoD] = hf_correlations::getBMotherInfoMcRec<TracksWithMc>(candidate, mcParticles, Pdg::kDPlus, DepthMaxDplusDaughters);
entryDplusHadronBMotherInfo(ptB, deltaPhiBtoD);
for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) {
outputMl[iclass] = candidate.mlProbDplusToPiKPi()[classMl->at(iclass)];
}
Expand Down Expand Up @@ -910,6 +925,8 @@ struct HfCorrelatorDplusHadrons {
poolBin);
entryDplusHadronRecoInfo(MassDPlus, true);
entryDplusHadronGenInfo(isDplusPrompt, particleAssoc.isPhysicalPrimary(), trackOrigin);
const auto [ptB, deltaPhiBtoD] = hf_correlations::getBMotherInfoMcGen(candidate, mcParticles);
entryDplusHadronBMotherInfo(ptB, deltaPhiBtoD);
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,6 @@ struct HfCorrelatorDsHadrons {
entryTrackRecoInfo(track.dcaXY(), track.dcaZ(), track.tpcNClsCrossedRows());
} else if (isCorrectInvMassHypo && candidate.isSelDsToPiKK() >= selectionFlagDs) {
// if (track.has_mcParticle()) {
auto mcParticle = track.template mcParticle_as<aod::McParticles>();
entryDsHadronPair(getDeltaPhi(track.phi(), candidate.phi()),
track.eta() - candidate.eta(),
candidate.pt() * chargeDs,
Expand Down Expand Up @@ -859,13 +858,14 @@ struct HfCorrelatorDsHadrons {
outputMl[iclass] = candidate.mlProbDsToKKPi()[classMl->at(iclass)];
}
candReduced(indexHfcReducedCollision, candidate.phi(), candidate.eta(), candidate.pt() * chargeDs, HfHelper::invMassDsToKKPi(candidate), candidate.prong0Id(), candidate.prong1Id(), candidate.prong2Id());
candSelInfo(indexHfcReducedCollision, outputMl[0], outputMl[2]);
// Check compatibility with the candidate selector options; candSelInfo considers BdtScoreBkg, BdtScorePrompt, BdtScoreNonPrompt
candSelInfo(indexHfcReducedCollision, outputMl[2], outputMl[0], outputMl[1]); // bkg, prompt, non-prompt (Ds convention: outputMl[0] = prompt, outputMl[2] = bkg)
} else if (candidate.isSelDsToPiKK() >= selectionFlagDs) {
for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) {
outputMl[iclass] = candidate.mlProbDsToPiKK()[classMl->at(iclass)];
}
candReduced(indexHfcReducedCollision, candidate.phi(), candidate.eta(), candidate.pt() * chargeDs, HfHelper::invMassDsToPiKK(candidate), candidate.prong0Id(), candidate.prong1Id(), candidate.prong2Id());
candSelInfo(indexHfcReducedCollision, outputMl[0], outputMl[2]);
candSelInfo(indexHfcReducedCollision, outputMl[2], outputMl[0], outputMl[1]); // bkg, prompt, non-prompt (Ds convention: outputMl[0] = prompt, outputMl[2] = bkg)
}
}

Expand Down
Loading
Loading