PandaRoot
PndHelixPropagator.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  * PndHelixPropagator.h
15  *
16  * Created on: Sep 23, 2013
17  * Updated: April 2021
18  * Author: stockman, Gaiser
19  */
20 
21 #ifndef PNDHELIXPROPAGATOR_H_
22 #define PNDHELIXPROPAGATOR_H_
23 
24 #include <utility>
25 #include "TVector3.h"
26 #include "FairTrackPar.h"
27 #include "PndPropagator.h"
28 #include "FairLogger.h"
29 #include "FairField.h"
30 #include "FairLogger.h"
31 
37  protected:
38  Double_t fFieldStrength;
39  Double_t fCharge;
40  Bool_t fBackPropagate;
41 
42  Double_t fDeltaPhi;
43  FairField *fMagneticField;
44 
45  Double_t fA, fB, fC, fD;
46 
51  Double_t Radius()
52  {
53  return fInitialMomentum.Perp() / (fFieldStrength * 0.3) * 100;
54  }
55 
60  TVector3 FindCircleCenter();
61 
62  public:
64  PndHelixPropagator(const TString &name, const TString &title);
65  PndHelixPropagator(Double_t fieldStrength, TVector3 origin, TVector3 momentum, Double_t charge);
66  virtual ~PndHelixPropagator() {};
67 
74  Double_t FindDistanceToPCAXYProjection(FairTrackPar *TStart);
75 
83  Bool_t FindPCA(FairTrackPar* TStart);
84 
90  Bool_t FindPCAOnHelix();
91 
97  Bool_t FindPCAOnStraightLine();
98 
108  Bool_t Propagate(FairTrackPar* TStart, FairTrackPar* TEnd, Int_t charge);
109 
115  FairTrackPar PropagateToZ(Double_t zpos);
116 
122  FairTrackPar PropagateToXYPos(TVector2 xypos);
123 
129  FairTrackPar PropagateToS(Double_t arclength);
130 
136  FairTrackPar PropagateByAngle(Double_t step);
137 
148  Bool_t SetPCAPropagation(Int_t pca_mode = 1,
149  Int_t dir = 1,
150  [[gnu::unused]] FairTrackPar* par = nullptr)
151  {
152  if (dir >= 0) fBackPropagate = kFALSE;
153  else fBackPropagate = kTRUE;
154  if (pca_mode != 1) { // TODO: add other propagation modes -> propagation to wire, volume, and plane
155  LOG(info) << "PndHelixPropagator::SetPCAPropagation: only propagation to point implemented at the moment";
156  return kFALSE;
157  }
158  fPcaMode = pca_mode;
159  return kTRUE;
160  }
161 
169  Bool_t SetDestinationPlane([[gnu::unused]] const TVector3& v0,
170  [[gnu::unused]] const TVector3& v1,
171  [[gnu::unused]] const TVector3& v2)
172  {
173  LOG(info) << "PndHelixPropagator: Propagation to plane not implemented yet";
174  return kFALSE;
175  }
176 
183  Bool_t SetOriginPlane([[gnu::unused]] const TVector3& v0, [[gnu::unused]] const TVector3& v1)
184  {
185  LOG(info) << "PndHelixPropagator: Propagation from plane not implemented yet";
186  return kFALSE;
187  }
188 
196  Bool_t SetDestinationVolume([[gnu::unused]] std::string volName,
197  [[gnu::unused]] Int_t copyNo,
198  [[gnu::unused]] Int_t option)
199  {
200  LOG(info) << "PndHelixPropagator: Propagation to volume not implemented yet";
201  return kFALSE;
202  }
203 
209  Bool_t SetDestinationLength([[gnu::unused]] Float_t length)
210  {
211  LOG(info) << "PndHelixPropagator: Propagation to given track length not implemented yet";
212  return kFALSE;
213  };
214 
219  void Init(FairTrackPar* TStart);
220 
225  void SetFieldStrength(Double_t field_strength) { fFieldStrength = field_strength; };
226 
231  void SetMagneticField(FairField *field) { fMagneticField = field; };
232 
236  Double_t GetDeltaPhi() { return fDeltaPhi; };
237 
241  TVector3 GetPoint() { return fPoint; };
242 
246  Int_t GetPcaMode() { return fPcaMode; };
247 
249 };
250 
251 #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:67
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:68
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:77
Bool_t fBackPropagate
kTRUE if backward propagation
Propagator interface class for PandaRoot.
Definition: PndPropagator.h:64
TVector3 FindCircleCenter()
Find position of track circle center.
Double_t GetDeltaPhi()
Get difference in phi between initial and final vector.