12#include <TApplication.h>
27int main(
int argc,
char* argv[]) {
29 TApplication app(
"app", &argc, argv);
33 const double rwire = 1.0;
35 const double axis_x = 5;
37 const double axis_y = 5;
38 const double axis_z = 5;
54 "wire2d/mesh.header",
"wire2d/mesh.elements",
"wire2d/mesh.nodes",
55 "wire2d/dielectrics.dat",
"wire2d/wire2d.result",
"cm");
62 sensor->
SetArea(-axis_x, -axis_y, -axis_z, axis_x, axis_y, axis_z);
71 viewDrift->
SetArea(-axis_x, -axis_y, -axis_z, axis_x, axis_y, axis_z);
75 const double zi = 1.0;
76 double ri = rwire + 2.0;
78 double xi = ri * cos(thetai);
79 double yi = ri * sin(thetai);
81 std::cout <<
"Avalanche of a single electron starting from (" << xi <<
", " << yi <<
", " << zi <<
")..." << std::endl;
84 std::cout <<
"... avalanche complete with "
88 TCanvas* cGeom =
new TCanvas(
"geom",
"Geometry/Avalanche/Fields");
89 cGeom->SetLeftMargin(0.14);
90 const bool plotContours =
false;
95 vf->
SetArea(-axis_x, -axis_y, axis_x, axis_y);
104 vFE->
SetArea(-axis_x, -axis_z, -axis_y, axis_x, axis_z, axis_y);
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).
int main(int argc, char *argv[])