CMS 3D CMS Logo

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