Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

TrState Class Reference

#include <TrState.h>

List of all members.

Public Types

enum  Type { HasMomentum, StraightLine }
enum  Location {
  MostUpstream, FirstMeasurement, AtTT, AtT,
  BegRich1, EndRich1, BegRich2, EndRich2,
  Calo, Muon
}

Public Methods

 TrState ()
 Default constructor. State defined to be of type TrState::HasMomentum. More...

virtual ~TrState ()
 Destructor. More...

virtual const CLID & clID () const
 Retrieve pointer to class definition structure. More...

unsigned int nParameters () const
 Retrieve the number of state parameters. More...

void positionAndMomentum (HepPoint3D &pos, HepVector3D &mom, HepSymMatrix &cov6D) const
 Retrieve the position and momentum vectors and the corresponding 6D covariance matrix (pos:1->3,mom:4-6) of the state. More...

HepPoint3D position () const
 Retrieve the 3D-position vector of the state. More...

double x () const
 Retrieve the x-position of the state. More...

double y () const
 Retrieve the y-position of the state. More...

double z () const
 Retrieve the z-position of the state. More...

HepVector3D slopes () const
 Retrieve the slopes (Tx=dx/dz,Ty=dy/dz,1.) of the state. More...

double tx () const
 Retrieve the Tx=dx/dz slope of the state. More...

double ty () const
 Retrieve the Ty=dy/dz slope of the state. More...

virtual double qOverP () const
 Retrieve the charge-over-momentum Q/P of the state. More...

virtual double p () const
 Retrieve the momentum of the state. More...

virtual double pt () const
 Retrieve the transverse momentum of the state. More...

HepVector3D momentum () const
 Retrieve the momentum vector of the state. More...

double qOverPperp () const
 Retrieve the Q/Pperp (ratio of the charge to the component of the momentum transverse to the magnetic field) of the state. More...

virtual HepSymMatrix posMomCovariance () const
 Retrieve the 6D covariance matrix (x,y,z,px,py,pz) of the state. More...

HepSymMatrix errPosition () const
 Retrieve the errors on the 3D-position vector of the state. More...

double errX2 () const
 Retrieve the squared error on the x-position of the state. More...

double errY2 () const
 Retrieve the squared error on the y-position of the state. More...

HepSymMatrix errSlopes () const
 Retrieve the errors on the slopes of the state. More...

double errTx2 () const
 Retrieve the squared error on the x-slope Tx=dx/dz of the state. More...

double errTy2 () const
 Retrieve the squared error on the y-slope Ty=dy/dz of the state. More...

virtual double errQOverP2 () const
 Retrieve the squared error on the charge-over-momentum Q/P of the state. More...

virtual double errP2 () const
 Retrieve the squared error on the momentum of the state. More...

virtual HepSymMatrix errMomentum () const
 Retrieve the errors on the momentum vector of the stateRetrieve the errors on the momentum vector of the state. More...

virtual double errQOverPperp2 () const
 Retrieve the squared error on the Q/Pperp of the state. More...

virtual TrState * clone () const
 Clone the state. More...

virtual void reset ()
 Clear the state before re-using it. More...

bool type (unsigned value) const
 Check the type of the state. More...

bool location (unsigned value) const
 Check the location of the state. More...

void setState (const HepVector &state)
 Update the state vector. More...

virtual void setState (double x, double y, double z, double tx, double ty, double qOverP)
 Update the state vector (presumably of type TrState::HasMomentum). More...

void setState (double x, double y, double z, double tx, double ty)
 Update the state vector (presumably of type TrState::StraightLine). More...

void setCovariance (const HepSymMatrix &value)
 Update the state covariance. More...

void setX (double value)
 Update the x-position of the state. More...

void setY (double value)
 Update the y-position of the state. More...

void setTx (double value)
 Update the Tx slope of the state. More...

void setTy (double value)
 Update the Ty slope of the state. More...

virtual void setQOverP (double value)
 Update the Q/P value of the state. More...

void setLocation (unsigned value)
 Update the location of the state. More...

unsigned flags () const
 Retrieve Variety of state flags. More...

const HepVector & state () const
 Retrieve the state vector. More...

HepVector & state ()
 Retrieve the state vector (non-const). More...

const HepSymMatrix & covariance () const
 Retrieve the state covariance matrix (indexes 1,...,5 for x, y, tx, ty, Q/p). More...

HepSymMatrix & covariance ()
 Retrieve the state covariance matrix (indexes 1,...,5 for x, y, tx, ty, Q/p) (non-const). More...

virtual StreamBuffer & serialize (StreamBuffer &s) const
 Serialize the object for writing. More...

virtual StreamBuffer & serialize (StreamBuffer &s)
 Serialize the object for reading. More...

virtual std::ostream & fillStream (std::ostream &s) const
 Fill the ASCII output stream. More...


Static Public Methods

const CLID & classID ()

Protected Methods

bool isFlagSet (unsigned bits, unsigned mask)
void setType (unsigned value)
 Update the type of the state. More...

void setFlag (bool value, unsigned bits, unsigned mask)

Private Types

enum  flagsBits {
  LocationMostUpstreamBits = 0, LocationFirstMeasurementBits = 1, LocationAtTTBits = 2, LocationAtTBits = 3,
  LocationBegRich1Bits = 4, LocationEndRich1Bits = 5, LocationBegRich2Bits = 6, LocationEndRich2Bits = 7,
  LocationCaloBits = 8, LocationMuonBits = 9, TypeHasMomentumBits = 10, TypeStraightLineBits = 11
}
enum  flagsMasks {
  LocationMostUpstreamMask = 0x00000001, LocationFirstMeasurementMask = 0x00000002, LocationAtTTMask = 0x00000004, LocationAtTMask = 0x00000008,
  LocationBegRich1Mask = 0x00000010, LocationEndRich1Mask = 0x00000020, LocationBegRich2Mask = 0x00000040, LocationEndRich2Mask = 0x00000080,
  LocationCaloMask = 0x00000100, LocationMuonMask = 0x00000200, TypeHasMomentumMask = 0x00000400, TypeStraightLineMask = 0x00000800
}

Private Attributes

unsigned m_flags
 Variety of state flags. More...

HepVector m_state
 the state vector. More...

HepSymMatrix m_covariance
 the state covariance matrix (indexes 1,...,5 for x, y, tx, ty, Q/p). More...

double m_z
 the z-position of the state. More...


Detailed Description

TrState is the base class of offline and online track states.

Author:
Jose Hernando, Eduardo Rodrigues created Tue Dec 7 10:29:41 2004

Definition at line 50 of file TrState.h.


Member Enumeration Documentation

enum TrState::flagsBits [private]
 

Enumeration values:
LocationMostUpstreamBits 
LocationFirstMeasurementBits 
LocationAtTTBits 
LocationAtTBits 
LocationBegRich1Bits 
LocationEndRich1Bits 
LocationBegRich2Bits 
LocationEndRich2Bits 
LocationCaloBits 
LocationMuonBits 
TypeHasMomentumBits 
TypeStraightLineBits 

Definition at line 222 of file TrState.h.

enum TrState::flagsMasks [private]
 

Enumeration values:
LocationMostUpstreamMask 
LocationFirstMeasurementMask 
LocationAtTTMask 
LocationAtTMask 
LocationBegRich1Mask 
LocationEndRich1Mask 
LocationBegRich2Mask 
LocationEndRich2Mask 
LocationCaloMask 
LocationMuonMask 
TypeHasMomentumMask 
TypeStraightLineMask 

Definition at line 223 of file TrState.h.

00223 {LocationMostUpstreamMask = 0x00000001, LocationFirstMeasurementMask = 0x00000002, LocationAtTTMask = 0x00000004, LocationAtTMask = 0x00000008, LocationBegRich1Mask = 0x00000010, LocationEndRich1Mask = 0x00000020, LocationBegRich2Mask = 0x00000040, LocationEndRich2Mask = 0x00000080, LocationCaloMask = 0x00000100, LocationMuonMask = 0x00000200, TypeHasMomentumMask = 0x00000400, TypeStraightLineMask = 0x00000800}; 

enum TrState::Location
 

Enumeration values:
MostUpstream 
FirstMeasurement 
AtTT 
AtT 
BegRich1 
EndRich1 
BegRich2 
EndRich2 
Calo 
Muon 

Definition at line 56 of file TrState.h.

enum TrState::Type
 

Enumeration values:
HasMomentum 
StraightLine 

Definition at line 55 of file TrState.h.


Constructor & Destructor Documentation

TrState::TrState  
 

Default constructor. State defined to be of type TrState::HasMomentum.

Definition at line 16 of file TrState.cpp.

References HasMomentum, m_covariance, m_state, m_z, and setType.

Referenced by clone.

00016                  {
00017   setType( TrState::HasMomentum );
00018   m_z          = 0.;
00019   m_state      = HepVector(5,0);
00020   m_covariance = HepSymMatrix(5,0);
00021 }

virtual TrState::~TrState   [inline, virtual]
 

Destructor.

Definition at line 62 of file TrState.h.

00062 {}


Member Function Documentation

const CLID & TrState::classID   [inline, static]
 

Definition at line 242 of file TrState.h.

References CLID_TrState.

Referenced by clID.

00243 {
00244   return CLID_TrState;
00245 }

const CLID & TrState::clID   const [inline, virtual]
 

Retrieve pointer to class definition structure.

Definition at line 237 of file TrState.h.

References classID.

00238 {
00239   return TrState::classID();
00240 }

TrState * TrState::clone   const [virtual]
 

Clone the state.

Definition at line 153 of file TrState.cpp.

References TrState.

Referenced by propagate.

00154 {
00155   return new TrState(*this);
00156 };

HepSymMatrix & TrState::covariance   [inline]
 

Retrieve the state covariance matrix (indexes 1,...,5 for x, y, tx, ty, Q/p) (non-const).

Definition at line 457 of file TrState.h.

References m_covariance.

00458 {
00459   return m_covariance;
00460 }

const HepSymMatrix & TrState::covariance   const [inline]
 

Retrieve the state covariance matrix (indexes 1,...,5 for x, y, tx, ty, Q/p).

Definition at line 452 of file TrState.h.

References m_covariance.

Referenced by posMomCovariance.

00453 {
00454   return m_covariance;
00455 }

HepSymMatrix TrState::errMomentum   const [virtual]
 

Retrieve the errors on the momentum vector of the stateRetrieve the errors on the momentum vector of the state.

Definition at line 110 of file TrState.cpp.

References isFlagSet, posMomCovariance, TypeHasMomentumBits, and TypeHasMomentumMask.

00111 {
00112   if ( isFlagSet(TypeHasMomentumBits,TypeHasMomentumMask) ) {
00113     return posMomCovariance().sub(4,6);
00114   }
00115   else {
00116     //print out an error message ...
00117     return HepSymMatrix(3,0);
00118   }
00119 };

double TrState::errP2   const [virtual]
 

Retrieve the squared error on the momentum of the state.

Definition at line 101 of file TrState.cpp.

References errQOverP2, and m_state.

00102 {
00103   if ( m_state[4] != 0. ) return errQOverP2() / pow( m_state[4], 4. );
00104   return 0.;
00105 };

HepSymMatrix TrState::errPosition   const [inline]
 

Retrieve the errors on the 3D-position vector of the state.

Definition at line 329 of file TrState.h.

References posMomCovariance.

00330 {
00331    
00332   return posMomCovariance().sub(1,3);
00333         
00334 }

double TrState::errQOverP2   const [virtual]
 

Retrieve the squared error on the charge-over-momentum Q/P of the state.

Definition at line 93 of file TrState.cpp.

References m_covariance.

Referenced by errP2.

00094 {
00095   return m_covariance.fast(5,5);
00096 };

double TrState::errQOverPperp2   const [virtual]
 

Retrieve the squared error on the Q/Pperp of the state.

Definition at line 124 of file TrState.cpp.

References m_covariance, qOverP, tx, and ty.

00125 {
00126   double tx2        = tx() * tx();
00127   double ty2        = ty() * ty();
00128   double qOverP2    = qOverP() * qOverP();
00129   double transSlope = 1. + tx2;
00130   double norm       = 1 + tx2 + ty2;
00131 
00132   double QOverPperpError = ( (norm/transSlope) * m_covariance[4][4] )
00133 
00134     + ( qOverP2 * tx2 * ty2*ty2 * m_covariance[2][2]/
00135        (pow(transSlope,3.)*norm))
00136 
00137     + ( qOverP2 * ty2 * m_covariance[3][3] / (norm*transSlope) )
00138 
00139     - ( 2. * qOverP() * tx() * ty2 * m_covariance[2][4]
00140         / ( transSlope*transSlope ) )
00141 
00142     + 2. * qOverP() * ty() * m_covariance[3][4] / transSlope
00143 
00144     - 2. * ( qOverP2 * tx() * ty() * ty2 * m_covariance[2][3]
00145          / ( norm* transSlope*transSlope ) );
00146 
00147   return QOverPperpError;
00148 };

HepSymMatrix TrState::errSlopes   const [inline]
 

Retrieve the errors on the slopes of the state.

Definition at line 350 of file TrState.h.

References m_covariance.

00351 {
00352    
00353   HepSymMatrix err = m_covariance.sub(3,5);
00354   err.fast(2,1) = 0.;
00355   err.fast(3,1) = 0.;
00356   err.fast(3,2) = 0.;
00357   err.fast(3,3) = 0.;
00358   return err;
00359         
00360 }

double TrState::errTx2   const [inline]
 

Retrieve the squared error on the x-slope Tx=dx/dz of the state.

Definition at line 362 of file TrState.h.

References m_covariance.

00363 {
00364    
00365   return m_covariance.fast(3,3);
00366         
00367 }

double TrState::errTy2   const [inline]
 

Retrieve the squared error on the y-slope Ty=dy/dz of the state.

Definition at line 369 of file TrState.h.

References m_covariance.

00370 {
00371    
00372   return m_covariance.fast(4,4);
00373         
00374 }

double TrState::errX2   const [inline]
 

Retrieve the squared error on the x-position of the state.

Definition at line 336 of file TrState.h.

References m_covariance.

00337 {
00338    
00339   return m_covariance.fast(1,1);
00340         
00341 }

double TrState::errY2   const [inline]
 

Retrieve the squared error on the y-position of the state.

Definition at line 343 of file TrState.h.

References m_covariance.

00344 {
00345    
00346   return m_covariance.fast(2,2);
00347         
00348 }

std::ostream & TrState::fillStream std::ostream &    s const [inline, virtual]
 

Fill the ASCII output stream.

Definition at line 482 of file TrState.h.

References m_covariance, m_flags, m_state, and m_z.

00483 {
00484   s << "{ "
00485     << " flags:\t" << m_flags << std::endl
00486     << "   state:\t" << m_state << std::endl
00487     << "   covariance:\t" << m_covariance << std::endl
00488     << "   z:\t" << (float)m_z << " } ";
00489   return s;
00490 }

unsigned TrState::flags   const [inline]
 

Retrieve Variety of state flags.

Definition at line 437 of file TrState.h.

References m_flags.

00438 {
00439   return m_flags;
00440 }

bool TrState::isFlagSet unsigned    bits,
unsigned    mask
[protected]
 

Definition at line 213 of file TrState.cpp.

References m_flags.

Referenced by errMomentum, location, setState, and type.

00214 {
00215   return (bool)((m_flags & mask) >> bits);
00216 };

bool TrState::location unsigned    value const
 

Check the location of the state.

Definition at line 184 of file TrState.cpp.

References AtT, AtTT, BegRich1, BegRich2, Calo, EndRich1, EndRich2, FirstMeasurement, isFlagSet, LocationAtTBits, LocationAtTMask, LocationAtTTBits, LocationAtTTMask, LocationBegRich1Bits, LocationBegRich1Mask, LocationBegRich2Bits, LocationBegRich2Mask, LocationCaloBits, LocationCaloMask, LocationEndRich1Bits, LocationEndRich1Mask, LocationEndRich2Bits, LocationEndRich2Mask, LocationFirstMeasurementBits, LocationFirstMeasurementMask, LocationMostUpstreamBits, LocationMostUpstreamMask, LocationMuonBits, LocationMuonMask, MostUpstream, and Muon.

00185 {
00186   if      ( value == TrState::MostUpstream )
00187     return isFlagSet( LocationMostUpstreamMask, LocationMostUpstreamBits);
00188   else if ( value == TrState::FirstMeasurement )
00189     return isFlagSet( LocationFirstMeasurementMask, LocationFirstMeasurementBits);
00190   else if ( value == TrState::AtTT )
00191     return isFlagSet( LocationAtTTMask, LocationAtTTBits);
00192   else if ( value == TrState::AtT )
00193     return isFlagSet( LocationAtTMask, LocationAtTBits);
00194   else if ( value == TrState::BegRich1 )
00195     return isFlagSet( LocationBegRich1Mask, LocationBegRich1Bits);
00196   else if ( value == TrState::EndRich1 )
00197     return isFlagSet( LocationEndRich1Mask, LocationEndRich1Bits);
00198   else if ( value == TrState::BegRich2 )
00199     return isFlagSet( LocationBegRich2Mask, LocationBegRich2Bits);
00200   else if ( value == TrState::EndRich2 )
00201     return isFlagSet( LocationEndRich2Mask, LocationEndRich2Bits);
00202   else if ( value == TrState::Calo )
00203     return isFlagSet( LocationCaloMask, LocationCaloBits);
00204   else if ( value == TrState::Muon )
00205     return isFlagSet( LocationMuonMask, LocationMuonBits);
00206 
00207   return false;  
00208 };

HepVector3D TrState::momentum   const [inline]
 

Retrieve the momentum vector of the state.

Definition at line 312 of file TrState.h.

References p, and slopes.

Referenced by positionAndMomentum.

00313 {
00314    
00315   HepVector3D mom = slopes();
00316   mom *= ( p() / mom.mag() );
00317   return mom;
00318         
00319 }

unsigned int TrState::nParameters   const [inline]
 

Retrieve the number of state parameters.

Definition at line 247 of file TrState.h.

References m_state.

Referenced by setCovariance.

00248 {
00249    
00250   return (unsigned int) m_state.num_row();
00251         
00252 }

double TrState::p   const [virtual]
 

Retrieve the momentum of the state.

Definition at line 60 of file TrState.cpp.

References m_state.

Referenced by momentum.

00061 {
00062   if ( m_state[4] != 0. ) return fabs( 1./m_state[4] );
00063   return 0.;
00064 };

HepPoint3D TrState::position   const [inline]
 

Retrieve the 3D-position vector of the state.

Definition at line 263 of file TrState.h.

References m_state, and m_z.

Referenced by positionAndMomentum.

00264 {
00265    
00266   return HepPoint3D( m_state[0], m_state[1], m_z );
00267         
00268 }

void TrState::positionAndMomentum HepPoint3D &    pos,
HepVector3D &    mom,
HepSymMatrix &    cov6D
const [inline]
 

Retrieve the position and momentum vectors and the corresponding 6D covariance matrix (pos:1->3,mom:4-6) of the state.

Definition at line 254 of file TrState.h.

References momentum, position, and posMomCovariance.

00255 {
00256    
00257   pos   = position();
00258   mom   = momentum();
00259   cov6D = posMomCovariance();
00260         
00261 }

HepSymMatrix TrState::posMomCovariance   const [virtual]
 

Retrieve the 6D covariance matrix (x,y,z,px,py,pz) of the state.

Definition at line 82 of file TrState.cpp.

References covariance.

Referenced by errMomentum, errPosition, and positionAndMomentum.

00083 {
00084   HepSymMatrix cov = covariance();
00085   // to be written ...
00086 
00087   return cov;  
00088 };

double TrState::pt   const [virtual]
 

Retrieve the transverse momentum of the state.

Definition at line 69 of file TrState.cpp.

References m_state.

00070 {
00071   if ( m_state[4] != 0. ) {
00072     double txy2 = m_state[2]*m_state[2] + m_state[3]*m_state[3];
00073     return sqrt( txy2/(1.+txy2) ) / fabs( m_state[4] );
00074   }
00075   return 0.;
00076 };

double TrState::qOverP   const [virtual]
 

Retrieve the charge-over-momentum Q/P of the state.

Definition at line 52 of file TrState.cpp.

References m_state.

Referenced by errQOverPperp2, qOverPperp, and setState.

00053 {
00054   return m_state[4];
00055 };

double TrState::qOverPperp   const [inline]
 

Retrieve the Q/Pperp (ratio of the charge to the component of the momentum transverse to the magnetic field) of the state.

Definition at line 321 of file TrState.h.

References qOverP, tx, and ty.

00322 {
00323    
00324   double tx2 = tx() * tx();
00325   return ( qOverP() * sqrt( (1.+ tx2 + ty()*ty()) / (1. + tx2 ) ) );
00326         
00327 }

void TrState::reset   [virtual]
 

Clear the state before re-using it.

Definition at line 161 of file TrState.cpp.

References m_covariance, m_state, and m_z.

00162 {
00163   m_z          = 0.;
00164   m_state      = HepVector(5,0);
00165   m_covariance = HepSymMatrix(5,0);
00166 };

StreamBuffer & TrState::serialize StreamBuffer &    s [inline, virtual]
 

Serialize the object for reading.

Definition at line 471 of file TrState.h.

References m_covariance, m_flags, m_state, and m_z.

00472 {
00473   float l_z;
00474   s >> m_flags
00475     >> m_state
00476     >> m_covariance
00477     >> l_z;
00478   m_z = l_z;
00479   return s;
00480 }

StreamBuffer & TrState::serialize StreamBuffer &    s const [inline, virtual]
 

Serialize the object for writing.

Definition at line 462 of file TrState.h.

References m_covariance, m_flags, m_state, and m_z.

00463 {
00464   s << m_flags
00465     << m_state
00466     << m_covariance
00467     << (float)m_z;
00468   return s;
00469 }

void TrState::setCovariance const HepSymMatrix &    value [inline]
 

Update the state covariance.

Definition at line 394 of file TrState.h.

References m_covariance, and nParameters.

00395 {
00396    
00397   if ( value.num_row() == (int) nParameters() ) {
00398     m_covariance = value;
00399   }
00400   else {
00401     std::cerr << "ERROR   The dimension of the covariance matrix does not match that of the state!"
00402               << "ERROR   Using the default covariance matrix." << std::endl;
00403     int dim = nParameters();
00404     m_covariance = HepSymMatrix(dim,0);
00405   }
00406         
00407 }

void TrState::setFlag bool    value,
unsigned    bits,
unsigned    mask
[protected]
 

Definition at line 304 of file TrState.cpp.

References m_flags.

Referenced by setLocation, and setType.

00305 {
00306   unsigned val  = (unsigned) value;
00307   m_flags &= ~mask;
00308   m_flags |= ((((unsigned)val) << bits) & mask);
00309 };

void TrState::setLocation unsigned    value
 

Update the location of the state.

Definition at line 262 of file TrState.cpp.

References AtT, AtTT, BegRich1, BegRich2, Calo, EndRich1, EndRich2, FirstMeasurement, LocationAtTBits, LocationAtTMask, LocationAtTTBits, LocationAtTTMask, LocationBegRich1Bits, LocationBegRich1Mask, LocationBegRich2Bits, LocationBegRich2Mask, LocationCaloBits, LocationCaloMask, LocationEndRich1Bits, LocationEndRich1Mask, LocationEndRich2Bits, LocationEndRich2Mask, LocationFirstMeasurementBits, LocationFirstMeasurementMask, LocationMostUpstreamBits, LocationMostUpstreamMask, LocationMuonBits, LocationMuonMask, MostUpstream, Muon, and setFlag.

00263 {
00264   switch ( value )
00265   {
00266     case TrState::MostUpstream :
00267       setFlag( true, LocationMostUpstreamBits, LocationMostUpstreamMask );
00268       break;
00269     case TrState::FirstMeasurement :
00270       setFlag( true,  LocationFirstMeasurementBits, LocationFirstMeasurementMask );
00271       break;
00272     case TrState::AtTT :
00273       setFlag( true, LocationAtTTBits, LocationAtTTMask );
00274       break;
00275     case TrState::AtT :
00276       setFlag( true, LocationAtTBits, LocationAtTMask );
00277       break;
00278     case TrState::BegRich1 :
00279       setFlag( true, LocationBegRich1Bits, LocationBegRich1Mask );
00280       break;
00281     case TrState::EndRich1 :
00282       setFlag( true, LocationEndRich1Bits, LocationEndRich1Mask );
00283       break;
00284     case TrState::BegRich2 :
00285       setFlag( true, LocationBegRich2Bits, LocationBegRich2Mask );
00286       break;
00287     case TrState::EndRich2 :
00288       setFlag( true, LocationEndRich2Bits, LocationEndRich2Mask );
00289       break;
00290     case TrState::Calo :
00291       setFlag( true, LocationCaloBits, LocationCaloMask );
00292       break;
00293     case TrState::Muon :
00294       setFlag( true, LocationMuonBits, LocationMuonMask );
00295       break;
00296     default:
00297       ;
00298   }
00299 };

void TrState::setQOverP double    value [virtual]
 

Update the Q/P value of the state.

Definition at line 243 of file TrState.cpp.

References m_state.

00244 {
00245   m_state[4] = value;
00246 };

void TrState::setState double    x,
double    y,
double    z,
double    tx,
double    ty
[inline]
 

Update the state vector (presumably of type TrState::StraightLine).

Definition at line 383 of file TrState.h.

References m_state, m_z, tx, ty, x, y, and z.

00384 {
00385    
00386   m_state[0] = x;
00387   m_state[1] = y;
00388   m_state[2] = tx;
00389   m_state[3] = ty;
00390   m_z        = z;
00391         
00392 }

void TrState::setState double    x,
double    y,
double    z,
double    tx,
double    ty,
double    qOverP
[virtual]
 

Update the state vector (presumably of type TrState::HasMomentum).

Definition at line 221 of file TrState.cpp.

References isFlagSet, m_state, m_z, qOverP, tx, ty, TypeStraightLineBits, TypeStraightLineMask, x, y, and z.

00224 {
00225   m_state[0] = x;
00226   m_state[1] = y;
00227   m_state[2] = tx;
00228   m_state[3] = ty;
00229   m_z        = z;
00230   if ( isFlagSet(TypeStraightLineBits,TypeStraightLineMask) ) {
00231     std::cerr
00232       << "ERROR   You're trying to set the Q/P value for a state of type TrState::StraightLine!"
00233       << "ERROR   This value will be discarded." << std::endl;
00234   }
00235   else {
00236      m_state[4] = qOverP;
00237   }
00238 };

void TrState::setState const HepVector &    state [inline]
 

Update the state vector.

Definition at line 376 of file TrState.h.

References m_state, and state.

00377 {
00378    
00379   m_state = state;
00380         
00381 }

void TrState::setTx double    value [inline]
 

Update the Tx slope of the state.

Definition at line 423 of file TrState.h.

References m_state.

00424 {
00425    
00426   m_state[2] = value;
00427         
00428 }

void TrState::setTy double    value [inline]
 

Update the Ty slope of the state.

Definition at line 430 of file TrState.h.

References m_state.

00431 {
00432    
00433   m_state[3] = value;
00434         
00435 }

void TrState::setType unsigned    value [protected]
 

Update the type of the state.

Definition at line 251 of file TrState.cpp.

References HasMomentum, setFlag, StraightLine, TypeHasMomentumBits, TypeHasMomentumMask, TypeStraightLineBits, and TypeStraightLineMask.

Referenced by TrState.

00252 {
00253   if      ( value == TrState::HasMomentum )
00254     setFlag( true, TypeHasMomentumBits, TypeHasMomentumMask );
00255   else if ( value == TrState::StraightLine)
00256     setFlag( true, TypeStraightLineBits, TypeStraightLineMask );
00257 };

void TrState::setX double    value [inline]
 

Update the x-position of the state.

Definition at line 409 of file TrState.h.

References m_state.

00410 {
00411    
00412   m_state[0] = value;
00413         
00414 }

void TrState::setY double    value [inline]
 

Update the y-position of the state.

Definition at line 416 of file TrState.h.

References m_state.

00417 {
00418    
00419   m_state[1] = value;
00420         
00421 }

HepVector3D TrState::slopes   const [inline]
 

Retrieve the slopes (Tx=dx/dz,Ty=dy/dz,1.) of the state.

Definition at line 291 of file TrState.h.

References m_state.

Referenced by momentum.

00292 {
00293    
00294   return HepVector3D( m_state[2], m_state[3], 1.);
00295         
00296 }

HepVector & TrState::state   [inline]
 

Retrieve the state vector (non-const).

Definition at line 447 of file TrState.h.

References m_state.

00448 {
00449   return m_state;
00450 }

const HepVector & TrState::state   const [inline]
 

Retrieve the state vector.

Definition at line 442 of file TrState.h.

References m_state.

Referenced by setState.

00443 {
00444   return m_state;
00445 }

double TrState::tx   const [inline]
 

Retrieve the Tx=dx/dz slope of the state.

Definition at line 298 of file TrState.h.

References m_state.

Referenced by errQOverPperp2, qOverPperp, and setState.

00299 {
00300    
00301   return m_state[2];
00302         
00303 }

double TrState::ty   const [inline]
 

Retrieve the Ty=dy/dz slope of the state.

Definition at line 305 of file TrState.h.

References m_state.

Referenced by errQOverPperp2, qOverPperp, and setState.

00306 {
00307    
00308   return m_state[3];
00309         
00310 }

bool TrState::type unsigned    value const
 

Check the type of the state.

Definition at line 171 of file TrState.cpp.

References HasMomentum, isFlagSet, StraightLine, TypeHasMomentumBits, TypeHasMomentumMask, TypeStraightLineBits, and TypeStraightLineMask.

00172 {
00173   if      ( value == TrState::HasMomentum)
00174     return isFlagSet( TypeHasMomentumBits, TypeHasMomentumMask );
00175   else if ( value == TrState::StraightLine)
00176     return isFlagSet( TypeStraightLineBits, TypeStraightLineMask );
00177 
00178   return false;
00179 };

double TrState::x   const [inline]
 

Retrieve the x-position of the state.

Definition at line 270 of file TrState.h.

References m_state.

Referenced by setState.

00271 {
00272    
00273   return m_state[0];
00274         
00275 }

double TrState::y   const [inline]
 

Retrieve the y-position of the state.

Definition at line 277 of file TrState.h.

References m_state.

Referenced by setState.

00278 {
00279    
00280   return m_state[1];
00281         
00282 }

double TrState::z   const [inline]
 

Retrieve the z-position of the state.

Definition at line 284 of file TrState.h.

References m_z.

Referenced by setState.

00285 {
00286    
00287   return m_z;
00288         
00289 }


Member Data Documentation

HepSymMatrix TrState::m_covariance [private]
 

the state covariance matrix (indexes 1,...,5 for x, y, tx, ty, Q/p).

Definition at line 227 of file TrState.h.

Referenced by covariance, errQOverP2, errQOverPperp2, errSlopes, errTx2, errTy2, errX2, errY2, fillStream, reset, serialize, setCovariance, and TrState.

unsigned TrState::m_flags [private]
 

Variety of state flags.

Definition at line 225 of file TrState.h.

Referenced by fillStream, flags, isFlagSet, serialize, and setFlag.

HepVector TrState::m_state [private]
 

the state vector.

Definition at line 226 of file TrState.h.

Referenced by errP2, fillStream, nParameters, p, position, pt, qOverP, reset, serialize, setQOverP, setState, setTx, setTy, setX, setY, slopes, state, TrState, tx, ty, x, and y.

double TrState::m_z [private]
 

the z-position of the state.

Definition at line 228 of file TrState.h.

Referenced by fillStream, position, reset, serialize, setState, TrState, and z.


The documentation for this class was generated from the following files:
Generated on Tue Dec 7 10:30:21 2004 for New Track Event Model by doxygen 1.2.14 written by Dimitri van Heesch, © 1997-2002