CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | Friends
LHEEventProduct::const_iterator Class Reference

#include <LHEEventProduct.h>

Public Types

typedef std::ptrdiff_t difference_type
 
typedef std::forward_iterator_tag iterator_category
 
typedef std::string * pointer
 
typedef std::string & reference
 
typedef std::string value_type
 

Public Member Functions

 const_iterator ()
 
bool operator!= (const const_iterator &other) const
 
const std::string & operator* () const
 
const_iteratoroperator++ ()
 
const_iterator operator++ (int dummy)
 
const std::string * operator-> () const
 
bool operator== (const const_iterator &other) const
 
 ~const_iterator ()
 

Private Member Functions

void next ()
 

Private Attributes

const LHEEventProductevent
 
unsigned int line
 
std::string tmp
 

Static Private Attributes

static const unsigned int npos = 99999
 

Friends

class LHEEventProduct
 

Detailed Description

Definition at line 80 of file LHEEventProduct.h.

Member Typedef Documentation

Definition at line 84 of file LHEEventProduct.h.

typedef std::forward_iterator_tag LHEEventProduct::const_iterator::iterator_category

Definition at line 82 of file LHEEventProduct.h.

Definition at line 85 of file LHEEventProduct.h.

Definition at line 86 of file LHEEventProduct.h.

Definition at line 83 of file LHEEventProduct.h.

Constructor & Destructor Documentation

LHEEventProduct::const_iterator::const_iterator ( )
inline

Definition at line 88 of file LHEEventProduct.h.

Referenced by LHEEventProduct::end().

88 : line(npos) {}
static const unsigned int npos
LHEEventProduct::const_iterator::~const_iterator ( )
inline

Definition at line 89 of file LHEEventProduct.h.

89 {}

Member Function Documentation

void LHEEventProduct::const_iterator::next ( void  )
private

Definition at line 9 of file LHEEventProduct.cc.

References lhef::HEPEUP::AQCDUP, lhef::HEPEUP::AQEDUP, alignBH_cfg::fixed, LHEEventProduct::hepeup(), lhef::HEPEUP::ICOLUP, gen::PdfInfo::id, lhef::HEPEUP::IDPRUP, lhef::HEPEUP::IDUP, lhef::HEPEUP::ISTUP, line, lhef::HEPEUP::MOTHUP, npos, lhef::HEPEUP::NUP, LHEEventProduct::pdf(), lhef::HEPEUP::PUP, gen::PdfInfo::scalePDF, lhef::HEPEUP::SCALUP, lhef::HEPEUP::SPINUP, tmp, lhef::HEPEUP::VTIMUP, gen::PdfInfo::x, and gen::PdfInfo::xPDF.

Referenced by operator++().

10 {
11  const lhef::HEPEUP &hepeup = event->hepeup();
12  int line = this->line++;
13 
14  if (!line) {
15  std::ostringstream ss;
16  ss << std::setprecision(7)
17  << std::scientific
18  << std::uppercase
19  << " " << hepeup.NUP
20  << " " << hepeup.IDPRUP
21  << " " << event->originalXWGTUP()
22  << " " << hepeup.SCALUP
23  << " " << hepeup.AQEDUP
24  << " " << hepeup.AQCDUP << std::endl;
25  tmp = ss.str();
26  return;
27  }
28  line--;
29 
30  if (line < hepeup.NUP) {
31  std::ostringstream ss;
32  ss << std::setprecision(10)
33  << std::scientific
34  << std::uppercase
35  << "\t" << hepeup.IDUP[line]
36  << "\t" << hepeup.ISTUP[line]
37  << "\t" << hepeup.MOTHUP[line].first
38  << "\t" << hepeup.MOTHUP[line].second
39  << "\t" << hepeup.ICOLUP[line].first
40  << "\t" << hepeup.ICOLUP[line].second
41  << "\t" << hepeup.PUP[line][0]
42  << "\t" << hepeup.PUP[line][1]
43  << "\t" << hepeup.PUP[line][2]
44  << "\t" << hepeup.PUP[line][3]
45  << "\t" << hepeup.PUP[line][4]
46  << std::setprecision(3)
47  << "\t" << hepeup.VTIMUP[line]
48  << std::setprecision(1)
49  << std::fixed
50  << "\t" << hepeup.SPINUP[line] << std::endl;
51  tmp = ss.str();
52  return;
53  }
54  line -= hepeup.NUP;
55 
56  if (event->pdf()) {
57  if (!line) {
58  const PDF &pdf = *event->pdf();
59  std::ostringstream ss;
60  ss << std::setprecision(7)
61  << std::scientific
62  << std::uppercase
63  << "#pdf " << pdf.id.first
64  << " " << pdf.id.second
65  << " " << pdf.x.first
66  << " " << pdf.x.second
67  << " " << pdf.scalePDF
68  << " " << pdf.xPDF.first
69  << " " << pdf.xPDF.second << std::endl;
70  tmp = ss.str();
71  return;
72  }
73  line--;
74  }
75 
76  if (line < (int)event->comments_size()) {
77  tmp = *(event->comments_begin() + line);
78  return;
79  }
80  line -= event->comments_size();
81 
82  if (!line) {
83  tmp = "</event>\n";
84  return;
85  }
86 
87  tmp.clear();
88  this->line = npos;
89 }
const lhef::HEPEUP & hepeup() const
const PDF * pdf() const
std::vector< double > VTIMUP
Definition: LesHouches.h:267
std::vector< std::pair< int, int > > MOTHUP
Definition: LesHouches.h:249
std::vector< FiveVector > PUP
Definition: LesHouches.h:261
std::vector< double > SPINUP
Definition: LesHouches.h:274
std::vector< int > ISTUP
Definition: LesHouches.h:243
gen::PdfInfo PDF
std::vector< int > IDUP
Definition: LesHouches.h:238
std::pair< int, int > id
Definition: PdfInfo.h:12
double AQCDUP
Definition: LesHouches.h:233
static const unsigned int npos
double AQEDUP
Definition: LesHouches.h:228
std::vector< std::pair< int, int > > ICOLUP
Definition: LesHouches.h:255
Definition: event.py:1
double SCALUP
Definition: LesHouches.h:223
bool LHEEventProduct::const_iterator::operator!= ( const const_iterator other) const
inline

Definition at line 93 of file LHEEventProduct.h.

References operator==().

94  { return !operator == (other); }
bool operator==(const const_iterator &other) const
const std::string& LHEEventProduct::const_iterator::operator* ( void  ) const
inline

Definition at line 101 of file LHEEventProduct.h.

References tmp.

101 { return tmp; }
const_iterator& LHEEventProduct::const_iterator::operator++ ( void  )
inline

Definition at line 96 of file LHEEventProduct.h.

References next().

97  { next(); return *this; }
const_iterator LHEEventProduct::const_iterator::operator++ ( int  dummy)
inline

Definition at line 98 of file LHEEventProduct.h.

References next().

const std::string* LHEEventProduct::const_iterator::operator-> ( ) const
inline

Definition at line 102 of file LHEEventProduct.h.

References tmp.

102 { return &tmp; }
bool LHEEventProduct::const_iterator::operator== ( const const_iterator other) const
inline

Definition at line 91 of file LHEEventProduct.h.

References line.

Referenced by operator!=().

92  { return line == other.line; }

Friends And Related Function Documentation

friend class LHEEventProduct
friend

Definition at line 105 of file LHEEventProduct.h.

Member Data Documentation

const LHEEventProduct* LHEEventProduct::const_iterator::event
private

Definition at line 109 of file LHEEventProduct.h.

Referenced by LHEEventProduct::begin(), and Types.EventID::cppID().

unsigned int LHEEventProduct::const_iterator::line
private

Definition at line 110 of file LHEEventProduct.h.

Referenced by LHEEventProduct::begin(), next(), and operator==().

const unsigned int LHEEventProduct::const_iterator::npos = 99999
staticprivate

Definition at line 113 of file LHEEventProduct.h.

Referenced by next().

std::string LHEEventProduct::const_iterator::tmp
private

Definition at line 111 of file LHEEventProduct.h.

Referenced by LHEEventProduct::begin(), next(), operator*(), and operator->().