00001 //$id$ 00002 /* 00003 * 2005/10/30 Zhengyun You Peking University 00004 * G4 Geometry for Bes sub-detector 00005 * 00006 */ 00007 00008 using namespace std; 00009 00010 #include <string> 00011 #include <iostream> 00012 00013 #include "G4Geo/SubDetectorG4Geo.h" 00014 00015 SubDetectorG4Geo::SubDetectorG4Geo() 00016 : m_G4GeoInit(0) 00017 { 00018 // Default constructor. 00019 //m_sxp.Initialize(); 00020 } 00021 00022 SubDetectorG4Geo::~SubDetectorG4Geo() 00023 { 00024 m_sxp.Finalize(); 00025 } 00026 00027 void 00028 SubDetectorG4Geo::ReadGdml( const char *gdmlFile, const char *setupName ) 00029 { 00030 m_config.SetURI( gdmlFile ); 00031 m_config.SetSetupName( setupName ); 00032 m_config.SetType ( "G4" ); 00033 00034 m_sxp.Configure( &m_config ); 00035 m_sxp.Initialize(); 00036 m_sxp.Run(); 00037 } 00038 00039 G4LogicalVolume* 00040 SubDetectorG4Geo::GetLogicalVolume( const std::string& vn ) 00041 { 00042 G4LogicalVolume *lv = (G4LogicalVolume*)GDMLProcessor::GetInstance()->GetLogicalVolume(vn); 00043 //if (!lv) std::cout << "Logical Volume " << vn << " not found " << std::endl; 00044 return lv; 00045 } 00046 00047