| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

SimParticleHistory.h

Go to the documentation of this file.
00001 
00002 //   **************************************************************************
00003 //   *                                                                        *
00004 //   *                      ! ! ! A T T E N T I O N ! ! !                     *
00005 //   *                                                                        *
00006 //   *  This file was created automatically by GaudiObjDesc, please do not    *
00007 //   *  delete it or edit it by hand.                                         *
00008 //   *                                                                        *
00009 //   *  If you want to change this file, first change the corresponding       *
00010 //   *  xml-file and rerun the tools from GaudiObjDesc (or run make if you    *
00011 //   *  are using it from inside a Gaudi-package).                            *
00012 //   *                                                                        *
00013 //   **************************************************************************
00014 
00015 #ifndef SimEvent_SimParticleHistory_H
00016 #define SimEvent_SimParticleHistory_H 1
00017 
00018 // Include files
00019 #include "Event/SimTrackReference.h"
00020 #include "GaudiKernel/boost_allocator.h"
00021 #include <list>
00022 #include <vector>
00023 #include <map>
00024 #include <ostream>
00025 
00026 // Forward declarations
00027 
00028 namespace DayaBay 
00029 {
00030 
00031   // Forward declarations
00032   class SimTrack;
00033   class SimVertex;
00034   class SimProcess;
00035   
00036 
00046   class SimParticleHistory
00047   {
00048   public:
00049 
00051     SimParticleHistory() : m_tracks(),
00052                            m_vertices(),
00053                            m_primaryTracks(),
00054                            m_idToTrack(),
00055                            m_currentTrack() {}
00056   
00058   ~SimParticleHistory();
00059   
00061     const SimTrackReference track(int trackid) const;
00062   
00064     void addTrack(SimTrack* aTrack);
00065   
00067     void addPrimaryTrack(const SimTrack* aTrack);
00068   
00070     void addTrackRef(int id,
00071                      const SimTrackReference& aRef);
00072   
00074     void addVertex(SimVertex* aVertex);
00075   
00077     std::vector<DayaBay::SimTrack*> trackVector();
00078   
00080     std::vector<DayaBay::SimVertex*> vertexVector();
00081   
00083     std::ostream& fillStream(std::ostream& s) const;
00084   
00087   const std::list<DayaBay::SimTrack*>& tracks() const;
00088   
00091   const std::list<DayaBay::SimVertex*>& vertices() const;
00092   
00095   const std::list<const DayaBay::SimTrack*>& primaryTracks() const;
00096   
00099   const DayaBay::SimTrackReference& currentTrack() const;
00100   
00103   void setCurrentTrack(const DayaBay::SimTrackReference& value);
00104   
00105   
00106   #ifndef GOD_NOALLOC
00108     static void* operator new ( size_t size )
00109     {
00110       return ( sizeof(SimParticleHistory) == size ? 
00111                boost::singleton_pool<SimParticleHistory, sizeof(SimParticleHistory)>::malloc() :
00112                ::operator new(size) );
00113     }
00114   
00118     static void* operator new ( size_t size, void* pObj )
00119     {
00120       return ::operator new (size,pObj);
00121     }
00122   
00124     static void operator delete ( void* p )
00125     {
00126       boost::singleton_pool<SimParticleHistory, sizeof(SimParticleHistory)>::is_from(p) ?
00127       boost::singleton_pool<SimParticleHistory, sizeof(SimParticleHistory)>::free(p) :
00128       ::operator delete(p);
00129     }
00130   
00133     static void operator delete ( void* p, void* pObj )
00134     {
00135       ::operator delete (p, pObj);
00136     }
00137   #endif
00138   protected:
00139 
00140   private:
00141 
00142     std::list<DayaBay::SimTrack*>             m_tracks;        
00143     std::list<DayaBay::SimVertex*>            m_vertices;      
00144     std::list<const DayaBay::SimTrack*>       m_primaryTracks; 
00145     std::map<int, DayaBay::SimTrackReference> m_idToTrack;     
00146     DayaBay::SimTrackReference                m_currentTrack;  
00147   
00148   }; // class SimParticleHistory
00149 
00150   inline std::ostream& operator<< (std::ostream& str, const SimParticleHistory& obj)
00151   {
00152     return obj.fillStream(str);
00153   }
00154   
00155 } // namespace DayaBay;
00156 
00157 // -----------------------------------------------------------------------------
00158 // end of class
00159 // -----------------------------------------------------------------------------
00160 
00161 // Including forward declarations
00162 #include "SimTrack.h"
00163 #include "SimVertex.h"
00164 #include "SimProcess.h"
00165 
00166 
00167 inline const std::list<DayaBay::SimTrack*>& DayaBay::SimParticleHistory::tracks() const 
00168 {
00169   return m_tracks;
00170 }
00171 
00172 inline const std::list<DayaBay::SimVertex*>& DayaBay::SimParticleHistory::vertices() const 
00173 {
00174   return m_vertices;
00175 }
00176 
00177 inline const std::list<const DayaBay::SimTrack*>& DayaBay::SimParticleHistory::primaryTracks() const 
00178 {
00179   return m_primaryTracks;
00180 }
00181 
00182 inline const DayaBay::SimTrackReference& DayaBay::SimParticleHistory::currentTrack() const 
00183 {
00184   return m_currentTrack;
00185 }
00186 
00187 inline void DayaBay::SimParticleHistory::setCurrentTrack(const DayaBay::SimTrackReference& value) 
00188 {
00189   m_currentTrack = value;
00190 }
00191 
00192 inline std::vector<DayaBay::SimTrack*> DayaBay::SimParticleHistory::trackVector() 
00193 {
00194 
00195                 return std::vector<DayaBay::SimTrack*>(m_tracks.begin(),m_tracks.end());
00196               
00197 }
00198 
00199 inline std::vector<DayaBay::SimVertex*> DayaBay::SimParticleHistory::vertexVector() 
00200 {
00201 
00202                 return std::vector<DayaBay::SimVertex*>(m_vertices.begin(),m_vertices.end());
00203               
00204 }
00205 
00206 
00207 #endif 
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:31:28 2011 for SimEvent by doxygen 1.4.7