BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
MucG4Geo.cxx
Go to the documentation of this file.
1//$id$
2/*
3 * 2005/10/30 Zhengyun You Peking University
4 * Muc Geometry General for Simulation
5 * inherit from class SubDetectorG4Geo
6 */
7
8using namespace std;
9
10#include <iomanip>
11#include <iostream>
12#include <sstream>
13#include <string>
14#include <vector>
15
16#include "G4Geo/MucG4Geo.h"
17#include "Identifier/MucID.h"
18
19MucG4Geo* MucG4Geo::m_pMucG4Geo = 0L;
20
22 string GdmlManagementPath = getenv( "GDMLMANAGEMENTDATAROOT" );
23 if ( GdmlManagementPath == "" ) cout << "MucG4Geo::GdmlManagementPath not set" << endl;
24 string GdmlFile = GdmlManagementPath + string( "/dat/Muc.gdml" );
25 cout << "Construct Muc from GdmlFile " << GdmlFile << endl;
26 InitFromGdml( GdmlFile.c_str(), "Muc" );
27}
28
30
31void MucG4Geo::InitFromGdml( const char* gdmlFile, const char* setupName ) {
32 ReadGdml( gdmlFile, setupName );
33 m_TopVolume = GetLogicalVolume( "logicalMuc" );
34 if ( !m_TopVolume ) cout << "MucG4Geo::InitFromGdml, m_TopVolume not found" << endl;
35 else cout << "Muc TopVolume name " << m_TopVolume->GetName() << endl;
37
38 m_G4GeoInit = 1;
39}
40
42 // std::cout << "begin of set defaultvis" << std::endl;
43
44 // std::cout << "end of set defaultvis" << std::endl;
45}
46
48 // Get a pointer to the single instance of MucG4Geo
49 if ( !m_pMucG4Geo )
50 {
51 m_pMucG4Geo = new MucG4Geo;
52 // cout<<"in MucG4Geo:: no MucG4Geo now."<<m_pMucG4Geo<<endl;
53 }
54 // cout<<"in MucG4Geo:: get MucG4Geo successfully."<<endl;
55 return m_pMucG4Geo;
56}
void InitFromGdml(const char *gdmlFile, const char *setupName)
Initialize the instance of G4Geo.
Definition MucG4Geo.cxx:31
static MucG4Geo * Instance()
Get a pointer to the single instance of MucG4Geo.
Definition MucG4Geo.cxx:47
MucG4Geo()
Constructor.
Definition MucG4Geo.cxx:21
void SetDefaultVis()
Set default visual attributes;.
Definition MucG4Geo.cxx:41
~MucG4Geo()
Destructor.
Definition MucG4Geo.cxx:29
void ReadGdml(const char *gdmlFile, const char *setupName)
Initialize the instance of G4Geo.
G4LogicalVolume * GetLogicalVolume(const std::string &vn)
Get a logical volume by name;.