pybes3.detectors
Parsing methods
parse_mdc_gid(gid, with_pos=True)
Parse the gid of MDC wires. "gid" is the global ID of the wire, ranges from 0 to 6795.
When gid is an ak.Array, the result is an ak.Array, otherwise it is a dict.
Keys of the output:
gid: Global ID of the wire.layer: Layer number.wire: Local wire number.stereo: Stereo type. 0 for axial, -1 forphi_west < phi_east, 1 forphi_west > phi_east.is_stereo: Whether the wire is a stereo wire.superlayer: Superlayer number.
Optional keys of the output when with_pos is True:
mid_x: x position of the wire atz=0.mid_y: y position of the wire atz=0.west_x: x position of the west end of the wire.west_y: y position of the west end of the wire.west_z: z position of the west end of the wire.east_x: x position of the east end of the wire.east_y: y position of the east end of the wire.east_z: z position of the east end of the wire.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gid
|
IntLike
|
The gid of the wire. |
required |
with_pos
|
bool
|
Whether to include the position information. |
True
|
Returns:
| Type | Description |
|---|---|
Union[IntLike, dict[str, IntLike]]
|
The parsed result. |
Source code in src/pybes3/detectors/__init__.py
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | |
parse_mdc_digi_id(mdc_digi_id, with_pos=False)
Parse MDC digi ID.
When mdc_digi_id is an ak.Array, the result is an ak.Array, otherwise it is a dict.
Keys of the output:
gid: Global ID of the wire.wire: Local wire number.layer: Layer number.stereo: Stereo type. 0 for axial, -1 forphi_west < phi_east, 1 forphi_west > phi_east.is_stereo: Whether the wire is a stereo wire.superlayer: Superlayer number.
Optional keys of the output when with_pos is True:
mid_x: x position of the wire atz=0.mid_y: y position of the wire atz=0.west_x: x position of the west end of the wire.west_y: y position of the west end of the wire.west_z: z position of the west end of the wire.east_x: x position of the east end of the wire.east_y: y position of the east end of the wire.east_z: z position of the east end of the wire.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mdc_digi_id
|
IntLike
|
The MDC digi ID. |
required |
with_pos
|
bool
|
Whether to include the position information. |
False
|
Returns:
| Type | Description |
|---|---|
Union[IntLike, dict[str, IntLike]]
|
The parsed result. |
Source code in src/pybes3/detectors/__init__.py
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | |
parse_tof_digi_id(tof_digi_id, flat=False, library='ak')
Parse TOF digi ID.
If library is ak, return ak.Record. If library is np, return dict[str, np.ndarray].
Available keys of the output:
part: The part number.0,1,2for scintillator endcap0, barrel, endcap1;3,4for MRPC endcap0, endcap1.layer_or_module: The scintillator layer or MRPC module number, based on the part number.phi_or_strip: The scintillator phi or MRPC strip ID, based on the part number.end: The readout end ID.
The return value is based on the part number.
Rows where part < 3 are scintillator and layer_or_module represents layer number, phi_or_strip represents phi number.
Rows where part >= 3 are MRPC and layer_or_module represents module number, phi_or_strip represents strip ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tof_digi_id
|
IntLike
|
The TOF ID. |
required |
flat
|
bool
|
Whether to flatten the output. |
False
|
library
|
Literal['ak', 'np']
|
The library to use as output. |
'ak'
|
Returns:
| Type | Description |
|---|---|
Union[Record, dict[str, ndarray], dict[str, int_]]
|
The parsed TOF ID. |
Source code in src/pybes3/detectors/__init__.py
237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 | |
parse_emc_digi_id(emc_digi_id, with_pos=False)
Parse EMC digi ID.
When emc_digi_id is an ak.Array, the result is an ak.Array, otherwise it is a dict.
Keys of the output:
gid: Global ID of the crystal.part: Part number, 0 for endcap0, 1 for barrel, 2 for endcap1.theta: Theta number.phi: Phi number.
Optional keys of the output when with_pos is True:
front_center_x: x position of the front center of the crystal.front_center_y: y position of the front center of the crystal.front_center_z: z position of the front center of the crystal.center_x: x position of the center of the crystal.center_y: y position of the center of the crystal.center_z: z position of the center of the crystal.
Info
The 8 points of the crystal will not be returned here.
If you need the 8 points of the crystal, use emc_gid_to_point_x, emc_gid_to_point_y
and emc_gid_to_point_z.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
emc_digi_id
|
IntLike
|
The EMC digi ID. |
required |
with_pos
|
bool
|
Whether to include the position information. |
False
|
Returns:
| Type | Description |
|---|---|
Union[IntLike, dict[str, IntLike]]
|
The parsed EMC digi ID. |
Source code in src/pybes3/detectors/__init__.py
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 | |
parse_muc_digi_id(muc_digi_id, flat=False, library='ak')
Parse MUC digi ID.
If library is ak, return ak.Record. If library is np, return dict[str, np.ndarray].
Available keys of the output:
part: The part number.segment: The segment number.layer: The layer number.channel: The channel number.gap: The gap number, which is equivalent to layer number.strip: The strip number, which is equivalent to channel number.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
muc_digi_id
|
IntLike
|
The MUC digi ID. |
required |
flat
|
bool
|
Whether to flatten the output. |
False
|
library
|
Literal['ak', 'np']
|
The library to use as output. |
'ak'
|
Returns:
| Type | Description |
|---|---|
Union[Record, dict[str, ndarray], dict[str, int_]]
|
The parsed MUC digi ID. |
Source code in src/pybes3/detectors/__init__.py
450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 | |
parse_cgem_digi_id(cgem_digi_id, flat=False, library='ak')
Parse CGEM digi ID.
If library is ak, return ak.Record. If library is np, return dict[str, np.ndarray].
Available keys of the output:
layer: The layer number.sheet: The sheet ID.strip: The strip ID.is_x_strip: Whether the strip is an X-strip.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cgem_digi_id
|
IntLike
|
The CGEM digi ID. |
required |
flat
|
bool
|
Whether to flatten the output. |
False
|
library
|
Literal['ak', 'np']
|
The library to use as output. |
'ak'
|
Returns:
| Type | Description |
|---|---|
Union[Record, dict[str, ndarray], dict[str, int_]]
|
The parsed CGEM digi ID. |
Source code in src/pybes3/detectors/__init__.py
506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 | |
Geometry
get_mdc_wire_position(library='np')
Get the MDC wire position table.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
library
|
Literal['np', 'ak', 'pd']
|
The library to return the data in. Choose from 'ak', 'np', 'pd'. |
'np'
|
Returns:
| Type | Description |
|---|---|
Array | dict[str, ndarray] | DataFrame
|
The MDC wire position table. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the library is not 'ak', 'np', or 'pd'. |
ImportError
|
If the library is 'pd' but pandas is not installed. |
Source code in src/pybes3/detectors/geometry/mdc.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | |
get_mdc_gid(layer, wire)
Get MDC gid of given layer and wire.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layer
|
IntLike
|
The layer number. |
required |
wire
|
IntLike
|
The wire number. |
required |
Returns:
| Type | Description |
|---|---|
IntLike
|
The gid of the wire. |
Source code in src/pybes3/detectors/geometry/mdc.py
77 78 79 80 81 82 83 84 85 86 87 88 89 | |
mdc_gid_to_layer(gid)
Convert gid to layer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gid
|
IntLike
|
The gid of the wire. |
required |
Returns:
| Type | Description |
|---|---|
IntLike
|
The layer number of the wire. |
Source code in src/pybes3/detectors/geometry/mdc.py
120 121 122 123 124 125 126 127 128 129 130 131 | |
mdc_gid_to_wire(gid)
Convert gid to wire.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gid
|
IntLike
|
The gid of the wire. |
required |
Returns:
| Type | Description |
|---|---|
IntLike
|
The wire number of the wire. |
Source code in src/pybes3/detectors/geometry/mdc.py
134 135 136 137 138 139 140 141 142 143 144 145 | |
mdc_gid_to_is_stereo(gid)
Convert gid to is_stereo.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gid
|
IntLike
|
The gid of the wire. |
required |
Returns:
| Type | Description |
|---|---|
BoolLike
|
The is_stereo of the wire. |
Source code in src/pybes3/detectors/geometry/mdc.py
179 180 181 182 183 184 185 186 187 188 189 190 | |
mdc_layer_to_is_stereo(layer)
Convert layer to is_stereo.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layer
|
IntLike
|
The layer number. |
required |
Returns:
| Type | Description |
|---|---|
BoolLike
|
The is_stereo of the layer. |
Source code in src/pybes3/detectors/geometry/mdc.py
165 166 167 168 169 170 171 172 173 174 175 176 | |
mdc_gid_to_east_x(gid)
Convert gid to east_x (cm).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gid
|
IntLike
|
The gid of the wire. |
required |
Returns:
| Type | Description |
|---|---|
FloatLike
|
The east_x (cm) of the wire. |
Source code in src/pybes3/detectors/geometry/mdc.py
235 236 237 238 239 240 241 242 243 244 245 246 | |
mdc_gid_to_east_y(gid)
Convert gid to east_y (cm).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gid
|
IntLike
|
The gid of the wire. |
required |
Returns:
| Type | Description |
|---|---|
FloatLike
|
The east_y (cm) of the wire. |
Source code in src/pybes3/detectors/geometry/mdc.py
249 250 251 252 253 254 255 256 257 258 259 260 | |
mdc_gid_to_east_z(gid)
Convert gid to east_z (cm).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gid
|
IntLike
|
The gid of the wire. |
required |
Returns:
| Type | Description |
|---|---|
FloatLike
|
The east_z (cm) of the wire. |
Source code in src/pybes3/detectors/geometry/mdc.py
263 264 265 266 267 268 269 270 271 272 273 274 | |
mdc_gid_to_west_x(gid)
Convert gid to west_x (cm).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gid
|
IntLike
|
The gid of the wire. |
required |
Returns:
| Type | Description |
|---|---|
FloatLike
|
The west_x (cm) of the wire. |
Source code in src/pybes3/detectors/geometry/mdc.py
193 194 195 196 197 198 199 200 201 202 203 204 | |
mdc_gid_to_west_y(gid)
Convert gid to west_y (cm).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gid
|
IntLike
|
The gid of the wire. |
required |
Returns:
| Type | Description |
|---|---|
FloatLike
|
The west_y (cm) of the wire. |
Source code in src/pybes3/detectors/geometry/mdc.py
207 208 209 210 211 212 213 214 215 216 217 218 | |
mdc_gid_to_west_z(gid)
Convert gid to west_z (cm).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gid
|
IntLike
|
The gid of the wire. |
required |
Returns:
| Type | Description |
|---|---|
FloatLike
|
The west_z (cm) of the wire. |
Source code in src/pybes3/detectors/geometry/mdc.py
221 222 223 224 225 226 227 228 229 230 231 232 | |
mdc_gid_z_to_x(gid, z)
Get the x (cm) position of the wire at z (cm).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gid
|
IntLike
|
The gid of the wire. |
required |
z
|
FloatLike
|
The z (cm) position. |
required |
Returns:
| Type | Description |
|---|---|
FloatLike
|
The x (cm) position of the wire at z (cm). |
Source code in src/pybes3/detectors/geometry/mdc.py
277 278 279 280 281 282 283 284 285 286 287 288 289 | |
mdc_gid_z_to_y(gid, z)
Get the y (cm) position of the wire at z (cm).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gid
|
IntLike
|
The gid of the wire. |
required |
z
|
FloatLike
|
The z (cm) position. |
required |
Returns:
| Type | Description |
|---|---|
FloatLike
|
The y (cm) position of the wire at z (cm). |
Source code in src/pybes3/detectors/geometry/mdc.py
292 293 294 295 296 297 298 299 300 301 302 303 304 | |
get_emc_crystal_position(library='np')
Get EMC crystal position table.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
library
|
Literal['np', 'ak', 'pd']
|
The library to return the data in. Choose from 'ak', 'np', 'pd'. |
'np'
|
Returns:
| Type | Description |
|---|---|
Array | dict[str, ndarray] | DataFrame
|
The EMC crystal position table. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the library is not 'ak', 'np', or 'pd'. |
ImportError
|
If the library is 'pd' but pandas is not installed. |
Source code in src/pybes3/detectors/geometry/emc.py
46 47 48 49 50 51 52 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 82 83 84 85 86 87 88 89 90 91 92 | |
get_emc_gid(part, theta, phi)
Get EMC gid of given part, theta, and phi.
- part 0: 0-479
- theta 0: 0-63
- theta 1: 64-127
- theta 2: 128-207
- theta 3: 208-287
- theta 4: 288-383
- theta 5: 384-479
- part 1: 480-5759 (theta 0-47)
- part 2: 5760-6239
- theta 5: 5760-5855 (96)
- theta 4: 5856-5951 (96)
- theta 3: 5952-6031 (80)
- theta 2: 6032-6111 (80)
- theta 1: 6112-6175 (64)
- theta 0: 6176-6239 (64)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
part
|
IntLike
|
part number |
required |
theta
|
IntLike
|
theta number |
required |
phi
|
IntLike
|
phi number |
required |
Returns:
| Name | Type | Description |
|---|---|---|
index |
IntLike
|
EMC index |
Source code in src/pybes3/detectors/geometry/emc.py
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | |
emc_gid_to_center_x(gid)
Convert EMC gid to x coordinate of the crystal's center.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gid
|
IntLike
|
The gid of the crystal. |
required |
Returns:
| Type | Description |
|---|---|
FloatLike
|
The x coordinate of the crystal's center. |
Source code in src/pybes3/detectors/geometry/emc.py
244 245 246 247 248 249 250 251 252 253 254 255 | |
emc_gid_to_center_y(gid)
Convert EMC gid to y coordinate of the crystal's center.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gid
|
IntLike
|
The gid of the crystal. |
required |
Returns:
| Type | Description |
|---|---|
FloatLike
|
The y coordinate of the crystal's center. |
Source code in src/pybes3/detectors/geometry/emc.py
258 259 260 261 262 263 264 265 266 267 268 269 | |
emc_gid_to_center_z(gid)
Convert EMC gid to z coordinate of the crystal's center.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gid
|
IntLike
|
The gid of the crystal. |
required |
Returns:
| Type | Description |
|---|---|
FloatLike
|
The z coordinate of the crystal's center. |
Source code in src/pybes3/detectors/geometry/emc.py
272 273 274 275 276 277 278 279 280 281 282 283 | |
emc_gid_to_front_center_x(gid)
Convert EMC gid to x coordinate of the crystal's front center.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gid
|
IntLike
|
The gid of the crystal. |
required |
Returns:
| Type | Description |
|---|---|
FloatLike
|
The x coordinate of the crystal's front center. |
Source code in src/pybes3/detectors/geometry/emc.py
286 287 288 289 290 291 292 293 294 295 296 297 | |
emc_gid_to_front_center_y(gid)
Convert EMC gid to y coordinate of the crystal's front center.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gid
|
IntLike
|
The gid of the crystal. |
required |
Returns:
| Type | Description |
|---|---|
FloatLike
|
The y coordinate of the crystal's front center. |
Source code in src/pybes3/detectors/geometry/emc.py
300 301 302 303 304 305 306 307 308 309 310 311 | |
emc_gid_to_front_center_z(gid)
Convert EMC gid to z coordinate of the crystal's front center.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gid
|
IntLike
|
The gid of the crystal. |
required |
Returns:
| Type | Description |
|---|---|
FloatLike
|
The z coordinate of the crystal's front center. |
Source code in src/pybes3/detectors/geometry/emc.py
314 315 316 317 318 319 320 321 322 323 324 325 | |
emc_gid_to_part(gid)
Convert EMC gid to part.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gid
|
IntLike
|
The gid of the crystal. |
required |
Returns:
| Type | Description |
|---|---|
IntLike
|
The part number of the crystal. |
Source code in src/pybes3/detectors/geometry/emc.py
157 158 159 160 161 162 163 164 165 166 167 168 | |
emc_gid_to_phi(gid)
Convert EMC gid to phi.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gid
|
IntLike
|
The gid of the crystal. |
required |
Returns:
| Type | Description |
|---|---|
IntLike
|
The phi number of the crystal. |
Source code in src/pybes3/detectors/geometry/emc.py
185 186 187 188 189 190 191 192 193 194 195 196 | |
emc_gid_to_point_x(gid, point)
Convert EMC gid to x coordinate of the point.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gid
|
IntLike
|
The gid of the crystal. |
required |
point
|
IntLike
|
The point number, 0-7. |
required |
Returns:
| Type | Description |
|---|---|
FloatLike
|
The x coordinate of the point. |
Source code in src/pybes3/detectors/geometry/emc.py
199 200 201 202 203 204 205 206 207 208 209 210 211 | |
emc_gid_to_point_y(gid, point)
Convert EMC gid to y coordinate of the point.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gid
|
IntLike
|
The gid of the crystal. |
required |
point
|
IntLike
|
The point number, 0-7. |
required |
Returns:
| Type | Description |
|---|---|
FloatLike
|
The y coordinate of the point. |
Source code in src/pybes3/detectors/geometry/emc.py
214 215 216 217 218 219 220 221 222 223 224 225 226 | |
emc_gid_to_point_z(gid, point)
Convert EMC gid to z coordinate of the point.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gid
|
IntLike
|
The gid of the crystal. |
required |
point
|
IntLike
|
The point number, 0-7. |
required |
Returns:
| Type | Description |
|---|---|
FloatLike
|
The z coordinate of the point. |
Source code in src/pybes3/detectors/geometry/emc.py
229 230 231 232 233 234 235 236 237 238 239 240 241 | |
emc_gid_to_theta(gid)
Convert EMC gid to theta.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gid
|
IntLike
|
The gid of the crystal. |
required |
Returns:
| Type | Description |
|---|---|
IntLike
|
The theta number of the crystal. |
Source code in src/pybes3/detectors/geometry/emc.py
171 172 173 174 175 176 177 178 179 180 181 182 | |
Digi Identifier
check_mdc_id(mdc_digi_id)
Check if the MDC digi ID is valid.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mdc_digi_id
|
IntLike
|
The MDC digi ID array or value. |
required |
Returns:
| Type | Description |
|---|---|
BoolLike
|
Whether the digi ID is valid. |
Source code in src/pybes3/detectors/digi_id.py
80 81 82 83 84 85 86 87 88 89 90 91 | |
mdc_id_to_wire(mdc_digi_id)
Convert MDC digi ID to wire number.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mdc_digi_id
|
IntLike
|
MDC digi ID array or value. |
required |
Returns:
| Type | Description |
|---|---|
IntLike
|
The wire number. |
Source code in src/pybes3/detectors/digi_id.py
94 95 96 97 98 99 100 101 102 103 104 105 | |
mdc_id_to_layer(mdc_digi_id)
Convert the MDC digi ID to the layer number.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mdc_digi_id
|
IntLike
|
The MDC digi ID array or value. |
required |
Returns:
| Type | Description |
|---|---|
IntLike
|
The layer number. |
Source code in src/pybes3/detectors/digi_id.py
108 109 110 111 112 113 114 115 116 117 118 119 | |
mdc_id_to_is_stereo(mdc_digi_id)
Convert the MDC digi ID to whether it is a stereo wire.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mdc_digi_id
|
IntLike
|
The MDC digi ID array or value. |
required |
Returns:
| Type | Description |
|---|---|
BoolLike
|
Whether the wire is a stereo wire. |
Source code in src/pybes3/detectors/digi_id.py
122 123 124 125 126 127 128 129 130 131 132 133 134 135 | |
get_mdc_digi_id(wire, layer, wire_type)
Generate MDC digi ID based on the wire number, layer number, and wire type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
wire
|
IntLike
|
The wire number. |
required |
layer
|
IntLike
|
The layer number. |
required |
wire_type
|
IntLike
|
The wire type. |
required |
Returns:
| Type | Description |
|---|---|
IntLike
|
The MDC digi ID. |
Source code in src/pybes3/detectors/digi_id.py
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | |
check_tof_id(tof_digi_id)
Check if the TOF digi ID is valid.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tof_digi_id
|
IntLike
|
The TOF digi ID array or value. |
required |
Returns:
| Type | Description |
|---|---|
BoolLike
|
Whether the digi ID is valid. |
Source code in src/pybes3/detectors/digi_id.py
166 167 168 169 170 171 172 173 174 175 176 177 | |
tof_id_to_part(tof_digi_id)
Convert TOF digi ID to part number. 0, 1, 2 for scintillator endcap0/barrel/endcap1, 3, 4 for MRPC endcap0/endcap1.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tof_digi_id
|
IntLike
|
TOF digi ID array or value. |
required |
Returns:
| Type | Description |
|---|---|
IntLike
|
The part number. |
Source code in src/pybes3/detectors/digi_id.py
180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 | |
tof_id_to_layer_or_module(tof_digi_id, part=None)
Convert the TOF digi ID to the scintillator layer or MRPC module number.
If part < 3, it is scintillator and the return value is layer number. Otherwise, it is
MRPC and the return value is module number.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tof_digi_id
|
IntLike
|
The TOF digi ID array or value. |
required |
part
|
Optional[IntLike]
|
The part number. If not provided, it will be calculated based on the TOF digi ID. |
None
|
Returns:
| Type | Description |
|---|---|
IntLike
|
The scintillator layer or MRPC module number. |
Source code in src/pybes3/detectors/digi_id.py
255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 | |
tof_id_to_phi_or_strip(tof_digi_id, part=None)
Convert the TOF digi ID to the scintillator phi or MRPC strip number, based on the part number.
If part < 3, it is scintillator and the return value is phi number. Otherwise, it is
MRPC and the return value is strip number.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tof_digi_id
|
IntLike
|
The TOF digi ID array or value. |
required |
part
|
Optional[IntLike]
|
The part number. If not provided, it will be calculated based on the TOF digi ID. |
None
|
Returns:
| Type | Description |
|---|---|
IntLike
|
The scintillator phi or MRPC strip number. |
Source code in src/pybes3/detectors/digi_id.py
320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 | |
tof_id_to_end(tof_digi_id)
Convert the TOF digi ID to the readout end number.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tof_digi_id
|
IntLike
|
The TOF digi ID array or value. |
required |
Returns:
| Type | Description |
|---|---|
IntLike
|
The readout end number. |
Source code in src/pybes3/detectors/digi_id.py
198 199 200 201 202 203 204 205 206 207 208 209 | |
get_tof_digi_id(part, layer_or_module, phi_or_strip, end)
Generate TOF scintillator ID based on the part number, layer number, phi number, and readout end number.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
part
|
IntLike
|
The part number. |
required |
layer_or_module
|
IntLike
|
The scintillator layer or MRPC module number. |
required |
phi_or_strip
|
IntLike
|
The scintillator phi or MRPC strip number. |
required |
end
|
IntLike
|
The readout end number. |
required |
Returns:
| Type | Description |
|---|---|
IntLike
|
The TOF digi ID. |
Source code in src/pybes3/detectors/digi_id.py
342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 | |
check_emc_id(emc_digi_id)
Check if the EMC digi ID is valid.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
emc_digi_id
|
IntLike
|
The EMC digi ID array or value. |
required |
Returns:
| Type | Description |
|---|---|
BoolLike
|
Whether the digi ID is valid. |
Source code in src/pybes3/detectors/digi_id.py
383 384 385 386 387 388 389 390 391 392 393 394 | |
emc_id_to_module(emc_digi_id)
Convert EMC digi ID to module number
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
emc_digi_id
|
IntLike
|
EMC digi ID array or value. |
required |
Returns:
| Type | Description |
|---|---|
IntLike
|
The module number. |
Source code in src/pybes3/detectors/digi_id.py
397 398 399 400 401 402 403 404 405 406 407 408 | |
emc_id_to_theta(emc_digi_id)
Convert the EMC digi ID to the theta number.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
emc_digi_id
|
IntLike
|
The EMC digi ID array or value. |
required |
Returns:
| Type | Description |
|---|---|
IntLike
|
The theta number. |
Source code in src/pybes3/detectors/digi_id.py
411 412 413 414 415 416 417 418 419 420 421 422 | |
emc_id_to_phi(emc_digi_id)
Convert the EMC digi ID to the phi number.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
emc_digi_id
|
IntLike
|
The EMC digi ID array or value. |
required |
Returns:
| Type | Description |
|---|---|
IntLike
|
The phi number. |
Source code in src/pybes3/detectors/digi_id.py
425 426 427 428 429 430 431 432 433 434 435 436 | |
get_emc_digi_id(module, theta, phi)
Generate EMC digi ID based on the module number, theta number, and phi number.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
module
|
IntLike
|
The module number. |
required |
theta
|
IntLike
|
The theta number. |
required |
phi
|
IntLike
|
The phi number. |
required |
Returns:
| Type | Description |
|---|---|
IntLike
|
The EMC digi ID. |
Source code in src/pybes3/detectors/digi_id.py
439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 | |
check_muc_id(muc_digi_id)
Check if the MUC digi ID is valid.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
muc_digi_id
|
IntLike
|
The MUC digi ID array or value. |
required |
Returns:
| Type | Description |
|---|---|
BoolLike
|
Whether the digi ID is valid. |
Source code in src/pybes3/detectors/digi_id.py
467 468 469 470 471 472 473 474 475 476 477 478 | |
muc_id_to_part(muc_digi_id)
Convert MUC digi ID to part number
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
muc_digi_id
|
IntLike
|
MUC digi ID array or value. |
required |
Returns:
| Type | Description |
|---|---|
IntLike
|
The part number. |
Source code in src/pybes3/detectors/digi_id.py
481 482 483 484 485 486 487 488 489 490 491 492 | |
muc_id_to_segment(muc_digi_id)
Convert the MUC digi ID to the segment number.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
muc_digi_id
|
IntLike
|
The MUC digi ID array or value. |
required |
Returns:
| Type | Description |
|---|---|
IntLike
|
The segment number. |
Source code in src/pybes3/detectors/digi_id.py
495 496 497 498 499 500 501 502 503 504 505 506 | |
muc_id_to_layer(muc_digi_id)
Convert the MUC digi ID to the layer number.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
muc_digi_id
|
IntLike
|
The MUC digi ID array or value. |
required |
Returns:
| Type | Description |
|---|---|
IntLike
|
The layer number. |
Source code in src/pybes3/detectors/digi_id.py
509 510 511 512 513 514 515 516 517 518 519 520 | |
muc_id_to_strip(muc_digi_id)
Convert the MUC digi ID to the strip number, which is equivalent to channel number.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
muc_digi_id
|
IntLike
|
The MUC digi ID array or value. |
required |
Returns:
| Type | Description |
|---|---|
IntLike
|
The strip number. |
Source code in src/pybes3/detectors/digi_id.py
578 579 580 581 582 583 584 585 586 587 588 | |
muc_id_to_gap(muc_digi_id)
Convert the MUC digi ID to the gap ID, which is equivalent to layer number.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
muc_digi_id
|
IntLike
|
The MUC digi ID array or value. |
required |
Returns:
| Type | Description |
|---|---|
IntLike
|
The gap ID. |
Source code in src/pybes3/detectors/digi_id.py
565 566 567 568 569 570 571 572 573 574 575 | |
muc_id_to_strip(muc_digi_id)
Convert the MUC digi ID to the strip number, which is equivalent to channel number.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
muc_digi_id
|
IntLike
|
The MUC digi ID array or value. |
required |
Returns:
| Type | Description |
|---|---|
IntLike
|
The strip number. |
Source code in src/pybes3/detectors/digi_id.py
578 579 580 581 582 583 584 585 586 587 588 | |
get_muc_digi_id(part, segment, layer, channel)
Generate MUC digi ID based on the part number, segment number, layer number, and channel number.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
part
|
IntLike
|
The part number. |
required |
segment
|
IntLike
|
The segment number. |
required |
layer
|
IntLike
|
The layer number. |
required |
channel
|
IntLike
|
The channel number. |
required |
Returns:
| Type | Description |
|---|---|
IntLike
|
The MUC digi ID. |
Source code in src/pybes3/detectors/digi_id.py
537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 | |
check_cgem_id(cgem_digi_id)
Check if the CGEM digi ID is valid.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cgem_digi_id
|
IntLike
|
The CGEM digi ID array or value. |
required |
Returns:
| Type | Description |
|---|---|
BoolLike
|
Whether the digi ID is valid. |
Source code in src/pybes3/detectors/digi_id.py
594 595 596 597 598 599 600 601 602 603 604 605 | |
cgem_id_to_layer(cgem_digi_id)
Convert the CGEM digi ID to the layer number.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cgem_digi_id
|
IntLike
|
The CGEM digi ID array or value. |
required |
Returns:
| Type | Description |
|---|---|
IntLike
|
The layer number. |
Source code in src/pybes3/detectors/digi_id.py
608 609 610 611 612 613 614 615 616 617 618 619 | |
cgem_id_to_sheet(cgem_digi_id)
Convert the CGEM digi ID to the sheet number.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cgem_digi_id
|
IntLike
|
The CGEM digi ID array or value. |
required |
Returns:
| Type | Description |
|---|---|
IntLike
|
The sheet number. |
Source code in src/pybes3/detectors/digi_id.py
622 623 624 625 626 627 628 629 630 631 632 633 | |
cgem_id_to_strip(cgem_digi_id)
Convert CGEM digi ID to strip number
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cgem_digi_id
|
IntLike
|
CGEM digi ID array or value. |
required |
Returns:
| Type | Description |
|---|---|
IntLike
|
The strip number. |
Source code in src/pybes3/detectors/digi_id.py
636 637 638 639 640 641 642 643 644 645 646 647 | |
cgem_id_to_is_x_strip(cgem_digi_id)
Convert the CGEM digi ID to whether it is an X-strip.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cgem_digi_id
|
IntLike
|
The CGEM digi ID array or value. |
required |
Returns:
| Type | Description |
|---|---|
BoolLike
|
Whether the strip is an X-strip |
Source code in src/pybes3/detectors/digi_id.py
650 651 652 653 654 655 656 657 658 659 660 661 662 663 | |
get_cgem_digi_id(layer, sheet, strip, is_x_strip)
Generate CGEM digi ID based on the strip number, strip type, sheet number, and layer number.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layer
|
IntLike
|
The layer number. |
required |
sheet
|
IntLike
|
The sheet number. |
required |
strip
|
IntLike
|
The strip number. |
required |
is_x_strip
|
BoolLike
|
Whether the strip is an X-strip. |
required |
Returns:
| Type | Description |
|---|---|
IntLike
|
The CGEM digi ID. |
Source code in src/pybes3/detectors/digi_id.py
666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 | |