BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
MucGeomSvc.cxx
Go to the documentation of this file.
1/*
2 * 2004/09/10 Zhengyun You Peking University
3 *
4 */
5
6#include "MucGeomSvc.h"
7#include "GaudiKernel/IInterface.h"
8#include "GaudiKernel/Kernel.h"
9#include "GaudiKernel/MsgStream.h"
10#include "GaudiKernel/StatusCode.h"
11
12// static SvcFactory<MucGeomSvc> s_factory;
13// const ISvcFactory& MucGeomSvcFactory = s_factory;
14
16
17MucGeomSvc::MucGeomSvc( const std::string& name, ISvcLocator* svcloc )
18 : base_class( name, svcloc ) {
19 // Declare the properties
20 declareProperty( "GeometryMode", m_Geometry = 1 );
21}
22
24 MsgStream log( msgSvc(), name() );
25 log << MSG::INFO << name() << ": Start of run initialisation" << endmsg;
26
27 StatusCode sc = Service::initialize();
28 if ( sc.isFailure() ) return sc;
29
30 // get geometry data
31 Fill();
32
33 return StatusCode::SUCCESS;
34}
35
37 MsgStream log( msgSvc(), name() );
38 log << MSG::INFO << name() << ": End of Run" << endmsg;
39 return StatusCode::SUCCESS;
40}
41
43
44void MucGeomSvc::Fill() {
45 if ( m_Geometry == 1 )
46 {
47 m_pMucGeoGeneral = MucGeoGeneral::Instance();
48 m_pMucGeoGeneral->Init();
49 // m_pMucGeoGeneral->InitFromASCII();
50 m_pMucGeoGeneral->InitFromXML();
51 }
52 else
53 { // geant4 geo
54 m_pMucG4Geo = MucG4Geo::Instance();
55 }
56}
57
58const MucGeoGeneral* const MucGeomSvc::GetGeoGeneral() { return m_pMucGeoGeneral; }
59
60const MucGeoGap* const MucGeomSvc::GetGap( int part, int seg, int gap ) {
61 return m_pMucGeoGeneral->GetGap( part, seg, gap );
62}
63
64const MucGeoStrip* const MucGeomSvc::GetStrip( int part, int seg, int gap, int strip ) {
65 return m_pMucGeoGeneral->GetStrip( part, seg, gap, strip );
66}
67
69 std::cout << "StripNumTotal = " << m_pMucGeoGeneral->GetStripNumTotal() << std::endl;
70}
71
72const MucG4Geo* const // for geant4 geo 2006.11.23
74 return m_pMucG4Geo;
75}
DECLARE_COMPONENT(BesBdkRc)
IMessageSvc * msgSvc()
static MucG4Geo * Instance()
Get a pointer to the single instance of MucG4Geo.
Definition MucG4Geo.cxx:47
void Init()
Initialize the instance of MucGeoGeneral.
void InitFromXML()
Initialize from xml.
static MucGeoGeneral * Instance()
Get a pointer to the single instance of MucGeoGeneral.
virtual void Dump()
virtual StatusCode initialize()
MucGeomSvc(const std::string &name, ISvcLocator *svcloc)
virtual StatusCode finalize()
virtual const MucGeoGeneral *const GetGeoGeneral()
virtual const MucG4Geo *const GetMucG4Geo()
virtual const MucGeoStrip *const GetStrip(int part, int seg, int gap, int strip)
virtual const MucGeoGap *const GetGap(int part, int seg, int gap)