Skip to content

Commit a1c3d64

Browse files
jinhyunniJinhyun Parkalibuild
authored
[PWGHF] [xic0omegac0] Update code to fix PID assignment in KFParticle (#16381)
Co-authored-by: Jinhyun Park <jinhyun@Jinhyunui-MacBookPro.local> Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent 7141922 commit a1c3d64

1 file changed

Lines changed: 53 additions & 26 deletions

File tree

PWGHF/TableProducer/candidateCreatorXic0Omegac0Qa.cxx

Lines changed: 53 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ struct HfCandidateCreatorXic0Omegac0Qa {
261261
int pdgIdOfV0DauPos{}, pdgIdOfV0DauNeg{}, pdgIdOfBach{}, pdgIdOfCharmBach{};
262262
int pdgIdOfV0{}, pdgIdOfCascade{}, pdgIdOfCharmBaryon{};
263263

264-
// Track PID - Used in DCAFitter
264+
// Track PID: PID value of tracks defined under o2::track::PID namespace
265265
int trackPidOfCascade{};
266266

267267
// Mass of daughter tracks & V0s & cascades & charm baryons;
@@ -362,20 +362,21 @@ struct HfCandidateCreatorXic0Omegac0Qa {
362362
massOfV0 = o2::constants::physics::MassLambda;
363363
massOfCascade = o2::constants::physics::MassOmegaMinus;
364364
}
365-
LOGF(info, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
366-
LOGF(info, "PDG ID of V0 positive daughter: %d", pdgIdOfV0DauPos);
367-
LOGF(info, "PDG ID of V0 negative daughter: %d", pdgIdOfV0DauNeg);
368-
LOGF(info, "PDG ID of Bachelor: %d", pdgIdOfBach);
369-
LOGF(info, "PDG ID of Charm Bachelor: %d", pdgIdOfCharmBach);
370-
LOGF(info, "-------------------------------------------");
371-
LOGF(info, "PDG ID of V0: %d", pdgIdOfV0);
372-
LOGF(info, "PDG ID of Cascade: %d", pdgIdOfCascade);
373-
LOGF(info, "PDG ID of Charm Baryon: %d", pdgIdOfCharmBaryon);
374-
LOGF(info, "-------------------------------------------");
375-
LOGF(info, "Mass of V0 set as: %f", massOfV0);
376-
LOGF(info, "Mass of CharmBach set as: %f", massOfCharmBach);
377-
LOGF(info, "Mass of Casc as: %f", massOfCascade);
378-
LOGF(info, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
365+
LOGF(info, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
366+
LOGF(info, " Chosen reconstruction info: ToXiPi(%d)/ ToOmegaPi(%d)/ ToOmegaKa(%d)", xipiEnabledDca + xipiEnabledKf, omegapiEnabledDca + omegapiEnabledKf, omegakaEnabledDca + omegakaEnabledKf);
367+
LOGF(info, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
368+
LOGF(info, " PDG ID of V0 positive daughter: %d", pdgIdOfV0DauPos);
369+
LOGF(info, " PDG ID of V0 negative daughter: %d", pdgIdOfV0DauNeg);
370+
LOGF(info, " PDG ID of V0: %d", pdgIdOfV0);
371+
LOGF(info, " PDG ID of Bachelor: %d", pdgIdOfBach);
372+
LOGF(info, " PDG ID of Cascade: %d", pdgIdOfCascade);
373+
LOGF(info, " PDG ID of Charm Bachelor: %d", pdgIdOfCharmBach);
374+
LOGF(info, " PDG ID of Charm Baryon: %d", pdgIdOfCharmBaryon);
375+
LOGF(info, "-----------------------------------------------------------------------");
376+
LOGF(info, " Mass of V0 set as: %f", massOfV0);
377+
LOGF(info, " Mass of CharmBach set as: %f", massOfCharmBach);
378+
LOGF(info, " Mass of Casc as: %f", massOfCascade);
379+
LOGF(info, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
379380

380381
// Add histogram to indicate which sv method was used
381382
registry.add("hVertexerType", "Use KF or DCAFitterN;Vertexer type;entries", {kTH1F, {{2, 0.0, 2.0}}});
@@ -491,6 +492,30 @@ struct HfCandidateCreatorXic0Omegac0Qa {
491492

492493
} // end of initialization
493494

495+
// helper function to convert PDG of KFParticle object into appropriate track PID.
496+
// exclusively used to make input of getTrackParCovFromKFP()
497+
// \brief kfPdg is Pdg value of KFParticle object
498+
o2::track::PID::ID convertPDGIntoPID(const int kfPdg)
499+
{
500+
switch (std::abs(kfPdg)) {
501+
case kPiPlus:
502+
return o2::track::PID::Pion;
503+
case kKPlus:
504+
return o2::track::PID::Kaon;
505+
case kProton:
506+
return o2::track::PID::Proton;
507+
case kLambda0:
508+
return o2::track::PID::Lambda;
509+
case kXiMinus:
510+
return o2::track::PID::XiMinus;
511+
case kOmegaMinus:
512+
return o2::track::PID::OmegaMinus;
513+
default:
514+
LOGF(fatal, "Undefined PDG value from KFParticle given for conversion(%d). Replace it with PID of Pion", kfPdg);
515+
return o2::track::PID::Pion;
516+
}
517+
}
518+
494519
// template function for running charm baryon reconstruction with DCAFitter
495520
/// \brief centEstimator is for different centrality estimators
496521
/// \brief decayChannel is for different decay channels. 0 for XiczeroOmegaczeroToXiPi, 1 for OmegaczeroToOmegaPi, 2 for OmegaczeroToOmeagaK
@@ -934,6 +959,7 @@ struct HfCandidateCreatorXic0Omegac0Qa {
934959
const KFPTrack kfTrackBach = createKFPTrackFromTrack(bachTrack);
935960

936961
bool isAnti = (bachTrack.signed1Pt() > 0 ? true : false);
962+
int bachCharge = (bachTrack.signed1Pt() > 0 ? +1 : -1);
937963

938964
KFParticle kfPos(kfTrack0, (isAnti ? -pdgIdOfV0DauNeg : pdgIdOfV0DauPos));
939965
KFParticle kfNeg(kfTrack1, (isAnti ? -pdgIdOfV0DauPos : pdgIdOfV0DauNeg));
@@ -1082,6 +1108,18 @@ struct HfCandidateCreatorXic0Omegac0Qa {
10821108
kfCharmBaryonToPv.SetProductionVertex(kfPv);
10831109

10841110
//----------Reconstruct information after vertex fit----------
1111+
auto trackParCovV0DauPos = getTrackParCovFromKFP(kfPos, convertPDGIntoPID(kfPos.GetPDG()), 1);
1112+
auto trackParCovV0DauNeg = getTrackParCovFromKFP(kfNeg, convertPDGIntoPID(kfNeg.GetPDG()), -1);
1113+
auto trackParCovBach = getTrackParCovFromKFP(kfBachToCasc, convertPDGIntoPID(kfBachToCasc.GetPDG()), bachCharge);
1114+
auto trackParCovCharmBach = getTrackParCovFromKFP(kfCharmBachToCharmBaryon, convertPDGIntoPID(kfCharmBachToCharmBaryon.GetPDG()), -bachCharge);
1115+
auto trackParCovCasc = getTrackParCovFromKFP(kfCascToCharmBaryon, convertPDGIntoPID(kfCascToCharmBaryon.GetPDG()), bachCharge);
1116+
1117+
trackParCovV0DauPos.setAbsCharge(1);
1118+
trackParCovV0DauNeg.setAbsCharge(1);
1119+
trackParCovBach.setAbsCharge(1);
1120+
trackParCovCharmBach.setAbsCharge(1);
1121+
trackParCovCasc.setAbsCharge(1);
1122+
10851123
std::array<float, 3> vertexV0 = {kfV0.GetX(), kfV0.GetY(), kfV0.GetZ()};
10861124
std::array<float, 3> vertexCasc = {kfCasc.GetX(), kfCasc.GetY(), kfCasc.GetZ()};
10871125

@@ -1098,17 +1136,6 @@ struct HfCandidateCreatorXic0Omegac0Qa {
10981136

10991137
std::array<float, 3> pvCoord = {collision.posX(), collision.posY(), collision.posZ()};
11001138

1101-
auto trackParCovV0DauPos = getTrackParCovFromKFP(kfPos, kfPos.GetPDG(), 1);
1102-
auto trackParCovV0DauNeg = getTrackParCovFromKFP(kfNeg, kfNeg.GetPDG(), -1);
1103-
auto trackParCovBach = getTrackParCovFromKFP(kfBachToCasc, kfBachToCasc.GetPDG(), (isAnti ? 1 : -1));
1104-
auto trackParCovCharmBach = getTrackParCovFromKFP(kfCharmBachToCharmBaryon, kfCharmBachToCharmBaryon.GetPDG(), (isAnti ? -1 : 1));
1105-
auto trackParCovCasc = getTrackParCovFromKFP(kfCascToCharmBaryon, kfCascToCharmBaryon.GetPDG(), (isAnti ? 1 : -1));
1106-
trackParCovV0DauPos.setAbsCharge(1);
1107-
trackParCovV0DauNeg.setAbsCharge(1);
1108-
trackParCovBach.setAbsCharge(1);
1109-
trackParCovCharmBach.setAbsCharge(1);
1110-
trackParCovCasc.setAbsCharge(1);
1111-
11121139
//----------Calculate physical quantities and fill candidate table----------
11131140

11141141
// impact parameters

0 commit comments

Comments
 (0)