-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtargetRev1.pl
executable file
·1265 lines (1104 loc) · 48.6 KB
/
targetRev1.pl
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
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
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
#!/usr/bin/perl -w
#Author Omair Shahzad Alam #Date 12-18-15
# loading GEMC geometry routines
use strict;
use lib ("$ENV{GEMC}/io");
use utils;
use geometry;
# Define the Help Message
sub help()
{
print "\n Usage: \n";
print " geometry.pl <configuration filename>\n";
print " Will create a target using the variation specified in the configuration file\n";
exit;
}
# Make sure the argument list is correct
# If not pring the help
if( scalar @ARGV != 1)
{
help();
exit;
}
# Loading configuration file (first argument)
#Configuration file contains name of the shape, its version, the format in which the shape will be output, and the ranges of the geometry of the shape.
our %configuration = load_configuration($ARGV[0]);
#---------------------------------------------------------------------------
#For all shapes please refer to a the labelled diagram in the package which associates the methods with their respective shapes.
#For example, build_cork below will be labelled as 1.1 in the diagram in the package, and its shape will roughly be like the shape drawn two methods down
#Similarly, innercork will be labelled as 1.2 in the diagram.
#--------------------------------------------------------------------------
#General Remarks ----------------------------------------------------------------------------------
# All the windows are made of Aluminium, with a thicknes of 15 micro-inch
#Setting visibility as zero just makes the geometry as the word implies, invisible. But it still exists and will interact with any particle that passes through its region
#For Reference, here are the Geant4 shape names and their GEMC equivalents that were used in building this target
# Geant4 Name GEMC Name Object
# G4Sphere Sphere Sphere
# G4Tubs Tube Cylinder
# G4Cons Cons Cone
# I have attached a GEMC dictionary file which also contains other shape names and their eqiuivalents
# Some of the materials used to build these shapes were actually not avaiable in the Geant4 materials database, but were rather mentioned in the source code for GEMC and so they were found
#by GREP-ing the source code for the material that was needed, in the file materials.cc in installation directory of GEMC
#All the colors are 6 digit hexadecimal numbers, which makes sense since, 2 hexadecimal numbers are 8 bits and so thats a range between 0 and 255. So, the scheme is RRGGBB.
#One more number can be added to the end of this 6 digit number and this defines the opacity of the color, with 0 being the most opaque and 6 being the least opaque
#There is a frame which acts like a mother volume for all the geometries made below. Therefore this frame allows us to move the target in different directions and also to rotate it however we like
sub build_totalFrame
{
my %detector = init_det();
$detector{"name"} = "biggestFrame";
$detector{"mother"} = "root";
$detector{"description"} = "In order to move the picture";
$detector{"pos"} = "0*mm 0*mm -2.05837*cm";
$detector{"rotation"} = "0*deg 0*deg 0*deg";
$detector{"color"} = "C875334";
$detector{"type"} = "Tube";
$detector{"dimensions"} = "0*mm 50.9*mm 400*mm 0*deg 360*deg";
$detector{"material"} = "vacuum_m9";
$detector{"visible"} = 1;
$detector{"style"} = 1;
print_det(\%configuration, \%detector);
}
#The innercork is the liquid hydrogen
sub build_innerCork #1.2
{
my %detector = init_det();
$detector{"name"} = "innerCork";
$detector{"mother"} = "biggestFrame";
$detector{"description"} = "The liquid hydrogen";
$detector{"pos"} = "0*mm 0*mm 23.9537*mm";
$detector{"rotation"} = "0*deg 0*deg 0*deg";
$detector{"color"} = "C87533";
$detector{"type"} = "Cons";
$detector{"dimensions"} = "0*mm 2.2509*mm 0*mm 5.49125*mm 0.98535*mm 270*deg 360*deg";
$detector{"material"} = "G4_lH2";
$detector{"visible"} = 1;
$detector{"style"} = 1;
print_det(\%configuration, \%detector);
}
#This is the Aluminium casing for the liquid hydrogen
sub build_innerCorkCase #1.21
{
my %detector = init_det();
$detector{"name"} = "innerCorkCase";
$detector{"mother"} = "biggestFrame";
$detector{"description"} = "The container for the liquid hydrogen";
$detector{"pos"} = "0*mm 0*mm 23.9537*mm";
$detector{"rotation"} = "0*deg 0*deg 0*deg";
$detector{"color"} = "C875333";
$detector{"type"} = "Cons";
$detector{"dimensions"} = "1.8135*mm 2.2509*mm 5.05385*mm 5.49125*mm 0.98535*mm 270*deg 360*deg";
$detector{"material"} = "G4_Al";
$detector{"visible"} = 1;
$detector{"style"} = 1;
print_det(\%configuration, \%detector);
}
#This is a supporting structure fo the container of liquid hydrogen
sub build_cork #1.1
{
my %detector = init_det();
$detector{"name"} = "cork";
$detector{"mother"} = "biggestFrame";
$detector{"description"} = "The structure that supports the liquid hydrogen";
$detector{"pos"} = "0*mm 0*mm 22.36835*mm";#25.53395
$detector{"rotation"} = "180*deg 0*deg 0*deg";
$detector{"color"} = "C875333";
$detector{"type"} = "Cons";
$detector{"dimensions"} = "5.23735*mm 5.49125*mm 5.5841*mm 5.838*mm 2.48275*mm 270*deg 360*deg";
$detector{"material"} = "G4_Al";
$detector{"visible"} = 1;
$detector{"style"} = 1;
print_det(\%configuration, \%detector);
}
#There is an opening in the centre of the innerCorkCase which is closed off by making a very thin window
sub build_corkWindow #1.3
{
my %detector = init_det();
$detector{"name"} = "corkWindow";
$detector{"mother"} = "biggestFrame";
$detector{"description"} = "The glass window for the top cork";
$detector{"pos"} = "0*mm 0*mm 22.96835*mm";
$detector{"rotation"} = "0*deg 0*deg 0*deg";
$detector{"color"} = "FF0000";
$detector{"type"} = "Tube";
$detector{"dimensions"} = "0*mm 1.8135*mm 0.000381*mm 270*deg 360*deg";
$detector{"material"} = "G4_Al";
$detector{"visible"} = 1;
$detector{"style"} = 1;
print_det(\%configuration, \%detector);
}
#
#
# ___________
# /\ 1.1 /\
# / \_______/ \
# / 1.3 \
# / \
# / 1.2 \
# ~~~~~~~~~~~~~~~~~~~~~
#---------------------------------------------------------------------------------------------------
#This is the outermost layer and is comprised of two cones, the kaptonLayer and the kaptonCone
#The kaptonLayer is the longer cone that runs through the length of the target
sub build_kaptonLayer #2.1
{
my %detector = init_det();
$detector{"name"} = "kapLayer";
$detector{"mother"} = "biggestFrame";
$detector{"description"} = "The outermost cone that encapsulates the cork and the liquid duterium constructs";
$detector{"pos"} = "0*mm 0*mm 0*mm";
$detector{"rotation"} = "180*deg 0*deg 0*deg";
$detector{"color"} = "99CC004";
$detector{"type"} = "Cons";
$detector{"dimensions"} = "7.9911*mm 7.9912*mm 17.90044*mm 17.90045*mm 39.28*mm 270*deg 360*deg";
$detector{"material"} = "G4_KAPTON";
$detector{"visible"} = 1;
$detector{"style"} = 1;
print_det(\%configuration, \%detector);
}
#The kaptonCone is the smaller cone that basically caps the kaptonLayer cone
sub build_kaptonCone #2.2
{
my %detector = init_det();
$detector{"name"} = "kapCone";
$detector{"mother"} = "biggestFrame";
$detector{"description"} = "the cap of the outermost cone";
$detector{"pos"} = "0*mm 0*mm 41.11685*mm";
$detector{"rotation"} = "180*deg 0*deg 0*deg";
$detector{"color"} = "99CC004";
$detector{"type"} = "Cons";
$detector{"dimensions"} = "1.9982*mm 1.9983*mm 7.99124*mm 7.99125*mm 1.83685*mm 270*deg 360*deg";
$detector{"material"} = "G4_KAPTON";
$detector{"visible"} = 1;
$detector{"style"} = 1;
print_det(\%configuration, \%detector);
}
#The LH2 system is created taking into account that the outhermost kapton cone has LH2 except for the spaces which have other shapes in them or the piping. Therefore, this system shape is desinged by subtracting the solids that take up space inside the kapton cone such as the kapton cover which encloses the LD2 system as well as the first outer pipe which protrudes into the kapton layer
sub build_lH2StorageSystem #2.1
{
my %detector = init_det();
$detector{"name"} = "mykapLayer";
$detector{"mother"} = "biggestFrame";
$detector{"description"} = "The outermost cone that encapsulates the cork and the liquid duterium constructs";
$detector{"pos"} = "0*mm 0*mm 0*mm";
$detector{"rotation"} = "0*deg 0*deg 0*deg";
$detector{"color"} = "99CC00";
$detector{"type"} = "Cons";
$detector{"dimensions"} = "0*mm 7.9912*mm 0*mm 17.90045*mm 39.28*mm 270*deg 360*deg";
$detector{"material"} = "Component";
$detector{"visible"} = 0;
$detector{"style"} = 1;
print_det(\%configuration, \%detector);
%detector = init_det();
$detector{"name"} = "mykaptonCover";
$detector{"mother"} = "biggestFrame";
$detector{"description"} = "The kapton that encloses the LH2 and the foam";
$detector{"pos"} = "0*mm 0*mm 2.0293*mm";
$detector{"rotation"} = "0*deg 0*deg 0*deg";
$detector{"color"} = "B266FF";
$detector{"type"} = "Cons";
$detector{"dimensions"} = "0*mm 5.838*mm 0*mm 12.69566*mm 27.0538*mm 270*deg 360*deg";
$detector{"material"} = "Component";
$detector{"visible"} = 0;
$detector{"style"} = 1;
print_det(\%configuration, \%detector);
%detector = init_det();
$detector{"name"} = "myfirstOuterPipe";
$detector{"mother"} = "biggestFrame";
$detector{"description"} = "The pipeline touching the ld2 storage as well as the foam layer";
$detector{"pos"} = "0*mm 0*mm 45.2375*mm";
$detector{"rotation"} = "0*deg 0*deg 0*deg";
$detector{"color"} = "0FE61E3";
$detector{"type"} = "Tube";
$detector{"dimensions"} = "0*mm 14.2672*mm 23.13425*mm 270*deg 360*deg";
$detector{"material"} = "Component";
$detector{"visible"} = 1;
$detector{"style"} = 1;
print_det(\%configuration, \%detector);
%detector = init_det();
$detector{"name"} = "lh2KaptonConeA";
$detector{"mother"} = "biggestFrame";
$detector{"description"} = "Kapton Cone minus kapLayer";
$detector{"pos"} = "0*mm 0*mm 0*mm";
$detector{"rotation"} = "0*deg 0*deg 0*deg";
$detector{"color"} = "339999";
$detector{"type"} = "Operation: mykapLayer - mykaptonCover";
$detector{"dimensions"} = "0*mm";
$detector{"material"} = "Component";
$detector{"visible"} = 0;
$detector{"style"} = 1;
print_det(\%configuration, \%detector);
%detector = init_det();
$detector{"name"} = "lH2System";
$detector{"mother"} = "biggestFrame";
$detector{"description"} = "Kapton Cone - kapLayer - firstOuterPipe";
$detector{"pos"} = "0*mm 0*mm 0*mm";
$detector{"rotation"} = "180*deg 0*deg 0*deg";
$detector{"color"} = "3399994";
$detector{"type"} = "Operation: lh2KaptonConeA - myfirstOuterPipe";
$detector{"dimensions"} = "0*mm";
$detector{"material"} = "G4_lH2";
$detector{"visible"} = 1;
$detector{"style"} = 1;
print_det(\%configuration, \%detector);
}
sub build_lh2Cone #2.2
{
my %detector = init_det();
$detector{"name"} = "lh2Cone";
$detector{"mother"} = "biggestFrame";
$detector{"description"} = "the cap of the outermost cone";
$detector{"pos"} = "0*mm 0*mm 41.11685*mm";
$detector{"rotation"} = "180*deg 0*deg 0*deg";
$detector{"color"} = "99CC004";
$detector{"type"} = "Cons";
$detector{"dimensions"} = "0*mm 1.9983*mm 0*mm 7.99125*mm 1.83685*mm 270*deg 360*deg";
$detector{"material"} = "G4_lH2";
$detector{"visible"} = 1;
$detector{"style"} = 1;
print_det(\%configuration, \%detector);
}
#There is an opening in the center of the kaptonCone which is covered off by making an aluminium window
sub build_kaptonConeWindow #2.3
{
my %detector = init_det();
$detector{"name"} = "kaptonConeWindow";
$detector{"mother"} = "biggestFrame";
$detector{"description"} = "The window for the kapton cone ";
$detector{"pos"} = "0*mm 0*mm 42.9537*mm";
$detector{"rotation"} = "0*deg 0*deg 0*deg";
$detector{"color"} = "FF00003";
$detector{"type"} = "Tube";
$detector{"dimensions"} = "0.0001*mm 1.9982*mm 0.000381*mm 270*deg 360*deg";
$detector{"material"} = "G4_Al";
$detector{"visible"} = 1;
$detector{"style"} = 1;
print_det(\%configuration, \%detector);
}
#--------------------------------------------------------------------------------------------------------------------
#The LD2 Storage is the liquid duterium... very similar to teh liquid hydrogen we did above. This time the only thing inside the ld2 storage was the central pipeline so we subtracted that volume for our volume of the cone of LD2 storage and the remainder was the actual LD2 Storage amount
sub build_LD2StorageSystem #4.1
{
my %detector = init_det();
$detector{"name"} = "myld2Storage";
$detector{"mother"} = "biggestFrame";
$detector{"description"} = "the liquid duterimum";
$detector{"pos"} = "0*mm 0*mm -9.7*mm";
$detector{"rotation"} = "0*deg 0*deg 0*deg";
$detector{"color"} = "8000004";
$detector{"type"} = "Cons";
$detector{"dimensions"} = "0.001*mm 4.4162*mm 0.001*mm 10.1119*mm 20.3958*mm 270*deg 360*deg";
$detector{"material"} = "Component";
$detector{"visible"} = 1;
$detector{"style"} = 1;
print_det(\%configuration, \%detector);
%detector = init_det();
$detector{"name"} = "mycentralPipeline";
$detector{"mother"} = "biggestFrame";
$detector{"description"} = "The main pipeline going into the LD2 Storage Cone";
$detector{"pos"} = "0*mm 0*m 42.4*mm"; #-48.6557
$detector{"rotation"} = "0*deg 0*deg 0*deg";
$detector{"color"} = "CCCC003";
$detector{"type"} = "Tube";
$detector{"dimensions"} = "0.5*mm 5*mm 43.2062*mm 270*deg 360*deg";
$detector{"material"} = "Component";
$detector{"visible"} = 1;
$detector{"style"} = 1;
print_det(\%configuration, \%detector);
%detector = init_det();
$detector{"name"} = "ld2System";
$detector{"mother"} = "biggestFrame";
$detector{"description"} = "ld2 storage - space inside which isnt ld2(i.e. central pipeline)";
$detector{"pos"} = "0*mm 0*mm -10*mm";
$detector{"rotation"} = "180*deg 0*deg 0*deg";
$detector{"color"} = "3399993";
$detector{"type"} = "Operation: myld2Storage - mycentralPipeline";
$detector{"dimensions"} = "0*mm";
$detector{"material"} = "LD2";
$detector{"visible"} = 1;
$detector{"style"} = 1;
print_det(\%configuration, \%detector);
}
#This is the casing for the liquid duterium.
sub build_LD2StorageCover #4.2
{
my %detector = init_det();
$detector{"name"} = "ld2StorageCover";
$detector{"mother"} = "biggestFrame";
$detector{"description"} = "the outer casing for the whole LD2 Storage cone";
$detector{"pos"} = "0*mm 0*mm -9.7*mm";
$detector{"rotation"} = "180*deg 0*deg 0*deg";
$detector{"color"} = "0FE61E4";
$detector{"type"} = "Cons";
$detector{"dimensions"} = "4.4151*mm 4.4162*mm 5.000*mm 10.1119*mm 20.3958*mm 270*deg 360*deg";
$detector{"material"} = "G4_KAPTON";
$detector{"visible"} = 1;
$detector{"style"} = 1;
print_det(\%configuration, \%detector);
}
#This is some more liquid duterium as a cone that sits above the previous cone that we defined (LD2 Storage)
sub build_LD2Cap #5.1
{
my %detector = init_det();
$detector{"name"} = "ld2Cap";
$detector{"mother"} = "biggestFrame";
$detector{"description"} = "the cap for the LD2 storage";
$detector{"pos"} = "0*mm 0*mm 11.4715*mm";
$detector{"rotation"} = "0*deg 0*deg 0*deg";
$detector{"color"} = "8000004";
$detector{"type"} = "Cons";
$detector{"dimensions"} = "0.0001*mm 4.4162*mm 0.0001*mm 2*mm 0.85495*mm 270*deg 360*deg";
$detector{"material"} = "LD2";
$detector{"visible"} = 1;
$detector{"style"} = 1;
print_det(\%configuration, \%detector);
}
#This is the casing for the liquid duterium cone made above
sub build_LD2CapCover #5.2
{
my %detector = init_det();
$detector{"name"} = "ld2CapCover";
$detector{"mother"} = "biggestFrame";
$detector{"description"} = "The outer-copper-casing of the front cone of the LD2 Storage";
$detector{"pos"} = "0*mm 0*mm 11.4715*mm";
$detector{"rotation"} = "0*deg 0*deg 0*deg";
$detector{"color"} = "0FE61E4";
$detector{"type"} = "Cons";
$detector{"dimensions"} = "4.4161*mm 4.4162*mm 1.9*mm 2*mm 0.85495*mm 270*deg 360*deg";
$detector{"material"} = "G4_KAPTON";
$detector{"visible"} = 1;
$detector{"style"} = 1;
print_det(\%configuration, \%detector);
}
#There is an opening in the center of the ld2Cap which is covered by making a very thin aluminium window
sub build_LD2CapWindow #5.3
{
my %detector = init_det();
$detector{"name"} = "ld2CapWindow";
$detector{"mother"} = "biggestFrame";
$detector{"description"} = "The lid of the front cone of the LD2 Storage ";
$detector{"pos"} = "0*mm 0*mm 12.2645*mm";
$detector{"rotation"} = "0*deg 0*deg 0*deg";
$detector{"color"} = "FF00003";
$detector{"type"} = "Tube";
$detector{"dimensions"} = "0.0001*mm 2*mm 0.000381*mm 270*deg 360*deg";
$detector{"material"} = "G4_Al";
$detector{"visible"} = 1;
$detector{"style"} = 1;
print_det(\%configuration, \%detector);
}
#---------------------------------------------------------------------------------------------------------------------
#There are 3 pieces of foam that have been made to surround the liquid duterium shapes shown above. The 3 pieces are all identical to each
#other and were made in parts so that they could be placed with gaps between them, as per the specifications of the geometry
#The foam pieces are approximately 111 degree wide and have consistent gaps beteween them.
sub build_foamLayer1 #3.1
{
my %detector = init_det();
$detector{"name"} = "foamLayer1";
$detector{"mother"} = "biggestFrame";
$detector{"description"} = "the first foam layer approximately 111 degree wide enclosing the liquid duterium";
$detector{"pos"} = "0*mm 0*mm -4.75*mm";
$detector{"rotation"} = "180*deg 0*deg 0*deg";
$detector{"color"} = "FFFF003";
$detector{"type"} = "Cons";
$detector{"dimensions"} = "3.5422*mm 5.838*mm 10.16675*mm 12.69565*mm 24.57105*mm 214.49*deg 111.02*deg";
$detector{"material"} = "rohacell";
$detector{"visible"} = 1;
$detector{"style"} = 1;
print_det(\%configuration, \%detector);
}
sub build_foamLayer2 #3.1
{
my %detector = init_det();
$detector{"name"} = "foamLayer2";
$detector{"mother"} = "biggestFrame";
$detector{"description"} = "the second foam layer approximately 111 degree wide enclosing the liquid duterium";
$detector{"pos"} = "0*mm 0*mm -4.75*mm";
$detector{"rotation"} = "180*deg 0*deg 0*deg";
$detector{"color"} = "FFFF003";
$detector{"type"} = "Cons";
$detector{"dimensions"} = "3.5422*mm 5.838*mm 10.16675*mm 12.69565*mm 24.57105*mm 334.4855*deg 111.02*deg";
$detector{"material"} = "rohacell";
$detector{"visible"} = 1;
$detector{"style"} = 1;
print_det(\%configuration, \%detector);
}
sub build_foamLayer3 #3.1
{
my %detector = init_det();
$detector{"name"} = "foamLayer3";
$detector{"mother"} = "biggestFrame";
$detector{"description"} = "the third foam layer approximately 111 degree wide enclosing the liquid duterium ";
$detector{"pos"} = "0*mm 0*mm -4.75*mm";
$detector{"rotation"} = "180*deg 0*deg 0*deg";
$detector{"color"} = "FFFF003";
$detector{"type"} = "Cons";
$detector{"dimensions"} = "3.5422*mm 5.838*mm 10.16675*mm 12.69565*mm 24.57105*mm 454.481*deg 111.02*deg";
$detector{"material"} = "rohacell";
$detector{"visible"} = 1;
$detector{"style"} = 1;
print_det(\%configuration, \%detector);
}
#---------------------------------------------------------------------------------------------------------------------------------
#This is a kapton casing for the foam as well as the cork (the structure containing the liquid hydrogen (see above) )
sub build_kaptonCoverForFoamAndDuterium #3.1
{
my %detector = init_det();
$detector{"name"} = "kaptonCover";
$detector{"mother"} = "biggestFrame";
$detector{"description"} = "The kapton that encloses the LH2 and the foam";
$detector{"pos"} = "0*mm 0*mm -2.0293*mm";
$detector{"rotation"} = "180*deg 0*deg 0*deg";
$detector{"color"} = "B266FF3";
$detector{"type"} = "Cons";
$detector{"dimensions"} = "5.4669*mm 5.838*mm 12.69565*mm 12.69566*mm 27.0538*mm 270*deg 360*deg";
$detector{"material"} = "G4_C";
$detector{"visible"} = 1;
$detector{"style"} = 1;
print_det(\%configuration, \%detector);
}
#This is another casing for the foam only
sub build_carbonCoverForFoam #3.2
{
my %detector = init_det();
$detector{"name"} = "cabonCoverForFoam";
$detector{"mother"} = "biggestFrame";
$detector{"description"} = "A carbon cone that covers the foam";
$detector{"pos"} = "0*mm 0*mm -4.00*mm";
$detector{"rotation"} = "180*deg 0*deg 0*deg";
$detector{"color"} = "170E0E3";
$detector{"type"} = "Cons";
$detector{"dimensions"} = "5.838*mm 6.138*mm 12.69566*mm 12.99566*mm 23.7707*mm 270*deg 360*deg";
$detector{"material"} = "G4_C";
$detector{"visible"} = 1;
$detector{"style"} = 1;
print_det(\%configuration, \%detector);
}
#--------------------------------------------------------------------------------------------------------
#PLUMBING
#This is the central pipeline that extends into the liquid duterium container
sub build_centralPipeline #6.1
{
my %detector = init_det();
$detector{"name"} = "centralPipeline";
$detector{"mother"} = "biggestFrame";
$detector{"description"} = "The main pipeline going into the LD2 Storage Cone";
$detector{"pos"} = "0*mm 0*mm -52.5*mm"; #-48.6557
$detector{"rotation"} = "0*deg 0*deg 0*deg";
$detector{"color"} = "CCCC003";
$detector{"type"} = "Tube";
$detector{"dimensions"} = "2*mm 5*mm 43.2062*mm 270*deg 360*deg";
$detector{"material"} = "G4_Cu";
$detector{"visible"} = 1;
$detector{"style"} = 1;
print_det(\%configuration, \%detector);
}
#There is a hole at the front of this pipeline which is covered by making a thin aluminium window
sub build_centralPipelineWindow #6.2
{
my %detector = init_det();
$detector{"name"} = "centralPipelineWindow";
$detector{"mother"} = "biggestFrame";
$detector{"description"} = "The window for the main pipeline";
$detector{"pos"} = "0*mm 0*mm -9.154*mm";
$detector{"rotation"} = "0*deg 0*deg 0*deg";
$detector{"color"} = "FF0000";
$detector{"type"} = "Tube";
$detector{"dimensions"} = "0.00001*mm 2*mm 0.000381*mm 270*deg 360*deg";
$detector{"material"} = "G4_Al";
$detector{"visible"} = 1;
$detector{"style"} = 1;
print_det(\%configuration, \%detector);
}
#Part of this pipeline is in contact with the liquid duterium and is a smaller tube
sub build_firstOuterPipe #7.1
{
my %detector = init_det();
$detector{"name"} = "firstOuterPipe";
$detector{"mother"} = "biggestFrame";
$detector{"description"} = "The pipeline touching the ld2 storage as well as the foam layer";
$detector{"pos"} = "0*mm 0*mm -51.7953*mm";
$detector{"rotation"} = "180*deg 0*deg 0*deg";
$detector{"color"} = "0FE61E3";
$detector{"type"} = "Tube";
$detector{"dimensions"} = "5*mm 14.2672*mm 23.13425*mm 270*deg 360*deg";
$detector{"material"} = "G4_Cu";
$detector{"visible"} = 1;
$detector{"style"} = 1;
print_det(\%configuration, \%detector);
}
#This pipeline extends back from the pipeline made above and is a larger tube
sub build_secondOuterPipe #8.1
{
my %detector = init_det();
$detector{"name"} = "secondOuterPipe";
$detector{"mother"} = "biggestFrame";
$detector{"description"} = "The secondary pipeline extending the first outer pipeline";
$detector{"pos"} = "0*mm 0*mm -84.7427*mm";
$detector{"rotation"} = "180*deg 0*deg 0*deg";
$detector{"color"} = "0FE61E3";
$detector{"type"} = "Tube";
$detector{"dimensions"} = "5*mm 18.8116*mm 9.81315*mm 270*deg 360*deg";
$detector{"material"} = "G4_Cu";
$detector{"visible"} = 1;
$detector{"style"} = 1;
print_det(\%configuration, \%detector);
}
# secondOuterPipe
# ----------
# ------------------
#
# ------------------
# ---------- firstOuterPipe
#This pipeline has 4 components
#If these components are being looked at with reference to the diagram, backwards means left and forward means right
#1) This is a tube that starts at the back of the kapton Layer cone (#2.1) mentioned above and extends backwards
sub build_thirdOuterPipe #9.1
{
my %detector = init_det();
$detector{"name"} = "thirdOuterPipe";
$detector{"mother"} = "biggestFrame";
$detector{"description"} = "The secondary pipeline extending the first outer pipeline";
$detector{"pos"} = "0*mm 0*mm -47.83465*mm";
$detector{"rotation"} = "180*deg 0*deg 0*deg";
$detector{"color"} = "0FE61E3";
$detector{"type"} = "Tube";
$detector{"dimensions"} = "16.9504*mm 19.9832*mm 5.95065*mm 270*deg 360*deg";
$detector{"material"} = "G4_Cu";
$detector{"visible"} = 1;
$detector{"style"} = 1;
print_det(\%configuration, \%detector);
}
#2) This is a cone that starts at the front of the tube just made above, extends forward, and goes over the sides of the kapton layer cone
sub build_ccThirdOuterPipe #9.2
{
my %detector = init_det();
$detector{"name"} = "ccThirdOuterPipe";
$detector{"mother"} = "biggestFrame";
$detector{"description"} = "The top cone of the third outerpipe, connecting to the kapton layer";
$detector{"pos"} = "0*mm 0*mm -40.12025*mm";
$detector{"rotation"} = "0*deg 0*deg 0*deg";
$detector{"color"} = "0FE61E3";
$detector{"type"} = "Cons";
$detector{"dimensions"} = "16.9504*mm 19.9232*mm 16.9504*mm 17.9504*mm 1.76375*mm 270*deg 360*deg";
$detector{"material"} = "G4_KAPTON";
$detector{"visible"} = 1;
$detector{"style"} = 1;
print_det(\%configuration, \%detector);
}
#3) This is a cone that starts at the back of the tube #9.1 and extends backwards
sub build_cThirdOuterPipe #9.3
{
my %detector = init_det();
$detector{"name"} = "cThirdOuterPipe";
$detector{"mother"} = "biggestFrame";
$detector{"description"} = "The cone for the third outer pipe";
$detector{"pos"} = "0*mm 0*mm -57.80105*mm";
$detector{"rotation"} = "0*deg 0*deg 0*deg";
$detector{"color"} = "0FE61E3";
$detector{"type"} = "Cons";
$detector{"dimensions"} = "16.9504*mm 34.01*mm 16.9504*mm 19.9832*mm 4.01575*mm 270*deg 360*deg";
$detector{"material"} = "G4_KAPTON";
$detector{"visible"} = 1;
$detector{"style"} = 1;
print_det(\%configuration, \%detector);
}
#4) This is a tube that starts at the back of the #9.3 and extends backwards
sub build_tThirdOuterPipe #9.4
{
my %detector = init_det();
$detector{"name"} = "tThirdOuterPipe";
$detector{"mother"} = "biggestFrame";
$detector{"description"} = "The Tube (cylinder) for the third outer pipe";
$detector{"pos"} = "0*mm 0*mm -78.3168*mm";
$detector{"rotation"} = "180*deg 0*deg 0*deg";
$detector{"color"} = "0FE61E3";
$detector{"type"} = "Tube";
$detector{"dimensions"} = "16.9504*mm 34.01*mm 16.5*mm 270*deg 360*deg";
$detector{"material"} = "G4_Cu";
$detector{"visible"} = 1;
$detector{"style"} = 1;
print_det(\%configuration, \%detector);
}
#--------------------------------------------------------------------------------------------------------------------------------
#The following pipes will be providing liquid hydrogen and duterium to the storage tanks mentioned above
#Their relative positioning is identical to that of the foam mentioned above, i.e. each set of pipes is separated by 111 degrees. One set of pipes include, airCylinderVerticalTop1, pipetoLD2Top1,
#airCylinderVerticalBottom1, pipetoLD2Bottom1
#There are 3 such sets of piping just like there were three sets of foam layers
#This is the first vertical pipe that lies in a vertical plane and is connected to an outside supply of liquid duterium
sub build_airCylinderVerticalTop1 #10.1
{
my %detector = init_det();
$detector{"name"} = "airCylinderVerticalTop1";
$detector{"mother"} = "biggestFrame";
$detector{"description"} = "The cylinder from which we will feed liquid duterium";
$detector{"pos"} = "0*mm 24.4041*mm -70.89165*mm";
$detector{"rotation"} = "-90*deg 0*deg 0*deg";
$detector{"color"} = "66FFFF";
$detector{"type"} = "Tube";
$detector{"dimensions"} = "3.8635*mm 3.8735*mm 8.5188*mm 270*deg 360*deg";
$detector{"material"} = "G4_Cu";
$detector{"visible"} = 1;
$detector{"style"} = 1;
print_det(\%configuration, \%detector);
}
#This pipe connects the first vertical pipe to the kapton layer
sub build_pipeToLD2Top1 #10.2
{
my %detector = init_det();
$detector{"name"} = "pipeToLD2Top1";
$detector{"mother"} = "biggestFrame";
$detector{"description"} = "The cylinder connecting to the LD2 tank";
$detector{"pos"} = "0*mm 15.1323*mm -58.29065*mm";
$detector{"rotation"} = "0*deg 0*deg 0*deg";
$detector{"color"} = "66FFFF";
$detector{"type"} = "Tube";
$detector{"dimensions"} = "1.4090*mm 1.4091*mm 16.56905*mm 270*deg 360*deg";
$detector{"material"} = "G4_Cu";
$detector{"visible"} = 1;
$detector{"style"} = 1;
print_det(\%configuration, \%detector);
}
#This is a copy of the first vertical pipe but is slightly smaller and is situation slightly below the first vertical pipe
sub build_airCylinderVerticalBottom1 #10.3
{
my %detector = init_det();
$detector{"name"} = "airCylinderVerticalBottom1";
$detector{"mother"} = "biggestFrame";
$detector{"description"} = "Entry/Exit Point number 2 for the liquid duterium";
$detector{"pos"} = "0*mm 13.1679*mm -82.1877*mm";
$detector{"rotation"} = "-90*deg 0*deg 0*deg";
$detector{"color"} = "CC0066";
$detector{"type"} = "Tube";
$detector{"dimensions"} = "3.8735*mm 3.8736*mm 7.405*mm 270*deg 360*deg";
$detector{"material"} = "G4_Cu";
$detector{"visible"} = 1;
$detector{"style"} = 1;
print_det(\%configuration, \%detector);
}
#This pipe connects the pipe above to the liquid duterium cone
sub build_pipeToLD2Bottom1 #10.4
{
my %detector = init_det();
$detector{"name"} = "pipeToLD2Bottom1";
$detector{"mother"} = "biggestFrame";
$detector{"description"} = "The cylinder connecting the vertical pipe to the LD2 tank";
$detector{"pos"} = "0*mm 5.001*mm -57.851325*mm";
$detector{"rotation"} = "0*deg 0*deg 0*deg";
$detector{"color"} = "CC0066";
$detector{"type"} = "Tube";
$detector{"dimensions"} = "0.85*mm 0.86*mm 28.191375*mm 270*deg 360*deg";
$detector{"material"} = "G4_Cu";
$detector{"visible"} = 1;
$detector{"style"} = 1;
print_det(\%configuration, \%detector);
}
sub build_airCylinderVerticalTop2
{
my %detector = init_det();
$detector{"name"} = "airCylinderVerticalTop2";
$detector{"mother"} = "biggestFrame";
$detector{"description"} = "The cylinder from which we will feed liquid duterium";
$detector{"pos"} = "19.3958*mm -13.3958*mm -71.19065*mm";
$detector{"rotation"} = "90*deg 424.4835*deg 180*deg";
$detector{"color"} = "66FFFF";
$detector{"type"} = "Tube";
$detector{"dimensions"} = "3.8635*mm 3.8735*mm 8.5188*mm 270*deg 360*deg";
$detector{"material"} = "G4_Cu";
$detector{"visible"} = 1;
$detector{"style"} = 1;
print_det(\%configuration, \%detector);
}
sub build_pipeToLD2Top2
{
my %detector = init_det();
$detector{"name"} = "pipeToLD2Top2";
$detector{"mother"} = "biggestFrame";
$detector{"description"} = "The cylinder connecting to the LD2 tank";
$detector{"pos"} = "12*mm -8.4162*mm -58.29065*mm";
$detector{"rotation"} = "0*deg 0*deg 0*deg";
$detector{"color"} = "66FFFF";
$detector{"type"} = "Tube";
$detector{"dimensions"} = "1.4090*mm 1.4091*mm 16.56905*mm 270*deg 360*deg";
$detector{"material"} = "G4_Cu";
$detector{"visible"} = 1;
$detector{"style"} = 1;
print_det(\%configuration, \%detector);
}
sub build_airCylinderVerticalBottom2
{
my %detector = init_det();
$detector{"name"} = "airCylinderVerticalBottom2";
$detector{"mother"} = "biggestFrame";
$detector{"description"} = "Entry/Exit Point number 2 for the liquid duterium";
$detector{"pos"} = "10.0*mm -9.119*mm -82.1877*mm";
$detector{"rotation"} = "90*deg 424.4835*deg 180*deg";
$detector{"color"} = "CC0066";
$detector{"type"} = "Tube";
$detector{"dimensions"} = "3.8735*mm 3.8736*mm 7.405*mm 270*deg 360*deg";
$detector{"material"} = "G4_Cu";
$detector{"visible"} = 1;
$detector{"style"} = 1;
print_det(\%configuration, \%detector);
}
sub build_pipeToLD2Bottom2
{
my %detector = init_det();
$detector{"name"} = "pipeToLD2Bottom2";
$detector{"mother"} = "biggestFrame";
$detector{"description"} = "The cylinder connecting the vertical pipe to the LD2 tank";
$detector{"pos"} = "3.5*mm -4.5*mm -57.851352*mm";
$detector{"rotation"} = "0*deg 0*deg 0*deg";
$detector{"color"} = "CC0066";
$detector{"type"} = "Tube";
$detector{"dimensions"} = "0.85*mm 0.86*mm 28.191375*mm 270*deg 360*deg";
$detector{"material"} = "G4_Cu";
$detector{"visible"} = 1;
$detector{"style"} = 1;
print_det(\%configuration, \%detector);
}
#!!!!!--------------------THIRD FOAM LAYER------------------!!!!!!!!!!!!!!!!!!!!!!!!!!1
sub build_airCylinderVerticalTop3
{
my %detector = init_det();
$detector{"name"} = "airCylinderVerticalTop3";
$detector{"mother"} = "biggestFrame";
$detector{"description"} = "The cylinder from which we will feed liquid duterium";
$detector{"pos"} = "-19.3958*mm -13.6958*mm -71.19055*mm";
$detector{"rotation"} = "90*deg 300.4835*deg 180*deg";
$detector{"color"} = "66FFFF";
$detector{"type"} = "Tube";
$detector{"dimensions"} = "3.8635*mm 3.8735*mm 8.5188*mm 270*deg 360*deg";
$detector{"material"} = "G4_Cu";
$detector{"visible"} = 1;
$detector{"style"} = 1;
print_det(\%configuration, \%detector);
}
sub build_pipeToLD2Top3
{
my %detector = init_det();
$detector{"name"} = "pipeToLD2Top3";
$detector{"mother"} = "biggestFrame";
$detector{"description"} = "The cylinder connecting to the LD2 tank";
$detector{"pos"} = "-12.5*mm -8.9162*mm -58.29065*mm";
$detector{"rotation"} = "0*deg 0*deg 0*deg";
$detector{"color"} = "66FFFF";
$detector{"type"} = "Tube";
$detector{"dimensions"} = "1.4090*mm 1.4091*mm 16.56905*mm 270*deg 360*deg";
$detector{"material"} = "G4_Cu";
$detector{"visible"} = 1;
$detector{"style"} = 1;
print_det(\%configuration, \%detector);
}
sub build_airCylinderVerticalBottom3
{
my %detector = init_det();
$detector{"name"} = "airCylinderVerticalBottom3";
$detector{"mother"} = "biggestFrame";
$detector{"description"} = "Entry/Exit Point number 2 for the liquid duterium";
$detector{"pos"} = "-10.0*mm -8.119*mm -82.1877*mm";
$detector{"rotation"} = "90*deg 300.4835*deg 180*deg";
$detector{"color"} = "CC0066";
$detector{"type"} = "Tube";
$detector{"dimensions"} = "3.8735*mm 3.8736*mm 7.405*mm 270*deg 360*deg";
$detector{"material"} = "G4_Cu";
$detector{"visible"} = 1;
$detector{"style"} = 1;
print_det(\%configuration, \%detector);
}
sub build_pipeToLD2Bottom3
{
my %detector = init_det();
$detector{"name"} = "pipeToLD2Bottom3";
$detector{"mother"} = "biggestFrame";
$detector{"description"} = "The cylinder connecting the vertical pipe to the LD2 tank";
$detector{"pos"} = "-3.5*mm -4.5*mm -57.851325*mm";
$detector{"rotation"} = "0*deg 0*deg 0*deg";
$detector{"color"} = "CC0066";
$detector{"type"} = "Tube";
$detector{"dimensions"} = "0.85*mm 0.86*mm 28.191375*mm 270*deg 360*deg";
$detector{"material"} = "G4_Cu";
$detector{"visible"} = 1;
$detector{"style"} = 1;
print_det(\%configuration, \%detector);
}
#This is the largest cylinder that encloses everything
sub build_finalTube #11.1
{
my %detector = init_det();
$detector{"name"} = "finalTube";
$detector{"mother"} = "biggestFrame";
$detector{"description"} = "The final tube that encloses everything ";
$detector{"pos"} = "0*mm 0*mm -30.6043*mm";
$detector{"rotation"} = "0*deg 0*deg 0*deg";
$detector{"color"} = "FF99993";
$detector{"type"} = "Tube";
$detector{"dimensions"} = "43.6533*mm 50.0033*mm 64.09025*mm 270*deg 360*deg";
$detector{"material"} = "G4_Cu";
$detector{"visible"} = 1;
$detector{"style"} = 1;
print_det(\%configuration, \%detector);
}
#This is the cap of the largest cylinder and is made of multiple shapes as will be shown below
sub build_topCap #11.2
{
#We make a cone that we will subtract from the volume to get a cone like crater
my %detector = init_det();
$detector{"name"} = "emptyCone";
$detector{"mother"} = "biggestFrame";
$detector{"description"} = "The cone shaped crater made inside the shell";
$detector{"pos"} = "0*mm 50.96835*mm 0*mm";
$detector{"rotation"} = "-270*deg 0*deg 0*deg";
$detector{"color"} = "8800003";
$detector{"type"} = "Cons";
$detector{"dimensions"} = "0*cm 3.7059*mm 0*cm 4.49185*mm 8.91505*mm 270*deg 360*deg";
$detector{"material"} = "Component";
$detector{"visible"} = 0;
$detector{"style"} = 1;
print_det(\%configuration, \%detector);
#We make a cylindrical volume which acts like a nozel to the cap
%detector = init_det();
$detector{"name"} = "outsideProngs";
$detector{"mother"} = "biggestFrame";
$detector{"description"} = "The cylinder that is going to extend from the shell";
$detector{"pos"} = "0*mm 50.96835*mm 0*mm";
$detector{"rotation"} = "-90*deg 0*deg 0*deg";
$detector{"color"} = "4400193";
$detector{"type"} = "Tube";
$detector{"dimensions"} = "0*mm 9.52455*mm 8.31505*mm 0*deg 360*deg";
$detector{"material"} = "Component";
$detector{"visible"} = 0;
$detector{"style"} = 1;
print_det(\%configuration, \%detector);
#We make a hemisphere that is the bulk of the cap
%detector = init_det();
$detector{"name"} = "shell";
$detector{"mother"} = "biggestFrame";
$detector{"description"} = "The shell which acts like the cap for the cylinder";
$detector{"pos"} = "0*mm 0*mm 0*mm";
$detector{"rotation"} = "-90*deg 0*deg 0*deg";
$detector{"color"} = "4400193";
$detector{"type"} = "Sphere";
$detector{"dimensions"} = "43.6533*mm 50.0033*mm 0*deg 180*deg 0*deg 180*deg";
$detector{"material"} = "Component";