CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
lheh5.h
Go to the documentation of this file.
1 // lheh5.h
2 #ifndef GeneratorInterface_LHEInterface_LHEH5_H
3 #define GeneratorInterface_LHEInterface_LHEH5_H
4 
5 #include <iostream>
6 #include <string>
7 #include <vector>
8 
9 #include <unistd.h>
10 
11 #include "highfive/H5File.hpp"
12 #include "highfive/H5DataSet.hpp"
13 
14 namespace lheh5 {
15 
16  struct Particle {
18  double px, py, pz, e, m, lifetime, spin;
19  // id .. IDUP
20  // color1/2 .. ICOLUP firt/second
21  // mother1/2 .. MOTHUP first/second
22  // status .. ISTUP
23  // px ... m .. PUP[..]
24  // lifetime .. VTIMUP (UP ... user process)
25  // spin .. SPINUP
26  };
27 
28  struct EventHeader {
29  // Event info
30  int nparticles; // corr to NUP
31  int pid; // this is all LHAu-::setProcess
32  double weight;
33  size_t trials;
34  double scale;
35  double rscale;
36  double fscale;
37  double aqed;
38  double aqcd;
39  int npLO;
40  int npNLO;
41  };
42 
43  struct Events {
44  // Lookup
45  std::vector<size_t> _vstart;
46  std::vector<size_t> _vend;
47  // Particles
48  std::vector<int> _vid;
49  std::vector<int> _vstatus;
50  std::vector<int> _vmother1;
51  std::vector<int> _vmother2;
52  std::vector<int> _vcolor1;
53  std::vector<int> _vcolor2;
54  std::vector<double> _vpx;
55  std::vector<double> _vpy;
56  std::vector<double> _vpz;
57  std::vector<double> _ve;
58  std::vector<double> _vm;
59  std::vector<double> _vlifetime;
60  std::vector<double> _vspin;
61  // Event info
62  std::vector<int> _vnparticles;
63  std::vector<int> _vpid;
64  std::vector<double> _vweight;
65  std::vector<size_t> _vtrials;
66  std::vector<double> _vscale;
67  std::vector<double> _vrscale;
68  std::vector<double> _vfscale;
69  std::vector<double> _vaqed;
70  std::vector<double> _vaqcd;
71  std::vector<int> _vnpLO;
72  std::vector<int> _vnpNLO;
74 
75  Particle mkParticle(size_t idx) const;
76  std::vector<Particle> mkEvent(size_t ievent) const;
77  EventHeader mkEventHeader(int ievent) const;
78  };
79 
80  struct Events2 {
81  // Lookup
82  std::vector<size_t> _vstart;
83  // Particles
84  std::vector<int> _vid;
85  std::vector<int> _vstatus;
86  std::vector<int> _vmother1;
87  std::vector<int> _vmother2;
88  std::vector<int> _vcolor1;
89  std::vector<int> _vcolor2;
90  std::vector<double> _vpx;
91  std::vector<double> _vpy;
92  std::vector<double> _vpz;
93  std::vector<double> _ve;
94  std::vector<double> _vm;
95  std::vector<double> _vlifetime;
96  std::vector<double> _vspin;
97  // Event info
98  std::vector<int> _vnparticles;
99  std::vector<int> _vpid;
100  std::vector<double> _vweight;
101  std::vector<size_t> _vtrials;
102  std::vector<double> _vscale;
103  std::vector<double> _vrscale;
104  std::vector<double> _vfscale;
105  std::vector<double> _vaqed;
106  std::vector<double> _vaqcd;
107  int npLO;
108  int npNLO;
110 
111  Particle mkParticle(size_t idx) const;
112  std::vector<Particle> mkEvent(size_t ievent) const;
113  EventHeader mkEventHeader(int ievent) const;
114  };
115 
116  Events readEvents(HighFive::Group& g_index,
117  HighFive::Group& g_particle,
118  HighFive::Group& g_event,
119  size_t first_event,
120  size_t n_events);
122  HighFive::Group& g_particle, HighFive::Group& g_event, size_t first_event, size_t n_events, int npLO, int npNLO);
123  std::ostream& operator<<(std::ostream& os, Particle const& p);
124  std::ostream& operator<<(std::ostream& os, EventHeader const& eh);
125 } // namespace lheh5
126 
127 #endif
std::vector< Particle > mkEvent(size_t ievent) const
Definition: lheh5.cc:213
std::vector< double > _vpx
Definition: lheh5.h:54
double fscale
Definition: lheh5.h:36
double pz
Definition: lheh5.h:18
std::vector< int > _vnparticles
Definition: lheh5.h:98
std::vector< double > _vpy
Definition: lheh5.h:55
EventHeader mkEventHeader(int ievent) const
Definition: lheh5.cc:51
std::vector< size_t > _vtrials
Definition: lheh5.h:101
std::vector< double > _vlifetime
Definition: lheh5.h:59
std::vector< double > _vlifetime
Definition: lheh5.h:95
std::vector< int > _vid
Definition: lheh5.h:84
std::vector< double > _vaqcd
Definition: lheh5.h:106
std::vector< double > _vrscale
Definition: lheh5.h:103
std::vector< double > _vpx
Definition: lheh5.h:90
double lifetime
Definition: lheh5.h:18
double px
Definition: lheh5.h:18
std::vector< double > _vscale
Definition: lheh5.h:102
std::vector< size_t > _vstart
Definition: lheh5.h:45
std::vector< Particle > mkEvent(size_t ievent) const
Definition: lheh5.cc:35
std::vector< int > _vcolor2
Definition: lheh5.h:53
Events readEvents(HighFive::Group &g_index, HighFive::Group &g_particle, HighFive::Group &g_event, size_t first_event, size_t n_events)
Definition: lheh5.cc:68
std::vector< double > _vaqcd
Definition: lheh5.h:70
double scale
Definition: lheh5.h:34
std::vector< size_t > _vstart
Definition: lheh5.h:82
std::vector< int > _vcolor1
Definition: lheh5.h:52
int status
Definition: lheh5.h:17
std::vector< int > _vmother2
Definition: lheh5.h:51
double weight
Definition: lheh5.h:32
size_t _particle_offset
Definition: lheh5.h:109
double aqed
Definition: lheh5.h:37
std::vector< double > _vm
Definition: lheh5.h:58
std::vector< double > _vweight
Definition: lheh5.h:64
std::vector< double > _vaqed
Definition: lheh5.h:69
std::vector< size_t > _vend
Definition: lheh5.h:46
EventHeader mkEventHeader(int ievent) const
Definition: lheh5.cc:231
std::vector< int > _vnpNLO
Definition: lheh5.h:72
std::vector< double > _vpz
Definition: lheh5.h:56
std::vector< double > _vspin
Definition: lheh5.h:96
std::vector< double > _vm
Definition: lheh5.h:94
std::vector< double > _vspin
Definition: lheh5.h:60
std::vector< int > _vstatus
Definition: lheh5.h:49
std::vector< double > _vpy
Definition: lheh5.h:91
std::vector< int > _vnpLO
Definition: lheh5.h:71
int mother2
Definition: lheh5.h:17
std::vector< int > _vnparticles
Definition: lheh5.h:62
std::vector< int > _vstatus
Definition: lheh5.h:85
double m
Definition: lheh5.h:18
std::vector< int > _vmother2
Definition: lheh5.h:87
std::vector< double > _vfscale
Definition: lheh5.h:104
size_t _particle_offset
Definition: lheh5.h:73
std::vector< double > _ve
Definition: lheh5.h:57
std::vector< int > _vid
Definition: lheh5.h:48
std::vector< int > _vpid
Definition: lheh5.h:63
double rscale
Definition: lheh5.h:35
std::vector< double > _vaqed
Definition: lheh5.h:105
size_t trials
Definition: lheh5.h:33
int color2
Definition: lheh5.h:17
std::vector< size_t > _vtrials
Definition: lheh5.h:65
std::vector< double > _vpz
Definition: lheh5.h:92
std::ostream & operator<<(std::ostream &os, Particle const &p)
Definition: lheh5.cc:5
std::vector< double > _vfscale
Definition: lheh5.h:68
Particle mkParticle(size_t idx) const
Definition: lheh5.cc:19
std::vector< double > _ve
Definition: lheh5.h:93
std::vector< double > _vrscale
Definition: lheh5.h:67
std::vector< int > _vcolor2
Definition: lheh5.h:89
double py
Definition: lheh5.h:18
Particle mkParticle(size_t idx) const
Definition: lheh5.cc:197
int color1
Definition: lheh5.h:17
int mother1
Definition: lheh5.h:17
double e
Definition: lheh5.h:18
double spin
Definition: lheh5.h:18
double aqcd
Definition: lheh5.h:38
std::vector< double > _vscale
Definition: lheh5.h:66
std::vector< int > _vmother1
Definition: lheh5.h:86
std::vector< int > _vcolor1
Definition: lheh5.h:88
std::vector< int > _vpid
Definition: lheh5.h:99
std::vector< int > _vmother1
Definition: lheh5.h:50
std::vector< double > _vweight
Definition: lheh5.h:100