Linux/OS X/WebAssembly Home windows

This isn’t an official ALICE or CERN challenge

This repository demonstrates how the public information launched by the CERN primarily based ALICE collaboration might be analyzed with the Rust programming language.

Listed here are some instance figures produced with this challenge. The primary two present the distribution of produced particles within the longitudinal and azimuthal dimensions. The third determine exhibits the place the collisions (aka occasions) occurred alongside the course of the particle beams within the collider. The final determine exhibits what number of charged particles had been produced per collision:

This assortment of crates offers and demonstrates:

  • A parser for studying the ROOT binary file format. That is the usual format utilized in particle physics.
  • The mALICE framework offering some important instruments for writing an evaluation of the general public information.
  • A library/binary for downloading a desired quantity of the publicly launched information. See the alice-download crate. The alice-open-data crate offers some conveniences for later finding and studying the downloaded recordsdata
  • Excessive efficiency n-dimensional histograms for streaming information.
    Maintains a binned depend of the info which might be successively stuffed. See histogram
  • A easy evaluation demonstrating the way it all performs collectively. See examples/simple-analysis


There aren’t any dependencies on any ALICE particular software program, nor ROOT itself. The software program from this repository might be run on Linux, MacOS, and Home windows.


ALICE (A Massive Ion Collider Experiment) is the devoted Heavy Ion experiment on the Massive Hadron Collider (LHC) in Switzerland. Identical to most different CERN primarily based experiments, its purpose is to raised perceive the basic particles and forces of the universe. Particularly, ALICE is anxious with the so known as robust pressure which is the dominant actor for processes inside an atomic nuclei. Lots of the properties of this pressure manifest them self at excessive pressures and temperatures as they had been discovered micro seconds after the Massive Bang. By colliding heavy nuclei resembling lead ions at practically the velocity of sunshine, we’re in a position to recreate such excessive situations for a really transient second inside the ALICE detector. By rigorously learning the particles produced at such collisions we are able to deduce the properties of the robust pressure which can assist us to raised perceive nuclear reactions, neutron stars, the primary moments of the universe and rather more.

See also  A Review of Benefits, Side Effects and Dosage

CERN open information

ALICE, in addition to another CERN primarily based experiments have launched a small subset of their recorded information into the general public area. The dataset in query for this challenge is in complete roughly 6TB. Whereas some analyses actually need all the info they’ll get, others (like the instance one) might be run on only a ~1GB. With this challenge it’s completely feasile to obtain the entire public dataset to a big exterior laborious drive and run a fancy evaluation over night time on a laptop computer.


The usual implementation for studying ROOT recordsdata is written in C++. I wrote a wrapper to interface with the usual implementation to do precisely the identical type of work which is being completed within the Rust code. I ran each implementations on precisely the identical set of enter recordsdata. The outcomes had been similar in each instances. I as soon as ran with a heat cache and as soon as with a chilly one. The benchmarks had been completed with hyperfine. Under are the outcomes:

  • Heat cache
$ hyperfine --warmup=1 './goal/launch/deps/malice-0650b02bfc3cb85f bench_rust' './goal/launch/deps/malice-0650b02bfc3cb85f bench_cpp'
Benchmark #1: ./goal/launch/deps/malice-0650b02bfc3cb85f bench_rust

  Time (imply ± σ):      6.305 s ±  0.187 s    [User: 5.392 s, System: 0.909 s]
  Vary (min … max):    6.156 s …  6.788 s
Benchmark #2: ./goal/launch/deps/malice-0650b02bfc3cb85f bench_cpp

  Time (imply ± σ):      8.234 s ±  0.116 s    [User: 6.888 s, System: 1.347 s]
  Vary (min … max):    8.098 s …  8.406 s

  • Chilly cache
$ hyperfine -p 'sync; echo 3 | sudo tee /proc/sys/vm/drop_caches' './goal/launch/deps/malice-0650b02bfc3cb85f bench_rust' './goal/launch/deps/malice-0650b02bfc3cb85f bench_cpp'
Benchmark #1: ./goal/launch/deps/malice-0650b02bfc3cb85f bench_rust

  Time (imply ± σ):     10.894 s ±  0.180 s    [User: 6.750 s, System: 1.348 s]
  Vary (min … max):   10.619 s … 11.213 s
Benchmark #2: ./goal/launch/deps/malice-0650b02bfc3cb85f bench_cpp

  Time (imply ± σ):     18.557 s ±  0.464 s    [User: 8.519 s, System: 2.691 s]
  Vary (min … max):   17.775 s … 19.156 s

In each instances, the Rust model processed the set of recordsdata ~30% (heat cache) and ~70% (chilly cache) sooner. The chilly catch is arguably the extra practical bench mark since one will go to every file in a set solely as soon as per evaluation. Observe that these benchmarks used no concurrency in any respect. The true worth of the Rust model is that it could actually simply be used multithreaded, whereas the ROOT-implementation can not.

Observe additionally, that the usual ALICE framework, which is construct on high of ROOT, was not benchmarked. The ALICE framework at all times reads in and decompresses all the info of a given file, despite the fact that a standard evaluation solely must entry much less then 10% of it. This makes the usual ALICE framework considerably much less performant than this set of crates.

Why this challenge?

I began this challenge with the intend of studying the Rust programming language. It didn’t take lengthy till I used to be plainly fascinated by its ease of use, all of the little gems just like the debug formatting of bitflags, and the by no means the much less uncompromising velocity.

In the intervening time I used to be in a position to strip of increasingly dependencies to the ALICE software program stack (aka. AliRoot and AliPhysics). Lastly I reached the purpose the place I used to be in a position to drop the entire ~5M strains of code.
I noticed that this challenge is perhaps of curiosity to a wider group of people that wish to use the ALICE public information however are understandably misplaced within the ALICE software program stack. At present, the one technique to analyze the printed information is thru that massive and largely undocumented ALICE framework, which I contemplate an virtually insurmountable entry barrier. Even when any person doesn’t wish to be taught Rust, this repository may nonetheless present useful clues on tips on how to analyze ALICE’s information with minimal dependencies.

See also  The Cleric Handbook

Maybe not surprisingly, eradicating a lot code and indirection from the evaluation improved the efficiency considerably.

Operating assessments

This initiatives makes use of cargo as a construct device. Operating wasm assessments requires a CORS proxy in the intervening time. If the proxy is about up with a route at (customary within the not but launched CERN CORS proxy) one might run:

cd ./alice-open-data/
wasm-pack take a look at --firefox --headless

Find out how to cite this challenge in a publication

  writer =    {Christian Bourjau},
  title =     {{mALICE}: An open supply framework for analyzing ALICE's Open Knowledge},
  yr =      {2018--},
  url = ""



Leave a Reply

Your email address will not be published.