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  virtual ~GenRunInfoProduct();
17 
18  // getters
19 
20  const XSec &internalXSec() const { return internalXSec_; }
21  const XSec &externalXSecLO() const { return externalXSecLO_; }
22  const XSec &externalXSecNLO() const { return externalXSecNLO_; }
23  double filterEfficiency() const { return externalFilterEfficiency_; }
24 
25  // setters
26 
27  void setInternalXSec(const XSec &xsec) { internalXSec_ = xsec; }
28  void setExternalXSecLO(const XSec &xsec) { externalXSecLO_ = xsec; }
29  void setExternalXSecNLO(const XSec &xsec) { externalXSecNLO_ = xsec; }
30  void setFilterEfficiency(double effic) { externalFilterEfficiency_ = effic; }
31 
32  // struct definitions
33  struct XSec {
34  public:
35  XSec() : value_(-1.), error_(-1.) {}
36  XSec(double value, double error = -1.) :
37  value_(value), error_(error) {}
38  XSec(const XSec &other) :
39  value_(other.value_), error_(other.error_) {}
40 
41  double value() const { return value_; }
42  double error() const { return error_; }
43 
44  bool isSet() const { return value_ >= 0.; }
45  bool hasError() const { return error_ >= 0.; }
46 
47  operator double() const { return value_; }
48  operator bool() const { return isSet(); }
49 
50  bool operator == (const XSec &other) const
51  { return value_ == other.value_ && error_ == other.error_; }
52  bool operator != (const XSec &other) const { return !(*this == other); }
53 
54  private:
55  double value_, error_;
56  };
57 
58  // convenience (return the value, prefer externally specified over internal one)
59  double crossSection() const
61 
62  // methods used by EDM
63  virtual bool mergeProduct(const GenRunInfoProduct &other);
64  virtual bool isProductEqual(const GenRunInfoProduct &other) const;
65 
66  private:
67  // cross sections
68  XSec internalXSec_; // the one computed during cmsRun
69  XSec externalXSecLO_, externalXSecNLO_; // from config file
70  double externalFilterEfficiency_; // from config file
71 };
72 
73 #endif // SimDataFormats_GeneratorProducts_GenRunInfoProduct_h
void setFilterEfficiency(double effic)
XSec(const XSec &other)
void setInternalXSec(const XSec &xsec)
virtual bool mergeProduct(const GenRunInfoProduct &other)
bool operator==(const XSec &other) const
double filterEfficiency() const
const XSec & externalXSecLO() const
double externalFilterEfficiency_
virtual bool isProductEqual(const GenRunInfoProduct &other) const
const XSec & externalXSecNLO() const
XSec(double value, double error=-1.)
const XSec & internalXSec() const
virtual ~GenRunInfoProduct()
bool operator!=(const XSec &other) const
double crossSection() const
void setExternalXSecNLO(const XSec &xsec)
void setExternalXSecLO(const XSec &xsec)