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.

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.

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

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.12.tar.gz (5.5 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.12-cp313-cp313-win_amd64.whl (955.0 kB view details)

Uploaded CPython 3.13Windows x86-64

pybes3-0.3.12-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (983.7 kB view details)

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

pybes3-0.3.12-cp313-cp313-macosx_11_0_arm64.whl (944.4 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

pybes3-0.3.12-cp312-cp312-win_amd64.whl (955.0 kB view details)

Uploaded CPython 3.12Windows x86-64

pybes3-0.3.12-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (983.8 kB view details)

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

pybes3-0.3.12-cp312-cp312-macosx_11_0_arm64.whl (944.4 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

pybes3-0.3.12-cp311-cp311-win_amd64.whl (953.9 kB view details)

Uploaded CPython 3.11Windows x86-64

pybes3-0.3.12-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.12-cp311-cp311-macosx_11_0_arm64.whl (943.8 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

pybes3-0.3.12-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (981.5 kB view details)

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

pybes3-0.3.12-cp310-cp310-macosx_11_0_arm64.whl (942.5 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

pybes3-0.3.12-cp39-cp39-win_amd64.whl (954.0 kB view details)

Uploaded CPython 3.9Windows x86-64

pybes3-0.3.12-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.12-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.12.tar.gz.

File metadata

  • Download URL: pybes3-0.3.12.tar.gz
  • Upload date:
  • Size: 5.5 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.12.tar.gz
Algorithm Hash digest
SHA256 b064405005ae85ec6a072ac69b50a916a4b1e67149e0f33a489de67a928e1c68
MD5 b0e6d3577ab8b9837839735184f26035
BLAKE2b-256 c3b88c2e05d2e754621cfda8ae9fd3b46a5087e59af3f3e465ec31cacab3856d

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pybes3-0.3.12-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 955.0 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.12-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 d3711bc7c712b47b48d52613b8d71759739180adcc6b4ac4df648d8726305910
MD5 6ae7da8864f428e28818b0a6ee561a22
BLAKE2b-256 55d423d9898e5c60cda0b98a7db5dbe3311608140ba7fccbeac25bfb5098f7d2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pybes3-0.3.12-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 24deff42f615000fd8484d60a85d36a398e3b9611db0c5289cec339d8b83a807
MD5 191edfa73fb46e40c202690020b4134e
BLAKE2b-256 2acdc11f5ff1004ae7b3f556060077b4b7fcf1bc224eeb168093b579288466d2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pybes3-0.3.12-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7403f50f659efac5261564e9cfd04f88c71eca55b5d0698e363db40d1de77ce0
MD5 b4a1a904c6b4e14cc1588ab84c9f6667
BLAKE2b-256 f85d9d4d1793445e01c7b9817d5002f642043eb95718a06b38041a6e42049daf

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pybes3-0.3.12-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 955.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.12-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 02fc4a72e8c74a263414ea55c9688195622e358d037b4ef7bfe8ff8347d22cc1
MD5 7b136ec17fb18839e5fe07408ed5c454
BLAKE2b-256 d70dda82b559fbb3aa2eac6a072a318436a2cc1ec20deb9377aeed757e2e6e4d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pybes3-0.3.12-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7a927af203a95ac4eed26d3bc61cc6b8c7926552b9120b6227eb1db0ad8bd586
MD5 453f1cb0ab5d4cb47196a537e42d21d9
BLAKE2b-256 9ccf40312f98aec616bddd5dd19f4d6dfa4daa1a1e2d173f9c7183ce7aadb432

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pybes3-0.3.12-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 221450db8241c04f7b8b61ab724bff1f9af22ff25bba59bda44088c7efde5a40
MD5 725b3cfc8ef2c050b1ab1d5c772ac417
BLAKE2b-256 0940f003736a09c6888a932058f7613bd5ac37119949bc01e85095e1e4eaec28

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pybes3-0.3.12-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 953.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.12-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 49590408bcb8557b75007a0ecb0bd5e503f3a7b4785fdf04528c01aa324b80bb
MD5 9c6a18899e2e1cd45317a662f379e0c3
BLAKE2b-256 ac0c4618b63531e9502713b5087743c5c2de29fd64c72d4cbb0477a24d6c7943

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pybes3-0.3.12-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e6afcf3cf03c869a8943e44e56f5a59447ab676f48199470ef06528488645602
MD5 a92c1849e53e660c5b0dde002338cc86
BLAKE2b-256 0df11c2201184bef92dba64fe2c3659ad0f1f8f203426b90feb154934935ebe1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pybes3-0.3.12-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3a11f506e40402351740ed29bcae3ab3933e1088f5aa24b38dd3d8f1778e1c67
MD5 793d4edc973e7c40e0e85ffcf6fe7814
BLAKE2b-256 e75d5736d6ece2487019fee00502b859586c6d057190dcfa2d654fe2b3bcde50

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pybes3-0.3.12-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.12-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 b8d0faeadd13646b92a206d97b3d2d3246cb1f66086b811d62152ad239c813ad
MD5 ec1182a755138a0bbb65e7c9c88a9ed6
BLAKE2b-256 e3d7b41fc00ee62e0afd55fc737569db9a78f8d8939b21de175e2fb80e42b8f6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pybes3-0.3.12-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0721bc408a48aefdc8c049e43292a0b74fd68a303683332d233638649b07d53a
MD5 6b150aaf7b93120b1819d7f80591f249
BLAKE2b-256 c4f39e6cac7d8c58f6a59188978c992cba553350dfe4ee6d7979d21ea0c3b6ec

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pybes3-0.3.12-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 86b67801869a0bc2e0911252f674d300613fcea63e05b2aabad879fa7fcfc7a8
MD5 3260a6f63568354106569c1d7c8dfb06
BLAKE2b-256 904e1af91291b3ef15db745196572b82488484d8ed19033009bc598ed2545156

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pybes3-0.3.12-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 954.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.12-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 c054749cbe7def5431ef86399265cc97177261cd03efb16f9a19a21c79b40f06
MD5 7c355e29d5889de7df2e58f75e0863f5
BLAKE2b-256 d4a50f48f5a4386244041cc127a1d037902a037f7e041b46197a79501a6a1672

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pybes3-0.3.12-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2445dca33c2c4527dbaf5b6b98111d9c52c9553fbaaed41f87b172f8aa409f08
MD5 5a425ede24cadeb4f5e89793bb92ce75
BLAKE2b-256 348959c703392a6d705bfa3c36b0bc0ae430757885aba87d66c099d136cf0f07

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pybes3-0.3.12-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9e25d80e6875ca5c2d9fc83a1dbcc5a65aecd18ae1f45893b3a0a32e891f7074
MD5 14b11fb81471733ebee28a59c9ec128d
BLAKE2b-256 986f349d0271a7780a0324353db4ba9b6bb10f69456b2dfc3c2eee01576e1133

See more details on using hashes here.

Provenance

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