Loading...
Searching...
No Matches
MoviesDetectorConstruction.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 MoviesDetectorConstruction.cc
27/// \brief Implementation of the MoviesDetectorConstruction class
28//
29
31
32#include "G4Material.hh"
33#include "G4NistManager.hh"
34
35#include "G4Box.hh"
36#include "G4LogicalVolume.hh"
37#include "G4PVPlacement.hh"
38#include "G4PVReplica.hh"
39
40#include "G4VisAttributes.hh"
41
42#include "G4PhysicalConstants.hh"
43#include "G4SystemOfUnits.hh"
44
46{
47 // Define materials
49
50 // Define volumes
51 return DefineVolumes();
52}
53
55{
56 auto nistManager = G4NistManager::Instance();
57
58 // Lead material defined using NIST Manager
59 nistManager->FindOrBuildMaterial("G4_Pb");
60
61 // Liquid argon material
62 G4double a; // mass of a mole;
63 G4double z; // z=mean number of protons;
64 G4double density;
65 new G4Material("liquidArgon", z=18., a=39.95*g/mole, density=1.390*g/cm3);
66 // The argon by NIST Manager is a gas with a different density
67
68 // Vacuum
69 nistManager->FindOrBuildMaterial("G4_Galactic");
70
71 // Print materials
72 G4cout << *(G4Material::GetMaterialTable()) << G4endl;
73}
74
76{
77 // Geometry parameters
78 const G4bool checkOverlaps = true;
79
80 // A generous world
81 const G4double worldSizeXY = 1.*m;
82 const G4double worldSizeZ = 1.*m;
83
84 // Lead-argon calorimeter
85 G4int nofLayers = 10;
86 G4double absoThickness = 10.*mm;
87 G4double gapThickness = 5.*mm;
88 G4double calorSizeXY = 10.*cm;
89
90 auto layerThickness = absoThickness + gapThickness;
91 auto calorThickness = nofLayers * layerThickness;
92
93 // Get materials
94 auto defaultMaterial = G4Material::GetMaterial("G4_Galactic");
95 auto absorberMaterial = G4Material::GetMaterial("G4_Pb");
96 auto gapMaterial = G4Material::GetMaterial("liquidArgon");
97
98 // World
99 auto worldS
100 = new G4Box("World",worldSizeXY/2,worldSizeXY/2,worldSizeZ/2);
101
102 auto worldLV
103 = new G4LogicalVolume(
104 worldS, // its solid
105 defaultMaterial, // its material
106 "World"); // its name
107
108 auto worldPV
109 = new G4PVPlacement(
110 0, // no rotation
111 G4ThreeVector(), // at (0,0,0)
112 worldLV, // its logical volume
113 "World", // its name
114 0, // its mother volume
115 false, // no boolean operation
116 0, // copy number
117 checkOverlaps); // checking overlaps
118
119
120 // Calorimeter
121
122 auto calorimeterS
123 = new G4Box("Calorimeter",calorSizeXY/2,calorSizeXY/2,calorThickness/2);
124
125 auto calorLV
126 = new G4LogicalVolume(
127 calorimeterS, // its solid
128 defaultMaterial, // its material
129 "Calorimeter"); // its name
130
131 new G4PVPlacement(
132 0, // no rotation
133 G4ThreeVector(), // at (0,0,0)
134 calorLV, // its logical volume
135 "Calorimeter", // its name
136 worldLV, // its mother volume
137 false, // no boolean operation
138 0, // copy number
139 checkOverlaps); // checking overlaps
140
141 // Layer
142
143 auto layerS
144 = new G4Box("Layer", // its name
145 calorSizeXY/2, calorSizeXY/2, layerThickness/2); // its size
146
147 auto layerLV
148 = new G4LogicalVolume(
149 layerS, // its solid
150 defaultMaterial, // its material
151 "Layer"); // its name
152
153 new G4PVReplica(
154 "Layer", // its name
155 layerLV, // its logical volume
156 calorLV, // its mother
157 kZAxis, // axis of replication
158 nofLayers, // number of replica
159 layerThickness); // witdth of replica
160
161 // Absorber
162
163 auto absorberS
164 = new G4Box("Abso", // its name
165 calorSizeXY/2, calorSizeXY/2, absoThickness/2); // its size
166
167 auto absorberLV
168 = new G4LogicalVolume(
169 absorberS, // its solid
170 absorberMaterial, // its material
171 "Abso"); // its name
172
173 new G4PVPlacement(
174 0, // no rotation
175 G4ThreeVector(0., 0., -gapThickness/2), // its position
176 absorberLV, // its logical volume
177 "Abso", // its name
178 layerLV, // its mother volume
179 false, // no boolean operation
180 0, // copy number
181 checkOverlaps); // checking overlaps
182
183 // Gap
184
185 auto gapS
186 = new G4Box("Gap", // its name
187 calorSizeXY/2, calorSizeXY/2, gapThickness/2); // its size
188
189 auto gapLV
190 = new G4LogicalVolume(
191 gapS, // its solid
192 gapMaterial, // its material
193 "Gap"); // its name
194
195 new G4PVPlacement(
196 0, // no rotation
197 G4ThreeVector(0., 0., absoThickness/2), // its position
198 gapLV, // its logical volume
199 "Gap", // its name
200 layerLV, // its mother volume
201 false, // no boolean operation
202 0, // copy number
203 checkOverlaps); // checking overlaps
204
205 // Visualization attributes
206 worldLV->SetVisAttributes (G4VisAttributes::GetInvisible());
207
208 return worldPV;
209}
std::vector< ExP01TrackerHit * > a
Definition of the MoviesDetectorConstruction class.
virtual G4VPhysicalVolume * Construct()

Applications | User Support | Publications | Collaboration