Skip to content
Snippets Groups Projects
Commit 8ff219a1 authored by Edward Moyse's avatar Edward Moyse
Browse files

Merge branch 'py3.ForwardTransportSvc-20200130' into 'master'

ForwardTransportSvc+CosmicGenerator+G4AtlasTests+FullChainTransforms+ISF_FatrasServices: python 3 fixes

See merge request atlas/athena!29961
parents 40132a3f da8c22db
No related branches found
No related tags found
No related merge requests found
Showing
with 60 additions and 56 deletions
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
from __future__ import print_function
def getForwardTransportSvc(name="ForwardTransportSvc", **kwargs):
from ForwardTransportSvc.ForwardTransportFlags import forwardTransportFlags
......@@ -12,10 +14,10 @@ def getForwardTransportSvc(name="ForwardTransportSvc", **kwargs):
detFlag = forwardTransportFlags.detectorFlag.get_Value()
if detFlag == "ALFA": return getALFAForwardTransportSvc(name, **kwargs)
elif detFlag == "ZDC": return getZDCForwardTransportSvc (name, **kwargs)
else: print "Uknown operation for detectorFlag: ", detFlag
else: print ("Uknown operation for detectorFlag: ", detFlag)
def getALFAForwardTransportSvc(name="ForwardTransportSvc", **kwargs):
print "getALFAForwardTransportSvc"
print ("getALFAForwardTransportSvc")
kwargs.setdefault("EndMarker", 236.888);
kwargs.setdefault("TransportFlag", 1);
kwargs.setdefault("EtaCut", 7.5);
......@@ -24,7 +26,7 @@ def getALFAForwardTransportSvc(name="ForwardTransportSvc", **kwargs):
return CfgMgr.ForwardTransportSvc(name,**kwargs)
def getZDCForwardTransportSvc(name="ForwardTransportSvc", **kwargs):
print "getZDCForwardTransportSvc"
print ("getZDCForwardTransportSvc")
kwargs.setdefault("EndMarker", 141.580);
kwargs.setdefault("TransportFlag", 0);
kwargs.setdefault("EtaCut", 7.5);
......
......@@ -26,7 +26,7 @@ else:
#from TruthExamples.TruthExamplesConf import DumpMC
#topSequence += DumpMC()
print cosmicGen
printfunc (cosmicGen)
#FIXME temporary hacks to ensure that BeamEffectsAlg runs after the Cosmic Generators
def moveAlgInSequence(alg, seq, newpos):
......
print 'SINGLE PARTICLE GENERATOR'
printfunc ('SINGLE PARTICLE GENERATOR')
import AthenaCommon.AtlasUnixGeneratorJob
from AthenaCommon.AlgSequence import AlgSequence
......@@ -11,7 +11,7 @@ job += pg
include("G4AtlasApps/fragment.SimCopyWeights.py")
print "As this is a single particle generator job turn off VertexPositioner (EventFilter already off when ZDCon)"
printfunc ("As this is a single particle generator job turn off VertexPositioner (EventFilter already off when ZDCon)")
simFlags.MagneticField.set_Off()
simFlags.EventFilter.get_Value()['VertexPositioner'] = False
simFlags.EventFilter.get_Value()['BeamEffectTransformation'] = False
......@@ -21,7 +21,7 @@ simFlags.VertexFromCondDB = False
try:
include("ForwardTransportSvc/preInclude.ForwardTransportFlags_3.5TeV_0090.00m_nominal_v02.py")
except:
print "forwardTransportFlags not available in this release. The job will only work if this release uses TwissFiles-00-00-03 or earlier."
printfunc ("forwardTransportFlags not available in this release. The job will only work if this release uses TwissFiles-00-00-03 or earlier.")
include('ForwardTransportSvc/ForwardTransportSvcConfig.ALFA.py')
......
print 'SINGLE PARTICLE GENERATOR'
printfunc ('SINGLE PARTICLE GENERATOR')
## Run ParticleGenerator
# One neutron and one photon per side
import AthenaCommon.AtlasUnixGeneratorJob
......@@ -14,7 +14,7 @@ job += pg
include("G4AtlasApps/fragment.SimCopyWeights.py")
print "As this is a single particle generator job turn off VertexPositioner"
printfunc ("As this is a single particle generator job turn off VertexPositioner")
simFlags.EventFilter.get_Value()['VertexPositioner'] = False
simFlags.EventFilter.get_Value()['BeamEffectTransformation'] = False
simFlags.EventFilter.get_Value()['PrimaryEventRotations'] = False
......@@ -23,6 +23,6 @@ simFlags.VertexFromCondDB= False
try:
include('ForwardTransportSvc/preInclude.ForwardTransportFlags_3.5TeV_0000.55m_nominal_v01.py')
except:
print "forwardTransportFlags not available in this release."
printfunc ("forwardTransportFlags not available in this release.")
include('ForwardTransportSvc/ForwardTransportSvcConfig.ZDC.py')
......@@ -19,7 +19,7 @@ simFlags.EventFilter.set_On()
simFlags.EventFilter.get_Value()['BeamEffectTransformation'] = True
def verbose_beameffecttransformation():
print "verbose BeamEffectTransformation"
printfunc ("verbose BeamEffectTransformation")
from G4AtlasApps import AtlasG4Eng
AtlasG4Eng.G4Eng.menu_EventFilter().getFilter('BeamEffectTransformation').SetVerboseLevel(99)
......
......@@ -119,10 +119,10 @@ ServiceMgr += atRndmGenSvc
from G4AtlasApps.atlas_utilities import MemorySnooper
job += MemorySnooper()
print "###MYOUTPUT###"
print ServiceMgr
print "###MYOUTPUT###"
print job
printfunc ("###MYOUTPUT###" )
printfunc (ServiceMgr )
printfunc ("###MYOUTPUT###" )
printfunc (job )
from AthenaCommon.ConfigurationShelve import saveToAscii
saveToAscii("config.txt")
......@@ -119,10 +119,10 @@ ServiceMgr += atRndmGenSvc
from G4AtlasApps.atlas_utilities import MemorySnooper
job += MemorySnooper()
print "###MYOUTPUT###"
print ServiceMgr
print "###MYOUTPUT###"
print job
printfunc ("###MYOUTPUT###")
printfunc (ServiceMgr)
printfunc ("###MYOUTPUT###")
printfunc (job)
from AthenaCommon.ConfigurationShelve import saveToAscii
saveToAscii("config.txt")
......
......@@ -118,10 +118,10 @@ ServiceMgr += atRndmGenSvc
from G4AtlasApps.atlas_utilities import MemorySnooper
job += MemorySnooper()
print "###MYOUTPUT###"
print ServiceMgr
print "###MYOUTPUT###"
print job
printfunc ("###MYOUTPUT###" )
printfunc (ServiceMgr )
printfunc ("###MYOUTPUT###" )
printfunc (job )
from AthenaCommon.ConfigurationShelve import saveToAscii
saveToAscii("config.txt")
......@@ -123,10 +123,10 @@ ServiceMgr += atRndmGenSvc
from G4AtlasApps.atlas_utilities import MemorySnooper
job += MemorySnooper()
print "###MYOUTPUT###"
print ServiceMgr
print "###MYOUTPUT###"
print job
printfunc ("###MYOUTPUT###" )
printfunc (ServiceMgr )
printfunc ("###MYOUTPUT###" )
printfunc (job )
from AthenaCommon.ConfigurationShelve import saveToAscii
saveToAscii("config.txt")
......@@ -82,7 +82,7 @@ EventSelector.InputCollections = In
try:
EventSelector.CollectionType = CollType
except:
print "Reading from file"
printfunc ("Reading from file")
ServiceMgr.EventSelector.SkipEvents = 0
......
......@@ -82,7 +82,7 @@ EventSelector.InputCollections = In
try:
EventSelector.CollectionType = CollType
except:
print "Reading from file"
printfunc ("Reading from file")
ServiceMgr.EventSelector.SkipEvents = 0
......
......@@ -45,7 +45,7 @@ simFlags.EventFilter.set_On()
simFlags.EventFilter.get_Value()['BeamEffectTransformation'] = True
def verbose_beameffecttransformation():
print "verbose BeamEffectTransformation"
printfunc ("verbose BeamEffectTransformation")
from G4AtlasApps import AtlasG4Eng
AtlasG4Eng.G4Eng.menu_EventFilter().getFilter('BeamEffectTransformation').SetVerboseLevel(99)
......
......@@ -124,10 +124,10 @@ ServiceMgr += atRndmGenSvc
from G4AtlasApps.atlas_utilities import MemorySnooper
job += MemorySnooper()
print "###MYOUTPUT###"
print ServiceMgr
print "###MYOUTPUT###"
print job
printfunc ("###MYOUTPUT###")
printfunc (ServiceMgr)
printfunc ("###MYOUTPUT###")
printfunc (job)
from AthenaCommon.ConfigurationShelve import saveToAscii
saveToAscii("config.txt")
......
......@@ -83,7 +83,7 @@ EventSelector.InputCollections = In
try:
EventSelector.CollectionType = CollType
except:
print "Reading from file"
printfunc ("Reading from file")
ServiceMgr.EventSelector.SkipEvents = 0
......
......@@ -83,7 +83,7 @@ EventSelector.InputCollections = In
try:
EventSelector.CollectionType = CollType
except:
print "Reading from file"
printfunc ("Reading from file")
ServiceMgr.EventSelector.SkipEvents = 0
......
......@@ -123,10 +123,10 @@ ServiceMgr += atRndmGenSvc
from G4AtlasApps.atlas_utilities import MemorySnooper
job += MemorySnooper()
print "###MYOUTPUT###"
print ServiceMgr
print "###MYOUTPUT###"
print job
printfunc ("###MYOUTPUT###" )
printfunc (ServiceMgr )
printfunc ("###MYOUTPUT###" )
printfunc (job )
from AthenaCommon.ConfigurationShelve import saveToAscii
saveToAscii("config.txt")
......@@ -40,7 +40,7 @@ simFlags.EventFilter.set_On()
simFlags.EventFilter.get_Value()['BeamEffectTransformation'] = True
def verbose_beameffecttransformation():
print "verbose BeamEffectTransformation"
printfunc ("verbose BeamEffectTransformation")
from G4AtlasApps import AtlasG4Eng
AtlasG4Eng.G4Eng.menu_EventFilter().getFilter('BeamEffectTransformation').SetVerboseLevel(99)
......
......@@ -59,7 +59,7 @@ except:
AtlasG4Eng.G4Eng._ctrl.G4Command("/geometry/test/recursive_test")
## Turn off processes other than transport
# TODO! Do this using the UI commands
print "WARNING: the fast physics list is dead! We need to tell this JO to run particle transport only"
printfunc ("WARNING: the fast physics list is dead! We need to tell this JO to run particle transport only")
simFlags.InitFunctions.add_function("preInitG4", setup_g4geo)
include("G4AtlasApps/G4Atlas.flat.configuration.py")
......
......@@ -126,7 +126,7 @@ myTest = MySimSkeleton()
def change_worldvolume_y():
myWorld = AtlasG4Eng.G4Eng.Dict_DetFacility.get('WorldVolume')
myWorld.df.SetDy(2000)
print 'Setting Y coordinate of the WorldVolume to 2000'
printfunc ('Setting Y coordinate of the WorldVolume to 2000')
simFlags.InitFunctions.add_function(1, change_worldvolume_y)
......
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
from __future__ import print_function
class FatrasTrackingGeometrySvc:
def __init__(self):
......@@ -29,8 +31,8 @@ class FatrasTrackingGeometrySvc:
from TrkDetDescrSvc.TrkDetDescrJobProperties import TrkDetFlags
if TrkDetFlags.ConfigurationOutputLevel() < 3 :
print '[ Configuration : start ] *** FatrasTrackingGeometry ********************************'
print '[ TrackingGeometrySvc ]'
print ('[ Configuration : start ] *** FatrasTrackingGeometry ********************************')
print ('[ TrackingGeometrySvc ]')
# check whether the material retrieval is ment to be from COOL
if TrkDetFlags.MaterialFromCool() :
......@@ -39,8 +41,8 @@ class FatrasTrackingGeometrySvc:
AtlasMaterialTag = TrkDetFlags.MaterialTagBase()+str(TrkDetFlags.MaterialVersion())+'_'
if TrkDetFlags.ConfigurationOutputLevel() < 3 :
print '[ TrackingGeometrySvc ] Associating DB folder : ',CoolDataBaseFolder
print '[ TrackingGeometrySvc ] base material tag : ',AtlasMaterialTag
print ('[ TrackingGeometrySvc ] Associating DB folder : ',CoolDataBaseFolder)
print ('[ TrackingGeometrySvc ] base material tag : ',AtlasMaterialTag)
# we need the conditions interface
from IOVDbSvc.CondDB import conddb
......@@ -54,7 +56,7 @@ class FatrasTrackingGeometrySvc:
conddb.blockFolder('/GLOBAL/TrackingGeo/LayerMaterial')
conddb.addFolderWithTag('',DataBaseConnection+CoolDataBaseFolder,AtlasMaterialTag+MagicTag,force=True)
if TrkDetFlags.ConfigurationOutputLevel() < 3 :
print '[ TrackingGeometrySvc ] Using Local Database: '+DataBaseConnection
print ('[ TrackingGeometrySvc ] Using Local Database: '+DataBaseConnection )
# make sure that the pool files are in the catalog
#from PoolSvc.PoolSvcConf import PoolSvc
#PoolSvc.ReadCatalog += [ DataBasePath+'PoolFileCatalog.xml' ]
......@@ -164,12 +166,12 @@ class FatrasTrackingGeometrySvc:
from AthenaCommon.AppMgr import ServiceMgr as svcMgr
svcMgr += FatrasTrackingGeometrySvc
print '* [ Configuration : start ] *** FatrasTrackingGeometry ********************************'
print '* [ FatrasTrackingGeometrySvc ]'
print FatrasTrackingGeometrySvc
print '* [ GeometryBuilder ]'
print FatrasGeometryBuilder
print '* [ Configuration : end ] *** FatrasTrackingGeometry ********************************'
print ('* [ Configuration : start ] *** FatrasTrackingGeometry ********************************')
print ('* [ FatrasTrackingGeometrySvc ]')
print (FatrasTrackingGeometrySvc)
print ('* [ GeometryBuilder ]')
print (FatrasGeometryBuilder)
print ('* [ Configuration : end ] *** FatrasTrackingGeometry ********************************')
##################################################################################
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment