Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RemSimAstronautDecorator.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 // * RemSimAstronautDecorator.cc *
29 // * *
30 // **********************************
31 //
32 // $Id$
33 //
34 // Author:Susanna Guatelli, guatelli@ge.infn.it
35 
37 #include "RemSimMaterial.hh"
38 #include "G4SystemOfUnits.hh"
39 #include "G4Material.hh"
40 #include "G4MaterialTable.hh"
42 #include "RemSimDecorator.hh"
43 #include "G4Box.hh"
44 #include "G4LogicalVolume.hh"
45 #include "G4VPhysicalVolume.hh"
46 #include "G4PVPlacement.hh"
47 #include "G4VisAttributes.hh"
48 #include "G4SDManager.hh"
49 #include "G4RunManager.hh"
50 #include "RemSimMoonHabitat.hh"
51 
53  : RemSimDecorator(comp), phantom(0), phantomLog(0), phantomPhys(0)
54 {
55  flag = moon;
56 }
58 {
59 }
61 {
63  ConstructAstronaut(motherVolume);
64 }
65 
67 {
68 
69 }
70 
71 void RemSimAstronautDecorator::ConstructAstronaut(G4VPhysicalVolume* motherVolume)
72 {
73  // Astronaut definition: Box of water
74  // The Astronaut is the sensitive detector
75 
76  RemSimMaterial* pMaterial = new RemSimMaterial();
77 
78  G4Material* water = pMaterial -> GetMaterial("Water");
79  delete pMaterial;
80 
81  // Phantom sizes
82  G4double phantomX = 3. *m;
83  G4double phantomY = 3. *m;
84  G4double phantomZ = 30. *cm;
85 
86 
87  phantom = new G4Box("phantom",phantomX/2.,phantomY/2.,phantomZ/2.);
88 
89  phantomLog = new G4LogicalVolume(phantom,
90  water,
91  "phantom",
92  0,0,0);
93  G4double translation1 = 0.;
94  if (flag == true)
95  {
96  G4double thickShelter = 4.5 *m;
97  translation1 = 0.5*m + thickShelter/2.;
98  }
99 
100  phantomPhys = new G4PVPlacement(0,
101  G4ThreeVector(0.,0.,translation1),
102  "phantom",phantomLog,
103  motherVolume,false,0);
104 
105  // Visualisation attributes
106  G4Colour lblue (0.0, 0.0,.75);
107  G4VisAttributes* phantomVisAtt = new G4VisAttributes(lblue);
108  phantomVisAtt -> SetVisibility(true);
109  phantomVisAtt -> SetForceSolid(true);
110  phantomLog -> SetVisAttributes(phantomVisAtt);
111 }
112 
114 {
115  G4cout << "It is not possible to change the sizes of the Astronaut"
116  << G4endl;
117 }
118 
120 {
121  G4cout << "-----------------------------------------------------------------------"
122  << G4endl
123  << "the astronaut is a box whose thickness is: " << G4endl
124  << ((phantom -> GetZHalfLength())*2.)/cm
125  << " cm along the Z axis"
126  << G4endl
127  << "material of the astronaut: "
128  << phantomLog -> GetMaterial() -> GetName() <<G4endl
129  << G4endl;
130 }
131