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