CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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.) :
36  value_(value), error_(error) {}
37  XSec(const XSec &other) :
38  value_(other.value_), error_(other.error_) {}
39 
40  double value() const { return value_; }
41  double error() const { return error_; }
42 
43  bool isSet() const { return value_ >= 0.; }
44  bool hasError() const { return error_ >= 0.; }
45 
46  operator double() const { return value_; }
47  operator bool() const { return isSet(); }
48 
49  bool operator == (const XSec &other) const
50  { return value_ == other.value_ && error_ == other.error_; }
51  bool operator != (const XSec &other) const { return !(*this == other); }
52 
53  private:
54  double value_, error_;
55  };
56 
57  // convenience (return the value, prefer externally specified over internal one)
58  double crossSection() const
60 
61  // methods used by EDM
62  bool isProductEqual(const GenRunInfoProduct &other) const;
63 
64  private:
65  // cross sections
66  XSec internalXSec_; // the one computed during cmsRun
67  XSec externalXSecLO_, externalXSecNLO_; // from config file
68  double externalFilterEfficiency_; // from config file
69 };
70 
71 #endif // SimDataFormats_GeneratorProducts_GenRunInfoProduct_h
void setFilterEfficiency(double effic)
XSec(const XSec &other)
void setInternalXSec(const XSec &xsec)
bool operator==(const XSec &other) const
double filterEfficiency() const
const XSec & externalXSecLO() const
double externalFilterEfficiency_
bool isProductEqual(const GenRunInfoProduct &other) const
const XSec & externalXSecNLO() const
XSec(double value, double error=-1.)
const XSec & internalXSec() const
bool operator!=(const XSec &other) const
double crossSection() const
void setExternalXSecNLO(const XSec &xsec)
void setExternalXSecLO(const XSec &xsec)