Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RE04ParallelWorldConstruction.cc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
28 //
29 // $Id: $
30 //
33 
34 #include "G4Box.hh"
35 #include "G4LogicalVolume.hh"
36 #include "G4PVPlacement.hh"
37 #include "G4PVParameterised.hh"
38 #include "G4Material.hh"
39 #include "G4SystemOfUnits.hh"
40 
41 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
44 :G4VUserParallelWorld(parallelWorldName),fConstructed(false)
45 {;}
46 
47 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
49 {;}
50 
51 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
53 {
54  if(fConstructed) return;
55  fConstructed = true;
56 
57  //
58  // World
59  //
60  G4VPhysicalVolume* ghostWorld = GetWorld();
61  G4LogicalVolume* worldLogical = ghostWorld->GetLogicalVolume();
62 
63  //
64  // material defined in the mass world
65  //
66  G4Material* water = G4Material::GetMaterial("G4_WATER");
67 
68  //
69  // parallel world placement box
70  //
71  G4VSolid* paraBox = new G4Box("paraBox",5.0*cm,30.0*cm,5.0*cm);
72  G4LogicalVolume* paraBoxLogical = new G4LogicalVolume(paraBox,water,
73  "paraBox");
74  new G4PVPlacement(0,G4ThreeVector(-25.0*cm,0.,0.),paraBoxLogical,
75  "paraBox",worldLogical,false,0);
76 
77  //
78  // mother of parallel world parameterized volumes
79  //
80  G4VSolid* paraMom = new G4Box("paraMom",20.0*cm,40.0*cm,20.0*cm);
81  G4LogicalVolume* paraMomLogical = new G4LogicalVolume(paraMom,0,"paraMom");
82  new G4PVPlacement(0,G4ThreeVector(10.0*cm,0.,0.),paraMomLogical,"paraMom",
83  worldLogical,false,0);
84 
85  //
86  // parallel world parameterized volumes
87  //
88  G4VSolid* paraPara = new G4Box("paraPara",5.0*cm,15.0*cm,10.0*cm);
89  G4LogicalVolume* paraParaLogical = new G4LogicalVolume(paraPara,water,
90  "paraPara");
92  new G4PVParameterised("paraPara",paraParaLogical,paraMomLogical,
93  kXAxis, 2, param);
94 
95 }
Definition of the RE04ParallelWorldParam class.
CLHEP::Hep3Vector G4ThreeVector
G4VPhysicalVolume * GetWorld()
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
Definition: G4Material.cc:602
Definition: G4Box.hh:64
Definition of the RE04ParallelWorldConstruction class.
RE04ParallelWorldConstruction(G4String &parallelWorldName)
static constexpr double cm
Definition: G4SIunits.hh:119
G4LogicalVolume * GetLogicalVolume() const