def __init__(self, name): subDetectors = [] if DetFlags.pixel_on(): subDetectors += ["Pixel"] if DetFlags.SCT_on(): subDetectors += ["SCT"] if DetFlags.TRT_on(): subDetectors += ["TRT"] if DetFlags.Calo_on(): subDetectors += ["Calo"] from ActsGeometry.ActsGeometryConf import ActsTrackingGeometrySvc actsTrackingGeometrySvc = ActsTrackingGeometrySvc( name="ActsTrackingGeometrySvc", BuildSubDetectors=subDetectors) from AthenaCommon.AppMgr import ServiceMgr ServiceMgr += actsTrackingGeometrySvc from ActsGeometry.ActsGeometryConf import NominalAlignmentCondAlg from AthenaCommon.AlgSequence import AthSequencer condSeq = AthSequencer("AthCondSeq") if not hasattr(condSeq, "NominalAlignmentCondAlg"): condSeq += NominalAlignmentCondAlg(name="NominalAlignmentCondAlg") ActsTrackingGeometryTool.__init__( self, name, ActsTrackingGeometrySvc=actsTrackingGeometrySvc)
def getATLAS_RegionCreatorList(): regionCreatorList = [] from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags as commonGeoFlags from AtlasGeoModel.InDetGMJobProperties import InDetGeometryFlags as geoFlags isUpgrade = commonGeoFlags.Run() == "RUN4" or ( commonGeoFlags.Run() == "UNDEFINED" and geoFlags.isSLHC()) isRUN2 = (commonGeoFlags.Run() in [ "RUN2", "RUN3" ]) or (commonGeoFlags.Run() == "UNDEFINED" and geoFlags.isIBL()) from G4AtlasApps.SimFlags import simFlags from AthenaCommon.DetFlags import DetFlags if simFlags.SimulateCavern.get_Value(): regionCreatorList += [ 'SX1PhysicsRegionTool', 'BedrockPhysicsRegionTool', 'CavernShaftsConcretePhysicsRegionTool' ] #regionCreatorList += ['CavernShaftsAirPhysicsRegionTool'] # Not used currently if DetFlags.ID_on(): if DetFlags.pixel_on(): regionCreatorList += ['PixelPhysicsRegionTool'] if DetFlags.SCT_on(): regionCreatorList += ['SCTPhysicsRegionTool'] if DetFlags.TRT_on() and not isUpgrade: regionCreatorList += ['TRTPhysicsRegionTool'] if isRUN2: regionCreatorList += ['TRT_ArPhysicsRegionTool' ] #'TRT_KrPhysicsRegionTool' # FIXME dislike the ordering here, but try to maintain the same ordering as in the old configuration. if DetFlags.bpipe_on(): if simFlags.BeamPipeSimMode.statusOn and simFlags.BeamPipeSimMode( ) != "Normal": regionCreatorList += ['BeampipeFwdCutPhysicsRegionTool'] if simFlags.ForwardDetectors.statusOn and simFlags.ForwardDetectors( ) == 2: regionCreatorList += ['FWDBeamLinePhysicsRegionTool'] if DetFlags.Calo_on(): if DetFlags.geometry.LAr_on(): ## Shower parameterization overrides the calibration hit flag if simFlags.LArParameterization.statusOn and simFlags.LArParameterization() > 0 \ and simFlags.CalibrationRun.statusOn and simFlags.CalibrationRun.get_Value() in ['LAr','LAr+Tile','DeadLAr']: print( 'You requested both calibration hits and frozen showers / parameterization in the LAr.' ) print( ' Such a configuration is not allowed, and would give junk calibration hits where the showers are modified.' ) print( ' Please try again with a different value of either simFlags.LArParameterization (' + str(simFlags.LArParameterization()) + ') or simFlags.CalibrationRun (' + str(simFlags.CalibrationRun.get_Value()) + ')') raise RuntimeError('Configuration not allowed') if simFlags.LArParameterization() > 0: regionCreatorList += [ 'EMBPhysicsRegionTool', 'EMECPhysicsRegionTool', 'HECPhysicsRegionTool', 'FCALPhysicsRegionTool' ] # FIXME 'EMBPhysicsRegionTool' used for parametrization also - do we need a second instance?? regionCreatorList += [ 'EMECParaPhysicsRegionTool', 'FCALParaPhysicsRegionTool', 'FCAL2ParaPhysicsRegionTool' ] if simFlags.LArParameterization.get_Value() > 1: regionCreatorList += [ 'PreSampLArPhysicsRegionTool', 'DeadMaterialPhysicsRegionTool' ] elif simFlags.LArParameterization( ) is None or simFlags.LArParameterization() == 0: regionCreatorList += [ 'EMBPhysicsRegionTool', 'EMECPhysicsRegionTool', 'HECPhysicsRegionTool', 'FCALPhysicsRegionTool' ] ## FIXME _initPR never called for FwdRegion?? #if simFlags.ForwardDetectors.statusOn: # if DetFlags.geometry.FwdRegion_on(): # regionCreatorList += ['FwdRegionPhysicsRegionTool'] if DetFlags.Muon_on(): regionCreatorList += [ 'DriftWallPhysicsRegionTool', 'DriftWall1PhysicsRegionTool', 'DriftWall2PhysicsRegionTool' ] if simFlags.CavernBG.statusOn and simFlags.CavernBG.get_Value( ) != 'Read' and not (simFlags.RecordFlux.statusOn and simFlags.RecordFlux()): regionCreatorList += ['MuonSystemFastPhysicsRegionTool'] return regionCreatorList
] job.G4TestAlg.SimTestTools += [ CfgGetter.getPrivateTool("BeamTruthTestTool", checkType=True) ] job.G4TestAlg.SimTestTools += [ CfgGetter.getPrivateTool("EvgenTruthTestTool", checkType=True) ] if DetFlags.pixel_on(): job.G4TestAlg.SimTestTools += [ CfgGetter.getPrivateTool("PixelHitsTestTool", checkType=True) ] if DetFlags.SCT_on(): job.G4TestAlg.SimTestTools += [ CfgGetter.getPrivateTool("SCT_HitsTestTool", checkType=True) ] if DetFlags.TRT_on(): job.G4TestAlg.SimTestTools += [ CfgGetter.getPrivateTool("TrtHitsTestTool", checkType=True) ] if DetFlags.LAr_on(): job.G4TestAlg.SimTestTools += [ CfgGetter.getPrivateTool("EMBHitsTestTool", checkType=True) ] job.G4TestAlg.SimTestTools += [ CfgGetter.getPrivateTool("EMECHitsTestTool", checkType=True) ] job.G4TestAlg.SimTestTools += [ CfgGetter.getPrivateTool("FCALHitsTestTool", checkType=True) ] job.G4TestAlg.SimTestTools += [ CfgGetter.getPrivateTool("HECHitsTestTool", checkType=True)
def __init__(self, name='InDetTrackingGeometryBuilder', namePrefix='', setLayerAssociation=True, buildTrtStrawLayers=False): # get the ToolSvc from AthenaCommon.AppMgr import ToolSvc, ServiceMgr from AthenaCommon.DetFlags import DetFlags # the Detector flags to be imported from TrkDetDescrSvc.TrkDetDescrJobProperties import TrkDetFlags # beampipe from InDetTrackingGeometry.InDetTrackingGeometryConf import InDet__BeamPipeBuilder BeamPipeBuilder = InDet__BeamPipeBuilder(name=namePrefix + 'BeamPipeBuilder') BeamPipeBuilder.BeamPipeRadius = TrkDetFlags.BeamPipeRadius() BeamPipeBuilder.BeamPipeThickness = TrkDetFlags.BeamPipeThickness() BeamPipeBuilder.BeamPipeMaterialBinsZ = TrkDetFlags.BeamPipeLayerMaterialBinsZ( ) BeamPipeBuilder.OutputLevel = TrkDetFlags.BeamPipeBuildingOutputLevel() ToolSvc += BeamPipeBuilder # the layer providers from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__LayerProvider BeamPipeProvider = Trk__LayerProvider(name=namePrefix + 'BeamPipeProvider') BeamPipeProvider.LayerBuilder = BeamPipeBuilder ToolSvc += BeamPipeProvider # binning of the beam pipe BeamPipeBinning = 2 # the layer builders layerProviders = [BeamPipeProvider] binningsCenter = [BeamPipeBinning] binningsEndcap = [BeamPipeBinning] colors = [2] # PIXEL building if DetFlags.pixel_on(): from InDetTrackingGeometry.InDetTrackingGeometryConf import InDet__SiLayerBuilder PixelLayerBuilder = InDet__SiLayerBuilder(name=namePrefix + 'PixelLayerBuilder') PixelLayerBuilder.PixelCase = True PixelLayerBuilder.Identification = 'Pixel' PixelLayerBuilder.SiDetManagerLocation = 'Pixel' # Pixel barrel specifications PixelLayerBuilder.BarrelLayerBinsZ = TrkDetFlags.PixelBarrelLayerMaterialBinsZ( ) PixelLayerBuilder.BarrelLayerBinsPhi = TrkDetFlags.PixelBarrelLayerMaterialBinsPhi( ) PixelLayerBuilder.EndcapLayerBinsR = TrkDetFlags.PixelEndcapLayerMaterialBinsR( ) PixelLayerBuilder.EndcapLayerBinsPhi = TrkDetFlags.PixelEndcapLayerMaterialBinsPhi( ) PixelLayerBuilder.EndcapRingLayout = TrkDetFlags.PixelRingLayout() # set the layer association PixelLayerBuilder.SetLayerAssociation = setLayerAssociation # output level PixelLayerBuilder.OutputLevel = TrkDetFlags.PixelBuildingOutputLevel( ) # the binning type of the layers PixelLayerBinning = 2 # add it to tool service ToolSvc += PixelLayerBuilder # the layer providers PixelLayerProvider = Trk__LayerProvider(name=namePrefix + 'PixelLayerProvider') PixelLayerProvider.LayerBuilder = PixelLayerBuilder ToolSvc += PixelLayerProvider layerProviders += [PixelLayerProvider] binningsCenter += [PixelLayerBinning] binningsEndcap += [PixelLayerBinning] colors += [3] # SCT building if DetFlags.SCT_on(): SCT_LayerBuilder = InDet__SiLayerBuilder(name=namePrefix + 'SCT_LayerBuilder') SCT_LayerBuilder.PixelCase = False SCT_LayerBuilder.Identification = 'SCT' SCT_LayerBuilder.SiDetManagerLocation = 'SCT' # additionall layers - handle with care ! SCT_LayerBuilder.EndcapAdditionalLayerPositionsZ = [-2850, 2850] SCT_LayerBuilder.EndcapAdditionalLayerType = [0, 0] # SCT barrel specifications SCT_LayerBuilder.BarrelLayerBinsZ = TrkDetFlags.SCT_BarrelLayerMaterialBinsZ( ) SCT_LayerBuilder.BarrelLayerBinsPhi = TrkDetFlags.SCT_BarrelLayerMaterialBinsPhi( ) # SCT endcap specifications SCT_LayerBuilder.EndcapLayerBinsR = TrkDetFlags.SCT_EndcapLayerMaterialBinsR( ) SCT_LayerBuilder.EndcapLayerBinsPhi = TrkDetFlags.SCT_EndcapLayerMaterialBinsPhi( ) SCT_LayerBuilder.EndcapComplexRingBinning = TrkDetFlags.SCT_EndcapLayerDynamicRings( ) # set the layer association SCT_LayerBuilder.SetLayerAssociation = setLayerAssociation # output level SCT_LayerBuilder.OutputLevel = TrkDetFlags.SCT_BuildingOutputLevel( ) # the binning type of the layer SCT_LayerBinning = 2 # SCT -> ToolSvc ToolSvc += SCT_LayerBuilder # the layer providers SCT_LayerProvider = Trk__LayerProvider(name=namePrefix + 'SCT_LayerProvider') SCT_LayerProvider.LayerBuilder = SCT_LayerBuilder ToolSvc += SCT_LayerProvider # put them to the caches layerProviders += [SCT_LayerProvider] binningsCenter += [SCT_LayerBinning] binningsEndcap += [SCT_LayerBinning] colors += [4] # TRT building if DetFlags.TRT_on(): from InDetTrackingGeometry.InDetTrackingGeometryConf import InDet__TRT_LayerBuilder TRT_LayerBuilder = InDet__TRT_LayerBuilder(name=namePrefix + 'TRT_LayerBuilder') # TRT barrel specifications TRT_LayerBuilder.ModelBarrelLayers = TrkDetFlags.TRT_BarrelModelLayers( ) TRT_LayerBuilder.BarrelLayerBinsZ = TrkDetFlags.TRT_BarrelLayerMaterialBinsZ( ) TRT_LayerBuilder.BarrelLayerBinsPhi = TrkDetFlags.TRT_BarrelLayerMaterialBinsPhi( ) # SCT endcap specifications TRT_LayerBuilder.ModelEndcapLayers = TrkDetFlags.TRT_EndcapModelLayers( ) TRT_LayerBuilder.EndcapLayerBinsR = TrkDetFlags.TRT_EndcapLayerMaterialBinsR( ) TRT_LayerBuilder.EndcapLayerBinsPhi = TrkDetFlags.TRT_EndcapLayerMaterialBinsPhi( ) # set the binning from bi-aequidistant to arbitrary for complex TRT volumes TRT_LayerBinning = 1 if buildTrtStrawLayers or TrkDetFlags.TRT_BuildStrawLayers(): TRT_LayerBinning = 2 TRT_LayerBuilder.ModelLayersOnly = False # output level TRT_LayerBuilder.OutputLevel = TrkDetFlags.TRT_BuildingOutputLevel( ) # TRT -> ToolSvc ToolSvc += TRT_LayerBuilder # the layer providers TRT_LayerProvider = Trk__LayerProvider(name=namePrefix + 'TRT_LayerProvider') TRT_LayerProvider.LayerBuilder = TRT_LayerBuilder ToolSvc += TRT_LayerProvider # put them to the caches layerProviders += [TRT_LayerProvider] binningsCenter += [TRT_LayerBinning] binningsEndcap += [TRT_LayerBinning] colors += [5] # helpers for the InDetTrackingGeometry Builder : layer array creator from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__LayerArrayCreator InDetLayerArrayCreator = Trk__LayerArrayCreator( name='InDetLayerArrayCreator') InDetLayerArrayCreator.EmptyLayerMode = 2 # deletes empty material layers from arrays InDetLayerArrayCreator.OutputLevel = TrkDetFlags.InDetBuildingHelperOutputLevel( ) # add to ToolSvc ToolSvc += InDetLayerArrayCreator # helpers for the InDetTrackingGeometry Builder : volume array creator from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__TrackingVolumeArrayCreator InDetTrackingVolumeArrayCreator = Trk__TrackingVolumeArrayCreator( name='InDetTrackingVolumeArrayCreator') InDetTrackingVolumeArrayCreator.OutputLevel = TrkDetFlags.InDetBuildingOutputLevel( ) # add to ToolSvc ToolSvc += InDetTrackingVolumeArrayCreator # helpers for the InDetTrackingGeometry Builder : tracking voluem helper for glueing from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__TrackingVolumeHelper InDetTrackingVolumeHelper = Trk__TrackingVolumeHelper( name='InDetTrackingVolumeHelper') InDetTrackingVolumeHelper.OutputLevel = TrkDetFlags.InDetBuildingHelperOutputLevel( ) # the material bins InDetTrackingVolumeHelper.BarrelLayerBinsZ = TrkDetFlags.InDetPassiveLayerMaterialBinsRz( ) InDetTrackingVolumeHelper.BarrelLayerBinsPhi = TrkDetFlags.InDetPassiveLayerMaterialBinsPhi( ) InDetTrackingVolumeHelper.EndcapLayerBinsR = TrkDetFlags.InDetPassiveLayerMaterialBinsRz( ) InDetTrackingVolumeHelper.EndcapLayerBinsPhi = TrkDetFlags.InDetPassiveLayerMaterialBinsPhi( ) # add to ToolSvc ToolSvc += InDetTrackingVolumeHelper # helpers for the InDetTrackingGeometry Builder : cylinder volume creator from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__CylinderVolumeCreator InDetCylinderVolumeCreator = Trk__CylinderVolumeCreator( name='InDetCylinderVolumeCreator') # give him the layer array creator InDetCylinderVolumeCreator.LayerArrayCreator = InDetLayerArrayCreator InDetCylinderVolumeCreator.TrackingVolumeArrayCreator = InDetTrackingVolumeArrayCreator InDetCylinderVolumeCreator.TrackingVolumeHelper = InDetTrackingVolumeHelper # specifiy the binning, passive layers, entry layers InDetCylinderVolumeCreator.PassiveLayerThickness = TrkDetFlags.InDetPassiveLayerThickness( ) InDetCylinderVolumeCreator.PassiveLayerBinsPhi = TrkDetFlags.InDetPassiveLayerMaterialBinsPhi( ) InDetCylinderVolumeCreator.PassiveLayerBinsRZ = TrkDetFlags.InDetPassiveLayerMaterialBinsRz( ) # output level InDetCylinderVolumeCreator.OutputLevel = TrkDetFlags.InDetBuildingHelperOutputLevel( ) # add to ToolSvc ToolSvc += InDetCylinderVolumeCreator # the envelope definition service from SubDetectorEnvelopes.SubDetectorEnvelopesConf import DetDescrDBEnvelopeSvc AtlasEnvelopeSvc = DetDescrDBEnvelopeSvc( 'AtlasEnvelopeSvcDefinitionSvc') # set the output level for the Envelope service AtlasEnvelopeSvc.OutputLevel = TrkDetFlags.InDetBuildingHelperOutputLevel( ) # add to SvcMgr ServiceMgr += AtlasEnvelopeSvc # the tracking geometry builder InDet__StagedTrackingGeometryBuilder.__init__(self,namePrefix+name,\ LayerBuilders = layerProviders, LayerBinningTypeCenter = binningsCenter, LayerBinningTypeEndcap = binningsEndcap, ColorCodes = colors, EnvelopeDefinitionSvc = AtlasEnvelopeSvc, VolumeEnclosureDiscPositions = [ 3000., 3450. ], TrackingVolumeCreator = InDetCylinderVolumeCreator, LayerArrayCreator = InDetLayerArrayCreator, CheckForRingLayout = True, BuildBoundaryLayers = TrkDetFlags.InDetBuildMaterialBoundaries(), ReplaceAllJointBoundaries = TrkDetFlags.InDetBuildJointBoundaries(), OutputLevel = TrkDetFlags.InDetBuildingOutputLevel(), ExitVolumeName = TrkDetFlags.InDetContainerName(), MagneticFieldMode = TrkDetFlags.MagneticFieldMode())
# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration from IOVDbSvc.CondDB import conddb from AthenaCommon.AthenaCommonFlags import athenaCommonFlags from AthenaCommon.DetFlags import DetFlags from AtlasGeoModel.InDetGMJobProperties import InDetGeometryFlags # Top sequence from AthenaCommon.AlgSequence import AlgSequence topSequence = AlgSequence() if DetFlags.TRT_on(): # Dead/Noisy Straw Lists if hasattr(topSequence, "OutputConditionsAlg" ): # revert to old style CondHandle in case streaming to POOL conddb.addFolderSplitOnline("TRT", "/TRT/Onl/Cond/Status", "/TRT/Cond/Status") else: conddb.addFolderSplitOnline( "TRT", "/TRT/Onl/Cond/Status", "/TRT/Cond/Status", className='TRTCond::StrawStatusMultChanContainer') if hasattr(topSequence, "OutputConditionsAlg"): conddb.addFolderSplitOnline("TRT", "/TRT/Onl/Cond/StatusPermanent", "/TRT/Cond/StatusPermanent") else: conddb.addFolderSplitOnline( "TRT",