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