CMS 3D CMS Logo

FastLine.cc
Go to the documentation of this file.
2 
4  const GlobalPoint& innerHit) :
5  theOuterHit(outerHit),
6  theInnerHit(innerHit),
7  theRho(0.),
8  theN1(0.),
9  theN2(0.),
10  theC(0.),
11  theValid(true) {
12 
14 
15 }
16 
18  const GlobalPoint& innerHit,
19  double rho) :
20  theOuterHit(outerHit),
21  theInnerHit(innerHit),
22  theRho(rho),
23  theN1(0.),
24  theN2(0.),
25  theC(0.),
26  theValid(true) {
27 
29 
30 }
31 
33 
34  double rphi0 = 0., rphi1 = 0.;
35 
36  if(theRho > 0.) {
37  if (fabs( 1. - theInnerHit.perp2()/(2.*theRho*theRho) ) > 1.) rphi0 = theInnerHit.perp();
38  else rphi0 = theRho*acos(1. - theInnerHit.perp2()/(2.*theRho*theRho));
39  if (fabs(1. - theOuterHit.perp2()/(2.*theRho*theRho) ) >1.) rphi1 = theOuterHit.perp();
40  else rphi1 = theRho*acos(1. - theOuterHit.perp2()/(2.*theRho*theRho));
41  } else {
42  rphi0 = theInnerHit.perp();
43  rphi1 = theOuterHit.perp();
44  }
45 
46  double n1 = theInnerHit.z() - theOuterHit.z();
47  double n2 = -(rphi0 - rphi1);
48  double norm = sqrt(n1*n1 + n2*n2);
49  theN1 = n1/norm;
50  theN2= n2/norm;
51  theC = -(theN1*rphi0 + theN2*theInnerHit.z());
52  // theC = -(theN1*rphi1 + theN2*theOuterHit.z());
53 
54 }
55 
56 
57 
58 
59 
60 
GlobalPoint theOuterHit
Definition: FastLine.h:38
T perp() const
Definition: PV3DBase.h:72
FastLine(const GlobalPoint &outerHit, const GlobalPoint &innerHit)
Definition: FastLine.cc:3
T perp2() const
Definition: PV3DBase.h:71
T sqrt(T t)
Definition: SSEVec.h:18
T z() const
Definition: PV3DBase.h:64
double n1() const
Definition: FastLine.h:28
double theRho
Definition: FastLine.h:40
void createLineParameters()
Definition: FastLine.cc:32
double theN2
Definition: FastLine.h:43
bool theValid
Definition: FastLine.h:46
GlobalPoint theInnerHit
Definition: FastLine.h:39
double theC
Definition: FastLine.h:44
double theN1
Definition: FastLine.h:42
double n2() const
Definition: FastLine.h:30