Main Page | Namespace List | Class List | File List | Namespace Members | Class Members | File Members

Track Class Reference

#include <Track.h>

List of all members.

Public Types

enum  TrackType {
  Velo = 1, VeloR = 2, Backward = 4, Long = 8,
  Upstream = 16, Downstream = 32, Ttrack = 64
}
 enumeration for the track type More...

enum  HistoryFlag {
  LongTrack = 1, Seeding = 2, TrKshort = 4, TrMatching = 8,
  VeloTrack = 16, VeloTT = 32, TrgForward = 64, TrgVelo = 128,
  TrgVeloTT = 256
}
 enumeration for the track history More...

enum  Flag { Valid = 1, Unique = 2 }
 enumeration for the track flags More...


Public Member Functions

 Track ()
 Default Constructor.

virtual ~Track ()
 Default Destructor.

virtual const CLID & clID () const
StatusCode 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 a track closest to the beam-line.

StatusCode position (HepPoint3D &pos, HepSymMatrix &errPos) const
 Retrieve the 3D-position (+ errors) of a track closest to the beam-line.

StatusCode slopes (HepVector3D &slopes, HepSymMatrix &errSlopes) const
 Retrieve the slopes (dx/dz,dy/dz,1) of a track closest to the beam-line.

double p () const
 Retrieve the momentum of a track closest to the beam-line.

double pt () const
 Retrieve the transverse momentum of a track closest to the beam-line.

StatusCode momentum (HepVector3D &mom, HepSymMatrix &errMom) const
 Retrieve the momentum vector (+ errors) of a track closest to the beam-line.

StatusCode posMomCovariance (HepSymMatrix &cov6D) const
 Retrieve the 6D covariance matrix (x,y,z,px,py,pz) of a track closest to the beam-line.

int charge () const
 Retrieve the charge assigned to the track.

unsigned int nStates () const
 number of states on track

void addToStates (State *value)
 Add a State to the list of states associated to the track.

void removeFromStates (State *value)
 Remove a State from the list of states associated to the track.

virtual StateclosestState (double z)
 Retrieve the pointer to the state closest to the given z-position.

virtual const StateclosestState (double z) const
 Retrieve the pointer to the state closest to the given z-position.

virtual StateclosestState (HepPlane3D &plane)
 Retrieve the pointer to the state closest to the given plane.

virtual const StateclosestState (HepPlane3D &plane) const
 Retrieve the pointer to the state closest to the given plane.

virtual StatestateAt (const State::Location &value)
 Retrieve the pointer to the state at a certain predefined location. See State class.

virtual const StatestateAt (const State::Location &value) const
 Retrieve the pointer to the state at a certain predefined location. See State class.

double chi2 () const
 Retrieve the Chi^2 of the track.

virtual void reset ()
 Clear the track before re-use.

virtual Trackclone () const
 Clone the track.

std::vector< LHCbID > & LHCbIDs ()
 Retrieve the LHCbIDs associated to the track.

const std::vector< LHCbID > & LHCbIDs () const
 Retrieve the LHCbIDs associated to the track.

void setLHCbIDs (const std::vector< LHCbID > &value)
 Update the LHCbIDs associated to the track.

void addToLHCbIDs (const LHCbID &value)
 Add an LHCbID to the list of LHCbIDs associated to the track.

void removeFromLHCbIDs (const LHCbID &value)
 Remove an LHCbID from the list of LHCbIDs associated to the track.

virtual bool producedByAlgo (const HistoryFlag &value) const
 Check whether the track was produced by a given algorithm.

virtual void setProducedByAlgo (const HistoryFlag &value)
 Update the name of the algorithm that produced the track.

double chi2PerDoF () const
 Retrieve const chi^2 per degree of freedom of the track.

void setChi2PerDoF (double value)
 Update chi^2 per degree of freedom of the track.

int nDoF () const
 Retrieve const number of degrees of freedom of the track.

void setNDoF (int value)
 Update number of degrees of freedom of the track.

unsigned int flags () const
 Retrieve const the variety of track flags.

void setType (const TrackType &value)
 Update track type.

bool checkType (const TrackType &value) const
 Check track type.

void setFlag (const Flag &value)
 Update track flags.

bool checkFlag (const Flag &value) const
 Check track flags.

const StatephysicsState () const
 Retrieve const State closest to the beam-line.

StatephysicsState ()
 Retrieve State closest to the beam-line.

void setPhysicsState (const State &value)
 Update State closest to the beam-line.

const std::vector< State * > & states () const
 Retrieve const container with pointers to all the states.

std::vector< State * > & states ()
 Retrieve container with pointers to all the states.

void setStates (const std::vector< State * > &value)
 Update container with pointers to all the states.


Static Public Member Functions

const CLID & classID ()

Private Types

enum  flagsBits { typeBits = 0, historyBits = 7, flagBits = 16 }
 Offsets of bitfield flags. More...

enum  flagsMasks { typeMask = 0x7FL, historyMask = 0xFF80L, flagMask = 0x30000L }
 Bitmasks for bitfield flags. More...


Private Attributes

double m_chi2PerDoF
 chi^2 per degree of freedom of the track

int m_nDoF
 number of degrees of freedom of the track

unsigned int m_flags
 the variety of track flags

std::vector< LHCbID > m_lhcbids
 container of LHCbIDs

State m_physicsState
 State closest to the beam-line.

std::vector< State * > m_states
 container with pointers to all the states


Detailed Description

Track is the base class for offline and online tracks.

Author:
Jose Hernando, Eduardo Rodrigues created Tue Dec 14 21:59:39 2004

Definition at line 64 of file Track.h.


Member Enumeration Documentation

enum Track::Flag
 

enumeration for the track flags

Enumeration values:
Valid 
Unique 

Definition at line 87 of file Track.h.

00087            { Valid=1,
00088              Unique=2 };

enum Track::flagsBits [private]
 

Offsets of bitfield flags.

Enumeration values:
typeBits 
historyBits 
flagBits 

Definition at line 241 of file Track.h.

00241                 {typeBits    = 0,
00242                  historyBits = 7,
00243                  flagBits    = 16};

enum Track::flagsMasks [private]
 

Bitmasks for bitfield flags.

Enumeration values:
typeMask 
historyMask 
flagMask 

Definition at line 246 of file Track.h.

00246                  {typeMask    = 0x7FL,
00247                   historyMask = 0xFF80L,
00248                   flagMask    = 0x30000L};

enum Track::HistoryFlag
 

enumeration for the track history

Enumeration values:
LongTrack 
Seeding 
TrKshort 
TrMatching 
VeloTrack 
VeloTT 
TrgForward 
TrgVelo 
TrgVeloTT 

Definition at line 77 of file Track.h.

00077                   { LongTrack=1,
00078                     Seeding=2,
00079                     TrKshort=4,
00080                     TrMatching=8,
00081                     VeloTrack=16,
00082                     VeloTT=32,
00083                     TrgForward=64,
00084                     TrgVelo=128,
00085                     TrgVeloTT=256 };

enum Track::TrackType
 

enumeration for the track type

Enumeration values:
Velo 
VeloR 
Backward 
Long 
Upstream 
Downstream 
Ttrack 

Definition at line 69 of file Track.h.

00069                 { Velo=1,
00070                   VeloR=2,
00071                   Backward=4,
00072                   Long=8,
00073                   Upstream=16,
00074                   Downstream=32,
00075                   Ttrack=64 };


Constructor & Destructor Documentation

Track::Track  )  [inline]
 

Default Constructor.

Definition at line 91 of file Track.h.

References m_chi2PerDoF, m_flags, m_lhcbids, m_nDoF, m_physicsState, and m_states.

Referenced by clone().

00091           : m_chi2PerDoF(0.0),
00092             m_nDoF(0),
00093             m_flags(0),
00094             m_lhcbids(),
00095             m_physicsState(),
00096             m_states() {}

virtual Track::~Track  )  [inline, virtual]
 

Default Destructor.

Definition at line 99 of file Track.h.

00099 {}


Member Function Documentation

void Track::addToLHCbIDs const LHCbID &  value  )  [inline]
 

Add an LHCbID to the list of LHCbIDs associated to the track.

Definition at line 431 of file Track.h.

References m_lhcbids.

00432 {
00433 
00434   m_lhcbids.push_back( value );
00435         
00436 }

void Track::addToStates State value  )  [inline]
 

Add a State to the list of states associated to the track.

Definition at line 375 of file Track.h.

References m_states.

00376 {
00377 
00378   m_states.push_back( value );
00379         
00380 }

int Track::charge  )  const [inline]
 

Retrieve the charge assigned to the track.

Definition at line 360 of file Track.h.

References m_physicsState, and State::qOverP().

00361 {
00362 
00363   double qP = m_physicsState.qOverP();
00364   return ( qP != 0. ? int(fabs(qP)/qP) : 0 );
00365         
00366 }

bool Track::checkFlag const Flag value  )  const [inline]
 

Check track flags.

Definition at line 325 of file Track.h.

References flagMask, and m_flags.

00326 {
00327   unsigned int val = (unsigned int)value;  return 0 != ( m_flags & flagMask & val );
00328 }

bool Track::checkType const TrackType value  )  const [inline]
 

Check track type.

Definition at line 313 of file Track.h.

References m_flags, and typeMask.

00314 {
00315   unsigned int val = (unsigned int)value;  return 0 != ( m_flags & typeMask & val );
00316 }

double Track::chi2  )  const [inline]
 

Retrieve the Chi^2 of the track.

Definition at line 391 of file Track.h.

References m_chi2PerDoF, and m_nDoF.

00392 {
00393 
00394   return ( m_chi2PerDoF * double(m_nDoF) );
00395         
00396 }

double Track::chi2PerDoF  )  const [inline]
 

Retrieve const chi^2 per degree of freedom of the track.

Definition at line 281 of file Track.h.

References m_chi2PerDoF.

00282 {
00283   return m_chi2PerDoF;
00284 }

const CLID & Track::classID  )  [inline, static]
 

Definition at line 276 of file Track.h.

References CLID_Track.

Referenced by clID().

00277 {
00278   return CLID_Track;
00279 }

const CLID & Track::clID  )  const [inline, virtual]
 

Definition at line 271 of file Track.h.

References classID().

00272 {
00273   return Track::classID();
00274 }

Track * Track::clone  )  const [virtual]
 

Clone the track.

Definition at line 188 of file Track.cpp.

References Track().

00189 {
00190   Track* tk = new Track();
00191   *tk = *this;
00192   return tk;
00193 };

const State * Track::closestState HepPlane3D &  plane  )  const [virtual]
 

Retrieve the pointer to the state closest to the given plane.

Definition at line 145 of file Track.cpp.

References m_states, and position().

00146 {
00147   double minDist = 999999999.;
00148   double dist;
00149   State* best = 0;
00150   for ( std::vector<State*>::const_iterator it = m_states.begin() ;
00151         m_states.end() != it; it++ ) {
00152     dist = plane.distance( ((*it) -> position()) );
00153     if ( minDist > dist ) {
00154       minDist = dist;
00155       best    = *it;
00156     }
00157   }
00158   return best;
00159 };

State * Track::closestState HepPlane3D &  plane  )  [virtual]
 

Retrieve the pointer to the state closest to the given plane.

Definition at line 126 of file Track.cpp.

References m_states, and position().

00127 {
00128   double minDist = 999999999.;
00129   double dist;
00130   State* best = 0;
00131   for ( std::vector<State*>::iterator it = m_states.begin() ;
00132         m_states.end() != it; it++ ) {
00133     dist = plane.distance( ((*it) -> position()) );
00134     if ( minDist > dist ) {
00135       minDist = dist;
00136       best    = *it;
00137     }
00138   }
00139   return best;
00140 };

const State * Track::closestState double  z  )  const [virtual]
 

Retrieve the pointer to the state closest to the given z-position.

Definition at line 109 of file Track.cpp.

References m_states.

00110 {
00111   double minDist = 999999999.;
00112   State* best = 0;
00113   for ( std::vector<State*>::const_iterator it = m_states.begin() ;
00114         m_states.end() != it; it++ ) {
00115     if ( minDist > fabs( z - (*it)->z() ) ) {
00116       minDist = fabs( z-(*it)->z() );
00117       best    = *it;
00118     }
00119   }
00120   return best;
00121 };

State * Track::closestState double  z  )  [virtual]
 

Retrieve the pointer to the state closest to the given z-position.

Definition at line 92 of file Track.cpp.

References m_states.

00093 {
00094   double minDist = 999999999.;
00095   State* best = 0;
00096   for ( std::vector<State*>::iterator it = m_states.begin() ;
00097         m_states.end() != it; it++ ) {
00098     if ( minDist > fabs( z - (*it)->z() ) ) {
00099       minDist = fabs( z-(*it)->z() );
00100       best    = *it;
00101     }
00102   }
00103   return best;
00104 };

unsigned int Track::flags  )  const [inline]
 

Retrieve const the variety of track flags.

Definition at line 301 of file Track.h.

References m_flags.

00302 {
00303   return m_flags;
00304 }

const std::vector< LHCbID > & Track::LHCbIDs  )  const [inline]
 

Retrieve the LHCbIDs associated to the track.

Definition at line 417 of file Track.h.

References m_lhcbids.

00418 {
00419 
00420   return m_lhcbids;
00421         
00422 }

std::vector< LHCbID > & Track::LHCbIDs  )  [inline]
 

Retrieve the LHCbIDs associated to the track.

Definition at line 410 of file Track.h.

References m_lhcbids.

00411 {
00412 
00413   return m_lhcbids;
00414         
00415 }

StatusCode Track::momentum HepVector3D &  mom,
HepSymMatrix &  errMom
const
 

Retrieve the momentum vector (+ errors) of a track closest to the beam-line.

Definition at line 69 of file Track.cpp.

References State::errMomentum(), m_physicsState, and State::momentum().

00071 {
00072   mom    = m_physicsState.momentum();
00073   errMom = m_physicsState.errMomentum();
00074 
00075   return StatusCode::SUCCESS;
00076 };

int Track::nDoF  )  const [inline]
 

Retrieve const number of degrees of freedom of the track.

Definition at line 291 of file Track.h.

References m_nDoF.

00292 {
00293   return m_nDoF;
00294 }

unsigned int Track::nStates  )  const [inline]
 

number of states on track

Definition at line 368 of file Track.h.

References m_states.

00369 {
00370 
00371   return m_states.size();
00372         
00373 }

double Track::p  )  const
 

Retrieve the momentum of a track closest to the beam-line.

Definition at line 53 of file Track.cpp.

References m_physicsState, and State::p().

00054 {
00055   return m_physicsState.p();
00056 };

State & Track::physicsState  )  [inline]
 

Retrieve State closest to the beam-line.

Definition at line 335 of file Track.h.

References m_physicsState.

00336 {
00337   return m_physicsState;
00338 }

const State & Track::physicsState  )  const [inline]
 

Retrieve const State closest to the beam-line.

Definition at line 330 of file Track.h.

References m_physicsState.

00331 {
00332   return m_physicsState;
00333 }

StatusCode Track::position HepPoint3D &  pos,
HepSymMatrix &  errPos
const
 

Retrieve the 3D-position (+ errors) of a track closest to the beam-line.

Definition at line 29 of file Track.cpp.

References State::errPosition(), m_physicsState, and State::position().

Referenced by closestState().

00031 {
00032   pos    = m_physicsState.position();
00033   errPos = m_physicsState.errPosition();
00034 
00035   return StatusCode::SUCCESS;
00036 };

StatusCode Track::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 a track closest to the beam-line.

Definition at line 17 of file Track.cpp.

References m_physicsState, and State::positionAndMomentum().

00020 {
00021   m_physicsState.positionAndMomentum( pos, mom, cov6D );
00022 
00023   return StatusCode::SUCCESS;
00024 };

StatusCode Track::posMomCovariance HepSymMatrix &  cov6D  )  const
 

Retrieve the 6D covariance matrix (x,y,z,px,py,pz) of a track closest to the beam-line.

Definition at line 82 of file Track.cpp.

References m_physicsState, and State::posMomCovariance().

00083 {
00084   cov6D = m_physicsState.posMomCovariance();
00085 
00086   return StatusCode::SUCCESS;
00087 };

bool Track::producedByAlgo const HistoryFlag value  )  const [virtual]
 

Check whether the track was produced by a given algorithm.

Definition at line 198 of file Track.cpp.

References historyMask, and m_flags.

00199 {
00200   unsigned int val = (unsigned int)value;
00201   return 0 != ( m_flags & historyMask & val );
00202 };

double Track::pt  )  const
 

Retrieve the transverse momentum of a track closest to the beam-line.

Definition at line 61 of file Track.cpp.

References m_physicsState, and State::pt().

00062 {
00063   return m_physicsState.pt();
00064 };

void Track::removeFromLHCbIDs const LHCbID &  value  )  [inline]
 

Remove an LHCbID from the list of LHCbIDs associated to the track.

Definition at line 438 of file Track.h.

References m_lhcbids.

00439 {
00440 
00441   std::vector<LHCbID>::iterator iter =
00442     std::remove( m_lhcbids.begin(), m_lhcbids.end(), value );
00443   m_lhcbids.erase( iter, m_lhcbids.end() );
00444         
00445 }

void Track::removeFromStates State value  )  [inline]
 

Remove a State from the list of states associated to the track.

Definition at line 382 of file Track.h.

References m_states.

00383 {
00384 
00385   std::vector<State*>::iterator iter =
00386     std::remove( m_states.begin(), m_states.end(), value );
00387   m_states.erase( iter, m_states.end() );
00388         
00389 }

void Track::reset  )  [inline, virtual]
 

Clear the track before re-use.

Definition at line 398 of file Track.h.

References m_chi2PerDoF, m_flags, m_lhcbids, m_nDoF, m_physicsState, m_states, and State::reset().

00399 {
00400 
00401   m_chi2PerDoF   = 0;
00402   m_nDoF         = 0;
00403   m_flags        = 0;
00404   m_physicsState.reset();
00405   m_states.clear();
00406   m_lhcbids.clear();
00407         
00408 }

void Track::setChi2PerDoF double  value  )  [inline]
 

Update chi^2 per degree of freedom of the track.

Definition at line 286 of file Track.h.

References m_chi2PerDoF.

00287 {
00288   m_chi2PerDoF = value;
00289 }

void Track::setFlag const Flag value  )  [inline]
 

Update track flags.

Definition at line 318 of file Track.h.

References flagBits, flagMask, and m_flags.

00319 {
00320   unsigned int val = (unsigned int)value;
00321   m_flags &= ~flagMask;
00322   m_flags |= ((((unsigned int)val) << flagBits) & flagMask);
00323 }

void Track::setLHCbIDs const std::vector< LHCbID > &  value  )  [inline]
 

Update the LHCbIDs associated to the track.

Definition at line 424 of file Track.h.

References m_lhcbids.

00425 {
00426 
00427   m_lhcbids = value;
00428         
00429 }

void Track::setNDoF int  value  )  [inline]
 

Update number of degrees of freedom of the track.

Definition at line 296 of file Track.h.

References m_nDoF.

00297 {
00298   m_nDoF = value;
00299 }

void Track::setPhysicsState const State value  )  [inline]
 

Update State closest to the beam-line.

Definition at line 340 of file Track.h.

References m_physicsState.

00341 {
00342   m_physicsState = value;
00343 }

void Track::setProducedByAlgo const HistoryFlag value  )  [virtual]
 

Update the name of the algorithm that produced the track.

Definition at line 207 of file Track.cpp.

References historyBits, historyMask, and m_flags.

00208 {
00209   unsigned int val = (unsigned int)value;
00210   m_flags &= ~historyMask;
00211   m_flags |= ((((unsigned int)val) << historyBits) & historyMask);
00212 };

void Track::setStates const std::vector< State * > &  value  )  [inline]
 

Update container with pointers to all the states.

Definition at line 355 of file Track.h.

References m_states.

00356 {
00357   m_states = value;
00358 }

void Track::setType const TrackType value  )  [inline]
 

Update track type.

Definition at line 306 of file Track.h.

References m_flags, typeBits, and typeMask.

00307 {
00308   unsigned int val = (unsigned int)value;
00309   m_flags &= ~typeMask;
00310   m_flags |= ((((unsigned int)val) << typeBits) & typeMask);
00311 }

StatusCode Track::slopes HepVector3D &  slopes,
HepSymMatrix &  errSlopes
const
 

Retrieve the slopes (dx/dz,dy/dz,1) of a track closest to the beam-line.

Definition at line 41 of file Track.cpp.

References State::errSlopes(), m_physicsState, and State::slopes().

00043 {
00044   slopes    = m_physicsState.slopes();
00045   errSlopes = m_physicsState.errSlopes();
00046 
00047   return StatusCode::SUCCESS;
00048 };

const State * Track::stateAt const State::Location value  )  const [virtual]
 

Retrieve the pointer to the state at a certain predefined location. See State class.

Definition at line 176 of file Track.cpp.

References m_states.

00177 {
00178   for ( std::vector<State*>::const_iterator it = m_states.begin() ;
00179         m_states.end() != it; it++ ) {
00180     if ( (*it) -> checkLocation( value ) ) return (*it);
00181   }
00182   return NULL;
00183 };

State * Track::stateAt const State::Location value  )  [virtual]
 

Retrieve the pointer to the state at a certain predefined location. See State class.

Definition at line 164 of file Track.cpp.

References m_states.

00165 {
00166   for ( std::vector<State*>::iterator it = m_states.begin() ;
00167         m_states.end() != it; it++ ) {
00168     if ( (*it) -> checkLocation( value ) ) return (*it);
00169   }
00170   return NULL;
00171 };

std::vector< State * > & Track::states  )  [inline]
 

Retrieve container with pointers to all the states.

Definition at line 350 of file Track.h.

References m_states.

00351 {
00352   return m_states;
00353 }

const std::vector< State * > & Track::states  )  const [inline]
 

Retrieve const container with pointers to all the states.

Definition at line 345 of file Track.h.

References m_states.

00346 {
00347   return m_states;
00348 }


Member Data Documentation

double Track::m_chi2PerDoF [private]
 

chi^2 per degree of freedom of the track

Definition at line 251 of file Track.h.

Referenced by chi2(), chi2PerDoF(), reset(), setChi2PerDoF(), and Track().

unsigned int Track::m_flags [private]
 

the variety of track flags

Definition at line 253 of file Track.h.

Referenced by checkFlag(), checkType(), flags(), producedByAlgo(), reset(), setFlag(), setProducedByAlgo(), setType(), and Track().

std::vector<LHCbID> Track::m_lhcbids [private]
 

container of LHCbIDs

Definition at line 254 of file Track.h.

Referenced by addToLHCbIDs(), LHCbIDs(), removeFromLHCbIDs(), reset(), setLHCbIDs(), and Track().

int Track::m_nDoF [private]
 

number of degrees of freedom of the track

Definition at line 252 of file Track.h.

Referenced by chi2(), nDoF(), reset(), setNDoF(), and Track().

State Track::m_physicsState [private]
 

State closest to the beam-line.

Definition at line 255 of file Track.h.

Referenced by charge(), momentum(), p(), physicsState(), position(), positionAndMomentum(), posMomCovariance(), pt(), reset(), setPhysicsState(), slopes(), and Track().

std::vector<State*> Track::m_states [private]
 

container with pointers to all the states

Definition at line 256 of file Track.h.

Referenced by addToStates(), closestState(), nStates(), removeFromStates(), reset(), setStates(), stateAt(), states(), and Track().


The documentation for this class was generated from the following files:
Generated on Tue Dec 14 22:00:36 2004 for New Track Event Model by doxygen 1.3.5