FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FairGeanePro.h
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
8 // Class for the interface to propagate track parameters with GEANE
9 //
10 // Authors: M. Al-Turany, A. Fontana, L. Lavezzi and A. Rotondi
11 //
12 #ifndef FAIRGEANEPRO_H
13 #define FAIRGEANEPRO_H 1
14 
15 #include "FairLogger.h"
16 #include "FairPropagator.h" // for TNamed
17 #include "TGeant3.h" // for Ertrio_t, etc
18 #include "TString.h" // for TString
19 #include "TVector3.h" // for TVector3
20 
21 class FairTrackPar;
22 class FairTrackParP;
23 class FairTrackParH;
25 class TDatabasePDG;
26 
28 {
29  public:
31  FairGeanePro();
32 
34  ~FairGeanePro();
35 
36  /* Old methods that still should be working */
37  virtual bool Propagate(FairTrackParH* TStart, FairTrackParH* TEnd, int PDG);
38  virtual bool Propagate(FairTrackParP* TStart, FairTrackParH* TEnd, int PDG);
39  virtual bool Propagate(FairTrackParP* TStart, FairTrackParP* TEnd, int PDG);
40  virtual bool Propagate(FairTrackParH* TStart, FairTrackParP* TEnd, int PDG);
41  virtual bool Propagate(float* x1, float* p1, float* x2, float* p2, int PDG);
42 
43  /* Old methods that still should be working */
44 
48  virtual bool SetDestinationPlane(const TVector3& v0, const TVector3& v1, const TVector3& v2);
49 
53  virtual bool SetOriginPlane(const TVector3& v0, const TVector3& v1);
54 
60  virtual bool SetDestinationVolume(std::string volName, int copyNo, int option);
61 
65  virtual bool SetDestinationLength(float length);
66 
69  virtual bool SetPropagateOnlyParameters();
70 
71  /* ====== Depracated functions ====== */
72  __attribute__((deprecated("Function PropagateToPlane depracated, use SetDestinationPlane."))) bool
73  PropagateToPlane(const TVector3& v0, const TVector3& v1, const TVector3& v2);
74  __attribute__((deprecated("Function PropagateFromPlane depracated, use SetOriginPlane."))) bool PropagateFromPlane(
75  const TVector3& v1,
76  const TVector3& v2);
77  __attribute__((deprecated("Function PropagateToVolume depracated, use SetDestinationVolume."))) bool
78  PropagateToVolume(TString VolName, int CopyNo, int option);
79  __attribute__((deprecated("Function PropagateToLength depracated, use SetDestinationLength."))) bool
80  PropagateToLength(float length);
81  __attribute__((deprecated("Function PropagateOnlyParameters depracated, use SetPropagateOnlyParameters."))) bool
82  PropagateOnlyParameters();
83  /* ====== ====== ====== ====== ====== */
84 
85  void Init(FairTrackPar* TParam);
86  bool Propagate(int PDG);
87 
88  private:
89  void Track2ToLine(TVector3 x1,
90  TVector3 x2,
91  TVector3 w1,
92  TVector3 w2,
93  TVector3& Pfinal,
94  TVector3& Pwire,
95  int& Iflag,
96  double& Dist,
97  double& Length);
98  void Track2ToPoint(TVector3 x1,
99  TVector3 x2,
100  TVector3 w1,
101  TVector3& Pfinal,
102  double& Dist,
103  double& Length,
104  int& quitFlag);
105  void Track3ToLine(TVector3 x1,
106  TVector3 x2,
107  TVector3 x3,
108  TVector3 w1,
109  TVector3 w2,
110  TVector3& Pfinal,
111  TVector3& Wire,
112  int& Iflag,
113  double& Dist,
114  double& Length,
115  double& Radius);
116  void Track3ToPoint(TVector3 x1,
117  TVector3 x2,
118  TVector3 x3,
119  TVector3 w1,
120  TVector3& Pfinal,
121  int& Iflag,
122  double& Dist,
123  double& Length,
124  double& Radius);
125 
126  public:
127  /* ====== Depracated functions ====== */
128  __attribute__((deprecated("Function FindPCA(many parameters) depracated, it is replaced by PCAOutputStruct "
129  "FindPCA(pca, PDGCode, point, wire1, wire2, maxdistance)."))) int
130  FindPCA(int pca,
131  int PDGCode,
132  TVector3 point,
133  TVector3 wire1,
134  TVector3 wire2,
135  double maxdistance,
136  double& Rad,
137  TVector3& vpf,
138  TVector3& vwi,
139  double& Di,
140  float& trklength);
141 
142  __attribute__((deprecated("Function SetWire depracated, contact FairRoot group if you need it."))) bool SetWire(
143  TVector3 extremity1,
144  TVector3 extremity2);
145  __attribute__((deprecated("Function SetPoint depracated, contact FairRoot group if you need it."))) bool SetPoint(
146  TVector3 pnt);
147  __attribute__((deprecated("Function PropagateToPCA depracated, use SetPCAPropagation."))) bool PropagateToPCA(
148  int pca);
149  __attribute__((deprecated("Function PropagateToPCA depracated, use SetPCAPropagation."))) bool PropagateToPCA(
150  int pca,
151  int dir);
152  // function to call the FindPCA alone to retrieve
153  // the PCA.
154  __attribute__((deprecated("Function ActualFindPCA depracated, use SetPCAPropagation."))) bool
155  ActualFindPCA(int pca, FairTrackParP* par, int dir);
156 
157  TVector3 GetPCAOnWire()
158  __attribute__((deprecated("Function GetPCAOnWire obsolete, contact FairRoot group if you need it.")))
159  {
160  return fvwi;
161  }
162  TVector3 GetPCAOnTrack()
163  __attribute__((deprecated("Function GetPCAOnTrack obsolete, contact FairRoot group if you need it.")))
164  {
165  return fvpf;
166  }
167  float GetLengthAtPCA()
168  __attribute__((deprecated("Function GetLengthAtPCA obsolete, contact FairRoot group if you need it.")))
169  {
170  return ftrklength;
171  }
172  float GetTimeAtPCA()
173  __attribute__((deprecated("Function GetTimeAtPCA obsolete, contact FairRoot group if you need it.")))
174  {
175  return ftrktime;
176  }
177 
178  __attribute__((
179  deprecated("Function PropagateToVirtualPlaneAtPCA questionable, contact FairRoot if you need it."))) bool
180  PropagateToVirtualPlaneAtPCA(int pca);
181  __attribute__((deprecated("Function BackTrackToVertex questionable, contact FairRoot if you need it."))) bool
182  BackTrackToVertex();
183  __attribute__((
184  deprecated("Function BackTrackToVirtualPlaneAtPCA questionable, contact FairRoot if you need it."))) bool
185  BackTrackToVirtualPlaneAtPCA(int pca);
186  /* ====== ====== ====== ====== ====== */
187 
188  void setBackProp() { fPropOption = "BPE"; }
189 
190  virtual bool SetPCAPropagation(int pca, int dir = 1, FairTrackParP* par = nullptr);
191 
192  virtual PCAOutputStruct FindPCA(int PCA,
193  int PDGCode,
194  TVector3 Point,
195  TVector3 Wire1,
196  TVector3 Wire2,
197  double MaxDistance);
198 
199  // transport matrix
200  void GetTransportMatrix(double trm[5][5]);
201 
202  void SetPrintErrors(bool printError = kTRUE) { fPrintErrors = printError; }
203 
204  private:
205  TGeant3* gMC3;
206  TString fPropOption;
207  float xlf[1]; // track length when PropagateToTrack is chosen
208  float ein[15]; // Input error matrix
209  int nepred; // Number of predictions
210  TDatabasePDG* fdbPDG;
211  float pli[6];
212  float x2[3];
213  float p2[3];
214  /* TVector3 Pos; */
215  /* TVector3 PosErr; */
216  /* TVector3 Mom; */
217  /* TArrayD *fErrorMat; */
218  Ertrio_t* afErtrio;
219  float x1[3];
220  float p1[3];
221  int GeantCode;
222  /* FairTrackParH *fTrkParH; */
223  /* FairTrackParP *fTrkParP; */
224  /* FairTrackPar *fTrkPar; */
225  int ProMode;
226  /* FairField *fField; */
227  float plo[12];
228  TString VName;
229  int VCopyNo;
230  bool VEnter;
231 
232  TVector3 fpoint, fwire1, fwire2;
233  int fPCA;
234  double fRad, fDi;
235  TVector3 fvpf, fvwi;
236  float ftrklength;
237  float ftrktime;
238  int flag;
239  FairGeaneApplication* fApp;
240  double trpmat[5][5];
241 
242  // if kFALSE --> do not print the ABORT messages
243  bool fPrintErrors;
244 
245  FairGeanePro(const FairGeanePro&);
246  FairGeanePro& operator=(const FairGeanePro&);
247 
248  ClassDef(FairGeanePro, 2);
249 };
250 
251 #endif
virtual PCAOutputStruct FindPCA(int PCA, int PDGCode, TVector3 Point, TVector3 Wire1, TVector3 Wire2, double MaxDistance)
TVector3 GetPCAOnTrack() __attribute__((deprecated("Function GetPCAOnTrack obsolete
int TVector3 TVector3 TVector3 double double TVector3 TVector3 double & Di
Definition: FairGeanePro.h:131
float GetTimeAtPCA() __attribute__((deprecated("Function GetTimeAtPCA obsolete
int TVector3 TVector3 TVector3 double double TVector3 & vpf
Definition: FairGeanePro.h:131
virtual bool SetDestinationLength(float length)
FairTrackParP * par
Definition: FairGeanePro.h:155
int TVector3 TVector3 TVector3 wire2
Definition: FairGeanePro.h:131
int TVector3 TVector3 wire1
Definition: FairGeanePro.h:131
void SetPrintErrors(bool printError=kTRUE)
Definition: FairGeanePro.h:202
TVector3 GetPCAOnWire() __attribute__((deprecated("Function GetPCAOnWire obsolete
virtual bool SetDestinationPlane(const TVector3 &v0, const TVector3 &v1, const TVector3 &v2)
virtual bool SetPCAPropagation(int pca, int dir=1, FairTrackParP *par=nullptr)
int TVector3 TVector3 TVector3 double double TVector3 TVector3 double float & trklength
Definition: FairGeanePro.h:131
virtual bool SetDestinationVolume(std::string volName, int copyNo, int option)
void Init(FairTrackPar *TParam)
__attribute__((deprecated("Function PropagateToPlane depracated, use SetDestinationPlane."))) bool PropagateToPlane(const TVector3 &v0
TVector3 contact FairRoot group if you need it return fvwi
Definition: FairGeanePro.h:160
int TVector3 TVector3 TVector3 double double TVector3 TVector3 & vwi
Definition: FairGeanePro.h:131
virtual bool SetOriginPlane(const TVector3 &v0, const TVector3 &v1)
int TVector3 point
Definition: FairGeanePro.h:131
TVector3 contact FairRoot group if you need it
Definition: FairGeanePro.h:164
void setBackProp()
Definition: FairGeanePro.h:188
void GetTransportMatrix(double trm[5][5])
float GetLengthAtPCA() __attribute__((deprecated("Function GetLengthAtPCA obsolete
int int option
Definition: FairGeanePro.h:78
TVector3 extremity2
Definition: FairGeanePro.h:144
const TVector3 & v1
Definition: FairGeanePro.h:73
virtual bool Propagate(FairTrackParH *TStart, FairTrackParH *TEnd, int PDG)
int TVector3 TVector3 TVector3 double maxdistance
Definition: FairGeanePro.h:131
virtual bool SetPropagateOnlyParameters()
int TVector3 TVector3 TVector3 double double & Rad
Definition: FairGeanePro.h:131
const TVector3 const TVector3 & v2
Definition: FairGeanePro.h:73