QwGeant4
QweakSimGeometry.cc
Go to the documentation of this file.
1 //=============================================================================
2 //
3 // ---------------------------
4 // | Doxygen File Information |
5 // ---------------------------
6 //
7 /**
8 
9  \file QweakSimGeometry.cc
10 
11  $Revision: 1.0 $
12  $Date: 2009/09/02 19:37:26 $
13 
14  \author Wouter Deconinck
15 
16 */
17 //=============================================================================
18 
19 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
20 
21 #include "QweakSimGeometry.hh"
22 
23 // geant4 includes
24 #ifdef G4LIB_USE_GDML
25 #include "G4GDMLParser.hh"
26 #include "G4Material.hh"
27 #include "G4Element.hh"
28 #endif
29 
30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
31 
33 : fStoreReferences(true)
34 {
35  G4cout << G4endl << "###### Calling QweakSimGeometry::QweakSimGeometry() " << G4endl << G4endl;
36 
37  // Filenames
38  fReadFile = "GDML/qweak.gdml";
39  fWriteFile = "GDML/qweak_out.gdml";
40 
41  // Modules
42  fModuleDepth = -1;
43  fModuleUser = false;
44 
45 #ifdef G4LIB_USE_GDML
46 #else
47  G4cout << "No support for GDML geometry!" << G4endl;
48 #endif
49 
51 
52  G4cout << G4endl << "###### Leaving QweakSimGeometry::QweakSimGeometry() " << G4endl << G4endl;
53 }
54 
55 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
56 
58 {
59  G4cout << G4endl << "###### Calling QweakSimGeometry::~QweakSimGeometry() " << G4endl << G4endl;
60 
62 
63  G4cout << G4endl << "###### Leaving QweakSimGeometry::~QweakSimGeometry() " << G4endl << G4endl;
64 }
65 
66 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
67 
69 {
70  G4cout << G4endl << "###### Calling QweakSimGeometry::Write() " << G4endl << G4endl;
71 
72 #ifdef G4LIB_USE_GDML
73  // If the module depth is non-negative, split according to this depth
74  if (fModuleDepth >= 0)
75  fGDMLParser.AddModule(fModuleDepth);
76  // Write all geometry starting from the world volume
77  fGDMLParser.Write(fWriteFile, fWorldVolume, fStoreReferences);
78 #else
79  G4cout << "No support for GDML geometry!" << G4endl;
80 #endif
81 
82  G4cout << G4endl << "###### Leaving QweakSimGeometry::Write() " << G4endl << G4endl;
83 }
84 
85 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
86 
87 G4VPhysicalVolume* QweakSimGeometry::Read()
88 {
89  G4cout << G4endl << "###### Calling QweakSimGeometry::Read() " << G4endl << G4endl;
90 
91 #ifdef G4LIB_USE_GDML
92  fGDMLParser.SetOverlapCheck(true);
93  fGDMLParser.Read(fReadFile);
94  fGDMLParser.StripNamePointers();
95 
96  G4cout << *(G4Element::GetElementTable()) << G4endl;
97  G4cout << *(G4Material::GetMaterialTable()) << G4endl;
98 
99  G4VPhysicalVolume* worldvolume = fGDMLParser.GetWorldVolume();
100 #else
101  G4cout << "No support for GDML geometry!" << G4endl;
102  G4VPhysicalVolume* worldvolume = NULL;
103 #endif
104 
105  G4cout << G4endl << "###### Leaving QweakSimGeometry::Read() " << G4endl << G4endl;
106 
107  return worldvolume;
108 }
109 
110 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Scans the input file for /GDML/ commands.
G4VPhysicalVolume * Read()
QweakSimGeometryMessenger * fGeometryMessenger
G4VPhysicalVolume * fWorldVolume