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");
37 for (
size_t i = 0; i < nRegions; ++i) {
65 const double theta = (
RndmUniform() - 0.5) * 20. * DegreeToRad;
68 track.
NewTrack(x0, y0, 0., 0., sin(theta), 0., cos(theta));
72 for (
const auto& electron : cluster.electrons) {
74 constexpr double fPlot = 0.01;
76 drift.
DriftElectron(electron.x, electron.y, electron.z, electron.t);
77 drift.
DriftHole(electron.x, electron.y, electron.z, electron.t);
void EnablePlotting(ViewDrift *view)
Switch on drift line plotting.
bool DriftHole(const double x, const double y, const double z, const double t)
Simulate the drift line of a hole from a given starting point.
bool DriftElectron(const double x, const double y, const double z, const double t)
Simulate the drift line of an electron from a given starting point.
void SetDistanceSteps(const double d=0.001)
Use fixed distance steps (default 10 um).
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(const bool verbose=false)
Set the user area to the default.
Generate tracks using Heed++.
bool NewTrack(const double x0, const double y0, const double z0, const double t0, const double dx0, const double dy0, const double dz0) override
const std::vector< Cluster > & GetClusters() const
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=true, const bool snapshot=false)
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).