Garfield 0.3
Toolkit for the detailed simulation of particle detectors based on ionization measurement in gases and semiconductors
Loading...
Searching...
No Matches
Garfield::AvalancheMicroscopic Class Reference

Calculate electron drift lines and avalanches using microscopic tracking. More...

#include <AvalancheMicroscopic.hh>

Classes

struct  Electron
struct  Photon
struct  Point
struct  Seed
struct  Statistics

Public Member Functions

 AvalancheMicroscopic ()
 Default constructor.
 AvalancheMicroscopic (Sensor *sensor)
 Constructor.
 ~AvalancheMicroscopic ()
 Destructor.
void SetSensor (Sensor *sensor)
 Set the sensor.
void EnablePlotting (ViewDrift *view, const std::size_t nColl=100)
 Switch on drift line plotting.
void DisablePlotting ()
 Switch off drift line plotting.
void EnableExcitationMarkers (const bool on=true)
 Draw a marker at every excitation or not.
void EnableIonisationMarkers (const bool on=true)
 Draw a marker at every ionising collision or not.
void EnableAttachmentMarkers (const bool on=true)
 Draw a marker at every attachment or not.
void EnableSignalCalculation (const bool on=true)
 Switch calculation of induced currents on or off (default: enabled).
void UseWeightingPotential (const bool on=true)
 Use the weighting potential (as opposed to the weighting field) for calculating the induced current.
void EnableWeightingFieldIntegration (const bool on=true)
 Integrate the weighting field over a drift line step when calculating the induced current (default: off).
void UseInducedCharge (const bool on=true)
 Switch on calculation of the total induced charge (default: off).
void EnablePathLengthComputation (const bool on=true)
 Compute and store the path length of each trajectory (default: off).
void EnableElectronEnergyHistogramming (TH1 *histo)
 Fill a histogram with the electron energy distribution.
void DisableElectronEnergyHistogramming ()
 Stop histogramming the electron energy distribution.
void EnableHoleEnergyHistogramming (TH1 *histo)
 Fill a histogram with the hole energy distribution.
void DisableHoleEnergyHistogramming ()
 Stop histogramming the hole energy distribution.
void SetDistanceHistogram (TH1 *histo, const char opt='r')
 Fill histograms of the distance between successive collisions.
void EnableDistanceHistogramming (const int type)
 Fill distance distribution histograms for a given collision type.
void DisableDistanceHistogramming (const int type)
 Stop filling distance distribution histograms for a given collision type.
void DisableDistanceHistogramming ()
 Stop filling distance distribution histograms.
void EnableSecondaryEnergyHistogramming (TH1 *histo)
 Fill histograms of the energy of electrons emitted in ionising collisions.
void DisableSecondaryEnergyHistogramming ()
 Stop histogramming the secondary electron energy distribution.
void EnableDriftLines (const bool on=true)
 Switch on storage of drift lines (default: off).
void EnablePhotonTransport (const bool on=true)
 Switch on photon transport.
void EnableBandStructure (const bool on=true)
 Switch on stepping according to band structure E(k), for semiconductors.
void EnableNullCollisionSteps (const bool on=true, const int nSteps=1)
 Switch on update of coordinates for null-collision steps (default: off).
void EnableRKNSteps (const bool on=true)
 Switch on Runge-Kutta-Nystrom stepping (default: off).
void SetRKNTolerance (const double sTol=1.e-10, const double sMinStep=1.e-5)
 Set error tolerance and minimum step size on Runge-Kutta-Nystrom method (default: 1.e-10 and 1.e-5).
void SetElectronTransportCut (const double cut)
 Set a (lower) energy threshold for electron transport.
double GetElectronTransportCut () const
 Retrieve the value of the energy threshold.
void SetPhotonTransportCut (const double cut)
 Set an energy threshold for photon transport.
double GetPhotonTransportCut () const
 Retrieve the energy threshold for transporting photons.
void EnableAvalancheSizeLimit (const unsigned int size)
 Set a max.
void DisableAvalancheSizeLimit ()
 Do not apply a limit on the avalanche size.
int GetAvalancheSizeLimit () const
 Retrieve the currently set size limit.
void EnableMagneticField (const bool on=true)
 Switch on/off using the magnetic field in the stepping algorithm.
void SetCollisionSteps (const unsigned int n)
 Set number of collisions to be skipped for storing drift lines.
void SetTimeWindow (const double t0, const double t1)
 Define a time interval (only carriers inside the interval are simulated).
void UnsetTimeWindow ()
 Do not restrict the time interval within which carriers are simulated.
void GetAvalancheSize (int &ne, int &ni) const
 Return the number of electrons and ions in the avalanche.
std::pair< int, int > GetAvalancheSize () const
 Return the number of electrons and ions in the avalanche.
void GetAvalancheSize (int &ne, int &nh, int &ni) const
void GetAvalancheSizeGPU (int &ne, int &ni) const
 Return the number of electrons and ions in the avalanche.
const std::vector< Electron > & GetElectrons () const
const std::vector< Electron > & GetHoles () const
size_t GetNumberOfElectronEndpoints () const
 Return the number of electron trajectories in the last simulated avalanche (including captured electrons).
unsigned int GetNumberOfElectronEndpointsGPU () const
void GetElectronEndpoint (const size_t i, double &x0, double &y0, double &z0, double &t0, double &e0, double &x1, double &y1, double &z1, double &t1, double &e1, int &status) const
 Return the coordinates and time of start and end point of a given electron drift line.
void GetElectronEndpointGPU (const size_t i, double &x0, double &y0, double &z0, double &t0, double &e0, double &x1, double &y1, double &z1, double &t1, double &e1, int &status) const
size_t GetNumberOfElectronDriftLinePoints (const size_t i=0) const
void GetElectronDriftLinePoint (double &x, double &y, double &z, double &t, const size_t ip, const size_t ie=0) const
size_t GetNumberOfPhotons () const
void GetPhoton (const size_t i, double &e, double &x0, double &y0, double &z0, double &t0, double &x1, double &y1, double &z1, double &t1, int &status) const
bool DriftElectron (const double x, const double y, const double z, const double t, const double e, const double dx=0., const double dy=0., const double dz=0., const size_t w=1)
 Calculate an electron drift line.
bool AvalancheElectron (const double x, const double y, const double z, const double t, const double e, const double dx=0., const double dy=0., const double dz=0., const size_t w=1)
 Calculate an avalanche initiated by a given electron.
void AddElectron (const double x, const double y, const double z, const double t, const double e, const double dx=0., const double dy=0., const double dz=0., const size_t w=1)
 Add an electron to the list of particles to be transported.
bool ResumeAvalanche ()
 Continue the avalanche simulation from the current set of electrons.
void SetUserHandleStep (void(*f)(double x, double y, double z, double t, double e, double dx, double dy, double dz, bool hole))
 Set a callback function to be called at every step.
void UnsetUserHandleStep ()
 Deactivate the user handle called at every step.
void SetUserHandleCollision (void(*f)(double x, double y, double z, double t, int type, int level, Medium *m, double e0, double e1, double dx0, double dy0, double dz0, double dx1, double dy1, double dz1))
 Set a callback function to be called at every (real) collision.
void UnsetUserHandleCollision ()
 Deactivate the user handle called at every collision.
void SetUserHandleAttachment (void(*f)(double x, double y, double z, double t, int type, int level, Medium *m))
 Set a user handling procedure, to be called at every attachment.
void UnsetUserHandleAttachment ()
 Deactivate the user handle called at every attachment.
void SetUserHandleInelastic (void(*f)(double x, double y, double z, double t, int type, int level, Medium *m))
 Set a user handling procedure, to be called at every inelastic collision.
void UnsetUserHandleInelastic ()
 Deactivate the user handle called at every inelastic collision.
void SetUserHandleIonisation (void(*f)(double x, double y, double z, double t, int type, int level, Medium *m))
 Set a user handling procedure, to be called at every ionising collision or excitation followed by Penning transfer.
void UnsetUserHandleIonisation ()
 Deactivate the user handle called at every ionisation.
void EnableDebugging ()
 Switch on debugging messages.
void DisableDebugging ()
Statistics GetStatistics ()
void SetRunModeOptions (MPRunMode mode, int device=-1)
void SetMaxNumShowerLoops (int max_loops)
void SetShowProgress (bool show_progress)
void SetDebugShowerIterationAndElectronID (int iter_num, int elec_id)
std::vector< SeedGetStackOld ()
std::vector< ElectronGetStackOldGPU ()

Private Member Functions

bool TransportElectrons (std::vector< Seed > &stack, const bool aval)
int TransportElectron (const Seed &seed, const bool signal, std::vector< double > &ts, std::vector< std::array< double, 3 > > &xs, std::vector< Point > &path, std::vector< Seed > &stack)
int TransportElectronBfield (const Seed &seed, const bool signal, std::vector< double > &ts, std::vector< std::array< double, 3 > > &xs, std::vector< Point > &path, std::vector< Seed > &stack)
int TransportElectronSc (const Seed &seed, const bool signal, std::vector< double > &ts, std::vector< std::array< double, 3 > > &xs, std::vector< Point > &path, std::vector< Seed > &stack)
void TransportPhoton (const double x, const double y, const double z, const double t, const double e, const size_t w, std::vector< Seed > &stack)
bool transportParticleStack (const bool aval, std::vector< Seed > &stack, std::vector< Seed > &newParticles, const bool signal, const bool useBfield, const bool sc)
void Terminate (double x0, double y0, double z0, double t0, double &x1, double &y1, double &z1, double &t1) const
void CreatePenningElectron (const double x, const double y, const double z, const double t, const size_t w, const double ds, const double dt, const double ep, const int level, std::vector< Seed > &stack) const
void PlotCollision (const int cstype, const size_t did, const double x, const double y, const double z, size_t &nCollPlot) const
void CallUserHandles (const int cstype, const double x, const double y, const double z, const double t, const int level, Medium *medium, const double en1, const double en, const double kx, const double ky, const double kz, const double kx1, const double ky1, const double kz1) const
void FillDistanceHistogram (const int cstype, const double x, const double y, const double z, double &xLast, double &yLast, double &zLast) const

Private Attributes

std::string m_className = "AvalancheMicroscopic"
MPRunMode m_runMode {MPRunMode::Normal}
int m_cudaDevice {-1}
int m_maxNumShowerLoops {-1}
int m_debugElectronID {-1}
int m_debugShowerLoopNum {-1}
bool m_showProgress {false}
AvalancheMicroscopicGPUm_gpuInterface {nullptr}
Statistics m_stats
Sensor * m_sensor = nullptr
std::vector< Electronm_electrons
std::vector< Electronm_electrons_gpu
std::vector< Electronm_holes
std::vector< Seedm_stackStoreCPU
std::vector< Electronm_stackStoreGPU
std::vector< Photonm_photons
int m_nElectrons = 0
 Number of electrons produced.
int m_nHoles = 0
 Number of holes produced.
int m_nIons = 0
 Number of ions produced.
int m_nElectronsGPU = 0
 Number of electrons produced.
int m_nHolesGPU = 0
 Number of holes produced.
int m_nIonsGPU = 0
 Number of ions produced.
ViewDriftm_viewer = nullptr
bool m_plotExcitations = true
bool m_plotIonisations = true
bool m_plotAttachments = true
TH1 * m_histElectronEnergy = nullptr
TH1 * m_histHoleEnergy = nullptr
TH1 * m_histDistance = nullptr
char m_distanceOption = 'r'
std::vector< int > m_distanceHistogramType
TH1 * m_histSecondary = nullptr
bool m_doSignal = true
bool m_useWeightingPotential = true
bool m_integrateWeightingField = false
bool m_doInducedCharge = false
bool m_computePathLength = false
bool m_storeDriftLines = false
bool m_usePhotons = false
bool m_useBandStructure = true
bool m_useNullCollisionSteps = false
bool m_useBfieldAuto = true
bool m_useBfield = false
bool m_rknSteps = false
double m_rknsteperrortol = 1.e-10
double m_rknMinh = 1.e-5
double m_nullCollScale = 1.
double m_deltaCut = 0.
double m_gammaCut = 0.
unsigned int m_sizeCut = 0
size_t m_nCollSkip = 100
size_t m_nCollPlot = 100
bool m_hasTimeWindow = false
double m_tMin = 0.
double m_tMax = 0.
void(* m_userHandleStep )(double x, double y, double z, double t, double e, double dx, double dy, double dz, bool hole) = nullptr
void(* m_userHandleCollision )(double x, double y, double z, double t, int type, int level, Medium *m, double e0, double e1, double dx0, double dy0, double dz0, double dx1, double dy1, double dz1) = nullptr
void(* m_userHandleAttachment )(double x, double y, double z, double t, int type, int level, Medium *m) = nullptr
void(* m_userHandleInelastic )(double x, double y, double z, double t, int type, int level, Medium *m) = nullptr
void(* m_userHandleIonisation )(double x, double y, double z, double t, int type, int level, Medium *m) = nullptr
bool m_debug = false

Friends

class AvalancheMicroscopicGPU

Detailed Description

Calculate electron drift lines and avalanches using microscopic tracking.

Definition at line 24 of file AvalancheMicroscopic.hh.

Constructor & Destructor Documentation

◆ AvalancheMicroscopic() [1/2]

Garfield::AvalancheMicroscopic::AvalancheMicroscopic ( )
inline

Default constructor.

Definition at line 27 of file AvalancheMicroscopic.hh.

27: AvalancheMicroscopic(nullptr) {}
AvalancheMicroscopic()
Default constructor.

◆ AvalancheMicroscopic() [2/2]

Garfield::AvalancheMicroscopic::AvalancheMicroscopic ( Sensor * sensor)

Constructor.

◆ ~AvalancheMicroscopic()

Garfield::AvalancheMicroscopic::~AvalancheMicroscopic ( )
inline

Destructor.

Definition at line 31 of file AvalancheMicroscopic.hh.

31{}

Member Function Documentation

◆ AddElectron()

void Garfield::AvalancheMicroscopic::AddElectron ( const double x,
const double y,
const double z,
const double t,
const double e,
const double dx = 0.,
const double dy = 0.,
const double dz = 0.,
const size_t w = 1 )

Add an electron to the list of particles to be transported.

◆ AvalancheElectron()

bool Garfield::AvalancheMicroscopic::AvalancheElectron ( const double x,
const double y,
const double z,
const double t,
const double e,
const double dx = 0.,
const double dy = 0.,
const double dz = 0.,
const size_t w = 1 )

Calculate an avalanche initiated by a given electron.

◆ CallUserHandles()

void Garfield::AvalancheMicroscopic::CallUserHandles ( const int cstype,
const double x,
const double y,
const double z,
const double t,
const int level,
Medium * medium,
const double en1,
const double en,
const double kx,
const double ky,
const double kz,
const double kx1,
const double ky1,
const double kz1 ) const
private

◆ CreatePenningElectron()

void Garfield::AvalancheMicroscopic::CreatePenningElectron ( const double x,
const double y,
const double z,
const double t,
const size_t w,
const double ds,
const double dt,
const double ep,
const int level,
std::vector< Seed > & stack ) const
private

◆ DisableAvalancheSizeLimit()

void Garfield::AvalancheMicroscopic::DisableAvalancheSizeLimit ( )
inline

Do not apply a limit on the avalanche size.

Definition at line 135 of file AvalancheMicroscopic.hh.

◆ DisableDebugging()

void Garfield::AvalancheMicroscopic::DisableDebugging ( )
inline

Definition at line 287 of file AvalancheMicroscopic.hh.

◆ DisableDistanceHistogramming() [1/2]

void Garfield::AvalancheMicroscopic::DisableDistanceHistogramming ( )

Stop filling distance distribution histograms.

◆ DisableDistanceHistogramming() [2/2]

void Garfield::AvalancheMicroscopic::DisableDistanceHistogramming ( const int type)

Stop filling distance distribution histograms for a given collision type.

◆ DisableElectronEnergyHistogramming()

void Garfield::AvalancheMicroscopic::DisableElectronEnergyHistogramming ( )
inline

Stop histogramming the electron energy distribution.

Definition at line 70 of file AvalancheMicroscopic.hh.

◆ DisableHoleEnergyHistogramming()

void Garfield::AvalancheMicroscopic::DisableHoleEnergyHistogramming ( )
inline

Stop histogramming the hole energy distribution.

Definition at line 74 of file AvalancheMicroscopic.hh.

◆ DisablePlotting()

void Garfield::AvalancheMicroscopic::DisablePlotting ( )
inline

Switch off drift line plotting.

Definition at line 39 of file AvalancheMicroscopic.hh.

39{ m_viewer = nullptr; }

◆ DisableSecondaryEnergyHistogramming()

void Garfield::AvalancheMicroscopic::DisableSecondaryEnergyHistogramming ( )
inline

Stop histogramming the secondary electron energy distribution.

Definition at line 92 of file AvalancheMicroscopic.hh.

◆ DriftElectron()

bool Garfield::AvalancheMicroscopic::DriftElectron ( const double x,
const double y,
const double z,
const double t,
const double e,
const double dx = 0.,
const double dy = 0.,
const double dz = 0.,
const size_t w = 1 )

Calculate an electron drift line.

Parameters
x,y,z,tstarting point of the electron
einitial energy of the electron
dx,dy,dzinitial direction vector of the electron If the initial direction is not specified, it is sampled randomly.
wweight (multiplicity) of the electron Secondary electrons are not transported.

◆ EnableAttachmentMarkers()

void Garfield::AvalancheMicroscopic::EnableAttachmentMarkers ( const bool on = true)
inline

Draw a marker at every attachment or not.

Definition at line 45 of file AvalancheMicroscopic.hh.

◆ EnableAvalancheSizeLimit()

void Garfield::AvalancheMicroscopic::EnableAvalancheSizeLimit ( const unsigned int size)
inline

Set a max.

avalanche size (i. e. ignore ionising collisions once this size has been reached).

Definition at line 133 of file AvalancheMicroscopic.hh.

133{ m_sizeCut = size; }

◆ EnableBandStructure()

void Garfield::AvalancheMicroscopic::EnableBandStructure ( const bool on = true)
inline

Switch on stepping according to band structure E(k), for semiconductors.

Definition at line 102 of file AvalancheMicroscopic.hh.

◆ EnableDebugging()

void Garfield::AvalancheMicroscopic::EnableDebugging ( )
inline

Switch on debugging messages.

Definition at line 286 of file AvalancheMicroscopic.hh.

286{ m_debug = true; }

◆ EnableDistanceHistogramming()

void Garfield::AvalancheMicroscopic::EnableDistanceHistogramming ( const int type)

Fill distance distribution histograms for a given collision type.

◆ EnableDriftLines()

void Garfield::AvalancheMicroscopic::EnableDriftLines ( const bool on = true)
inline

Switch on storage of drift lines (default: off).

Definition at line 95 of file AvalancheMicroscopic.hh.

◆ EnableElectronEnergyHistogramming()

void Garfield::AvalancheMicroscopic::EnableElectronEnergyHistogramming ( TH1 * histo)

Fill a histogram with the electron energy distribution.

◆ EnableExcitationMarkers()

void Garfield::AvalancheMicroscopic::EnableExcitationMarkers ( const bool on = true)
inline

Draw a marker at every excitation or not.

Definition at line 41 of file AvalancheMicroscopic.hh.

◆ EnableHoleEnergyHistogramming()

void Garfield::AvalancheMicroscopic::EnableHoleEnergyHistogramming ( TH1 * histo)

Fill a histogram with the hole energy distribution.

◆ EnableIonisationMarkers()

void Garfield::AvalancheMicroscopic::EnableIonisationMarkers ( const bool on = true)
inline

Draw a marker at every ionising collision or not.

Definition at line 43 of file AvalancheMicroscopic.hh.

◆ EnableMagneticField()

void Garfield::AvalancheMicroscopic::EnableMagneticField ( const bool on = true)
inline

Switch on/off using the magnetic field in the stepping algorithm.

Definition at line 140 of file AvalancheMicroscopic.hh.

◆ EnableNullCollisionSteps()

void Garfield::AvalancheMicroscopic::EnableNullCollisionSteps ( const bool on = true,
const int nSteps = 1 )
inline

Switch on update of coordinates for null-collision steps (default: off).

Definition at line 105 of file AvalancheMicroscopic.hh.

105 {
107 m_nullCollScale = nSteps <= 1 ? 1. : 1. / nSteps;
108 }

◆ EnablePathLengthComputation()

void Garfield::AvalancheMicroscopic::EnablePathLengthComputation ( const bool on = true)
inline

Compute and store the path length of each trajectory (default: off).

Definition at line 64 of file AvalancheMicroscopic.hh.

◆ EnablePhotonTransport()

void Garfield::AvalancheMicroscopic::EnablePhotonTransport ( const bool on = true)
inline

Switch on photon transport.

Remarks
This feature has not been tested thoroughly.

Definition at line 99 of file AvalancheMicroscopic.hh.

◆ EnablePlotting()

void Garfield::AvalancheMicroscopic::EnablePlotting ( ViewDrift * view,
const std::size_t nColl = 100 )

Switch on drift line plotting.

◆ EnableRKNSteps()

void Garfield::AvalancheMicroscopic::EnableRKNSteps ( const bool on = true)
inline

Switch on Runge-Kutta-Nystrom stepping (default: off).

Definition at line 111 of file AvalancheMicroscopic.hh.

◆ EnableSecondaryEnergyHistogramming()

void Garfield::AvalancheMicroscopic::EnableSecondaryEnergyHistogramming ( TH1 * histo)

Fill histograms of the energy of electrons emitted in ionising collisions.

◆ EnableSignalCalculation()

void Garfield::AvalancheMicroscopic::EnableSignalCalculation ( const bool on = true)
inline

Switch calculation of induced currents on or off (default: enabled).

Definition at line 48 of file AvalancheMicroscopic.hh.

◆ EnableWeightingFieldIntegration()

void Garfield::AvalancheMicroscopic::EnableWeightingFieldIntegration ( const bool on = true)
inline

Integrate the weighting field over a drift line step when calculating the induced current (default: off).

Definition at line 56 of file AvalancheMicroscopic.hh.

◆ FillDistanceHistogram()

void Garfield::AvalancheMicroscopic::FillDistanceHistogram ( const int cstype,
const double x,
const double y,
const double z,
double & xLast,
double & yLast,
double & zLast ) const
private

◆ GetAvalancheSize() [1/3]

std::pair< int, int > Garfield::AvalancheMicroscopic::GetAvalancheSize ( ) const
inline

Return the number of electrons and ions in the avalanche.

Definition at line 159 of file AvalancheMicroscopic.hh.

159 {
160 return std::make_pair(m_nElectrons, m_nIons);
161 }
int m_nElectrons
Number of electrons produced.
int m_nIons
Number of ions produced.

◆ GetAvalancheSize() [2/3]

void Garfield::AvalancheMicroscopic::GetAvalancheSize ( int & ne,
int & nh,
int & ni ) const
inline

Definition at line 162 of file AvalancheMicroscopic.hh.

162 {
163 ne = m_nElectrons;
164 nh = m_nHoles;
165 ni = m_nIons;
166 }
int m_nHoles
Number of holes produced.

◆ GetAvalancheSize() [3/3]

void Garfield::AvalancheMicroscopic::GetAvalancheSize ( int & ne,
int & ni ) const
inline

Return the number of electrons and ions in the avalanche.

Definition at line 154 of file AvalancheMicroscopic.hh.

154 {
155 ne = m_nElectrons;
156 ni = m_nIons;
157 }

◆ GetAvalancheSizeGPU()

void Garfield::AvalancheMicroscopic::GetAvalancheSizeGPU ( int & ne,
int & ni ) const
inline

Return the number of electrons and ions in the avalanche.

Definition at line 168 of file AvalancheMicroscopic.hh.

168 {
169 ne = m_nElectronsGPU;
170 ni = m_nIonsGPU;
171 }
int m_nIonsGPU
Number of ions produced.
int m_nElectronsGPU
Number of electrons produced.

◆ GetAvalancheSizeLimit()

int Garfield::AvalancheMicroscopic::GetAvalancheSizeLimit ( ) const
inline

Retrieve the currently set size limit.

Definition at line 137 of file AvalancheMicroscopic.hh.

137{ return m_sizeCut; }

◆ GetElectronDriftLinePoint()

void Garfield::AvalancheMicroscopic::GetElectronDriftLinePoint ( double & x,
double & y,
double & z,
double & t,
const size_t ip,
const size_t ie = 0 ) const

◆ GetElectronEndpoint()

void Garfield::AvalancheMicroscopic::GetElectronEndpoint ( const size_t i,
double & x0,
double & y0,
double & z0,
double & t0,
double & e0,
double & x1,
double & y1,
double & z1,
double & t1,
double & e1,
int & status ) const

Return the coordinates and time of start and end point of a given electron drift line.

Parameters
iindex of the drift line
x0,y0,z0,t0coordinates and time of the starting point
x1,y1,z1,t1coordinates and time of the end point
e0,e1initial and final energy
statusstatus code (see GarfieldConstants.hh)

◆ GetElectronEndpointGPU()

void Garfield::AvalancheMicroscopic::GetElectronEndpointGPU ( const size_t i,
double & x0,
double & y0,
double & z0,
double & t0,
double & e0,
double & x1,
double & y1,
double & z1,
double & t1,
double & e1,
int & status ) const

◆ GetElectrons()

const std::vector< Electron > & Garfield::AvalancheMicroscopic::GetElectrons ( ) const
inline

Definition at line 194 of file AvalancheMicroscopic.hh.

194{ return m_electrons; }

◆ GetElectronTransportCut()

double Garfield::AvalancheMicroscopic::GetElectronTransportCut ( ) const
inline

Retrieve the value of the energy threshold.

Definition at line 124 of file AvalancheMicroscopic.hh.

◆ GetHoles()

const std::vector< Electron > & Garfield::AvalancheMicroscopic::GetHoles ( ) const
inline

Definition at line 195 of file AvalancheMicroscopic.hh.

195{ return m_holes; }

◆ GetNumberOfElectronDriftLinePoints()

size_t Garfield::AvalancheMicroscopic::GetNumberOfElectronDriftLinePoints ( const size_t i = 0) const

◆ GetNumberOfElectronEndpoints()

size_t Garfield::AvalancheMicroscopic::GetNumberOfElectronEndpoints ( ) const
inline

Return the number of electron trajectories in the last simulated avalanche (including captured electrons).

Definition at line 198 of file AvalancheMicroscopic.hh.

198{ return m_electrons.size(); }

◆ GetNumberOfElectronEndpointsGPU()

unsigned int Garfield::AvalancheMicroscopic::GetNumberOfElectronEndpointsGPU ( ) const
inline

Definition at line 199 of file AvalancheMicroscopic.hh.

199 {
200 return m_electrons_gpu.size();
201 }
std::vector< Electron > m_electrons_gpu

◆ GetNumberOfPhotons()

size_t Garfield::AvalancheMicroscopic::GetNumberOfPhotons ( ) const
inline

Definition at line 222 of file AvalancheMicroscopic.hh.

222{ return m_photons.size(); }

◆ GetPhoton()

void Garfield::AvalancheMicroscopic::GetPhoton ( const size_t i,
double & e,
double & x0,
double & y0,
double & z0,
double & t0,
double & x1,
double & y1,
double & z1,
double & t1,
int & status ) const

◆ GetPhotonTransportCut()

double Garfield::AvalancheMicroscopic::GetPhotonTransportCut ( ) const
inline

Retrieve the energy threshold for transporting photons.

Definition at line 129 of file AvalancheMicroscopic.hh.

◆ GetStackOld()

std::vector< Seed > Garfield::AvalancheMicroscopic::GetStackOld ( )
inline

Definition at line 458 of file AvalancheMicroscopic.hh.

458 {
459 return m_stackStoreCPU;
460 }

◆ GetStackOldGPU()

std::vector< Electron > Garfield::AvalancheMicroscopic::GetStackOldGPU ( )
inline

Definition at line 461 of file AvalancheMicroscopic.hh.

461{ return m_stackStoreGPU; }
std::vector< Electron > m_stackStoreGPU

◆ GetStatistics()

Statistics Garfield::AvalancheMicroscopic::GetStatistics ( )
inline

Definition at line 300 of file AvalancheMicroscopic.hh.

◆ PlotCollision()

void Garfield::AvalancheMicroscopic::PlotCollision ( const int cstype,
const size_t did,
const double x,
const double y,
const double z,
size_t & nCollPlot ) const
private

◆ ResumeAvalanche()

bool Garfield::AvalancheMicroscopic::ResumeAvalanche ( )

Continue the avalanche simulation from the current set of electrons.

◆ SetCollisionSteps()

void Garfield::AvalancheMicroscopic::SetCollisionSteps ( const unsigned int n)
inline

Set number of collisions to be skipped for storing drift lines.

Definition at line 146 of file AvalancheMicroscopic.hh.

◆ SetDebugShowerIterationAndElectronID()

void Garfield::AvalancheMicroscopic::SetDebugShowerIterationAndElectronID ( int iter_num,
int elec_id )
inline

◆ SetDistanceHistogram()

void Garfield::AvalancheMicroscopic::SetDistanceHistogram ( TH1 * histo,
const char opt = 'r' )

Fill histograms of the distance between successive collisions.

Parameters
histopointer to the histogram to be filled
optdirection ('x', 'y', 'z', 'r')

◆ SetElectronTransportCut()

void Garfield::AvalancheMicroscopic::SetElectronTransportCut ( const double cut)
inline

Set a (lower) energy threshold for electron transport.

This can be useful for simulating delta electrons.

Definition at line 122 of file AvalancheMicroscopic.hh.

122{ m_deltaCut = cut; }

◆ SetMaxNumShowerLoops()

void Garfield::AvalancheMicroscopic::SetMaxNumShowerLoops ( int max_loops)
inline

Definition at line 303 of file AvalancheMicroscopic.hh.

◆ SetPhotonTransportCut()

void Garfield::AvalancheMicroscopic::SetPhotonTransportCut ( const double cut)
inline

Set an energy threshold for photon transport.

Definition at line 127 of file AvalancheMicroscopic.hh.

127{ m_gammaCut = cut; }

◆ SetRKNTolerance()

void Garfield::AvalancheMicroscopic::SetRKNTolerance ( const double sTol = 1.e-10,
const double sMinStep = 1.e-5 )
inline

Set error tolerance and minimum step size on Runge-Kutta-Nystrom method (default: 1.e-10 and 1.e-5).

Definition at line 114 of file AvalancheMicroscopic.hh.

◆ SetRunModeOptions()

void Garfield::AvalancheMicroscopic::SetRunModeOptions ( MPRunMode mode,
int device = -1 )

◆ SetSensor()

void Garfield::AvalancheMicroscopic::SetSensor ( Sensor * sensor)

Set the sensor.

◆ SetShowProgress()

void Garfield::AvalancheMicroscopic::SetShowProgress ( bool show_progress)
inline

Definition at line 304 of file AvalancheMicroscopic.hh.

◆ SetTimeWindow()

void Garfield::AvalancheMicroscopic::SetTimeWindow ( const double t0,
const double t1 )

Define a time interval (only carriers inside the interval are simulated).

◆ SetUserHandleAttachment()

void Garfield::AvalancheMicroscopic::SetUserHandleAttachment ( void(* )(double x, double y, double z, double t, int type, int level, Medium *m))

Set a user handling procedure, to be called at every attachment.

◆ SetUserHandleCollision()

void Garfield::AvalancheMicroscopic::SetUserHandleCollision ( void(* )(double x, double y, double z, double t, int type, int level, Medium *m, double e0, double e1, double dx0, double dy0, double dz0, double dx1, double dy1, double dz1))

Set a callback function to be called at every (real) collision.

◆ SetUserHandleInelastic()

void Garfield::AvalancheMicroscopic::SetUserHandleInelastic ( void(* )(double x, double y, double z, double t, int type, int level, Medium *m))

Set a user handling procedure, to be called at every inelastic collision.

◆ SetUserHandleIonisation()

void Garfield::AvalancheMicroscopic::SetUserHandleIonisation ( void(* )(double x, double y, double z, double t, int type, int level, Medium *m))

Set a user handling procedure, to be called at every ionising collision or excitation followed by Penning transfer.

◆ SetUserHandleStep()

void Garfield::AvalancheMicroscopic::SetUserHandleStep ( void(* )(double x, double y, double z, double t, double e, double dx, double dy, double dz, bool hole))

Set a callback function to be called at every step.

◆ Terminate()

void Garfield::AvalancheMicroscopic::Terminate ( double x0,
double y0,
double z0,
double t0,
double & x1,
double & y1,
double & z1,
double & t1 ) const
private

◆ TransportElectron()

int Garfield::AvalancheMicroscopic::TransportElectron ( const Seed & seed,
const bool signal,
std::vector< double > & ts,
std::vector< std::array< double, 3 > > & xs,
std::vector< Point > & path,
std::vector< Seed > & stack )
private

◆ TransportElectronBfield()

int Garfield::AvalancheMicroscopic::TransportElectronBfield ( const Seed & seed,
const bool signal,
std::vector< double > & ts,
std::vector< std::array< double, 3 > > & xs,
std::vector< Point > & path,
std::vector< Seed > & stack )
private

◆ TransportElectrons()

bool Garfield::AvalancheMicroscopic::TransportElectrons ( std::vector< Seed > & stack,
const bool aval )
private

◆ TransportElectronSc()

int Garfield::AvalancheMicroscopic::TransportElectronSc ( const Seed & seed,
const bool signal,
std::vector< double > & ts,
std::vector< std::array< double, 3 > > & xs,
std::vector< Point > & path,
std::vector< Seed > & stack )
private

◆ transportParticleStack()

bool Garfield::AvalancheMicroscopic::transportParticleStack ( const bool aval,
std::vector< Seed > & stack,
std::vector< Seed > & newParticles,
const bool signal,
const bool useBfield,
const bool sc )
private

◆ TransportPhoton()

void Garfield::AvalancheMicroscopic::TransportPhoton ( const double x,
const double y,
const double z,
const double t,
const double e,
const size_t w,
std::vector< Seed > & stack )
private

◆ UnsetTimeWindow()

void Garfield::AvalancheMicroscopic::UnsetTimeWindow ( )
inline

Do not restrict the time interval within which carriers are simulated.

Definition at line 151 of file AvalancheMicroscopic.hh.

◆ UnsetUserHandleAttachment()

void Garfield::AvalancheMicroscopic::UnsetUserHandleAttachment ( )
inline

Deactivate the user handle called at every attachment.

Definition at line 272 of file AvalancheMicroscopic.hh.

272{ m_userHandleAttachment = nullptr; }
void(* m_userHandleAttachment)(double x, double y, double z, double t, int type, int level, Medium *m)

◆ UnsetUserHandleCollision()

void Garfield::AvalancheMicroscopic::UnsetUserHandleCollision ( )
inline

Deactivate the user handle called at every collision.

Definition at line 267 of file AvalancheMicroscopic.hh.

267{ m_userHandleCollision = nullptr; }
void(* m_userHandleCollision)(double x, double y, double z, double t, int type, int level, Medium *m, double e0, double e1, double dx0, double dy0, double dz0, double dx1, double dy1, double dz1)

◆ UnsetUserHandleInelastic()

void Garfield::AvalancheMicroscopic::UnsetUserHandleInelastic ( )
inline

Deactivate the user handle called at every inelastic collision.

Definition at line 277 of file AvalancheMicroscopic.hh.

277{ m_userHandleInelastic = nullptr; }
void(* m_userHandleInelastic)(double x, double y, double z, double t, int type, int level, Medium *m)

◆ UnsetUserHandleIonisation()

void Garfield::AvalancheMicroscopic::UnsetUserHandleIonisation ( )
inline

Deactivate the user handle called at every ionisation.

Definition at line 283 of file AvalancheMicroscopic.hh.

283{ m_userHandleIonisation = nullptr; }
void(* m_userHandleIonisation)(double x, double y, double z, double t, int type, int level, Medium *m)

◆ UnsetUserHandleStep()

void Garfield::AvalancheMicroscopic::UnsetUserHandleStep ( )
inline

Deactivate the user handle called at every step.

Definition at line 259 of file AvalancheMicroscopic.hh.

259{ m_userHandleStep = nullptr; }
void(* m_userHandleStep)(double x, double y, double z, double t, double e, double dx, double dy, double dz, bool hole)

◆ UseInducedCharge()

void Garfield::AvalancheMicroscopic::UseInducedCharge ( const bool on = true)
inline

Switch on calculation of the total induced charge (default: off).

Definition at line 61 of file AvalancheMicroscopic.hh.

◆ UseWeightingPotential()

void Garfield::AvalancheMicroscopic::UseWeightingPotential ( const bool on = true)
inline

Use the weighting potential (as opposed to the weighting field) for calculating the induced current.

Definition at line 51 of file AvalancheMicroscopic.hh.

◆ AvalancheMicroscopicGPU

friend class AvalancheMicroscopicGPU
friend

Definition at line 463 of file AvalancheMicroscopic.hh.

Member Data Documentation

◆ m_className

std::string Garfield::AvalancheMicroscopic::m_className = "AvalancheMicroscopic"
private

Definition at line 311 of file AvalancheMicroscopic.hh.

◆ m_computePathLength

bool Garfield::AvalancheMicroscopic::m_computePathLength = false
private

Definition at line 372 of file AvalancheMicroscopic.hh.

◆ m_cudaDevice

int Garfield::AvalancheMicroscopic::m_cudaDevice {-1}
private

Definition at line 314 of file AvalancheMicroscopic.hh.

314{-1};

◆ m_debug

bool Garfield::AvalancheMicroscopic::m_debug = false
private

Definition at line 415 of file AvalancheMicroscopic.hh.

◆ m_debugElectronID

int Garfield::AvalancheMicroscopic::m_debugElectronID {-1}
private

Definition at line 316 of file AvalancheMicroscopic.hh.

316{-1};

◆ m_debugShowerLoopNum

int Garfield::AvalancheMicroscopic::m_debugShowerLoopNum {-1}
private

Definition at line 317 of file AvalancheMicroscopic.hh.

317{-1};

◆ m_deltaCut

double Garfield::AvalancheMicroscopic::m_deltaCut = 0.
private

Definition at line 386 of file AvalancheMicroscopic.hh.

◆ m_distanceHistogramType

std::vector<int> Garfield::AvalancheMicroscopic::m_distanceHistogramType
private

Definition at line 363 of file AvalancheMicroscopic.hh.

◆ m_distanceOption

char Garfield::AvalancheMicroscopic::m_distanceOption = 'r'
private

Definition at line 362 of file AvalancheMicroscopic.hh.

◆ m_doInducedCharge

bool Garfield::AvalancheMicroscopic::m_doInducedCharge = false
private

Definition at line 370 of file AvalancheMicroscopic.hh.

◆ m_doSignal

bool Garfield::AvalancheMicroscopic::m_doSignal = true
private

Definition at line 367 of file AvalancheMicroscopic.hh.

◆ m_electrons

std::vector<Electron> Garfield::AvalancheMicroscopic::m_electrons
private

Definition at line 325 of file AvalancheMicroscopic.hh.

◆ m_electrons_gpu

std::vector<Electron> Garfield::AvalancheMicroscopic::m_electrons_gpu
private

Definition at line 326 of file AvalancheMicroscopic.hh.

◆ m_gammaCut

double Garfield::AvalancheMicroscopic::m_gammaCut = 0.
private

Definition at line 387 of file AvalancheMicroscopic.hh.

◆ m_gpuInterface

AvalancheMicroscopicGPU* Garfield::AvalancheMicroscopic::m_gpuInterface {nullptr}
private

Definition at line 319 of file AvalancheMicroscopic.hh.

319{nullptr};

◆ m_hasTimeWindow

bool Garfield::AvalancheMicroscopic::m_hasTimeWindow = false
private

Definition at line 395 of file AvalancheMicroscopic.hh.

◆ m_histDistance

TH1* Garfield::AvalancheMicroscopic::m_histDistance = nullptr
private

Definition at line 361 of file AvalancheMicroscopic.hh.

◆ m_histElectronEnergy

TH1* Garfield::AvalancheMicroscopic::m_histElectronEnergy = nullptr
private

Definition at line 359 of file AvalancheMicroscopic.hh.

◆ m_histHoleEnergy

TH1* Garfield::AvalancheMicroscopic::m_histHoleEnergy = nullptr
private

Definition at line 360 of file AvalancheMicroscopic.hh.

◆ m_histSecondary

TH1* Garfield::AvalancheMicroscopic::m_histSecondary = nullptr
private

Definition at line 365 of file AvalancheMicroscopic.hh.

◆ m_holes

std::vector<Electron> Garfield::AvalancheMicroscopic::m_holes
private

Definition at line 327 of file AvalancheMicroscopic.hh.

◆ m_integrateWeightingField

bool Garfield::AvalancheMicroscopic::m_integrateWeightingField = false
private

Definition at line 369 of file AvalancheMicroscopic.hh.

◆ m_maxNumShowerLoops

int Garfield::AvalancheMicroscopic::m_maxNumShowerLoops {-1}
private

Definition at line 315 of file AvalancheMicroscopic.hh.

315{-1};

◆ m_nCollPlot

size_t Garfield::AvalancheMicroscopic::m_nCollPlot = 100
private

Definition at line 393 of file AvalancheMicroscopic.hh.

◆ m_nCollSkip

size_t Garfield::AvalancheMicroscopic::m_nCollSkip = 100
private

Definition at line 392 of file AvalancheMicroscopic.hh.

◆ m_nElectrons

int Garfield::AvalancheMicroscopic::m_nElectrons = 0
private

Number of electrons produced.

Definition at line 341 of file AvalancheMicroscopic.hh.

◆ m_nElectronsGPU

int Garfield::AvalancheMicroscopic::m_nElectronsGPU = 0
private

Number of electrons produced.

Definition at line 348 of file AvalancheMicroscopic.hh.

◆ m_nHoles

int Garfield::AvalancheMicroscopic::m_nHoles = 0
private

Number of holes produced.

Definition at line 343 of file AvalancheMicroscopic.hh.

◆ m_nHolesGPU

int Garfield::AvalancheMicroscopic::m_nHolesGPU = 0
private

Number of holes produced.

Definition at line 350 of file AvalancheMicroscopic.hh.

◆ m_nIons

int Garfield::AvalancheMicroscopic::m_nIons = 0
private

Number of ions produced.

Definition at line 345 of file AvalancheMicroscopic.hh.

◆ m_nIonsGPU

int Garfield::AvalancheMicroscopic::m_nIonsGPU = 0
private

Number of ions produced.

Definition at line 352 of file AvalancheMicroscopic.hh.

◆ m_nullCollScale

double Garfield::AvalancheMicroscopic::m_nullCollScale = 1.
private

Definition at line 383 of file AvalancheMicroscopic.hh.

◆ m_photons

std::vector<Photon> Garfield::AvalancheMicroscopic::m_photons
private

Definition at line 338 of file AvalancheMicroscopic.hh.

◆ m_plotAttachments

bool Garfield::AvalancheMicroscopic::m_plotAttachments = true
private

Definition at line 357 of file AvalancheMicroscopic.hh.

◆ m_plotExcitations

bool Garfield::AvalancheMicroscopic::m_plotExcitations = true
private

Definition at line 355 of file AvalancheMicroscopic.hh.

◆ m_plotIonisations

bool Garfield::AvalancheMicroscopic::m_plotIonisations = true
private

Definition at line 356 of file AvalancheMicroscopic.hh.

◆ m_rknMinh

double Garfield::AvalancheMicroscopic::m_rknMinh = 1.e-5
private

Definition at line 382 of file AvalancheMicroscopic.hh.

◆ m_rknsteperrortol

double Garfield::AvalancheMicroscopic::m_rknsteperrortol = 1.e-10
private

Definition at line 381 of file AvalancheMicroscopic.hh.

◆ m_rknSteps

bool Garfield::AvalancheMicroscopic::m_rknSteps = false
private

Definition at line 380 of file AvalancheMicroscopic.hh.

◆ m_runMode

MPRunMode Garfield::AvalancheMicroscopic::m_runMode {MPRunMode::Normal}
private

◆ m_sensor

Sensor* Garfield::AvalancheMicroscopic::m_sensor = nullptr
private

Definition at line 323 of file AvalancheMicroscopic.hh.

◆ m_showProgress

bool Garfield::AvalancheMicroscopic::m_showProgress {false}
private

Definition at line 318 of file AvalancheMicroscopic.hh.

318{false};

◆ m_sizeCut

unsigned int Garfield::AvalancheMicroscopic::m_sizeCut = 0
private

Definition at line 390 of file AvalancheMicroscopic.hh.

◆ m_stackStoreCPU

std::vector<Seed> Garfield::AvalancheMicroscopic::m_stackStoreCPU
private

Definition at line 329 of file AvalancheMicroscopic.hh.

◆ m_stackStoreGPU

std::vector<Electron> Garfield::AvalancheMicroscopic::m_stackStoreGPU
private

Definition at line 330 of file AvalancheMicroscopic.hh.

◆ m_stats

Statistics Garfield::AvalancheMicroscopic::m_stats
private

Definition at line 321 of file AvalancheMicroscopic.hh.

◆ m_storeDriftLines

bool Garfield::AvalancheMicroscopic::m_storeDriftLines = false
private

Definition at line 373 of file AvalancheMicroscopic.hh.

◆ m_tMax

double Garfield::AvalancheMicroscopic::m_tMax = 0.
private

Definition at line 397 of file AvalancheMicroscopic.hh.

◆ m_tMin

double Garfield::AvalancheMicroscopic::m_tMin = 0.
private

Definition at line 396 of file AvalancheMicroscopic.hh.

◆ m_useBandStructure

bool Garfield::AvalancheMicroscopic::m_useBandStructure = true
private

Definition at line 375 of file AvalancheMicroscopic.hh.

◆ m_useBfield

bool Garfield::AvalancheMicroscopic::m_useBfield = false
private

Definition at line 378 of file AvalancheMicroscopic.hh.

◆ m_useBfieldAuto

bool Garfield::AvalancheMicroscopic::m_useBfieldAuto = true
private

Definition at line 377 of file AvalancheMicroscopic.hh.

◆ m_useNullCollisionSteps

bool Garfield::AvalancheMicroscopic::m_useNullCollisionSteps = false
private

Definition at line 376 of file AvalancheMicroscopic.hh.

◆ m_usePhotons

bool Garfield::AvalancheMicroscopic::m_usePhotons = false
private

Definition at line 374 of file AvalancheMicroscopic.hh.

◆ m_userHandleAttachment

void(* Garfield::AvalancheMicroscopic::m_userHandleAttachment) (double x, double y, double z, double t, int type, int level, Medium *m) = nullptr
private

Definition at line 407 of file AvalancheMicroscopic.hh.

◆ m_userHandleCollision

void(* Garfield::AvalancheMicroscopic::m_userHandleCollision) (double x, double y, double z, double t, int type, int level, Medium *m, double e0, double e1, double dx0, double dy0, double dz0, double dx1, double dy1, double dz1) = nullptr
private

Definition at line 403 of file AvalancheMicroscopic.hh.

◆ m_userHandleInelastic

void(* Garfield::AvalancheMicroscopic::m_userHandleInelastic) (double x, double y, double z, double t, int type, int level, Medium *m) = nullptr
private

Definition at line 409 of file AvalancheMicroscopic.hh.

◆ m_userHandleIonisation

void(* Garfield::AvalancheMicroscopic::m_userHandleIonisation) (double x, double y, double z, double t, int type, int level, Medium *m) = nullptr
private

Definition at line 411 of file AvalancheMicroscopic.hh.

◆ m_userHandleStep

void(* Garfield::AvalancheMicroscopic::m_userHandleStep) (double x, double y, double z, double t, double e, double dx, double dy, double dz, bool hole) = nullptr
private

Definition at line 400 of file AvalancheMicroscopic.hh.

◆ m_useWeightingPotential

bool Garfield::AvalancheMicroscopic::m_useWeightingPotential = true
private

Definition at line 368 of file AvalancheMicroscopic.hh.

◆ m_viewer

ViewDrift* Garfield::AvalancheMicroscopic::m_viewer = nullptr
private

Definition at line 354 of file AvalancheMicroscopic.hh.


The documentation for this class was generated from the following file: