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

Track Class Reference

#include <Track.h>

List of all members.

Public Member Functions

 Track (int key)
 Constructor with assigned key.
 Track ()
 Default Constructor.
 ~Track ()
 Track destructor.
virtual const CLID & clID () const
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) at the first state.
void positionAndMomentum (HepPoint3D &pos, HepVector3D &mom) const
 Retrieve the position and momentum vectors at the first state.
HepPoint3D position () const
 Retrieve the 3D-position vector of the state.
void position (HepPoint3D &pos, HepSymMatrix &errPos) const
 Retrieve the 3D-position (+ errors) at the first state.
HepVector3D slopes () const
 Retrieve the slopes (Tx=dx/dz,Ty=dy/dz,1.) of the state.
void slopes (HepVector3D &slopes, HepSymMatrix &errSlopes) const
 Retrieve the slopes (dx/dz,dy/dz,1) at the first state.
HepVector3D momentum () const
 Retrieve the momentum vector of the state.
double p () const
 Retrieve the momentum at the first state.
double pt () const
 Retrieve the transverse momentum at the first state.
void momentum (HepVector3D &mom, HepSymMatrix &errMom) const
 Retrieve the momentum vector (+ errors) at the first state.
void posMomCovariance (HepSymMatrix &cov6D) const
 Retrieve the 6D covariance matrix (x,y,z,px,py,pz) at the first state.
StatefirstState () const
 Retrieve the the first state.
int charge () const
 Retrieve the charge assigned to the track.
double chi2 () const
 Retrieve the Chi^2 of the track.
unsigned int nStates () const
 number of states on track
void addToStates (const State &state)
 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.
StateclosestState (double z)
 Retrieve the reference to the state closest to the given z-position.
const StateclosestState (double z) const
 Retrieve the reference to the state closest to the given z-position.
StateclosestState (const HepPlane3D &plane)
 Retrieve the reference to the state closest to the given plane.
const StateclosestState (const HepPlane3D &plane) const
 Retrieve the reference to the state closest to the given plane.
bool hasStateAt (unsigned int location) const
 check the existence of a state at a certain predefined location. See State class.
StatestateAt (unsigned int location)
 Retrieve the state at a certain predefined location. See State class.
const StatestateAt (unsigned int location) const
 Retrieve the const state at a certain predefined location. See State class.
unsigned int nMeasurements () const
 number of measurements on track
void addToMeasurements (const Measurement &meas)
 add a measurement to the list associated to the track
void removeFromMeasurements (Measurement *value)
 Remove a measurement from the list of measurements associated to the track.
void addToNodes (Node *node)
 add a Node to the list of nodes (note: Track will take the ownership of this pointer!!)
void removeFromNodes (Node *value)
 Remove a Node from the list of nodes 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.
void addToAncestors (const Track &ancestor)
 add a track to the list of ancestors of this track
virtual void reset ()
 Clear the track before re-use.
virtual Trackclone () const
 Clone the track (you take ownership of the pointer).
bool checkType (unsigned int value) const
 check the type of the track
bool checkHistory (unsigned int value) const
 check the history of the track
bool checkHistoryFit (unsigned int value) const
 check the fit history of the track
void setFlag (unsigned int flag, bool ok)
 Update the flag (see TrackKeys::Flags).
bool checkFlag (unsigned int flag) const
 check the status of the flag
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 setFlags (unsigned int value)
 Update the variety of track flags.
unsigned int type () const
 Retrieve track type.
void setType (unsigned int value)
 Update track type.
unsigned int history () const
 Retrieve specifies the pattern recogn algorithm that created the track.
void setHistory (unsigned int value)
 Update specifies the pattern recogn algorithm that created the track.
unsigned int historyFit () const
 Retrieve specifies the fitting algorithm the fitted the track).
void setHistoryFit (unsigned int value)
 Update specifies the fitting algorithm the fitted the track).
unsigned int status () const
 Retrieve status of the track.
void setStatus (unsigned int value)
 Update status of the track.
unsigned int flag () const
 Retrieve track flags.
unsigned int specific () const
 Retrieve track specific bits.
void setSpecific (unsigned int value)
 Update track specific bits.
const std::vector< LHCbID > & lhcbIDs () const
 Retrieve const container of LHCbIDs.
std::vector< LHCbID > & lhcbIDs ()
 Retrieve container of LHCbIDs.
void setLhcbIDs (const std::vector< LHCbID > &value)
 Update container of LHCbIDs.
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.
const std::vector< Measurement * > & measurements () const
 Retrieve const container of Measurements.
std::vector< Measurement * > & measurements ()
 Retrieve container of Measurements.
const std::vector< Node * > & nodes () const
 Retrieve const container of Nodes.
std::vector< Node * > & nodes ()
 Retrieve container of Nodes.
const SmartRefVector< Track > & ancestors () const
 Retrieve (const) ancestor tracks that created this one.
SmartRefVector< Track > & ancestors ()
 Retrieve ancestor tracks that created this one.
void addToAncestors (const SmartRef< Track > &value)
 Add to ancestor tracks that created this one.
void addToAncestors (const Track *value)
 Att to (pointer) ancestor tracks that created this one.
void removeFromAncestors (const SmartRef< Track > &value)
 Remove from ancestor tracks that created this one.
void clearAncestors ()
 Clear ancestor tracks that created this one.

Static Public Member Functions

static const CLID & classID ()

Protected Types

enum  flagsBits {
  typeBits = 0, historyBits = 5, historyFitBits = 10, statusBits = 15,
  flagBits = 18, specificBits = 28
}
 Offsets of bitfield flags. More...
enum  flagsMasks {
  typeMask = 0x1FL, historyMask = 0x3E0L, historyFitMask = 0x7C00L, statusMask = 0x38000L,
  flagMask = 0xFFC0000L, specificMask = 0xF0000000L
}
 Bitmasks for bitfield flags. More...

Protected 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< LHCbIDm_lhcbIDs
 container of LHCbIDs
std::vector< State * > m_states
 container with pointers to all the states
std::vector< Measurement * > m_measurements
 container of Measurements
std::vector< Node * > m_nodes
 container of Nodes
SmartRefVector< Trackm_ancestors
 ancestor tracks that created this one


Detailed Description

Track is the base class for offline and online tracks.

Author:
Jose Hernando, Eduardo Rodrigues created Fri May 27 11:53:51 2005

Definition at line 63 of file Track.h.


Member Enumeration Documentation

enum Track::flagsBits [protected]
 

Offsets of bitfield flags.

Enumeration values:
typeBits 
historyBits 
historyFitBits 
statusBits 
flagBits 
specificBits 

Definition at line 317 of file Track.h.

00317                 {typeBits       = 0,
00318                  historyBits    = 5,
00319                  historyFitBits = 10,
00320                  statusBits     = 15,
00321                  flagBits       = 18,
00322                  specificBits   = 28};

enum Track::flagsMasks [protected]
 

Bitmasks for bitfield flags.

Enumeration values:
typeMask 
historyMask 
historyFitMask 
statusMask 
flagMask 
specificMask 

Definition at line 325 of file Track.h.

00325                  {typeMask       = 0x1FL,
00326                   historyMask    = 0x3E0L,
00327                   historyFitMask = 0x7C00L,
00328                   statusMask     = 0x38000L,
00329                   flagMask       = 0xFFC0000L,
00330                   specificMask   = 0xF0000000L};


Constructor & Destructor Documentation

Track::Track int  key  )  [inline]
 

Constructor with assigned key.

Definition at line 68 of file Track.h.

References m_ancestors, m_chi2PerDoF, m_flags, m_lhcbIDs, m_measurements, m_nDoF, m_nodes, and m_states.

00068                  : KeyedObject<int>( key ),
00069                    m_chi2PerDoF(0.0),
00070                    m_nDoF(0),
00071                    m_flags(0),
00072                    m_lhcbIDs(),
00073                    m_states(),
00074                    m_measurements(),
00075                    m_nodes(),
00076                    m_ancestors() {}

Track::Track  )  [inline]
 

Default Constructor.

Definition at line 79 of file Track.h.

References m_chi2PerDoF, m_flags, m_lhcbIDs, m_measurements, m_nDoF, m_nodes, and m_states.

Referenced by clone().

00079           : m_chi2PerDoF(0.0),
00080             m_nDoF(0),
00081             m_flags(0),
00082             m_lhcbIDs(),
00083             m_states(),
00084             m_measurements(),
00085             m_nodes() {}

Track::~Track  )  [inline]
 

Track destructor.

Definition at line 356 of file Track.h.

References reset().

00357 {
00358 
00359   reset();
00360         
00361 }


Member Function Documentation

void Track::addToAncestors const Track value  )  [inline]
 

Att to (pointer) ancestor tracks that created this one.

Definition at line 528 of file Track.h.

References m_ancestors.

00529 {
00530   m_ancestors.push_back(value);
00531 }

void Track::addToAncestors const SmartRef< Track > &  value  )  [inline]
 

Add to ancestor tracks that created this one.

Definition at line 523 of file Track.h.

References m_ancestors.

00524 {
00525   m_ancestors.push_back(value);
00526 }

void Track::addToAncestors const Track ancestor  )  [inline]
 

add a track to the list of ancestors of this track

Definition at line 632 of file Track.h.

References m_ancestors.

Referenced by clone().

00633 {
00634 
00635   m_ancestors.push_back( (Track*) &ancestor );
00636         
00637 }

void Track::addToLhcbIDs const LHCbID value  )  [inline]
 

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

Definition at line 616 of file Track.h.

References m_lhcbIDs.

Referenced by addToMeasurements().

00617 {
00618 
00619   m_lhcbIDs.push_back( value );
00620         
00621 }

void Track::addToMeasurements const Measurement meas  ) 
 

add a measurement to the list associated to the track

Definition at line 252 of file Track.cpp.

References addToLhcbIDs(), checkFlag(), clone(), m_lhcbIDs, and m_measurements.

Referenced by clone().

00253 {
00254   const LHCbID& id = meas.lhcbID();
00255   if (std::find(m_lhcbIDs.begin(),m_lhcbIDs.end(),id) == m_lhcbIDs.end())
00256     addToLhcbIDs(id);
00257   Measurement* local = meas.clone();
00258   m_measurements.push_back(local);
00259   int order = checkFlag(TrackKeys::Backward) ? -1 : 1;
00260   std::vector<Measurement*>::iterator i = 
00261     std::upper_bound(m_measurements.begin(),
00262                      m_measurements.end(),
00263                      local,  
00264                      TrackFunctor::orderByZ<Measurement>(order));
00265   m_measurements.insert(i,local);
00266 }

void Track::addToNodes Node node  )  [inline]
 

add a Node to the list of nodes (note: Track will take the ownership of this pointer!!)

Definition at line 609 of file Track.h.

References m_nodes.

Referenced by clone().

00610 {
00611 
00612   m_nodes.push_back( node );
00613         
00614 }

void Track::addToStates const State state  ) 
 

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

Definition at line 238 of file Track.cpp.

References checkFlag(), clone(), and m_states.

Referenced by clone().

00239 {
00240   State* local = state.clone();
00241   m_states.push_back(local);
00242   int order = checkFlag(TrackKeys::Backward) ? -1 : 1;
00243   std::vector<State*>::iterator i = 
00244     std::upper_bound(m_states.begin(),
00245                      m_states.end(),
00246                      local,  
00247                      TrackFunctor::orderByZ<State>(order));
00248   m_states.insert(i,local);    
00249 }

SmartRefVector< Track > & Track::ancestors  )  [inline]
 

Retrieve ancestor tracks that created this one.

Definition at line 518 of file Track.h.

References m_ancestors.

00519 {
00520   return m_ancestors;
00521 }

const SmartRefVector< Track > & Track::ancestors  )  const [inline]
 

Retrieve (const) ancestor tracks that created this one.

Definition at line 513 of file Track.h.

References m_ancestors.

00514 {
00515   return m_ancestors;
00516 }

int Track::charge  )  const [inline]
 

Retrieve the charge assigned to the track.

Definition at line 578 of file Track.h.

References firstState(), and State::qOverP().

00579 {
00580 
00581   double qP = firstState().qOverP();
00582   return ( qP != 0. ? int(fabs(qP)/qP) : 0 );
00583         
00584 }

bool Track::checkFlag unsigned int  flag  )  const [inline]
 

check the status of the flag

Definition at line 670 of file Track.h.

References flagBits, flagMask, and m_flags.

Referenced by addToMeasurements(), and addToStates().

00671 {
00672 
00673   unsigned int val = ((unsigned int) flag << flagBits);  
00674   bool ok = (0 != ( m_flags & flagMask & val ));
00675   return ok;
00676         
00677 }

bool Track::checkHistory unsigned int  value  )  const [inline]
 

check the history of the track

Definition at line 646 of file Track.h.

References history().

00647 {
00648 
00649   return history() == value;
00650         
00651 }

bool Track::checkHistoryFit unsigned int  value  )  const [inline]
 

check the fit history of the track

Definition at line 653 of file Track.h.

References historyFit().

00654 {
00655 
00656   return historyFit() == value;
00657         
00658 }

bool Track::checkType unsigned int  value  )  const [inline]
 

check the type of the track

Definition at line 639 of file Track.h.

References type().

00640 {
00641 
00642   return type() == value;
00643         
00644 }

double Track::chi2  )  const [inline]
 

Retrieve the Chi^2 of the track.

Definition at line 586 of file Track.h.

References m_chi2PerDoF, and m_nDoF.

00587 {
00588 
00589   return ( m_chi2PerDoF * double(m_nDoF) );
00590         
00591 }

double Track::chi2PerDoF  )  const [inline]
 

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

Definition at line 373 of file Track.h.

References m_chi2PerDoF.

Referenced by clone().

00374 {
00375   return m_chi2PerDoF;
00376 }

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

Definition at line 368 of file Track.h.

References CLID_Track.

Referenced by clID().

00369 {
00370   return CLID_Track;
00371 }

void Track::clearAncestors  )  [inline]
 

Clear ancestor tracks that created this one.

Definition at line 540 of file Track.h.

References m_ancestors.

00541 {
00542   m_ancestors.clear();
00543 }

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

Definition at line 363 of file Track.h.

References classID().

00364 {
00365   return Track::classID();
00366 }

Track * Track::clone  )  const [virtual]
 

Clone the track (you take ownership of the pointer).

Definition at line 214 of file Track.cpp.

References addToAncestors(), addToMeasurements(), addToNodes(), addToStates(), chi2PerDoF(), flags(), lhcbIDs(), m_ancestors, m_measurements, m_nodes, m_states, nDoF(), setChi2PerDoF(), setFlags(), setLhcbIDs(), setNDoF(), and Track().

Referenced by addToMeasurements(), addToStates(), and TrFitTrack2TrackCnv::execute().

00215 {
00216   Track* tr = new Track();
00217   tr->setChi2PerDoF( chi2PerDoF() );
00218   tr->setNDoF( nDoF() );
00219   tr->setFlags( flags() );
00220   tr->setLhcbIDs( lhcbIDs() );
00221   for (std::vector<State*>::const_iterator it = m_states.begin();
00222        it != m_states.end(); it++) tr->addToStates( *(*it));
00223   for (std::vector<Measurement*>::const_iterator it2 = m_measurements.begin();
00224        it2 != m_measurements.end(); it2++) 
00225     tr->addToMeasurements( *(*it2) );
00226   for (std::vector<Node*>::const_iterator it3 = m_nodes.begin();
00227        it3 != m_nodes.end(); it3++) tr->addToNodes( (*it3)->clone() );
00228   for (SmartRefVector<Track>::const_iterator it4 = m_ancestors.begin();
00229        it4 != m_ancestors.end();  it4++) tr->addToAncestors(*(*it4));
00230   
00231   return tr;
00232 };

const State & Track::closestState const HepPlane3D &  plane  )  const
 

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

Definition at line 135 of file Track.cpp.

References m_states.

00136 {
00137   std::vector<State*>::const_iterator iter = 
00138     std::max_element(m_states.begin(),m_states.end(),
00139                      TrackFunctor::closestToPlane<State>(plane));
00140   if (iter == m_states.end())
00141     throw GaudiException( "No state closest to plane","Track.cpp",
00142                           StatusCode::FAILURE );
00143   return *(*iter);
00144 };

State & Track::closestState const HepPlane3D &  plane  ) 
 

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

Definition at line 121 of file Track.cpp.

References m_states.

00122 {
00123   std::vector<State*>::iterator iter = 
00124     std::max_element(m_states.begin(),m_states.end(),
00125                      TrackFunctor::closestToPlane<State>(plane));
00126   if (iter == m_states.end())
00127     throw GaudiException( "No state closest to plane","Track.cpp",
00128                           StatusCode::FAILURE );
00129   return *(*iter);
00130 };

const State & Track::closestState double  z  )  const
 

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

Definition at line 107 of file Track.cpp.

References m_states.

00108 {
00109   std::vector<State*>::const_iterator iter = 
00110     std::max_element(m_states.begin(),m_states.end(),
00111                      TrackFunctor::closestToZ<State>(z));
00112   if (iter == m_states.end())
00113     throw GaudiException( "No state closest to z","Track.cpp",
00114                           StatusCode::FAILURE );
00115   return *(*iter);
00116 };

State & Track::closestState double  z  ) 
 

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

Definition at line 93 of file Track.cpp.

References m_states.

00094 {
00095   std::vector<State*>::iterator iter = 
00096     std::max_element(m_states.begin(),m_states.end(),
00097                      TrackFunctor::closestToZ<State>(z));
00098   if (iter == m_states.end())
00099     throw GaudiException( "No state closest to z","Track.cpp",
00100                           StatusCode::FAILURE );
00101   return *(*iter);
00102 };

State & Track::firstState  )  const [inline]
 

Retrieve the the first state.

Definition at line 566 of file Track.h.

References m_states.

Referenced by charge(), momentum(), p(), position(), positionAndMomentum(), posMomCovariance(), pt(), and slopes().

00567 {
00568 
00569   // check at least the "first state" exists
00570   if ( m_states.empty() )
00571     throw GaudiException( "first (first) state not defined!",
00572                           "Track.h",
00573                           StatusCode::FAILURE );
00574   return *m_states[0];
00575         
00576 }

unsigned int Track::flag  )  const [inline]
 

Retrieve track flags.

Definition at line 451 of file Track.h.

References flagBits, flagMask, and m_flags.

00452 {
00453   return (unsigned int)((m_flags & flagMask) >> flagBits);
00454 }

unsigned int Track::flags  )  const [inline]
 

Retrieve const the variety of track flags.

Definition at line 393 of file Track.h.

References m_flags.

Referenced by clone().

00394 {
00395   return m_flags;
00396 }

bool Track::hasStateAt unsigned int  location  )  const
 

check the existence of a state at a certain predefined location. See State class.

Definition at line 149 of file Track.cpp.

References m_states.

00150 {
00151   std::vector<State*>::const_iterator iter =
00152     std::find_if(m_states.begin(),m_states.end(),
00153                  std::bind2nd(std::mem_fun(&State::checkLocation),location));
00154   // the last line should be equivalent to:
00155   //             TrackFunctor::HasKey<State>(&State::checkLocation,location));
00156   return (iter != m_states.end());
00157 };

unsigned int Track::history  )  const [inline]
 

Retrieve specifies the pattern recogn algorithm that created the track.

Definition at line 415 of file Track.h.

References historyBits, historyMask, and m_flags.

Referenced by checkHistory().

00416 {
00417   return (unsigned int)((m_flags & historyMask) >> historyBits);
00418 }

unsigned int Track::historyFit  )  const [inline]
 

Retrieve specifies the fitting algorithm the fitted the track).

Definition at line 427 of file Track.h.

References historyFitBits, historyFitMask, and m_flags.

Referenced by checkHistoryFit().

00428 {
00429   return (unsigned int)((m_flags & historyFitMask) >> historyFitBits);
00430 }

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

Retrieve container of LHCbIDs.

Definition at line 473 of file Track.h.

References m_lhcbIDs.

00474 {
00475   return m_lhcbIDs;
00476 }

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

Retrieve const container of LHCbIDs.

Definition at line 468 of file Track.h.

References m_lhcbIDs.

Referenced by clone().

00469 {
00470   return m_lhcbIDs;
00471 }

std::vector< Measurement * > & Track::measurements  )  [inline]
 

Retrieve container of Measurements.

Definition at line 498 of file Track.h.

References m_measurements.

00499 {
00500   return m_measurements;
00501 }

const std::vector< Measurement * > & Track::measurements  )  const [inline]
 

Retrieve const container of Measurements.

Definition at line 493 of file Track.h.

References m_measurements.

00494 {
00495   return m_measurements;
00496 }

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

Retrieve the momentum vector (+ errors) at the first state.

Definition at line 75 of file Track.cpp.

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

00077 {
00078   mom    = firstState().momentum();
00079   errMom = firstState().errMomentum();
00080 };

HepVector3D Track::momentum  )  const [inline]
 

Retrieve the momentum vector of the state.

Definition at line 559 of file Track.h.

References firstState(), and State::momentum().

00560 {
00561 
00562    return firstState().momentum();
00563         
00564 }

int Track::nDoF  )  const [inline]
 

Retrieve const number of degrees of freedom of the track.

Definition at line 383 of file Track.h.

References m_nDoF.

Referenced by clone().

00384 {
00385   return m_nDoF;
00386 }

unsigned int Track::nMeasurements  )  const [inline]
 

number of measurements on track

Definition at line 600 of file Track.h.

References m_lhcbIDs, and m_measurements.

00601 {
00602 
00603   unsigned int n = m_measurements.size();
00604   if (n == 0) n = m_lhcbIDs.size();
00605   return n;
00606         
00607 }

std::vector< Node * > & Track::nodes  )  [inline]
 

Retrieve container of Nodes.

Definition at line 508 of file Track.h.

References m_nodes.

00509 {
00510   return m_nodes;
00511 }

const std::vector< Node * > & Track::nodes  )  const [inline]
 

Retrieve const container of Nodes.

Definition at line 503 of file Track.h.

References m_nodes.

00504 {
00505   return m_nodes;
00506 }

unsigned int Track::nStates  )  const [inline]
 

number of states on track

Definition at line 593 of file Track.h.

References m_states.

00594 {
00595 
00596   return m_states.size();
00597         
00598 }

double Track::p  )  const
 

Retrieve the momentum at the first state.

Definition at line 59 of file Track.cpp.

References firstState(), and State::p().

00060 {
00061   return firstState().p();
00062 };

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

Retrieve the 3D-position (+ errors) at the first state.

Definition at line 39 of file Track.cpp.

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

00041 {
00042   pos    = firstState().position();
00043   errPos = firstState().errPosition();
00044 };

HepPoint3D Track::position  )  const [inline]
 

Retrieve the 3D-position vector of the state.

Definition at line 545 of file Track.h.

References firstState(), and State::position().

00546 {
00547 
00548    return firstState().position();
00549         
00550 }

void Track::positionAndMomentum HepPoint3D &  pos,
HepVector3D &  mom
const
 

Retrieve the position and momentum vectors at the first state.

Definition at line 30 of file Track.cpp.

References firstState(), and State::positionAndMomentum().

00032 {
00033   firstState().positionAndMomentum( pos, mom );
00034 };

void 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) at the first state.

Definition at line 20 of file Track.cpp.

References firstState(), and State::positionAndMomentum().

00023 {
00024   firstState().positionAndMomentum( pos, mom, cov6D );
00025 };

void Track::posMomCovariance HepSymMatrix &  cov6D  )  const
 

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

Definition at line 85 of file Track.cpp.

References firstState(), and State::posMomCovariance().

00086 {
00087   cov6D = firstState().posMomCovariance();
00088 };

double Track::pt  )  const
 

Retrieve the transverse momentum at the first state.

Definition at line 67 of file Track.cpp.

References firstState(), and State::pt().

00068 {
00069   return firstState().pt();
00070 };

void Track::removeFromAncestors const SmartRef< Track > &  value  )  [inline]
 

Remove from ancestor tracks that created this one.

Definition at line 533 of file Track.h.

References m_ancestors.

00534 {
00535   SmartRefVector<Track>::iterator iter =
00536     std::remove(m_ancestors.begin(), m_ancestors.end(), value);
00537   m_ancestors.erase(iter, m_ancestors.end());
00538 }

void Track::removeFromLhcbIDs const LHCbID value  )  [inline]
 

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

Definition at line 623 of file Track.h.

References m_lhcbIDs.

Referenced by removeFromMeasurements().

00624 {
00625 
00626   std::vector<LHCbID>::iterator iter =
00627     std::remove( m_lhcbIDs.begin(), m_lhcbIDs.end(), value );
00628   m_lhcbIDs.erase( iter, m_lhcbIDs.end() );
00629         
00630 }

void Track::removeFromMeasurements Measurement value  ) 
 

Remove a measurement from the list of measurements associated to the track.

Definition at line 269 of file Track.cpp.

References m_measurements, and removeFromLhcbIDs().

00270 {
00271   const LHCbID& id = meas->lhcbID();
00272   removeFromLhcbIDs(id);
00273   TrackFunctor::deleteFromList<Measurement>(m_measurements,meas);
00274 }

void Track::removeFromNodes Node value  ) 
 

Remove a Node from the list of nodes associated to the track.

Definition at line 276 of file Track.cpp.

References m_nodes.

00277 {
00278   TrackFunctor::deleteFromList<Node>(m_nodes,node);
00279 }

void Track::removeFromStates State value  ) 
 

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

Definition at line 281 of file Track.cpp.

References m_states.

00282 {
00283   TrackFunctor::deleteFromList<State>(m_states,state);
00284 }

void Track::reset  )  [virtual]
 

Clear the track before re-use.

Definition at line 192 of file Track.cpp.

References m_ancestors, m_chi2PerDoF, m_flags, m_lhcbIDs, m_measurements, m_nDoF, m_nodes, and m_states.

Referenced by ~Track().

00193 {
00194 
00195   m_chi2PerDoF = 0;
00196   m_nDoF       = 0;
00197   m_flags      = 0;
00198   m_lhcbIDs.clear();
00199   for (std::vector<State*>::iterator it = m_states.begin();
00200        it != m_states.end(); it++) delete *it;
00201   for (std::vector<Measurement*>::iterator it2 = m_measurements.begin();
00202        it2 != m_measurements.end(); it2++) delete *it2;
00203   for (std::vector<Node*>::iterator it3 = m_nodes.begin();
00204        it3 != m_nodes.end(); it3++) delete *it3;
00205   m_states.clear();
00206   m_measurements.clear();
00207   m_nodes.clear();
00208   m_ancestors.clear();
00209 };

void Track::setChi2PerDoF double  value  )  [inline]
 

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

Definition at line 378 of file Track.h.

References m_chi2PerDoF.

Referenced by clone().

00379 {
00380   m_chi2PerDoF = value;
00381 }

void Track::setFlag unsigned int  flag,
bool  ok
[inline]
 

Update the flag (see TrackKeys::Flags).

Definition at line 660 of file Track.h.

References flagBits, flagMask, and m_flags.

00662 {
00663 
00664   unsigned int val = (((unsigned int) flag) << flagBits) & flagMask;
00665   if (ok) m_flags |= val;
00666   else m_flags &= ~val;
00667         
00668 }

void Track::setFlags unsigned int  value  )  [inline]
 

Update the variety of track flags.

Definition at line 398 of file Track.h.

References m_flags.

Referenced by clone().

00399 {
00400   m_flags = value;
00401 }

void Track::setHistory unsigned int  value  )  [inline]
 

Update specifies the pattern recogn algorithm that created the track.

Definition at line 420 of file Track.h.

References historyBits, historyMask, and m_flags.

00421 {
00422   unsigned int val = (unsigned int)value;
00423   m_flags &= ~historyMask;
00424   m_flags |= ((((unsigned int)val) << historyBits) & historyMask);
00425 }

void Track::setHistoryFit unsigned int  value  )  [inline]
 

Update specifies the fitting algorithm the fitted the track).

Definition at line 432 of file Track.h.

References historyFitBits, historyFitMask, and m_flags.

00433 {
00434   unsigned int val = (unsigned int)value;
00435   m_flags &= ~historyFitMask;
00436   m_flags |= ((((unsigned int)val) << historyFitBits) & historyFitMask);
00437 }

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

Update container of LHCbIDs.

Definition at line 478 of file Track.h.

References m_lhcbIDs.

Referenced by clone().

00479 {
00480   m_lhcbIDs = value;
00481 }

void Track::setNDoF int  value  )  [inline]
 

Update number of degrees of freedom of the track.

Definition at line 388 of file Track.h.

References m_nDoF.

Referenced by clone().

00389 {
00390   m_nDoF = value;
00391 }

void Track::setSpecific unsigned int  value  )  [inline]
 

Update track specific bits.

Definition at line 461 of file Track.h.

References m_flags, specificBits, and specificMask.

00462 {
00463   unsigned int val = (unsigned int)value;
00464   m_flags &= ~specificMask;
00465   m_flags |= ((((unsigned int)val) << specificBits) & specificMask);
00466 }

void Track::setStatus unsigned int  value  )  [inline]
 

Update status of the track.

Definition at line 444 of file Track.h.

References m_flags, statusBits, and statusMask.

00445 {
00446   unsigned int val = (unsigned int)value;
00447   m_flags &= ~statusMask;
00448   m_flags |= ((((unsigned int)val) << statusBits) & statusMask);
00449 }

void Track::setType unsigned int  value  )  [inline]
 

Update track type.

Definition at line 408 of file Track.h.

References m_flags, typeBits, and typeMask.

00409 {
00410   unsigned int val = (unsigned int)value;
00411   m_flags &= ~typeMask;
00412   m_flags |= ((((unsigned int)val) << typeBits) & typeMask);
00413 }

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

Retrieve the slopes (dx/dz,dy/dz,1) at the first state.

Definition at line 49 of file Track.cpp.

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

00051 {
00052   slopes    = firstState().slopes();
00053   errSlopes = firstState().errSlopes();
00054 };

HepVector3D Track::slopes  )  const [inline]
 

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

Definition at line 552 of file Track.h.

References firstState(), and State::slopes().

Referenced by slopes().

00553 {
00554 
00555    return firstState().slopes();
00556         
00557 }

unsigned int Track::specific  )  const [inline]
 

Retrieve track specific bits.

Definition at line 456 of file Track.h.

References m_flags, specificBits, and specificMask.

00457 {
00458   return (unsigned int)((m_flags & specificMask) >> specificBits);
00459 }

const State & Track::stateAt unsigned int  location  )  const
 

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

Definition at line 177 of file Track.cpp.

References m_states.

00178 {
00179   std::vector<State*>::const_iterator iter = 
00180     std::find_if(m_states.begin(),m_states.end(),
00181                  TrackFunctor::HasKey<State>(&State::checkLocation,location));
00182   if (iter == m_states.end())
00183     throw GaudiException( "There is no state at requested location",
00184                           "Track.cpp",
00185                           StatusCode::FAILURE );
00186   return *(*iter);
00187 };

State & Track::stateAt unsigned int  location  ) 
 

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

Definition at line 162 of file Track.cpp.

References m_states.

00163 {
00164   std::vector<State*>::iterator iter = 
00165     std::find_if(m_states.begin(),m_states.end(),
00166                  TrackFunctor::HasKey<State>(&State::checkLocation,location));
00167   if (iter == m_states.end())
00168     throw GaudiException( "There is no state at requested location",
00169                           "Track.cpp",
00170                           StatusCode::FAILURE );
00171   return *(*iter);
00172 };

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

Retrieve container with pointers to all the states.

Definition at line 488 of file Track.h.

References m_states.

00489 {
00490   return m_states;
00491 }

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

Retrieve const container with pointers to all the states.

Definition at line 483 of file Track.h.

References m_states.

00484 {
00485   return m_states;
00486 }

unsigned int Track::status  )  const [inline]
 

Retrieve status of the track.

Definition at line 439 of file Track.h.

References m_flags, statusBits, and statusMask.

00440 {
00441   return (unsigned int)((m_flags & statusMask) >> statusBits);
00442 }

unsigned int Track::type  )  const [inline]
 

Retrieve track type.

Definition at line 403 of file Track.h.

References m_flags, typeBits, and typeMask.

Referenced by checkType().

00404 {
00405   return (unsigned int)((m_flags & typeMask) >> typeBits);
00406 }


Member Data Documentation

SmartRefVector<Track> Track::m_ancestors [protected]
 

ancestor tracks that created this one

Definition at line 340 of file Track.h.

Referenced by addToAncestors(), ancestors(), clearAncestors(), clone(), removeFromAncestors(), reset(), and Track().

double Track::m_chi2PerDoF [protected]
 

chi^2 per degree of freedom of the track

Definition at line 333 of file Track.h.

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

unsigned int Track::m_flags [protected]
 

the variety of track flags

Definition at line 335 of file Track.h.

Referenced by checkFlag(), flag(), flags(), history(), historyFit(), reset(), setFlag(), setFlags(), setHistory(), setHistoryFit(), setSpecific(), setStatus(), setType(), specific(), status(), Track(), and type().

std::vector<LHCbID> Track::m_lhcbIDs [protected]
 

container of LHCbIDs

Definition at line 336 of file Track.h.

Referenced by addToLhcbIDs(), addToMeasurements(), lhcbIDs(), nMeasurements(), removeFromLhcbIDs(), reset(), setLhcbIDs(), and Track().

std::vector<Measurement*> Track::m_measurements [protected]
 

container of Measurements

Definition at line 338 of file Track.h.

Referenced by addToMeasurements(), clone(), measurements(), nMeasurements(), removeFromMeasurements(), reset(), and Track().

int Track::m_nDoF [protected]
 

number of degrees of freedom of the track

Definition at line 334 of file Track.h.

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

std::vector<Node*> Track::m_nodes [protected]
 

container of Nodes

Definition at line 339 of file Track.h.

Referenced by addToNodes(), clone(), nodes(), removeFromNodes(), reset(), and Track().

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

container with pointers to all the states

Definition at line 337 of file Track.h.

Referenced by addToStates(), clone(), closestState(), firstState(), hasStateAt(), nStates(), removeFromStates(), reset(), stateAt(), states(), and Track().


The documentation for this class was generated from the following files:
Generated on Fri May 27 13:59:44 2005 for New Track Event Model by doxygen 1.4.1