CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
LH5Reader.h
Go to the documentation of this file.
1 #ifndef GeneratorInterface_LHEInterface_LH5Reader_h
2 #define GeneratorInterface_LHEInterface_LH5Reader_h
3 
4 #include <string>
5 #include <vector>
6 #include <memory>
7 
10 
11 namespace lhef {
12 
13  class LHERunInfo;
14  class LHEEvent;
15 
16  class H5Handler {
17  public:
18  H5Handler(const std::string &fileNameIn);
19  virtual ~H5Handler() {}
20  void readBlock();
21  void counter(int, int);
22  std::unique_ptr<HighFive::File> h5file;
24  HighFive::Group _index, _particle, _event, _init, _procInfo;
25  int npLO, npNLO;
26  unsigned int long _eventsRead;
29  std::vector<lheh5::Particle> getEvent();
31  std::pair<lheh5::EventHeader, std::vector<lheh5::Particle> > getEventProperties();
32 
33  private:
34  unsigned int long _eventsTotal;
38  };
39 
40  class LH5Reader {
41  public:
43  LH5Reader(const std::vector<std::string> &fileNames, unsigned int skip = 0, int maxEvents = -1);
44  LH5Reader(const std::string &inputs, unsigned int skip = 0, int maxEvents = -1);
45  ~LH5Reader();
46 
47  std::shared_ptr<LHEEvent> next(bool *newFileOpened = nullptr);
48 
49  private:
50  class Source;
51  class FileSource;
52  class StringSource;
53 
54  const std::vector<std::string> fileURLs;
56  unsigned int firstEvent;
57  int maxEvents;
58  unsigned int curIndex;
59  std::vector<std::string> weightsinconfig;
60 
61  std::unique_ptr<Source> curSource;
62  bool curDoc;
63  std::shared_ptr<LHERunInfo> curRunInfo;
64  };
65 
66 } // namespace lhef
67 
68 #endif // GeneratorInterface_LHEInterface_LH5Reader_h
unsigned int long _eventsTotal
Definition: LH5Reader.h:34
LH5Reader(const edm::ParameterSet &params)
Definition: LH5Reader.cc:165
HighFive::Group _particle
Definition: LH5Reader.h:24
std::unique_ptr< Source > curSource
Definition: LH5Reader.h:61
unsigned int firstEvent
Definition: LH5Reader.h:56
lheh5::Events2 _events2
Definition: LH5Reader.h:27
std::vector< lheh5::Particle > getEvent()
Definition: LH5Reader.cc:133
int _eventsInBlock
Definition: LH5Reader.h:35
bool indexStatus
Definition: LH5Reader.h:23
void counter(int, int)
Definition: LH5Reader.cc:110
HighFive::Group _init
Definition: LH5Reader.h:24
virtual ~H5Handler()
Definition: LH5Reader.h:19
std::shared_ptr< LHEEvent > next(bool *newFileOpened=nullptr)
Definition: LH5Reader.cc:179
lheh5::EventHeader getHeader()
Definition: LH5Reader.cc:145
unsigned int curIndex
Definition: LH5Reader.h:58
std::vector< std::string > weightsinconfig
Definition: LH5Reader.h:59
std::pair< lheh5::EventHeader, std::vector< lheh5::Particle > > getEventProperties()
Definition: LH5Reader.cc:150
HighFive::Group _procInfo
Definition: LH5Reader.h:24
const std::string strName
Definition: LH5Reader.h:55
HighFive::Group _event
Definition: LH5Reader.h:24
HighFive::Group _index
Definition: LH5Reader.h:24
std::unique_ptr< HighFive::File > h5file
Definition: LH5Reader.h:22
unsigned int long _eventsRead
Definition: LH5Reader.h:26
void readBlock()
Definition: LH5Reader.cc:123
H5Handler(const std::string &fileNameIn)
Definition: LH5Reader.cc:70
lheh5::Events _events1
Definition: LH5Reader.h:28
std::shared_ptr< LHERunInfo > curRunInfo
Definition: LH5Reader.h:63
tuple fileNames
Definition: LaserDQM_cfg.py:34
const std::vector< std::string > fileURLs
Definition: LH5Reader.h:52