HepMC Reference Documentation

HepMC

TempParticleMap.h

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 #ifndef HEPMC_TempParticleMap_H
00003 #define HEPMC_TempParticleMap_H
00004 
00006 // garren@fnal.gov, October 2007
00007 //
00008 // Used by IO classes
00010 
00011 #include <map>
00012 
00013 namespace HepMC {
00014 
00015     class GenParticle;
00016 
00018 
00024     class TempParticleMap {
00025     public:
00026         typedef std::map<HepMC::GenParticle*,int> TempMap;
00027         typedef std::map<int,HepMC::GenParticle*> TempOrderMap;
00028         typedef TempMap::iterator     TempMapIterator;
00029         typedef TempOrderMap::iterator  orderIterator;
00030         
00031         TempParticleMap() 
00032         : m_particle_to_end_vertex(), m_particle_order(), m_counter(0) {}
00033         
00034         ~TempParticleMap() {}
00035         
00036         TempMapIterator begin() { return m_particle_to_end_vertex.begin(); }
00037         TempMapIterator end() { return m_particle_to_end_vertex.end(); }
00038         orderIterator order_begin() { return m_particle_order.begin(); }
00039         orderIterator order_end() { return m_particle_order.end(); }
00040         
00041         int end_vertex( GenParticle* );
00042         
00043         void addEndParticle( GenParticle*, int& );
00044         
00045     private:
00046         TempMap       m_particle_to_end_vertex;
00047         TempOrderMap  m_particle_order;
00048         int           m_counter;
00049     };
00050     
00051     inline int TempParticleMap::end_vertex( GenParticle* p )
00052     { 
00053         //return m_particle_to_end_vertex[p]->second; 
00054         TempMapIterator it = m_particle_to_end_vertex.find(p);
00055         if( it == end() ) return 0;
00056         return m_particle_to_end_vertex[p];
00057     }
00058 
00059     inline void TempParticleMap::addEndParticle( GenParticle* p, int& end_vtx_code )
00060     {
00061         ++m_counter;
00062         m_particle_order[m_counter] = p;
00063         m_particle_to_end_vertex[p] = end_vtx_code;
00064     }
00065 
00066 } // HepMC
00067 
00068 #endif  // HEPMC_TempParticleMap_H
00069 //--------------------------------------------------------------------------

Generated on Tue Feb 5 13:25:45 2008 for HepMC by  doxygen 1.5.1-3