CMS 3D CMS Logo

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

#include <GenEventInfoProduct3.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
 
 GenEventInfoProduct3 ()
 
 GenEventInfoProduct3 (const HepMC3::GenEvent *evt)
 
 GenEventInfoProduct3 (const GenEventInfoProduct3 &other)
 
 GenEventInfoProduct3 (GenEventInfoProduct3 &&other)=default
 
bool hasBinningValues () const
 
bool hasDJRValues () const
 
bool hasPDF () const
 
int nMEPartons () const
 
int nMEPartonsFiltered () const
 
GenEventInfoProduct3operator= (const GenEventInfoProduct3 &other)
 
GenEventInfoProduct3operator= (GenEventInfoProduct3 &&other)=default
 
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
 
 ~GenEventInfoProduct3 ()
 

Private Attributes

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

Detailed Description

Definition at line 17 of file GenEventInfoProduct3.h.

Member Typedef Documentation

◆ PDF

Definition at line 28 of file GenEventInfoProduct3.h.

Constructor & Destructor Documentation

◆ GenEventInfoProduct3() [1/4]

GenEventInfoProduct3::GenEventInfoProduct3 ( )

◆ GenEventInfoProduct3() [2/4]

GenEventInfoProduct3::GenEventInfoProduct3 ( const HepMC3::GenEvent *  evt)

Definition at line 19 of file GenEventInfoProduct3.cc.

References alphaQCD_, alphaQED_, gen::PdfInfo::id, pdf(), qScale_, gen::PdfInfo::scalePDF, setPDF(), signalProcessID_, gen::PdfInfo::x, and gen::PdfInfo::xPDF.

20  : weights_(evt->weights().begin(), evt->weights().end()), nMEPartons_(-1), nMEPartonsFiltered_(-1) {
21  std::shared_ptr<HepMC3::IntAttribute> A_signal_process_id = evt->attribute<HepMC3::IntAttribute>("signal_process_id");
22  std::shared_ptr<HepMC3::DoubleAttribute> A_event_scale = evt->attribute<HepMC3::DoubleAttribute>("event_scale");
23  std::shared_ptr<HepMC3::DoubleAttribute> A_alphaQCD = evt->attribute<HepMC3::DoubleAttribute>("alphaQCD");
24  std::shared_ptr<HepMC3::DoubleAttribute> A_alphaQED = evt->attribute<HepMC3::DoubleAttribute>("alphaQED");
25  //std::shared_ptr<HepMC3::IntAttribute> A_mpi = evt->attribute<HepMC3::IntAttribute>("mpi");
26 
27  signalProcessID_ = A_signal_process_id ? (A_signal_process_id->value()) : 0;
28  qScale_ = A_event_scale ? (A_event_scale->value()) : 0.0;
29  alphaQCD_ = A_alphaQCD ? (A_alphaQCD->value()) : 0.0;
30  alphaQED_ = A_alphaQED ? (A_alphaQED->value()) : 0.0;
31 
32  std::shared_ptr<HepMC3::GenPdfInfo> A_pdf = evt->attribute<HepMC3::GenPdfInfo>("GenPdfInfo");
33  if (A_pdf) {
34  PDF pdf;
35  pdf.id = std::make_pair(A_pdf->parton_id[0], A_pdf->parton_id[1]);
36  pdf.x = std::make_pair(A_pdf->x[0], A_pdf->x[1]);
37  pdf.xPDF = std::make_pair(A_pdf->xf[0], A_pdf->xf[1]);
38  pdf.scalePDF = A_pdf->scale;
39  setPDF(&pdf);
40  }
41 }
void setPDF(const PDF *pdf)
std::pair< double, double > x
Definition: PdfInfo.h:13
const PDF * pdf() const
std::pair< double, double > xPDF
Definition: PdfInfo.h:14
std::vector< double > weights_
std::pair< int, int > id
Definition: PdfInfo.h:12
double scalePDF
Definition: PdfInfo.h:15

◆ GenEventInfoProduct3() [3/4]

GenEventInfoProduct3::GenEventInfoProduct3 ( const GenEventInfoProduct3 other)

Definition at line 43 of file GenEventInfoProduct3.cc.

References trackingPlots::other, and setPDF().

44  : weights_(other.weights_),
45  signalProcessID_(other.signalProcessID_),
46  qScale_(other.qScale_),
47  alphaQCD_(other.alphaQCD_),
48  alphaQED_(other.alphaQED_),
49  binningValues_(other.binningValues_),
50  DJRValues_(other.DJRValues_),
51  nMEPartons_(other.nMEPartons_),
52  nMEPartonsFiltered_(other.nMEPartons_) {
53  setPDF(other.pdf());
54 }
void setPDF(const PDF *pdf)
std::vector< double > weights_
std::vector< float > DJRValues_
std::vector< double > binningValues_

◆ GenEventInfoProduct3() [4/4]

GenEventInfoProduct3::GenEventInfoProduct3 ( GenEventInfoProduct3 &&  other)
default

◆ ~GenEventInfoProduct3()

GenEventInfoProduct3::~GenEventInfoProduct3 ( )

Definition at line 56 of file GenEventInfoProduct3.cc.

56 {}

Member Function Documentation

◆ alphaQCD()

double GenEventInfoProduct3::alphaQCD ( ) const
inline

Definition at line 42 of file GenEventInfoProduct3.h.

References alphaQCD_.

42 { return alphaQCD_; }

◆ alphaQED()

double GenEventInfoProduct3::alphaQED ( ) const
inline

Definition at line 43 of file GenEventInfoProduct3.h.

References alphaQED_.

43 { return alphaQED_; }

◆ binningValues()

const std::vector<double>& GenEventInfoProduct3::binningValues ( ) const
inline

Definition at line 48 of file GenEventInfoProduct3.h.

References binningValues_.

48 { return binningValues_; }
std::vector< double > binningValues_

◆ DJRValues()

const std::vector<float>& GenEventInfoProduct3::DJRValues ( ) const
inline

Definition at line 51 of file GenEventInfoProduct3.h.

References DJRValues_.

51 { return DJRValues_; }
std::vector< float > DJRValues_

◆ hasBinningValues()

bool GenEventInfoProduct3::hasBinningValues ( ) const
inline

Definition at line 49 of file GenEventInfoProduct3.h.

References binningValues_.

49 { return !binningValues_.empty(); }
std::vector< double > binningValues_

◆ hasDJRValues()

bool GenEventInfoProduct3::hasDJRValues ( ) const
inline

Definition at line 52 of file GenEventInfoProduct3.h.

References DJRValues_.

52 { return !DJRValues_.empty(); }
std::vector< float > DJRValues_

◆ hasPDF()

bool GenEventInfoProduct3::hasPDF ( ) const
inline

Definition at line 46 of file GenEventInfoProduct3.h.

References pdf().

46 { return pdf() != nullptr; }
const PDF * pdf() const

◆ nMEPartons()

int GenEventInfoProduct3::nMEPartons ( ) const
inline

Definition at line 54 of file GenEventInfoProduct3.h.

References nMEPartons_.

◆ nMEPartonsFiltered()

int GenEventInfoProduct3::nMEPartonsFiltered ( ) const
inline

Definition at line 56 of file GenEventInfoProduct3.h.

References nMEPartonsFiltered_.

◆ operator=() [1/2]

GenEventInfoProduct3 & GenEventInfoProduct3::operator= ( const GenEventInfoProduct3 other)

Definition at line 58 of file GenEventInfoProduct3.cc.

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

58  {
59  weights_ = other.weights_;
60  signalProcessID_ = other.signalProcessID_;
61  qScale_ = other.qScale_;
62  alphaQCD_ = other.alphaQCD_;
63  alphaQED_ = other.alphaQED_;
64  binningValues_ = other.binningValues_;
65  DJRValues_ = other.DJRValues_;
66  nMEPartons_ = other.nMEPartons_;
67  nMEPartonsFiltered_ = other.nMEPartonsFiltered_;
68 
69  setPDF(other.pdf());
70 
71  return *this;
72 }
void setPDF(const PDF *pdf)
std::vector< double > weights_
std::vector< float > DJRValues_
std::vector< double > binningValues_

◆ operator=() [2/2]

GenEventInfoProduct3& GenEventInfoProduct3::operator= ( GenEventInfoProduct3 &&  other)
default

◆ pdf()

const PDF* GenEventInfoProduct3::pdf ( ) const
inline

Definition at line 45 of file GenEventInfoProduct3.h.

References pdf_.

Referenced by GenEventInfoProduct3(), hasPDF(), and setPDF().

45 { return pdf_.get(); }
std::unique_ptr< PDF > pdf_

◆ qScale()

double GenEventInfoProduct3::qScale ( ) const
inline

Definition at line 41 of file GenEventInfoProduct3.h.

References qScale_.

41 { return qScale_; }

◆ setBinningValues()

void GenEventInfoProduct3::setBinningValues ( const std::vector< double > &  values)
inline

Definition at line 68 of file GenEventInfoProduct3.h.

References binningValues_, and contentValuesCheck::values.

◆ setDJR()

void GenEventInfoProduct3::setDJR ( const std::vector< float > &  values)
inline

Definition at line 70 of file GenEventInfoProduct3.h.

References DJRValues_, and contentValuesCheck::values.

◆ setNMEPartons()

void GenEventInfoProduct3::setNMEPartons ( int  n)
inline

◆ setNMEPartonsFiltered()

void GenEventInfoProduct3::setNMEPartonsFiltered ( int  n)
inline

◆ setPDF()

void GenEventInfoProduct3::setPDF ( const PDF pdf)
inline

Definition at line 66 of file GenEventInfoProduct3.h.

References pdf(), and pdf_.

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

66 { pdf_.reset(pdf ? new PDF(*pdf) : nullptr); }
const PDF * pdf() const
std::unique_ptr< PDF > pdf_

◆ setScales()

void GenEventInfoProduct3::setScales ( double  q = -1.,
double  qcd = -1.,
double  qed = -1. 
)
inline

◆ setSignalProcessID()

void GenEventInfoProduct3::setSignalProcessID ( unsigned int  procID)
inline

Definition at line 62 of file GenEventInfoProduct3.h.

References signalProcessID_.

62 { signalProcessID_ = procID; }

◆ setWeights()

void GenEventInfoProduct3::setWeights ( const std::vector< double > &  weights)
inline

Definition at line 60 of file GenEventInfoProduct3.h.

References weights(), and weights_.

60 { weights_ = weights; }
std::vector< double > weights_
std::vector< double > & weights()

◆ signalProcessID()

unsigned int GenEventInfoProduct3::signalProcessID ( ) const
inline

Definition at line 39 of file GenEventInfoProduct3.h.

References signalProcessID_.

39 { return signalProcessID_; }

◆ weight()

double GenEventInfoProduct3::weight ( ) const
inline

Definition at line 35 of file GenEventInfoProduct3.h.

References weights_.

35 { return weights_.empty() ? 1.0 : weights_[0]; }
std::vector< double > weights_

◆ weightProduct()

double GenEventInfoProduct3::weightProduct ( ) const

Definition at line 74 of file GenEventInfoProduct3.cc.

References weights_.

74  {
75  return std::accumulate(weights_.begin(), weights_.end(), 1., std::multiplies<double>());
76 }
std::vector< double > weights_

◆ weights() [1/2]

std::vector<double>& GenEventInfoProduct3::weights ( )
inline

Definition at line 32 of file GenEventInfoProduct3.h.

References weights_.

Referenced by setWeights().

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

◆ weights() [2/2]

const std::vector<double>& GenEventInfoProduct3::weights ( ) const
inline

Definition at line 33 of file GenEventInfoProduct3.h.

References weights_.

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

Member Data Documentation

◆ alphaQCD_

double GenEventInfoProduct3::alphaQCD_
private

Definition at line 85 of file GenEventInfoProduct3.h.

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

◆ alphaQED_

double GenEventInfoProduct3::alphaQED_
private

Definition at line 85 of file GenEventInfoProduct3.h.

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

◆ binningValues_

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

◆ DJRValues_

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

Definition at line 98 of file GenEventInfoProduct3.h.

Referenced by DJRValues(), hasDJRValues(), operator=(), and setDJR().

◆ nMEPartons_

int GenEventInfoProduct3::nMEPartons_
private

Definition at line 99 of file GenEventInfoProduct3.h.

Referenced by nMEPartons(), operator=(), and setNMEPartons().

◆ nMEPartonsFiltered_

int GenEventInfoProduct3::nMEPartonsFiltered_
private

Definition at line 100 of file GenEventInfoProduct3.h.

Referenced by nMEPartonsFiltered(), operator=(), and setNMEPartonsFiltered().

◆ pdf_

std::unique_ptr<PDF> GenEventInfoProduct3::pdf_
private

Definition at line 88 of file GenEventInfoProduct3.h.

Referenced by pdf(), and setPDF().

◆ qScale_

double GenEventInfoProduct3::qScale_
private

Definition at line 84 of file GenEventInfoProduct3.h.

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

◆ signalProcessID_

unsigned int GenEventInfoProduct3::signalProcessID_
private

◆ weights_

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

Definition at line 78 of file GenEventInfoProduct3.h.

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