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 201 of file XMLUtils.h.

Definition at line 202 of file XMLUtils.h.

Definition at line 203 of file XMLUtils.h.

Function Documentation

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

Definition at line 158 of file LHEReader.cc.

References mps_fire::i, and dataset::name.

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

159 {
160  for(unsigned int i = 0; i < attributes.getLength(); i++) {
161  const XMLCh *name = attributes.getQName(i);
162  const XMLCh *value = attributes.getValue(i);
163 
164  dom->setAttribute(name, value);
165  }
166 }
Definition: value.py:1
static std::vector<std::string> lhef::domToLines ( const DOMNode *  node)
static

Definition at line 504 of file LHERunInfo.cc.

References edmScanValgrind::buffer, fillLines(), AlCaHLTBitMon_ParallelJobs::p, lumiQueryAPI::q, mps_fire::result, and cscNeutronWriter_cfi::writer.

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

505 {
506  std::vector<std::string> result;
507  DOMImplementation *impl =
508  DOMImplementationRegistry::getDOMImplementation(
509  XMLUniStr("Core"));
510  std::unique_ptr<DOMLSSerializer> writer(((DOMImplementationLS*)(impl))->createLSSerializer());
511 
512  std::unique_ptr<DOMLSOutput> outputDesc(((DOMImplementationLS*)impl)->createLSOutput());
513  assert(outputDesc.get());
514  outputDesc->setEncoding(XMLUniStr("UTF-8"));
515 
516  XMLSimpleStr buffer(writer->writeToString(node));
517 
518  const char *p = std::strchr((const char*)buffer, '>') + 1;
519  const char *q = std::strrchr(p, '<');
520  fillLines(result, p, q - p);
521 
522  return result;
523 }
static void fillLines(std::vector< std::string > &lines, const char *data, int len=-1)
Definition: LHERunInfo.cc:487
static void lhef::fillHeader ( LHERunInfo::Header header,
const char *  data,
int  len = -1 
)
static

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

170 {
171  const char *end = len >= 0 ? (data + len) : nullptr;
172  while(*data && (!end || data < end)) {
173  std::size_t len = std::strcspn(data, "\r\n");
174  if (end && data + len > end)
175  len = end - data;
176  if (data[len] == '\r' && data[len + 1] == '\n')
177  len += 2;
178  else if (data[len])
179  len++;
180  header.addLine(std::string(data, len));
181  data += len;
182  }
183 }
#define end
Definition: vmac.h:39
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
static void lhef::fillLines ( std::vector< std::string > &  lines,
const char *  data,
int  len = -1 
)
static

Definition at line 487 of file LHERunInfo.cc.

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

Referenced by domToLines().

489 {
490  const char *end = len >= 0 ? (data + len) : nullptr;
491  while(*data && (!end || data < end)) {
492  std::size_t len = std::strcspn(data, "\r\n");
493  if (end && data + len > end)
494  len = end - data;
495  if (data[len] == '\r' && data[len + 1] == '\n')
496  len += 2;
497  else if (data[len])
498  len++;
499  lines.push_back(std::string(data, len));
500  data += len;
501  }
502 }
#define end
Definition: vmac.h:39
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
static void lhef::fixSubTree ( HepMC::GenVertex *  vertex,
HepMC::FourVector &  _time,
std::set< const HepMC::GenVertex * > &  visited 
)
static

Definition at line 481 of file LHEEvent.cc.

References protons_cff::time.

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

484 {
485  HepMC::FourVector time = _time;
486  HepMC::FourVector curTime = vertex->position();
487  bool needsFixup = curTime.t() < time.t();
488 
489  if (!visited.insert(vertex).second && !needsFixup)
490  return;
491 
492  if (needsFixup)
493  vertex->set_position(time);
494  else
495  time = curTime;
496 
497  for(HepMC::GenVertex::particles_out_const_iterator iter =
498  vertex->particles_out_const_begin();
499  iter != vertex->particles_out_const_end(); ++iter) {
500  HepMC::GenVertex *endVertex = (*iter)->end_vertex();
501  if (endVertex)
502  fixSubTree(endVertex, time, visited);
503  }
504 }
static void fixSubTree(HepMC::GenVertex *vertex, HepMC::FourVector &_time, std::set< const HepMC::GenVertex * > &visited)
Definition: LHEEvent.cc:481
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 655 of file LHERunInfo.cc.

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

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

Definition at line 652 of file LHERunInfo.cc.

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

653 { return (lhs.process() == rhs.process()); }