Crate malice[][src]

malice

"milli ALICE" aka malice is a tiny framework defining some sensible defaults to analyze the ALICE open data.

Features

malice supports two IO back-ends. The first and recommended one is the pure Rust root-io crate. The second one is behind the cpp feature gate and depends on the c++ ROOT framework.

Example

Here is a very simple example "analysis" using malice which counts the number of tracks in an event. For a more comprehensive, but still small, example check out simple-analysis.

use alice_open_data;
use malice::{default_event_filter, default_track_filter};
use malice::event_iterator_from_files;

let file = alice_open_data::test_file()
    .expect("No data files found. Did you download with alice-open-data?");

// Create an iterator over all the events in all the given files
let events = event_iterator_from_files(vec![file].into_iter());

for event in events.filter(default_event_filter) {
     // Fill only if we have a valid primary vertex
     if let Some(prime_vtx) = event.primary_vertex() {
         let n_tracks = event
         .tracks()
         // Apply a sensible default "cut" on the valid tracks
         .filter(|tr| default_track_filter(&tr, &prime_vtx))
         .count();
         println!("This event had {} valid tracks", n_tracks);
    }
}

Structs

Event

A model for a subset of an event as stored in the published data

Flags

Various attributes of tracks. Flags are based on those found in AliRoot's AliVTrack.[h,cxx]

ItsClusters

Clusters in the ITS associated with the curren track See AliESDTrack::HasPointOnITSLayer

PrimaryVertex

The most likely position in the detector where the current event took place. The primary vertex is the most likely common origin of all the reconstructed tracks.

Track

A Track is a reconstruction of the trajectory of a particle traversing the detector.

TriggerMask

Triggers are low level qualifier of an event. One event may "fire" several triggers.

Functions

default_event_filter

A simple but reasonable default event selection Returns true if the given event passes the recommended selection criterion

default_track_filter

Applies a reasonable set of default track cuts returning true if the track is valid

event_iterator_from_files

Main entry point for analyses running over ALICE's open data. Produces an iterator over events from an iterator over files (either local or remote).

event_stream_from_esd_file

A helper function which turns a path to an ALICE ESD file into a stream over the Events of that file.

event_stream_from_files

Create a stream of events found in the given files (local or remote). You probably want to use event_iterator_from_files instead unless you are a on the wasm32 target.

event_stream_from_tree
is_hybrid_track

So called hybrid tracks are sometimes used in order to achieve a more uniform distribution of tracks in eta and phi. This function cannot be used with the default_track_filter and might need more debugging. Use with care.