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