![]() |
Garfield 0.3
Toolkit for the detailed simulation of particle detectors based on ionization measurement in gases and semiconductors
|
Semi-analytic calculation of two-dimensional configurations consisting of wires, planes, and tubes. More...
#include <ComponentAnalyticField.hh>
Classes | |
struct | Charge3d |
struct | Pixel |
struct | Plane |
struct | Strip |
struct | Wire |
Public Types | |
enum | Cell { A00 , B1X , B1Y , B2X , B2Y , C10 , C2X , C2Y , C30 , D10 , D20 , D30 , D40 , Unknown } |
Public Member Functions | |
ComponentAnalyticField () | |
Constructor. | |
~ComponentAnalyticField () | |
Destructor. | |
void | SetMedium (Medium *medium) |
Set the medium inside the cell. | |
void | AddWire (const double x, const double y, const double diameter, const double voltage, const std::string &label="", const double length=100., const double tension=50., const double rho=19.3, const int ntrap=5) |
Add a wire at (x, y) . | |
void | AddTube (const double radius, const double voltage, const int nEdges, const std::string &label="") |
Add a tube. | |
void | AddPlaneX (const double x, const double voltage, const std::string &label="") |
Add a plane at constant x. | |
void | AddPlaneY (const double y, const double voltage, const std::string &label="") |
Add a plane at constant y. | |
void | AddPlaneR (const double r, const double voltage, const std::string &label="") |
Add a plane at constant radius. | |
void | AddPlanePhi (const double phi, const double voltage, const std::string &label="") |
Add a plane at constant phi. | |
void | AddStripOnPlaneX (const char direction, const double x, const double smin, const double smax, const std::string &label, const double gap=-1.) |
Add a strip in the y or z direction on an existing plane at constant x. | |
void | AddStripOnPlaneY (const char direction, const double y, const double smin, const double smax, const std::string &label, const double gap=-1.) |
Add a strip in the x or z direction on an existing plane at constant y. | |
void | AddStripOnPlaneR (const char direction, const double r, const double smin, const double smax, const std::string &label, const double gap=-1.) |
Add a strip in the phi or z direction on an existing plane at constant radius. | |
void | AddStripOnPlanePhi (const char direction, const double phi, const double smin, const double smax, const std::string &label, const double gap=-1.) |
Add a strip in the r or z direction on an existing plane at constant phi. | |
void | AddPixelOnPlaneX (const double x, const double ymin, const double ymax, const double zmin, const double zmax, const std::string &label, const double gap=-1., const double rot=0.) |
Add a pixel on an existing plane at constant x. | |
void | AddPixelOnPlaneY (const double y, const double xmin, const double xmax, const double zmin, const double zmax, const std::string &label, const double gap=-1., const double rot=0.) |
Add a pixel on an existing plane at constant y. | |
void | AddPixelOnPlaneR (const double r, const double phimin, const double phimax, const double zmin, const double zmax, const std::string &label, const double gap=-1.) |
Add a pixel on an existing plane at constant radius. | |
void | AddPixelOnPlanePhi (const double phi, const double rmin, const double rmax, const double zmin, const double zmax, const std::string &label, const double gap=-1.) |
Add a pixel on an existing plane at constant phi. | |
void | SetPeriodicityX (const double s) |
Set the periodic length [cm] in the x-direction. | |
void | SetPeriodicityY (const double s) |
Set the periodic length [cm] in the y-direction. | |
void | SetPeriodicityPhi (const double phi) |
Set the periodicity [degree] in phi. | |
bool | GetPeriodicityX (double &s) |
Get the periodic length in the x-direction. | |
bool | GetPeriodicityY (double &s) |
Get the periodic length in the y-direction. | |
bool | GetPeriodicityPhi (double &s) |
Get the periodicity [degree] in phi. | |
void | SetCartesianCoordinates () |
Use Cartesian coordinates (default). | |
void | SetPolarCoordinates () |
Use polar coordinates. | |
bool | IsPolar () const |
Are polar coordinates being used? | |
void | PrintCell () |
Print all available information on the cell. | |
void | PlotCell (TPad *pad) |
Make a plot of the cell layout. | |
void | AddCharge (const double x, const double y, const double z, const double q) |
Add a point charge. | |
void | ClearCharges () |
Remove all point charges. | |
void | PrintCharges () const |
Print a list of the point charges. | |
std::string | GetCellType () |
Return the cell type. | |
void | AddReadout (const std::string &label, const bool silent=false) |
Request calculation of weighting field and potential for a given group of wires or planes. | |
void | SetNumberOfCellCopies (const unsigned int nfourier) |
bool | MultipoleMoments (const unsigned int iw, const unsigned int order=4, const bool print=false, const bool plot=false, const double rmult=1., const double eps=1.e-4, const unsigned int nMaxIter=20) |
Calculate multipole moments for a given wire. | |
void | EnableDipoleTerms (const bool on=true) |
Request dipole terms be included for each of the wires (default: off). | |
void | EnableChargeCheck (const bool on=true) |
Check the quality of the capacitance matrix inversion (default: off). | |
unsigned int | GetNumberOfWires () const |
Get the number of wires. | |
bool | GetWire (const unsigned int i, double &x, double &y, double &diameter, double &voltage, std::string &label, double &length, double &charge, int &ntrap) const |
Retrieve the parameters of a wire. | |
unsigned int | GetNumberOfPlanesX () const |
Get the number of equipotential planes at constant x. | |
unsigned int | GetNumberOfPlanesY () const |
Get the number of equipotential planes at constant y. | |
unsigned int | GetNumberOfPlanesR () const |
Get the number of equipotential planes at constant radius. | |
unsigned int | GetNumberOfPlanesPhi () const |
Get the number of equipotential planes at constant phi. | |
bool | GetPlaneX (const unsigned int i, double &x, double &voltage, std::string &label) const |
Retrieve the parameters of a plane at constant x. | |
bool | GetPlaneY (const unsigned int i, double &y, double &voltage, std::string &label) const |
Retrieve the parameters of a plane at constant y. | |
bool | GetPlaneR (const unsigned int i, double &r, double &voltage, std::string &label) const |
Retrieve the parameters of a plane at constant radius. | |
bool | GetPlanePhi (const unsigned int i, double &phi, double &voltage, std::string &label) const |
Retrieve the parameters of a plane at constant phi. | |
bool | GetTube (double &r, double &voltage, int &nEdges, std::string &label) const |
Retrieve the tube parameters. | |
bool | OptimiseOnTrack (const std::vector< std::string > &groups, const std::string &field_function, const double target, const double x0, const double y0, const double x1, const double y1, const unsigned int nP=20, const bool print=true) |
Vary the potential of selected electrodes to match (a function of) the potential or field along a given line to a target. | |
bool | OptimiseOnGrid (const std::vector< std::string > &groups, const std::string &field_function, const double target, const double x0, const double y0, const double x1, const double y1, const unsigned int nX=10, const unsigned int nY=10, const bool print=true) |
Vary the potential of selected electrodes to match (a function of) the potential or field on an x-y (or r-phi) grid of points. | |
bool | OptimiseOnWires (const std::vector< std::string > &groups, const std::string &field_function, const double target, const std::vector< unsigned int > &wires, const bool print=true) |
Vary the potential of selected electrodes to match (a function of) the potential or field on the surfaces of a set of wires. | |
void | SetOptimisationParameters (const double dist=1., const double eps=1.e-4, const unsigned int nMaxIter=10) |
Set the conditions at which to allow the iteration to stop. | |
bool | ElectricFieldAtWire (const unsigned int iw, double &ex, double &ey) |
Calculate the electric field at a given wire position, as if the wire itself were not there, but with the presence of its mirror images. | |
void | SetScanningGrid (const unsigned int nX, const unsigned int nY) |
Set the number of grid lines at which the electrostatic force as function of the wire displacement is computed. | |
void | SetScanningArea (const double xmin, const double xmax, const double ymin, const double ymax) |
Specify explicitly the boundaries of the the scanning area (i. | |
void | SetScanningAreaLargest () |
Set the scanning area to the largest area around each wire which is free from other cell elements. | |
void | SetScanningAreaFirstOrder (const double scale=2.) |
Set the scanning area based on the zeroth-order estimates of the wire shift, enlarged by a scaling factor. | |
void | EnableExtrapolation (const bool on=true) |
Switch on/off extrapolation of electrostatic forces beyond the scanning area (default: off). | |
void | SetGravity (const double dx, const double dy, const double dz) |
Set the gravity orientation. | |
void | GetGravity (double &dx, double &dy, double &dz) const |
Get the gravity orientation. | |
void | EnableGravity (const bool on=true) |
Include gravity in the sag computation or not. | |
void | EnableElectrostaticForce (const bool on=true) |
Include the electrostatic force in the sag computation or not. | |
bool | ForcesOnWire (const unsigned int iw, std::vector< double > &xMap, std::vector< double > &yMap, std::vector< std::vector< double > > &fxMap, std::vector< std::vector< double > > &fyMap) |
Calculate a table of the forces acting on a wire. | |
bool | WireDisplacement (const unsigned int iw, const bool detailed, std::vector< double > &csag, std::vector< double > &xsag, std::vector< double > &ysag, double &stretch, const bool print=true) |
Compute the sag profile of a wire. | |
void | SetNumberOfShots (const unsigned int n) |
Set the number of shots used for numerically solving the wire sag differential equation. | |
void | SetNumberOfSteps (const unsigned int n) |
Set the number of integration steps within each shot (must be >= 1). | |
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 &pmin, double &pmax) 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 |
bool | GetBoundingBox (double &x0, double &y0, double &z0, double &x1, double &y1, double &z1) override |
bool | GetElementaryCell (double &x0, double &y0, double &z0, double &x1, double &y1, double &z1) override |
bool | CrossedWire (const double x0, const double y0, const double z0, const double x1, const double y1, const double z1, double &xc, double &yc, double &zc, const bool centre, double &rc) override |
bool | InTrapRadius (const double q0, const double x0, const double y0, const double z0, double &xw, double &yx, double &rw) override |
bool | CrossedPlane (const double x0, const double y0, const double z0, const double x1, const double y1, const double z1, double &xc, double &yc, double &zc) override |
double | StepSizeHint () override |
Private Types | |
enum class | ScanningRange { Largest = 0 , FirstOrder , User } |
Private Member Functions | |
void | UpdatePeriodicity () override |
void | Reset () override |
void | CellInit () |
bool | Prepare () |
bool | CellCheck () |
bool | WireCheck () const |
bool | CellType () |
std::string | GetCellType (const Cell) const |
bool | PrepareStrips () |
bool | PrepareSignals () |
bool | SetupWireSignals () |
bool | SetupPlaneSignals () |
bool | Setup () |
bool | Update (const std::vector< double > &vw, const std::array< double, 5 > &vp) |
bool | SetupA00 () |
bool | SetupB1X () |
bool | SetupB1Y () |
bool | SetupB2X () |
bool | SetupB2Y () |
bool | SetupC10 () |
bool | SetupC2X () |
bool | SetupC2Y () |
bool | SetupC30 () |
bool | SetupD10 () |
bool | SetupD20 () |
bool | SetupD30 () |
bool | IprA00 (const int mx, const int my, std::vector< std::vector< std::complex< double > > > &mat) |
bool | IprB2X (const int my, std::vector< std::vector< std::complex< double > > > &mat) |
bool | IprB2Y (const int mx, std::vector< std::vector< std::complex< double > > > &mat) |
bool | IprC2X (std::vector< std::vector< std::complex< double > > > &mat) |
bool | IprC2Y (std::vector< std::vector< std::complex< double > > > &mat) |
bool | IprC30 (std::vector< std::vector< std::complex< double > > > &mat) |
bool | IprD10 (std::vector< std::vector< std::complex< double > > > &mat) |
bool | IprD30 (std::vector< std::vector< std::complex< double > > > &mat) |
bool | SetupDipoleTerms () |
bool | Charge (std::vector< std::vector< double > > &mat) |
int | Field (const double xin, const double yin, const double zin, double &ex, double &ey, double &ez, double &volt, const bool opt) |
void | FieldA00 (const double xpos, const double ypos, double &ex, double &ey, double &volt, const bool opt) const |
void | FieldB1X (const double xpos, const double ypos, double &ex, double &ey, double &volt, const bool opt) const |
void | FieldB1Y (const double xpos, const double ypos, double &ex, double &ey, double &volt, const bool opt) const |
void | FieldB2X (const double xpos, const double ypos, double &ex, double &ey, double &volt, const bool opt) const |
void | FieldB2Y (const double xpos, const double ypos, double &ex, double &ey, double &volt, const bool opt) const |
void | FieldC10 (const double xpos, const double ypos, double &ex, double &ey, double &volt, const bool opt) const |
void | FieldC2X (const double xpos, const double ypos, double &ex, double &ey, double &volt, const bool opt) const |
void | FieldC2Y (const double xpos, const double ypos, double &ex, double &ey, double &volt, const bool opt) const |
void | FieldC30 (const double xpos, const double ypos, double &ex, double &ey, double &volt, const bool opt) const |
void | FieldD10 (const double xpos, const double ypos, double &ex, double &ey, double &volt, const bool opt) const |
void | FieldD20 (const double xpos, const double ypos, double &ex, double &ey, double &volt, const bool opt) const |
void | FieldD30 (const double xpos, const double ypos, double &ex, double &ey, double &volt, const bool opt) const |
void | Field3dA00 (const double x, const double y, const double z, double &ex, double &ey, double &ez, double &volt) const |
void | Field3dB2X (const double x, const double y, const double z, double &ex, double &ey, double &ez, double &volt) const |
void | Field3dB2Y (const double x, const double y, const double z, double &ex, double &ey, double &ez, double &volt) const |
void | Field3dD10 (const double x, const double y, const double z, double &ex, double &ey, double &ez, double &volt) const |
bool | Wfield (const double x, const double y, const double z, double &ex, double &ey, double &ez, const std::string &label) const |
void | WfieldWireA00 (const double x, const double y, double &ex, double &ey, const int mx, const int my, const std::vector< double > &qw) const |
void | WfieldWireB2X (const double x, const double y, double &ex, double &ey, const int my, const std::vector< double > &qw) const |
void | WfieldWireB2Y (const double x, const double y, double &ex, double &ey, const int mx, const std::vector< double > &qw) const |
void | WfieldWireC2X (const double x, const double y, double &ex, double &ey, const std::vector< double > &qw) const |
void | WfieldWireC2Y (const double x, const double y, double &ex, double &ey, const std::vector< double > &qw) const |
void | WfieldWireC30 (const double x, const double y, double &ex, double &ey, const std::vector< double > &qw) const |
void | WfieldWireD10 (const double x, const double y, double &ex, double &ey, const std::vector< double > &qw) const |
void | WfieldWireD30 (const double x, const double y, double &ex, double &ey, const std::vector< double > &qw) const |
void | WfieldPlaneA00 (const double x, const double y, double &ex, double &ey, const int mx, const int my, const std::vector< double > &qp) const |
void | WfieldPlaneB2X (const double x, const double y, double &ex, double &ey, const int my, const std::vector< double > &qp) const |
void | WfieldPlaneB2Y (const double x, const double ypos, double &ex, double &ey, const int mx, const std::vector< double > &qp) const |
void | WfieldPlaneC2X (const double x, const double y, double &ex, double &ey, const std::vector< double > &qp) const |
void | WfieldPlaneC2Y (const double x, const double y, double &ex, double &ey, const std::vector< double > &qp) const |
void | WfieldPlaneC30 (const double x, const double y, double &ex, double &ey, const std::vector< double > &qp) const |
void | WfieldPlaneD10 (const double x, const double y, double &ex, double &ey, const std::vector< double > &qp) const |
void | WfieldPlaneD30 (const double x, const double y, double &ex, double &ey, const std::vector< double > &qp) const |
void | WfieldStripZ (const double x, const double y, double &ex, double &ey, const int ip, const Strip &strip) const |
void | WfieldStripXy (const double x, const double y, const double z, double &ex, double &ey, double &ez, const int ip, const Strip &strip) const |
void | WfieldStrip (const double x, const double y, const double g, const double w, double &fx, double &fy) const |
void | WfieldPixel (const double x, const double y, const double z, double &ex, double &ey, double &ez, const int ip, const Pixel &pixel) const |
double | Wpot (const double x, const double y, const double z, const std::string &label) const |
double | WpotWireA00 (const double x, const double y, const int mx, const int my, const std::vector< double > &qw) const |
double | WpotWireB2X (const double x, const double y, const int my, const std::vector< double > &qw) const |
double | WpotWireB2Y (const double x, const double y, const int mx, const std::vector< double > &qw) const |
double | WpotWireC2X (const double x, const double y, const std::vector< double > &qw) const |
double | WpotWireC2Y (const double x, const double y, const std::vector< double > &qw) const |
double | WpotWireC30 (const double x, const double y, const std::vector< double > &qw) const |
double | WpotWireD10 (const double x, const double y, const std::vector< double > &qw) const |
double | WpotWireD30 (const double x, const double y, const std::vector< double > &qw) const |
double | WpotPlaneA00 (const double x, const double y, const int mx, const int my, const std::vector< double > &qp) const |
double | WpotPlaneB2X (const double x, const double y, const int my, const std::vector< double > &qp) const |
double | WpotPlaneB2Y (const double x, const double y, const int mx, const std::vector< double > &qp) const |
double | WpotPlaneC2X (const double x, const double y, const std::vector< double > &qp) const |
double | WpotPlaneC2Y (const double x, const double y, const std::vector< double > &qp) const |
double | WpotPlaneC30 (const double x, const double y, const std::vector< double > &qp) const |
double | WpotPlaneD10 (const double x, const double y, const std::vector< double > &qp) const |
double | WpotPlaneD30 (const double x, const double y, const std::vector< double > &qp) const |
double | WpotStripZ (const double x, const double y, const int ip, const Strip &strip) const |
double | WpotStripXy (const double x, const double y, const double z, const int ip, const Strip &strip) const |
double | WpotPixel (const double x, const double y, const double z, const int ip, const Pixel &pixel) const |
void | FieldAtWireA00 (const double xpos, const double ypos, double &ex, double &ey, const std::vector< bool > &cnalso) const |
void | FieldAtWireB1X (const double xpos, const double ypos, double &ex, double &ey, const std::vector< bool > &cnalso) const |
void | FieldAtWireB1Y (const double xpos, const double ypos, double &ex, double &ey, const std::vector< bool > &cnalso) const |
void | FieldAtWireB2X (const double xpos, const double ypos, double &ex, double &ey, const std::vector< bool > &cnalso) const |
void | FieldAtWireB2Y (const double xpos, const double ypos, double &ex, double &ey, const std::vector< bool > &cnalso) const |
void | FieldAtWireC10 (const double xpos, const double ypos, double &ex, double &ey, const std::vector< bool > &cnalso) const |
void | FieldAtWireC2X (const double xpos, const double ypos, double &ex, double &ey, const std::vector< bool > &cnalso) const |
void | FieldAtWireC2Y (const double xpos, const double ypos, double &ex, double &ey, const std::vector< bool > &cnalso) const |
void | FieldAtWireC30 (const double xpos, const double ypos, double &ex, double &ey, const std::vector< bool > &cnalso) const |
void | FieldAtWireD10 (const double xpos, const double ypos, double &ex, double &ey, const std::vector< bool > &cnalso) const |
void | FieldAtWireD20 (const double xpos, const double ypos, double &ex, double &ey, const std::vector< bool > &cnalso) const |
void | FieldAtWireD30 (const double xpos, const double ypos, double &ex, double &ey, const std::vector< bool > &cnalso) const |
void | DipoleFieldA00 (const double xpos, const double ypos, double &ex, double &ey, double &volt, const bool opt) const |
void | DipoleFieldB1X (const double xpos, const double ypos, double &ex, double &ey, double &volt, const bool opt) const |
void | DipoleFieldB1Y (const double xpos, const double ypos, double &ex, double &ey, double &volt, const bool opt) const |
void | DipoleFieldB2X (const double xpos, const double ypos, double &ex, double &ey, double &volt, const bool opt) const |
void | DipoleFieldB2Y (const double xpos, const double ypos, double &ex, double &ey, double &volt, const bool opt) const |
double | Ph2 (const double xpos, const double ypos) const |
double | Ph2Lim (const double radius) const |
void | E2Sum (const double xpos, const double ypos, double &ex, double &ey) const |
void | ConformalMap (const std::complex< double > &z, std::complex< double > &ww, std::complex< double > &wd) const |
bool | SagDetailed (const Wire &wire, const std::vector< double > &xMap, const std::vector< double > &yMap, const std::vector< std::vector< double > > &fxMap, const std::vector< std::vector< double > > &fyMap, std::vector< double > &csag, std::vector< double > &xsag, std::vector< double > &ysag) const |
bool | GetForceRatio (const Wire &wire, const double coor, const std::array< double, 2 > &bend, const std::array< double, 2 > &dbend, std::array< double, 2 > &f, const std::vector< double > &xMap, const std::vector< double > &yMap, const std::vector< std::vector< double > > &fxMap, const std::vector< std::vector< double > > &fyMap) const |
bool | FindZeroes (const Wire &wire, const double h, std::vector< double > &x, const std::vector< double > &xMap, const std::vector< double > &yMap, const std::vector< std::vector< double > > &fxMap, const std::vector< std::vector< double > > &fyMap) const |
bool | StepRKN (const Wire &wire, const double h, double &x, std::array< double, 2 > &y, std::array< double, 2 > &yp, const std::vector< double > &xMap, const std::vector< double > &yMap, const std::vector< std::vector< double > > &fxMap, const std::vector< std::vector< double > > &fyMap) const |
bool | Trace (const Wire &wire, const double h, const std::vector< double > &xx, std::vector< double > &f, const std::vector< double > &xMap, const std::vector< double > &yMap, const std::vector< std::vector< double > > &fxMap, const std::vector< std::vector< double > > &fyMap) const |
size_t | SignalLayer (const int mx, const int my) const |
void | InitialiseFitParameters (const std::vector< std::string > &groups, std::vector< double > &vw0, std::array< double, 5 > &vp0, std::vector< double > &aFit, std::vector< std::vector< unsigned int > > &wiresInGroup, std::vector< std::vector< unsigned int > > &planesInGroup) |
Static Private Member Functions | |
static bool | InTube (const double x0, const double y0, const double a, const int n) |
Private Attributes | |
std::mutex | m_mutex |
Medium * | m_medium = nullptr |
bool | m_chargeCheck = false |
bool | m_cellset = false |
bool | m_sigset = false |
bool | m_polar = false |
Cell | m_cellType |
double | m_xmin |
double | m_xmax |
double | m_ymin |
double | m_ymax |
double | m_zmin |
double | m_zmax |
double | m_vmin |
double | m_vmax |
bool | m_perx = false |
bool | m_pery = false |
double | m_sx |
double | m_sy |
int | m_nFourier = 1 |
Cell | m_cellTypeFourier = A00 |
bool | m_fperx = false |
bool | m_fpery = false |
int | m_mxmin = 0 |
int | m_mxmax = 0 |
int | m_mymin = 0 |
int | m_mymax = 0 |
int | m_mfexp = 0 |
std::vector< std::string > | m_readout |
unsigned int | m_nWires |
std::vector< Wire > | m_w |
bool | m_dipole = false |
std::vector< double > | m_cosph2 |
std::vector< double > | m_sinph2 |
std::vector< double > | m_amp2 |
std::vector< double > | m_b2sin |
int | m_mode |
std::complex< double > | m_zmult |
double | m_p1 |
double | m_p2 |
double | m_c1 |
std::vector< std::complex< double > > | m_zw |
double | m_kappa |
double | m_v0 |
double | m_corvta |
double | m_corvtb |
double | m_corvtc |
bool | m_ynplan [4] |
bool | m_ynplax |
bool | m_ynplay |
double | m_coplan [4] |
double | m_coplax |
double | m_coplay |
double | m_vtplan [4] |
std::array< Plane, 5 > | m_planes |
bool | m_tube = false |
int | m_mtube = 0 |
int | m_ntube = 1 |
double | m_cotube = 1. |
double | m_cotube2 = 1. |
double | m_vttube = 0. |
double | m_dmin = -1. |
std::vector< std::vector< std::vector< double > > > | m_qwire |
std::vector< std::vector< std::vector< double > > > | m_qplane |
std::vector< Charge3d > | m_ch3d |
unsigned int | m_nTermBessel = 10 |
unsigned int | m_nTermPoly = 100 |
bool | m_useElectrostaticForce = true |
bool | m_useGravitationalForce = true |
std::array< double, 3 > | m_down {{0, 0, 1}} |
unsigned int | m_nShots = 2 |
unsigned int | m_nSteps = 20 |
ScanningRange | m_scanRange = ScanningRange::FirstOrder |
double | m_xScanMin = 0. |
double | m_xScanMax = 0. |
double | m_yScanMin = 0. |
double | m_yScanMax = 0. |
double | m_scaleRange = 2. |
unsigned int | m_nScanX = 11 |
unsigned int | m_nScanY = 11 |
bool | m_extrapolateForces = false |
double | m_optDist = 1. |
double | m_optEps = 1.e-4 |
unsigned int | m_optNitmax = 10 |
Semi-analytic calculation of two-dimensional configurations consisting of wires, planes, and tubes.
Definition at line 21 of file ComponentAnalyticField.hh.
|
strongprivate |
Enumerator | |
---|---|
Largest | |
FirstOrder | |
User |
Definition at line 536 of file ComponentAnalyticField.hh.
Garfield::ComponentAnalyticField::ComponentAnalyticField | ( | ) |
Constructor.
|
inline |
void Garfield::ComponentAnalyticField::AddCharge | ( | const double | x, |
const double | y, | ||
const double | z, | ||
const double | q ) |
Add a point charge.
void Garfield::ComponentAnalyticField::AddPixelOnPlanePhi | ( | const double | phi, |
const double | rmin, | ||
const double | rmax, | ||
const double | zmin, | ||
const double | zmax, | ||
const std::string & | label, | ||
const double | gap = -1. ) |
Add a pixel on an existing plane at constant phi.
void Garfield::ComponentAnalyticField::AddPixelOnPlaneR | ( | const double | r, |
const double | phimin, | ||
const double | phimax, | ||
const double | zmin, | ||
const double | zmax, | ||
const std::string & | label, | ||
const double | gap = -1. ) |
Add a pixel on an existing plane at constant radius.
void Garfield::ComponentAnalyticField::AddPixelOnPlaneX | ( | const double | x, |
const double | ymin, | ||
const double | ymax, | ||
const double | zmin, | ||
const double | zmax, | ||
const std::string & | label, | ||
const double | gap = -1., | ||
const double | rot = 0. ) |
Add a pixel on an existing plane at constant x.
x | coordinate of the plane. |
ymin | lower limit of the pixel cell in y, |
ymax | upper limit of the pixel cell in y. |
zmin | lower limit of the pixel cell in z. |
zmax | upper limit of the pixel cell in z. |
label | weighting field identifier. |
gap | distance to the opposite plane (optional). |
rot | rotation angle (rad) of the pixel (optional). |
void Garfield::ComponentAnalyticField::AddPixelOnPlaneY | ( | const double | y, |
const double | xmin, | ||
const double | xmax, | ||
const double | zmin, | ||
const double | zmax, | ||
const std::string & | label, | ||
const double | gap = -1., | ||
const double | rot = 0. ) |
Add a pixel on an existing plane at constant y.
void Garfield::ComponentAnalyticField::AddPlanePhi | ( | const double | phi, |
const double | voltage, | ||
const std::string & | label = "" ) |
Add a plane at constant phi.
void Garfield::ComponentAnalyticField::AddPlaneR | ( | const double | r, |
const double | voltage, | ||
const std::string & | label = "" ) |
Add a plane at constant radius.
void Garfield::ComponentAnalyticField::AddPlaneX | ( | const double | x, |
const double | voltage, | ||
const std::string & | label = "" ) |
Add a plane at constant x.
void Garfield::ComponentAnalyticField::AddPlaneY | ( | const double | y, |
const double | voltage, | ||
const std::string & | label = "" ) |
Add a plane at constant y.
void Garfield::ComponentAnalyticField::AddReadout | ( | const std::string & | label, |
const bool | silent = false ) |
Request calculation of weighting field and potential for a given group of wires or planes.
void Garfield::ComponentAnalyticField::AddStripOnPlanePhi | ( | const char | direction, |
const double | phi, | ||
const double | smin, | ||
const double | smax, | ||
const std::string & | label, | ||
const double | gap = -1. ) |
Add a strip in the r or z direction on an existing plane at constant phi.
void Garfield::ComponentAnalyticField::AddStripOnPlaneR | ( | const char | direction, |
const double | r, | ||
const double | smin, | ||
const double | smax, | ||
const std::string & | label, | ||
const double | gap = -1. ) |
Add a strip in the phi or z direction on an existing plane at constant radius.
void Garfield::ComponentAnalyticField::AddStripOnPlaneX | ( | const char | direction, |
const double | x, | ||
const double | smin, | ||
const double | smax, | ||
const std::string & | label, | ||
const double | gap = -1. ) |
Add a strip in the y or z direction on an existing plane at constant x.
direction | 'y' or 'z'. |
x | coordinate of the plane. |
smin | lower limit of the strip in y or z. |
smax | upper limit of the strip in y or z. |
label | weighting field identifier. |
gap | distance to the opposite plane (optional). |
void Garfield::ComponentAnalyticField::AddStripOnPlaneY | ( | const char | direction, |
const double | y, | ||
const double | smin, | ||
const double | smax, | ||
const std::string & | label, | ||
const double | gap = -1. ) |
Add a strip in the x or z direction on an existing plane at constant y.
void Garfield::ComponentAnalyticField::AddTube | ( | const double | radius, |
const double | voltage, | ||
const int | nEdges, | ||
const std::string & | label = "" ) |
Add a tube.
void Garfield::ComponentAnalyticField::AddWire | ( | const double | x, |
const double | y, | ||
const double | diameter, | ||
const double | voltage, | ||
const std::string & | label = "", | ||
const double | length = 100., | ||
const double | tension = 50., | ||
const double | rho = 19.3, | ||
const int | ntrap = 5 ) |
Add a wire at (x, y) .
|
private |
|
private |
|
private |
|
private |
void Garfield::ComponentAnalyticField::ClearCharges | ( | ) |
Remove all point charges.
|
private |
|
override |
|
override |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
override |
|
override |
bool Garfield::ComponentAnalyticField::ElectricFieldAtWire | ( | const unsigned int | iw, |
double & | ex, | ||
double & | ey ) |
Calculate the electric field at a given wire position, as if the wire itself were not there, but with the presence of its mirror images.
|
inline |
Check the quality of the capacitance matrix inversion (default: off).
Definition at line 186 of file ComponentAnalyticField.hh.
void Garfield::ComponentAnalyticField::EnableDipoleTerms | ( | const bool | on = true | ) |
Request dipole terms be included for each of the wires (default: off).
|
inline |
Include the electrostatic force in the sag computation or not.
Definition at line 289 of file ComponentAnalyticField.hh.
|
inline |
Switch on/off extrapolation of electrostatic forces beyond the scanning area (default: off).
Definition at line 280 of file ComponentAnalyticField.hh.
|
inline |
Include gravity in the sag computation or not.
Definition at line 287 of file ComponentAnalyticField.hh.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
bool Garfield::ComponentAnalyticField::ForcesOnWire | ( | const unsigned int | iw, |
std::vector< double > & | xMap, | ||
std::vector< double > & | yMap, | ||
std::vector< std::vector< double > > & | fxMap, | ||
std::vector< std::vector< double > > & | fyMap ) |
Calculate a table of the forces acting on a wire.
iw | index of the wire |
xMap | coordinates of the grid lines in x |
yMap | coordinates of the grid lines in y |
fxMap | x-components of the force at the grid points |
fyMap | y-components of the force at the grid points |
|
override |
|
inline |
Return the cell type.
Cells are classified according to the number and orientation of planes, the presence of periodicities and the location of the wires as one of the following types:
A non-periodic cells with at most 1 x- and 1 y-plane B1X x-periodic cells without x-planes and at most 1 y-plane B1Y y-periodic cells without y-planes and at most 1 x-plane B2X cells with 2 x-planes and at most 1 y-plane B2Y cells with 2 y-planes and at most 1 x-plane C1 doubly periodic cells without planes C2X doubly periodic cells with x-planes C2Y doubly periodic cells with y-planes C3 double periodic cells with x- and y-planes D1 round tubes without axial periodicity D2 round tubes with axial periodicity D3 polygonal tubes without axial periodicity
Definition at line 156 of file ComponentAnalyticField.hh.
|
private |
|
override |
|
private |
void Garfield::ComponentAnalyticField::GetGravity | ( | double & | dx, |
double & | dy, | ||
double & | dz ) const |
Get the gravity orientation.
|
override |
unsigned int Garfield::ComponentAnalyticField::GetNumberOfPlanesPhi | ( | ) | const |
Get the number of equipotential planes at constant phi.
unsigned int Garfield::ComponentAnalyticField::GetNumberOfPlanesR | ( | ) | const |
Get the number of equipotential planes at constant radius.
unsigned int Garfield::ComponentAnalyticField::GetNumberOfPlanesX | ( | ) | const |
Get the number of equipotential planes at constant x.
unsigned int Garfield::ComponentAnalyticField::GetNumberOfPlanesY | ( | ) | const |
Get the number of equipotential planes at constant y.
|
inline |
Get the number of wires.
Definition at line 189 of file ComponentAnalyticField.hh.
bool Garfield::ComponentAnalyticField::GetPeriodicityPhi | ( | double & | s | ) |
Get the periodicity [degree] in phi.
bool Garfield::ComponentAnalyticField::GetPeriodicityX | ( | double & | s | ) |
Get the periodic length in the x-direction.
bool Garfield::ComponentAnalyticField::GetPeriodicityY | ( | double & | s | ) |
Get the periodic length in the y-direction.
bool Garfield::ComponentAnalyticField::GetPlanePhi | ( | const unsigned int | i, |
double & | phi, | ||
double & | voltage, | ||
std::string & | label ) const |
Retrieve the parameters of a plane at constant phi.
bool Garfield::ComponentAnalyticField::GetPlaneR | ( | const unsigned int | i, |
double & | r, | ||
double & | voltage, | ||
std::string & | label ) const |
Retrieve the parameters of a plane at constant radius.
bool Garfield::ComponentAnalyticField::GetPlaneX | ( | const unsigned int | i, |
double & | x, | ||
double & | voltage, | ||
std::string & | label ) const |
Retrieve the parameters of a plane at constant x.
bool Garfield::ComponentAnalyticField::GetPlaneY | ( | const unsigned int | i, |
double & | y, | ||
double & | voltage, | ||
std::string & | label ) const |
Retrieve the parameters of a plane at constant y.
bool Garfield::ComponentAnalyticField::GetTube | ( | double & | r, |
double & | voltage, | ||
int & | nEdges, | ||
std::string & | label ) const |
Retrieve the tube parameters.
|
override |
bool Garfield::ComponentAnalyticField::GetWire | ( | const unsigned int | i, |
double & | x, | ||
double & | y, | ||
double & | diameter, | ||
double & | voltage, | ||
std::string & | label, | ||
double & | length, | ||
double & | charge, | ||
int & | ntrap ) const |
Retrieve the parameters of a wire.
|
private |
|
override |
|
staticprivate |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
inline |
bool Garfield::ComponentAnalyticField::MultipoleMoments | ( | const unsigned int | iw, |
const unsigned int | order = 4, | ||
const bool | print = false, | ||
const bool | plot = false, | ||
const double | rmult = 1., | ||
const double | eps = 1.e-4, | ||
const unsigned int | nMaxIter = 20 ) |
Calculate multipole moments for a given wire.
iw | Index of the wire. |
order | Order of the highest multipole moment. |
Print information about the fitting process. | |
plot | Plot the potential and multipole fit around the wire. |
rmult | Distance in multiples of the wire radius at which the decomposition is to be carried out. |
eps | Used in the fit for calculating the covariance matrix. |
nMaxIter | Maximum number of iterations in the fit. |
bool Garfield::ComponentAnalyticField::OptimiseOnGrid | ( | const std::vector< std::string > & | groups, |
const std::string & | field_function, | ||
const double | target, | ||
const double | x0, | ||
const double | y0, | ||
const double | x1, | ||
const double | y1, | ||
const unsigned int | nX = 10, | ||
const unsigned int | nY = 10, | ||
const bool | print = true ) |
Vary the potential of selected electrodes to match (a function of) the potential or field on an x-y (or r-phi) grid of points.
bool Garfield::ComponentAnalyticField::OptimiseOnTrack | ( | const std::vector< std::string > & | groups, |
const std::string & | field_function, | ||
const double | target, | ||
const double | x0, | ||
const double | y0, | ||
const double | x1, | ||
const double | y1, | ||
const unsigned int | nP = 20, | ||
const bool | print = true ) |
Vary the potential of selected electrodes to match (a function of) the potential or field along a given line to a target.
groups | Identifier of the electrodes for which to vary the potential. |
field_function | A function of the coordinates (x, y or r, phi), the electrostatic field (ex, ey, e) and potential (v). |
target | Value of the field function to be reproduced. |
x0,y0 | Starting point of the line. |
x1,y1 | End point of the line. |
nP | Number of points on the line. |
Flag to print out information during each fit cycle. |
bool Garfield::ComponentAnalyticField::OptimiseOnWires | ( | const std::vector< std::string > & | groups, |
const std::string & | field_function, | ||
const double | target, | ||
const std::vector< unsigned int > & | wires, | ||
const bool | print = true ) |
Vary the potential of selected electrodes to match (a function of) the potential or field on the surfaces of a set of wires.
|
private |
|
inlineprivate |
Definition at line 778 of file ComponentAnalyticField.hh.
void Garfield::ComponentAnalyticField::PlotCell | ( | TPad * | pad | ) |
Make a plot of the cell layout.
|
private |
|
private |
|
private |
void Garfield::ComponentAnalyticField::PrintCell | ( | ) |
Print all available information on the cell.
void Garfield::ComponentAnalyticField::PrintCharges | ( | ) | const |
Print a list of the point charges.
|
inlineoverrideprivate |
Definition at line 561 of file ComponentAnalyticField.hh.
|
private |
void Garfield::ComponentAnalyticField::SetCartesianCoordinates | ( | ) |
Use Cartesian coordinates (default).
void Garfield::ComponentAnalyticField::SetGravity | ( | const double | dx, |
const double | dy, | ||
const double | dz ) |
Set the gravity orientation.
|
inline |
Set the medium inside the cell.
Definition at line 29 of file ComponentAnalyticField.hh.
void Garfield::ComponentAnalyticField::SetNumberOfCellCopies | ( | const unsigned int | nfourier | ) |
|
inline |
Set the number of shots used for numerically solving the wire sag differential equation.
Definition at line 319 of file ComponentAnalyticField.hh.
void Garfield::ComponentAnalyticField::SetNumberOfSteps | ( | const unsigned int | n | ) |
Set the number of integration steps within each shot (must be >= 1).
void Garfield::ComponentAnalyticField::SetOptimisationParameters | ( | const double | dist = 1., |
const double | eps = 1.e-4, | ||
const unsigned int | nMaxIter = 10 ) |
Set the conditions at which to allow the iteration to stop.
dist | Maximum deviation among all points between target and field function. |
eps | Relative change between iterations. |
nMaxIter | Maximum number of iterations. |
void Garfield::ComponentAnalyticField::SetPeriodicityPhi | ( | const double | phi | ) |
Set the periodicity [degree] in phi.
void Garfield::ComponentAnalyticField::SetPeriodicityX | ( | const double | s | ) |
Set the periodic length [cm] in the x-direction.
void Garfield::ComponentAnalyticField::SetPeriodicityY | ( | const double | s | ) |
Set the periodic length [cm] in the y-direction.
void Garfield::ComponentAnalyticField::SetPolarCoordinates | ( | ) |
Use polar coordinates.
void Garfield::ComponentAnalyticField::SetScanningArea | ( | const double | xmin, |
const double | xmax, | ||
const double | ymin, | ||
const double | ymax ) |
Specify explicitly the boundaries of the the scanning area (i.
e. the area in which the electrostatic force acting on a wire is computed).
void Garfield::ComponentAnalyticField::SetScanningAreaFirstOrder | ( | const double | scale = 2. | ) |
Set the scanning area based on the zeroth-order estimates of the wire shift, enlarged by a scaling factor.
This is the default behaviour.
|
inline |
Set the scanning area to the largest area around each wire which is free from other cell elements.
Definition at line 274 of file ComponentAnalyticField.hh.
void Garfield::ComponentAnalyticField::SetScanningGrid | ( | const unsigned int | nX, |
const unsigned int | nY ) |
Set the number of grid lines at which the electrostatic force as function of the wire displacement is computed.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
override |
|
private |
|
private |
|
overrideprivate |
|
inlineoverride |
Definition at line 334 of file ComponentAnalyticField.hh.
|
inlineoverride |
Definition at line 341 of file ComponentAnalyticField.hh.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
bool Garfield::ComponentAnalyticField::WireDisplacement | ( | const unsigned int | iw, |
const bool | detailed, | ||
std::vector< double > & | csag, | ||
std::vector< double > & | xsag, | ||
std::vector< double > & | ysag, | ||
double & | stretch, | ||
const bool | print = true ) |
Compute the sag profile of a wire.
iw | index of the wire |
detailed | flag to request a detailed calculation of the profile or only a fast one. |
csag | coordinate along the wire. |
xsag | x components of the sag profile. |
ysag | y components of the sag profile. |
stretch | relative elongation. |
flag to print the calculation results or not. |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Definition at line 447 of file ComponentAnalyticField.hh.
|
private |
Definition at line 450 of file ComponentAnalyticField.hh.
|
private |
Definition at line 454 of file ComponentAnalyticField.hh.
|
private |
Definition at line 391 of file ComponentAnalyticField.hh.
|
private |
Definition at line 397 of file ComponentAnalyticField.hh.
Definition at line 414 of file ComponentAnalyticField.hh.
|
private |
Definition at line 522 of file ComponentAnalyticField.hh.
|
private |
Definition at line 389 of file ComponentAnalyticField.hh.
|
private |
Definition at line 469 of file ComponentAnalyticField.hh.
|
private |
Definition at line 470 of file ComponentAnalyticField.hh.
|
private |
Definition at line 470 of file ComponentAnalyticField.hh.
|
private |
Definition at line 462 of file ComponentAnalyticField.hh.
|
private |
Definition at line 462 of file ComponentAnalyticField.hh.
|
private |
Definition at line 462 of file ComponentAnalyticField.hh.
|
private |
Definition at line 445 of file ComponentAnalyticField.hh.
|
private |
Definition at line 505 of file ComponentAnalyticField.hh.
|
private |
Definition at line 506 of file ComponentAnalyticField.hh.
|
private |
Definition at line 443 of file ComponentAnalyticField.hh.
|
private |
Definition at line 510 of file ComponentAnalyticField.hh.
|
private |
Definition at line 529 of file ComponentAnalyticField.hh.
|
private |
Definition at line 549 of file ComponentAnalyticField.hh.
|
private |
Definition at line 415 of file ComponentAnalyticField.hh.
|
private |
Definition at line 416 of file ComponentAnalyticField.hh.
|
private |
Definition at line 458 of file ComponentAnalyticField.hh.
|
private |
Definition at line 387 of file ComponentAnalyticField.hh.
|
private |
Definition at line 421 of file ComponentAnalyticField.hh.
|
private |
Definition at line 452 of file ComponentAnalyticField.hh.
|
private |
Definition at line 503 of file ComponentAnalyticField.hh.
|
private |
Definition at line 385 of file ComponentAnalyticField.hh.
|
private |
Definition at line 418 of file ComponentAnalyticField.hh.
|
private |
Definition at line 417 of file ComponentAnalyticField.hh.
|
private |
Definition at line 420 of file ComponentAnalyticField.hh.
|
private |
Definition at line 419 of file ComponentAnalyticField.hh.
|
private |
Definition at line 413 of file ComponentAnalyticField.hh.
|
private |
Definition at line 546 of file ComponentAnalyticField.hh.
|
private |
Definition at line 547 of file ComponentAnalyticField.hh.
|
private |
Definition at line 531 of file ComponentAnalyticField.hh.
|
private |
Definition at line 533 of file ComponentAnalyticField.hh.
|
private |
Definition at line 523 of file ComponentAnalyticField.hh.
|
private |
Definition at line 524 of file ComponentAnalyticField.hh.
|
private |
Definition at line 504 of file ComponentAnalyticField.hh.
|
private |
Definition at line 426 of file ComponentAnalyticField.hh.
|
private |
Definition at line 553 of file ComponentAnalyticField.hh.
|
private |
Definition at line 556 of file ComponentAnalyticField.hh.
|
private |
Definition at line 558 of file ComponentAnalyticField.hh.
|
private |
Definition at line 454 of file ComponentAnalyticField.hh.
|
private |
Definition at line 454 of file ComponentAnalyticField.hh.
|
private |
Definition at line 408 of file ComponentAnalyticField.hh.
|
private |
Definition at line 409 of file ComponentAnalyticField.hh.
|
private |
Definition at line 499 of file ComponentAnalyticField.hh.
|
private |
Definition at line 394 of file ComponentAnalyticField.hh.
|
private |
Definition at line 515 of file ComponentAnalyticField.hh.
|
private |
Definition at line 513 of file ComponentAnalyticField.hh.
|
private |
Definition at line 423 of file ComponentAnalyticField.hh.
|
private |
Definition at line 544 of file ComponentAnalyticField.hh.
|
private |
Definition at line 537 of file ComponentAnalyticField.hh.
|
private |
Definition at line 392 of file ComponentAnalyticField.hh.
|
private |
Definition at line 446 of file ComponentAnalyticField.hh.
|
private |
Definition at line 410 of file ComponentAnalyticField.hh.
|
private |
Definition at line 410 of file ComponentAnalyticField.hh.
|
private |
Definition at line 502 of file ComponentAnalyticField.hh.
|
private |
Definition at line 526 of file ComponentAnalyticField.hh.
|
private |
Definition at line 527 of file ComponentAnalyticField.hh.
|
private |
Definition at line 461 of file ComponentAnalyticField.hh.
|
private |
Definition at line 405 of file ComponentAnalyticField.hh.
|
private |
Definition at line 405 of file ComponentAnalyticField.hh.
|
private |
Definition at line 472 of file ComponentAnalyticField.hh.
|
private |
Definition at line 507 of file ComponentAnalyticField.hh.
|
private |
Definition at line 440 of file ComponentAnalyticField.hh.
|
private |
Definition at line 400 of file ComponentAnalyticField.hh.
|
private |
Definition at line 400 of file ComponentAnalyticField.hh.
|
private |
Definition at line 540 of file ComponentAnalyticField.hh.
|
private |
Definition at line 539 of file ComponentAnalyticField.hh.
|
private |
Definition at line 401 of file ComponentAnalyticField.hh.
|
private |
Definition at line 401 of file ComponentAnalyticField.hh.
|
private |
Definition at line 466 of file ComponentAnalyticField.hh.
|
private |
Definition at line 467 of file ComponentAnalyticField.hh.
|
private |
Definition at line 467 of file ComponentAnalyticField.hh.
|
private |
Definition at line 542 of file ComponentAnalyticField.hh.
|
private |
Definition at line 541 of file ComponentAnalyticField.hh.
|
private |
Definition at line 402 of file ComponentAnalyticField.hh.
|
private |
Definition at line 402 of file ComponentAnalyticField.hh.
|
private |
Definition at line 453 of file ComponentAnalyticField.hh.
|
private |
Definition at line 457 of file ComponentAnalyticField.hh.