EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GFAbsTrackRep.cxx
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file GFAbsTrackRep.cxx
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), fXX0(-1.)
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), fXX0(-1.)
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 
57  TVector3& poca,
58  TVector3& normVec){
59  Abort("extrapolateToPoca()");
60 }
61 
62 void GFAbsTrackRep::extrapolateToLine(const TVector3& point1,
63  const TVector3& point2,
64  TVector3& poca,
65  TVector3& normVec,
66  TVector3& poca_onwire){
67  Abort("extrapolateToLine()");
68 }
69 
70 
72  TVector3& point,
73  TVector3& dir){
74  Abort("stepalong()");
75  return 0.;
76 }
77 
78 
80  Abort("getPDG()");
81  return 0;
82 }
83 
84 
85 void GFAbsTrackRep::getPosMomCov(const GFDetPlane& pl,TVector3& pos,TVector3& mom,TMatrixT<double>& cov){
86  Abort("getPosMomCov()");
87 }
88 
89 void GFAbsTrackRep::setPosMomCov(const TVector3& pos, const TVector3& mom, const TMatrixT<double>& cov){
90  Abort("setPosMomCov()");
91 }
92 
93 void
95  std::cout<<"GFAbsTrackRep::reset"<<std::endl;
96  TVector3 nullVec(0.,0.,0.);
97  fRefPlane.set(nullVec,nullVec,nullVec);
98  fState.Zero();
99  fCov.Zero();
100  fFirstState.Zero();
101  fFirstCov.Zero();
102  fLastState.Zero();
103  fLastCov.Zero();
104 }
105 
106 void
107 GFAbsTrackRep::Print(const Option_t* option) const {
108  std::cout << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl;
109  std::cout<<"GFAbsTrackRep::Parameters at reference plane ";
110  fRefPlane.Print(option);
111  std::cout<<"GFAbsTrackRep::State"<<std::endl;
112  fState.Print(option);
113  std::cout<<"GFAbsTrackRep::Covariances"<<std::endl;
114  fCov.Print(option);
115  std::cout<<"GFAbsTrackRep::chi^2"<<std::endl;
116  std::cout<<fChiSqu<<std::endl;
117  std::cout << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl;
118 }
119 
120 
121