PandaRoot
PndPropagator.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  * PndPropagator.h
15  *
16  * Created: April 2021
17  * Author: Gaiser
18  */
19 
20 #ifndef PNDPROPAGATOR_H
21 #define PNDPROPAGATOR_H
22 
23 #include <Rtypes.h> // for THashConsistencyHolder, ClassDef
24 #include <RtypesCore.h> // for kTRUE
25 #include <iosfwd> // for string
26 #include <string> // for basic_string
27 
28 #include "TNamed.h" // for TNamed
29 #include "TString.h" // for TString
30 #include "TVector3.h" // for TVector3
31 
32 #include "FairLogger.h"
33 #include "FairField.h"
34 #include "FairTrackPar.h"
35 
36 namespace PndProp {
42  {
44  : PCAStatusFlag(1)
45  , Radius(0.)
46  , OnTrackPCA(TVector3(0., 0., 0.))
47  , OnWirePCA(TVector3(0., 0., 0.))
48  , Distance(0.)
49  , TrackLength(0.)
50  {}
52  Double_t Radius;
53  TVector3 OnTrackPCA;
54  TVector3 OnWirePCA;
55  Double_t Distance;
56  Float_t TrackLength;
57  };
58 }
59 
64 class PndPropagator : public TNamed
65 {
66  protected:
67  Int_t fPcaMode;
68  TVector3 fPoint;
69  TVector3 fWire1;
70  TVector3 fWire2;
72  TString fVolumeName;
73  Int_t fVolumeCopyNo;
74  Bool_t fVolumeEnter;
75 
76  TVector3 fInitialPosition;
77  TVector3 fInitialMomentum;
78  TVector3 fFinalPosition;
79  TVector3 fFinalMomentum;
80 
82 
83  public:
84  PndPropagator();
85  PndPropagator(const TString& name, const TString& title);
86 
87  virtual ~PndPropagator() {};
88 
89  virtual void Init(FairTrackPar* /* TParam */){};
90 
98  virtual Bool_t Propagate([[gnu::unused]] FairTrackPar* TStart,
99  [[gnu::unused]] FairTrackPar* TEnd,
100  [[gnu::unused]] Int_t PDG)
101  {
102  return kFALSE;
103  }
104 
114  virtual Bool_t Propagate([[gnu::unused]] Float_t* x1,
115  [[gnu::unused]] Float_t* p1,
116  [[gnu::unused]] Float_t* x2,
117  [[gnu::unused]] Float_t* p2,
118  [[gnu::unused]] Int_t PDG)
119  {
120  return kFALSE;
121  }
122 
135  virtual PndProp::PCAOutputStruct FindPCA([[gnu::unused]] Int_t PCA,
136  [[gnu::unused]] Int_t PDGCode,
137  [[gnu::unused]] TVector3 Point,
138  [[gnu::unused]] TVector3 Wire1,
139  [[gnu::unused]] TVector3 Wire2,
140  [[gnu::unused]] Double_t MaxDistance)
141  {
142  return PndProp::PCAOutputStruct();
143  }
144 
145  /* =========================================================================================================================================== */
146 
151  virtual Bool_t SetPropagateOnlyParameters() { return kFALSE; }
152 
163  virtual Bool_t SetPCAPropagation([[gnu::unused]] Int_t pca,
164  [[gnu::unused]] Int_t dir = 1,
165  [[gnu::unused]] FairTrackPar* par = nullptr)
166  {
167  return kTRUE;
168  }
169 
177  virtual Bool_t SetDestinationPlane([[gnu::unused]] const TVector3& v0,
178  [[gnu::unused]] const TVector3& v1,
179  [[gnu::unused]] const TVector3& v2)
180  {
181  return kFALSE;
182  }
183 
190  virtual Bool_t SetOriginPlane([[gnu::unused]] const TVector3& v0, [[gnu::unused]] const TVector3& v1)
191  {
192  return kFALSE;
193  }
194 
202  virtual Bool_t SetDestinationVolume(std::string volName,
203  Int_t copyNo,
204  Int_t option)
205  {
206  fVolumeName = volName;
207  fVolumeCopyNo = copyNo;
208  if (option == 1) fVolumeEnter = kTRUE;
209  else fVolumeEnter = kFALSE;
210  return kTRUE;
211  }
212 
218  virtual Bool_t SetDestinationLength(Float_t length)
219  {
220  fDestinationLength = length;
221  return kFALSE;
222  };
223 
229  virtual Bool_t SetDestinationPoint(const TVector3 point)
230  {
231  fPoint = point;
232  return kTRUE;
233  };
234 
240  virtual Bool_t SetDestinationWire(const TVector3 wire1, const TVector3 wire2)
241  {
242  fWire1 = wire1;
243  fWire2 = wire2;
244  return kTRUE;
245  };
246 
247  /* =========================================================================================================================================== */
248 
252  virtual PndProp::PCAOutputStruct GetPcaOutput() { return fPcaOutput; };
253 
257  virtual Float_t GetLengthAtPCA() { return fPcaOutput.TrackLength; };
258 
262  virtual Float_t GetDistAtPCA() { return fPcaOutput.Distance; };
263 
267  virtual TVector3 GetPCA() { return fPcaOutput.OnTrackPCA; };
268 
269  ClassDef(PndPropagator, 1);
270 };
271 
272 #endif //PNDPROPAGATOR_H
TVector3 fFinalPosition
final position
Definition: PndPropagator.h:78
Bool_t fVolumeEnter
true if enter volume
Definition: PndPropagator.h:74
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:81
TString fVolumeName
volume name
Definition: PndPropagator.h:72
virtual Bool_t SetPropagateOnlyParameters()
Method to set to propagate only parameters.
TVector3 fInitialPosition
initial position in cm
Definition: PndPropagator.h:76
virtual void Init(FairTrackPar *)
default destructor
Definition: PndPropagator.h:89
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:69
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:67
virtual ~PndPropagator()
Definition: PndPropagator.h:87
Float_t fDestinationLength
track length when PropagateToTrack is chosen
Definition: PndPropagator.h:71
TVector3 fPoint
point to which to calculate pca
Definition: PndPropagator.h:68
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:98
output of PCA finding algorithm
Definition: PndPropagator.h:41
TVector3 fInitialMomentum
initial momentum in GeV
Definition: PndPropagator.h:77
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:73
Propagator interface class for PandaRoot.
Definition: PndPropagator.h:64
virtual TVector3 GetPCA()
Get position of pca on track.
TVector3 fWire2
second anchor point of line to which to calculate pca
Definition: PndPropagator.h:70
virtual Bool_t SetDestinationWire(const TVector3 wire1, const TVector3 wire2)
Method to set wire to propagate to.
TVector3 fFinalMomentum
final momentum
Definition: PndPropagator.h:79