CMS 3D CMS Logo

HepMGProductAnalyzer Class Reference

A modified version of the HepMCProducts, which is used to print out the content of HepMC products. More...

#include <IOMC/HepMGProductAnalyzer/src/HepMGProductAnalyzer.cc>

Inheritance diagram for HepMGProductAnalyzer:

edm::EDAnalyzer

List of all members.

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 HepMGProductAnalyzer (const edm::ParameterSet &)
void printTable (HepMC::GenEvent *event)
 ~HepMGProductAnalyzer ()

Private Attributes

std::string label_


Detailed Description

A modified version of the HepMCProducts, which is used to print out the content of HepMC products.

This version has an additional method to print a table of particles and their decay products.

Definition at line 36 of file HepMGProductAnalyzer.h.


Constructor & Destructor Documentation

HepMGProductAnalyzer::HepMGProductAnalyzer ( const edm::ParameterSet iConfig  )  [explicit]

Definition at line 4 of file HepMGProductAnalyzer.cc.

00004 : label_(iConfig.getUntrackedParameter("moduleLabel",std::string("source"))) {}

HepMGProductAnalyzer::~HepMGProductAnalyzer (  ) 

Definition at line 6 of file HepMGProductAnalyzer.cc.

00006 {}


Member Function Documentation

void HepMGProductAnalyzer::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
) [virtual]

Implements edm::EDAnalyzer.

Definition at line 8 of file HepMGProductAnalyzer.cc.

References edm::Event::getByLabel(), and label_.

00008                                                                                       {
00009    edm::Handle<edm::HepMCProduct> evt;
00010 // iEvent.getByType(evt);
00011    iEvent.getByLabel(label_,evt);
00012 
00013    //Print out the HepMCProduct
00014    evt->GetEvent()->print();
00015   
00016    //To print out status code, pdg, mass, etc table uncomment below
00017    //   HepMC::GenEvent * myGenEvent = new  HepMC::GenEvent(*(evt->GetEvent()));
00018    //   this->printTable(myGenEvent);
00019 }

void HepMGProductAnalyzer::printTable ( HepMC::GenEvent *  event  ) 

Definition at line 21 of file HepMGProductAnalyzer.cc.

References GenMuonPlsPt100GeV_cfg::cout, and lat::endl().

00021                                                                 {
00022 // this method is outdated, use print() method of GenEvent instead
00023   std::cout<<std::endl;
00024   std::cout<<"Barcode:  Pgd:     Status:  Mother:"<<std::endl;   
00025 /*
00026   for ( HepMC::GenEvent::particle_iterator p = myGenEvent->particles_begin();
00027         p != myGenEvent->particles_end(); ++p) { 
00028     std::cout<<" "<<(*p)->barcode()<<"        "<<(*p)->pdg_id()<<"       "<<(*p)->status()<<"        "<<(*p)->Mother()<<std::endl;
00029   }
00030 */
00031 }


Member Data Documentation

std::string HepMGProductAnalyzer::label_ [private]

Definition at line 44 of file HepMGProductAnalyzer.h.

Referenced by analyze().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:24:10 2009 for CMSSW by  doxygen 1.5.4