00001 //$id$ 00002 /* 00003 * 2004/12/9 Zhengyun You Peking University 00004 * ROOT Geometry for Bes sub-detector in event display and reconstruction. 00005 * 00006 */ 00007 00008 #ifndef SUBDETECTOR_ROOT_GEO_H 00009 #define SUBDETECTOR_ROOT_GEO_H 00010 00011 #include <string> 00012 00013 #include <TGeoVolume.h> 00014 #include <TGeoNode.h> 00015 #include <TGeoPhysicalNode.h> 00016 00017 #include "Saxana/SAXProcessor.h" 00018 #include "Saxana/ProcessingConfigurator.h" 00019 #include "Processor/TGDMLProcessor.h" 00020 00029 class SubDetectorROOTGeo 00030 { 00031 public: 00032 00034 SubDetectorROOTGeo(); 00035 00037 virtual ~SubDetectorROOTGeo(); 00038 00040 virtual void ReadGdml( const char *gdmlFile, const char *setupName ); 00041 00043 virtual int IsInitialized() { return m_ROOTGeoInit; } 00044 00045 // Set child no of this subdetector in bes; 00046 virtual void SetChildNo(int childNo) { m_childNo = childNo; } 00047 00049 virtual TGeoVolume *GetLogicalVolume( const std::string& vn ); 00050 00052 virtual TGeoVolume *GetTopVolume() { return m_TopVolume; } 00053 00055 virtual TGeoVolumeAssembly *GetAssemblyVolume( const std::string& an ); 00056 00058 virtual TGeoNode* GetNode( const std::string& nn ); 00059 00061 virtual int GetHitsNum() { return m_HitsArray->GetEntries(); } 00062 00064 virtual TGeoPhysicalNode* GetHit(int i); 00065 00067 virtual void SetDetectorOn(); 00068 00069 00070 private: 00071 00072 SAXProcessor m_sxp; 00073 ProcessingConfigurator m_config; 00074 00075 protected: 00076 // Have we initialize the geometry. 00077 int m_ROOTGeoInit; 00078 int m_childNo; // child no of this subdetector in bes. 00079 int m_2DGeoInit; 00080 00081 TGeoVolume *m_TopVolume; 00082 00083 TObjArray *m_DetectorsArray; 00084 TObjArray *m_HitsArray; 00085 TObjArray *m_2DHitsArray; 00086 }; 00087 00088 #endif /* SUBDETECTOR_ROOT_GEO_H */