CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
 
 GenEventInfoProduct ()
 
 GenEventInfoProduct (const HepMC::GenEvent *evt)
 
 GenEventInfoProduct (const GenEventInfoProduct &other)
 
bool hasBinningValues () const
 
bool hasPDF () const
 
GenEventInfoProductoperator= (const GenEventInfoProduct &other)
 
const PDFpdf () const
 
double qScale () const
 
void setBinningValues (const std::vector< double > &values)
 
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
 
const std::vector< double > & weights () const
 
virtual ~GenEventInfoProduct ()
 

Private Attributes

double alphaQCD_
 
double alphaQED_
 
std::vector< double > binningValues_
 
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 24 of file GenEventInfoProduct.h.

Constructor & Destructor Documentation

GenEventInfoProduct::GenEventInfoProduct ( )

Definition at line 16 of file GenEventInfoProduct.cc.

16  :
17  signalProcessID_(0), qScale_(-1.), alphaQCD_(-1.), alphaQED_(-1.)
18 {
19 }
unsigned int signalProcessID_
GenEventInfoProduct::GenEventInfoProduct ( const HepMC::GenEvent *  evt)

Definition at line 21 of file GenEventInfoProduct.cc.

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

21  :
22  weights_(evt->weights().begin(), evt->weights().end()),
23  signalProcessID_(evt->signal_process_id()),
24  qScale_(evt->event_scale()),
25  alphaQCD_(evt->alphaQCD()),
26  alphaQED_(evt->alphaQED())
27 {
28  const HepMC::PdfInfo *hepPDF = evt->pdf_info();
29  if (hepPDF) {
30  PDF pdf;
31 
32  pdf.id = std::make_pair(hepPDF->id1(), hepPDF->id2());
33  pdf.x = std::make_pair(hepPDF->x1(), hepPDF->x2());
34  pdf.xPDF = std::make_pair(hepPDF->pdf1(), hepPDF->pdf2());
35  pdf.scalePDF = hepPDF->scalePDF();
36 
37  setPDF(&pdf);
38  }
39 }
void setPDF(const PDF *pdf)
const PDF * pdf() const
std::vector< double > weights_
std::pair< int, int > id
Definition: PdfInfo.h:10
unsigned int signalProcessID_
GenEventInfoProduct::GenEventInfoProduct ( const GenEventInfoProduct other)

Definition at line 41 of file GenEventInfoProduct.cc.

References pdf(), and setPDF().

41  :
42  weights_(other.weights_),
44  qScale_(other.qScale_),
45  alphaQCD_(other.alphaQCD_),
46  alphaQED_(other.alphaQED_),
48 {
49  setPDF(other.pdf());
50 }
void setPDF(const PDF *pdf)
const PDF * pdf() const
std::vector< double > weights_
std::vector< double > binningValues_
unsigned int signalProcessID_
GenEventInfoProduct::~GenEventInfoProduct ( )
virtual

Definition at line 52 of file GenEventInfoProduct.cc.

53 {
54 }

Member Function Documentation

double GenEventInfoProduct::alphaQCD ( ) const
inline

Definition at line 34 of file GenEventInfoProduct.h.

References alphaQCD_.

34 { return alphaQCD_; }
double GenEventInfoProduct::alphaQED ( ) const
inline

Definition at line 35 of file GenEventInfoProduct.h.

References alphaQED_.

35 { return alphaQED_; }
const std::vector<double>& GenEventInfoProduct::binningValues ( ) const
inline

Definition at line 40 of file GenEventInfoProduct.h.

References binningValues_.

40 { return binningValues_; }
std::vector< double > binningValues_
bool GenEventInfoProduct::hasBinningValues ( ) const
inline

Definition at line 41 of file GenEventInfoProduct.h.

References binningValues_.

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

Definition at line 38 of file GenEventInfoProduct.h.

References pdf().

38 { return pdf() != 0; }
const PDF * pdf() const
GenEventInfoProduct & GenEventInfoProduct::operator= ( const GenEventInfoProduct other)

Definition at line 56 of file GenEventInfoProduct.cc.

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

57 {
58  weights_ = other.weights_;
60  qScale_ = other.qScale_;
61  alphaQCD_ = other.alphaQCD_;
62  alphaQED_ = other.alphaQED_;
64 
65  setPDF(other.pdf());
66 
67  return *this;
68 }
void setPDF(const PDF *pdf)
const PDF * pdf() const
std::vector< double > weights_
std::vector< double > binningValues_
unsigned int signalProcessID_
const PDF* GenEventInfoProduct::pdf ( ) const
inline

Definition at line 37 of file GenEventInfoProduct.h.

References pdf_.

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

37 { return pdf_.get(); }
std::auto_ptr< PDF > pdf_
double GenEventInfoProduct::qScale ( ) const
inline

Definition at line 33 of file GenEventInfoProduct.h.

References qScale_.

33 { return qScale_; }
void GenEventInfoProduct::setBinningValues ( const std::vector< double > &  values)
inline

Definition at line 56 of file GenEventInfoProduct.h.

References binningValues_, and makeHLTPrescaleTable::values.

void GenEventInfoProduct::setPDF ( const PDF pdf)
inline

Definition at line 54 of file GenEventInfoProduct.h.

References pdf_.

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

54 { pdf_.reset(pdf ? new PDF(*pdf) : 0); }
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 51 of file GenEventInfoProduct.h.

References alphaQCD_, alphaQED_, lumiQueryAPI::q, and qScale_.

void GenEventInfoProduct::setSignalProcessID ( unsigned int  procID)
inline

Definition at line 48 of file GenEventInfoProduct.h.

References signalProcessID_.

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

Definition at line 45 of file GenEventInfoProduct.h.

References weights(), and weights_.

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

Definition at line 31 of file GenEventInfoProduct.h.

References signalProcessID_.

31 { return signalProcessID_; }
unsigned int signalProcessID_
double GenEventInfoProduct::weight ( void  ) const

Definition at line 70 of file GenEventInfoProduct.cc.

References weights_.

Referenced by cuy.ValElement::__init__(), cuy.additionElement::__init__(), cuy.superimposeElement::__init__(), and cuy.graphElement::__init__().

71 {
72  return std::accumulate(weights_.begin(), weights_.end(),
73  1., std::multiplies<double>());
74 }
std::vector< double > weights_
const std::vector<double>& GenEventInfoProduct::weights ( ) const
inline

Definition at line 28 of file GenEventInfoProduct.h.

References weights_.

Referenced by setWeights().

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

Member Data Documentation

double GenEventInfoProduct::alphaQCD_
private

Definition at line 68 of file GenEventInfoProduct.h.

Referenced by alphaQCD(), operator=(), and setScales().

double GenEventInfoProduct::alphaQED_
private

Definition at line 68 of file GenEventInfoProduct.h.

Referenced by alphaQED(), operator=(), and setScales().

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

Definition at line 80 of file GenEventInfoProduct.h.

Referenced by binningValues(), hasBinningValues(), operator=(), and setBinningValues().

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

Definition at line 71 of file GenEventInfoProduct.h.

Referenced by pdf(), and setPDF().

double GenEventInfoProduct::qScale_
private

Definition at line 67 of file GenEventInfoProduct.h.

Referenced by operator=(), qScale(), and setScales().

unsigned int GenEventInfoProduct::signalProcessID_
private

Definition at line 64 of file GenEventInfoProduct.h.

Referenced by operator=(), setSignalProcessID(), and signalProcessID().

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

Definition at line 61 of file GenEventInfoProduct.h.

Referenced by operator=(), setWeights(), weight(), and weights().