LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
RKTrackRep.h
Go to the documentation of this file.
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 */
19 
20 /*
21  */
22 
28 #ifndef RKTRACKREP_H
29 #define RKTRACKREP_H
30 
31 #include <stdexcept> // std::logic_error
35 #include <TMatrixT.h>
36 
37 //#include "GFMaterialEffects.h"
38 
50 namespace genf {
51 
52 class RKTrackRep : public GFAbsTrackRep {
53 
54  public:
55 
56  // Constructors/Destructors ---------
57  RKTrackRep();
58  RKTrackRep(const TVector3& pos,
59  const TVector3& mom,
60  const TVector3& poserr,
61  const TVector3& momerr,
62  const int& PDGCode);
63 
64  RKTrackRep(const GFTrackCand* aGFTrackCandPtr);
65 
66  RKTrackRep(const TVector3& pos,
67  const TVector3& mom,
68  const int& PDGCode);
69 
70  RKTrackRep(const GFDetPlane& pl,
71  const TVector3& mom,
72  const int& PDGCode);
73 
74  virtual ~RKTrackRep();
75 
76 
77  virtual GFAbsTrackRep* clone() const {return new RKTrackRep(*this);}
78  virtual GFAbsTrackRep* prototype()const{return new RKTrackRep();}
79 
81 
103  double extrapolate(const GFDetPlane&,
104  TMatrixT<Double_t>& statePred,
105  TMatrixT<Double_t>& covPred);
106 
108  double extrapolate(const GFDetPlane&,
109  TMatrixT<Double_t>& statePred);
110 
112  void extrapolateToPoint(const TVector3& pos,
113  TVector3& poca,
114  TVector3& dirInPoca);
115 
117  void extrapolateToLine(const TVector3& point1,
118  const TVector3& point2,
119  TVector3& poca,
120  TVector3& dirInPoca,
121  TVector3& poca_onwire);
122 
123 
125 
128  TVector3 getPos(const GFDetPlane&);
130 
133  TVector3 getMom(const GFDetPlane&);
134  TVector3 getMomLast(const GFDetPlane&);
136 
139  void getPosMom(const GFDetPlane&,TVector3& pos,TVector3& mom);
141  double getCharge()const {return fCharge;}
145  void setPDG(int);
146  int getPDG();
147  void rescaleCovOffDiags();
148 
150 
154  void setData(const TMatrixT<double>& st, const GFDetPlane& pl, const TMatrixT<double>* cov=NULL, const TMatrixT<double>* aux=NULL);
155  // the base class method is hidden by the one above; which does not make much
156  // sense since polymorphic access will still get to it.
157  // We make it official by explicitly importing the base class method as well.
159 
160  const TMatrixT<double>* getAuxInfo(const GFDetPlane& pl);
161 
162  bool hasAuxInfo() { return true; }
163 
164  private:
165 
167  double fCacheSpu;
168  double fSpu;
169  TMatrixT<double> fAuxInfo;
170 
171 
172  RKTrackRep& operator=(const RKTrackRep* /* rhs */){return *this;}
173  RKTrackRep(const RKTrackRep& /* rhs */): GFAbsTrackRep() {}
175 
177  int fPdg;
179  double fMass;
181  double fCharge;
183  //GFMaterialEffects *fEffect;
184 
186 
196  bool RKutta (const GFDetPlane& plane,double* P, double& coveredDistance, std::vector<TVector3>& points, std::vector<double>& pointLengths, const double& maxLen=-1, bool calcCov=true) const;
197 
198  TVector3 poca2Line(const TVector3& extr1,const TVector3& extr2,const TVector3& point) const;
199 
201 
208  double Extrap(const GFDetPlane& plane, TMatrixT<Double_t>* state, TMatrixT<Double_t>* cov=NULL) const;
209 
210 
211  // void setData(const TMatrixT<Double_t>& /* st */, const GFDetPlane& /* pl */, const TMatrixT<Double_t>* cov=NULL, const TMatrixT<double>* aux=NULL);
212  // { throw std::logic_error(std::string(__func__) + "::setData(TMatrixT, GFDetPlane, TMatrixT) not available"); }
213 
214  // public:
215  //ClassDef(RKTrackRep,3)
216 
217  };
218 
219 } // end namespace
220 #endif
221 
int fPdg
PDG particle code.
Definition: RKTrackRep.h:177
const TMatrixT< double > * getAuxInfo(const GFDetPlane &pl)
Definition: RKTrackRep.cxx:56
void extrapolateToLine(const TVector3 &point1, const TVector3 &point2, TVector3 &poca, TVector3 &dirInPoca, TVector3 &poca_onwire)
This method extrapolates to the point of closest approach to a line.
Definition: RKTrackRep.cxx:425
Generic Interface to magnetic fields in GENFIT.
double fMass
Mass (in GeV)
Definition: RKTrackRep.h:179
GFDetPlane fCachePlane
Definition: RKTrackRep.h:166
virtual ~RKTrackRep()
Definition: RKTrackRep.cxx:66
double extrapolate(const GFDetPlane &, TMatrixT< Double_t > &statePred, TMatrixT< Double_t > &covPred)
returns the tracklength spanned in this extrapolation
Definition: RKTrackRep.cxx:476
RKTrackRep(const RKTrackRep &)
Definition: RKTrackRep.h:173
void setData(const TMatrixT< double > &st, const GFDetPlane &pl, const TMatrixT< double > *cov=NULL, const TMatrixT< double > *aux=NULL)
Sets state, plane and (optionally) covariance.
Definition: RKTrackRep.cxx:43
Base Class for genfit track representations. Defines interface for track parameterizations.
Definition: GFAbsTrackRep.h:85
TMatrixT< double > fAuxInfo
Definition: RKTrackRep.h:169
virtual void setData(const TMatrixT< Double_t > &st, const GFDetPlane &pl, const TMatrixT< Double_t > *cov=NULL)
void rescaleCovOffDiags()
void extrapolateToPoint(const TVector3 &pos, TVector3 &poca, TVector3 &dirInPoca)
This method is to extrapolate the track to point of closest approach to a point in space...
Definition: RKTrackRep.cxx:366
void setPDG(int)
Set PDG particle code.
Definition: RKTrackRep.cxx:300
void switchDirection()
deprecated
Definition: RKTrackRep.h:143
RKTrackRep & operator=(const RKTrackRep *)
Definition: RKTrackRep.h:172
double Extrap(const GFDetPlane &plane, TMatrixT< Double_t > *state, TMatrixT< Double_t > *cov=NULL) const
Handles propagation and material effects.
virtual GFAbsTrackRep * clone() const
Definition: RKTrackRep.h:77
TVector3 getMomLast(const GFDetPlane &)
Definition: RKTrackRep.cxx:338
double fCharge
Charge.
Definition: RKTrackRep.h:181
virtual GFAbsTrackRep * prototype() const
Definition: RKTrackRep.h:78
void getPosMom(const GFDetPlane &, TVector3 &pos, TVector3 &mom)
Gets position and momentum in the plane by exrapolating or not.
Definition: RKTrackRep.cxx:348
bool RKutta(const GFDetPlane &plane, double *P, double &coveredDistance, std::vector< TVector3 > &points, std::vector< double > &pointLengths, const double &maxLen=-1, bool calcCov=true) const
Contains all material effects.
Definition: RKTrackRep.cxx:692
TVector3 poca2Line(const TVector3 &extr1, const TVector3 &extr2, const TVector3 &point) const
Definition: RKTrackRep.cxx:412
double getCharge() const
Returns charge.
Definition: RKTrackRep.h:141