5 #include <Geant4/G4Box.hh>
6 #include <Geant4/G4Color.hh>
7 #include <Geant4/G4LogicalVolume.hh>
8 #include <Geant4/G4Material.hh>
9 #include <Geant4/G4PVPlacement.hh>
10 #include <Geant4/G4SubtractionSolid.hh>
11 #include <Geant4/G4SystemOfUnits.hh>
12 #include <Geant4/G4ThreeVector.hh>
13 #include <Geant4/G4Tubs.hh>
14 #include <Geant4/G4VisAttributes.hh>
44 double xdim = 20 *
cm;
45 double ydim = 20 *
cm;
46 double zdim = 20 *
cm;
47 G4VSolid *solidbox =
new G4Box(
"Example01BoxSolid", xdim / 2., ydim / 2., zdim / 2.);
48 G4VSolid *cylcut =
new G4Tubs(
"CylinderCutSolid", 0., xdim / 4., zdim, 0.,
M_PI *
rad);
49 G4VSolid *subtract =
new G4SubtractionSolid(
"HoleInBox", solidbox, cylcut);
50 G4LogicalVolume *logical =
new G4LogicalVolume(subtract, G4Material::GetMaterial(
"G4_Al"),
"BoxWithHoleLogical");
52 G4VisAttributes *vis =
new G4VisAttributes(G4Color(G4Colour::Grey()));
53 vis->SetForceSolid(
true);
54 logical->SetVisAttributes(vis);
55 G4VPhysicalVolume *phy =
new G4PVPlacement(
nullptr, G4ThreeVector(0, 0, 0),
56 logical,
"BoxWithHole",
66 cout <<
"Example01 Detector:" << endl;
67 if (what ==
"ALL" || what ==
"VOLUME")
69 cout <<
"Version 0.1" << endl;