diff --git a/PWGDQ/Core/VarManager.h b/PWGDQ/Core/VarManager.h index af177686e69..d8e65697aba 100644 --- a/PWGDQ/Core/VarManager.h +++ b/PWGDQ/Core/VarManager.h @@ -430,7 +430,7 @@ class VarManager : public TObject }; enum DileptonCharmHadronTypes { - kJPsiToMuMu = 0, + kJPsi = 0, kD0ToPiK, kD0barToKPi }; @@ -2191,7 +2191,7 @@ void VarManager::FillSingleDileptonCharmHadron(Cand const& candidate, H hfHelper values = fgValues; } - if constexpr (partType == kJPsiToMuMu) { + if constexpr (partType == kJPsi) { values[kMass] = candidate.mass(); values[kPt] = candidate.pt(); values[kPhi] = candidate.phi(); @@ -2214,7 +2214,7 @@ void VarManager::FillSingleDileptonCharmHadron(Cand const& candidate, H hfHelper template void VarManager::FillDileptonCharmHadron(DQ const& dilepton, HF const& charmHadron, H hfHelper, float* values) { - FillSingleDileptonCharmHadron(dilepton, hfHelper, values); + FillSingleDileptonCharmHadron(dilepton, hfHelper, values); FillSingleDileptonCharmHadron(charmHadron, hfHelper, values); } diff --git a/PWGDQ/TableProducer/tableMakerJpsiHf.cxx b/PWGDQ/TableProducer/tableMakerJpsiHf.cxx index 5071109d082..7cea0f540a2 100644 --- a/PWGDQ/TableProducer/tableMakerJpsiHf.cxx +++ b/PWGDQ/TableProducer/tableMakerJpsiHf.cxx @@ -37,7 +37,8 @@ using namespace o2::aod::hf_cand_2prong; // Declarations of various short names using MyEvents = soa::Join; -using MyPairCandidatesSelected = soa::Join; +using MyDileptonCandidatesSelected = soa::Join; +using MyDileptonCandidatesSelectedWithDca = soa::Join; using MyD0CandidatesSelected = soa::Join; using MyD0CandidatesSelectedWithBdt = soa::Join; @@ -71,12 +72,13 @@ struct tableMakerJpsiHf { Configurable configDebug{"configDebug", true, "If true, fill D0 - J/psi histograms separately"}; SliceCache cache; - Partition selectedDileptonCandidates = aod::reducedpair::mass > 1.0f && aod::reducedpair::mass < 5.0f && aod::reducedpair::sign == 0; + Partition selectedDileptonCandidates = aod::reducedpair::mass > 1.0f && aod::reducedpair::mass < 5.0f && aod::reducedpair::sign == 0; + Partition selectedDileptonCandidatesWithDca = aod::reducedpair::mass > 1.0f && aod::reducedpair::mass < 5.0f && aod::reducedpair::sign == 0; Partition selectedD0Candidates = aod::hf_sel_candidate_d0::isSelD0 >= 1 || aod::hf_sel_candidate_d0::isSelD0bar >= 1; Partition selectedD0CandidatesWithBdt = aod::hf_sel_candidate_d0::isSelD0 >= 1 || aod::hf_sel_candidate_d0::isSelD0bar >= 1; Preslice perCollisionDmeson = aod::hf_cand::collisionId; - Preslice perCollisionDilepton = aod::reducedpair::collisionId; + Preslice perCollisionDilepton = aod::reducedpair::collisionId; // Define histograms manager float* fValuesDileptonCharmHadron{}; @@ -102,7 +104,7 @@ struct tableMakerJpsiHf { // Template function to run pair - hadron combinations // TODO: generalise to all charm-hadron species - template + template void runDileptonDmeson(TDqTrack const& dileptons, THfTrack const& dmesons, MyEvents::iterator const& collision) { VarManager::ResetValues(0, VarManager::kNVars, fValuesDileptonCharmHadron); @@ -151,7 +153,7 @@ struct tableMakerJpsiHf { } if (configDebug) { - VarManager::FillSingleDileptonCharmHadron(dilepton, hfHelper, fValuesDileptonCharmHadron); + VarManager::FillSingleDileptonCharmHadron(dilepton, hfHelper, fValuesDileptonCharmHadron); fHistMan->FillHistClass("JPsi", fValuesDileptonCharmHadron); VarManager::ResetValues(0, VarManager::kNVars, fValuesDileptonCharmHadron); } @@ -177,7 +179,11 @@ struct tableMakerJpsiHf { isCollSel = true; } auto indexRed = redCollisions.lastIndex(); - redDileptons(indexRed, dilepton.px(), dilepton.py(), dilepton.pz(), dilepton.mass(), dilepton.sign(), dilepton.mcDecision(), dilepton.tauz(), dilepton.lz(), dilepton.lxy()); + if constexpr (withDca) { + redDileptons(indexRed, dilepton.px(), dilepton.py(), dilepton.pz(), dilepton.mass(), dilepton.sign(), dilepton.mcDecision(), dilepton.tauz(), dilepton.lz(), dilepton.lxy()); + } else { + redDileptons(indexRed, dilepton.px(), dilepton.py(), dilepton.pz(), dilepton.mass(), dilepton.sign(), dilepton.mcDecision(), 0, 0, 0); + } redDmesons(indexRed, dmeson.px(), dmeson.py(), dmeson.pz(), dmeson.xSecondaryVertex(), dmeson.ySecondaryVertex(), dmeson.zSecondaryVertex(), 0, 0); if constexpr (withBdt) { auto scores = dmeson.mlProbD0(); @@ -207,25 +213,25 @@ struct tableMakerJpsiHf { } // process J/psi - D0 - void processJspiD0(MyEvents const& collisions, MyPairCandidatesSelected const& dileptons, MyD0CandidatesSelected const& dmesons) + void processJspiD0(MyEvents const& collisions, MyDileptonCandidatesSelected const& dileptons, MyD0CandidatesSelected const& dmesons) { redCollCounter(collisions.size()); for (auto& collision : collisions) { auto groupedDmesonCandidates = selectedD0Candidates->sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); auto groupedDileptonCandidates = selectedDileptonCandidates->sliceByCached(aod::reducedpair::collisionId, collision.globalIndex(), cache); - runDileptonDmeson(groupedDileptonCandidates, groupedDmesonCandidates, collision); + runDileptonDmeson(groupedDileptonCandidates, groupedDmesonCandidates, collision); } } PROCESS_SWITCH(tableMakerJpsiHf, processJspiD0, "Process J/psi - D0", true); // process J/psi - D0 adding the BDT output scores to the D0 table - void processJspiD0WithBdt(MyEvents const& collisions, MyPairCandidatesSelected const& dileptons, MyD0CandidatesSelectedWithBdt const& dmesons) + void processJspiD0WithBdt(MyEvents const& collisions, MyDileptonCandidatesSelected const& dileptons, MyD0CandidatesSelectedWithBdt const& dmesons) { redCollCounter(collisions.size()); for (auto& collision : collisions) { auto groupedDmesonCandidates = selectedD0CandidatesWithBdt->sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); auto groupedDileptonCandidates = selectedDileptonCandidates->sliceByCached(aod::reducedpair::collisionId, collision.globalIndex(), cache); - runDileptonDmeson(groupedDileptonCandidates, groupedDmesonCandidates, collision); + runDileptonDmeson(groupedDileptonCandidates, groupedDmesonCandidates, collision); } } PROCESS_SWITCH(tableMakerJpsiHf, processJspiD0WithBdt, "Process J/psi - D0", true); diff --git a/PWGDQ/Tasks/tableReader.cxx b/PWGDQ/Tasks/tableReader.cxx index a40833ec181..3d2f7bc3c9b 100644 --- a/PWGDQ/Tasks/tableReader.cxx +++ b/PWGDQ/Tasks/tableReader.cxx @@ -993,6 +993,9 @@ struct AnalysisSameEventPairing { dileptonFilterMap = twoTrackFilter; dileptonList(event, VarManager::fgValues[VarManager::kMass], VarManager::fgValues[VarManager::kPt], VarManager::fgValues[VarManager::kEta], VarManager::fgValues[VarManager::kPhi], t1.sign() + t2.sign(), dileptonFilterMap, dileptonMcDecision); + if constexpr (TPairType == pairTypeMuMu) { + dileptonInfoList(t1.collisionId(), event.posX(), event.posY(), event.posZ()); + } constexpr bool trackHasCov = ((TTrackFillMap & VarManager::ObjTypes::TrackCov) > 0 || (TTrackFillMap & VarManager::ObjTypes::ReducedTrackBarrelCov) > 0); if constexpr ((TPairType == pairTypeEE) && trackHasCov) { @@ -1002,7 +1005,6 @@ struct AnalysisSameEventPairing { if constexpr ((TPairType == pairTypeMuMu) && muonHasCov) { // LOGP(info, "mu1 collId = {}, mu2 collId = {}", t1.collisionId(), t2.collisionId()); dileptonExtraList(t1.globalIndex(), t2.globalIndex(), VarManager::fgValues[VarManager::kVertexingTauz], VarManager::fgValues[VarManager::kVertexingLz], VarManager::fgValues[VarManager::kVertexingLxy]); - dileptonInfoList(t1.collisionId(), event.posX(), event.posY(), event.posZ()); if (fConfigFlatTables.value) { dimuonAllList(event.posX(), event.posY(), event.posZ(), event.numContrib(), -999., -999., -999.,