Skip to main content

The stand-alone ultra-fast simulation option for LHCb

Project description

GitHub address Doxygen on Pages

Lamarr logo

SQLamarr

The stand-alone ultra-fast simulation option for LHCb

The detailed simulation of the hadron collisions at the LHC, and of the interaction of the generated particles with the detector material dominates the cost for the computing infrastructure pledged to the LHCb Collaboration.

Among the various options explored towards a faster simulation, there is Lamarr, a framework defining a pipeline of parametrizations transforming generator-level quantities to reconstructed, analysis-level features. Most of the parametrizations are defined using machine-learning, and in particular Deep Neural Networks and Gradient Boosted Decision Trees, with a traing procedure defined in independent packages (e.g. landerlini/lb-trksim-train and mbarbetti/lb-pidsim-train).

To be integrated in the LHCb software stack, models must be queried from a C++ application, running in the Gaudi framework, which includes a dedicated multithreading scheduler which was found to conflict with the schedulers of TensorFlow and ONNX runtimes. In addition, since the models are relatively simple and fast to evaluate, the overhead of context switching from Gaudi to a dedicated runtime was observed to be unaccptably large. Hence, models are converted into compatible C code using the landerlini/scikinC package and distributed through the CernVM FileSystem releasing the LamarrData package.

While crucial to the applications within LHCb, the integration with Gaudi and Gauss makes the adoption of Lamarr unappealing for researchers outside of the LHCb community approaching the LHCb simulation to evaluate the experiment sensitivity to new physics phenomena or studying the recently-released LHCb Open Data. The landerlini/SQLamarr package aims at decoupling Lamarr from Gaudi providing a stand-alone application with minimal dependencies that can be easily set up and run in any Linux machine. The parametrizations are shared between the Gauss-embedded implementation LbLamarr and SQLamarr. In the future, the exact same package might be integrated within Gaudi to reduce the maintainance effort.

To replace the ROOT-based TransientEventStore concept defind in Gaudi, SQLamarr adopts the SQLite3 package, enabling vectorized processing of batches of events, for a better performance.

To avoid dependencies on ROOT, also the persistency is handled using SQLite3, writing the reconstructed (or intermediate) quantities in the form of SQLite3 databases. Note that converting an SQLite3 table to a ROOT nTuple requires no more than 3 lines of Python:

import sqlite3, uproot, pandas
with sqlite3.connect("SomeInput.db") as conn:
  uproot.open("SomeFile.root", "RECREATE")["myTree"] = pandas.read_sql_table("myTable", conn)

Dependencies

  • SQLite3 with C/C++ headers
  • HepMC3 as a standard interface to event generators.

Build from source

Make sure you have conda (or similar) installed, if not get miniconda3. Create and activate a dedicated conda environment, say sqlamarr:

conda create -y -n sqlamarr -c conda-forge python=3.10 gxx gxx_linux-64 hepmc3 doxygen
conda activate sqlamarr

Create a out-of-source directory:

mkdir build
cd build

Configure and build

cmake .. 
cmake --build .

How to use SQLamarr

The project is not mature enough to provide a good user experience. For the time being, clone the repository and compile the package with CMake, then edit the file src/main.cpp to define the desired pipeline, by using the building blocks provided by the package.

BlockLib

The namespace SQLamarr::BlockLib groups functions defining specialized blocks making assumptions on the workflow in which these blocks will be deployed. While useful for testing and for organizing the code defining pipelines, it is not supposed to be stable (as it is being modified while the workflow under test is modified) and should not be used as part of other packages.

Other packages, however, may take inspiration from the structure of SQLamarr::BlockLib to design specialized blocks, resident in their codebase, in a more organized way than having everything pipelined in a single file.

To test the completeness of the feature set in the main part of the library, SQLamarr::BlockLib is designed to only include functions, accessing public methods of the objects defined in the main part of the library.

Copyright and Licence

(c) Copyright 2022 CERN for the benefit of the LHCb Collaboration.

This software is distributed under the terms of the GNU General Public Licence version 3 (GPL Version 3), copied verbatim in the file "LICENCE".

In applying this licence, CERN does not waive the privileges and immunities granted to it by virtue of its status as an Intergovernmental Organization
or submit itself to any jurisdiction.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

SQLamarr-0.0rc3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

SQLamarr-0.0rc3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

SQLamarr-0.0rc3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

SQLamarr-0.0rc3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

SQLamarr-0.0rc3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

File details

Details for the file SQLamarr-0.0rc3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for SQLamarr-0.0rc3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ac90c8e3ba845dd10de2112846c0d1b69783b2b1df224b0b4bcd80d2c3fb1acc
MD5 a3c41811360f60fa7cf87a7269b18ba5
BLAKE2b-256 3c7eac1fdea0f88b2b170e6367bbe9b4f9baa0f2a09d678ca8a807c0bea06ab5

See more details on using hashes here.

File details

Details for the file SQLamarr-0.0rc3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for SQLamarr-0.0rc3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 afec3bca7f318b06c4f36ac824fecb9fb51bbb4670062601cc23e48394e857e8
MD5 5a179a87912ef761342ab4d63a948b7a
BLAKE2b-256 352acd8042d7c95348077ef8dda83e9854af865ee7323e957890c164ad19b3ac

See more details on using hashes here.

File details

Details for the file SQLamarr-0.0rc3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for SQLamarr-0.0rc3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ccfd72734ed44714decadbe4cf2ba05e91a920a93a4cf200a53444ea243b704f
MD5 1c3beae26dbdf16dd0646ba232581e25
BLAKE2b-256 c47c6c11c1e1646d8ee60941109d32ea3bdf25bee8dc2225190defa439031f99

See more details on using hashes here.

File details

Details for the file SQLamarr-0.0rc3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for SQLamarr-0.0rc3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d2b87e2cb02550c948a2702d448e3fd8258928d21cecfcc3b967ec539595271b
MD5 6b811193baa00ebad50bead95b92c178
BLAKE2b-256 21a6b74a76f3bc08395f9eeb594afe4ef4fe9a2a2f35e1cf5d33cd8930663837

See more details on using hashes here.

File details

Details for the file SQLamarr-0.0rc3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for SQLamarr-0.0rc3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0548852c9a00907dda9b8065cb0af4c6df4656fa78a2549116afadb5cc4b8d54
MD5 a75b463952212a9963ecaff738a4dc65
BLAKE2b-256 e6867a3201a7ca1fc23d0fdde8848bbe624a8832fabbcde5540e14e0883ae10f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page