Skip to content

Commit a1a6883

Browse files
authored
Merge branch 'main' into TFG24c.Export.Mini
2 parents 8a19542 + 6ff5756 commit a1a6883

File tree

15 files changed

+109
-238
lines changed

15 files changed

+109
-238
lines changed

.github/workflows/build-pull-request.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
outputs: type=docker,dest=/tmp/star-sw-${{ env.STARENV }}.tar
3737

3838
- name: Save built image for test jobs
39-
uses: actions/upload-artifact@v3
39+
uses: actions/upload-artifact@v4
4040
with:
4141
name: star-sw-${{ env.STARENV }}
4242
path: /tmp/star-sw-${{ env.STARENV }}.tar
@@ -54,7 +54,7 @@ jobs:
5454
STARENV: ${{ matrix.starenv }}-${{ matrix.compiler }}
5555
steps:
5656
- name: Download artifact
57-
uses: actions/download-artifact@v3
57+
uses: actions/download-artifact@v4
5858
with:
5959
name: star-sw-${{ env.STARENV }}
6060
path: /tmp
@@ -79,7 +79,7 @@ jobs:
7979
STARENV: root5-${{ matrix.compiler }}
8080
steps:
8181
- name: Download artifact
82-
uses: actions/download-artifact@v3
82+
uses: actions/download-artifact@v4
8383
with:
8484
name: star-sw-${{ env.STARENV }}
8585
path: /tmp
@@ -104,7 +104,7 @@ jobs:
104104
STARENV: root5-${{ matrix.compiler }}
105105
steps:
106106
- name: Download artifact
107-
uses: actions/download-artifact@v3
107+
uses: actions/download-artifact@v4
108108
with:
109109
name: star-sw-${{ env.STARENV }}
110110
path: /tmp

StarVMC/Geometry/TpceGeo/TpceGeo3a.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -500,24 +500,24 @@
500500
<var name="dAnode" value="{0.2 ,0.4 }" comment="// Inner/Outer anode width " />
501501
<var name="zGatingGrid" value="TPCG_LengthV/2 -(TPCG_dGateGround+2*TPCG_dAnode(2))" comment="// " />
502502
<var name="zGroundGrid" value="TPCG_zGatingGrid+TPCG_dGateGround" comment="// " />
503-
<var name="DeadZone" value="12." comment="// Dead zone before GatingGrid. (outer) No hits there " />
504-
<var name="IDeadZone" value="12." comment="// Dead zone before GatingGrid. (inner) No hits there " />
503+
<var name="DeadZone" value="0." comment="// Dead zone before GatingGrid. (outer) No hits there (prev 12)" />
504+
<var name="IDeadZone" value="0." comment="// Dead zone before GatingGrid. (inner) No hits there (prev 12)" />
505505
<var name="tofmax" value="1.0E-6" comment="// Max time of flight" />
506506
</Fill>
507507
<Fill name="TPCG" comment="Subversion 1">
508508
<var name="version" value="3.1" comment="selector" />
509509
<var name="rmax" value="207.77" comment="Max envelope radius" />
510-
<var name="deadzone" value="14" comment="Extend deadzone before gating grid (outer)" />
511-
<var name="Ideadzone" value="14" comment="Extend deadzone before gating grid (inner)" />
510+
<var name="deadzone" value="0." comment="Extend deadzone before gating grid (outer) (prev 14)" />
511+
<var name="Ideadzone" value="0." comment="Extend deadzone before gating grid (inner) (prev 14)" />
512512
<var name="tofmax" value="32.0E-6" comment="Increase maximum TOF for particles" />
513513
</Fill>
514514
<Fill name="TPCG" comment="Subversion 2 -- flags mixed iTPC / TPC year">
515515
<var name="version" value="3.2" comment="selector" />
516516
</Fill>
517517
<Fill name="TPCG" comment="Subversion 2.1 -- flags mixed iTPC / TPC year">
518518
<var name="version" value="3.21" comment="selector" />
519-
<var name="deadzone" value="13.0" comment="Reduce outer deadzone by 1 cm" />
520-
<var name="ideadzone" value="12.4" comment="Reduce inner deadzone by 1.6 cm" />
519+
<var name="deadzone" value="0.0" comment="Reduce outer deadzone by 1 cm (prev 13)" />
520+
<var name="ideadzone" value="0.0" comment="Reduce inner deadzone by 1.6 cm (prev 12.4)" />
521521
</Fill>
522522

523523
<Use struct="TPCC" />

StarVMC/Geometry/TpceGeo/TpceGeo4.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,13 +494,13 @@
494494
<var name="dAnode" value="{0.2 ,0.4 }" comment="// Inner/Outer anode width " />
495495
<var name="zGatingGrid" value="TPCG_LengthV/2 -(TPCG_dGateGround+2*TPCG_dAnode(2))" comment="// " />
496496
<var name="zGroundGrid" value="TPCG_zGatingGrid+TPCG_dGateGround" comment="// " />
497-
<var name="DeadZone" value="12." comment="// Dead zone before GatingGrid. No hits there " />
497+
<var name="DeadZone" value="0." comment="// Dead zone before GatingGrid. No hits there (prev 12)" />
498498
<var name="tofmax" value="1.0E-6" comment="// Max time of flight" />
499499
</Fill>
500500
<Fill name="TPCG" comment="Subversion 1">
501501
<var name="version" value="3.1" comment="selector" />
502502
<var name="rmax" value="207.77" comment="Max envelope radius" />
503-
<var name="deadzone" value="14" comment="Extend deadzone before gating grid" />
503+
<var name="deadzone" value="0" comment="Extend deadzone before gating grid (prev 14)" />
504504
<var name="tofmax" value="32.0E-6" comment="Increase maximum TOF for particles" />
505505
</Fill>
506506

StarVMC/Geometry/TpceGeo/TpceGeo5.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@
460460
<var name="dAnode" value="{0.2 ,0.4 }" comment="// Inner/Outer anode width " />
461461
<var name="zGatingGrid" value="TPCG_LengthV/2 -(TPCG_dGateGround+2*TPCG_dAnode(2))" comment="// " />
462462
<var name="zGroundGrid" value="TPCG_zGatingGrid+TPCG_dGateGround" comment="// " />
463-
<var name="DeadZone" value="14." comment="// Dead zone before GatingGrid. No hits there " />
463+
<var name="DeadZone" value="0.0" comment="// Dead zone before GatingGrid. No hits there (prev 14)" />
464464
<var name="tofmax" value="32.0E-6" comment="// Max time of flight" />
465465
<var name="NTPSSdiv" value="100" comment="Number of radial TPSS divisions (304 is approx 0.5cm cylindrical divisions)" />
466466
</Fill>

StarVMC/Geometry/TpceGeo/TpceGeo6.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -500,15 +500,15 @@
500500
<var name="dAnode" value="{0.2 ,0.4 }" comment="// Inner/Outer anode width " />
501501
<var name="zGatingGrid" value="TPCG_LengthV/2 -(TPCG_dGateGround+2*TPCG_dAnode(2))" comment="// " />
502502
<var name="zGroundGrid" value="TPCG_zGatingGrid+TPCG_dGateGround" comment="// " />
503-
<var name="DeadZone" value="14." comment="// Dead zone before GatingGrid. No hits there " />
504-
<var name="IDeadZone" value="14." comment="// Dead zone before GatingGrid. (inner) No hits there " />
503+
<var name="DeadZone" value="0." comment="// Dead zone before GatingGrid. No hits there (previously 14)" />
504+
<var name="IDeadZone" value="0." comment="// Dead zone before GatingGrid. (inner) No hits there (prev 14)" />
505505
<var name="tofmax" value="32.0E-6" comment="// Max time of flight" />
506506
</Fill>
507507

508508
<Fill name="TPCG" comment="// TPC basic dimensions" >
509509
<var name="version" value="6.1" comment="// version =&gt; current version " />
510-
<var name="DeadZone" value="13." comment="// Dead zone before GatingGrid. No hits there " />
511-
<var name="IDeadZone" value="12.4" comment="// Dead zone before GatingGrid. (inner) No hits there " />
510+
<var name="DeadZone" value="0." comment="// Dead zone before GatingGrid. No hits there (prev 13)" />
511+
<var name="IDeadZone" value="0.0" comment="// Dead zone before GatingGrid. (inner) No hits there (prev 12.4) " />
512512
</Fill>
513513

514514

mgr/Dyson/Export/AgDL.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from Handler import Handler
1+
from Dyson.Export.Handler import Handler
22
import Dyson.Utils.Shapes
33

44
export_comments = False
@@ -45,7 +45,6 @@ def __init__(self,firstKey=None,keylist=[]):
4545

4646
self.firstKey = firstKey
4747
self.keylist = keylist
48-
# print firstKey
4948

5049
def startElement(self,tag,attr):
5150
out = ''
@@ -62,7 +61,7 @@ def startElement(self,tag,attr):
6261
if value != None: out += '%s=%s '%( key, value.strip() )
6362
except KeyError:
6463
pass
65-
for key,value in attr.iteritems():
64+
for key,value in attr.items():
6665
if value != None: out += '%s=%s '%( key, value.strip() )
6766
out = sanitize(out)
6867
out = '%s '%( tag.upper() ) + out + ';'
@@ -77,8 +76,6 @@ def __init__(self,firstKey=None,keylist=[]):
7776
def startElement(self,tag,attr):
7877
global _depth
7978
out = ''
80-
# if ( tag=='Placement' ):
81-
# print "PLACEMENT: 1st=%s"%self.firstKey
8279
if ( self.firstKey != None ):
8380
try:
8481
firstValue = attr.pop(self.firstKey)
@@ -93,7 +90,7 @@ def startElement(self,tag,attr):
9390
if ( value != None ): out += '%s=%s '%( key, value.strip() )
9491
except KeyError:
9592
pass
96-
for key,value in attr.iteritems():
93+
for key,value in attr.items():
9794
if value != None: out += '%s=%s '%( key, value.strip() )
9895
out = '%s '%tag.upper() + sanitize(out) + '{'
9996

@@ -144,7 +141,7 @@ def __call__(self,line):
144141
output += _prepend
145142
i+=1
146143
output += line
147-
print output
144+
print(output)
148145

149146

150147
# ====================================================================================================

mgr/Dyson/Export/AgML.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,7 +1130,7 @@ def startElement(self,tag,attr):
11301130
if value != None: out += '%s="%s" '%( key, value )
11311131
except KeyError:
11321132
pass
1133-
for key,value in attr.iteritems():
1133+
for key,value in attr.items():
11341134
if value != None: out += '%s="%s" '%( key, value )
11351135
out = sanitize(out)
11361136
out = '<%s '%( tag ) + out + ' />'
@@ -1162,7 +1162,7 @@ def startElement(self,tag,attr):
11621162
if ( value != None ): out += '%s="%s" '%( key, value )
11631163
except KeyError:
11641164
pass
1165-
for key,value in attr.iteritems():
1165+
for key,value in attr.items():
11661166
if value != None: out += '%s="%s" '%( key, value )
11671167
out = '<%s '%tag + sanitize(out) + ' >'
11681168
#out += '>'
@@ -1205,7 +1205,7 @@ def __call__(self,line):
12051205
output += _prepend
12061206
i+=1
12071207
output += line
1208-
print output
1208+
print(output)
12091209

12101210

12111211
# ====================================================================================================
@@ -1824,7 +1824,7 @@ def startElement(self,tag,attr):
18241824
# Perform %var --> material:var and ag_var --> material:var substitution
18251825
#
18261826
myattr = {}
1827-
for key,value in attr.iteritems():
1827+
for key,value in attr.items():
18281828
myattr[key] = ag_variable( attr[key], 'material' )
18291829
Operator.startElement(self,tag,myattr)
18301830

mgr/Dyson/Export/AgMLExceptions.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import os
2-
from exceptions import Exception
2+
try:
3+
from exceptions import Exception
4+
except ImportError:
5+
from builtins import Exception
36

47

58
from Dyson.Utils.Shapes import listOfShapes

mgr/Dyson/Export/AgROOT.py

Lines changed: 17 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from Handler import Handler
1+
from Dyson.Export.Handler import Handler
22

33
import Dyson.Utils.Shapes
44
from Dyson.Utils.Shapes import shape_params
@@ -8,7 +8,7 @@
88
import re
99

1010
# Exception handling
11-
from AgMLExceptions import ContentError, MissingError, AgmlArrayError, AgmlNameError, AgmlCommentError, AgmlShapeError, AgmlAttributeWarning, AgmlFillMissingVarError, MixtureComponentError, AgmlMissingAttributeWarning
11+
from Dyson.Export.AgMLExceptions import ContentError, MissingError, AgmlArrayError, AgmlNameError, AgmlCommentError, AgmlShapeError, AgmlAttributeWarning, AgmlFillMissingVarError, MixtureComponentError, AgmlMissingAttributeWarning
1212

1313
#enable_warnings = os.getenv('AGML_WARNINGS',False)
1414
#enable_warnings = ( os.getenv('STAR','...adev').find('adev') < 0 )
@@ -212,7 +212,7 @@ def checkAttributes( tag, attr, mylist, skip=[], warning=True ):
212212
to the expected values provided in mylist. Keys provided in
213213
the except list will not be checked.
214214
"""
215-
for key,value in attr.iteritems():
215+
for key,value in attr.items():
216216
if key in skip: continue
217217
if key.lower() in skip: continue
218218
key = key.lower()
@@ -353,10 +353,6 @@ def replacements( line ):
353353

354354
for struct in document.structs:
355355

356-
# if struct in myline:
357-
# print "----------------------------------------------------------"
358-
# print ":in: %s"%myline
359-
360356
# Lower case struct to be certain
361357
struct = struct.lower()
362358

@@ -365,7 +361,7 @@ def replacements( line ):
365361
# myline = myline.replace(',',')(')
366362

367363
# Loop over all variables in this struct.
368-
for key,value in _struct_dims.iteritems(): # isnt this backward?
364+
for key,value in _struct_dims.items(): # isnt this backward?
369365

370366
if ( key not in myline.lower() ): continue # can skip finditer
371367

@@ -406,21 +402,10 @@ def replacements( line ):
406402
New = Old.replace('(','[int(')
407403
New = New.replace(')',')-1]')
408404

409-
#print match
410-
#print New
411-
412405
myline = myline.replace(Old,New)
413406

414407

415408

416-
# if struct in myline:
417-
# print ":out: %s"%myline
418-
419-
420-
421-
422-
423-
424409

425410
#
426411
# Replace single quote for double quote
@@ -614,10 +599,6 @@ def characters(self,content):
614599
for flag in content.split(' '):
615600
if len(flag.strip()):
616601
self.flags.append(flag)
617-
## name = flag[:4]
618-
## print '%s::setup();' % flag
619-
## print '%s::Module *%s = new %s::Module();' % ( flag, name, flag )
620-
## print '%s -> ConstructGeometry();' %name
621602

622603

623604
def endElement(self,tag):
@@ -1696,7 +1677,6 @@ def endElement(self,tag):
16961677
if i<len(self.arglist)-1:
16971678
mydef += ','
16981679
mydef += ') { return %s; }' % self.rvalue
1699-
#print mydef
17001680

17011681
# Add this inline function to the implementation file
17021682
document.impl( mydef, unit=self.name )
@@ -1966,13 +1946,13 @@ def startElement(self,tag,attr):
19661946
try:
19671947
self.parent.addVar(name,type,dim,value,comment)
19681948
except AttributeError:
1969-
print 'AttributeError: %s does not implement addVar' % self.parent
1970-
print ' : name %s'%name
1971-
print ' : type %s'%type
1972-
print ' : dim %s'%dim
1973-
print ' : value %s'%value
1974-
print ' : comment %s'%comment
1975-
assert 2+2==5
1949+
print('AttributeError: %s does not implement addVar' % self.parent)
1950+
print(' : name %s'%name)
1951+
print(' : type %s'%type)
1952+
print(' : dim %s'%dim)
1953+
print(' : value %s'%value)
1954+
print(' : comment %s'%comment)
1955+
assert(2+2==5)
19761956

19771957
self.type = type
19781958

@@ -2568,7 +2548,6 @@ def endElement(self,tag):
25682548
output += '// %s_docum.%s = "%s";\n'%(name,var,com)
25692549

25702550
output += "%s.fill();\n"%name.upper()
2571-
#print output
25722551

25732552
document.impl( output, unit=current )
25742553

@@ -3005,7 +2984,7 @@ def startElement(self,tag,attr):
30052984
"""
30062985
block = attr.get('block')
30072986
keys=[]
3008-
for key,value in attr.iteritems():
2987+
for key,value in attr.items():
30092988
keys.append(key)
30102989

30112990

@@ -3025,15 +3004,15 @@ def startElement(self,tag,attr):
30253004
if count:
30263005
document.impl('{ // Paramters passed in via the Create operator', unit=current );
30273006
document.impl('AgCreate createin("%s");'%block, unit=current )
3028-
for key,value in shape.iteritems():
3007+
for key,value in shape.items():
30293008
document.impl('createin.par("%s")=%s;'%(key,value), unit=current)
30303009
document.impl('_create = createin;', unit=current )
30313010
document.impl('}', unit=current );
30323011

30333012

30343013
document.impl( '{', unit=current );
30353014
document.impl( 'AgShape myshape; // undefined shape',unit=current )
3036-
for key,value in shape.iteritems():
3015+
for key,value in shape.items():
30373016
value=value.lower()
30383017
value=replacements(value)
30393018
document.impl( '/// Set shape par: %s = %s'%(key,value), unit=current )
@@ -3080,7 +3059,7 @@ def startElement(self,tag,attr):
30803059

30813060
# Check validity of attributes and issue warning if we are provided
30823061
# an unknown attribute
3083-
for key,value in attr.iteritems():
3062+
for key,value in attr.items():
30843063
if key=='block': continue
30853064
if key=='into' : continue
30863065
key = key.lower()
@@ -3125,7 +3104,6 @@ def startElement(self,tag,attr):
31253104
val = attr.get(key,None)
31263105
if ( val != None ):
31273106
pos = "%s=%s"%(key,val);
3128-
#print "Add pos=%s" %pos
31293107
self.pos.append(pos)
31303108

31313109
# And next the position arguements
@@ -3191,7 +3169,7 @@ def startElement(self,tag,attr):
31913169
parent = parent.parent
31923170

31933171
if into==None:
3194-
print 'AgROOT Warning: parent of block %s not in stack WTF?' % block
3172+
print('AgROOT Warning: parent of block %s not in stack WTF?' % block)
31953173

31963174

31973175

@@ -3918,7 +3896,7 @@ def setParent(self,p): self.parent = p
39183896

39193897

39203898
if ( 1 ):
3921-
print ag_variable( 'material::dens*vacuum')
3899+
print(ag_variable( 'material::dens*vacuum'))
39223900

39233901

39243902
if ( 0 ):

0 commit comments

Comments
 (0)