CMS 3D CMS Logo

Classes | Typedefs | Functions
lhef Namespace Reference

Classes

class  CBInputStream
 
class  CommonBlocks
 
class  H5Handler
 
class  HEPEUP
 
class  HEPRUP
 
class  LH5Reader
 
class  LHEEvent
 
class  LHEProxy
 
class  LHEReader
 
class  LHERunInfo
 
class  STLInputStream
 
class  StorageInputStream
 
class  StorageWrap
 
class  XMLDocument
 
class  XMLInputSourceWrapper
 
class  XMLSimpleStr
 
class  XMLUniStr
 

Typedefs

typedef XMLInputSourceWrapper< CBInputStreamCBInputSource
 
typedef XMLInputSourceWrapper< STLInputStreamSTLInputSource
 
typedef XMLInputSourceWrapper< StorageInputStreamStorageInputSource
 

Functions

static void attributesToDom (DOMElement *dom, const Attributes &attributes)
 
static std::vector< std::string > domToLines (const DOMNode *node)
 
static void fillHeader (LHERunInfo::Header &header, const char *data, int len=-1)
 
static void fillLines (std::vector< std::string > &lines, const char *data, int len=-1)
 
static void fixSubTree (HepMC::GenVertex *vertex, HepMC::FourVector &_time, std::set< const HepMC::GenVertex *> &visited)
 
static void logFileAction (char const *msg, std::string const &fileName)
 
static void logFileAction (char const *msg, std::string const &fileName)
 
const bool operator< (const LHERunInfo::Process &lhs, const LHERunInfo::Process &rhs)
 
const bool operator== (const LHERunInfo::Process &lhs, const LHERunInfo::Process &rhs)
 

Typedef Documentation

◆ CBInputSource

Definition at line 188 of file XMLUtils.h.

◆ STLInputSource

Definition at line 189 of file XMLUtils.h.

◆ StorageInputSource

Definition at line 190 of file XMLUtils.h.

Function Documentation

◆ attributesToDom()

static void lhef::attributesToDom ( DOMElement *  dom,
const Attributes &  attributes 
)
static

Definition at line 147 of file LHEReader.cc.

References contentValuesFiles::dom, mps_fire::i, and Skims_PA_cff::name.

Referenced by lhef::LHEReader::XMLHandler::startElement().

147  {
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  }
Definition: value.py:1

◆ domToLines()

static std::vector<std::string> lhef::domToLines ( const DOMNode *  node)
static

Definition at line 416 of file LHERunInfo.cc.

References cms::cuda::assert(), edmScanValgrind::buffer, fillLines(), AlCaHLTBitMon_ParallelJobs::p, submitPVResolutionJobs::q, mps_fire::result, and convertToRaw::writer.

Referenced by lhef::LHERunInfo::findHeader().

416  {
417  std::vector<std::string> result;
418  DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(XMLUniStr("Core"));
419  std::unique_ptr<DOMLSSerializer> writer(((DOMImplementationLS *)(impl))->createLSSerializer());
420 
421  std::unique_ptr<DOMLSOutput> outputDesc(((DOMImplementationLS *)impl)->createLSOutput());
422  assert(outputDesc.get());
423  outputDesc->setEncoding(XMLUniStr("UTF-8"));
424 
425  XMLSimpleStr buffer(writer->writeToString(node));
426 
427  const char *p = std::strchr((const char *)buffer, '>') + 1;
428  const char *q = std::strrchr(p, '<');
429  fillLines(result, p, q - p);
430 
431  return result;
432  }
assert(be >=bs)
static void fillLines(std::vector< std::string > &lines, const char *data, int len=-1)
Definition: LHERunInfo.cc:401

◆ fillHeader()

static void lhef::fillHeader ( LHERunInfo::Header header,
const char *  data,
int  len = -1 
)
static

Definition at line 156 of file LHEReader.cc.

References data, mps_fire::end, RecoTauValidation_cfi::header, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by lhef::LHEReader::XMLHandler::comment(), and lhef::LHEReader::XMLHandler::endElement().

156  {
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  }
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79

◆ fillLines()

static void lhef::fillLines ( std::vector< std::string > &  lines,
const char *  data,
int  len = -1 
)
static

Definition at line 401 of file LHERunInfo.cc.

References data, mps_fire::end, groupFilesInBlocks::lines, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by domToLines().

401  {
402  const char *end = len >= 0 ? (data + len) : nullptr;
403  while (*data && (!end || data < end)) {
404  std::size_t len = std::strcspn(data, "\r\n");
405  if (end && data + len > end)
406  len = end - data;
407  if (data[len] == '\r' && data[len + 1] == '\n')
408  len += 2;
409  else if (data[len])
410  len++;
411  lines.push_back(std::string(data, len));
412  data += len;
413  }
414  }
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79

◆ fixSubTree()

static void lhef::fixSubTree ( HepMC::GenVertex *  vertex,
HepMC::FourVector &  _time,
std::set< const HepMC::GenVertex *> &  visited 
)
static

Definition at line 432 of file LHEEvent.cc.

References protons_cff::time, bphysicsOniaDQM_cfi::vertex, and class-composition::visited.

Referenced by lhef::LHEEvent::fixHepMCEventTimeOrdering().

434  {
435  HepMC::FourVector time = _time;
436  HepMC::FourVector curTime = vertex->position();
437  bool needsFixup = curTime.t() < time.t();
438 
439  if (!visited.insert(vertex).second && !needsFixup)
440  return;
441 
442  if (needsFixup)
443  vertex->set_position(time);
444  else
445  time = curTime;
446 
447  for (HepMC::GenVertex::particles_out_const_iterator iter = vertex->particles_out_const_begin();
448  iter != vertex->particles_out_const_end();
449  ++iter) {
450  HepMC::GenVertex *endVertex = (*iter)->end_vertex();
451  if (endVertex)
452  fixSubTree(endVertex, time, visited);
453  }
454  }
static void fixSubTree(HepMC::GenVertex *vertex, HepMC::FourVector &_time, std::set< const HepMC::GenVertex *> &visited)
Definition: LHEEvent.cc:432

◆ logFileAction() [1/2]

static void lhef::logFileAction ( char const *  msg,
std::string const &  fileName 
)
static

Definition at line 31 of file LH5Reader.cc.

References MillePedeFileConverter_cfg::fileName, edm::FlushMessageLog(), and mps_check::msg.

Referenced by lhef::LHEReader::next(), and lhef::LH5Reader::next().

31  {
32  edm::LogAbsolute("fileAction") << std::setprecision(0) << edm::TimeOfDay() << msg << fileName;
34  }
void FlushMessageLog()
tuple msg
Definition: mps_check.py:285
Log< level::System, true > LogAbsolute

◆ logFileAction() [2/2]

static void lhef::logFileAction ( char const *  msg,
std::string const &  fileName 
)
static

Definition at line 35 of file LHEReader.cc.

References MillePedeFileConverter_cfg::fileName, edm::FlushMessageLog(), and mps_check::msg.

35  {
36  edm::LogAbsolute("fileAction") << std::setprecision(0) << edm::TimeOfDay() << msg << fileName;
38  }
void FlushMessageLog()
tuple msg
Definition: mps_check.py:285
Log< level::System, true > LogAbsolute

◆ operator<()

const bool lhef::operator< ( const LHERunInfo::Process lhs,
const LHERunInfo::Process rhs 
)

Definition at line 545 of file LHERunInfo.cc.

References lhef::LHERunInfo::Process::process().

545  {
546  return (lhs.process() < rhs.process());
547  }

◆ operator==()

const bool lhef::operator== ( const LHERunInfo::Process lhs,
const LHERunInfo::Process rhs 
)

Definition at line 541 of file LHERunInfo.cc.

References lhef::LHERunInfo::Process::process().

541  {
542  return (lhs.process() == rhs.process());
543  }