00001 #ifndef __GLG4HitPMTCollection_hh__ 00002 #define __GLG4HitPMTCollection_hh__ 00003 /** @file GLG4HitPMTCollection.hh 00004 Declares GLG4HitPMTCollection class and helper functions. 00005 00006 This file is part of the GenericLAND software library. 00007 $Id: GLG4HitPMTCollection.hh,v 1.1.1.1 2004/12/21 22:29:48 GLG4sim Exp $ 00008 00009 @author Glenn Horton-Smith, December 2004 00010 */ 00011 00012 #include "GLG4HitPMT.hh" 00013 #include <vector> 00014 #include <map> 00015 00016 /** GLG4HitPMTCollection stores GLG4HitPMT objects. 00017 00018 The general contract for GLG4HitPMTCollection is as follows: 00019 - efficiently keep a bunch of GLG4HitPMTs with GLG4HitPhotons 00020 - provide Clear, DetectPhoton, SortTimeAscending, GetEntries, GetPMT, 00021 and Print(ostream &) functions 00022 - note the GLG4HitPhotons passed to DetectPhoton will become the 00023 "owned" by the GLG4HitPMTCollection and its GLG4HitPMTs, and they 00024 will take care of deletion. 00025 00026 This is almost the same "general contract" that was implemented 00027 for KLG4sim's KLHitPMTCollection by O. Tajima and G. Horton-Smith, 00028 but the code was rewritten for GLG4sim in December 2004. 00029 00030 @author Glenn Horton-Smith 00031 */ 00032 00033 class GLG4HitPMTCollection { 00034 public: 00035 GLG4HitPMTCollection(); 00036 virtual ~GLG4HitPMTCollection(); 00037 00038 void Clear(); 00039 void DetectPhoton(GLG4HitPhoton*); 00040 void SortTimeAscending(); 00041 int GetEntries() const; 00042 GLG4HitPMT* GetPMT(int i) const; 00043 GLG4HitPMT* GetPMT_ByID(int id) const; 00044 00045 void Print(std::ostream &) const; 00046 00047 private: 00048 std::vector<GLG4HitPMT*> fPMT; 00049 std::map<short, GLG4HitPMT*> fHitmap; 00050 }; 00051 00052 00053 #endif // __GLG4HitPMTCollection_hh__