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 
19 
20 
21 class TrackingRegion;
22 class OrderedHitPair;
23 
24 
26 
27 public:
28 
33 
34 
36  double ip, double curv, double tolerance);
37 
38 // inline Range operator()(double radius, int charge) const { return rangeRPhiSlow(radius,charge,1); }
39  inline Range operator()(double radius, int charge) const { return rangeRPhi(radius,charge); }
40 
41  Range rangeRPhi(double radius, int charge) const __attribute__ ((optimize(3, "fast-math")));
42  // Range rangeRPhiSlow(double radius, int charge, int nIter=5) const;
43 
44  void init( const GlobalPoint & P1, const GlobalPoint & P2, double ip, double curv);
45 private:
46 
47  inline double coeffA(double impactParameter, double charge) const;
48  inline double coeffB(double impactParameter, double charge) const;
49  inline double predV(double u, double ip, double charge) const;
50  inline double ipFromCurvature(double curvature, double charge) const;
51 
52  Point2D transform(Point2D const & p) const {
53  return theRotation.rotate(p)/p.mag2();
54  }
55 
56  Point2D transformBack(Point2D const & p) const {
57  return theRotation.rotateBack(p)/p.mag2();
58  }
59 
60 private:
61 
63  double u1u2, overDu, pv, dv, su;
64 
65  inline void findPointAtCurve(double radius, double charge, double ip, double &u, double &v) const;
66 
68  double theTolerance;
69 
70 };
71 
72 
73 
75  coeffA(double impactParameter, double charge) const
76 {
77  return -charge*pv*overDu - u1u2*impactParameter;
78 }
79 
81  coeffB(double impactParameter, double charge) const
82 {
83  return charge*dv*overDu - su*impactParameter;
84 }
85 
87  ipFromCurvature(double curvature, double charge) const
88 {
89  double overU1u2 = 1./u1u2;
90  double inInf = -charge*pv*overDu*overU1u2;
91  return inInf-curvature*overU1u2*0.5;
92 }
93 
95 predV( double u, double ip, double charge) const
96 {
97  return -charge*( coeffA(ip,charge) - coeffB(ip,charge)*u - ip*u*u);
98 }
99 
101  double & u, double & v) const
102 {
103  //
104  // assume u=(1-alpha^2/2)/r v=alpha/r
105  // solve qudratic equation neglecting aplha^4 term
106  //
107  double A = coeffA(ip,c);
108  double B = coeffB(ip,c);
109 
110  // double overR = 1./r;
111  double ipOverR = ip/r; // *overR;
112 
113  double delta = 1-4*(0.5*B+ipOverR)*(-B+A*r-ipOverR);
114  // double sqrtdelta = (delta > 0) ? std::sqrt(delta) : 0.;
115  double sqrtdelta = std::sqrt(delta);
116  double alpha = (c>0)? (-c+sqrtdelta)/(B+2*ipOverR) : (-c-sqrtdelta)/(B+2*ipOverR);
117 
118  v = alpha; // *overR
119  double d2 = 1. - v*v; // overR*overR - v*v
120  // u = (d2 > 0) ? std::sqrt(d2) : 0.;
121  u = std::sqrt(d2);
122 
123  // u,v not rotated! not multiplied by 1/r
124 }
125 
126 
127 #endif
dbl * delta
Definition: mlp_gen.cc:36
float alpha
Definition: AMPTWrapper.h:95
double predV(double u, double ip, double charge) const
double charge(const std::vector< uint8_t > &Ampls)
double coeffA(double impactParameter, double charge) const
Range operator()(double radius, int charge) const
double coeffB(double impactParameter, double charge) const
void init(const GlobalPoint &P1, const GlobalPoint &P2, double ip, double curv)
T curvature(T InversePt, const edm::EventSetup &iSetup)
T sqrt(T t)
Definition: SSEVec.h:46
double ipFromCurvature(double curvature, double charge) const
ThirdHitPredictionFromInvParabola(const GlobalPoint &P1, const GlobalPoint &P2, double ip, double curv, double tolerance)
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
Range rangeRPhi(double radius, int charge) const __attribute__((optimize(3
BasicVector rotateBack(const BasicVector &v) const
class Geom::Polar2Cartesian __attribute__
Point2D transformBack(Point2D const &p) const
mathSSE::Vec4< T > v
void findPointAtCurve(double radius, double charge, double ip, double &u, double &v) const
BasicVector rotate(const BasicVector &v) const