Garfield++ v2r0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
Garfield::ViewField Class Reference

Visualize the potential or electric field of a component or sensor. More...

#include <ViewField.hh>

Public Member Functions

 ViewField ()
 Constructor.
 
 ~ViewField ()
 Destructor.
 
void SetSensor (Sensor *s)
 Set the sensor from which to retrieve the field.
 
void SetComponent (ComponentBase *c)
 Set the component from which to retrieve the field.
 
void SetCanvas (TCanvas *c)
 Set the canvas to be painted on.
 
void SetVoltageRange (const double vmin, const double vmax)
 Set the plot limits for the potential.
 
void SetElectricFieldRange (const double emin, const double emax)
 Set the plot limits for the electric field.
 
void SetWeightingFieldRange (const double wmin, const double wmax)
 Set the plot limits for the weighting field.
 
void SetArea (const double xmin, const double ymin, const double xmax, const double ymax)
 Set the viewing area (in local coordinates of the current viewing plane).
 
void SetArea ()
 Set the viewing area based on the bounding box of the sensor/component.
 
void SetPlane (const double fx, const double fy, const double fz, const double x0, const double y0, const double z0)
 
void SetDefaultProjection ()
 Set the default viewing plane ( $x$- $y$ at $z = 0$).
 
void Rotate (const double angle)
 Rotate the viewing plane (angle in radian).
 
void SetNumberOfContours (const unsigned int n)
 Set the number of contour levels (at most 50).
 
void SetNumberOfSamples1d (const unsigned int n)
 Set the number of points used for drawing 1D functions.
 
void SetNumberOfSamples2d (const unsigned int nx, const unsigned int ny)
 Set the number of points used for drawing 2D functions.
 
void PlotContour (const std::string &option="v")
 
void PlotSurface (const std::string &option="v")
 
void Plot (const std::string &option="v", const std::string &drawopt="arr")
 
void PlotProfile (const double x0, const double y0, const double z0, const double x1, const double y1, const double z1, const std::string &option="v")
 
void PlotContourWeightingField (const std::string &label, const std::string &option)
 
void PlotSurfaceWeightingField (const std::string &label, const std::string &option)
 
void PlotWeightingField (const std::string &label, const std::string &option, const std::string &drawopt)
 
void PlotProfileWeightingField (const std::string &label, const double x0, const double y0, const double z0, const double x1, const double y1, const double z1, const std::string &option="v")
 
void EnableAutoRange (const bool on=true)
 
void EnableAcknowledgeStatus (const double v0=0.)
 
void DisableAcknowledgeStatus ()
 Ignore the status flag returned by the sensor/component.
 
void EnableDebugging (const bool on=true)
 Switch on/off debugging output.
 

Protected Member Functions

double Evaluate2D (double *pos, double *par)
 
double EvaluateProfile (double *pos, double *par)
 

Friends

class TF1
 
class TF2
 

Detailed Description

Visualize the potential or electric field of a component or sensor.

Definition at line 15 of file ViewField.hh.

Constructor & Destructor Documentation

◆ ViewField()

Garfield::ViewField::ViewField ( )

Constructor.

Definition at line 52 of file ViewField.cc.

53 : m_className("ViewField"),
54 m_debug(false),
55 m_useAutoRange(true),
56 m_useStatus(false),
57 m_vBkg(0.),
58 m_sensor(NULL),
59 m_component(NULL),
60 m_hasUserArea(false),
61 m_xmin(-1.),
62 m_ymin(-1.),
63 m_xmax(1.),
64 m_ymax(1.),
65 m_vmin(0.),
66 m_vmax(100.),
67 m_emin(0.),
68 m_emax(10000.),
69 m_wmin(0.),
70 m_wmax(100.),
71 m_nContours(m_nMaxContours),
72 m_nSamples1d(1000),
73 m_nSamples2dX(200),
74 m_nSamples2dY(200),
75 m_electrode(""),
76 m_canvas(NULL),
77 m_hasExternalCanvas(false),
78 m_f2d(NULL),
79 m_f2dW(NULL),
80 m_fProfile(NULL),
81 m_fProfileW(NULL) {
82
85}
void SetDefaultProjection()
Set the default viewing plane ( - at ).
Definition: ViewField.cc:291
PlottingEngineRoot plottingEngine

◆ ~ViewField()

Garfield::ViewField::~ViewField ( )

Destructor.

Definition at line 87 of file ViewField.cc.

87 {
88
89 if (!m_hasExternalCanvas && m_canvas) delete m_canvas;
90 if (m_f2d) delete m_f2d;
91 if (m_f2dW) delete m_f2dW;
92 if (m_fProfile) delete m_fProfile;
93 if (m_fProfileW) delete m_fProfileW;
94}

Member Function Documentation

◆ DisableAcknowledgeStatus()

void Garfield::ViewField::DisableAcknowledgeStatus ( )
inline

Ignore the status flag returned by the sensor/component.

Definition at line 133 of file ViewField.hh.

133{ m_useStatus = false; }

◆ EnableAcknowledgeStatus()

void Garfield::ViewField::EnableAcknowledgeStatus ( const double  v0 = 0.)
inline

Make use of the status flag returned by the sensor/component.

Parameters
v0Value to be used for regions with status != 0.

Definition at line 128 of file ViewField.hh.

128 {
129 m_useStatus = true;
130 m_vBkg = v0;
131 }

◆ EnableAutoRange()

void Garfield::ViewField::EnableAutoRange ( const bool  on = true)
inline

Definition at line 123 of file ViewField.hh.

123{ m_useAutoRange = on; }

◆ EnableDebugging()

void Garfield::ViewField::EnableDebugging ( const bool  on = true)
inline

Switch on/off debugging output.

Definition at line 136 of file ViewField.hh.

136{ m_debug = on; }

◆ Evaluate2D()

double Garfield::ViewField::Evaluate2D ( double *  pos,
double *  par 
)
protected

Definition at line 314 of file ViewField.cc.

314 {
315
316 if (!m_sensor && !m_component) return 0.;
317
318 // Transform to global coordinates.
319 const double u = pos[0];
320 const double v = pos[1];
321 const double x = m_project[0][0] * u + m_project[1][0] * v + m_project[2][0];
322 const double y = m_project[0][1] * u + m_project[1][1] * v + m_project[2][1];
323 const double z = m_project[0][2] * u + m_project[1][2] * v + m_project[2][2];
324
325 // Determine which quantity to plot.
326 const PlotType plotType = static_cast<PlotType>(int(fabs(par[0]) / 10.));
327
328 // Compute the field.
329 double ex = 0., ey = 0., ez = 0., volt = 0.;
330 int status = 0;
331 if (par[0] > 0.) {
332 // "Drift" electric field.
333 Medium* medium = NULL;
334 if (!m_sensor) {
335 m_component->ElectricField(x, y, z, ex, ey, ez, volt, medium, status);
336 } else {
337 m_sensor->ElectricField(x, y, z, ex, ey, ez, volt, medium, status);
338 }
339 } else {
340 // Weighting field.
341 if (!m_sensor) {
342 if (plotType == Potential) {
343 volt = m_component->WeightingPotential(x, y, z, m_electrode);
344 } else {
345 m_component->WeightingField(x, y, z, ex, ey, ez, m_electrode);
346 }
347 } else {
348 if (plotType == Potential) {
349 volt = m_sensor->WeightingPotential(x, y, z, m_electrode);
350 } else {
351 m_sensor->WeightingField(x, y, z, ex, ey, ez, m_electrode);
352 }
353 }
354 }
355
356 if (m_debug) {
357 std::cout << m_className << "::Evaluate2D:\n"
358 << " At (u, v) = (" << u << ", " << v << "), "
359 << " (x,y,z) = (" << x << "," << y << "," << z << ")\n"
360 << " E = " << ex << ", " << ey << ", " << ez
361 << "), V = " << volt << ", status = " << status << "\n";
362 }
363 if (m_useStatus && status != 0) return m_vBkg;
364
365 switch (plotType) {
366 case Potential:
367 return volt;
368 break;
369 case Magnitude:
370 return sqrt(ex * ex + ey * ey + ez * ez);
371 break;
372 case Ex:
373 return ex;
374 break;
375 case Ey:
376 return ey;
377 break;
378 case Ez:
379 return ez;
380 break;
381 default:
382 break;
383 }
384 return volt;
385}
virtual void ElectricField(const double x, const double y, const double z, double &ex, double &ey, double &ez, Medium *&m, int &status)=0
virtual double WeightingPotential(const double x, const double y, const double z, const std::string &label)
virtual void WeightingField(const double x, const double y, const double z, double &wx, double &wy, double &wz, const std::string &label)
void WeightingField(const double x, const double y, const double z, double &wx, double &wy, double &wz, const std::string &label)
Get the weighting field at (x, y, z).
Definition: Sensor.cc:117
void ElectricField(const double x, const double y, const double z, double &ex, double &ey, double &ez, double &v, Medium *&medium, int &status)
Get the drift field and potential at (x, y, z).
Definition: Sensor.cc:48
double WeightingPotential(const double x, const double y, const double z, const std::string &label)
Get the weighting potential at (x, y, z).
Definition: Sensor.cc:136
DoubleAc fabs(const DoubleAc &f)
Definition: DoubleAc.h:615
DoubleAc sqrt(const DoubleAc &f)
Definition: DoubleAc.cpp:314

◆ EvaluateProfile()

double Garfield::ViewField::EvaluateProfile ( double *  pos,
double *  par 
)
protected

Definition at line 387 of file ViewField.cc.

387 {
388
389 if (!m_sensor && !m_component) return 0.;
390
391 // Get the start and end position.
392 const double x0 = par[0];
393 const double y0 = par[1];
394 const double z0 = par[2];
395 const double x1 = par[3];
396 const double y1 = par[4];
397 const double z1 = par[5];
398 // Compute the direction.
399 const double dx = x1 - x0;
400 const double dy = y1 - y0;
401 const double dz = z1 - z0;
402 // Get the position.
403 const double t = pos[0];
404 const double x = x0 + t * dx;
405 const double y = y0 + t * dy;
406 const double z = z0 + t * dz;
407 // Determine which quantity to plot.
408 const PlotType plotType = static_cast<PlotType>(int(fabs(par[6]) / 10.));
409
410 // Compute the field.
411 double ex = 0., ey = 0., ez = 0., volt = 0.;
412 int status = 0;
413 if (par[6] > 0.) {
414 Medium* medium = NULL;
415 // "Drift" electric field.
416 if (!m_sensor) {
417 m_component->ElectricField(x, y, z, ex, ey, ez, volt, medium, status);
418 } else {
419 m_sensor->ElectricField(x, y, z, ex, ey, ez, volt, medium, status);
420 }
421 } else {
422 // Weighting field.
423 if (!m_sensor) {
424 if (plotType == Potential) {
425 volt = m_component->WeightingPotential(x, y, z, m_electrode);
426 } else {
427 m_component->WeightingField(x, y, z, ex, ey, ez, m_electrode);
428 }
429 } else {
430 if (plotType == Potential) {
431 volt = m_sensor->WeightingPotential(x, y, z, m_electrode);
432 } else {
433 m_sensor->WeightingField(x, y, z, ex, ey, ez, m_electrode);
434 }
435 }
436 }
437 if (m_useStatus && status != 0) volt = m_vBkg;
438
439 switch (plotType) {
440 case Potential:
441 return volt;
442 break;
443 case Magnitude:
444 return sqrt(ex * ex + ey * ey + ez * ez);
445 break;
446 case Ex:
447 return ex;
448 break;
449 case Ey:
450 return ey;
451 break;
452 case Ez:
453 return ez;
454 break;
455 default:
456 break;
457 }
458 return volt;
459}

◆ Plot()

void Garfield::ViewField::Plot ( const std::string &  option = "v",
const std::string &  drawopt = "arr" 
)

Make a 2D plot of the electric potential or field.

Parameters
optionquantity to be plotted (see PlotContour)
drawoptoption string passed to TF2::Draw

Definition at line 222 of file ViewField.cc.

222 {
223
224 SetupCanvas();
225 if (!SetupFunction(option, m_f2d, false, false)) return;
226 m_f2d->Draw(drawopt.c_str());
227 gPad->SetRightMargin(0.15);
228 gPad->Update();
229}

Referenced by PlotSurface().

◆ PlotContour()

void Garfield::ViewField::PlotContour ( const std::string &  option = "v")

Make a contour plot of the electric potential or field.

Parameters
optionquantity to be plotted
  • potential: "v", "voltage", "p", "potential"
  • magnitude of the electric field: "e", "field"
  • x-component of the electric field: "ex"
  • y-component of the electric field: "ey"
  • z-component of the electric field: "ez"

Definition at line 213 of file ViewField.cc.

213 {
214
215 SetupCanvas();
216 if (!SetupFunction(option, m_f2d, true, false)) return;
217 m_f2d->Draw("CONT4Z");
218 gPad->SetRightMargin(0.15);
219 gPad->Update();
220}

◆ PlotContourWeightingField()

void Garfield::ViewField::PlotContourWeightingField ( const std::string &  label,
const std::string &  option 
)

Make a contour plot of the weighting potential or field.

Parameters
labelidentifier of the electrode
optionquantity to be plotted (see PlotContour)

Definition at line 254 of file ViewField.cc.

255 {
256
257 m_electrode = label;
258 SetupCanvas();
259 if (!SetupFunction(option, m_f2dW, true, true)) return;
260 m_f2dW->Draw("CONT4Z");
261 gPad->SetRightMargin(0.15);
262 gPad->Update();
263}

◆ PlotProfile()

void Garfield::ViewField::PlotProfile ( const double  x0,
const double  y0,
const double  z0,
const double  x1,
const double  y1,
const double  z1,
const std::string &  option = "v" 
)

Make a 1D plot of the electric potential or field along a line.

Parameters
x0,y0,z0starting point
x1,y1,z1end point
quantityto be plotted (see PlotContour)

Definition at line 231 of file ViewField.cc.

233 {
234
235
236 SetupCanvas();
237 if (!SetupProfile(x0, y0, z0, x1, y1, z1, option, m_fProfile, false)) return;
238 m_fProfile->Draw();
239 gPad->Update();
240}

◆ PlotProfileWeightingField()

void Garfield::ViewField::PlotProfileWeightingField ( const std::string &  label,
const double  x0,
const double  y0,
const double  z0,
const double  x1,
const double  y1,
const double  z1,
const std::string &  option = "v" 
)

Make a 1D plot of the weighting potential or field along a line.

Parameters
labelidentifier of the electrode
x0,y0,z0starting point
x1,y1,z1end point
quantityto be plotted (see PlotContour)

Definition at line 265 of file ViewField.cc.

268 {
269
270 m_electrode = label;
271 SetupCanvas();
272 if (!SetupProfile(x0, y0, z0, x1, y1, z1, option, m_fProfileW, true)) return;
273 m_fProfileW->Draw();
274 gPad->Update();
275}

◆ PlotSurface()

void Garfield::ViewField::PlotSurface ( const std::string &  option = "v")
inline

Make a surface plot ("SURF4") of the electric potential or field.

Parameters
optionquantity to be plotted (see PlotContour)

Definition at line 73 of file ViewField.hh.

73{ Plot(option, "SURF4"); }
void Plot(const std::string &option="v", const std::string &drawopt="arr")
Definition: ViewField.cc:222

◆ PlotSurfaceWeightingField()

void Garfield::ViewField::PlotSurfaceWeightingField ( const std::string &  label,
const std::string &  option 
)
inline

Make a surface plot ("SURF4") of the weighting potential or field.

Parameters
labelidentifier of the electrode
optionquantity to be plotted (see PlotContour)

Definition at line 99 of file ViewField.hh.

100 {
101 PlotWeightingField(label, option, "SURF4");
102 }
void PlotWeightingField(const std::string &label, const std::string &option, const std::string &drawopt)
Definition: ViewField.cc:242

◆ PlotWeightingField()

void Garfield::ViewField::PlotWeightingField ( const std::string &  label,
const std::string &  option,
const std::string &  drawopt 
)

Make a 2D plot of the weighting potential or field.

Parameters
labelidentifier of the electrode
optionquantity to be plotted (see PlotContour)
drawoptoption string passed to TF2::Draw

Definition at line 242 of file ViewField.cc.

244 {
245
246 m_electrode = label;
247 SetupCanvas();
248 if (!SetupFunction(option, m_f2dW, false, true)) return;
249 m_f2dW->Draw(drawopt.c_str());
250 gPad->SetRightMargin(0.15);
251 gPad->Update();
252}

Referenced by PlotSurfaceWeightingField().

◆ Rotate()

void Garfield::ViewField::Rotate ( const double  angle)

Rotate the viewing plane (angle in radian).

Definition at line 736 of file ViewField.cc.

736 {
737
738 // Rotate the axes
739 double auxu[3], auxv[3];
740 const double ctheta = cos(theta);
741 const double stheta = sin(theta);
742 for (int i = 0; i < 3; ++i) {
743 auxu[i] = ctheta * m_project[0][i] - stheta * m_project[1][i];
744 auxv[i] = stheta * m_project[0][i] + ctheta * m_project[1][i];
745 }
746 for (int i = 0; i < 3; ++i) {
747 m_project[0][i] = auxu[i];
748 m_project[1][i] = auxv[i];
749 }
750
751 // Make labels to be placed along the axes
752 Labels();
753}
DoubleAc cos(const DoubleAc &f)
Definition: DoubleAc.cpp:432
DoubleAc sin(const DoubleAc &f)
Definition: DoubleAc.cpp:384

◆ SetArea() [1/2]

void Garfield::ViewField::SetArea ( )
inline

Set the viewing area based on the bounding box of the sensor/component.

Definition at line 41 of file ViewField.hh.

41{ m_hasUserArea = false; }

◆ SetArea() [2/2]

void Garfield::ViewField::SetArea ( const double  xmin,
const double  ymin,
const double  xmax,
const double  ymax 
)

Set the viewing area (in local coordinates of the current viewing plane).

Definition at line 129 of file ViewField.cc.

130 {
131
132 // Check range, assign if non-null.
133 if (xmin == xmax || ymin == ymax) {
134 std::cerr << m_className << "::SetArea: Null area range is not permitted.\n"
135 << " " << xmin << " < x < " << xmax << "\n"
136 << " " << ymin << " < y < " << ymax << "\n";
137 return;
138 }
139 m_xmin = std::min(xmin, xmax);
140 m_ymin = std::min(ymin, ymax);
141 m_xmax = std::max(xmin, xmax);
142 m_ymax = std::max(ymin, ymax);
143 m_hasUserArea = true;
144}

◆ SetCanvas()

void Garfield::ViewField::SetCanvas ( TCanvas *  c)

Set the canvas to be painted on.

Definition at line 118 of file ViewField.cc.

118 {
119
120 if (!c) return;
121 if (!m_hasExternalCanvas && m_canvas) {
122 delete m_canvas;
123 m_canvas = NULL;
124 }
125 m_canvas = c;
126 m_hasExternalCanvas = true;
127}

◆ SetComponent()

void Garfield::ViewField::SetComponent ( ComponentBase c)

Set the component from which to retrieve the field.

Definition at line 107 of file ViewField.cc.

107 {
108
109 if (!c) {
110 std::cerr << m_className << "::SetComponent: Null pointer.\n";
111 return;
112 }
113
114 m_component = c;
115 m_sensor = NULL;
116}

◆ SetDefaultProjection()

void Garfield::ViewField::SetDefaultProjection ( )

Set the default viewing plane ( $x$- $y$ at $z = 0$).

Definition at line 291 of file ViewField.cc.

291 {
292
293 // Default projection: x-y at z=0
294 m_project[0][0] = 1;
295 m_project[1][0] = 0;
296 m_project[2][0] = 0;
297 m_project[0][1] = 0;
298 m_project[1][1] = 1;
299 m_project[2][1] = 0;
300 m_project[0][2] = 0;
301 m_project[1][2] = 0;
302 m_project[2][2] = 0;
303
304 // Plane description
305 m_plane[0] = 0;
306 m_plane[1] = 0;
307 m_plane[2] = 1;
308 m_plane[3] = 0;
309
310 // Prepare axis labels.
311 Labels();
312}

Referenced by ViewField().

◆ SetElectricFieldRange()

void Garfield::ViewField::SetElectricFieldRange ( const double  emin,
const double  emax 
)

Set the plot limits for the electric field.

Definition at line 153 of file ViewField.cc.

153 {
154
155 m_emin = std::min(emin, emax);
156 m_emax = std::max(emin, emax);
157 m_useAutoRange = false;
158}

◆ SetNumberOfContours()

void Garfield::ViewField::SetNumberOfContours ( const unsigned int  n)

Set the number of contour levels (at most 50).

Definition at line 167 of file ViewField.cc.

167 {
168
169 if (n <= m_nMaxContours) {
170 m_nContours = n;
171 } else {
172 std::cerr << m_className << "::SetNumberOfContours:\n"
173 << " Max. number of contours is " << m_nMaxContours << ".\n";
174 }
175}

◆ SetNumberOfSamples1d()

void Garfield::ViewField::SetNumberOfSamples1d ( const unsigned int  n)

Set the number of points used for drawing 1D functions.

Definition at line 177 of file ViewField.cc.

177 {
178
179 const unsigned int nmin = 10;
180 const unsigned int nmax = 100000;
181 if (n < nmin || n > nmax) {
182 std::cerr << m_className << "::SetNumberOfSamples1d:\n"
183 << " Number of points (" << n << ") out of range.\n"
184 << " " << nmin << " <= n <= " << nmax << "\n";
185 return;
186 }
187
188 m_nSamples1d = n;
189}

◆ SetNumberOfSamples2d()

void Garfield::ViewField::SetNumberOfSamples2d ( const unsigned int  nx,
const unsigned int  ny 
)

Set the number of points used for drawing 2D functions.

Definition at line 191 of file ViewField.cc.

192 {
193
194 const unsigned int nmin = 10;
195 const unsigned int nmax = 10000;
196 if (nx < nmin || nx > nmax) {
197 std::cerr << m_className << "::SetNumberOfSamples2d:\n"
198 << " Number of x-points (" << nx << ") out of range.\n"
199 << " " << nmin << " <= nx <= " << nmax << "\n";
200 } else {
201 m_nSamples2dX = nx;
202 }
203
204 if (ny < nmin || ny > nmax) {
205 std::cerr << m_className << "::SetNumberOfSamples2d:\n"
206 << " Number of y-points (" << ny << ") out of range.\n"
207 << " " << nmin << " <= ny <= " << nmax << "\n";
208 } else {
209 m_nSamples2dY = ny;
210 }
211}

◆ SetPlane()

void Garfield::ViewField::SetPlane ( const double  fx,
const double  fy,
const double  fz,
const double  x0,
const double  y0,
const double  z0 
)

Set the projection (viewing plane).

Parameters
fx,fy,fznormal vector
x0,y0,z0in-plane point

Definition at line 694 of file ViewField.cc.

695 {
696
697 // Calculate two in-plane vectors for the normal vector
698 const double fnorm = sqrt(fx * fx + fy * fy + fz * fz);
699 if (fnorm > 0 && fx * fx + fz * fz > 0) {
700 const double fxz = sqrt(fx * fx + fz * fz);
701 m_project[0][0] = fz / fxz;
702 m_project[0][1] = 0;
703 m_project[0][2] = -fx / fxz;
704 m_project[1][0] = -fx * fy / (fxz * fnorm);
705 m_project[1][1] = (fx * fx + fz * fz) / (fxz * fnorm);
706 m_project[1][2] = -fy * fz / (fxz * fnorm);
707 m_project[2][0] = x0;
708 m_project[2][1] = y0;
709 m_project[2][2] = z0;
710 } else if (fnorm > 0 && fy * fy + fz * fz > 0) {
711 const double fyz = sqrt(fy * fy + fz * fz);
712 m_project[0][0] = (fy * fy + fz * fz) / (fyz * fnorm);
713 m_project[0][1] = -fx * fz / (fyz * fnorm);
714 m_project[0][2] = -fy * fz / (fyz * fnorm);
715 m_project[1][0] = 0;
716 m_project[1][1] = fz / fyz;
717 m_project[1][2] = -fy / fyz;
718 m_project[2][0] = x0;
719 m_project[2][1] = y0;
720 m_project[2][2] = z0;
721 } else {
722 std::cout << m_className << "::SetPlane:\n"
723 << " Normal vector has zero norm. No new projection set.\n";
724 }
725
726 // Store the plane description
727 m_plane[0] = fx;
728 m_plane[1] = fy;
729 m_plane[2] = fz;
730 m_plane[3] = fx * x0 + fy * y0 + fz * z0;
731
732 // Make labels to be placed along the axes
733 Labels();
734}

◆ SetSensor()

void Garfield::ViewField::SetSensor ( Sensor s)

Set the sensor from which to retrieve the field.

Definition at line 96 of file ViewField.cc.

96 {
97
98 if (!s) {
99 std::cerr << m_className << "::SetSensor: Null pointer.\n";
100 return;
101 }
102
103 m_sensor = s;
104 m_component = NULL;
105}

◆ SetVoltageRange()

void Garfield::ViewField::SetVoltageRange ( const double  vmin,
const double  vmax 
)

Set the plot limits for the potential.

Definition at line 146 of file ViewField.cc.

146 {
147
148 m_vmin = std::min(vmin, vmax);
149 m_vmax = std::max(vmin, vmax);
150 m_useAutoRange = false;
151}

◆ SetWeightingFieldRange()

void Garfield::ViewField::SetWeightingFieldRange ( const double  wmin,
const double  wmax 
)

Set the plot limits for the weighting field.

Definition at line 160 of file ViewField.cc.

160 {
161
162 m_wmin = std::min(wmin, wmax);
163 m_wmax = std::max(wmin, wmax);
164 m_useAutoRange = false;
165}

Friends And Related Function Documentation

◆ TF1

friend class TF1
friend

Definition at line 138 of file ViewField.hh.

◆ TF2

friend class TF2
friend

Definition at line 139 of file ViewField.hh.


The documentation for this class was generated from the following files: