CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
LHEEventProduct.h
Go to the documentation of this file.
1 #ifndef SimDataFormats_GeneratorProducts_LHEEventProduct_h
2 #define SimDataFormats_GeneratorProducts_LHEEventProduct_h
3 
4 #include <memory>
5 #include <vector>
6 #include <string>
7 
11 
13  public:
14  typedef gen::PdfInfo PDF;
16 
17  typedef std::vector<std::string>::const_iterator
20 
23  hepeup_(hepeup), originalXWGTUP_(0) {}
25  const double originalXWGTUP) :
26  hepeup_(hepeup), originalXWGTUP_(originalXWGTUP) {}
28 
29  void setPDF(const PDF &pdf) { pdf_.reset(new PDF(pdf)); }
30  void addWeight(const WGT& wgt) {
31  weights_.push_back(wgt);
32  }
33  void addComment(const std::string &line) { comments_.push_back(line); }
34 
35  double originalXWGTUP() const { return originalXWGTUP_; }
36  const std::vector<WGT>& weights() const { return weights_; }
37 
38  const lhef::HEPEUP &hepeup() const { return hepeup_; }
39  const PDF *pdf() const { return pdf_.get(); }
40 
41  size_type comments_size() const { return comments_.size(); }
42  comments_const_iterator comments_begin() const { return comments_.begin(); }
44 
46  public:
47  typedef std::forward_iterator_tag iterator_category;
49  typedef std::ptrdiff_t difference_type;
50  typedef std::string *pointer;
52 
55 
56  inline bool operator == (const const_iterator &other) const
57  { return line == other.line; }
58  inline bool operator != (const const_iterator &other) const
59  { return !operator == (other); }
60 
62  { next(); return *this; }
63  inline const_iterator operator ++ (int dummy)
64  { const_iterator orig = *this; next(); return orig; }
65 
66  const std::string &operator * () const { return tmp; }
67  const std::string *operator -> () const { return &tmp; }
68 
69  private:
70  friend class LHEEventProduct;
71 
72  void next();
73 
75  unsigned int line;
77 
78  static const unsigned int npos = 99999;
79  };
80 
81  const_iterator begin() const;
82  inline const_iterator end() const { return const_iterator(); }
83 
84  private:
86  std::vector<std::string> comments_;
87  std::auto_ptr<PDF> pdf_;
88  std::vector<WGT> weights_;
90 };
91 
92 #endif // GeneratorEvent_LHEInterface_LHEEventProduct_h
double originalXWGTUP() const
const_iterator begin() const
const_iterator end() const
const lhef::HEPEUP & hepeup() const
bool operator!=(const const_iterator &other) const
void addComment(const std::string &line)
std::vector< std::string >::size_type size_type
const PDF * pdf() const
LHEEventProduct(const lhef::HEPEUP &hepeup, const double originalXWGTUP)
std::auto_ptr< PDF > pdf_
void addWeight(const WGT &wgt)
const std::string * operator->() const
gen::WeightsInfo WGT
std::vector< std::string > comments_
LHEEventProduct(const lhef::HEPEUP &hepeup)
size_type comments_size() const
uint16_t size_type
const std::vector< WGT > & weights() const
const LHEEventProduct * event
comments_const_iterator comments_begin() const
std::vector< WGT > weights_
gen::PdfInfo PDF
const std::string & operator*() const
std::forward_iterator_tag iterator_category
void setPDF(const PDF &pdf)
bool operator==(const const_iterator &other) const
comments_const_iterator comments_end() const
static const unsigned int npos
std::vector< std::string >::const_iterator comments_const_iterator
lhef::HEPEUP hepeup_