CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
FastLine.cc
Go to the documentation of this file.
2 
3 FastLine::FastLine(const GlobalPoint& outerHit, const GlobalPoint& innerHit)
4  : theOuterHit(outerHit), theInnerHit(innerHit), theRho(0.), theN1(0.), theN2(0.), theC(0.), theValid(true) {
6 }
7 
8 FastLine::FastLine(const GlobalPoint& outerHit, const GlobalPoint& innerHit, double rho)
9  : theOuterHit(outerHit), theInnerHit(innerHit), theRho(rho), theN1(0.), theN2(0.), theC(0.), theValid(true) {
11 }
12 
14  double rphi0 = 0., rphi1 = 0.;
15 
16  if (theRho > 0.) {
17  if (fabs(1. - theInnerHit.perp2() / (2. * theRho * theRho)) > 1.)
18  rphi0 = theInnerHit.perp();
19  else
20  rphi0 = theRho * acos(1. - theInnerHit.perp2() / (2. * theRho * theRho));
21  if (fabs(1. - theOuterHit.perp2() / (2. * theRho * theRho)) > 1.)
22  rphi1 = theOuterHit.perp();
23  else
24  rphi1 = theRho * acos(1. - theOuterHit.perp2() / (2. * theRho * theRho));
25  } else {
26  rphi0 = theInnerHit.perp();
27  rphi1 = theOuterHit.perp();
28  }
29 
30  double n1 = theInnerHit.z() - theOuterHit.z();
31  double n2 = -(rphi0 - rphi1);
32  double norm = sqrt(n1 * n1 + n2 * n2);
33  theN1 = n1 / norm;
34  theN2 = n2 / norm;
35  theC = -(theN1 * rphi0 + theN2 * theInnerHit.z());
36  // theC = -(theN1*rphi1 + theN2*theOuterHit.z());
37 }
GlobalPoint theOuterHit
Definition: FastLine.h:32
T perp() const
Definition: PV3DBase.h:69
FastLine(const GlobalPoint &outerHit, const GlobalPoint &innerHit)
Definition: FastLine.cc:3
T perp2() const
Definition: PV3DBase.h:68
T sqrt(T t)
Definition: SSEVec.h:19
T z() const
Definition: PV3DBase.h:61
double n1() const
Definition: FastLine.h:23
double theRho
Definition: FastLine.h:34
void createLineParameters()
Definition: FastLine.cc:13
double theN2
Definition: FastLine.h:37
GlobalPoint theInnerHit
Definition: FastLine.h:33
double theC
Definition: FastLine.h:38
double theN1
Definition: FastLine.h:36
double n2() const
Definition: FastLine.h:25