CMS 3D CMS Logo

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 comments_const_iterator;
19 
25 
27 
28  ~LHEEventProduct() = default;
29 
30  void setPDF(const PDF &pdf) { pdf_.reset(new PDF(pdf)); }
31  void addWeight(const WGT &wgt) { weights_.push_back(wgt); }
32  void addComment(const std::string &line) { comments_.push_back(line); }
33 
34  double originalXWGTUP() const { return originalXWGTUP_; }
35  const std::vector<WGT> &weights() const { return weights_; }
36 
37  const std::vector<float> &scales() const { return scales_; }
38  void setScales(const std::vector<float> &scales) { scales_ = scales; }
39 
40  int npLO() const { return npLO_; }
41  int npNLO() const { return npNLO_; }
42 
43  void setNpLO(int n) { npLO_ = n; }
44  void setNpNLO(int n) { npNLO_ = n; }
45 
46  const lhef::HEPEUP &hepeup() const { return hepeup_; }
47  const PDF *pdf() const { return pdf_.get(); }
48 
49  size_type comments_size() const { return comments_.size(); }
50  comments_const_iterator comments_begin() const { return comments_.begin(); }
52 
53  const char *getComment(unsigned i) const {
54  if (comments_.empty() || i >= comments_.size())
55  return "";
56  else
57  return (const char *)comments_[i].c_str();
58  }
59 
61  public:
62  typedef std::forward_iterator_tag iterator_category;
64  typedef std::ptrdiff_t difference_type;
65  typedef std::string *pointer;
67 
70 
71  inline bool operator==(const const_iterator &other) const { return line == other.line; }
72  inline bool operator!=(const const_iterator &other) const { return !operator==(other); }
73 
75  next();
76  return *this;
77  }
79  const_iterator orig = *this;
80  next();
81  return orig;
82  }
83 
84  const std::string &operator*() const { return tmp; }
85  const std::string *operator->() const { return &tmp; }
86 
87  private:
88  friend class LHEEventProduct;
89 
90  void next();
91 
93  unsigned int line;
95 
96  static const unsigned int npos = 99999;
97  };
98 
99  const_iterator begin() const;
100  inline const_iterator end() const { return const_iterator(); }
101 
102 private:
104  std::vector<std::string> comments_;
105  std::unique_ptr<PDF> pdf_;
106  std::vector<WGT> weights_;
108  std::vector<float> scales_; //scale value used to exclude EWK-produced partons from matching
109  int npLO_; //number of partons for LO process (used to steer matching/merging)
110  int npNLO_; //number of partons for NLO process (used to steer matching/merging)
111 };
112 
113 #endif // GeneratorEvent_LHEInterface_LHEEventProduct_h
LHEEventProduct::const_iterator::iterator_category
std::forward_iterator_tag iterator_category
Definition: LHEEventProduct.h:62
mps_fire.i
i
Definition: mps_fire.py:428
LHEEventProduct::const_iterator::tmp
std::string tmp
Definition: LHEEventProduct.h:94
LHEEventProduct
Definition: LHEEventProduct.h:12
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
LHEEventProduct::scales_
std::vector< float > scales_
Definition: LHEEventProduct.h:108
LHEEventProduct::hepeup_
lhef::HEPEUP hepeup_
Definition: LHEEventProduct.h:103
LHEEventProduct::size_type
std::vector< std::string >::size_type size_type
Definition: LHEEventProduct.h:18
LHEEventProduct::getComment
const char * getComment(unsigned i) const
Definition: LHEEventProduct.h:53
LHEEventProduct::const_iterator::operator->
const std::string * operator->() const
Definition: LHEEventProduct.h:85
LHEEventProduct::originalXWGTUP
double originalXWGTUP() const
Definition: LHEEventProduct.h:34
LHEEventProduct::const_iterator::pointer
std::string * pointer
Definition: LHEEventProduct.h:65
LHEEventProduct::const_iterator::operator*
const std::string & operator*() const
Definition: LHEEventProduct.h:84
LHEEventProduct::WGT
gen::WeightsInfo WGT
Definition: LHEEventProduct.h:15
LHEEventProduct::setNpLO
void setNpLO(int n)
Definition: LHEEventProduct.h:43
gen::WeightsInfo
Definition: WeightsInfo.h:10
LHEEventProduct::const_iterator::line
unsigned int line
Definition: LHEEventProduct.h:93
LHEEventProduct::npNLO_
int npNLO_
Definition: LHEEventProduct.h:110
LHEEventProduct::npNLO
int npNLO() const
Definition: LHEEventProduct.h:41
LHEEventProduct::end
const_iterator end() const
Definition: LHEEventProduct.h:100
LHEEventProduct::const_iterator
Definition: LHEEventProduct.h:60
LHEEventProduct::const_iterator::reference
std::string & reference
Definition: LHEEventProduct.h:66
LHEEventProduct::weights_
std::vector< WGT > weights_
Definition: LHEEventProduct.h:106
gen::PdfInfo
Definition: PdfInfo.h:11
LHEEventProduct::const_iterator::operator++
const_iterator & operator++()
Definition: LHEEventProduct.h:74
trigger::size_type
uint16_t size_type
Definition: TriggerTypeDefs.h:18
LHEEventProduct::comments_begin
comments_const_iterator comments_begin() const
Definition: LHEEventProduct.h:50
LHEEventProduct::const_iterator::difference_type
std::ptrdiff_t difference_type
Definition: LHEEventProduct.h:64
WeightsInfo.h
trackingPlots.other
other
Definition: trackingPlots.py:1460
LHEEventProduct::const_iterator::operator==
bool operator==(const const_iterator &other) const
Definition: LHEEventProduct.h:71
LHEEventProduct::comments_const_iterator
std::vector< std::string >::const_iterator comments_const_iterator
Definition: LHEEventProduct.h:17
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
LHEEventProduct::const_iterator::next
void next()
Definition: LHEEventProduct.cc:9
LHEEventProduct::npLO_
int npLO_
Definition: LHEEventProduct.h:109
LHEEventProduct::setScales
void setScales(const std::vector< float > &scales)
Definition: LHEEventProduct.h:38
LHEEventProduct::const_iterator::npos
static const unsigned int npos
Definition: LHEEventProduct.h:96
LHEEventProduct::LHEEventProduct
LHEEventProduct()
Definition: LHEEventProduct.h:20
LHEEventProduct::weights
const std::vector< WGT > & weights() const
Definition: LHEEventProduct.h:35
LHEEventProduct::const_iterator::operator!=
bool operator!=(const const_iterator &other) const
Definition: LHEEventProduct.h:72
LHEEventProduct::comments_size
size_type comments_size() const
Definition: LHEEventProduct.h:49
LHEEventProduct::const_iterator::const_iterator
const_iterator()
Definition: LHEEventProduct.h:68
LHEEventProduct::setPDF
void setPDF(const PDF &pdf)
Definition: LHEEventProduct.h:30
LHEEventProduct::LHEEventProduct
LHEEventProduct(const lhef::HEPEUP &hepeup)
Definition: LHEEventProduct.h:21
LHEEventProduct::LHEEventProduct
LHEEventProduct(const lhef::HEPEUP &hepeup, const double originalXWGTUP)
Definition: LHEEventProduct.h:22
lhef::HEPEUP
Definition: LesHouches.h:138
LesHouches.h
LHEEventProduct::const_iterator::operator++
const_iterator operator++(int dummy)
Definition: LHEEventProduct.h:78
LHEEventProduct::PDF
gen::PdfInfo PDF
Definition: LHEEventProduct.h:14
LHEEventProduct::setNpNLO
void setNpNLO(int n)
Definition: LHEEventProduct.h:44
LHEEventProduct::hepeup
const lhef::HEPEUP & hepeup() const
Definition: LHEEventProduct.h:46
LHEEventProduct::const_iterator::event
const LHEEventProduct * event
Definition: LHEEventProduct.h:92
LHEEventProduct::comments_
std::vector< std::string > comments_
Definition: LHEEventProduct.h:104
LHEEventProduct::scales
const std::vector< float > & scales() const
Definition: LHEEventProduct.h:37
LHEEventProduct::comments_end
comments_const_iterator comments_end() const
Definition: LHEEventProduct.h:51
LHEEventProduct::operator=
LHEEventProduct & operator=(LHEEventProduct &&other)=default
LHEEventProduct::pdf
const PDF * pdf() const
Definition: LHEEventProduct.h:47
LHEEventProduct::const_iterator::value_type
std::string value_type
Definition: LHEEventProduct.h:63
LHEEventProduct::originalXWGTUP_
double originalXWGTUP_
Definition: LHEEventProduct.h:107
LHEEventProduct::begin
const_iterator begin() const
Definition: LHEEventProduct.cc:64
LHEEventProduct::const_iterator::~const_iterator
~const_iterator()
Definition: LHEEventProduct.h:69
LHEEventProduct::~LHEEventProduct
~LHEEventProduct()=default
dummy
Definition: DummySelector.h:38
mps_splice.line
line
Definition: mps_splice.py:76
LHEEventProduct::pdf_
std::unique_ptr< PDF > pdf_
Definition: LHEEventProduct.h:105
PdfInfo.h
LHEEventProduct::npLO
int npLO() const
Definition: LHEEventProduct.h:40
LHEEventProduct::addComment
void addComment(const std::string &line)
Definition: LHEEventProduct.h:32
LHEEventProduct::addWeight
void addWeight(const WGT &wgt)
Definition: LHEEventProduct.h:31