27 {
28
29 TApplication app("app", &argc, argv);
30
31
32
33 const double rwire = 1.0;
34
35 const double axis_x = 5;
36
37 const double axis_y = 5;
38 const double axis_z = 5;
39
40
41
43
45
47
49
51
52
54 "wire2d/mesh.header", "wire2d/mesh.elements", "wire2d/mesh.nodes",
55 "wire2d/dielectrics.dat", "wire2d/wire2d.result", "cm");
58
59
62 sensor->
SetArea(-axis_x, -axis_y, -axis_z, axis_x, axis_y, axis_z);
63
64
68
69
71 viewDrift->
SetArea(-axis_x, -axis_y, -axis_z, axis_x, axis_y, axis_z);
73
74
75 const double zi = 1.0;
76 double ri = rwire + 2.0;
78 double xi = ri *
cos(thetai);
79 double yi = ri *
sin(thetai);
80
81 std::cout << "Avalanche of a single electron starting from (" << xi << ", " << yi << ", " << zi << ")..." << std::endl;
83
84 std::cout << "... avalanche complete with "
86
87
88 TCanvas* cGeom = new TCanvas("geom", "Geometry/Avalanche/Fields");
89 cGeom->SetLeftMargin(0.14);
90 const bool plotContours = false;
91 if (plotContours) {
95 vf->
SetArea(-axis_x, -axis_y, axis_x, axis_y);
100 }
101
102
104 vFE->
SetArea(-axis_x, -axis_z, -axis_y, axis_x, axis_z, axis_y);
110 if (!plotContours) {
116 }
117
118 app.Run(kTRUE);
119
120 return 0;
121}
Calculate electron drift lines and avalanches using microscopic tracking.
void EnablePlotting(ViewDrift *view)
Switch on drift line plotting.
void SetCollisionSteps(const unsigned int n)
Set number of collisions to be skipped for plotting.
void SetSensor(Sensor *sensor)
Set the sensor.
bool AvalancheElectron(const double x0, const double y0, const double z0, const double t0, const double e0, const double dx0=0., const double dy0=0., const double dz0=0.)
Calculate an avalanche initiated by a given electron.
unsigned int GetNumberOfElectronEndpoints() const
Component for importing field maps computed by Elmer.
void SetRangeZ(const double zmin, const double zmax)
void SetMedium(const unsigned int imat, Medium *medium)
Associate a field map material with a Medium class.
bool SetComposition(const std::string &gas1, const double f1=1., const std::string &gas2="", const double f2=0., const std::string &gas3="", const double f3=0., const std::string &gas4="", const double f4=0., const std::string &gas5="", const double f5=0., const std::string &gas6="", const double f6=0.)
Set the gas mixture.
void SetTemperature(const double t)
Set the temperature [K].
virtual void EnableDrift(const bool on=true)
Switch electron/ion/hole on/off.
void SetPressure(const double p)
void AddComponent(Component *comp)
Add a component.
bool SetArea()
Set the user area to the default.
void SetCanvas(TPad *pad)
Set the canvas to be painted on.
void SetArea(const double xmin, const double ymin, const double xmax, const double ymax)
virtual void SetPlane(const double fx, const double fy, const double fz, const double x0, const double y0, const double z0)
Visualize drift lines and tracks.
Draw the mesh of a field-map component.
void SetYaxisTitle(const std::string &ytitle)
void SetViewDrift(ViewDrift *vd)
Set the optional associated ViewDrift.
void SetXaxisTitle(const std::string &xtitle)
void SetPlane(const double fx, const double fy, const double fz, const double x0, const double y0, const double z0) override
bool Plot()
Plot method to be called by user.
void SetComponent(ComponentFieldMap *cmp)
Set the component from which to retrieve the mesh and field.
void SetColor(int matID, int colorID)
void SetFillMesh(const bool f)
Element fill switch; 2D only, set false for wireframe mesh.
Visualize the potential or electric field of a component or sensor.
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 SetNumberOfContours(const unsigned int n)
Set the number of contour levels.
void SetSensor(Sensor *s)
Set the sensor for which to plot the field.
double RndmUniform()
Draw a random number uniformly distributed in the range [0, 1).
DoubleAc cos(const DoubleAc &f)
DoubleAc sin(const DoubleAc &f)