Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RemSimRoofDecorator.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 // ************************************
27 // * *
28 // * RemSimRoofDecorator.cc *
29 // * *
30 // ************************************
31 //
32 // Code developed by: S.Guatelli, susanna@uow.edu.au
33 //
34 //
35 // $Id$
36 //
37 
38 #include "RemSimRoofDecorator.hh"
39 #include "RemSimDecorator.hh"
41 #include "RemSimMaterial.hh"
42 
43 #include "G4SystemOfUnits.hh"
44 #include "G4Material.hh"
45 #include "G4MaterialTable.hh"
46 #include "G4Trd.hh"
47 #include "G4LogicalVolume.hh"
48 #include "G4VPhysicalVolume.hh"
49 #include "G4PVPlacement.hh"
50 #include "G4VisAttributes.hh"
51 #include "G4RunManager.hh"
52 
54  : RemSimDecorator(comp)
55 {
56  pMaterial = new RemSimMaterial();
57  roofVisAtt = 0;
58  roof = 0;
59  roofLog = 0;
60  roofPhys = 0;
61 }
63 {
64  delete pMaterial;
65 }
67 {
68  pMaterial -> DefineMaterials();
70  ConstructRoof(motherVolume);
71 }
72 
74 {
75  delete roofVisAtt;
76  roofVisAtt = 0;
77 
78  delete roofPhys;
79  roofPhys = 0;
80 
81  delete roofLog;
82  roofLog = 0;
83 
84  delete roof;
85  roof = 0;
86 }
87 void RemSimRoofDecorator::ConstructRoof(G4VPhysicalVolume* motherVolume)
88 {
89  // Geometry definition
90  pMaterial -> DefineMaterials();
91 
92  G4Material* moonMaterial = pMaterial -> GetMaterial("moon");
93 
94 
95  roof = new G4Trd("roof",2.25*m,7.*m,5.*m, 8.*m, 0.5 *m);
96 
97  roofLog = new G4LogicalVolume(roof,
98  moonMaterial,
99  "roof",
100  0,0,0);
101 
102  roofPhys = new G4PVPlacement(0,
103  G4ThreeVector(0.,0., - 0.5 *m),
104  "roof",roofLog,
105  motherVolume,false,0);
106 
107  //Visualisation attributes
108  G4Colour red (1.0,0.0,0.0);
109  roofVisAtt = new G4VisAttributes(red);
110  roofVisAtt -> SetVisibility(true);
111  roofVisAtt -> SetForceSolid(true);
112  roofLog -> SetVisAttributes(roofVisAtt);
114 }
115 
117 {
119  roof -> SetZHalfLength(thick/2.);
120  roofPhys -> SetTranslation(G4ThreeVector
121  (0.,0., - thick/2.));
122 }
123 
125 {
126  ;
127 }