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
GenRunInfoProduct::crossSection
double crossSection() const
Definition: GenRunInfoProduct.h:55
electrons_cff.bool
bool
Definition: electrons_cff.py:366
GenRunInfoProduct::isProductEqual
bool isProductEqual(const GenRunInfoProduct &other) const
Definition: GenRunInfoProduct.cc:19
GenRunInfoProduct::setFilterEfficiency
void setFilterEfficiency(double effic)
Definition: GenRunInfoProduct.h:29
GenRunInfoProduct::internalXSec
const XSec & internalXSec() const
Definition: GenRunInfoProduct.h:19
GenRunInfoProduct::setInternalXSec
void setInternalXSec(const XSec &xsec)
Definition: GenRunInfoProduct.h:26
GenRunInfoProduct::XSec::error_
double error_
Definition: GenRunInfoProduct.h:51
GenRunInfoProduct::XSec::XSec
XSec(double value, double error=-1.)
Definition: GenRunInfoProduct.h:35
GenRunInfoProduct::filterEfficiency
double filterEfficiency() const
Definition: GenRunInfoProduct.h:22
GenRunInfoProduct::XSec::value
double value() const
Definition: GenRunInfoProduct.h:38
GenRunInfoProduct::XSec::value_
double value_
Definition: GenRunInfoProduct.h:51
trackingPlots.other
other
Definition: trackingPlots.py:1464
GenRunInfoProduct::XSec::isSet
bool isSet() const
Definition: GenRunInfoProduct.h:41
GenRunInfoProduct
Definition: GenRunInfoProduct.h:8
GenRunInfoProduct::XSec::XSec
XSec()
Definition: GenRunInfoProduct.h:34
GenRunInfoProduct::XSec
Definition: GenRunInfoProduct.h:32
GenRunInfoProduct::externalXSecLO
const XSec & externalXSecLO() const
Definition: GenRunInfoProduct.h:20
GenRunInfoProduct::XSec::operator!=
bool operator!=(const XSec &other) const
Definition: GenRunInfoProduct.h:48
value
Definition: value.py:1
GenRunInfoProduct::externalFilterEfficiency_
double externalFilterEfficiency_
Definition: GenRunInfoProduct.h:64
GenRunInfoProduct::XSec::XSec
XSec(const XSec &other)
Definition: GenRunInfoProduct.h:36
GenRunInfoProduct::internalXSec_
XSec internalXSec_
Definition: GenRunInfoProduct.h:62
GenRunInfoProduct::externalXSecNLO_
XSec externalXSecNLO_
Definition: GenRunInfoProduct.h:63
GenRunInfoProduct::externalXSecLO_
XSec externalXSecLO_
Definition: GenRunInfoProduct.h:63
GenRunInfoProduct::externalXSecNLO
const XSec & externalXSecNLO() const
Definition: GenRunInfoProduct.h:21
GenRunInfoProduct::XSec::error
double error() const
Definition: GenRunInfoProduct.h:39
GenRunInfoProduct::GenRunInfoProduct
GenRunInfoProduct()
Definition: GenRunInfoProduct.cc:11
GenRunInfoProduct::setExternalXSecLO
void setExternalXSecLO(const XSec &xsec)
Definition: GenRunInfoProduct.h:27
GenRunInfoProduct::XSec::operator==
bool operator==(const XSec &other) const
Definition: GenRunInfoProduct.h:47
GenRunInfoProduct::setExternalXSecNLO
void setExternalXSecNLO(const XSec &xsec)
Definition: GenRunInfoProduct.h:28
GenRunInfoProduct::XSec::hasError
bool hasError() const
Definition: GenRunInfoProduct.h:42