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 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 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:80

◆ 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:80

◆ 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 hcalRecHitTable_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: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  }