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.0.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.4.0-cp313-cp313-win_amd64.whl (965.8 kB view details)

Uploaded CPython 3.13Windows x86-64

pybes3-0.4.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (986.0 kB view details)

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

pybes3-0.4.0-cp313-cp313-macosx_11_0_arm64.whl (958.0 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

pybes3-0.4.0-cp312-cp312-win_amd64.whl (965.8 kB view details)

Uploaded CPython 3.12Windows x86-64

pybes3-0.4.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (986.0 kB view details)

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

pybes3-0.4.0-cp312-cp312-macosx_11_0_arm64.whl (958.0 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

pybes3-0.4.0-cp311-cp311-win_amd64.whl (963.5 kB view details)

Uploaded CPython 3.11Windows x86-64

pybes3-0.4.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (984.9 kB view details)

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

pybes3-0.4.0-cp311-cp311-macosx_11_0_arm64.whl (957.1 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

pybes3-0.4.0-cp310-cp310-win_amd64.whl (962.9 kB view details)

Uploaded CPython 3.10Windows x86-64

pybes3-0.4.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (984.0 kB view details)

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

pybes3-0.4.0-cp310-cp310-macosx_11_0_arm64.whl (955.9 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

pybes3-0.4.0-cp39-cp39-win_amd64.whl (963.8 kB view details)

Uploaded CPython 3.9Windows x86-64

pybes3-0.4.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (984.4 kB view details)

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

pybes3-0.4.0-cp39-cp39-macosx_11_0_arm64.whl (956.1 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: pybes3-0.4.0.tar.gz
  • Upload date:
  • Size: 5.7 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.0.tar.gz
Algorithm Hash digest
SHA256 12c08d005f17356a3fe6bc23fa0ae3ce351c786fade362bf9f554b59b9f67843
MD5 445970371538b4ca66cbc0dc07134f68
BLAKE2b-256 5b1e7a149b30a7eaee165d16fcdff7f7db1f884b5707697c5a2b3c1bb0bdd0e4

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pybes3-0.4.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 965.8 kB
  • 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.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 1a5af4226a872c873e61ef14e76476d393bd83bbeaf1fff7027319184613a104
MD5 0281270e9218c3b0823b82406ff3c225
BLAKE2b-256 3591a384a36bb9341e17f9326e9246bfb54b16761ef4d927cca1a3e89a4fb25d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pybes3-0.4.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 43f1a5220beef388649fe58efebad384922f212bd3b3add5362774081d3b9cca
MD5 004b33cef09b16c97d9e5be849694311
BLAKE2b-256 9e06398d55cd7d4a975369f5b25ee33401c55a2466ca198b0e3f3f12f6bd7306

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pybes3-0.4.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 62743c63d87759fc53ca6f3657682c34261cc5e01b66d7629c06767c070495a9
MD5 a753553f60578dc2f768c145e8f29370
BLAKE2b-256 498e5f3931e667c847e710b6e00deee97774935f35085218d8499f90a885e260

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pybes3-0.4.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 965.8 kB
  • 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.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 680de123c7c050105db40e23be07edce322bf7d0eeff4855030b23308b210858
MD5 908754e34ab90aa0b251c5daef515a47
BLAKE2b-256 4e79e7eec3e34d2409263a79f7224943a132c52b413101d35f8191c9320276c0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pybes3-0.4.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c874dd0e1b201acfd704b64befa04c27e4e92b476bcd536d8e9d15cf84768372
MD5 63c4a47fa8d423e9e761b33411b7e463
BLAKE2b-256 e831712b1ba1fe9e79f4e008c80295a6d8913b53a9e4d37ead584b121fd736a7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pybes3-0.4.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f9ef76460f3e2a64c499976e917de82e51f0b678437df767f2c24e668b4b9859
MD5 c8f958d656a502d7f00ad4b33015c948
BLAKE2b-256 711cb729391a51d8186e7099f206c49b958cee3114718f50cf860825b962200a

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pybes3-0.4.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 963.5 kB
  • 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.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 e9eaf6dd498368f4fa29928bb943d079cd92b40ddce9b0fa28af9289e00b04ab
MD5 e0c27d40b688011e0bda3b08fc5d0e5b
BLAKE2b-256 e5fdc2749f6405264171e6dd2a389c8bedaed79b8531fef67128771e450914a6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pybes3-0.4.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c47ce484a7ed2c428c452c804c66364c2081074e781ad91c36ba33369ce2668c
MD5 0f2105f2eafc500604557fcaa2be1448
BLAKE2b-256 c3d56b64057a0a2c4e32a32a812c731c16433a957a8bca389a47d2750544e216

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pybes3-0.4.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 78c8542bb8317b113a89502607f36d1139d270786fa0feb8d9b0c52c2b5ea96a
MD5 087bc501dac6c630948cd69ebf7e38e8
BLAKE2b-256 f49429dbe3c07fc6e864ef3f76fa195de8be58bf9e0831ce1aa8eef56a5b7aee

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pybes3-0.4.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 962.9 kB
  • 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.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 168c9fd6540f98198dd52fb4c77ead86a325107cdd3fd81413eac02dd65d021d
MD5 b162d0c74061bb713a0720aa743ebecf
BLAKE2b-256 2048c9c8fef78faebf6c0e4119c81455a3ed809bd924ddeec202f4e8ab1b894d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pybes3-0.4.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a95e3b5660c731bee104b7578815699a713f84aae785ef067047f92ba3cca850
MD5 deaa03c1bad48eeb36a0ffb092e11611
BLAKE2b-256 7d3454507754b03a3686876598770acdcf5248ec9cf26455fbfff670c3818352

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pybes3-0.4.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 82c199b8f2597425b2dd8709f7683f494dbdd3d579fa36c0c19e0a27b3b53da6
MD5 3f7b0deec1314163a99b606d25c64d12
BLAKE2b-256 7a29fb4c64ee9f488357324eaafde9616f06411bddfa923269dcb82ce2161f43

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pybes3-0.4.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 963.8 kB
  • 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.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 b38a179ace164073e858bb7612d1617691cd2d231c00c7e9c5f79c1456c39127
MD5 86b539fecbd9caadf007f5179acc1b8e
BLAKE2b-256 363262abba531e0d85bb3bfd697f8ed13e80c3eacac9198aa4ba0569597345b9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pybes3-0.4.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ef436ad7d8d3f1a679c6199894fd2c02c42d30cfde344e959a43ab67264660d3
MD5 37a441cb038eb5636cf8753ad218e0cc
BLAKE2b-256 8a2716967fc63344cec7d103292e66d5f21ef1604b5e950690db42a8fa70e642

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pybes3-0.4.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 26245ccdc9f4e239dd16685636c74471466c31d7d0a1b68205c7d1a1f7e7a376
MD5 b71f49ade4d6d671827b2f4276d309f0
BLAKE2b-256 20e526185c4de912064a52dbcd0bc39f287b9847610a619c82b7725b8342ef02

See more details on using hashes here.

Provenance

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