CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ThirdHitZPrediction.cc
Go to the documentation of this file.
1 #include "ThirdHitZPrediction.h"
2 
3 namespace {
4  template <class T>
5  T sqr(T t) {
6  return t * t;
7  }
8 } // namespace
9 
11  double dR23 = (thePoint3 - thePoint2).perp();
12 
13  double slope = dR23 / dR12;
14  if ((theCurvature > 1.e-4) && (std::abs(0.5 * dR23 * theCurvature) < 1.))
15  slope = std::asin(0.5 * dR23 * theCurvature) / dS12;
16 
17  double z3 = thePoint2.z() + dZ12 * slope;
18 
19  double sqr_errorXY23 = sqr_errorXY2 + sqr(erroRPhi3);
20  double error = sqrt(sqr((1 + dR23 / dR12) * theErrorZ2) + sqr(dR23 / dR12 * theErrorZ1) +
21  sqr(dZ12 / dR12) * sqr_errorXY23 + sqr((dZ12 / dR12) * (dR23 / dR12)) * sqr_errorXY12);
22  error *= theNSigma;
23  return Range(z3 - error, z3 + error);
24 }
PixelRecoRange< float > Range
static const double slope[3]
int sqr(const T &t)
T sqrt(T t)
Definition: SSEVec.h:19
T z() const
Definition: PV3DBase.h:61
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
Range operator()(const GlobalPoint &p3, float erroRPhi3) const
T perp() const
Magnitude of transverse component.
long double T