FairRoot/PandaRoot
Public Member Functions | Private Attributes | Friends | List of all members
GFTrackCand Class Reference

Track candidate – a list of cluster indices. More...

#include <GFTrackCand.h>

Inheritance diagram for GFTrackCand:

Public Member Functions

 GFTrackCand ()
 
 ~GFTrackCand ()
 
 GFTrackCand (double curv, double dip, double inv, std::vector< unsigned int > detIDs, std::vector< unsigned int > hitIDs)
 Initializing constructor. More...
 
 GFTrackCand (double curv, double dip, double inv, std::vector< unsigned int > detIDs, std::vector< unsigned int > hitIDs, std::vector< double > rhos)
 
void getHit (unsigned int i, unsigned int &detId, unsigned int &hitId) const
 Get detector ID and cluster index (hitId) for hit number i. More...
 
void getHit (unsigned int i, unsigned int &detId, unsigned int &hitId, double &rho) const
 Get detector ID and cluster index (hitId) for hit number i with ordering parameter rho. More...
 
void getHitWithPlane (unsigned int i, unsigned int &detId, unsigned int &hitId, unsigned int &planeId) const
 Get detector ID and cluster index (hitId) for hit number i with plane id. More...
 
unsigned int getNHits () const
 
double getCurv () const
 
double getDip () const
 
bool inverted () const
 
std::vector< unsigned int > GetHitIDs (int detId=-1)
 
std::vector< unsigned int > GetDetIDs () const
 
std::vector< double > GetRhos () const
 
std::set< unsigned int > GetUniqueDetIDs () const
 
int getMcTrackId () const
 get the MCT track id, for MC simulations - def. value -1 More...
 
TVector3 getPosSeed () const
 get the seed value for track: pos More...
 
TVector3 getDirSeed () const
 get the seed value for track: direction More...
 
double getQoverPseed () const
 get the seed value for track: qoverp More...
 
TVector3 getPosError () const
 get the seed value for track: error on pos (standard deviation) More...
 
TVector3 getDirError () const
 get the seed value for track: error on direction (standard deviation) More...
 
int getPdgCode () const
 get the PDG code More...
 
void addHit (unsigned int detId, unsigned int hitId, double rho=0., unsigned int planeId=0)
 
void setCurv (double c)
 
void setDip (double d)
 
void setInverted (bool f=true)
 
void setMcTrackId (int i)
 set the MCT track id, for MC simulations More...
 
bool HitInTrack (unsigned int detId, unsigned int hitId)
 Test if hit already is part of this track candidate. More...
 
void setTrackSeed (const TVector3 &pos, const TVector3 &direction, const double qop)
 set the seed values for track: pos, direction, q/p More...
 
void setComplTrackSeed (const TVector3 &pos, const TVector3 &mom, const int pdgCode, TVector3 posError=TVector3(1.0, 1.0, 1.0), TVector3 dirError=TVector3(1.0, 1.0, 1.0))
 set the seed values for track: pos, momentum, pdgCode, pos error, momentum error (errors are optional and will be set to 1,1,1 if not given) More...
 
void setPdgCode (int pdgCode)
 set a particle hypothesis in form of a PDG code More...
 
void append (const GFTrackCand &)
 
void reset ()
 
void Print () const
 

Private Attributes

std::vector< unsigned int > fDetId
 
std::vector< unsigned int > fHitId
 
std::vector< unsigned int > fPlaneId
 
std::vector< double > fRho
 
double fCurv
 
double fDip
 
bool fInv
 
TVector3 fPosSeed
 
TVector3 fDirSeed
 
TVector3 fPosError
 
TVector3 fDirError
 
double fQoverpSeed
 
int fMcTrackId
 
int fPdg
 

Friends

bool operator== (const GFTrackCand &lhs, const GFTrackCand &rhs)
 

Detailed Description

Track candidate – a list of cluster indices.

Author
Christian Höppner (Technische Universität München, original author)
Sebastian Neubert (Technische Universität München, original author)

The main task of the GFTrackCand 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 rho, to order hits. Optionally, plane indices for the hits can be stored (most importantly for fitting with the GFDaf). 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 GFTrackCand offers members to store starting values for the fit. However this information is not autmatically used in genfit!!! But a pointer to a GFTrackCand can be passed to the RKTrackRep to make use of this information.

See Also
RecoHitFactory

Definition at line 55 of file GFTrackCand.h.

Constructor & Destructor Documentation

GFTrackCand::GFTrackCand ( )

Definition at line 26 of file GFTrackCand.cxx.

26 :fCurv(0),fDip(0),fInv(false), fQoverpSeed(0.),fMcTrackId(-1),fPdg(0){}
double fDip
Definition: GFTrackCand.h:179
double fCurv
Definition: GFTrackCand.h:178
double fQoverpSeed
Definition: GFTrackCand.h:186
GFTrackCand::~GFTrackCand ( )

Definition at line 28 of file GFTrackCand.cxx.

28 {}
GFTrackCand::GFTrackCand ( double  curv,
double  dip,
double  inv,
std::vector< unsigned int >  detIDs,
std::vector< unsigned int >  hitIDs 
)

Initializing constructor.

Parameters
curvCurvature from prefit. There is no stringent definition what this parameter means at the moment.
dipDip angle from prefit. There is no stringent definition what this parameter means at the moment.
invDummy paramter. Has been used to mark inverted tracks in the past.
detIDscollection of detector IDs. Each detector ID needs a corresponding GFRecoHitProducer. See RecoHitFactory for details.
hitIDscollection of hit indices.

Definition at line 30 of file GFTrackCand.cxx.

References fDetId, fHitId, and fRho.

31  : fDetId(detIDs),fHitId(hitIDs),fCurv(curv), fDip(dip), fInv(inv),fQoverpSeed(0.), fMcTrackId(-1),fPdg(0)
32 {
33  assert(fDetId.size()==fHitId.size());
34  fRho.resize(fDetId.size(),0.);
35 }
double fDip
Definition: GFTrackCand.h:179
std::vector< unsigned int > fHitId
Definition: GFTrackCand.h:174
double fCurv
Definition: GFTrackCand.h:178
std::vector< double > fRho
Definition: GFTrackCand.h:176
double fQoverpSeed
Definition: GFTrackCand.h:186
std::vector< unsigned int > fDetId
Definition: GFTrackCand.h:173
GFTrackCand::GFTrackCand ( double  curv,
double  dip,
double  inv,
std::vector< unsigned int >  detIDs,
std::vector< unsigned int >  hitIDs,
std::vector< double >  rhos 
)

Definition at line 36 of file GFTrackCand.cxx.

References fDetId, fHitId, and fRho.

37  : fDetId(detIDs),fHitId(hitIDs),fRho(rhos),fCurv(curv), fDip(dip), fInv(inv),fQoverpSeed(0.), fMcTrackId(-1),fPdg(0)
38 {
39  assert(fDetId.size()==fHitId.size());
40  assert(fDetId.size()==fRho.size());
41 }
double fDip
Definition: GFTrackCand.h:179
std::vector< unsigned int > fHitId
Definition: GFTrackCand.h:174
double fCurv
Definition: GFTrackCand.h:178
std::vector< double > fRho
Definition: GFTrackCand.h:176
double fQoverpSeed
Definition: GFTrackCand.h:186
std::vector< unsigned int > fDetId
Definition: GFTrackCand.h:173

Member Function Documentation

void GFTrackCand::addHit ( unsigned int  detId,
unsigned int  hitId,
double  rho = 0.,
unsigned int  planeId = 0 
)

Definition at line 44 of file GFTrackCand.cxx.

References fDetId, fHitId, fPlaneId, and fRho.

Referenced by GFTrack::addHit(), append(), PndHypDPatternRecoTask::Exec(), and PndTrackCand2GenfitTrackCand().

45 {
46  fDetId.push_back(detId);
47  fHitId.push_back(hitId);
48  fPlaneId.push_back(planeId);
49  fRho.push_back(rho);
50 }
std::vector< unsigned int > fHitId
Definition: GFTrackCand.h:174
std::vector< unsigned int > fPlaneId
Definition: GFTrackCand.h:175
std::vector< double > fRho
Definition: GFTrackCand.h:176
std::vector< unsigned int > fDetId
Definition: GFTrackCand.h:173
void GFTrackCand::append ( const GFTrackCand rhs)

Definition at line 106 of file GFTrackCand.cxx.

References addHit(), getHit(), getNHits(), and i.

106  {
107  unsigned int detId,hitId;
108  double rho;
109  for(unsigned int i=0;i<rhs.getNHits();++i){
110  rhs.getHit(i,detId,hitId,rho);
111  addHit(detId,hitId,rho);
112  }
113 
114 
115 }
Int_t i
Definition: run_full.C:25
unsigned int getNHits() const
Definition: GFTrackCand.h:113
void getHit(unsigned int i, unsigned int &detId, unsigned int &hitId) const
Get detector ID and cluster index (hitId) for hit number i.
Definition: GFTrackCand.h:84
void addHit(unsigned int detId, unsigned int hitId, double rho=0., unsigned int planeId=0)
Definition: GFTrackCand.cxx:44
double GFTrackCand::getCurv ( ) const
inline

Definition at line 114 of file GFTrackCand.h.

References fCurv.

Referenced by PndMvdEventAnaTask::Exec().

114 {return fCurv;}
double fCurv
Definition: GFTrackCand.h:178
std::vector<unsigned int> GFTrackCand::GetDetIDs ( ) const
inline

Definition at line 118 of file GFTrackCand.h.

References fDetId.

118 {return fDetId;}
std::vector< unsigned int > fDetId
Definition: GFTrackCand.h:173
double GFTrackCand::getDip ( ) const
inline

Definition at line 115 of file GFTrackCand.h.

References fDip.

Referenced by PndMvdEventAnaTask::Exec().

115 {return fDip;}
double fDip
Definition: GFTrackCand.h:179
TVector3 GFTrackCand::getDirError ( ) const
inline

get the seed value for track: error on direction (standard deviation)

Definition at line 139 of file GFTrackCand.h.

References fDirError.

Referenced by RKTrackRep::RKTrackRep().

139 {return fDirError;}
TVector3 fDirError
Definition: GFTrackCand.h:185
TVector3 GFTrackCand::getDirSeed ( ) const
inline

get the seed value for track: direction

Definition at line 133 of file GFTrackCand.h.

References fDirSeed.

Referenced by PndHypKalmanTask::Exec(), PndLmdKalmanTask::Exec(), and RKTrackRep::RKTrackRep().

133 {return fDirSeed;}
TVector3 fDirSeed
Definition: GFTrackCand.h:183
void GFTrackCand::getHit ( unsigned int  i,
unsigned int &  detId,
unsigned int &  hitId 
) const
inline
void GFTrackCand::getHit ( unsigned int  i,
unsigned int &  detId,
unsigned int &  hitId,
double &  rho 
) const
inline

Get detector ID and cluster index (hitId) for hit number i with ordering parameter rho.

Definition at line 93 of file GFTrackCand.h.

References fDetId, fHitId, fRho, and getNHits().

96  {
97  assert(i<getNHits());
98  detId=fDetId.at(i);hitId=fHitId.at(i);
99  rho=fRho.at(i);
100  }
Int_t i
Definition: run_full.C:25
unsigned int getNHits() const
Definition: GFTrackCand.h:113
std::vector< unsigned int > fHitId
Definition: GFTrackCand.h:174
std::vector< double > fRho
Definition: GFTrackCand.h:176
std::vector< unsigned int > fDetId
Definition: GFTrackCand.h:173
std::vector< unsigned int > GFTrackCand::GetHitIDs ( int  detId = -1)

Definition at line 53 of file GFTrackCand.cxx.

References fDetId, fHitId, i, and n.

53  {
54  if(detId<0){ // return hits from all detectors
55  return fHitId;
56  }
57  else {
58  std::vector<unsigned int> result;
59  unsigned int n=fHitId.size();
60  for(unsigned int i=0;i<n;++i){
61  if(fDetId[i]==(unsigned int)detId)result.push_back(fHitId[i]);
62  }
63  return result;
64  }
65 }
Int_t i
Definition: run_full.C:25
int n
std::vector< unsigned int > fHitId
Definition: GFTrackCand.h:174
std::vector< unsigned int > fDetId
Definition: GFTrackCand.h:173
void GFTrackCand::getHitWithPlane ( unsigned int  i,
unsigned int &  detId,
unsigned int &  hitId,
unsigned int &  planeId 
) const
inline

Get detector ID and cluster index (hitId) for hit number i with plane id.

Definition at line 104 of file GFTrackCand.h.

References fDetId, fHitId, fPlaneId, and getNHits().

Referenced by GFTrack::getHitsByPlane().

107  {
108  assert(i<getNHits());
109  detId=fDetId.at(i);hitId=fHitId.at(i);
110  planeId=fPlaneId.at(i);
111  }
Int_t i
Definition: run_full.C:25
unsigned int getNHits() const
Definition: GFTrackCand.h:113
std::vector< unsigned int > fHitId
Definition: GFTrackCand.h:174
std::vector< unsigned int > fPlaneId
Definition: GFTrackCand.h:175
std::vector< unsigned int > fDetId
Definition: GFTrackCand.h:173
int GFTrackCand::getMcTrackId ( ) const
inline

get the MCT track id, for MC simulations - def. value -1

Definition at line 129 of file GFTrackCand.h.

References fMcTrackId.

Referenced by GenfitTrackCand2PndTrackCand().

129 {return fMcTrackId;}
unsigned int GFTrackCand::getNHits ( ) const
inline
int GFTrackCand::getPdgCode ( ) const
inline

get the PDG code

Definition at line 141 of file GFTrackCand.h.

References fPdg.

Referenced by PndHypKalmanTask::Exec(), and RKTrackRep::RKTrackRep().

141 {return fPdg;}
TVector3 GFTrackCand::getPosError ( ) const
inline

get the seed value for track: error on pos (standard deviation)

Definition at line 137 of file GFTrackCand.h.

References fPosError.

Referenced by RKTrackRep::RKTrackRep().

137 {return fPosError;}
TVector3 fPosError
Definition: GFTrackCand.h:184
TVector3 GFTrackCand::getPosSeed ( ) const
inline

get the seed value for track: pos

Definition at line 131 of file GFTrackCand.h.

References fPosSeed.

Referenced by PndHypKalmanTask::Exec(), PndLmdKalmanTask::Exec(), and RKTrackRep::RKTrackRep().

131 {return fPosSeed;}
TVector3 fPosSeed
Definition: GFTrackCand.h:182
double GFTrackCand::getQoverPseed ( ) const
inline

get the seed value for track: qoverp

Definition at line 135 of file GFTrackCand.h.

References fQoverpSeed.

Referenced by PndHypKalmanTask::Exec(), and PndHypDKalmanTask::Exec().

135 {return fQoverpSeed;}
double fQoverpSeed
Definition: GFTrackCand.h:186
std::vector<double> GFTrackCand::GetRhos ( ) const
inline

Definition at line 119 of file GFTrackCand.h.

References fRho.

119 {return fRho;}
std::vector< double > fRho
Definition: GFTrackCand.h:176
std::set<unsigned int> GFTrackCand::GetUniqueDetIDs ( ) const
inline

Definition at line 120 of file GFTrackCand.h.

References fDetId, and i.

120  {
121  std::set<unsigned int> retVal;
122  for(unsigned int i=0;i<fDetId.size();++i){
123  retVal.insert(fDetId.at(i));
124  }
125  return retVal;
126  }
Int_t i
Definition: run_full.C:25
std::vector< unsigned int > fDetId
Definition: GFTrackCand.h:173
bool GFTrackCand::HitInTrack ( unsigned int  detId,
unsigned int  hitId 
)

Test if hit already is part of this track candidate.

Definition at line 73 of file GFTrackCand.cxx.

References fDetId, fHitId, and i.

74 {
75  for (unsigned int i = 0; i < fDetId.size(); i++){
76  if (detId == fDetId[i])
77  if (hitId == fHitId[i])
78  return true;
79  }
80  return false;
81 }
Int_t i
Definition: run_full.C:25
std::vector< unsigned int > fHitId
Definition: GFTrackCand.h:174
std::vector< unsigned int > fDetId
Definition: GFTrackCand.h:173
bool GFTrackCand::inverted ( ) const
inline

Definition at line 116 of file GFTrackCand.h.

References fInv.

116 {return fInv;}
void GFTrackCand::Print ( ) const

Definition at line 90 of file GFTrackCand.cxx.

References fDetId, fDirSeed, fHitId, fMcTrackId, fPosSeed, fQoverpSeed, fRho, and i.

90  {
91  std::cout << "======== GFTrackCand::print ========" << std::endl;
92  if(fMcTrackId>=0) std::cout << "mcTrackId=" << fMcTrackId << std::endl;
93  std::cout << "seed values for pos,direction, and q/p: " << std::endl;
94  fPosSeed.Print();
95  fDirSeed.Print();
96  std::cout << "q/p=" << fQoverpSeed << std::endl;
97  assert(fDetId.size()==fHitId.size());
98  std::cout << "detId|hitId|rho ";
99  for(unsigned int i=0;i<fDetId.size();++i){
100  std::cout << fDetId.at(i) << "|" << fHitId.at(i)
101  << "|" << fRho.at(i) << " ";
102  }
103  std::cout << std::endl;
104 }
Int_t i
Definition: run_full.C:25
std::vector< unsigned int > fHitId
Definition: GFTrackCand.h:174
TVector3 fPosSeed
Definition: GFTrackCand.h:182
std::vector< double > fRho
Definition: GFTrackCand.h:176
double fQoverpSeed
Definition: GFTrackCand.h:186
TVector3 fDirSeed
Definition: GFTrackCand.h:183
std::vector< unsigned int > fDetId
Definition: GFTrackCand.h:173
void GFTrackCand::reset ( )

Definition at line 68 of file GFTrackCand.cxx.

References fDetId, and fHitId.

69 {
70  fDetId.clear();fHitId.clear();
71 }
std::vector< unsigned int > fHitId
Definition: GFTrackCand.h:174
std::vector< unsigned int > fDetId
Definition: GFTrackCand.h:173
void GFTrackCand::setComplTrackSeed ( const TVector3 &  pos,
const TVector3 &  mom,
const int  pdgCode,
TVector3  posError = TVector3(1.0,1.0,1.0),
TVector3  dirError = TVector3(1.0,1.0,1.0) 
)

set the seed values for track: pos, momentum, pdgCode, pos error, momentum error (errors are optional and will be set to 1,1,1 if not given)

Definition at line 117 of file GFTrackCand.cxx.

References fDirError, fDirSeed, fPdg, fPosError, fPosSeed, fQoverpSeed, mom, and pos.

117  {
118  fPosSeed=pos;fDirSeed=mom; fPdg = pdgCode; fPosError = posError; fDirError = dirError;
119  TParticlePDG* part = TDatabasePDG::Instance()->GetParticle(fPdg);
120  double charge = part->Charge()/(3.);
121  fQoverpSeed=charge/mom.Mag();
122 }
TVector3 pos
TVector3 fPosError
Definition: GFTrackCand.h:184
Double_t mom
Definition: plot_dirc.C:14
TVector3 fPosSeed
Definition: GFTrackCand.h:182
double fQoverpSeed
Definition: GFTrackCand.h:186
TVector3 fDirSeed
Definition: GFTrackCand.h:183
TVector3 fDirError
Definition: GFTrackCand.h:185
void GFTrackCand::setCurv ( double  c)
inline

Definition at line 144 of file GFTrackCand.h.

References c, and fCurv.

Referenced by PndHypIdealTrackFinderTask::AddAndExpand().

144 {fCurv=c;}
double fCurv
Definition: GFTrackCand.h:178
void GFTrackCand::setDip ( double  d)
inline

Definition at line 145 of file GFTrackCand.h.

References d, and fDip.

Referenced by PndHypIdealTrackFinderTask::AddAndExpand().

145 {fDip=d;}
TObjArray * d
double fDip
Definition: GFTrackCand.h:179
void GFTrackCand::setInverted ( bool  f = true)
inline

Definition at line 146 of file GFTrackCand.h.

References f, and fInv.

Referenced by PndHypIdealTrackFinderTask::AddAndExpand().

146 {fInv=f;}
TFile * f
Definition: bump_analys.C:12
void GFTrackCand::setMcTrackId ( int  i)
inline

set the MCT track id, for MC simulations

Definition at line 149 of file GFTrackCand.h.

References fMcTrackId, and i.

Referenced by PndHypIdealPRTask::AddHitToTrack(), and PndTrackCand2GenfitTrackCand().

149 {fMcTrackId=i;}
Int_t i
Definition: run_full.C:25
void GFTrackCand::setPdgCode ( int  pdgCode)
inline

set a particle hypothesis in form of a PDG code

Definition at line 163 of file GFTrackCand.h.

References fPdg.

Referenced by PndHypIdealPRTask::AddHitToTrack().

163 {fPdg=pdgCode;}
void GFTrackCand::setTrackSeed ( const TVector3 &  pos,
const TVector3 &  direction,
const double  qop 
)
inline

set the seed values for track: pos, direction, q/p

Definition at line 155 of file GFTrackCand.h.

References fDirSeed, fPosSeed, fQoverpSeed, and pos.

Referenced by PndHypIdealPRTask::AddHitToTrack().

155  {
156  fPosSeed=pos;fDirSeed=direction;fQoverpSeed=qop;
157  }
TVector3 pos
TVector3 fPosSeed
Definition: GFTrackCand.h:182
double fQoverpSeed
Definition: GFTrackCand.h:186
TVector3 fDirSeed
Definition: GFTrackCand.h:183

Friends And Related Function Documentation

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

Definition at line 83 of file GFTrackCand.cxx.

83  {
84  if(lhs.getNHits()!=rhs.getNHits()) return false;
85  bool result=std::equal(lhs.fDetId.begin(),lhs.fDetId.end(),rhs.fDetId.begin());
86  result &=std::equal(lhs.fHitId.begin(),lhs.fHitId.end(),rhs.fHitId.begin());
87  return result;
88 }
unsigned int getNHits() const
Definition: GFTrackCand.h:113
std::vector< unsigned int > fHitId
Definition: GFTrackCand.h:174
std::vector< unsigned int > fDetId
Definition: GFTrackCand.h:173

Member Data Documentation

double GFTrackCand::fCurv
private

Definition at line 178 of file GFTrackCand.h.

Referenced by getCurv(), and setCurv().

std::vector<unsigned int> GFTrackCand::fDetId
private
double GFTrackCand::fDip
private

Definition at line 179 of file GFTrackCand.h.

Referenced by getDip(), and setDip().

TVector3 GFTrackCand::fDirError
private

Definition at line 185 of file GFTrackCand.h.

Referenced by getDirError(), and setComplTrackSeed().

TVector3 GFTrackCand::fDirSeed
private

Definition at line 183 of file GFTrackCand.h.

Referenced by getDirSeed(), Print(), setComplTrackSeed(), and setTrackSeed().

std::vector<unsigned int> GFTrackCand::fHitId
private
bool GFTrackCand::fInv
private

Definition at line 180 of file GFTrackCand.h.

Referenced by inverted(), and setInverted().

int GFTrackCand::fMcTrackId
private

Definition at line 187 of file GFTrackCand.h.

Referenced by getMcTrackId(), Print(), and setMcTrackId().

int GFTrackCand::fPdg
private

Definition at line 188 of file GFTrackCand.h.

Referenced by getPdgCode(), setComplTrackSeed(), and setPdgCode().

std::vector<unsigned int> GFTrackCand::fPlaneId
private

Definition at line 175 of file GFTrackCand.h.

Referenced by addHit(), and getHitWithPlane().

TVector3 GFTrackCand::fPosError
private

Definition at line 184 of file GFTrackCand.h.

Referenced by getPosError(), and setComplTrackSeed().

TVector3 GFTrackCand::fPosSeed
private

Definition at line 182 of file GFTrackCand.h.

Referenced by getPosSeed(), Print(), setComplTrackSeed(), and setTrackSeed().

double GFTrackCand::fQoverpSeed
private

Definition at line 186 of file GFTrackCand.h.

Referenced by getQoverPseed(), Print(), setComplTrackSeed(), and setTrackSeed().

std::vector<double> GFTrackCand::fRho
private

Definition at line 176 of file GFTrackCand.h.

Referenced by addHit(), getHit(), GetRhos(), GFTrackCand(), and Print().


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