00001 #include "GeneratorInterface/MadGraphInterface/interface/HepMGProductAnalyzer.h" 00002 #include <iostream> 00003 00004 HepMGProductAnalyzer::HepMGProductAnalyzer(const edm::ParameterSet& iConfig) : label_(iConfig.getUntrackedParameter("moduleLabel",std::string("source"))) {} 00005 00006 HepMGProductAnalyzer::~HepMGProductAnalyzer() {} 00007 00008 void HepMGProductAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) { 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 } 00020 00021 void HepMGProductAnalyzer::printTable(HepMC::GenEvent * myGenEvent) { 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 }