print_dune_gdml.pl
Go to the documentation of this file.
1 #!/usr/bin/perl
2 
3  $RockMaterial="ShotRock"; # current options: "Granite", "Dirt", "ShotRock"
4 
5  $DetectorWidth=1900;
6  $DetectorHeight=1700;
7  $DetectorLength=8900;
8  $CavernWidth=$DetectorWidth+2*$TotalPadding;
9  $CavernHeight=$DetectorHeight+$TotalPadding;
10  $CavernLength=$DetectorLength+2*$TotalPadding;
11  $RockThickness=2000;
12  $ConcretePadding=50;
13  $GlassFoamPadding=100;
14  $TotalPadding=$ConcretePadding+$GlassFoamPadding;
15 
16 
17 $GDML = "dune.gdml";
18 $GDML = ">" . $GDML;
19 open(GDML) or die("Could not open file $GDML for writing");
20 
21 print GDML <<EOF;
22 <?xml version="1.0" encoding="UTF-8" ?>
23 <gdml xmlns:gdml="http://cern.ch/2001/Schemas/GDML"
24  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
25  xsi:noNamespaceSchemaLocation="GDMLSchema/gdml.xsd">
26 <define>
27  <constant name="kInch" value="2.54" />
28  <constant name="kPi" value="3.14159265358979" />
29  <constant name="kSteelThickness" value="0.5*kInch" />
30 </define>
31 
32 <materials>
33  <element name="videRef" formula="VACUUM" Z="1"> <atom value="1"/> </element>
34  <element name="bromine" formula="Br" Z="35"> <atom value="79.904"/> </element>
35  <element name="hydrogen" formula="H" Z="1"> <atom value="1.0079"/> </element>
36  <element name="nitrogen" formula="N" Z="7"> <atom value="14.0067"/> </element>
37  <element name="oxygen" formula="O" Z="8"> <atom value="15.999"/> </element>
38  <element name="aluminum" formula="Al" Z="13"> <atom value="26.9815"/> </element>
39  <element name="silicon" formula="Si" Z="14"> <atom value="28.0855"/> </element>
40  <element name="carbon" formula="C" Z="6"> <atom value="12.0107"/> </element>
41  <element name="potassium" formula="K" Z="19"> <atom value="39.0983"/> </element>
42  <element name="chromium" formula="Cr" Z="24"> <atom value="51.9961"/> </element>
43  <element name="iron" formula="Fe" Z="26"> <atom value="55.8450"/> </element>
44  <element name="nickel" formula="Ni" Z="28"> <atom value="58.6934"/> </element>
45  <element name="calcium" formula="Ca" Z="20"> <atom value="40.078"/> </element>
46  <element name="magnesium" formula="Mg" Z="12"> <atom value="24.305"/> </element>
47  <element name="sodium" formula="Na" Z="11"> <atom value="22.99"/> </element>
48  <element name="titanium" formula="Ti" Z="22"> <atom value="47.867"/> </element>
49  <element name="argon" formula="Ar" Z="18"> <atom value="39.9480"/> </element>
50 
51  <material name="Vacuum" formula="Vacuum">
52  <D value="1.e-25" unit="g/cm3"/>
53  <fraction n="1.0" ref="videRef"/>
54  </material>
55 
56  <material name="ALUMINUM_Al" formula="ALUMINUM_Al">
57  <D value="2.6990" unit="g/cm3"/>
58  <fraction n="1.0000" ref="aluminum"/>
59  </material>
60 
61  <material name="SILICON_Si" formula="SILICON_Si">
62  <D value="2.3300" unit="g/cm3"/>
63  <fraction n="1.0000" ref="silicon"/>
64  </material>
65 
66  <material name="epoxy_resin" formula="C38H40O6Br4">
67  <D value="1.1250" unit="g/cm3"/>
68  <composite n="38" ref="carbon"/>
69  <composite n="40" ref="hydrogen"/>
70  <composite n="6" ref="oxygen"/>
71  <composite n="4" ref="bromine"/>
72  </material>
73 
74  <material name="SiO2" formula="SiO2">
75  <D value="2.2" unit="g/cm3"/>
76  <composite n="1" ref="silicon"/>
77  <composite n="2" ref="oxygen"/>
78  </material>
79 
80  <material name="Al2O3" formula="Al2O3">
81  <D value="3.97" unit="g/cm3"/>
82  <composite n="2" ref="aluminum"/>
83  <composite n="3" ref="oxygen"/>
84  </material>
85 
86  <material name="Fe2O3" formula="Fe2O3">
87  <D value="5.24" unit="g/cm3"/>
88  <composite n="2" ref="iron"/>
89  <composite n="3" ref="oxygen"/>
90  </material>
91 
92  <material name="CaO" formula="CaO">
93  <D value="3.35" unit="g/cm3"/>
94  <composite n="1" ref="calcium"/>
95  <composite n="1" ref="oxygen"/>
96  </material>
97 
98  <material name="MgO" formula="MgO">
99  <D value="3.58" unit="g/cm3"/>
100  <composite n="1" ref="magnesium"/>
101  <composite n="1" ref="oxygen"/>
102  </material>
103 
104  <material name="Na2O" formula="Na2O">
105  <D value="2.27" unit="g/cm3"/>
106  <composite n="2" ref="sodium"/>
107  <composite n="1" ref="oxygen"/>
108  </material>
109 
110  <material name="TiO2" formula="TiO2">
111  <D value="4.23" unit="g/cm3"/>
112  <composite n="1" ref="titanium"/>
113  <composite n="2" ref="oxygen"/>
114  </material>
115 
116  <material name="fibrous_glass">
117  <D value="2.74351" unit="g/cm3"/>
118  <fraction n="0.600" ref="SiO2"/>
119  <fraction n="0.118" ref="Al2O3"/>
120  <fraction n="0.001" ref="Fe2O3"/>
121  <fraction n="0.224" ref="CaO"/>
122  <fraction n="0.034" ref="MgO"/>
123  <fraction n="0.010" ref="Na2O"/>
124  <fraction n="0.013" ref="TiO2"/>
125  </material>
126 
127  <material name="FR4">
128  <D value="1.98281" unit="g/cm3"/>
129  <fraction n="0.47" ref="epoxy_resin"/>
130  <fraction n="0.53" ref="fibrous_glass"/>
131  </material>
132 
133  <material name="STEEL_STAINLESS_Fe7Cr2Ni" formula="STEEL_STAINLESS_Fe7Cr2Ni">
134  <D value="7.9300" unit="g/cm3"/>
135  <fraction n="0.0010" ref="carbon"/>
136  <fraction n="0.1800" ref="chromium"/>
137  <fraction n="0.7298" ref="iron"/>
138  <fraction n="0.0900" ref="nickel"/>
139  </material>
140 
141  <material name="LAr" formula="LAr">
142  <D value="1.40" unit="g/cm3"/>
143  <fraction n="1.0000" ref="argon"/>
144  </material>
145 
146  <material formula=" " name="Air">
147  <D value="0.001205" unit="g/cm3"/>
148  <fraction n="0.78084" ref="nitrogen"/>
149  <fraction n="0.209476" ref="oxygen"/>
150  <fraction n="0.00934" ref="argon"/>
151  </material>
152 
153  <material formula=" " name="G10">
154  <D value="1.7" unit="g/cm3"/>
155  <fraction n="0.2805" ref="silicon"/>
156  <fraction n="0.3954" ref="oxygen"/>
157  <fraction n="0.2990" ref="carbon"/>
158  <fraction n="0.0251" ref="hydrogen"/>
159  </material>
160 
161  <material formula=" " name="Granite">
162  <D value="2.7" unit="g/cm3"/>
163  <fraction n="0.438" ref="oxygen"/>
164  <fraction n="0.257" ref="silicon"/>
165  <fraction n="0.222" ref="sodium"/>
166  <fraction n="0.049" ref="aluminum"/>
167  <fraction n="0.019" ref="iron"/>
168  <fraction n="0.015" ref="potassium"/>
169  </material>
170 
171  <material formula=" " name="ShotRock">
172  <D value="2.7*0.6" unit="g/cm3"/>
173  <fraction n="0.438" ref="oxygen"/>
174  <fraction n="0.257" ref="silicon"/>
175  <fraction n="0.222" ref="sodium"/>
176  <fraction n="0.049" ref="aluminum"/>
177  <fraction n="0.019" ref="iron"/>
178  <fraction n="0.015" ref="potassium"/>
179  </material>
180 
181  <material formula=" " name="Dirt">
182  <D value="1.7" unit="g/cm3"/>
183  <fraction n="0.438" ref="oxygen"/>
184  <fraction n="0.257" ref="silicon"/>
185  <fraction n="0.222" ref="sodium"/>
186  <fraction n="0.049" ref="aluminum"/>
187  <fraction n="0.019" ref="iron"/>
188  <fraction n="0.015" ref="potassium"/>
189  </material>
190 
191  <material formula=" " name="Concrete">
192  <D value="2.3" unit="g/cm3"/>
193  <fraction n="0.530" ref="oxygen"/>
194  <fraction n="0.335" ref="silicon"/>
195  <fraction n="0.060" ref="calcium"/>
196  <fraction n="0.015" ref="sodium"/>
197  <fraction n="0.020" ref="iron"/>
198  <fraction n="0.040" ref="aluminum"/>
199  </material>
200 
201  <material formula="H2O" name="Water">
202  <D value="1.0" unit="g/cm3"/>
203  <fraction n="0.1119" ref="hydrogen"/>
204  <fraction n="0.8881" ref="oxygen"/>
205  </material>
206 
207  <material formula="Ti" name="Titanium">
208  <D value="4.506" unit="g/cm3"/>
209  <fraction n="1." ref="titanium"/>
210  </material>
211 
212  <material name="TPB" formula="TPB">
213  <D value="1.40" unit="g/cm3"/>
214  <fraction n="1.0000" ref="argon"/>
215  </material>
216 
217  <material name="Glass">
218  <D value="2.74351" unit="g/cm3"/>
219  <fraction n="0.600" ref="SiO2"/>
220  <fraction n="0.118" ref="Al2O3"/>
221  <fraction n="0.001" ref="Fe2O3"/>
222  <fraction n="0.224" ref="CaO"/>
223  <fraction n="0.034" ref="MgO"/>
224  <fraction n="0.010" ref="Na2O"/>
225  <fraction n="0.013" ref="TiO2"/>
226  </material>
227 
228  <material name="Acrylic">
229  <D value="1.19" unit="g/cm3"/>
230  <fraction n="0.600" ref="carbon"/>
231  <fraction n="0.320" ref="oxygen"/>
232  <fraction n="0.080" ref="hydrogen"/>
233  </material>
234 </materials>
235 
236 <solids>
237  <box name="World" lunit="cm"
238  x="$CavernWidth+$RockThickness"
239  y="$CavernHeight+$RockThickness"
240  z="$CavernLength+$RockThickness"/>
241  <box name="Rock" lunit="cm"
242  x="$CavernWidth+$RockThickness"
243  y="$CavernHeight+$RockThickness"
244  z="$CavernLength+$RockThickness"/>
245  <box name="RockBottom" lunit="cm"
246  x="$CavernWidth"
247  y="$RockThickness"
248  z="$CavernLength"/>
249  <box name="Cavern" lunit="cm"
250  x="$CavernWidth"
251  y="$CavernHeight+2*$RockThickness+100"
252  z="$CavernLength"/>
253  <subtraction name="RockWithCavern">
254  <first ref="Rock"/>
255  <second ref="Cavern"/>
256  </subtraction>
257  <box name="Concrete" lunit="cm"
258  x="1900"
259  y="1700"
260  z="8900"/>
261  <box name="ConcreteBottom" lunit="cm"
262  x="1850"
263  y="50"
264  z="8850"/>
265  <box name="ConcreteCavern" lunit="cm"
266  x="1850"
267  y="1800"
268  z="8850"/>
269  <subtraction name="ConcreteWithCavern">
270  <first ref="Concrete"/>
271  <second ref="ConcreteCavern"/>
272  </subtraction>
273  <box name="SteelBox" lunit="cm"
274  x="1900-2*(150)"
275  y="1600"
276  z="8900-2*(150)"/>
277  <box name="ArgonInterior" lunit="cm"
278  x="1900-2*150-kSteelThickness"
279  y="1600-kSteelThickness"
280  z="1700-2*150-kSteelThickness"/>
281  <subtraction name="CryostatSteelShell">
282  <first ref="SteelBox"/>
283  <second ref="ArgonInterior"/>
284  </subtraction>
285 </solids>
286 
287 <structure>
288  <volume name="volArgonInterior">
289  <materialref ref="LAr" />
290  <solidref ref="ArgonInterior" />
291  </volume>
292  <volume name="volCryostatSteelShell">
293  <materialref ref="STEEL_STAINLESS_Fe7Cr2Ni" />
294  <solidref ref="CryostatSteelShell" />
295  </volume>
296  <volume name="volConcreteWithCavern">
297  <materialref ref="Concrete" />
298  <solidref ref="ConcreteWithCavern" />
299  </volume>
300  <volume name="volConcreteBottom">
301  <materialref ref="Concrete" />
302  <solidref ref="ConcreteBottom" />
303  </volume>
304  <volume name="volRockWithCavern">
305  <materialref ref="$RockMaterial" />
306  <solidref ref="RockWithCavern" />
307  </volume>
308  <volume name="volRockBottom">
309  <materialref ref="$RockMaterial" />
310  <solidref ref="RockBottom" />
311  </volume>
312  <volume name="volWorld" >
313  <materialref ref="Air"/>
314  <solidref ref="World"/>
315  <physvol>
316  <volumeref ref="volCryostatSteelShell"/>
317  <position name="posCryostatSteelShell" unit="cm" x="0" y="250+(1550/2)" z="0"/>
318  </physvol>
319  <physvol>
320  <volumeref ref="volArgonInterior"/>
321  <position name="posArgonInterior" unit="cm" x="0" y="250+(1550/2)" z="0"/>
322  </physvol>
323  <physvol>
324  <volumeref ref="volConcreteWithCavern"/>
325  <position name="posConcreteWithCavern" unit="cm" x="0" y="150+(1700/2)" z="0"/>
326  </physvol>
327  <physvol>
328  <volumeref ref="volConcreteBottom"/>
329  <position name="posConcreteWithCavern" unit="cm" x="0" y="150+(50/2)" z="0"/>
330  </physvol>
331  <physvol>
332  <volumeref ref="volRockWithCavern"/>
333  <position name="posRockWithCavern" unit="cm" x="0" y="0" z="0"/>
334  </physvol>
335  <physvol>
336  <volumeref ref="volRockBottom"/>
337  <position name="posRockBottom" unit="cm" x="0" y="-850" z="0"/>
338  </physvol>
339  <physvol>
340  <volumeref ref="volRockWithCavern"/>
341  <position name="posRockWithCavern" unit="cm" x="0" y="0" z="0"/>
342  </physvol>
343  <physvol>
344  <volumeref ref="volRockBottom"/>
345  <position name="posRockBottom" unit="cm" x="0" y="-850" z="0"/>
346  </physvol>
347  </volume>
348 </structure>
349 
350 <setup name="Default" version="1.0">
351  <world ref="volWorld" />
352 </setup>
353 
354 </gdml>
355 
356 EOF