22 #include "TVirtualGeoTrack.h" 25 : fTrackReps(NULL),fPDG(2112), fCardinal_rep(0), fNextHitToFit(0)
43 for(
unsigned int i=0;i<
fHits.size();i++) {
59 for(
unsigned int i=0; i<_tr.
getNumReps();i++) {
79 for(
unsigned int i=0;i<
fHits.size();i++) {
117 for(
unsigned int i=0;i<
fHits.size();i++) {
127 for(
unsigned int i=0;i<nhits;++i){
156 for(
unsigned int i=0; i<
n; ++i){
158 TVector3 pos=rep->
getPos(pl);
160 std::cout<<pos.X()<<
","<<pos.Y()<<
","<<pos.Z()<<std::endl;
162 geotrk->AddPoint(pos.X(),pos.Y(),pos.Z(),0);
171 std::vector<double>& result)
176 for(
unsigned int ih=0; ih<nhits; ++ih){
184 TMatrixT<Double_t> state(repDim,1);
194 result.push_back(res);
201 out <<
"GFTrack::printBookkeeping()" << std::endl;
203 out <<
"trackRep " << i <<
":" << std::endl;
214 out <<
"GFTrack has " <<
getNumHits() <<
" detector hits." << std::endl;
220 for(
int i=0;retVal.size();++i){
226 throw GFException(
"genf::GFTrack::getResiduals(): inconsistent hits", __LINE__, __FILE__).
setFatal();
227 if (
fHits.size() < 2)
228 throw GFException(
"genf::GFTrack::getResiduals(): less than 2 hits", __LINE__, __FILE__).
setFatal();
229 unsigned int detId,hitId,planeId;
232 unsigned int lastPlane=planeId;
233 retVal.push_back(
new std::vector<int>);
234 retVal.at(0)->push_back(0);
238 if(lastPlane==planeId){
239 retVal.at(retVal.size()-1)->push_back(i);
243 retVal.push_back(
new std::vector<int>);
244 retVal.at(retVal.size()-1)->push_back(i);
void printBookkeeping(std::ostream &out=std::cout) const
print bookkeeping
GFTrack & operator=(const GFTrack &)
assignement operator
virtual GFAbsTrackRep * clone() const =0
TObjArray * fTrackReps
Collection of track representations.
virtual TVector3 getPos(const GFDetPlane &pl)=0
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.
GFAbsTrackRep * getTrackRep(int id) const
Accessor for track representations.
virtual const GFDetPlane & getDetPlane(GFAbsTrackRep *)=0
Get detector plane for a given track representation.
const TMatrixT< Double_t > & getState() const
unsigned int fNextHitToFit
std::vector< int > fRepAtHit
repAtHit keeps track of at which hit index which rep is currently defined, to avoid null extrapolatio...
Base Class for genfit track representations. Defines interface for track parameterizations.
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
void fillGeoTrack(TVirtualGeoTrack *tr) const
Fill TVirtualGeoTrack object Cardinal representation is used.
GFTrackCand fCand
Helper to store the indices of the hits in the track. See GFTrackCand for details.
unsigned int getNumReps() const
Get number of track represenatations.
GFTrack()
Default constructor – needed for compatibility with ROOT.
GFAbsRecoHit * getHit(int id) const
unsigned int fCardinal_rep
virtual double extrapolate(const GFDetPlane &plane, TMatrixT< Double_t > &statePred)
returns the tracklength spanned in this extrapolation
void Print(std::ostream &out=std::cout) const
void getResiduals(unsigned int detId, unsigned int dim, unsigned int rep, std::vector< double > &result)
Get residuals.
void mergeHits(GFTrack *trk)
Merge two GFTracks. Only hits will be merged.
Detector simulation of raw signals on wires.
unsigned int getNumHits() const
void getHit(unsigned int i, unsigned int &detId, unsigned int &hitId) const
Get detector ID and cluster index (hitId) for hit number i.
void reset()
Resets the GFTrack – deletes RecoHits!
std::vector< GFAbsRecoHit * > fHits
Collection of RecoHits.
unsigned int getNHits() const
Exception class for error handling in GENFIT (provides storage for diagnostic information) ...
void PrintROOTobject(std::ostream &, const ROOTOBJ &)
Small utility functions which print some ROOT objects into an output stream.
GFException & setFatal(bool b=true)
set fatal flag. if this is true, the fit stops for this current track repr.
void getHitsByPlane(std::vector< std::vector< int > * > &retVal)
const GFTrackCand & getCand() const
void addHit(GFAbsRecoHit *theHit)
deprecated!
unsigned int getDim() const
returns dimension of state vector
std::vector< GFBookkeeping * > fBookkeeping
Collection of Bookeeping objects for failed hits in every trackrep.
virtual TMatrixT< Double_t > residualVector(const GFAbsTrackRep *stateVector, const TMatrixT< Double_t > &state, const GFDetPlane &d)
Calculate residual with respect to a track representation.
void addTrackRep(GFAbsTrackRep *theTrackRep)
Add track represenation.
virtual void Print(std::ostream &out=std::cout) const
void setCandidate(const GFTrackCand &cand, bool doreset=false)
set track candidate