FairRoot/PandaRoot
GFAbsTrackRep.cxx
Go to the documentation of this file.
1 /* Copyright 2008-2010, Technische Universitaet Muenchen,
2  Authors: Christian Hoeppner & Sebastian Neubert
3 
4  This file is part of GENFIT.
5 
6  GENFIT is free software: you can redistribute it and/or modify
7  it under the terms of the GNU Lesser General Public License as published
8  by the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  GENFIT is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public License
17  along with GENFIT. If not, see <http://www.gnu.org/licenses/>.
18 */
19 #include "GFAbsTrackRep.h"
20 #include <iostream>
21 #include <assert.h>
22 
23 GFAbsTrackRep::GFAbsTrackRep() : fDimension(5),fState(5,1), fCov(5,5), fChiSqu(0), fNdf(0), fStatusFlag(0), fInverted(false), fFirstState(5,1), fFirstCov(5,5), fLastState(5,1), fLastCov(5,5)
24 {
25 }
26 
27 GFAbsTrackRep::GFAbsTrackRep(int dim) : fDimension(dim), fState(dim,1), fCov(dim,dim), fChiSqu(0), fNdf(0), fStatusFlag(0), fInverted(false), fFirstState(dim,1), fFirstCov(dim,dim), fLastState(dim,1), fLastCov(dim,dim)
28 {
29 }
30 
32 
34  TMatrixT<double> statePred(fDimension,1);
35  TMatrixT<double> covPred(fDimension,fDimension);
36  double retVal = extrapolate(plane,statePred,covPred);
37  setData(statePred,plane,&covPred);
38  return retVal;
39 }
40 
41 //default implentation might be overwritten, please see the doxy docu
42 double GFAbsTrackRep::extrapolate(const GFDetPlane& plane, TMatrixT<double>& statePred){
43  TMatrixT<double> cov(fDimension,fDimension);
44  return extrapolate(plane,statePred,cov);
45 }
46 
47 void GFAbsTrackRep::Abort(std::string method){
48  std::cerr << method << " as implemented in " << __FILE__
49  << " was called. This means that this feature was used "
50  << "in a track rep which didnt overwrite this method. "
51  << std::endl << "C++ throw;" << std::endl;
52  //system call abort
53  throw;
54 }
55 
56 void GFAbsTrackRep::extrapolateToPoint(const TVector3&, //(const TVector3& point,
57  TVector3&,//TVector3& poca,
58  TVector3&){//TVector3& normVec
59  Abort("extrapolateToPoca()");
60 }
61 
62 void GFAbsTrackRep::extrapolateToLine(const TVector3& , //(const TVector3& point1,
63  const TVector3& ,//const TVector3& point2,
64  TVector3& ,//TVector3& poca,
65  TVector3& ,//TVector3& normVec,
66  TVector3& ){//TVector3& poca_onwire){
67  Abort("extrapolateToLine()");
68 }
69 
70 
71 double GFAbsTrackRep::stepalong(double ,//(double h,
72  TVector3& ,//TVector3& point,
73  TVector3& ){//TVector3& dir){
74  Abort("stepalong()");
75  return -1.;
76 }
77 
78 
79 void GFAbsTrackRep::getPosMomCov(const GFDetPlane& ,TVector3& ,TVector3& ,TMatrixT<double>& ){//const GFDetPlane& pl,TVector3& pos,TVector3& mom,TMatrixT<double>& cov
80  Abort("getPosMomCov()");
81 }
82 
83 void
85  std::cout<<"GFAbsTrackRep::reset"<<std::endl;
86  TVector3 nullVec(0.,0.,0.);
87  fRefPlane.set(nullVec,nullVec,nullVec);
88  fState.Zero();
89  fCov.Zero();
90  fFirstState.Zero();
91  fFirstCov.Zero();
92  fLastState.Zero();
93  fLastCov.Zero();
94 }
95 
96 void
98  std::cout << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl;
99  std::cout<<"GFAbsTrackRep::Parameters at reference plane ";
100  fRefPlane.Print();
101  std::cout<<"GFAbsTrackRep::State"<<std::endl;
102  fState.Print();
103  std::cout<<"GFAbsTrackRep::Covariances"<<std::endl;
104  fCov.Print();
105  std::cout<<"GFAbsTrackRep::chi^2"<<std::endl;
106  std::cout<<fChiSqu<<std::endl;
107  std::cout << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl;
108 }
109 
110 
111 
Base Class for genfit track representations. Defines interface for track parameterizations.
Definition: GFAbsTrackRep.h:80
void Abort(std::string method)
void set(const TVector3 &o, const TVector3 &u, const TVector3 &v)
Definition: GFDetPlane.cxx:83
Detector plane genfit geometry class.
Definition: GFDetPlane.h:59
TMatrixT< double > fLastState
TMatrixT< double > fFirstCov
virtual void extrapolateToLine(const TVector3 &point1, const TVector3 &point2, TVector3 &poca, TVector3 &normVec, TVector3 &poca_onwire)
This method extrapolates to the point of closest approach to a line.
virtual void getPosMomCov(const GFDetPlane &pl, TVector3 &pos, TVector3 &mom, TMatrixT< double > &cov)
method which gets position, momentum and 6x6 covariance matrix
unsigned int fDimension
Dimensionality of track representation.
Definition: GFAbsTrackRep.h:85
TMatrixT< double > fFirstState
state, cov and plane for first and last point in fit
virtual ~GFAbsTrackRep()
virtual void reset()
GFDetPlane fRefPlane
virtual double extrapolate(const GFDetPlane &plane, TMatrixT< double > &statePred)
returns the tracklength spanned in this extrapolation
virtual void Print() const
virtual void extrapolateToPoint(const TVector3 &point, TVector3 &poca, TVector3 &normVec)
This method is to extrapolate the track to point of closest approach to a point in space...
ClassImp(PndAnaContFact)
virtual double stepalong(double h, TVector3 &point, TVector3 &dir)
make step of h cm along the track
TMatrixT< double > fState
The vector of track parameters.
Definition: GFAbsTrackRep.h:88
virtual void setData(const TMatrixT< double > &st, const GFDetPlane &pl, const TMatrixT< double > *cov=NULL, const TMatrixT< double > *aux=NULL)
Puts the track representation in a given state.
double fChiSqu
chiSqu of the track fit
Definition: GFAbsTrackRep.h:94
TMatrixT< double > fLastCov
void Print() const
Definition: GFDetPlane.cxx:238
TMatrixT< double > fCov
The covariance matrix.
Definition: GFAbsTrackRep.h:91