CMS 3D CMS Logo

Classes | Typedefs | Functions
lhef Namespace Reference

Classes

class  CBInputStream
 
class  CommonBlocks
 
class  HEPEUP
 
class  HEPRUP
 
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)
 
const bool operator< (const LHERunInfo::Process &lhs, const LHERunInfo::Process &rhs)
 
const bool operator== (const LHERunInfo::Process &lhs, const LHERunInfo::Process &rhs)
 

Typedef Documentation

Definition at line 185 of file XMLUtils.h.

Definition at line 186 of file XMLUtils.h.

Definition at line 187 of file XMLUtils.h.

Function Documentation

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

Definition at line 147 of file LHEReader.cc.

References 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
static std::vector<std::string> lhef::domToLines ( const DOMNode *  node)
static

Definition at line 418 of file LHERunInfo.cc.

References edmScanValgrind::buffer, fillLines(), AlCaHLTBitMon_ParallelJobs::p, data-class-funcs::q, mps_fire::result, and cscNeutronWriter_cfi::writer.

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

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

Definition at line 156 of file LHEReader.cc.

References LHERunInfoProduct::Header::addLine(), data, end, and AlCaHLTBitMon_QueryRunRegistry::string.

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

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  }
#define end
Definition: vmac.h:39
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
static void lhef::fillLines ( std::vector< std::string > &  lines,
const char *  data,
int  len = -1 
)
static

Definition at line 403 of file LHERunInfo.cc.

References data, LHERunInfoProduct::Header::end(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by domToLines().

403  {
404  const char *end = len >= 0 ? (data + len) : nullptr;
405  while (*data && (!end || data < end)) {
406  std::size_t len = std::strcspn(data, "\r\n");
407  if (end && data + len > end)
408  len = end - data;
409  if (data[len] == '\r' && data[len + 1] == '\n')
410  len += 2;
411  else if (data[len])
412  len++;
413  lines.push_back(std::string(data, len));
414  data += len;
415  }
416  }
#define end
Definition: vmac.h:39
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
static void lhef::fixSubTree ( HepMC::GenVertex *  vertex,
HepMC::FourVector &  _time,
std::set< const HepMC::GenVertex * > &  visited 
)
static

Definition at line 427 of file LHEEvent.cc.

References ntuplemaker::time.

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

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

Definition at line 37 of file LHEReader.cc.

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

Referenced by lhef::LHEReader::next(), and dqm::DQMFileSaverBase::saveRun().

37  {
38  edm::LogAbsolute("fileAction") << std::setprecision(0) << edm::TimeOfDay() << msg << fileName;
40  }
void FlushMessageLog()
tuple msg
Definition: mps_check.py:285
const bool lhef::operator< ( const LHERunInfo::Process lhs,
const LHERunInfo::Process rhs 
)

Definition at line 547 of file LHERunInfo.cc.

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

547  {
548  return (lhs.process() < rhs.process());
549  }
const bool lhef::operator== ( const LHERunInfo::Process lhs,
const LHERunInfo::Process rhs 
)

Definition at line 543 of file LHERunInfo.cc.

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

543  {
544  return (lhs.process() == rhs.process());
545  }