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 }
GenEventInfoProduct::alphaQED_
double alphaQED_
Definition: GenEventInfoProduct.h:85
GenEventInfoProduct
Definition: GenEventInfoProduct.h:17
GenEventInfoProduct::GenEventInfoProduct
GenEventInfoProduct()
Definition: GenEventInfoProduct.cc:16
GenEventInfoProduct::qScale_
double qScale_
Definition: GenEventInfoProduct.h:84
MessageLogger.h
GenEventInfoProduct::pdf
const PDF * pdf() const
Definition: GenEventInfoProduct.h:45
gen::PdfInfo::x
std::pair< double, double > x
Definition: PdfInfo.h:13
GenEventInfoProduct::DJRValues_
std::vector< float > DJRValues_
Definition: GenEventInfoProduct.h:98
edm
HLT enums.
Definition: AlignableModifier.h:19
GenEventInfoProduct::~GenEventInfoProduct
virtual ~GenEventInfoProduct()
Definition: GenEventInfoProduct.cc:65
GenEventInfoProduct::binningValues_
std::vector< double > binningValues_
Definition: GenEventInfoProduct.h:97
HepMC::GenEvent
Definition: hepmc_rootio.cc:9
gen::PdfInfo
Definition: PdfInfo.h:11
GenEventInfoProduct::weights_
std::vector< double > weights_
Definition: GenEventInfoProduct.h:78
GenEventInfoProduct::alphaQCD_
double alphaQCD_
Definition: GenEventInfoProduct.h:85
HLT_FULL_cff.weights
weights
Definition: HLT_FULL_cff.py:99166
mps_fire.end
end
Definition: mps_fire.py:242
gen::PdfInfo::xPDF
std::pair< double, double > xPDF
Definition: PdfInfo.h:14
GenEventInfoProduct::signalProcessID_
unsigned int signalProcessID_
Definition: GenEventInfoProduct.h:81
trackingPlots.other
other
Definition: trackingPlots.py:1460
GenEventInfoProduct.h
fetchall_from_DQM_v2.release
release
Definition: fetchall_from_DQM_v2.py:92
GenEventInfoProduct::operator=
GenEventInfoProduct & operator=(const GenEventInfoProduct &other)
Definition: GenEventInfoProduct.cc:67
GenEventInfoProduct::nMEPartons_
int nMEPartons_
Definition: GenEventInfoProduct.h:99
gen::PdfInfo::scalePDF
double scalePDF
Definition: PdfInfo.h:15
GenEventInfoProduct::weightProduct
double weightProduct() const
Definition: GenEventInfoProduct.cc:98
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
GenEventInfoProduct::pdf_
std::unique_ptr< PDF > pdf_
Definition: GenEventInfoProduct.h:88
gen::PdfInfo::id
std::pair< int, int > id
Definition: PdfInfo.h:12
GenEventInfoProduct::nMEPartonsFiltered_
int nMEPartonsFiltered_
Definition: GenEventInfoProduct.h:100
GenEventInfoProduct::setPDF
void setPDF(const PDF *pdf)
Definition: GenEventInfoProduct.h:66