@@ -262,8 +262,6 @@ struct HfCandidateCreatorXic0Omegac0Qa {
262262 int pdgIdOfV0{}, pdgIdOfCascade{}, pdgIdOfCharmBaryon{};
263263
264264 // Track PID: PID value of tracks defined under o2::track::PID namespace
265- int trackPidOfV0DauPos{}, trackPidOfV0DauNeg{};
266- int trackPidOfBach{}, trackPidOfCharmBach{};
267265 int trackPidOfCascade{};
268266
269267 // Mass of daughter tracks & V0s & cascades & charm baryons;
@@ -322,10 +320,6 @@ struct HfCandidateCreatorXic0Omegac0Qa {
322320 pdgIdOfCascade = kXiMinus ;
323321 pdgIdOfCharmBaryon = kXiC0 ;
324322
325- trackPidOfV0DauPos = o2::track::PID::Proton;
326- trackPidOfV0DauNeg = o2::track::PID::Pion;
327- trackPidOfBach = o2::track::PID::Pion;
328- trackPidOfCharmBach = o2::track::PID::Pion;
329323 trackPidOfCascade = o2::track::PID::XiMinus;
330324
331325 massOfCharmBach = o2::constants::physics::MassPiPlus;
@@ -343,10 +337,6 @@ struct HfCandidateCreatorXic0Omegac0Qa {
343337 pdgIdOfCascade = kOmegaMinus ;
344338 pdgIdOfCharmBaryon = kOmegaC0 ;
345339
346- trackPidOfV0DauPos = o2::track::PID::Proton;
347- trackPidOfV0DauNeg = o2::track::PID::Pion;
348- trackPidOfBach = o2::track::PID::Kaon;
349- trackPidOfCharmBach = o2::track::PID::Pion;
350340 trackPidOfCascade = o2::track::PID::OmegaMinus;
351341
352342 massOfCharmBach = o2::constants::physics::MassPiPlus;
@@ -364,10 +354,6 @@ struct HfCandidateCreatorXic0Omegac0Qa {
364354 pdgIdOfCascade = kOmegaMinus ;
365355 pdgIdOfCharmBaryon = kOmegaC0 ;
366356
367- trackPidOfV0DauPos = o2::track::PID::Proton;
368- trackPidOfV0DauNeg = o2::track::PID::Pion;
369- trackPidOfBach = o2::track::PID::Kaon;
370- trackPidOfCharmBach = o2::track::PID::Kaon;
371357 trackPidOfCascade = o2::track::PID::OmegaMinus;
372358
373359 massOfCharmBach = o2::constants::physics::MassKPlus;
@@ -381,17 +367,10 @@ struct HfCandidateCreatorXic0Omegac0Qa {
381367 LOGF (info, " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" );
382368 LOGF (info, " PDG ID of V0 positive daughter: %d" , pdgIdOfV0DauPos);
383369 LOGF (info, " PDG ID of V0 negative daughter: %d" , pdgIdOfV0DauNeg);
384- LOGF (info, " PDG ID of Bachelor: %d" , pdgIdOfBach);
385- LOGF (info, " PDG ID of Charm Bachelor: %d" , pdgIdOfCharmBach);
386- LOGF (info, " -----------------------------------------------------------------------" );
387- LOGF (info, " Track PID of V0 Dau Pos: %d" , trackPidOfV0DauPos);
388- LOGF (info, " Track PID of V0 Dau Neg: %d" , trackPidOfV0DauNeg);
389- LOGF (info, " Track PID of Bach: %d" , trackPidOfBach);
390- LOGF (info, " Track PID of Charm Bach: %d" , trackPidOfCharmBach);
391- LOGF (info, " Track PID of Cascade: %d" , trackPidOfCascade);
392- LOGF (info, " -----------------------------------------------------------------------" );
393370 LOGF (info, " PDG ID of V0: %d" , pdgIdOfV0);
371+ LOGF (info, " PDG ID of Bachelor: %d" , pdgIdOfBach);
394372 LOGF (info, " PDG ID of Cascade: %d" , pdgIdOfCascade);
373+ LOGF (info, " PDG ID of Charm Bachelor: %d" , pdgIdOfCharmBach);
395374 LOGF (info, " PDG ID of Charm Baryon: %d" , pdgIdOfCharmBaryon);
396375 LOGF (info, " -----------------------------------------------------------------------" );
397376 LOGF (info, " Mass of V0 set as: %f" , massOfV0);
@@ -513,6 +492,29 @@ struct HfCandidateCreatorXic0Omegac0Qa {
513492
514493 } // end of initialization
515494
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" , kfPdg);
515+ }
516+ }
517+
516518 // template function for running charm baryon reconstruction with DCAFitter
517519 // / \brief centEstimator is for different centrality estimators
518520 // / \brief decayChannel is for different decay channels. 0 for XiczeroOmegaczeroToXiPi, 1 for OmegaczeroToOmegaPi, 2 for OmegaczeroToOmeagaK
@@ -956,6 +958,7 @@ struct HfCandidateCreatorXic0Omegac0Qa {
956958 const KFPTrack kfTrackBach = createKFPTrackFromTrack (bachTrack);
957959
958960 bool isAnti = (bachTrack.signed1Pt () > 0 ? true : false );
961+ int bachCharge= (bachTrack.signed1Pt () > 0 ? +1 : -1 );
959962
960963 KFParticle kfPos (kfTrack0, (isAnti ? -pdgIdOfV0DauNeg : pdgIdOfV0DauPos));
961964 KFParticle kfNeg (kfTrack1, (isAnti ? -pdgIdOfV0DauPos : pdgIdOfV0DauNeg));
@@ -1104,11 +1107,11 @@ struct HfCandidateCreatorXic0Omegac0Qa {
11041107 kfCharmBaryonToPv.SetProductionVertex (kfPv);
11051108
11061109 // ----------Reconstruct information after vertex fit----------
1107- auto trackParCovV0DauPos = getTrackParCovFromKFP (kfPos, (isAnti ? trackPidOfV0DauNeg : trackPidOfV0DauPos ), 1 );
1108- auto trackParCovV0DauNeg = getTrackParCovFromKFP (kfNeg, (isAnti ? trackPidOfV0DauPos : trackPidOfV0DauNeg ), -1 );
1109- auto trackParCovBach = getTrackParCovFromKFP (kfBachToCasc, trackPidOfBach, (isAnti ? 1 : - 1 ) );
1110- auto trackParCovCharmBach = getTrackParCovFromKFP (kfCharmBachToCharmBaryon, trackPidOfCharmBach, (isAnti ? - 1 : 1 ) );
1111- auto trackParCovCasc = getTrackParCovFromKFP (kfCascToCharmBaryon, trackPidOfCascade, (isAnti ? 1 : - 1 ) );
1110+ auto trackParCovV0DauPos = getTrackParCovFromKFP (kfPos, convertPDGIntoPID (kfPos. GetPDG () ), 1 );
1111+ auto trackParCovV0DauNeg = getTrackParCovFromKFP (kfNeg, convertPDGIntoPID (kfNeg. GetPDG () ), -1 );
1112+ auto trackParCovBach = getTrackParCovFromKFP (kfBachToCasc, convertPDGIntoPID (kfBachToCasc. GetPDG ()), bachCharge );
1113+ auto trackParCovCharmBach = getTrackParCovFromKFP (kfCharmBachToCharmBaryon, convertPDGIntoPID (kfCharmBachToCharmBaryon. GetPDG ()), -bachCharge );
1114+ auto trackParCovCasc = getTrackParCovFromKFP (kfCascToCharmBaryon, convertPDGIntoPID (kfCascToCharmBaryon. GetPDG ()), bachCharge );
11121115
11131116 trackParCovV0DauPos.setAbsCharge (1 );
11141117 trackParCovV0DauNeg.setAbsCharge (1 );
0 commit comments