6 #include <G4Material.hh> 7 #include <G4LogicalVolume.hh> 8 #include <G4VPhysicalVolume.hh> 9 #include <G4PVPlacement.hh> 10 #include <G4VisAttributes.hh> 11 #include <G4VisExtent.hh> 13 #include <G4SystemOfUnits.hh> 14 #include <G4PhysicalConstants.hh> 18 #include <G4SubtractionSolid.hh> 35 =
new G4UIcmdWithADoubleAndUnit(
CommandName(
"length"),
this);
36 fLengthCMD->SetGuidance(
"Set the length of the world.");
37 fLengthCMD->SetParameterName(
"Length",
false);
38 fLengthCMD->SetUnitCategory(
"Length");
40 fWidthCMD =
new G4UIcmdWithADoubleAndUnit(
CommandName(
"width"),
this);
41 fWidthCMD->SetGuidance(
"Set the width of the world.");
42 fWidthCMD->SetParameterName(
"Width",
false);
43 fWidthCMD->SetUnitCategory(
"Length");
45 fHeightCMD =
new G4UIcmdWithADoubleAndUnit(
CommandName(
"height"),
this);
46 fHeightCMD->SetGuidance(
"Set the height of the world.");
47 fHeightCMD->SetParameterName(
"Height",
false);
48 fHeightCMD->SetUnitCategory(
"Length");
58 if (cmd==fLengthCMD) {
59 fBuilder->
SetLength(fLengthCMD->GetNewDoubleValue(val));
61 else if (cmd==fWidthCMD) {
62 fBuilder->
SetWidth(fWidthCMD->GetNewDoubleValue(val));
64 else if (cmd==fHeightCMD) {
65 fBuilder->
SetHeight(fHeightCMD->GetNewDoubleValue(val));
87 EDepSimLog(
"##############################################");
89 EDepSimLog(
"##############################################");
91 G4LogicalVolume *logVolume
92 =
new G4LogicalVolume(
new G4Box(GetName(),
98 logVolume->SetVisAttributes(G4VisAttributes::Invisible);
101 G4LogicalVolume *logFloor
102 =
new G4LogicalVolume(
new G4Box(GetName()+
"/Floor",
106 FindMaterial(
"Cement"),
108 logFloor->SetVisAttributes(G4VisAttributes::Invisible);
111 = Get<CaptCryostatBuilder>(
"Cryostat");
112 G4LogicalVolume* logCryostat = cryo.
GetPiece();
114 G4ThreeVector cryoCenter = G4ThreeVector(0,0,0)
117 new G4PVPlacement(NULL,
120 logCryostat->GetName(),
127 G4VisExtent cryoExtent = logCryostat->GetSolid()->GetExtent();
128 G4ThreeVector centerFloor(0.0, 0.0,
129 cryoCenter.z() + cryoExtent.GetZmin()
132 new G4PVPlacement(NULL,
142 logFloor->SetVisAttributes(GetColor(logFloor));
static constexpr double cm
#define EDepSimLog(outStream)
virtual ~CaptWorldBuilder()
void SetNewValue(G4UIcommand *cmd, G4String val)
G4UIcmdWithADoubleAndUnit * fHeightCMD
void SetHeight(double v)
Set the height of the world.
CaptWorldMessenger(CaptWorldBuilder *c)
Construct a module from components.
BuilderMessenger(EDepSim::Builder *c, const char *guide=NULL)
void SetWidth(double v)
Set the width of the world.
G4ThreeVector GetTPCOffset()
G4UIcmdWithADoubleAndUnit * fLengthCMD
void SetLength(double v)
Set the length of the world.
G4ThreeVector GetOffset()
void SetNewValue(G4UIcommand *cmd, G4String val)
virtual G4LogicalVolume * GetPiece(void)
G4UIcmdWithADoubleAndUnit * fWidthCMD
G4String CommandName(G4String cmd)
Build a command name with the directory prefix.
CaptWorldBuilder * fBuilder
virtual ~CaptWorldMessenger()
virtual G4LogicalVolume * GetPiece(void)
static TemplateFilterFactory::AutoRegister< FilterLength > fLength("length")