-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdetectorconstruction.cc
executable file
·742 lines (615 loc) · 25.7 KB
/
detectorconstruction.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
#include "detectorconstruction.hh"
// contructor
detectorconstruction::detectorconstruction()
{
// default values
fmessenger= new detectormessenger(this);
DefaultValues();
DefineMaterials();
}
// destructor
detectorconstruction::~detectorconstruction()
{}
// function for default values of messenger
void detectorconstruction::DefaultValues(){
// pipe
ra_pipe=2*cm;
len_pipe=0.5*m;
th_pipe=0.01*cm;
// first detector
posX1=-20*cm;
posY1=0*cm;
posZ1=20*cm;
// second detector
posX2=-20*cm;
posY2=0*cm;
posZ2=-20*cm;
// third detector)
posX3=20*cm;
posY3=0*cm;
posZ3=20*cm;
// fourth detector
posX4=20*cm;
posY4=0*cm;
posZ4=-20*cm;
// angles for detectors
ang1=180*deg;
ang2=0*deg;
ang3=180*deg;
ang4=0*deg;
// default values for the box pipe
len_pipebox=0.5*m;
y_pipe=(15/2)*cm;
z_pipe=(15/2)*cm;
// default values to construct the kind og pipe
isPipeBox=true;
isPipeCylinder=false;
}
//
// define the action constructors
// first detector
void detectorconstruction::SetPipeDimCyl(G4ThreeVector pipe_dim) {
th_pipe=pipe_dim[0];
ra_pipe=pipe_dim[1];
len_pipe=pipe_dim[2];
G4RunManager::GetRunManager()->ReinitializeGeometry();
}
void detectorconstruction::SetPipeDimBox(G4ThreeVector pipe_dim) {
len_pipebox=pipe_dim[0];
y_pipe=pipe_dim[1];
z_pipe=pipe_dim[2];
G4RunManager::GetRunManager()->ReinitializeGeometry();
}
void detectorconstruction::SetPos_NaI1(G4ThreeVector dims) {
posX1=dims[0];
posY1=dims[1];
posZ1=dims[2];
G4RunManager::GetRunManager()->ReinitializeGeometry();
}
void detectorconstruction::SetPos_NaI2(G4ThreeVector dims) {
posX2=dims[0];
posY2=dims[1];
posZ2=dims[2];
G4RunManager::GetRunManager()->ReinitializeGeometry();
}
void detectorconstruction::SetPos_NaI3(G4ThreeVector dims) {
posX3=dims[0];
posY3=dims[1];
posZ3=dims[2];
G4RunManager::GetRunManager()->ReinitializeGeometry();
}
void detectorconstruction::SetPos_NaI4(G4ThreeVector dims) {
posX4=dims[0];
posY4=dims[1];
posZ4=dims[2];
G4RunManager::GetRunManager()->ReinitializeGeometry();
}
void detectorconstruction::SetAng_NaI1(G4double ang) {
ang1=ang;
G4RunManager::GetRunManager()->ReinitializeGeometry();
}
void detectorconstruction::SetAng_NaI2(G4double ang) {
ang2=ang;
G4RunManager::GetRunManager()->ReinitializeGeometry();
}
void detectorconstruction::SetAng_NaI3(G4double ang) {
ang3=ang;
G4RunManager::GetRunManager()->ReinitializeGeometry();
}
void detectorconstruction::SetAng_NaI4(G4double ang) {
ang4=ang;
G4RunManager::GetRunManager()->ReinitializeGeometry();
}
void detectorconstruction::SetPipeCyl(G4bool g1){
isPipeCylinder=g1;
if (g1==true){
isPipeBox=false;
}
G4RunManager::GetRunManager()->ReinitializeGeometry();
}
void detectorconstruction::SetPipeBox(G4bool g1){
isPipeBox=g1;
if (g1==true){
isPipeCylinder=false;
}
G4RunManager::GetRunManager()->ReinitializeGeometry();
}
void detectorconstruction::Set_Rotate_X_NaI1(G4bool a){
isRotX_NaI1=a;
if (isRotX_NaI1==true){
isRotY_NaI1=false;
isRotZ_NaI1=false;
}
}
void detectorconstruction::Set_Rotate_Y_NaI1(G4bool a){
isRotY_NaI1=a;
if (isRotY_NaI1==true){
isRotX_NaI1=false;
isRotZ_NaI1=false;
}
}
void detectorconstruction::Set_Rotate_Z_NaI1(G4bool a){
isRotZ_NaI1=a;
if (isRotZ_NaI1==true){
isRotX_NaI1=false;
isRotZ_NaI1=false;
}
}
void detectorconstruction::Set_Rotate_X_NaI2(G4bool a){
isRotX_NaI2=a;
if (isRotX_NaI2==true){
isRotY_NaI2=false;
isRotZ_NaI2=false;
}
}
void detectorconstruction::Set_Rotate_Y_NaI2(G4bool a){
isRotY_NaI2=a;
if (isRotY_NaI2==true){
isRotX_NaI2=false;
isRotZ_NaI2=false;
}
}
void detectorconstruction::Set_Rotate_Z_NaI2(G4bool a){
isRotZ_NaI2=a;
if (isRotZ_NaI2==true){
isRotX_NaI2=false;
isRotZ_NaI2=false;
}
}
void detectorconstruction::Set_Rotate_X_NaI3(G4bool a){
isRotX_NaI3=a;
if (isRotX_NaI3==true){
isRotY_NaI3=false;
isRotZ_NaI3=false;
}
}
void detectorconstruction::Set_Rotate_Y_NaI3(G4bool a){
isRotY_NaI3=a;
if (isRotY_NaI3==true){
isRotX_NaI3=false;
isRotZ_NaI3=false;
}
}
void detectorconstruction::Set_Rotate_Z_NaI3(G4bool a){
isRotZ_NaI3=a;
if (isRotZ_NaI3==true){
isRotX_NaI3=false;
isRotZ_NaI3=false;
}
}
void detectorconstruction::Set_Rotate_X_NaI4(G4bool a){
isRotX_NaI4=a;
if (isRotX_NaI4==true){
isRotY_NaI4=false;
isRotZ_NaI4=false;
}
}
void detectorconstruction::Set_Rotate_Y_NaI4(G4bool a){
isRotY_NaI4=a;
if (isRotY_NaI4==true){
isRotX_NaI4=false;
isRotZ_NaI4=false;
}
}
void detectorconstruction::Set_Rotate_Z_NaI4(G4bool a){
isRotZ_NaI4=a;
if (isRotZ_NaI4==true){
isRotX_NaI4=false;
isRotZ_NaI4=false;
}
}
// define a function of materials
void detectorconstruction::DefineMaterials(){
G4NistManager* nist = G4NistManager::Instance();
nist->SetVerbose(1);
air = nist->FindOrBuildMaterial("G4_AIR");
cu= nist->FindOrBuildMaterial("G4_Cu");
water= nist->FindOrBuildMaterial("G4_WATER");
al_mat = nist->FindOrBuildMaterial("G4_Al");
si_mat = nist->FindOrBuildMaterial("G4_SILICON_DIOXIDE");
mg_mat = nist->FindOrBuildMaterial("G4_MAGNESIUM_OXIDE");
na_mat = nist->FindOrBuildMaterial("G4_SODIUM_IODIDE");
}
void detectorconstruction::ConstructCylinderPipe(){
// DEFINE PIPE LINE
// solid
// define thickness
pipe_solid= new G4Tubs ("pipe_solid",0*cm,(ra_pipe+th_pipe),len_pipe,0.*deg,360.*deg);
pipe_logic= new G4LogicalVolume(pipe_solid, cu,"pipe_logic");
// define rotation matrix
m_rot= new G4RotationMatrix();
m_rot->rotateY(90.*deg);
// define physical volume
pipe_phys= new G4PVPlacement(m_rot, //no rotation
G4ThreeVector(), //at position
pipe_logic, //its logical volume
"pipe_phys", //its name
logicWorld, //its mother volume
false, //no boolean operation
0, //copy number
true); //overlaps checking
// define the water inside the pipe
water_solid= new G4Tubs ("water_solid",0*cm,ra_pipe,(len_pipe-0.001*cm),0.*deg,360.*deg);
water_logic= new G4LogicalVolume(water_solid, water,"water_logic");
// define physical volume
water_phys= new G4PVPlacement(0, //no rotation
G4ThreeVector(), //at position
water_logic, //its logical volume
"water_phys", //its name
pipe_logic, //its mother volume
false, //no boolean operation
0, //copy number
true); //overlaps checking
}
void detectorconstruction::ConstructBoxPipe(){
// DEFINE PIPE LINE
// solid
// define thickness
cuadbox_solid = new G4Box ("pipe_solid",len_pipebox,y_pipe,z_pipe);
pipe_logic = new G4LogicalVolume(cuadbox_solid, cu,"pipe_logic");
// define physical volume
pipe_phys= new G4PVPlacement(m_rot, //no rotation
G4ThreeVector(), //at position
pipe_logic, //its logical volume
"pipe_phys", //its name
logicWorld, //its mother volume
false, //no boolean operation
0, //copy number
true); //overlaps checking
// define the water inside the pipe
water_solid_box = new G4Box ("water_solid",len_pipebox,(y_pipe-0.001*cm),(z_pipe-0.001*cm));
water_logic = new G4LogicalVolume(water_solid_box, water,"water_logic");
// define physical volume
water_phys= new G4PVPlacement(0, //no rotation
G4ThreeVector(), //at position
water_logic, //its logical volume
"water_phys", //its name
pipe_logic, //its mother volume
false, //no boolean operation
0, //copy number
true); //overlaps checking
}
void detectorconstruction::ConstructNaI1()
{
// define aluminium layer
// define solid
al_solid= new G4Tubs ("al_solid",0.0*cm,4.045*cm,4.1025*cm,0.*deg,360.*deg);
// define logic
al_logic= new G4LogicalVolume(al_solid, //its solid
al_mat, //its material
"Aluminium_logic"); //its name
G4ThreeVector ps_d1= G4ThreeVector (posX1, posY1, posZ1);
// define rotation matrix
m_rot1= new G4RotationMatrix();
if (isRotX_NaI1==true){ m_rot1->rotateX(ang1);}
else if (isRotY_NaI1==true) { m_rot1->rotateY(ang1);}
else if (isRotZ_NaI1==true) { m_rot1->rotateZ(ang1);}
// define physical volume
al_phys= new G4PVPlacement(m_rot1, //no rotation
ps_d1, //at position
al_logic, //its logical volume
"detector_1", //its name
logicWorld, //its mother volume
false, //no boolean operation
0, //copy number
true); //overlaps checking
// define SiO2 layer
// define solid
si_solid= new G4Tubs ("si_solid",0.0*cm,3.995*cm,0.15*cm,0.*deg,360.*deg);
// define logic
si_logic= new G4LogicalVolume(si_solid, //its solid
si_mat, //its material
"si_logic"); //its name
// define physical volume
si_phys= new G4PVPlacement(0, //no rotation
pos2, //at position
si_logic, //its logical volume
"si_phys", //its name
al_logic, //its mother volume
false, //no boolean operation
0, //copy number
true); //overlaps checking
// define MgO layer
// define solid
mg_solid= new G4Tubs ("mg_solid",0.0*cm,3.995*cm,3.9025*cm,0.*deg,360.*deg);
// define logic
mg_logic= new G4LogicalVolume(mg_solid, //its solid
mg_mat, //its material
"mg_logic"); //its name
// define physical volume
mg_phys= new G4PVPlacement(0, //no rotation
pos3, //at position
mg_logic, //its logical volume
"mg_phys", //its name
al_logic, //its mother volume
false, //no boolean operation
0, //copy number
true); //overlaps checking
// define solid
na_solid= new G4Tubs ("na_solid",0.0*cm,3.81*cm,3.81*cm,0.*deg,360.*deg);
// define logic
logic_nai1 = new G4LogicalVolume(na_solid, //its solid
na_mat, //its material
"na_logic"); //its name
na_phys1=new G4PVPlacement(0, //no rotation
pos4, //at position
logic_nai1, //its logical volume
"na_phys", //its name
mg_logic, //its mother volume
false, //no boolean operation
0, //copy number
true); //overlaps checking
fScoringVolume1=logic_nai1;
}
void detectorconstruction::ConstructNaI2() {
// SECOND DETECTOR
// define aluminium layer
// define logic
G4ThreeVector pos5 = G4ThreeVector(posX2,posY2,posZ2);
al_logic2= new G4LogicalVolume(al_solid, //its solid
al_mat, //its material
"Aluminium_logic"); //its name
// define rotation matrix
m_rot2= new G4RotationMatrix();
if (isRotX_NaI2==true){ m_rot2->rotateX(ang2);}
else if (isRotY_NaI2==true) { m_rot2->rotateY(ang2);}
else if (isRotZ_NaI2==true) { m_rot2->rotateZ(ang2);}
// define physical volume
al_phys2= new G4PVPlacement(m_rot2, //no rotation
pos5, //at position
al_logic2, //its logical volume
"detector_2", //its name
logicWorld, //its mother volume
false, //no boolean operation
0, //copy number
true); //overlaps checking
// define SiO2 layer
// define logic
si_logic2= new G4LogicalVolume(si_solid, //its solid
si_mat, //its material
"si_logic"); //its name
// define physical volume
si_phys2= new G4PVPlacement(0, //no rotation
pos2, //at position
si_logic2, //its logical volume
"si_phys", //its name
al_logic2, //its mother volume
false, //no boolean operation
0, //copy number
true); //overlaps checking
// define MgO layer
// define logic
mg_logic2= new G4LogicalVolume(mg_solid, //its solid
mg_mat, //its material
"mg_logic"); //its name
// define physical volume
mg_phys2=new G4PVPlacement(0, //no rotation
pos3, //at position
mg_logic2, //its logical volume
"mg_phys", //its name
al_logic2, //its mother volume
false, //no boolean operation
0, //copy number
true); //overlaps checking
logic_nai2 = new G4LogicalVolume(na_solid, //its solid
na_mat, //its material
"na_logic"); //its name
na_phys2= new G4PVPlacement(0, //no rotation
pos4, //at position
logic_nai2, //its logical volume
"na_phys2", //its name
mg_logic2, //its mother volume
false, //no boolean operation
0, //copy number
true); //overlaps checking
fScoringVolume2=logic_nai2;
}
void detectorconstruction::ConstructNaI3(){
// THIRD DETECTOR
// define aluminium layer
// define logic
G4ThreeVector pos6 = G4ThreeVector(posX3,posY3,posZ3);
al_logic3= new G4LogicalVolume(al_solid, //its solid
al_mat, //its material
"Aluminium_logic"); //its name
// define rotation matrix
m_rot3= new G4RotationMatrix();
if (isRotX_NaI3==true){ m_rot3->rotateX(ang3);}
else if (isRotY_NaI3==true) { m_rot3->rotateY(ang3);}
else if (isRotZ_NaI3==true) { m_rot3->rotateZ(ang3);}
// define physical volume
al_phys3= new G4PVPlacement(m_rot3, //no rotation
pos6, //at position
al_logic3, //its logical volume
"detector_3", //its name
logicWorld, //its mother volume
false, //no boolean operation
0, //copy number
true); //overlaps checking
// define SiO2 layer
// define logic
si_logic3= new G4LogicalVolume(si_solid, //its solid
si_mat, //its material
"si_logic"); //its name
// define physical volume
si_phys3 = new G4PVPlacement(0, //no rotation
pos2, //at position
si_logic3, //its logical volume
"si_phys", //its name
al_logic3, //its mother volume
false, //no boolean operation
0, //copy number
true); //overlaps checking
// define MgO layer
// define logic
mg_logic3= new G4LogicalVolume(mg_solid, //its solid
mg_mat, //its material
"mg_logic"); //its name
// define physical volume
mg_phys3= new G4PVPlacement(0, //no rotation
pos3, //at position
mg_logic3, //its logical volume
"mg_phys", //its name
al_logic3, //its mother volume
false, //no boolean operation
0, //copy number
true); //overlaps checking
logic_nai3 = new G4LogicalVolume(na_solid, //its solid
na_mat, //its material
"na_logic"); //its name
na_phys3= new G4PVPlacement(0, //no rotation
pos4, //at position
logic_nai3, //its logical volume
"na_phys2", //its name
mg_logic3, //its mother volume
false, //no boolean operation
0, //copy number
true); //overlaps checking
fScoringVolume3=logic_nai3;
}
void detectorconstruction::ConstructNaI4(){
// FOURTH DETECTOR
// define aluminium layer
// define logic
G4ThreeVector pos7 = G4ThreeVector(posX4,posY4,posZ4);
al_logic4= new G4LogicalVolume(al_solid, //its solid
al_mat, //its material
"Aluminium_logic"); //its name
// define rotation matrix
m_rot4= new G4RotationMatrix();
if (isRotX_NaI4==true){ m_rot4->rotateX(ang4);}
else if (isRotY_NaI4==true) { m_rot4->rotateY(ang4);}
else if (isRotZ_NaI4==true) { m_rot4->rotateZ(ang4);}
// define physical volume
al_phys4= new G4PVPlacement(m_rot4, //no rotation
pos7, //at position
al_logic4, //its logical volume
"detector_4", //its name
logicWorld, //its mother volume
false, //no boolean operation
0, //copy number
true); //overlaps checking
// define SiO2 layer
// define logic
si_logic4= new G4LogicalVolume(si_solid, //its solid
si_mat, //its material
"si_logic"); //its name
// define physical volume
si_phys4= new G4PVPlacement(0, //no rotation
pos2, //at position
si_logic4, //its logical volume
"si_phys", //its name
al_logic4, //its mother volume
false, //no boolean operation
0, //copy number
true); //overlaps checking
// define MgO layer
// define logic
mg_logic4= new G4LogicalVolume(mg_solid, //its solid
mg_mat, //its material
"mg_logic"); //its name
// define physical volume
mg_phys4= new G4PVPlacement(0, //no rotation
pos3, //at position
mg_logic4, //its logical volume
"mg_phys", //its name
al_logic4, //its mother volume
false, //no boolean operation
0, //copy number
true); //overlaps checking
logic_nai4 = new G4LogicalVolume(na_solid, //its solid
na_mat, //its material
"na_logic"); //its name
na_phys4= new G4PVPlacement(0, //no rotation
pos4, //at position
logic_nai4, //its logical volume
"na_phys2", //its name
mg_logic4, //its mother volume
false, //no boolean operation
0, //copy number
true); //overlaps checking
fScoringVolume4=logic_nai4;
}
// add properties and volumenes
G4VPhysicalVolume* detectorconstruction::Construct()
{
// define the world
// define the size
G4double long_x1= 1*m;
G4double long_y1= 1*m;
G4double long_z1= 1*m;
// define world solid
solidWorld =
new G4Box("World", //its name
long_x1, long_y1, long_z1); //its size
// define world logic
logicWorld =
new G4LogicalVolume(solidWorld, //its solid
air, //its material
"World"); //its name
// define physics solid
physWorld =
new G4PVPlacement(0, //no rotation
G4ThreeVector(), //at (0,0,0)
logicWorld, //its logical volume
"World", //its name
0, //its mother volume
false, //no boolean operation
0, //copy number
true); //overlaps checking
// DEFINE PIPE LINE
if (isPipeBox==true){
ConstructBoxPipe();
}
if (isPipeCylinder==true){
ConstructCylinderPipe();
}
// DEFINE DETECTORS GEOMETRIES
// FIRST DETECTOR
ConstructNaI1();
// SECOND DETECTOR
ConstructNaI2();
// THIRD DETECTOR
ConstructNaI3();
// FOURTH DETECTOR
ConstructNaI4();
// VISUALIZATION ATRIBUTES
logicWorld->SetVisAttributes (G4VisAttributes::GetInvisible());
auto pipe_VisAtt= new G4VisAttributes(G4Colour(0.0,0.0,1.0));
pipe_VisAtt->SetVisibility(true);
pipe_logic->SetVisAttributes(pipe_VisAtt);
water_logic->SetVisAttributes(pipe_VisAtt);
// visualization atributes for first detector
// red one
auto dt1_VisAtt= new G4VisAttributes(G4Colour(1.0,0.0,0.0));
dt1_VisAtt->SetVisibility(true);
al_logic->SetVisAttributes(dt1_VisAtt);
logic_nai1->SetVisAttributes(dt1_VisAtt);
si_logic->SetVisAttributes(dt1_VisAtt);
mg_logic->SetVisAttributes(dt1_VisAtt);
// visualization atributes for second detector
// green one
auto dt2_VisAtt= new G4VisAttributes(G4Colour(0.0,1.0,0.0));
dt2_VisAtt->SetVisibility(true);
al_logic2->SetVisAttributes(dt2_VisAtt);
logic_nai2->SetVisAttributes(dt2_VisAtt);
si_logic2->SetVisAttributes(dt2_VisAtt);
mg_logic2->SetVisAttributes(dt2_VisAtt);
// visualization atributes for third detector
// yellow one
auto dt3_VisAtt= new G4VisAttributes(G4Colour(1.0,1.0,0.0));
dt3_VisAtt->SetVisibility(true);
al_logic3->SetVisAttributes(dt3_VisAtt);
logic_nai3->SetVisAttributes(dt3_VisAtt);
si_logic3->SetVisAttributes(dt3_VisAtt);
mg_logic3->SetVisAttributes(dt3_VisAtt);
// visualization atributes for fourth detector
// magenta one
auto dt4_VisAtt= new G4VisAttributes(G4Colour(1.0,0.0,1.0));
dt4_VisAtt->SetVisibility(true);
al_logic4->SetVisAttributes(dt4_VisAtt);
logic_nai4->SetVisAttributes(dt4_VisAtt);
si_logic4->SetVisAttributes(dt4_VisAtt);
mg_logic4->SetVisAttributes(dt4_VisAtt);
return physWorld;
}