1 '''Generate the GDML for the SBND CRT geometry.
3 We define a global XML DOM which the function for each volume will append to.
4 Volume-building functions are called hierarchically, so if you call module(),
5 it will construct the module and all the parts that make it up, so you end
6 up with complete GDML for one module.
8 Each physical volume has a corresponding unique logical volume, as required
9 by LArG4 to keep track of energy depositions. The solids, however, can safely
10 be referenced many times, and so are stored only once (using a hash keyed on
11 the the linear dimensions).
13 The output of this code is a file "crt.gdml" which contains the GDML snippets
14 to paste into the full SBND geometry.
16 Created by A. Mastbaum <mastbaum@uchicago.edu>, 2016/10/27
17 Downloaded by C. Hilgenberg <Chris.Hilgenberg@colostate.edu> 2017/10/25
18 Modified by C. Hilgenberg 2017/10/26
23 import xml.etree.cElementTree
as ET
24 from xml.dom
import minidom
36 WVFOOTELEVATION = 10.16
42 TOPLEDGERISERTOFLOOR = 991.9
43 LEDGERISERHEIGTH = 46.99
44 TOPCRTBEAMTOFLOOR = 970.8
45 CRTBEAMSPACING = 92.71
47 BOTTOMCRTROLLERHEIGHT = 3.02
48 SIDECRTWVOFFSET = 4.13
49 SIDECRTPOSTWIDTH = 4.13
50 SIDECRTPOSTSPACING = 4.13
51 SIDECRTSTACKDEPTH = 3*SIDECRTPOSTWIDTH + 2*SIDECRTPOSTSPACING
52 SIDECRTSHELFTHICK = 0.56
59 separatetwomodule = 0.6
61 offsetontopmodule = 48.26
62 verticalmodule = 485.14
68 CRTBEAMLENGTH = 1132.84
71 CRTBEAMFLANGETHICK = 1.434
72 CRTBEAMWEBTHICK = 0.89407
79 MINOSSTRAIGHTSNOUT = 37.5
81 MINOSSNOUTLENGTH = 0.5*(MINOSSTRAIGHTSNOUT+MINOSBENDSNOUT)
106 mModL = ZM+2*PADM+2*PADStrip
107 mModW = YM*NXM+2*PADM+(NXM+1)*PADStrip
108 mModH = XM+2*PADM+2*PADStrip
109 cModW = XC*NXC+2*PADC+(NXC+1)*PADStrip
110 cModH = YCTOP+YCBOT+2*PADC+3*PADStrip
111 dModH = YD*2+2*PADD+3*PADStrip
117 SLIDERSPACE = 18.5+mModH
119 SIDECRTROLLOFFSET = 44.29
120 SIDECRTNORTHWALLTOFLOOR = 152.2
121 SIDECRTSOUTHWALLLATOFFSET = 1.1*MINOSSNOUTLENGTH
125 LONGOFF5=(3*ISLANDWIDTH+481.8)*0.5+181.8
126 LONGOFF2= (ISLANDWIDTH+181.8)*0.5
134 SLOPEINCLINATION=90.0
135 CERNROOFL = NTOPZ*cModW+(NTOPZ-1)*CERNMODSPACE
138 SHELLY = 1.1*cModH+TOPCRTBEAMTOFLOOR-BOTTOMCRTROLLERHEIGHT*0.9
140 MINOSSOUTHY = -0.5*SHELLY+0.5*(NMODSTACKSOUTHY*mModW+(NMODSTACKSOUTHY-1)*SIDECRTSHELFTHICK+2*PADTagger)+WVFOOTELEVATION
141 MINOSLATFIXY = MINOSSOUTHY
142 MINOSLATROLLY = MINOSLATFIXY-0.5*mModW+10
143 MINOSLATSOUTHACTIVEOVERHANG = 2*MINOSSNOUTLENGTH
144 MINOSLATSOUTHZ = -0.5*WVLENGTH + 0.5*mModL - 0.5*MINOSLATSOUTHACTIVEOVERHANG
145 MINOSLATNORTHZ = 0.5*WVLENGTH - 0.5*mModL
146 MINOSLATCENTZ = 0.5*(-0.5*MINOSLATSOUTHACTIVEOVERHANG+MINOSLATSOUTHZ+MINOSLATNORTHZ)
149 posDCInDetEncl = (0,-480.135, 0)
152 CERNRIMSWVOFFSET = 34.0
153 CERNTOPY = SHELLY*0.5 - 0.6*cModH
154 CERNRIMSY = CERNTOPY - 0.5*cModH - CRTBEAMHEIGHT - 2.54 - 0.5*cModW
155 CERNRIMSZ = -0.5*WVLENGTH - CERNRIMSWVOFFSET
156 CERNRIMNY = CERNRIMSY + 29.0
157 CERNRIMNZ = CERNROOFL + CERNRIMSZ + 0.6*cModH + CRTBEAMSPACING
158 CERNTOPZ = CERNRIMSZ + 0.5*CERNROOFL
159 CERNRIMLATX = 0.5*WVWIDTH + 0.5*cModH + 38.0
160 CERNRIMLATY = CERNRIMSY
161 CERNRIMLATZ = CERNTOPZ
164 SHELLZ = 1.01*(0.5*cModH+CERNRIMNZ-min(CERNRIMSZ+0.5*cModH,MINOSLATSOUTHZ-(mModL+MINOSLATSOUTHACTIVEOVERHANG+SIDECRTSOUTHWALLLATOFFSET)*0.5))
165 SHELLWVOFFSET = SHELLZ*0.5/1.01 - WVLENGTH*0.5
166 if CERNRIMSZ+0.5*cModH < MINOSLATSOUTHZ-(mModL+MINOSLATSOUTHACTIVEOVERHANG+SIDECRTSOUTHWALLLATOFFSET)*0.5:
167 SHELLWVOFFSET-= CERNRIMSWVOFFSET
169 SHELLWVOFFSET-= MINOSLATSOUTHACTIVEOVERHANG
173 minosCutModLengthNorth = (256.54, 309.9, 309.9, 508.19, 508.19, 508.19)
174 minosCutModLengthSoutheast = (497.84, 497.84, 497.84, 497.84, 497.84, 497.84, 497.84, 497.84, 497.84)
175 minosCutModLengthSouthwest = (497.84, 497.84, 497.84, 497.84, 497.84, 497.84, 325.12, 325.12, 325.12)
176 MINOSNORTHY = -0.5*SHELLY+0.5*(len(minosCutModLengthNorth)*mModW+(len(minosCutModLengthNorth)-1)*SIDECRTSHELFTHICK+2*PADTagger)-PADTagger+SIDECRTNORTHWALLTOFLOOR-BOTTOMCRTROLLERHEIGHT*0.9
180 gdml = ET.Element(
'gdml')
181 if testmode: materials = ET.SubElement(gdml,
'materials')
182 solids = ET.SubElement(gdml,
'solids')
183 structure = ET.SubElement(gdml,
'structure')
213 '''build one wide flange beam for top CRT support'''
218 xx = str(CRTBEAMWIDTH)
219 yy = str(CRTBEAMHEIGHT)
220 zz = str(CRTBEAMLENGTH)
221 xxsub = str(0.5*(CRTBEAMWIDTH-CRTBEAMWEBTHICK))
222 yysub = str(CRTBEAMHEIGHT-2*CRTBEAMFLANGETHICK)
224 xsubpos = 0.5*(CRTBEAMWIDTH-0.5*(CRTBEAMWIDTH-CRTBEAMWEBTHICK))
225 area = CRTBEAMWIDTH*CRTBEAMHEIGHT-(CRTBEAMWIDTH-CRTBEAMWEBTHICK)*(CRTBEAMHEIGHT-2*CRTBEAMFLANGETHICK)
226 if beam_id==1:
print(
'modeled - true beam areas (cm^2): '+str(area-92.90304))
228 sname =
'TopCRTSupportBeam'
229 vname =
'vol'+sname+
'_'+str(beam_id)
231 if not sname
in solids_store:
232 snameext = sname+
'_external'
233 snameint = sname+
'_internal'
234 snamesub = sname+
'_firstsubtraction'
235 sexternal= ET.SubElement(solids,
'box', name=snameext, lunit=
"cm", x=xx, y=yy, z=zz)
236 sinternal = ET.SubElement(solids,
'box', name=snameint, lunit=
"cm", x=xxsub, y=yysub, z=zzsub)
237 ssub = ET.SubElement(solids,
'subtraction', name=snamesub)
239 ET.SubElement(ssub,
'first', ref=snameext)
240 ET.SubElement(ssub,
'second', ref=snameint)
241 ET.SubElement(ssub,
'position', name=
'beamsubpos1', unit=
'cm', x=str(xsubpos), y=
'0', z=
'0')
242 s = ET.SubElement(solids,
'subtraction', name=sname)
243 ET.SubElement(s,
'first', ref=snamesub)
244 ET.SubElement(s,
'second', ref=snameint)
245 ET.SubElement(s,
'position', name=
'beamsubpos2', unit=
'cm', x=str(-1*xsubpos), y=
'0', z=
'0')
246 solids_store[sname] = s
249 s = solids_store[sname]
251 v = ET.SubElement(structure,
'volume', name=vname)
252 ET.SubElement(v,
'materialref', ref=
'STEEL_A992')
253 ET.SubElement(v,
'solidref', ref=sname)
261 xx = str(CRTBEAMLENGTH+padding)
262 yy = str(CRTBEAMHEIGHT+padding)
263 zz = (nbeam-1)*CRTBEAMSPACING+CRTBEAMWIDTH+padding
265 sname =
'TopCRTSupportBeamEnclosure'
269 for i
in range(nbeam):
272 s = ET.SubElement(solids,
'box', name=sname, lunit=
"cm", x=xx, y=yy, z=str(zz))
273 v = ET.SubElement(structure,
'volume', name=vname)
274 ET.SubElement(v,
'materialref', ref=
'Air')
275 ET.SubElement(v,
'solidref', ref=sname)
277 for i, (sbeam,vbeam)
in enumerate(beams):
279 pv = ET.SubElement(v,
'physvol')
280 ET.SubElement(pv,
'volumeref', ref=vbeam.attrib[
'name'])
282 dz = str(0.5*(padding-zz+CRTBEAMWIDTH) + i*CRTBEAMSPACING)
284 posname =
'pos' + vbeam.attrib[
'name']
285 ET.SubElement(pv,
'position', name=posname,unit=
"cm", x=
'0', y=
'0', z=dz)
286 posname =
'rot' + vbeam.attrib[
'name']
287 ET.SubElement(pv,
'rotation', name=posname, unit=
"deg", x=
'0', y=
'90', z=
'0')
292 def strip(style="m", modnum=0, stripnum=0, length=0):
293 '''Build one scintillator strip.'''
321 sname =
'AuxDetSensitive_' + name
322 vname =
'volAuxDetSensitive_' + name +
'_module_'
329 vname += str(modnum)+
'_'
330 if style==
'm' and length!=0:
331 sname+=
'_cut'+str(int(length))+
'_'
332 vname+=
'cut'+str(int(length))+
'_'
345 vname += str(stripnum)
347 if not sname
in solids_store:
348 s = ET.SubElement(solids,
'box', name=sname, lunit=
"cm", x=xx, y=yy, z=zz)
349 solids_store[sname] = s
352 s = solids_store[sname]
355 v = ET.SubElement(structure,
'volume', name=vname)
356 ET.SubElement(v,
'materialref', ref=
'Polystyrene')
357 ET.SubElement(v,
'solidref', ref=sname)
363 def module(style="c", reg='tt', length=0):
364 '''Build an edge-to-edge array of scintillator strips.'''
373 zzsub = str(mModL-2*PADM)
376 print(
'WARNING: LENGTH SPECIFIED FOR CUT MINOS MODULE EXCEEDES FULL LENGTH!')
378 zz = str(mModL-ZM+length)
379 zzsub = str(mModL-2*PADM-ZM+length)
382 xxsub = str(mModH-2*PADM)
383 yysub = str(mModW-2*PADM)
393 xxsub = str(cModW - 2*PADC)
394 yysub = str(cModH-2*PADC)
403 xx = str(x*(ny+0.5)+2*PADD+(ny+2)*PADStrip)
405 zz = str(z+2*PADD+2*PADStrip)
406 xxsub = str(x*(ny+0.5)+(ny+2)*PADStrip)
407 yysub = str(dModH-2*PADM)
408 zzsub = str(z+2*PADStrip)
414 sname =
'AuxDet_' + name +
'_module_'
415 vname =
'vol' + sname
421 vname += str(modnum)+
'_'
423 if style==
'm' and length!=0:
424 sname +=
'cut'+str(int(length))
425 vname +=
'cut'+str(int(length))+
'_'
427 if reg==
'tt': vname +=
'Top'
428 if reg==
'rn': vname +=
'RimNorth'
429 if reg==
'rs': vname +=
'RimSouth'
430 if reg==
'rw': vname +=
'RimWest'
431 if reg==
're': vname +=
'RimEast'
432 if reg==
'ss': vname +=
'South'
433 if reg==
'nn': vname +=
'North'
434 if reg==
'ws': vname +=
'WestSouth'
435 if reg==
'wc': vname +=
'WestCenter'
436 if reg==
'wn': vname +=
'WestNorth'
437 if reg==
'es': vname +=
'EastSouth'
438 if reg==
'ec': vname +=
'EastCenter'
439 if reg==
'en': vname +=
'EastNorth'
440 if reg==
'bt': vname +=
'Bottom'
442 snamein = sname+
'_inner'
444 if not sname
in solids_store:
446 s = ET.SubElement(solids,
'box', name=sname, lunit=
"cm", x=xx, y=yy, z=zz)
447 sin = ET.SubElement(solids,
'box', name=snamein, lunit=
"cm", x=xxsub, y=yysub, z=zzsub)
449 solids_store[sname] = s
450 solids_store[snamein] = sin
453 s = solids_store[sname]
454 sin = solids_store[snamein]
461 if style==
'm' and length>0:
462 strips.append(
strip(style, modnum, stripnum,length))
464 strips.append(
strip(style, modnum, stripnum,0))
468 if style==
'd' or style==
'c':
470 strips2.append(
strip(style, modnum, stripnum))
473 vnamein = vname +
'_inner'
474 vin = ET.SubElement(structure,
'volume', name=vnamein)
475 ET.SubElement(vin,
'materialref', ref=
'Air')
476 ET.SubElement(vin,
'solidref', ref=snamein)
481 pv = ET.SubElement(vin,
'physvol')
482 ET.SubElement(pv,
'volumeref', ref=ev.attrib[
'name'])
485 dy = (2*i - ny + 1)* 0.5 * (y+PADStrip)
488 dx = (2*i - ny + 1)* 0.5 * (x+PADStrip)
489 dy=0.5*(YCBOT+PADStrip)
493 dx=(i - 0.5*ny + 0.25) * (x+PADStrip)
495 posname =
'pos' + ev.attrib[
'name']
496 ET.SubElement(pv,
'position', name=posname, unit=
"cm", x=str(dx), y=str(dy), z=
'0')
501 pv = ET.SubElement(vin,
'physvol')
502 ET.SubElement(pv,
'volumeref', ref=ev.attrib[
'name'])
504 dy= -0.5*(YCTOP+PADStrip)
505 dz=(2*i - ny + 1)* 0.5 * (x+PADStrip)
507 posname =
'pos' + ev.attrib[
'name']
508 ET.SubElement(pv,
'position', name=posname,
509 unit=
"cm", x=
'0', y=str(dy), z=str(dz))
510 posname =
'rot' + ev.attrib[
'name']
511 ET.SubElement(pv,
'rotation', name=posname, unit=
"deg", x=
'0', y=
'90', z=
'0')
516 pv = ET.SubElement(vin,
'physvol')
517 ET.SubElement(pv,
'volumeref', ref=ev.attrib[
'name'])
519 dy= -0.5*(y+PADStrip)
520 dx=(i - 0.5*ny + 0.75) * (x+PADStrip)
522 posname =
'pos' + ev.attrib[
'name']
523 ET.SubElement(pv,
'position', name=posname, unit=
"cm", x=str(dx), y=str(dy), z=
'0')
526 v = ET.SubElement(structure,
'volume', name=vname)
527 ET.SubElement(v,
'materialref', ref=
'ALUMINUM_Al')
528 ET.SubElement(v,
'solidref', ref=sname)
530 pv = ET.SubElement(v,
'physvol')
531 ET.SubElement(pv,
'volumeref', ref=vin.attrib[
'name'])
540 ''' Build a side tagger (1 stacks)
542 if side!=
'e' and side !=
'w':
543 print(
'bad value passed to function, minosSideTagger: side='+side)
544 if pos!=
'n' and pos!=
'c' and pos !=
's':
545 print(
'bad value passed to function, minosSideTagger: pos='+pos)
554 z = mModL+2*PADTagger
556 z+=MINOSLATSOUTHACTIVEOVERHANG
558 xx = str(SIDECRTSTACKDEPTH)
559 yy = str(nstack*mModW+(nstack-1)*SIDECRTSHELFTHICK+2*PADTagger)
563 xxsub = str(SIDECRTSTACKDEPTH)
564 yysub = str(mModW+PADTagger)
565 zzsub = str(MINOSLATSOUTHACTIVEOVERHANG+PADTagger)
567 ypsub = str(0.5*((nstack-1)*(mModW+SIDECRTSHELFTHICK)+PADTagger))
568 zpsub = str(-0.5*(z-MINOSLATSOUTHACTIVEOVERHANG))
571 for layer
in range (2):
573 dx = ((-1)**layer)*0.5*LAYERSPACE
574 if side==
'w': dx*= -1
577 for i
in range(nstack):
578 dy = 0.5*(2*i+1-nstack)*(mModW+SIDECRTSHELFTHICK)
581 if pos==
's' and i==nstack-1 : dz = 0.5*MINOSLATSOUTHACTIVEOVERHANG
582 elif pos==
's': dz = -0.5*MINOSLATSOUTHACTIVEOVERHANG
583 coords.append((dx,dy,dz))
585 sname =
'tagger_SideLat_'
586 if pos==
'c': sname+=
'Center'
589 snameint = sname +
'_internal'
590 snameext = sname +
'_external'
591 if pos==
'n': sname+=
'North'
593 if not sname
in solids_store:
594 if pos !=
's': stagger = ET.SubElement(solids,
'box', name=sname, lunit=
"cm", x=xx, y=yy, z=zz)
596 sext = ET.SubElement(solids,
'box', name=snameext, lunit=
"cm", x=xx, y=yy, z=zz)
597 sint = ET.SubElement(solids,
'box', name=snameint, lunit=
"cm", x=xxsub, y=yysub, z=zzsub)
598 stagger = ET.SubElement(solids,
'subtraction', name=sname)
599 ET.SubElement(stagger,
'first', ref=snameext)
600 ET.SubElement(stagger,
'second', ref=snameint)
601 ET.SubElement(stagger,
'position', name=
'crtsouthtaggersubpos', unit=
'cm', x=xpsub,y=ypsub,z=zpsub)
602 solids_store[snameext] = sext
603 solids_store[snameint] = sint
604 solids_store[sname] = stagger
607 sext = solids_store[snameext]
608 sint = solids_store[snameint]
609 stagger = solids_store[sname]
611 vname =
'vol_'+ sname+
'_'
617 if printModIds:
print(
'MINOS tagger, '+side+
', pos '+pos+
' first module: '+str(mod_id+1)+
', first FEB: '+str(feb_id+1))
620 for i
in range(len(coords)):
623 modules.append(
module(
'm',
'ws'))
624 if i==0: vname+=
'WestSouth'
626 modules.append(
module(
'm',
'wc'))
627 if i==0: vname+=
'WestCenter'
629 modules.append(
module(
'm',
'wn'))
630 if i==0: vname+=
'WestNorth'
633 modules.append(
module(
'm',
'es'))
634 if i==0: vname+=
'EastSouth'
636 modules.append(
module(
'm',
'ec'))
637 if i==0: vname+=
'EastCenter'
639 modules.append(
module(
'm',
'en'))
640 if i==0: vname+=
'EastNorth'
642 modToFeb[mod_id] = ((feb_id-1,fmod),(feb_id,fmod))
645 if i != len(coords)-1: feb_id+=2
647 if printModIds:
print(
' last module: '+str(mod_id)+
', last FEB: '+str(feb_id))
652 vtagger = ET.SubElement(structure,
'volume', name=vname)
653 ET.SubElement(vtagger,
'materialref', ref=
'Air')
654 ET.SubElement(vtagger,
'solidref', ref=sname)
660 pv = ET.SubElement(vtagger,
'physvol')
661 ET.SubElement(pv,
'volumeref', ref=v.attrib[
'name'])
663 posname =
'pos' + v.attrib[
'name']
664 ET.SubElement(pv,
'position', name=posname, unit=
"cm", x=str(xc), y=str(yc), z=str(zc))
666 return stagger, vtagger
669 ''' Build north MINOS tagger (2 layers cut modules in X-X) on upstream face
674 ny = len(minosCutModLengthNorth)
676 x = 2*(mModL-ZM+max(minosCutModLengthNorth))+PADM+2*PADTagger
677 y = ny*mModW+(ny-1)*SIDECRTSHELFTHICK+2*PADTagger
680 zz = str(SIDECRTSTACKDEPTH)
685 if printModIds:
print(
'MINOS tagger North, first module: '+str(mod_id+1)+
', FEB: '+str(feb_id+1))
690 for row
in range(ny):
692 xleft = 0.5*x - PADTagger - 0.5*(mModL-ZM+minosCutModLengthNorth[row])
693 yrow = -0.5*y + PADTagger + (row+0.5)*mModW + row*SIDECRTSHELFTHICK
700 rowcoords = ( (xleft,yrow,zin),(-xleft,yrow,zin),(xleft,yrow,-zin),(-xleft,yrow,-zin) )
701 coords.append(rowcoords)
706 rowmodules.append(
module(
'm',
'nn',minosCutModLengthNorth[row]))
707 modToFeb[mod_id] = (feb_id-3+i,fmod/4)
709 modules.append(rowmodules)
712 if row != ny-1: feb_id+=4
714 if printModIds:
print(
' last module: '+str(mod_id)+
', FEB: '+str(feb_id))
716 sname =
'tagger_SideNorth'
717 vname =
'vol_'+ sname
719 stagger = ET.SubElement(solids,
'box', name=sname, lunit=
"cm", x=xx, y=yy, z=zz)
720 vtagger = ET.SubElement(structure,
'volume', name=vname)
721 ET.SubElement(vtagger,
'materialref', ref=
'Air')
722 ET.SubElement(vtagger,
'solidref', ref=sname)
727 for row
in range(len(coords)):
728 for mod, (xc,yc,zc)
in enumerate(coords[row]):
730 (s,v)=modules[row][mod]
731 pv = ET.SubElement(vtagger,
'physvol')
732 ET.SubElement(pv,
'volumeref', ref=v.attrib[
'name'])
734 posname =
'pos' + v.attrib[
'name']
735 ET.SubElement(pv,
'position', name=posname, unit=
"cm", x=str(xc), y=str(yc), z=str(zc))
738 posname =
'rotplus' + v.attrib[
'name']
739 ET.SubElement(pv,
'rotation', name=posname, unit=
"deg", x=
'0', y=
'90', z=
'0')
741 posname =
'rotneg' + v.attrib[
'name']
742 ET.SubElement(pv,
'rotation', name=posname, unit=
"deg", x=
'0', y=
'-90', z=
'0')
744 return stagger, vtagger
747 ''' Build front MINOS tagger (2 layers in X-Y) on upstream face
754 x = 2*(mModL-ZM+max(minosCutModLengthSoutheast)-crosstwomodule)+overlap+2*PADTagger
755 y = mModL + 2*PADTagger
756 z = SIDECRTSTACKDEPTH+mModH+PADTagger
763 for i
in range(2*nmody+1):
767 dx = -0.5*x + offset + PADTagger + (i+0.5)*mModW + i*PADModule
768 dy = -0.5*y + PADTagger + 0.5*(mModL-0.5*ZM)
769 dz = -0.5*z + PADTagger + 0.5*mModH
774 dx = -0.5*x + offset + PADTagger + (i+0.5)*mModW + i*PADModule
775 dy = -0.5*y + PADTagger + 0.5*(mModL-ZM+verticalmodule)
777 dz = -0.5*z + PADTagger + 0.5*mModH
782 dx = -0.5*x+offset + PADTagger + (i+0.5-nmody-1)*mModW + (i-nmody-1)*PADModule
783 dy = 0.5*y - PADTagger - 0.5*(mModL - 0.5*ZM)
784 dz = -0.5*z +PADTagger + mModH + 1.5*SIDECRTPOSTWIDTH
786 coords.append((dx,dy,dz,1))
789 for i
in range(NMODSTACK):
791 dxeast = 0.5*(mModL-ZM+minosCutModLengthSoutheast[i]) + gap - crosstwomodule
792 dy = -0.5*y+PADTagger+(i+0.5)*mModW + i*SIDECRTSHELFTHICK
793 dz = 0.5*z - 1.5*SIDECRTPOSTWIDTH - separatetwomodule
795 if i == (NMODSTACK -1):
796 dxeast = 0.5*(mModL-ZM+minosCutModLengthSoutheast[i]) + gap - crosstwomodule - offsetontopmodule - separatetwomodule
797 dy = -0.5*y+PADTagger+(i+0.5)*mModW + i*SIDECRTSHELFTHICK
798 dz = 0.5*z - 1.5*SIDECRTPOSTWIDTH - separatetwomodule
799 coords.append((-dxeast,dy,dz,0))
801 for i
in range(NMODSTACK):
803 dxwest = 0.5*(mModL-ZM+minosCutModLengthSouthwest[i]) + gap - crosstwomodule
804 dy = -0.5*y+PADTagger+(i+0.5)*mModW + i*SIDECRTSHELFTHICK
805 dz = 0.5*z - 1.5*SIDECRTPOSTWIDTH - separatetwomodule
806 coords.append((dxwest,dy,dz,0))
810 if printModIds:
print(
'MINOS tagger South, first module: '+str(mod_id+1)+
', FEB: '+str(feb_id+1))
816 for i
in range(len(coords)):
820 modules.append(
module(
'm',
'ss',verticalmodule))
822 modules.append(
module(
'm',
'ss',0.5*ZM))
824 modToFeb[mod_id] = (feb_id,fmod)
829 if i!=2*nmody: feb_id+=1
832 if i >= 2*nmody+1
and i < 2*nmody+1+9 :
833 modules.append(
module(
'm',
'ss',minosCutModLengthSoutheast[i-(2*nmody+1)]))
836 modToFeb[mod_id] = (feb_id,fmod)
839 if i!= (2*nmody+9): feb_id+=1
842 if i >= 2*nmody+1+9 :
843 modules.append(
module(
'm',
'ss',minosCutModLengthSouthwest[i-(2*nmody+1+9)]))
846 modToFeb[mod_id] = (feb_id,fmod)
849 if i!= (2*nmody+18): feb_id+=1
852 if printModIds:
print(
' last module: '+str(mod_id)+
', FEB: '+str(feb_id))
854 sname =
'tagger_SideSouth'
855 vname =
'vol_'+ sname
857 stagger = ET.SubElement(solids,
'box', name=sname, lunit=
"cm", x=xx, y=yy, z=zz)
858 vtagger = ET.SubElement(structure,
'volume', name=vname)
859 ET.SubElement(vtagger,
'materialref', ref=
'Air')
860 ET.SubElement(vtagger,
'solidref', ref=sname)
863 for i, (xc,yc,zc,r)
in enumerate(coords):
866 pv = ET.SubElement(vtagger,
'physvol')
867 ET.SubElement(pv,
'volumeref', ref=v.attrib[
'name'])
869 posname =
'pos' + v.attrib[
'name']
870 ET.SubElement(pv,
'position', name=posname, unit=
"cm", x=str(xc), y=str(yc), z=str(zc))
872 posname =
'rot' + v.attrib[
'name']
873 if r==1 : ET.SubElement(pv,
'rotation', name=posname, unit=
"deg", x=
'90', y=
'0', z=
'90')
876 posname =
'rotplus' + v.attrib[
'name']
877 ET.SubElement(pv,
'rotation', name=posname, unit=
"deg", x=
'0', y=
'90', z=
'0')
879 posname =
'rotneg' + v.attrib[
'name']
880 ET.SubElement(pv,
'rotation', name=posname, unit=
"deg", x=
'0', y=
'-90', z=
'0')
884 return stagger, vtagger
887 ''' Build bottom tagger
889 modwidth = XD*(NXD+0.5)+2*PADD+(NXD+2)*PADStrip
890 xx = str(modwidth*5 + DCSPACER*4 + 2*PADTagger)
891 yy = str(2*(YD+PADD+PADTagger)+3*PADStrip)
900 dx = (2*i-5+1)*0.5*(modwidth+ DCSPACER)
903 dx = (ZD + 2*(PADD+PADStrip))*0.5*(-1)**i
906 dx = (ZD + 2*(PADD+PADStrip))*0.5*(-1)**i
909 dx = (2*(i-9)-5+1)*0.5*(modwidth+ DCSPACER)
917 coords.append((dx,0,dz,rot))
921 if printModIds:
print(
'DC tagger, first module: '+str(mod_id+1)+
', FEB: '+str(feb_id+1))
923 for i
in range(len(coords)):
924 modules.append(
module(
'd',
'bt'))
926 modToFeb[mod_id] = (feb_id,1)
928 if printModIds:
print(
' last module: '+str(mod_id)+
', FEB: '+str(feb_id))
930 sname =
'tagger_Bottom'
931 vname =
'vol_'+ sname
933 stagger = ET.SubElement(solids,
'box', name=sname, lunit=
"cm", x=xx, y=yy, z=zz)
934 vtagger = ET.SubElement(structure,
'volume', name=vname)
935 ET.SubElement(vtagger,
'materialref', ref=
'Air')
936 ET.SubElement(vtagger,
'solidref', ref=sname)
939 for i, (xc,yc,zc,r)
in enumerate(coords):
942 pv = ET.SubElement(vtagger,
'physvol')
943 ET.SubElement(pv,
'volumeref', ref=v.attrib[
'name'])
945 posname =
'pos' + v.attrib[
'name']
946 ET.SubElement(pv,
'position', name=posname, unit=
"cm", x=str(xc), y=str(yc), z=str(zc))
949 posname =
'rot' + v.attrib[
'name']
950 ET.SubElement(pv,
'rotation', name=posname, unit=
"deg", x=
'0', y=
'90', z=
'0')
952 return stagger, vtagger
956 ''' Build top CERN tagger (1 layer of modules)
958 modwidth = ZC + 2*PADC + (NXC+1)*PADStrip
959 xx = str(NTOPX*modwidth+2*PADTagger+(NTOPX-1)*PADModule)
960 yy = str(YCTOP+YCBOT+3*PADStrip+2*PADC+2*PADTagger)
961 zz = str(NTOPZ*modwidth + 2*PADTagger + (NTOPZ-1)*PADModule)
966 dz = 0.5*(modwidth+PADModule)*(1 - NTOPZ)
967 dx = 0.5*(modwidth+PADModule)*(1 - NTOPX)
969 for i
in range(NTOPX*NTOPZ):
971 coords.append((dx,0,dz))
974 dx+= modwidth + PADModule
975 dz = 0.5*(modwidth+PADModule)*(1 - NTOPZ)
976 else: dz+= modwidth + PADModule
980 if printModIds:
print(
'CERN tagger Top, first module: '+str(mod_id+1)+
', FEB: '+str(feb_id+1))
982 for i
in range(len(coords)):
983 modules.append(
module(
'c',
'tt'))
985 modToFeb[mod_id] = (feb_id,1)
987 if printModIds:
print(
' last module: '+str(mod_id)+
', FEB: '+str(feb_id))
990 vname =
'vol_'+ sname
992 stagger = ET.SubElement(solids,
'box', name=sname, lunit=
"cm", x=xx, y=yy, z=zz)
993 vtagger = ET.SubElement(structure,
'volume', name=vname)
994 ET.SubElement(vtagger,
'materialref', ref=
'Air')
995 ET.SubElement(vtagger,
'solidref', ref=sname)
1001 pv = ET.SubElement(vtagger,
'physvol')
1002 ET.SubElement(pv,
'volumeref', ref=v.attrib[
'name'])
1004 posname =
'pos' + v.attrib[
'name']
1005 ET.SubElement(pv,
'position', name=posname, unit=
"cm", x=str(xc), y=str(yc), z=str(zc))
1007 return stagger, vtagger
1010 ''' Build east(side='R') or west(side='L') CERN rim tagger
1012 modwidth = ZC + 2*PADC + (NXC+1)*PADStrip
1013 xx = str(modwidth+2*PADTagger)
1014 yy = str(YCTOP+YCBOT+3*PADStrip+2*PADC+2*PADTagger)
1015 zz = str(NSLOPELAT*modwidth + 2*PADTagger + (NSLOPELAT-1)*PADModule)
1020 dz = 0.5*(modwidth+PADModule)*(1 - NSLOPELAT)
1022 for i in range(NSLOPELAT):
1024 coords.append((0,0,dz))
1026 dz+= modwidth+PADModule
1030 if printModIds: print('CERN tagger Lat, side '+side+' first module: '+str(mod_id+1)+', FEB: '+str(feb_id+1))
1032 for i in range(len(coords)):
1034 modules.append(module('c','rw'))
1036 modules.append(module('c',
're'))
1038 modToFeb[mod_id] = (feb_id,1)
1040 if printModIds:
print(
' last module: '+str(mod_id)+
', FEB: '+str(feb_id))
1047 vname =
'vol_'+ sname
1049 stagger = ET.SubElement(solids,
'box', name=sname, lunit=
"cm", x=xx, y=yy, z=zz)
1050 vtagger = ET.SubElement(structure,
'volume', name=vname)
1051 ET.SubElement(vtagger,
'materialref', ref=
'Air')
1052 ET.SubElement(vtagger,
'solidref', ref=sname)
1058 pv = ET.SubElement(vtagger,
'physvol')
1059 ET.SubElement(pv,
'volumeref', ref=v.attrib[
'name'])
1061 posname =
'pos' + v.attrib[
'name']
1062 ET.SubElement(pv,
'position', name=posname, unit=
"cm", x=str(xc), y=str(yc), z=str(zc))
1064 return stagger, vtagger
1068 ''' Build north(side='D') or south(side='U') CERN rim tagger
1070 modwidth = ZC + 2*PADC + (NXC+1)*PADStrip
1071 xx = str(NSLOPEFRONT*modwidth+2*PADTagger+(NSLOPEFRONT-1)*PADModule)
1072 yy = str(YCTOP+YCBOT+3*PADStrip+2*PADC+2*PADTagger)
1073 zz = str(modwidth + 2*PADTagger)
1078 dx = 0.5*(modwidth+PADModule)*(1 - NSLOPEFRONT)
1080 for i in range(NSLOPEFRONT):
1082 coords.append((dx,0,0))
1083 dx+= modwidth+PADModule
1087 if printModIds: print('CERN tagger Long, side '+side+' first module: '+str(mod_id+1)+', FEB: '+str(feb_id+1))
1089 for i in range(len(coords)):
1091 modules.append(module('c',
'rs'))
1093 modules.append(
module(
'c',
'rn'))
1095 modToFeb[mod_id] = (feb_id,1)
1097 if printModIds:
print(
' last module: '+str(mod_id)+
', FEB: '+str(feb_id))
1104 vname =
'vol_'+ sname
1106 stagger = ET.SubElement(solids,
'box', name=sname, lunit=
"cm", x=xx, y=yy, z=zz)
1107 vtagger = ET.SubElement(structure,
'volume', name=vname)
1108 ET.SubElement(vtagger,
'materialref', ref=
'Air')
1109 ET.SubElement(vtagger,
'solidref', ref=sname)
1115 pv = ET.SubElement(vtagger,
'physvol')
1116 ET.SubElement(pv,
'volumeref', ref=v.attrib[
'name'])
1118 posname =
'pos' + v.attrib[
'name']
1119 ET.SubElement(pv,
'position', name=posname, unit=
"cm", x=str(xc), y=str(yc), z=str(zc))
1121 return stagger, vtagger
1127 xxint = str(WVWIDTH + 2*SIDECRTWVOFFSET)
1128 yyint = str(WVHEIGHT+1.0+WVPADY)
1129 zzint = str(WVLENGTH+2*SIDECRTWVOFFSET)
1131 xxext = str(WVWIDTH + 2*SIDECRTROLLOFFSET + 1.1*SIDECRTSTACKDEPTH)
1154 snameext = sname+
'_external'
1155 snameint = sname+
'_internal'
1156 sexternal = ET.SubElement(solids,
'box', name=snameext, lunit=
"cm", x=xxext, y=yyext, z=zzext)
1157 sinternal = ET.SubElement(solids,
'box', name=snameint, lunit=
"cm", x=xxint, y=yyint, z=zzint)
1158 sshell = ET.SubElement(solids,
'subtraction', name=sname)
1159 ET.SubElement(sshell,
'first', ref=snameext)
1160 ET.SubElement(sshell,
'second', ref=snameint)
1161 ET.SubElement(sshell,
'position', name=
'crtshellsubpos', unit=
'cm', x=
'0',y=str(-0.5*SHELLY+WVFOOTELEVATION+0.5*WVHEIGHT+0.5*WVPADY),z=str(-SHELLWVOFFSET))
1164 vshell = ET.SubElement(structure,
'volume', name=vname)
1165 ET.SubElement(vshell,
'materialref', ref=
'Air')
1166 ET.SubElement(vshell,
'solidref', ref=sname)
1169 pv = ET.SubElement(vshell,
'physvol')
1170 ET.SubElement(pv,
'volumeref', ref=vbeam.attrib[
'name'])
1171 posname =
'pos' + vbeam.attrib[
'name']
1172 ET.SubElement(pv,
'position', name=posname, unit=
"cm", x=
'0', y=str(CERNTOPY-CRTBEAMHEIGHT*0.5-cModH*0.6), z=str(0))
1175 pv = ET.SubElement(vshell,
'physvol')
1176 ET.SubElement(pv,
'volumeref', ref=vws.attrib[
'name'])
1178 xc = 0.5* WVWIDTH + SIDECRTWVOFFSET + 0.5*SIDECRTSTACKDEPTH
1180 zc = MINOSLATSOUTHZ - SHELLWVOFFSET
1182 posname =
'pos' + vws.attrib[
'name']
1183 ET.SubElement(pv,
'position', name=posname, unit=
"cm", x=str(xc), y=str(yc), z=str(zc))
1186 pv = ET.SubElement(vshell,
'physvol')
1187 ET.SubElement(pv,
'volumeref', ref=vwc.attrib[
'name'])
1189 xc = 0.5* WVWIDTH + SIDECRTROLLOFFSET
1191 zc = MINOSLATCENTZ - SHELLWVOFFSET
1193 posname =
'pos' + vwc.attrib[
'name']
1194 ET.SubElement(pv,
'position', name=posname, unit=
"cm", x=str(xc), y=str(yc), z=str(zc))
1197 pv = ET.SubElement(vshell,
'physvol')
1198 ET.SubElement(pv,
'volumeref', ref=vwn.attrib[
'name'])
1200 xc = 0.5* WVWIDTH + SIDECRTWVOFFSET + 0.5*SIDECRTSTACKDEPTH
1202 zc = MINOSLATNORTHZ - SHELLWVOFFSET
1204 posname =
'pos' + vwn.attrib[
'name']
1205 ET.SubElement(pv,
'position', name=posname, unit=
"cm", x=str(xc), y=str(yc), z=str(zc))
1208 pv = ET.SubElement(vshell,
'physvol')
1209 ET.SubElement(pv,
'volumeref', ref=ves.attrib[
'name'])
1211 xc = -0.5* WVWIDTH - SIDECRTWVOFFSET - 0.5*SIDECRTSTACKDEPTH
1213 zc = MINOSLATSOUTHZ - SHELLWVOFFSET
1215 posname =
'pos' + ves.attrib[
'name']
1216 ET.SubElement(pv,
'position', name=posname, unit=
"cm", x=str(xc), y=str(yc), z=str(zc))
1219 pv = ET.SubElement(vshell,
'physvol')
1220 ET.SubElement(pv,
'volumeref', ref=vec.attrib[
'name'])
1222 xc = -0.5* WVWIDTH - SIDECRTROLLOFFSET
1224 zc = MINOSLATCENTZ - SHELLWVOFFSET
1226 posname =
'pos' + vec.attrib[
'name']
1227 ET.SubElement(pv,
'position', name=posname, unit=
"cm", x=str(xc), y=str(yc), z=str(zc))
1230 pv = ET.SubElement(vshell,
'physvol')
1231 ET.SubElement(pv,
'volumeref', ref=ven.attrib[
'name'])
1233 xc = -0.5* WVWIDTH - SIDECRTWVOFFSET - 0.5*SIDECRTSTACKDEPTH
1235 zc = MINOSLATNORTHZ - SHELLWVOFFSET
1237 posname =
'pos' + ven.attrib[
'name']
1238 ET.SubElement(pv,
'position', name=posname, unit=
"cm", x=str(xc), y=str(yc), z=str(zc))
1241 pv = ET.SubElement(vshell,
'physvol')
1242 ET.SubElement(pv,
'volumeref', ref=vnn.attrib[
'name'])
1246 zc = 0.5* WVLENGTH + SIDECRTWVOFFSET + 0.5*SIDECRTSTACKDEPTH - SHELLWVOFFSET
1248 posname =
'pos' + vnn.attrib[
'name']
1249 ET.SubElement(pv,
'position', name=posname, unit=
"cm", x=str(xc), y=str(yc), z=str(zc))
1252 pv = ET.SubElement(vshell,
'physvol')
1253 ET.SubElement(pv,
'volumeref', ref=vss.attrib[
'name'])
1257 zc = -1*(0.5* WVLENGTH + SIDECRTWVOFFSET + 0.5*(SIDECRTSTACKDEPTH+PADTagger+mModH)) - SHELLWVOFFSET
1259 posname =
'pos' + vss.attrib[
'name']
1260 ET.SubElement(pv,
'position', name=posname, unit=
"cm", x=str(xc), y=str(yc), z=str(zc))
1263 pv = ET.SubElement(vshell,
'physvol')
1264 ET.SubElement(pv,
'volumeref', ref=vbt.attrib[
'name'])
1266 xc = posDCInDetEncl[0]
1267 yc = posDCInDetEncl[1]
1268 zc = posDCInDetEncl[2] - SHELLWVOFFSET
1270 posname =
'pos' + vbt.attrib[
'name']
1271 ET.SubElement(pv,
'position', name=posname, unit=
"cm", x=str(xc), y=str(yc), z=str(zc))
1274 pv = ET.SubElement(vshell,
'physvol')
1275 ET.SubElement(pv,
'volumeref', ref=vtt.attrib[
'name'])
1279 zc = CERNTOPZ - SHELLWVOFFSET
1281 posname =
'pos' + vtt.attrib[
'name']
1282 ET.SubElement(pv,
'position', name=posname, unit=
"cm", x=str(xc), y=str(yc), z=str(zc))
1285 pv = ET.SubElement(vshell,
'physvol')
1286 ET.SubElement(pv,
'volumeref', ref=vrw.attrib[
'name'])
1290 zc = CERNRIMLATZ - SHELLWVOFFSET
1292 posname =
'pos' + vrw.attrib[
'name']
1293 ET.SubElement(pv,
'position', name=posname, unit=
"cm", x=str(xc), y=str(yc), z=str(zc))
1295 posname =
'rot' + vrw.attrib[
'name']
1296 ET.SubElement(pv,
'rotation', name=posname, unit=
"deg", x=
'0', y=
'0', z=str(SLOPEINCLINATION))
1299 pv = ET.SubElement(vshell,
'physvol')
1300 ET.SubElement(pv,
'volumeref', ref=vre.attrib[
'name'])
1304 zc = CERNRIMLATZ - SHELLWVOFFSET
1306 posname =
'pos' + vre.attrib[
'name']
1307 ET.SubElement(pv,
'position', name=posname, unit=
"cm", x=str(xc), y=str(yc), z=str(zc))
1309 posname =
'rot' + vre.attrib[
'name']
1310 ET.SubElement(pv,
'rotation', name=posname, unit=
"deg", x=
'0', y=
'0', z=str(-1*SLOPEINCLINATION))
1313 pv = ET.SubElement(vshell,
'physvol')
1314 ET.SubElement(pv,
'volumeref', ref=vrs.attrib[
'name'])
1318 zc = CERNRIMSZ - SHELLWVOFFSET
1320 posname =
'pos' + vrs.attrib[
'name']
1321 ET.SubElement(pv,
'position', name=posname, unit=
"cm", x=str(xc), y=str(yc), z=str(zc))
1323 posname =
'rot' + vrs.attrib[
'name']
1324 ET.SubElement(pv,
'rotation', name=posname, unit=
"deg", x=str(SLOPEINCLINATION), y=
'0', z=
'0')
1327 pv = ET.SubElement(vshell,
'physvol')
1328 ET.SubElement(pv,
'volumeref', ref=vrn.attrib[
'name'])
1332 zc = CERNRIMNZ - SHELLWVOFFSET
1334 posname =
'pos' + vrn.attrib[
'name']
1335 ET.SubElement(pv,
'position', name=posname, unit=
"cm", x=str(xc), y=str(yc), z=str(zc))
1337 posname =
'rot' + vrn.attrib[
'name']
1338 ET.SubElement(pv,
'rotation', name=posname, unit=
"deg", x=str(-1*SLOPEINCLINATION), y=
'0', z=
'0')
1340 return sshell,vshell
1347 m = ET.SubElement(materials,
'element', name=
'aluminum', formula=
'Al', Z=
'13')
1348 ET.SubElement(m,
'atom', value=
'26.9815')
1349 m = ET.SubElement(materials,
'element', name=
'nitrogen', formula=
'N', Z=
'7')
1350 ET.SubElement(m,
'atom', value=
'14.0067')
1351 m = ET.SubElement(materials,
'element', name=
'oxygen', formula=
'O', Z=
'8')
1352 ET.SubElement(m,
'atom', value=
'15.999')
1353 m = ET.SubElement(materials,
'element', name=
'argon', formula=
'Ar', Z=
'18')
1354 ET.SubElement(m,
'atom', value=
'39.9480')
1355 m = ET.SubElement(materials,
'element', name=
'hydrogen', formula=
'H', Z=
'1')
1356 ET.SubElement(m,
'atom', value=
'1.0079')
1357 m = ET.SubElement(materials,
'element', name=
'carbon', formula=
'C', Z=
'6')
1358 ET.SubElement(m,
'atom', value=
'12.0107')
1359 m = ET.SubElement(materials,
'element', name=
'iron', formula=
'Fe', Z=
'26')
1360 ET.SubElement(m,
'atom', value=
'55.8450')
1361 m = ET.SubElement(materials,
'element', name=
'niobium', formula=
'Nb', Z=
'41')
1362 ET.SubElement(m,
'atom', value=
'92.90637')
1363 m = ET.SubElement(materials,
'element', name=
'copper', formula=
'Cu', Z=
'29')
1364 ET.SubElement(m,
'atom', value=
'63.5463')
1365 m = ET.SubElement(materials,
'element', name=
'manganese', formula=
'Mn', Z=
'25')
1366 ET.SubElement(m,
'atom', value=
'54.938043')
1367 m = ET.SubElement(materials,
'element', name=
'molybdenum', formula=
'Mo', Z=
'42')
1368 ET.SubElement(m,
'atom', value=
'95.951')
1369 m = ET.SubElement(materials,
'element', name=
'nickel', formula=
'Ni', Z=
'28')
1370 ET.SubElement(m,
'atom', value=
'58.6934')
1371 m = ET.SubElement(materials,
'element', name=
'phosphorus', formula=
'P', Z=
'15')
1372 ET.SubElement(m,
'atom', value=
'30.973')
1373 m = ET.SubElement(materials,
'element', name=
'silicon', formula=
'Si', Z=
'14')
1374 ET.SubElement(m,
'atom', value=
'28.0855')
1375 m = ET.SubElement(materials,
'element', name=
'sulfur', formula=
'S', Z=
'16')
1376 ET.SubElement(m,
'atom', value=
'32.065')
1377 m = ET.SubElement(materials,
'element', name=
'vanadium', formula=
'V', Z=
'23')
1378 ET.SubElement(m,
'atom', value=
'50.94151')
1381 m = ET.SubElement(materials,
'material', name=
'ALUMINUM_Al', formula=
'ALUMINUM_Al')
1382 ET.SubElement(m,
'D', value=
'2.6990', unit=
'g/cm3')
1383 ET.SubElement(m,
'fraction', n=
'1.000', ref=
'aluminum')
1385 m = ET.SubElement(materials,
'material', name=
'Air')
1386 ET.SubElement(m,
'D', value=
'0.001205', unit=
'g/cm3')
1387 ET.SubElement(m,
'fraction', n=
'0.781154', ref=
'nitrogen')
1388 ET.SubElement(m,
'fraction', n=
'0.209476', ref=
'oxygen')
1389 ET.SubElement(m,
'fraction', n=
'0.00934', ref=
'argon')
1391 m = ET.SubElement(materials,
'material', name=
'Polystyrene')
1392 ET.SubElement(m,
'D', value=
'1.19', unit=
'g/cm3')
1393 ET.SubElement(m,
'fraction', n=
'0.077418', ref=
'hydrogen')
1394 ET.SubElement(m,
'fraction', n=
'0.922582', ref=
'carbon')
1396 m = ET.SubElement(materials,
'material', name=
'STEEL_A992')
1397 ET.SubElement(m,
'D', value=
'7.85', unit=
'g/cm3')
1398 ET.SubElement(m,
'fraction', n=
'0.0022', ref=
'carbon')
1399 ET.SubElement(m,
'fraction', n=
'0.0004', ref=
'niobium')
1400 ET.SubElement(m,
'fraction', n=
'0.005', ref=
'copper')
1401 ET.SubElement(m,
'fraction', n=
'0.01', ref=
'manganese')
1402 ET.SubElement(m,
'fraction', n=
'0.0014', ref=
'molybdenum')
1403 ET.SubElement(m,
'fraction', n=
'0.0044', ref=
'nickel')
1404 ET.SubElement(m,
'fraction', n=
'0.00034', ref=
'phosphorus')
1405 ET.SubElement(m,
'fraction', n=
'0.0039', ref=
'silicon')
1406 ET.SubElement(m,
'fraction', n=
'0.00044', ref=
'sulfur')
1407 ET.SubElement(m,
'fraction', n=
'0.001', ref=
'vanadium')
1408 ET.SubElement(m,
'fraction', n=
'0.97092', ref=
'iron')
1415 ws = ET.SubElement(solids,
'box', name=
'World', lunit=
"cm", x=
'1500', y=
'1500', z=
'3000')
1416 w = ET.SubElement(structure,
'volume', name=
'volWorld')
1417 ET.SubElement(w,
'materialref', ref=
'Air')
1418 ET.SubElement(w,
'solidref', ref=
'World')
1419 pv = ET.SubElement(w,
'physvol')
1420 ET.SubElement(pv,
'volumeref', ref=v.attrib[
'name'])
1421 posname =
'pos' + v.attrib[
'name']
1422 ET.SubElement(pv,
'position', name=posname, unit=
"cm", x=
'0', y=
'0', z=
'0')
1423 setup = ET.SubElement(gdml,
'setup', name=
'Default', version=
'1.0')
1424 ET.SubElement(setup,
'world', ref=
'volWorld')
1427 print(
'MINOS modules generated: '+str(nModM))
1428 print(
'CERN modules generated: '+str(nModC))
1429 print(
'DblCh modules generated: '+str(nModD))
1432 with
open(
'icarus_crt.gdml',
'w')
as f:
1433 f.write(minidom.parseString(ET.tostring(gdml)).toprettyxml(indent=
'\t'))
1435 print(
'Writing dictionary to file...')
1436 with
open(
'feb_map.txt',
'w')
as f:
1437 writer = csv.writer(f,delimiter=
',',quotechar=
'"',quoting=csv.QUOTE_MINIMAL)
1438 for mod
in modToFeb.keys():
1440 if type(tmp[0])==int:
1441 writer.writerow([str(mod),str(tmp[0]),str(tmp[1])])
1443 writer.writerow([str(mod),str(tmp[0][0]),str(tmp[0][1]),str(tmp[1][0]),str(tmp[1][1])])
then if[["$THISISATEST"==1]]
do one_file $F done echo for F in find $TOP name CMakeLists txt print
auto enumerate(Iterables &&...iterables)
Range-for loop helper tracking the number of iteration.
open(RACETRACK) or die("Could not open file $RACETRACK for writing")