@@ -88,7 +88,6 @@ struct HfDerivedDataCreatorCorrelationsReduced {
8888 Configurable<float > ptCandMax{" ptCandMax" , 24 ., " max. cand. pT" };
8989 Configurable<int > tpcNClsCrossedRowsMin{" tpcNClsCrossedRowsMin" , 70 , " min. TPC crossed rows for associated tracks" };
9090 Configurable<float > etaTrkMax{" etaTrkMax" , 1 ., " max. track eta" };
91- Configurable<float > etaCandMax{" etaCandMax" , 1 ., " max. trigger candidate eta" };
9291 Configurable<float > ptTrkMin{" ptTrkMin" , 0.2 , " min. track pT" };
9392 Configurable<float > ptTrkMax{" ptTrkMax" , 3 ., " max. track pT" };
9493 Configurable<float > dcaXYTrkMax{" dcaXYTrkMax" , 1 ., " max. track DCA XY" };
@@ -264,6 +263,25 @@ struct HfDerivedDataCreatorCorrelationsReduced {
264263 return outputMl;
265264 }
266265
266+ // / Cut on rapidity of the candidate
267+ // / \param candidate is the charm hadron candidate
268+ template <CandidateType CandType, typename TCand>
269+ bool cutCandRapidity (const TCand& candidate) {
270+ double y = 0.0 ;
271+ if constexpr (CandType == CandidateType::DsToKKPi || CandType == CandidateType::DsToPiKK) {
272+ y = HfHelper::yDs (candidate);
273+ } else if constexpr (CandType == CandidateType::DplusToPiKPi) {
274+ y = HfHelper::yDplus (candidate);
275+ } else if constexpr (CandType == CandidateType::D0ToPiK || CandType == CandidateType::D0ToKPi) {
276+ y = HfHelper::yD0 (candidate);
277+ } else if constexpr (CandType == CandidateType::LcToPKPi) {
278+ y = HfHelper::yLc (candidate);
279+ } else {
280+ return true ;
281+ }
282+ return std::fabs (y) < yCandMax;
283+ }
284+
267285 // / Check event selections for collision and fill the collision table
268286 // / \param collision is the collision
269287 template <typename Coll>
@@ -336,7 +354,7 @@ struct HfDerivedDataCreatorCorrelationsReduced {
336354 const float collCentrality)
337355 {
338356 for (const auto & trigCand : trigCands) {
339- if (std::fabs (trigCand. eta ()) >= etaCandMax ) {
357+ if (!cutCandRapidity<CandType> (trigCand) ) {
340358 continue ;
341359 }
342360 double trigCandPt = trigCand.pt ();
@@ -392,7 +410,7 @@ struct HfDerivedDataCreatorCorrelationsReduced {
392410 void fillCharmMixedEvent (TTrigCands const & trigCands)
393411 {
394412 for (const auto & trigCand : trigCands) {
395- if (std::fabs (trigCand. eta ()) >= etaCandMax ) {
413+ if (!cutCandRapidity<CandType> (trigCand) ) {
396414 continue ;
397415 }
398416 registry.fill (HIST (" hPhiVsPtTrig" ), RecoDecay::constrainAngle (trigCand.phi (), -o2::constants::math::PIHalf), trigCand.pt ());
0 commit comments