CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
reco::MustacheKernel Namespace Reference

Functions

bool inDynamicDPhiWindow (const bool isEE, const float seedPhi, const float ClustE, const float ClusEta, const float clusPhi)
 
bool inMustache (const float maxEta, const float maxPhi, const float ClustE, const float ClusEta, const float ClusPhi)
 

Function Documentation

bool reco::MustacheKernel::inDynamicDPhiWindow ( const bool  isEE,
const float  seedPhi,
const float  ClustE,
const float  ClusEta,
const float  clusPhi 
)

Definition at line 74 of file Mustache.cc.

References abs, constexpr, create_public_lumi_plots::exp, create_public_lumi_plots::log, and Phi_mpi_pi().

Referenced by PFSuperClusterTreeMaker::processSuperClusterFillTree().

76  {
77  // from Rishi's fit 21 May 2013
78  constexpr double yoffsetEB = 0.04635;
79  constexpr double scaleEB = 0.6514;
80  constexpr double xoffsetEB = 0.5709;
81  constexpr double widthEB = 0.7814;
82 
83  constexpr double yoffsetEE = 0.0453;
84  constexpr double scaleEE = 0.7416;
85  constexpr double xoffsetEE = 0.09217;
86  constexpr double widthEE = 1.059;
87 
88  double maxdphi;
89 
90  const double logClustEt = std::log(ClustE/std::cosh(ClusEta));
91  const double clusDphi = std::abs(TVector2::Phi_mpi_pi(seedPhi -
92  ClusPhi));
93  if( isEB ) {
94  maxdphi = (yoffsetEB + scaleEB/(1+std::exp((logClustEt -
95  xoffsetEB)/widthEB)));
96  } else {
97  maxdphi = (yoffsetEE + scaleEE/(1+std::exp((logClustEt -
98  xoffsetEE)/widthEE)));
99  }
100  maxdphi = ( logClustEt > 2.0 ) ? 0.15 : maxdphi;
101  maxdphi = ( logClustEt < -1.0 ) ? 0.6 : maxdphi;
102 
103  return clusDphi < maxdphi;
104  }
#define abs(x)
Definition: mlp_lapack.h:159
double Phi_mpi_pi(double x)
Definition: JetUtil.h:24
#define constexpr
bool reco::MustacheKernel::inMustache ( const float  maxEta,
const float  maxPhi,
const float  ClustE,
const float  ClusEta,
const float  ClusPhi 
)

Definition at line 9 of file Mustache.cc.

References constexpr, f, max(), maxEta, min, Phi_mpi_pi(), funct::sin(), mathSSE::sqrt(), w10, and w11.

Referenced by reco::Mustache::MustacheClust(), reco::Mustache::MustacheID(), and PFSuperClusterTreeMaker::processSuperClusterFillTree().

11  {
12  //bool inMust=false;
13  //float eta0 = maxEta;
14  //float phi0 = maxPhi;
15 
16  constexpr float p00 = -0.107537;
17  constexpr float p01 = 0.590969;
18  constexpr float p02 = -0.076494;
19  constexpr float p10 = -0.0268843;
20  constexpr float p11 = 0.147742;
21  constexpr float p12 = -0.0191235;
22 
23  constexpr float w00 = -0.00571429;
24  constexpr float w01 = -0.002;
25  constexpr float w10 = 0.0135714;
26  constexpr float w11 = 0.001;
27 
28  const float sineta0 = std::sin(maxEta);
29  const float eta0xsineta0 = maxEta*sineta0;
30 
31 
32  //2 parabolas (upper and lower)
33  //of the form: y = a*x*x + b
34 
35  //b comes from a fit to the width
36  //and has a slight dependence on E on the upper edge
37  // this only works because of fine tuning :-D
38  const float sqrt_log10_clustE = std::sqrt(std::log10(ClustE)+1.1);
39  // we need to have this in two steps, so that we don't improperly shift
40  // the lower bound!
41  float b_upper = w10*eta0xsineta0 + w11 / sqrt_log10_clustE;
42  float b_lower = w00*eta0xsineta0 + w01 / sqrt_log10_clustE;
43  const float midpoint = 0.5*( b_upper + b_lower );
44  b_upper -= midpoint;
45  b_lower -= midpoint;
46 
47  //the curvature comes from a parabolic
48  //fit for many slices in eta given a
49  //slice -0.1 < log10(Et) < 0.1
50  const float curv_up=std::max(eta0xsineta0*(p00*eta0xsineta0+p01)+p02,
51  0.0f);
52  const float curv_low=std::max(eta0xsineta0*(p10*eta0xsineta0+p11)+p12,
53  0.0f);
54 
55  //solving for the curviness given the width of this particular point
56  const float a_upper=(1/(4*curv_up))-fabs(b_upper);
57  const float a_lower = (1/(4*curv_low))-fabs(b_lower);
58 
59  const double dphi=TVector2::Phi_mpi_pi(ClusPhi-maxPhi);
60  const double dphi2 = dphi*dphi;
61  // minimum offset is half a crystal width in either direction
62  // because science.
63  const float upper_cut=( std::max((1./(4.*a_upper)),0.0)*dphi2 +
64  std::max(b_upper,0.0087f) );
65  const float lower_cut=( std::max((1./(4.*a_lower)),0.0)*dphi2 +
66  std::min(b_lower,-0.0087f) );
67 
68  //if(deta < upper_cut && deta > lower_cut) inMust=true;
69 
70  const float deta=(1-2*(maxEta<0))*(ClusEta-maxEta); // sign flip deta
71  return (deta < upper_cut && deta > lower_cut);
72  }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
common ppss p3p6s2 common epss epspn46 common const1 w10
Definition: inclppp.h:1
#define min(a, b)
Definition: mlp_lapack.h:161
double Phi_mpi_pi(double x)
Definition: JetUtil.h:24
double maxEta
common ppss p3p6s2 common epss epspn46 common const1 w11
Definition: inclppp.h:1
const T & max(const T &a, const T &b)
T sqrt(T t)
Definition: SSEVec.h:48
double f[11][100]
#define constexpr