Create detector geometry.
71 {
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
151
153
156
157 G4Transform3D transform_HER = G4Translate3D(0., 0., 0.);
158 transform_HER = transform_HER * G4RotateY3D(crossingAngleHER);
159
160 G4Transform3D transform_LER = G4Translate3D(0., 0., 0.);
161 transform_LER = transform_LER * G4RotateY3D(crossingAngleLER);
162
163 map<string, CryostatElement> elements;
164
165
166
167
168
169 CryostatElement tubeR;
170 std::string prep = "TubeR.";
171
173
174 std::vector<double> TubeR_Z(TubeR_N);
175 std::vector<double> TubeR_R(TubeR_N);
176 std::vector<double> TubeR_r(TubeR_N);
177
178 for (int i = 0; i < TubeR_N; ++i) {
179 ostringstream ossZID;
180 ossZID << "Z" << i;
181
182 ostringstream ossRID;
183 ossRID << "R" << i;
184
185 ostringstream ossrID;
186 ossrID << "r" << i;
187
191 }
192
193 tubeR.transform = G4Translate3D(0., 0., 0.);
194 tubeR.geo = new G4Polycone("geo_TubeR_name", 0, 2 * M_PI, TubeR_N, &(TubeR_Z[0]), &(TubeR_r[0]), &(TubeR_R[0]));
195 tubeR.logi = NULL;
196 elements["TubeR"] = tubeR;
197
198
199 CryostatElement tubeR2;
200 prep = "TubeR2.";
202
203 std::vector<double> TubeR2_Z(TubeR2_N);
204 std::vector<double> TubeR2_R(TubeR2_N);
205 std::vector<double> TubeR2_r(TubeR2_N);
206
207 for (int i = 0; i < TubeR2_N; ++i) {
208 ostringstream ossZID;
209 ossZID << "Z" << i;
210
211 ostringstream ossRID;
212 ossRID << "R" << i;
213
214 ostringstream ossrID;
215 ossrID << "r" << i;
216
220 }
221
222 tubeR2.transform = G4Translate3D(0., 0., 0.);
223 tubeR2.geo = new G4Polycone("geo_TubeR2_name", 0, 2 * M_PI, TubeR2_N, &(TubeR2_Z[0]), &(TubeR2_r[0]), &(TubeR2_R[0]));
224 tubeR2.logi = NULL;
225 elements["TubeR2"] = tubeR2;
226
227
228 CryostatElement tubeL;
229 prep = "TubeL.";
231
232 std::vector<double> TubeL_Z(TubeL_N);
233 std::vector<double> TubeL_R(TubeL_N);
234 std::vector<double> TubeL_r(TubeL_N);
235
236 for (int i = 0; i < TubeL_N; ++i) {
237 ostringstream ossZID;
238 ossZID << "Z" << i;
239
240 ostringstream ossRID;
241 ossRID << "R" << i;
242
243 ostringstream ossrID;
244 ossrID << "r" << i;
245
249 }
250
251 tubeL.transform = G4Translate3D(0., 0., 0.);
252 tubeL.geo = new G4Polycone("geo_TubeL_name", 0, 2 * M_PI, TubeL_N, &(TubeL_Z[0]), &(TubeL_r[0]), &(TubeL_R[0]));
253 tubeL.logi = NULL;
254 elements["TubeL"] = tubeL;
255
256
257
258
259
260
261
262
263 CryostatElement A1spc1;
264 prep = "A1spc1.";
266
267 std::vector<double> A1spc1_Z(A1spc1_N);
268 std::vector<double> A1spc1_r(A1spc1_N);
269 std::vector<double> A1spc1_R(A1spc1_N);
270
271 for (int i = 0; i < A1spc1_N; ++i) {
272 ostringstream ossZID;
273 ossZID << "Z" << i;
274
275 ostringstream ossRID;
276 ossRID << "R" << i;
277
278 ostringstream ossrID;
279 ossrID << "r" << i;
280
284 }
285
286 A1spc1.transform = transform_HER;
287 G4Polycone* geo_A1spc1xx = new G4Polycone("geo_A1spc1xx_name", 0, 2 * M_PI, A1spc1_N, &(A1spc1_Z[0]), &(A1spc1_r[0]),
288 &(A1spc1_R[0]));
289
290
291 CryostatElement A1spc2;
292 prep = "A1spc2.";
294
295 std::vector<double> A1spc2_Z(A1spc2_N);
296 std::vector<double> A1spc2_R(A1spc2_N);
297 std::vector<double> A1spc2_r(A1spc2_N);
298
299 for (int i = 0; i < A1spc2_N; ++i) {
300 ostringstream ossZID;
301 ossZID << "Z" << i;
302
303 ostringstream ossRID;
304 ossRID << "R" << i;
305
306 ostringstream ossrID;
307 ossrID << "r" << i;
308
312 }
313
314 A1spc2.transform = transform_HER;
315 G4Polycone* geo_A1spc2xx = new G4Polycone("geo_A1spc2xx_name", 0, 2 * M_PI, A1spc2_N, &(A1spc2_Z[0]), &(A1spc2_r[0]),
316 &(A1spc2_R[0]));
317
318
319 CryostatElement B1spc1;
320 prep = "B1spc1.";
322
323 std::vector<double> B1spc1_Z(B1spc1_N);
324 std::vector<double> B1spc1_R(B1spc1_N);
325 std::vector<double> B1spc1_r(B1spc1_N);
326
327 for (int i = 0; i < B1spc1_N; ++i) {
328 ostringstream ossZID;
329 ossZID << "Z" << i;
330
331 ostringstream ossRID;
332 ossRID << "R" << i;
333
334 ostringstream ossrID;
335 ossrID << "r" << i;
336
340 }
341
342 B1spc1.transform = transform_LER;
343 G4Polycone* geo_B1spc1xx = new G4Polycone("geo_B1spc1xx_name", 0, 2 * M_PI, B1spc1_N, &(B1spc1_Z[0]), &(B1spc1_r[0]),
344 &(B1spc1_R[0]));
345
346
347 CryostatElement B1spc2;
348 prep = "B1spc2.";
350
351 std::vector<double> B1spc2_Z(B1spc2_N);
352 std::vector<double> B1spc2_R(B1spc2_N);
353 std::vector<double> B1spc2_r(B1spc2_N);
354
355 for (int i = 0; i < B1spc2_N; ++i) {
356 ostringstream ossZID;
357 ossZID << "Z" << i;
358
359 ostringstream ossRID;
360 ossRID << "R" << i;
361
362 ostringstream ossrID;
363 ossrID << "r" << i;
364
368 }
369
370 B1spc2.transform = transform_LER;
371 G4Polycone* geo_B1spc2xx = new G4Polycone("geo_B1spc2xx_name", 0, 2 * M_PI, B1spc2_N, &(B1spc2_Z[0]), &(B1spc2_r[0]),
372 &(B1spc2_R[0]));
373
374
375 B1spc2.geo = new G4IntersectionSolid("geo_B1spc2_name", geo_B1spc2xx, elements["TubeR2"].geo, B1spc2.transform.inverse());
376 B1spc2.logi = NULL;
377
378 G4IntersectionSolid* geo_B1spc1x = new G4IntersectionSolid("geo_B1spc1x_name", geo_B1spc1xx, elements["TubeR"].geo,
379 B1spc1.transform.inverse());
380 B1spc1.geo = new G4UnionSolid("geo_B1spc1_name", geo_B1spc1x, B1spc2.geo);
381
382 A1spc2.geo = new G4IntersectionSolid("geo_A1spc2_name", geo_A1spc2xx, elements["TubeR2"].geo, A1spc2.transform.inverse());
383 A1spc2.logi = NULL;
384
385 G4IntersectionSolid* geo_A1spc1xy = new G4IntersectionSolid("geo_A1spc1xy_name", geo_A1spc1xx, elements["TubeR"].geo,
386 A1spc1.transform.inverse());
387 G4UnionSolid* geo_A1spc1x = new G4UnionSolid("geo_A1spc1x_name", geo_A1spc1xy, A1spc2.geo);
388 A1spc1.geo = new G4SubtractionSolid("geo_A1spc1_name", geo_A1spc1x, B1spc1.geo, A1spc1.transform.inverse()*B1spc1.transform);
389
392 A1spc1.logi = new G4LogicalVolume(A1spc1.geo, mat_A1spc1, "logi_A1spc1_name");
393 if (flag_limitStep)
394 A1spc1.logi->SetUserLimits(new G4UserLimits(stepMax));
395
396
398
399 new G4PVPlacement(A1spc1.transform, A1spc1.logi, "phys_A1spc1_name", &topVolume, false, 0);
400
403 B1spc1.logi = new G4LogicalVolume(B1spc1.geo, mat_B1spc1, "logi_B1spc1_name");
404 if (flag_limitStep)
405 B1spc1.logi->SetUserLimits(new G4UserLimits(stepMax));
406
407
409
410 new G4PVPlacement(B1spc1.transform, B1spc1.logi, "phys_B1spc1_name", &topVolume, false, 0);
411
412 elements["A1spc1"] = A1spc1;
413 elements["A1spc2"] = A1spc2;
414 elements["B1spc1"] = B1spc1;
415 elements["B1spc2"] = B1spc2;
416
417
418
419
420
421 CryostatElement C1wal1;
422 prep = "C1wal1.";
424
425 std::vector<double> C1wal1_Z(C1wal1_N);
426 std::vector<double> C1wal1_R(C1wal1_N);
427 std::vector<double> C1wal1_r(C1wal1_N);
428
429 for (int i = 0; i < C1wal1_N; ++i) {
430 ostringstream ossZID;
431 ossZID << "Z" << i;
432
433 ostringstream ossRID;
434 ossRID << "R" << i;
435
436 ostringstream ossrID;
437 ossrID << "r" << i;
438
442 }
443
444 C1wal1.transform = G4Translate3D(0., 0., 0.);
445
446
447 G4Polycone* geo_C1wal1xxx = new G4Polycone("geo_C1wal1xxx_name", 0, 2 * M_PI, C1wal1_N, &(C1wal1_Z[0]), &(C1wal1_r[0]),
448 &(C1wal1_R[0]));
449 G4IntersectionSolid* geo_C1wal1xx = new G4IntersectionSolid("geo_C1wal1xx_name", geo_C1wal1xxx, elements["TubeR"].geo,
450 elements["TubeR"].transform);
451 G4SubtractionSolid* geo_C1wal1x = new G4SubtractionSolid("geo_C1wal1x_name", geo_C1wal1xx, elements["A1spc1"].geo,
452 elements["A1spc1"].transform);
453 C1wal1.geo = new G4SubtractionSolid("geo_C1wal1_name", geo_C1wal1x, elements["B1spc1"].geo, elements["B1spc1"].transform);
454
457 C1wal1.logi = new G4LogicalVolume(C1wal1.geo, mat_C1wal1, "logi_C1wal1_name");
458
459
462 new G4PVPlacement(0, G4ThreeVector(0, 0, 0), C1wal1.logi, "phys_C1wal1_name", &topVolume, false, 0);
463
464 elements["C1wal1"] = C1wal1;
465
466
467
468
469
470 CryostatElement D1spc1;
471 prep = "D1spc1.";
473
474 std::vector<double> D1spc1_Z(D1spc1_N);
475 std::vector<double> D1spc1_r(D1spc1_N);
476 std::vector<double> D1spc1_R(D1spc1_N);
477
478 for (int i = 0; i < D1spc1_N; ++i) {
479 ostringstream ossZID;
480 ossZID << "Z" << i;
481
482 ostringstream ossRID;
483 ossRID << "R" << i;
484
485 ostringstream ossrID;
486 ossrID << "r" << i;
487
491 }
492
493 D1spc1.transform = transform_HER;
494 G4Polycone* geo_D1spc1xx = new G4Polycone("geo_D1spc1xx_name", 0, 2 * M_PI, D1spc1_N, &(D1spc1_Z[0]), &(D1spc1_r[0]),
495 &(D1spc1_R[0]));
496
497
498 CryostatElement E1spc1;
499 prep = "E1spc1.";
501
502 std::vector<double> E1spc1_Z(E1spc1_N);
503 std::vector<double> E1spc1_R(E1spc1_N);
504 std::vector<double> E1spc1_r(E1spc1_N);
505
506 for (int i = 0; i < E1spc1_N; ++i) {
507 ostringstream ossZID;
508 ossZID << "Z" << i;
509
510 ostringstream ossRID;
511 ossRID << "R" << i;
512
513 ostringstream ossrID;
514 ossrID << "r" << i;
515
519 }
520
521 E1spc1.transform = transform_LER;
522 G4Polycone* geo_E1spc1xx = new G4Polycone("geo_E1spc1xx_name", 0, 2 * M_PI, E1spc1_N, &(E1spc1_Z[0]), &(E1spc1_r[0]),
523 &(E1spc1_R[0]));
524
525
526 G4IntersectionSolid* geo_D1spc1x = new G4IntersectionSolid("geo_D1spc1x_name", geo_D1spc1xx, elements["TubeL"].geo,
527 D1spc1.transform.inverse());
528 E1spc1.geo = new G4IntersectionSolid("geo_E1spc1_name", geo_E1spc1xx, elements["TubeL"].geo, E1spc1.transform.inverse());
529 D1spc1.geo = new G4SubtractionSolid("geo_D1spc1_name", geo_D1spc1x, E1spc1.geo, D1spc1.transform.inverse()*E1spc1.transform);
530
533 D1spc1.logi = new G4LogicalVolume(D1spc1.geo, mat_D1spc1, "logi_D1spc1_name");
534 if (flag_limitStep)
535 D1spc1.logi->SetUserLimits(new G4UserLimits(stepMax));
536
537
539
540 new G4PVPlacement(D1spc1.transform, D1spc1.logi, "phys_D1spc1_name", &topVolume, false, 0);
541
544 E1spc1.logi = new G4LogicalVolume(E1spc1.geo, mat_E1spc1, "logi_E1spc1_name");
545 if (flag_limitStep)
546 E1spc1.logi->SetUserLimits(new G4UserLimits(stepMax));
547
548
550
551 new G4PVPlacement(E1spc1.transform, E1spc1.logi, "phys_E1spc1_name", &topVolume, false, 0);
552
553 elements["E1spc1"] = E1spc1;
554 elements["D1spc1"] = D1spc1;
555
556
557
558
559
560
561 CryostatElement F1wal1;
562 prep = "F1wal1.";
564
565 std::vector<double> F1wal1_Z(F1wal1_N);
566 std::vector<double> F1wal1_R(F1wal1_N);
567 std::vector<double> F1wal1_r(F1wal1_N);
568
569 for (int i = 0; i < F1wal1_N; ++i) {
570 ostringstream ossZID;
571 ossZID << "Z" << i;
572
573 ostringstream ossRID;
574 ossRID << "R" << i;
575
576 ostringstream ossrID;
577 ossrID << "r" << i;
578
582 }
583
584 F1wal1.transform = G4Translate3D(0., 0., 0.);
585
586
587 G4Polycone* geo_F1wal1xxx = new G4Polycone("geo_F1wal1xxx_name", 0, 2 * M_PI, F1wal1_N, &(F1wal1_Z[0]), &(F1wal1_r[0]),
588 &(F1wal1_R[0]));
589 G4IntersectionSolid* geo_F1wal1xx = new G4IntersectionSolid("geo_F1wal1xx_name", geo_F1wal1xxx, elements["TubeL"].geo,
590 elements["TubeL"].transform);
591 G4SubtractionSolid* geo_F1wal1x = new G4SubtractionSolid("geo_F1wal1x_name", geo_F1wal1xx, elements["D1spc1"].geo,
592 elements["D1spc1"].transform);
593 F1wal1.geo = new G4SubtractionSolid("geo_F1wal1_name", geo_F1wal1x, elements["E1spc1"].geo, elements["E1spc1"].transform);
594
597 F1wal1.logi = new G4LogicalVolume(F1wal1.geo, mat_F1wal1, "logi_F1wal1_name");
598
599
602 new G4PVPlacement(F1wal1.transform, F1wal1.logi, "phys_F1wal1_name", &topVolume, false, 0);
603
604 elements["F1wal1"] = F1wal1;
605
606
607
608
609
610 std::vector<std::string> supports;
612 for (const auto& name : supports) {
613
614 CryostatElement sup;
615 prep = name + ".";
616
623
631
633
635
636
637 G4Transform3D transform_box = G4Translate3D(box_X0, box_Y0, box_Z0);
638 transform_box = transform_box * G4RotateY3D(sup_PHI /
Unit::rad);
639
640 G4Transform3D transform_trd = G4Translate3D(trd_X0, trd_Y0, trd_Z0);
641 transform_trd = transform_trd * G4RotateY3D(sup_PHI /
Unit::rad) * G4RotateX3D(M_PI / 2.0 /
Unit::rad);
642
643
644 string geo_box_name = "geo_" + name + "_box_name";
645 string geo_trd_name = "geo_" + name + "_trd_name";
646
647 string geo_sup_name;
648 if (sup_cut_N == 0) {
649 geo_sup_name = "geo_" + name + "_name";
650 } else {
651 geo_sup_name = "geo_" + name + "_x_name";
652 }
653
654 G4Box* geo_box = new G4Box(geo_box_name, box_W / 2.0, box_H / 2.0, box_L / 2.0);
655 G4Trd* geo_trd = new G4Trd(geo_trd_name, trd_W1 / 2.0, trd_W2 / 2.0, trd_L / 2.0, trd_L / 2.0, trd_H / 2.0);
656
657 G4VSolid* geo_sup = new G4UnionSolid(geo_sup_name, geo_box, geo_trd, transform_box.inverse() * transform_trd);
658
659
660 for (int i = 0; i < sup_cut_N; ++i) {
661 ostringstream oss_block_num;
662 oss_block_num << i;
663
665 string geo_supx_name;
666 if (i == sup_cut_N - 1) {
667 geo_supx_name = "geo_" + name + "_name";
668 } else {
669 geo_sup_name = "geo_" + name + "_x" + oss_block_num.str() + "_name";
670 }
671 string geo_cut_name = "geo_" + name + "_cut" + oss_block_num.str() + "_name";
672
673 G4VSolid* geo_cut;
674
675 if (cut_type == 0.0) {
679
680 geo_cut = new G4Box(geo_cut_name, cut_W / 2.0, cut_H / 2.0, cut_L / 2.0);
681
682 } else {
685
686 geo_cut = new G4Tubs(geo_cut_name, 0.0, cut_R, cut_L / 2.0, 0.0, 2.0 * M_PI);
687 }
688
689
690
696
697 G4Transform3D cut_transform = G4Translate3D(cut_X0, cut_Y0, cut_Z0);
698 cut_transform = cut_transform * G4RotateX3D(cut_PHI /
Unit::rad);
699 cut_transform = cut_transform * G4RotateZ3D(cut_TH /
Unit::rad);
700
701 geo_sup = new G4SubtractionSolid(geo_sup_name, geo_sup, geo_cut, cut_transform);
702 }
703
704 sup.geo = geo_sup;
705 sup.transform = transform_box;
706
709
710 string logi_sup_name = "logi_" + name + "_name";
711 G4LogicalVolume* logi_sup = new G4LogicalVolume(sup.geo, mat_sup, logi_sup_name);
712
713 sup.logi = logi_sup;
714
715
717
718 string phys_sup_name = "phys_" + name + "_name";
719 new G4PVPlacement(sup.transform, sup.logi, phys_sup_name, &topVolume, false, 0);
720
721 elements[name] = sup;
722 }
723
724
725
726
727
728 std::vector<std::string> straightSections;
730 for (const auto& name : straightSections) {
731 prep = name + ".";
732
733 CryostatElement polycone;
734
736
737 std::vector<double> Z(N);
738 std::vector<double>
R(N);
739 std::vector<double> r(N);
740
741 for (int i = 0; i < N; ++i) {
742 ostringstream ossZID;
743 ossZID << "Z" << i;
744
745 ostringstream ossRID;
746 ossRID << "R" << i;
747
748 ostringstream ossrID;
749 ossrID << "r" << i;
750
754 }
755
756 polycone.transform = G4Translate3D(0.0, 0.0, 0.0);
757
758
762
763 string geo_polyconexx_name = "geo_" + name + "xx_name";
764 string geo_polyconex_name = "geo_" + name + "x_name";
765 string geo_polycone_name = "geo_" + name + "_name";
766
767 G4VSolid* geo_polyconexx, *geo_polycone;
768
770 geo_polyconexx =
new G4Polycone(geo_polyconexx_name, 0.0, 2 * M_PI, N, &(Z[0]), &(r[0]), &(
R[0]));
771 G4VSolid* geo_polyconex = new G4SubtractionSolid(geo_polyconex_name, geo_polyconexx, elements[subtract].geo,
772 elements[motherVolume].transform.inverse()*polycone.transform.inverse()*elements[subtract].transform);
773 geo_polycone =
new G4IntersectionSolid(geo_polycone_name, geo_polyconex, elements[
intersect].geo,
774 elements[motherVolume].transform.inverse()*polycone.transform.inverse()*elements[
intersect].transform);
775 } else if (subtract != "") {
776 geo_polyconexx =
new G4Polycone(geo_polyconexx_name, 0.0, 2 * M_PI, N, &(Z[0]), &(r[0]), &(
R[0]));
777 geo_polycone = new G4SubtractionSolid(geo_polycone_name, geo_polyconexx, elements[subtract].geo,
778 elements[motherVolume].transform.inverse()*polycone.transform.inverse()*elements[subtract].transform);
780 geo_polyconexx =
new G4Polycone(geo_polyconexx_name, 0.0, 2 * M_PI, N, &(Z[0]), &(r[0]), &(
R[0]));
781 geo_polycone =
new G4IntersectionSolid(geo_polycone_name, geo_polyconexx, elements[
intersect].geo,
782 elements[motherVolume].transform.inverse()*polycone.transform.inverse()*elements[
intersect].transform);
783 } else
784 geo_polycone =
new G4Polycone(geo_polycone_name, 0.0, 2 * M_PI, N, &(Z[0]), &(r[0]), &(
R[0]));
785
786 polycone.geo = geo_polycone;
787
788
791 string logi_polycone_name = "logi_" + name + "_name";
792 polycone.logi = new G4LogicalVolume(polycone.geo, mat_polycone, logi_polycone_name);
793 setColor(*polycone.logi,
"#CC0000");
795
796
797 string phys_polycone_name = "phys_" + name + "_name";
798 new G4PVPlacement(polycone.transform, polycone.logi, phys_polycone_name, elements[motherVolume].logi, false, 0);
799
800
801 polycone.transform = polycone.transform * elements[motherVolume].transform;
802
803 elements[name] = polycone;
804 }
805
806
807
808
809
810 std::vector<std::string> shields;
812 for (const auto& name : shields) {
813 prep = name + ".";
814
815
816
823
830
832
833
834 CryostatElement shield;
835
836 shield.transform = G4Translate3D(shield_X0, shield_Y0, shield_Z0);
837 shield.transform = shield.transform * G4RotateY3D(shield_PHI /
Unit::rad);
838
839 G4Transform3D transform_shield_hole = G4Translate3D(shield_hole_dX, shield_hole_dY, shield_hole_dZ);
840
841
842 string geo_shieldx_name = "geo_" + name + "x_name";
843 string geo_shield_hole_name = "geo_" + name + "_hole_name";
844 string geo_shield_name = "geo_" + name + "_name";
845
846 if (shield_hole_W == 0 || shield_hole_H == 0 || shield_hole_L == 0) {
847 G4Box* geo_shield = new G4Box(geo_shield_name, shield_W / 2.0, shield_H / 2.0, shield_L / 2.0);
848
849 shield.geo = geo_shield;
850 } else {
851 G4Box* geo_shieldx = new G4Box(geo_shieldx_name, shield_W / 2.0, shield_H / 2.0, shield_L / 2.0);
852 G4Box* geo_shield_hole = new G4Box(geo_shield_hole_name, shield_hole_W / 2.0, shield_hole_H / 2.0, shield_hole_L / 2.0);
853 G4SubtractionSolid* geo_shield = new G4SubtractionSolid(geo_shield_name, geo_shieldx, geo_shield_hole,
854 transform_shield_hole);
855
856 shield.geo = geo_shield;
857 }
858
861
862 string logi_shield_name = "logi_" + name + "_name";
863 G4LogicalVolume* logi_shield = new G4LogicalVolume(shield.geo, mat_shield, logi_shield_name);
864
865 shield.logi = logi_shield;
866
867
869
870 string phys_shield_name = "phys_" + name + "_name";
871 new G4PVPlacement(shield.transform, shield.logi, phys_shield_name, &topVolume, false, 0);
872
873 elements[name] = shield;
874 }
875
876
877
878 G4Tubs* geo_rvcR = new G4Tubs("geo_rvcR", 60, 60 + 60, (620 - 560) / 2., 0, 2 * M_PI);
879 G4LogicalVolume* logi_rvcR =
new G4LogicalVolume(geo_rvcR,
Materials::get(
"SUS316L"),
"logi_rvcR_name");
880 new G4PVPlacement(0, G4ThreeVector(0, 0, (620 + 560) / 2.), logi_rvcR, "phys_rvcR_name", &topVolume, false, 0);
881
882 G4Tubs* geo_rvcL = new G4Tubs("geo_rvcL", 60, 60 + 60, (-560 - (-620)) / 2., 0, 2 * M_PI);
883 G4LogicalVolume* logi_rvcL =
new G4LogicalVolume(geo_rvcL,
Materials::get(
"SUS316L"),
"logi_rvcL_name");
884 new G4PVPlacement(0, G4ThreeVector(0, 0, (-620 - 560) / 2.), logi_rvcL, "phys_rvcL_name", &topVolume, false, 0);
885
886
887
888 G4EllipticalTube* geo_elp_QC1LEx = new G4EllipticalTube("geo_elp_QC1LEx", 10.5, 13.5, (-675 - (-1225)) / 2.);
889 G4IntersectionSolid* geo_elp_QC1LE = new G4IntersectionSolid("geo_elp_QC1LE", elements["D2wal1"].geo, geo_elp_QC1LEx,
890 G4Translate3D(0, 0, (-675 - 1225) / 2.));
891 G4LogicalVolume* logi_elp_QC1LE =
new G4LogicalVolume(geo_elp_QC1LE,
Materials::get(
"Vacuum"),
"logi_elp_QC1LE_name");
892 new G4PVPlacement(0, G4ThreeVector(0, 0, 0), logi_elp_QC1LE, "phys_elp_QC1LE_name", elements["D2wal1"].logi, false, 0);
893
894 G4EllipticalTube* geo_elp_QC1LPx = new G4EllipticalTube("geo_elp_QC1LPx", 10.5, 13.5, (-675 - (-1225)) / 2.);
895 G4IntersectionSolid* geo_elp_QC1LP = new G4IntersectionSolid("geo_elp_QC1LP", elements["E2wal1"].geo, geo_elp_QC1LPx,
896 G4Translate3D(0, 0, (-675 - 1225) / 2.));
897 G4LogicalVolume* logi_elp_QC1LP =
new G4LogicalVolume(geo_elp_QC1LP,
Materials::get(
"Vacuum"),
"logi_elp_QC1LP_name");
898 new G4PVPlacement(0, G4ThreeVector(0, 0, 0), logi_elp_QC1LP, "phys_elp_QC1LP_name", elements["E2wal1"].logi, false, 0);
899
900 G4EllipticalTube* geo_elp_QC1REx = new G4EllipticalTube("geo_elp_QC1REx", 10.5, 13.5, (1225 - 675) / 2.);
901 G4IntersectionSolid* geo_elp_QC1RE = new G4IntersectionSolid("geo_elp_QC1RE", elements["A2wal1"].geo, geo_elp_QC1REx,
902 G4Translate3D(0, 0, (1225 + 675) / 2.));
903 G4LogicalVolume* logi_elp_QC1RE =
new G4LogicalVolume(geo_elp_QC1RE,
Materials::get(
"Vacuum"),
"logi_elp_QC1RE_name");
904 new G4PVPlacement(0, G4ThreeVector(0, 0, 0), logi_elp_QC1RE, "phys_elp_QC1RE_name", elements["A2wal1"].logi, false, 0);
905
906 G4EllipticalTube* geo_elp_QC1RPx = new G4EllipticalTube("geo_elp_QC1RPx", 10.5, 13.5, (1225 - 675) / 2.);
907 G4IntersectionSolid* geo_elp_QC1RP = new G4IntersectionSolid("geo_elp_QC1RP", elements["B2wal1"].geo, geo_elp_QC1RPx,
908 G4Translate3D(0, 0, (1225 + 675) / 2.));
909 G4LogicalVolume* logi_elp_QC1RP =
new G4LogicalVolume(geo_elp_QC1RP,
Materials::get(
"Vacuum"),
"logi_elp_QC1RP_name");
910 new G4PVPlacement(0, G4ThreeVector(0, 0, 0), logi_elp_QC1RP, "phys_elp_QC1RP_name", elements["B2wal1"].logi, false, 0);
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023 }
const std::string & getParameterStr(const std::string &name) const
Get string parameter.
double getParameter(const std::string &name) const
Get parameter value.
static const double mm
[millimeters]
static const double rad
Standard of [angle].
static const double cm
Standard units with the value = 1.
static G4Material * get(const std::string &name)
Find given material.
int intersect(const TRGCDCLpar &lp1, const TRGCDCLpar &lp2, CLHEP::HepVector &v1, CLHEP::HepVector &v2)
intersection
void setVisibility(G4LogicalVolume &volume, bool visible)
Helper function to quickly set the visibility of a given volume.
void setColor(G4LogicalVolume &volume, const std::string &color)
Set the color of a logical volume.