CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
< CBInputStream
CBInputSource
 
typedef XMLInputSourceWrapper
< STLInputStream
STLInputSource
 
typedef XMLInputSourceWrapper
< StorageInputStream
StorageInputSource
 

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)
 
template<typename T >
static void pop (std::vector< T > &vec, unsigned int index)
 

Typedef Documentation

Definition at line 193 of file XMLUtils.h.

Definition at line 194 of file XMLUtils.h.

Definition at line 195 of file XMLUtils.h.

Function Documentation

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

Definition at line 152 of file LHEReader.cc.

References i, mergeVDriftHistosByStation::name, and relativeConstraints::value.

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

153 {
154  for(unsigned int i = 0; i < attributes.getLength(); i++) {
155  const XMLCh *name = attributes.getQName(i);
156  const XMLCh *value = attributes.getValue(i);
157 
158  dom->setAttribute(name, value);
159  }
160 }
int i
Definition: DBlmapReader.cc:9
static std::vector<std::string> lhef::domToLines ( const DOMNode *  node)
static

Definition at line 504 of file LHERunInfo.cc.

References fillLines(), AlCaHLTBitMon_ParallelJobs::p, lumiQueryAPI::q, and query::result.

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

505 {
506  std::vector<std::string> result;
507  DOMImplementation *impl =
508  DOMImplementationRegistry::getDOMImplementation(
509  XMLUniStr("Core"));
510  std::auto_ptr<DOMWriter> writer(
511  static_cast<DOMImplementationLS*>(impl)->createDOMWriter());
512 
513  writer->setEncoding(XMLUniStr("UTF-8"));
514  XMLSimpleStr buffer(writer->writeToString(*node));
515 
516  const char *p = std::strchr((const char*)buffer, '>') + 1;
517  const char *q = std::strrchr(p, '<');
518  fillLines(result, p, q - p);
519 
520  return result;
521 }
tuple result
Definition: query.py:137
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 162 of file LHEReader.cc.

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

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

164 {
165  const char *end = len >= 0 ? (data + len) : 0;
166  while(*data && (!end || data < end)) {
167  std::size_t len = std::strcspn(data, "\r\n");
168  if (end && data + len > end)
169  len = end - data;
170  if (data[len] == '\r' && data[len + 1] == '\n')
171  len += 2;
172  else if (data[len])
173  len++;
174  header.addLine(std::string(data, len));
175  data += len;
176  }
177 }
#define end
Definition: vmac.h:37
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, end, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by domToLines().

489 {
490  const char *end = len >= 0 ? (data + len) : 0;
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:37
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 488 of file LHEEvent.cc.

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

491 {
492  HepMC::FourVector time = _time;
493  HepMC::FourVector curTime = vertex->position();
494  bool needsFixup = curTime.t() < time.t();
495 
496  if (!visited.insert(vertex).second && !needsFixup)
497  return;
498 
499  if (needsFixup)
500  vertex->set_position(time);
501  else
502  time = curTime;
503 
504  for(HepMC::GenVertex::particles_out_const_iterator iter =
505  vertex->particles_out_const_begin();
506  iter != vertex->particles_out_const_end(); ++iter) {
507  HepMC::GenVertex *endVertex = (*iter)->end_vertex();
508  if (endVertex)
509  fixSubTree(endVertex, time, visited);
510  }
511 }
static void fixSubTree(HepMC::GenVertex *vertex, HepMC::FourVector &_time, std::set< const HepMC::GenVertex * > &visited)
Definition: LHEEvent.cc:488
static void lhef::logFileAction ( char const *  msg,
std::string const &  fileName 
)
static
const bool lhef::operator< ( const LHERunInfo::Process &  lhs,
const LHERunInfo::Process &  rhs 
)

Definition at line 653 of file LHERunInfo.cc.

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

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

Definition at line 650 of file LHERunInfo.cc.

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

651 { return (lhs.process() == rhs.process()); }
template<typename T >
static void lhef::pop ( std::vector< T > &  vec,
unsigned int  index 
)
inlinestatic

Definition at line 150 of file LHEEvent.cc.

References findQualityFiles::size.

Referenced by electronDataDiscovery::common_search(), python.rootplot.utilities.Hist::delete_bin(), EmDQMPostProcessor::dqmEndJob(), findBadModT9::findpr(), combineBTagCalibrationData::main(), and lhef::LHEEvent::removeParticle().

151 {
152  unsigned int size = vec.size() - 1;
153  std::memmove(&vec[index], &vec[index + 1], (size - index) * sizeof(T));
154 }
long double T
tuple size
Write out results.