25 {
26 TApplication app("app", &argc, argv);
27
28 constexpr double d = 199.5e-04;
29 constexpr double pitch = 55e-4;
30
33
35 efield.LoadElectricField(
"Efield.txt",
"XY",
true,
false);
36 efield.EnablePeriodicityX();
38
39 efield.LoadElectronAttachment(
"Attachment.txt",
"XY", 2);
40 efield.LoadHoleAttachment(
"Attachment.txt",
"XY", 3);
41
44
48 const std::string label = "pixel";
50
51
52 const unsigned int nTimeBins = 1000;
53 const double tmin = 0.;
54 const double tmax = 10.;
55 const double tstep = (
tmax - tmin) / nTimeBins;
57
58
61
64
65
68
71
72 double x0 = pitch * 1.5, y0 = 5.e-5, z0 = 0., t0 = 0.;
73 double dx = 0., dy = 1., dz = 0.;
74 track.
NewTrack(x0, y0, z0, t0, dx, dy, dz);
75
77
78 for (const auto& electron : cluster.electrons) {
79
80 drift.
DriftElectron(electron.x, electron.y, electron.z, electron.t);
81 drift.
DriftHole(electron.x, electron.y, electron.z, electron.t);
82 }
83 }
84 constexpr bool plotSignal = true;
88
89 std::ofstream outfile;
90 outfile.open("signal.txt", std::ios::out);
91 for (unsigned int i = 0; i < nTimeBins; ++i) {
92 const double t = (i + 0.5) * tstep;
93 const double f = sensor.
GetSignal(label, i);
96 outfile << t << " " << f << " " << fe << " " << fh << "\n";
97 }
98 outfile.close();
99 if (plotSignal) app.Run();
100}
void SetSensor(Sensor *s)
Set the sensor.
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.
void EnableAttachmentMap(const bool on=true)
Retrieve the attachment coefficient from the component.
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).
Component for interpolating field maps on a regular mesh.
void Print()
Print information about the mesh and the available data.
bool LoadWeightingField(const std::string &filename, const std::string &format, const bool withPotential, const double scaleX=1., const double scaleE=1., const double scaleP=1.)
Import (prompt) weighting field from file.
Solid crystalline silicon
void SetTemperature(const double t)
Set the temperature [K].
double GetElectronSignal(const std::string &label, const unsigned int bin)
Retrieve the electron signal for a given electrode and time bin.
void SetTimeWindow(const double tstart, const double tstep, const unsigned int nsteps)
void AddElectrode(Component *comp, const std::string &label)
Add an electrode.
void AddComponent(Component *comp)
Add a component.
double GetSignal(const std::string &label, const unsigned int bin)
Retrieve the total signal for a given electrode and time bin.
double GetIonSignal(const std::string &label, const unsigned int bin)
Retrieve the ion or hole signal for a given electrode and time bin.
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 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)
Plot the signal computed by a sensor as a ROOT histogram.
void SetSensor(Sensor *s)
Set the sensor from which to retrieve the signal.
void PlotSignal(const std::string &label, const std::string &optTotal="t", const std::string &optPrompt="", const std::string &optDelayed="", const bool same=false)