CMS 3D CMS Logo

Functions
reco::MustacheKernel Namespace Reference

Functions

bool inDynamicDPhiWindow (const EcalSCDynamicDPhiParameters *params, const float seedEta, const float seedPhi, const float ClustE, const float ClusEta, const float clusPhi)
 
bool inMustache (const EcalMustacheSCParameters *params, const float maxEta, const float maxPhi, const float ClustE, const float ClusEta, const float ClusPhi)
 

Function Documentation

◆ inDynamicDPhiWindow()

bool reco::MustacheKernel::inDynamicDPhiWindow ( const EcalSCDynamicDPhiParameters params,
const float  seedEta,
const float  seedPhi,
const float  ClustE,
const float  ClusEta,
const float  clusPhi 
)

Definition at line 64 of file Mustache.cc.

References funct::abs(), JetChargeProducer_cfi::exp, WZElectronSkims53X_cff::max, mkfit::Config::maxdphi, SiStripPI::min, submitPVValidationJobs::params, and lst_math::Phi_mpi_pi().

Referenced by ticl::TracksterLinkingbySuperClusteringMustache::linkTracksters().

69  {
70  const double absSeedEta = std::abs(seedEta);
71  const double logClustEt = std::log10(ClustE / std::cosh(ClusEta));
72  const double clusDphi = std::abs(TVector2::Phi_mpi_pi(seedPhi - ClusPhi));
73 
74  const auto dynamicDPhiParams = params->dynamicDPhiParameters(ClustE, absSeedEta);
75  if (!dynamicDPhiParams) {
76  return false;
77  }
78 
79  auto maxdphi = dynamicDPhiParams->yoffset +
80  dynamicDPhiParams->scale /
81  (1. + std::exp((logClustEt - dynamicDPhiParams->xoffset) / dynamicDPhiParams->width));
82  maxdphi = std::min(maxdphi, dynamicDPhiParams->cutoff);
83  maxdphi = std::max(maxdphi, dynamicDPhiParams->saturation);
84 
85  return clusDphi < maxdphi;
86  }
const float maxdphi
Definition: Config.cc:28
float Phi_mpi_pi(float x)
Definition: lst_math.h:8
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ inMustache()

bool reco::MustacheKernel::inMustache ( const EcalMustacheSCParameters params,
const float  maxEta,
const float  maxPhi,
const float  ClustE,
const float  ClusEta,
const float  ClusPhi 
)

Definition at line 8 of file Mustache.cc.

References funct::abs(), ALPAKA_ACCELERATOR_NAMESPACE::brokenline::constexpr(), WZElectronSkims53X_cff::max, razorScouting_cff::maxEta, HLT_2024v14_cff::maxPhi, SiStripPI::min, submitPVValidationJobs::params, lst_math::Phi_mpi_pi(), funct::sin(), and mathSSE::sqrt().

Referenced by ticl::TracksterLinkingbySuperClusteringMustache::linkTracksters(), reco::Mustache::MustacheClust(), and reco::Mustache::MustacheID().

13  {
14  const auto log10ClustE = std::log10(ClustE);
15  const auto parabola_params = params->parabolaParameters(log10ClustE, std::abs(ClusEta));
16  if (!parabola_params) {
17  return false;
18  }
19 
20  const float sineta0 = std::sin(maxEta);
21  const float eta0xsineta0 = maxEta * sineta0;
22 
23  //2 parabolas (upper and lower)
24  //of the form: y = a*x*x + b
25 
26  //b comes from a fit to the width
27  //and has a slight dependence on E on the upper edge
28  // this only works because of fine tuning :-D
29  const float sqrt_log10_clustE = std::sqrt(log10ClustE + params->sqrtLogClustETuning());
30  const float b_upper =
31  parabola_params->w1Up[0] * eta0xsineta0 + parabola_params->w1Up[1] / sqrt_log10_clustE -
32  0.5 * (parabola_params->w1Up[0] * eta0xsineta0 + parabola_params->w1Up[1] / sqrt_log10_clustE +
33  parabola_params->w0Up[0] * eta0xsineta0 + parabola_params->w0Up[1] / sqrt_log10_clustE);
34  const float b_lower =
35  parabola_params->w0Low[0] * eta0xsineta0 + parabola_params->w0Low[1] / sqrt_log10_clustE -
36  0.5 * (parabola_params->w1Low[0] * eta0xsineta0 + parabola_params->w1Low[1] / sqrt_log10_clustE +
37  parabola_params->w0Low[0] * eta0xsineta0 + parabola_params->w0Low[1] / sqrt_log10_clustE);
38 
39  //the curvature comes from a parabolic
40  //fit for many slices in eta given a
41  //slice -0.1 < log10(Et) < 0.1
42  const float curv_up =
43  eta0xsineta0 * (parabola_params->pUp[0] * eta0xsineta0 + parabola_params->pUp[1]) + parabola_params->pUp[2];
44  const float curv_low = eta0xsineta0 * (parabola_params->pLow[0] * eta0xsineta0 + parabola_params->pLow[1]) +
45  parabola_params->pLow[2];
46 
47  //solving for the curviness given the width of this particular point
48  const float a_upper = (1. / (4. * curv_up)) - std::abs(b_upper);
49  const float a_lower = (1. / (4. * curv_low)) - std::abs(b_lower);
50 
51  const double dphi = TVector2::Phi_mpi_pi(ClusPhi - maxPhi);
52  const double dphi2 = dphi * dphi;
53  // minimum offset is half a crystal width in either direction
54  // because science.
55  constexpr float half_crystal_width = 0.0087;
56  const float upper_cut =
57  (std::max((1. / (4. * a_upper)), 0.0) * dphi2 + std::max(b_upper, half_crystal_width)) + half_crystal_width;
58  const float lower_cut = (std::max((1. / (4. * a_lower)), 0.0) * dphi2 + std::min(b_lower, -half_crystal_width));
59 
60  const float deta = (1 - 2 * (maxEta < 0)) * (ClusEta - maxEta); // sign flip deta
61  return (deta < upper_cut && deta > lower_cut);
62  }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
float Phi_mpi_pi(float x)
Definition: lst_math.h:8
T sqrt(T t)
Definition: SSEVec.h:23
Abs< T >::type abs(const T &t)
Definition: Abs.h:22