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

◆ STLInputSource

Definition at line 186 of file XMLUtils.h.

◆ StorageInputSource

Definition at line 187 of file XMLUtils.h.

Function Documentation

◆ attributesToDom()

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

Definition at line 145 of file LHEReader.cc.

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

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

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

◆ domToLines()

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

Definition at line 416 of file LHERunInfo.cc.

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  }

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

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

◆ fillHeader()

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

Definition at line 154 of file LHEReader.cc.

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

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

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

◆ 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.

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  }

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

Referenced by domToLines().

◆ 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.

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  }

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

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

◆ logFileAction() [1/2]

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

Definition at line 29 of file LH5Reader.cc.

29  {
30  edm::LogAbsolute("fileAction") << std::setprecision(0) << edm::TimeOfDay() << msg << fileName;
32  }

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

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

◆ logFileAction() [2/2]

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

Definition at line 35 of file LHEReader.cc.

35  {
36  edm::LogAbsolute("fileAction") << std::setprecision(0) << edm::TimeOfDay() << msg << fileName;
38  }

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

◆ operator<()

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

Definition at line 545 of file LHERunInfo.cc.

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

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

◆ operator==()

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

Definition at line 541 of file LHERunInfo.cc.

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

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

lhef::fixSubTree
static void fixSubTree(HepMC::GenVertex *vertex, HepMC::FourVector &_time, std::set< const HepMC::GenVertex * > &visited)
Definition: LHEEvent.cc:429
mps_fire.i
i
Definition: mps_fire.py:428
edm::TimeOfDay
Definition: TimeOfDay.h:9
contentValuesFiles.dom
dom
Definition: contentValuesFiles.py:50
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
cms::cuda::assert
assert(be >=bs)
protons_cff.time
time
Definition: protons_cff.py:39
cscNeutronWriter_cfi.writer
writer
Definition: cscNeutronWriter_cfi.py:6
mps_check.msg
tuple msg
Definition: mps_check.py:285
MillePedeFileConverter_cfg.fileName
fileName
Definition: MillePedeFileConverter_cfg.py:32
lhef::fillLines
static void fillLines(std::vector< std::string > &lines, const char *data, int len=-1)
Definition: LHERunInfo.cc:401
edmScanValgrind.buffer
buffer
Definition: edmScanValgrind.py:171
mps_fire.end
end
Definition: mps_fire.py:242
class-composition.visited
visited
Definition: class-composition.py:74
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::FlushMessageLog
void FlushMessageLog()
Definition: MessageLogger.cc:34
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
groupFilesInBlocks.lines
lines
Definition: groupFilesInBlocks.py:95
value
Definition: value.py:1
edm::LogAbsolute
Log< level::System, true > LogAbsolute
Definition: MessageLogger.h:134
submitPVResolutionJobs.q
q
Definition: submitPVResolutionJobs.py:84
impl
Definition: trackAlgoPriorityOrder.h:18
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
RecoTauValidation_cfi.header
header
Definition: RecoTauValidation_cfi.py:292
mps_fire.result
result
Definition: mps_fire.py:311