test
CMS 3D CMS Logo

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