CGEM BOSS 6.6.5.h
BESIII Offline Software System
Loading...
Searching...
No Matches
EmcG4Geo.cxx
Go to the documentation of this file.
1//$id$
2/*
3 * 2007/05/15 Miao He <[email protected]>
4 * Emc 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/EmcID.h"
17#include "G4Geo/EmcG4Geo.h"
18
20EmcG4Geo::m_pEmcG4Geo = 0L;
21
23{
24 string GdmlManagementPath = getenv("GDMLMANAGEMENTROOT");
25 if (GdmlManagementPath == "") cout << "EmcG4Geo::GdmlManagementPath not set!" << endl;
26 string GdmlFile = GdmlManagementPath + string("/dat/Emc.gdml");
27 cout << "Construct Emc from GdmlFile " << GdmlFile << endl;
28 InitFromGdml( GdmlFile.c_str(), "Emc" );
29}
30
33
34void
35EmcG4Geo::InitFromGdml( const char *gdmlFile, const char *setupName )
36{
37 ReadGdml(gdmlFile, setupName);
38 m_TopVolume = GetLogicalVolume("logicalEMC");
39 if (!m_TopVolume) cout << "EmcG4Geo::InitFromGdml, m_TopVolume not found" << endl;
40 else cout << "Emc TopVolume name " << m_TopVolume->GetName() << endl;
42
43 m_G4GeoInit = 1;
44}
45
46void
50
53{
54 //Get a pointer to the single instance of EmcG4Geo
55 if(!m_pEmcG4Geo) {
56 m_pEmcG4Geo = new EmcG4Geo;
57 //cout<<"in EmcG4Geo:: no EmcG4Geo now."<<m_pEmcG4Geo<<endl;
58 }
59 //cout<<"in EmcG4Geo:: get EmcG4Geo successfully."<<endl;
60 return m_pEmcG4Geo;
61}
62
static EmcG4Geo * Instance()
Get a pointer to the single instance of EmcG4Geo.
Definition EmcG4Geo.cxx:52
~EmcG4Geo()
Destructor.
Definition EmcG4Geo.cxx:31
void SetDefaultVis()
Set default visual attributes;.
Definition EmcG4Geo.cxx:47
void InitFromGdml(const char *gdmlFile, const char *setupName)
Initialize the instance of G4Geo.
Definition EmcG4Geo.cxx:35
EmcG4Geo()
Constructor.
Definition EmcG4Geo.cxx:22
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;.
G4LogicalVolume * m_TopVolume