00001
00002
00003
00004
00005
00006 #include "MucGeomSvc/MucGeomSvc.h"
00007 #include "GaudiKernel/Kernel.h"
00008 #include "GaudiKernel/IInterface.h"
00009 #include "GaudiKernel/StatusCode.h"
00010
00011 #include "GaudiKernel/SvcFactory.h"
00012 #include "GaudiKernel/MsgStream.h"
00013
00014
00015
00016
00017 MucGeomSvc::MucGeomSvc( const std::string& name, ISvcLocator* svcloc ) : Service(name, svcloc)
00018 {
00019
00020 declareProperty("GeometryMode",m_Geometry=1);
00021
00022 }
00023
00024 StatusCode MucGeomSvc::queryInterface (const InterfaceID& riid, void** ppvInterface ){
00025
00026 if ( IID_IMucGeomSvc.versionMatch(riid) ) {
00027 *ppvInterface = static_cast<IMucGeomSvc*> (this);
00028 } else {
00029 return Service::queryInterface(riid, ppvInterface) ;
00030 }
00031 return StatusCode::SUCCESS;
00032 }
00033
00034 StatusCode MucGeomSvc::initialize ( ) {
00035 MsgStream log(messageService(), name());
00036 log << MSG::INFO << name() << ": Start of run initialisation" << endreq;
00037
00038 StatusCode sc = Service::initialize();
00039 if ( sc.isFailure() ) return sc;
00040
00041
00042 Fill();
00043
00044 return StatusCode::SUCCESS;
00045 }
00046
00047
00048 StatusCode MucGeomSvc::finalize ( ) {
00049 MsgStream log(messageService(), name());
00050 log << MSG::INFO << name() << ": End of Run" << endreq;
00051 return StatusCode::SUCCESS;
00052 }
00053
00054
00055 MucGeomSvc::~MucGeomSvc(){
00056 }
00057
00058 void MucGeomSvc::Fill(){
00059 if(m_Geometry==1){
00060 m_pMucGeoGeneral = MucGeoGeneral::Instance();
00061 m_pMucGeoGeneral->Init();
00062
00063 m_pMucGeoGeneral->InitFromXML();
00064 } else{
00065 m_pMucG4Geo = MucG4Geo::Instance();
00066 }
00067 }
00068
00069 const MucGeoGeneral * const
00070 MucGeomSvc::GetGeoGeneral()
00071 {
00072 return m_pMucGeoGeneral;
00073 }
00074
00075 const MucGeoGap * const
00076 MucGeomSvc::GetGap(int part, int seg, int gap)
00077 {
00078 return m_pMucGeoGeneral->GetGap(part, seg, gap);
00079 }
00080
00081 const MucGeoStrip * const
00082 MucGeomSvc::GetStrip(int part, int seg, int gap, int strip)
00083 {
00084 return m_pMucGeoGeneral->GetStrip(part, seg, gap, strip);
00085 }
00086
00087 void MucGeomSvc::Dump(){
00088 std::cout << "StripNumTotal = " << m_pMucGeoGeneral->GetStripNumTotal() << std::endl;
00089 }
00090
00091 const MucG4Geo * const
00092 MucGeomSvc::GetMucG4Geo()
00093 {
00094 return m_pMucG4Geo;
00095 }