PandaRoot
PndHelixPropagator.h
Go to the documentation of this file.
1 /*
2  * PndHelixPropagator.h
3  *
4  * Created on: Sep 23, 2013
5  * Updated: April 2021
6  * Author: stockman, Gaiser
7  */
8 
9 #ifndef PNDHELIXPROPAGATOR_H_
10 #define PNDHELIXPROPAGATOR_H_
11 
12 #include <utility>
13 #include "TVector3.h"
14 #include "FairTrackPar.h"
15 #include "PndPropagator.h"
16 #include "FairLogger.h"
17 #include "FairField.h"
18 #include "FairLogger.h"
19 
25  protected:
26  Double_t fFieldStrength;
27  Double_t fCharge;
28  Bool_t fBackPropagate;
29 
30  Double_t fDeltaPhi;
31  FairField *fMagneticField;
32 
33  Double_t fA, fB, fC, fD;
34 
39  Double_t Radius()
40  {
41  return fInitialMomentum.Perp() / (fFieldStrength * 0.3) * 100;
42  }
43 
48  TVector3 FindCircleCenter();
49 
50  public:
52  PndHelixPropagator(const TString &name, const TString &title);
53  PndHelixPropagator(Double_t fieldStrength, TVector3 origin, TVector3 momentum, Double_t charge);
54  virtual ~PndHelixPropagator() {};
55 
62  Double_t FindDistanceToPCAXYProjection(FairTrackPar *TStart);
63 
71  Bool_t FindPCA(FairTrackPar* TStart);
72 
78  Bool_t FindPCAOnHelix();
79 
85  Bool_t FindPCAOnStraightLine();
86 
96  Bool_t Propagate(FairTrackPar* TStart, FairTrackPar* TEnd, Int_t charge);
97 
103  FairTrackPar PropagateToZ(Double_t zpos);
104 
110  FairTrackPar PropagateToXYPos(TVector2 xypos);
111 
117  FairTrackPar PropagateToS(Double_t arclength);
118 
124  FairTrackPar PropagateByAngle(Double_t step);
125 
136  Bool_t SetPCAPropagation(Int_t pca_mode = 1,
137  Int_t dir = 1,
138  [[gnu::unused]] FairTrackPar* par = nullptr)
139  {
140  if (dir >= 0) fBackPropagate = kFALSE;
141  else fBackPropagate = kTRUE;
142  if (pca_mode != 1) { // TODO: add other propagation modes -> propagation to wire, volume, and plane
143  LOG(info) << "PndHelixPropagator::SetPCAPropagation: only propagation to point implemented at the moment";
144  return kFALSE;
145  }
146  fPcaMode = pca_mode;
147  return kTRUE;
148  }
149 
157  Bool_t SetDestinationPlane([[gnu::unused]] const TVector3& v0,
158  [[gnu::unused]] const TVector3& v1,
159  [[gnu::unused]] const TVector3& v2)
160  {
161  LOG(info) << "PndHelixPropagator: Propagation to plane not implemented yet";
162  return kFALSE;
163  }
164 
171  Bool_t SetOriginPlane([[gnu::unused]] const TVector3& v0, [[gnu::unused]] const TVector3& v1)
172  {
173  LOG(info) << "PndHelixPropagator: Propagation from plane not implemented yet";
174  return kFALSE;
175  }
176 
184  Bool_t SetDestinationVolume([[gnu::unused]] std::string volName,
185  [[gnu::unused]] Int_t copyNo,
186  [[gnu::unused]] Int_t option)
187  {
188  LOG(info) << "PndHelixPropagator: Propagation to volume not implemented yet";
189  return kFALSE;
190  }
191 
197  Bool_t SetDestinationLength([[gnu::unused]] Float_t length)
198  {
199  LOG(info) << "PndHelixPropagator: Propagation to given track length not implemented yet";
200  return kFALSE;
201  };
202 
207  void Init(FairTrackPar* TStart);
208 
213  void SetFieldStrength(Double_t field_strength) { fFieldStrength = field_strength; };
214 
219  void SetMagneticField(FairField *field) { fMagneticField = field; };
220 
224  Double_t GetDeltaPhi() { return fDeltaPhi; };
225 
229  TVector3 GetPoint() { return fPoint; };
230 
234  Int_t GetPcaMode() { return fPcaMode; };
235 
237 };
238 
239 #endif /* PNDHELIXPROPAGATOR_H_ */
Double_t FindDistanceToPCAXYProjection(FairTrackPar *TStart)
default destructor
Bool_t SetOriginPlane([[gnu::unused]] const TVector3 &v0, [[gnu::unused]] const TVector3 &v1)
Method to set the plane to propagate particles from.
Bool_t SetDestinationVolume([[gnu::unused]] std::string volName, [[gnu::unused]] Int_t copyNo, [[gnu::unused]] Int_t option)
Method to set the volume to propagate particles to.
TVector3 GetPoint()
Get point to which to propagate.
ClassDef(PndPropagator, 1)
Double_t fCharge
sign of charge
Double_t fDeltaPhi
propagated angle
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.
Helix propagator for PandaRoot.
FairTrackPar PropagateByAngle(Double_t step)
Calculate position and momentum at requested.
void SetFieldStrength(Double_t field_strength)
Set field strength in z-Direction.
FairTrackPar PropagateToS(Double_t arclength)
Calculate position and momentum at requested arc length.
PndHelixPropagator()
default constructor
Bool_t SetDestinationLength([[gnu::unused]] Float_t length)
Method to set the length to propagate particles to.
FairTrackPar PropagateToZ(Double_t zpos)
Calculate position and momentum at requested z-Value.
Bool_t SetPCAPropagation(Int_t pca_mode=1, Int_t dir=1, [[gnu::unused]] FairTrackPar *par=nullptr)
Set PCA propagation.
FairField * fMagneticField
magnetic field in detector
Bool_t FindPCAOnStraightLine()
Find point of closest approach on straight track.
Int_t GetPcaMode()
Get propagation mode.
Int_t fPcaMode
if 1: propagate to point, if 2: propagate to line, if 0: no pca
Definition: PndPropagator.h:55
void SetMagneticField(FairField *field)
Set magnetic field in detector.
void Init(FairTrackPar *TStart)
Set initial position and momentum from track parameters.
TVector3 fPoint
point to which to calculate pca
Definition: PndPropagator.h:56
FairTrackPar PropagateToXYPos(TVector2 xypos)
Propagate to closest distance to given xy position.
Double_t fFieldStrength
magentic field strength in z-Direction in Tesla
Bool_t FindPCAOnHelix()
Find point of closest approach on helix track.
Bool_t FindPCA(FairTrackPar *TStart)
Find point of closest approach on track.
Bool_t Propagate(FairTrackPar *TStart, FairTrackPar *TEnd, Int_t charge)
Function to propagate track to point of closest approach.
Double_t Radius()
Calculate radius of track circle of charged particle.
TVector3 fInitialMomentum
initial momentum in GeV
Definition: PndPropagator.h:65
Bool_t fBackPropagate
kTRUE if backward propagation
Propagator interface class for PandaRoot.
Definition: PndPropagator.h:52
TVector3 FindCircleCenter()
Find position of track circle center.
Double_t GetDeltaPhi()
Get difference in phi between initial and final vector.