57 {
58
60
61
62
63
64
65
66
67 vector<double> bar = content.getArray("bar");
68 B2INFO("Contents of bar: ");
69 for (double value : bar) {
70 B2INFO("value: " << value);
71 }
72
73
74
75
76
77
78
79
80
81
82
83
84
85 for (const GearDir& activeParams : content.getNodes("Active")) {
86
87
88 double x_tpcbeamR = activeParams.getLength("x_tpcbeamR") * CLHEP::cm;
89 double y_tpcbeamR = activeParams.getLength("y_tpcbeamR") * CLHEP::cm;
90 double z_tpcbeamR = activeParams.getLength("z_tpcbeamR") * CLHEP::cm;
91 double x_tpcbeamL = activeParams.getLength("x_tpcbeamL") * CLHEP::cm;
92 double y_tpcbeamL = activeParams.getLength("y_tpcbeamL") * CLHEP::cm;
93 double z_tpcbeamL = activeParams.getLength("z_tpcbeamL") * CLHEP::cm;
94 double x_tpcbeamT = activeParams.getLength("x_tpcbeamT") * CLHEP::cm;
95 double y_tpcbeamT = activeParams.getLength("y_tpcbeamT") * CLHEP::cm;
96 double z_tpcbeamT = activeParams.getLength("z_tpcbeamT") * CLHEP::cm;
97 double x_tpcbeamB = activeParams.getLength("x_tpcbeamB") * CLHEP::cm;
98 double y_tpcbeamB = activeParams.getLength("y_tpcbeamB") * CLHEP::cm;
99 double z_tpcbeamB = activeParams.getLength("z_tpcbeamB") * CLHEP::cm;
100
101
102
103
104
105
106
107
108
109
110
111 double betpcbeam = 190.8 / 2. * CLHEP::mm;
112 G4double dx_tpcbeam = 2.54 * 1.63 / 2.*CLHEP::cm;
113 G4double dy_tpcbeam = 2.54 * 1.63 / 2.*CLHEP::cm;
114 G4double dz_tpcbeam = 2200. / 2.*CLHEP::mm;
115 G4double dw_tpcbeam = 2.54 * 0.25 / 2.*CLHEP::cm;
116
117
118
119 G4double dx_plate_short = 0.5 / 2. * CLHEP::cm;
120 G4double dy_plate_short = 27.47788 / 2.*CLHEP::cm;
121 G4double dz_plate_short = 40. / 2.*CLHEP::cm;
122
123 G4double dx_plate = 0.5 / 2. * CLHEP::cm;
124 G4double dy_plate = 32. / 2.*CLHEP::cm;
125 G4double dz_plate = 50. / 2.*CLHEP::cm;
126
127
128
129 G4VSolid* s_plate = new G4Box("s_plate", dx_plate, dy_plate, dz_plate);
130 G4VSolid* s_plate_short = new G4Box("s_plate_short", dx_plate_short, dy_plate_short, dz_plate_short);
131
132
134 G4LogicalVolume* l_plate_short =
new G4LogicalVolume(s_plate_short,
geometry::Materials::get(
"Al"),
"l_plate_short", 0, 0);
135 G4VisAttributes* white = new G4VisAttributes(G4Colour(1, 1, 1));
136 white->SetForceAuxEdgeVisible(true);
137 l_plate->SetVisAttributes(white);
138 l_plate_short->SetVisAttributes(white);
139
140 G4VSolid* s_tpcbeam_a = new G4Box("s_tpcbeam_a", dx_tpcbeam, dy_tpcbeam, dz_tpcbeam);
141 G4VSolid* s_tpcbeam_b = new G4Box("s_tpcbeam_b", dx_tpcbeam - 2.*dw_tpcbeam, dy_tpcbeam - dw_tpcbeam, dz_tpcbeam);
142 G4VSolid* s_tpcbeampos = new G4SubtractionSolid("s_tpcbeampos", s_tpcbeam_a, s_tpcbeam_b, 0, G4ThreeVector(0, dw_tpcbeam, 0));
143 G4VSolid* s_tpcbeamneg = new G4SubtractionSolid("s_tpcbeamneg", s_tpcbeam_a, s_tpcbeam_b, 0, G4ThreeVector(0, -dw_tpcbeam, 0));
144 G4VSolid* s_tpcbeam = new G4UnionSolid("s_tpcbeam", s_tpcbeampos, s_tpcbeamneg, 0, G4ThreeVector(0, -2.*dy_tpcbeam, 0));
145
146
147 G4LogicalVolume* l_tpcbeam =
new G4LogicalVolume(s_tpcbeam,
geometry::Materials::get(
"FG_Epoxy"),
"l_tpcbeam", 0, 0);
148
149
150 G4ThreeVector PH1SUSTRpos = G4ThreeVector(
151 x_tpcbeamR,
152 y_tpcbeamR,
153 z_tpcbeamR
154 );
155 new G4PVPlacement(0, PH1SUSTRpos, l_plate, "p_plateR", &topVolume, false, 1);
156
157
158
159 G4double offset_h = dz_tpcbeam + 80.*CLHEP::cm - 2. * dz_tpcbeam;
160
161
162
163
164
165
166
167
168 G4Transform3D TransForm = G4Translate3D(x_tpcbeamR + dx_plate + dx_tpcbeam,
169 y_tpcbeamR + betpcbeam + 2. * dy_tpcbeam,
170 -offset_h / 2.) * G4RotateZ3D(90.*CLHEP::deg);
171 new G4PVPlacement(TransForm, l_tpcbeam, "p_tpcbeamR1", &topVolume, false, 1);
172
173
174
175
176
177
178
179
180 TransForm = G4Translate3D(x_tpcbeamR + dx_plate + dx_tpcbeam,
181 y_tpcbeamR - betpcbeam - 2. * dy_tpcbeam,
182 -offset_h / 2.) * G4RotateZ3D(90.*CLHEP::deg);
183 new G4PVPlacement(TransForm, l_tpcbeam, "p_tpcbeamR2", &topVolume, false, 1);
184
185
186
187 PH1SUSTRpos = G4ThreeVector(
188 x_tpcbeamL,
189 y_tpcbeamL,
190 z_tpcbeamL
191 );
192 new G4PVPlacement(0, PH1SUSTRpos, l_plate, "p_plateL", &topVolume, false, 1);
193
194
195
196
197
198
199
200
201 TransForm = G4Translate3D(x_tpcbeamL - dx_plate - 3. * dx_tpcbeam,
202 y_tpcbeamL + betpcbeam + 2. * dy_tpcbeam,
203 -offset_h / 2.) * G4RotateZ3D(90.*CLHEP::deg);
204 new G4PVPlacement(TransForm, l_tpcbeam, "p_tpcbeamL1", &topVolume, false, 1);
205
206
207
208
209
210
211
212
213 TransForm = G4Translate3D(x_tpcbeamL - dx_plate - 3. * dx_tpcbeam,
214 y_tpcbeamL - betpcbeam - 2. * dy_tpcbeam,
215 -offset_h / 2.) * G4RotateZ3D(90.*CLHEP::deg);
216 new G4PVPlacement(TransForm, l_tpcbeam, "p_tpcbeamL2", &topVolume, false, 1);
217
218
219 G4RotationMatrix* rotXx = new G4RotationMatrix();
220 double Angle = 90. * CLHEP::deg;
221 rotXx->rotateZ(Angle);
222
223 PH1SUSTRpos = G4ThreeVector(
224 x_tpcbeamB,
225 y_tpcbeamB,
226 z_tpcbeamB
227 );
228 new G4PVPlacement(rotXx, PH1SUSTRpos, l_plate_short, "p_plateB", &topVolume, false, 1);
229
230
231
232
233
234
235
236
237 TransForm = G4Translate3D(x_tpcbeamB + betpcbeam + 1.5 * dx_tpcbeam,
238 y_tpcbeamB - dx_plate - 1.5 * dy_tpcbeam,
239 -offset_h / 2.) ;
240 new G4PVPlacement(TransForm, l_tpcbeam, "p_tpcbeamB1", &topVolume, false, 1);
241
242
243
244
245
246
247
248
249 TransForm = G4Translate3D(x_tpcbeamB - betpcbeam - 1.5 * dx_tpcbeam,
250 y_tpcbeamB - dx_plate - 1.5 * dy_tpcbeam,
251 -offset_h / 2.) ;
252 new G4PVPlacement(TransForm, l_tpcbeam, "p_tpcbeamB2", &topVolume, false, 1);
253
254
255
256
257
258 PH1SUSTRpos = G4ThreeVector(
259 x_tpcbeamT,
260 y_tpcbeamT,
261 z_tpcbeamT
262 );
263 new G4PVPlacement(rotXx, PH1SUSTRpos, l_plate, "p_plateT", &topVolume, false, 1);
264
265
266
267
268
269
270
271
272 TransForm = G4Translate3D(x_tpcbeamT + betpcbeam + 1.5 * dx_tpcbeam,
273 y_tpcbeamT + dx_plate + 3. * dy_tpcbeam,
274 -offset_h / 2.) ;
275 new G4PVPlacement(TransForm, l_tpcbeam, "p_tpcbeamT1", &topVolume, false, 1);
276
277
278
279
280
281
282
283
284 TransForm = G4Translate3D(x_tpcbeamT - betpcbeam - 1.5 * dx_tpcbeam,
285 y_tpcbeamT + dx_plate + 3 * dy_tpcbeam,
286 -offset_h / 2.) ;
287 new G4PVPlacement(TransForm, l_tpcbeam, "p_tpcbeamT2", &topVolume, false, 1);
288
289
290
291 G4double dz_tpcbeamv = 1583. / 2.*CLHEP::mm;
292 G4VSolid* s_tpcbeamv_a = new G4Box("s_tpcbeamv_a", dx_tpcbeam, dy_tpcbeam, dz_tpcbeamv);
293 G4VSolid* s_tpcbeamv_b = new G4Box("s_tpcbeamv_b", dx_tpcbeam - 2.*dw_tpcbeam, dy_tpcbeam - dw_tpcbeam, dz_tpcbeamv);
294 G4VSolid* s_tpcbeamvpos = new G4SubtractionSolid("s_tpcbeamvpos", s_tpcbeamv_a, s_tpcbeamv_b, 0, G4ThreeVector(0, dw_tpcbeam, 0));
295 G4VSolid* s_tpcbeamvneg = new G4SubtractionSolid("s_tpcbeamvneg", s_tpcbeamv_a, s_tpcbeamv_b, 0, G4ThreeVector(0, -dw_tpcbeam, 0));
296 G4VSolid* s_tpcbeamv = new G4UnionSolid("s_tpcbeamv", s_tpcbeamvpos, s_tpcbeamvneg, 0, G4ThreeVector(0, -2.*dy_tpcbeam, 0));
297 G4LogicalVolume* l_tpcbeamv =
new G4LogicalVolume(s_tpcbeamv,
geometry::Materials::get(
"FG_Epoxy"),
"l_tpcbeamv", 0, 0);
298
299
300
301 G4double offset_v = fabs(110.*CLHEP::cm - 2. * dz_tpcbeamv) / 2.;
302
303
304 G4RotationMatrix* rotX = new G4RotationMatrix();
305 rotX->rotateX(90.*CLHEP::deg);
306 PH1SUSTRpos = G4ThreeVector(
307 x_tpcbeamL - dx_plate - 3 * dx_tpcbeam - 2.*dx_tpcbeam,
308 offset_v / 2.,
309 -800.*CLHEP::mm
310 );
311 new G4PVPlacement(rotX, PH1SUSTRpos, l_tpcbeamv, "p_tpcbeamv1", &topVolume, false, 0);
312
313 PH1SUSTRpos = G4ThreeVector(
314 x_tpcbeamR + dx_plate + 3.*dx_tpcbeam + 2.*dx_tpcbeam,
315 offset_v / 2.,
316 -800.*CLHEP::mm
317 );
318 new G4PVPlacement(rotX, PH1SUSTRpos, l_tpcbeamv, "p_tpcbeamv2", &topVolume, false, 0);
319
320 PH1SUSTRpos = G4ThreeVector(
321 x_tpcbeamL - dx_plate - 3.*dx_tpcbeam - 2.*dx_tpcbeam,
322 offset_v / 2.,
323 1100.*CLHEP::mm
324 );
325 new G4PVPlacement(rotX, PH1SUSTRpos, l_tpcbeamv, "p_tpcbeamv3", &topVolume, false, 0);
326
327 PH1SUSTRpos = G4ThreeVector(
328 x_tpcbeamR + dx_plate + 3.*dx_tpcbeam + 2.*dx_tpcbeam,
329 offset_v / 2.,
330 1100.*CLHEP::mm
331 );
332 new G4PVPlacement(rotX, PH1SUSTRpos, l_tpcbeamv, "p_tpcbeamv4", &topVolume, false, 0);
333
334
335
336 G4double dz_tpcbeamh = 1614. / 2.*CLHEP::mm;
337 G4VSolid* s_tpcbeamh_a = new G4Box("s_tpcbeamh_a", dx_tpcbeam, dy_tpcbeam, dz_tpcbeamh);
338 G4VSolid* s_tpcbeamh_b = new G4Box("s_tpcbeamh_b", dx_tpcbeam - 2.*dw_tpcbeam, dy_tpcbeam - dw_tpcbeam, dz_tpcbeamh);
339 G4VSolid* s_tpcbeamhpos = new G4SubtractionSolid("s_tpcbeamhpos", s_tpcbeamh_a, s_tpcbeamh_b, 0, G4ThreeVector(0, dw_tpcbeam, 0));
340 G4VSolid* s_tpcbeamhneg = new G4SubtractionSolid("s_tpcbeanhneg", s_tpcbeamh_a, s_tpcbeamh_b, 0, G4ThreeVector(0, -dw_tpcbeam, 0));
341 G4VSolid* s_tpcbeamh = new G4UnionSolid("s_tpcbeamh", s_tpcbeamhpos, s_tpcbeamhneg, 0, G4ThreeVector(0, -2.*dy_tpcbeam, 0));
342
343 G4LogicalVolume* l_tpcbeamh =
new G4LogicalVolume(s_tpcbeamh,
geometry::Materials::get(
"FG_Epoxy"),
"l_tpcbeamh", 0, 0);
344
345
346 G4RotationMatrix* rotY = new G4RotationMatrix();
347 rotY->rotateY(90.*CLHEP::deg);
348 PH1SUSTRpos = G4ThreeVector(
349 0 * CLHEP::mm,
350 y_tpcbeamB - dx_plate - 4. * dy_tpcbeam - 2. * dy_tpcbeam,
351 1100.*CLHEP::mm - 2. * dy_tpcbeam
352 );
353 new G4PVPlacement(rotY, PH1SUSTRpos, l_tpcbeamh, "p_tpcbeamh1", &topVolume, false, 0);
354
355
356 PH1SUSTRpos = G4ThreeVector(
357 0 * CLHEP::mm,
358 y_tpcbeamT + dx_plate + 5. * dy_tpcbeam + 2. * dy_tpcbeam,
359 1100.*CLHEP::mm - 2. * dy_tpcbeam
360 );
361 new G4PVPlacement(rotY, PH1SUSTRpos, l_tpcbeamh, "p_tpcbeamh2", &topVolume, false, 0);
362
363
364 PH1SUSTRpos = G4ThreeVector(
365 0 * CLHEP::mm,
366 y_tpcbeamB - dx_plate - 4. * dy_tpcbeam - 2. * dy_tpcbeam,
367 -800.*CLHEP::mm + 4. * dy_tpcbeam
368 );
369 new G4PVPlacement(rotY, PH1SUSTRpos, l_tpcbeamh, "p_tpcbeamh3", &topVolume, false, 0);
370
371
372 PH1SUSTRpos = G4ThreeVector(
373 0 * CLHEP::mm,
374 y_tpcbeamT + dx_plate + 5. * dy_tpcbeam + 2. * dy_tpcbeam,
375 -800.*CLHEP::mm + 4. * dy_tpcbeam
376 );
377 new G4PVPlacement(rotY, PH1SUSTRpos, l_tpcbeamh, "p_tpcbeamh4", &topVolume, false, 0);
378
379 G4VisAttributes* brown = new G4VisAttributes(G4Colour(.5, .5, 0));
380 brown->SetForceAuxEdgeVisible(true);
381 l_tpcbeam->SetVisAttributes(brown);
382 l_tpcbeamv->SetVisAttributes(brown);
383 l_tpcbeamh->SetVisAttributes(brown);
384
385
386 G4double dz_csibeamh = activeParams.getLength("lcsiBeamh") * CLHEP::cm / 2.;
387 G4VSolid* s_csibeamh_a = new G4Box("s_csibeamh_a", dx_tpcbeam, dy_tpcbeam, dz_csibeamh);
388 G4VSolid* s_csibeamh_b = new G4Box("s_csibeamh_b", dx_tpcbeam - 2.*dw_tpcbeam, dy_tpcbeam - dw_tpcbeam, dz_csibeamh);
389 G4VSolid* s_csibeamhpos = new G4SubtractionSolid("s_csibeamhpos", s_csibeamh_a, s_csibeamh_b, 0, G4ThreeVector(0, dw_tpcbeam, 0));
390 G4VSolid* s_csibeamhneg = new G4SubtractionSolid("s_csibeamhneg", s_csibeamh_a, s_csibeamh_b, 0, G4ThreeVector(0, -dw_tpcbeam, 0));
391
392
393 G4VSolid* s_csibeamh = new G4UnionSolid("s_csibeamh", s_csibeamhpos, s_csibeamhneg, 0, G4ThreeVector(0, -2.*dy_tpcbeam, 0));
394 G4LogicalVolume* l_csibeamh =
new G4LogicalVolume(s_csibeamh,
geometry::Materials::get(
"FG_Epoxy"),
"l_csibeamh", 0, 0);
395
396 double x_offset = activeParams.getLength("x_offset") * CLHEP::cm;
397 double y_offset = activeParams.getLength("y_offset") * CLHEP::cm;
398
399 std::vector<double> xcsiBeamh = activeParams.getArray("xcsiBeamh", {0});
400 std::vector<double> ycsiBeamh = activeParams.getArray("ycsiBeamh", {0});
401 std::vector<double> zcsiBeamh = activeParams.getArray("zcsiBeamh", {0});
402 for (unsigned int i = 0; i < xcsiBeamh.size(); ++i) {
403 xcsiBeamh[i] = xcsiBeamh[i] - x_offset;
404 ycsiBeamh[i] = ycsiBeamh[i] - y_offset;
405 G4Transform3D transform = G4Translate3D(xcsiBeamh[i], ycsiBeamh[i] - dy_tpcbeam,
406 zcsiBeamh[i] + 2. * dy_tpcbeam) * G4RotateY3D(90.*CLHEP::deg) * G4RotateZ3D(90.*CLHEP::deg);
407 new G4PVPlacement(transform, l_csibeamh, TString::Format("p_csibeamh1_%d", i).Data(), &topVolume, false, 1);
408 transform = G4Translate3D(xcsiBeamh[i], ycsiBeamh[i] + dy_tpcbeam,
409 zcsiBeamh[i] + 2. * dy_tpcbeam) * G4RotateY3D(90.*CLHEP::deg) * G4RotateZ3D(90.*CLHEP::deg);
410 new G4PVPlacement(transform, l_csibeamh, TString::Format("p_csibeamh2_%d", i).Data(), &topVolume, false, 1);
411 }
412
413 G4double dz_csibeamvF = activeParams.getLength("lcsiBeamvF") * CLHEP::cm / 2.;
414 G4VSolid* s_csibeamvF_a = new G4Box("s_csibeamvF_a", dx_tpcbeam, dy_tpcbeam, dz_csibeamvF);
415 G4VSolid* s_csibeamvF_b = new G4Box("s_csibeamvF_b", dx_tpcbeam - 2.*dw_tpcbeam, dy_tpcbeam - dw_tpcbeam, dz_csibeamvF);
416 G4VSolid* s_csibeamvFpos = new G4SubtractionSolid("s_csibeamvFpos", s_csibeamvF_a, s_csibeamvF_b, 0, G4ThreeVector(0, dw_tpcbeam,
417 0));
418 G4VSolid* s_csibeamvFneg = new G4SubtractionSolid("s_csibeamvFneg", s_csibeamvF_a, s_csibeamvF_b, 0, G4ThreeVector(0, -dw_tpcbeam,
419 0));
420 G4VSolid* s_csibeamvF = new G4UnionSolid("s_csibeamvF", s_csibeamvFpos, s_csibeamvFneg, 0, G4ThreeVector(0, -2.*dy_tpcbeam, 0));
421 G4LogicalVolume* l_csibeamvF =
new G4LogicalVolume(s_csibeamvF,
geometry::Materials::get(
"FG_Epoxy"),
"l_csibeamvF", 0, 0);
422
423 std::vector<double> xcsiBeamvF =
424 activeParams.getArray("xcsiBeamvF", {0});
425 std::vector<double> ycsiBeamvF =
426 activeParams.getArray("ycsiBeamvF", {0});
427 std::vector<double> zcsiBeamvF =
428 activeParams.getArray("zcsiBeamvF", {0});
429 for (unsigned int i = 0; i < xcsiBeamvF.size(); ++i) {
430 xcsiBeamvF[i] = xcsiBeamvF[i] - x_offset;
431 ycsiBeamvF[i] = ycsiBeamvF[i] - y_offset;
432 PH1SUSTRpos = G4ThreeVector(xcsiBeamvF[i], ycsiBeamvF[i], zcsiBeamvF[i]);
433 new G4PVPlacement(rotX, PH1SUSTRpos, l_csibeamvF, TString::Format("p_csibeamvF_%d", i).Data(), &topVolume, false, 0);
434 }
435
436 G4double dz_csibeamvB = activeParams.getLength("lcsiBeamvB") * CLHEP::cm / 2.;
437 G4VSolid* s_csibeamvB_a = new G4Box("s_csibeamvB_a", dx_tpcbeam, dy_tpcbeam, dz_csibeamvB);
438 G4VSolid* s_csibeamvB_b = new G4Box("s_csibeamvB_b", dx_tpcbeam - 2.*dw_tpcbeam, dy_tpcbeam - dw_tpcbeam, dz_csibeamvB);
439 G4VSolid* s_csibeamvBpos = new G4SubtractionSolid("s_csibeamvBpos", s_csibeamvB_a, s_csibeamvB_b, 0, G4ThreeVector(0, dw_tpcbeam,
440 0));
441 G4VSolid* s_csibeamvBneg = new G4SubtractionSolid("s_csibeamvBneg", s_csibeamvB_a, s_csibeamvB_b, 0, G4ThreeVector(0, -dw_tpcbeam,
442 0));
443 G4VSolid* s_csibeamvB = new G4UnionSolid("s_csibeamvB", s_csibeamvBpos, s_csibeamvBneg, 0, G4ThreeVector(0, -2.*dy_tpcbeam, 0));
444 G4LogicalVolume* l_csibeamvB =
new G4LogicalVolume(s_csibeamvB,
geometry::Materials::get(
"FG_Epoxy"),
"l_csibeamvB", 0, 0);
445
446 std::vector<double> xcsiBeamvB =
447 activeParams.getArray("xcsiBeamvB", {0});
448 std::vector<double> ycsiBeamvB =
449 activeParams.getArray("ycsiBeamvB", {0});
450 std::vector<double> zcsiBeamvB =
451 activeParams.getArray("zcsiBeamvB", {0});
452 for (unsigned int i = 0; i < xcsiBeamvB.size(); ++i) {
453 xcsiBeamvB[i] = xcsiBeamvB[i] - x_offset;
454 ycsiBeamvB[i] = ycsiBeamvB[i] - y_offset;
455 PH1SUSTRpos = G4ThreeVector(xcsiBeamvB[i], ycsiBeamvB[i], zcsiBeamvB[i]);
456 new G4PVPlacement(rotX, PH1SUSTRpos, l_csibeamvB, TString::Format("p_csibeamvB_%d", i).Data(), &topVolume, false, 0);
457 }
458
459 G4double dz_base = activeParams.getLength("lBase") * CLHEP::cm / 2.;
460 G4VSolid* s_base_a = new G4Box("s_base_a", dx_tpcbeam, dy_tpcbeam, dz_base);
461 G4VSolid* s_base_b = new G4Box("s_base_b", dx_tpcbeam - 2.*dw_tpcbeam, dy_tpcbeam - dw_tpcbeam, dz_base);
462 G4VSolid* s_base = new G4SubtractionSolid("s_base", s_base_a, s_base_b, 0, G4ThreeVector(0, dw_tpcbeam, 0));
464
465 std::vector<double> xBase = activeParams.getArray("xBase", {0});
466 std::vector<double> yBase = activeParams.getArray("yBase", {0});
467 std::vector<double> zBase = activeParams.getArray("zBase", {0});
468 for (unsigned int i = 0; i < xBase.size(); ++i) {
469 xBase[i] = xBase[i] - x_offset;
470 yBase[i] = yBase[i] - y_offset;
471 PH1SUSTRpos = G4ThreeVector(xBase[i], yBase[i], zBase[i]);
472 new G4PVPlacement(0, PH1SUSTRpos, l_base, TString::Format("p_base_%d", i).Data(), &topVolume, false, 0);
473 }
474
475 G4double dz_bgobeamv = activeParams.getLength("lbgoBeamv") * CLHEP::cm / 2.;
476 G4VSolid* s_bgobeamv_a = new G4Box("s_bgobeamv_a", dx_tpcbeam, dy_tpcbeam, dz_bgobeamv);
477 G4VSolid* s_bgobeamv_b = new G4Box("s_bgobeamv_b", dx_tpcbeam - 2.*dw_tpcbeam, dy_tpcbeam - dw_tpcbeam, dz_bgobeamv);
478 G4VSolid* s_bgobeamvpos = new G4SubtractionSolid("s_bgobeamvpos", s_bgobeamv_a, s_bgobeamv_b, 0, G4ThreeVector(0, dw_tpcbeam, 0));
479 G4VSolid* s_bgobeamvneg = new G4SubtractionSolid("s_bgobeamvneg", s_bgobeamv_a, s_bgobeamv_b, 0, G4ThreeVector(0, -dw_tpcbeam, 0));
480 G4VSolid* s_bgobeamv = new G4UnionSolid("s_bgobeamv", s_bgobeamvpos, s_bgobeamvneg, 0, G4ThreeVector(0, -2.*dy_tpcbeam, 0));
481 G4LogicalVolume* l_bgobeamv =
new G4LogicalVolume(s_bgobeamv,
geometry::Materials::get(
"FG_Epoxy"),
"l_bgobeamv", 0, 0);
482
483 std::vector<double> xbgoBeamv = activeParams.getArray("xbgoBeamv", {0});
484 std::vector<double> ybgoBeamv = activeParams.getArray("ybgoBeamv", {0});
485 std::vector<double> zbgoBeamv = activeParams.getArray("zbgoBeamv", {0});
486 for (unsigned int i = 0; i < xbgoBeamv.size(); ++i) {
487 ybgoBeamv[i] = ybgoBeamv[i] - y_offset;
488 PH1SUSTRpos = G4ThreeVector(xbgoBeamv[i], ybgoBeamv[i], zbgoBeamv[i]);
489 new G4PVPlacement(rotX, PH1SUSTRpos, l_bgobeamv, TString::Format("p_bgobeamv_%d", i).Data(), &topVolume, false, 0);
490 }
491
492 G4double dz_bgobeamh = activeParams.getLength("lbgoBeamh") * CLHEP::cm / 2.;
493 G4VSolid* s_bgobeamh_a = new G4Box("s_bgobeamh_a", dx_tpcbeam, dy_tpcbeam, dz_bgobeamh);
494 G4VSolid* s_bgobeamh_b = new G4Box("s_bgobeamh_b", dx_tpcbeam - 2.*dw_tpcbeam, dy_tpcbeam - dw_tpcbeam, dz_bgobeamh);
495 G4VSolid* s_bgobeamhpos = new G4SubtractionSolid("s_bgobeamhpos", s_bgobeamh_a, s_bgobeamh_b, 0, G4ThreeVector(0, dw_tpcbeam, 0));
496 G4VSolid* s_bgobeamhneg = new G4SubtractionSolid("s_bgobeamhneg", s_bgobeamh_a, s_bgobeamh_b, 0, G4ThreeVector(0, -dw_tpcbeam, 0));
497 G4VSolid* s_bgobeamh = new G4UnionSolid("s_bgobeamh", s_bgobeamhpos, s_bgobeamhneg, 0, G4ThreeVector(0, -2.*dy_tpcbeam, 0));
498 G4LogicalVolume* l_bgobeamh =
new G4LogicalVolume(s_bgobeamh,
geometry::Materials::get(
"FG_Epoxy"),
"l_bgobeamh", 0, 0);
499
500 std::vector<double> xbgoBeamh = activeParams.getArray("xbgoBeamh", {0});
501 std::vector<double> ybgoBeamh = activeParams.getArray("ybgoBeamh", {0});
502 std::vector<double> zbgoBeamh = activeParams.getArray("zbgoBeamh", {0});
503 for (unsigned int i = 0; i < xbgoBeamh.size(); ++i) {
504 ybgoBeamh[i] = ybgoBeamh[i] - y_offset;
505 G4Transform3D transform = G4Translate3D(xbgoBeamh[i], ybgoBeamh[i],
506 zbgoBeamh[i] + 2. * dy_tpcbeam) * G4RotateY3D(90.*CLHEP::deg) * G4RotateZ3D(90.*CLHEP::deg);
507 new G4PVPlacement(transform, l_bgobeamh, TString::Format("p_bgobeamh_%d", i).Data(), &topVolume, false, 0);
508 }
509
510 G4double dz_bgobeamt = activeParams.getLength("lbgoBeamt") * CLHEP::cm / 2.;
511 G4VSolid* s_bgobeamt_a = new G4Box("s_bgobeamt_a", dx_tpcbeam, dy_tpcbeam, dz_bgobeamt);
512 G4VSolid* s_bgobeamt_b = new G4Box("s_bgobeamt_b", dx_tpcbeam - 2.*dw_tpcbeam, dy_tpcbeam - dw_tpcbeam, dz_bgobeamt);
513 G4VSolid* s_bgobeamt = new G4SubtractionSolid("s_bgobeamt", s_bgobeamt_a, s_bgobeamt_b, 0, G4ThreeVector(0, dw_tpcbeam, 0));
514 G4LogicalVolume* l_bgobeamt =
new G4LogicalVolume(s_bgobeamt,
geometry::Materials::get(
"FG_Epoxy"),
"l_bgobeamt", 0, 0);
515
516 std::vector<double> xbgoBeamt = activeParams.getArray("xbgoBeamt", {0});
517 std::vector<double> ybgoBeamt = activeParams.getArray("ybgoBeamt", {0});
518 std::vector<double> zbgoBeamt = activeParams.getArray("zbgoBeamt", {0});
519 for (unsigned int i = 0; i < xbgoBeamt.size(); ++i) {
520 ybgoBeamt[i] = ybgoBeamt[i] - y_offset;
521 PH1SUSTRpos = G4ThreeVector(xbgoBeamt[i], ybgoBeamt[i], zbgoBeamt[i]);
522 new G4PVPlacement(0, PH1SUSTRpos, l_bgobeamt, TString::Format("p_bgobeamt_%d", i).Data(), &topVolume, false, 0);
523 }
524
525 G4double dz_bgobeamb = activeParams.getLength("lbgoBeamb") * CLHEP::cm / 2.;
526 G4VSolid* s_bgobeamb_a = new G4Box("s_bgobeamb_a", dx_tpcbeam, dy_tpcbeam, dz_bgobeamb);
527 G4VSolid* s_bgobeamb_b = new G4Box("s_bgobeamb_b", dx_tpcbeam - 2.*dw_tpcbeam, dy_tpcbeam - dw_tpcbeam, dz_bgobeamb);
528 G4VSolid* s_bgobeambpos = new G4SubtractionSolid("s_bgobeambpos", s_bgobeamb_a, s_bgobeamb_b, 0, G4ThreeVector(0, dw_tpcbeam, 0));
529 G4VSolid* s_bgobeambneg = new G4SubtractionSolid("s_bgobeambneg", s_bgobeamb_a, s_bgobeamb_b, 0, G4ThreeVector(0, -dw_tpcbeam, 0));
530 G4VSolid* s_bgobeamb = new G4UnionSolid("s_bgobeamb", s_bgobeambpos, s_bgobeambneg, 0, G4ThreeVector(0, -2.*dy_tpcbeam, 0));
531 G4LogicalVolume* l_bgobeamb =
new G4LogicalVolume(s_bgobeamb,
geometry::Materials::get(
"FG_Epoxy"),
"l_bgobeamb", 0, 0);
532 std::vector<double> xbgoBeamb = activeParams.getArray("xbgoBeamb", {0});
533 std::vector<double> ybgoBeamb = activeParams.getArray("ybgoBeamb", {0});
534 std::vector<double> zbgoBeamb = activeParams.getArray("zbgoBeamb", {0});
535 for (unsigned int i = 0; i < xbgoBeamb.size(); ++i) {
536 xbgoBeamb[i] = xbgoBeamb[i] - x_offset;
537 ybgoBeamb[i] = ybgoBeamb[i] - y_offset;
538 G4Transform3D transform = G4Translate3D(xbgoBeamb[i], ybgoBeamb[i],
539 zbgoBeamb[i] + 2. * dy_tpcbeam) * G4RotateY3D(90.*CLHEP::deg) * G4RotateZ3D(90.*CLHEP::deg);
540 new G4PVPlacement(transform, l_bgobeamb, TString::Format("p_bgobeamb_%d", i).Data(), &topVolume, false, 1);
541 }
542
543 G4double dz_tpcbeamb = activeParams.getLength("ltpcBeamb") * CLHEP::cm / 2.;
544 G4VSolid* s_tpcbeamb_a = new G4Box("s_tpcbeamb_a", dx_tpcbeam, dy_tpcbeam, dz_tpcbeamb);
545 G4VSolid* s_tpcbeamb_b = new G4Box("s_tpcbeamb_b", dx_tpcbeam - 2.*dw_tpcbeam, dy_tpcbeam - dw_tpcbeam, dz_tpcbeamb);
546 G4VSolid* s_tpcbeambpos = new G4SubtractionSolid("s_tpcbeambpos", s_tpcbeamb_a, s_tpcbeamb_b, 0, G4ThreeVector(0, dw_tpcbeam, 0));
547 G4VSolid* s_tpcbeambneg = new G4SubtractionSolid("s_tpcbeambneg", s_tpcbeamb_a, s_tpcbeamb_b, 0, G4ThreeVector(0, -dw_tpcbeam, 0));
548 G4VSolid* s_tpcbeamb = new G4UnionSolid("s_tpcbeamb", s_tpcbeambpos, s_tpcbeambneg, 0, G4ThreeVector(0, -2.*dy_tpcbeam, 0));
549 G4LogicalVolume* l_tpcbeamb =
new G4LogicalVolume(s_tpcbeamb,
geometry::Materials::get(
"FG_Epoxy"),
"l_tpcbeamb", 0, 0);
550 std::vector<double> xtpcBeamb = activeParams.getArray("xtpcBeamb", {0});
551 std::vector<double> ytpcBeamb = activeParams.getArray("ytpcBeamb", {0});
552 std::vector<double> ztpcBeamb = activeParams.getArray("ztpcBeamb", {0});
553 for (unsigned int i = 0; i < xtpcBeamb.size(); ++i) {
554 xtpcBeamb[i] = xtpcBeamb[i] - x_offset;
555 ytpcBeamb[i] = ytpcBeamb[i] - y_offset;
556 G4Transform3D transform =
557 G4Translate3D(xtpcBeamb[i], ytpcBeamb[i], ztpcBeamb[i] + 2. * dy_tpcbeam) *
558 G4RotateY3D(90.*CLHEP::deg) * G4RotateZ3D(90.*CLHEP::deg);
559 new G4PVPlacement(transform, l_tpcbeamb, TString::Format("p_tpcbeamb_%d", i).Data(), &topVolume, false, 1);
560 }
561
562 G4double dz_fangsbeamhf = activeParams.getLength("lfangsBeamhf") * CLHEP::cm / 2.;
563 G4VSolid* s_fangsbeamhf_a = new G4Box("s_fangsbeamhf_a", dx_tpcbeam, dy_tpcbeam, dz_fangsbeamhf);
564 G4VSolid* s_fangsbeamhf_b = new G4Box("s_fangsbeamhf_b", dx_tpcbeam - 2.*dw_tpcbeam, dy_tpcbeam - dw_tpcbeam, dz_fangsbeamhf);
565 G4VSolid* s_fangsbeamhf = new G4SubtractionSolid("s_fangsbeamhf", s_fangsbeamhf_a, s_fangsbeamhf_b, 0, G4ThreeVector(0, dw_tpcbeam,
566 0));
567 G4LogicalVolume* l_fangsbeamhf =
new G4LogicalVolume(s_fangsbeamhf,
geometry::Materials::get(
"FG_Epoxy"),
"l_fangsbeamhf", 0, 0);
568 double xfangsbeamhf = activeParams.getLength("xfangsBeamhf") * CLHEP::cm;
569 double yfangsbeamhf = activeParams.getLength("yfangsBeamhf") * CLHEP::cm;
570 double zfangsbeamhf = activeParams.getLength("zfangsBeamhf") * CLHEP::cm;
571 PH1SUSTRpos = G4ThreeVector(xfangsbeamhf, yfangsbeamhf, zfangsbeamhf);
572 new G4PVPlacement(rotY, PH1SUSTRpos, l_fangsbeamhf, "p_fangsbeamhf", &topVolume, false, 0);
573
574 G4double dz_fangsbeamhb = activeParams.getLength("lfangsBeamhb") * CLHEP::cm / 2.;
575 G4VSolid* s_fangsbeamhb_a = new G4Box("s_fangsbeamhb_a", dx_tpcbeam, dy_tpcbeam, dz_fangsbeamhb);
576 G4VSolid* s_fangsbeamhb_b = new G4Box("s_fangsbeamhb_b", dx_tpcbeam - 2.*dw_tpcbeam, dy_tpcbeam - dw_tpcbeam, dz_fangsbeamhb);
577 G4VSolid* s_fangsbeamhbpos = new G4SubtractionSolid("s_fangsbeamhbpos", s_fangsbeamhb_a, s_fangsbeamhb_b, 0, G4ThreeVector(0,
578 dw_tpcbeam, 0));
579 G4VSolid* s_fangsbeamhbneg = new G4SubtractionSolid("s_fangsbeamhbneg", s_fangsbeamhb_a, s_fangsbeamhb_b, 0, G4ThreeVector(0,
580 -dw_tpcbeam, 0));
581 G4VSolid* s_fangsbeamhb = new G4UnionSolid("s_fangsbeamhb", s_fangsbeamhbpos, s_fangsbeamhbneg, 0, G4ThreeVector(0, -2.*dy_tpcbeam,
582 0));
583 G4LogicalVolume* l_fangsbeamhb =
new G4LogicalVolume(s_fangsbeamhb,
geometry::Materials::get(
"FG_Epoxy"),
"l_fangsbeamhb", 0, 0);
584 double xfangsbeamhb = activeParams.getLength("xfangsBeamhb") * CLHEP::cm;
585 double yfangsbeamhb = activeParams.getLength("yfangsBeamhb") * CLHEP::cm;
586 double zfangsbeamhb = activeParams.getLength("zfangsBeamhb") * CLHEP::cm;
587 TransForm = G4Translate3D(xfangsbeamhb, yfangsbeamhb, zfangsbeamhb) * G4RotateY3D(90.*CLHEP::deg);
588 new G4PVPlacement(TransForm, l_fangsbeamhb, "p_fangsbeamhb", &topVolume, false, 1);
589 }
590 }
static G4Material * get(const std::string &name)
Find given material.
VXD::SensitiveDetector< PXDSimHit, PXDTrueHit > SensitiveDetector
The PXD Sensitive Detector class.