pyg4ometry.fluka.body

Set of classes for FLUKA bodies.

Classes

RPP

Rectangular Parallelepiped

BOX

General Rectangular Parallelepiped

SPH

Sphere

RCC

Right Circular Cylinder

REC

Right Elliptical Cylinder

TRC

Truncated Right-angled Cone

ELL

Ellipsoid of Revolution

WED

Right Angle Wedge

RAW

Base class representing a body as defined in FLUKA

ARB

Arbitrary Convex Polyhedron

XYP

Infinite half-space delimited by the x-y plane (perpendicular to the z-axis)

XZP

Infinite half-space delimited by the x-y plane (perpendicular to the y-axis)

YZP

Infinite half-space delimited by the x-y plane (perpendicular to the x-axis)

PLA

Infinite half-space delimited by the x-y plane (perpendicular to the z-axis) Generic infinite half-space.

XCC

Infinite Circular Cylinder parallel to the x-axis

YCC

Infinite Circular Cylinder parallel to the y-axis

ZCC

Infinite Circular Cylinder parallel to the z-axis

XEC

Infinite Elliptical Cylinder parallel to the x-axis

YEC

Infinite Elliptical Cylinder parallel to the y-axis

ZEC

Infinite Elliptical Cylinder parallel to the z-axis

QUA

Generic quadric

Module Contents

class pyg4ometry.fluka.body.RPP(name, xmin, xmax, ymin, ymax, zmin, zmax, transform=None, flukaregistry=None, addRegistry=True, comment='')

Bases: BodyMixin

Rectangular Parallelepiped

Parameters:
  • name (str) – of body

  • xmin (float) – lower x coordinate of RPP

  • xmax (float) – upper x coordinate of RPP

  • ymin (float) – lower y coordinate of RPP

  • ymax (float) – upper y coordinate of RPP

  • zmin (float) – lower z coordinate of RPP

  • zmax (float) – upper z coordinate of RPP)

name
lower
upper
transform
comment
centre(aabb=None)
rotation()
lengths()
geant4Solid(reg, aabb=None)
__repr__()
_withLengthSafety(safety, reg)
flukaFreeString()
hash()
class pyg4ometry.fluka.body.BOX(name, vertex, edge1, edge2, edge3, transform=None, flukaregistry=None, addRegistry=True, comment='')

Bases: BodyMixin

General Rectangular Parallelepiped

Parameters:
  • name (str) – of body

  • vertex (list) – position [x, y, z] of one of the corners.

  • edge1 (list) – vector [x, y, z] denoting the first side of the box.

  • edge2 (list) – vector [x, y, z] denoting the second side of the box.

  • edge3 (list) – vector [x, y, z] denoting the second side of the box.

name
vertex
edge1
edge2
edge3
transform
comment
centre(aabb=None)
rotation()
lengths()
geant4Solid(greg, aabb=None)
__repr__()
_withLengthSafety(safety, reg)
flukaFreeString()
hash()
class pyg4ometry.fluka.body.SPH(name, point, radius, transform=None, flukaregistry=None, comment='')

Bases: BodyMixin

Sphere

Parameters:
  • name (str) – of body

  • point (list) – position [x, y, z] of the centre of the sphere.

  • radius (float) – radius of the sphere.

name
point
radius
transform
comment
centre(aabb=None)
rotation()
geant4Solid(reg, aabb=None)
__repr__()
_withLengthSafety(safety, reg)
flukaFreeString()
hash()
class pyg4ometry.fluka.body.RCC(name, face, direction, radius, transform=None, flukaregistry=None, comment='')

Bases: BodyMixin

Right Circular Cylinder

Parameters:
  • name (str) – of body

  • vertex (list) – position [x, y, z] of one of the faces of the cylinder.

  • edge1 (list) – vector [x, y, z] denoting the direction along the length of the cylinder.

  • edge2 (float) – radius of the cylinder face.

name
face
direction
radius
transform
comment
centre(aabb=None)
rotation()
geant4Solid(reg, aabb=None)
__repr__()
_withLengthSafety(safety, reg)
flukaFreeString()
hash()
class pyg4ometry.fluka.body.REC(name, face, direction, semiminor, semimajor, transform=None, flukaregistry=None, comment='')

Bases: BodyMixin

Right Elliptical Cylinder

Parameters:
  • name (str) – of body

  • vertex (list) – position [x, y, z] of one of the faces of the cylinder.

  • semiminor (list) – vector [x, y, z] denoting the direction along the semiminor axis of the ellipse.

  • semimajor (list) – vector [x, y, z] denoting the direction along the semimajor axis of the ellipse.

name
face
direction
semiminor
semimajor
transform
comment
centre(aabb=None)
rotation()
geant4Solid(reg, aabb=None)
__repr__()
_withLengthSafety(safety, reg)
flukaFreeString()
hash()
class pyg4ometry.fluka.body.TRC(name, major_centre, direction, major_radius, minor_radius, transform=None, flukaregistry=None, comment='')

Bases: BodyMixin

Truncated Right-angled Cone

Parameters:
  • name (str) – of body

  • major_centre (list) – vector [x, y, z] position of the centre of the larger face.

  • direction (list) – vector [x, y, z] pointing from the larger face to the smaller face.

  • major_radius (float) – radius of the larger face.

  • minor_radius (float) – radius of the smaller face.

name
major_centre
direction
major_radius
minor_radius
transform
comment
centre(aabb=None)
rotation()
geant4Solid(registry, aabb=None)
__repr__()
_withLengthSafety(safety, reg)
flukaFreeString()
hash()
class pyg4ometry.fluka.body.ELL(name, focus1, focus2, length, transform=None, flukaregistry=None, comment='')

Bases: BodyMixin

Ellipsoid of Revolution

Parameters:
  • name (str) – of body

  • focus1 (list) – position [x, y, z] denoting of one of the foci.

  • focus2 (list) – position [x, y, z] denoting the other focus.

  • length (float) – length of the ellipse axis which the foci lie on.

name
focus1
focus2
length
transform
comment
semimajor
centre(aabb=None)
rotation()
_linearEccentricity()
_semiminor()
geant4Solid(greg, aabb=None)
__repr__()
_withLengthSafety(safety, reg)
flukaFreeString()
hash()
class pyg4ometry.fluka.body.WED(name, vertex, edge1, edge2, edge3, transform=None, flukaregistry=None, comment='')

Bases: _WED_RAW

Right Angle Wedge

Parameters:
  • name (str) – of body

  • vertex (list) – position [x, y, z] of one of the the rectangular corners.

  • edge1 (list) – vector [x, y, z] denoting height of the wedge.

  • edge2 (list) – vector [x, y, z] denoting width of the wedge.

  • edge3 (list) – vector [x, y, z] denoting length of the wedge.

class pyg4ometry.fluka.body.RAW(name, vertex, edge1, edge2, edge3, transform=None, flukaregistry=None, comment='')

Bases: _WED_RAW

Base class representing a body as defined in FLUKA

__doc__
class pyg4ometry.fluka.body.ARB(name, vertices, facenumbers, transform=None, flukaregistry=None, comment='')

Bases: BodyMixin

Arbitrary Convex Polyhedron

Parameters:
  • name (str) – of body

  • vertices (list) – Eight vertices which make up the polyhedron as [[x1, y1, z1], [x2, y2, z2], …]. There must be eight even if only six or seven vertices are needed to make up the polydedron.

  • facenumbers (float) – The faces of the polyhedron expressed as floats where each digit of the float refers to one of the vertices which makes up that face. Six must always be provided as [1234,8765, …], even if only four or five faces are needed. Any unneeded faces must be set to 0 (no less than 4 sides). Note that the references to the vertices are not zero-counting. The order of the vertices denoted in the facenumbers must be either all clockwise or all anticlockwise, which if not obeyed will result in erroneous output without warning.

name
vertices
facenumbers
transform
comment
_nfaces = 6
zeros = []
centre(aabb=None)
rotation()
_faceNumbersToZeroCountingIndices()
_extent()
geant4Solid(greg, aabb=None)
_toTesselatedSolid(verticesAndPolygons, greg, addRegistry)
_getVerticesAndPolygons()
_toVerticesAndPolygons(reverse)
__repr__()
_withLengthSafety(safety, reg)
flukaFreeString()
hash()
class pyg4ometry.fluka.body.XYP(name, z, transform=None, flukaregistry=None, comment='')

Bases: _HalfSpaceMixin

Infinite half-space delimited by the x-y plane (perpendicular to the z-axis)

Parameters:
  • name (str) – of body

  • z (float) – position of the x-y plane on the z-axis. All points less than z are considered to be part of this body.

name
z
transform
comment
__repr__()
_withLengthSafety(safety, reg)
flukaFreeString()
hash()
toPlane()
class pyg4ometry.fluka.body.XZP(name, y, transform=None, flukaregistry=None, comment='')

Bases: _HalfSpaceMixin

Infinite half-space delimited by the x-y plane (perpendicular to the y-axis)

Parameters:
  • name (str) – of body

  • y (float) – position of the x-y plane on the y-axis. All points less than y are considered to be part of this body.

name
y
transform
comment
__repr__()
_withLengthSafety(safety, reg)
flukaFreeString()
hash()
toPlane()
class pyg4ometry.fluka.body.YZP(name, x, transform=None, flukaregistry=None, comment='')

Bases: _HalfSpaceMixin

Infinite half-space delimited by the x-y plane (perpendicular to the x-axis)

Parameters:
  • name (str) – of body

  • x (float) – position of the x-y plane on the x-axis. All points less than x are considered to be part of this body.

name
x
transform
comment
__repr__()
_withLengthSafety(safety, reg)
flukaFreeString()
hash()
toPlane()
class pyg4ometry.fluka.body.PLA(name, normal, point, transform=None, flukaregistry=None, comment='')

Bases: _HalfSpaceMixin

Infinite half-space delimited by the x-y plane (perpendicular to the z-axis) Generic infinite half-space.

Parameters:
  • name (str) – of body

  • normal (list) – position of a point on the plane

  • normal – vector perpendicular to the face of the plane, pointing away from the contents of the half space.

name
normal
point
transform
comment
rotation()
__repr__()
_withLengthSafety(safety, reg=None)
flukaFreeString()
hash()
toPlane()
class pyg4ometry.fluka.body.XCC(name, y, z, radius, transform=None, flukaregistry=None, comment='')

Bases: _InfiniteCylinderMixin, _ShiftableCylinderMixin

Infinite Circular Cylinder parallel to the x-axis

Parameters:
  • name (str) – of body

  • y (float) – position of the centre on the

  • z (float) – position of the centre on the

  • radius (float) – position of the centre on the

name
y
z
radius
transform
comment
centre(aabb=None)
rotation()
__repr__()
_withLengthSafety(safety, reg=None)
flukaFreeString()
hash()
point()
direction()
class pyg4ometry.fluka.body.YCC(name, z, x, radius, transform=None, flukaregistry=None, comment='')

Bases: _InfiniteCylinderMixin, _ShiftableCylinderMixin

Infinite Circular Cylinder parallel to the y-axis

Parameters:
  • name (str) – of body

  • z (float) – position of the centre on the

  • x (float) – position of the centre on the

  • radius (float) – position of the centre on the

name
z
x
radius
transform
comment
centre(aabb=None)
rotation()
__repr__()
_withLengthSafety(safety, reg=None)
flukaFreeString()
hash()
point()
direction()
class pyg4ometry.fluka.body.ZCC(name, x, y, radius, transform=None, flukaregistry=None, comment='')

Bases: _InfiniteCylinderMixin, _ShiftableCylinderMixin

Infinite Circular Cylinder parallel to the z-axis

Parameters:
  • name (str) – of body

  • x (float) – position of the centre on the

  • y (float) – position of the centre on the

  • radius (float) – position of the centre on the

name
x
y
radius
transform
comment
centre(aabb=None)
rotation()
__repr__()
_withLengthSafety(safety, reg=None)
flukaFreeString()
hash()
point()
direction()
class pyg4ometry.fluka.body.XEC(name, y, z, ysemi, zsemi, transform=None, flukaregistry=None, comment='')

Bases: BodyMixin, _ShiftableCylinderMixin

Infinite Elliptical Cylinder parallel to the x-axis

Parameters:
  • name (str) – of body

  • y (float) – position of the centre on the

  • z (float) – position of the centre on the

  • ysemi (float) – position of the centre on the

  • zsemi (float) – position of the centre on the

name
y
z
ysemi
zsemi
transform
comment
centre(aabb=None)
rotation()
geant4Solid(reg, aabb=None)
__repr__()
_withLengthSafety(safety, reg=None)
flukaFreeString()
hash()
class pyg4ometry.fluka.body.YEC(name, z, x, zsemi, xsemi, transform=None, flukaregistry=None, comment='')

Bases: BodyMixin, _ShiftableCylinderMixin

Infinite Elliptical Cylinder parallel to the y-axis

Parameters:
  • name (str) – of body

  • z (float) – position of the centre on the

  • x (float) – position of the centre on the

  • zsemi (float) – position of the centre on the

  • xsemi (float) – position of the centre on the

name
z
x
zsemi
xsemi
transform
comment
centre(aabb=None)
rotation()
geant4Solid(reg, aabb=None)
__repr__()
_withLengthSafety(safety, reg=None)
flukaFreeString()
hash()
class pyg4ometry.fluka.body.ZEC(name, x, y, xsemi, ysemi, transform=None, flukaregistry=None, comment='')

Bases: BodyMixin, _ShiftableCylinderMixin

Infinite Elliptical Cylinder parallel to the z-axis

Parameters:
  • name (str) – of body

  • x (float) – position of the centre on the

  • y (float) – position of the centre on the

  • xsemi (float) – position of the centre on the

  • ysemi (float) – position of the centre on the

name
x
y
xsemi
ysemi
transform
comment
centre(aabb=None)
rotation()
geant4Solid(reg, aabb=None)
__repr__()
_withLengthSafety(safety, reg=None)
flukaFreeString()
hash()
class pyg4ometry.fluka.body.QUA(name, cxx, cyy, czz, cxy, cxz, cyz, cx, cy, cz, c, transform=None, flukaregistry=None, comment='', **kwargs)

Bases: BodyMixin

Generic quadric

Parameters:
  • name (str) – of body

  • cxx (float) – x^2 coefficient

  • cyy (float) – y^2 coefficient

  • czz (float) – z^2 coefficient

  • cxy (float) – xy coefficient

  • cxz (float) – xz coefficient

  • cyz (float) – yz coefficient

  • cx (float) – x coefficient

  • cy (float) – y coefficient

  • cz (float) – z coefficient

  • c (constant) – constant

name
cxx
cyy
czz
cxy
cxz
cyz
cx
cy
cz
c
transform
comment
centre(aabb=None)
rotation()
coefficientsMatrix()
static _quadricMatrixToCoefficients(matrix)
mesh(lower, upper, capping=True)
geant4Solid(reg, aabb=None)
_withLengthSafety(safety, reg=None)
__repr__()
flukaFreeString()
hash()