CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
FastLine Class Reference

#include <FastLine.h>

Public Member Functions

double c () const
 
 FastLine (const GlobalPoint &outerHit, const GlobalPoint &innerHit)
 
 FastLine (const GlobalPoint &outerHit, const GlobalPoint &innerHit, double rho)
 
bool isValid () const
 
double n1 () const
 
double n2 () const
 
 ~FastLine ()
 

Private Member Functions

void createLineParameters ()
 

Private Attributes

double theC
 
GlobalPoint theInnerHit
 
double theN1
 
double theN2
 
GlobalPoint theOuterHit
 
double theRho
 
bool theValid
 

Detailed Description

Calculate the Line parameters (n1, n2, c) of a Line in Rho*Phi-Z. A Line is defined by n1*x + n2*y + c = 0. (== n1*RHOPHI + n2*Z + c) If rho is not specified, the Line parameters are calculated in R-Z.

Implementation: Matthias Winkler 21.02.2001

Definition at line 15 of file FastLine.h.

Constructor & Destructor Documentation

FastLine::FastLine ( const GlobalPoint outerHit,
const GlobalPoint innerHit 
)

Definition at line 3 of file FastLine.cc.

References createLineParameters().

4  :
5  theOuterHit(outerHit),
6  theInnerHit(innerHit),
7  theRho(0.),
8  theN1(0.),
9  theN2(0.),
10  theC(0.),
11  theValid(true) {
12 
14 
15 }
GlobalPoint theOuterHit
Definition: FastLine.h:38
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
FastLine::FastLine ( const GlobalPoint outerHit,
const GlobalPoint innerHit,
double  rho 
)

Definition at line 17 of file FastLine.cc.

References createLineParameters().

19  :
20  theOuterHit(outerHit),
21  theInnerHit(innerHit),
22  theRho(rho),
23  theN1(0.),
24  theN2(0.),
25  theC(0.),
26  theValid(true) {
27 
29 
30 }
GlobalPoint theOuterHit
Definition: FastLine.h:38
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
FastLine::~FastLine ( )
inline

Definition at line 26 of file FastLine.h.

26 {}

Member Function Documentation

double FastLine::c ( ) const
inline
void FastLine::createLineParameters ( )
private

Definition at line 32 of file FastLine.cc.

References n1(), n2(), PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::perp2(), mathSSE::sqrt(), theC, theInnerHit, theN1, theN2, theOuterHit, theRho, and PV3DBase< T, PVType, FrameType >::z().

Referenced by FastLine().

32  {
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 }
GlobalPoint theOuterHit
Definition: FastLine.h:38
T perp() const
Definition: PV3DBase.h:72
T perp2() const
Definition: PV3DBase.h:71
T sqrt(T t)
Definition: SSEVec.h:48
T z() const
Definition: PV3DBase.h:64
double n1() const
Definition: FastLine.h:28
double theRho
Definition: FastLine.h:40
double theN2
Definition: FastLine.h:43
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
bool FastLine::isValid ( void  ) const
inline

Definition at line 34 of file FastLine.h.

References theValid.

Referenced by core.AutoHandle.AutoHandle::ReallyLoad().

34 {return theValid;}
bool theValid
Definition: FastLine.h:46
double FastLine::n1 ( ) const
inline

Definition at line 28 of file FastLine.h.

References theN1.

Referenced by createLineParameters(), ConversionFastHelix::straightLineStateAtVertex(), and FastHelix::straightLineStateAtVertex().

28 {return theN1;}
double theN1
Definition: FastLine.h:42
double FastLine::n2 ( ) const
inline

Definition at line 30 of file FastLine.h.

References theN2.

Referenced by createLineParameters(), ConversionFastHelix::straightLineStateAtVertex(), and FastHelix::straightLineStateAtVertex().

30 {return theN2;}
double theN2
Definition: FastLine.h:43

Member Data Documentation

double FastLine::theC
private

Definition at line 44 of file FastLine.h.

Referenced by c(), and createLineParameters().

GlobalPoint FastLine::theInnerHit
private

Definition at line 39 of file FastLine.h.

Referenced by createLineParameters().

double FastLine::theN1
private

Definition at line 42 of file FastLine.h.

Referenced by createLineParameters(), and n1().

double FastLine::theN2
private

Definition at line 43 of file FastLine.h.

Referenced by createLineParameters(), and n2().

GlobalPoint FastLine::theOuterHit
private

Definition at line 38 of file FastLine.h.

Referenced by createLineParameters().

double FastLine::theRho
private

Definition at line 40 of file FastLine.h.

Referenced by createLineParameters().

bool FastLine::theValid
private

Definition at line 46 of file FastLine.h.

Referenced by isValid().