CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GenEventInfoProduct.cc
Go to the documentation of this file.
1 #include <functional>
2 #include <numeric>
3 using std::ptrdiff_t;
4 
5 #include <HepMC/GenEvent.h>
6 #include <HepMC/WeightContainer.h>
7 #include <HepMC/PdfInfo.h>
8 
10 
12 
13 using namespace edm;
14 using namespace std;
15 
17  signalProcessID_(0), qScale_(-1.), alphaQCD_(-1.), alphaQED_(-1.),
18  nMEPartons_(-1), nMEPartonsFiltered_(-1)
19 {
20 }
21 
22 GenEventInfoProduct::GenEventInfoProduct(const HepMC::GenEvent *evt) :
23  weights_(evt->weights().begin(), evt->weights().end()),
24  signalProcessID_(evt->signal_process_id()),
25  qScale_(evt->event_scale()),
26  alphaQCD_(evt->alphaQCD()),
27  alphaQED_(evt->alphaQED()),
28  nMEPartons_(-1), nMEPartonsFiltered_(-1)
29 {
30  const HepMC::PdfInfo *hepPDF = evt->pdf_info();
31  if (hepPDF) {
32  PDF pdf;
33 
34  pdf.id = std::make_pair(hepPDF->id1(), hepPDF->id2());
35  pdf.x = std::make_pair(hepPDF->x1(), hepPDF->x2());
36  pdf.xPDF = std::make_pair(hepPDF->pdf1(), hepPDF->pdf2());
37  pdf.scalePDF = hepPDF->scalePDF();
38 
39  setPDF(&pdf);
40  }
41 }
42 
44  weights_(other.weights_),
45  signalProcessID_(other.signalProcessID_),
46  qScale_(other.qScale_),
47  alphaQCD_(other.alphaQCD_),
48  alphaQED_(other.alphaQED_),
49  binningValues_(other.binningValues_),
50  DJRValues_(other.DJRValues_),
51  nMEPartons_(other.nMEPartons_), nMEPartonsFiltered_(other.nMEPartons_)
52 {
53  setPDF(other.pdf());
54 }
55 
57 {
58 }
59 
61 {
62  weights_ = other.weights_;
64  qScale_ = other.qScale_;
65  alphaQCD_ = other.alphaQCD_;
66  alphaQED_ = other.alphaQED_;
68  DJRValues_ = other.DJRValues_;
71 
72  setPDF(other.pdf());
73 
74  return *this;
75 }
76 
78 {
79  return std::accumulate(weights_.begin(), weights_.end(),
80  1., std::multiplies<double>());
81 }
void setPDF(const PDF *pdf)
const PDF * pdf() const
std::pair< double, double > x
Definition: PdfInfo.h:11
GenEventInfoProduct & operator=(const GenEventInfoProduct &other)
std::pair< double, double > xPDF
Definition: PdfInfo.h:12
std::vector< float > DJRValues_
std::vector< double > weights_
#define end
Definition: vmac.h:38
std::pair< int, int > id
Definition: PdfInfo.h:10
double weightProduct() const
std::vector< double > binningValues_
#define begin
Definition: vmac.h:31
unsigned int signalProcessID_
double scalePDF
Definition: PdfInfo.h:13