CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

FastLine Class Reference

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

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

  createLineParameters();
  
}
FastLine::FastLine ( const GlobalPoint outerHit,
const GlobalPoint innerHit,
double  rho 
)

Definition at line 17 of file FastLine.cc.

References createLineParameters().

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

  createLineParameters();
  
}
FastLine::~FastLine ( ) [inline]

Definition at line 26 of file FastLine.h.

{}

Member Function Documentation

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

Definition at line 32 of file FastLine.cc.

References n1(), n2(), lumiNorm::norm, 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().

                                    {

  double rphi0 = 0., rphi1 = 0.;

  if(theRho > 0.) {
    if (fabs( 1. - theInnerHit.perp2()/(2.*theRho*theRho) ) > 1.) rphi0 = theInnerHit.perp();
    else rphi0 = theRho*acos(1. - theInnerHit.perp2()/(2.*theRho*theRho));
    if (fabs(1. - theOuterHit.perp2()/(2.*theRho*theRho) ) >1.) rphi1 = theOuterHit.perp();
    else rphi1 = theRho*acos(1. - theOuterHit.perp2()/(2.*theRho*theRho));
  } else {
    rphi0 = theInnerHit.perp();
    rphi1 = theOuterHit.perp();
  } 

  double n1 = theInnerHit.z() - theOuterHit.z();
  double n2 = -(rphi0 - rphi1);
  double norm = sqrt(n1*n1 + n2*n2);
  theN1 = n1/norm;
  theN2= n2/norm;
  theC = -(theN1*rphi0 + theN2*theInnerHit.z());
  //  theC = -(theN1*rphi1 + theN2*theOuterHit.z());

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

Definition at line 34 of file FastLine.h.

References theValid.

{return theValid;}
double FastLine::n1 ( ) const [inline]
double FastLine::n2 ( ) const [inline]

Member Data Documentation

double FastLine::theC [private]

Definition at line 44 of file FastLine.h.

Referenced by c(), and createLineParameters().

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

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