5#include <TApplication.h>
25int main(
int argc,
char* argv[]) {
26 TApplication app(
"app", &argc, argv);
28 constexpr double d = 199.5e-04;
29 constexpr double pitch = 55e-4;
35 efield.LoadElectricField(
"Efield.txt",
"XY",
true,
false);
36 efield.EnablePeriodicityX();
37 efield.SetMedium(&si);
39 efield.LoadElectronAttachment(
"Attachment.txt",
"XY", 2);
40 efield.LoadHoleAttachment(
"Attachment.txt",
"XY", 3);
48 const std::string label =
"pixel";
52 const unsigned int nTimeBins = 1000;
53 const double tmin = 0.;
54 const double tmax = 10.;
55 const double tstep = (tmax - tmin) / nTimeBins;
73 double x0 = pitch * 1.5, y0 = 5.e-5, z0 = 0., t0 = 0.;
74 double dx = 0., dy = 1., dz = 0.;
75 track.
NewTrack(x0, y0, z0, t0, dx, dy, dz);
76 double xc = 0., yc = 0., zc = 0., tc = 0., ec = 0., extra = 0.;
79 while (track.
GetCluster(xc, yc, zc, tc, ne, ec, extra)) {
81 for (
int j = 0; j < ne; ++j) {
82 double xe = 0., ye = 0., ze = 0., te = 0., ee = 0.;
83 double dxe = 0., dye = 0., dze = 0.;
84 track.
GetElectron(j, xe, ye, ze, te, ee, dxe, dye, dze);
90 constexpr bool plotSignal =
true;
93 constexpr bool plotTotalSignal =
true;
94 constexpr bool plotElectronSignal =
false;
95 constexpr bool plotHoleSignal =
false;
96 signalView.
PlotSignal(
"pixel", plotTotalSignal, plotElectronSignal,
99 std::ofstream outfile;
100 outfile.open(
"signal.txt", std::ios::out);
101 for (
unsigned int i = 0; i < nTimeBins; ++i) {
102 const double t = (i + 0.5) * tstep;
103 const double f = sensor.
GetSignal(label, i);
106 outfile << t <<
" " << f <<
" " << fe <<
" " << fh <<
"\n";
int main(int argc, char *argv[])
void EnableSignalCalculation(const bool on=true)
Switch on calculation of induced currents (default: disabled).
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 EnableAttachmentMap(const bool on=true)
Retrieve the attachment coefficient from the component.
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.
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 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)
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 bool total=true, const bool electron=false, const bool ion=false, const bool delayed=false, const bool same=false)