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.14.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.14-cp313-cp313-win_amd64.whl (954.1 kB view details)

Uploaded CPython 3.13Windows x86-64

pybes3-0.3.14-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (982.8 kB view details)

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

pybes3-0.3.14-cp313-cp313-macosx_11_0_arm64.whl (943.5 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

pybes3-0.3.14-cp312-cp312-win_amd64.whl (954.1 kB view details)

Uploaded CPython 3.12Windows x86-64

pybes3-0.3.14-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (983.1 kB view details)

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

pybes3-0.3.14-cp312-cp312-macosx_11_0_arm64.whl (943.4 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

pybes3-0.3.14-cp311-cp311-win_amd64.whl (953.0 kB view details)

Uploaded CPython 3.11Windows x86-64

pybes3-0.3.14-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (981.8 kB view details)

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

pybes3-0.3.14-cp311-cp311-macosx_11_0_arm64.whl (942.8 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

pybes3-0.3.14-cp310-cp310-win_amd64.whl (952.2 kB view details)

Uploaded CPython 3.10Windows x86-64

pybes3-0.3.14-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (980.8 kB view details)

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

pybes3-0.3.14-cp310-cp310-macosx_11_0_arm64.whl (941.6 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

pybes3-0.3.14-cp39-cp39-win_amd64.whl (953.1 kB view details)

Uploaded CPython 3.9Windows x86-64

pybes3-0.3.14-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (980.8 kB view details)

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

pybes3-0.3.14-cp39-cp39-macosx_11_0_arm64.whl (941.7 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: pybes3-0.3.14.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.14.tar.gz
Algorithm Hash digest
SHA256 dd399915f687d2c0dee555929c85168841c025f4eee76d1aa8d9a213a3bb562d
MD5 5456296ee77620da85006de67a0aaf8a
BLAKE2b-256 6c7fd869e25d5c86c4f0a58ab706dcbb92c6433a7243166d51914abd1fc931f9

See more details on using hashes here.

Provenance

The following attestation bundles were made for pybes3-0.3.14.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.14-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: pybes3-0.3.14-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 954.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.14-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 85ce83faeec2067279095f0512d68e746a25ffe9aec18898955b71c1728d3f08
MD5 103f6896fb41127ec781eaf30fad4274
BLAKE2b-256 862cd044eaa6700c9540f59573e20a90f4a21426dbb05e31c274e588f1d0278c

See more details on using hashes here.

Provenance

The following attestation bundles were made for pybes3-0.3.14-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.14-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pybes3-0.3.14-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d86b7bf6565a61900a9789d1e68ec7dcd1796955c365a6bc0e2f3f28f0c99355
MD5 340eb89c5650faf289d5a675df36d7de
BLAKE2b-256 74f8c3744133ca40df59939843e3a6a17123c694fb07a14cf086297d758ed53a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pybes3-0.3.14-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.14-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pybes3-0.3.14-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1b557cf0c24da779caf5c46573d75c47467c3cf2414c4b0f8ce9ae30d9c825d3
MD5 d20239532957f49f05be4f12848ed672
BLAKE2b-256 6619d8f79cd023e42349dfa5d97bc72ff1ac80f39b0e077d75872b35727aa4c4

See more details on using hashes here.

Provenance

The following attestation bundles were made for pybes3-0.3.14-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.14-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: pybes3-0.3.14-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 954.1 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.14-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 d32fed3a1dfb5d58a15be17016dc9ed50f980ff86214a538d98cffbc7f8a74cd
MD5 d3b2731a4bc551abffd1a99cf465ff62
BLAKE2b-256 d784cbcdf1f5c5a32dc1f977b05fd31b3bde9da31c4783df6ab3e76b127e117a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pybes3-0.3.14-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.14-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pybes3-0.3.14-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 fb330e00d834d7cb5caf738b64ff3ff0f2217694e7cf884c5221124fed3b1806
MD5 5fb5d3f4fb362cd1e9d391c75f3ca148
BLAKE2b-256 0e65069a31e356678d7a3b57c394d139c286388edd22eb3e188d484e35744066

See more details on using hashes here.

Provenance

The following attestation bundles were made for pybes3-0.3.14-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.14-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pybes3-0.3.14-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 25ad924c59ed13c940019aad80bec971520e112a5bbdaeb0cc08557347f0f235
MD5 e02b7f3d29a5c5f9645cd282a0bccb4f
BLAKE2b-256 ef855d7f1dd261e7639c736e93dca92f68d2f9e82510b2dbf87b135065bc9af7

See more details on using hashes here.

Provenance

The following attestation bundles were made for pybes3-0.3.14-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.14-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pybes3-0.3.14-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 953.0 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.14-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 9211bb13a97753b9e2697bdb963690124b6f44f5d4e4cd0acaccf0128f2d15e9
MD5 26bf0ff43e8074251ae1308bfc54ee35
BLAKE2b-256 48ee3103c7c2b8a9fa136cdc921afe9785870efa9ef231c7979663196b1ea2f9

See more details on using hashes here.

Provenance

The following attestation bundles were made for pybes3-0.3.14-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.14-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pybes3-0.3.14-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0d924e6e52707db490b761913c24d5c68b9b5e949b14bde3efbedf7250ffbdfa
MD5 c56f059062faaef2cdd7cfab1d3bef6a
BLAKE2b-256 e15ccc071f4a945eb83c5e5263e33f76670458853a5be0238b2085dcfea7db1a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pybes3-0.3.14-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.14-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pybes3-0.3.14-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 67361d3b1cf237f3c4fc2dac516e39f1e798f0ed62e1e089f873f32e1a425b0f
MD5 fc774f568b8e5188bd8c7a4141c4bc33
BLAKE2b-256 228f9162ad5970535ac680b4e4878bf2a40ce058b7984d6b339760fd08bd3360

See more details on using hashes here.

Provenance

The following attestation bundles were made for pybes3-0.3.14-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.14-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pybes3-0.3.14-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 952.2 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.14-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 5d2cd2510ffc75c83c469e9716d2efcaee851592a8ad76c9dcad5b347276ab01
MD5 c8598f8a82d4151b31a18fa0e32644d1
BLAKE2b-256 b0153f2b1a16f917b9e4e13c3aec472a17de04ebca356b1b02ec9f4da28e038e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pybes3-0.3.14-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.14-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pybes3-0.3.14-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b12adae16efcd34fe03c1fe769f2835a95f59763576e87ebf85b24208b711f1b
MD5 5b9c3e71ee8e6c09ed38ccad4ca4e6e2
BLAKE2b-256 33ff4d586add923aeaef9f85c76d7cd12a72d6e4072cc2c77529b04c9f5d9ea9

See more details on using hashes here.

Provenance

The following attestation bundles were made for pybes3-0.3.14-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.14-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pybes3-0.3.14-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 55688135c9766fe1803f1ec02867bca0d1e667d0d5ff553a788f48dea3344602
MD5 dea73630583fa8f8a4995635e376f6e0
BLAKE2b-256 dcadf2ad119216e62e1ca9fcafde29b8327732e7c6d14ab3dfee23e38709ece4

See more details on using hashes here.

Provenance

The following attestation bundles were made for pybes3-0.3.14-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.14-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: pybes3-0.3.14-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 953.1 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.14-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 d55d9029a4a0926938db2ee9799dd1d58f486e912b9921298280e81617f695d9
MD5 1aac347f062b90ed8922079a640aa217
BLAKE2b-256 d13fc115c857d10aacc04c86ab5ce90e9b0342c6dc38d0ec7e4939ccbd4f1cb1

See more details on using hashes here.

Provenance

The following attestation bundles were made for pybes3-0.3.14-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.14-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pybes3-0.3.14-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 64912a3066b21c2632a0e1c2203488d760909f9fdeaed4fcfe4896488e498860
MD5 15610e01f22a804a643c06b331829572
BLAKE2b-256 2476e45a92f451c6472eaeecc90360378b267e68dc1f5e01ede43d694794c264

See more details on using hashes here.

Provenance

The following attestation bundles were made for pybes3-0.3.14-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.14-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pybes3-0.3.14-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e7a995f13a4cc896a65007f9e4724be8ec8abfb28b3fa7228a187b36e447f4ae
MD5 df9d20aa66f6a0ec7d655d221ad94a44
BLAKE2b-256 6e219dbdbe811c2aa5a13a6e9fc43392982bdd3fc8e5337c4bc0230e5a311d37

See more details on using hashes here.

Provenance

The following attestation bundles were made for pybes3-0.3.14-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