CMS 3D CMS Logo

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 
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()),
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_),
46  qScale_(other.qScale_),
47  alphaQCD_(other.alphaQCD_),
48  alphaQED_(other.alphaQED_),
50  DJRValues_(other.DJRValues_),
52 {
53  setPDF(other.pdf());
54 }
55 
66 {
67 }
68 
69 
70 
72 {
73 }
74 
76 {
77  weights_ = other.weights_;
79  qScale_ = other.qScale_;
80  alphaQCD_ = other.alphaQCD_;
81  alphaQED_ = other.alphaQED_;
83  DJRValues_ = other.DJRValues_;
86 
87  setPDF(other.pdf());
88 
89  return *this;
90 }
91 
93 {
94  weights_ = std::move(other.weights_);
95  signalProcessID_ = other.signalProcessID_;
96  qScale_ = other.qScale_;
97  alphaQCD_ = other.alphaQCD_;
98  alphaQED_ = other.alphaQED_;
99  binningValues_ = std::move(other.binningValues_);
100  DJRValues_ = std::move(other.DJRValues_);
101  nMEPartons_=other.nMEPartons_;
102  nMEPartonsFiltered_=other.nMEPartonsFiltered_;
103  pdf_.reset(other.pdf_.release());
104 
105  return *this;
106 }
107 
108 
110 {
111  return std::accumulate(weights_.begin(), weights_.end(),
112  1., std::multiplies<double>());
113 }
void setPDF(const PDF *pdf)
const PDF * pdf() const
double alphaQCD() const
std::pair< double, double > x
Definition: PdfInfo.h:13
GenEventInfoProduct & operator=(const GenEventInfoProduct &other)
std::pair< double, double > xPDF
Definition: PdfInfo.h:14
std::vector< float > DJRValues_
std::vector< double > weights_
#define end
Definition: vmac.h:39
double alphaQED() const
std::auto_ptr< PDF > pdf_
std::pair< int, int > id
Definition: PdfInfo.h:12
double weightProduct() const
std::vector< double > binningValues_
#define begin
Definition: vmac.h:32
HLT enums.
std::vector< double > & weights()
unsigned int signalProcessID_
double scalePDF
Definition: PdfInfo.h:15
def move(src, dest)
Definition: eostools.py:511