12#include <TApplication.h>
26int main(
int argc,
char* argv[]) {
28 TApplication app(
"app", &argc, argv);
32 const double rwire = 1.0;
34 const double axis_x = 5;
36 const double axis_y = 5;
37 const double axis_z = 5;
48 "wire2d/mesh.header",
"wire2d/mesh.elements",
"wire2d/mesh.nodes",
49 "wire2d/dielectrics.dat",
"wire2d/wire2d.result",
"cm");
56 sensor.
SetArea(-axis_x, -axis_y, -axis_z, axis_x, axis_y, axis_z);
63 viewDrift.
SetArea(-axis_x, -axis_y, -axis_z, axis_x, axis_y, axis_z);
67 const double zi = 1.0;
68 double ri = rwire + 2.0;
70 double xi = ri * cos(thetai);
71 double yi = ri * sin(thetai);
73 std::cout <<
"Avalanche of a single electron starting from ("
74 << xi <<
", " << yi <<
", " << zi <<
")..." << std::endl;
77 std::cout <<
"... avalanche complete with "
81 TCanvas* cGeom =
new TCanvas(
"geom",
"Geometry/Avalanche/Fields");
82 cGeom->SetLeftMargin(0.14);
83 const bool plotContours =
false;
88 vf->
SetArea(-axis_x, -axis_y, axis_x, axis_y);
97 vFE.
SetArea(-axis_x, -axis_z, -axis_y, axis_x, axis_z, axis_y);
Calculate electron drift lines and avalanches using microscopic tracking.
size_t GetNumberOfElectronEndpoints() const
bool AvalancheElectron(const double x, const double y, const double z, const double t, const double e, const double dx=0., const double dy=0., const double dz=0.)
Calculate an avalanche initiated by a given electron.
void EnablePlotting(ViewDrift *view, const size_t nColl=100)
Switch on drift line plotting.
Component for importing two-dimensional field maps computed by Elmer.
void SetRangeZ(const double zmin, const double zmax)
void SetGas(Medium *medium)
void SetTemperature(const double t)
Set the temperature [K].
void SetPressure(const double p)
void AddComponent(Component *comp)
Add a component.
bool SetArea(const bool verbose=false)
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.
bool Plot(const bool twod=true)
Plot method to be called by user.
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
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).
int main(int argc, char *argv[])