lhef/data.rs
1use std::collections::HashMap;
2
3pub type XmlAttr = HashMap<String, String>;
4
5#[cfg(feature = "serde")]
6use serde::{Serialize, Deserialize};
7
8/// Generator run information
9///
10/// See <https://arxiv.org/abs/hep-ph/0109068v1> for details on the fields.
11#[allow(non_snake_case)]
12#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13#[derive(PartialEq, Debug, Clone)]
14pub struct HEPRUP {
15 /// Beam IDs
16 pub IDBMUP: [i32; 2],
17 /// Beam energies
18 pub EBMUP: [f64; 2],
19 /// PDF groups
20 pub PDFGUP: [i32; 2],
21 /// PDF set IDs
22 pub PDFSUP: [i32; 2],
23 /// Event weight specification
24 pub IDWTUP: i32,
25 /// Number of subprocesses
26 pub NPRUP: i32,
27 /// Subprocess cross sections
28 pub XSECUP: Vec<f64>,
29 /// Subprocess cross section errors
30 pub XERRUP: Vec<f64>,
31 /// Subprocess maximum weights
32 pub XMAXUP: Vec<f64>,
33 /// Process IDs
34 pub LPRUP: Vec<i32>,
35 /// Optional run information
36 pub info: String,
37 /// Attributes in `<init>` tag
38 pub attr: XmlAttr,
39}
40
41/// Event information
42///
43/// See <https://arxiv.org/abs/hep-ph/0109068v1> for details on the fields.
44#[allow(non_snake_case)]
45#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
46#[derive(PartialEq, Debug, Clone)]
47pub struct HEPEUP {
48 /// Number of particles
49 pub NUP: i32,
50 /// Process ID
51 pub IDRUP: i32,
52 /// Event weight
53 pub XWGTUP: f64,
54 /// Scale in GeV
55 pub SCALUP: f64,
56 /// Value of the QED coupling α
57 pub AQEDUP: f64,
58 /// Value of the QCD coupling α_s
59 pub AQCDUP: f64,
60 /// Particle IDs
61 pub IDUP: Vec<i32>,
62 /// Particle status
63 pub ISTUP: Vec<i32>,
64 /// Indices of decay mothers
65 pub MOTHUP: Vec<[i32; 2]>,
66 /// Colour flow
67 pub ICOLUP: Vec<[i32; 2]>,
68 /// Particle momentum in GeV
69 pub PUP: Vec<[f64; 5]>,
70 /// Lifetime in mm
71 pub VTIMUP: Vec<f64>,
72 /// Spin angle
73 pub SPINUP: Vec<f64>,
74 /// Optional event information
75 pub info: String,
76 /// Attributes in `<event>` tag
77 pub attr: XmlAttr,
78}
79
80pub type XmlTree = xmltree::Element;