LCOV - code coverage report
Current view: top level - TEvtGen/Photos/src/eventRecordInterfaces - PhotosHepMCEvent.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 0 20 0.0 %
Date: 2016-06-14 17:26:59 Functions: 0 8 0.0 %

          Line data    Source code
       1             : #include <vector>
       2             : #include "PhotosHepMCParticle.h"
       3             : #include "PhotosHepMCEvent.h"
       4             : #include "Log.h"
       5             : using namespace std;
       6             : 
       7             : namespace Photospp
       8             : {
       9             : 
      10           0 : PhotosHepMCEvent::PhotosHepMCEvent(HepMC::GenEvent * event)
      11           0 : {
      12           0 :         m_event=event;
      13           0 :         HepMC::GenEvent::particle_const_iterator part_itr = m_event->particles_begin();
      14           0 :         for( ; part_itr!=m_event->particles_end(); part_itr++)
      15             :         {
      16           0 :                 PhotosParticle *particle = new PhotosHepMCParticle(*part_itr);
      17           0 :                 particles.push_back(particle);
      18           0 :         }
      19           0 : }
      20             : 
      21             : PhotosHepMCEvent::~PhotosHepMCEvent()
      22           0 : {
      23           0 :         while(particles.size())
      24             :         {
      25           0 :                 PhotosParticle *p = particles.back();
      26           0 :                 particles.pop_back();
      27           0 :                 if(p) delete p;
      28             :         }
      29           0 : }
      30             : 
      31             : HepMC::GenEvent * PhotosHepMCEvent::getEvent()
      32             : {
      33           0 :         return m_event;
      34             : }
      35             : 
      36             : void PhotosHepMCEvent::print()
      37             : {
      38           0 :         if(!m_event) return;
      39           0 :         m_event->print();
      40           0 : }
      41             : 
      42             : vector<PhotosParticle*> PhotosHepMCEvent::getParticleList()
      43             : {
      44           0 :         return particles;
      45             : }
      46             : 
      47             : } // namespace Photospp

Generated by: LCOV version 1.11