BOSS 7.0.4
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 <string>
11#include <iostream>
12#include <sstream>
13#include <vector>
14#include <iomanip>
15
16#include "Identifier/MucID.h"
17#include "G4Geo/MucG4Geo.h"
18
19
21MucG4Geo::m_pMucG4Geo = 0L;
22
23
25{
26 string GdmlManagementPath = getenv("GDMLMANAGEMENTROOT");
27 if (GdmlManagementPath == "") cout << "MucG4Geo::GdmlManagementPath not set" << endl;
28 string GdmlFile = GdmlManagementPath + string("/dat/Muc.gdml");
29 cout << "Construct Muc from GdmlFile " << GdmlFile << endl;
30 InitFromGdml( GdmlFile.c_str(), "Muc" );
31}
32
34{ }
35
36void
37MucG4Geo::InitFromGdml( const char *gdmlFile, const char *setupName )
38{
39 ReadGdml(gdmlFile, setupName);
40 m_TopVolume = GetLogicalVolume("logicalMuc");
41 if (!m_TopVolume) cout << "MucG4Geo::InitFromGdml, m_TopVolume not found" << endl;
42 else cout << "Muc TopVolume name " << m_TopVolume->GetName() << endl;
44
45 m_G4GeoInit = 1;
46}
47
48void
50{
51 //std::cout << "begin of set defaultvis" << std::endl;
52
53 //std::cout << "end of set defaultvis" << std::endl;
54}
55
58{
59 //Get a pointer to the single instance of MucG4Geo
60 if(!m_pMucG4Geo){
61 m_pMucG4Geo = new MucG4Geo;
62 //cout<<"in MucG4Geo:: no MucG4Geo now."<<m_pMucG4Geo<<endl;
63
64 }
65 //cout<<"in MucG4Geo:: get MucG4Geo successfully."<<endl;
66 return m_pMucG4Geo;
67}
void InitFromGdml(const char *gdmlFile, const char *setupName)
Initialize the instance of G4Geo.
Definition: MucG4Geo.cxx:37
static MucG4Geo * Instance()
Get a pointer to the single instance of MucG4Geo.
Definition: MucG4Geo.cxx:57
MucG4Geo()
Constructor.
Definition: MucG4Geo.cxx:24
void SetDefaultVis()
Set default visual attributes;.
Definition: MucG4Geo.cxx:49
~MucG4Geo()
Destructor.
Definition: MucG4Geo.cxx:33
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;.