Skip to content

Commit

Permalink
changes to HDF5 reader for compatibility with HighFive master
Browse files Browse the repository at this point in the history
  • Loading branch information
smrenna committed Jul 28, 2020
1 parent d51dfac commit 15984d4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
7 changes: 4 additions & 3 deletions GeneratorInterface/LHEInterface/interface/LH5Reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ namespace lhef {
H5Handler(const std::string &fileNameIn);
virtual ~H5Handler() {}
void readBlock();
void init(int, int);
int npLO, npNLO;
void counter(int, int);
std::unique_ptr<HighFive::File> h5file;
bool indexStatus;
HighFive::Group _index, _particle, _event, _init, _procInfo;
int npLO, npNLO;
unsigned int long _eventsRead;
lheh5::Events2 _events2;
lheh5::Events _events1;
Expand All @@ -29,7 +31,6 @@ namespace lhef {
std::pair<lheh5::EventHeader, std::vector<lheh5::Particle> > getEventProperties();

private:
std::unique_ptr<HighFive::File> h5file;
unsigned int long _eventsTotal;
int _eventsInBlock;
int _formatType;
Expand Down
18 changes: 9 additions & 9 deletions GeneratorInterface/LHEInterface/src/LH5Reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,15 @@ namespace lhef {
~StringSource() override {}
};

H5Handler::H5Handler(const std::string &fileNameIn)
: h5file(new HighFive::File(fileNameIn)),
indexStatus(h5file->exist("/index")),
_index(h5file->getGroup(indexStatus ? "index" : "event")),
_particle(h5file->getGroup("particle")),
_event(h5file->getGroup("event")),
_init(h5file->getGroup("init")),
_procInfo(h5file->getGroup("procInfo")) {
H5Handler::H5Handler(const std::string &fileNameIn) :
h5file( new HighFive::File(fileNameIn) ),
indexStatus( h5file->exist("/index") ),
_index( h5file->getGroup( indexStatus ? "index" : "event") ),
_particle( h5file->getGroup("particle") ),
_event( h5file->getGroup("event") ),
_init( h5file->getGroup("init") ),
_procInfo( h5file->getGroup("procInfo") )
{
hid_t dspace;
_formatType = 1;

Expand All @@ -81,7 +82,6 @@ namespace lhef {
_formatType = 2;
} else {
_index = h5file->getGroup("event");
dspace = H5Dget_space(h5file->getDataSet("event/start").getId());
_formatType = 1;
}

Expand Down

0 comments on commit 15984d4

Please sign in to comment.