98{
99
100 G4int nofLayers = 10;
101 G4double absoThickness = 10.*mm;
102 G4double gapThickness = 5.*mm;
103 G4double calorSizeXY = 10.*cm;
104
105 auto layerThickness = absoThickness + gapThickness;
106 auto calorThickness = nofLayers * layerThickness;
107 auto worldSizeXY = 1.2 * calorSizeXY;
108 auto worldSizeZ = 1.2 * calorThickness;
109
110
111 auto defaultMaterial = G4Material::GetMaterial("Galactic");
112 auto absorberMaterial = G4Material::GetMaterial("G4_Pb");
113 auto gapMaterial = G4Material::GetMaterial("liquidArgon");
114
115 if ( ! defaultMaterial || ! absorberMaterial || ! gapMaterial ) {
116 G4ExceptionDescription msg;
117 msg << "Cannot retrieve materials already defined.";
118 G4Exception("DetectorConstruction::DefineVolumes()",
119 "MyCode0001", FatalException, msg);
120 }
121
122
123
124
125 auto worldS
127 worldSizeXY/2, worldSizeXY/2, worldSizeZ/2);
128
129 auto worldLV
131 worldS,
132 defaultMaterial,
133 "World");
134
136 G4ThreeVector(),
137 worldLV,
138 "World",
139 nullptr,
140 false,
141 0,
143
144
145
146
147 auto calorimeterS
148 =
new G4Box(
"Calorimeter",
149 calorSizeXY/2, calorSizeXY/2, calorThickness/2);
150
151 auto calorLV
153 calorimeterS,
154 defaultMaterial,
155 "Calorimeter");
156
158 G4ThreeVector(),
159 calorLV,
160 "Calorimeter",
161 worldLV,
162 false,
163 0,
165
166
167
168
169 auto layerS
171 calorSizeXY/2, calorSizeXY/2, layerThickness/2);
172
173 auto layerLV
175 layerS,
176 defaultMaterial,
177 "Layer");
178
180 "Layer",
181 layerLV,
182 calorLV,
183 kZAxis,
184 nofLayers,
185 layerThickness);
186
187
188
189
190 auto absorberS
192 calorSizeXY/2, calorSizeXY/2, absoThickness/2);
193
194 auto absorberLV
196 absorberS,
197 absorberMaterial,
198 "Abso");
199
201 G4ThreeVector(0., 0., -gapThickness / 2),
202 absorberLV,
203 "Abso",
204 layerLV,
205 false,
206 0,
208
209
210
211
212 auto gapS
214 calorSizeXY/2, calorSizeXY/2, gapThickness/2);
215
216 auto gapLV
218 gapS,
219 gapMaterial,
220 "Gap");
221
223 G4ThreeVector(0., 0., absoThickness / 2),
224 gapLV,
225 "Gap",
226 layerLV,
227 false,
228 0,
230
231
232
233
234 G4cout
235 << G4endl
236 << "------------------------------------------------------------" << G4endl
237 << "---> The calorimeter is " << nofLayers << " layers of: [ "
238 << absoThickness/mm << "mm of " << absorberMaterial->GetName()
239 << " + "
240 << gapThickness/mm << "mm of " << gapMaterial->GetName() << " ] " << G4endl
241 << "------------------------------------------------------------" << G4endl;
242
243
244
245
246 worldLV->SetVisAttributes(G4VisAttributes::GetInvisible());
248
249
250
251
252 return worldPV;
253}