CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PixelRecoLineRZ.h
Go to the documentation of this file.
1 #ifndef PixelRecoLineRZ_H
2 #define PixelRecoLineRZ_H
3 
7 #include <cmath>
8 
11 
13 public:
14 
16 
18 
20  : theTIP2 ( initTIP2( p1.x(), p1.y(), p2.x(), p2.y() ) ),
21  theOrigin ( LineOrigin( subTIP(p1.perp()), p1.z() ) ),
22  theCotLine ( initCot( p2.z()-theOrigin.z(), subTIP(p2.perp())-theOrigin.r() ) )
23  { }
24 
25  PixelRecoLineRZ(const LineOrigin & aOrigin, float aCotLine, float transverseIP = 0.f)
27  theOrigin( subTIP(aOrigin.r()), aOrigin.z() ),
28  theCotLine(aCotLine) { }
29 
30  PixelRecoLineRZ(const LineOrigin & aOrigin, const PixelRecoPointRZ & aPoint, float transverseIP = 0.f)
32  theOrigin( subTIP(aOrigin.r()), aOrigin.z() ),
33  theCotLine( initCot( aPoint.z()-theOrigin.z(), subTIP(aPoint.r())-theOrigin.r() ) )
34  { }
35 
36  float cotLine() const { return theCotLine; }
37  float transverseIP() const { return std::sqrt(theTIP2); }
38  float transverseIP2() const { return theTIP2; }
39  LineOrigin origin() const { return LineOrigin( addTIP(theOrigin.r()), theOrigin.z() ); }
40 
41  float zAtR (float r) const
42  { return theOrigin.z()+(subTIP(r)-theOrigin.r())*theCotLine; }
43  float rAtZ (float z) const
44  { return (std::abs(theCotLine) > 1.e-4f) ? addTIP(theOrigin.r()+(z-theOrigin.z())/theCotLine) : 99999.f; }
45 
46 private:
47  static float initCot (float dz, float dr)
48  { return (std::abs(dr) > 1.e-4f) ? dz/dr : 99999.f; }
49  static float initTIP2 (float x1, float y1, float x2, float y2)
50  {
51  double l = y1 * (x2 - x1) - x1 * (y2 - y1);
52  return l * l / ( (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1) );
53  }
54 
55  inline float addTIP (float val) const
56  { return theTIP2 ? std::sqrt(val * val + theTIP2) : val; }
57  inline float subTIP (float val) const
58  {
59  if (!theTIP2) return val;
60  double val2 = val * val;
61  return val2 > theTIP2 ? std::sqrt(val2 - theTIP2) : 0.;
62  }
63 
64 private:
65  float theTIP2;
67  float theCotLine;
68 };
69 #endif
float transverseIP() const
static float initCot(float dz, float dr)
T perp() const
Magnitude of transverse component.
#define abs(x)
Definition: mlp_lapack.h:159
LineOrigin origin() const
float addTIP(float val) const
float zAtR(float r) const
static float initTIP2(float x1, float y1, float x2, float y2)
float cotLine() const
Definition: DDAxes.h:10
T sqrt(T t)
Definition: SSEVec.h:28
float subTIP(float val) const
float transverseIP2() const
double f[11][100]
PixelRecoLineRZ(const LineOrigin &aOrigin, const PixelRecoPointRZ &aPoint, float transverseIP=0.f)
LineOrigin theOrigin
double p2[4]
Definition: TauolaWrapper.h:90
float z() const
float r() const
PixelRecoPointRZ LineOrigin
float rAtZ(float z) const
double p1[4]
Definition: TauolaWrapper.h:89
PixelRecoLineRZ(const LineOrigin &aOrigin, float aCotLine, float transverseIP=0.f)
PixelRecoLineRZ(const GlobalPoint &p1, const GlobalPoint &p2)