EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LSLTrackRep.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file LSLTrackRep.h
1 /* Copyright 2008-2009, 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 */
27 #ifndef LSLTRACKREP_H
28 #define LSLTRACKREP_H
29 
30 #include <ostream> // remove if you do not need streaming op
31 
32 #include "TVectorT.h"
33 #include "TMatrixT.h"
34 
35 #include "GFAbsTrackRep.h"
36 
37 // Collaborating Class Declarations --
38 class GFAbsBField;
39 class AbsNystromEQM;
40 
63 class LSLTrackRep : public GFAbsTrackRep {
64 public:
65 
66  // Constructors/Destructors ---------
67  LSLTrackRep();
68  LSLTrackRep(double z, double x, double y,
69  double dxdz, double dydz, double invp,
70  double sigx, double sigy,
71  double sigdxdz, double sigdydz,
72  double siginvp,
73  GFAbsBField* field);
74  LSLTrackRep(const LSLTrackRep& rep); // copy ctor
75 
76  virtual ~LSLTrackRep();
77 
78 
79  virtual GFAbsTrackRep* clone()const {return new LSLTrackRep(*this);}
80 
81  virtual GFAbsTrackRep* prototype()const{return new LSLTrackRep();}
82 
83  // Operators
84  friend std::ostream& operator<< (std::ostream& s, const LSLTrackRep& me);
85 
86  // Accessors -----------------------
87  void init(const TVector3& pos,
88  double dxdz, double dydz, double invp,
89  double sigx, double sigy,
90  double sigdxdz, double sigdydz,
91  double siginvp,
92  GFAbsBField* field);
93 
94  // Modifiers
95  void SetBField(GFAbsBField* b);
96  void setData(const TMatrixT<double>& st, const GFDetPlane& pl, const TMatrixT<double>* cov=NULL){
98  s=pl.getO().Z();
99  }
100  void setRungeKuttaAcc(double acc){_acc=acc;}
102  // Operations ----------------------
103  virtual double extrapolate(const GFDetPlane&, TMatrixT<double>& statePred);
104  //virtual void extrapolate(const GFDetPlane&,
105  // const TMatrixT<double>& stateFrom,
106  // TMatrixT<double>& stateResult);
107 
108  virtual double extrapolate(const GFDetPlane&,
109  TMatrixT<double>& statePred,
110  TMatrixT<double>& covPred);
111 
112 
113  virtual void extrapolateToPoint(const TVector3&,
114  TVector3& poca,
115  TVector3& normVec);
116 
117 
118  virtual void stepalong(double h);
119 
120  virtual TVector3 getPos(const GFDetPlane&) ;
121  virtual TVector3 getMom(const GFDetPlane&) ;
122  virtual void getPosMom(const GFDetPlane&,TVector3& pos, TVector3& mom) ;
123  virtual TVectorT<double> getGlobal(); // (x,y,z,px,py,pz)
124  virtual TMatrixT<double> getGlobalCov(); // covariances
125 
126  virtual double getCharge()const {double fact= fInverted ? -1.:1.;
127  return fState[4][0]<0 ? -fact : fact;}
128 
129  virtual void switchDirection(){};
130 
131 private:
132 
133  // Private Data Members ------------
134 
135  // Private Methods -----------------
136  // equation of motion in a magnetic field
137  //static TVectorT<double> eqm(const TVectorT<double>& u,
138  // const TVectorT<double>& uprim,
139  // const TVectorT<double>& par);
140 
141  double s;
142 
143  double _acc; // accuracy of runge kutta; default: 1E-2cm
144  bool _adaptive;
145 
147 
148  // calculate jacobian of extrapolation
149  void Jacobian(const GFDetPlane& pl,
150  const TMatrixT<double>& statePred,
151  TMatrixT<double>& jacResult);
152 
153  public:
154  ClassDef(LSLTrackRep,1)
155 
156 };
157 
158 
159 #endif
160 
161