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') # Alignments have to disabled for Pixels from PixelGeoModel.PixelGeoModelConf import PixelDetectorTool pixelTool = PixelDetectorTool() pixelTool.Alignable = False
def __init__(self, name='CustomTrackingGeometry', geometryName='CustomGeometry', prefix='', customPixel=False, customSCT=False, customTRT=False, writeXML=True, layerAssociation=True, TRTstrawLayers=False): # get the custom geometry builder from ISF_FatrasDetDescrTools.CustomInDetTrackingGeometryBuilder import CustomInDetTrackingGeometryBuilder self.__ctGeometryBuilder__ = CustomInDetTrackingGeometryBuilder( name=geometryName + 'Builder', namePrefix=prefix, setLayerAssociation=layerAssociation, buildTrtStrawLayers=TRTstrawLayers, buildCustomPixel=customPixel, buildCustomSCT=customSCT, buildCustomTRT=customTRT, createXML=writeXML, dictionaryFileName=geometryName + '.xml') # now attach the file to GeoModel from AthenaCommon.AppMgr import theApp from AthenaCommon.AppMgr import ServiceMgr as svcMgr import AthenaCommon.AtlasUnixStandardJob # Create DetDescrCnvSvc and add to SvcMgr from DetDescrCnvSvc.DetDescrCnvSvcConf import DetDescrCnvSvc DetDescrCnvSvc = DetDescrCnvSvc() DetDescrCnvSvc.IdDictFromRDB = False DetDescrCnvSvc.InDetIDFileName = geometryName + '.xml' DetDescrCnvSvc.IdDictName = "IdDictParser/ATLAS_IDS.xml" DetDescrCnvSvc.DoInitNeighbours = False svcMgr += DetDescrCnvSvc svcMgr.EventPersistencySvc.CnvServices += ["DetDescrCnvSvc"] theApp.Dlls += ["IdDictDetDescrCnv"] from TrkDetDescrSvc.TrkDetDescrJobProperties import TrkDetFlags TrkDetFlags.ISF_FatrasCustomGeometry = True TrkDetFlags.ISF_FatrasCustomGeometryBuilderName = geometryName + 'Builder'
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"
############################################################### # # Job options file # This fragment creates GeoModel service and loads TileGeoModel # It should not be used if more than one detector needs to be # loaded. In this case use AtlasGeoModel/GeoModelInit instead # #============================================================== if not 'TILEGEOMODEL_TILEGEOMODEL_HAS_BEEN_INCLUDED' in dir(): TILEGEOMODEL_TILEGEOMODEL_HAS_BEEN_INCLUDED = 1 from DetDescrCnvSvc.DetDescrCnvSvcConf import DetDescrCnvSvc DetDescrCnvSvc = DetDescrCnvSvc() DetDescrCnvSvc.IdDictFromRDB = True # Conditions DB setup and TagInfo from IOVDbSvc.CondDB import conddb import EventInfoMgt.EventInfoMgtInit from AthenaCommon.AppMgr import ServiceMgr from GeoModelSvc.GeoModelSvcConf import GeoModelSvc GeoModelSvc = GeoModelSvc() ServiceMgr += GeoModelSvc theApp.CreateSvc += ["GeoModelSvc"] #load all identifiers #include( "TileIdCnv/TileIdCnv_jobOptions.py" ) #include( "CaloIdCnv/CaloIdCnv_joboptions.py" ) from TileGeoModel.TileGeoModelConf import TileDetectorTool GeoModelSvc.DetectorTools += [TileDetectorTool()]