@@ -53,6 +53,7 @@ struct ConfKinkFilters : o2::framework::ConfigurableGroup {
5353 o2::framework::Configurable<float > etaMax{" etaMax" , 10 .f , " Maximum eta" };
5454 o2::framework::Configurable<float > phiMin{" phiMin" , 0 .f , " Minimum phi" };
5555 o2::framework::Configurable<float > phiMax{" phiMax" , 1 .f * o2::constants::math::TwoPI, " Maximum phi" };
56+ o2::framework::Configurable<bool > kinkPhiAtPv{" kinkPhiAtPv" , true , " Kinks and PCM SigmaPlus: store the azimuth of the Sigma momentum at the primary vertex" };
5657 o2::framework::Configurable<float > massMinSigma{" massMinSigma" , 1 .1f , " Minimum mass for Sigma hypothesis" };
5758 o2::framework::Configurable<float > massMaxSigma{" massMaxSigma" , 1 .3f , " Maximum mass for Sigma hypothesis" };
5859 o2::framework::Configurable<float > massMinSigmaPlus{" massMinSigmaPlus" , 1 .1f , " Minimum mass for SigmaPlus hypothesis" };
@@ -234,6 +235,7 @@ enum KinkFilters {
234235 kPhiMax ,
235236 kMassMin ,
236237 kMassMax ,
238+ kPhiAtPv ,
237239 kMlScoreMin ,
238240 kKinkFiltersMax
239241};
@@ -250,6 +252,7 @@ const std::unordered_map<KinkFilters, std::string> kinkFilterNames = {
250252 {kPhiMax , " phiMax" },
251253 {kMassMin , " massMin" },
252254 {kMassMax , " massMax" },
255+ {kPhiAtPv , " kinkPhiAtPv" },
253256 {kMlScoreMin , " mlScoreMin" }};
254257
255258// / \class KinkCuts
@@ -272,6 +275,7 @@ class KinkSelection : public baseselection::BaseSelection<float, o2::analysis::f
272275 mEtaMax = filter.etaMax .value ;
273276 mPhiMin = filter.phiMin .value ;
274277 mPhiMax = filter.phiMax .value ;
278+ mKinkPhiAtPv = filter.kinkPhiAtPv .value ;
275279
276280 if constexpr (modes::isEqual (kinkType, modes::Kink::kSigma )) {
277281 mMassSigmaLowerLimit = filter.massMinSigma .value ;
@@ -317,6 +321,7 @@ class KinkSelection : public baseselection::BaseSelection<float, o2::analysis::f
317321 {kinkFilterNames.at (kPhiMax ), mPhiMax },
318322 {kinkFilterNames.at (kMassMin ), mMassSigmaLowerLimit },
319323 {kinkFilterNames.at (kMassMax ), mMassSigmaUpperLimit },
324+ {kinkFilterNames.at (kPhiAtPv ), static_cast <float >(mKinkPhiAtPv )},
320325 });
321326 }
322327 if constexpr (modes::isEqual (kinkType, modes::Kink::kSigmaPlus )) {
@@ -331,6 +336,7 @@ class KinkSelection : public baseselection::BaseSelection<float, o2::analysis::f
331336 {kinkFilterNames.at (kPhiMax ), mPhiMax },
332337 {kinkFilterNames.at (kMassMin ), mMassSigmaPlusLowerLimit },
333338 {kinkFilterNames.at (kMassMax ), mMassSigmaPlusUpperLimit },
339+ {kinkFilterNames.at (kPhiAtPv ), static_cast <float >(mKinkPhiAtPv )},
334340 });
335341 }
336342 };
@@ -421,6 +427,9 @@ class KinkSelection : public baseselection::BaseSelection<float, o2::analysis::f
421427
422428 mKinkMotherEta = RecoDecay::eta (momMother);
423429 mKinkMotherPhi = RecoDecay::phi (momMother);
430+ if (mKinkPhiAtPv ) {
431+ mKinkMotherPhi = utils::phiAtPrimaryVertex (mKinkMotherPhi , kinkCand.xDecVtx (), kinkCand.yDecVtx ());
432+ }
424433
425434 // Recalculate pT using kinematic constraints of the decay channel
426435 float ptRecalc = -999 .f ;
@@ -468,6 +477,8 @@ class KinkSelection : public baseselection::BaseSelection<float, o2::analysis::f
468477 this ->template fillFilter <FilterHistName>(kPhiMax , p);
469478 pass &= p;
470479
480+ this ->template fillFilter <FilterHistName>(kPhiAtPv , mKinkPhiAtPv );
481+
471482 if constexpr (modes::isEqual (kinkType, modes::Kink::kSigma )) {
472483 float sigmaMass = kinkCand.mSigmaMinus ();
473484
@@ -517,6 +528,7 @@ class KinkSelection : public baseselection::BaseSelection<float, o2::analysis::f
517528 float mEtaMax = 1 .f;
518529 float mPhiMin = 0 .f;
519530 float mPhiMax = o2::constants::math::TwoPI;
531+ bool mKinkPhiAtPv = true ;
520532
521533 // mother kinematic
522534 float mKinkMotherPt = 0 .f; // recalculated pT (falls back to the original pT if the recalculation fails)
@@ -827,6 +839,7 @@ class SigmaPlusPcmSelection : public baseselection::BaseSelection<float, o2::ana
827839 mEtaMax = filter.etaMax .value ;
828840 mPhiMin = filter.phiMin .value ;
829841 mPhiMax = filter.phiMax .value ;
842+ mPhiAtPv = filter.kinkPhiAtPv .value ;
830843 mMassLowerLimit = filter.massMinSigmaPlusPcm .value ;
831844 mMassUpperLimit = filter.massMaxSigmaPlusPcm .value ;
832845 mMlScoreMin = filter.mlScoreMinSigmaPlusPcm .value ;
@@ -852,17 +865,21 @@ class SigmaPlusPcmSelection : public baseselection::BaseSelection<float, o2::ana
852865 {kinkFilterNames.at (kPhiMax ), mPhiMax },
853866 {kinkFilterNames.at (kMassMin ), mMassLowerLimit },
854867 {kinkFilterNames.at (kMassMax ), mMassUpperLimit },
868+ {kinkFilterNames.at (kPhiAtPv ), static_cast <float >(mPhiAtPv )},
855869 {kinkFilterNames.at (kMlScoreMin ), mMlScoreMin },
856870 });
857871 };
858872
859- template <typename T >
860- void computeKinematics (T const & sigmaPlusPcmCand)
873+ template <typename T1 , typename T2 >
874+ void computeKinematics (T1 const & sigmaPlusPcmCand, T2 const & col )
861875 {
862876 std::array<float , 3 > momMother = {sigmaPlusPcmCand.pxSigmaPlus (), sigmaPlusPcmCand.pySigmaPlus (), sigmaPlusPcmCand.pzSigmaPlus ()};
863877 mPt = RecoDecay::pt (momMother);
864878 mEta = RecoDecay::eta (momMother);
865879 mPhi = RecoDecay::phi (momMother);
880+ if (mPhiAtPv ) {
881+ mPhi = utils::phiAtPrimaryVertex (mPhi , sigmaPlusPcmCand.xDecVtx () - col.posX (), sigmaPlusPcmCand.yDecVtx () - col.posY ());
882+ }
866883 mMass = sigmaPlusPcmCand.massSigmaPlus ();
867884 mMlScore = sigmaPlusPcmCand.mlScore ();
868885 }
@@ -897,6 +914,8 @@ class SigmaPlusPcmSelection : public baseselection::BaseSelection<float, o2::ana
897914 this ->template fillFilter <FilterHistName>(kPhiMax , p);
898915 pass &= p;
899916
917+ this ->template fillFilter <FilterHistName>(kPhiAtPv , mPhiAtPv );
918+
900919 p = mMass > mMassLowerLimit ;
901920 this ->template fillFilter <FilterHistName>(kMassMin , p);
902921 pass &= p;
@@ -951,6 +970,7 @@ class SigmaPlusPcmSelection : public baseselection::BaseSelection<float, o2::ana
951970 float mEtaMin = -1 .f;
952971 float mEtaMax = 1 .f;
953972 float mPhiMin = 0 .f;
973+ bool mPhiAtPv = true ;
954974 float mPhiMax = o2::constants::math::TwoPI;
955975
956976 // mother kinematic
@@ -1015,7 +1035,7 @@ class SigmaPlusPcmBuilder
10151035 int64_t daughterIndex = 0 ;
10161036
10171037 for (const auto & sigmaPlusPcm : sigmaPlusPcms) {
1018- mSigmaPlusPcmSelection .computeKinematics (sigmaPlusPcm);
1038+ mSigmaPlusPcmSelection .computeKinematics (sigmaPlusPcm, col );
10191039 if (!mSigmaPlusPcmSelection .checkFilters (sigmaPlusPcm)) {
10201040 continue ;
10211041 }
@@ -1041,7 +1061,7 @@ class SigmaPlusPcmBuilder
10411061 int64_t daughterIndex = 0 ;
10421062
10431063 for (const auto & sigmaPlusPcm : sigmaPlusPcms) {
1044- mSigmaPlusPcmSelection .computeKinematics (sigmaPlusPcm);
1064+ mSigmaPlusPcmSelection .computeKinematics (sigmaPlusPcm, col );
10451065 if (!mSigmaPlusPcmSelection .checkFilters (sigmaPlusPcm)) {
10461066 continue ;
10471067 }
0 commit comments