CMS 3D CMS Logo

GenEventInfoProduct3.h
Go to the documentation of this file.
1 #ifndef SimDataFormats_GeneratorProducts_GenEventInfoProduct3_h
2 #define SimDataFormats_GeneratorProducts_GenEventInfoProduct3_h
3 
4 #include <vector>
5 #include <memory>
6 
8 
9 namespace HepMC3 {
10  class GenEvent;
11 } // namespace HepMC3
12 
18 public:
20  GenEventInfoProduct3(const HepMC3::GenEvent *evt);
23  virtual ~GenEventInfoProduct3();
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  // HepMC3::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_GenEventInfoProduct3_h
void setPDF(const PDF *pdf)
const std::vector< float > & DJRValues() const
const PDF * pdf() const
GenEventInfoProduct3 & operator=(const GenEventInfoProduct3 &other)
unsigned int signalProcessID() const
void setScales(double q=-1., double qcd=-1., double qed=-1.)
std::vector< double > weights_
std::vector< float > DJRValues_
std::vector< double > & weights()
void setDJR(const std::vector< float > &values)
const std::vector< double > & binningValues() const
void setSignalProcessID(unsigned int procID)
const std::vector< double > & weights() const
void setBinningValues(const std::vector< double > &values)
void setWeights(const std::vector< double > &weights)
std::vector< double > binningValues_
std::unique_ptr< PDF > pdf_