root_io/tree_reader/
mod.rs

1//! A convenience wrapper and needed parsers to work with ROOT's
2//! `TTree`s. A Tree may be thought of as a table where each row
3//! represents a particle collision. Each column may contain one or
4//! several elements per collision. This module provides two Iterator
5//! structs in order to iterate over these columns (`TBranches` in
6//! ROOT lingo).
7
8mod branch;
9mod container;
10mod leafs;
11mod tree;
12
13pub use self::tree::{ttree, Tree};
14
15#[cfg(all(test, not(target_arch = "wasm32")))]
16mod tests {
17    use std::path::PathBuf;
18    use tokio;
19
20    use crate::core::RootFile;
21
22    #[tokio::test]
23    async fn simple_tree() {
24        let path = PathBuf::from("./src/test_data/simple.root");
25        let f = RootFile::new(path.as_path())
26            .await
27            .expect("Failed to open file");
28        f.items()[0].as_tree().await.unwrap();
29    }
30}