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