CMS 3D CMS Logo

LHEReader.cc
Go to the documentation of this file.
1 #include <algorithm>
2 #include <iomanip>
3 #include <iostream>
4 #include <memory>
5 
6 #include <cstdio>
7 #include <cstring>
8 #include <fstream>
9 #include <sstream>
10 #include <string>
11 #include <vector>
12 
13 #include <xercesc/sax2/Attributes.hpp>
14 #include <xercesc/dom/DOM.hpp>
15 
20 
24 
28 
29 #include "XMLUtils.h"
30 
32 
33 namespace lhef {
34 
35  static void logFileAction(char const *msg, std::string const &fileName) {
36  edm::LogAbsolute("fileAction") << std::setprecision(0) << edm::TimeOfDay() << msg << fileName;
38  }
39 
41  public:
42  Source() {}
43  virtual ~Source() {}
45  };
46 
48  public:
49  FileSource(const std::string &fileURL) {
50  auto storage = StorageFactory::get()->open(fileURL, IOFlags::OpenRead);
51 
52  if (!storage)
53  throw cms::Exception("FileOpenError")
54  << "Could not open LHE file \"" << fileURL << "\" for reading" << std::endl;
55 
56  fileStream = std::make_unique<StorageWrap>(std::move(storage));
57  }
58 
59  ~FileSource() override {}
60 
62 
63  private:
64  std::unique_ptr<StorageWrap> fileStream;
65  };
66 
68  public:
70  if (inputs.empty())
71  throw cms::Exception("StreamOpenError") << "Empty LHE file string name \"" << std::endl;
72 
73  std::stringstream *tmpis = new std::stringstream(inputs);
74  fileStream.reset(tmpis);
75  }
76 
77  ~StringSource() override {}
78 
80 
81  private:
82  std::unique_ptr<std::istream> fileStream;
83  };
84 
86  public:
87  typedef std::vector<std::pair<std::string, std::string> > wgt_info;
89  : impl(nullptr),
91  mode(kNone),
92  xmlHeader(nullptr),
93  xmlEvent(nullptr),
94  headerOk(false),
95  npLO(-99),
96  npNLO(-99) {}
97  ~XMLHandler() override {
98  if (xmlHeader)
99  xmlHeader->release();
100  if (xmlEvent)
101  xmlEvent->release();
102  }
103 
105 
106  void reset() {
107  headerOk = false;
108  weightsinevent.clear();
109  gotObject = kNone;
110  mode = kNone;
111  }
112 
113  const wgt_info &weightInfo() const { return weightsinevent; }
114 
115  protected:
116  void startElement(const XMLCh *const uri,
117  const XMLCh *const localname,
118  const XMLCh *const qname,
119  const Attributes &attributes) override;
120 
121  void endElement(const XMLCh *const uri, const XMLCh *const localname, const XMLCh *const qname) override;
122 
123  void characters(const XMLCh *const chars, const XMLSize_t length) override;
124  void comment(const XMLCh *const chars, const XMLSize_t length) override;
125 
126  private:
127  friend class LHEReader;
128 
129  bool skipEvent = false;
130  std::unique_ptr<DOMImplementation> impl;
134  DOMDocument *xmlHeader;
135  DOMDocument *xmlEvent;
136  std::vector<DOMElement *> xmlNodes, xmlEventNodes;
137  bool headerOk;
138  std::vector<LHERunInfo::Header> headers;
140  int npLO;
141  int npNLO;
142  std::vector<float> scales;
143  };
144 
145  static void attributesToDom(DOMElement *dom, const Attributes &attributes) {
146  for (unsigned int i = 0; i < attributes.getLength(); i++) {
147  const XMLCh *name = attributes.getQName(i);
148  const XMLCh *value = attributes.getValue(i);
149 
150  dom->setAttribute(name, value);
151  }
152  }
153 
154  static void fillHeader(LHERunInfo::Header &header, const char *data, int len = -1) {
155  const char *end = len >= 0 ? (data + len) : nullptr;
156  while (*data && (!end || data < end)) {
157  std::size_t len = std::strcspn(data, "\r\n");
158  if (end && data + len > end)
159  len = end - data;
160  if (data[len] == '\r' && data[len + 1] == '\n')
161  len += 2;
162  else if (data[len])
163  len++;
164  header.addLine(std::string(data, len));
165  data += len;
166  }
167  }
168 
169  void LHEReader::XMLHandler::startElement(const XMLCh *const uri,
170  const XMLCh *const localname,
171  const XMLCh *const qname,
172  const Attributes &attributes) {
173  std::string name((const char *)XMLSimpleStr(qname));
174 
175  if (!headerOk) {
176  if (name != "LesHouchesEvents")
177  throw cms::Exception("InvalidFormat") << "LHE file has invalid header" << std::endl;
178  headerOk = true;
179  return;
180  }
181 
182  if (mode == kHeader) {
183  DOMElement *elem = xmlHeader->createElement(qname);
184  attributesToDom(elem, attributes);
185  xmlNodes.back()->appendChild(elem);
186  xmlNodes.push_back(elem);
187  return;
188  } else if (mode == kEvent) {
189  if (skipEvent) {
190  return;
191  }
192 
193  DOMElement *elem = xmlEvent->createElement(qname);
194  attributesToDom(elem, attributes);
195 
196  //TODO this is a hack (even more than the rest of this class)
197  if (name == "rwgt") {
198  xmlEventNodes[0]->appendChild(elem);
199  } else if (name == "wgt") {
200  xmlEventNodes[1]->appendChild(elem);
201  } else if (name == "scales") {
202  for (XMLSize_t iscale = 0; iscale < attributes.getLength(); ++iscale) {
203  int ipart = 0;
204  const char *scalename = XMLSimpleStr(attributes.getQName(iscale));
205  int nmatch = sscanf(scalename, "pt_clust_%d", &ipart);
206 
207  if (nmatch != 1) {
208  edm::LogError("Generator|LHEInterface") << "invalid attribute in <scales> tag" << std::endl;
209  }
210 
211  float scaleval;
212  const char *scalevalstr = XMLSimpleStr(attributes.getValue(iscale));
213  sscanf(scalevalstr, "%e", &scaleval);
214 
215  scales.push_back(scaleval);
216  }
217  }
218  xmlEventNodes.push_back(elem);
219  return;
220  } else if (mode == kInit) {
221  //skip unknown tags in init block as well
222  return;
223  } else if (mode != kNone) {
224  throw cms::Exception("InvalidFormat") << "LHE file has invalid format" << std::endl;
225  }
226 
227  if (name == "header") {
228  if (!impl)
229  impl.reset(DOMImplementationRegistry::getDOMImplementation(XMLUniStr("Core")));
230 
231  xmlHeader = impl->createDocument(nullptr, qname, nullptr);
232  xmlNodes.resize(1);
233  xmlNodes[0] = xmlHeader->getDocumentElement();
234  mode = kHeader;
235  }
236  if (name == "init") {
237  mode = kInit;
238  } else if (name == "event") {
239  if (!skipEvent) {
240  if (!impl)
241  impl.reset(DOMImplementationRegistry::getDOMImplementation(XMLUniStr("Core")));
242 
243  if (xmlEvent)
244  xmlEvent->release();
245  xmlEvent = impl->createDocument(nullptr, qname, nullptr);
246  weightsinevent.resize(0);
247  scales.clear();
248 
249  npLO = -99;
250  npNLO = -99;
251  const XMLCh *npLOval = attributes.getValue(XMLString::transcode("npLO"));
252  if (npLOval) {
253  const char *npLOs = XMLSimpleStr(npLOval);
254  sscanf(npLOs, "%d", &npLO);
255  }
256  const XMLCh *npNLOval = attributes.getValue(XMLString::transcode("npNLO"));
257  if (npNLOval) {
258  const char *npNLOs = XMLSimpleStr(npNLOval);
259  sscanf(npNLOs, "%d", &npNLO);
260  }
261 
262  xmlEventNodes.resize(1);
263  xmlEventNodes[0] = xmlEvent->getDocumentElement();
264  }
265  mode = kEvent;
266  }
267 
268  if (mode == kNone)
269  throw cms::Exception("InvalidFormat") << "LHE file has invalid format" << std::endl;
270 
271  buffer.clear();
272  }
273 
274  void LHEReader::XMLHandler::endElement(const XMLCh *const uri,
275  const XMLCh *const localname,
276  const XMLCh *const qname) {
277  std::string name((const char *)XMLSimpleStr(qname));
278 
279  if (mode) {
280  if (mode == kHeader && xmlNodes.size() > 1) {
281  xmlNodes.resize(xmlNodes.size() - 1);
282  return;
283  } else if (mode == kHeader) {
284  std::unique_ptr<DOMLSSerializer> writer(impl->createLSSerializer());
285  std::unique_ptr<DOMLSOutput> outputDesc(impl->createLSOutput());
286  assert(outputDesc.get());
287  outputDesc->setEncoding(XMLUniStr("UTF-8"));
288 
289  for (DOMNode *node = xmlNodes[0]->getFirstChild(); node; node = node->getNextSibling()) {
290  XMLSimpleStr buffer(writer->writeToString(node));
291 
293  const char *p, *q;
294  DOMElement *elem;
295 
296  switch (node->getNodeType()) {
297  case DOMNode::ELEMENT_NODE:
298  elem = static_cast<DOMElement *>(node);
299  type = (const char *)XMLSimpleStr(elem->getTagName());
300  p = std::strchr((const char *)buffer, '>') + 1;
301  q = std::strrchr(p, '<');
302  break;
303  case DOMNode::COMMENT_NODE:
304  type = "";
305  p = buffer + 4;
306  q = buffer + strlen(buffer) - 3;
307  break;
308  default:
309  type = "<>";
310  p = buffer + std::strspn(buffer, " \t\r\n");
311  if (!*p)
312  continue;
313  q = p + strlen(p);
314  }
316  fillHeader(header, p, q - p);
317  headers.push_back(header);
318  }
319 
320  xmlHeader->release();
321  xmlHeader = nullptr;
322  } else if (name == "event" && mode == kEvent &&
323  (skipEvent || (!xmlEventNodes.empty()))) { // handling of weights in LHE file
324 
325  if (skipEvent) {
326  gotObject = mode;
327  mode = kNone;
328  return;
329  }
330 
331  for (DOMNode *node = xmlEventNodes[0]->getFirstChild(); node; node = node->getNextSibling()) {
332  switch (node->getNodeType()) {
333  case DOMNode::ELEMENT_NODE: // rwgt
334  for (DOMNode *rwgt = xmlEventNodes[1]->getFirstChild(); rwgt; rwgt = rwgt->getNextSibling()) {
335  DOMNode *attr = rwgt->getAttributes()->item(0);
336  XMLSimpleStr atname(attr->getNodeValue());
337  XMLSimpleStr weight(rwgt->getFirstChild()->getNodeValue());
338  switch (rwgt->getNodeType()) {
339  case DOMNode::ELEMENT_NODE:
340  weightsinevent.push_back(std::make_pair((const char *)atname, (const char *)weight));
341  break;
342  default:
343  break;
344  }
345  }
346  break;
347  case DOMNode::TEXT_NODE: // event information
348  {
349  XMLSimpleStr data(node->getNodeValue());
350  buffer.append(data);
351  } break;
352  default:
353  break;
354  }
355  }
356  } else if (mode == kEvent) {
357  //skip unknown tags
358  return;
359  }
360 
361  if (gotObject != kNone)
362  throw cms::Exception("InvalidState") << "Unexpected pileup in"
363  " LHEReader::XMLHandler::endElement"
364  << std::endl;
365 
366  gotObject = mode;
367  mode = kNone;
368  }
369  }
370 
371  void LHEReader::XMLHandler::characters(const XMLCh *const data_, const XMLSize_t length) {
372  if (mode == kHeader) {
373  DOMText *text = xmlHeader->createTextNode(data_);
374  xmlNodes.back()->appendChild(text);
375  return;
376  }
377 
378  if (XMLSimpleStr::isAllSpaces(data_, length))
379  return;
380 
381  unsigned int offset = 0;
382  while (offset < length && XMLSimpleStr::isSpace(data_[offset]))
383  offset++;
384 
385  if (mode == kEvent) {
386  if (!skipEvent) {
387  DOMText *text = xmlEvent->createTextNode(data_ + offset);
388  xmlEventNodes.back()->appendChild(text);
389  }
390  return;
391  }
392 
393  if (mode == kNone)
394  throw cms::Exception("InvalidFormat") << "LHE file has invalid format" << std::endl;
395 
396  XMLSimpleStr data(data_ + offset);
397  buffer.append(data);
398  }
399 
400  void LHEReader::XMLHandler::comment(const XMLCh *const data_, const XMLSize_t length) {
401  if (mode == kHeader) {
402  DOMComment *comment = xmlHeader->createComment(data_);
403  xmlNodes.back()->appendChild(comment);
404  return;
405  }
406 
407  XMLSimpleStr data(data_);
408 
411  headers.push_back(header);
412  }
413 
415  : fileURLs(params.getUntrackedParameter<std::vector<std::string> >("fileNames")),
416  strName(""),
417  firstEvent(params.getUntrackedParameter<unsigned int>("skipEvents", 0)),
418  maxEvents(params.getUntrackedParameter<int>("limitEvents", -1)),
419  curIndex(0),
420  handler(new XMLHandler()) {}
421 
422  LHEReader::LHEReader(const std::vector<std::string> &fileNames, unsigned int firstEvent)
423  : fileURLs(fileNames),
424  strName(""),
426  maxEvents(-1),
427  curIndex(0),
428  handler(new XMLHandler()) {}
429 
431  : strName(inputs), firstEvent(firstEvent), maxEvents(-1), curIndex(0), handler(new XMLHandler()) {}
432 
434  // Explicitly release "orphaned" resources
435  // that were created through DOM implementation
436  // createXXXX factory method *before* last
437  // XMLPlatformUtils::Terminate is called.
438  handler.release();
439  curDoc.release();
440  curSource.release();
441  }
442 
443  std::shared_ptr<LHEEvent> LHEReader::next(bool *newFileOpened) {
444  while (curDoc.get() || curIndex < fileURLs.size() || (fileURLs.empty() && !strName.empty())) {
445  if (!curDoc.get()) {
446  if (!platform) {
447  //If we read multiple files, the XercesPlatform must live longer than any one
448  // XMLDocument.
450  }
451  if (!fileURLs.empty()) {
452  logFileAction(" Initiating request to open LHE file ", fileURLs[curIndex]);
453  curSource = std::make_unique<FileSource>(fileURLs[curIndex]);
454  logFileAction(" Successfully opened LHE file ", fileURLs[curIndex]);
455  if (newFileOpened != nullptr)
456  *newFileOpened = true;
457  ++curIndex;
458  } else if (!strName.empty()) {
459  curSource = std::make_unique<StringSource>(strName);
460  }
461  handler->reset();
462  curDoc.reset(curSource->createReader(*handler));
463  curRunInfo.reset();
464  }
465  handler->skipEvent = firstEvent > 0;
466 
467  XMLHandler::Object event = handler->gotObject;
468  handler->gotObject = XMLHandler::kNone;
469 
470  switch (event) {
471  case XMLHandler::kNone:
472  if (!curDoc->parse()) {
473  curDoc.reset();
474  logFileAction(" Closed LHE file ", fileURLs[curIndex - 1]);
475  return std::shared_ptr<LHEEvent>();
476  }
477  break;
478 
479  case XMLHandler::kHeader:
480  break;
481 
482  case XMLHandler::kInit: {
483  std::istringstream data;
484  data.str(handler->buffer);
485  handler->buffer.clear();
486 
487  curRunInfo.reset(new LHERunInfo(data));
488 
489  std::for_each(handler->headers.begin(),
490  handler->headers.end(),
491  std::bind(&LHERunInfo::addHeader, curRunInfo.get(), std::placeholders::_1));
492  handler->headers.clear();
493  } break;
494 
496  break;
497 
498  case XMLHandler::kEvent: {
499  if (!curRunInfo.get())
500  throw cms::Exception("InvalidState") << "Got LHE event without"
501  " initialization."
502  << std::endl;
503 
504  if (firstEvent > 0) {
505  firstEvent--;
506  continue;
507  }
508 
509  if (maxEvents == 0)
510  return std::shared_ptr<LHEEvent>();
511  else if (maxEvents > 0)
512  maxEvents--;
513 
514  std::istringstream data;
515  data.str(handler->buffer);
516  handler->buffer.clear();
517 
518  std::shared_ptr<LHEEvent> lheevent;
519  lheevent.reset(new LHEEvent(curRunInfo, data));
520  const XMLHandler::wgt_info &info = handler->weightsinevent;
521  for (size_t i = 0; i < info.size(); ++i) {
522  double num = -1.0;
523  sscanf(info[i].second.c_str(), "%le", &num);
524  lheevent->addWeight(gen::WeightsInfo(info[i].first, num));
525  }
526  lheevent->setNpLO(handler->npLO);
527  lheevent->setNpNLO(handler->npNLO);
528  //fill scales
529  if (!handler->scales.empty()) {
530  lheevent->setScales(handler->scales);
531  }
532  return lheevent;
533  }
534  }
535  }
536 
537  return std::shared_ptr<LHEEvent>();
538  }
539 
540 } // namespace lhef
lhef::XMLDocument::platformHandle
static std::shared_ptr< void > platformHandle()
Definition: XMLUtils.h:45
lhef::XMLSimpleStr::isAllSpaces
static bool isAllSpaces(const XMLCh *str, unsigned int length)
Definition: XMLUtils.h:81
mps_fire.i
i
Definition: mps_fire.py:428
lhef::LHEReader::XMLHandler::endElement
void endElement(const XMLCh *const uri, const XMLCh *const localname, const XMLCh *const qname) override
Definition: LHEReader.cc:274
MessageLogger.h
lhef::LHEReader::XMLHandler::impl
std::unique_ptr< DOMImplementation > impl
Definition: LHEReader.cc:130
funct::false
false
Definition: Factorize.h:29
lhef::LHEReader::strName
const std::string strName
Definition: LHEReader.h:32
edm::TimeOfDay
Definition: TimeOfDay.h:9
lhef::fillHeader
static void fillHeader(LHERunInfo::Header &header, const char *data, int len=-1)
Definition: LHEReader.cc:154
contentValuesFiles.dom
dom
Definition: contentValuesFiles.py:50
CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
mps_merge.weight
weight
Definition: mps_merge.py:88
lhef::LHEReader::curDoc
std::unique_ptr< XMLDocument > curDoc
Definition: LHEReader.h:39
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
lhef::LHEReader::XMLHandler::weightsinevent
wgt_info weightsinevent
Definition: LHEReader.cc:139
StorageFactory::open
std::unique_ptr< Storage > open(const std::string &url, int mode=IOFlags::OpenRead) const
Definition: StorageFactory.cc:124
lhef::LHEReader::XMLHandler::xmlHeader
DOMDocument * xmlHeader
Definition: LHEReader.cc:134
ALCARECOPromptCalibProdSiPixelAli0T_cff.mode
mode
Definition: ALCARECOPromptCalibProdSiPixelAli0T_cff.py:96
lhef::XMLUniStr
Definition: XMLUtils.h:91
lhef::LHEReader::XMLHandler::scales
std::vector< float > scales
Definition: LHEReader.cc:142
gen::WeightsInfo
Definition: WeightsInfo.h:10
cms::cuda::assert
assert(be >=bs)
lhef::LHEReader::fileURLs
const std::vector< std::string > fileURLs
Definition: LHEReader.h:29
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
lhef::LHEReader::~LHEReader
~LHEReader()
Definition: LHEReader.cc:433
cscNeutronWriter_cfi.writer
writer
Definition: cscNeutronWriter_cfi.py:6
info
static const TGPicture * info(bool iBackgroundIsBlack)
Definition: FWCollectionSummaryWidget.cc:153
lhef::LHEReader::XMLHandler
Definition: LHEReader.cc:85
mps_check.msg
tuple msg
Definition: mps_check.py:285
particlelevel_cff.LHERunInfo
LHERunInfo
Definition: particlelevel_cff.py:56
XERCES_CPP_NAMESPACE_USE
Definition: XMLConfigWriter.cc:40
lhef::LHEReader
Definition: LHEReader.h:16
Storage.h
MillePedeFileConverter_cfg.fileName
fileName
Definition: MillePedeFileConverter_cfg.py:32
lhef::LHEReader::StringSource::StringSource
StringSource(const std::string &inputs)
Definition: LHEReader.cc:69
lhef::LHEReader::StringSource::~StringSource
~StringSource() override
Definition: LHEReader.cc:77
dqmdumpme.first
first
Definition: dqmdumpme.py:55
getRunAppsInfo.headers
headers
Definition: getRunAppsInfo.py:65
lhef::LHEReader::XMLHandler::headers
std::vector< LHERunInfo::Header > headers
Definition: LHEReader.cc:138
lhef::LHEReader::StringSource::createReader
XMLDocument * createReader(XMLDocument::Handler &handler) override
Definition: LHEReader.cc:79
lhef::LHEReader::XMLHandler::weightInfo
const wgt_info & weightInfo() const
Definition: LHEReader.cc:113
edmScanValgrind.buffer
buffer
Definition: edmScanValgrind.py:171
lhef::LHEReader::XMLHandler::kComment
Definition: LHEReader.cc:104
lhef::LHEReader::FileSource::~FileSource
~FileSource() override
Definition: LHEReader.cc:59
LHEReader.h
XMLUtils.h
lhef::XMLDocument
Definition: XMLUtils.h:35
lhef::LHEReader::XMLHandler::buffer
std::string buffer
Definition: LHEReader.cc:131
StorageFactory::get
static const StorageFactory * get(void)
Definition: StorageFactory.cc:28
mps_fire.end
end
Definition: mps_fire.py:242
lhef::LHEReader::XMLHandler::gotObject
Object gotObject
Definition: LHEReader.cc:132
IOFlags::OpenRead
Definition: IOFlags.h:7
lhef::LHEReader::XMLHandler::comment
void comment(const XMLCh *const chars, const XMLSize_t length) override
Definition: LHEReader.cc:400
lhef::LHEReader::Source
Definition: LHEReader.cc:40
lhef::LHEReader::XMLHandler::npLO
int npLO
Definition: LHEReader.cc:140
lhef::LHEReader::XMLHandler::kInit
Definition: LHEReader.cc:104
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
lhef::logFileAction
static void logFileAction(char const *msg, std::string const &fileName)
Definition: LH5Reader.cc:29
edm::FlushMessageLog
void FlushMessageLog()
Definition: MessageLogger.cc:34
lhef::LHEReader::FileSource::createReader
XMLDocument * createReader(XMLDocument::Handler &handler) override
Definition: LHEReader.cc:61
edm::ParameterSet
Definition: ParameterSet.h:47
lhef::LHEReader::XMLHandler::xmlEvent
DOMDocument * xmlEvent
Definition: LHEReader.cc:135
lhef::LHEReader::curIndex
unsigned int curIndex
Definition: LHEReader.h:35
LHERunInfo.h
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
lhef::XMLDocument::Handler
Definition: XMLUtils.h:37
lhef
Definition: ExhumeHadronizer.h:12
gainCalibHelper::gainCalibPI::type
type
Definition: SiPixelGainCalibHelper.h:39
lhef::LHEReader::XMLHandler::XMLHandler
XMLHandler()
Definition: LHEReader.cc:88
lhef::LHEEvent
Definition: LHEEvent.h:23
lhef::LHERunInfo::addHeader
void addHeader(const Header &header)
Definition: LHERunInfo.h:61
lhef::LHEReader::XMLHandler::~XMLHandler
~XMLHandler() override
Definition: LHEReader.cc:97
lhef::XMLSimpleStr
Definition: XMLUtils.h:73
StorageFactory.h
createfilelist.int
int
Definition: createfilelist.py:10
lhef::LHEReader::platform
std::shared_ptr< void > platform
Definition: LHEReader.h:42
value
Definition: value.py:1
lhef::LHEReader::XMLHandler::mode
Object mode
Definition: LHEReader.cc:133
PixelMapPlotter.inputs
inputs
Definition: PixelMapPlotter.py:490
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
edm::LogAbsolute
Log< level::System, true > LogAbsolute
Definition: MessageLogger.h:134
lhef::LHEReader::Source::Source
Source()
Definition: LHEReader.cc:42
lhef::LHEReader::XMLHandler::kNone
Definition: LHEReader.cc:104
IOTypes.h
submitPVResolutionJobs.q
q
Definition: submitPVResolutionJobs.py:84
lhef::XMLSimpleStr::isSpace
static bool isSpace(XMLCh ch)
Definition: XMLUtils.h:85
lhef::LHEReader::curSource
std::unique_ptr< Source > curSource
Definition: LHEReader.h:38
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
lhef::LHEReader::firstEvent
unsigned int firstEvent
Definition: LHEReader.h:33
lhef::LHEReader::XMLHandler::skipEvent
bool skipEvent
Definition: LHEReader.cc:129
lhef::LHEReader::XMLHandler::Object
Object
Definition: LHEReader.cc:104
lhef::LHEReader::maxEvents
int maxEvents
Definition: LHEReader.h:34
EgammaValidation_cff.num
num
Definition: EgammaValidation_cff.py:34
lhef::LHEReader::XMLHandler::npNLO
int npNLO
Definition: LHEReader.cc:141
lhef::LHEReader::FileSource
Definition: LHEReader.cc:47
lhef::LHEReader::XMLHandler::characters
void characters(const XMLCh *const chars, const XMLSize_t length) override
Definition: LHEReader.cc:371
lhef::LHEReader::FileSource::fileStream
std::unique_ptr< StorageWrap > fileStream
Definition: LHEReader.cc:64
lhef::LHEReader::Source::~Source
virtual ~Source()
Definition: LHEReader.cc:43
WDecay::kNone
Definition: TopGenEvent.h:27
lhef::LHEReader::StringSource
Definition: LHEReader.cc:67
impl
Definition: trackAlgoPriorityOrder.h:18
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
lhef::LHEReader::XMLHandler::xmlNodes
std::vector< DOMElement * > xmlNodes
Definition: LHEReader.cc:136
lhef::LHERunInfo::Header
Definition: LHERunInfo.h:35
lhef::LHEReader::XMLHandler::kHeader
Definition: LHEReader.cc:104
lhef::LHEReader::XMLHandler::reset
void reset()
Definition: LHEReader.cc:106
lhef::LHEReader::curRunInfo
std::shared_ptr< LHERunInfo > curRunInfo
Definition: LHEReader.h:40
lhef::LHEReader::StringSource::fileStream
std::unique_ptr< std::istream > fileStream
Definition: LHEReader.cc:82
lhef::LHEReader::Source::createReader
virtual XMLDocument * createReader(XMLDocument::Handler &handler)=0
lhef::LHEReader::FileSource::FileSource
FileSource(const std::string &fileURL)
Definition: LHEReader.cc:49
Exception
Definition: hltDiff.cc:246
lhef::attributesToDom
static void attributesToDom(DOMElement *dom, const Attributes &attributes)
Definition: LHEReader.cc:145
Data_TkAlMinBias_Run2018C_PromptReco_v3_cff.maxEvents
maxEvents
Definition: Data_TkAlMinBias_Run2018C_PromptReco_v3_cff.py:3
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
Exception.h
lhef::LHEReader::XMLHandler::xmlEventNodes
std::vector< DOMElement * > xmlEventNodes
Definition: LHEReader.cc:136
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
LHEEvent.h
lhef::LHEReader::next
std::shared_ptr< LHEEvent > next(bool *newFileOpened=nullptr)
Definition: LHEReader.cc:443
RecoTauValidation_cfi.header
header
Definition: RecoTauValidation_cfi.py:292
LaserTracksInput_cfi.fileNames
fileNames
Definition: LaserTracksInput_cfi.py:8
lhef::LHEReader::XMLHandler::startElement
void startElement(const XMLCh *const uri, const XMLCh *const localname, const XMLCh *const qname, const Attributes &attributes) override
Definition: LHEReader.cc:169
cms::Exception
Definition: Exception.h:70
lhef::LHEReader::XMLHandler::headerOk
bool headerOk
Definition: LHEReader.cc:137
ParameterSet.h
lhef::LHEReader::handler
std::unique_ptr< XMLHandler > handler
Definition: LHEReader.h:41
runonSM.text
text
Definition: runonSM.py:43
TimeOfDay.h
lhef::LHEReader::XMLHandler::kEvent
Definition: LHEReader.cc:104
lhef::LHEReader::LHEReader
LHEReader(const edm::ParameterSet &params)
Definition: LHEReader.cc:414
event
Definition: event.py:1
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82
lhef::LHEReader::XMLHandler::wgt_info
std::vector< std::pair< std::string, std::string > > wgt_info
Definition: LHEReader.cc:87
amptDefault_cfi.firstEvent
firstEvent
Definition: amptDefault_cfi.py:8
weight
Definition: weight.py:1