CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
GenEventInfoProduct.h
Go to the documentation of this file.
1 #ifndef SimDataFormats_GeneratorProducts_GenEventInfoProduct_h
2 #define SimDataFormats_GeneratorProducts_GenEventInfoProduct_h
3 
4 #include <vector>
5 #include <memory>
6 
8 
9 namespace HepMC {
10  class GenEvent;
11 } // namespace HepMC
12 
18 public:
23  virtual ~GenEventInfoProduct();
24 
27 
28  typedef gen::PdfInfo PDF;
29 
30  // getters
31 
32  std::vector<double> &weights() { return weights_; }
33  const std::vector<double> &weights() const { return weights_; }
34 
35  double weight() const { return weights_.empty() ? 1.0 : weights_[0]; }
36 
37  double weightProduct() const;
38 
39  unsigned int signalProcessID() const { return signalProcessID_; }
40 
41  double qScale() const { return qScale_; }
42  double alphaQCD() const { return alphaQCD_; }
43  double alphaQED() const { return alphaQED_; }
44 
45  const PDF *pdf() const { return pdf_.get(); }
46  bool hasPDF() const { return pdf() != nullptr; }
47 
48  const std::vector<double> &binningValues() const { return binningValues_; }
49  bool hasBinningValues() const { return !binningValues_.empty(); }
50 
51  const std::vector<float> &DJRValues() const { return DJRValues_; }
52  bool hasDJRValues() const { return !DJRValues_.empty(); }
53 
54  int nMEPartons() const { return nMEPartons_; }
55 
56  int nMEPartonsFiltered() const { return nMEPartonsFiltered_; }
57 
58  // setters
59 
60  void setWeights(const std::vector<double> &weights) { weights_ = weights; }
61 
62  void setSignalProcessID(unsigned int procID) { signalProcessID_ = procID; }
63 
64  void setScales(double q = -1., double qcd = -1., double qed = -1.) { qScale_ = q, alphaQCD_ = qcd, alphaQED_ = qed; }
65 
66  void setPDF(const PDF *pdf) { pdf_.reset(pdf ? new PDF(*pdf) : nullptr); }
67 
68  void setBinningValues(const std::vector<double> &values) { binningValues_ = values; }
69 
70  void setDJR(const std::vector<float> &values) { DJRValues_ = values; }
71 
72  void setNMEPartons(int n) { nMEPartons_ = n; }
73 
75 
76 private:
77  // HepMC::GenEvent provides a list of weights
78  std::vector<double> weights_;
79 
80  // generator-dependent process ID
81  unsigned int signalProcessID_;
82 
83  // information about scales
84  double qScale_;
86 
87  // optional PDF info
88  std::unique_ptr<PDF> pdf_;
89 
90  // If event was produced in bis, this contains
91  // the values that were used to define which
92  // bin the event belongs in
93  // This replaces the genEventScale, which only
94  // corresponds to Pythia pthat. The RunInfo
95  // will contain the information what physical
96  // quantity these values actually belong to
97  std::vector<double> binningValues_;
98  std::vector<float> DJRValues_;
101 };
102 
103 #endif // SimDataFormats_GeneratorProducts_GenEventInfoProduct_h
void setNMEPartonsFiltered(int n)
const std::vector< double > & binningValues() const
void setPDF(const PDF *pdf)
const PDF * pdf() const
bool hasBinningValues() const
double alphaQCD() const
const std::vector< float > & DJRValues() const
double weight() const
GenEventInfoProduct & operator=(const GenEventInfoProduct &other)
void setDJR(const std::vector< float > &values)
std::vector< float > DJRValues_
double qScale() const
void setBinningValues(const std::vector< double > &values)
std::vector< double > weights_
bool hasDJRValues() const
void setScales(double q=-1., double qcd=-1., double qed=-1.)
double alphaQED() const
std::unique_ptr< PDF > pdf_
double weightProduct() const
std::vector< double > binningValues_
const std::vector< double > & weights() const
void setWeights(const std::vector< double > &weights)
void setSignalProcessID(unsigned int procID)
std::vector< double > & weights()
int nMEPartonsFiltered() const
unsigned int signalProcessID() const
unsigned int signalProcessID_