CMS 3D CMS Logo

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 { class GenEvent; } // forward declaration
10 
16  public:
21  virtual ~GenEventInfoProduct();
22 
23  GenEventInfoProduct &operator = (const GenEventInfoProduct &other);
24  GenEventInfoProduct &operator = (GenEventInfoProduct &&other);
25 
26  typedef gen::PdfInfo PDF;
27 
28  // getters
29 
30  std::vector<double> &weights() { return weights_; }
31  const std::vector<double> &weights() const { return weights_; }
32 
33  double weight() const { return weights_.empty() ? 1.0 : weights_[0]; }
34 
35  double weightProduct() const;
36 
37  unsigned int signalProcessID() const { return signalProcessID_; }
38 
39  double qScale() const { return qScale_; }
40  double alphaQCD() const { return alphaQCD_; }
41  double alphaQED() const { return alphaQED_; }
42 
43  const PDF *pdf() const { return pdf_.get(); }
44  bool hasPDF() const { return pdf() != nullptr; }
45 
46  const std::vector<double> &binningValues() const { return binningValues_; }
47  bool hasBinningValues() const { return !binningValues_.empty(); }
48 
49  const std::vector<float> &DJRValues() const { return DJRValues_; }
50  bool hasDJRValues() const { return !DJRValues_.empty(); }
51 
52  int nMEPartons() const { return nMEPartons_; }
53 
54  int nMEPartonsFiltered() const { return nMEPartonsFiltered_; }
55 
56  // setters
57 
58  void setWeights(const std::vector<double> &weights)
59  { weights_ = weights; }
60 
61  void setSignalProcessID(unsigned int procID)
62  { signalProcessID_ = procID; }
63 
64  void setScales(double q = -1., double qcd = -1., double qed = -1.)
65  { qScale_ = q, alphaQCD_ = qcd, alphaQED_ = qed; }
66 
67  void setPDF(const PDF *pdf) { pdf_.reset(pdf ? new PDF(*pdf) : nullptr); }
68 
69  void setBinningValues(const std::vector<double> &values)
70  { binningValues_ = values; }
71 
72  void setDJR(const std::vector<float> &values)
73  {DJRValues_ = values;}
74 
75  void setNMEPartons(int n) {nMEPartons_ = n;}
76 
77  void setNMEPartonsFiltered(int n) {nMEPartonsFiltered_ = n;}
78 
79  private:
80  // HepMC::GenEvent provides a list of weights
81  std::vector<double> weights_;
82 
83  // generator-dependent process ID
84  unsigned int signalProcessID_;
85 
86  // information about scales
87  double qScale_;
88  double alphaQCD_, alphaQED_;
89 
90  // optional PDF info
91  std::auto_ptr<PDF> pdf_;
92 
93  // If event was produced in bis, this contains
94  // the values that were used to define which
95  // bin the event belongs in
96  // This replaces the genEventScale, which only
97  // corresponds to Pythia pthat. The RunInfo
98  // will contain the information what physical
99  // quantity these values actually belong to
100  std::vector<double> binningValues_;
101  std::vector<float> DJRValues_;
104 };
105 
106 #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
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::auto_ptr< PDF > pdf_
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_