Skip to content

Commit 979bbb0

Browse files
jinhyunniJinhyun Parkalibuild
authored
[PWGHF] [xic0omegac0] Updated candidate creator & candidate selector (#16042)
Co-authored-by: Jinhyun Park <jinhyun@Jinhyunui-MacBookPro.local> Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent 63af69a commit 979bbb0

2 files changed

Lines changed: 33 additions & 58 deletions

File tree

PWGHF/TableProducer/candidateCreatorXic0Omegac0Qa.cxx

Lines changed: 10 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -258,16 +258,15 @@ struct HfCandidateCreatorXic0Omegac0Qa {
258258
HfEventSelection hfEvSel;
259259

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

265264
// Track PID - Used in DCAFitter
266-
int trackPidOfCascade;
265+
int trackPidOfCascade{};
267266

268267
// Mass of daughter tracks & V0s & cascades & charm baryons;
269-
float massOfV0DauPos, massOfV0DauNeg, massOfBach, massOfCharmBach;
270-
float massOfV0, massOfCascade, massOfCharmBaryon;
268+
float massOfV0DauPos{}, massOfV0DauNeg{}, massOfCharmBach{};
269+
float massOfV0{}, massOfCascade{};
271270

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

320-
pdgIdOfAntiV0DauPos = kPiPlus;
321-
pdgIdOfAntiV0DauNeg = kProton;
322-
pdgIdOfAntiBach = kPiPlus;
323-
pdgIdOfAntiCharmBach = kPiMinus;
324-
325319
pdgIdOfV0 = kLambda0;
326320
pdgIdOfCascade = kXiMinus;
327321
pdgIdOfCharmBaryon = kXiC0;
@@ -339,11 +333,6 @@ struct HfCandidateCreatorXic0Omegac0Qa {
339333
pdgIdOfBach = kKMinus;
340334
pdgIdOfCharmBach = kPiPlus;
341335

342-
pdgIdOfAntiV0DauPos = kPiPlus;
343-
pdgIdOfAntiV0DauNeg = kProton;
344-
pdgIdOfAntiBach = kKPlus;
345-
pdgIdOfAntiCharmBach = kPiMinus;
346-
347336
pdgIdOfV0 = kLambda0;
348337
pdgIdOfCascade = kOmegaMinus;
349338
pdgIdOfCharmBaryon = kOmegaC0;
@@ -361,11 +350,6 @@ struct HfCandidateCreatorXic0Omegac0Qa {
361350
pdgIdOfBach = kKMinus;
362351
pdgIdOfCharmBach = kKPlus;
363352

364-
pdgIdOfAntiV0DauPos = kPiPlus;
365-
pdgIdOfAntiV0DauNeg = kProton;
366-
pdgIdOfAntiBach = kKPlus;
367-
pdgIdOfAntiCharmBach = kKMinus;
368-
369353
pdgIdOfV0 = kLambda0;
370354
pdgIdOfCascade = kOmegaMinus;
371355
pdgIdOfCharmBaryon = kOmegaC0;
@@ -384,11 +368,6 @@ struct HfCandidateCreatorXic0Omegac0Qa {
384368
LOGF(info, "PDG ID of Bachelor: %d", pdgIdOfBach);
385369
LOGF(info, "PDG ID of Charm Bachelor: %d", pdgIdOfCharmBach);
386370
LOGF(info, "-------------------------------------------");
387-
LOGF(info, "PDG ID of anti V0 positive daughter: %d", pdgIdOfAntiV0DauPos);
388-
LOGF(info, "PDG ID of anti V0 negative daughter: %d", pdgIdOfAntiV0DauNeg);
389-
LOGF(info, "PDG ID of anti Bachelor: %d", pdgIdOfAntiBach);
390-
LOGF(info, "PDG ID of anti Charm Bachelor: %d", pdgIdOfAntiCharmBach);
391-
LOGF(info, "-------------------------------------------");
392371
LOGF(info, "PDG ID of V0: %d", pdgIdOfV0);
393372
LOGF(info, "PDG ID of Cascade: %d", pdgIdOfCascade);
394373
LOGF(info, "PDG ID of Charm Baryon: %d", pdgIdOfCharmBaryon);
@@ -512,12 +491,6 @@ struct HfCandidateCreatorXic0Omegac0Qa {
512491

513492
} // end of initialization
514493

515-
////////////////////////////////////////////////////////////
516-
// //
517-
// Candidate reconstruction with DCAFitter //
518-
// //
519-
////////////////////////////////////////////////////////////
520-
521494
// template function for running charm baryon reconstruction with DCAFitter
522495
/// \brief centEstimator is for different centrality estimators
523496
/// \brief decayChannel is for different decay channels. 0 for XiczeroOmegaczeroToXiPi, 1 for OmegaczeroToOmegaPi, 2 for OmegaczeroToOmeagaK
@@ -962,10 +935,10 @@ struct HfCandidateCreatorXic0Omegac0Qa {
962935

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

965-
KFParticle kfPos(kfTrack0, (isAnti ? pdgIdOfAntiV0DauPos : pdgIdOfV0DauPos));
966-
KFParticle kfNeg(kfTrack1, (isAnti ? pdgIdOfAntiV0DauNeg : pdgIdOfV0DauNeg));
967-
KFParticle kfBach(kfTrackBach, (isAnti ? pdgIdOfAntiBach : pdgIdOfBach));
968-
KFParticle kfBachRej(kfTrackBach, (isAnti ? pdgIdOfAntiBach : pdgIdOfBach)); // Rej -> Used for Omegac0->OmegaPi only
938+
KFParticle kfPos(kfTrack0, (isAnti ? -pdgIdOfV0DauNeg : pdgIdOfV0DauPos));
939+
KFParticle kfNeg(kfTrack1, (isAnti ? -pdgIdOfV0DauPos : pdgIdOfV0DauNeg));
940+
KFParticle kfBach(kfTrackBach, (isAnti ? -pdgIdOfBach : pdgIdOfBach));
941+
KFParticle kfBachRej(kfTrackBach, (isAnti ? -pdgIdOfBach : pdgIdOfBach)); // Rej -> Used for Omegac0->OmegaPi only
969942

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

10551028
KFParticle kfCharmBaryon;

PWGHF/TableProducer/candidateSelectorToXiPiQa.cxx

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ struct HfCandidateSelectorToXiPiQa {
295295
// Selection on LF related informations
296296
// returns true if all cuts are passed
297297
template <int svReco, typename T>
298-
bool SelectOnLF(const T& candidate, const int& inputPtBin)
298+
bool selectOnLf(const T& candidate, const int& inputPtBin)
299299
{
300300

301301
registry.fill(HIST("hSelStatusLf"), 0.0);
@@ -442,7 +442,7 @@ struct HfCandidateSelectorToXiPiQa {
442442
// Apply cuts with charm baryon & charm bachelor related informations
443443
// returns true if all cuts are passed
444444
template <int svReco, typename T>
445-
bool SelectOnHF(const T& candidate, const int& inputPtBin)
445+
bool selectOnHf(const T& candidate, const int& inputPtBin)
446446
{
447447

448448
registry.fill(HIST("hSelStatusHf"), 0.0);
@@ -561,8 +561,8 @@ struct HfCandidateSelectorToXiPiQa {
561561
}
562562

563563
// Topological selection
564-
const bool selectionResOnLF = SelectOnLF<svReco>(candidate, pTBin);
565-
const bool selectionResOnHF = SelectOnHF<svReco>(candidate, pTBin);
564+
const bool selectionResOnLF = selectOnLf<svReco>(candidate, pTBin);
565+
const bool selectionResOnHF = selectOnHf<svReco>(candidate, pTBin);
566566
if (!selectionResOnLF || !selectionResOnHF) {
567567
resultSelections = false;
568568
}
@@ -699,23 +699,6 @@ struct HfCandidateSelectorToXiPiQa {
699699
statusInvMassCharmBaryon = true;
700700
}
701701

702-
// ML BDT selection
703-
if (applyMl) {
704-
bool isSelectedMlXic0 = false;
705-
std::vector<float> inputFeaturesXic0 = {};
706-
if constexpr (svReco == doDcaFitter) {
707-
inputFeaturesXic0 = hfMlResponseDca.getInputFeatures(candidate, trackPiFromLam, trackPiFromCasc, trackPiFromCharm);
708-
isSelectedMlXic0 = hfMlResponseDca.isSelectedMl(inputFeaturesXic0, ptCandXic0, outputMlXic0ToXiPi);
709-
} else {
710-
inputFeaturesXic0 = hfMlResponseKf.getInputFeatures(candidate, trackPiFromLam, trackPiFromCasc, trackPiFromCharm);
711-
isSelectedMlXic0 = hfMlResponseKf.isSelectedMl(inputFeaturesXic0, ptCandXic0, outputMlXic0ToXiPi);
712-
}
713-
if (!isSelectedMlXic0) {
714-
continue;
715-
}
716-
hfMlToXiPi(outputMlXic0ToXiPi);
717-
}
718-
719702
// Fill in selection result
720703
if constexpr (svReco == doDcaFitter) {
721704
hfSelToXiPi(statusPidLambda, statusPidCascade, statusPidCharmBaryon, statusInvMassLambda, statusInvMassCascade, statusInvMassCharmBaryon, resultSelections, infoTpcStored, infoTofStored,
@@ -732,6 +715,25 @@ struct HfCandidateSelectorToXiPiQa {
732715
trackPiFromCharm.tofNSigmaPi(), trackPiFromCasc.tofNSigmaPi(), trackPiFromLam.tofNSigmaPi(), trackPrFromLam.tofNSigmaPr());
733716
}
734717

718+
// ML BDT selection if required
719+
if (applyMl) {
720+
bool isSelectedMlXic0 = false;
721+
std::vector<float> inputFeaturesXic0 = {};
722+
if constexpr (svReco == doDcaFitter) {
723+
inputFeaturesXic0 = hfMlResponseDca.getInputFeatures(candidate, trackPiFromLam, trackPiFromCasc, trackPiFromCharm);
724+
isSelectedMlXic0 = hfMlResponseDca.isSelectedMl(inputFeaturesXic0, ptCandXic0, outputMlXic0ToXiPi);
725+
} else {
726+
inputFeaturesXic0 = hfMlResponseKf.getInputFeatures(candidate, trackPiFromLam, trackPiFromCasc, trackPiFromCharm);
727+
isSelectedMlXic0 = hfMlResponseKf.isSelectedMl(inputFeaturesXic0, ptCandXic0, outputMlXic0ToXiPi);
728+
}
729+
730+
hfMlToXiPi(outputMlXic0ToXiPi);
731+
732+
if (!isSelectedMlXic0) {
733+
continue;
734+
}
735+
}
736+
735737
// Fill in invariant mass histogram
736738
if (resultSelections) {
737739
registry.fill(HIST("hInvMassCharmBaryonWoPidInvMassCut"), invMassCharmBaryon);

0 commit comments

Comments
 (0)