CMS 3D CMS Logo

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
T z() const
Definition: PV3DBase.h:61
static const double slope[3]
T sqrt(T t)
Definition: SSEVec.h:19
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
T perp() const
Magnitude of transverse component.
Range operator()(const GlobalPoint &p3, float erroRPhi3) const
Square< F >::type sqr(const F &f)
Definition: Square.h:14
long double T