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

Simple component with electric field given by a user function. More...

#include <ComponentUser.hh>

Inheritance diagram for Garfield::ComponentUser:

Public Member Functions

 ComponentUser ()
 Constructor.
 ~ComponentUser ()
 Destructor.
void SetElectricField (std::function< void(const double, const double, const double, double &, double &, double &)>)
 Set the function to be called for calculating the electric field.
void SetElectricField (const std::string &expression)
 Set the expression to be used for calculating the electric field.
void SetPotential (std::function< double(const double, const double, const double)>)
 Set the function to be called for calculating the electric potential.
void SetPotential (const std::string &expression)
 Set the expression to be used for calculating the electric potential.
void SetWeightingField (std::function< void(const double, const double, const double, double &, double &, double &)>, const std::string &label)
 Set the function to be called for calculating the weighting field.
void SetWeightingField (const std::string &expression, const std::string &label)
 Set the expression to be used for calculating the weighting field.
void SetWeightingPotential (std::function< double(const double, const double, const double)>, const std::string &label)
 Set the function to be called for calculating the weighting potential.
void SetWeightingPotential (const std::string &expression, const std::string &label)
 Set the expression to be used for calculating the weighting potential.
void SetDelayedWeightingField (std::function< void(const double, const double, const double, const double, double &, double &, double &)>, const std::string &label)
 Set the function to be called for calculating the delayed weighting field.
void SetDelayedWeightingField (const std::string &expression, const std::string &label)
 Set the expression to be used for calculating the delayed weighting field.
void SetDelayedWeightingPotential (std::function< double(const double, const double, const double, const double)>, const std::string &label)
 Set the function to be called for calculating the delayed weighting potential.
void SetDelayedWeightingPotential (const std::string &expression, const std::string &label)
 Set the expression to be used for calculating the delayed weighting potential.
void SetDelayedSignalTimes (const std::vector< double > &ts)
 Set the time steps at which to evaluate the delayed weighting potential/field.
void SetMagneticField (std::function< void(const double, const double, const double, double &, double &, double &)>)
 Set the function to be called for calculating the magnetic field.
void SetMagneticField (const std::string &expression)
 Set the expression to be used for calculating the magnetic field.
void SetArea (const double xmin, const double ymin, const double zmin, const double xmax, const double ymax, const double zmax)
 Set the limits of the active area explicitly (instead of using a Geometry object).
void UnsetArea ()
 Remove the explicit limits of the active area.
void SetMedium (Medium *medium)
 Set the medium in the active area.
Medium * GetMedium (const double x, const double y, const double z) override
void ElectricField (const double x, const double y, const double z, double &ex, double &ey, double &ez, Medium *&m, int &status) override
void ElectricField (const double x, const double y, const double z, double &ex, double &ey, double &ez, double &v, Medium *&m, int &status) override
bool GetVoltageRange (double &vmin, double &vmax) override
void MagneticField (const double x, const double y, const double z, double &bx, double &by, double &bz, int &status) override
void WeightingField (const double x, const double y, const double z, double &wx, double &wy, double &wz, const std::string &label) override
double WeightingPotential (const double x, const double y, const double z, const std::string &label) override
void DelayedWeightingField (const double x, const double y, const double z, const double t, double &wx, double &wy, double &wz, const std::string &label) override
double DelayedWeightingPotential (const double x, const double y, const double z, const double t, const std::string &label) override
bool GetBoundingBox (double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) override
bool HasMagneticField () const override

Private Member Functions

void Reset () override
 Reset the component.
void UpdatePeriodicity () override
bool InArea (const double x, const double y, const double z)

Private Attributes

std::function< void(const double, const double, const double, double &, double &, double &)> m_efield
 Electric field function.
std::function< double(const double, const double, const double)> m_epot
 Electric potential function.
std::map< std::string, std::function< void(const double, const double, const double, double &, double &, double &)> > m_wfield
 Weighting field functions.
std::map< std::string, std::function< double(const double, const double, const double)> > m_wpot
 Weighting potential functions.
std::map< std::string, std::function< void(const double, const double, const double, const double, double &, double &, double &)> > m_dwfield
 Delayed weighting field functions.
std::map< std::string, std::function< double(const double, const double, const double, const double)> > m_dwpot
 Delayed weighting potential functions.
std::function< void(const double, const double, const double, double &, double &, double &)> m_bfield
 Magnetic field function.
std::array< double, 3 > m_xmin = {{0., 0., 0.}}
std::array< double, 3 > m_xmax = {{0., 0., 0.}}
bool m_hasArea = false
Medium * m_medium = nullptr

Detailed Description

Simple component with electric field given by a user function.

Definition at line 14 of file ComponentUser.hh.

Constructor & Destructor Documentation

◆ ComponentUser()

Garfield::ComponentUser::ComponentUser ( )

Constructor.

◆ ~ComponentUser()

Garfield::ComponentUser::~ComponentUser ( )
inline

Destructor.

Definition at line 19 of file ComponentUser.hh.

19{}

Member Function Documentation

◆ DelayedWeightingField()

void Garfield::ComponentUser::DelayedWeightingField ( const double x,
const double y,
const double z,
const double t,
double & wx,
double & wy,
double & wz,
const std::string & label )
override

◆ DelayedWeightingPotential()

double Garfield::ComponentUser::DelayedWeightingPotential ( const double x,
const double y,
const double z,
const double t,
const std::string & label )
override

◆ ElectricField() [1/2]

void Garfield::ComponentUser::ElectricField ( const double x,
const double y,
const double z,
double & ex,
double & ey,
double & ez,
double & v,
Medium *& m,
int & status )
override

◆ ElectricField() [2/2]

void Garfield::ComponentUser::ElectricField ( const double x,
const double y,
const double z,
double & ex,
double & ey,
double & ez,
Medium *& m,
int & status )
override

◆ GetBoundingBox()

bool Garfield::ComponentUser::GetBoundingBox ( double & xmin,
double & ymin,
double & zmin,
double & xmax,
double & ymax,
double & zmax )
override

◆ GetMedium()

Medium * Garfield::ComponentUser::GetMedium ( const double x,
const double y,
const double z )
inlineoverride

Definition at line 89 of file ComponentUser.hh.

89 {
90 return !m_hasArea ? Component::GetMedium(x, y, z)
91 : InArea(x, y, z) ? m_medium
92 : nullptr;
93 }
bool InArea(const double x, const double y, const double z)

◆ GetVoltageRange()

bool Garfield::ComponentUser::GetVoltageRange ( double & vmin,
double & vmax )
override

◆ HasMagneticField()

bool Garfield::ComponentUser::HasMagneticField ( ) const
override

◆ InArea()

bool Garfield::ComponentUser::InArea ( const double x,
const double y,
const double z )
inlineprivate

Definition at line 167 of file ComponentUser.hh.

167 {
168 return (x >= m_xmin[0] && x <= m_xmax[0] && y >= m_xmin[1] &&
169 y <= m_xmax[1] && z >= m_xmin[2] && z <= m_xmax[2]);
170 }
std::array< double, 3 > m_xmax
std::array< double, 3 > m_xmin

◆ MagneticField()

void Garfield::ComponentUser::MagneticField ( const double x,
const double y,
const double z,
double & bx,
double & by,
double & bz,
int & status )
override

◆ Reset()

void Garfield::ComponentUser::Reset ( )
overrideprivate

Reset the component.

◆ SetArea()

void Garfield::ComponentUser::SetArea ( const double xmin,
const double ymin,
const double zmin,
const double xmax,
const double ymax,
const double zmax )

Set the limits of the active area explicitly (instead of using a Geometry object).

◆ SetDelayedSignalTimes()

void Garfield::ComponentUser::SetDelayedSignalTimes ( const std::vector< double > & ts)

Set the time steps at which to evaluate the delayed weighting potential/field.

◆ SetDelayedWeightingField() [1/2]

void Garfield::ComponentUser::SetDelayedWeightingField ( const std::string & expression,
const std::string & label )

Set the expression to be used for calculating the delayed weighting field.

◆ SetDelayedWeightingField() [2/2]

void Garfield::ComponentUser::SetDelayedWeightingField ( std::function< void(const double, const double, const double, const double, double &, double &, double &)> ,
const std::string & label )

Set the function to be called for calculating the delayed weighting field.

◆ SetDelayedWeightingPotential() [1/2]

void Garfield::ComponentUser::SetDelayedWeightingPotential ( const std::string & expression,
const std::string & label )

Set the expression to be used for calculating the delayed weighting potential.

◆ SetDelayedWeightingPotential() [2/2]

void Garfield::ComponentUser::SetDelayedWeightingPotential ( std::function< double(const double, const double, const double, const double)> ,
const std::string & label )

Set the function to be called for calculating the delayed weighting potential.

◆ SetElectricField() [1/2]

void Garfield::ComponentUser::SetElectricField ( const std::string & expression)

Set the expression to be used for calculating the electric field.

◆ SetElectricField() [2/2]

void Garfield::ComponentUser::SetElectricField ( std::function< void(const double, const double, const double, double &, double &, double &)> )

Set the function to be called for calculating the electric field.

◆ SetMagneticField() [1/2]

void Garfield::ComponentUser::SetMagneticField ( const std::string & expression)

Set the expression to be used for calculating the magnetic field.

◆ SetMagneticField() [2/2]

void Garfield::ComponentUser::SetMagneticField ( std::function< void(const double, const double, const double, double &, double &, double &)> )

Set the function to be called for calculating the magnetic field.

◆ SetMedium()

void Garfield::ComponentUser::SetMedium ( Medium * medium)
inline

Set the medium in the active area.

Definition at line 87 of file ComponentUser.hh.

87{ m_medium = medium; }

◆ SetPotential() [1/2]

void Garfield::ComponentUser::SetPotential ( const std::string & expression)

Set the expression to be used for calculating the electric potential.

◆ SetPotential() [2/2]

void Garfield::ComponentUser::SetPotential ( std::function< double(const double, const double, const double)> )

Set the function to be called for calculating the electric potential.

◆ SetWeightingField() [1/2]

void Garfield::ComponentUser::SetWeightingField ( const std::string & expression,
const std::string & label )

Set the expression to be used for calculating the weighting field.

◆ SetWeightingField() [2/2]

void Garfield::ComponentUser::SetWeightingField ( std::function< void(const double, const double, const double, double &, double &, double &)> ,
const std::string & label )

Set the function to be called for calculating the weighting field.

◆ SetWeightingPotential() [1/2]

void Garfield::ComponentUser::SetWeightingPotential ( const std::string & expression,
const std::string & label )

Set the expression to be used for calculating the weighting potential.

◆ SetWeightingPotential() [2/2]

void Garfield::ComponentUser::SetWeightingPotential ( std::function< double(const double, const double, const double)> ,
const std::string & label )

Set the function to be called for calculating the weighting potential.

◆ UnsetArea()

void Garfield::ComponentUser::UnsetArea ( )

Remove the explicit limits of the active area.

◆ UpdatePeriodicity()

void Garfield::ComponentUser::UpdatePeriodicity ( )
overrideprivate

◆ WeightingField()

void Garfield::ComponentUser::WeightingField ( const double x,
const double y,
const double z,
double & wx,
double & wy,
double & wz,
const std::string & label )
override

◆ WeightingPotential()

double Garfield::ComponentUser::WeightingPotential ( const double x,
const double y,
const double z,
const std::string & label )
override

Member Data Documentation

◆ m_bfield

std::function<void(const double, const double, const double, double&, double&, double&)> Garfield::ComponentUser::m_bfield
private

Magnetic field function.

Definition at line 152 of file ComponentUser.hh.

◆ m_dwfield

std::map<std::string, std::function<void(const double, const double, const double, const double, double&, double&, double&)> > Garfield::ComponentUser::m_dwfield
private

Delayed weighting field functions.

Definition at line 142 of file ComponentUser.hh.

◆ m_dwpot

std::map<std::string, std::function<double(const double, const double, const double, const double)> > Garfield::ComponentUser::m_dwpot
private

Delayed weighting potential functions.

Definition at line 147 of file ComponentUser.hh.

◆ m_efield

std::function<void(const double, const double, const double, double&, double&, double&)> Garfield::ComponentUser::m_efield
private

Electric field function.

Definition at line 123 of file ComponentUser.hh.

◆ m_epot

std::function<double(const double, const double, const double)> Garfield::ComponentUser::m_epot
private

Electric potential function.

Definition at line 125 of file ComponentUser.hh.

◆ m_hasArea

bool Garfield::ComponentUser::m_hasArea = false
private

Definition at line 158 of file ComponentUser.hh.

◆ m_medium

Medium* Garfield::ComponentUser::m_medium = nullptr
private

Definition at line 160 of file ComponentUser.hh.

◆ m_wfield

std::map<std::string, std::function<void(const double, const double, const double, double&, double&, double&)> > Garfield::ComponentUser::m_wfield
private

Weighting field functions.

Definition at line 131 of file ComponentUser.hh.

◆ m_wpot

std::map<std::string, std::function<double(const double, const double, const double)> > Garfield::ComponentUser::m_wpot
private

Weighting potential functions.

Definition at line 136 of file ComponentUser.hh.

◆ m_xmax

std::array<double, 3> Garfield::ComponentUser::m_xmax = {{0., 0., 0.}}
private

Definition at line 156 of file ComponentUser.hh.

156{{0., 0., 0.}};

◆ m_xmin

std::array<double, 3> Garfield::ComponentUser::m_xmin = {{0., 0., 0.}}
private

Definition at line 155 of file ComponentUser.hh.

155{{0., 0., 0.}};

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