CMS 3D CMS Logo

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
lhef::LH5Reader::maxEvents
int maxEvents
Definition: LH5Reader.h:57
lhef::H5Handler::_formatType
int _formatType
Definition: LH5Reader.h:36
lhef::LH5Reader::curIndex
unsigned int curIndex
Definition: LH5Reader.h:58
CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
lhef::LH5Reader::Source
Definition: LH5Reader.cc:34
lhef::H5Handler::readBlock
void readBlock()
Definition: LH5Reader.cc:121
lhef::H5Handler::_particle
HighFive::Group _particle
Definition: LH5Reader.h:24
lhef::H5Handler::_index
HighFive::Group _index
Definition: LH5Reader.h:24
lhef::H5Handler::_events2
lheh5::Events2 _events2
Definition: LH5Reader.h:27
lhef::H5Handler::H5Handler
H5Handler(const std::string &fileNameIn)
Definition: LH5Reader.cc:68
lhef::LH5Reader::LH5Reader
LH5Reader(const edm::ParameterSet &params)
Definition: LH5Reader.cc:163
particlelevel_cff.LHERunInfo
LHERunInfo
Definition: particlelevel_cff.py:56
lhef::H5Handler::getEventProperties
std::pair< lheh5::EventHeader, std::vector< lheh5::Particle > > getEventProperties()
Definition: LH5Reader.cc:148
lheh5.h
lhef::H5Handler::indexStatus
bool indexStatus
Definition: LH5Reader.h:23
lhef::H5Handler::npLO
int npLO
Definition: LH5Reader.h:25
lheh5::Events2
Definition: lheh5.h:80
optionsL1T.skip
skip
Definition: optionsL1T.py:30
lhef::LH5Reader::curSource
std::unique_ptr< Source > curSource
Definition: LH5Reader.h:61
lhef::LH5Reader::curRunInfo
std::shared_ptr< LHERunInfo > curRunInfo
Definition: LH5Reader.h:63
lheh5::EventHeader
Definition: lheh5.h:28
lhef::H5Handler::h5file
std::unique_ptr< HighFive::File > h5file
Definition: LH5Reader.h:22
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
lhef::LH5Reader::next
std::shared_ptr< LHEEvent > next(bool *newFileOpened=nullptr)
Definition: LH5Reader.cc:177
edm::ParameterSet
Definition: ParameterSet.h:47
lhef::LH5Reader::curDoc
bool curDoc
Definition: LH5Reader.h:62
lhef::H5Handler::_eventsInBlock
int _eventsInBlock
Definition: LH5Reader.h:35
lhef::H5Handler::_procInfo
HighFive::Group _procInfo
Definition: LH5Reader.h:24
lhef::H5Handler::_events1
lheh5::Events _events1
Definition: LH5Reader.h:28
lhef::LH5Reader::fileURLs
const std::vector< std::string > fileURLs
Definition: LH5Reader.h:52
lhef
Definition: ExhumeHadronizer.h:12
lhef::LH5Reader::FileSource
Definition: LH5Reader.cc:43
lhef::H5Handler
Definition: LH5Reader.h:16
PixelMapPlotter.inputs
inputs
Definition: PixelMapPlotter.py:490
lhef::H5Handler::getHeader
lheh5::EventHeader getHeader()
Definition: LH5Reader.cc:143
lhef::LH5Reader
Definition: LH5Reader.h:40
lhef::H5Handler::_event
HighFive::Group _event
Definition: LH5Reader.h:24
lhef::H5Handler::_blocksRead
int _blocksRead
Definition: LH5Reader.h:37
lhef::H5Handler::_eventsRead
unsigned int long _eventsRead
Definition: LH5Reader.h:26
lhef::H5Handler::~H5Handler
virtual ~H5Handler()
Definition: LH5Reader.h:19
lheh5::Events
Definition: lheh5.h:43
lhef::LH5Reader::weightsinconfig
std::vector< std::string > weightsinconfig
Definition: LH5Reader.h:59
lhef::H5Handler::getEvent
std::vector< lheh5::Particle > getEvent()
Definition: LH5Reader.cc:131
lhef::LH5Reader::StringSource
Definition: LH5Reader.cc:55
lhef::H5Handler::counter
void counter(int, int)
Definition: LH5Reader.cc:108
lhef::H5Handler::_init
HighFive::Group _init
Definition: LH5Reader.h:24
LaserTracksInput_cfi.fileNames
fileNames
Definition: LaserTracksInput_cfi.py:8
lhef::LH5Reader::firstEvent
unsigned int firstEvent
Definition: LH5Reader.h:56
lhef::LH5Reader::strName
const std::string strName
Definition: LH5Reader.h:55
ParameterSet.h
lhef::H5Handler::npNLO
int npNLO
Definition: LH5Reader.h:25
lhef::H5Handler::_eventsTotal
unsigned int long _eventsTotal
Definition: LH5Reader.h:34
lhef::LH5Reader::~LH5Reader
~LH5Reader()
Definition: LH5Reader.cc:175