ATTPCROOT  0.3.0-alpha
A ROOT-based framework for analyzing data from active target detectors
AtRadialChargeModel.h
Go to the documentation of this file.
1 #ifndef ATRADIALCHARGEMODEL_H
2 #define ATRADIALCHARGEMODEL_H
3 
4 #include "AtSpaceChargeModel.h"
5 
6 #include <Rtypes.h> // for Double_t
7 
8 #include <functional>
9 class AtDigiPar;
10 
19 public:
20  using EFieldPtr = std::function<double(double rho, double z)>;
21 
22 private:
28  EFieldPtr GetEField{nullptr};
29 
30  Double_t fEFieldZ{700}; //< Magnitude of electric field in Z direction [V/cm]
31  Double_t fDriftVel{0.815}; //< Drift velocity of electron in gas [cm/us]
32  Double_t fMobilityElec{1.16429e-3}; //< Mobility of electron (calculated from drift velocity) [cm2/V/us]
33  Double_t fStepSize{1e-4}; //< Step size for solving differential equation [us]
34  XYZPoint fWindow{0, 0, 0}; //<Beam location at window in mm
35  XYZPoint fPadPlane{0, 0, 1000}; //<Beam location at pad plane in mm
36 
37 public:
39 
40  virtual XYZPoint CorrectSpaceCharge(const XYZPoint &directInputPosition) override;
41  virtual XYZPoint ApplySpaceCharge(const XYZPoint &reverseInputPosition) override;
42 
43  void SetDistortionField(EFieldPtr field) { GetEField = field; }
44  void SetStepSize(double setSize) { fStepSize = setSize; }
45  void SetEField(double field);
46  void SetDriftVelocity(double v);
47  void LoadParameters(const AtDigiPar *par) override;
48 
49 private:
50  XYZPoint SolveEqn(XYZPoint ele, bool correction);
51 };
52 
54 
55  double fLambda;
56 
57 public:
58  AtLineChargeZDep(double l) : fLambda(l) {}
59 
60  double operator()(double rho, double z)
61  {
62  constexpr double rBeam = 2.0 / 100; // in *m*
63  constexpr double eps = 8.85418782E-12; // SI
64  constexpr double pi = 3.14159265358979;
65  constexpr double eps2pi = 2 * pi * eps;
66  rho /= 100.; // Convert units from cm to m
67  z /= 100.; // Convert units from cm to m
68 
69  double field;
70  if (rho > rBeam)
71  field = fLambda / eps2pi / rho * (z / 1.); // v/m
72  else
73  // field = lambda / eps2pi / rBeam / rBeam * rho * (z/1.); // v/m
74  field = 0;
75  return field / 100.; // V/cm
76  }
77 };
78 #endif /* ATRADIALCHARGEMODEL_H */
AtRadialChargeModel::LoadParameters
void LoadParameters(const AtDigiPar *par) override
Load common parameters from AtDigiPar.
Definition: AtRadialChargeModel.cxx:110
AtRadialChargeModel::SetDistortionField
void SetDistortionField(EFieldPtr field)
Definition: AtRadialChargeModel.h:43
AtRadialChargeModel
Space charge model from arbitrary radial E-field,.
Definition: AtRadialChargeModel.h:18
AtRadialChargeModel::SetStepSize
void SetStepSize(double setSize)
Definition: AtRadialChargeModel.h:44
XYZPoint
ROOT::Math::XYZPoint XYZPoint
Definition: AtPatternCircle2D.h:18
AtSpaceChargeModel.h
AtRadialChargeModel::ApplySpaceCharge
virtual XYZPoint ApplySpaceCharge(const XYZPoint &reverseInputPosition) override
Using model add space charge effect.
Definition: AtRadialChargeModel.cxx:39
AtLineChargeZDep::operator()
double operator()(double rho, double z)
Definition: AtRadialChargeModel.h:60
AtRadialChargeModel::CorrectSpaceCharge
virtual XYZPoint CorrectSpaceCharge(const XYZPoint &directInputPosition) override
Using model correct for space charge.
Definition: AtRadialChargeModel.cxx:31
AtSpaceChargeModel
Definition: AtSpaceChargeModel.h:9
AtDigiPar
Definition: AtDigiPar.h:14
AtRadialChargeModel::SetEField
void SetEField(double field)
Definition: AtRadialChargeModel.cxx:120
AtRadialChargeModel::EFieldPtr
std::function< double(double rho, double z)> EFieldPtr
Definition: AtRadialChargeModel.h:20
AtLineChargeZDep
Definition: AtRadialChargeModel.h:53
AtLineChargeZDep::AtLineChargeZDep
AtLineChargeZDep(double l)
Definition: AtRadialChargeModel.h:58
AtRadialChargeModel::SetDriftVelocity
void SetDriftVelocity(double v)
Definition: AtRadialChargeModel.cxx:125
AtRadialChargeModel::AtRadialChargeModel
AtRadialChargeModel(EFieldPtr efield)
Definition: AtRadialChargeModel.cxx:29