30 void SetRangeE(
const double emin,
const double emax,
const bool logscale);
32 void SetRangeB(
const double bmin,
const double bmax,
const bool logscale);
34 void SetRangeA(
const double amin,
const double amax,
const bool logscale);
38 void SetRangeY(
const double ymin,
const double ymax,
39 const bool logscale =
false);
46 void SetAngle(
const double angle) { m_angle = angle; }
48 void EnableExport(
const std::string& txtfile) { m_outfile = txtfile; }
63 void PlotVelocity(
const std::string& carriers,
const char xaxis);
65 void PlotDiffusion(
const std::string& carriers,
const char xaxis);
67 void PlotTownsend(
const std::string& carriers,
const char xaxis);
69 void PlotAttachment(
const std::string& carriers,
const char xaxis);
71 void PlotAlphaEta(
const std::string& carriers,
const char xaxis);
105 Plot(GetAxis(xaxis), Charge::Electron, Parameter::Townsend, same);
109 Plot(GetAxis(xaxis), Charge::Hole, Parameter::Townsend, same);
113 Plot(GetAxis(xaxis), Charge::Electron, Parameter::Attachment, same);
117 Plot(GetAxis(xaxis), Charge::Hole, Parameter::Attachment, same);
121 PlotLorentzAngle(GetAxis(xaxis), Charge::Electron, same);
125 void SetColours(
const std::vector<short>& cols) { m_colours = cols; }
127 void SetLabels(
const std::vector<std::string>& labels) { m_labels = labels; }
131 enum class Parameter {
136 LongitudinalDiffusion,
155 Medium* m_medium =
nullptr;
158 double m_eMin = 100., m_eMax = 100000.;
159 double m_bMin = 0., m_bMax = 2.;
160 double m_aMin = 0., m_aMax = Pi;
165 bool m_autoRangeX =
true;
166 Axis m_xaxis = Axis::None;
169 double m_yMin = 0., m_yMax = 1.;
171 bool m_autoRangeY =
true;
174 double m_efield = 1000.;
176 double m_bfield = 0.;
178 double m_angle = HalfPi;
180 std::vector<double> m_xPlot;
181 std::vector<std::vector<double> > m_yPlot;
182 std::vector<Parameter> m_par;
183 std::vector<Charge> m_q;
185 std::vector<std::vector<double> > m_xGraph;
186 std::vector<std::vector<double> > m_yGraph;
188 std::vector<short> m_colours;
189 std::vector<std::string> m_labels;
191 std::string m_outfile;
193 void PlotVelocity(
const Axis xaxis,
const Charge particle,
197 void Plot(
const Axis xaxis,
const Charge particle,
198 const Parameter par,
const bool same);
199 void PlotLorentzAngle(
const Axis xaxis,
const Charge particle,
203 void ResetX(
const Axis xaxis);
207 Axis GetAxis(
const char xaxis)
const;
208 bool GetGrid(std::array<std::vector<double>, 3>& grid,
209 int& ie,
int& ib,
int& ia,
const Axis xaxis)
const;
Abstract base class for media.
ViewBase()=delete
Default constructor.
void PlotHoleTownsend(const char xaxis='e', const bool same=false)
Plot the Townsend coefficient for holes.
void PlotElectronVelocity(const char xaxis='e', const bool same=false)
void SetRangeY(const double ymin, const double ymax, const bool logscale=false)
Set the range of the function (velocity etc.) to be plotted.
void SetAngle(const double angle)
Set the angle to use when plotting as function of E or B.
void SetRangeB(const double bmin, const double bmax, const bool logscale)
Set the limits of the magnetic field.
void PlotElectronTownsend(const char xaxis='e', const bool same=false)
Plot the Townsend coefficient for electrons.
void PlotAttachment(const std::string &carriers, const char xaxis)
Plot the attachment coefficient.
void PlotElectronAttachment(const char xaxis='e', const bool same=false)
Plot the attachment coefficient for electrons.
void SetLabels(const std::vector< std::string > &labels)
Set user-defined plot labels.
void SetMedium(Medium *m)
Set the medium from which to retrieve the transport coefficients.
void SetMagneticField(const double bfield)
Set the magnetic field to use when plotting as function of E or angle.
void PlotAlphaEta(const std::string &carriers, const char xaxis)
Plot Townsend and attachment coefficients.
void PlotElectronLorentzAngle(const char xaxis='e', const bool same=false)
Plot the angle between drift velocity and field.
void PlotIonDiffusion(const char xaxis='e', const bool same=false)
Plot the diffusion coefficients of ions in the gas.
void PlotHoleAttachment(const char xaxis='e', const bool same=false)
Plot the attachment coefficient for holes.
void PlotTownsend(const std::string &carriers, const char xaxis)
Plot the Townsend coefficient.
~ViewMedium()=default
Destructor.
void EnableExport(const std::string &txtfile)
void PlotHoleVelocity(const char xaxis='e', const bool same=false)
Plot the drift velocity components of holes in the medium.
void SetColours(const std::vector< short > &cols)
Set the (ROOT) colours to be used in the plots.
void PlotDiffusion(const std::string &carriers, const char xaxis)
Plot the transverse and longitudinal diffusion coefficients.
void PlotIonVelocity(const char xaxis='e', const bool same=false)
Plot the ion drift velocity in the gas.
void EnableAutoRangeY(const bool on=true)
Choose the y-axis range based on the function's minima/maxima.
void SetRangeE(const double emin, const double emax, const bool logscale)
Set the limits of the electric field.
void SetElectricField(const double efield)
Set the electric field to use when plotting as function of B or angle.
void PlotElectronDiffusion(const char xaxis='e', const bool same=false)
Plot the diffusion coefficients in the medium.
void PlotVelocity(const std::string &carriers, const char xaxis)
void SetRangeA(const double amin, const double amax, const bool logscale)
Set the limits of the angle between electric and magnetic field.
void EnableAutoRangeX(const bool on=true)
Try to choose the x-axis range based on the field grid.
void PlotHoleDiffusion(const char xaxis='e', const bool same=false)
Plot the diffusion coefficients of holes in the medium.