def __init__(self): # Only use local text file and dictionary if SLHC_Version set if (SLHC_Flags.SLHC_Version() and not (SLHC_Flags.SLHC_Version() == 'None')): # get the environment variable datapath data_path = os.environ.get('DATAPATH') # database file name database_file = SLHC_Flags.LocalGeometryDbBaseName( ) + SLHC_Flags.SLHC_Version() + '.txt' # dictionary file dict_file = SLHC_Flags.LocalDictionaryBaseName( ) + SLHC_Flags.SLHC_Version() + '.xml' # search the file in the path database_file_path = self.search_file(database_file, data_path) dict_file_path = self.search_file(dict_file, data_path) # screen output print '[ SLHC ] Local geometry database: ', database_file print ' - found in: ', database_file_path print '[ SLHC ] Local dictionary: ', dict_file print ' - found in: ', dict_file_path # the database database_full_path_name = database_file_path + '/' + database_file # Pass text file name to GeometryDBSvc from AthenaCommon.AppMgr import ServiceMgr as svcMgr if not hasattr(svcMgr, 'InDetGeometryDBSvc'): from GeometryDBSvc.GeometryDBSvcConf import GeometryDBSvc svcMgr += GeometryDBSvc("InDetGeometryDBSvc") svcMgr.InDetGeometryDBSvc.TextFileName = database_full_path_name svcMgr.InDetGeometryDBSvc.Sections = [ "Pixel", "SCT", "InDetServMat" ] # Deprecated: this is for old SCT text files os.environ["LocalSlhcGeometryDatabase"] = database_full_path_name # dictionary creation : # BeamPipe modification : do not overwrite dictionary !!!!! ## from DetDescrCnvSvc.DetDescrCnvSvcConf import DetDescrCnvSvc ## DetDescrCnvSvc = DetDescrCnvSvc() ## DetDescrCnvSvc.IdDictFromRDB = False ## DetDescrCnvSvc.InDetIDFileName = dict_file_path+'/'+dict_file else: print 'SLHC_Setup: Geometry coming fully from database' # Alignments have to disabled for Pixels from PixelGeoModel.PixelGeoModelConf import PixelDetectorTool pixelTool = PixelDetectorTool() pixelTool.Alignable = False
InDetFlags.doSLHC = True # --- do not use DCS InDetFlags.useDCS = False # --- turn off conditions # ... missing from InDetSLHC_Example.SLHC_JobProperties import SLHC_Flags SLHC_Flags.SLHC_Version = '' # ---- setup of pixel tool from PixelGeoModel.PixelGeoModelConf import PixelDetectorTool pixelTool = PixelDetectorTool() # --- turn off alignment pixelTool.Alignable = False # --- setup of tracking geometry from TrkDetDescrSvc.TrkDetDescrJobProperties import TrkDetFlags TrkDetFlags.SLHC_Geometry = True TrkDetFlags.PixelBuildingOutputLevel = VERBOSE TrkDetFlags.SCT_BuildingOutputLevel = VERBOSE TrkDetFlags.TRT_BuildingOutputLevel = VERBOSE TrkDetFlags.MagneticFieldCallbackEnforced = False TrkDetFlags.TRT_BuildStrawLayers = False # TrkDetFlags.MaterialFromCool = True TrkDetFlags.MaterialDatabaseLocal = True # False and TrkDetFlags.MaterialFromCool() TrkDetFlags.MaterialStoreGateKey = '/GLOBAL/TrackingGeo/SLHC_LayerMaterial' #TrkDetFlags.MaterialTagBase = 'SLHC_LayerMat_v' TrkDetFlags.MaterialTagBase = 'AtlasLayerMat_v' # TrkDetFlags.MaterialVersion = 6
def __init__(self): # Only use local text file and dictionary if SLHC_Version set if (SLHC_Flags.SLHC_Version() and not (SLHC_Flags.SLHC_Version() == 'None')): # get the environment variable datapath data_path = os.environ.get('DATAPATH') # database file name database_file = SLHC_Flags.LocalGeometryDbBaseName( ) + SLHC_Flags.SLHC_Version() + '.txt' # dictionary file dict_file = SLHC_Flags.LocalDictionaryBaseName( ) + SLHC_Flags.SLHC_Version() + '.xml' # search the file in the path database_file_path = self.search_file(database_file, data_path) dict_file_path = self.search_file(dict_file, data_path) # screen output print '[ SLHC ] Local geometry database: ', database_file print ' - found in: ', database_file_path print '[ SLHC ] Local dictionary: ', dict_file print ' - found in: ', dict_file_path # the database database_full_path_name = database_file_path + '/' + database_file # Pass text file name to GeometryDBSvc from AthenaCommon.AppMgr import ServiceMgr as svcMgr if not hasattr(svcMgr, 'InDetGeometryDBSvc'): from GeometryDBSvc.GeometryDBSvcConf import GeometryDBSvc svcMgr += GeometryDBSvc("InDetGeometryDBSvc") svcMgr.InDetGeometryDBSvc.TextFileName = database_full_path_name svcMgr.InDetGeometryDBSvc.Sections = [ "Pixel", "SCT", "InDetServMat" ] # Deprecated: this is for old SCT text files os.environ["LocalSlhcGeometryDatabase"] = database_full_path_name # dictionary creation from DetDescrCnvSvc.DetDescrCnvSvcConf import DetDescrCnvSvc DetDescrCnvSvc = DetDescrCnvSvc() DetDescrCnvSvc.IdDictFromRDB = False DetDescrCnvSvc.InDetIDFileName = dict_file_path + '/' + dict_file else: print 'SLHC_Setup: Geometry coming fully from database' # GeoModelConfiguration xmlFileDict = {} xmlFileDict["Pixel"] = { "PIXELGENERAL": "LoI_PixelGeneral", "PIXELSIMPLESERVICE": "ECRing_PixelSimpleService", "PIXELDYNAMICSERVICE": "ECRing_PixelDynamicService", "PIXELSERVICEMATERIAL": "ECRing_PixelServiceMaterial", "SILICONMODULES": "ITK_PixelModules", "SILICONREADOUT": "PixelModuleReadout", "PIXELDISCSUPPORT": "ECRing_PixelDiscSupport", "STAVESUPPORT": "LoI_PixelStaveSupport", "MATERIAL": "LoI_Material", } for subDet in ["Pixel"]: for key in xmlFileDict[subDet].keys(): fileName = xmlFileDict[subDet][key] + ".xml" envName = subDet.upper() + "_" + key + "_GEO_XML" os.environ[envName] = fileName print "ENV ", envName, " ", fileName from AthenaCommon.AppMgr import ServiceMgr as svcMgr from AthenaCommon.AppMgr import ToolSvc as toolSvc print "******************************************************************************************" # Service used to build module geometry from PixelModuleTool.PixelModuleToolConf import PixelModuleBuilder moduleGeomBuilder = PixelModuleBuilder(name="PixelModuleSvc") svcMgr += moduleGeomBuilder # Service used to build module design from PixelModuleTool.PixelModuleToolConf import PixelDesignBuilder moduleDesignBuilder = PixelDesignBuilder(name="PixelDesignSvc") svcMgr += moduleDesignBuilder print "******************************************************************************************" from PixelServicesTool.PixelServicesToolConf import PixelServicesTool serviceTool = PixelServicesTool(name="PixelServicesTool") serviceTool.ReadSvcFromDB = True toolSvc += serviceTool print "******************************************************************************************" print "PixelGeoModel - import GeoPixelBarrelLoITool" from PixelLayoutLoI.PixelLayoutLoIConf import GeoPixelBarrelLoITool geoBarrelTool = GeoPixelBarrelLoITool(name="GeoPixelBarrelLoITool") geoBarrelTool.PixelServicesTool = serviceTool toolSvc += geoBarrelTool print "******************************************************************************************" from PixelLayoutECRing.PixelLayoutECRingConf import GeoPixelLayerECRingTool geoECLayerTool = GeoPixelLayerECRingTool( name="GeoPixelLayerECRingTool") toolSvc += geoECLayerTool from PixelLayoutECRing.PixelLayoutECRingConf import GeoPixelEndcapECRingTool geoEndcapTool = GeoPixelEndcapECRingTool( name="GeoPixelEndcapECRingTool") geoEndcapTool.GeoPixelEndcapLayerTool = geoECLayerTool geoEndcapTool.PixelServicesTool = serviceTool toolSvc += geoEndcapTool print "******************************************************************************************" print "PixelGeoModel - import GeoPixelEnvelopeLoITool" from PixelLayoutLoI.PixelLayoutLoIConf import GeoPixelEnvelopeLoITool geoEnvelopeTool = GeoPixelEnvelopeLoITool( name="GeoPixelEnvelopeLoITool") geoEnvelopeTool.GeoPixelBarrelTool = geoBarrelTool geoEnvelopeTool.GeoPixelEndcapTool = geoEndcapTool geoEnvelopeTool.PixelServicesTool = serviceTool toolSvc += geoEnvelopeTool print "******************************************************************************************" from PixelGeoModel.PixelGeoModelConf import PixelDetectorTool pixelTool = PixelDetectorTool() pixelTool.Alignable = False pixelTool.FastBuildGeoModel = True pixelTool.ConfigGeoAlgTool = True pixelTool.ConfigGeoBase = "GeoPixelEnvelopeLoITool"
def __init__(self): # Only use local text file and dictionary if SLHC_Version set if (SLHC_Flags.SLHC_Version() and not (SLHC_Flags.SLHC_Version() == 'None')): # get the environment variable datapath data_path = os.environ.get('DATAPATH') # database file name database_file = SLHC_Flags.LocalGeometryDbBaseName( ) + SLHC_Flags.SLHC_Version() + '.txt' # dictionary file dict_file = SLHC_Flags.LocalDictionaryBaseName( ) + SLHC_Flags.SLHC_Version() + '.xml' # search the file in the path database_file_path = self.search_file(database_file, data_path) dict_file_path = self.search_file(dict_file, data_path) # screen output print('[ SLHC ] Local geometry database: ', database_file) print(' - found in: ', database_file_path) print('[ SLHC ] Local dictionary: ', dict_file) print(' - found in: ', dict_file_path) # the database database_full_path_name = database_file_path + '/' + database_file # Pass text file name to GeometryDBSvc from AthenaCommon.AppMgr import ServiceMgr as svcMgr if not hasattr(svcMgr, 'InDetGeometryDBSvc'): from GeometryDBSvc.GeometryDBSvcConf import GeometryDBSvc svcMgr += GeometryDBSvc("InDetGeometryDBSvc") svcMgr.InDetGeometryDBSvc.TextFileName = database_full_path_name svcMgr.InDetGeometryDBSvc.Sections = [ "Pixel", "SCT", "InDetServMat" ] # Deprecated: this is for old SCT text files os.environ["LocalSlhcGeometryDatabase"] = database_full_path_name else: print('SLHC_Setup: Geometry coming fully from database') # GeoModelConfiguration xmlFileDict = {} xmlFileDict["Pixel"] = { "PIXELGENERAL": "IExtBrl4_PixelGeneral", "PIXELSIMPLESERVICE": "InclBrl_PixelSimpleService", "SILICONMODULES": "ITK_PixelModules", "SILICONREADOUT": "PixelModuleReadout", "STAVESUPPORT": "InclBrl_StaveSupport", "MATERIAL": "InclBrl_Material", "PIXELROUTINGSERVICE": "IExtBrl4_PixelRoutingService", } for subDet in ["Pixel"]: for key in xmlFileDict[subDet].keys(): fileName = xmlFileDict[subDet][key] + ".xml" envName = subDet.upper() + "_" + key + "_GEO_XML" os.environ[envName] = fileName print("ENV ", envName, " ", fileName) from AthenaCommon.AppMgr import ServiceMgr as svcMgr from AthenaCommon.AppMgr import ToolSvc as toolSvc print( "******************************************************************************************" ) print("PixelGeoModel - import module and design tools") # Service used to build module geometry from PixelModuleTool.PixelModuleToolConf import PixelModuleBuilder moduleGeomBuilder = PixelModuleBuilder(name="PixelModuleSvc") svcMgr += moduleGeomBuilder # Service used to build module design from PixelModuleTool.PixelModuleToolConf import PixelDesignBuilder moduleDesignBuilder = PixelDesignBuilder(name="PixelDesignSvc") svcMgr += moduleDesignBuilder print( "******************************************************************************************" ) print("PixelGeoModel - import PixelServiceTool") from PixelServicesTool.PixelServicesToolConf import PixelServicesTool serviceTool = PixelServicesTool(name="PixelServicesTool") serviceTool.ReadSvcFromDB = True serviceTool.SvcDynAutomated = False serviceTool.BarrelModuleMaterial = True toolSvc += serviceTool print( "******************************************************************************************" ) print("PixelGeoModel - import GeoPixelLayerInclRefTool") from BarrelInclinedRef.BarrelInclinedRefConf import GeoPixelLayerInclRefTool geoLayerInnerTool = GeoPixelLayerInclRefTool( name="InnerPixelLayerTool") toolSvc += geoLayerInnerTool from BarrelInclinedRef.BarrelInclinedRefConf import GeoPixelLayerPlanarRefTool geoLayerOuterTool = GeoPixelLayerPlanarRefTool( name="OuterPixelLayerTool") toolSvc += geoLayerOuterTool print("PixelGeoModel - import GeoPixelBarrelInclRefTool") from BarrelInclinedRef.BarrelInclinedRefConf import GeoPixelBarrelInclRefTool geoBarrelTool = GeoPixelBarrelInclRefTool( name="GeoPixelBarrelInclRefTool") geoBarrelTool.InnerPixelLayerTool = geoLayerInnerTool geoBarrelTool.OuterPixelLayerTool = geoLayerOuterTool geoBarrelTool.MaxInnerLayerMax = 2 geoBarrelTool.PixelServicesTool = serviceTool toolSvc += geoBarrelTool print( "******************************************************************************************" ) from EndcapRingRef.EndcapRingRefConf import GeoPixelLayerECRingRefTool geoECLayerTool = GeoPixelLayerECRingRefTool( name="GeoPixelLayerECRingRefTool") toolSvc += geoECLayerTool from EndcapRingRef.EndcapRingRefConf import GeoPixelEndcapECRingRefTool geoEndcapTool = GeoPixelEndcapECRingRefTool( name="GeoPixelEndcapECRingRefTool") geoEndcapTool.GeoPixelEndcapLayerTool = geoECLayerTool geoEndcapTool.PixelServicesTool = serviceTool toolSvc += geoEndcapTool print( "******************************************************************************************" ) print("PixelGeoModel - import GeoPixelEnvelopeInclRefTool") from BarrelInclinedRef.BarrelInclinedRefConf import GeoPixelEnvelopeInclRefTool geoEnvelopeTool = GeoPixelEnvelopeInclRefTool( name="GeoPixelEnvelopeInclRefTool") geoEnvelopeTool.GeoPixelBarrelTool = geoBarrelTool geoEnvelopeTool.GeoPixelEndcapTool = geoEndcapTool geoEnvelopeTool.PixelServicesTool = serviceTool toolSvc += geoEnvelopeTool print( "******************************************************************************************" ) from PixelGeoModel.PixelGeoModelConf import PixelDetectorTool pixelTool = PixelDetectorTool() pixelTool.Alignable = False pixelTool.FastBuildGeoModel = True pixelTool.ConfigGeoAlgTool = True pixelTool.ConfigGeoBase = "GeoPixelEnvelopeInclRefTool"
def __init__(self): import os, shutil from PyJobTransformsCore.envutil import * #-------------------------------------------------------------- # XML reader #------------------------------------------------------------- ###### Setup ITk XML reader ###### from InDetTrackingGeometryXML.InDetTrackingGeometryXMLConf import InDet__XMLReaderSvc xmlReader = InDet__XMLReaderSvc(name='InDetXMLReaderSvc') PixelLayout = "ATLAS" SCTLayout = "ATLAS" # VeryForward = False dictionaryFileName = "InDetIdDictFiles/IdDictInnerDetector_SLHC-23-24-dev9.xml" createXML = True doPix = True doSCT = True PIXMODULEFILE = "PixelModules.xml" PIXSTAVEFILE = str(PixelLayout) + "_PixelStave.xml" PIXBARRELFILE = str(PixelLayout) + "_PixelBarrel.xml" PIXENDCAPFILE = str(PixelLayout) + "_PixelEndcap.xml" SCTMODULEFILE = str(SCTLayout) + "_SCTModules.xml" SCTSTAVEFILE = str(SCTLayout) + "_SCTStave.xml" SCTBARRELFILE = str(SCTLayout) + "_SCTBarrel.xml" SCTENDCAPFILE = str(SCTLayout) + "_SCTEndcap.xml" ## if VeryForward: ## PIXSTAVEFILE = str(PixelLayout) + "_PixelStave_VF.xml" ## PIXBARRELFILE = str(PixelLayout) + "_PixelBarrel_VF.xml" ## PIXENDCAPFILE = str(PixelLayout) + "_PixelEndcap_VF.xml" ## ###### Setup dictionary file to use ###### ## dictDir = os.path.dirname(dictionaryFileName) ## if not os.path.exists(dictDir): ## os.makedirs(dictDir) ###### Setup XML builders properties ###### xmlReader.dictionaryFileName = dictionaryFileName xmlReader.createXMLDictionary = createXML xmlReader.doPix = doPix xmlReader.doSCT = doSCT ###### Setup XML files for Material ###### xmlReader.XML_Materials = find_file_env("Materials.xml", 'DATAPATH') ###### Setup XML filesfor pixels ###### xmlReader.XML_PixelModules = find_file_env(str(PIXMODULEFILE), 'DATAPATH') xmlReader.XML_PixelStaves = find_file_env(str(PIXSTAVEFILE), 'DATAPATH') xmlReader.XML_PixelBarrelLayers = find_file_env( str(PIXBARRELFILE), 'DATAPATH') xmlReader.XML_PixelEndcapLayers = find_file_env( str(PIXENDCAPFILE), 'DATAPATH') ###### Setup XML files for SCT ###### xmlReader.XML_SCTModules = find_file_env(str(SCTMODULEFILE), 'DATAPATH') xmlReader.XML_SCTStaves = find_file_env(str(SCTSTAVEFILE), 'DATAPATH') xmlReader.XML_SCTBarrelLayers = find_file_env(str(SCTBARRELFILE), 'DATAPATH') xmlReader.XML_SCTEndcapLayers = find_file_env(str(SCTENDCAPFILE), 'DATAPATH') from AthenaCommon.AppMgr import theApp from AthenaCommon.AppMgr import ServiceMgr as svcMgr svcMgr += xmlReader theApp.CreateSvc.insert(0, "InDet::XMLReaderSvc/InDetXMLReaderSvc") print svcMgr # Only use local text file and dictionary if SLHC_Version set if (SLHC_Flags.SLHC_Version() and not (SLHC_Flags.SLHC_Version() == 'None')): # get the environment variable datapath data_path = os.environ.get('DATAPATH') # database file name database_file = SLHC_Flags.LocalGeometryDbBaseName( ) + SLHC_Flags.SLHC_Version() + '.txt' # dictionary file dict_file = SLHC_Flags.LocalDictionaryBaseName( ) + SLHC_Flags.SLHC_Version() + '.xml' # search the file in the path database_file_path = self.search_file(database_file, data_path) dict_file_path = self.search_file(dict_file, data_path) # screen output print '[ SLHC ] Local geometry database: ', database_file print ' - found in: ', database_file_path print '[ SLHC ] Local dictionary: ', dict_file print ' - found in: ', dict_file_path # the database database_full_path_name = database_file_path + '/' + database_file # Pass text file name to GeometryDBSvc from AthenaCommon.AppMgr import ServiceMgr as svcMgr if not hasattr(svcMgr, 'InDetGeometryDBSvc'): from GeometryDBSvc.GeometryDBSvcConf import GeometryDBSvc svcMgr += GeometryDBSvc("InDetGeometryDBSvc") svcMgr.InDetGeometryDBSvc.TextFileName = database_full_path_name svcMgr.InDetGeometryDBSvc.Sections = [ "Pixel", "SCT", "InDetServMat" ] # Deprecated: this is for old SCT text files os.environ["LocalSlhcGeometryDatabase"] = database_full_path_name ## # dictionary creation ## from DetDescrCnvSvc.DetDescrCnvSvcConf import DetDescrCnvSvc ## DetDescrCnvSvc = DetDescrCnvSvc() ## DetDescrCnvSvc.IdDictFromRDB = False ## DetDescrCnvSvc.InDetIDFileName = dict_file_path+'/'+dict_file else: print 'SLHC_Setup: Geometry coming fully from database' ## # Alignments have to disabled for Pixels ## from PixelGeoModel.PixelGeoModelConf import PixelDetectorTool ## pixelTool = PixelDetectorTool() ## pixelTool.Alignable = False # GeoModelConfiguration xmlFileDict = {} xmlFileDict["Pixel"] = { "PIXELGENERAL": "AlpinePixelGeneral", # "PIXELSIMPLESERVICE":"PixelSimpleService", "SILICONMODULES": "PixelModules", "SILICONREADOUT": "PixelModuleReadout", "STAVESUPPORT": "ATLASStaveSupport", "MATERIAL": "ATLASMaterial", # "PIXELROUTINGSERVICE":"AlpinePixelRoutingService", } for subDet in ["Pixel"]: for key in xmlFileDict[subDet].keys(): fileName = xmlFileDict[subDet][key] + ".xml" envName = subDet.upper() + "_" + key + "_GEO_XML" os.environ[envName] = fileName print "ENV ", envName, " ", fileName from AthenaCommon.AppMgr import ServiceMgr as svcMgr from AthenaCommon.AppMgr import ToolSvc as toolSvc # Service used to build module geometry from PixelModuleTool.PixelModuleToolConf import PixelModuleBuilder moduleGeomBuilder = PixelModuleBuilder(name="PixelModuleSvc") svcMgr += moduleGeomBuilder # Service used to build module design from PixelModuleTool.PixelModuleToolConf import PixelDesignBuilder moduleDesignBuilder = PixelDesignBuilder(name="PixelDesignSvc") svcMgr += moduleDesignBuilder from PixelServicesTool.PixelServicesToolConf import PixelServicesTool serviceTool = PixelServicesTool(name="PixelServicesTool") serviceTool.ReadSvcFromDB = True serviceTool.SvcDynAutomated = False toolSvc += serviceTool print "******************************************************************************************" print "PixelGeoModel - import GeoPixelBarrelLoITool" from PixelLayoutLoI.PixelLayoutLoIConf import GeoPixelBarrelLoITool geoBarrelTool = GeoPixelBarrelLoITool(name="GeoPixelBarrelLoITool") geoBarrelTool.PixelServicesTool = serviceTool toolSvc += geoBarrelTool print "******************************************************************************************" print "PixelGeoModel - import GeoPixelEndcapLoITool" from PixelLayoutLoI.PixelLayoutLoIConf import GeoPixelEndcapLoITool geoEndcapTool = GeoPixelEndcapLoITool(name="GeoPixelEndcapLoITool") geoEndcapTool.PixelServicesTool = serviceTool toolSvc += geoEndcapTool print "******************************************************************************************" print "PixelGeoModel - import GeoPixelEnvelopeLoITool" from PixelLayoutLoI.PixelLayoutLoIConf import GeoPixelEnvelopeLoITool geoEnvelopeTool = GeoPixelEnvelopeLoITool( name="GeoPixelEnvelopeLoITool") geoEnvelopeTool.GeoPixelBarrelTool = geoBarrelTool geoEnvelopeTool.GeoPixelEndcapTool = geoEndcapTool geoEnvelopeTool.PixelServicesTool = serviceTool toolSvc += geoEnvelopeTool print "******************************************************************************************" from PixelGeoModel.PixelGeoModelConf import PixelDetectorTool pixelTool = PixelDetectorTool() pixelTool.Alignable = False pixelTool.FastBuildGeoModel = True pixelTool.ConfigGeoAlgTool = True pixelTool.ConfigGeoBase = "GeoPixelEnvelopeLoITool"