Beispiel #1
0
    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)
Beispiel #2
0
from AthenaCommon.AppMgr import ServiceMgr as svcMgr
from AthenaCommon.BeamFlags import jobproperties
from AthenaCommon.DetFlags import DetFlags
import AthenaCommon.SystemOfUnits as Units

### Set event burst cut (no cut by default but 200 for cosmics)
if jobproperties.Beam.beamType()=='cosmics':
  eventBurstCut = 200  
else:
  eventBurstCut = -1

### Set track quality cuts for collisions
if jobproperties.Beam.beamType() == "collisions":
  minTrkPtCut = 2.0 * Units.GeV
  ### at least one silicon detector must be on to require silicon hits
  if DetFlags.pixel_on() or DetFlags.SCT_on():
    minPixHitCut = 1 if DetFlags.pixel_on() else 0
    minSiHitCut = 3
  else: # both silicon detectors are off, we cannot require hits
    minSiHitCut = 0
    minPixHitCut = 0
else: # no track quality cuts for cosmics or single beams
  minTrkPtCut = 0
  minSiHitCut = 0
  minPixHitCut = 0

#-------------------------------------------------------------
# Barrel Monitoring
#-------------------------------------------------------------
from TRT_Monitoring.TRT_MonitoringConf import TRT_Monitoring_Tool
InDetTRT_Monitoring_Tool = TRT_Monitoring_Tool (name                         = "TRT_Monitoring_Tool",
Beispiel #3
0
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
Beispiel #4
0
from AthenaCommon import CfgGetter
if DetFlags.Truth_on():
    job.G4TestAlg.SimTestTools += [
        CfgGetter.getPrivateTool("TruthTestTool", checkType=True)
    ]
    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 += [
    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())
Beispiel #6
0
    def __init__(self,name = 'InDetTrackingGeometryBuilder',
                      namePrefix = '',
                      setLayerAssociation = True):

        # 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.InDetBuildingOutputLevel()
        # the binning type of the layers   
        BeamPipeBinning = 2
        # where to build it from
        BeamPipeBuilder.BeamPipeFromGeoModel    = TrkDetFlags.BeamPipeFromGeoModel()
        BeamPipeBuilder.BeamPipeEnvelope        = TrkDetFlags.BeamPipeEnvelope()
        if not TrkDetFlags.BeamPipeFromGeoModel():
            BeamPipeBuilder.BeamPipeOffsetX	        = TrkDetFlags.BeamPipeOffsetX()
            BeamPipeBuilder.BeamPipeOffsetY	        = TrkDetFlags.BeamPipeOffsetY()
            BeamPipeBuilder.BeamPipeRadius 	        = TrkDetFlags.BeamPipeRadius()

        ToolSvc += BeamPipeBuilder

        # the layer providers
        from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__LayerProvider
        BeamPipeProvider = Trk__LayerProvider(name=namePrefix+'BeamPipeProvider')
        BeamPipeProvider.LayerBuilder = BeamPipeBuilder
        ToolSvc += BeamPipeProvider
                
        # the layer builders
        layerProviders   = [ BeamPipeProvider ]
        binningsCenter  = [ BeamPipeBinning ]
        binningsEndcap  = [ BeamPipeBinning ]
        colors          = [ 2 ]
                                
        # PIXEL building
        from InDetTrackingGeometry.InDetTrackingGeometryConf import InDet__SiLayerBuilder
        PixelLayerBuilder = InDet__SiLayerBuilder(name=namePrefix+'PixelLayerBuilder')
        PixelLayerBuilder.PixelCase 	       = True
        PixelLayerBuilder.Identification       = 'Pixel1'
        PixelLayerBuilder.SiDetManagerLocation = 'Pixel'
        # The pixel split mode
        PixelLayerBuilder.SplitMode            = TrkDetFlags.PixelSplitMode()
        # Pixel barrel specifications
        PixelLayerBuilder.BarrelLayerBinsZ     = TrkDetFlags.PixelBarrelLayerMaterialBinsZ()
        PixelLayerBuilder.BarrelLayerBinsPhi   = TrkDetFlags.PixelBarrelLayerMaterialBinsPhi()
        PixelLayerBuilder.EndcapLayerBinsR     = TrkDetFlags.PixelEndcapLayerMaterialBinsR()
        PixelLayerBuilder.EndcapLayerBinsPhi   = TrkDetFlags.PixelEndcapLayerMaterialBinsPhi()
        # 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
        # put them to the caches
        PixelLayerProvider = Trk__LayerProvider(name=namePrefix+'PixelLayerProvider')
        PixelLayerProvider.LayerBuilder = PixelLayerBuilder
        ToolSvc += PixelLayerProvider
        layerProviders  += [ PixelLayerProvider ]
        binningsCenter += [ PixelLayerBinning ]
        binningsEndcap += [ PixelLayerBinning ]
        colors         += [ 3 ]
        # check if the pixel split mode is one
        if TrkDetFlags.PixelSplitMode() != 0:
            # set split mode to pixel layer builder 
            print ("[SLHC_GeometryBuilder] Building Pixel layers in split mode")
            # change the identificaiton of the first one
            PixelLayerBuilder.Identification       = 'Pixel1'
            # and now configure the second one
            PixelLayerBuilder2 = InDet__SiLayerBuilder(name=namePrefix+'PixelLayerBuilder2')
            PixelLayerBuilder2.PixelCase 	        = True
            PixelLayerBuilder2.SplitMode            = TrkDetFlags.PixelSplitMode()
            PixelLayerBuilder2.Identification       = 'Pixel2'
            PixelLayerBuilder2.SiDetManagerLocation = 'Pixel'
            # Pixel barrel specifications
            PixelLayerBuilder2.BarrelLayerBinsZ     = TrkDetFlags.PixelBarrelLayerMaterialBinsZ()
            PixelLayerBuilder2.BarrelLayerBinsPhi   = TrkDetFlags.PixelBarrelLayerMaterialBinsPhi()
            PixelLayerBuilder2.EndcapLayerBinsR     = TrkDetFlags.PixelEndcapLayerMaterialBinsR()
            PixelLayerBuilder2.EndcapLayerBinsPhi   = TrkDetFlags.PixelEndcapLayerMaterialBinsPhi()
            # set the layer association
            PixelLayerBuilder2.SetLayerAssociation  = setLayerAssociation
            # output level
            PixelLayerBuilder2.OutputLevel         = TrkDetFlags.PixelBuildingOutputLevel()
            # add it to tool service
            ToolSvc += PixelLayerBuilder2

            # the layer providers
            PixelLayerProvider2 = Trk__LayerProvider(name=namePrefix+'PixelLayerProvider2')
            PixelLayerProvider2.LayerBuilder = PixelLayerBuilder2
            ToolSvc += PixelLayerProvider2
            # put them to the caches
            layerProviders  += [ PixelLayerProvider2 ]
            binningsCenter += [ PixelLayerBinning ]
            binningsEndcap += [ PixelLayerBinning ]
            colors         += [ 3 ]
             
        
        if DetFlags.SCT_on() :
            # SCT building
            SCT_LayerBuilder = InDet__SiLayerBuilder(name=namePrefix+'SCT_LayerBuilder')
            SCT_LayerBuilder.PixelCase                       = False
            SCT_LayerBuilder.Identification                  = 'SCT1'
            SCT_LayerBuilder.SiDetManagerLocation            = 'SCT'
            # general steering
            SCT_LayerBuilder.SplitMode                       = TrkDetFlags.SCT_SplitMode()
            # 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 ]
                                                              
            # the split and the second SCT layer builder is needed if the SCT outer barrel
            # spans over the full width      
            if TrkDetFlags.SCT_SplitMode() != 0 :
              print ("[SLHC_GeometryBuilder] Building SCT layers in split mode")
              from InDetTrackingGeometry.InDetTrackingGeometryConf import InDet__SiLayerBuilder
              SCT_LayerBuilder2 = InDet__SiLayerBuilder(name=namePrefix+'SCT_LayerBuilder2')
            
              # switch of the pixel case
              SCT_LayerBuilder2.PixelCase                = False
              SCT_LayerBuilder2.SiDetManagerLocation     = 'SCT'
              # set the general parameters
              SCT_LayerBuilder2.OutputLevel              = 2
              SCT_LayerBuilder2.SplitMode                = TrkDetFlags.SCT_SplitMode()
              SCT_LayerBuilder2.Identification           = "SCT2"
              # SCT barrel specifications
              SCT_LayerBuilder2.BarrelLayerBinsZ         = TrkDetFlags.SCT_BarrelLayerMaterialBinsZ()
              SCT_LayerBuilder2.BarrelLayerBinsPhi       = TrkDetFlags.SCT_BarrelLayerMaterialBinsPhi()
              # SCT endcap specifications                     
              SCT_LayerBuilder2.EndcapLayerBinsR         = TrkDetFlags.SCT_EndcapLayerMaterialBinsR()
              SCT_LayerBuilder2.EndcapLayerBinsPhi       = TrkDetFlags.SCT_EndcapLayerMaterialBinsPhi()
              # set the layer association
              SCT_LayerBuilder2.SetLayerAssociation = setLayerAssociation        
              # output level
              SCT_LayerBuilder2.OutputLevel         = TrkDetFlags.SCT_BuildingOutputLevel()
              ToolSvc += SCT_LayerBuilder2
              # the layer providers
              SCT_LayerProvider2 = Trk__LayerProvider(name=namePrefix+'SCT_LayerProvider2')
              SCT_LayerProvider2.LayerBuilder = SCT_LayerBuilder2
              ToolSvc += SCT_LayerProvider2
              # put them to the caches
              layerProviders  += [ SCT_LayerProvider2 ] 
              binningsCenter += [ SCT_LayerBinning ]
              binningsEndcap += [ SCT_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.InDetBuildingOutputLevel()
        # 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.InDetBuildingOutputLevel()
        # 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.InDetBuildingOutputLevel()        
        # 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.InDetBuildingOutputLevel()  
        # add to SvcMgr
        ServiceMgr += AtlasEnvelopeSvc
        
        # the tracking geometry builder
        InDet__StagedTrackingGeometryBuilder.__init__(self,namePrefix+name,\
                                                      BeamPipeBuilder           = BeamPipeBuilder,\
                                                      LayerBuilders             = layerProviders,
                                                      LayerBinningTypeCenter    = binningsCenter,
                                                      LayerBinningTypeEndcap    = binningsEndcap,
                                                      ColorCodes                = colors,
                                                      EnvelopeDefinitionSvc     = AtlasEnvelopeSvc,
                                                      # VolumeEnclosureDiscPositions = [ 3000., 3450. ],
                                                      TrackingVolumeCreator     = InDetCylinderVolumeCreator,
                                                      LayerArrayCreator         = InDetLayerArrayCreator,
                                                      BuildBoundaryLayers       = True,
                                                      # ReplaceAllJointBoundaries = TrkDetFlags.InDetBuildMaterialBoundaries(),
                                                      OutputLevel               = TrkDetFlags.InDetBuildingOutputLevel(),
                                                      ExitVolumeName            = TrkDetFlags.InDetContainerName(),
                                                      MagneticFieldMode         = TrkDetFlags.MagneticFieldMode(),
                                                      isSLHC = True)
Beispiel #7
0
                                    className="AlignableTransformContainer")
    else:
        conddb.addFolderSplitOnline("TRT", "/TRT/Onl/Align", "/TRT/Align")

from AthenaCommon.AlgSequence import AthSequencer
condSeq = AthSequencer("AthCondSeq")

# Condition algorithms for ID alignment
if DetFlags.TRT_on() and ((not DetFlags.simulate.TRT_on())
                          or DetFlags.overlay.TRT_on()):
    if not hasattr(condSeq, "TRTAlignCondAlg"):
        import os
        if "AthSimulation_DIR" not in os.environ:  # Protection for AthSimulation builds
            condSeq += TRTAlignCondAlg

if DetFlags.SCT_on() and ((not DetFlags.simulate.SCT_on())
                          or DetFlags.overlay.SCT_on()):
    if not hasattr(condSeq, "SCT_AlignCondAlg"):
        import os
        if "AthSimulation_DIR" not in os.environ:  # Protection for AthSimulation builds
            from SCT_ConditionsAlgorithms.SCT_ConditionsAlgorithmsConf import SCT_AlignCondAlg
            condSeq += SCT_AlignCondAlg(
                name="SCT_AlignCondAlg",
                UseDynamicAlignFolders=InDetGeometryFlags.
                useDynamicAlignFolders())
            if not hasattr(condSeq, "SCT_DetectorElementCondAlg"):
                from SCT_ConditionsAlgorithms.SCT_ConditionsAlgorithmsConf import SCT_DetectorElementCondAlg
                condSeq += SCT_DetectorElementCondAlg(
                    name="SCT_DetectorElementCondAlg")

if DetFlags.pixel_on() and ((not DetFlags.simulate.pixel_on())