00001 #ifndef __EMCGEOMETRY_H__ 00002 #define __EMCGEOMETRY_H__ 00003 00004 #include <iostream> 00005 #include <vector> 00006 #ifndef __EMCMANAGEABLE_H__ 00007 #include "emcManageable.h" 00008 #endif 00009 #ifndef __SECGEOM_H__ 00010 #include "SecGeom.h" 00011 #endif 00012 #ifndef __PHTIMESTAMP_H__ 00013 #include "PHTimeStamp.h" 00014 #endif 00015 00018 class emcGeometry : public emcManageable 00019 { 00020 00022 friend std::ostream& operator<<(std::ostream& out, const emcGeometry& obj); 00023 00024 public: 00025 00027 emcGeometry(); 00028 00029 #ifndef __CINT__ 00030 00031 emcGeometry(const std::vector<SecGeom>& sectors) 00032 { 00033 Set(sectors); 00034 } 00035 #endif 00036 00038 emcGeometry(const emcGeometry& obj); 00039 00041 emcGeometry& operator=(const emcGeometry& obj); 00042 00044 virtual ~emcGeometry(); 00045 00047 virtual const char* GetCategory(void) const 00048 { 00049 return "geom.emc.Sectors"; 00050 } 00051 00053 const PHTimeStamp& GetEndValTime(void) const 00054 { 00055 return fEnd; 00056 } 00057 00059 const PHTimeStamp& GetStartValTime(void) const 00060 { 00061 return fStart; 00062 } 00063 00065 bool IsValid(const PHTimeStamp& when) const; 00066 00068 static size_t MaxNumberOfSectors(void) 00069 { 00070 return fgNumberOfSectors; 00071 } 00072 00074 size_t NumberOfSectors(void) const 00075 { 00076 return fSectors.size(); 00077 } 00078 00080 void Print(void) const 00081 { 00082 std::cout << *this << std::endl; 00083 } 00084 00086 void PrintCorners(void) const; 00087 00088 #ifndef __CINT__ 00089 00090 void Set(const std::vector<SecGeom>& sectors) 00091 { 00092 fSectors = sectors; 00093 } 00094 #endif 00095 00097 void Reset(void); 00098 00100 const SecGeom& Sector(size_t iS) const; 00101 00102 // Set the validity period. 00103 void SetValidityPeriod(const PHTimeStamp& t1, const PHTimeStamp& t2) 00104 { 00105 fStart = t1; 00106 fEnd = t2; 00107 } 00108 00109 protected: 00110 00111 void Copy(emcGeometry&) const; 00112 00113 private: 00114 std::vector<SecGeom> fSectors; 00115 static size_t fgNumberOfSectors; 00116 PHTimeStamp fStart; 00117 PHTimeStamp fEnd; 00118 }; 00119 00120 #endif