Public Member Functions | |
GenEventPdfInfoProducer (const edm::ParameterSet &) | |
constructor | |
Private Member Functions | |
void | produce (edm::Event &evt, const edm::EventSetup &es) |
Private Attributes | |
edm::InputTag | src_ |
Save the PDFInfo stored in HepMC so that they are available in AODs
Definition at line 15 of file GenEventPdfInfoProducer.cc.
GenEventPdfInfoProducer::GenEventPdfInfoProducer | ( | const edm::ParameterSet & | p | ) |
constructor
Definition at line 35 of file GenEventPdfInfoProducer.cc.
00035 : 00036 src_(p.getParameter<InputTag>("src")) { 00037 produces<reco::PdfInfo>(); 00038 }
void GenEventPdfInfoProducer::produce | ( | edm::Event & | evt, | |
const edm::EventSetup & | es | |||
) | [private, virtual] |
Implements edm::EDProducer.
Definition at line 40 of file GenEventPdfInfoProducer.cc.
References edm::Event::getByLabel(), info, edm::errors::InvalidReference, edm::Event::put(), and src_.
00040 { 00041 // get the HepMC 00042 Handle<HepMCProduct> mcp; 00043 evt.getByLabel(src_, mcp); 00044 const GenEvent * mc = mcp->GetEvent(); 00045 if(mc == 0) { 00046 throw edm::Exception(edm::errors::InvalidReference) 00047 << "HepMC has null pointer to GenEvent\n"; 00048 } 00049 PdfInfo* pdf_info = mc->pdf_info(); 00050 auto_ptr<reco::PdfInfo> info(new reco::PdfInfo); 00051 if (pdf_info != 0) { 00052 info->id1 = pdf_info->id1(); 00053 info->id2 = pdf_info->id2(); 00054 info->x1 = pdf_info->x1(); 00055 info->x2 = pdf_info->x2(); 00056 info->scalePDF = pdf_info->scalePDF(); 00057 info->pdf1 = pdf_info->pdf1(); 00058 info->pdf2 = pdf_info->pdf2(); 00059 } else { 00060 info->id1 = -99; 00061 info->id2 = -99; 00062 info->x1 = -1.; 00063 info->x2 = -1.; 00064 info->scalePDF = -1.; 00065 info->pdf1 = -1.; 00066 info->pdf2 = -1.; 00067 } 00068 evt.put(info); 00069 }
edm::InputTag GenEventPdfInfoProducer::src_ [private] |