7#include <TApplication.h>
22int main(
int argc,
char * argv[]) {
24 TApplication app(
"app", &argc, argv);
34 cmp.
Initialise(
"diode_msh.grd",
"diode_des.dat");
38 for (
size_t i = 0; i < nRegions; ++i) {
68 const double theta = (
RndmUniform() - 0.5) * 20. * DegreeToRad;
71 track.
NewTrack(x0, y0, 0., 0., sin(theta), 0., cos(theta));
73 double xc, yc, zc, tc, ec, dummy;
75 while (track.
GetCluster(xc, yc, zc, tc, ne, ec, dummy)) {
77 for (
int i = 0; i < ne; ++i) {
78 double xe, ye, ze, te, ee, dxe, dye, dze;
79 track.
GetElectron(i, xe, ye, ze, te, ee, dxe, dye, dze);
81 constexpr double fPlot = 0.01;
void EnablePlotting(ViewDrift *view)
Switch on drift line plotting.
bool DriftElectron(const double x0, const double y0, const double z0, const double t0)
Simulate the drift line of an electron from a given starting point.
void SetSensor(Sensor *s)
Set the sensor.
void SetDistanceSteps(const double d=0.001)
Use fixed distance steps (default 10 um).
bool DriftHole(const double x0, const double y0, const double z0, const double t0)
Simulate the drift line of a hole from a given starting point.
Interpolation in a three-dimensional field map created by Sentaurus Device.
size_t GetNumberOfRegions() const
Get the number of regions in the device.
bool Initialise(const std::string &gridfilename, const std::string &datafilename)
void SetMedium(const size_t ireg, Medium *m)
Set the medium to be associated to a given region.
Solid crystalline silicon
void SetTemperature(const double t)
Set the temperature [K].
void AddComponent(Component *comp)
Add a component.
bool SetArea()
Set the user area to the default.
Generate tracks using Heed++.
bool GetCluster(double &xcls, double &ycls, double &zcls, double &tcls, int &n, double &e, double &extra) override
bool NewTrack(const double x0, const double y0, const double z0, const double t0, const double dx0, const double dy0, const double dz0) override
bool GetElectron(const unsigned int i, double &x, double &y, double &z, double &t, double &e, double &dx, double &dy, double &dz)
void SetSensor(Sensor *s)
Set the sensor through which to transport the particle.
void SetMomentum(const double p)
Set the particle momentum.
virtual void SetParticle(const std::string &part)
void SetPlaneXZ()
Set the viewing plane to x-z.
Visualize drift lines and tracks.
void Plot2d(const bool axis)
Make a 2D plot of the drift lines in the current viewing plane.
Visualize the potential or electric field of a component or sensor.
void PlotContour(const std::string &option="v")
void SetSensor(Sensor *s)
Set the sensor for which to plot the field.
int main(int argc, char *argv[])
double RndmUniform()
Draw a random number uniformly distributed in the range [0, 1).