31 #include "DetectorConstruction.hh"
49 fBoxMaterialName(boxMaterialName),
50 fWorldMaterialName(worldMaterialName),
51 fBoxDimensions(boxHx*2, boxHy*2, boxHz*2),
52 fWorldSizeFactor(worldSizeFactor),
135 auto newMaterial = nistManager->FindOrBuildMaterial(materialName);
136 if ( ! newMaterial ) {
137 G4cerr <<
"Material " << materialName <<
" not found." <<
G4endl;
138 G4cerr <<
"The box material was not changed." <<
G4endl;
142 if ( fBoxVolume ) fBoxVolume->SetMaterial(newMaterial);
143 G4cout <<
"Material of box changed to " << materialName <<
G4endl;
152 auto newMaterial = nistManager->FindOrBuildMaterial(materialName);
153 if ( ! newMaterial ) {
154 G4cerr <<
"Material " << materialName <<
" not found." <<
G4endl;
155 G4cerr <<
"The box material was not changed." <<
G4endl;
159 if ( fWorldVolume ) fWorldVolume->SetMaterial(newMaterial);
160 G4cout <<
"Material of box changed to " << materialName <<
G4endl;
180 fWorldSizeFactor = factor;
193 auto& setBoxMaterialCmd
196 "Set box material name.");
201 auto& setWorldMaterialCmd
204 "Set world material name.");
209 auto& setBoxDimensionsCmd
212 "Set box dimensions (in half lentgh).");
217 auto& setWorldSizeFactorCmd
220 "Set the multiplication factor from box dimensions to world dimensions.");
222 setWorldSizeFactorCmd.
SetRange(
"WorldSizeFactor >= 1");
G4LogicalVolume * fWorldVolume
This class is generic messenger.
CLHEP::Hep3Vector G4ThreeVector
Command & DeclareMethodWithUnit(const G4String &name, const G4String &defaultUnit, const G4AnyMethod &fun, const G4String &doc="")
void SetBoxDimensions(G4ThreeVector dimensions)
G4VPhysicalVolume * Construct()
Command & SetDefaultValue(const G4String &)
void SetBoxMaterial(const G4String &materialName)
G4LogicalVolume * fBoxVolume
G4String fWorldMaterialName
Command & DeclareMethod(const G4String &name, const G4AnyMethod &fun, const G4String &doc="")
void SetWorldMaterial(const G4String &materialName)
Command & SetStates(G4ApplicationState s0)
G4String fBoxMaterialName
Command & SetRange(const G4String &range)
G4GLOB_DLL std::ostream G4cerr
Command & SetParameterName(const G4String &, G4bool, G4bool=false)
void SetWorldSizeFactor(G4double factor)
G4GenericMessenger * fMessenger
G4double fWorldSizeFactor
G4GLOB_DLL std::ostream G4cout
G4ThreeVector fBoxDimensions
static G4NistManager * Instance()