LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
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 55 of file GFTrackCand.h.

Constructor & Destructor Documentation

genf::GFTrackCand::GFTrackCand ( )

Definition at line 27 of file GFTrackCand.cxx.

genf::GFTrackCand::~GFTrackCand ( )

Definition at line 29 of file GFTrackCand.cxx.

29 {}
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 31 of file GFTrackCand.cxx.

References fDetId, fHitId, fRho, and GFException::setFatal().

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

References fDetId, fHitId, and GFException::setFatal().

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

Member Function Documentation

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

Definition at line 48 of file GFTrackCand.cxx.

References fDetId, fHitId, fPlaneId, and fRho.

Referenced by genf::GFTrack::addHit(), append(), and getPdgCode().

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

Definition at line 109 of file GFTrackCand.cxx.

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

Referenced by setPdgCode().

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

Definition at line 117 of file GFTrackCand.h.

References fCurv.

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

Definition at line 121 of file GFTrackCand.h.

References fDetId.

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

Definition at line 118 of file GFTrackCand.h.

References fDip.

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

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

Definition at line 141 of file GFTrackCand.h.

References fDirError.

Referenced by genf::RKTrackRep::RKTrackRep().

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

get the seed value for track: direction

Definition at line 136 of file GFTrackCand.h.

References fDirSeed.

Referenced by genf::RKTrackRep::RKTrackRep().

136 {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 84 of file GFTrackCand.h.

References fDetId, fHitId, getNHits(), and GFException::setFatal().

Referenced by append(), genf::GFRecoHitFactory::createMany(), genf::GFTrack::getResiduals(), and genf::GFTrack::mergeHits().

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

References fDetId, fHitId, fRho, getNHits(), and GFException::setFatal().

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

Definition at line 57 of file GFTrackCand.cxx.

References fDetId, fHitId, and n.

Referenced by inverted().

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

References fDetId, fHitId, fPlaneId, getNHits(), and GFException::setFatal().

Referenced by genf::GFTrack::getHitsByPlane().

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

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

Definition at line 132 of file GFTrackCand.h.

References fMcTrackId.

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

Definition at line 116 of file GFTrackCand.h.

References fDetId.

Referenced by append(), genf::GFRecoHitFactory::createMany(), genf::GFTrack::fillGeoTrack(), getHit(), genf::GFTrack::getHitsByPlane(), getHitWithPlane(), and genf::operator==().

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

get the PDG code

Definition at line 143 of file GFTrackCand.h.

References addHit(), and fPdg.

Referenced by genf::RKTrackRep::RKTrackRep().

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

Definition at line 139 of file GFTrackCand.h.

References fPosError.

Referenced by genf::RKTrackRep::RKTrackRep().

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

get the seed value for track: pos

Definition at line 134 of file GFTrackCand.h.

References fPosSeed.

Referenced by genf::RKTrackRep::RKTrackRep().

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

get the seed value for track: qoverp

Definition at line 138 of file GFTrackCand.h.

References fQoverpSeed.

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

Definition at line 122 of file GFTrackCand.h.

References fRho.

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

Definition at line 123 of file GFTrackCand.h.

References fDetId.

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

Test if hit already is part of this track candidate.

Definition at line 77 of file GFTrackCand.cxx.

References fDetId, and fHitId.

Referenced by setMcTrackId().

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

Definition at line 119 of file GFTrackCand.h.

References fInv, and GetHitIDs().

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

Definition at line 94 of file GFTrackCand.cxx.

References fDetId, fDirSeed, fHitId, fMcTrackId, fPosSeed, fQoverpSeed, fRho, and genf::PrintROOTobject().

Referenced by setPdgCode().

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

Definition at line 195 of file GFTrackCand.h.

References operator==, and GFException::setFatal().

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

Definition at line 72 of file GFTrackCand.cxx.

References fDetId, and fHitId.

Referenced by setPdgCode().

73 {
74  fDetId.clear();fHitId.clear();
75 }
std::vector< unsigned int > fDetId
Definition: GFTrackCand.h:176
std::vector< unsigned int > fHitId
Definition: GFTrackCand.h:177
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) 
)

Referenced by setTrackSeed().

void genf::GFTrackCand::setCurv ( double  c)
inline

Definition at line 147 of file GFTrackCand.h.

References fCurv.

147 {fCurv=c;}
void genf::GFTrackCand::setDip ( double  d)
inline

Definition at line 148 of file GFTrackCand.h.

References d, and fDip.

148 {fDip=d;}
Float_t d
Definition: plot.C:237
void genf::GFTrackCand::setInverted ( bool  f = true)
inline

Definition at line 149 of file GFTrackCand.h.

References f, and fInv.

149 {fInv=f;}
TFile f
Definition: plotHisto.C:6
void genf::GFTrackCand::setMcTrackId ( int  i)
inline

set the MCT track id, for MC simulations

Definition at line 152 of file GFTrackCand.h.

References fMcTrackId, and HitInTrack().

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

set a particle hypothesis in form of a PDG code

Definition at line 165 of file GFTrackCand.h.

References append(), fPdg, Print(), and reset().

165 {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 158 of file GFTrackCand.h.

References d, fDirSeed, fPosSeed, fQoverpSeed, and setComplTrackSeed().

158  {
160  }
Float_t d
Definition: plot.C:237

Friends And Related Function Documentation

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

Referenced by Print().

Member Data Documentation

double genf::GFTrackCand::fCurv
private

Definition at line 181 of file GFTrackCand.h.

Referenced by getCurv(), and setCurv().

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

Definition at line 182 of file GFTrackCand.h.

Referenced by getDip(), and setDip().

TVector3 genf::GFTrackCand::fDirError
private

Definition at line 189 of file GFTrackCand.h.

Referenced by getDirError().

TVector3 genf::GFTrackCand::fDirSeed
private

Definition at line 186 of file GFTrackCand.h.

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

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

Definition at line 183 of file GFTrackCand.h.

Referenced by inverted(), and setInverted().

int genf::GFTrackCand::fMcTrackId
private

Definition at line 192 of file GFTrackCand.h.

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

int genf::GFTrackCand::fPdg
private

Definition at line 190 of file GFTrackCand.h.

Referenced by getPdgCode(), and setPdgCode().

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

Definition at line 178 of file GFTrackCand.h.

Referenced by addHit(), and getHitWithPlane().

TVector3 genf::GFTrackCand::fPosError
private

Definition at line 188 of file GFTrackCand.h.

Referenced by getPosError().

TVector3 genf::GFTrackCand::fPosSeed
private

Definition at line 185 of file GFTrackCand.h.

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

double genf::GFTrackCand::fQoverpSeed
private

Definition at line 187 of file GFTrackCand.h.

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

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

Definition at line 179 of file GFTrackCand.h.

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


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