1use std::collections::{BTreeMap, HashMap};
2
3use particle_id::ParticleID;
4use petgraph::prelude::DiGraph;
5
6#[derive(Clone, Debug, Default)]
8pub struct Event {
9 pub id: Option<i32>,
11 pub sample_info: SampleInfo,
13 pub weights: Vec<WeightInfo>,
15 pub scales: Scales,
17 pub alpha_s: Option<f64>,
19 pub alpha: Option<f64>,
21 pub process_id: Option<i32>,
23 pub particles: Vec<Particle>,
25 pub info: String,
27 pub attr: HashMap<String, String>,
29 pub mpi: Option<i32>,
31 pub random_states: Vec<i32>,
32 pub heavy_ion_info: Option<HeavyIonInfo>,
34 pub topology: DiGraph<Vertex, usize>,
38 pub reweights: Vec<Reweight>,
40}
41
42#[derive(Clone, Debug, Default, PartialEq)]
44pub struct SampleInfo {
45 pub generators: Vec<String>,
47 pub nevents: Option<usize>,
49 pub beam: [Beam; 2],
51 pub pdf: [Option<i32>; 2],
53 pub cross_sections: Vec<CrossSection>,
55 pub process_ids: Vec<i32>,
57 pub weight_type: Option<i32>,
59 pub info: String,
61 pub attr: HashMap<String, String>,
63}
64
65#[derive(Clone, Debug, Default, PartialEq, PartialOrd)]
67pub struct WeightInfo {
68 pub weight: Option<f64>,
70 pub name: Option<String>,
72 pub mu_r_factor: Option<f64>,
74 pub mu_f_factor: Option<f64>,
76 pub pdf: Option<i32>,
78 pub pdf2: Option<i32>,
80}
81
82#[derive(Clone, Debug, Default, PartialEq, PartialOrd)]
84pub struct Scales {
85 pub mu_r: Option<f64>,
87 pub mu_f: Option<f64>,
89 pub mu_ps: Option<f64>,
91}
92
93#[derive(Clone, Debug, Default, PartialEq, PartialOrd)]
95pub struct Particle {
96 pub id: Option<ParticleID>,
98 pub p: Option<[f64; 4]>,
100 pub m: Option<f64>,
102 pub status: Option<Status>,
104 pub spin: Option<f64>,
106 pub col: Option<[i32; 2]>,
108 pub flows: BTreeMap<i32, i32>,
110 pub lifetime: Option<f64>,
112 pub theta: Option<f64>,
114 pub phi: Option<f64>,
116}
117
118#[derive(Copy, Clone, Debug, Default, PartialEq, PartialOrd)]
120pub struct Beam {
121 pub id: Option<ParticleID>,
123 pub energy: Option<f64>,
125}
126
127#[derive(Clone, Debug, Default, PartialEq, PartialOrd)]
128pub struct CrossSection {
129 pub mean: f64,
131 pub err: Option<f64>,
133}
134
135#[derive(Copy, Clone, Debug, Eq, PartialEq, PartialOrd, Ord, Hash)]
136pub enum Status {
137 Incoming,
139 Outgoing,
141 IntermediateSpacelike,
143 IntermediateResonance,
145 IntermediateDoc,
147 IncomingBeam,
149 Unknown(i32),
151}
152
153#[derive(Clone, Debug, Default, PartialEq, PartialOrd)]
154pub struct Vertex {
155 pub status: Option<i32>,
156 pub x: Option<f64>,
157 pub y: Option<f64>,
158 pub z: Option<f64>,
159 pub t: Option<f64>,
160 pub weights: Vec<f64>,
161}
162
163#[derive(Debug, PartialEq, PartialOrd, Default, Copy, Clone)]
165pub struct HeavyIonInfo {
166 pub ncoll_hard: Option<i32>,
167 pub npart_proj: Option<i32>,
168 pub npart_targ: Option<i32>,
169 pub ncoll: Option<i32>,
170 pub spectator_neutrons: Option<i32>,
171 pub spectator_protons: Option<i32>,
172 pub n_nwounded_collisions: Option<i32>,
173 pub nwounded_n_collisions: Option<i32>,
174 pub nwounded_nwounded_collisions: Option<i32>,
175 pub impact_parameter: Option<f64>,
176 pub event_plane_angle: Option<f64>,
177 pub eccentricity: Option<f64>,
178 pub sigma_inel_nn: Option<f64>,
179}
180
181#[derive(Clone, Debug, PartialEq, PartialOrd)]
183pub struct Reweight {
184 pub channel: u32,
185 pub x1: f64,
186 pub x2: f64,
187 pub log_coeff: Vec<f64>,
188}