Skip to main content

Unofficial Python module for BES3

Project description

pybes3

pybes3 is an unofficial python module that aims to make BES3 users easier to work with Python.

[!TIP] If you have any suggestions, questions, or issues, please feel free to open an issue.

It is highly recommended to take a look at these Python modules before using pybes3:

  • awkward: A Python module that can handle ragged-like array.
  • uproot: A ROOT I/O Python module. pybes3 uses uproot to read BES3 ROOT files.

Visit the documentation for more information about installation, usage, and examples.

Installation

[!NOTE] pybes3 requires Python 3.9 or higher.

Users on lxlogin server

"lxlogin server" means the login server of computation clusters of IHEP. If you are not using lxlogin server, please skip to Install pybes3 using pip.

Since there is a quota limitation on user's home directory (~/), you need to create symbolinks for ~/.local and ~/.cache, which contains pip packages and caches that installed in "user mode":

# Check whether a `.local` directory and `.cache` already exists.
# If so, move it to somewhere else.
ls -a ~
mv ~/.local /path/to/somewhere/
mv ~/.cache /path/to/somewhere

# If no `.local` or `.cache` exists, create them
mkdir /path/to/somewhere/.local
mkdir /path/to/somewhere/.cache

# After moving or creating them, link them back to `~`
ln -s /path/to/somewhere/.local ~/.local
ln -s /path/to/somewhere/.cache ~/.cache

Install pybes3 using pip

pip install pybes3

Using pybes3 under BOSS8 environment

If you are using pybes3 under BOSS8 environment, you MUST run following commands after setting up BOSS8 environment:

export PYTHONPATH=`python -m site --user-site`:$PYTHONPATH
export PATH=`python -m site --user-base`/bin:$PATH

[!WARNING] DO NOT add these commands to your shell configuration file (e.g. ~/.bashrc), since they will conflict with the default python environment (without BOSS8).

Features

At the moment, pybes3 provides:

  • BES3 data reading

    Read rtraw, rec, dst, and even raw files.

  • Digi identifier

    Convert digi identifier id number to a human-readable format.

  • Global ID

    Global ID numbers for each detector element in pybes3.

  • Geometry

    Retrieve and compute geometry information of detectors.

  • Helix operations

    Parse and transform helix parameters.

Performance

pybes3 is designed to be fast and efficient. It uses numba to accelerate some of the operations, such as helix operations, digi identifier conversion, etc. When numba is not available, pybes3 will use C++ to accelerate the operations.

Data reading

A simple benchmark is provided to compare the performance of pybes3 and BOSS8 in reading dst files:

  • For pybes3, we directly read out the Event tree:

    import uproot
    import pybes3
    
    n_evt = ... # number of events to read
    files = [...] # list of ROOT files to read
    
    data_array = uproot.concatenate({f: "Event" for f in files}, entry_stop=n_evt)
    
  • For BOSS8, since when reading reconstruction data, it will load a RecMakerAlg algorithm for each event, which slows down the reading performance significantly (4~5 times slower than pure reading), we test 2 cases:

    • A loop on all events with default job-options (with RecMakerAlg algorithm):

      #include "$ROOTIOROOT/share/jobOptions_ReadRec.txt"
      #include "$OFFLINEEVENTLOOPMGRROOT/share/OfflineEventLoopMgr_Option.txt"
      
      EventCnvSvc.digiRootInputFile = { ... }; // list of ROOT files to read
      ApplicationMgr.EvtMax = ...; // number of events to read
      MessageSvc.OutputLevel = 7; // suppress messages
      
    • A loop on all events without loading RecMakerAlg algorithm. This is similar to reading rtraw files and is the closest case to raw ROOT reading:

      ApplicationMgr.ExtSvc += {"EvtPersistencySvc/EventPersistencySvc"};
      ApplicationMgr.ExtSvc +={"RootEvtSelector/EventSelector","RootCnvSvc/EventCnvSvc"};
      EventPersistencySvc.CnvServices += {"EventCnvSvc"};
      #include "$OFFLINEEVENTLOOPMGRROOT/share/OfflineEventLoopMgr_Option.txt"
      
      EventCnvSvc.digiRootInputFile = { ... }; // list of ROOT files to read
      ApplicationMgr.EvtMax = ...; // number of events to read
      MessageSvc.OutputLevel = 7; // suppress messages
      

The machine used for the benchmark is a Intel i7-12700 with Great Wall GW7000 4TB SSD. The operating system is AlmaLinuxOS9 on WSL2. The number of events is set to 1000, 5000, 10000, 50000, 100000, 500000, and 1000000.

The results are shown below:

Dummy Reading Performance

The fitting results with a linear function is:

Initialization time (s) Slope (s/10k-event)
BOSS8 (with RecMakerAlg) 0.615 2.766
BOSS8 (no RecMakerAlg) 0.451 0.338
pybes3 1.135 0.326

The result shows that pybes3 is also comparable to BOSS8 when RecMakerAlg is not loaded, which means that the reading performance of pybes3 is close to the reading performance of ROOT itself. pybes3 is several times faster than BOSS8 with default settings, and slower when reading small number of events (~1000), since the module importing and initialization time is counted in the benchmark.

Since users may have to use the default settings of BOSS to read reconstruction data, pybes3 is still several times faster in this case.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pybes3-0.3.15.tar.gz (5.7 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pybes3-0.3.15-cp313-cp313-win_amd64.whl (963.1 kB view details)

Uploaded CPython 3.13Windows x86-64

pybes3-0.3.15-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (983.4 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

pybes3-0.3.15-cp313-cp313-macosx_11_0_arm64.whl (955.5 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

pybes3-0.3.15-cp312-cp312-win_amd64.whl (963.0 kB view details)

Uploaded CPython 3.12Windows x86-64

pybes3-0.3.15-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (983.4 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

pybes3-0.3.15-cp312-cp312-macosx_11_0_arm64.whl (955.4 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

pybes3-0.3.15-cp311-cp311-win_amd64.whl (960.9 kB view details)

Uploaded CPython 3.11Windows x86-64

pybes3-0.3.15-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (982.2 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

pybes3-0.3.15-cp311-cp311-macosx_11_0_arm64.whl (954.5 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

pybes3-0.3.15-cp310-cp310-win_amd64.whl (960.1 kB view details)

Uploaded CPython 3.10Windows x86-64

pybes3-0.3.15-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (981.3 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

pybes3-0.3.15-cp310-cp310-macosx_11_0_arm64.whl (953.2 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

pybes3-0.3.15-cp39-cp39-win_amd64.whl (961.0 kB view details)

Uploaded CPython 3.9Windows x86-64

pybes3-0.3.15-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (981.5 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

pybes3-0.3.15-cp39-cp39-macosx_11_0_arm64.whl (953.3 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

Details for the file pybes3-0.3.15.tar.gz.

File metadata

  • Download URL: pybes3-0.3.15.tar.gz
  • Upload date:
  • Size: 5.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pybes3-0.3.15.tar.gz
Algorithm Hash digest
SHA256 ac6fa8fad2463cbcb84a1f5b42facb4d1677052cdecb453cbc228c22d2811be7
MD5 08c8494d5048e06506bcc72440c96a5d
BLAKE2b-256 590b3cee58604d0cd865d2be514d4884f73b7d24d3b5f47a5dcbfc0200a2c7ce

See more details on using hashes here.

Provenance

The following attestation bundles were made for pybes3-0.3.15.tar.gz:

Publisher: python-publish.yml on mrzimu/pybes3

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pybes3-0.3.15-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: pybes3-0.3.15-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 963.1 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pybes3-0.3.15-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 c3c7b7e6a53951927c785a9aa5d3db51353dd8afa837aa452cc6a917c6ec2a25
MD5 48ee5c230d177e641e3e29422e4e5a2e
BLAKE2b-256 e16b8384b04e890c9a4cc96d1482b79fee127465eba2095fce1ab2421a85c61c

See more details on using hashes here.

Provenance

The following attestation bundles were made for pybes3-0.3.15-cp313-cp313-win_amd64.whl:

Publisher: python-publish.yml on mrzimu/pybes3

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pybes3-0.3.15-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pybes3-0.3.15-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a77d59f1c84281bbbdbc5d7d2439cd4301bc252a447cf1591be50d64fb4b762c
MD5 02ff8e593b0b102c24c7e6a3de46a3ac
BLAKE2b-256 e627d4273ac4f6ce180538a4577da041ea7a12244f7fa0339ee402ccfa6f4146

See more details on using hashes here.

Provenance

The following attestation bundles were made for pybes3-0.3.15-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: python-publish.yml on mrzimu/pybes3

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pybes3-0.3.15-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pybes3-0.3.15-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ab223c1f8d60204b0ea605e7d5ccd8f20e99232b68dd702ca26997ecbf550585
MD5 ade7533daa9785b7b28eaa9dddfab171
BLAKE2b-256 35c0120e8117763aa590c899ca71ad1794618f9638e4851fd161e7eeafc8fcec

See more details on using hashes here.

Provenance

The following attestation bundles were made for pybes3-0.3.15-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: python-publish.yml on mrzimu/pybes3

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pybes3-0.3.15-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: pybes3-0.3.15-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 963.0 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pybes3-0.3.15-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 fe8a4149fb25e216b1635c6e16393888d5edf6292e4363c8bf92acd4ce5aa3f4
MD5 46d1e407fcbbeed5c4ee67cf95fb7fc2
BLAKE2b-256 e79b2ecba64c85a09a378d6a22f948d509886a1e6de2285cc80dcf38a490afa1

See more details on using hashes here.

Provenance

The following attestation bundles were made for pybes3-0.3.15-cp312-cp312-win_amd64.whl:

Publisher: python-publish.yml on mrzimu/pybes3

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pybes3-0.3.15-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pybes3-0.3.15-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 94e27df806f2af2024d0dd83d3f4eeff90e6a3a3949e0dc41298bc0052771d85
MD5 eb7bd0e18cffe7ac97d687ac047b29d7
BLAKE2b-256 54c944eb47ee443fc696861eeebc391834cba59a3c95f7b5db23794e0041fe71

See more details on using hashes here.

Provenance

The following attestation bundles were made for pybes3-0.3.15-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: python-publish.yml on mrzimu/pybes3

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pybes3-0.3.15-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pybes3-0.3.15-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0add5109c5343a7e23726fcaf790e399b229a8b44bcb4b7be66d0e9643e4360f
MD5 108576220096a2f03c9c98b04d49be0c
BLAKE2b-256 8fc76dfef927b925dae16025d355edb63b984ae674aaf3919d954ae08ca80046

See more details on using hashes here.

Provenance

The following attestation bundles were made for pybes3-0.3.15-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: python-publish.yml on mrzimu/pybes3

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pybes3-0.3.15-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pybes3-0.3.15-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 960.9 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pybes3-0.3.15-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 7b9a6f6bb822bd4c504bc030a171701e446387b30431ac289ba3d98e978b199b
MD5 e4ec566b5bdb4aa40a005cca6458db94
BLAKE2b-256 ca376930899ee89c851985c8e44d89b8676c6926646a4daceb4f6265051425a6

See more details on using hashes here.

Provenance

The following attestation bundles were made for pybes3-0.3.15-cp311-cp311-win_amd64.whl:

Publisher: python-publish.yml on mrzimu/pybes3

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pybes3-0.3.15-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pybes3-0.3.15-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5eed5a9ca3ca9bf2bb4a8fb0f24e0ce84c5a230f1fad0958b9c1886d18ff7378
MD5 efca64282056709e0d11e4989c2bd60f
BLAKE2b-256 79bcba5d7dafe8f0634c86695c10373d163b142d55a48064b8cc1712ccea276a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pybes3-0.3.15-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: python-publish.yml on mrzimu/pybes3

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pybes3-0.3.15-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pybes3-0.3.15-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c2ac9ad62c39067989c7382de10a7caf773e601d440bf9388f342e04a5116122
MD5 4ab507ae165c3289066eb604e8f7d288
BLAKE2b-256 527d438fa9218457b61aa79939241c184fe9f2531782231c42e32d8d345f18d4

See more details on using hashes here.

Provenance

The following attestation bundles were made for pybes3-0.3.15-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: python-publish.yml on mrzimu/pybes3

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pybes3-0.3.15-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pybes3-0.3.15-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 960.1 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pybes3-0.3.15-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 20da3e48fb678a30094fc4c0920acde10da73be67bcd1d8e654e1f80c76e2a00
MD5 8b5776ae75ff2a9bcf7138003048cc51
BLAKE2b-256 7746a93b4746c2b6cf725c93a1f8ccce170d0c0ebfed1acec68510e5e54a308a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pybes3-0.3.15-cp310-cp310-win_amd64.whl:

Publisher: python-publish.yml on mrzimu/pybes3

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pybes3-0.3.15-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pybes3-0.3.15-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 15c0a87606539f4f8b9c900ccb64665e3daa803eac6587b0b217d68033470606
MD5 9b3f004d241a8472d18ef956777a8c8a
BLAKE2b-256 4456660a40202574f43db3ab41eac8d0f3e1ecf208c1a87152dc36e0603a26ae

See more details on using hashes here.

Provenance

The following attestation bundles were made for pybes3-0.3.15-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: python-publish.yml on mrzimu/pybes3

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pybes3-0.3.15-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pybes3-0.3.15-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6e1b5479fe724ac34882f5c2ae65e904628bf47a54cc7b9cee30330d3cbc0c0a
MD5 fd16bf9a487cdd3da019d4dfa99d1331
BLAKE2b-256 41a999607e7708e13f59d51fba460e50acdc68938ed230133e96ec032fce7f0e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pybes3-0.3.15-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: python-publish.yml on mrzimu/pybes3

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pybes3-0.3.15-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: pybes3-0.3.15-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 961.0 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pybes3-0.3.15-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 8b75ed92278593cd85e621ed3566043554ec689d129af7a44495a502842fbed0
MD5 d34db651cfecad1f7f06a6ae8e4174b0
BLAKE2b-256 dbed75013f1f54a1abf1fecc28abfbdeee6dfd78fe990a93810d2b3ea6506e70

See more details on using hashes here.

Provenance

The following attestation bundles were made for pybes3-0.3.15-cp39-cp39-win_amd64.whl:

Publisher: python-publish.yml on mrzimu/pybes3

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pybes3-0.3.15-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pybes3-0.3.15-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9a747a29cb51352f92427b1554e122177dfbb05f50f22b0a22f9ae253ca0f2b6
MD5 61625318be02930cc571c6ee0e57ab54
BLAKE2b-256 9f934e084a643b3f3f5b5d11639aeb199cedaaab54a0080c51913cd200a14185

See more details on using hashes here.

Provenance

The following attestation bundles were made for pybes3-0.3.15-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: python-publish.yml on mrzimu/pybes3

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pybes3-0.3.15-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pybes3-0.3.15-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 adbcb8072e9bf184d5c5040863176a5bc3bc21defd979f1ef2239a8bb979ce54
MD5 58868f60738b0e75feeb1dc3a22e6b94
BLAKE2b-256 dd478b076b2276409a93f1ab974ef64f4533ed9a499d92e14fa8cb6e81e790df

See more details on using hashes here.

Provenance

The following attestation bundles were made for pybes3-0.3.15-cp39-cp39-macosx_11_0_arm64.whl:

Publisher: python-publish.yml on mrzimu/pybes3

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page