CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ThirdHitPredictionFromInvParabola.h
Go to the documentation of this file.
1 #ifndef ThirdHitPredictionFromInvParabola_H
2 #define ThirdHitPredictionFromInvParabola_H
3 
15 
18 
19 
20 class TrackingRegion;
21 class OrderedHitPair;
22 
23 
25 
26 public:
27 
30 
32  double ip, double curv, double tolerance);
33 
34 // inline Range operator()(double radius, int charge) const { return rangeRPhiSlow(radius,charge,1); }
35  inline Range operator()(double radius, int charge) const { return rangeRPhi(radius,charge); }
36 
37  Range rangeRPhi(double radius, int charge) const;
38  Range rangeRPhiSlow(double radius, int charge, int nIter=5) const;
39 
40  void init( const GlobalPoint & P1, const GlobalPoint & P2, double ip, double curv);
41 private:
42 
43  inline double coeffA(double impactParameter, int charge) const;
44  inline double coeffB(double impactParameter, int charge) const;
45  double predV(double u, double ip, int charge) const;
46  double ipFromCurvature(double curvature, int charge) const;
47 
48 
49 private:
50 
51  template <class T> class MappedPoint {
52  public:
53  MappedPoint() : theU(0), theV(0), pRot(0) { }
54  MappedPoint(const T & aU, const T & aV, const TkRotation<T> * aRot)
55  : theU(aU), theV(aV), pRot(aRot) { }
57  : pRot(aRot) {
58  T invRadius2 = T(1)/point.mag2();
59  Basic3DVector<T> rotated = (*pRot) * point;
60  theU = rotated.x() * invRadius2;
61  theV = rotated.y() * invRadius2;
62  }
63  T u() const {return theU; }
64  T v() const {return theV; }
66  T radius2 = T(1)/(theU*theU+theV*theV);
68  = (*pRot).multiplyInverse(Basic2DVector<T>(theU,theV));
69  return Basic2DVector<T>( tmp.x()*radius2, tmp.y()*radius2);
70  }
71  private:
72  T theU, theV;
74  };
75 
76 private:
77 
81  PointUV findPointAtCurve(double radius, int charge, double ip) const;
82 
84  double theTolerance;
85 
86 };
87 
88 
89 
91  coeffA(double impactParameter, int charge) const
92 {
93  double u1u2 = p1.u()*p2.u();
94  double du = p2.u() - p1.u();
95  double pv = p1.v()*p2.u() - p2.v()*p1.u();
96  return -charge*pv/du - u1u2*impactParameter;
97 }
98 
100  coeffB(double impactParameter,int charge) const
101 {
102  double dv = p2.v() - p1.v();
103  double du = p2.u() - p1.u();
104  double su = p2.u() + p1.u();
105  return charge*dv/du - su*impactParameter;
106 }
107 
108 
109 #endif
T y() const
Cartesian y coordinate.
T x() const
Cartesian x coordinate.
Range rangeRPhiSlow(double radius, int charge, int nIter=5) const
MappedPoint(const Basic2DVector< T > &point, const TkRotation< T > *aRot)
MappedPoint(const T &aU, const T &aV, const TkRotation< T > *aRot)
double charge(const std::vector< uint8_t > &Ampls)
Range operator()(double radius, int charge) const
void init(const GlobalPoint &P1, const GlobalPoint &P2, double ip, double curv)
double predV(double u, double ip, int charge) const
T curvature(T InversePt, const edm::EventSetup &iSetup)
double coeffB(double impactParameter, int charge) const
ThirdHitPredictionFromInvParabola(const GlobalPoint &P1, const GlobalPoint &P2, double ip, double curv, double tolerance)
Range rangeRPhi(double radius, int charge) const
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
Definition: Basic2DVector.h:68
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
double coeffA(double impactParameter, int charge) const
PointUV findPointAtCurve(double radius, int charge, double ip) const
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
double ipFromCurvature(double curvature, int charge) const