Geant4  10.02.p03
G03DetectorConstruction Class Reference

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

#include <G03DetectorConstruction.hh>

Inheritance diagram for G03DetectorConstruction:
Collaboration diagram for G03DetectorConstruction:

Public Member Functions

 G03DetectorConstruction ()
 
 ~G03DetectorConstruction ()
 
virtual G4VPhysicalVolumeConstruct ()
 
void ListOfMaterials ()
 
void SetReadFile (const G4String &fname)
 
void SetWriteFile (const G4String &fname)
 
- Public Member Functions inherited from G4VUserDetectorConstruction
 G4VUserDetectorConstruction ()
 
virtual ~G4VUserDetectorConstruction ()
 
virtual void ConstructSDandField ()
 
virtual void CloneSD ()
 
virtual void CloneF ()
 
void RegisterParallelWorld (G4VUserParallelWorld *)
 
G4int ConstructParallelGeometries ()
 
void ConstructParallelSD ()
 
G4int GetNumberOfParallelWorld () const
 
G4VUserParallelWorldGetParallelWorld (G4int i) const
 

Private Attributes

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

Additional Inherited Members

- Protected Member Functions inherited from G4VUserDetectorConstruction
void SetSensitiveDetector (const G4String &logVolName, G4VSensitiveDetector *aSD, G4bool multi=false)
 
void SetSensitiveDetector (G4LogicalVolume *logVol, G4VSensitiveDetector *aSD)
 

Detailed Description

Detector construction for the GDML extensions example.

Definition at line 50 of file G03DetectorConstruction.hh.

Constructor & Destructor Documentation

◆ G03DetectorConstruction()

G03DetectorConstruction::G03DetectorConstruction ( )

Definition at line 60 of file G03DetectorConstruction.cc.

62  fAir(0), fAluminum(0), fPb(0), fXenon(0),
63  fReader(0), fWriter(0), fParser(0),
65 {
66  fReadFile = "color_extension.gdml";
67  fWriteFile = "color_extension_test.gdml";
68  fWritingChoice = 1;
69 
71 
72  fReader = new G03ColorReader;
73  fWriter = new G03ColorWriter;
75 }
G4GDMLWriteStructure * fWriter
GDML reader for the color attributes.
Detector messenger for the GDML extensions example.
GDML writer for the color attributes.
G4GDMLReadStructure * fReader
G03DetectorMessenger * fDetectorMessenger

◆ ~G03DetectorConstruction()

G03DetectorConstruction::~G03DetectorConstruction ( )

Definition at line 79 of file G03DetectorConstruction.cc.

80 {
81  delete fDetectorMessenger;
82  delete fReader;
83  delete fWriter;
84  delete fParser;
85 }
G4GDMLWriteStructure * fWriter
G4GDMLReadStructure * fReader
G03DetectorMessenger * fDetectorMessenger

Member Function Documentation

◆ Construct()

G4VPhysicalVolume * G03DetectorConstruction::Construct ( void  )
virtual

Implements G4VUserDetectorConstruction.

Definition at line 89 of file G03DetectorConstruction.cc.

90 {
91  // Reading of Geometry from GDML
92 
93  G4VPhysicalVolume* fWorldPhysVol;
94 
95  fParser->Read(fReadFile,false);
96  //
97  // 2nd Boolean argument "Validate" set to false.
98  // Disabling Schema validation for reading extended GDML file.
99 
100  // Prints the material information
101  //
103 
104  // Giving World Physical Volume from GDML Parser
105  //
106  fWorldPhysVol = fParser->GetWorldVolume();
107 
108  if(fWritingChoice!=0)
109  {
110  fParser->Write(fWriteFile, fWorldPhysVol, true,
111  "./SimpleExtensionSchema/SimpleExtension.xsd");
112  }
113 
114  return fWorldPhysVol;
115 }
static G4MaterialTable * GetMaterialTable()
Definition: G4Material.cc:589
G4GLOB_DLL std::ostream G4cout
void Write(const G4String &filename, const G4VPhysicalVolume *pvol=0, G4bool storeReferences=true, const G4String &SchemaLocation=G4GDML_DEFAULT_SCHEMALOCATION)
G4VPhysicalVolume * GetWorldVolume(const G4String &setupName="Default") const
void Read(const G4String &filename, G4bool Validate=true)
#define G4endl
Definition: G4ios.hh:61
Here is the call graph for this function:

◆ ListOfMaterials()

void G03DetectorConstruction::ListOfMaterials ( )

Definition at line 119 of file G03DetectorConstruction.cc.

120 {
121  G4double a; // atomic mass
122  G4double z; // atomic number
123  G4double density,temperature,pressure;
124  G4double fractionmass;
126  G4int ncomponents;
127 
128  // Elements needed for the materials
129 
130  a = 14.01*g/mole;
131  G4Element* elN = new G4Element(name="Nitrogen", symbol="N", z=7., a);
132 
133  a = 16.00*g/mole;
134  G4Element* elO = new G4Element(name="Oxygen", symbol="O", z=8., a);
135 
136  a = 26.98*g/mole;
137  G4Element* elAl = new G4Element(name="Aluminum", symbol="Al", z=13., a);
138 
139  // Print the Element information
140  //
142 
143  // Air
144  //
145  density = 1.29*mg/cm3;
146  fAir = new G4Material(name="Air", density, ncomponents=2);
147  fAir->AddElement(elN, fractionmass=0.7);
148  fAir->AddElement(elO, fractionmass=0.3);
149 
150  // Aluminum
151  //
152  density = 2.70*g/cm3;
153  fAluminum = new G4Material(name="Aluminum", density, ncomponents=1);
154  fAluminum->AddElement(elAl, fractionmass=1.0);
155 
156  // Lead
157  //
158  fPb = new G4Material("Lead", z=82., a= 207.19*g/mole, density= 11.35*g/cm3);
159 
160  // Xenon gas
161  //
162  fXenon = new G4Material("XenonGas", z=54., a=131.29*g/mole,
163  density= 5.458*mg/cm3, kStateGas,
164  temperature= 293.15*kelvin, pressure= 1*atmosphere);
165 
166  // Prints the material information
167  //
169 }
G4String symbol
Definition: TRTMaterials.hh:40
G4String name
Definition: TRTMaterials.hh:40
static G4MaterialTable * GetMaterialTable()
Definition: G4Material.cc:589
static const double mg
Definition: G4SIunits.hh:181
int G4int
Definition: G4Types.hh:78
G4Element * elN
Definition: TRTMaterials.hh:44
G4double density
Definition: TRTMaterials.hh:39
function g(Y1, Y2, PT2)
Definition: hijing1.383.f:5206
G4GLOB_DLL std::ostream G4cout
G4Element * elO
Definition: TRTMaterials.hh:46
static const double cm3
Definition: G4SIunits.hh:120
static const double kelvin
Definition: G4SIunits.hh:278
static const double atmosphere
Definition: G4SIunits.hh:234
static const double mole
Definition: G4SIunits.hh:283
#define G4endl
Definition: G4ios.hh:61
void AddElement(G4Element *element, G4int nAtoms)
Definition: G4Material.cc:364
double G4double
Definition: G4Types.hh:76
static G4ElementTable * GetElementTable()
Definition: G4Element.cc:395
Here is the call graph for this function:

◆ SetReadFile()

void G03DetectorConstruction::SetReadFile ( const G4String fname)

Definition at line 173 of file G03DetectorConstruction.cc.

Here is the caller graph for this function:

◆ SetWriteFile()

void G03DetectorConstruction::SetWriteFile ( const G4String fname)

Definition at line 181 of file G03DetectorConstruction.cc.

Here is the caller graph for this function:

Member Data Documentation

◆ fAir

G4Material* G03DetectorConstruction::fAir
private

Definition at line 74 of file G03DetectorConstruction.hh.

◆ fAluminum

G4Material* G03DetectorConstruction::fAluminum
private

Definition at line 75 of file G03DetectorConstruction.hh.

◆ fDetectorMessenger

G03DetectorMessenger* G03DetectorConstruction::fDetectorMessenger
private

Definition at line 98 of file G03DetectorConstruction.hh.

◆ fParser

G4GDMLParser* G03DetectorConstruction::fParser
private

Definition at line 89 of file G03DetectorConstruction.hh.

◆ fPb

G4Material* G03DetectorConstruction::fPb
private

Definition at line 76 of file G03DetectorConstruction.hh.

◆ fReader

G4GDMLReadStructure* G03DetectorConstruction::fReader
private

Definition at line 81 of file G03DetectorConstruction.hh.

◆ fReadFile

G4String G03DetectorConstruction::fReadFile
private

Definition at line 93 of file G03DetectorConstruction.hh.

◆ fWriteFile

G4String G03DetectorConstruction::fWriteFile
private

Definition at line 93 of file G03DetectorConstruction.hh.

◆ fWriter

G4GDMLWriteStructure* G03DetectorConstruction::fWriter
private

Definition at line 85 of file G03DetectorConstruction.hh.

◆ fWritingChoice

G4bool G03DetectorConstruction::fWritingChoice
private

Definition at line 94 of file G03DetectorConstruction.hh.

◆ fXenon

G4Material* G03DetectorConstruction::fXenon
private

Definition at line 77 of file G03DetectorConstruction.hh.


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