LArSoft  v09_90_00
Liquid Argon Software toolkit - https://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 
27 #ifndef RKTRACKREP_H
28 #define RKTRACKREP_H
29 
32 #include <TMatrixT.h>
33 #include <stdexcept> // std::logic_error
34 
35 namespace genf {
36  class GFTrackCand;
37 }
38 
39 //#include "GFMaterialEffects.h"
40 
52 namespace genf {
53 
54  class RKTrackRep : public GFAbsTrackRep {
55 
56  public:
57  // Constructors/Destructors ---------
58  RKTrackRep();
59  RKTrackRep(const TVector3& pos,
60  const TVector3& mom,
61  const TVector3& poserr,
62  const TVector3& momerr,
63  const int& PDGCode);
64 
65  RKTrackRep(const GFTrackCand* aGFTrackCandPtr);
66 
67  RKTrackRep(const TVector3& pos, const TVector3& mom, const int& PDGCode);
68 
69  RKTrackRep(const GFDetPlane& pl, const TVector3& mom, const int& PDGCode);
70 
71  virtual ~RKTrackRep();
72 
73  virtual GFAbsTrackRep* clone() const { return new RKTrackRep(*this); }
74  virtual GFAbsTrackRep* prototype() const { return new RKTrackRep(); }
75 
77 
99  double extrapolate(const GFDetPlane&,
100  TMatrixT<Double_t>& statePred,
101  TMatrixT<Double_t>& covPred);
102 
104  double extrapolate(const GFDetPlane&, TMatrixT<Double_t>& statePred);
105 
107  void extrapolateToPoint(const TVector3& pos, TVector3& poca, TVector3& dirInPoca);
108 
110  void extrapolateToLine(const TVector3& point1,
111  const TVector3& point2,
112  TVector3& poca,
113  TVector3& dirInPoca,
114  TVector3& poca_onwire);
115 
117 
120  TVector3 getPos(const GFDetPlane&);
122 
125  TVector3 getMom(const GFDetPlane&);
126  TVector3 getMomLast(const GFDetPlane&);
128 
131  void getPosMom(const GFDetPlane&, TVector3& pos, TVector3& mom);
133  double getCharge() const { return fCharge; }
137  void setPDG(int);
138  int getPDG();
139  void rescaleCovOffDiags();
140 
142 
146  void setData(const TMatrixT<double>& st,
147  const GFDetPlane& pl,
148  const TMatrixT<double>* cov = NULL,
149  const TMatrixT<double>* aux = NULL);
150  // the base class method is hidden by the one above; which does not make much
151  // sense since polymorphic access will still get to it.
152  // We make it official by explicitly importing the base class method as well.
154 
155  const TMatrixT<double>* getAuxInfo(const GFDetPlane& pl);
156 
157  bool hasAuxInfo() { return true; }
158 
159  private:
161  double fCacheSpu;
162  double fSpu;
163  TMatrixT<double> fAuxInfo;
164 
165  RKTrackRep& operator=(const RKTrackRep* /* rhs */) { return *this; }
166  RKTrackRep(const RKTrackRep& /* rhs */) : GFAbsTrackRep() {}
168 
170  int fPdg;
172  double fMass;
174  double fCharge;
176  //GFMaterialEffects *fEffect;
177 
179 
189  bool RKutta(const GFDetPlane& plane,
190  double* P,
191  double& coveredDistance,
192  std::vector<TVector3>& points,
193  std::vector<double>& pointLengths,
194  const double& maxLen = -1,
195  bool calcCov = true) const;
196 
197  TVector3 poca2Line(const TVector3& extr1, const TVector3& extr2, const TVector3& point) const;
198 
200 
207  double Extrap(const GFDetPlane& plane,
208  TMatrixT<Double_t>* state,
209  TMatrixT<Double_t>* cov = NULL) const;
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 } // end namespace
219 #endif
220 
int fPdg
PDG particle code.
Definition: RKTrackRep.h:170
const TMatrixT< double > * getAuxInfo(const GFDetPlane &pl)
Definition: RKTrackRep.cxx:61
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:415
Generic Interface to magnetic fields in GENFIT.
Definition: GFAbsBField.h:34
double fMass
Mass (in GeV)
Definition: RKTrackRep.h:172
GFDetPlane fCachePlane
Definition: RKTrackRep.h:160
virtual ~RKTrackRep()
Definition: RKTrackRep.cxx:75
double extrapolate(const GFDetPlane &, TMatrixT< Double_t > &statePred, TMatrixT< Double_t > &covPred)
returns the tracklength spanned in this extrapolation
Definition: RKTrackRep.cxx:468
RKTrackRep(const RKTrackRep &)
Definition: RKTrackRep.h:166
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:41
Base Class for genfit track representations. Defines interface for track parameterizations.
Definition: GFAbsTrackRep.h:81
TMatrixT< double > fAuxInfo
Definition: RKTrackRep.h:163
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:352
void setPDG(int)
Set PDG particle code.
Definition: RKTrackRep.cxx:284
void switchDirection()
deprecated
Definition: RKTrackRep.h:135
RKTrackRep & operator=(const RKTrackRep *)
Definition: RKTrackRep.h:165
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:73
TVector3 getMomLast(const GFDetPlane &)
Definition: RKTrackRep.cxx:328
double fCharge
Charge.
Definition: RKTrackRep.h:174
virtual GFAbsTrackRep * prototype() const
Definition: RKTrackRep.h:74
void getPosMom(const GFDetPlane &, TVector3 &pos, TVector3 &mom)
Gets position and momentum in the plane by exrapolating or not.
Definition: RKTrackRep.cxx:338
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:682
TVector3 poca2Line(const TVector3 &extr1, const TVector3 &extr2, const TVector3 &point) const
Definition: RKTrackRep.cxx:398
double getCharge() const
Returns charge.
Definition: RKTrackRep.h:133