Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
F06DetectorConstruction.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 //
30 //
31 //
32 
33 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
34 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
35 
37 
38 #include "G4Material.hh"
39 #include "G4NistManager.hh"
40 
41 #include "G4Box.hh"
42 #include "G4LogicalVolume.hh"
43 #include "G4PVPlacement.hh"
44 
45 #include "G4GeometryManager.hh"
46 #include "G4PhysicalVolumeStore.hh"
47 #include "G4LogicalVolumeStore.hh"
48 #include "G4SolidStore.hh"
49 
50 #include "G4VisAttributes.hh"
51 #include "G4Colour.hh"
52 
53 #include "G4UserLimits.hh"
54 #include "G4SystemOfUnits.hh"
55 
56 #include "F06Field.hh"
57 
58 #include "G4RunManager.hh"
59 
60 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
61 
63  : Vacuum(0), field(0)
64 {
65  // materials
66  DefineMaterials();
67 
68  // ensure the global field is initialized
69  field = new F06Field();
70 }
71 
72 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
73 
75 {
76  delete field;
77 }
78 
79 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
80 
81 void F06DetectorConstruction::DefineMaterials()
82 {
84 
85  Vacuum = nistMan->FindOrBuildMaterial("G4_Galactic");
86 
88 }
89 
90 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
91 
93 {
94  //
95  // World
96  //
97 
98  G4double expHall_x = 1.0*m;
99  G4double expHall_y = 1.0*m;
100  G4double expHall_z = 1.0*m;
101 
102  solidWorld = new G4Box("World", //its name
103  expHall_x,expHall_y,expHall_z); //its size
104 
105  logicWorld = new G4LogicalVolume(solidWorld, //its solid
106  Vacuum, //its material
107  "World"); //its name
108 
109  physiWorld = new G4PVPlacement(0, //no rotation
110  G4ThreeVector(), //at (0,0,0)
111  logicWorld, //its logical volume
112  "World", //its name
113  0, //its mother volume
114  false, //no boolean operation
115  0); //copy number
116 
117  G4double maxStep = 1.0*mm;
118  G4double maxTime = 41.*s;
119 
120  G4UserLimits* stepLimit = new G4UserLimits(maxStep,DBL_MAX,maxTime);
121 
122  logicWorld->SetUserLimits(stepLimit);
123 
124  //
125  // Visualization attributes
126  //
127  // logicWorld->SetVisAttributes (G4VisAttributes::Invisible);
128 
129  //
130  //always return the physical World
131  //
132  return physiWorld;
133 }
134 
135 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......