CMS 3D CMS Logo

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() [1/2]

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

Definition at line 3 of file FastLine.cc.

4  : theOuterHit(outerHit), theInnerHit(innerHit), theRho(0.), theN1(0.), theN2(0.), theC(0.), theValid(true) {
6 }

References createLineParameters().

◆ FastLine() [2/2]

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

Definition at line 8 of file FastLine.cc.

9  : theOuterHit(outerHit), theInnerHit(innerHit), theRho(rho), theN1(0.), theN2(0.), theC(0.), theValid(true) {
11 }

References createLineParameters().

◆ ~FastLine()

FastLine::~FastLine ( )
inline

Definition at line 21 of file FastLine.h.

21 {}

Member Function Documentation

◆ c()

double FastLine::c ( ) const
inline

◆ createLineParameters()

void FastLine::createLineParameters ( )
private

Definition at line 13 of file FastLine.cc.

13  {
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 }

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().

◆ isValid()

bool FastLine::isValid ( void  ) const
inline

Definition at line 29 of file FastLine.h.

29 { return theValid; }

References theValid.

Referenced by ntupleDataFormat._Object::_checkIsValid(), and core.AutoHandle.AutoHandle::ReallyLoad().

◆ n1()

double FastLine::n1 ( ) const
inline

◆ n2()

double FastLine::n2 ( ) const
inline

Member Data Documentation

◆ theC

double FastLine::theC
private

Definition at line 38 of file FastLine.h.

Referenced by c(), and createLineParameters().

◆ theInnerHit

GlobalPoint FastLine::theInnerHit
private

Definition at line 33 of file FastLine.h.

Referenced by createLineParameters().

◆ theN1

double FastLine::theN1
private

Definition at line 36 of file FastLine.h.

Referenced by createLineParameters(), and n1().

◆ theN2

double FastLine::theN2
private

Definition at line 37 of file FastLine.h.

Referenced by createLineParameters(), and n2().

◆ theOuterHit

GlobalPoint FastLine::theOuterHit
private

Definition at line 32 of file FastLine.h.

Referenced by createLineParameters().

◆ theRho

double FastLine::theRho
private

Definition at line 34 of file FastLine.h.

Referenced by createLineParameters().

◆ theValid

bool FastLine::theValid
private

Definition at line 40 of file FastLine.h.

Referenced by isValid().

FastLine::theN1
double theN1
Definition: FastLine.h:36
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
FastLine::theC
double theC
Definition: FastLine.h:38
FastLine::theInnerHit
GlobalPoint theInnerHit
Definition: FastLine.h:33
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
FastLine::theValid
bool theValid
Definition: FastLine.h:40
DDAxes::rho
FastLine::theRho
double theRho
Definition: FastLine.h:34
FastLine::theOuterHit
GlobalPoint theOuterHit
Definition: FastLine.h:32
FastLine::createLineParameters
void createLineParameters()
Definition: FastLine.cc:13
FastLine::n1
double n1() const
Definition: FastLine.h:23
FastLine::n2
double n2() const
Definition: FastLine.h:25
PV3DBase::perp
T perp() const
Definition: PV3DBase.h:69
PV3DBase::perp2
T perp2() const
Definition: PV3DBase.h:68
FastLine::theN2
double theN2
Definition: FastLine.h:37