22 #ifndef genfit_TrackCand_h
23 #define genfit_TrackCand_h
25 #include "TrackCandHit.h"
35 #include <TMatrixDSym.h>
36 #include <TDatabasePDG.h>
87 friend bool operator!= (
const TrackCand& lhs,
const TrackCand& rhs) {
return !(lhs == rhs);}
95 void getHit(
int i,
int& detId,
int& hitId)
const;
98 void getHit(
int i,
int& detId,
int& hitId,
double& sortingParameter)
const;
101 void getHitWithPlane(
int i,
int& detId,
int& hitId,
int& planeId)
const;
103 unsigned int getNHits()
const {
return hits_.size();}
110 std::vector<int>
getHitIDs(
int detId = -2)
const;
116 std::set<int> getUniqueDetIDs()
const;
136 double getChargeSeed()
const {
return q_;}
146 void addHit(
int detId,
int hitId,
int planeId = -1,
double sortingParameter = 0);
162 void sortHits(
const std::vector<unsigned int>& indices);
169 void Print(
const Option_t* =
"")
const ;
180 void set6DSeed(
const TVectorD& state6D,
const double charge);
189 void setPosMomSeed(
const TVector3& pos,
const TVector3& mom,
const double charge);
201 void setTime6DSeed(
double time,
const TVectorD& state6D,
const double charge);
215 const double charge);
222 const TVector3& mom,
const int pdgCode);
228 std::vector<TrackCandHit*> hits_;
Hit object for use in TrackCand.
Track candidate – seed values and indices.
void getHitWithPlane(int i, int &detId, int &hitId, int &planeId) const
Get detector Id, hit Id and plane id for hit number i.
int getMcTrackId() const
Get the MCT track id, for MC simulations - default value = -1.
void set6DSeed(const TVectorD &state6D, const double charge)
sets the state to seed the track fitting.
TVectorD state6D_
global 6D position plus momentum state
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 w...
void setTimeSeed(double time)
Set the time at which the seed is defined.
int getPdgCode() const
Get the PDG code.
int mcTrackId_
if MC simulation, store the mc track id here
friend bool operator==(const TrackCand &lhs, const TrackCand &rhs)
== operator checks equality of TrackCandHits. Does not check for sorting parameters.
TVector3 getMomSeed() const
get the seed value for track: mom.
TMatrixDSym cov6D_
global 6D position plus momentum state
void setTime6DSeed(double time, const TVectorD &state6D, const double charge)
sets the state to seed the track fitting and its time.
double time_
Time at which the seed is given.
void Print(const Option_t *="") const
Write the content of all private attributes to the terminal.
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 co...
void setPosMomSeed(const TVector3 &pos, const TVector3 &mom, const double charge)
sets the state to seed the track fitting.
std::vector< double > getSortingParameters() const
Get sorting parameterts of all hits.
bool hitInTrack(int detId, int hitId) const
Is there a hit with detId and hitId in the TrackCand?
TVector3 getPosSeed() const
get the seed value for track: pos.
void setTimePosMomSeed(double time, const TVector3 &pos, const TVector3 &mom, const double charge)
sets the state to seed the track fitting and its time.
void setCovSeed(const TMatrixDSym &cov6D)
set the covariance matrix seed (6D).
int pdg_
particle data groupe's id for a particle
void setMcTrackId(int i)
Set the MCT track id, for MC simulations.
void sortHits()
Sort the hits that were already added to the trackCand using the sorting parameters.
double q_
the charge of the particle in units of elementary charge
const TMatrixDSym & getCovSeed() const
get the covariance matrix seed (6D).
void append(const TrackCand &)
Clone the TrackCandHit objects from the other TrackCand and append them to this TrackCand.
const TVectorD & getStateSeed() const
Returns the 6D seed state; should be in global coordinates.
std::vector< int > getDetIDs() const
Get detector IDs of all hits.
void reset()
Delete and clear the TrackCandHits.
std::vector< int > getHitIDs(int detId=-2) const
Get hit ids of from a specific detector.
TrackCand & operator=(TrackCand other)
assignment operator
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 co...
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 w...
void setPdgCode(int pdgCode)
Set a particle hypothesis in form of a PDG code. This will also set the charge attribute.
double getTimeSeed() const
Get the time at which the seed state is defined.
Defines for I/O streams used for error and debug printing.