pybes3
besio
open(file, **kwargs)
Alias for uproot.open.
Returns:
| Type | Description |
|---|---|
Any
|
The uproot file object. |
Warning
This function is deprecated and will be removed in future versions.
Use uproot.open instread.
Source code in src/pybes3/besio/__init__.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | |
concatenate(files, expressions=None, cut=None, **kwargs)
Alias for uproot.concatenate.
Returns:
| Type | Description |
|---|---|
Any
|
The concatenated array. |
Warning
This function is deprecated and will be removed in future versions.
Use uproot.concatenate instread.
Source code in src/pybes3/besio/__init__.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | |
open_raw(file)
Open a raw binary file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file
|
str
|
The file to open. |
required |
Returns:
| Type | Description |
|---|---|
RawBinaryReader
|
The raw binary reader. |
Source code in src/pybes3/besio/__init__.py
60 61 62 63 64 65 66 67 68 69 70 | |
concatenate_raw(files, *, entry_start=0, entry_stop=-1, filter_name=None, verbose=False)
Concatenate multiple raw binary files into ak.Array
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
files
|
str | Path | list[str | Path]
|
files to be read. |
required |
entry_start
|
int
|
The starting entry to read. Defaults to 0. |
0
|
entry_stop
|
int
|
The stopping entry to read. Defaults to -1, which means read until the end. |
-1
|
filter_name
|
Union[str, list, None]
|
A filter to select specific fields to read. Defaults to |
None
|
verbose
|
bool
|
Show reading process. Defaults to |
False
|
Returns:
| Type | Description |
|---|---|
Array
|
Concatenated raw data array. |
Source code in src/pybes3/besio/raw_io.py
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 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 | |
detectors
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/emc.py
260 261 262 263 264 265 266 267 268 269 270 271 | |
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/emc.py
274 275 276 277 278 279 280 281 282 283 284 285 | |
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/emc.py
288 289 290 291 292 293 294 295 296 297 298 299 | |
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/emc.py
302 303 304 305 306 307 308 309 310 311 312 313 | |
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/emc.py
316 317 318 319 320 321 322 323 324 325 326 327 | |
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/emc.py
330 331 332 333 334 335 336 337 338 339 340 341 | |
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/emc.py
173 174 175 176 177 178 179 180 181 182 183 184 | |
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/emc.py
201 202 203 204 205 206 207 208 209 210 211 212 | |
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/emc.py
215 216 217 218 219 220 221 222 223 224 225 226 227 | |
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/emc.py
230 231 232 233 234 235 236 237 238 239 240 241 242 | |
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/emc.py
245 246 247 248 249 250 251 252 253 254 255 256 257 | |
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/emc.py
187 188 189 190 191 192 193 194 195 196 197 198 | |
get_emc_geom_table(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/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_crystal_position(library='np')
Deprecated
This function is deprecated, use get_emc_geom_table instead.
Source code in src/pybes3/detectors/emc.py
95 96 97 98 99 100 101 102 103 104 105 106 107 108 | |
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/emc.py
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 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | |
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/mdc.py
88 89 90 91 92 93 94 95 96 97 98 99 100 | |
get_mdc_geom_table(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/mdc.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | |
get_mdc_wire_position(library='np')
Deprecated
This function is deprecated, use get_mdc_geom_table instead.
Source code in src/pybes3/detectors/mdc.py
72 73 74 75 76 77 78 79 80 81 82 83 84 85 | |
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/mdc.py
246 247 248 249 250 251 252 253 254 255 256 257 | |
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/mdc.py
260 261 262 263 264 265 266 267 268 269 270 271 | |
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/mdc.py
274 275 276 277 278 279 280 281 282 283 284 285 | |
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/mdc.py
190 191 192 193 194 195 196 197 198 199 200 201 | |
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/mdc.py
131 132 133 134 135 136 137 138 139 140 141 142 | |
mdc_gid_to_stereo(gid)
Convert gid to stereo.
0 for axial,
-1 for stereo that phi_west < phi_east,
1 for stereo that phi_west > phi_east.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gid
|
IntLike
|
The gid of the wire. |
required |
Returns:
| Type | Description |
|---|---|
IntLike
|
The stereo of the wire. |
Source code in src/pybes3/detectors/mdc.py
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 | |
mdc_gid_to_superlayer(gid)
Convert gid to superlayer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gid
|
IntLike
|
The gid of the wire. |
required |
Returns:
| Type | Description |
|---|---|
IntLike
|
The superlayer number of the wire. |
Source code in src/pybes3/detectors/mdc.py
103 104 105 106 107 108 109 110 111 112 113 114 | |
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/mdc.py
204 205 206 207 208 209 210 211 212 213 214 215 | |
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/mdc.py
218 219 220 221 222 223 224 225 226 227 228 229 | |
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/mdc.py
232 233 234 235 236 237 238 239 240 241 242 243 | |
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/mdc.py
145 146 147 148 149 150 151 152 153 154 155 156 | |
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/mdc.py
288 289 290 291 292 293 294 295 296 297 298 299 300 | |
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/mdc.py
303 304 305 306 307 308 309 310 311 312 313 314 315 | |
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/mdc.py
176 177 178 179 180 181 182 183 184 185 186 187 | |
mdc_layer_to_superlayer(layer)
Convert layer to superlayer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layer
|
IntLike
|
The layer number. |
required |
Returns:
| Type | Description |
|---|---|
IntLike
|
The superlayer number of the layer. |
Source code in src/pybes3/detectors/mdc.py
117 118 119 120 121 122 123 124 125 126 127 128 | |
parse_emc_gid(gid, geometry=False)
Parse the gid of EMC crystals. "gid" is the global ID of the crystal, ranges from 0 to 6239.
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 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 geometry 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 |
|---|---|---|---|
gid
|
IntLike
|
The gid of the crystal. |
required |
geometry
|
bool
|
Whether to include the geometry information. |
False
|
Returns:
| Type | Description |
|---|---|
Array | dict[str, Any]
|
The parsed result. |
Source code in src/pybes3/detectors/emc.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 387 388 389 390 391 392 393 394 | |
parse_mdc_gid(gid, geometry=False)
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 geometry 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 |
geometry
|
bool
|
Whether to include the geometry information. |
False
|
Returns:
| Type | Description |
|---|---|
Array | dict[str, Any]
|
The parsed result. |
Source code in src/pybes3/detectors/mdc.py
318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 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 378 379 | |
cgem_gid_to_is_vstrip(gid)
Check whether a CGEM gid corresponds to a v-strip.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gid
|
IntLike
|
The gid of the strip. |
required |
Returns:
| Type | Description |
|---|---|
BoolLike
|
True if the strip is a v-strip, otherwise False. |
Source code in src/pybes3/detectors/cgem.py
157 158 159 160 161 162 163 164 165 166 167 | |
cgem_gid_to_is_xstrip(gid)
Check whether a CGEM gid corresponds to an x-strip.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gid
|
IntLike
|
The gid of the strip. |
required |
Returns:
| Type | Description |
|---|---|
BoolLike
|
True if the strip is an x-strip, otherwise False. |
Source code in src/pybes3/detectors/cgem.py
144 145 146 147 148 149 150 151 152 153 154 | |
cgem_gid_to_layer(gid)
Convert CGEM gid to layer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gid
|
IntLike
|
The gid of the strip. |
required |
Returns:
| Type | Description |
|---|---|
IntLike
|
The layer number of the strip. |
Source code in src/pybes3/detectors/cgem.py
88 89 90 91 92 93 94 95 96 97 98 99 | |
cgem_gid_to_sheet(gid)
Convert CGEM gid to sheet.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gid
|
IntLike
|
The gid of the strip. |
required |
Returns:
| Type | Description |
|---|---|
IntLike
|
The sheet number of the strip. |
Source code in src/pybes3/detectors/cgem.py
102 103 104 105 106 107 108 109 110 111 112 113 | |
cgem_gid_to_strip(gid)
Convert CGEM gid to strip number.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gid
|
IntLike
|
The gid of the strip. |
required |
Returns:
| Type | Description |
|---|---|
IntLike
|
The strip number within the corresponding strip type. |
Source code in src/pybes3/detectors/cgem.py
130 131 132 133 134 135 136 137 138 139 140 141 | |
cgem_gid_to_strip_type(gid)
Convert CGEM gid to strip type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gid
|
IntLike
|
The gid of the strip. |
required |
Returns:
| Type | Description |
|---|---|
IntLike
|
The strip type of the strip, 0 for x-strip and 1 for v-strip. |
Source code in src/pybes3/detectors/cgem.py
116 117 118 119 120 121 122 123 124 125 126 127 | |
get_cgem_gid(layer, sheet, strip_type, strip)
Get CGEM gid of given layer, sheet, strip_type and strip.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layer
|
IntLike
|
The layer number, 0-2. |
required |
sheet
|
IntLike
|
The sheet number within the layer. |
required |
strip_type
|
IntLike
|
The strip type, 0 for x-strip and 1 for v-strip. |
required |
strip
|
IntLike
|
The strip number within the strip type. |
required |
Returns:
| Type | Description |
|---|---|
IntLike
|
The global strip ID of the CGEM strip, ranging from 0 to 9896. |
Source code in src/pybes3/detectors/cgem.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | |
parse_cgem_gid(gid)
Parse CGEM gid into layer, sheet, strip type and strip number.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gid
|
IntLike
|
The gid of the strip. |
required |
Returns:
| Type | Description |
|---|---|
Array | dict[str, Any]
|
If gid is a ak.Array, returns an ak.Array with fields "layer", "sheet", "strip_type", |
Array | dict[str, Any]
|
"strip", "is_xstrip" and "is_vstrip". |
Array | dict[str, Any]
|
Otherwise, returns a dictionary with keys "layer", "sheet", "strip_type", "strip", |
Array | dict[str, Any]
|
"is_xstrip" and "is_vstrip". |
Source code in src/pybes3/detectors/cgem.py
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 | |
get_tof_gid(part, layer_or_module, phi_or_strip)
Get TOF gid of given part, layer_or_module and phi_or_strip.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
part
|
IntLike
|
The part of the TOF, 0-2 for scintillator, 3-4 for MRPC. |
required |
layer_or_module
|
IntLike
|
The layer (for scintillator) or module (for MRPC) number, starting from 0. |
required |
phi_or_strip
|
IntLike
|
The phi (for scintillator) or strip (for MRPC) number, starting from 0. |
required |
Returns:
| Type | Description |
|---|---|
IntLike
|
The global strip ID of the TOF strip, ranging from 0 to 1135. |
Source code in src/pybes3/detectors/tof.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | |
parse_tof_gid(gid)
Parse TOF gid into part, layer_or_module and phi_or_strip.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gid
|
IntLike
|
The global strip ID of the TOF strip, ranging from 0 to 1135. |
required |
Returns:
| Type | Description |
|---|---|
Array | dict[str, Any]
|
If gid is a ak.Array, returns an ak.Array with fields "part", "layer_or_module" and "phi_or_strip". |
Array | dict[str, Any]
|
Otherwise, returns a dictionary with keys "part", "layer_or_module" and "phi_or_strip". |
Source code in src/pybes3/detectors/tof.py
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 | |
tof_gid_to_layer_or_module(gid)
Get TOF layer_or_module from gid.
Source code in src/pybes3/detectors/tof.py
72 73 74 75 | |
tof_gid_to_part(gid)
Get TOF part from gid.
Source code in src/pybes3/detectors/tof.py
66 67 68 69 | |
tof_gid_to_phi_or_strip(gid)
Get TOF phi_or_strip from gid.
Source code in src/pybes3/detectors/tof.py
78 79 80 81 | |
tracks
HelixObject
Source code in src/pybes3/helix.py
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 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 | |
radius
property
Circular radius of the helix (in cm).
momentum
property
Momentum of the helix as a 3D vector. Note that the momentum is relative to the pivot, so once the pivot is changed, the momentum will also change accordingly.
charge
property
Returns the charge of the helix.
change_pivot(*args)
Change the pivot point of the helix.
The transformation refers to Helix class in BOSS.
Source code in src/pybes3/helix.py
297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 | |
dr_phi0_to_x(dr, phi0)
Convert helix parameters to x location.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dr
|
float
|
helix[0] parameter, dr. |
required |
phi0
|
float
|
helix[1] parameter, phi0. |
required |
Returns:
| Type | Description |
|---|---|
FloatLike
|
x location of the helix. |
Source code in src/pybes3/helix.py
473 474 475 476 477 478 479 480 481 482 483 484 485 | |
dr_phi0_to_y(dr, phi0)
Convert helix parameters to y location.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dr
|
FloatLike
|
helix[0] parameter, dr. |
required |
phi0
|
FloatLike
|
helix[1] parameter, phi0. |
required |
Returns:
| Type | Description |
|---|---|
FloatLike
|
y location of the helix. |
Source code in src/pybes3/helix.py
488 489 490 491 492 493 494 495 496 497 498 499 500 | |
helix_awk(*args, **kwargs)
helix_awk(
helix: ak.Array,
error: ak.Array | None = None,
pivot: TypeAwkPosition = (0, 0, 0),
) -> HelixAwkwardArray
helix_awk(
*,
dr: ak.Array,
phi0: ak.Array,
kappa: ak.Array,
dz: ak.Array,
tanl: ak.Array,
error: ak.Array | None = None,
pivot: TypeAwkPosition = (0, 0, 0),
) -> HelixAwkwardArray
helix_awk(
*,
momentum: ak.Array,
position: ak.Array,
charge: Literal[-1, 1] | ak.Array,
error: ak.Array | None = None,
pivot: TypeAwkPosition = (0, 0, 0),
) -> HelixAwkwardArray
Source code in src/pybes3/helix.py
936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 | |
helix_obj(*args, **kwargs)
helix_obj(
dr: float,
phi0: float,
kappa: float,
dz: float,
tanl: float,
*,
error: np.ndarray | None = None,
pivot: TypeObjPosition = (0, 0, 0),
) -> HelixObject
helix_obj(
*,
params: tuple[float, float, float, float, float],
error: np.ndarray | None = None,
pivot: TypeObjPosition = (0, 0, 0),
) -> HelixObject
helix_obj(
*,
momentum: TypeObjMomentum,
position: TypeObjPosition,
charge: Literal[-1, 1],
error: np.ndarray | None = None,
pivot: TypeObjPosition = (0, 0, 0),
) -> HelixObject
Source code in src/pybes3/helix.py
407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 | |
kappa_to_charge(kappa)
Convert helix parameter to charge.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
kappa
|
FloatLike
|
helix[2] parameter, kappa. |
required |
Returns:
| Type | Description |
|---|---|
IntLike
|
charge of the helix. |
Source code in src/pybes3/helix.py
531 532 533 534 535 536 537 538 539 540 541 542 | |
kappa_to_pt(kappa)
Convert helix parameter to pt.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
kappa
|
FloatLike
|
helix[2] parameter, kappa. |
required |
Returns:
| Type | Description |
|---|---|
FloatLike
|
pt of the helix. |
Source code in src/pybes3/helix.py
517 518 519 520 521 522 523 524 525 526 527 528 | |
kappa_to_radius(kappa)
Convert helix parameter kappa to circular radius.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
kappa
|
FloatLike
|
helix[2] parameter, kappa. |
required |
Returns:
| Type | Description |
|---|---|
FloatLike
|
circular radius of the helix in cm. |
Source code in src/pybes3/helix.py
545 546 547 548 549 550 551 552 553 554 555 556 | |
phi0_to_phi(phi0)
Convert helix parameter phi0 to momentum phi.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
phi0
|
FloatLike
|
helix[1] parameter, phi0. |
required |
Returns:
| Type | Description |
|---|---|
FloatLike
|
phi of the momentum vector. |
Source code in src/pybes3/helix.py
503 504 505 506 507 508 509 510 511 512 513 514 | |