113{
114
115 G4int nofLayers = 10;
116 G4double absoThickness = 10. * mm;
117 G4double gapThickness = 5. * mm;
118 G4double calorSizeXY = 10. * cm;
119
120 G4double layerThickness = absoThickness + gapThickness;
121 G4double calorThickness = nofLayers * layerThickness;
122 G4double worldSizeXY = 1.2 * calorSizeXY;
123 G4double worldSizeZ = 1.2 * calorThickness;
124
125
126 G4Material* defaultMaterial = G4Material::GetMaterial("Galactic");
127 G4Material* absorberMaterial = G4Material::GetMaterial("G4_Pb");
128 G4Material* gapMaterial = G4Material::GetMaterial("liquidArgon");
129
130 if (!defaultMaterial || !absorberMaterial || !gapMaterial) {
131 G4ExceptionDescription msg;
132 msg << "Cannot retrieve materials already defined.";
133 G4Exception("B4DetectorConstruction::DefineVolumes()", "MyCode0001",
134 FatalException, msg);
135 }
136
137
138
139
140 G4VSolid* worldS = new G4Box("World",
141 worldSizeXY / 2, worldSizeXY / 2, worldSizeZ / 2);
142
143 G4LogicalVolume* worldLV = new G4LogicalVolume(worldS,
144 defaultMaterial,
145 "WRLD");
146
147 G4VPhysicalVolume* worldPV = new G4PVPlacement(0,
148 G4ThreeVector(),
149 worldLV,
150 "WRLD",
151 0,
152 false,
153 0,
155
156
157
158
159 G4VSolid* calorimeterS = new G4Box("Calorimeter",
160 calorSizeXY / 2, calorSizeXY / 2, calorThickness / 2);
161
162 G4LogicalVolume* calorLV = new G4LogicalVolume(calorimeterS,
163 defaultMaterial,
164 "CALO");
165
166 new G4PVPlacement(0,
167 G4ThreeVector(),
168 calorLV,
169 "CALO",
170 worldLV,
171 false,
172 0,
174
175
176
177
178 G4VSolid* layerS = new G4Box("Layer",
179 calorSizeXY / 2, calorSizeXY / 2, layerThickness / 2);
180
181 G4LogicalVolume* layerLV = new G4LogicalVolume(layerS,
182 defaultMaterial,
183 "LAYE");
184
185 new G4PVReplica("LAYE",
186 layerLV,
187 calorLV,
188 kZAxis,
189 nofLayers,
190 layerThickness);
191
192
193
194
195 G4VSolid* absorberS = new G4Box("Abso",
196 calorSizeXY / 2, calorSizeXY / 2, absoThickness / 2);
197
198 G4LogicalVolume* absorberLV = new G4LogicalVolume(absorberS,
199 absorberMaterial,
200 "ABSO");
201
203 G4ThreeVector(0., 0., -gapThickness / 2),
204 absorberLV,
205 "ABSO",
206 layerLV,
207 false,
208 0,
210
211
212
213
214 G4VSolid* gapS = new G4Box("Gap",
215 calorSizeXY / 2, calorSizeXY / 2, gapThickness / 2);
216
217 G4LogicalVolume* gapLV = new G4LogicalVolume(gapS,
218 gapMaterial,
219 "GAPX");
220
221 fGapPV =
new G4PVPlacement(0,
222 G4ThreeVector(0., 0., absoThickness / 2),
223 gapLV,
224 "GAPX",
225 layerLV,
226 false,
227 0,
229
230
231
232
233 G4cout << "\n------------------------------------------------------------"
234 << "\n---> The calorimeter is " << nofLayers << " layers of: [ "
235 << absoThickness / mm << "mm of " << absorberMaterial->GetName()
236 << " + " << gapThickness / mm << "mm of " << gapMaterial->GetName()
237 << " ] "
238 << "\n------------------------------------------------------------\n";
239
240
241
242
243 worldLV->SetVisAttributes(G4VisAttributes::GetInvisible());
244
245 G4VisAttributes* simpleBoxVisAtt =
246 new G4VisAttributes(G4Colour(1.0, 1.0, 1.0));
247 simpleBoxVisAtt->SetVisibility(true);
248 calorLV->SetVisAttributes(simpleBoxVisAtt);
249
250
251
252
253 return worldPV;
254}