CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
GenEventInfoProduct Class Reference

#include <GenEventInfoProduct.h>

Public Types

typedef gen::PdfInfo PDF
 

Public Member Functions

double alphaQCD () const
 
double alphaQED () const
 
const std::vector< double > & binningValues () const
 
const std::vector< float > & DJRValues () const
 
 GenEventInfoProduct ()
 
 GenEventInfoProduct (const HepMC::GenEvent *evt)
 
 GenEventInfoProduct (const GenEventInfoProduct &other)
 
 GenEventInfoProduct (GenEventInfoProduct &&other)
 
bool hasBinningValues () const
 
bool hasDJRValues () const
 
bool hasPDF () const
 
int nMEPartons () const
 
int nMEPartonsFiltered () const
 
GenEventInfoProductoperator= (const GenEventInfoProduct &other)
 
GenEventInfoProductoperator= (GenEventInfoProduct &&other)
 
const PDFpdf () const
 
double qScale () const
 
void setBinningValues (const std::vector< double > &values)
 
void setDJR (const std::vector< float > &values)
 
void setNMEPartons (int n)
 
void setNMEPartonsFiltered (int n)
 
void setPDF (const PDF *pdf)
 
void setScales (double q=-1., double qcd=-1., double qed=-1.)
 
void setSignalProcessID (unsigned int procID)
 
void setWeights (const std::vector< double > &weights)
 
unsigned int signalProcessID () const
 
double weight () const
 
double weightProduct () const
 
std::vector< double > & weights ()
 
const std::vector< double > & weights () const
 
virtual ~GenEventInfoProduct ()
 

Private Attributes

double alphaQCD_
 
double alphaQED_
 
std::vector< double > binningValues_
 
std::vector< float > DJRValues_
 
int nMEPartons_
 
int nMEPartonsFiltered_
 
std::auto_ptr< PDFpdf_
 
double qScale_
 
unsigned int signalProcessID_
 
std::vector< double > weights_
 

Detailed Description

Definition at line 15 of file GenEventInfoProduct.h.

Member Typedef Documentation

Definition at line 26 of file GenEventInfoProduct.h.

Constructor & Destructor Documentation

GenEventInfoProduct::GenEventInfoProduct ( )
GenEventInfoProduct::GenEventInfoProduct ( const HepMC::GenEvent evt)

Definition at line 22 of file GenEventInfoProduct.cc.

References gen::PdfInfo::id, pdf(), gen::PdfInfo::scalePDF, setPDF(), gen::PdfInfo::x, and gen::PdfInfo::xPDF.

22  :
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 }
void setPDF(const PDF *pdf)
const PDF * pdf() const
std::vector< double > weights_
std::pair< int, int > id
Definition: PdfInfo.h:12
unsigned int signalProcessID_
GenEventInfoProduct::GenEventInfoProduct ( const GenEventInfoProduct other)

Definition at line 43 of file GenEventInfoProduct.cc.

References pdf(), and setPDF().

43  :
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 }
void setPDF(const PDF *pdf)
const PDF * pdf() const
std::vector< float > DJRValues_
std::vector< double > weights_
std::vector< double > binningValues_
unsigned int signalProcessID_
GenEventInfoProduct::GenEventInfoProduct ( GenEventInfoProduct &&  other)

Definition at line 56 of file GenEventInfoProduct.cc.

56  :
57  weights_(std::move(other.weights_)),
59  qScale_(other.qScale_),
60  alphaQCD_(other.alphaQCD_),
61  alphaQED_(other.alphaQED_),
62  pdf_(other.pdf_.release()),
66 {
67 }
std::vector< float > DJRValues_
std::vector< double > weights_
std::auto_ptr< PDF > pdf_
std::vector< double > binningValues_
unsigned int signalProcessID_
def move(src, dest)
Definition: eostools.py:511
GenEventInfoProduct::~GenEventInfoProduct ( )
virtual

Definition at line 71 of file GenEventInfoProduct.cc.

72 {
73 }

Member Function Documentation

double GenEventInfoProduct::alphaQCD ( ) const
inline
double GenEventInfoProduct::alphaQED ( ) const
inline
const std::vector<double>& GenEventInfoProduct::binningValues ( ) const
inline
const std::vector<float>& GenEventInfoProduct::DJRValues ( ) const
inline

Definition at line 49 of file GenEventInfoProduct.h.

Referenced by CompareGeneratorResultsAnalyzer::globalEndLuminosityBlock().

49 { return DJRValues_; }
std::vector< float > DJRValues_
bool GenEventInfoProduct::hasBinningValues ( ) const
inline

Definition at line 47 of file GenEventInfoProduct.h.

Referenced by JetTester::analyze(), L1GenTreeProducer::analyze(), and JetTester_HeavyIons::analyze().

47 { return !binningValues_.empty(); }
std::vector< double > binningValues_
bool GenEventInfoProduct::hasDJRValues ( ) const
inline

Definition at line 50 of file GenEventInfoProduct.h.

50 { return !DJRValues_.empty(); }
std::vector< float > DJRValues_
bool GenEventInfoProduct::hasPDF ( ) const
inline

Definition at line 44 of file GenEventInfoProduct.h.

44 { return pdf() != nullptr; }
const PDF * pdf() const
int GenEventInfoProduct::nMEPartons ( ) const
inline
int GenEventInfoProduct::nMEPartonsFiltered ( ) const
inline
GenEventInfoProduct & GenEventInfoProduct::operator= ( const GenEventInfoProduct other)

Definition at line 75 of file GenEventInfoProduct.cc.

References alphaQCD_, alphaQED_, binningValues_, DJRValues_, nMEPartons_, nMEPartonsFiltered_, pdf(), qScale_, setPDF(), signalProcessID_, and weights_.

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 }
void setPDF(const PDF *pdf)
const PDF * pdf() const
std::vector< float > DJRValues_
std::vector< double > weights_
std::vector< double > binningValues_
unsigned int signalProcessID_
GenEventInfoProduct & GenEventInfoProduct::operator= ( GenEventInfoProduct &&  other)

Definition at line 92 of file GenEventInfoProduct.cc.

References alphaQCD_, alphaQED_, binningValues_, DJRValues_, eostools::move(), nMEPartons_, nMEPartonsFiltered_, trackingPlots::other, pdf_, qScale_, signalProcessID_, and weights_.

93 {
94  weights_ = std::move(other.weights_);
96  qScale_ = other.qScale_;
97  alphaQCD_ = other.alphaQCD_;
98  alphaQED_ = other.alphaQED_;
101  nMEPartons_=other.nMEPartons_;
103  pdf_.reset(other.pdf_.release());
104 
105  return *this;
106 }
std::vector< float > DJRValues_
std::vector< double > weights_
std::auto_ptr< PDF > pdf_
std::vector< double > binningValues_
unsigned int signalProcessID_
def move(src, dest)
Definition: eostools.py:511
const PDF* GenEventInfoProduct::pdf ( ) const
inline
double GenEventInfoProduct::qScale ( ) const
inline
void GenEventInfoProduct::setBinningValues ( const std::vector< double > &  values)
inline
void GenEventInfoProduct::setDJR ( const std::vector< float > &  values)
inline
void GenEventInfoProduct::setNMEPartons ( int  n)
inline

Definition at line 75 of file GenEventInfoProduct.h.

References gen::n.

void GenEventInfoProduct::setNMEPartonsFiltered ( int  n)
inline

Definition at line 77 of file GenEventInfoProduct.h.

References gen::n.

void GenEventInfoProduct::setPDF ( const PDF pdf)
inline

Definition at line 67 of file GenEventInfoProduct.h.

Referenced by GenEventInfoProduct(), and operator=().

67 { pdf_.reset(pdf ? new PDF(*pdf) : nullptr); }
const PDF * pdf() const
std::auto_ptr< PDF > pdf_
void GenEventInfoProduct::setScales ( double  q = -1.,
double  qcd = -1.,
double  qed = -1. 
)
inline

Definition at line 64 of file GenEventInfoProduct.h.

References lumiQueryAPI::q.

void GenEventInfoProduct::setSignalProcessID ( unsigned int  procID)
inline

Definition at line 61 of file GenEventInfoProduct.h.

62  { signalProcessID_ = procID; }
unsigned int signalProcessID_
void GenEventInfoProduct::setWeights ( const std::vector< double > &  weights)
inline

Definition at line 58 of file GenEventInfoProduct.h.

References HGCalRecHit_cfi::weights.

59  { weights_ = weights; }
std::vector< double > weights_
std::vector< double > & weights()
unsigned int GenEventInfoProduct::signalProcessID ( ) const
inline
double GenEventInfoProduct::weight ( ) const
inline
double GenEventInfoProduct::weightProduct ( ) const

Definition at line 109 of file GenEventInfoProduct.cc.

References weights_.

110 {
111  return std::accumulate(weights_.begin(), weights_.end(),
112  1., std::multiplies<double>());
113 }
std::vector< double > weights_
std::vector<double>& GenEventInfoProduct::weights ( )
inline
const std::vector<double>& GenEventInfoProduct::weights ( ) const
inline

Definition at line 31 of file GenEventInfoProduct.h.

31 { return weights_; }
std::vector< double > weights_

Member Data Documentation

double GenEventInfoProduct::alphaQCD_
private

Definition at line 88 of file GenEventInfoProduct.h.

Referenced by operator=().

double GenEventInfoProduct::alphaQED_
private

Definition at line 88 of file GenEventInfoProduct.h.

Referenced by operator=().

std::vector<double> GenEventInfoProduct::binningValues_
private

Definition at line 100 of file GenEventInfoProduct.h.

Referenced by operator=().

std::vector<float> GenEventInfoProduct::DJRValues_
private

Definition at line 101 of file GenEventInfoProduct.h.

Referenced by operator=().

int GenEventInfoProduct::nMEPartons_
private

Definition at line 102 of file GenEventInfoProduct.h.

Referenced by operator=().

int GenEventInfoProduct::nMEPartonsFiltered_
private

Definition at line 103 of file GenEventInfoProduct.h.

Referenced by operator=().

std::auto_ptr<PDF> GenEventInfoProduct::pdf_
private

Definition at line 91 of file GenEventInfoProduct.h.

Referenced by operator=().

double GenEventInfoProduct::qScale_
private

Definition at line 87 of file GenEventInfoProduct.h.

Referenced by operator=().

unsigned int GenEventInfoProduct::signalProcessID_
private

Definition at line 84 of file GenEventInfoProduct.h.

Referenced by operator=().

std::vector<double> GenEventInfoProduct::weights_
private

Definition at line 81 of file GenEventInfoProduct.h.

Referenced by operator=(), and weightProduct().