Garfield++ v2r0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
ViewCell.hh
Go to the documentation of this file.
1#ifndef G_VIEW_CELL
2#define G_VIEW_CELL
3
4#include <string>
5
6#include <TCanvas.h>
7#include <TGeoManager.h>
8
9namespace Garfield {
10
11class ComponentAnalyticField;
12
13/// Visualize the "cell" defined in an analytic-field component.
14
15class ViewCell {
16
17 public:
18 /// Constructor
19 ViewCell();
20 /// Destructor
21 ~ViewCell();
22
23 /// Set the canvas on which to draw the cell geometry.
24 void SetCanvas(TCanvas* c);
25 /// Set the component for which to draw the cell geometry.
27
28 /// Set the plot range explicitly.
29 void SetArea(const double xmin, const double ymin, const double zmin,
30 const double xmax, const double ymax, const double zmax);
31 /// Take the plot range from the bounding box of the component class.
32 void SetArea() { m_hasUserArea = false; }
33
34 /// Make a two-dimensional drawing of the cell geometry.
35 void Plot2d();
36 /// Make a three-dimensional drawing of the cell geometry (using TGeo).
37 void Plot3d();
38
39 /// Switch on/off debugging output.
40 void EnableDebugging(const bool on = true) { m_debug = on; }
41
42 /// Visualize wirers using markers or as a circle with the actual wire radius.
43 /// The default is markers.
44 void EnableWireMarkers(const bool on = true) { m_useWireMarker = on; }
46
47 private:
48 std::string m_className;
49
50 // Options
51 bool m_debug;
52 bool m_useWireMarker;
53
54 std::string m_label;
55
56 // Canvas
57 TCanvas* m_canvas;
58 bool m_hasExternalCanvas;
59
60 // Box dimensions
61 bool m_hasUserArea;
62 double m_xMin, m_yMin, m_zMin;
63 double m_xMax, m_yMax, m_zMax;
64
65 ComponentAnalyticField* m_component;
66
67 // 3D geometry.
68 TGeoManager* m_geo;
69
70 bool Plot(const bool use3d);
71 void PlotWire(const double x, const double y, const double d,
72 const int type);
73 void PlotTube(const double x0, const double y0, const double r, const int n);
74
75};
76}
77#endif
Visualize the "cell" defined in an analytic-field component.
Definition: ViewCell.hh:15
void EnableDebugging(const bool on=true)
Switch on/off debugging output.
Definition: ViewCell.hh:40
void Plot3d()
Make a three-dimensional drawing of the cell geometry (using TGeo).
Definition: ViewCell.cc:91
~ViewCell()
Destructor.
Definition: ViewCell.cc:37
void SetArea()
Take the plot range from the bounding box of the component class.
Definition: ViewCell.hh:32
void SetCanvas(TCanvas *c)
Set the canvas on which to draw the cell geometry.
Definition: ViewCell.cc:54
void SetComponent(ComponentAnalyticField *comp)
Set the component for which to draw the cell geometry.
Definition: ViewCell.cc:44
ViewCell()
Constructor.
Definition: ViewCell.cc:17
void Plot2d()
Make a two-dimensional drawing of the cell geometry.
Definition: ViewCell.cc:84
void EnableWireMarkers(const bool on=true)
Definition: ViewCell.hh:44
void DisableWireMarkers()
Definition: ViewCell.hh:45