21 #include "TVirtualGeoTrack.h" 26 : fTrackReps(NULL), fPDG(2112), fCardinal_rep(0), fNextHitToFit(0)
39 for (
unsigned int i = 0; i <
getNumReps(); i++) {
44 for (
unsigned int i = 0; i <
fHits.size(); i++) {
57 for (
unsigned int i = 0; i < _tr.
getNumHits(); i++) {
61 for (
unsigned int i = 0; i < _tr.
getNumReps(); i++) {
68 for (
unsigned int i = 0; i < _tr.
fBookkeeping.size(); ++i) {
77 for (
unsigned int i = 0; i <
getNumReps(); i++) {
83 for (
unsigned int i = 0; i <
fHits.size(); i++) {
90 for (
unsigned int i = 0; i < _tr.
getNumReps(); ++i) {
96 for (
unsigned int i = 0; i < _tr.
getNumHits(); i++) {
104 for (
unsigned int i = 0; i < _tr.
fBookkeeping.size(); ++i) {
115 for (
unsigned int i = 0; i <
getNumReps(); i++) {
120 for (
unsigned int i = 0; i <
fHits.size(); i++) {
130 for (
unsigned int i = 0; i < nhits; ++i) {
135 addHit(hit, detId, hitId);
145 for (
unsigned int i = 0; i <
getNumReps(); 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);
169 std::vector<double>& result)
174 for (
unsigned int ih = 0; ih < nhits; ++ih) {
181 int repDim = rep->
getDim();
182 TMatrixT<Double_t> state(repDim, 1);
192 result.push_back(res);
199 out <<
"GFTrack::printBookkeeping()" << std::endl;
200 for (
unsigned int i = 0; i <
getNumReps(); ++i) {
201 out <<
"trackRep " << i <<
":" << std::endl;
208 for (
unsigned int i = 0; i <
getNumReps(); ++i) {
212 out <<
"GFTrack has " <<
getNumHits() <<
" detector hits." << std::endl;
217 for (
int i = 0; retVal.size(); ++i) {
223 throw GFException(
"genf::GFTrack::getResiduals(): inconsistent hits", __LINE__, __FILE__)
225 if (
fHits.size() < 2)
226 throw GFException(
"genf::GFTrack::getResiduals(): less than 2 hits", __LINE__, __FILE__)
228 unsigned int detId, hitId, planeId;
231 unsigned int lastPlane = planeId;
232 retVal.push_back(
new std::vector<int>);
233 retVal.at(0)->push_back(0);
237 if (lastPlane == planeId) { retVal.at(retVal.size() - 1)->push_back(i); }
240 retVal.push_back(
new std::vector<int>);
241 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.
std::vector< GFBookkeeping * > fBookkeeping
Collection of Bookeeping objects for failed hits in every trackrep.
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
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