1#ifndef G_COMPONENT_PP_H
2#define G_COMPONENT_PP_H
28 void Setup(
double g,
double b,
double eps,
double v,
double sigma = 0.);
30 void ElectricField(
const double x,
const double y,
const double z,
double& ex,
31 double& ey,
double& ez,
Medium*& m,
int& status)
override;
32 void ElectricField(
const double x,
const double y,
const double z,
double& ex,
33 double& ey,
double& ez,
double& v,
Medium*& m,
34 int& status)
override;
36 void WeightingField(
const double x,
const double y,
const double z,
37 double& wx,
double& wy,
double& wz,
38 const std::string& label)
override;
41 const std::string& label)
override;
44 const double z,
const double t,
45 const std::string& label)
override;
48 const double t,
double& wx,
double& wy,
double& wz,
49 const std::string& label)
override;
59 void AddPixel(
double x,
double y,
double lx,
double ly,
60 const std::string& label);
62 void AddStrip(
double x,
double lx,
const std::string& label);
66 void AddPlane(
const std::string& label,
bool anode =
true);
74 const double xmax,
const double xsteps,
75 const double ymin,
const double ymax,
76 const double ysteps,
const double zmin,
77 const double zmax,
const double zsteps,
78 const double tmin,
const double tmax,
84 const double xsteps,
const double ymin,
85 const double ymax,
const double ysteps,
86 const double zmin,
const double zmax,
87 const double zsteps,
const double tmin,
88 const double tmax,
const double tsteps);
90 Medium*
GetMedium(
const double x,
const double y,
const double z)
override;
93 double& xmax,
double& ymax,
double& zmax)
override;
95 static constexpr double m_precision = 1.e-30;
102 static constexpr double m_Vw = 1.;
104 double m_eps0 = 8.85418782e-3;
114 Medium* m_medium =
nullptr;
119 int ind = structureelectrode::NotSet;
124 bool m_usegrid =
false;
125 std::vector<std::vector<std::vector<double>>> gridPromptV;
126 std::vector<std::vector<std::vector<std::vector<double>>>> gridDelayedV;
128 double gridXSteps = 0;
129 double gridYSteps = 0;
130 double gridZSteps = 0;
131 double gridTSteps = 0;
138 double gridXStepSize = 0;
139 double gridYStepSize = 0;
140 double gridZStepSize = 0;
141 double gridTStepSize = 0;
144 enum fieldcomponent { xcomp = 0, ycomp, zcomp };
147 enum structureelectrode { NotSet = -1, Plane, Strip, Pixel };
150 std::vector<std::string> m_readout;
151 std::vector<Electrode> m_readout_p;
154 double IntegrateField(
const Electrode& el,
int comp,
const double x,
155 const double y,
const double z);
157 double IntegrateDelayedField(
const Electrode& el,
int comp,
const double x,
158 const double y,
const double z,
const double t);
160 double IntegratePromptPotential(
const Electrode& el,
const double x,
161 const double y,
const double z);
162 double IntegrateDelayedPotential(
const Electrode& el,
const double x,
163 const double y,
const double z,
166 void CalculateDynamicalWeightingPotential(
const Electrode& el);
168 double FindWeightingPotentialInGrid(
const Electrode& el,
const double x,
169 const double y,
const double z);
171 double FindDelayedWeightingPotentialInGrid(
const Electrode& el,
172 const double x,
const double y,
173 const double z,
const double t);
175 double FindWeightFactor(
const Electrode& el,
const double dx,
const double dy,
178 double FindWeightFactor(
const Electrode& el,
const double dx,
const double dy,
179 const double dz,
const double dt);
181 void UpdatePeriodicity()
override;
182 void Reset()
override;
Component for parallel-plate geometries.
void Setup(double g, double b, double eps, double v, double sigma=0.)
void DelayedWeightingField(const double x, const double y, const double z, const double t, double &wx, double &wy, double &wz, const std::string &label) override
ComponentParallelPlate()
Constructor.
double WeightingPotential(const double x, const double y, const double z, const std::string &label) override
~ComponentParallelPlate()
Destructor.
void AddStrip(double x, double lx, const std::string &label)
Add strip electrode.
double DelayedWeightingPotential(const double x, const double y, const double z, const double t, const std::string &label) override
void SetMedium(Medium *medium)
void WeightingField(const double x, const double y, const double z, double &wx, double &wy, double &wz, const std::string &label) override
void ElectricField(const double x, const double y, const double z, double &ex, double &ey, double &ez, Medium *&m, int &status) override
void AddPlane(const std::string &label, bool anode=true)
void SetWeightingPotentialGrid(const std::string &label, const double xmin, const double xmax, const double xsteps, const double ymin, const double ymax, const double ysteps, const double zmin, const double zmax, const double zsteps, const double tmin, const double tmax, const double tsteps)
Medium * GetMedium(const double x, const double y, const double z) override
Get the medium at a given location (x, y, z).
void SetWeightingPotentialGrids(const double xmin, const double xmax, const double xsteps, const double ymin, const double ymax, const double ysteps, const double zmin, const double zmax, const double zsteps, const double tmin, const double tmax, const double tsteps)
bool GetVoltageRange(double &vmin, double &vmax) override
Calculate the voltage range [V].
bool GetBoundingBox(double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) override
Get the bounding box coordinates.
void AddPixel(double x, double y, double lx, double ly, const std::string &label)
Abstract base class for components.
Abstract base class for media.