Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RMC01DetectorConstruction.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 //
32 // Class Name: RMC01DetectorConstruction
33 // Author: L. Desorgher
34 // Organisation: SpaceIT GmbH
35 // Contract: ESA contract 21435/08/NL/AT
36 // Customer: ESA/ESTEC
38 
39 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
40 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
41 
44 
45 #include "G4Material.hh"
46 #include "G4Box.hh"
47 #include "G4Orb.hh"
48 #include "G4Tubs.hh"
49 #include "G4LogicalVolume.hh"
50 #include "G4PVPlacement.hh"
51 #include "G4GeometryManager.hh"
52 #include "G4PhysicalVolumeStore.hh"
53 #include "G4LogicalVolumeStore.hh"
54 #include "G4SolidStore.hh"
55 #include "G4VisAttributes.hh"
56 #include "G4Colour.hh"
57 
58 #include "G4SDManager.hh"
59 #include "G4RunManager.hh"
60 #include "G4PhysicalConstants.hh"
61 #include "G4SystemOfUnits.hh"
62 #include "RMC01SD.hh"
63 
64 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
65 
67  : fShield_Thickness(5.*mm),
68  fSensitive_cylinder_H (1.*mm),
69  fSensitive_cylinder_Rout (1.*mm)
70 {
71  fDetectorMessenger = new RMC01DetectorMessenger(this);
72 }
73 
74 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
75 
77 { delete fDetectorMessenger;
78 }
79 
80 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
81 
83 {
84  DefineMaterials();
85  return ConstructSimpleGeometry();
86 }
87 
88 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
89 
90 void RMC01DetectorConstruction::DefineMaterials()
91 {
92 
93  G4String symbol; //a=mass of a mole;
94  G4double a, z, density; //z=mean number of protons;
95  G4double fractionmass;
96  G4int ncomponents;
97 
98  //
99  // define Elements
100  //
101 
102  G4Element* N = new G4Element("Nitrogen",symbol="N" , z= 7., a= 14.01*g/mole);
103  G4Element* O = new G4Element("Oxygen" ,symbol="O" , z= 8., a= 16.00*g/mole);
104 
105  //
106  // define simple materials
107  //
108 
109  new G4Material("Aluminum", z=13., a=26.98*g/mole, density=2.700*g/cm3);
110  new G4Material("Silicon", z=14., a=28.09*g/mole, density=2.33*g/cm3);
111  new G4Material("Tantalum", z=73., a=180.9479*g/mole, density=16.654*g/cm3);
112 
113  //
114  // define air
115  //
116 
117  G4Material* Air = new G4Material("Air" , density= 1.290*mg/cm3, ncomponents=2);
118  Air->AddElement(N, fractionmass=0.7);
119  Air->AddElement(O, fractionmass=0.3);
120 
121  //
122  //Example of Vacuum
123  //
124 
125  new G4Material("Vacuum", z=1., a=1.01*g/mole,density= universe_mean_density,
126  kStateGas, 3.e-18*pascal, 2.73*kelvin);
127 }
128 
129 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
130 
131 G4VPhysicalVolume* RMC01DetectorConstruction::ConstructSimpleGeometry()
132 {
133 
134  // Clean old geometry, if any
135 
140 
141  // World
142  //-----------
143 
144  G4Box* solidWorld = new G4Box("World",15.*cm, 15.*cm, 15.*cm);
145  G4LogicalVolume* logicWorld = new G4LogicalVolume(solidWorld,
146  G4Material::GetMaterial("Vacuum"),
147  "World");
148 
149  G4VPhysicalVolume* physiWorld = new G4PVPlacement(0, //no rotation
150  G4ThreeVector(), //at (0,0,0)
151  logicWorld, //its logical volume
152  "World", //its name
153  0, //its mother volume
154  false, //no boolean operation
155  0);
156 
157  //Shielding Aluminum Sphere
158  //-------------------
159 
160  G4double radiusShieldingSphere =10.*cm;
161 
162  G4Orb* solidShieldingSphere=new G4Orb("Shielding", radiusShieldingSphere);
163  G4LogicalVolume* logicShieldingSphere=
164  new G4LogicalVolume(solidShieldingSphere,
165  G4Material::GetMaterial("Aluminum"),
166  "Shielding"); //its name;
167 
168  new G4PVPlacement(0, //no rotation
169  G4ThreeVector(), //at (0,0,0)
170  logicShieldingSphere, //its logical volume
171  "Shielding", //its name
172  logicWorld, //its mother volume
173  false, //no boolean operation
174  0);
175 
176  //Bulk Sphere
177  //-------------------
178 
179  G4Orb* solidBulkSphere=new G4Orb("Bulk", radiusShieldingSphere-fShield_Thickness);
180  G4LogicalVolume* logicBulkSphere=new G4LogicalVolume(solidBulkSphere, //its solid
181  G4Material::GetMaterial("Air"),//its material
182  "Bulk"); //its name;
183 
184  new G4PVPlacement(0, //no rotation
185  G4ThreeVector(), //at (0,0,0)
186  logicBulkSphere, //its logical volume
187  "Bulk", //its name
188  logicShieldingSphere, //its mother volume
189  false, //no boolean operation
190  0);
191 
192  //Detecting cylinder
193  //-------------------
194 
195  G4Tubs* solidDetecting=new G4Tubs("SensitiveVolume",
196  0.,fSensitive_cylinder_Rout,fSensitive_cylinder_H/2.,
197  0.,twopi);
198 
199  G4LogicalVolume* logicDetectingCylinder=new G4LogicalVolume(solidDetecting,
200  G4Material::GetMaterial("Silicon"),
201  "SensitiveVolume");
202 
203  new G4PVPlacement(0, //no rotation
204  G4ThreeVector(0.,0.,0.), //at (0,0,0)
205  logicDetectingCylinder, //its logical volume
206  "SensitiveVolume", //its name
207  logicBulkSphere, //its mother volume
208  false, //no boolean operation
209  0);
210 
211 
212  RMC01SD* theSensitiveDetector = new RMC01SD("/SensitiveCylinder");
213 
214  G4SDManager::GetSDMpointer()->AddNewDetector(theSensitiveDetector);
215  logicDetectingCylinder->SetSensitiveDetector(theSensitiveDetector);
216 
217  //Tantalum Plates on the top and beside
218  //-------------------------------------
219  G4Box* solidPlate=new G4Box("TantalumPlate",4.*cm,4.*cm,0.25*mm);
220  G4LogicalVolume* logicPlate=new G4LogicalVolume(solidPlate, //its solid
221  G4Material::GetMaterial("Tantalum"),//its material
222  "TantalumPlate"); //its name;
223 
224 
225  new G4PVPlacement(0, //no rotation
226  G4ThreeVector(0.,0.,6.*cm), //at (0,0,0)
227  logicPlate, //its logical volume
228  "TantalumPlate1", //its name
229  logicBulkSphere, //its mother volume
230  false, //no boolean operation
231  0);
232 
233  new G4PVPlacement(0, //no rotation
234  G4ThreeVector(0.,0.,-6.*cm), //at (0,0,0)
235  logicPlate, //its logical volume
236  "TantalumPlate2", //its name
237  logicBulkSphere, //its mother volume
238  false, //no boolean operation
239  0);
240 
241  return physiWorld;
242 
243 }
244 
245 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
246 
248 { fSensitive_cylinder_Rout=r;
249 }
250 
251 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
252 
254 { fSensitive_cylinder_H=h;
255 }
256 
257 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
258 
260 { fShield_Thickness=d;
261 }
262 
263 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......