Geant4.10
 All Data Structures 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 //
26 /// \file biasing/ReverseMC01/src/RMC01DetectorConstruction.cc
27 /// \brief Implementation of the RMC01DetectorConstruction class
28 //
29 // $Id: RMC01DetectorConstruction.cc 71233 2013-06-12 13:16:05Z gcosmo $
30 //
31 //////////////////////////////////////////////////////////////
32 // Class Name: RMC01DetectorConstruction
33 // Author: L. Desorgher
34 // Organisation: SpaceIT GmbH
35 // Contract: ESA contract 21435/08/NL/AT
36 // Customer: ESA/ESTEC
37 //////////////////////////////////////////////////////////////
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 
68  fDetectorMessenger(0),
69  fShield_Thickness(5.*mm),
70  fSensitive_cylinder_H (1.*mm),
71  fSensitive_cylinder_Rout (1.*mm)
72 {
73  fDetectorMessenger = new RMC01DetectorMessenger(this);
74 }
75 
76 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
77 
79 { delete fDetectorMessenger;
80 }
81 
82 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
83 
85 {
86  DefineMaterials();
87  return ConstructSimpleGeometry();
88 }
89 
90 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
91 
92 void RMC01DetectorConstruction::DefineMaterials()
93 {
94 
95  G4String symbol; //a=mass of a mole;
96  G4double a, z, density; //z=mean number of protons;
97  G4double fractionmass;
98  G4int ncomponents;
99 
100  //
101  // define Elements
102  //
103 
104  G4Element* N = new G4Element("Nitrogen",symbol="N" , z= 7., a= 14.01*g/mole);
105  G4Element* O = new G4Element("Oxygen" ,symbol="O" , z= 8., a= 16.00*g/mole);
106 
107  //
108  // define simple materials
109  //
110 
111  new G4Material("Aluminum", z=13., a=26.98*g/mole, density=2.700*g/cm3);
112  new G4Material("Silicon", z=14., a=28.09*g/mole, density=2.33*g/cm3);
113  new G4Material("Tantalum", z=73., a=180.9479*g/mole, density=16.654*g/cm3);
114 
115  //
116  // define air
117  //
118 
119  G4Material* Air = new G4Material("Air", density= 1.290*mg/cm3, ncomponents=2);
120  Air->AddElement(N, fractionmass=0.7);
121  Air->AddElement(O, fractionmass=0.3);
122 
123  //
124  //Example of Vacuum
125  //
126 
127  new G4Material("Vacuum", z=1., a=1.01*g/mole,density= universe_mean_density,
128  kStateGas, 3.e-18*pascal, 2.73*kelvin);
129 }
130 
131 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
132 
133 G4VPhysicalVolume* RMC01DetectorConstruction::ConstructSimpleGeometry()
134 {
135 
136  // Clean old geometry, if any
137 
142 
143  // World
144  //-----------
145 
146  G4Box* solidWorld = new G4Box("World",15.*cm, 15.*cm, 15.*cm);
147  G4LogicalVolume* logicWorld = new G4LogicalVolume(solidWorld,
148  G4Material::GetMaterial("Vacuum"),
149  "World");
150 
151  G4VPhysicalVolume* physiWorld = new G4PVPlacement(0, //no rotation
152  G4ThreeVector(), //at (0,0,0)
153  logicWorld, //its logical volume
154  "World", //its name
155  0, //its mother volume
156  false, //no boolean operation
157  0);
158 
159  //Shielding Aluminum Sphere
160  //-------------------
161 
162  G4double radiusShieldingSphere =10.*cm;
163 
164  G4Orb* solidShieldingSphere=new G4Orb("Shielding", radiusShieldingSphere);
165  G4LogicalVolume* logicShieldingSphere=
166  new G4LogicalVolume(solidShieldingSphere,
167  G4Material::GetMaterial("Aluminum"),
168  "Shielding"); //its name;
169 
170  new G4PVPlacement(0, //no rotation
171  G4ThreeVector(), //at (0,0,0)
172  logicShieldingSphere, //its logical volume
173  "Shielding", //its name
174  logicWorld, //its mother volume
175  false, //no boolean operation
176  0);
177 
178  //Bulk Sphere
179  //-------------------
180 
181  G4Orb* solidBulkSphere=new G4Orb("Bulk",
182  radiusShieldingSphere-fShield_Thickness);
183  G4LogicalVolume* logicBulkSphere=new G4LogicalVolume(
184  solidBulkSphere,//its solid
185  G4Material::GetMaterial("Air"),//its material
186  "Bulk"); //its name;
187 
188  new G4PVPlacement(0, //no rotation
189  G4ThreeVector(), //at (0,0,0)
190  logicBulkSphere, //its logical volume
191  "Bulk", //its name
192  logicShieldingSphere, //its mother volume
193  false, //no boolean operation
194  0);
195 
196  //Detecting cylinder
197  //-------------------
198 
199  G4Tubs* solidDetecting=new G4Tubs("SensitiveVolume",
200  0.,fSensitive_cylinder_Rout,fSensitive_cylinder_H/2.,
201  0.,twopi);
202 
203  G4LogicalVolume* logicDetectingCylinder=new G4LogicalVolume(solidDetecting,
204  G4Material::GetMaterial("Silicon"),
205  "SensitiveVolume");
206 
207  new G4PVPlacement(0, //no rotation
208  G4ThreeVector(0.,0.,0.), //at (0,0,0)
209  logicDetectingCylinder, //its logical volume
210  "SensitiveVolume", //its name
211  logicBulkSphere, //its mother volume
212  false, //no boolean operation
213  0);
214 
215 
216  RMC01SD* theSensitiveDetector = new RMC01SD("/SensitiveCylinder");
217 
218  G4SDManager::GetSDMpointer()->AddNewDetector(theSensitiveDetector);
219  logicDetectingCylinder->SetSensitiveDetector(theSensitiveDetector);
220 
221  //Tantalum Plates on the top and beside
222  //-------------------------------------
223  G4Box* solidPlate=new G4Box("TantalumPlate",4.*cm,4.*cm,0.25*mm);
224  G4LogicalVolume* logicPlate=new G4LogicalVolume(solidPlate, //its solid
225  G4Material::GetMaterial("Tantalum"),//its material
226  "TantalumPlate"); //its name;
227 
228 
229  new G4PVPlacement(0, //no rotation
230  G4ThreeVector(0.,0.,6.*cm), //at (0,0,0)
231  logicPlate, //its logical volume
232  "TantalumPlate1", //its name
233  logicBulkSphere, //its mother volume
234  false, //no boolean operation
235  0);
236 
237  new G4PVPlacement(0, //no rotation
238  G4ThreeVector(0.,0.,-6.*cm), //at (0,0,0)
239  logicPlate, //its logical volume
240  "TantalumPlate2", //its name
241  logicBulkSphere, //its mother volume
242  false, //no boolean operation
243  0);
244 
245  return physiWorld;
246 
247 }
248 
249 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
250 
252 { fSensitive_cylinder_Rout=r;
253 }
254 
255 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
256 
258 { fSensitive_cylinder_H=h;
259 }
260 
261 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
262 
264 { fShield_Thickness=d;
265 }
266 
267 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4String symbol
Definition: TRTMaterials.hh:40
G4Material * Air
Definition: TRTMaterials.hh:57
CLHEP::Hep3Vector G4ThreeVector
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
Definition: G4Material.cc:578
G4double z
Definition: TRTMaterials.hh:39
int universe_mean_density
Definition: hepunit.py:307
Definition: G4Box.hh:63
Definition: G4Tubs.hh:84
static void Clean()
Definition: G4SolidStore.cc:79
int G4int
Definition: G4Types.hh:78
virtual G4VPhysicalVolume * Construct()
Definition of the RMC01DetectorConstruction class.
static G4PhysicalVolumeStore * GetInstance()
Definition of the RMC01SD class.
G4double density
Definition: TRTMaterials.hh:39
function g(Y1, Y2, PT2)
Definition: hijing1.383.f:5205
#define pascal
static G4LogicalVolumeStore * GetInstance()
static G4SolidStore * GetInstance()
static G4GeometryManager * GetInstance()
Definition: G4Orb.hh:60
void AddNewDetector(G4VSensitiveDetector *aSD)
Definition: G4SDManager.cc:67
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
Definition of the RMC01DetectorMessenger class.
**D E S C R I P T I O N
void OpenGeometry(G4VPhysicalVolume *vol=0)
void AddElement(G4Element *element, G4int nAtoms)
Definition: G4Material.cc:345
double G4double
Definition: G4Types.hh:76
void SetSensitiveDetector(G4VSensitiveDetector *pSDetector)