Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
genf::GFTrackCand Class Reference

#include <GFTrackCand.h>

Inheritance diagram for genf::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
 
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 &p, const TVector3 &d, 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))
 
void setPdgCode (int pdgCode)
 set a particle hypothesis in form of a PDG code More...
 
void append (const GFTrackCand &)
 
void reset ()
 
void Print (std::ostream &out=std::cout) const
 

Private Member Functions

virtual void Print (Option_t *) 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
 
double fQoverpSeed
 
TVector3 fPosError
 
TVector3 fDirError
 
int fPdg
 
int fMcTrackId
 

Friends

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

Detailed Description

Definition at line 56 of file GFTrackCand.h.

Constructor & Destructor Documentation

genf::GFTrackCand::GFTrackCand ( )

Definition at line 28 of file GFTrackCand.cxx.

genf::GFTrackCand::~GFTrackCand ( )

Definition at line 30 of file GFTrackCand.cxx.

30 {}
genf::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 32 of file GFTrackCand.cxx.

33  : fDetId(detIDs),fHitId(hitIDs),fCurv(curv), fDip(dip), fInv(inv),fQoverpSeed(0.), fMcTrackId(-1)
34 {
35  if (fDetId.size() != fHitId.size())
36  throw GFException("genf::GFTrackCand::GFTrackCand(): hit/det size mismatch", __LINE__, __FILE__).setFatal();
37  fRho.resize(fDetId.size(),0.);
38 }
Exception class for error handling in GENFIT (provides storage for diagnostic information) ...
Definition: GFException.h:48
GFException & setFatal(bool b=true)
set fatal flag. if this is true, the fit stops for this current track repr.
Definition: GFException.h:78
std::vector< unsigned int > fDetId
Definition: GFTrackCand.h:177
std::vector< unsigned int > fHitId
Definition: GFTrackCand.h:178
std::vector< double > fRho
Definition: GFTrackCand.h:180
genf::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 39 of file GFTrackCand.cxx.

40  : fDetId(detIDs),fHitId(hitIDs),fRho(rhos),fCurv(curv), fDip(dip), fInv(inv),fQoverpSeed(0.), fMcTrackId(-1)
41 {
42  if (fDetId.size() != fHitId.size())
43  throw GFException("genf::GFTrackCand::GFTrackCand(): hit/det size mismatch", __LINE__, __FILE__).setFatal();
44  if (fDetId.size() != fHitId.size())
45  throw GFException("genf::GFTrackCand::GFTrackCand(): rho/det size mismatch", __LINE__, __FILE__).setFatal();
46 }
Exception class for error handling in GENFIT (provides storage for diagnostic information) ...
Definition: GFException.h:48
GFException & setFatal(bool b=true)
set fatal flag. if this is true, the fit stops for this current track repr.
Definition: GFException.h:78
std::vector< unsigned int > fDetId
Definition: GFTrackCand.h:177
std::vector< unsigned int > fHitId
Definition: GFTrackCand.h:178
std::vector< double > fRho
Definition: GFTrackCand.h:180

Member Function Documentation

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

Definition at line 49 of file GFTrackCand.cxx.

50 {
51  fDetId.push_back(detId);
52  fHitId.push_back(hitId);
53  fPlaneId.push_back(planeId);
54  fRho.push_back(rho);
55 }
std::vector< unsigned int > fPlaneId
Definition: GFTrackCand.h:179
std::vector< unsigned int > fDetId
Definition: GFTrackCand.h:177
std::vector< unsigned int > fHitId
Definition: GFTrackCand.h:178
std::vector< double > fRho
Definition: GFTrackCand.h:180
void genf::GFTrackCand::append ( const GFTrackCand rhs)

Definition at line 110 of file GFTrackCand.cxx.

110  {
111  unsigned int detId,hitId;
112  double rho;
113  for(unsigned int i=0;i<rhs.getNHits();++i){
114  rhs.getHit(i,detId,hitId,rho);
115  addHit(detId,hitId,rho);
116  }
117 
118 
119 }
void addHit(unsigned int detId, unsigned int hitId, double rho=0., unsigned int planeId=0)
Definition: GFTrackCand.cxx:49
double genf::GFTrackCand::getCurv ( ) const
inline

Definition at line 118 of file GFTrackCand.h.

118 {return fCurv;}
std::vector<unsigned int> genf::GFTrackCand::GetDetIDs ( ) const
inline

Definition at line 122 of file GFTrackCand.h.

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

Definition at line 119 of file GFTrackCand.h.

119 {return fDip;}
TVector3 genf::GFTrackCand::getDirError ( ) const
inline

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

Definition at line 142 of file GFTrackCand.h.

142 {return fDirError;}
TVector3 fDirError
Definition: GFTrackCand.h:190
TVector3 genf::GFTrackCand::getDirSeed ( ) const
inline

get the seed value for track: direction

Definition at line 137 of file GFTrackCand.h.

137 {return fDirSeed;}
void genf::GFTrackCand::getHit ( unsigned int  i,
unsigned int &  detId,
unsigned int &  hitId 
) const
inline

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

Definition at line 85 of file GFTrackCand.h.

87  {
88  if (i >= getNHits())
89  throw GFException("genf::GFTrackCand::getHit(int, int, int): hit index out of range", __LINE__, __FILE__).setFatal();
90  detId=fDetId.at(i);hitId=fHitId.at(i);
91  }
unsigned int getNHits() const
Definition: GFTrackCand.h:117
Exception class for error handling in GENFIT (provides storage for diagnostic information) ...
Definition: GFException.h:48
GFException & setFatal(bool b=true)
set fatal flag. if this is true, the fit stops for this current track repr.
Definition: GFException.h:78
std::vector< unsigned int > fDetId
Definition: GFTrackCand.h:177
std::vector< unsigned int > fHitId
Definition: GFTrackCand.h:178
void genf::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 95 of file GFTrackCand.h.

98  {
99  if (i >= getNHits())
100  throw GFException("genf::GFTrackCand::getHit(int, int, int, double): hit index out of range", __LINE__, __FILE__).setFatal();
101  detId=fDetId.at(i);hitId=fHitId.at(i);
102  rho=fRho.at(i);
103  }
unsigned int getNHits() const
Definition: GFTrackCand.h:117
Exception class for error handling in GENFIT (provides storage for diagnostic information) ...
Definition: GFException.h:48
GFException & setFatal(bool b=true)
set fatal flag. if this is true, the fit stops for this current track repr.
Definition: GFException.h:78
std::vector< unsigned int > fDetId
Definition: GFTrackCand.h:177
std::vector< unsigned int > fHitId
Definition: GFTrackCand.h:178
std::vector< double > fRho
Definition: GFTrackCand.h:180
std::vector< unsigned int > genf::GFTrackCand::GetHitIDs ( int  detId = -1)

Definition at line 58 of file GFTrackCand.cxx.

58  {
59  if(detId<0){ // return hits from all detectors
60  return fHitId;
61  }
62  else {
63  std::vector<unsigned int> result;
64  unsigned int n=fHitId.size();
65  for(unsigned int i=0;i<n;++i){
66  if(fDetId[i]==(unsigned int)detId)result.push_back(fHitId[i]);
67  }
68  return result;
69  }
70 }
static QCString result
std::void_t< T > n
std::vector< unsigned int > fDetId
Definition: GFTrackCand.h:177
std::vector< unsigned int > fHitId
Definition: GFTrackCand.h:178
void genf::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 107 of file GFTrackCand.h.

110  {
111  if (i >= getNHits())
112  throw GFException("genf::GFTrackCand::getHitWithPlane(): hit index out of range", __LINE__, __FILE__).setFatal();
113  detId=fDetId.at(i);hitId=fHitId.at(i);
114  planeId=fPlaneId.at(i);
115  }
std::vector< unsigned int > fPlaneId
Definition: GFTrackCand.h:179
unsigned int getNHits() const
Definition: GFTrackCand.h:117
Exception class for error handling in GENFIT (provides storage for diagnostic information) ...
Definition: GFException.h:48
GFException & setFatal(bool b=true)
set fatal flag. if this is true, the fit stops for this current track repr.
Definition: GFException.h:78
std::vector< unsigned int > fDetId
Definition: GFTrackCand.h:177
std::vector< unsigned int > fHitId
Definition: GFTrackCand.h:178
int genf::GFTrackCand::getMcTrackId ( ) const
inline

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

Definition at line 133 of file GFTrackCand.h.

133 {return fMcTrackId;}
unsigned int genf::GFTrackCand::getNHits ( ) const
inline

Definition at line 117 of file GFTrackCand.h.

117 {return fDetId.size();}
std::vector< unsigned int > fDetId
Definition: GFTrackCand.h:177
int genf::GFTrackCand::getPdgCode ( ) const
inline

get the PDG code

Definition at line 144 of file GFTrackCand.h.

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

Definition at line 140 of file GFTrackCand.h.

140 {return fPosError;}
TVector3 fPosError
Definition: GFTrackCand.h:189
TVector3 genf::GFTrackCand::getPosSeed ( ) const
inline

get the seed value for track: pos

Definition at line 135 of file GFTrackCand.h.

135 {return fPosSeed;}
double genf::GFTrackCand::getQoverPseed ( ) const
inline

get the seed value for track: qoverp

Definition at line 139 of file GFTrackCand.h.

139 {return fQoverpSeed;}
std::vector<double> genf::GFTrackCand::GetRhos ( ) const
inline

Definition at line 123 of file GFTrackCand.h.

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

Definition at line 124 of file GFTrackCand.h.

124  {
125  std::set<unsigned int> retVal;
126  for(unsigned int i=0;i<fDetId.size();++i){
127  retVal.insert(fDetId.at(i));
128  }
129  return retVal;
130  }
std::vector< unsigned int > fDetId
Definition: GFTrackCand.h:177
bool genf::GFTrackCand::HitInTrack ( unsigned int  detId,
unsigned int  hitId 
)

Test if hit already is part of this track candidate.

Definition at line 78 of file GFTrackCand.cxx.

79 {
80  for (unsigned int i = 0; i < fDetId.size(); i++){
81  if (detId == fDetId[i])
82  if (hitId == fHitId[i])
83  return true;
84  }
85  return false;
86 }
std::vector< unsigned int > fDetId
Definition: GFTrackCand.h:177
std::vector< unsigned int > fHitId
Definition: GFTrackCand.h:178
bool genf::GFTrackCand::inverted ( ) const
inline

Definition at line 120 of file GFTrackCand.h.

120 {return fInv;}
void genf::GFTrackCand::Print ( std::ostream &  out = std::cout) const

Definition at line 95 of file GFTrackCand.cxx.

95  {
96  out << "======== GFTrackCand::print ========";
97  if(fMcTrackId>=0) out << "\nmcTrackId=" << fMcTrackId;
98  out << "\nseed values for pos,direction, and q/p: " << std::endl;
101  out << "q/p=" << fQoverpSeed << std::endl;
102  if (fDetId.size() !=fHitId.size())
103  throw std::runtime_error("genf::GFTrackCand::GFTrackCand(): hit/det size mismatch");
104  out << "detId|hitId|rho ";
105  for(unsigned int i=0;i<fDetId.size();++i)
106  out << fDetId.at(i) << "|" << fHitId.at(i) << "|" << fRho.at(i) << " ";
107  out << std::endl;
108 }
void PrintROOTobject(std::ostream &, const ROOTOBJ &)
Small utility functions which print some ROOT objects into an output stream.
Definition: GFException.h:127
std::vector< unsigned int > fDetId
Definition: GFTrackCand.h:177
std::vector< unsigned int > fHitId
Definition: GFTrackCand.h:178
std::vector< double > fRho
Definition: GFTrackCand.h:180
QTextStream & endl(QTextStream &s)
virtual void genf::GFTrackCand::Print ( Option_t *  ) const
inlineprivatevirtual

Definition at line 196 of file GFTrackCand.h.

197  { throw GFException(std::string(__func__) + "::Print(Option_t*) not available", __LINE__, __FILE__).setFatal(); }
std::string string
Definition: nybbler.cc:12
Exception class for error handling in GENFIT (provides storage for diagnostic information) ...
Definition: GFException.h:48
GFException & setFatal(bool b=true)
set fatal flag. if this is true, the fit stops for this current track repr.
Definition: GFException.h:78
void genf::GFTrackCand::reset ( )

Definition at line 73 of file GFTrackCand.cxx.

74 {
75  fDetId.clear();fHitId.clear();
76 }
std::vector< unsigned int > fDetId
Definition: GFTrackCand.h:177
std::vector< unsigned int > fHitId
Definition: GFTrackCand.h:178
void genf::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) 
)
void genf::GFTrackCand::setCurv ( double  c)
inline

Definition at line 148 of file GFTrackCand.h.

void genf::GFTrackCand::setDip ( double  d)
inline

Definition at line 149 of file GFTrackCand.h.

149 {fDip=d;}
void genf::GFTrackCand::setInverted ( bool  f = true)
inline

Definition at line 150 of file GFTrackCand.h.

void genf::GFTrackCand::setMcTrackId ( int  i)
inline

set the MCT track id, for MC simulations

Definition at line 153 of file GFTrackCand.h.

153 {fMcTrackId=i;}
void genf::GFTrackCand::setPdgCode ( int  pdgCode)
inline

set a particle hypothesis in form of a PDG code

Definition at line 166 of file GFTrackCand.h.

166 {fPdg=pdgCode;}
void genf::GFTrackCand::setTrackSeed ( const TVector3 &  p,
const TVector3 &  d,
double  qop 
)
inline

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

Definition at line 159 of file GFTrackCand.h.

159  {
161  }
p
Definition: test.py:223

Friends And Related Function Documentation

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

Member Data Documentation

double genf::GFTrackCand::fCurv
private

Definition at line 182 of file GFTrackCand.h.

std::vector<unsigned int> genf::GFTrackCand::fDetId
private

Definition at line 177 of file GFTrackCand.h.

double genf::GFTrackCand::fDip
private

Definition at line 183 of file GFTrackCand.h.

TVector3 genf::GFTrackCand::fDirError
private

Definition at line 190 of file GFTrackCand.h.

TVector3 genf::GFTrackCand::fDirSeed
private

Definition at line 187 of file GFTrackCand.h.

std::vector<unsigned int> genf::GFTrackCand::fHitId
private

Definition at line 178 of file GFTrackCand.h.

bool genf::GFTrackCand::fInv
private

Definition at line 184 of file GFTrackCand.h.

int genf::GFTrackCand::fMcTrackId
private

Definition at line 193 of file GFTrackCand.h.

int genf::GFTrackCand::fPdg
private

Definition at line 191 of file GFTrackCand.h.

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

Definition at line 179 of file GFTrackCand.h.

TVector3 genf::GFTrackCand::fPosError
private

Definition at line 189 of file GFTrackCand.h.

TVector3 genf::GFTrackCand::fPosSeed
private

Definition at line 186 of file GFTrackCand.h.

double genf::GFTrackCand::fQoverpSeed
private

Definition at line 188 of file GFTrackCand.h.

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

Definition at line 180 of file GFTrackCand.h.


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