00001
00015 #ifndef PMTGEOMINFOSVC_H
00016 #define PMTGEOMINFOSVC_H
00017
00018 #include "DetHelpers/IPmtGeomInfoSvc.h"
00019 #include "GaudiKernel/Service.h"
00020 #include "GaudiKernel/IDataProviderSvc.h"
00021
00022 #include <map>
00023 #include <string>
00024 #include <vector>
00025
00026 class PmtGeomInfoTHResolver;
00027
00028 class PmtGeomInfoSvc : public Service,
00029 virtual public IPmtGeomInfoSvc
00030 {
00031 public:
00032
00033 PmtGeomInfoSvc(const std::string& name, ISvcLocator *svc);
00034 ~PmtGeomInfoSvc();
00035 virtual StatusCode initialize();
00036 virtual StatusCode reinitialize();
00037 virtual StatusCode finalize();
00038 virtual StatusCode queryInterface(const InterfaceID& riid,
00039 void** ppvInterface);
00040
00042
00044 IPmtGeomInfo* get(std::string structure_path);
00045
00047 IPmtGeomInfo* get(IDetectorElement* pmtde);
00048
00050 IPmtGeomInfo* get(unsigned int pmtid);
00051
00052 private:
00053
00057 std::vector<std::string> m_StreamItems;
00058 std::vector<IDetectorElement*> m_topDEs;
00059
00063 std::string m_SiteIdUserParameter;
00067 std::string m_DetectorIdUserParameter;
00071 std::string m_PmtIdUserParameter;
00075 bool m_enableSabGeometry;
00076
00077
00078 IPmtGeomInfo* add(unsigned int pmtid, const std::string& path,
00079 IDetectorElement* de);
00080
00081
00082 IPmtGeomInfo* find(unsigned int pmtid, IDetectorElement* de);
00083
00084 IDetectorElement* findParent(unsigned int pmtid,
00085 IDetectorElement* currentDE);
00086
00087 typedef std::map<unsigned int,IPmtGeomInfo*> MapByInt;
00088 MapByInt m_byId;
00089 typedef std::map<std::string,IPmtGeomInfo*> MapByString;
00090 MapByString m_byPath;
00091 typedef std::map<IDetectorElement*,IPmtGeomInfo*> MapByDE;
00092 MapByDE m_byDE;
00093
00094 IDataProviderSvc* m_detSvc;
00095
00096
00097 IDetectorElement* m_detector;
00098
00099 };
00100
00101 #endif // PMTGEOMINFOSVC_H