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 146 of file LHEReader.cc.

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

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

146  {
147  for (unsigned int i = 0; i < attributes.getLength(); i++) {
148  const XMLCh *name = attributes.getQName(i);
149  const XMLCh *value = attributes.getValue(i);
150 
151  dom->setAttribute(name, value);
152  }
153  }
Definition: value.py:1

◆ domToLines()

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

Definition at line 406 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().

406  {
407  std::vector<std::string> result;
408  DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(XMLUniStr("Core"));
409  std::unique_ptr<DOMLSSerializer> writer(((DOMImplementationLS *)(impl))->createLSSerializer());
410 
411  std::unique_ptr<DOMLSOutput> outputDesc(((DOMImplementationLS *)impl)->createLSOutput());
412  assert(outputDesc.get());
413  outputDesc->setEncoding(XMLUniStr("UTF-8"));
414 
415  XMLSimpleStr buffer(writer->writeToString(node));
416 
417  const char *p = std::strchr((const char *)buffer, '>') + 1;
418  const char *q = std::strrchr(p, '<');
419  fillLines(result, p, q - p);
420 
421  return result;
422  }
assert(be >=bs)
static void fillLines(std::vector< std::string > &lines, const char *data, int len=-1)
Definition: LHERunInfo.cc:391

◆ fillHeader()

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

Definition at line 155 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().

155  {
156  const char *end = len >= 0 ? (data + len) : nullptr;
157  while (*data && (!end || data < end)) {
158  std::size_t len = std::strcspn(data, "\r\n");
159  if (end && data + len > end)
160  len = end - data;
161  if (data[len] == '\r' && data[len + 1] == '\n')
162  len += 2;
163  else if (data[len])
164  len++;
165  header.addLine(std::string(data, len));
166  data += len;
167  }
168  }
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 391 of file LHERunInfo.cc.

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

Referenced by domToLines().

391  {
392  const char *end = len >= 0 ? (data + len) : nullptr;
393  while (*data && (!end || data < end)) {
394  std::size_t len = std::strcspn(data, "\r\n");
395  if (end && data + len > end)
396  len = end - data;
397  if (data[len] == '\r' && data[len + 1] == '\n')
398  len += 2;
399  else if (data[len])
400  len++;
401  lines.push_back(std::string(data, len));
402  data += len;
403  }
404  }
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 429 of file LHEEvent.cc.

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

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

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

◆ 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:286
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:286
Log< level::System, true > LogAbsolute

◆ operator<()

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

Definition at line 535 of file LHERunInfo.cc.

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

535  {
536  return (lhs.process() < rhs.process());
537  }

◆ operator==()

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

Definition at line 531 of file LHERunInfo.cc.

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

531  {
532  return (lhs.process() == rhs.process());
533  }