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 float seedEta, 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 float  seedEta,
const float  seedPhi,
const float  ClustE,
const float  ClusEta,
const float  clusPhi 
)

Definition at line 73 of file Mustache.cc.

References funct::abs(), constexpr, Exception, create_public_lumi_plots::exp, bookConverter::max, min(), Phi_mpi_pi(), pileupReCalc_HLTpaths::scale, and create_public_lumi_plots::width.

75  {
76  // from Rishi's fits 06 June 2013 in log base 10
77  constexpr double yoffsetEB = 7.151e-02;
78  constexpr double scaleEB = 5.656e-01;
79  constexpr double xoffsetEB = 2.931e-01;
80  constexpr double widthEB = 2.976e-01;
81 
82  constexpr double yoffsetEE_0 = 5.058e-02;
83  constexpr double scaleEE_0 = 7.131e-01;
84  constexpr double xoffsetEE_0 = 1.668e-02;
85  constexpr double widthEE_0 = 4.114e-01;
86 
87  constexpr double yoffsetEE_1 = -9.913e-02;
88  constexpr double scaleEE_1 = 4.404e+01;
89  constexpr double xoffsetEE_1 = -5.326e+00;
90  constexpr double widthEE_1 = 1.184e+00;
91 
92  constexpr double yoffsetEE_2 = -6.346e-01;
93  constexpr double scaleEE_2 = 1.317e+01;
94  constexpr double xoffsetEE_2 = -7.037e+00;
95  constexpr double widthEE_2 = 2.836e+00;
96 
97 
98  const double absSeedEta = std::abs(seedEta);
99  const int etaBin = ( (int)(absSeedEta >= 1.479) +
100  (int)(absSeedEta >= 1.75) +
101  (int)(absSeedEta >= 2.0) );
102  const double logClustEt = std::log10(ClustE/std::cosh(ClusEta));
103  const double clusDphi = std::abs(TVector2::Phi_mpi_pi(seedPhi -
104  ClusPhi));
105 
106  double yoffset, scale, xoffset, width, saturation, cutoff, maxdphi;
107 
108  switch( etaBin ) {
109  case 0: // EB
110  yoffset = yoffsetEB;
111  scale = scaleEB;
112  xoffset = xoffsetEB;
113  width = 1.0/widthEB;
114  saturation = 0.14;
115  cutoff = 0.60;
116  break;
117  case 1: // 1.479 -> 1.75
118  yoffset = yoffsetEE_0;
119  scale = scaleEE_0;
120  xoffset = xoffsetEE_0;
121  width = 1.0/widthEE_0;
122  saturation = 0.14;
123  cutoff = 0.55;
124  break;
125  case 2: // 1.75 -> 2.0
126  yoffset = yoffsetEE_1;
127  scale = scaleEE_1;
128  xoffset = xoffsetEE_1;
129  width = 1.0/widthEE_1;
130  saturation = 0.12;
131  cutoff = 0.45;
132  break;
133  case 3: // 2.0 and up
134  yoffset = yoffsetEE_2;
135  scale = scaleEE_2;
136  xoffset = xoffsetEE_2;
137  width = 1.0/widthEE_2;
138  saturation = 0.12;
139  cutoff = 0.30;
140  break;
141  default:
142  throw cms::Exception("InValidEtaBin")
143  << "Calculated invalid eta bin = " << etaBin
144  << " in \"inDynamicDPhiWindow\"" << std::endl;
145  }
146 
147  maxdphi = yoffset+scale/(1+std::exp((logClustEt-xoffset)*width));
148  maxdphi = std::min(maxdphi,cutoff);
149  maxdphi = std::max(maxdphi,saturation);
150 
151  return clusDphi < maxdphi;
152  }
double Phi_mpi_pi(double x)
Definition: JetUtil.h:24
#define constexpr
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
T min(T a, T b)
Definition: MathUtil.h:58
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, bookConverter::max, maxEta, min(), Phi_mpi_pi(), funct::sin(), mathSSE::sqrt(), w10, and w11.

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

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=eta0xsineta0*(p00*eta0xsineta0+p01)+p02;
51  const float curv_low=eta0xsineta0*(p10*eta0xsineta0+p11)+p12;
52 
53  //solving for the curviness given the width of this particular point
54  const float a_upper=(1/(4*curv_up))-fabs(b_upper);
55  const float a_lower = (1/(4*curv_low))-fabs(b_lower);
56 
57  const double dphi=TVector2::Phi_mpi_pi(ClusPhi-maxPhi);
58  const double dphi2 = dphi*dphi;
59  // minimum offset is half a crystal width in either direction
60  // because science.
61  const float upper_cut=( std::max((1./(4.*a_upper)),0.0)*dphi2 +
62  std::max(b_upper,0.0087f) ) + 0.0087;
63  const float lower_cut=( std::max((1./(4.*a_lower)),0.0)*dphi2 +
64  std::min(b_lower,-0.0087f) );
65 
66 
67  //if(deta < upper_cut && deta > lower_cut) inMust=true;
68 
69  const float deta=(1-2*(maxEta<0))*(ClusEta-maxEta); // sign flip deta
70  return (deta < upper_cut && deta > lower_cut);
71  }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
common ppss p3p6s2 common epss epspn46 common const1 w10
Definition: inclppp.h:1
double Phi_mpi_pi(double x)
Definition: JetUtil.h:24
double maxEta
#define constexpr
common ppss p3p6s2 common epss epspn46 common const1 w11
Definition: inclppp.h:1
T sqrt(T t)
Definition: SSEVec.h:18
double f[11][100]
T min(T a, T b)
Definition: MathUtil.h:58