PandaRoot
tracking/GenfitTools/trackrep/RKTrackRep/RKTrackRep.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 /* Copyright 2008-2009, Technische Universitaet Muenchen,
14  Authors: Christian Hoeppner & Sebastian Neubert
15 
16  This file is part of GENFIT.
17 
18  GENFIT is free software: you can redistribute it and/or modify
19  it under the terms of the GNU Lesser General Public License as published
20  by the Free Software Foundation, either version 3 of the License, or
21  (at your option) any later version.
22 
23  GENFIT is distributed in the hope that it will be useful,
24  but WITHOUT ANY WARRANTY; without even the implied warranty of
25  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26  GNU Lesser General Public License for more details.
27 
28  You should have received a copy of the GNU Lesser General Public License
29  along with GENFIT. If not, see <http://www.gnu.org/licenses/>.
30 */
31 
32 /*
33  */
34 
39 #ifndef RKTRACKREP_H
40 #define RKTRACKREP_H
41 
42 #include "GFAbsTrackRep.h"
43 #include "GFDetPlane.h"
44 #include "GFTrackCand.h"
45 #include <TMatrixT.h>
46 
58 class RKTrackRep : public GFAbsTrackRep {
59 
60  public:
61  // Constructors/Destructors ---------
62  RKTrackRep();
63  RKTrackRep(const TVector3 &pos, const TVector3 &mom, const TVector3 &poserr, const TVector3 &momerr, 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 
140  double extrapolate(const GFDetPlane &, TMatrixT<double> &statePred, TMatrixT<double> &covPred);
141 
143  double extrapolate(const GFDetPlane &, TMatrixT<double> &statePred);
144 
146  void extrapolateToPoint(const TVector3 &pos, TVector3 &poca, TVector3 &dirInPoca);
147 
149  void extrapolateToLine(const TVector3 &point1, const TVector3 &point2, TVector3 &poca, TVector3 &dirInPoca, TVector3 &poca_onwire);
150 
152 
155  double stepalong(double h, TVector3 &point, TVector3 &dir);
156 
158 
161  TVector3 getPos(const GFDetPlane &);
163 
166  TVector3 getMom(const GFDetPlane &);
168 
171  void getPosMom(const GFDetPlane &, TVector3 &pos, TVector3 &mom);
173  double getCharge() const { return fCharge; }
174 
175  int getPDG() { return fPdg; };
176 
178  void switchDirection() { fDirection = (!fDirection); }
180  void setPDG(int);
181 
183 
187  void setData(const TMatrixT<double> &st, const GFDetPlane &pl, const TMatrixT<double> *cov = nullptr, const TMatrixT<double> *aux = nullptr);
188 
189  const TMatrixT<double> *getAuxInfo(const GFDetPlane &pl);
190 
191  bool hasAuxInfo() { return true; }
192 
193  void getPosMomCov(const GFDetPlane &pl, TVector3 &pos, TVector3 &mom, TMatrixT<double> &cov); // to be implemented soon
194 
195  private:
196  RKTrackRep &operator=(const RKTrackRep *) { return *this; }; // rhs // [R.K.03/2017] unused variable(s)
197 
199 
209  bool RKutta(const GFDetPlane &plane, double *P, double &coveredDistance, std::vector<TVector3> &points, std::vector<double> &pointLengths, const double &maxLen = -1,
210  bool calcCov = true) const;
211 
212  TVector3 poca2Line(const TVector3 &extr1, const TVector3 &extr2, const TVector3 &point) const;
213 
215 
222  double Extrap(const GFDetPlane &plane, TMatrixT<double> *state, TMatrixT<double> *cov = nullptr) const;
223 
224  // RKTrackRep(const RKTrackRep& rhs){};
225 
226  // data members
227 
228  bool fDirection;
229 
231  int fPdg;
233  double fMass;
235  double fCharge;
236 
237  GFDetPlane fCachePlane;
238  double fCacheSpu;
239  double fSpu;
240  TMatrixT<double> fAuxInfo;
241 
242  public:
243  ClassDef(RKTrackRep, 4)
244 };
245 
246 #endif
247 
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:92
Detector plane genfit geometry class.
Definition: GFDetPlane.h:70
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:67
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