PandaRoot
PndPropagator.h
Go to the documentation of this file.
1 /*
2  * PndPropagator.h
3  *
4  * Created: April 2021
5  * Author: Gaiser
6  */
7 
8 #ifndef PNDPROPAGATOR_H
9 #define PNDPROPAGATOR_H
10 
11 #include <Rtypes.h> // for THashConsistencyHolder, ClassDef
12 #include <RtypesCore.h> // for kTRUE
13 #include <iosfwd> // for string
14 #include <string> // for basic_string
15 
16 #include "TNamed.h" // for TNamed
17 #include "TString.h" // for TString
18 #include "TVector3.h" // for TVector3
19 
20 #include "FairLogger.h"
21 #include "FairField.h"
22 #include "FairTrackPar.h"
23 
24 namespace PndProp {
30  {
32  : PCAStatusFlag(1)
33  , Radius(0.)
34  , OnTrackPCA(TVector3(0., 0., 0.))
35  , OnWirePCA(TVector3(0., 0., 0.))
36  , Distance(0.)
37  , TrackLength(0.)
38  {}
40  Double_t Radius;
41  TVector3 OnTrackPCA;
42  TVector3 OnWirePCA;
43  Double_t Distance;
44  Float_t TrackLength;
45  };
46 }
47 
52 class PndPropagator : public TNamed
53 {
54  protected:
55  Int_t fPcaMode;
56  TVector3 fPoint;
57  TVector3 fWire1;
58  TVector3 fWire2;
60  TString fVolumeName;
61  Int_t fVolumeCopyNo;
62  Bool_t fVolumeEnter;
63 
64  TVector3 fInitialPosition;
65  TVector3 fInitialMomentum;
66  TVector3 fFinalPosition;
67  TVector3 fFinalMomentum;
68 
70 
71  public:
72  PndPropagator();
73  PndPropagator(const TString& name, const TString& title);
74 
75  virtual ~PndPropagator() {};
76 
77  virtual void Init(FairTrackPar* /* TParam */){};
78 
86  virtual Bool_t Propagate([[gnu::unused]] FairTrackPar* TStart,
87  [[gnu::unused]] FairTrackPar* TEnd,
88  [[gnu::unused]] Int_t PDG)
89  {
90  return kFALSE;
91  }
92 
102  virtual Bool_t Propagate([[gnu::unused]] Float_t* x1,
103  [[gnu::unused]] Float_t* p1,
104  [[gnu::unused]] Float_t* x2,
105  [[gnu::unused]] Float_t* p2,
106  [[gnu::unused]] Int_t PDG)
107  {
108  return kFALSE;
109  }
110 
123  virtual PndProp::PCAOutputStruct FindPCA([[gnu::unused]] Int_t PCA,
124  [[gnu::unused]] Int_t PDGCode,
125  [[gnu::unused]] TVector3 Point,
126  [[gnu::unused]] TVector3 Wire1,
127  [[gnu::unused]] TVector3 Wire2,
128  [[gnu::unused]] Double_t MaxDistance)
129  {
130  return PndProp::PCAOutputStruct();
131  }
132 
133  /* =========================================================================================================================================== */
134 
139  virtual Bool_t SetPropagateOnlyParameters() { return kFALSE; }
140 
151  virtual Bool_t SetPCAPropagation([[gnu::unused]] Int_t pca,
152  [[gnu::unused]] Int_t dir = 1,
153  [[gnu::unused]] FairTrackPar* par = nullptr)
154  {
155  return kTRUE;
156  }
157 
165  virtual Bool_t SetDestinationPlane([[gnu::unused]] const TVector3& v0,
166  [[gnu::unused]] const TVector3& v1,
167  [[gnu::unused]] const TVector3& v2)
168  {
169  return kFALSE;
170  }
171 
178  virtual Bool_t SetOriginPlane([[gnu::unused]] const TVector3& v0, [[gnu::unused]] const TVector3& v1)
179  {
180  return kFALSE;
181  }
182 
190  virtual Bool_t SetDestinationVolume(std::string volName,
191  Int_t copyNo,
192  Int_t option)
193  {
194  fVolumeName = volName;
195  fVolumeCopyNo = copyNo;
196  if (option == 1) fVolumeEnter = kTRUE;
197  else fVolumeEnter = kFALSE;
198  return kTRUE;
199  }
200 
206  virtual Bool_t SetDestinationLength(Float_t length)
207  {
208  fDestinationLength = length;
209  return kFALSE;
210  };
211 
217  virtual Bool_t SetDestinationPoint(const TVector3 point)
218  {
219  fPoint = point;
220  return kTRUE;
221  };
222 
228  virtual Bool_t SetDestinationWire(const TVector3 wire1, const TVector3 wire2)
229  {
230  fWire1 = wire1;
231  fWire2 = wire2;
232  return kTRUE;
233  };
234 
235  /* =========================================================================================================================================== */
236 
240  virtual PndProp::PCAOutputStruct GetPcaOutput() { return fPcaOutput; };
241 
245  virtual Float_t GetLengthAtPCA() { return fPcaOutput.TrackLength; };
246 
250  virtual Float_t GetDistAtPCA() { return fPcaOutput.Distance; };
251 
255  virtual TVector3 GetPCA() { return fPcaOutput.OnTrackPCA; };
256 
257  ClassDef(PndPropagator, 1);
258 };
259 
260 #endif //PNDPROPAGATOR_H
TVector3 fFinalPosition
final position
Definition: PndPropagator.h:66
Bool_t fVolumeEnter
true if enter volume
Definition: PndPropagator.h:62
virtual Float_t GetLengthAtPCA()
virtual Bool_t SetDestinationPlane([[gnu::unused]] const TVector3 &v0, [[gnu::unused]] const TVector3 &v1, [[gnu::unused]] const TVector3 &v2)
Method to set the plane to propagate particles to.
virtual PndProp::PCAOutputStruct GetPcaOutput()
get PCAOutputStruct containing all relevant pca informations.
virtual Float_t GetDistAtPCA()
Get distance between point of closest approach and vertex.
PndProp::PCAOutputStruct fPcaOutput
Definition: PndPropagator.h:69
TString fVolumeName
volume name
Definition: PndPropagator.h:60
virtual Bool_t SetPropagateOnlyParameters()
Method to set to propagate only parameters.
TVector3 fInitialPosition
initial position in cm
Definition: PndPropagator.h:64
virtual void Init(FairTrackPar *)
default destructor
Definition: PndPropagator.h:77
virtual Bool_t SetOriginPlane([[gnu::unused]] const TVector3 &v0, [[gnu::unused]] const TVector3 &v1)
Method to set the plane to propagate particles from.
virtual Bool_t Propagate([[gnu::unused]] Float_t *x1, [[gnu::unused]] Float_t *p1, [[gnu::unused]] Float_t *x2, [[gnu::unused]] Float_t *p2, [[gnu::unused]] Int_t PDG)
Propagate track to point, wire, plane or volume.
virtual Bool_t SetDestinationLength(Float_t length)
Method to set the length to propagate particles to.
TVector3 fWire1
first anchor point of line to which to calculate pca
Definition: PndPropagator.h:57
virtual Bool_t SetPCAPropagation([[gnu::unused]] Int_t pca, [[gnu::unused]] Int_t dir=1, [[gnu::unused]] FairTrackPar *par=nullptr)
Set PCA propagation.
virtual Bool_t SetDestinationPoint(const TVector3 point)
Method to set the point to propagate particles to.
virtual PndProp::PCAOutputStruct FindPCA([[gnu::unused]] Int_t PCA, [[gnu::unused]] Int_t PDGCode, [[gnu::unused]] TVector3 Point, [[gnu::unused]] TVector3 Wire1, [[gnu::unused]] TVector3 Wire2, [[gnu::unused]] Double_t MaxDistance)
Find point of closest approach to point or wire.
Int_t fPcaMode
if 1: propagate to point, if 2: propagate to line, if 0: no pca
Definition: PndPropagator.h:55
virtual ~PndPropagator()
Definition: PndPropagator.h:75
Float_t fDestinationLength
track length when PropagateToTrack is chosen
Definition: PndPropagator.h:59
TVector3 fPoint
point to which to calculate pca
Definition: PndPropagator.h:56
virtual Bool_t Propagate([[gnu::unused]] FairTrackPar *TStart, [[gnu::unused]] FairTrackPar *TEnd, [[gnu::unused]] Int_t PDG)
Propagate track to point, wire, plane or volume.
Definition: PndPropagator.h:86
output of PCA finding algorithm
Definition: PndPropagator.h:29
TVector3 fInitialMomentum
initial momentum in GeV
Definition: PndPropagator.h:65
virtual Bool_t SetDestinationVolume(std::string volName, Int_t copyNo, Int_t option)
Method to set the volume to propagate particles to.
Int_t fVolumeCopyNo
volume copy number
Definition: PndPropagator.h:61
Propagator interface class for PandaRoot.
Definition: PndPropagator.h:52
virtual TVector3 GetPCA()
Get position of pca on track.
TVector3 fWire2
second anchor point of line to which to calculate pca
Definition: PndPropagator.h:58
virtual Bool_t SetDestinationWire(const TVector3 wire1, const TVector3 wire2)
Method to set wire to propagate to.
TVector3 fFinalMomentum
final momentum
Definition: PndPropagator.h:67