Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RemSimShelterSPEDecorator.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 //
26 // $Id$
27 //
28 // Code developed by: S.Guatelli, susanna@uow.edu.au
29 //
31 #include "RemSimDecorator.hh"
33 #include "RemSimMaterial.hh"
34 
35 #include "G4SystemOfUnits.hh"
36 #include "G4Material.hh"
37 #include "G4MaterialTable.hh"
38 #include "G4Box.hh"
39 #include "G4LogicalVolume.hh"
40 #include "G4VPhysicalVolume.hh"
41 #include "G4PVPlacement.hh"
42 #include "G4VisAttributes.hh"
43 #include "G4RunManager.hh"
44 
46  : RemSimDecorator(comp)
47 {
48  shelterSPEX = 5.*m;
49  shelterSPEY = 5.*m;
50  shelterSPEZ = 75.*cm;
51  translation = - 2.* m;
52  pMaterial = new RemSimMaterial();
53 
54  shelterSPEVisAtt = 0;
55 }
57 {
58  delete pMaterial;
59 }
61 {
62  pMaterial -> DefineMaterials();
64  ConstructShelterSPE(motherVolume);
65 }
66 
68 {
69  delete shelterSPEVisAtt;
70  shelterSPEVisAtt = 0;
71 
72  delete shelterSPEPhys;
73  shelterSPEPhys = 0;
74 
75  delete shelterSPELog;
76  shelterSPELog = 0;
77 
78  delete shelterSPE;
79  shelterSPE = 0;
80 }
81 void RemSimShelterSPEDecorator::ConstructShelterSPE(G4VPhysicalVolume* motherVolume)
82 {
83  // Geometry definition
84  pMaterial -> DefineMaterials();
85 
86  G4Material* water = pMaterial -> GetMaterial("Water");
87 
88  shelterSPE = new G4Box("shelterSPE",shelterSPEX/2.,shelterSPEY/2.,shelterSPEZ/2.);
89 
90  shelterSPELog = new G4LogicalVolume(shelterSPE, water,
91  "shelterSPELog",0,0,0);
92 
93  shelterSPEPhys = new G4PVPlacement(0,
94  G4ThreeVector(0.,0.,translation + shelterSPEZ/2.),
95  "shelterSPEPhys", shelterSPELog, motherVolume,false,0);
96 
97  //Visualisation attributes
98  G4Colour red (1.0,0.0,0.0);
99  shelterSPEVisAtt = new G4VisAttributes(red);
100  shelterSPEVisAtt -> SetVisibility(true);
101  shelterSPEVisAtt -> SetForceSolid(true);
102  shelterSPELog -> SetVisAttributes(shelterSPEVisAtt);
104 }
105 
107 {
108  ;
109 }
110 
112 {
113  G4cout << "-----------------------------------------------------------------------"
114  << G4endl
115  << "the shelterSPE is a box whose thickness is: " << G4endl
116  << ((shelterSPE -> GetZHalfLength())*2.)/cm
117  << " cm along the Z axis"
118  << G4endl
119  << "material of the shelterSPE: "
120  << shelterSPELog -> GetMaterial() -> GetName() <<G4endl
121  << G4endl;
122 }