BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
TofG4Geo.cxx
Go to the documentation of this file.
1//$id$
2
3/*
4 * 2005/10/30 Zhengyun You Peking University
5 * Tof Geometry General for Simulation
6 * inherit from class SubDetectorG4Geo
7 */
8
9using namespace std;
10
11#include <iomanip>
12#include <iostream>
13#include <sstream>
14#include <string>
15#include <vector>
16
17#include "G4Geo/TofG4Geo.h"
18#include "Identifier/TofID.h"
19#include "SimUtil/ReadBoostRoot.hh"
20
22 string GdmlManagementPath = getenv( "GDMLMANAGEMENTDATAROOT" );
23 if ( GdmlManagementPath == "" ) cout << "TofG4Geo::GdmlManagementPath not set" << endl;
24
25 string GdmlFile = GdmlManagementPath + string( "/dat/Tof.gdml" );
26 cout << "Construct old Tof from GdmlFile " << GdmlFile << endl;
27
28 InitFromGdml( GdmlFile.c_str(), "Tof" );
29}
30
32
33void TofG4Geo::InitFromGdml( const char* gdmlFile, const char* setupName ) {
34 ReadGdml( gdmlFile, setupName );
35 m_TopVolume = GetLogicalVolume( "logicalTof" );
36 if ( !m_TopVolume ) cout << "TofG4Geo::InitFromGdml, m_TopVolume not found" << endl;
37 else cout << "Tof TopVolume name " << m_TopVolume->GetName() << endl;
39
40 m_G4GeoInit = 1;
41}
42
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;.
~TofG4Geo()
Destructor.
Definition TofG4Geo.cxx:31
TofG4Geo()
Constructor.
Definition TofG4Geo.cxx:21
void InitFromGdml(const char *gdmlFile, const char *setupName)
Initialize the instance of G4Geo.
Definition TofG4Geo.cxx:33
void SetDefaultVis()
Set default visual attributes;.
Definition TofG4Geo.cxx:43