CMS 3D CMS Logo

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
lheh5::Events2::npNLO
int npNLO
Definition: lheh5.h:108
lheh5::Events::_vstatus
std::vector< int > _vstatus
Definition: lheh5.h:49
lheh5
Definition: lheh5.h:14
lheh5::Events2::_vtrials
std::vector< size_t > _vtrials
Definition: lheh5.h:101
lheh5::Events2::_vcolor1
std::vector< int > _vcolor1
Definition: lheh5.h:88
lheh5::Events::_vnpLO
std::vector< int > _vnpLO
Definition: lheh5.h:71
lheh5::Events::_ve
std::vector< double > _ve
Definition: lheh5.h:57
lheh5::Events::_vnparticles
std::vector< int > _vnparticles
Definition: lheh5.h:62
lheh5::Events::_vpid
std::vector< int > _vpid
Definition: lheh5.h:63
lheh5::Events2::_vpx
std::vector< double > _vpx
Definition: lheh5.h:90
lheh5::Events2::_vnparticles
std::vector< int > _vnparticles
Definition: lheh5.h:98
lheh5::Events::mkEventHeader
EventHeader mkEventHeader(int ievent) const
Definition: lheh5.cc:51
lheh5::Events::_particle_offset
size_t _particle_offset
Definition: lheh5.h:73
lheh5::Events2::_vaqcd
std::vector< double > _vaqcd
Definition: lheh5.h:106
lheh5::Events2::_vid
std::vector< int > _vid
Definition: lheh5.h:84
lheh5::Events2::_vweight
std::vector< double > _vweight
Definition: lheh5.h:100
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
lheh5::Events::_vtrials
std::vector< size_t > _vtrials
Definition: lheh5.h:65
lheh5::Particle::color2
int color2
Definition: lheh5.h:17
lheh5::Events::_vid
std::vector< int > _vid
Definition: lheh5.h:48
lheh5::Events2::_particle_offset
size_t _particle_offset
Definition: lheh5.h:109
lheh5::Events::_vfscale
std::vector< double > _vfscale
Definition: lheh5.h:68
lheh5::Events::mkEvent
std::vector< Particle > mkEvent(size_t ievent) const
Definition: lheh5.cc:35
lheh5::Events2::_vlifetime
std::vector< double > _vlifetime
Definition: lheh5.h:95
lheh5::EventHeader::weight
double weight
Definition: lheh5.h:32
lheh5::Particle::lifetime
double lifetime
Definition: lheh5.h:18
lheh5::Events2::_vm
std::vector< double > _vm
Definition: lheh5.h:94
lheh5::Events2::mkParticle
Particle mkParticle(size_t idx) const
Definition: lheh5.cc:197
lheh5::Events2::_vscale
std::vector< double > _vscale
Definition: lheh5.h:102
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
lheh5::Events::_vscale
std::vector< double > _vscale
Definition: lheh5.h:66
EcalDumpRaw_cfi.first_event
first_event
Definition: EcalDumpRaw_cfi.py:25
lheh5::Events2
Definition: lheh5.h:80
lheh5::Events2::_vpy
std::vector< double > _vpy
Definition: lheh5.h:91
lheh5::Events::_vrscale
std::vector< double > _vrscale
Definition: lheh5.h:67
lheh5::Events::_vmother1
std::vector< int > _vmother1
Definition: lheh5.h:50
lheh5::Events2::_vspin
std::vector< double > _vspin
Definition: lheh5.h:96
lheh5::EventHeader::npLO
int npLO
Definition: lheh5.h:39
lheh5::Particle::e
double e
Definition: lheh5.h:18
lheh5::Events2::_vstart
std::vector< size_t > _vstart
Definition: lheh5.h:82
lheh5::EventHeader
Definition: lheh5.h:28
lheh5::EventHeader::npNLO
int npNLO
Definition: lheh5.h:40
lheh5::Particle::m
double m
Definition: lheh5.h:18
lheh5::Events::_vpx
std::vector< double > _vpx
Definition: lheh5.h:54
lheh5::Events2::npLO
int npLO
Definition: lheh5.h:107
lheh5::Particle::pz
double pz
Definition: lheh5.h:18
lheh5::Particle::id
int id
Definition: lheh5.h:17
lheh5::Events2::_vstatus
std::vector< int > _vstatus
Definition: lheh5.h:85
lheh5::Particle::spin
double spin
Definition: lheh5.h:18
lheh5::Events::mkParticle
Particle mkParticle(size_t idx) const
Definition: lheh5.cc:19
lheh5::Events::_vpy
std::vector< double > _vpy
Definition: lheh5.h:55
lheh5::Events::_vstart
std::vector< size_t > _vstart
Definition: lheh5.h:45
lheh5::EventHeader::trials
size_t trials
Definition: lheh5.h:33
lheh5::Events2::_vmother2
std::vector< int > _vmother2
Definition: lheh5.h:87
lheh5::Events2::_ve
std::vector< double > _ve
Definition: lheh5.h:93
lheh5::Events::_vcolor2
std::vector< int > _vcolor2
Definition: lheh5.h:53
lheh5::Events::_vaqcd
std::vector< double > _vaqcd
Definition: lheh5.h:70
lheh5::Events2::mkEventHeader
EventHeader mkEventHeader(int ievent) const
Definition: lheh5.cc:231
lheh5::Events2::_vfscale
std::vector< double > _vfscale
Definition: lheh5.h:104
lheh5::Events::_vlifetime
std::vector< double > _vlifetime
Definition: lheh5.h:59
lheh5::operator<<
std::ostream & operator<<(std::ostream &os, Particle const &p)
Definition: lheh5.cc:5
lheh5::Particle::mother1
int mother1
Definition: lheh5.h:17
lheh5::Particle::px
double px
Definition: lheh5.h:18
lheh5::EventHeader::pid
int pid
Definition: lheh5.h:31
lheh5::readEvents
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
lheh5::Events2::_vmother1
std::vector< int > _vmother1
Definition: lheh5.h:86
lheh5::Particle::py
double py
Definition: lheh5.h:18
lheh5::Events::_vmother2
std::vector< int > _vmother2
Definition: lheh5.h:51
lheh5::EventHeader::nparticles
int nparticles
Definition: lheh5.h:30
lheh5::Events
Definition: lheh5.h:43
lheh5::Particle::mother2
int mother2
Definition: lheh5.h:17
lheh5::Events::_vcolor1
std::vector< int > _vcolor1
Definition: lheh5.h:52
lheh5::Events::_vaqed
std::vector< double > _vaqed
Definition: lheh5.h:69
lheh5::Events2::_vaqed
std::vector< double > _vaqed
Definition: lheh5.h:105
lheh5::Events::_vend
std::vector< size_t > _vend
Definition: lheh5.h:46
Particle
Definition: Particle.py:1
lheh5::Events2::_vcolor2
std::vector< int > _vcolor2
Definition: lheh5.h:89
lheh5::Events2::_vpid
std::vector< int > _vpid
Definition: lheh5.h:99
lheh5::Events::_vnpNLO
std::vector< int > _vnpNLO
Definition: lheh5.h:72
lheh5::EventHeader::aqed
double aqed
Definition: lheh5.h:37
lheh5::EventHeader::scale
double scale
Definition: lheh5.h:34
lheh5::Events2::_vpz
std::vector< double > _vpz
Definition: lheh5.h:92
lheh5::Events::_vm
std::vector< double > _vm
Definition: lheh5.h:58
lheh5::Events::_vspin
std::vector< double > _vspin
Definition: lheh5.h:60
lheh5::Events::_vweight
std::vector< double > _vweight
Definition: lheh5.h:64
lheh5::Particle::status
int status
Definition: lheh5.h:17
lheh5::Events::_vpz
std::vector< double > _vpz
Definition: lheh5.h:56
lheh5::EventHeader::aqcd
double aqcd
Definition: lheh5.h:38
lheh5::EventHeader::fscale
double fscale
Definition: lheh5.h:36
lheh5::EventHeader::rscale
double rscale
Definition: lheh5.h:35
lheh5::Events2::mkEvent
std::vector< Particle > mkEvent(size_t ievent) const
Definition: lheh5.cc:213
lheh5::Events2::_vrscale
std::vector< double > _vrscale
Definition: lheh5.h:103
lheh5::Particle::color1
int color1
Definition: lheh5.h:17