@@ -143,6 +143,7 @@ struct HfCandidateCreator3Prong {
143143 // KF
144144 Configurable<bool > applyTopoConstraint{" applyTopoConstraint" , false , " apply origin from PV hypothesis for created candidate, works only in KF mode" };
145145 Configurable<bool > applyInvMassConstraint{" applyInvMassConstraint" , false , " apply particle type hypothesis to recalculate created candidate's momentum, works only in KF mode" };
146+ Configurable<bool > kfConstructWithEnergyFitMc{" kfConstructWithEnergyFitMc" , true , " for details see https://github.com/alisw/KFParticle/blob/a00323cd7b022430abcb3c43f18188b291b0c803/KFParticle/KFParticleBase.cxx#L625" };
146147
147148 Configurable<LabeledArray<float >> tpcPidBBParamsLightNuclei{" tpcPidBBParamsLightNuclei" , {hf_presel_lightnuclei::BetheBlochParams[0 ], hf_presel_lightnuclei::NParticleRows, hf_presel_lightnuclei::NBetheBlochParams, hf_presel_lightnuclei::labelsRowsNucleiType, hf_presel_lightnuclei::labelsBetheBlochParams}, " TPC PID Bethe–Bloch parameter configurations for light nuclei (deuteron, triton, helium-3, alpha)" };
148149
@@ -475,6 +476,8 @@ struct HfCandidateCreator3Prong {
475476 TracksWCovExtraPidPiKaPrLightNuclei const &,
476477 BCsType const & bcs)
477478 {
479+ const int kfConstructMethod = kfConstructWithEnergyFitMc ? 2 : 0 ;
480+
478481 for (const auto & rowTrackIndexProng3 : rowsTrackIndexProng3) {
479482 // / reject candidates in collisions not satisfying the event selections
480483 auto collision = rowTrackIndexProng3.template collision_as <Coll>();
@@ -582,10 +585,10 @@ struct HfCandidateCreator3Prong {
582585 // Λc± → p± K∓ π±, Ξc± → p± K∓ π±
583586 KFParticle kfCandPKPi;
584587 const KFParticle* kfDaughtersPKPi[3 ] = {&kfFirstProton, &kfSecondKaon, &kfThirdPion};
585- kfCandPKPi.SetConstructMethod (2 );
588+ kfCandPKPi.SetConstructMethod (kfConstructMethod );
586589 KFParticle kfCandPiKP;
587590 const KFParticle* kfDaughtersPiKP[3 ] = {&kfFirstPion, &kfSecondKaon, &kfThirdProton};
588- kfCandPiKP.SetConstructMethod (2 );
591+ kfCandPiKP.SetConstructMethod (kfConstructMethod );
589592 if (createLc || createXic) {
590593 kfCandPKPi.Construct (kfDaughtersPKPi, 3 );
591594 kfCandPiKP.Construct (kfDaughtersPiKP, 3 );
@@ -595,7 +598,7 @@ struct HfCandidateCreator3Prong {
595598 // D± → π± K∓ π±
596599 KFParticle kfCandPiKPi;
597600 const KFParticle* kfDaughtersPiKPi[3 ] = {&kfFirstPion, &kfSecondKaon, &kfThirdPion};
598- kfCandPiKPi.SetConstructMethod (2 );
601+ kfCandPiKPi.SetConstructMethod (kfConstructMethod );
599602 if (createDplus) {
600603 kfCandPiKPi.Construct (kfDaughtersPiKPi, 3 );
601604 if (kfCandGeneric == nullptr ) {
@@ -606,10 +609,10 @@ struct HfCandidateCreator3Prong {
606609 // Ds± → K± K∓ π±
607610 KFParticle kfCandKKPi;
608611 const KFParticle* kfDaughtersKKPi[3 ] = {&kfFirstKaon, &kfSecondKaon, &kfThirdPion};
609- kfCandKKPi.SetConstructMethod (2 );
612+ kfCandKKPi.SetConstructMethod (kfConstructMethod );
610613 KFParticle kfCandPiKK;
611614 const KFParticle* kfDaughtersPiKK[3 ] = {&kfFirstPion, &kfSecondKaon, &kfThirdKaon};
612- kfCandPiKK.SetConstructMethod (2 );
615+ kfCandPiKK.SetConstructMethod (kfConstructMethod );
613616 if (createDs) {
614617 kfCandKKPi.Construct (kfDaughtersKKPi, 3 );
615618 kfCandPiKK.Construct (kfDaughtersPiKK, 3 );
@@ -619,7 +622,7 @@ struct HfCandidateCreator3Prong {
619622 }
620623
621624 if (kfCandGeneric == nullptr ) {
622- // should never happen, but for redundunt safety
625+ // should never happen, but for redundant safety
623626 LOGP (fatal, " kfCandGeneric was not assigned with address of any candidate hypothesis. Check the create<...> configurables" );
624627 }
625628
@@ -634,12 +637,12 @@ struct HfCandidateCreator3Prong {
634637
635638 KFParticle kfPairKPi;
636639 const KFParticle* kfDaughtersKPi[2 ] = {&kfSecondKaon, &kfThirdPion};
637- kfPairKPi.SetConstructMethod (2 );
640+ kfPairKPi.SetConstructMethod (kfConstructMethod );
638641 kfPairKPi.Construct (kfDaughtersKPi, 2 );
639642
640643 KFParticle kfPairPiK;
641644 const KFParticle* kfDaughtersPiK[2 ] = {&kfFirstPion, &kfSecondKaon};
642- kfPairPiK.SetConstructMethod (2 );
645+ kfPairPiK.SetConstructMethod (kfConstructMethod );
643646 kfPairPiK.Construct (kfDaughtersPiK, 2 );
644647
645648 const float massPKPi = kfCandPKPi.GetMass ();
0 commit comments