Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
G03DetectorConstruction Class Reference

Detector construction for the GDML extensions example. More...

#include <Doxymodules_persistency.h>

Inheritance diagram for G03DetectorConstruction:
G4VUserDetectorConstruction

Public Member Functions

 G03DetectorConstruction ()
 
 ~G03DetectorConstruction ()
 
virtual G4VPhysicalVolumeConstruct ()
 
void ListOfMaterials ()
 
void SetReadFile (const G4String &fname)
 
void SetWriteFile (const G4String &fname)
 

Private Attributes

G4MaterialfAir
 
G4MaterialfAluminum
 
G4MaterialfPb
 
G4MaterialfXenon
 
G4GDMLReadStructurefReader
 
G4GDMLWriteStructurefWriter
 
G4GDMLParserfParser
 
G4String fReadFile
 
G4String fWriteFile
 
G4bool fWritingChoice
 
G03DetectorMessengerfDetectorMessenger
 

Detailed Description

Detector construction for the GDML extensions example.

Definition at line 50 of file Doxymodules_persistency.h.

Constructor & Destructor Documentation

◆ G03DetectorConstruction()

G03DetectorConstruction::G03DetectorConstruction ( )

Definition at line 59 of file G03DetectorConstruction.cc.

61 fAir(0), fAluminum(0), fPb(0), fXenon(0),
62 fReader(0), fWriter(0), fParser(0),
64{
65 fReadFile = "color_extension.gdml";
66 fWriteFile = "color_extension_test.gdml";
68
70
74}
GDML reader for the color attributes.
GDML writer for the color attributes.
G03DetectorMessenger * fDetectorMessenger
G4GDMLWriteStructure * fWriter
Detector messenger for the GDML extensions example.

◆ ~G03DetectorConstruction()

G03DetectorConstruction::~G03DetectorConstruction ( )

Definition at line 78 of file G03DetectorConstruction.cc.

79{
80 delete fDetectorMessenger;
81 delete fReader;
82 delete fWriter;
83 delete fParser;
84}

Member Function Documentation

◆ Construct()

G4VPhysicalVolume * G03DetectorConstruction::Construct ( )
virtual

Definition at line 88 of file G03DetectorConstruction.cc.

89{
90 // Reading of Geometry from GDML
91
92 G4VPhysicalVolume* fWorldPhysVol;
93
94 fParser->Read(fReadFile,false);
95 //
96 // 2nd Boolean argument "Validate" set to false.
97 // Disabling Schema validation for reading extended GDML file.
98
99 // Prints the material information
100 //
101 G4cout << *(G4Material::GetMaterialTable() ) << G4endl;
102
103 // Giving World Physical Volume from GDML Parser
104 //
105 fWorldPhysVol = fParser->GetWorldVolume();
106
107 if(fWritingChoice!=0)
108 {
109 fParser->Write(fWriteFile, fWorldPhysVol, true,
110 "./SimpleExtensionSchema/SimpleExtension.xsd");
111 }
112
113 return fWorldPhysVol;
114}

◆ ListOfMaterials()

void G03DetectorConstruction::ListOfMaterials ( )

Definition at line 118 of file G03DetectorConstruction.cc.

119{
120 G4double a; // atomic mass
121 G4double z; // atomic number
122 G4double density,temperature,pressure;
123 G4double fractionmass;
124 G4String name, symbol;
125 G4int ncomponents;
126
127 // Elements needed for the materials
128
129 a = 14.01*g/mole;
130 G4Element* elN = new G4Element(name="Nitrogen", symbol="N", z=7., a);
131
132 a = 16.00*g/mole;
133 G4Element* elO = new G4Element(name="Oxygen", symbol="O", z=8., a);
134
135 a = 26.98*g/mole;
136 G4Element* elAl = new G4Element(name="Aluminum", symbol="Al", z=13., a);
137
138 // Print the Element information
139 //
140 G4cout << *(G4Element::GetElementTable()) << G4endl;
141
142 // Air
143 //
144 density = 1.29*mg/cm3;
145 fAir = new G4Material(name="Air", density, ncomponents=2);
146 fAir->AddElement(elN, fractionmass=0.7);
147 fAir->AddElement(elO, fractionmass=0.3);
148
149 // Aluminum
150 //
151 density = 2.70*g/cm3;
152 fAluminum = new G4Material(name="Aluminum", density, ncomponents=1);
153 fAluminum->AddElement(elAl, fractionmass=1.0);
154
155 // Lead
156 //
157 fPb = new G4Material("Lead", z=82., a= 207.19*g/mole, density= 11.35*g/cm3);
158
159 // Xenon gas
160 //
161 fXenon = new G4Material("XenonGas", z=54., a=131.29*g/mole,
162 density= 5.458*mg/cm3, kStateGas,
163 temperature= 293.15*kelvin, pressure= 1*atmosphere);
164
165 // Prints the material information
166 //
167 G4cout << *(G4Material::GetMaterialTable() ) << G4endl;
168}
std::vector< ExP01TrackerHit * > a

◆ SetReadFile()

void G03DetectorConstruction::SetReadFile ( const G4String fname)

Definition at line 172 of file G03DetectorConstruction.cc.

173{
174 fReadFile=fname;
176}

◆ SetWriteFile()

void G03DetectorConstruction::SetWriteFile ( const G4String fname)

Definition at line 180 of file G03DetectorConstruction.cc.

181{
182 fWriteFile=fname;
184}

Member Data Documentation

◆ fAir

G4Material* G03DetectorConstruction::fAir
private

Definition at line 73 of file G03DetectorConstruction.hh.

◆ fAluminum

G4Material* G03DetectorConstruction::fAluminum
private

Definition at line 74 of file G03DetectorConstruction.hh.

◆ fPb

G4Material* G03DetectorConstruction::fPb
private

Definition at line 75 of file G03DetectorConstruction.hh.

◆ fXenon

G4Material* G03DetectorConstruction::fXenon
private

Definition at line 76 of file G03DetectorConstruction.hh.

◆ fReader

G4GDMLReadStructure* G03DetectorConstruction::fReader
private

Definition at line 80 of file G03DetectorConstruction.hh.

◆ fWriter

G4GDMLWriteStructure* G03DetectorConstruction::fWriter
private

Definition at line 84 of file G03DetectorConstruction.hh.

◆ fParser

G4GDMLParser* G03DetectorConstruction::fParser
private

Definition at line 88 of file G03DetectorConstruction.hh.

◆ fReadFile

G4String G03DetectorConstruction::fReadFile
private

Definition at line 92 of file G03DetectorConstruction.hh.

◆ fWriteFile

G4String G03DetectorConstruction::fWriteFile
private

Definition at line 92 of file G03DetectorConstruction.hh.

◆ fWritingChoice

G4bool G03DetectorConstruction::fWritingChoice
private

Definition at line 93 of file G03DetectorConstruction.hh.

◆ fDetectorMessenger

G03DetectorMessenger* G03DetectorConstruction::fDetectorMessenger
private

Definition at line 97 of file G03DetectorConstruction.hh.


The documentation for this class was generated from the following files:

Applications | User Support | Publications | Collaboration