PhotosHepMCEvent.cxx

00001 #include <vector>
00002 #include "PhotosHepMCParticle.h"
00003 #include "PhotosHepMCEvent.h"
00004 #include "Log.h"
00005 using namespace std;
00006 
00007 namespace Photospp
00008 {
00009 
00010 PhotosHepMCEvent::PhotosHepMCEvent(HepMC::GenEvent * event)
00011 {
00012         m_event=event;
00013         HepMC::GenEvent::particle_const_iterator part_itr = m_event->particles_begin();
00014         for( ; part_itr!=m_event->particles_end(); part_itr++)
00015         {
00016                 PhotosParticle *particle = new PhotosHepMCParticle(*part_itr);
00017                 particles.push_back(particle);
00018         }
00019 }
00020 
00021 PhotosHepMCEvent::~PhotosHepMCEvent()
00022 {
00023         while(particles.size())
00024         {
00025                 PhotosParticle *p = particles.back();
00026                 particles.pop_back();
00027                 if(p) delete p;
00028         }
00029 }
00030 
00031 HepMC::GenEvent * PhotosHepMCEvent::getEvent()
00032 {
00033         return m_event;
00034 }
00035 
00036 void PhotosHepMCEvent::print()
00037 {
00038         if(!m_event) return;
00039         m_event->print();
00040 }
00041 
00042 vector<PhotosParticle*> PhotosHepMCEvent::getParticleList()
00043 {
00044         return particles;
00045 }
00046 
00047 } // namespace Photospp
Generated on Sun Oct 20 20:23:56 2013 for C++InterfacetoPHOTOS by  doxygen 1.6.3