PandaRoot
genfit::TrackCand Class Reference

Track candidate – seed values and indices. More...

#include <TrackCand.h>

Inheritance diagram for genfit::TrackCand:

Public Member Functions

 TrackCand ()
 
 ~TrackCand ()
 
 TrackCand (const TrackCand &other)
 copy constructor More...
 
TrackCandoperator= (TrackCand other)
 assignment operator More...
 
void swap (TrackCand &other)
 
TrackCandHitgetHit (int i) const
 
void getHit (int i, int &detId, int &hitId) const
 Get detector Id and hit Id for hit number i. More...
 
void getHit (int i, int &detId, int &hitId, double &sortingParameter) const
 Get detector Id, hit Id and sorting parameter for hit number i. More...
 
void getHitWithPlane (int i, int &detId, int &hitId, int &planeId) const
 Get detector Id, hit Id and plane id for hit number i. More...
 
unsigned int getNHits () const
 
std::vector< int > getHitIDs (int detId=-2) const
 Get hit ids of from a specific detector. More...
 
std::vector< int > getDetIDs () const
 Get detector IDs of all hits. More...
 
std::vector< double > getSortingParameters () const
 Get sorting parameterts of all hits. More...
 
std::set< int > getUniqueDetIDs () const
 
int getMcTrackId () const
 Get the MCT track id, for MC simulations - default value = -1. More...
 
double getTimeSeed () const
 Get the time at which the seed state is defined. More...
 
TVector3 getPosSeed () const
 get the seed value for track: pos. Identical to the first 3 components of getStateSeed More...
 
TVector3 getMomSeed () const
 get the seed value for track: mom. Identical to the last 3 components of getStateSeed More...
 
const TMatrixDSym & getCovSeed () const
 get the covariance matrix seed (6D). More...
 
const TVectorD & getStateSeed () const
 Returns the 6D seed state; should be in global coordinates. More...
 
double getChargeSeed () const
 
int getPdgCode () const
 Get the PDG code. More...
 
bool hitInTrack (int detId, int hitId) const
 Is there a hit with detId and hitId in the TrackCand? More...
 
void addHit (int detId, int hitId, int planeId=-1, double sortingParameter=0)
 
void addHit (TrackCandHit *hit)
 
void setMcTrackId (int i)
 Set the MCT track id, for MC simulations. More...
 
void setPdgCode (int pdgCode)
 Set a particle hypothesis in form of a PDG code. This will also set the charge attribute. More...
 
void append (const TrackCand &)
 Clone the TrackCandHit objects from the other TrackCand and append them to this TrackCand. More...
 
void sortHits ()
 Sort the hits that were already added to the trackCand using the sorting parameters. More...
 
void sortHits (const std::vector< unsigned int > &indices)
 
void reset ()
 Delete and clear the TrackCandHits. More...
 
void Print (const Option_t *="") const
 Write the content of all private attributes to the terminal. More...
 
void setTimeSeed (double time)
 Set the time at which the seed is defined. More...
 
void setCovSeed (const TMatrixDSym &cov6D)
 set the covariance matrix seed (6D). More...
 
void set6DSeed (const TVectorD &state6D, const double charge)
 sets the state to seed the track fitting. State has to be a TVectorD(6). First 3 elements are the staring postion second 3 elements the starting momentum. Everything in global coordinates charge is the charge hypotheses of the particle charge More...
 
void set6DSeedAndPdgCode (const TVectorD &state6D, const int pdgCode)
 This function works the same as set6DSeed but instead of a charge hypothesis you can set a pdg code which will set the charge automatically. More...
 
void setPosMomSeed (const TVector3 &pos, const TVector3 &mom, const double charge)
 sets the state to seed the track fitting. State has to be a TVector3 for position and a TVector3 for momentum. Everything in global coordinates charge is the charge hypotheses of the particle charge More...
 
void setPosMomSeedAndPdgCode (const TVector3 &pos, const TVector3 &mom, const int pdgCode)
 This function works the same as setPosMomSeed but instead of a charge hypothesis you can set a pdg code which will set the charge automatically. More...
 
void setTime6DSeed (double time, const TVectorD &state6D, const double charge)
 sets the state to seed the track fitting and its time. State has to be a TVectorD(6). First 3 elements are the staring postion second 3 elements the starting momentum. Everything in global coordinates charge is the charge hypotheses of the particle charge. More...
 
void setTime6DSeedAndPdgCode (double time, const TVectorD &state6D, const int pdgCode)
 This function works the same as set6DSeed but instead of a charge hypothesis you can set a pdg code which will set the charge automatically. More...
 
void setTimePosMomSeed (double time, const TVector3 &pos, const TVector3 &mom, const double charge)
 sets the state to seed the track fitting and its time. State has to be a TVector3 for position and a TVector3 for momentum. Everything in global coordinates charge is the charge hypotheses of the particle charge. More...
 
void setTimePosMomSeedAndPdgCode (double time, const TVector3 &pos, const TVector3 &mom, const int pdgCode)
 This function works the same as setPosMomSeed but instead of a charge hypothesis you can set a pdg code which will set the charge automatically. More...
 

Static Public Member Functions

static bool compareTrackCandHits (const TrackCandHit *lhs, const TrackCandHit *rhs)
 

Friends

bool operator== (const TrackCand &lhs, const TrackCand &rhs)
 == operator checks equality of TrackCandHits. Does not check for sorting parameters. More...
 
bool operator!= (const TrackCand &lhs, const TrackCand &rhs)
 

Detailed Description

Track candidate – seed values and indices.

Author
Christian Höppner (Technische Universität München, original author)
Sebastian Neubert (Technische Universität München, original author)
Moritz Nadler (maintainer during 2012)

The main task of the TrackCand object is to store a list of indices to cluster objects. Each cluster in the Track is identified by it's detector ID and it's index in the corresponding TClonesArray. Also there is a ordering parameter to order hits. Optionally, plane indices for the hits can be stored (most importantly for fitting with the Daf). This information is used by the RecoHitFactory to automatically load RecoHits into a Track. Through this it is possible to define Tracks over an arbitrary number of different detectors.

In addition TrackCand offers members to store starting values for the fit. The starting values (seeds) for the fit are stored as a 6D state (x,y,z,px,py,pz) and its corresponding 6x6 covariance matrix. All seed getter and setter manipulate these two members but the user can chose using TVector3 or TMatrixD to get/set the seed state. However this information is not automatically used in genfit. But a pointer to a TrackCand can be passed to the a RKTrackRep constructor to make use of this information without manually extracting it from the TrackCand object.

See also
RecoHitFactory

Definition at line 68 of file TrackCand.h.

Constructor & Destructor Documentation

◆ TrackCand() [1/2]

genfit::TrackCand::TrackCand ( )

◆ ~TrackCand()

genfit::TrackCand::~TrackCand ( )

◆ TrackCand() [2/2]

genfit::TrackCand::TrackCand ( const TrackCand other)

copy constructor

Member Function Documentation

◆ addHit() [1/2]

void genfit::TrackCand::addHit ( int  detId,
int  hitId,
int  planeId = -1,
double  sortingParameter = 0 
)

Referenced by getPdgCode().

◆ addHit() [2/2]

void genfit::TrackCand::addHit ( TrackCandHit hit)
inline

Definition at line 144 of file TrackCand.h.

144 { hits_.push_back(hit); }

◆ append()

void genfit::TrackCand::append ( const TrackCand )

Clone the TrackCandHit objects from the other TrackCand and append them to this TrackCand.

Referenced by setMcTrackId().

◆ compareTrackCandHits()

static bool genfit::TrackCand::compareTrackCandHits ( const TrackCandHit lhs,
const TrackCandHit rhs 
)
inlinestatic

Definition at line 85 of file TrackCand.h.

References getHit(), getHitWithPlane(), and i.

85 { return (*lhs < *rhs); } // operator< defined in TrackCandHit.h

◆ getChargeSeed()

double genfit::TrackCand::getChargeSeed ( ) const
inline

Definition at line 132 of file TrackCand.h.

132 { return q_; }

◆ getCovSeed()

const TMatrixDSym& genfit::TrackCand::getCovSeed ( ) const
inline

get the covariance matrix seed (6D).

Definition at line 127 of file TrackCand.h.

127 { return cov6D_; }

◆ getDetIDs()

std::vector<int> genfit::TrackCand::getDetIDs ( ) const

Get detector IDs of all hits.

Referenced by getNHits().

◆ getHit() [1/3]

TrackCandHit* genfit::TrackCand::getHit ( int  i) const

◆ getHit() [2/3]

void genfit::TrackCand::getHit ( int  i,
int &  detId,
int &  hitId 
) const

Get detector Id and hit Id for hit number i.

◆ getHit() [3/3]

void genfit::TrackCand::getHit ( int  i,
int &  detId,
int &  hitId,
double &  sortingParameter 
) const

Get detector Id, hit Id and sorting parameter for hit number i.

◆ getHitIDs()

std::vector<int> genfit::TrackCand::getHitIDs ( int  detId = -2) const

Get hit ids of from a specific detector.

DetId -1 gives hitIds of hits with default detId -1. The default argument -2 gives hit Ids of all hits.

Referenced by getNHits().

◆ getHitWithPlane()

void genfit::TrackCand::getHitWithPlane ( int  i,
int &  detId,
int &  hitId,
int &  planeId 
) const

Get detector Id, hit Id and plane id for hit number i.

Referenced by compareTrackCandHits().

◆ getMcTrackId()

int genfit::TrackCand::getMcTrackId ( ) const
inline

Get the MCT track id, for MC simulations - default value = -1.

Definition at line 115 of file TrackCand.h.

115 { return mcTrackId_; }

◆ getMomSeed()

TVector3 genfit::TrackCand::getMomSeed ( ) const
inline

get the seed value for track: mom. Identical to the last 3 components of getStateSeed

Definition at line 124 of file TrackCand.h.

124 { return TVector3(state6D_(3), state6D_(4), state6D_(5)); }

◆ getNHits()

unsigned int genfit::TrackCand::getNHits ( ) const
inline

Definition at line 99 of file TrackCand.h.

References getDetIDs(), getHitIDs(), getSortingParameters(), and getUniqueDetIDs().

Referenced by genfit::MeasurementFactory< genfit::AbsMeasurement >::createMany().

99 { return hits_.size(); }

◆ getPdgCode()

int genfit::TrackCand::getPdgCode ( ) const
inline

Get the PDG code.

Definition at line 135 of file TrackCand.h.

References addHit(), and hitInTrack().

135 { return pdg_; }

◆ getPosSeed()

TVector3 genfit::TrackCand::getPosSeed ( ) const
inline

get the seed value for track: pos. Identical to the first 3 components of getStateSeed

Definition at line 121 of file TrackCand.h.

121 { return TVector3(state6D_(0), state6D_(1), state6D_(2)); }

◆ getSortingParameters()

std::vector<double> genfit::TrackCand::getSortingParameters ( ) const

Get sorting parameterts of all hits.

Referenced by getNHits().

◆ getStateSeed()

const TVectorD& genfit::TrackCand::getStateSeed ( ) const
inline

Returns the 6D seed state; should be in global coordinates.

Definition at line 130 of file TrackCand.h.

130 { return state6D_; }

◆ getTimeSeed()

double genfit::TrackCand::getTimeSeed ( ) const
inline

Get the time at which the seed state is defined.

Definition at line 118 of file TrackCand.h.

118 { return time_; }

◆ getUniqueDetIDs()

std::set<int> genfit::TrackCand::getUniqueDetIDs ( ) const

Referenced by getNHits().

◆ hitInTrack()

bool genfit::TrackCand::hitInTrack ( int  detId,
int  hitId 
) const

Is there a hit with detId and hitId in the TrackCand?

Referenced by getPdgCode().

◆ operator=()

TrackCand& genfit::TrackCand::operator= ( TrackCand  other)

assignment operator

◆ Print()

void genfit::TrackCand::Print ( const Option_t *  = "") const

Write the content of all private attributes to the terminal.

Referenced by setMcTrackId().

◆ reset()

void genfit::TrackCand::reset ( )

Delete and clear the TrackCandHits.

Referenced by setMcTrackId().

◆ set6DSeed()

void genfit::TrackCand::set6DSeed ( const TVectorD &  state6D,
const double  charge 
)

sets the state to seed the track fitting. State has to be a TVectorD(6). First 3 elements are the staring postion second 3 elements the starting momentum. Everything in global coordinates charge is the charge hypotheses of the particle charge

Referenced by setCovSeed().

◆ set6DSeedAndPdgCode()

void genfit::TrackCand::set6DSeedAndPdgCode ( const TVectorD &  state6D,
const int  pdgCode 
)

This function works the same as set6DSeed but instead of a charge hypothesis you can set a pdg code which will set the charge automatically.

Referenced by setCovSeed().

◆ setCovSeed()

void genfit::TrackCand::setCovSeed ( const TMatrixDSym &  cov6D)
inline

set the covariance matrix seed (6D).

Definition at line 171 of file TrackCand.h.

References set6DSeed(), set6DSeedAndPdgCode(), setPosMomSeed(), setPosMomSeedAndPdgCode(), setTime6DSeed(), setTime6DSeedAndPdgCode(), setTimePosMomSeed(), and setTimePosMomSeedAndPdgCode().

171 { cov6D_ = cov6D; /* always 6D, no need to resize */ }

◆ setMcTrackId()

void genfit::TrackCand::setMcTrackId ( int  i)
inline

Set the MCT track id, for MC simulations.

Definition at line 147 of file TrackCand.h.

References append(), i, Print(), reset(), setPdgCode(), and sortHits().

147 { mcTrackId_ = i; }
unsigned int i
Definition: P4_F32vec4.h:21

◆ setPdgCode()

void genfit::TrackCand::setPdgCode ( int  pdgCode)

Set a particle hypothesis in form of a PDG code. This will also set the charge attribute.

Referenced by setMcTrackId().

◆ setPosMomSeed()

void genfit::TrackCand::setPosMomSeed ( const TVector3 &  pos,
const TVector3 &  mom,
const double  charge 
)

sets the state to seed the track fitting. State has to be a TVector3 for position and a TVector3 for momentum. Everything in global coordinates charge is the charge hypotheses of the particle charge

Referenced by setCovSeed().

◆ setPosMomSeedAndPdgCode()

void genfit::TrackCand::setPosMomSeedAndPdgCode ( const TVector3 &  pos,
const TVector3 &  mom,
const int  pdgCode 
)

This function works the same as setPosMomSeed but instead of a charge hypothesis you can set a pdg code which will set the charge automatically.

Referenced by setCovSeed().

◆ setTime6DSeed()

void genfit::TrackCand::setTime6DSeed ( double  time,
const TVectorD &  state6D,
const double  charge 
)

sets the state to seed the track fitting and its time. State has to be a TVectorD(6). First 3 elements are the staring postion second 3 elements the starting momentum. Everything in global coordinates charge is the charge hypotheses of the particle charge.

Referenced by setCovSeed().

◆ setTime6DSeedAndPdgCode()

void genfit::TrackCand::setTime6DSeedAndPdgCode ( double  time,
const TVectorD &  state6D,
const int  pdgCode 
)

This function works the same as set6DSeed but instead of a charge hypothesis you can set a pdg code which will set the charge automatically.

Referenced by setCovSeed().

◆ setTimePosMomSeed()

void genfit::TrackCand::setTimePosMomSeed ( double  time,
const TVector3 &  pos,
const TVector3 &  mom,
const double  charge 
)

sets the state to seed the track fitting and its time. State has to be a TVector3 for position and a TVector3 for momentum. Everything in global coordinates charge is the charge hypotheses of the particle charge.

Referenced by setCovSeed().

◆ setTimePosMomSeedAndPdgCode()

void genfit::TrackCand::setTimePosMomSeedAndPdgCode ( double  time,
const TVector3 &  pos,
const TVector3 &  mom,
const int  pdgCode 
)

This function works the same as setPosMomSeed but instead of a charge hypothesis you can set a pdg code which will set the charge automatically.

Referenced by setCovSeed().

◆ setTimeSeed()

void genfit::TrackCand::setTimeSeed ( double  time)
inline

Set the time at which the seed is defined.

Definition at line 168 of file TrackCand.h.

168 { time_ = time; }

◆ sortHits() [1/2]

void genfit::TrackCand::sortHits ( )

Sort the hits that were already added to the trackCand using the sorting parameters.

Referenced by setMcTrackId().

◆ sortHits() [2/2]

void genfit::TrackCand::sortHits ( const std::vector< unsigned int > &  indices)

◆ swap()

void genfit::TrackCand::swap ( TrackCand other)

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( const TrackCand lhs,
const TrackCand rhs 
)
friend

Definition at line 83 of file TrackCand.h.

83 { return !(lhs == rhs); }

◆ operator==

bool operator== ( const TrackCand lhs,
const TrackCand rhs 
)
friend

== operator checks equality of TrackCandHits. Does not check for sorting parameters.


The documentation for this class was generated from the following file: