CMS 3D CMS Logo

FastLine Class Reference

Calculate the Line parameters (n1, n2, c) of a Line in Rho*Phi-Z. More...

#include <RecoTracker/TkSeedGenerator/interface/FastLine.h>

List of all members.

Public Member Functions

double c () const
 FastLine (const GlobalPoint &outerHit, const GlobalPoint &innerHit, double rho)
 FastLine (const GlobalPoint &outerHit, const GlobalPoint &innerHit)
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().

00004                                                 : 
00005   theOuterHit(outerHit),
00006   theInnerHit(innerHit),
00007   theRho(0.),
00008   theN1(0.),
00009   theN2(0.),
00010   theC(0.),
00011   theValid(true) {
00012 
00013   createLineParameters();
00014   
00015 }

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

Definition at line 17 of file FastLine.cc.

References createLineParameters().

00019                                : 
00020   theOuterHit(outerHit),
00021   theInnerHit(innerHit),
00022   theRho(rho),
00023   theN1(0.),
00024   theN2(0.),
00025   theC(0.),
00026   theValid(true) {
00027 
00028   createLineParameters();
00029   
00030 }

FastLine::~FastLine (  )  [inline]

Definition at line 26 of file FastLine.h.

00026 {}


Member Function Documentation

double FastLine::c (  )  const [inline]

Definition at line 32 of file FastLine.h.

References theC.

Referenced by RoadSearchTrackCandidateMakerAlgorithm::initialTrajectory(), RoadSearchTrackCandidateMakerAlgorithm::initialTrajectoryFromTriplet(), ConversionFastHelix::straightLineStateAtVertex(), and FastHelix::straightLineStateAtVertex().

00032 {return theC;}

void FastLine::createLineParameters (  )  [private]

Definition at line 32 of file FastLine.cc.

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

Referenced by FastLine().

00032                                     {
00033 
00034   double rphi0 = 0., rphi1 = 0.;
00035 
00036   if(theRho > 0.) {
00037     if (fabs( 1. - theInnerHit.perp2()/(2.*theRho*theRho) ) > 1.) rphi0 = theInnerHit.perp();
00038     else rphi0 = theRho*acos(1. - theInnerHit.perp2()/(2.*theRho*theRho));
00039     if (fabs(1. - theOuterHit.perp2()/(2.*theRho*theRho) ) >1.) rphi1 = theOuterHit.perp();
00040     else rphi1 = theRho*acos(1. - theOuterHit.perp2()/(2.*theRho*theRho));
00041   } else {
00042     rphi0 = theInnerHit.perp();
00043     rphi1 = theOuterHit.perp();
00044   } 
00045 
00046   double n1 = theInnerHit.z() - theOuterHit.z();
00047   double n2 = -(rphi0 - rphi1);
00048   double norm = sqrt(n1*n1 + n2*n2);
00049   theN1 = n1/norm;
00050   theN2= n2/norm;
00051   theC = -(theN1*rphi0 + theN2*theInnerHit.z());
00052   //  theC = -(theN1*rphi1 + theN2*theOuterHit.z());
00053 
00054 }

bool FastLine::isValid ( void   )  const [inline]

Definition at line 34 of file FastLine.h.

References theValid.

00034 {return theValid;}

double FastLine::n1 (  )  const [inline]

Definition at line 28 of file FastLine.h.

References theN1.

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

00028 {return theN1;}

double FastLine::n2 (  )  const [inline]

Definition at line 30 of file FastLine.h.

References theN2.

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

00030 {return theN2;}


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


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:20:43 2009 for CMSSW by  doxygen 1.5.4