CMS 3D CMS Logo

GenRunInfoProduct.h
Go to the documentation of this file.
1 #ifndef SimDataFormats_GeneratorProducts_GenRunInfoProduct_h
2 #define SimDataFormats_GeneratorProducts_GenRunInfoProduct_h
3 
9 public:
10  // a few forward declarations
11  struct XSec;
12 
13  // constructors, destructors
16 
17  // getters
18 
19  const XSec &internalXSec() const { return internalXSec_; }
20  const XSec &externalXSecLO() const { return externalXSecLO_; }
21  const XSec &externalXSecNLO() const { return externalXSecNLO_; }
22  double filterEfficiency() const { return externalFilterEfficiency_; }
23 
24  // setters
25 
26  void setInternalXSec(const XSec &xsec) { internalXSec_ = xsec; }
27  void setExternalXSecLO(const XSec &xsec) { externalXSecLO_ = xsec; }
28  void setExternalXSecNLO(const XSec &xsec) { externalXSecNLO_ = xsec; }
29  void setFilterEfficiency(double effic) { externalFilterEfficiency_ = effic; }
30 
31  // struct definitions
32  struct XSec {
33  public:
34  XSec() : value_(-1.), error_(-1.) {}
35  XSec(double value, double error = -1.) : value_(value), error_(error) {}
37 
38  double value() const { return value_; }
39  double error() const { return error_; }
40 
41  bool isSet() const { return value_ >= 0.; }
42  bool hasError() const { return error_ >= 0.; }
43 
44  operator double() const { return value_; }
45  operator bool() const { return isSet(); }
46 
47  bool operator==(const XSec &other) const { return value_ == other.value_ && error_ == other.error_; }
48  bool operator!=(const XSec &other) const { return !(*this == other); }
49 
50  private:
51  double value_, error_;
52  };
53 
54  // convenience (return the value, prefer externally specified over internal one)
56 
57  // methods used by EDM
58  bool isProductEqual(const GenRunInfoProduct &other) const;
59 
60 private:
61  // cross sections
62  XSec internalXSec_; // the one computed during cmsRun
63  XSec externalXSecLO_, externalXSecNLO_; // from config file
64  double externalFilterEfficiency_; // from config file
65 };
66 
67 #endif // SimDataFormats_GeneratorProducts_GenRunInfoProduct_h
bool isProductEqual(const GenRunInfoProduct &other) const
double crossSection() const
bool operator!=(const XSec &other) const
void setFilterEfficiency(double effic)
const XSec & internalXSec() const
XSec(const XSec &other)
double filterEfficiency() const
bool operator==(const XSec &other) const
void setInternalXSec(const XSec &xsec)
Definition: value.py:1
double externalFilterEfficiency_
const XSec & externalXSecLO() const
XSec(double value, double error=-1.)
const XSec & externalXSecNLO() const
void setExternalXSecNLO(const XSec &xsec)
void setExternalXSecLO(const XSec &xsec)