PandaRoot
tracking/GenfitTools/trackrep/RKTrackRep/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 
30 #include "GFAbsTrackRep.h"
31 #include "GFDetPlane.h"
32 #include "GFTrackCand.h"
33 #include <TMatrixT.h>
34 
46 class RKTrackRep : public GFAbsTrackRep {
47 
48  public:
49  // Constructors/Destructors ---------
50  RKTrackRep();
51  RKTrackRep(const TVector3 &pos, const TVector3 &mom, const TVector3 &poserr, const TVector3 &momerr, const int &PDGCode);
52 
53  RKTrackRep(const GFTrackCand *aGFTrackCandPtr);
54 
55  RKTrackRep(const TVector3 &pos, const TVector3 &mom, const int &PDGCode);
56 
57  RKTrackRep(const GFDetPlane &pl, const TVector3 &mom, const int &PDGCode);
58 
59  virtual ~RKTrackRep();
60 
61  virtual GFAbsTrackRep *clone() const { return new RKTrackRep(*this); }
62  virtual GFAbsTrackRep *prototype() const { return new RKTrackRep(); }
63 
65 
128  double extrapolate(const GFDetPlane &, TMatrixT<double> &statePred, TMatrixT<double> &covPred);
129 
131  double extrapolate(const GFDetPlane &, TMatrixT<double> &statePred);
132 
134  void extrapolateToPoint(const TVector3 &pos, TVector3 &poca, TVector3 &dirInPoca);
135 
137  void extrapolateToLine(const TVector3 &point1, const TVector3 &point2, TVector3 &poca, TVector3 &dirInPoca, TVector3 &poca_onwire);
138 
140 
143  double stepalong(double h, TVector3 &point, TVector3 &dir);
144 
146 
149  TVector3 getPos(const GFDetPlane &);
151 
154  TVector3 getMom(const GFDetPlane &);
156 
159  void getPosMom(const GFDetPlane &, TVector3 &pos, TVector3 &mom);
161  double getCharge() const { return fCharge; }
162 
163  int getPDG() { return fPdg; };
164 
166  void switchDirection() { fDirection = (!fDirection); }
168  void setPDG(int);
169 
171 
175  void setData(const TMatrixT<double> &st, const GFDetPlane &pl, const TMatrixT<double> *cov = nullptr, const TMatrixT<double> *aux = nullptr);
176 
177  const TMatrixT<double> *getAuxInfo(const GFDetPlane &pl);
178 
179  bool hasAuxInfo() { return true; }
180 
181  void getPosMomCov(const GFDetPlane &pl, TVector3 &pos, TVector3 &mom, TMatrixT<double> &cov); // to be implemented soon
182 
183  private:
184  RKTrackRep &operator=(const RKTrackRep *) { return *this; }; // rhs // [R.K.03/2017] unused variable(s)
185 
187 
197  bool RKutta(const GFDetPlane &plane, double *P, double &coveredDistance, std::vector<TVector3> &points, std::vector<double> &pointLengths, const double &maxLen = -1,
198  bool calcCov = true) const;
199 
200  TVector3 poca2Line(const TVector3 &extr1, const TVector3 &extr2, const TVector3 &point) const;
201 
203 
210  double Extrap(const GFDetPlane &plane, TMatrixT<double> *state, TMatrixT<double> *cov = nullptr) const;
211 
212  // RKTrackRep(const RKTrackRep& rhs){};
213 
214  // data members
215 
216  bool fDirection;
217 
219  int fPdg;
221  double fMass;
223  double fCharge;
224 
225  GFDetPlane fCachePlane;
226  double fCacheSpu;
227  double fSpu;
228  TMatrixT<double> fAuxInfo;
229 
230  public:
231  ClassDef(RKTrackRep, 4)
232 };
233 
234 #endif
235 
void setData(const TMatrixT< double > &st, const GFDetPlane &pl, const TMatrixT< double > *cov=nullptr, const TMatrixT< double > *aux=nullptr)
Sets state, plane and (optionally) covariance.
TVector3 getMom()
Base Class for genfit track representations. Defines interface for track parameterizations.
Definition: GFAbsTrackRep.h:80
Detector plane genfit geometry class.
Definition: GFDetPlane.h:58
void getPosMom(const GFDetPlane &, TVector3 &pos, TVector3 &mom)
Gets position and momentum in the plane.
virtual GFAbsTrackRep * clone() const
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.
Track Representation module based on a Runge-Kutta algorithm including a full material model...
bool hasAuxInfo()
See if the track representation has auxillary information stored.
void getPosMomCov(const GFDetPlane &pl, TVector3 &pos, TVector3 &mom, TMatrixT< double > &cov)
method which gets position, momentum and 6x6 covariance matrix
double getCharge() const
Returns charge.
Track candidate – a list of cluster indices.
Definition: GFTrackCand.h:55
TVector3 getPos()
virtual ~RKTrackRep()
double stepalong(double h, TVector3 &point, TVector3 &dir)
make step of h cm along the track, returns the tracklength spanned in this extrapolation ...
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...
virtual GFAbsTrackRep * prototype() const
void setPDG(int)
Set PDG particle code.
const TMatrixT< double > * getAuxInfo(const GFDetPlane &pl)
Get auxillary information from the track representation.
double extrapolate(const GFDetPlane &, TMatrixT< double > &statePred, TMatrixT< double > &covPred)
returns the tracklength spanned in this extrapolation