Skip to main content

Unofficial Python module for BES3

Project description

pybes3

pybes3 is a 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.4.1.tar.gz (6.0 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.4.1-cp313-cp313-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.13Windows x86-64

pybes3-0.4.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (1.1 MB view details)

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

pybes3-0.4.1-cp313-cp313-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

pybes3-0.4.1-cp312-cp312-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.12Windows x86-64

pybes3-0.4.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (1.1 MB view details)

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

pybes3-0.4.1-cp312-cp312-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

pybes3-0.4.1-cp311-cp311-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.11Windows x86-64

pybes3-0.4.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (1.1 MB view details)

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

pybes3-0.4.1-cp311-cp311-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

pybes3-0.4.1-cp310-cp310-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.10Windows x86-64

pybes3-0.4.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (1.1 MB view details)

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

pybes3-0.4.1-cp310-cp310-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

pybes3-0.4.1-cp39-cp39-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.9Windows x86-64

pybes3-0.4.1-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (1.1 MB view details)

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

pybes3-0.4.1-cp39-cp39-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for pybes3-0.4.1.tar.gz
Algorithm Hash digest
SHA256 a4fa4b54f4f92cc99102f01dc01bcc996ccdf79f8d650c997b230b588b41bfa7
MD5 cca30de8c7932baa862cf78a28f320ad
BLAKE2b-256 9c099bbba7fd996e9e7e2f8cf63e539a4d430be6a57d28c12b4312ea75384108

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pybes3-0.4.1-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pybes3-0.4.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 c6dda024e3aad5cb191c806f77a0a04e478f757135e8a2c9e3b2bea319589870
MD5 b0714254c949787a976aaab7a218d1d6
BLAKE2b-256 55327c7bb2359856ccc4a57856c2bbdfd0c6aa3ed335d235b0aef22680528ff9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pybes3-0.4.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1f1f0b3ee941c84cc45cf91cb4ac9b2b5257c4760c4249b34a8941444ffe79ad
MD5 5616a722c0f692b7d685bdc47bce1504
BLAKE2b-256 714f23be8bd9322c64ae9dec6c6763def0cee8e25c121d8436c448b3515390c7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pybes3-0.4.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cb6717ee428d9968b1b257337e26075836019da677572e8d4224c1961e48c3d8
MD5 d6a541467b9126c39549b0e846e1cd21
BLAKE2b-256 c1a15824fe81a39a56dbd67071c5f7508629692599a203503133a493c5e2fde1

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pybes3-0.4.1-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pybes3-0.4.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 5f92663d6e45e9ee17d7c89fc4e9712cb57d6687acff1c2642ceab2ccb5a5ddd
MD5 ddde76a07096e4ddb187c6ab2c2224c5
BLAKE2b-256 ae3249007afa5d585c22a9868a73f783f957e3036acc731b90e43f59c669987e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pybes3-0.4.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 96f6a5ed39b3adcb7cc4f7715aa8dc0e9311c14afab81221775041ef5d7c41db
MD5 b9e25729119e99f147c513c4db38e2aa
BLAKE2b-256 2673dcadf730ea1d8fd816dd634f581ba1447c84868aa9f83baf64b5f0eed410

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pybes3-0.4.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c4572ae4fc4cba7ee4379e9bbc54535954623d495e1991a7c2a019109ff1fa00
MD5 5c96774c7ce5d42d7daabb04148b91b8
BLAKE2b-256 a791bd370ec1c2273289471ca22d51996b4d8112720c71875cfab141b267c002

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pybes3-0.4.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pybes3-0.4.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 05f9085fc74f3d74fa9aa1acc4111f34292f748a4c51d74d38399b4d89ef75d8
MD5 372263f6e8c0e82b6ac4949aeb12be76
BLAKE2b-256 3c6dbdb098eef0b10bbae5c580478526d56b986d568ea7cb72739ede11b2a794

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pybes3-0.4.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4794f8ede7f990162f6041985b456fbe6426e8f3dd43e1a4410a2d798d857247
MD5 ea3e203cd89990e588cf2130489c1264
BLAKE2b-256 e7c52fec1f07ac2c913091848b109491d4d3a4f5f2bf8aeff0d8458a270c74ee

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pybes3-0.4.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 03ad0c71114ddf4b7613a3695cd69179bde67bd9d377fa08a56d497b47102dca
MD5 3b5079e30432a70ae6b7aab49dfaa925
BLAKE2b-256 0006626db481c1b8eb6637e0d52c87760e493393703f07d59c4e0a498d89d0c5

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pybes3-0.4.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pybes3-0.4.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 ce184fe57195f7dfff77da8155d724d2d86de5f112ed317fafc10148e853e0e0
MD5 badf421e0eb219c47a37541fe90a7dd9
BLAKE2b-256 e07f2b44901b1238c61fd6b5137c33ee0f77ddbc61801ca9f7cd4d296bc44b55

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pybes3-0.4.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 96cf090a514c3f1ce2a102c20828365f94473afa8549e48e6196c612e8c5ab8c
MD5 fb52a9e439b4d0f9809f61830ec65ea3
BLAKE2b-256 35b9cbcaa77434f4b4e34bc1d417dc06cf893a0e704db498559d3c1b22bb7849

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pybes3-0.4.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9750e74df89f6ed260e83148357ff0a27bb6130cb2f7fee5713ad8446079bffb
MD5 d00ee3ff11c42c584b337367676993a9
BLAKE2b-256 11da55397b55b883378e640ac35e090fc2c27d0cf62e447d85e7aeeb981e9082

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pybes3-0.4.1-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pybes3-0.4.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 b044ec03c617dc307cf34312cdc034ede16cc312a914dbf6ecfc2172666b3759
MD5 1eccc800f21d93681870584bd52c9140
BLAKE2b-256 cc1598856edc55965d457b60968155d5c04b7ba3bb8bd5ea55f0a87fd0413723

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pybes3-0.4.1-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1cbc59116d090d8a362c2bdefdd280c1ddc66793b21a1b302a00d25fdecb5fea
MD5 b5fb00c904d893f81185b69edba2ff67
BLAKE2b-256 f693bbea4ac6f6adbdf84bd9382b91be6cba68ce77f64e07a6a457e9981e4858

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pybes3-0.4.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 968ae5b6e6ec7b84f34834bcd188fd06bb6dbd08401c533f52934d6a55cd105b
MD5 3ef1b75aace2ebc9d513e776f5216433
BLAKE2b-256 66812add29607271cf7027fbc674a946ad37177d6cf1d5302a4999088b96b194

See more details on using hashes here.

Provenance

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