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.), nMEPartons_(-1), nMEPartonsFiltered_(-1) {}
18 
20  : weights_(evt->weights().begin(), evt->weights().end()),
21  signalProcessID_(evt->signal_process_id()),
22  qScale_(evt->event_scale()),
23  alphaQCD_(evt->alphaQCD()),
24  alphaQED_(evt->alphaQED()),
25  nMEPartons_(-1),
26  nMEPartonsFiltered_(-1) {
27  const HepMC::PdfInfo *hepPDF = evt->pdf_info();
28  if (hepPDF) {
29  PDF pdf;
30 
31  pdf.id = std::make_pair(hepPDF->id1(), hepPDF->id2());
32  pdf.x = std::make_pair(hepPDF->x1(), hepPDF->x2());
33  pdf.xPDF = std::make_pair(hepPDF->pdf1(), hepPDF->pdf2());
34  pdf.scalePDF = hepPDF->scalePDF();
35 
36  setPDF(&pdf);
37  }
38 }
39 
41  : weights_(other.weights_),
42  signalProcessID_(other.signalProcessID_),
43  qScale_(other.qScale_),
44  alphaQCD_(other.alphaQCD_),
45  alphaQED_(other.alphaQED_),
46  binningValues_(other.binningValues_),
47  DJRValues_(other.DJRValues_),
48  nMEPartons_(other.nMEPartons_),
49  nMEPartonsFiltered_(other.nMEPartons_) {
50  setPDF(other.pdf());
51 }
52 
54  : weights_(std::move(other.weights_)),
55  signalProcessID_(other.signalProcessID_),
56  qScale_(other.qScale_),
57  alphaQCD_(other.alphaQCD_),
58  alphaQED_(other.alphaQED_),
59  pdf_(other.pdf_.release()),
60  binningValues_(std::move(other.binningValues_)),
61  DJRValues_(std::move(other.DJRValues_)),
62  nMEPartons_(other.nMEPartons_),
63  nMEPartonsFiltered_(other.nMEPartons_) {}
64 
66 
68  weights_ = other.weights_;
69  signalProcessID_ = other.signalProcessID_;
70  qScale_ = other.qScale_;
71  alphaQCD_ = other.alphaQCD_;
72  alphaQED_ = other.alphaQED_;
73  binningValues_ = other.binningValues_;
74  DJRValues_ = other.DJRValues_;
75  nMEPartons_ = other.nMEPartons_;
76  nMEPartonsFiltered_ = other.nMEPartonsFiltered_;
77 
78  setPDF(other.pdf());
79 
80  return *this;
81 }
82 
84  weights_ = std::move(other.weights_);
85  signalProcessID_ = other.signalProcessID_;
86  qScale_ = other.qScale_;
87  alphaQCD_ = other.alphaQCD_;
88  alphaQED_ = other.alphaQED_;
89  binningValues_ = std::move(other.binningValues_);
90  DJRValues_ = std::move(other.DJRValues_);
91  nMEPartons_ = other.nMEPartons_;
92  nMEPartonsFiltered_ = other.nMEPartonsFiltered_;
93  pdf_ = std::move(other.pdf_);
94 
95  return *this;
96 }
97 
99  return std::accumulate(weights_.begin(), weights_.end(), 1., std::multiplies<double>());
100 }
void setPDF(const PDF *pdf)
std::pair< double, double > x
Definition: PdfInfo.h:13
double weightProduct() const
GenEventInfoProduct & operator=(const GenEventInfoProduct &other)
std::pair< double, double > xPDF
Definition: PdfInfo.h:14
std::vector< float > DJRValues_
std::vector< double > weights_
std::pair< int, int > id
Definition: PdfInfo.h:12
std::unique_ptr< PDF > pdf_
std::vector< double > binningValues_
const PDF * pdf() const
HLT enums.
unsigned int signalProcessID_
double scalePDF
Definition: PdfInfo.h:15
def move(src, dest)
Definition: eostools.py:511