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 
63  Bool_t FindPCA(FairTrackPar* TStart);
64 
70  Bool_t FindPCAOnHelix();
71 
77  Bool_t FindPCAOnStraightLine();
78 
88  Bool_t Propagate(FairTrackPar* TStart, FairTrackPar* TEnd, Int_t charge);
89 
95  FairTrackPar PropagateToZ(Double_t zpos);
96 
102  FairTrackPar PropagateToXYPos(TVector2 xypos);
103 
109  FairTrackPar PropagateToS(Double_t arclength);
110 
116  FairTrackPar PropagateByAngle(Double_t step);
117 
128  Bool_t SetPCAPropagation(Int_t pca_mode = 1,
129  Int_t dir = 1,
130  [[gnu::unused]] FairTrackPar* par = nullptr)
131  {
132  if (dir >= 0) fBackPropagate = kFALSE;
133  else fBackPropagate = kTRUE;
134  if (pca_mode != 1) { // TODO: add other propagation modes -> propagation to wire, volume, and plane
135  LOG(info) << "PndHelixPropagator::SetPCAPropagation: only propagation to point implemented at the moment";
136  return kFALSE;
137  }
138  fPcaMode = pca_mode;
139  return kTRUE;
140  }
141 
149  Bool_t SetDestinationPlane([[gnu::unused]] const TVector3& v0,
150  [[gnu::unused]] const TVector3& v1,
151  [[gnu::unused]] const TVector3& v2)
152  {
153  LOG(info) << "PndHelixPropagator: Propagation to plane not implemented yet";
154  return kFALSE;
155  }
156 
163  Bool_t SetOriginPlane([[gnu::unused]] const TVector3& v0, [[gnu::unused]] const TVector3& v1)
164  {
165  LOG(info) << "PndHelixPropagator: Propagation from plane not implemented yet";
166  return kFALSE;
167  }
168 
176  Bool_t SetDestinationVolume([[gnu::unused]] std::string volName,
177  [[gnu::unused]] Int_t copyNo,
178  [[gnu::unused]] Int_t option)
179  {
180  LOG(info) << "PndHelixPropagator: Propagation to volume not implemented yet";
181  return kFALSE;
182  }
183 
189  Bool_t SetDestinationLength([[gnu::unused]] Float_t length)
190  {
191  LOG(info) << "PndHelixPropagator: Propagation to given track length not implemented yet";
192  return kFALSE;
193  };
194 
199  void Init(FairTrackPar* TStart);
200 
205  void SetFieldStrength(Double_t field_strength) { fFieldStrength = field_strength; };
206 
211  void SetMagneticField(FairField *field) { fMagneticField = field; };
212 
216  Double_t GetDeltaPhi() { return fDeltaPhi; };
217 
221  TVector3 GetPoint() { return fPoint; };
222 
226  Int_t GetPcaMode() { return fPcaMode; };
227 
229 };
230 
231 #endif /* PNDHELIXPROPAGATOR_H_ */
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)
default destructor
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.