Skip to content
Open
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
47 changes: 10 additions & 37 deletions PWGHF/TableProducer/candidateCreatorXic0Omegac0Qa.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -258,16 +258,15 @@ struct HfCandidateCreatorXic0Omegac0Qa {
HfEventSelection hfEvSel;

// PDG Id of daughter tracks & V0s & cascades & charm baryons - Used in KFParticle
int pdgIdOfV0DauPos, pdgIdOfV0DauNeg, pdgIdOfBach, pdgIdOfCharmBach;
int pdgIdOfAntiV0DauPos, pdgIdOfAntiV0DauNeg, pdgIdOfAntiBach, pdgIdOfAntiCharmBach;
int pdgIdOfV0, pdgIdOfCascade, pdgIdOfCharmBaryon;
int pdgIdOfV0DauPos{}, pdgIdOfV0DauNeg{}, pdgIdOfBach{}, pdgIdOfCharmBach{};
int pdgIdOfV0{}, pdgIdOfCascade{}, pdgIdOfCharmBaryon{};

// Track PID - Used in DCAFitter
int trackPidOfCascade;
int trackPidOfCascade{};

// Mass of daughter tracks & V0s & cascades & charm baryons;
float massOfV0DauPos, massOfV0DauNeg, massOfBach, massOfCharmBach;
float massOfV0, massOfCascade, massOfCharmBaryon;
float massOfV0DauPos{}, massOfV0DauNeg{}, massOfCharmBach{};
float massOfV0{}, massOfCascade{};

// Pointer of histograms for QA
std::shared_ptr<TH1> hInvMassCharmBaryonToXiPi, hInvMassCharmBaryonToOmegaPi, hInvMassCharmBaryonToOmegaKa;
Expand Down Expand Up @@ -317,11 +316,6 @@ struct HfCandidateCreatorXic0Omegac0Qa {
pdgIdOfBach = kPiMinus;
pdgIdOfCharmBach = kPiPlus;

pdgIdOfAntiV0DauPos = kPiPlus;
pdgIdOfAntiV0DauNeg = kProton;
pdgIdOfAntiBach = kPiPlus;
pdgIdOfAntiCharmBach = kPiMinus;

pdgIdOfV0 = kLambda0;
pdgIdOfCascade = kXiMinus;
pdgIdOfCharmBaryon = kXiC0;
Expand All @@ -339,11 +333,6 @@ struct HfCandidateCreatorXic0Omegac0Qa {
pdgIdOfBach = kKMinus;
pdgIdOfCharmBach = kPiPlus;

pdgIdOfAntiV0DauPos = kPiPlus;
pdgIdOfAntiV0DauNeg = kProton;
pdgIdOfAntiBach = kKPlus;
pdgIdOfAntiCharmBach = kPiMinus;

pdgIdOfV0 = kLambda0;
pdgIdOfCascade = kOmegaMinus;
pdgIdOfCharmBaryon = kOmegaC0;
Expand All @@ -361,11 +350,6 @@ struct HfCandidateCreatorXic0Omegac0Qa {
pdgIdOfBach = kKMinus;
pdgIdOfCharmBach = kKPlus;

pdgIdOfAntiV0DauPos = kPiPlus;
pdgIdOfAntiV0DauNeg = kProton;
pdgIdOfAntiBach = kKPlus;
pdgIdOfAntiCharmBach = kKMinus;

pdgIdOfV0 = kLambda0;
pdgIdOfCascade = kOmegaMinus;
pdgIdOfCharmBaryon = kOmegaC0;
Expand All @@ -384,11 +368,6 @@ struct HfCandidateCreatorXic0Omegac0Qa {
LOGF(info, "PDG ID of Bachelor: %d", pdgIdOfBach);
LOGF(info, "PDG ID of Charm Bachelor: %d", pdgIdOfCharmBach);
LOGF(info, "-------------------------------------------");
LOGF(info, "PDG ID of anti V0 positive daughter: %d", pdgIdOfAntiV0DauPos);
LOGF(info, "PDG ID of anti V0 negative daughter: %d", pdgIdOfAntiV0DauNeg);
LOGF(info, "PDG ID of anti Bachelor: %d", pdgIdOfAntiBach);
LOGF(info, "PDG ID of anti Charm Bachelor: %d", pdgIdOfAntiCharmBach);
LOGF(info, "-------------------------------------------");
LOGF(info, "PDG ID of V0: %d", pdgIdOfV0);
LOGF(info, "PDG ID of Cascade: %d", pdgIdOfCascade);
LOGF(info, "PDG ID of Charm Baryon: %d", pdgIdOfCharmBaryon);
Expand Down Expand Up @@ -512,12 +491,6 @@ struct HfCandidateCreatorXic0Omegac0Qa {

} // end of initialization

////////////////////////////////////////////////////////////
// //
// Candidate reconstruction with DCAFitter //
// //
////////////////////////////////////////////////////////////

// template function for running charm baryon reconstruction with DCAFitter
/// \brief centEstimator is for different centrality estimators
/// \brief decayChannel is for different decay channels. 0 for XiczeroOmegaczeroToXiPi, 1 for OmegaczeroToOmegaPi, 2 for OmegaczeroToOmeagaK
Expand Down Expand Up @@ -962,10 +935,10 @@ struct HfCandidateCreatorXic0Omegac0Qa {

bool isAnti = (bachTrack.signed1Pt() > 0 ? true : false);

KFParticle kfPos(kfTrack0, (isAnti ? pdgIdOfAntiV0DauPos : pdgIdOfV0DauPos));
KFParticle kfNeg(kfTrack1, (isAnti ? pdgIdOfAntiV0DauNeg : pdgIdOfV0DauNeg));
KFParticle kfBach(kfTrackBach, (isAnti ? pdgIdOfAntiBach : pdgIdOfBach));
KFParticle kfBachRej(kfTrackBach, (isAnti ? pdgIdOfAntiBach : pdgIdOfBach)); // Rej -> Used for Omegac0->OmegaPi only
KFParticle kfPos(kfTrack0, (isAnti ? -pdgIdOfV0DauNeg : pdgIdOfV0DauPos));
KFParticle kfNeg(kfTrack1, (isAnti ? -pdgIdOfV0DauPos : pdgIdOfV0DauNeg));
KFParticle kfBach(kfTrackBach, (isAnti ? -pdgIdOfBach : pdgIdOfBach));
KFParticle kfBachRej(kfTrackBach, (isAnti ? -pdgIdOfBach : pdgIdOfBach)); // Rej -> Used for Omegac0->OmegaPi only

// ~~~~~~~Construct V0 with KF~~~~~~~
const KFParticle* v0Daughters[2] = {&kfPos, &kfNeg};
Expand Down Expand Up @@ -1049,7 +1022,7 @@ struct HfCandidateCreatorXic0Omegac0Qa {
//~~~~~~~Construct Charm Baryon with KF~~~~~~~
auto trackCharmBachelor = tracks.rawIteratorAt(cand.prong0Id());
const KFPTrack kfTrackCharmBach = createKFPTrackFromTrack(trackCharmBachelor);
const KFParticle kfCharmBach(kfTrackCharmBach, (isAnti ? pdgIdOfAntiCharmBach : pdgIdOfCharmBach));
const KFParticle kfCharmBach(kfTrackCharmBach, (isAnti ? -pdgIdOfCharmBach : pdgIdOfCharmBach));
const KFParticle* charmBaryonDaughters[2] = {&kfCharmBach, &kfCasc};

KFParticle kfCharmBaryon;
Expand Down
36 changes: 19 additions & 17 deletions PWGHF/TableProducer/candidateSelectorToXiPiQa.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -699,23 +699,6 @@ struct HfCandidateSelectorToXiPiQa {
statusInvMassCharmBaryon = true;
}

// ML BDT selection
if (applyMl) {
bool isSelectedMlXic0 = false;
std::vector<float> inputFeaturesXic0 = {};
if constexpr (svReco == doDcaFitter) {
inputFeaturesXic0 = hfMlResponseDca.getInputFeatures(candidate, trackPiFromLam, trackPiFromCasc, trackPiFromCharm);
isSelectedMlXic0 = hfMlResponseDca.isSelectedMl(inputFeaturesXic0, ptCandXic0, outputMlXic0ToXiPi);
} else {
inputFeaturesXic0 = hfMlResponseKf.getInputFeatures(candidate, trackPiFromLam, trackPiFromCasc, trackPiFromCharm);
isSelectedMlXic0 = hfMlResponseKf.isSelectedMl(inputFeaturesXic0, ptCandXic0, outputMlXic0ToXiPi);
}
if (!isSelectedMlXic0) {
continue;
}
hfMlToXiPi(outputMlXic0ToXiPi);
}

// Fill in selection result
if constexpr (svReco == doDcaFitter) {
hfSelToXiPi(statusPidLambda, statusPidCascade, statusPidCharmBaryon, statusInvMassLambda, statusInvMassCascade, statusInvMassCharmBaryon, resultSelections, infoTpcStored, infoTofStored,
Expand All @@ -732,6 +715,25 @@ struct HfCandidateSelectorToXiPiQa {
trackPiFromCharm.tofNSigmaPi(), trackPiFromCasc.tofNSigmaPi(), trackPiFromLam.tofNSigmaPi(), trackPrFromLam.tofNSigmaPr());
}

// ML BDT selection if required
if (applyMl) {
bool isSelectedMlXic0 = false;
std::vector<float> inputFeaturesXic0 = {};
if constexpr (svReco == doDcaFitter) {
inputFeaturesXic0 = hfMlResponseDca.getInputFeatures(candidate, trackPiFromLam, trackPiFromCasc, trackPiFromCharm);
isSelectedMlXic0 = hfMlResponseDca.isSelectedMl(inputFeaturesXic0, ptCandXic0, outputMlXic0ToXiPi);
} else {
inputFeaturesXic0 = hfMlResponseKf.getInputFeatures(candidate, trackPiFromLam, trackPiFromCasc, trackPiFromCharm);
isSelectedMlXic0 = hfMlResponseKf.isSelectedMl(inputFeaturesXic0, ptCandXic0, outputMlXic0ToXiPi);
}

hfMlToXiPi(outputMlXic0ToXiPi);

if (!isSelectedMlXic0) {
continue;
}
}

// Fill in invariant mass histogram
if (resultSelections) {
registry.fill(HIST("hInvMassCharmBaryonWoPidInvMassCut"), invMassCharmBaryon);
Expand Down
Loading