Skip to content

detectors

converter.converter.shieldhit.detectors

ScoringCylinder dataclass

Bases: ScoringDetector

Cylinder detector dataclass used in DetectConfig.

Source code in yaptide/converter/converter/shieldhit/detectors.py
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
@dataclass(frozen=True)
class ScoringCylinder(ScoringDetector):
    """Cylinder detector dataclass used in DetectConfig."""

    name: str = "CylZ_Mesh"
    r_min: float = 0.
    r_max: float = 10.
    r_bins: int = 1
    h_min: float = 0.
    h_max: float = 20.
    h_bins: int = 400

    template: str = """Geometry Cyl
    Name {name}
    R {r_min:g} {r_max:g} {r_bins:d}
    Z {h_min:g} {h_max:g} {h_bins:d}
"""

    def __str__(self) -> str:
        return self.template.format(
            name=self.name,
            r_min=self.r_min, r_max=self.r_max, r_bins=self.r_bins,
            h_min=self.h_min, h_max=self.h_max, h_bins=self.h_bins,
        )

h_bins class-attribute instance-attribute

h_bins = 400

h_max class-attribute instance-attribute

h_max = 20.0

h_min class-attribute instance-attribute

h_min = 0.0

name class-attribute instance-attribute

name = 'CylZ_Mesh'

r_bins class-attribute instance-attribute

r_bins = 1

r_max class-attribute instance-attribute

r_max = 10.0

r_min class-attribute instance-attribute

r_min = 0.0

template class-attribute instance-attribute

template = "Geometry Cyl\n    Name {name}\n    R {r_min:g} {r_max:g} {r_bins:d}\n    Z {h_min:g} {h_max:g} {h_bins:d}\n"

__init__

__init__(
    uuid,
    name="CylZ_Mesh",
    r_min=0.0,
    r_max=10.0,
    r_bins=1,
    h_min=0.0,
    h_max=20.0,
    h_bins=400,
    template="Geometry Cyl\n    Name {name}\n    R {r_min:g} {r_max:g} {r_bins:d}\n    Z {h_min:g} {h_max:g} {h_bins:d}\n",
)

__str__

__str__()
Source code in yaptide/converter/converter/shieldhit/detectors.py
45
46
47
48
49
50
def __str__(self) -> str:
    return self.template.format(
        name=self.name,
        r_min=self.r_min, r_max=self.r_max, r_bins=self.r_bins,
        h_min=self.h_min, h_max=self.h_max, h_bins=self.h_bins,
    )

ScoringDetector dataclass

Bases: ABC

Abstract geometry dataclass for DetectConfig.

Source code in yaptide/converter/converter/shieldhit/detectors.py
 5
 6
 7
 8
 9
10
@dataclass(frozen=True)
class ScoringDetector(ABC):
    """Abstract geometry dataclass for DetectConfig."""

    uuid: str
    name: str

name instance-attribute

name

uuid instance-attribute

uuid

__init__

__init__(uuid, name)

ScoringGlobal dataclass

Bases: ScoringDetector

\"All\" detector. Scores on the whole defined space.

Source code in yaptide/converter/converter/shieldhit/detectors.py
13
14
15
16
17
18
19
20
21
22
23
24
@dataclass(frozen=True)
class ScoringGlobal(ScoringDetector):
    r"""\"All\" detector. Scores on the whole defined space."""

    name: str

    template: str = """Geometry All
    Name {name}
"""

    def __str__(self) -> str:
        return self.template.format(name=self.name)

name instance-attribute

name

template class-attribute instance-attribute

template = 'Geometry All\n    Name {name}\n'

__init__

__init__(
    uuid, name, template="Geometry All\n    Name {name}\n"
)

__str__

__str__()
Source code in yaptide/converter/converter/shieldhit/detectors.py
23
24
def __str__(self) -> str:
    return self.template.format(name=self.name)

ScoringMesh dataclass

Bases: ScoringDetector

Mesh detector dataclass used in DetectConfig.

Source code in yaptide/converter/converter/shieldhit/detectors.py
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
@dataclass(frozen=True)
class ScoringMesh(ScoringDetector):
    """Mesh detector dataclass used in DetectConfig."""

    name: str = "YZ_Mesh"
    x_min: float = -0.5
    x_max: float = 0.5
    x_bins: int = 1
    y_min: float = -2.
    y_max: float = 2.
    y_bins: int = 80
    z_min: float = 0.
    z_max: float = 20.
    z_bins: int = 400

    template: str = """Geometry Mesh
    Name {name}
    X {x_min:g} {x_max:g} {x_bins:d}
    Y {y_min:g} {y_max:g} {y_bins:d}
    Z {z_min:g} {z_max:g} {z_bins:d}
"""

    def __str__(self) -> str:
        return self.template.format(
            name=self.name,
            x_min=self.x_min, x_max=self.x_max, x_bins=self.x_bins,
            y_min=self.y_min, y_max=self.y_max, y_bins=self.y_bins,
            z_min=self.z_min, z_max=self.z_max, z_bins=self.z_bins,
        )

name class-attribute instance-attribute

name = 'YZ_Mesh'

template class-attribute instance-attribute

template = "Geometry Mesh\n    Name {name}\n    X {x_min:g} {x_max:g} {x_bins:d}\n    Y {y_min:g} {y_max:g} {y_bins:d}\n    Z {z_min:g} {z_max:g} {z_bins:d}\n"

x_bins class-attribute instance-attribute

x_bins = 1

x_max class-attribute instance-attribute

x_max = 0.5

x_min class-attribute instance-attribute

x_min = -0.5

y_bins class-attribute instance-attribute

y_bins = 80

y_max class-attribute instance-attribute

y_max = 2.0

y_min class-attribute instance-attribute

y_min = -2.0

z_bins class-attribute instance-attribute

z_bins = 400

z_max class-attribute instance-attribute

z_max = 20.0

z_min class-attribute instance-attribute

z_min = 0.0

__init__

__init__(
    uuid,
    name="YZ_Mesh",
    x_min=-0.5,
    x_max=0.5,
    x_bins=1,
    y_min=-2.0,
    y_max=2.0,
    y_bins=80,
    z_min=0.0,
    z_max=20.0,
    z_bins=400,
    template="Geometry Mesh\n    Name {name}\n    X {x_min:g} {x_max:g} {x_bins:d}\n    Y {y_min:g} {y_max:g} {y_bins:d}\n    Z {z_min:g} {z_max:g} {z_bins:d}\n",
)

__str__

__str__()
Source code in yaptide/converter/converter/shieldhit/detectors.py
75
76
77
78
79
80
81
def __str__(self) -> str:
    return self.template.format(
        name=self.name,
        x_min=self.x_min, x_max=self.x_max, x_bins=self.x_bins,
        y_min=self.y_min, y_max=self.y_max, y_bins=self.y_bins,
        z_min=self.z_min, z_max=self.z_max, z_bins=self.z_bins,
    )

ScoringZone dataclass

Bases: ScoringDetector

Scoring zone dataclass used un DetectConfig.

Source code in yaptide/converter/converter/shieldhit/detectors.py
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
@dataclass(frozen=True)
class ScoringZone(ScoringDetector):
    """Scoring zone dataclass used un DetectConfig."""

    name: str
    first_zone_id: int
    last_zone_id: str = ""
    volume: float = 1.

    template: str = """Geometry Zone
    Name {name}
    Zone {first_zone} {last_zone}
    Volume {volume:f}
"""

    def __str__(self) -> str:
        return self.template.format(
            name=self.name,
            first_zone=self.first_zone_id, last_zone=self.last_zone_id,
            volume=self.volume,
        )

first_zone_id instance-attribute

first_zone_id

last_zone_id class-attribute instance-attribute

last_zone_id = ''

name instance-attribute

name

template class-attribute instance-attribute

template = "Geometry Zone\n    Name {name}\n    Zone {first_zone} {last_zone}\n    Volume {volume:f}\n"

volume class-attribute instance-attribute

volume = 1.0

__init__

__init__(
    uuid,
    name,
    first_zone_id,
    last_zone_id="",
    volume=1.0,
    template="Geometry Zone\n    Name {name}\n    Zone {first_zone} {last_zone}\n    Volume {volume:f}\n",
)

__str__

__str__()
Source code in yaptide/converter/converter/shieldhit/detectors.py
 99
100
101
102
103
104
def __str__(self) -> str:
    return self.template.format(
        name=self.name,
        first_zone=self.first_zone_id, last_zone=self.last_zone_id,
        volume=self.volume,
    )