Garfield++ 4.0
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 <memory>
5#include <string>
6
7#include <TGeoManager.h>
8
9#include "ViewBase.hh"
10
11namespace Garfield {
12
13class ComponentAnalyticField;
14class ComponentNeBem2d;
15
16/// Visualize the "cell" defined in an analytic-field component.
17
18class ViewCell : public ViewBase {
19 public:
20 /// Constructor
21 ViewCell();
22 /// Destructor
23 ~ViewCell() = default;
24
25 /// Set the component for which to draw the cell geometry.
28
29 /// Make a two-dimensional drawing of the cell layout.
30 void Plot2d();
31 /// Make a three-dimensional drawing of the cell layout (using TGeo).
32 void Plot3d();
33
34 /// Visualize wirers using markers (default setting)
35 /// or as a circle with the actual wire radius.
36 void EnableWireMarkers(const bool on = true) { m_useWireMarker = on; }
38
39 private:
40 bool m_useWireMarker = true;
41
42 ComponentAnalyticField* m_component = nullptr;
43 ComponentNeBem2d* m_nebem = nullptr;
44
45 // 3D geometry.
46 std::unique_ptr<TGeoManager> m_geo;
47
48 bool Plot(const bool twod);
49 // Draw a wire in 2D.
50 void PlotWire(const double x, const double y, const double d, const int type);
51 // Draw a wire in 3D.
52 void PlotWire(const double x, const double y, const double d, const int type,
53 const double lz);
54 // Draw a tube in 2D.
55 void PlotTube(const double x0, const double y0, const double r, const int n);
56 // Draw a tube in 3D.
57 void PlotTube(const double x0, const double y0,
58 const double r1, const double r2, const int n,
59 const double lz);
60 // Draw a plane in 2D.
61 void PlotPlane(const double x0, const double y0,
62 const double x1, const double y1);
63 // Draw a plane in 3D.
64 void PlotPlane(const double dx, const double dy, const double dz,
65 const double x0, const double y0);
66 // Draw a neBEM 2D layout.
67 bool PlotNeBem(const bool twod);
68 // Setup the TGeoManager.
69 void SetupGeo(const double dx, const double dy, const double dz);
70
71};
72}
73#endif
Two-dimensional implementation of the nearly exact Boundary Element Method.
Base class for visualization classes.
Definition: ViewBase.hh:18
Visualize the "cell" defined in an analytic-field component.
Definition: ViewCell.hh:18
~ViewCell()=default
Destructor.
void Plot3d()
Make a three-dimensional drawing of the cell layout (using TGeo).
Definition: ViewCell.cc:42
void SetComponent(ComponentAnalyticField *comp)
Set the component for which to draw the cell geometry.
Definition: ViewCell.cc:20
ViewCell()
Constructor.
Definition: ViewCell.cc:18
void Plot2d()
Make a two-dimensional drawing of the cell layout.
Definition: ViewCell.cc:36
void EnableWireMarkers(const bool on=true)
Definition: ViewCell.hh:36
void DisableWireMarkers()
Definition: ViewCell.hh:37