Simple detector construction with only a world volume.
More...
#include <Doxymodules_common.h>
Simple detector construction with only a world volume.
Definition at line 13 of file Doxymodules_common.h.
◆ DetectorConstruction0()
Common::DetectorConstruction0::DetectorConstruction0 |
( |
const G4String & |
materialName = "G4_AIR" , |
|
|
G4double |
hx = 50*CLHEP::cm , |
|
|
G4double |
hy = 50*CLHEP::cm , |
|
|
G4double |
hz = 50*CLHEP::cm |
|
) |
| |
◆ ~DetectorConstruction0()
Common::DetectorConstruction0::~DetectorConstruction0 |
( |
| ) |
|
|
override |
◆ Construct()
Definition at line 62 of file DetectorConstruction0.cc.
63{
64
65
66 auto nistManager = G4NistManager::Instance();
67
68 auto material = nistManager->FindOrBuildMaterial(
fMaterialName);
69
70
71
72 auto sWorld
77
80 material,
81 "World");
82
83 auto pWorld
85 G4ThreeVector(),
87 "World",
88 0,
89 false,
90 0);
91
92
93
94 return pWorld;
95}
G4LogicalVolume * fWorldVolume
◆ SetMaterial()
void Common::DetectorConstruction0::SetMaterial |
( |
const G4String & |
materialName | ) |
|
Definition at line 99 of file DetectorConstruction0.cc.
100{
101 auto nistManager = G4NistManager::Instance();
102
103 auto newMaterial = nistManager->FindOrBuildMaterial(materialName);
104 if ( ! newMaterial ) {
105 G4cerr << "Material " << materialName << " not found." << G4endl;
106 G4cerr << "The box material was not changed." << G4endl;
107 return;
108 }
109
111 G4cout << "Material of box changed to " << materialName << G4endl;
112}
◆ SetDimensions()
void Common::DetectorConstruction0::SetDimensions |
( |
G4ThreeVector |
dimensions | ) |
|
Set world dimension (in half lengths). This setting has effect only if called in PreInit> phase
Definition at line 116 of file DetectorConstruction0.cc.
◆ DefineCommands()
void Common::DetectorConstruction0::DefineCommands |
( |
| ) |
|
|
private |
Definition at line 126 of file DetectorConstruction0.cc.
127{
128
130 "/detector/",
131 "Detector control");
132
133
134 auto& setMaterialCmd
137 "Set world material name.");
138 setMaterialCmd.SetParameterName("materialName", false);
139 setMaterialCmd.SetDefaultValue("G4_AIR");
140 setMaterialCmd.SetStates(G4State_PreInit);
141
142
143 auto& setDimensionsCmd
144 =
fMessenger->DeclareMethodWithUnit(
"setDimensions",
"mm",
146 "Set world dimensions (in half lentgh).");
147 setDimensionsCmd.SetParameterName("dimensions", false);
148 setDimensionsCmd.SetStates(G4State_PreInit);
149}
void SetDimensions(G4ThreeVector dimensions)
void SetMaterial(const G4String &materialName)
◆ fMessenger
◆ fMaterialName
G4String Common::DetectorConstruction0::fMaterialName |
|
private |
◆ fDimensions
G4ThreeVector Common::DetectorConstruction0::fDimensions |
|
private |
◆ fWorldVolume
The documentation for this class was generated from the following files: