29 using namespace lheh5;
61 throw cms::Exception(
"StreamOpenError") <<
"Empty LHE file string name \"" << std::endl;
71 : h5file(new HighFive::
File(fileNameIn)),
72 indexStatus(h5file->exist(
"/index")),
73 _index(h5file->getGroup(indexStatus ?
"index" :
"event")),
74 _particle(h5file->getGroup(
"particle")),
75 _event(h5file->getGroup(
"event")),
76 _init(h5file->getGroup(
"init")),
77 _procInfo(h5file->getGroup(
"procInfo")) {
82 dspace = H5Dget_space(
h5file->getDataSet(
"index/start").getId());
86 dspace = H5Dget_space(
h5file->getDataSet(
"event/start").getId());
94 throw cms::Exception(
"ReadError") <<
"block size does not match HDF5 file" << std::endl;
100 HighFive::DataSet _npLO =
_procInfo.getDataSet(
"npLO");
102 HighFive::DataSet _npNLO =
_procInfo.getDataSet(
"npNLO");
111 if (maxEventsIn > 0 && firstEventIn > maxEventsIn)
112 throw cms::Exception(
"ConfigurationError") <<
"\" firstEvent > maxEvents \"" << std::endl;
134 std::vector<lheh5::Particle> _vE;
136 return std::vector<lheh5::Particle>();
140 if (checkEvents >= 0 &&
_eventsRead > (
unsigned long int)checkEvents)
151 std::vector<lheh5::Particle> _vE;
155 return std::make_pair(_h, _vE);
160 if (checkEvents >= 0 &&
_eventsRead > (
unsigned long int)checkEvents)
162 return std::make_pair(_h, _vE);
186 if (newFileOpened !=
nullptr)
187 *newFileOpened =
true;
201 curSource->handler->_init.getDataSet(
"beamA").read(beamA);
202 curSource->handler->_init.getDataSet(
"beamB").read(beamB);
203 tmprup.
IDBMUP = std::make_pair(beamA, beamB);
204 double energyA, energyB;
205 curSource->handler->_init.getDataSet(
"energyA").read(energyA);
206 curSource->handler->_init.getDataSet(
"energyB").read(energyB);
207 tmprup.
EBMUP = std::make_pair(energyA, energyB);
208 int PDFsetA, PDFsetB;
209 curSource->handler->_init.getDataSet(
"PDFsetA").read(PDFsetA);
210 curSource->handler->_init.getDataSet(
"PDFsetB").read(PDFsetB);
211 tmprup.
PDFSUP = std::make_pair(PDFsetA, PDFsetB);
212 int PDFgroupA, PDFgroupB;
213 curSource->handler->_init.getDataSet(
"PDFgroupA").read(PDFgroupA);
214 curSource->handler->_init.getDataSet(
"PDFgroupB").read(PDFgroupB);
215 tmprup.
PDFGUP = std::make_pair(PDFgroupA, PDFgroupB);
216 std::vector<int> procId;
217 std::vector<double> xSection;
218 std::vector<double>
error;
219 std::vector<double> unitWeight;
221 curSource->handler->_procInfo.getDataSet(
"procId").read(procId);
222 curSource->handler->_procInfo.getDataSet(
"xSection").read(xSection);
224 curSource->handler->_procInfo.getDataSet(
"unitWeight").read(unitWeight);
226 tmprup.
LPRUP = procId;
229 tmprup.
XMAXUP = unitWeight;
231 size_t numProcesses = procId.size();
232 tmprup.
NPRUP = numProcesses;
234 const HEPRUP heprup(tmprup);
245 std::pair<EventHeader, std::vector<Particle> > evp =
curSource->handler->getEventProperties();
250 return std::shared_ptr<LHEEvent>();
257 for (
auto part : evp.second) {
260 tmp.MOTHUP[ip] = std::make_pair(
part.mother1,
part.mother2);
261 tmp.ICOLUP[ip] = std::make_pair(
part.color1,
part.color2);
262 tmp.VTIMUP[ip] =
part.lifetime;
276 std::shared_ptr<LHEEvent> lheevent;
290 lheevent->setNpLO(npLO);
291 lheevent->setNpNLO(npNLO);
298 return std::shared_ptr<LHEEvent>();