pyg4ometry.geant4.solid¶
Submodules¶
- pyg4ometry.geant4.solid.Box
- pyg4ometry.geant4.solid.Cons
- pyg4ometry.geant4.solid.CutTubs
- pyg4ometry.geant4.solid.Ellipsoid
- pyg4ometry.geant4.solid.EllipticalCone
- pyg4ometry.geant4.solid.EllipticalTube
- pyg4ometry.geant4.solid.ExtrudedSolid
- pyg4ometry.geant4.solid.GenericPolycone
- pyg4ometry.geant4.solid.GenericPolyhedra
- pyg4ometry.geant4.solid.GenericTrap
- pyg4ometry.geant4.solid.HalfSpace
- pyg4ometry.geant4.solid.Hype
- pyg4ometry.geant4.solid.Intersection
- pyg4ometry.geant4.solid.Layer
- pyg4ometry.geant4.solid.MultiUnion
- pyg4ometry.geant4.solid.OpticalSurface
- pyg4ometry.geant4.solid.Orb
- pyg4ometry.geant4.solid.Para
- pyg4ometry.geant4.solid.Paraboloid
- pyg4ometry.geant4.solid.Plane
- pyg4ometry.geant4.solid.Polycone
- pyg4ometry.geant4.solid.Polyhedra
- pyg4ometry.geant4.solid.Scaled
- pyg4ometry.geant4.solid.SolidBase
- pyg4ometry.geant4.solid.Sphere
- pyg4ometry.geant4.solid.Subtraction
- pyg4ometry.geant4.solid.TessellatedSolid
- pyg4ometry.geant4.solid.Tet
- pyg4ometry.geant4.solid.Torus
- pyg4ometry.geant4.solid.Trap
- pyg4ometry.geant4.solid.Trd
- pyg4ometry.geant4.solid.Tubs
- pyg4ometry.geant4.solid.TwistedBox
- pyg4ometry.geant4.solid.TwistedSolid
- pyg4ometry.geant4.solid.TwistedTrap
- pyg4ometry.geant4.solid.TwistedTrd
- pyg4ometry.geant4.solid.TwistedTubs
- pyg4ometry.geant4.solid.TwoVector
- pyg4ometry.geant4.solid.Union
- pyg4ometry.geant4.solid.Wedge
Classes¶
Base class for all solids |
|
Constructs a infinite plane. Should not be used to construct geant4 geometry. |
|
Base class for all solids |
|
Constructs a infinite wedge. Should not be used to construct geant4 geometry. |
|
Base class for all solids |
|
Constructs a box. Note the lengths are full lengths and not half lengths as in Geant4 |
|
Base class for all solids |
|
Constructs a cylindrical section. |
|
Base class for all solids |
|
Constructs a cylindrical section with end face cuts. Note pLowNorm and pHighNorm can be |
|
Base class for all solids |
|
Constructs a section of a spherical shell. |
|
Base class for all solids |
|
Constructs a conical section. |
|
Base class for all solids |
|
Constructs an ellipsoid optinoally cut by planes perpendicular to the z-axis. |
|
Base class for all solids |
|
Constructs a trapezoid. |
|
Base class for all solids |
|
Constructs a torus. |
|
Base class for all solids |
|
Constructs a solid of rotation using an arbitrary 2D surface defined by a series of (r,z) coordinates. |
|
Constructs a solid of rotation using an arbitrary 2D surface. |
|
Constructs a solid of rotation using an arbitrary 2D surface defined by a series of (r,z) coordinates. |
|
Base class for all solids |
|
Constructs a polyhedra. |
|
Base class for all solids |
|
General expression, does not have an analogue in GDML |
|
Construct an extruded solid |
|
Base class for all solids |
|
Union between two solids |
|
Base class for all solids |
|
Intersection between two solids |
|
Base class for all solids |
|
Subtraction between two solids |
|
Base class for all solids |
|
Base class for all solids |
|
Constructs a parallelepiped. |
|
Base class for all solids |
|
Constructs a general trapezoid. |
|
Base class for all solids |
|
Constructs a solid sphere. |
|
Base class for all solids |
|
Constructs a tube of elliptical cross-section. |
|
Base class for all solids |
|
Constructs a cone with elliptical cross-section and an |
|
Base class for all solids |
|
Constructs a paraboloid with possible cuts along the z axis. |
|
Base class for all solids |
|
Constructs a tube with hyperbolic profile. |
|
Base class for all solids |
|
Constructs a tetrahedra. |
|
Base class for all solids |
|
Constructs a box that is twisted though angle twisted angle |
|
Base class for all solids |
|
Constructs a general trapezoid with a twist around one axis. |
|
Base class for all solids |
|
Constructs a twisted general trapezoid. |
|
Base class for all solids |
|
Creates a twisted tube segement. Note that only 1 constructor is supprted. |
|
Base class for all solids |
|
Constructs a solid of rotation using an arbitrary 2D surface defined by a series of (r,z) coordinates. |
|
Constructs a solid of rotation using an arbitrary 2D surface defined by a series of (r,z) coordinates. |
|
Base class for all solids |
|
Constructs a solid of rotation using an arbitrary 2D surface defined by a series of (r,z) coordinates. |
|
Base class for all solids |
|
Constructs an arbitrary trapezoid using two quadrilaterals sitting |
|
Base class for all solids |
|
Constructs a tessellated solid |
|
Base class for all solids |
|
Union between two or more solids. |
|
Base class for all solids |
|
Constructs a scaled sold. |
|
Base class for all solids |
|
Base class for all solids |
Functions¶
|
|
|
Convert rad in radians into degrees |
|
Convert deg in degrees into radians |
|
Convert rad in gradians into radians |
|
Tait-Bryan x-y-z rotation to axis-angle representation |
|
Convert 3x3 transformation matrix to axis angle representation |
|
Convert axis angle to transformation matrix |
|
Convert rotation matrix to Tait-Bryan angles. |
|
Convert axis and angle to tait bryan angles |
|
Convert tait bryan angles to a single passive rotation matrix. |
|
Convert Tait-Bryan angles to a single passive rotation matrix. |
|
Returns the rotation matrix that rotates v_from to parallel to |
|
v_from = vector FROM |
|
Check if vector vector_1 is parallel to vector vector_2 down to |
|
Check if vector vector_1 is parallel to vector vector_2 down to |
|
Invert the rotation represented by these angles. |
|
matrix_from will align one vector with another, but there are |
|
Convert rad in radians into degrees |
|
Convert deg in degrees into radians |
|
Convert rad in gradians into radians |
|
Tait-Bryan x-y-z rotation to axis-angle representation |
|
Convert 3x3 transformation matrix to axis angle representation |
|
Convert axis angle to transformation matrix |
|
Convert rotation matrix to Tait-Bryan angles. |
|
Convert axis and angle to tait bryan angles |
|
Convert tait bryan angles to a single passive rotation matrix. |
|
Convert Tait-Bryan angles to a single passive rotation matrix. |
|
Returns the rotation matrix that rotates v_from to parallel to |
|
v_from = vector FROM |
|
Check if vector vector_1 is parallel to vector vector_2 down to |
|
Check if vector vector_1 is parallel to vector vector_2 down to |
|
Invert the rotation represented by these angles. |
|
matrix_from will align one vector with another, but there are |
|
Convert rad in radians into degrees |
|
Convert deg in degrees into radians |
|
Convert rad in gradians into radians |
|
Tait-Bryan x-y-z rotation to axis-angle representation |
|
Convert 3x3 transformation matrix to axis angle representation |
|
Convert axis angle to transformation matrix |
|
Convert rotation matrix to Tait-Bryan angles. |
|
Convert axis and angle to tait bryan angles |
|
Convert tait bryan angles to a single passive rotation matrix. |
|
Convert Tait-Bryan angles to a single passive rotation matrix. |
|
Returns the rotation matrix that rotates v_from to parallel to |
|
v_from = vector FROM |
|
Check if vector vector_1 is parallel to vector vector_2 down to |
|
Check if vector vector_1 is parallel to vector vector_2 down to |
|
Invert the rotation represented by these angles. |
|
matrix_from will align one vector with another, but there are |
|
|
|
|
|
Args: |
|
Convert rad in radians into degrees |
|
Convert deg in degrees into radians |
|
Convert rad in gradians into radians |
|
Tait-Bryan x-y-z rotation to axis-angle representation |
|
Convert 3x3 transformation matrix to axis angle representation |
|
Convert axis angle to transformation matrix |
|
Convert rotation matrix to Tait-Bryan angles. |
|
Convert axis and angle to tait bryan angles |
|
Convert tait bryan angles to a single passive rotation matrix. |
|
Convert Tait-Bryan angles to a single passive rotation matrix. |
|
Returns the rotation matrix that rotates v_from to parallel to |
|
v_from = vector FROM |
|
Check if vector vector_1 is parallel to vector vector_2 down to |
|
Check if vector vector_1 is parallel to vector vector_2 down to |
|
Invert the rotation represented by these angles. |
|
matrix_from will align one vector with another, but there are |
Package Contents¶
- class pyg4ometry.geant4.solid.TwoVector(xIn, yIn)¶
- x¶
- y¶
- Rotated(angle)¶
- __repr__()¶
- __getitem__(index)¶
- __add__(other)¶
- __sub__(other)¶
- __mul__(other)¶
- __rmul__(other)¶
- __truediv__(other)¶
- __abs__()¶
- dot(other)¶
- cross(other)¶
- class pyg4ometry.geant4.solid._SolidBase(name, type, registry=None)¶
Base class for all solids
- property name¶
- type¶
- registry¶
- evaluateParameter(obj)¶
- evaluateParameterWithUnits(varName)¶
- _addProperty(attribute)¶
- _setProperty(attribute, value)¶
- _getProperty(attribute)¶
- _twoPiValueCheck(attribute, aunit='rad')¶
Raises a ValueError if the attribute is over pyg4ometry.config.twoPiComparisonTolerance over 2 x pi.
- conver2Tessellated()¶
return a TessellatedSolid instance based on the mesh of this solid.
- class pyg4ometry.geant4.solid.Plane(name, normal, dist, zlength=10000)¶
Bases:
pyg4ometry.geant4.solid.SolidBase.SolidBaseConstructs a infinite plane. Should not be used to construct geant4 geometry.
- Parameters:
- normal¶
- dist¶
- pDz¶
- mesh = None¶
- __repr__()¶
- pycsgmesh()¶
- class pyg4ometry.geant4.solid._SolidBase(name, type, registry=None)¶
Base class for all solids
- property name¶
- type¶
- registry¶
- evaluateParameter(obj)¶
- evaluateParameterWithUnits(varName)¶
- _addProperty(attribute)¶
- _setProperty(attribute, value)¶
- _getProperty(attribute)¶
- _twoPiValueCheck(attribute, aunit='rad')¶
Raises a ValueError if the attribute is over pyg4ometry.config.twoPiComparisonTolerance over 2 x pi.
- conver2Tessellated()¶
return a TessellatedSolid instance based on the mesh of this solid.
- class pyg4ometry.geant4.solid.Wedge(name, pRMax=1000, pSPhi=0, pDPhi=1.5, halfzlength=10000, nslice=None)¶
Bases:
pyg4ometry.geant4.solid.SolidBase.SolidBaseConstructs a infinite wedge. Should not be used to construct geant4 geometry.
- Parameters:
- pRMax¶
- pSPhi¶
- pDPhi¶
- pDz¶
- nslice¶
- mesh = None¶
- __repr__()¶
- pycsgmesh()¶
- class pyg4ometry.geant4.solid._SolidBase(name, type, registry=None)¶
Base class for all solids
- property name¶
- type¶
- registry¶
- evaluateParameter(obj)¶
- evaluateParameterWithUnits(varName)¶
- _addProperty(attribute)¶
- _setProperty(attribute, value)¶
- _getProperty(attribute)¶
- _twoPiValueCheck(attribute, aunit='rad')¶
Raises a ValueError if the attribute is over pyg4ometry.config.twoPiComparisonTolerance over 2 x pi.
- conver2Tessellated()¶
return a TessellatedSolid instance based on the mesh of this solid.
- pyg4ometry.geant4.solid.cubeNet(vecList)¶
- class pyg4ometry.geant4.solid.Box(name, pX, pY, pZ, registry, lunit='mm', addRegistry=True)¶
Bases:
pyg4ometry.geant4.solid.SolidBase.SolidBaseConstructs a box. Note the lengths are full lengths and not half lengths as in Geant4
- Parameters:
name (str) – of solid for registry
pX (float, Constant, Quantity, Variable, Expression) – length along x
pY (float, Constant, Quantity, Variable, Expression) – length along y
pZ (float, Constant, Quantity, Variable, Expression) – length along z
registry (Registry) – for storing solid
lunit (str) – length unit (nm,um,mm,m,km) for solid
- lunit¶
- dependents = []¶
- varNames = ['pX', 'pY', 'pZ']¶
- varUnits = ['lunit', 'lunit', 'lunit']¶
- __repr__()¶
- __str__()¶
- mesh()¶
- class pyg4ometry.geant4.solid._SolidBase(name, type, registry=None)¶
Base class for all solids
- property name¶
- type¶
- registry¶
- evaluateParameter(obj)¶
- evaluateParameterWithUnits(varName)¶
- _addProperty(attribute)¶
- _setProperty(attribute, value)¶
- _getProperty(attribute)¶
- _twoPiValueCheck(attribute, aunit='rad')¶
Raises a ValueError if the attribute is over pyg4ometry.config.twoPiComparisonTolerance over 2 x pi.
- conver2Tessellated()¶
return a TessellatedSolid instance based on the mesh of this solid.
- class pyg4ometry.geant4.solid.Tubs(name, pRMin, pRMax, pDz, pSPhi, pDPhi, registry, lunit='mm', aunit='rad', nslice=None, addRegistry=True)¶
Bases:
pyg4ometry.geant4.solid.SolidBase.SolidBaseConstructs a cylindrical section.
- Parameters:
name (str) – of solid for registry
pDz (float, Constant, Quantity, Variable) – full length along z
pSPhi (float, Constant, Quantity, Variable) – starting phi angle
pDPhi (float, Constant, Quantity, Variable) – angle of segment in phi
registry (Registry) – for storing solid
lunit (str) – length unit (nm,um,mm,m,km) for solid
aunit (str) – angle unit (rad,deg) for solid
nslice (int) – number of phi elements for meshing
- lunit¶
- aunit¶
- dependents = []¶
- varNames = ['pRMin', 'pRMax', 'pDz', 'pSPhi', 'pDPhi', 'nslice']¶
- varUnits = ['lunit', 'lunit', 'lunit', 'aunit', 'aunit', None]¶
- __repr__()¶
- __str__()¶
- mesh()¶
- class pyg4ometry.geant4.solid._SolidBase(name, type, registry=None)¶
Base class for all solids
- property name¶
- type¶
- registry¶
- evaluateParameter(obj)¶
- evaluateParameterWithUnits(varName)¶
- _addProperty(attribute)¶
- _setProperty(attribute, value)¶
- _getProperty(attribute)¶
- _twoPiValueCheck(attribute, aunit='rad')¶
Raises a ValueError if the attribute is over pyg4ometry.config.twoPiComparisonTolerance over 2 x pi.
- conver2Tessellated()¶
return a TessellatedSolid instance based on the mesh of this solid.
- class pyg4ometry.geant4.solid.CutTubs(name, pRMin, pRMax, pDz, pSPhi, pDPhi, pLowNorm, pHighNorm, registry, lunit='mm', aunit='rad', nslice=None, addRegistry=True)¶
Bases:
pyg4ometry.geant4.solid.SolidBase.SolidBaseConstructs a cylindrical section with end face cuts. Note pLowNorm and pHighNorm can be lists of floats, Constants, Quantities or Variables.
- Parameters:
- lunit¶
- aunit¶
- dependents = []¶
- varNames = ['pRMin', 'pRMax', 'pDz', 'pSPhi', 'pDPhi', 'pLowNorm', 'pHighNorm', 'nslice']¶
- varUnits = ['lunit', 'lunit', 'lunit', 'aunit', 'aunit', 'lunit', 'lunit', None]¶
- __repr__()¶
- __str__()¶
- mesh()¶
- class pyg4ometry.geant4.solid._SolidBase(name, type, registry=None)¶
Base class for all solids
- property name¶
- type¶
- registry¶
- evaluateParameter(obj)¶
- evaluateParameterWithUnits(varName)¶
- _addProperty(attribute)¶
- _setProperty(attribute, value)¶
- _getProperty(attribute)¶
- _twoPiValueCheck(attribute, aunit='rad')¶
Raises a ValueError if the attribute is over pyg4ometry.config.twoPiComparisonTolerance over 2 x pi.
- conver2Tessellated()¶
return a TessellatedSolid instance based on the mesh of this solid.
- class pyg4ometry.geant4.solid.Sphere(name, pRmin, pRmax, pSPhi, pDPhi, pSTheta, pDTheta, registry, lunit='mm', aunit='rad', nslice=None, nstack=None, addRegistry=True)¶
Bases:
pyg4ometry.geant4.solid.SolidBase.SolidBaseConstructs a section of a spherical shell.
- Parameters:
name (str) – of object in registry
pRmin (float, Constant, Quantity, Variable) – inner radius of the shell
pRmax (float, Constant, Quantity, Variable) – outer radius of the shell
pSPhi (float, Constant, Quantity, Variable) – starting phi angle in radians
pSTheta (float, Constant, Quantity, Variable) – starting theta angle in radians
pDPhi (float, Constant, Quantity, Variable) – delta phi angle in radians
pDTheta (float, Constant, Quantity, Variable) – delta theta angle in radians
registry (Registry) – for storing solid
lunit (str) – length unit (nm,um,mm,m,km) for solid
aunit (str) – angle unit (rad,deg) for solid
nslice (int) – number of phi elements for meshing
nstack (int) – number of theta elements for meshing
- pRmin¶
- pRmax¶
- pSPhi¶
- pDPhi¶
- pSTheta¶
- pDTheta¶
- nslice¶
- nstack¶
- lunit¶
- aunit¶
- dependents = []¶
- varNames = ['pRmin', 'pRmax', 'pSPhi', 'pDPhi', 'pSTheta', 'pDTheta']¶
- varUnits = ['lunit', 'lunit', 'aunit', 'aunit', 'aunit', 'aunit']¶
- checkParameters()¶
- __repr__()¶
- __str__()¶
- mesh()¶
working off 0 < phi < 2pi 0 < theta < pi
- class pyg4ometry.geant4.solid._SolidBase(name, type, registry=None)¶
Base class for all solids
- property name¶
- type¶
- registry¶
- evaluateParameter(obj)¶
- evaluateParameterWithUnits(varName)¶
- _addProperty(attribute)¶
- _setProperty(attribute, value)¶
- _getProperty(attribute)¶
- _twoPiValueCheck(attribute, aunit='rad')¶
Raises a ValueError if the attribute is over pyg4ometry.config.twoPiComparisonTolerance over 2 x pi.
- conver2Tessellated()¶
return a TessellatedSolid instance based on the mesh of this solid.
- class pyg4ometry.geant4.solid.Cons(name, pRmin1, pRmax1, pRmin2, pRmax2, pDz, pSPhi, pDPhi, registry, lunit='mm', aunit='rad', nslice=None, addRegistry=True)¶
Bases:
pyg4ometry.geant4.solid.SolidBase.SolidBaseConstructs a conical section.
- Parameters:
name (str) – of the solid
pRMin1 (float, Constant, Quantity, Variable) – inner radius at -pDz/2
pRMax1 (float, Constant, Quantity, Variable) – outer radius at -pDz/2
pRMin2 (float, Constant, Quantity, Variable) – inner radius at +pDZ/2
pRMax2 (float, Constant, Quantity, Variable) – outer radius at +pDz/2
pSPhi (float, Constant, Quantity, Variable) – starting phi angle
pDPhi (float, Constant, Quantity, Variable) – angle of segment in radians
registry (Registry) – for storing solid
lunit (str) – length unit (nm,um,mm,m,km) for solid
aunit (str) – angle unit (rad,deg) for solid
nslice (int) – number of phi elements for meshing
- pRmin1¶
- pRmax1¶
- pRmin2¶
- pRmax2¶
- pDz¶
- pSPhi¶
- pDPhi¶
- nslice¶
- lunit¶
- aunit¶
- dependents = []¶
- varNames = ['pRmin1', 'pRmin2', 'pRmax1', 'pRmax2', 'pDz', 'pSPhi', 'pDPhi', 'nslice']¶
- varUnits = ['lunit', 'lunit', 'lunit', 'lunit', 'lunit', 'aunit', 'aunit', None]¶
- checkParameters()¶
- __repr__()¶
- __str__()¶
- mesh()¶
- class pyg4ometry.geant4.solid._SolidBase(name, type, registry=None)¶
Base class for all solids
- property name¶
- type¶
- registry¶
- evaluateParameter(obj)¶
- evaluateParameterWithUnits(varName)¶
- _addProperty(attribute)¶
- _setProperty(attribute, value)¶
- _getProperty(attribute)¶
- _twoPiValueCheck(attribute, aunit='rad')¶
Raises a ValueError if the attribute is over pyg4ometry.config.twoPiComparisonTolerance over 2 x pi.
- conver2Tessellated()¶
return a TessellatedSolid instance based on the mesh of this solid.
- class pyg4ometry.geant4.solid.Ellipsoid(name, pxSemiAxis, pySemiAxis, pzSemiAxis, pzBottomCut, pzTopCut, registry, lunit='mm', nslice=None, nstack=None, addRegistry=True)¶
Bases:
pyg4ometry.geant4.solid.SolidBase.SolidBaseConstructs an ellipsoid optinoally cut by planes perpendicular to the z-axis.
- Parameters:
name (str) – of the solid
pxSemiAxis (float, Constant, Quantity, Variable, Expression) – length of x semi axis
pySemiAxis (float, Constant, Quantity, Variable, Expression) – length of y semi axis
pzSemiAxis (float, Constant, Quantity, Variable, Expression) – length of z semi axis
pzBottomCut (float, Constant, Quantity, Variable, Expression) – z-position of bottom cut plane
pzTopCut (float, Constant, Quantity, Variable, Expression) – z-position of top cut plane
registry (Registry) – for storing solid
lunit (str) – length unit (nm,um,mm,m,km) for solid
nslice (int) – number of phi elements for meshing
nstack (int) – number of theta elements for meshing
- pxSemiAxis¶
- pySemiAxis¶
- pzSemiAxis¶
- pzBottomCut¶
- pzTopCut¶
- lunit¶
- nslice¶
- nstack¶
- dependents = []¶
- varNames = ['pxSemiAxis', 'pySemiAxis', 'pzSemiAxis', 'pzBottomCut', 'pzTopCut']¶
- varUnits = ['lunit', 'lunit', 'lunit', 'lunit', 'lunit']¶
- __repr__()¶
- __str__()¶
- mesh()¶
- class pyg4ometry.geant4.solid._SolidBase(name, type, registry=None)¶
Base class for all solids
- property name¶
- type¶
- registry¶
- evaluateParameter(obj)¶
- evaluateParameterWithUnits(varName)¶
- _addProperty(attribute)¶
- _setProperty(attribute, value)¶
- _getProperty(attribute)¶
- _twoPiValueCheck(attribute, aunit='rad')¶
Raises a ValueError if the attribute is over pyg4ometry.config.twoPiComparisonTolerance over 2 x pi.
- conver2Tessellated()¶
return a TessellatedSolid instance based on the mesh of this solid.
- class pyg4ometry.geant4.solid.Trd(name, pDx1, pDx2, pDy1, pDy2, pDz, registry, lunit='mm', addRegistry=True)¶
Bases:
pyg4ometry.geant4.solid.SolidBase.SolidBaseConstructs a trapezoid.
- Parameters:
name (str) – of the solid
pDx1 (float, Constant, Quantity, Variable) – length along x at the surface positioned at -dz/2
pDx2 (float, Constant, Quantity, Variable) – length along x at the surface postitioned at +dz/2
pDy1 (float, Constant, Quantity, Variable) – length along y at the surface positioned at -dz/2
pDy2 (float, Constant, Quantity, Variable) – length along y at the surface positioned at +dz/2
dz (float, Constant, Quantity, Variable) – length along the z axis
registry (Registry) – for storing solid
lunit (str) – length unit (nm,um,mm,m,km) for solid
- pX1¶
- pX2¶
- pY1¶
- pY2¶
- pZ¶
- lunit¶
- dependents = []¶
- varNames = ['pX1', 'pX2', 'pY1', 'pY2', 'pZ']¶
- varUnits = ['lunit', 'lunit', 'lunit', 'lunit', 'lunit']¶
- mesh()¶
- class pyg4ometry.geant4.solid._SolidBase(name, type, registry=None)¶
Base class for all solids
- property name¶
- type¶
- registry¶
- evaluateParameter(obj)¶
- evaluateParameterWithUnits(varName)¶
- _addProperty(attribute)¶
- _setProperty(attribute, value)¶
- _getProperty(attribute)¶
- _twoPiValueCheck(attribute, aunit='rad')¶
Raises a ValueError if the attribute is over pyg4ometry.config.twoPiComparisonTolerance over 2 x pi.
- conver2Tessellated()¶
return a TessellatedSolid instance based on the mesh of this solid.
- class pyg4ometry.geant4.solid.Torus(name, pRmin, pRmax, pRtor, pSPhi, pDPhi, registry, lunit='mm', aunit='rad', nslice=None, nstack=None, addRegistry=True)¶
Bases:
pyg4ometry.geant4.solid.SolidBase.SolidBaseConstructs a torus.
- Parameters:
name (str) – string, name of the volume
pRmin (float, Constant, Quantity, Variable, Expression) – innder radius
pRmax – outer radius
pRtor (float, Constant, Quantity, Variable, Expression) – swept radius of torus
pSphi (float, Constant, Quantity, Variable, Expression) – start phi angle
pDPhi (float, Constant, Quantity, Variable, Expression) – delta phi angle
registry (Registry) – for storing solid
lunit (str) – length unit (nm,um,mm,m,km) for solid
aunit (str) – angle unit (rad,deg) for solid
nslice (int) – number of phi elements for meshing
nstack (int) – number of theta elements for meshing
- pRmin¶
- pRmax¶
- pRtor¶
- pSPhi¶
- pDPhi¶
- nslice¶
- nstack¶
- lunit¶
- aunit¶
- dependents = []¶
- varNames = ['pRmin', 'pRmax', 'pRtor', 'pSPhi', 'pDPhi', 'nslice', 'nstack']¶
- varUnits = ['lunit', 'lunit', 'lunit', 'aunit', 'aunit', None, None]¶
- __repr__()¶
- __str__()¶
- mesh()¶
- class pyg4ometry.geant4.solid._SolidBase(name, type, registry=None)¶
Base class for all solids
- property name¶
- type¶
- registry¶
- evaluateParameter(obj)¶
- evaluateParameterWithUnits(varName)¶
- _addProperty(attribute)¶
- _setProperty(attribute, value)¶
- _getProperty(attribute)¶
- _twoPiValueCheck(attribute, aunit='rad')¶
Raises a ValueError if the attribute is over pyg4ometry.config.twoPiComparisonTolerance over 2 x pi.
- conver2Tessellated()¶
return a TessellatedSolid instance based on the mesh of this solid.
- class pyg4ometry.geant4.solid._GenericPolyhedra(name, pSPhi, pDPhi, numSide, pR, pZ, registry, lunit='mm', aunit='rad', addRegistry=True)¶
Bases:
pyg4ometry.geant4.solid.SolidBase.SolidBaseConstructs a solid of rotation using an arbitrary 2D surface defined by a series of (r,z) coordinates.
- Parameters:
name (str) – name
pSPhi (float, Constant, Quantity, Variable, Expression) – angle Phi at start of rotation
pDPhi (float, Constant, Quantity, Variable, Expression) – angle Phi at end of rotation
numSide (float, Constant, Quantity, Variable, Expression) – number of polygon sides
pR (list of float, Constant, Quantity, Variable, Expression) – r coordinate list
pZ (list of float, Constant, Quantity, Variable, Expression) – z coordinate list
- pSPhi¶
- pDPhi¶
- numSide¶
- pR¶
- pZ¶
- lunit¶
- aunit¶
- varNames = ['pSPhi', 'pDPhi', 'numSide', 'pR', 'pZ']¶
- varUnits = ['aunit', 'aunit', None, 'lunit', 'lunit']¶
- dependents = []¶
- __repr__()¶
- __str__()¶
- checkParameters()¶
- mesh()¶
- class pyg4ometry.geant4.solid.Polycone(name, pSPhi, pDPhi, pZpl, pRMin, pRMax, registry, lunit='mm', aunit='rad', nslice=None, addRegistry=True)¶
Bases:
pyg4ometry.geant4.solid.SolidBase.SolidBaseConstructs a solid of rotation using an arbitrary 2D surface.
- Parameters:
name (str) – of the solid
pSPhi (float, Constant, Quantity, Variable, Expression) – starting rotation angle in radians
pDPhi (float, Constant, Quantity, Variable, Expression) – total rotation angle in radius
pZPlns (list of float, Constant, Quantity, Variable, Expression) – z-positions of planes used
pRInr (list of float, Constant, Quantity, Variable, Expression) – inner radii of surface at each z-plane
pROut (list of float, Constant, Quantity, Variable, Expression) – outer radii of surface at each z-plane
registry (Registry) – for storing solid
lunit (str) – length unit (nm,um,mm,m,km) for solid
aunit (str) – angle unit (rad,deg) for solid
nslice (int) – number of phi elements for meshing
Optional registration as this solid is used as a temporary solid in Polyhedra and needn’t be always registered.
- pSPhi¶
- pDPhi¶
- pZpl¶
- pRMin¶
- pRMax¶
- lunit¶
- aunit¶
- nslice¶
- dependents = []¶
- varNames = ['pSPhi', 'pDPhi', 'pZpl', 'pRMin', 'pRMax']¶
- varUnits = ['aunit', 'aunit', 'lunit', 'lunit', 'lunit']¶
- __repr__()¶
- __str__()¶
- mesh()¶
- class pyg4ometry.geant4.solid._GenericPolyhedra(name, pSPhi, pDPhi, numSide, pR, pZ, registry, lunit='mm', aunit='rad', addRegistry=True)¶
Bases:
pyg4ometry.geant4.solid.SolidBase.SolidBaseConstructs a solid of rotation using an arbitrary 2D surface defined by a series of (r,z) coordinates.
- Parameters:
name (str) – name
pSPhi (float, Constant, Quantity, Variable, Expression) – angle Phi at start of rotation
pDPhi (float, Constant, Quantity, Variable, Expression) – angle Phi at end of rotation
numSide (float, Constant, Quantity, Variable, Expression) – number of polygon sides
pR (list of float, Constant, Quantity, Variable, Expression) – r coordinate list
pZ (list of float, Constant, Quantity, Variable, Expression) – z coordinate list
- pSPhi¶
- pDPhi¶
- numSide¶
- pR¶
- pZ¶
- lunit¶
- aunit¶
- varNames = ['pSPhi', 'pDPhi', 'numSide', 'pR', 'pZ']¶
- varUnits = ['aunit', 'aunit', None, 'lunit', 'lunit']¶
- dependents = []¶
- __repr__()¶
- __str__()¶
- checkParameters()¶
- mesh()¶
- class pyg4ometry.geant4.solid._SolidBase(name, type, registry=None)¶
Base class for all solids
- property name¶
- type¶
- registry¶
- evaluateParameter(obj)¶
- evaluateParameterWithUnits(varName)¶
- _addProperty(attribute)¶
- _setProperty(attribute, value)¶
- _getProperty(attribute)¶
- _twoPiValueCheck(attribute, aunit='rad')¶
Raises a ValueError if the attribute is over pyg4ometry.config.twoPiComparisonTolerance over 2 x pi.
- conver2Tessellated()¶
return a TessellatedSolid instance based on the mesh of this solid.
- class pyg4ometry.geant4.solid.Polyhedra(name, pSPhi, pDPhi, numSide, numZPlanes, zPlane, rInner, rOuter, registry, lunit='mm', aunit='rad', addRegistry=True)¶
Bases:
pyg4ometry.geant4.solid.SolidBase.SolidBaseConstructs a polyhedra.
- Parameters:
name (str) – of solid
pSPhi (float, Constant, Quantity, Variable, Expression) – start phi angle
pDPhi (float, Constant, Quantity, Variable, Expression) – delta phi angle
numSide (int) – number of sides
numZPlanes (int) – number of planes along z
zPlane (list of float, Constant, Quantity, Variable, Expression) – position of z planes
rInner (list of float, Constant, Quantity, Variable, Expression) – tangent distance to inner surface per z plane
rOuter (list of float, Constant, Quantity, Variable, Expression) – tangent distance to outer surface per z plane
registry (Registry) – for storing solid
lunit (str) – length unit (nm,um,mm,m,km) for solid
aunit (str) – angle unit (rad,deg) for solid
- pSPhi¶
- pDPhi¶
- numSide¶
- numZPlanes¶
- zPlane¶
- rInner¶
- rOuter¶
- lunit¶
- aunit¶
- varNames = ['pSPhi', 'pDPhi', 'numSide', 'numZPlanes', 'zPlane', 'rInner', 'rOuter']¶
- varUnits = ['aunit', 'aunit', None, None, 'lunit', 'lunit', 'lunit']¶
- dependents = []¶
- __repr__()¶
- __str__()¶
- mesh()¶
- class pyg4ometry.geant4.solid._SolidBase(name, type, registry=None)¶
Base class for all solids
- property name¶
- type¶
- registry¶
- evaluateParameter(obj)¶
- evaluateParameterWithUnits(varName)¶
- _addProperty(attribute)¶
- _setProperty(attribute, value)¶
- _getProperty(attribute)¶
- _twoPiValueCheck(attribute, aunit='rad')¶
Raises a ValueError if the attribute is over pyg4ometry.config.twoPiComparisonTolerance over 2 x pi.
- conver2Tessellated()¶
return a TessellatedSolid instance based on the mesh of this solid.
- class pyg4ometry.geant4.solid._Expression(name, value, registry, addRegistry=False)¶
Bases:
ScalarBaseGeneral expression, does not have an analogue in GDML
- Parameters:
- expression¶
- __int__()¶
- class pyg4ometry.geant4.solid.ExtrudedSolid(name, pPolygon, pZslices, registry, lunit='mm', addRegistry=True)¶
Bases:
pyg4ometry.geant4.solid.SolidBase.SolidBaseConstruct an extruded solid
- Parameters:
Example: Triangular prism with 2 slices pPoligon = [[x1,y1],[x2,y2],[x3,y3]] - vertices of polygon in clockwise order zSlices = [[z1,[offsx1, offsy1],scale1],[z2,[offsx2, offsy2],scale2]]
- lunit¶
- dependents = []¶
- varNames = ['pPolygon', 'pZslices']¶
- varUnits = ['lunit', 'lunit']¶
- __repr__()¶
- __str__()¶
- polygon_area(vertices)¶
- evaluateParameterWithUnits(varName)¶
- mesh()¶
- class pyg4ometry.geant4.solid._SolidBase(name, type, registry=None)¶
Base class for all solids
- property name¶
- type¶
- registry¶
- evaluateParameter(obj)¶
- evaluateParameterWithUnits(varName)¶
- _addProperty(attribute)¶
- _setProperty(attribute, value)¶
- _getProperty(attribute)¶
- _twoPiValueCheck(attribute, aunit='rad')¶
Raises a ValueError if the attribute is over pyg4ometry.config.twoPiComparisonTolerance over 2 x pi.
- conver2Tessellated()¶
return a TessellatedSolid instance based on the mesh of this solid.
- class pyg4ometry.geant4.solid.Union(name, obj1, obj2, tra2, registry, addRegistry=True)¶
Bases:
pyg4ometry.geant4.solid.SolidBase.SolidBaseUnion between two solids
- Parameters:
- obj1¶
- obj2¶
- tra2¶
- varNames = ['tra2']¶
- varUnits = [None]¶
- dependents = []¶
- __repr__()¶
- __str__()¶
- mesh()¶
- translation()¶
- rotation()¶
- object1()¶
- object2()¶
- pyg4ometry.geant4.solid.rad2deg(rad)¶
Convert rad in radians into degrees
- pyg4ometry.geant4.solid.deg2rad(deg)¶
Convert deg in degrees into radians
- pyg4ometry.geant4.solid.grad2rad(gradians)¶
Convert rad in gradians into radians
- pyg4ometry.geant4.solid.tbxyz2axisangle(rv)¶
Tait-Bryan x-y-z rotation to axis-angle representation Algorithm from http://www.sedris.org/wg8home/Documents/WG80485.pdf
For converting rotation angles to an active axis/angle pair for use in pycsg. Order of rotation: x->y->z.
- pyg4ometry.geant4.solid.matrix2axisangle(matrix)¶
Convert 3x3 transformation matrix to axis angle representation
- pyg4ometry.geant4.solid.axisangle2matrix(axis, angle)¶
Convert axis angle to transformation matrix
- Parameters:
axis (list/array(3)) – axis for rotation
angle (float) – rotation angle
- Returns:
transformation matrix
- Return type:
array(3,3)
- pyg4ometry.geant4.solid.matrix2tbxyz(matrix)¶
Convert rotation matrix to Tait-Bryan angles. Order of rotation is x -> y -> z.
- Parameters:
matrix – active (positive angle = anti-clockwise rotation about that axis when looking at the axis) matrix.
- Returns:
[x, y, z] Tait-Bryan angles in a list.
- Return type:
list(3)
- pyg4ometry.geant4.solid.axisangle2tbxyz(axis, angle)¶
Convert axis and angle to tait bryan angles
- Parameters:
axis (list/array(3)) – axis for rotation
angle (float) – rotation angle
- Returns:
tait bryan angles (x-y-z)
- Return type:
array(3)
- pyg4ometry.geant4.solid.tbxyz2matrix(angles)¶
Convert tait bryan angles to a single passive rotation matrix. rotation order = x -> y -> z.
- Parameters:
angles – list of angles: x, y, z
- Returns:
rotation matrix
- Return type:
array(3,3)
- pyg4ometry.geant4.solid.tbzyx2matrix(angles)¶
Convert Tait-Bryan angles to a single passive rotation matrix. rotation order = x -> y -> z.
- Parameters:
angles – list of angles: x, y, z
- Returns:
rotation matrix
- Return type:
array(3,3)
- pyg4ometry.geant4.solid.matrix_from(v_from, v_to)¶
Returns the rotation matrix that rotates v_from to parallel to v_to.
Useful for ensuring a given face points in a certain direction.
v_from and v_to should be array-like three-vectors.
- pyg4ometry.geant4.solid._rodrigues_anti_parallel(v_from, v_to)¶
v_from = vector FROM v_to = vector TO
- pyg4ometry.geant4.solid.are_parallel(vector_1, vector_2, tolerance=1e-10)¶
Check if vector vector_1 is parallel to vector vector_2 down to some tolerance.
- pyg4ometry.geant4.solid.are_anti_parallel(vector_1, vector_2, tolerance=1e-10)¶
Check if vector vector_1 is parallel to vector vector_2 down to some tolerance.
- pyg4ometry.geant4.solid.reverse(angles)¶
Invert the rotation represented by these angles.
- pyg4ometry.geant4.solid.two_fold_orientation(v1, v2, e1, e2)¶
matrix_from will align one vector with another, but there are an infinite number of such matrices that align two vectors. This further contrains the rotation by introducing a second pair of vectors.
v1 start v v2 end v e1 start e e2 end v
- class pyg4ometry.geant4.solid._SolidBase(name, type, registry=None)¶
Base class for all solids
- property name¶
- type¶
- registry¶
- evaluateParameter(obj)¶
- evaluateParameterWithUnits(varName)¶
- _addProperty(attribute)¶
- _setProperty(attribute, value)¶
- _getProperty(attribute)¶
- _twoPiValueCheck(attribute, aunit='rad')¶
Raises a ValueError if the attribute is over pyg4ometry.config.twoPiComparisonTolerance over 2 x pi.
- conver2Tessellated()¶
return a TessellatedSolid instance based on the mesh of this solid.
- class pyg4ometry.geant4.solid.Intersection(name, obj1, obj2, tra2, registry, addRegistry=True)¶
Bases:
pyg4ometry.geant4.solid.SolidBase.SolidBaseIntersection between two solids
- Parameters:
- obj1¶
- obj2¶
- tra2¶
- varNames = ['tra2']¶
- varUnits = [None]¶
- dependents = []¶
- __repr__()¶
- __str__()¶
- mesh()¶
- translation()¶
- rotation()¶
- object1()¶
- object2()¶
- pyg4ometry.geant4.solid.rad2deg(rad)¶
Convert rad in radians into degrees
- pyg4ometry.geant4.solid.deg2rad(deg)¶
Convert deg in degrees into radians
- pyg4ometry.geant4.solid.grad2rad(gradians)¶
Convert rad in gradians into radians
- pyg4ometry.geant4.solid.tbxyz2axisangle(rv)¶
Tait-Bryan x-y-z rotation to axis-angle representation Algorithm from http://www.sedris.org/wg8home/Documents/WG80485.pdf
For converting rotation angles to an active axis/angle pair for use in pycsg. Order of rotation: x->y->z.
- pyg4ometry.geant4.solid.matrix2axisangle(matrix)¶
Convert 3x3 transformation matrix to axis angle representation
- pyg4ometry.geant4.solid.axisangle2matrix(axis, angle)¶
Convert axis angle to transformation matrix
- Parameters:
axis (list/array(3)) – axis for rotation
angle (float) – rotation angle
- Returns:
transformation matrix
- Return type:
array(3,3)
- pyg4ometry.geant4.solid.matrix2tbxyz(matrix)¶
Convert rotation matrix to Tait-Bryan angles. Order of rotation is x -> y -> z.
- Parameters:
matrix – active (positive angle = anti-clockwise rotation about that axis when looking at the axis) matrix.
- Returns:
[x, y, z] Tait-Bryan angles in a list.
- Return type:
list(3)
- pyg4ometry.geant4.solid.axisangle2tbxyz(axis, angle)¶
Convert axis and angle to tait bryan angles
- Parameters:
axis (list/array(3)) – axis for rotation
angle (float) – rotation angle
- Returns:
tait bryan angles (x-y-z)
- Return type:
array(3)
- pyg4ometry.geant4.solid.tbxyz2matrix(angles)¶
Convert tait bryan angles to a single passive rotation matrix. rotation order = x -> y -> z.
- Parameters:
angles – list of angles: x, y, z
- Returns:
rotation matrix
- Return type:
array(3,3)
- pyg4ometry.geant4.solid.tbzyx2matrix(angles)¶
Convert Tait-Bryan angles to a single passive rotation matrix. rotation order = x -> y -> z.
- Parameters:
angles – list of angles: x, y, z
- Returns:
rotation matrix
- Return type:
array(3,3)
- pyg4ometry.geant4.solid.matrix_from(v_from, v_to)¶
Returns the rotation matrix that rotates v_from to parallel to v_to.
Useful for ensuring a given face points in a certain direction.
v_from and v_to should be array-like three-vectors.
- pyg4ometry.geant4.solid._rodrigues_anti_parallel(v_from, v_to)¶
v_from = vector FROM v_to = vector TO
- pyg4ometry.geant4.solid.are_parallel(vector_1, vector_2, tolerance=1e-10)¶
Check if vector vector_1 is parallel to vector vector_2 down to some tolerance.
- pyg4ometry.geant4.solid.are_anti_parallel(vector_1, vector_2, tolerance=1e-10)¶
Check if vector vector_1 is parallel to vector vector_2 down to some tolerance.
- pyg4ometry.geant4.solid.reverse(angles)¶
Invert the rotation represented by these angles.
- pyg4ometry.geant4.solid.two_fold_orientation(v1, v2, e1, e2)¶
matrix_from will align one vector with another, but there are an infinite number of such matrices that align two vectors. This further contrains the rotation by introducing a second pair of vectors.
v1 start v v2 end v e1 start e e2 end v
- class pyg4ometry.geant4.solid._SolidBase(name, type, registry=None)¶
Base class for all solids
- property name¶
- type¶
- registry¶
- evaluateParameter(obj)¶
- evaluateParameterWithUnits(varName)¶
- _addProperty(attribute)¶
- _setProperty(attribute, value)¶
- _getProperty(attribute)¶
- _twoPiValueCheck(attribute, aunit='rad')¶
Raises a ValueError if the attribute is over pyg4ometry.config.twoPiComparisonTolerance over 2 x pi.
- conver2Tessellated()¶
return a TessellatedSolid instance based on the mesh of this solid.
- class pyg4ometry.geant4.solid.Subtraction(name, obj1, obj2, tra2, registry, addRegistry=True)¶
Bases:
pyg4ometry.geant4.solid.SolidBase.SolidBaseSubtraction between two solids
- Parameters:
- obj1¶
- obj2¶
- tra2¶
- varNames = ['tra2']¶
- varUnits = [None]¶
- dependents = []¶
- __repr__()¶
- __str__()¶
- mesh()¶
- translation()¶
- rotation()¶
- object1()¶
- object2()¶
- pyg4ometry.geant4.solid.rad2deg(rad)¶
Convert rad in radians into degrees
- pyg4ometry.geant4.solid.deg2rad(deg)¶
Convert deg in degrees into radians
- pyg4ometry.geant4.solid.grad2rad(gradians)¶
Convert rad in gradians into radians
- pyg4ometry.geant4.solid.tbxyz2axisangle(rv)¶
Tait-Bryan x-y-z rotation to axis-angle representation Algorithm from http://www.sedris.org/wg8home/Documents/WG80485.pdf
For converting rotation angles to an active axis/angle pair for use in pycsg. Order of rotation: x->y->z.
- pyg4ometry.geant4.solid.matrix2axisangle(matrix)¶
Convert 3x3 transformation matrix to axis angle representation
- pyg4ometry.geant4.solid.axisangle2matrix(axis, angle)¶
Convert axis angle to transformation matrix
- Parameters:
axis (list/array(3)) – axis for rotation
angle (float) – rotation angle
- Returns:
transformation matrix
- Return type:
array(3,3)
- pyg4ometry.geant4.solid.matrix2tbxyz(matrix)¶
Convert rotation matrix to Tait-Bryan angles. Order of rotation is x -> y -> z.
- Parameters:
matrix – active (positive angle = anti-clockwise rotation about that axis when looking at the axis) matrix.
- Returns:
[x, y, z] Tait-Bryan angles in a list.
- Return type:
list(3)
- pyg4ometry.geant4.solid.axisangle2tbxyz(axis, angle)¶
Convert axis and angle to tait bryan angles
- Parameters:
axis (list/array(3)) – axis for rotation
angle (float) – rotation angle
- Returns:
tait bryan angles (x-y-z)
- Return type:
array(3)
- pyg4ometry.geant4.solid.tbxyz2matrix(angles)¶
Convert tait bryan angles to a single passive rotation matrix. rotation order = x -> y -> z.
- Parameters:
angles – list of angles: x, y, z
- Returns:
rotation matrix
- Return type:
array(3,3)
- pyg4ometry.geant4.solid.tbzyx2matrix(angles)¶
Convert Tait-Bryan angles to a single passive rotation matrix. rotation order = x -> y -> z.
- Parameters:
angles – list of angles: x, y, z
- Returns:
rotation matrix
- Return type:
array(3,3)
- pyg4ometry.geant4.solid.matrix_from(v_from, v_to)¶
Returns the rotation matrix that rotates v_from to parallel to v_to.
Useful for ensuring a given face points in a certain direction.
v_from and v_to should be array-like three-vectors.
- pyg4ometry.geant4.solid._rodrigues_anti_parallel(v_from, v_to)¶
v_from = vector FROM v_to = vector TO
- pyg4ometry.geant4.solid.are_parallel(vector_1, vector_2, tolerance=1e-10)¶
Check if vector vector_1 is parallel to vector vector_2 down to some tolerance.
- pyg4ometry.geant4.solid.are_anti_parallel(vector_1, vector_2, tolerance=1e-10)¶
Check if vector vector_1 is parallel to vector vector_2 down to some tolerance.
- pyg4ometry.geant4.solid.reverse(angles)¶
Invert the rotation represented by these angles.
- pyg4ometry.geant4.solid.two_fold_orientation(v1, v2, e1, e2)¶
matrix_from will align one vector with another, but there are an infinite number of such matrices that align two vectors. This further contrains the rotation by introducing a second pair of vectors.
v1 start v v2 end v e1 start e e2 end v
- class pyg4ometry.geant4.solid._SolidBase(name, type, registry=None)¶
Base class for all solids
- property name¶
- type¶
- registry¶
- evaluateParameter(obj)¶
- evaluateParameterWithUnits(varName)¶
- _addProperty(attribute)¶
- _setProperty(attribute, value)¶
- _getProperty(attribute)¶
- _twoPiValueCheck(attribute, aunit='rad')¶
Raises a ValueError if the attribute is over pyg4ometry.config.twoPiComparisonTolerance over 2 x pi.
- conver2Tessellated()¶
return a TessellatedSolid instance based on the mesh of this solid.
- class pyg4ometry.geant4.solid.OpticalSurface(name, finish, model, surf_type, value, registry, addRegistry=True)¶
Bases:
pyg4ometry.geant4.solid.SolidBase.SolidBase- allowed_models = ['glisur', 'unified', 'LUT', 'DAVIS', 'dichroic']¶
- allowed_types = ['dielectric_metal', 'dielectric_dielectric', 'dielectric_LUT', 'dielectric_LUTDAVIS',...¶
- allowed_finishes = ['polished', 'polishedfrontpainted', 'polishedbackpainted', 'ground', 'groundfrontpainted',...¶
- finish¶
- model¶
- osType¶
- value¶
- properties¶
- __repr__()¶
- __str__()¶
- addProperty(name, matrix)¶
Add a property to this surface from a matrix.
- addVecProperty(name, e, v, eunit='eV', vunit='')¶
Add a property from an energy and a value vector to this object.
- Parameters:
- class pyg4ometry.geant4.solid._SolidBase(name, type, registry=None)¶
Base class for all solids
- property name¶
- type¶
- registry¶
- evaluateParameter(obj)¶
- evaluateParameterWithUnits(varName)¶
- _addProperty(attribute)¶
- _setProperty(attribute, value)¶
- _getProperty(attribute)¶
- _twoPiValueCheck(attribute, aunit='rad')¶
Raises a ValueError if the attribute is over pyg4ometry.config.twoPiComparisonTolerance over 2 x pi.
- conver2Tessellated()¶
return a TessellatedSolid instance based on the mesh of this solid.
- pyg4ometry.geant4.solid._cubeNet(vecList)¶
- class pyg4ometry.geant4.solid.Para(name, pDx, pDy, pDz, pAlpha, pTheta, pPhi, registry, lunit='mm', aunit='rad', addRegistry=True)¶
Bases:
pyg4ometry.geant4.solid.SolidBase.SolidBaseConstructs a parallelepiped.
- Parameters:
name (str) – of the volume
pAlpha (float, Constant, Quantity, Variable) – angle formed by the y axis and the plane joining the centres of the faces parallel tothe z-x plane at -dy/2 and +dy/2
pTheta (float, Constant, Quantity, Variable) – polar angle of the line joining the centres of the faces at -dz/2 and +dz/2 in z
pPhi (float, Constant, Quantity, Variable) – azimuthal angle of the line joining the centres of the faces at -dx/2 and +dz/2 in z
registry (Registry) – for storing solid
lunit (str) – length unit (nm,um,mm,m,km) for solid
aunit (str) – angle unit (rad,deg) for solid
- pX¶
- pY¶
- pZ¶
- pAlpha¶
- pTheta¶
- pPhi¶
- lunit¶
- aunit¶
- dependents = []¶
- varNames = ['pX', 'pY', 'pZ', 'pAlpha', 'pPhi', 'pTheta']¶
- varUnits = ['lunit', 'lunit', 'lunit', 'aunit', 'aunit', 'aunit']¶
- __repr__()¶
- __str__()¶
- mesh()¶
- class pyg4ometry.geant4.solid._SolidBase(name, type, registry=None)¶
Base class for all solids
- property name¶
- type¶
- registry¶
- evaluateParameter(obj)¶
- evaluateParameterWithUnits(varName)¶
- _addProperty(attribute)¶
- _setProperty(attribute, value)¶
- _getProperty(attribute)¶
- _twoPiValueCheck(attribute, aunit='rad')¶
Raises a ValueError if the attribute is over pyg4ometry.config.twoPiComparisonTolerance over 2 x pi.
- conver2Tessellated()¶
return a TessellatedSolid instance based on the mesh of this solid.
- pyg4ometry.geant4.solid._cubeNet(vecList)¶
- class pyg4ometry.geant4.solid.Trap(name, pDz, pTheta, pDPhi, pDy1, pDx1, pDx2, pAlp1, pDy2, pDx3, pDx4, pAlp2, registry, lunit='mm', aunit='rad', addRegistry=True)¶
Bases:
pyg4ometry.geant4.solid.SolidBase.SolidBaseConstructs a general trapezoid.
- Parameters:
name (str) – name of the volume
pDz (float, Constant, Quantity, Variable, Expression) – half length along z
pTheta (float, Constant, Quantity, Variable, Expression) – polar angle of the line joining the centres of the faces at -/+pDz
pPhi (float, Constant, Quantity, Variable, Expression) – azimuthal angle of the line joining the centres of the faces at -/+pDz
pDy1 (float, Constant, Quantity, Variable, Expression) – half-length at -pDz
pDx1 (float, Constant, Quantity, Variable, Expression) – half length along x of the side at y=-pDy1
pDx2 (float, Constant, Quantity, Variable, Expression) – half length along x of the side at y=+pDy1
pAlp1 (float, Constant, Quantity, Variable, Expression) – angle wrt the y axis from the centre of the side (lower endcap)
pDy2 (float, Constant, Quantity, Variable, Expression) – half-length at +pDz
pDx3 (float, Constant, Quantity, Variable, Expression) – half-length of the side at y=-pDy2 of the face at +pDz
pDx4 (float, Constant, Quantity, Variable, Expression) – half-length of the side at y=+pDy2 of the face at +pDz
pAlp2 (float, Constant, Quantity, Variable, Expression) – angle wrt the y axis from the centre of the side (upper endcap)
- pDz¶
- pTheta¶
- pDPhi¶
- pDy1¶
- pDx1¶
- pDx2¶
- pAlp1¶
- pDy2¶
- pDx3¶
- pDx4¶
- pAlp2¶
- lunit¶
- aunit¶
- dependents = []¶
- varNames = ['pDz', 'pTheta', 'pDPhi', 'pDy1', 'pDx1', 'pDx2', 'pAlp1', 'pDy2', 'pDx3', 'pDx4', 'pAlp2']¶
- varUnits = ['lunit', 'aunit', 'aunit', 'lunit', 'lunit', 'lunit', 'aunit', 'lunit', 'lunit', 'lunit', 'aunit']¶
- __repr__()¶
- __str__()¶
- mesh()¶
- class pyg4ometry.geant4.solid._SolidBase(name, type, registry=None)¶
Base class for all solids
- property name¶
- type¶
- registry¶
- evaluateParameter(obj)¶
- evaluateParameterWithUnits(varName)¶
- _addProperty(attribute)¶
- _setProperty(attribute, value)¶
- _getProperty(attribute)¶
- _twoPiValueCheck(attribute, aunit='rad')¶
Raises a ValueError if the attribute is over pyg4ometry.config.twoPiComparisonTolerance over 2 x pi.
- conver2Tessellated()¶
return a TessellatedSolid instance based on the mesh of this solid.
- class pyg4ometry.geant4.solid.Orb(name, pRMax, registry, lunit='mm', nslice=None, nstack=None, addRegistry=True)¶
Bases:
pyg4ometry.geant4.solid.SolidBase.SolidBaseConstructs a solid sphere.
- Parameters:
- pRMax¶
- lunit¶
- nslice¶
- nstack¶
- dependents = []¶
- varNames = ['pRMax']¶
- varUnits = ['lunit']¶
- __repr__()¶
- __str__()¶
- mesh()¶
- class pyg4ometry.geant4.solid._SolidBase(name, type, registry=None)¶
Base class for all solids
- property name¶
- type¶
- registry¶
- evaluateParameter(obj)¶
- evaluateParameterWithUnits(varName)¶
- _addProperty(attribute)¶
- _setProperty(attribute, value)¶
- _getProperty(attribute)¶
- _twoPiValueCheck(attribute, aunit='rad')¶
Raises a ValueError if the attribute is over pyg4ometry.config.twoPiComparisonTolerance over 2 x pi.
- conver2Tessellated()¶
return a TessellatedSolid instance based on the mesh of this solid.
- class pyg4ometry.geant4.solid.EllipticalTube(name, pDx, pDy, pDz, registry, lunit='mm', nstack=None, nslice=None, addRegistry=True)¶
Bases:
pyg4ometry.geant4.solid.SolidBase.SolidBaseConstructs a tube of elliptical cross-section.
- Parameters:
name (str) – name of the solid
pDx (float, Constant, Quantity, Variable, Expression) – length in x
pDy (float, Constant, Quantity, Variable, Expression) – length in y
pDz (float, Constant, Quantity, Variable, Expression) – length in z
registry (Registry) – for storing solid
lunit (str) – length unit (nm,um,mm,m,km) for solid
nslice (int) – number of phi elements for meshing
nstack (int) – number of theta elements for meshing
- pDx¶
- pDy¶
- pDz¶
- lunit¶
- nslice¶
- nstack¶
- dependents = []¶
- varNames = ['pDx', 'pDy', 'pDz']¶
- varUnits = ['lunit', 'lunit', 'lunit']¶
- __repr__()¶
- __str__()¶
- mesh()¶
new meshing based of Tubs meshing
- class pyg4ometry.geant4.solid._SolidBase(name, type, registry=None)¶
Base class for all solids
- property name¶
- type¶
- registry¶
- evaluateParameter(obj)¶
- evaluateParameterWithUnits(varName)¶
- _addProperty(attribute)¶
- _setProperty(attribute, value)¶
- _getProperty(attribute)¶
- _twoPiValueCheck(attribute, aunit='rad')¶
Raises a ValueError if the attribute is over pyg4ometry.config.twoPiComparisonTolerance over 2 x pi.
- conver2Tessellated()¶
return a TessellatedSolid instance based on the mesh of this solid.
- class pyg4ometry.geant4.solid.EllipticalCone(name, pxSemiAxis, pySemiAxis, zMax, pzTopCut, registry, lunit='mm', nslice=None, nstack=None, addRegistry=True)¶
Bases:
pyg4ometry.geant4.solid.SolidBase.SolidBaseConstructs a cone with elliptical cross-section and an optional cut. Both zMax and pzTopCut are half lengths extending from the centre of the cone, at z=0.
- Parameters:
name (str) – name of the volume
pxSemiAxis (float, Constant, Quantity, Variable, Expression) – semiaxis in x at z=0 as a fraction of zMax.
pySemiAxis (float, Constant, Quantity, Variable, Expression) – semiaxis in y at z=0 as a fraction of zMax
zMax (float, Constant, Quantity, Variable, Expression) – half length of the cone.
pzTopCut (float, Constant, Quantity, Variable, Expression) – half length of the cut.
- pxSemiAxis¶
- pySemiAxis¶
- zMax¶
- pzTopCut¶
- lunit¶
- nslice¶
- nstack¶
- dependents = []¶
- varNames = ['pxSemiAxis', 'pySemiAxis', 'zMax', 'pzTopCut']¶
- varUnits = ['lunit', 'lunit', 'lunit', 'lunit']¶
- __repr__()¶
- __str__()¶
- mesh()¶
- class pyg4ometry.geant4.solid._SolidBase(name, type, registry=None)¶
Base class for all solids
- property name¶
- type¶
- registry¶
- evaluateParameter(obj)¶
- evaluateParameterWithUnits(varName)¶
- _addProperty(attribute)¶
- _setProperty(attribute, value)¶
- _getProperty(attribute)¶
- _twoPiValueCheck(attribute, aunit='rad')¶
Raises a ValueError if the attribute is over pyg4ometry.config.twoPiComparisonTolerance over 2 x pi.
- conver2Tessellated()¶
return a TessellatedSolid instance based on the mesh of this solid.
- class pyg4ometry.geant4.solid.Paraboloid(name, pDz, pR1, pR2, registry, lunit='mm', nslice=16, nstack=8, addRegistry=True)¶
Bases:
pyg4ometry.geant4.solid.SolidBase.SolidBaseConstructs a paraboloid with possible cuts along the z axis.
- Parameters:
name (str) – of solid
pDz (float, Constant, Quantity, Variable, Expression) – length along z
pR1 (float, Constant, Quantity, Variable, Expression) – radius at -Dz/2
pR2 (float, Constant, Quantity, Variable, Expression) – radius at +Dz/2 (pR2 > pR1)
registry (Registry) – for storing solid
lunit (str) – length unit (nm,um,mm,m,km) for solid
nslice (int) – number of phi elements for meshing
nstack (int) – number of theta elements for meshing
- pDz¶
- pR1¶
- pR2¶
- lunit¶
- nstack¶
- nslice¶
- dependents = []¶
- varNames = ['pDz', 'pR1', 'pR2']¶
- varUnits = ['lunit', 'lunit', 'lunit']¶
- __repr__()¶
- __str__()¶
- mesh()¶
- class pyg4ometry.geant4.solid._SolidBase(name, type, registry=None)¶
Base class for all solids
- property name¶
- type¶
- registry¶
- evaluateParameter(obj)¶
- evaluateParameterWithUnits(varName)¶
- _addProperty(attribute)¶
- _setProperty(attribute, value)¶
- _getProperty(attribute)¶
- _twoPiValueCheck(attribute, aunit='rad')¶
Raises a ValueError if the attribute is over pyg4ometry.config.twoPiComparisonTolerance over 2 x pi.
- conver2Tessellated()¶
return a TessellatedSolid instance based on the mesh of this solid.
- class pyg4ometry.geant4.solid.Hype(name, innerRadius, outerRadius, innerStereo, outerStereo, lenZ, registry, lunit='mm', aunit='rad', nslice=None, nstack=None, addRegistry=True)¶
Bases:
pyg4ometry.geant4.solid.SolidBase.SolidBaseConstructs a tube with hyperbolic profile.
- Parameters:
name (str) – of solid
innerRadius (float, Constant, Quantity, Variable, Expression) – inner radius
outerRadius (float, Constant, Quantity, Variable, Expression) – outer radius
innerStereo (float, Constant, Quantity, Variable, Expression) – inner stereo angle
outerStereo (float, Constant, Quantity, Variable, Expression) – outer stereo angle
lenZ – length along z
registry (Registry) – for storing solid
lunit (str) – length unit (nm,um,mm,m,km) for solid
aunit (str) – angle unit (rad,deg) for solid
nslice (int) – number of phi elements for meshing
nstack (int) – number of theta elements for meshing
- innerRadius¶
- outerRadius¶
- innerStereo¶
- outerStereo¶
- lenZ¶
- lunit¶
- aunit¶
- nslice¶
- nstack¶
- dependents = []¶
- varNames = ['innerRadius', 'outerRadius', 'innerStereo', 'outerStereo', 'lenZ']¶
- varUnits = ['lunit', 'lunit', 'aunit', 'aunit', 'lunit']¶
- __repr__()¶
- __str__()¶
- checkParameters()¶
- mesh()¶
- class pyg4ometry.geant4.solid._SolidBase(name, type, registry=None)¶
Base class for all solids
- property name¶
- type¶
- registry¶
- evaluateParameter(obj)¶
- evaluateParameterWithUnits(varName)¶
- _addProperty(attribute)¶
- _setProperty(attribute, value)¶
- _getProperty(attribute)¶
- _twoPiValueCheck(attribute, aunit='rad')¶
Raises a ValueError if the attribute is over pyg4ometry.config.twoPiComparisonTolerance over 2 x pi.
- conver2Tessellated()¶
return a TessellatedSolid instance based on the mesh of this solid.
- class pyg4ometry.geant4.solid.Tet(name, anchor, p2, p3, p4, registry, lunit='mm', degeneracyFlag=False, addRegistry=True)¶
Bases:
pyg4ometry.geant4.solid.SolidBase.SolidBaseConstructs a tetrahedra.
- Parameters:
- anchor¶
- p2¶
- p3¶
- p4¶
- lunit¶
- degen¶
- dependents = []¶
- varNames = ['anchor', 'p2', 'p3', 'p4']¶
- varUnits = ['lunit', 'lunit', 'lunit', 'lunit']¶
- __repr__()¶
- __str__()¶
- mesh()¶
- class pyg4ometry.geant4.solid._SolidBase(name, type, registry=None)¶
Base class for all solids
- property name¶
- type¶
- registry¶
- evaluateParameter(obj)¶
- evaluateParameterWithUnits(varName)¶
- _addProperty(attribute)¶
- _setProperty(attribute, value)¶
- _getProperty(attribute)¶
- _twoPiValueCheck(attribute, aunit='rad')¶
Raises a ValueError if the attribute is over pyg4ometry.config.twoPiComparisonTolerance over 2 x pi.
- conver2Tessellated()¶
return a TessellatedSolid instance based on the mesh of this solid.
- class pyg4ometry.geant4.solid._TwistedSolid¶
- makeFaceFromLayer(layer, reverse=False)¶
- makeSide(pal, pbl, pau, pbu, zl, zu, nsl)¶
p = point a = first b = second u = upper l = lower
- meshFromLayers(layers, nsl)¶
- class pyg4ometry.geant4.solid._TwoVector(xIn, yIn)¶
- x¶
- y¶
- Rotated(angle)¶
- __repr__()¶
- __getitem__(index)¶
- __add__(other)¶
- __sub__(other)¶
- __mul__(other)¶
- __rmul__(other)¶
- __truediv__(other)¶
- __abs__()¶
- dot(other)¶
- cross(other)¶
- class pyg4ometry.geant4.solid._Layer(p1, p2, p3, p4, z)¶
- p1¶
- p2¶
- p3¶
- p4¶
- z¶
- __getitem__(index)¶
- Rotated(angle)¶
- __repr__()¶
- class pyg4ometry.geant4.solid.TwistedBox(name, twistedangle, pDx, pDy, pDz, registry, lunit='mm', aunit='rad', nstack=None, refine=0, addRegistry=True)¶
Bases:
pyg4ometry.geant4.solid.SolidBase.SolidBase,pyg4ometry.geant4.solid.TwistedSolid.TwistedSolidConstructs a box that is twisted though angle twisted angle
- Parameters:
name (str) – of the solid
twistedangle (float, Constant, Quantity, Variable, Expression) – twist angle, must be less than pi/2
pDx (float, Constant, Quantity, Variable, Expression) – length in x
pDy (float, Constant, Quantity, Variable, Expression) – length in y
pDz (float, Constant, Quantity, Variable, Expression) – length in z
refine (int) – number of steps to iteratively smoothen the mesh by doubling the number of vertices at every step
registry (Registry) – for storing solid
lunit (str) – length unit (nm,um,mm,m,km) for solid
aunit (str) – angle unit (rad,deg) for solid
nstack (int) – Not written
- twistedAngle¶
- pDx¶
- pDy¶
- pDz¶
- lunit¶
- aunit¶
- nstack¶
- refine¶
- dependents = []¶
- varNames = ['twistedAngle', 'pDx', 'pDy', 'pDz']¶
- varUnits = ['aunit', 'lunit', 'lunit', 'lunit']¶
- __repr__()¶
- __str__()¶
- checkParameters()¶
- makeLayers(p1, p2, p3, p4, pDz, theta, nstack)¶
- mesh_old()¶
- makeLayerEdge(pDx, pDy, pTwistedAngle=0, nx=20, ny=20)¶
- mesh()¶
- class pyg4ometry.geant4.solid._SolidBase(name, type, registry=None)¶
Base class for all solids
- property name¶
- type¶
- registry¶
- evaluateParameter(obj)¶
- evaluateParameterWithUnits(varName)¶
- _addProperty(attribute)¶
- _setProperty(attribute, value)¶
- _getProperty(attribute)¶
- _twoPiValueCheck(attribute, aunit='rad')¶
Raises a ValueError if the attribute is over pyg4ometry.config.twoPiComparisonTolerance over 2 x pi.
- conver2Tessellated()¶
return a TessellatedSolid instance based on the mesh of this solid.
- class pyg4ometry.geant4.solid._TwistedSolid¶
- makeFaceFromLayer(layer, reverse=False)¶
- makeSide(pal, pbl, pau, pbu, zl, zu, nsl)¶
p = point a = first b = second u = upper l = lower
- meshFromLayers(layers, nsl)¶
- class pyg4ometry.geant4.solid._TwoVector(xIn, yIn)¶
- x¶
- y¶
- Rotated(angle)¶
- __repr__()¶
- __getitem__(index)¶
- __add__(other)¶
- __sub__(other)¶
- __mul__(other)¶
- __rmul__(other)¶
- __truediv__(other)¶
- __abs__()¶
- dot(other)¶
- cross(other)¶
- class pyg4ometry.geant4.solid._Layer(p1, p2, p3, p4, z)¶
- p1¶
- p2¶
- p3¶
- p4¶
- z¶
- __getitem__(index)¶
- Rotated(angle)¶
- __repr__()¶
- class pyg4ometry.geant4.solid.TwistedTrap(name, twistedAngle, pDz, pTheta, pDPhi, pDy1, pDx1, pDx2, pDy2, pDx3, pDx4, pAlp, registry, lunit='mm', aunit='rad', nstack=None, addRegistry=True)¶
Bases:
pyg4ometry.geant4.solid.SolidBase.SolidBase,pyg4ometry.geant4.solid.TwistedSolid.TwistedSolidConstructs a general trapezoid with a twist around one axis.
- Parameters:
name (str) – of the solid
twistedAngle – angle of twist (<90 deg)
pDz (float, Constant, Quantity, Variable, Expression) – length along z
pDx1 (float, Constant, Quantity, Variable, Expression) – length along x of the side at y=-pDy1/2
pDx2 (float, Constant, Quantity, Variable, Expression) – length along x of the side at y=+pDy1/2
pTheta (float, Constant, Quantity, Variable, Expression) – polar angle of the line joining the centres of the faces at -/+pDz/2
pPhi (float, Constant, Quantity, Variable, Expression) – azimuthal angle of the line joining the centres of the faces at -/+pDz/2
pDy1 (float, Constant, Quantity, Variable, Expression) – length at -pDz/2
pDy2 (float, Constant, Quantity, Variable, Expression) – length at +pDz/2
pDx3 (float, Constant, Quantity, Variable, Expression) – length of the side at y=-pDy2 of the face at +pDz/2
pDx4 (float, Constant, Quantity, Variable, Expression) – length of the side at y=+pDy2 of the face at +pDz/2
pAlp (float, Constant, Quantity, Variable, Expression) – angle wrt the y axi from the centre of the side
registry (Registry) – for storing solid
lunit (str) – length unit (nm,um,mm,m,km) for solid
aunit (str) – angle unit (rad,deg) for solid
- twistedAngle¶
- pDz¶
- pTheta¶
- pDPhi¶
- pDy1¶
- pDx1¶
- pDx2¶
- pDy2¶
- pDx3¶
- pDx4¶
- pAlp¶
- lunit¶
- aunit¶
- nstack¶
- dependents = []¶
- varNames = ['twistedAngle', 'pDz', 'pTheta', 'pDPhi', 'pDy1', 'pDx1', 'pDx2', 'pDy2', 'pDx3', 'pDx4', 'pAlp']¶
- varUnits = ['aunit', 'lunit', 'aunit', 'aunit', 'lunit', 'lunit', 'lunit', 'lunit', 'lunit', 'lunit', 'aunit']¶
- checkParameters()¶
- __repr__()¶
- __str__()¶
- makeLayers(pl1, pl2, pl3, pl4, pu1, pu2, pu3, pu4, pDz, twist, theta, nsl)¶
- mesh()¶
- class pyg4ometry.geant4.solid._SolidBase(name, type, registry=None)¶
Base class for all solids
- property name¶
- type¶
- registry¶
- evaluateParameter(obj)¶
- evaluateParameterWithUnits(varName)¶
- _addProperty(attribute)¶
- _setProperty(attribute, value)¶
- _getProperty(attribute)¶
- _twoPiValueCheck(attribute, aunit='rad')¶
Raises a ValueError if the attribute is over pyg4ometry.config.twoPiComparisonTolerance over 2 x pi.
- conver2Tessellated()¶
return a TessellatedSolid instance based on the mesh of this solid.
- class pyg4ometry.geant4.solid._TwoVector(xIn, yIn)¶
- x¶
- y¶
- Rotated(angle)¶
- __repr__()¶
- __getitem__(index)¶
- __add__(other)¶
- __sub__(other)¶
- __mul__(other)¶
- __rmul__(other)¶
- __truediv__(other)¶
- __abs__()¶
- dot(other)¶
- cross(other)¶
- class pyg4ometry.geant4.solid._Layer(p1, p2, p3, p4, z)¶
- p1¶
- p2¶
- p3¶
- p4¶
- z¶
- __getitem__(index)¶
- Rotated(angle)¶
- __repr__()¶
- class pyg4ometry.geant4.solid._TwistedSolid¶
- makeFaceFromLayer(layer, reverse=False)¶
- makeSide(pal, pbl, pau, pbu, zl, zu, nsl)¶
p = point a = first b = second u = upper l = lower
- meshFromLayers(layers, nsl)¶
- class pyg4ometry.geant4.solid.TwistedTrd(name, twistedangle, pDx1, pDx2, pDy1, pDy2, pDz, registry, lunit='mm', aunit='rad', nstack=None, refine=0, addRegistry=True)¶
Bases:
pyg4ometry.geant4.solid.SolidBase.SolidBase,pyg4ometry.geant4.solid.TwistedSolid.TwistedSolidConstructs a twisted general trapezoid.
- Parameters:
name (str) – of solid
twistedangle (float, Constant, Quantity, Variable, Expression) – twist angle, must be less than 0.5*pi
pDx1 (float, Constant, Quantity, Variable, Expression) – length in x at surface positioned at -pDz/2
pDx2 (float, Constant, Quantity, Variable, Expression) – length in x at surface positioned at +pDz/2
pDy1 (float, Constant, Quantity, Variable, Expression) – length in y at surface positioned at -pDz/2
pDy2 (float, Constant, Quantity, Variable, Expression) – length in y at surface positioned at +pDz/2
pDz (float, Constant, Quantity, Variable, Expression) – length in z
refine (int) – number of steps to iteratively smoothen the mesh by doubling the number of vertices at every step
registry (Registry) – for storing solid
lunit (str) – length unit (nm,um,mm,m,km) for solid
aunit (str) – angle unit (rad,deg) for solid
nstack (int) – number of theta elements for meshing
- twistedAngle¶
- pDx1¶
- pDx2¶
- pDy1¶
- pDy2¶
- pDz¶
- lunit¶
- aunit¶
- nstack¶
- refine¶
- dependents = []¶
- varNames = ['twistedAngle', 'pDx1', 'pDx2', 'pDy1', 'pDy2', 'pDz']¶
- varUnits = ['aunit', 'lunit', 'lunit', 'lunit', 'lunit', 'lunit']¶
- __repr__()¶
- __str__()¶
- checkParameters()¶
- makeLayers(pl1, pl2, pl3, pl4, pu1, pu2, pu3, pu4, pDz, theta, nsl)¶
- mesh()¶
- class pyg4ometry.geant4.solid._SolidBase(name, type, registry=None)¶
Base class for all solids
- property name¶
- type¶
- registry¶
- evaluateParameter(obj)¶
- evaluateParameterWithUnits(varName)¶
- _addProperty(attribute)¶
- _setProperty(attribute, value)¶
- _getProperty(attribute)¶
- _twoPiValueCheck(attribute, aunit='rad')¶
Raises a ValueError if the attribute is over pyg4ometry.config.twoPiComparisonTolerance over 2 x pi.
- conver2Tessellated()¶
return a TessellatedSolid instance based on the mesh of this solid.
- class pyg4ometry.geant4.solid.TwistedTubs(name, endinnerrad, endouterrad, zlen, phi, twistedangle, registry, lunit='mm', aunit='rad', nslice=None, nstack=None, addRegistry=True)¶
Bases:
pyg4ometry.geant4.solid.SolidBase.SolidBaseCreates a twisted tube segement. Note that only 1 constructor is supprted.
- Parameters:
name (str) – of solid
endinnerrad (float, Constant, Quantity, Variable, Expression) – inner radius at the end of the segment
endinnerrad – outer radius at the end of the segment
zlen (float, Constant, Quantity, Variable, Expression) – length of the tube segement
twistedangle (float, Constant, Quantity, Variable, Expression) – twist angle
registry (Registry) – for storing solid
lunit (str) – length unit (nm,um,mm,m,km) for solid
aunit (str) – angle unit (rad,deg) for solid
nslice – number of phi elements for meshing
nstack (int) – number of theta elements for meshing
- endinnerrad¶
- endouterrad¶
- zlen¶
- phi¶
- twistedangle¶
- lunit¶
- aunit¶
- nslice¶
- nstack¶
- dependents = []¶
- varNames = ['endinnerrad', 'endouterrad', 'zlen', 'phi', 'twistedangle']¶
- varUnits = ['lunit', 'lunit', 'lunit', 'aunit', 'aunit']¶
- __repr__()¶
- __str__()¶
- makeLayers(verts_bot, verts_top)¶
- mesh()¶
- class pyg4ometry.geant4.solid._SolidBase(name, type, registry=None)¶
Base class for all solids
- property name¶
- type¶
- registry¶
- evaluateParameter(obj)¶
- evaluateParameterWithUnits(varName)¶
- _addProperty(attribute)¶
- _setProperty(attribute, value)¶
- _getProperty(attribute)¶
- _twoPiValueCheck(attribute, aunit='rad')¶
Raises a ValueError if the attribute is over pyg4ometry.config.twoPiComparisonTolerance over 2 x pi.
- conver2Tessellated()¶
return a TessellatedSolid instance based on the mesh of this solid.
- class pyg4ometry.geant4.solid._GenericPolyhedra(name, pSPhi, pDPhi, numSide, pR, pZ, registry, lunit='mm', aunit='rad', addRegistry=True)¶
Bases:
pyg4ometry.geant4.solid.SolidBase.SolidBaseConstructs a solid of rotation using an arbitrary 2D surface defined by a series of (r,z) coordinates.
- Parameters:
name (str) – name
pSPhi (float, Constant, Quantity, Variable, Expression) – angle Phi at start of rotation
pDPhi (float, Constant, Quantity, Variable, Expression) – angle Phi at end of rotation
numSide (float, Constant, Quantity, Variable, Expression) – number of polygon sides
pR (list of float, Constant, Quantity, Variable, Expression) – r coordinate list
pZ (list of float, Constant, Quantity, Variable, Expression) – z coordinate list
- pSPhi¶
- pDPhi¶
- numSide¶
- pR¶
- pZ¶
- lunit¶
- aunit¶
- varNames = ['pSPhi', 'pDPhi', 'numSide', 'pR', 'pZ']¶
- varUnits = ['aunit', 'aunit', None, 'lunit', 'lunit']¶
- dependents = []¶
- __repr__()¶
- __str__()¶
- checkParameters()¶
- mesh()¶
- class pyg4ometry.geant4.solid.GenericPolycone(name, pSPhi, pDPhi, pR, pZ, registry, lunit='mm', aunit='rad', nslice=None, addRegistry=True)¶
Bases:
pyg4ometry.geant4.solid.SolidBase.SolidBaseConstructs a solid of rotation using an arbitrary 2D surface defined by a series of (r,z) coordinates.
- Parameters:
name (str) – of solid
pSPhi (float, Constant, Quantity, Variable, Expression) – angle phi at start of rotation
pDPhi (float, Constant, Quantity, Variable, Expression) – angle Phi at end of rotation
pR (list of float, Constant, Quantity, Variable, Expression) – r coordinate
pZ (list of float, Constant, Quantity, Variable, Expression) – z coordinate
registry (Registry) – for storing solid
lunit (str) – length unit (nm,um,mm,m,km) for solid
aunit (str) – angle unit (rad,deg) for solid
nslice (int) – number of phi elements for meshing
- pSPhi¶
- pDPhi¶
- pR¶
- pZ¶
- lunit¶
- aunit¶
- nslice¶
- varNames = ['pSPhi', 'pDPhi', 'pR', 'pZ']¶
- varUnits = ['aunit', 'aunit', 'lunit', 'lunit']¶
- dependents = []¶
- __repr__()¶
- __str__()¶
- checkParameters()¶
- mesh()¶
- class pyg4ometry.geant4.solid._SolidBase(name, type, registry=None)¶
Base class for all solids
- property name¶
- type¶
- registry¶
- evaluateParameter(obj)¶
- evaluateParameterWithUnits(varName)¶
- _addProperty(attribute)¶
- _setProperty(attribute, value)¶
- _getProperty(attribute)¶
- _twoPiValueCheck(attribute, aunit='rad')¶
Raises a ValueError if the attribute is over pyg4ometry.config.twoPiComparisonTolerance over 2 x pi.
- conver2Tessellated()¶
return a TessellatedSolid instance based on the mesh of this solid.
- class pyg4ometry.geant4.solid.GenericPolyhedra(name, pSPhi, pDPhi, numSide, pR, pZ, registry, lunit='mm', aunit='rad', addRegistry=True)¶
Bases:
pyg4ometry.geant4.solid.SolidBase.SolidBaseConstructs a solid of rotation using an arbitrary 2D surface defined by a series of (r,z) coordinates.
- Parameters:
name (str) – name
pSPhi (float, Constant, Quantity, Variable, Expression) – angle Phi at start of rotation
pDPhi (float, Constant, Quantity, Variable, Expression) – angle Phi at end of rotation
numSide (float, Constant, Quantity, Variable, Expression) – number of polygon sides
pR (list of float, Constant, Quantity, Variable, Expression) – r coordinate list
pZ (list of float, Constant, Quantity, Variable, Expression) – z coordinate list
- pSPhi¶
- pDPhi¶
- numSide¶
- pR¶
- pZ¶
- lunit¶
- aunit¶
- varNames = ['pSPhi', 'pDPhi', 'numSide', 'pR', 'pZ']¶
- varUnits = ['aunit', 'aunit', None, 'lunit', 'lunit']¶
- dependents = []¶
- __repr__()¶
- __str__()¶
- checkParameters()¶
- mesh()¶
- class pyg4ometry.geant4.solid._SolidBase(name, type, registry=None)¶
Base class for all solids
- property name¶
- type¶
- registry¶
- evaluateParameter(obj)¶
- evaluateParameterWithUnits(varName)¶
- _addProperty(attribute)¶
- _setProperty(attribute, value)¶
- _getProperty(attribute)¶
- _twoPiValueCheck(attribute, aunit='rad')¶
Raises a ValueError if the attribute is over pyg4ometry.config.twoPiComparisonTolerance over 2 x pi.
- conver2Tessellated()¶
return a TessellatedSolid instance based on the mesh of this solid.
- class pyg4ometry.geant4.solid.GenericTrap(name, v1x, v1y, v2x, v2y, v3x, v3y, v4x, v4y, v5x, v5y, v6x, v6y, v7x, v7y, v8x, v8y, dz, registry, nstack=20, lunit='mm', addRegistry=True)¶
Bases:
pyg4ometry.geant4.solid.SolidBase.SolidBaseConstructs an arbitrary trapezoid using two quadrilaterals sitting on two parallel planes. Vertices 1-4 define the quadrilateral at -dz and vertices 5-8 define the quadrilateral at +dz. This solid is called Arb8 in GDML notation.
- Parameters:
name – string, name of the volume
v1x – vertex 1 x position
v1y – vertex 1 y position
v2x – vertex 2 x position
v2y – vertex 2 y position
v3x – vertex 3 x position
v3y – vertex 3 y position
v4x – vertex 4 x position
v4y – vertex 4 y position
v5x – vertex 5 x position
v5y – vertex 5 y position
v6x – vertex 6 x position
v6y – vertex 6 y position
v7x – vertex 7 x position
v7y – vertex 7 y position
v8x – vertex 8 x position
v8y – vertex 8 y position
dz – half length along z
registry (Registry) – for storing solid
- dz¶
- lunit¶
- nstack¶
- vars_in¶
- dependents = []¶
- varNames = ['v1x', 'v1y', 'v2x', 'v2y', 'v3x', 'v3y', 'v4x', 'v4y', 'v5x', 'v5y', 'v6x', 'v6y', 'v7x',...¶
- varUnits¶
- __repr__()¶
- __str__()¶
- polygon_area(vertices)¶
- get_vertex(index)¶
- makeLayers(verts_bot, verts_top)¶
- mesh()¶
- class pyg4ometry.geant4.solid._SolidBase(name, type, registry=None)¶
Base class for all solids
- property name¶
- type¶
- registry¶
- evaluateParameter(obj)¶
- evaluateParameterWithUnits(varName)¶
- _addProperty(attribute)¶
- _setProperty(attribute, value)¶
- _getProperty(attribute)¶
- _twoPiValueCheck(attribute, aunit='rad')¶
Raises a ValueError if the attribute is over pyg4ometry.config.twoPiComparisonTolerance over 2 x pi.
- conver2Tessellated()¶
return a TessellatedSolid instance based on the mesh of this solid.
- class pyg4ometry.geant4.solid.TessellatedSolid(name, meshTess, registry, meshtype=MeshType.Freecad, addRegistry=True)¶
Bases:
pyg4ometry.geant4.solid.SolidBase.SolidBaseConstructs a tessellated solid
- Parameters:
- meshtype¶
- dependents = []¶
- varNames = []¶
- varUnits = []¶
- __repr__()¶
- __str__()¶
- addVertex(vertex)¶
- addTriangle(triangle)¶
- removeDuplicateVertices()¶
- mesh()¶
- pyg4ometry.geant4.solid.createTessellatedSolid(name, polygons, reg)¶
- Args:
name: Name of the tessallated solid polygons: list of polygons (list of points given in clockwise order). All polygons should have the same number of points. reg: registry
Returns: TessellatedSolid
- class pyg4ometry.geant4.solid._SolidBase(name, type, registry=None)¶
Base class for all solids
- property name¶
- type¶
- registry¶
- evaluateParameter(obj)¶
- evaluateParameterWithUnits(varName)¶
- _addProperty(attribute)¶
- _setProperty(attribute, value)¶
- _getProperty(attribute)¶
- _twoPiValueCheck(attribute, aunit='rad')¶
Raises a ValueError if the attribute is over pyg4ometry.config.twoPiComparisonTolerance over 2 x pi.
- conver2Tessellated()¶
return a TessellatedSolid instance based on the mesh of this solid.
- class pyg4ometry.geant4.solid.MultiUnion(name, objects, transformations, registry, addRegistry=True)¶
Bases:
pyg4ometry.geant4.solid.SolidBase.SolidBaseUnion between two or more solids.
- Parameters:
- objects¶
- transformations¶
- varNames = ['transformations']¶
- varUnits = [None]¶
- dependents = []¶
- __repr__()¶
- __str__()¶
- mesh()¶
- pyg4ometry.geant4.solid.rad2deg(rad)¶
Convert rad in radians into degrees
- pyg4ometry.geant4.solid.deg2rad(deg)¶
Convert deg in degrees into radians
- pyg4ometry.geant4.solid.grad2rad(gradians)¶
Convert rad in gradians into radians
- pyg4ometry.geant4.solid.tbxyz2axisangle(rv)¶
Tait-Bryan x-y-z rotation to axis-angle representation Algorithm from http://www.sedris.org/wg8home/Documents/WG80485.pdf
For converting rotation angles to an active axis/angle pair for use in pycsg. Order of rotation: x->y->z.
- pyg4ometry.geant4.solid.matrix2axisangle(matrix)¶
Convert 3x3 transformation matrix to axis angle representation
- pyg4ometry.geant4.solid.axisangle2matrix(axis, angle)¶
Convert axis angle to transformation matrix
- Parameters:
axis (list/array(3)) – axis for rotation
angle (float) – rotation angle
- Returns:
transformation matrix
- Return type:
array(3,3)
- pyg4ometry.geant4.solid.matrix2tbxyz(matrix)¶
Convert rotation matrix to Tait-Bryan angles. Order of rotation is x -> y -> z.
- Parameters:
matrix – active (positive angle = anti-clockwise rotation about that axis when looking at the axis) matrix.
- Returns:
[x, y, z] Tait-Bryan angles in a list.
- Return type:
list(3)
- pyg4ometry.geant4.solid.axisangle2tbxyz(axis, angle)¶
Convert axis and angle to tait bryan angles
- Parameters:
axis (list/array(3)) – axis for rotation
angle (float) – rotation angle
- Returns:
tait bryan angles (x-y-z)
- Return type:
array(3)
- pyg4ometry.geant4.solid.tbxyz2matrix(angles)¶
Convert tait bryan angles to a single passive rotation matrix. rotation order = x -> y -> z.
- Parameters:
angles – list of angles: x, y, z
- Returns:
rotation matrix
- Return type:
array(3,3)
- pyg4ometry.geant4.solid.tbzyx2matrix(angles)¶
Convert Tait-Bryan angles to a single passive rotation matrix. rotation order = x -> y -> z.
- Parameters:
angles – list of angles: x, y, z
- Returns:
rotation matrix
- Return type:
array(3,3)
- pyg4ometry.geant4.solid.matrix_from(v_from, v_to)¶
Returns the rotation matrix that rotates v_from to parallel to v_to.
Useful for ensuring a given face points in a certain direction.
v_from and v_to should be array-like three-vectors.
- pyg4ometry.geant4.solid._rodrigues_anti_parallel(v_from, v_to)¶
v_from = vector FROM v_to = vector TO
- pyg4ometry.geant4.solid.are_parallel(vector_1, vector_2, tolerance=1e-10)¶
Check if vector vector_1 is parallel to vector vector_2 down to some tolerance.
- pyg4ometry.geant4.solid.are_anti_parallel(vector_1, vector_2, tolerance=1e-10)¶
Check if vector vector_1 is parallel to vector vector_2 down to some tolerance.
- pyg4ometry.geant4.solid.reverse(angles)¶
Invert the rotation represented by these angles.
- pyg4ometry.geant4.solid.two_fold_orientation(v1, v2, e1, e2)¶
matrix_from will align one vector with another, but there are an infinite number of such matrices that align two vectors. This further contrains the rotation by introducing a second pair of vectors.
v1 start v v2 end v e1 start e e2 end v
- class pyg4ometry.geant4.solid._SolidBase(name, type, registry=None)¶
Base class for all solids
- property name¶
- type¶
- registry¶
- evaluateParameter(obj)¶
- evaluateParameterWithUnits(varName)¶
- _addProperty(attribute)¶
- _setProperty(attribute, value)¶
- _getProperty(attribute)¶
- _twoPiValueCheck(attribute, aunit='rad')¶
Raises a ValueError if the attribute is over pyg4ometry.config.twoPiComparisonTolerance over 2 x pi.
- conver2Tessellated()¶
return a TessellatedSolid instance based on the mesh of this solid.
- class pyg4ometry.geant4.solid.Scaled(name, solid, pX, pY, pZ, registry, addRegistry=True)¶
Bases:
pyg4ometry.geant4.solid.SolidBase.SolidBaseConstructs a scaled sold.
- Parameters:
- Poram solid:
reference for scaling
- solid¶
- pX¶
- pY¶
- pZ¶
- varNames = ['pX', 'pY', 'pZ']¶
- varUnits = [None, None, None]¶
- dependents = []¶
- __repr__()¶
- __str__()¶
- mesh()¶
- class pyg4ometry.geant4.solid._SolidBase(name, type, registry=None)¶
Base class for all solids
- property name¶
- type¶
- registry¶
- evaluateParameter(obj)¶
- evaluateParameterWithUnits(varName)¶
- _addProperty(attribute)¶
- _setProperty(attribute, value)¶
- _getProperty(attribute)¶
- _twoPiValueCheck(attribute, aunit='rad')¶
Raises a ValueError if the attribute is over pyg4ometry.config.twoPiComparisonTolerance over 2 x pi.
- conver2Tessellated()¶
return a TessellatedSolid instance based on the mesh of this solid.
- class pyg4ometry.geant4.solid.HalfSpace(name, registry=None)¶
Bases:
pyg4ometry.geant4.solid.SolidBase.SolidBase- pgons = []¶
- addPolygon(pgonVertex)¶
- mesh()¶
- class pyg4ometry.geant4.solid.SolidBase(name, type, registry=None)¶
Base class for all solids
- property name¶
- type¶
- registry¶
- evaluateParameter(obj)¶
- evaluateParameterWithUnits(varName)¶
- _addProperty(attribute)¶
- _setProperty(attribute, value)¶
- _getProperty(attribute)¶
- _twoPiValueCheck(attribute, aunit='rad')¶
Raises a ValueError if the attribute is over pyg4ometry.config.twoPiComparisonTolerance over 2 x pi.
- conver2Tessellated()¶
return a TessellatedSolid instance based on the mesh of this solid.