-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcompton_LHe_cryo_kapton_materials.pl
86 lines (75 loc) · 2.62 KB
/
compton_LHe_cryo_kapton_materials.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
#!/usr/bin/perl -w
###################################################################
# This script defines all materials used in the SoLID simulation. #
# If a new material is added, please specify your name, date and #
# the purpose of adding this. Please make sure all materials #
# have their names started with SL_mrpc_* #
#
# Note: G4_* are for materials, so use percentage
# For components,like C9H10, use the element "C" but not "G4_C"
# #
# -- Zhihong Ye, [email protected], 06/12/2014 #
###################################################################
############
#Note:
# (0) Define your new material in the section it belongs to,
# DO-NOT just simply add it to the end of the file.
# Put your name and date near where you define your new items.
# (1) Pay attention to the density unit, which should be g/cm3
# (2) For elements, they should be like "He","C", ...
# For materials, they should be like "G4_He", "G4_C"
# (3) "SL_mrpc_NewMaterial" is the newly defined material for SoLID
# (4) If the new material is composed of elements,
# use "integer" to define the number of elements,
# e.g "H 2 O 1"
# (5) If the new material is mixers of other materials,
# use "mass fraction" to define the components,
# e.g. "G4_Si 0.70 G4_O 0.30"
# (6) When you define a new material mixed by other materials,
# pay attention to how they are mixed,
# e.g. by "mass fraction" or by "mole fraction" or volumn etc.
#
use strict;
use lib ("$ENV{GEMC}/io");
use utils;
use materials;
# Help Message
sub help()
{
print "\n Usage: \n";
print " this_script.pl <configuration filename>\n";
print " Will create materials used in SoLID\n";
exit;
}
# Make sure the argument list is correct
# If not pring the help
if( scalar @ARGV != 1)
{
help();
exit;
}
# Loading configuration file from argument
our %configuration = load_configuration($ARGV[0]);
sub define_material
{
my %mat;
#unpol LHe target (full)
#4He
%mat = init_mat();
$mat{"name"} = "He4_liquid";
$mat{"description"} = "He4_liquid";
$mat{"density"} = "0.137"; #in g/cm3
$mat{"ncomponents"} = "1";
$mat{"components"} = "G4_He 1";
print_mat(\%configuration, \%mat);
#unpol LHe target (empty)
#4He
%mat = init_mat();
$mat{"name"} = "He4_gas";
$mat{"description"} = "He4_gas";
$mat{"density"} = "0.0025"; #in g/cm3
$mat{"ncomponents"} = "1";
$mat{"components"} = "G4_He 1";
print_mat(\%configuration, \%mat);
}
define_material();