PandaRoot
GeaneTrackRep.h
Go to the documentation of this file.
1 //-----------------------------------------------------------
2 // File and Version Information:
3 // $Id$
4 //
5 // Description:
6 // a GEANE (sd-system) track representation
7 // (q/p, v',w',v,w)
8 // (v,w) refers to DetPlane system
9 //
10 // Environment:
11 // Software developed for the PANDA Detector at FAIR.
12 //
13 // Author List:
14 // Sebastian Neubert TUM (original author)
15 // Andrea Fontana INFN
16 //
17 //
18 //-----------------------------------------------------------
19 
20 #ifndef GeaneTRACKREP_HH
21 #define GeaneTRACKREP_HH
22 
23 // Base Class Headers ----------------
24 #include "GFAbsTrackRep.h"
25 #include "FairTrackParP.h"
26 
27 // Collaborating Class Headers -------
28 #include <ostream> // remove if you do not need streaming op
29 #include "TVectorT.h"
30 
31 // Collaborating Class Declarations --
32 class FairGeanePro;
33 
34 class GeaneTrackRep : public GFAbsTrackRep {
35  public:
36  // Constructors/Destructors ---------
37  GeaneTrackRep();
38  GeaneTrackRep(FairGeanePro *geane,
39  const GFDetPlane &plane, // will be defined at origin of plane
40  const TVector3 &mom, const TVector3 &poserr, const TVector3 &momerr, double q, int PDGCode);
41 
42  GeaneTrackRep(FairGeanePro *geane,
43  const GFDetPlane &plane, // will be defined at origin of plane
44  const TVector3 &mom, const TVector3 &poserr, const TVector3 &momerr, int q, int PDGCode);
45 
46  virtual ~GeaneTrackRep();
47 
48  virtual GFAbsTrackRep *clone() const { return new GeaneTrackRep(*this); }
49  virtual GFAbsTrackRep *prototype() const { return new GeaneTrackRep(); }
50 
51  // Operators
52  friend std::ostream &operator<<(std::ostream &s, const GeaneTrackRep &me);
53 
54  // Accessors -----------------------
55 
56  // Modifiers
57 
58  // Operations ----------------------
59 
60  virtual double extrapolate(const GFDetPlane &, TMatrixT<double> &statePred);
61  // virtual void extrapolate(const GFDetPlane&,
62  // const TMatrixT<double>& stateFrom
63  // TMatrixT<double>& stateResult);
64 
65  virtual double extrapolate(const GFDetPlane &, TMatrixT<double> &statePred, TMatrixT<double> &covPred);
66 
67  // these two are overwritting ABsTrackRep methods
68  void extrapolateToPoint(const TVector3 &pos, TVector3 &poca, TVector3 &dirInPoca);
69 
70  void extrapolateToLine(const TVector3 &point1, const TVector3 &point2, TVector3 &poca, TVector3 &dirInPoca, TVector3 &poca_onwire);
71 
72  TVector3 getPocaOnLine(const TVector3 &p1, const TVector3 &p2, bool back = false);
73 
74  virtual TVector3 getPos(const GFDetPlane &);
75  virtual TVector3 getMom(const GFDetPlane &);
76  virtual void getPosMom(const GFDetPlane &, TVector3 &pos, TVector3 &mom);
77  virtual void getPosMomCov(const GFDetPlane &pl, TVector3 &pos, TVector3 &mom, TMatrixT<double> &cov);
78  virtual double getCharge() const { return fState[0][0] > 0 ? 1. : -1.; }
79  int getPropDir() { return _backw; }
80  FairGeanePro *getPropagator() { return _geane; }
81  int getPDG() { return _pdg; };
82  double getSPU() { return _spu; }
83 
84  void setPropagator(FairGeanePro *g) { _geane = g; }
85  void setPropDir(int d) { _backw = d; }
86  void switchDirection() { _backw = -_backw; }
87 
88  // (-1,0,1) -> (backward prop,decide myself,forward)
89 
90  private:
91  void checkState(); // checks if state vector is inside numerical limits
92 
93  // Private Data Members ------------
94  FairGeanePro *_geane;
95  int _pdg; // pdg code of the particle to be tracked
96  int _backw; // (-1,0,1) -> (backward prop,decide myself,forward)
97  double _spu; // sign of z-component of momentum
98 
99  // Private Methods -----------------
100 
101  // calculate jacobian of extrapolation
102  // void Jacobian(const GFDetPlane& pl,
103  // const TMatrixT<double>& statePred,
104  // TMatrixT<double>& jacResult);
105 
106  public:
107  ClassDef(GeaneTrackRep, 1)
108 };
109 
110 #endif
111 
112 //--------------------------------------------------------------
113 // $Log$
114 //--------------------------------------------------------------
TVector3 getMom()
Base Class for genfit track representations. Defines interface for track parameterizations.
Definition: GFAbsTrackRep.h:80
void setPropagator(FairGeanePro *g)
Definition: GeaneTrackRep.h:84
static const double me
Definition: mzparameters.h:11
Detector plane genfit geometry class.
Definition: GFDetPlane.h:58
FairGeanePro * getPropagator()
Definition: GeaneTrackRep.h:80
friend std::ostream & operator<<(std::ostream &s, const GeaneTrackRep &me)
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.
virtual ~GeaneTrackRep()
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 void getPosMomCov(const GFDetPlane &pl, TVector3 &pos, TVector3 &mom, TMatrixT< double > &cov)
method which gets position, momentum and 6x6 covariance matrix
virtual void getPosMom(const GFDetPlane &, TVector3 &pos, TVector3 &mom)
void setPropDir(int d)
Definition: GeaneTrackRep.h:85
virtual double extrapolate(const GFDetPlane &, TMatrixT< double > &statePred)
returns the tracklength spanned in this extrapolation
TVector3 getPos()
void switchDirection()
Definition: GeaneTrackRep.h:86
virtual GFAbsTrackRep * clone() const
Definition: GeaneTrackRep.h:48
virtual GFAbsTrackRep * prototype() const
Definition: GeaneTrackRep.h:49
double getSPU()
Definition: GeaneTrackRep.h:82
TMatrixT< double > fState
The vector of track parameters.
Definition: GFAbsTrackRep.h:88
virtual double getCharge() const
Definition: GeaneTrackRep.h:78
TVector3 getPocaOnLine(const TVector3 &p1, const TVector3 &p2, bool back=false)