def _setupGeoModel(): from AthenaCommon.JobProperties import jobproperties from AthenaCommon.AppMgr import ServiceMgr as svcMgr try: from TrkDetDescrSvc.TrkDetDescrJobProperties import TrkDetFlags if not (hasattr(svcMgr, 'DetDescrCnvSvc') and TrkDetFlags.ISF_FatrasCustomGeometry()): import DetDescrCnvSvc.DetStoreConfig svcMgr.DetDescrCnvSvc.IdDictFromRDB = True except ImportError: import DetDescrCnvSvc.DetStoreConfig svcMgr.DetDescrCnvSvc.IdDictFromRDB = True # Conditions DB setup and TagInfo from IOVDbSvc.CondDB import conddb import EventInfoMgt.EventInfoMgtInit if (jobproperties.Global.DataSource() == "geant3"): from AtlasGeoModel import GeoModelInitDC1 elif (jobproperties.Global.DetGeo() == "ctbh8"): from AtlasGeoModel import GeoModelInitCTB elif (jobproperties.Global.DetGeo() == "ctbh6"): from AtlasGeoModel import GeoModelInitH6 else: from AtlasGeoModel import GeoModelInitStandard pass
def getInDetTrackingGeometryBuilder(name="ISF_InDetTrackingGeometryBuilder", **kwargs): # get hand on the ID Tracking Geometry Builder kwargs.setdefault("namePrefix" , 'Fatras') kwargs.setdefault("setLayerAssociation" , False) #kwargs.setdefault("VolumeEnclosureOuterR" , 1148.) ### HACK: Cannot set via imput arguments. Is this right?? -kg if TrkDetFlags.ISF_FatrasCustomGeometry() : from ISF_FatrasDetDescrTools.CustomInDetTrackingGeometryBuilder import CustomInDetTrackingGeometryBuilder as IDGeometryBuilder else : if not TrkDetFlags.SLHC_Geometry() : kwargs.setdefault("buildTrtStrawLayers" , True) from InDetTrackingGeometry.ConfiguredInDetTrackingGeometryBuilder import ConfiguredInDetTrackingGeometryBuilder as IDGeometryBuilder else : from InDetTrackingGeometry.ConfiguredSLHC_InDetTrackingGeometryBuilder import ConfiguredSLHC_InDetTrackingGeometryBuilder as IDGeometryBuilder t = IDGeometryBuilder(name, **kwargs ) t.VolumeEnclosureOuterR = 1148. #t.EnvelopeDefinitionSvc = 'ISF_EnvelopeDefSvc' return t
def __init__(self, name='AtlasTrackingGeometrySvc'): if TrkDetFlags.ConfigurationOutputLevel() < 3: print('[ Configuration : start ] *** ' + name + ' ********************************') print('[ TrackingGeometrySvc ]') from AthenaCommon.AppMgr import ToolSvc ################################################################################# # The Geometry Builder ################################################################################# # the name to register the Geometry AtlasTrackingGeometryName = 'AtlasTrackingGeometry' # the geometry builder alg tool from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__GeometryBuilder AtlasGeometryBuilder = Trk__GeometryBuilder( name='AtlasGeometryBuilder') # switch the building outputlevel on AtlasGeometryBuilder.OutputLevel = TrkDetFlags.ConfigurationOutputLevel( ) # the envelope definition service from AthenaCommon.CfgGetter import getPrivateTool,getPrivateToolClone,getPublicTool,getPublicToolClone,\ getService,getServiceClone,getAlgorithm,getAlgorithmClone AtlasEnvelopeSvc = getService('AtlasGeometry_EnvelopeDefSvc') # (ID) if DetFlags.ID_on(): # get hand on the ID Tracking Geometry Builder if TrkDetFlags.ISF_FatrasCustomGeometry(): if hasattr(ToolSvc, TrkDetFlags.ISF_FatrasCustomGeometryBuilderName()): InDetTrackingGeometryBuilder = getattr( ToolSvc, TrkDetFlags.ISF_FatrasCustomGeometryBuilderName()) elif TrkDetFlags.XMLFastCustomGeometry(): if hasattr(ToolSvc, TrkDetFlags.InDetTrackingGeometryBuilderName()): InDetTrackingGeometryBuilder = getattr( ToolSvc, TrkDetFlags.InDetTrackingGeometryBuilderName()) else: if not TrkDetFlags.SLHC_Geometry( ) and not TrkDetFlags.InDetStagedGeometryBuilder(): from InDetTrackingGeometry.ConfiguredInDetTrackingGeometryBuilder import ConfiguredInDetTrackingGeometryBuilder as IDGeometryBuilder elif not TrkDetFlags.SLHC_Geometry(): from InDetTrackingGeometry.ConfiguredStagedTrackingGeometryBuilder import ConfiguredStagedTrackingGeometryBuilder as IDGeometryBuilder else: from InDetTrackingGeometry.ConfiguredSLHC_InDetTrackingGeometryBuilder import ConfiguredSLHC_InDetTrackingGeometryBuilder as IDGeometryBuilder InDetTrackingGeometryBuilder = IDGeometryBuilder( name='InDetTrackingGeometryBuilder') InDetTrackingGeometryBuilder.EnvelopeDefinitionSvc = AtlasEnvelopeSvc InDetTrackingGeometryBuilder.OutputLevel = TrkDetFlags.InDetBuildingOutputLevel( ) # and give it to the Geometry Builder AtlasGeometryBuilder.InDetTrackingGeometryBuilder = InDetTrackingGeometryBuilder # # (Calo) if DetFlags.Calo_on(): from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__CylinderVolumeCreator CaloVolumeCreator = Trk__CylinderVolumeCreator("CaloVolumeCreator") CaloVolumeCreator.OutputLevel = TrkDetFlags.CaloBuildingOutputLevel( ) ToolSvc += CaloVolumeCreator from CaloTrackingGeometry.ConfiguredCaloTrackingGeometryBuilder import ConfiguredCaloTrackingGeometryBuilder as ConfiguredCaloGeo CaloTrackingGeometryBuilder = ConfiguredCaloGeo( name='CaloTrackingGeometryBuilder') CaloTrackingGeometryBuilder.TrackingVolumeCreator = CaloVolumeCreator CaloTrackingGeometryBuilder.EnvelopeDefinitionSvc = AtlasEnvelopeSvc CaloTrackingGeometryBuilder.OutputLevel = TrkDetFlags.CaloBuildingOutputLevel( ) CaloTrackingGeometryBuilder.GeometryName = 'Calo' # and give it to the Geometry Builder AtlasGeometryBuilder.CaloTrackingGeometryBuilder = CaloTrackingGeometryBuilder # (Muon) if DetFlags.Muon_on(): from MuonTrackingGeometry.ConfiguredMuonTrackingGeometry import MuonTrackingGeometryBuilder MuonTrackingGeometryBuilder.EnvelopeDefinitionSvc = AtlasEnvelopeSvc # and give it to the Geometry Builder AtlasGeometryBuilder.MuonTrackingGeometryBuilder = MuonTrackingGeometryBuilder # processors AtlasGeometryProcessors = [] # check whether the material retrieval is ment to be from COOL if TrkDetFlags.MaterialSource() is 'COOL': # the material provider from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__LayerMaterialProvider as LayerMaterialProvider AtlasMaterialProvider = LayerMaterialProvider( 'AtlasMaterialProvider') AtlasMaterialProvider.OutputLevel = TrkDetFlags.ConfigurationOutputLevel( ) AtlasMaterialProvider.LayerMaterialMapName = TrkDetFlags.MaterialStoreGateKey( ) AtlasGeometryProcessors += [AtlasMaterialProvider] # the tag names CoolDataBaseFolder = TrkDetFlags.MaterialStoreGateKey() AtlasMaterialTag = TrkDetFlags.MaterialTagBase() + str( TrkDetFlags.MaterialVersion( )) + TrkDetFlags.MaterialSubVersion() + '_' if TrkDetFlags.ConfigurationOutputLevel() < 3: print('[ TrackingGeometrySvc ] Associating DB folder : ', CoolDataBaseFolder) # we need the conditions interface from IOVDbSvc.CondDB import conddb # use a local database if TrkDetFlags.MaterialDatabaseLocal(): # specify the local database DataBasePath = TrkDetFlags.MaterialDatabaseLocalPath() DataBaseName = TrkDetFlags.MaterialDatabaseLocalName() MagicTag = TrkDetFlags.MaterialMagicTag() DataBaseConnection = '<dbConnection>sqlite://X;schema=' + DataBasePath + DataBaseName + ';dbname=OFLP200</dbConnection>' conddb.blockFolder('/GLOBAL/TrackingGeo/LayerMaterialV2') conddb.addFolderWithTag('', DataBaseConnection + CoolDataBaseFolder, AtlasMaterialTag + MagicTag, force=True) if TrkDetFlags.ConfigurationOutputLevel() < 3: print('[ TrackingGeometrySvc ] Using Local Database: ' + DataBaseConnection) # make sure that the pool files are in the catalog elif TrkDetFlags.SLHC_Geometry(): # set the folder to the SLHC location CoolDataBaseFolder = '/GLOBAL/TrackingGeo/LayerMaterialITK' ctag = AtlasMaterialTag + TrkDetFlags.MaterialMagicTag() cfoldertag = CoolDataBaseFolder + ' <tag>' + ctag + '</tag>' conddb.addFolderSplitMC('GLOBAL', cfoldertag, cfoldertag) else: print('[ TrackingGeometrySvc ] base material tag : ', AtlasMaterialTag) cfolder = CoolDataBaseFolder + '<tag>TagInfoMajor/' + AtlasMaterialTag + '/GeoAtlas</tag>' print('[ TrackingGeometrySvc ] translated to COOL: ', cfolder) # load the right folders (preparation for calo inclusion) conddb.addFolderSplitMC('GLOBAL', cfolder, cfolder) elif TrkDetFlags.MaterialSource() is 'Input': # the material provider from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__InputLayerMaterialProvider AtlasMaterialProvider = Trk__InputLayerMaterialProvider( 'AtlasMaterialProvider') AtlasMaterialProvider.OutputLevel = TrkDetFlags.ConfigurationOutputLevel( ) AtlasGeometryProcessors += [AtlasMaterialProvider] # material validation if TrkDetFlags.MaterialValidation(): # load the material inspector from TrkDetDescrTestTools.TrkDetDescrTestToolsConf import Trk__LayerMaterialInspector AtlasLayerMaterialInspector = Trk__LayerMaterialInspector( 'AtlasLayerMaterialInspector') AtlasLayerMaterialInspector.OutputLevel = TrkDetFlags.ConfigurationOutputLevel( ) AtlasGeometryProcessors += [AtlasLayerMaterialInspector] # call the base class constructor : sets the tools Trk__TrackingGeometrySvc.__init__(self,name,\ GeometryBuilder = AtlasGeometryBuilder,\ TrackingGeometryName = AtlasTrackingGeometryName,\ GeometryProcessors = AtlasGeometryProcessors, \ BuildGeometryFromTagInfo = True,\ OutputLevel = TrkDetFlags.ConfigurationOutputLevel()) # screen output of the configuration if TrkDetFlags.ConfigurationOutputLevel() < 3: print(self) print('* [ GeometryBuilder ]') print(AtlasGeometryBuilder) print('* [ Configuration : end ] ***' + name + '********************************')
# --- the truth track creation algorithm from InDetRecExample.TrackingCommon import getInDetPRDtoTrackMapToolGangedPixels from TrkTruthTrackAlgs.TrkTruthTrackAlgsConf import Trk__TruthTrackCreation InDetTruthTrackCreation = Trk__TruthTrackCreation( name='InDetTruthTrackCreation', PRD_TruthTrajectoryBuilder=ISF_PRD_TruthTrajectoryBuilder, TruthTrackBuilder=InDetTruthTrackBuilder, OutputTrackCollection=InDetKeys.PseudoTracks(), AssociationTool=getIFS_PRDtoTrackMapTool(), TrackSummaryTool=InDetTrackSummaryTool) InDetTruthTrackCreation.OutputLevel = OutputLevel #VERBOSE topSequence += InDetTruthTrackCreation print InDetTruthTrackCreation if TrkDetFlags.ISF_FatrasCustomGeometry(): InDetKeys.PixelClustersTruth = "PRD_MultiTruthPlanarPixel" InDetKeys.SCT_ClustersTruth = "PRD_MultiTruthPlanarSCT" InDetFlags.doPhysValMon = True InDetRecTestBLayerTool = None InDetTrackSummaryToolSharedHits = InDetTrackSummaryTool InDetKeys.UnslimmedTracks = InDetKeys.PseudoTracks() InDetKeys.UnslimmedTracksTruth = InDetKeys.PseudoTracksTruth() InputTrackCollection = InDetKeys.PseudoTracks() include("InDetRecExample/ConfiguredInDetTrackTruth.py") InDetTracksTruth = ConfiguredInDetTrackTruth( InDetKeys.PseudoTracks(), InDetKeys.PseudoDetailedTracksTruth(),