1#ifndef G_COMPONENT_ANALYTIC_FIELD_H
2#define G_COMPONENT_ANALYTIC_FIELD_H
23 Medium*
GetMedium(
const double x,
const double y,
const double z)
override;
24 void ElectricField(
const double x,
const double y,
const double z,
double& ex,
25 double& ey,
double& ez,
Medium*& m,
int& status)
override {
29 status = Field(x, y, z, ex, ey, ez, v,
false);
41 void ElectricField(
const double x,
const double y,
const double z,
double& ex,
42 double& ey,
double& ez,
double& v,
Medium*& m,
43 int& status)
override {
46 status = Field(x, y, z, ex, ey, ez, v,
true);
61 double& wx,
double& wy,
double& wz,
62 const std::string& label)
override {
64 if (!m_sigset) PrepareSignals();
65 Wfield(x, y, z, wx, wy, wz, label);
68 const std::string& label)
override {
69 if (!m_sigset) PrepareSignals();
70 return Wpot(x, y, z, label);
73 bool GetBoundingBox(
double& x0,
double& y0,
double& z0,
double& x1,
74 double& y1,
double& z1)
override;
76 double& y1,
double& z1)
override;
78 bool IsWireCrossed(
const double x0,
const double y0,
const double z0,
79 const double x1,
const double y1,
const double z1,
80 double& xc,
double& yc,
double& zc,
const bool centre,
83 bool IsInTrapRadius(
const double q0,
const double x0,
const double y0,
84 const double z0,
double& xw,
double& yx,
91 void AddWire(
const double x,
const double y,
const double diameter,
92 const double voltage,
const std::string& label,
93 const double length = 100.,
const double tension = 50.,
94 const double rho = 19.3,
const int ntrap = 5);
96 void AddTube(
const double radius,
const double voltage,
const int nEdges,
97 const std::string& label);
99 void AddPlaneX(
const double x,
const double voltage,
100 const std::string& label);
102 void AddPlaneY(
const double y,
const double voltage,
103 const std::string& label);
105 void AddPlaneR(
const double r,
const double voltage,
106 const std::string& label);
108 void AddPlanePhi(
const double phi,
const double voltage,
109 const std::string& label);
118 void AddStripOnPlaneX(
const char direction,
const double x,
const double smin,
119 const double smax,
const std::string& label,
120 const double gap = -1.);
122 void AddStripOnPlaneY(
const char direction,
const double y,
const double smin,
123 const double smax,
const std::string& label,
124 const double gap = -1.);
126 void AddStripOnPlaneR(
const char direction,
const double r,
const double smin,
127 const double smax,
const std::string& label,
128 const double gap = -1.);
131 const double smax,
const std::string& label,
132 const double gap = -1.);
144 const double zmin,
const double zmax,
145 const std::string& label,
const double gap = -1.,
146 const double rot = 0.);
149 const double zmin,
const double zmax,
150 const std::string& label,
const double gap = -1.,
151 const double rot = 0.);
154 const double phimin,
const double phimax,
155 const double zmin,
const double zmax,
156 const std::string& label,
const double gap = -1.);
159 const double rmin,
const double rmax,
160 const double zmin,
const double zmax,
161 const std::string& label,
const double gap = -1.);
187 void AddCharge(
const double x,
const double y,
const double z,
215 if (CellCheck()) CellType();
234 const bool print =
false,
const bool plot =
false,
235 const double rmult = 1.,
const double eps = 1.e-4,
236 const unsigned int nMaxIter = 20);
245 bool GetWire(
const unsigned int i,
double& x,
double& y,
double& diameter,
246 double& voltage, std::string& label,
double& length,
247 double& charge,
int& ntrap)
const;
258 bool GetPlaneX(
const unsigned int i,
double& x,
double& voltage,
259 std::string& label)
const;
261 bool GetPlaneY(
const unsigned int i,
double& y,
double& voltage,
262 std::string& label)
const;
264 bool GetPlaneR(
const unsigned int i,
double& r,
double& voltage,
265 std::string& label)
const;
267 bool GetPlanePhi(
const unsigned int i,
double& phi,
double& voltage,
268 std::string& label)
const;
270 bool GetTube(
double& r,
double& voltage,
int& nEdges,
271 std::string& label)
const;
282 void SetScanningArea(
const double xmin,
const double xmax,
const double ymin,
295 void SetGravity(
const double dx,
const double dy,
const double dz);
297 void GetGravity(
double& dx,
double& dy,
double& dz)
const;
306 bool ForcesOnWire(
const unsigned int iw, std::vector<double>& xMap,
307 std::vector<double>& yMap,
308 std::vector<std::vector<double> >& fxMap,
309 std::vector<std::vector<double> >& fyMap);
321 std::vector<double>& csag, std::vector<double>& xsag,
322 std::vector<double>& ysag,
double& stretch,
323 const bool print =
true);
350 Medium* m_medium =
nullptr;
352 bool m_chargeCheck =
false;
354 bool m_cellset =
false;
355 bool m_sigset =
false;
357 bool m_polar =
false;
363 double m_xmin, m_xmax;
364 double m_ymin, m_ymax;
365 double m_zmin, m_zmax;
368 double m_vmin, m_vmax;
378 bool m_fperx =
false;
379 bool m_fpery =
false;
386 std::vector<std::string> m_readout;
389 unsigned int m_nWires;
403 std::vector<Wire> m_w;
408 std::vector<double> m_cosph2;
409 std::vector<double> m_sinph2;
410 std::vector<double> m_amp2;
413 std::vector<double> m_b2sin;
416 std::complex<double> m_zmult;
417 double m_p1, m_p2, m_c1;
420 std::vector<std::complex<double> > wmap;
425 double m_corvta, m_corvtb, m_corvtc;
430 bool m_ynplax, m_ynplay;
433 double m_coplax, m_coplay;
447 double smin = 0., smax = 0.;
448 double zmin = 0., zmax = 0.;
457 double ewxcor, ewycor;
458 std::vector<Strip> strips1;
459 std::vector<Strip> strips2;
460 std::vector<Pixel> pixels;
462 std::array<Plane, 5> m_planes;
468 double m_cotube = 1.;
469 double m_cotube2 = 1.;
470 double m_vttube = 0.;
473 std::vector<std::vector<double> > m_a;
475 std::vector<std::vector<std::complex<double> > > m_sigmat;
477 std::vector<std::vector<double> > m_qplane;
484 std::vector<Charge3d> m_ch3d;
485 unsigned int m_nTermBessel = 10;
486 unsigned int m_nTermPoly = 100;
488 bool m_useElectrostaticForce =
true;
489 bool m_useGravitationalForce =
true;
491 std::array<double, 3> m_down{{0, 0, 1}};
493 unsigned int m_nShots = 2;
495 unsigned int m_nSteps = 20;
498 enum class ScanningRange { Largest = 0, FirstOrder, User };
499 ScanningRange m_scanRange = ScanningRange::FirstOrder;
501 double m_xScanMin = 0.;
502 double m_xScanMax = 0.;
503 double m_yScanMin = 0.;
504 double m_yScanMax = 0.;
506 double m_scaleRange = 2.;
508 unsigned int m_nScanX = 11;
509 unsigned int m_nScanY = 11;
511 bool m_extrapolateForces =
false;
513 void UpdatePeriodicity()
override;
514 void Reset()
override {
522 bool WireCheck()
const;
525 bool PrepareStrips();
526 bool PrepareSignals();
527 bool SetupWireSignals();
528 bool SetupPlaneSignals();
545 bool IprA00(
const int mx,
const int my);
546 bool IprB2X(
const int my);
547 bool IprB2Y(
const int mx);
554 bool SetupDipoleTerms();
560 int Field(
const double xin,
const double yin,
const double zin,
double& ex,
561 double& ey,
double& ez,
double& volt,
const bool opt);
562 void FieldA00(
const double xpos,
const double ypos,
double& ex,
double& ey,
563 double& volt,
const bool opt)
const;
564 void FieldB1X(
const double xpos,
const double ypos,
double& ex,
double& ey,
565 double& volt,
const bool opt)
const;
566 void FieldB1Y(
const double xpos,
const double ypos,
double& ex,
double& ey,
567 double& volt,
const bool opt)
const;
568 void FieldB2X(
const double xpos,
const double ypos,
double& ex,
double& ey,
569 double& volt,
const bool opt)
const;
570 void FieldB2Y(
const double xpos,
const double ypos,
double& ex,
double& ey,
571 double& volt,
const bool opt)
const;
572 void FieldC10(
const double xpos,
const double ypos,
double& ex,
double& ey,
573 double& volt,
const bool opt)
const;
574 void FieldC2X(
const double xpos,
const double ypos,
double& ex,
double& ey,
575 double& volt,
const bool opt)
const;
576 void FieldC2Y(
const double xpos,
const double ypos,
double& ex,
double& ey,
577 double& volt,
const bool opt)
const;
578 void FieldC30(
const double xpos,
const double ypos,
double& ex,
double& ey,
579 double& volt,
const bool opt)
const;
580 void FieldD10(
const double xpos,
const double ypos,
double& ex,
double& ey,
581 double& volt,
const bool opt)
const;
582 void FieldD20(
const double xpos,
const double ypos,
double& ex,
double& ey,
583 double& volt,
const bool opt)
const;
584 void FieldD30(
const double xpos,
const double ypos,
double& ex,
double& ey,
585 double& volt,
const bool opt)
const;
588 void Field3dA00(
const double x,
const double y,
const double z,
double& ex,
589 double& ey,
double& ez,
double& volt);
590 void Field3dB2X(
const double x,
const double y,
const double z,
double& ex,
591 double& ey,
double& ez,
double& volt);
592 void Field3dB2Y(
const double x,
const double y,
const double z,
double& ex,
593 double& ey,
double& ez,
double& volt);
594 void Field3dD10(
const double x,
const double y,
const double z,
double& ex,
595 double& ey,
double& ez,
double& volt);
597 bool Wfield(
const double x,
const double y,
const double z,
598 double& ex,
double& ey,
double& ez,
599 const std::string& label)
const;
600 void WfieldWireA00(
const double xpos,
const double ypos,
double& ex,
601 double& ey,
const int mx,
const int my,
603 void WfieldWireB2X(
const double xpos,
const double ypos,
double& ex,
604 double& ey,
const int my,
const int sw)
const;
605 void WfieldWireB2Y(
const double xpos,
const double ypos,
double& ex,
606 double& ey,
const int mx,
const int sw)
const;
607 void WfieldWireC2X(
const double xpos,
const double ypos,
double& ex,
608 double& ey,
const int sw)
const;
609 void WfieldWireC2Y(
const double xpos,
const double ypos,
double& ex,
610 double& ey,
const int sw)
const;
611 void WfieldWireC30(
const double xpos,
const double ypos,
double& ex,
612 double& ey,
const int sw)
const;
613 void WfieldWireD10(
const double xpos,
const double ypos,
double& ex,
614 double& ey,
const int sw)
const;
615 void WfieldWireD30(
const double xpos,
const double ypos,
double& ex,
616 double& ey,
const int sw)
const;
617 void WfieldPlaneA00(
const double xpos,
const double ypos,
double& ex,
618 double& ey,
const int mx,
const int my,
619 const int iplane)
const;
620 void WfieldPlaneB2X(
const double xpos,
const double ypos,
double& ex,
621 double& ey,
const int my,
const int iplane)
const;
622 void WfieldPlaneB2Y(
const double xpos,
const double ypos,
double& ex,
623 double& ey,
const int mx,
const int iplane)
const;
624 void WfieldPlaneC2X(
const double xpos,
const double ypos,
double& ex,
625 double& ey,
const int iplane)
const;
626 void WfieldPlaneC2Y(
const double xpos,
const double ypos,
double& ex,
627 double& ey,
const int iplane)
const;
628 void WfieldPlaneC30(
const double xpos,
const double ypos,
double& ex,
629 double& ey,
const int iplane)
const;
630 void WfieldPlaneD10(
const double xpos,
const double ypos,
double& ex,
631 double& ey,
const int iplane)
const;
632 void WfieldPlaneD30(
const double xpos,
const double ypos,
double& ex,
633 double& ey,
const int iplane)
const;
634 void WfieldStripZ(
const double xpos,
const double ypos,
double& ex,
635 double& ey,
const int ip,
const Strip& strip)
const;
636 void WfieldStripXy(
const double xpos,
const double ypos,
const double zpos,
637 double& ex,
double& ey,
double& ez,
638 const int ip,
const Strip& strip)
const;
639 void WfieldPixel(
const double xpos,
const double ypos,
const double zpos,
640 double& ex,
double& ey,
double& ez,
641 const int ip,
const Pixel& pixel)
const;
644 double Wpot(
const double x,
const double y,
const double z,
645 const std::string& label)
const;
646 double WpotWireA00(
const double x,
const double y,
647 const int mx,
const int my,
const int sw)
const;
648 double WpotWireB2X(
const double x,
const double y,
649 const int my,
const int sw)
const;
650 double WpotWireB2Y(
const double x,
const double y,
651 const int mx,
const int sw)
const;
652 double WpotWireC2X(
const double x,
const double y,
const int sw)
const;
653 double WpotWireC2Y(
const double x,
const double y,
const int sw)
const;
654 double WpotWireC30(
const double x,
const double y,
const int sw)
const;
655 double WpotWireD10(
const double x,
const double y,
const int sw)
const;
656 double WpotWireD30(
const double x,
const double y,
const int sw)
const;
657 double WpotPlaneA00(
const double x,
const double y,
658 const int mx,
const int my,
const int ip)
const;
659 double WpotPlaneB2X(
const double x,
const double y,
660 const int my,
const int ip)
const;
661 double WpotPlaneB2Y(
const double x,
const double y,
662 const int mx,
const int ip)
const;
663 double WpotPlaneC2X(
const double x,
const double y,
const int ip)
const;
664 double WpotPlaneC2Y(
const double x,
const double y,
const int ip)
const;
665 double WpotPlaneC30(
const double x,
const double y,
const int ip)
const;
666 double WpotPlaneD10(
const double x,
const double y,
const int ip)
const;
667 double WpotPlaneD30(
const double x,
const double y,
const int ip)
const;
668 double WpotStripZ(
const double x,
const double y,
669 const int ip,
const Strip& strip)
const;
670 double WpotStripXy(
const double x,
const double y,
const double z,
671 const int ip,
const Strip& strip)
const;
672 double WpotPixel(
const double x,
const double y,
const double z,
673 const int ip,
const Pixel& pixel)
const;
678 void FieldAtWireA00(
const double xpos,
const double ypos,
double& ex,
679 double& ey,
const std::vector<bool>& cnalso)
const;
680 void FieldAtWireB1X(
const double xpos,
const double ypos,
double& ex,
681 double& ey,
const std::vector<bool>& cnalso)
const;
682 void FieldAtWireB1Y(
const double xpos,
const double ypos,
double& ex,
683 double& ey,
const std::vector<bool>& cnalso)
const;
684 void FieldAtWireB2X(
const double xpos,
const double ypos,
double& ex,
685 double& ey,
const std::vector<bool>& cnalso)
const;
686 void FieldAtWireB2Y(
const double xpos,
const double ypos,
double& ex,
687 double& ey,
const std::vector<bool>& cnalso)
const;
688 void FieldAtWireC10(
const double xpos,
const double ypos,
double& ex,
689 double& ey,
const std::vector<bool>& cnalso)
const;
690 void FieldAtWireC2X(
const double xpos,
const double ypos,
double& ex,
691 double& ey,
const std::vector<bool>& cnalso)
const;
692 void FieldAtWireC2Y(
const double xpos,
const double ypos,
double& ex,
693 double& ey,
const std::vector<bool>& cnalso)
const;
694 void FieldAtWireC30(
const double xpos,
const double ypos,
double& ex,
695 double& ey,
const std::vector<bool>& cnalso)
const;
696 void FieldAtWireD10(
const double xpos,
const double ypos,
double& ex,
697 double& ey,
const std::vector<bool>& cnalso)
const;
698 void FieldAtWireD20(
const double xpos,
const double ypos,
double& ex,
699 double& ey,
const std::vector<bool>& cnalso)
const;
700 void FieldAtWireD30(
const double xpos,
const double ypos,
double& ex,
701 double& ey,
const std::vector<bool>& cnalso)
const;
703 void DipoleFieldA00(
const double xpos,
const double ypos,
double& ex,
704 double& ey,
double& volt,
const bool opt)
const;
705 void DipoleFieldB1X(
const double xpos,
const double ypos,
double& ex,
706 double& ey,
double& volt,
const bool opt)
const;
707 void DipoleFieldB1Y(
const double xpos,
const double ypos,
double& ex,
708 double& ey,
double& volt,
const bool opt)
const;
709 void DipoleFieldB2X(
const double xpos,
const double ypos,
double& ex,
710 double& ey,
double& volt,
const bool opt)
const;
711 void DipoleFieldB2Y(
const double xpos,
const double ypos,
double& ex,
712 double& ey,
double& volt,
const bool opt)
const;
715 double Ph2(
const double xpos,
const double ypos)
const;
716 double Ph2Lim(
const double radius)
const {
717 return -log(abs(m_zmult) * radius * (1. - 3. * m_p1 + 5. * m_p2));
719 void E2Sum(
const double xpos,
const double ypos,
double& ex,
723 void ConformalMap(
const std::complex<double>& z, std::complex<double>& ww,
724 std::complex<double>& wd)
const;
726 bool InTube(
const double x0,
const double y0,
const double a,
729 bool SagDetailed(
const Wire& wire,
const std::vector<double>& xMap,
730 const std::vector<double>& yMap,
731 const std::vector<std::vector<double> >& fxMap,
732 const std::vector<std::vector<double> >& fyMap,
733 std::vector<double>& csag, std::vector<double>& xsag,
734 std::vector<double>& ysag)
const;
735 bool GetForceRatio(
const Wire& wire,
const double coor,
736 const std::array<double, 2>& bend,
737 const std::array<double, 2>& dbend,
738 std::array<double, 2>& f,
const std::vector<double>& xMap,
739 const std::vector<double>& yMap,
740 const std::vector<std::vector<double> >& fxMap,
741 const std::vector<std::vector<double> >& fyMap)
const;
742 bool FindZeroes(
const Wire& wire,
const double h, std::vector<double>& x,
743 const std::vector<double>& xMap,
744 const std::vector<double>& yMap,
745 const std::vector<std::vector<double> >& fxMap,
746 const std::vector<std::vector<double> >& fyMap)
const;
747 bool StepRKN(
const Wire& wire,
const double h,
double& x,
748 std::array<double, 2>& y, std::array<double, 2>& yp,
749 const std::vector<double>& xMap,
const std::vector<double>& yMap,
750 const std::vector<std::vector<double> >& fxMap,
751 const std::vector<std::vector<double> >& fyMap)
const;
752 bool Trace(
const Wire& wire,
const double h,
const std::vector<double>& xx,
753 std::vector<double>& f,
const std::vector<double>& xMap,
754 const std::vector<double>& yMap,
755 const std::vector<std::vector<double> >& fxMap,
756 const std::vector<std::vector<double> >& fyMap)
const;
void PrintCell()
Print all available information on the cell.
void SetGravity(const double dx, const double dy, const double dz)
Set the gravity orientation.
bool GetVoltageRange(double &pmin, double &pmax) override
Calculate the voltage range [V].
void SetPolarCoordinates()
Use polar coordinates.
void SetPeriodicityX(const double s)
Set the periodic length [cm] in the x-direction.
void EnableDipoleTerms(const bool on=true)
Request dipole terms be included for each of the wires (default: off).
bool GetPeriodicityY(double &s)
Get the periodic length in the y-direction.
void SetCartesianCoordinates()
Use Cartesian coordinates (default).
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 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 EnableChargeCheck(const bool on=true)
Check the quality of the capacitance matrix inversion (default: off).
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.)
bool IsPolar() const
Are polar coordinates being used?
void SetMedium(Medium *medium)
Set the medium inside the cell.
void AddCharge(const double x, const double y, const double z, const double q)
Add a point charge.
unsigned int GetNumberOfWires() const
Get the number of wires.
void SetScanningGrid(const unsigned int nX, const unsigned int nY)
void SetNumberOfSteps(const unsigned int n)
Set the number of integration steps within each shot (must be >= 1).
std::string GetCellType()
void SetNumberOfShots(const unsigned int n)
void ElectricField(const double x, const double y, const double z, double &ex, double &ey, double &ez, double &v, Medium *&m, int &status) override
Calculate the drift field [V/cm] and potential [V] at (x, y, z).
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.
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.
bool GetPlaneR(const unsigned int i, double &r, double &voltage, std::string &label) const
Retrieve the parameters of a plane at constant radius.
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)
void GetGravity(double &dx, double &dy, double &dz) const
Get the gravity orientation.
ComponentAnalyticField()
Constructor.
void AddStripOnPlaneX(const char direction, const double x, const double smin, const double smax, const std::string &label, const double gap=-1.)
void ClearCharges()
Remove all point charges.
unsigned int GetNumberOfPlanesY() const
Get the number of equipotential planes at constant y.
void AddPlanePhi(const double phi, const double voltage, const std::string &label)
Add a plane at constant phi.
void AddPlaneR(const double r, const double voltage, const std::string &label)
Add a plane at constant radius.
bool ElectricFieldAtWire(const unsigned int iw, double &ex, double &ey)
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)
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 EnableExtrapolation(const bool on=true)
unsigned int GetNumberOfPlanesX() const
Get the number of equipotential planes at constant x.
void SetScanningAreaLargest()
bool GetPeriodicityX(double &s)
Get the periodic length in the x-direction.
bool GetTube(double &r, double &voltage, int &nEdges, std::string &label) const
Retrieve the tube parameters.
bool GetPlaneX(const unsigned int i, double &x, double &voltage, std::string &label) const
Retrieve the parameters of a plane at constant x.
void AddPlaneY(const double y, const double voltage, const std::string &label)
Add a plane at constant y.
bool IsInTrapRadius(const double q0, const double x0, const double y0, const double z0, double &xw, double &yx, double &rw) override
bool GetElementaryCell(double &x0, double &y0, double &z0, double &x1, double &y1, double &z1) override
Get the coordinates of the elementary cell.
void SetPeriodicityPhi(const double phi)
Set the periodicity [degree] in phi.
bool GetPeriodicityPhi(double &s)
Get the periodicity [degree] in phi.
bool GetPlanePhi(const unsigned int i, double &phi, double &voltage, std::string &label) const
Retrieve the parameters of a plane at constant phi.
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.
bool GetBoundingBox(double &x0, double &y0, double &z0, double &x1, double &y1, double &z1) override
Get the bounding box coordinates.
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)
void WeightingField(const double x, const double y, const double z, double &wx, double &wy, double &wz, const std::string &label) override
void ElectricField(const double x, const double y, const double z, double &ex, double &ey, double &ez, Medium *&m, int &status) override
~ComponentAnalyticField()
Destructor.
void SetScanningAreaFirstOrder(const double scale=2.)
bool IsWireCrossed(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
void AddReadout(const std::string &label)
Setup the weighting field for a given group of wires or planes.
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.
double WeightingPotential(const double x, const double y, const double z, const std::string &label) override
void SetPeriodicityY(const double s)
Set the periodic length [cm] in the y-direction.
Medium * GetMedium(const double x, const double y, const double z) override
Get the medium at a given location (x, y, z).
unsigned int GetNumberOfPlanesPhi() const
Get the number of equipotential planes at constant phi.
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 PrintCharges() const
Print a list of the point charges.
void SetScanningArea(const double xmin, const double xmax, const double ymin, const double ymax)
bool GetPlaneY(const unsigned int i, double &y, double &voltage, std::string &label) const
Retrieve the parameters of a plane at constant y.
unsigned int GetNumberOfPlanesR() const
Get the number of equipotential planes 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.
Abstract base class for components.
Geometry * m_geometry
Pointer to the geometry.
virtual Medium * GetMedium(const double x, const double y, const double z, const bool tesselated=false) const =0
Retrieve the medium at a given point.
Abstract base class for media.
bool IsDriftable() const
Is charge carrier transport enabled in this medium?