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
    pybes3.wrap_uproot()
    
    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.13.tar.gz (5.6 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.13-cp313-cp313-win_amd64.whl (954.9 kB view details)

Uploaded CPython 3.13Windows x86-64

pybes3-0.3.13-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (983.6 kB view details)

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

pybes3-0.3.13-cp313-cp313-macosx_11_0_arm64.whl (944.3 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

pybes3-0.3.13-cp312-cp312-win_amd64.whl (954.9 kB view details)

Uploaded CPython 3.12Windows x86-64

pybes3-0.3.13-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (983.7 kB view details)

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

pybes3-0.3.13-cp312-cp312-macosx_11_0_arm64.whl (944.3 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

pybes3-0.3.13-cp311-cp311-win_amd64.whl (953.8 kB view details)

Uploaded CPython 3.11Windows x86-64

pybes3-0.3.13-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (982.7 kB view details)

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

pybes3-0.3.13-cp311-cp311-macosx_11_0_arm64.whl (943.7 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

pybes3-0.3.13-cp310-cp310-win_amd64.whl (953.0 kB view details)

Uploaded CPython 3.10Windows x86-64

pybes3-0.3.13-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (981.4 kB view details)

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

pybes3-0.3.13-cp310-cp310-macosx_11_0_arm64.whl (942.4 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

pybes3-0.3.13-cp39-cp39-win_amd64.whl (953.9 kB view details)

Uploaded CPython 3.9Windows x86-64

pybes3-0.3.13-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (981.8 kB view details)

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

pybes3-0.3.13-cp39-cp39-macosx_11_0_arm64.whl (942.6 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: pybes3-0.3.13.tar.gz
  • Upload date:
  • Size: 5.6 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.13.tar.gz
Algorithm Hash digest
SHA256 8c9e1f7e81d12d2bec156b42b7c0988c64f2ebd27b4f3f442f8dd2c9d0d51013
MD5 d264aae1ff529bcca3e404cc0c56f577
BLAKE2b-256 8ea2d31fdb58cb928addfe2e58a7adee7d4e5cbc6d717fa57c44408b4c884ad2

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pybes3-0.3.13-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 954.9 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.13-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 2501358318173e98ffb18e12839a55561b1374920cf54ca8e6a281898a30234f
MD5 912f8a0f62519529cd87b484d824db6e
BLAKE2b-256 cb2d4d2a2ac964579d2a4d2ff1d00473bd1239166b7839498a0cfcd5a1d47ba0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pybes3-0.3.13-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8dda5fa62d76fca7163b2232ae93128f2342778e0cc7edba3a9863e96b29a573
MD5 fb06c3a291c86cdc390c8d2dcd23cdd4
BLAKE2b-256 57d2139ffc9ae286c8ccdc1209a75b3baa4533003ca7aa27f082284bb0a9d323

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pybes3-0.3.13-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5dc422108e69241ad32b401a8ac8fb88e90c7950da7a79ef99f478d7a78484e9
MD5 99ee2e69878fd3d916d6635aa03ae832
BLAKE2b-256 5583d88114d91532920d574d9e7a5de187313a6705966bbef08ed004b6b9bbf0

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pybes3-0.3.13-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 954.9 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.13-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 f704c2daff5421dfe5f3b2c60c4b9eb5d8d3d12389b9812a64d3e522431f8dfa
MD5 48a077686837edcaa8c82a156b2b659a
BLAKE2b-256 cd8610a2cebd5eeefad160fca03edcf9f2722e55256ed86dafff2be6deca0043

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pybes3-0.3.13-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f77580407b9e44ba1cd99181041d3bff2fc0b3658d64e6f82c4d0e088ec397ae
MD5 1491123a5c0e350525aa9725dcccfeb7
BLAKE2b-256 1e4c3630d76ed35a23b9701aaa2f5dd3bce18fa6cc12450c39902496b14acbdd

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pybes3-0.3.13-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d80673eb33b03369078ef0519c1d1be33d5f09632c3bd0f8ba88e6c2083fc546
MD5 1e68ffaef4a0b7072a85dac3749be710
BLAKE2b-256 7748deb722e3e3de1bd49956c546257f09d3f0878156958120ddd077ffd4ca8d

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pybes3-0.3.13-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 953.8 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.13-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 b7737633d96583a2f8ece29a42784c93d886f3b54e5d77951f280db069079057
MD5 999a832157bdf7e673bd9ca4d6ff35ae
BLAKE2b-256 4388a0c421dd8059fbcd0663625bceaf7470902a7bdbc2861a39ba7874ceeb6f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pybes3-0.3.13-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 202f8b254db3bd4c3784b91abd2f1147cdf0f24c3eb92c2ca28a5cda99cc489e
MD5 e8cbfbf7820eafb3e4ee3cc5637756e1
BLAKE2b-256 30b4f7f62d17af2367f2e51c7d9e4414dc99a44cc7581d5cd285870752f55918

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pybes3-0.3.13-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 97e12c5ed8ead85dcf5d4388a89c46559ad6370a1b5bea8d49f2b5e5bfade960
MD5 66a2d8f90c741e99f55b33f022d2411b
BLAKE2b-256 b85afce7856b7017a48b2567df3df2aa01002404736293c523ccff557297e7dc

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pybes3-0.3.13-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 953.0 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.13-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 ec09ac5efc42aeba1af6736a1ddcadc64f115361bea1c6b351f606739c7d7463
MD5 3640e4150e6dc915f4d8291f1e5f29b0
BLAKE2b-256 b8f7cfe8a35da6ac1cfbfc167af6cf9d292ee02ee7b098da5cb47d8a3b404d16

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pybes3-0.3.13-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 95dee9345e71e92b7f46f19bfcd5811961d35a931ab0c5b157da695425caaa58
MD5 37055b91ee38426c72ed617939d8a2ea
BLAKE2b-256 3b86ca5e955715bb53909cfada63ca812466522abdd2a1d417e6eb8a54cb85cd

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pybes3-0.3.13-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 71101f853dab1fc42932bde80ccb91df60cbb51958877074f654fc3f81e2ee6b
MD5 18b998300df18e82cd75e4b7d8cad3d4
BLAKE2b-256 ca285ebcebdf65162b9a7712bfe3282f9292c0a53648dce3c8b1fba12dab7144

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pybes3-0.3.13-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 953.9 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.13-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 e2986ff66e0761fd5c3c99187ac1bd221d6ae26be2114b8d44ac75d683e15397
MD5 265abf04e31cb1599e96bdc568fde946
BLAKE2b-256 2662e04c5a86a6bea86c689312a1cbc9436b6c1f80c04dc21c9e0943169a4847

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pybes3-0.3.13-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 cd73c1572b83d3bf2d9854dacbc1e0389638921cab538a22676aba799733dd9b
MD5 2476d7e698303218fca22f1db7ba1604
BLAKE2b-256 e16981907a7e2d372d12d228b4fca913bcd27a39db6afa2c731a5b355d0220eb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pybes3-0.3.13-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cc1e74737f5be9571f1eb9700088e42ec4cc40d53b1145967750dfe6aa321b53
MD5 746bbc350b7a27e36ae7ed27bd585d2f
BLAKE2b-256 ec7f58cdc153d67504806b58b12e065a8f0bfac35dce01fada025c6727130722

See more details on using hashes here.

Provenance

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