CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ThirdHitZPrediction.cc
Go to the documentation of this file.
1 #include "ThirdHitZPrediction.h"
2 
3 namespace {
4  template<class T> T sqr(T t) { return t * t; }
5 }
6 
7 
9  const GlobalPoint& thePoint3, float erroRPhi3) const
10 {
11  double dR23 = (thePoint3-thePoint2).perp();
12 
13  double slope = dR23/dR12;
14  if ( (theCurvature > 1.e-4)
15  && (std::abs(0.5*dR23*theCurvature) < 1.)
16  ) slope = std::asin(0.5*dR23*theCurvature)/dS12;
17 
18  double z3 = thePoint2.z() + dZ12*slope;
19 
20  double sqr_errorXY23 = sqr_errorXY2+sqr(erroRPhi3);
21  double error = sqrt( sqr( (1+dR23/dR12)*theErrorZ2 )
22  + sqr( dR23/dR12 * theErrorZ1 )
23  + sqr(dZ12/dR12 )*sqr_errorXY23
24  + sqr((dZ12/dR12)*(dR23/dR12))*sqr_errorXY12
25  );
26  error *= theNSigma;
27  return Range(z3-error,z3+error);
28 }
29 
tuple t
Definition: tree.py:139
PixelRecoRange< float > Range
static const double slope[3]
T sqrt(T t)
Definition: SSEVec.h:48
T z() const
Definition: PV3DBase.h:64
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.
Square< F >::type sqr(const F &f)
Definition: Square.h:13
long double T