def generateInDetSensitiveDetectorList(): SensitiveDetectorList = [] from AtlasGeoModel.InDetGMJobProperties import GeometryFlags as geoFlags isUpgrade = geoFlags.Run() == "RUN3" or geoFlags.Run() == "RUN4" or ( geoFlags.Run() == "UNDEFINED" and geoFlags.isSLHC()) isRUN2 = geoFlags.Run() == "RUN2" or (geoFlags.Run() == "UNDEFINED" and geoFlags.isIBL()) isRUN1 = not (isRUN2 or isUpgrade) from AthenaCommon.DetFlags import DetFlags if (isRUN1 or isRUN2) and DetFlags.simulate.BCM_on(): SensitiveDetectorList += ['BCMSensorSD'] #if isRUN2 and DetFlags.simulation.DBM_on(): # SensitiveDetectorList += [ 'DBMSensorSD' ] if DetFlags.simulate.pixel_on(): if isRUN1 or isRUN2: SensitiveDetectorList += ['BLMSensorSD'] SensitiveDetectorList += ['PixelSensorSD'] if DetFlags.simulate.SCT_on(): if isUpgrade: SensitiveDetectorList += ['SLHC_SctSensorSD'] else: SensitiveDetectorList += ['SctSensorSD'] if DetFlags.simulate.TRT_on() and not isUpgrade: SensitiveDetectorList += ['TRTSensitiveDetector'] return SensitiveDetectorList
def __init__(self, name="L1MuctpiTool"): LVL1MUCTPI__L1MuctpiTool.__init__(self, name) # Create a logger: from AthenaCommon.Logging import logging logger = logging.getLogger("L1MuctpiTool") # Set properties of the LUT overlap handling: self.OverlapStrategyName = "LUT" self.DumpLUT = False self.LUTXMLFile = "UNDEFINED" self.RunPeriod = "UNDEFINED" self.FlaggingMode = False self.MultiplicityStrategyName = "INCLUSIVE" # Decide which LUT to use, based on which run we are simulating: from AtlasGeoModel.InDetGMJobProperties import GeometryFlags as geoFlags if (geoFlags.Run() == "RUN1") or ((geoFlags.Run() == "UNDEFINED") and (geoFlags.isIBL() == False)): self.LUTXMLFile = "TrigConfMuctpi/data10_7TeV.periodI.physics_Muons.MuCTPI_LUT.NoBEOverlaps_composedEF.v002.xml" self.RunPeriod = "RUN1" logger.info( "Configuring MuCTPI simulation with Run 1 configuration file:") logger.info( " TrigConfMuctpi/data10_7TeV.periodI.physics_Muons.MuCTPI_LUT.NoBEOverlaps_composedEF.v002.xml" ) logger.info(" with a RunPeriod=RUN1") elif (geoFlags.Run() == "RUN2") or ((geoFlags.Run() == "UNDEFINED") and (geoFlags.isIBL() == True)): self.LUTXMLFile = "TrigConfMuctpi/data10_7TeV.periodI.physics_Muons.MuCTPI_LUT.NoBEOverlaps_composedEF.v002_modifiedBB.xml" self.RunPeriod = "RUN2" logger.info( "Configuring MuCTPI simulation with Run 2 configuration file:") logger.info( " TrigConfMuctpi/data10_7TeV.periodI.physics_Muons.MuCTPI_LUT.NoBEOverlaps_composedEF.v002_modifiedBB.xml" ) logger.info(" with a RunPeriod=RUN2") else: self.LUTXMLFile = "TrigConfMuctpi/data10_7TeV.periodI.physics_Muons.MuCTPI_LUT.NoBEOverlaps_composedEF.v002_modifiedBB.xml" self.RunPeriod = "RUN2" logger.warning( "Couldn't determine which run to simulate, using Run 2 configuration file:" ) logger.warning( " TrigConfMuctpi/data10_7TeV.periodI.physics_Muons.MuCTPI_LUT.NoBEOverlaps_composedEF.v002_modifiedBB.xml" ) logger.warning(" with a RunPeriod=RUN2") pass # Set properties for NIM outputs ot L1Topo conversion from RoI to eta/phi self.GeometryXMLFile = "TrigConfMuctpi/TestMioctGeometry_2016_05_30_CS_2600573263.xml" # Turn on the NIM output creation by default: self.DoNIMOutput = True # The bit settings were extracted from here: # https://savannah.cern.ch/bugs/?90300#comment14 self.NIMBarrelBit = 29 self.NIMEndcapBit = 30
def getIDETEnvelope(name="IDET", **kwargs): from AtlasGeoModel.InDetGMJobProperties import GeometryFlags as geoFlags isUpgrade = geoFlags.Run() == "RUN3" or geoFlags.Run() == "RUN4" or ( geoFlags.Run() == "UNDEFINED" and geoFlags.isSLHC()) isRUN2 = geoFlags.Run() == "RUN2" or (geoFlags.Run() == "UNDEFINED" and geoFlags.isIBL()) isRUN1 = not (isRUN2 or isUpgrade) kwargs.setdefault("DetectorName", "IDET") innerRadius = 37. * mm # RUN1 default if isRUN2: innerRadius = 28.9 * mm #29.15*mm if isUpgrade: innerRadius = 32.15 * mm kwargs.setdefault("InnerRadius", innerRadius) kwargs.setdefault("OuterRadius", 1.148 * m) kwargs.setdefault("dZ", 347.5 * cm) SubDetectorList = [] from AthenaCommon.DetFlags import DetFlags if DetFlags.geometry.pixel_on(): SubDetectorList += ['Pixel'] if DetFlags.geometry.SCT_on(): SubDetectorList += ['SCT'] if DetFlags.geometry.TRT_on() and not isUpgrade: SubDetectorList += ['TRT'] SubDetectorList += ['IDetServicesMat'] kwargs.setdefault("SubDetectors", SubDetectorList) return CfgMgr.CylindricalEnvelope(name, **kwargs)
def getPixelPhysicsRegionTool(name='PixelPhysicsRegionTool', **kwargs): kwargs.setdefault("RegionName", 'Pixel') volumeList = ['Pixel::siLog', 'Pixel::siBLayLog'] from AtlasGeoModel.InDetGMJobProperties import GeometryFlags as geoFlags if geoFlags.Run() == "RUN2" or (geoFlags.Run() == "UNDEFINED" and geoFlags.isIBL()): volumeList += ['Pixel::dbmDiamondLog'] kwargs.setdefault("VolumeList", volumeList) kwargs.setdefault("ElectronCut", 0.05) kwargs.setdefault("PositronCut", 0.05) kwargs.setdefault("GammaCut", 0.05) return CfgMgr.RegionCreator(name, **kwargs)
def getTRTSensitiveDetector(name="TRTSensitiveDetector", **kwargs): bare_collection_name = "TRTUncompressedHits" mergeable_collection_suffix = "_G4" merger_input_property = "TRTUncompressedHits" hits_collection_name = generate_mergeable_collection_name( bare_collection_name, mergeable_collection_suffix, merger_input_property) logicalVolumeNames = ["TRT::Gas", "TRT::GasMA"] from AtlasGeoModel.InDetGMJobProperties import GeometryFlags as geoFlags if geoFlags.Run() == "RUN2": ## RUN2 configuration logicalVolumeNames += [ "TRT::Gas_Ar", "TRT::GasMA_Ar", "TRT::Gas_Kr", "TRT::GasMA_Kr" ] kwargs.setdefault("LogicalVolumeNames", logicalVolumeNames) kwargs.setdefault("OutputCollectionNames", [hits_collection_name]) return CfgMgr.TRTSensitiveDetectorTool(name, **kwargs)
"AtlasDerivation"): rec.doApplyAODFix.set_Value_and_Lock(False) include("RecExCommon/RecExCommon_topOptions.py") from AthenaCommon.AlgSequence import AlgSequence algSeq = AlgSequence() ### GEO Business from AthenaCommon.GlobalFlags import globalflags print "detDescr from global flags= " + str(globalflags.DetDescrVersion) from AtlasGeoModel.InDetGMJobProperties import GeometryFlags as geoFlags print "geoFlags.Run() = " + geoFlags.Run() print "geoFlags.isIBL() = " + str(geoFlags.isIBL()) ############################################################### ### THIS is the full retagging configuration ### this is if you want to re-tag with another calibration file from BTagging.BTaggingConfiguration import getConfiguration from BTagging.BTaggingFlags import BTaggingFlags #### if the new file is already in the datatbase: simple edit the name #BTaggingFlags.CalibrationTag = 'BTagCalibRUN12-08-18' #### if you want to use your own calibration file use this part below if RETAG & (LocalCalibSuffix != 'WHATEVER'): BTaggingFlags.CalibrationFromLocalReplica = True BTaggingFlags.TrigCalibrationFolderRoot = '/GLOBAL/TrigBTagCalib/' BTaggingFlags.TrigCalibrationTag = LocalCalibSuffix
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration # Configuration functions for IP2DNegTag # Author: Wouter van den Wollenberg (2013-2014) from BTagging.BTaggingFlags import BTaggingFlags from AtlasGeoModel.InDetGMJobProperties import GeometryFlags as geoFlags from IOVDbSvc.CondDB import conddb btagrun1 = False if conddb.dbdata == 'COMP200': btagrun1 = True elif conddb.isMC: btagrun1 = (geoFlags.Run() == "RUN1" or (geoFlags.Run() == "UNDEFINED" and geoFlags.isIBL() == False)) metaIP2DNegTag = { 'IsATagger': True, 'xAODBaseName': 'IP2DNeg', 'DependsOn': [ 'AtlasExtrapolator', 'BTagTrackToVertexTool', 'InDetVKalVxInJetTool', 'BTagFullLinearizedTrackFactory', 'BTagTrackToVertexIPEstimator', 'IP2DNegNewLikelihoodTool', 'IP2DNegTrackSelector', 'SVForIPTool_IP2DNeg', 'IP2DNegBasicTrackGradeFactory', 'IP2DNegDetailedTrackGradeFactory' ], 'PassByPointer': { 'SVForIPTool': 'SVForIPTool_IP2DNeg', 'trackSelectorTool': 'IP2DNegTrackSelector', 'trackGradeFactory': 'IP2DNegDetailedTrackGradeFactory', # 'trackToVertexTool' : 'BTagTrackToVertexTool',
TemperatureFolder="/PIXEL/HLT/DCS/TEMPERATURE", HVFolder="/PIXEL/HLT/DCS/HV", TemperatureFieldName="temperature", HVFieldName="HV") else: if not conddb.folderRequested('/PIXEL/DCS/TEMPERATURE'): conddb.addFolder("DCS_OFL", "/PIXEL/DCS/TEMPERATURE") if not conddb.folderRequested('/PIXEL/DCS/HV'): conddb.addFolder("DCS_OFL", "/PIXEL/DCS/HV") if not conddb.folderRequested('/PIXEL/DCS/FSMSTATUS'): conddb.addFolder("DCS_OFL", "/PIXEL/DCS/FSMSTATUS") if not conddb.folderRequested('/PIXEL/DCS/FSMSTATE'): conddb.addFolder("DCS_OFL", "/PIXEL/DCS/FSMSTATE") from AtlasGeoModel.InDetGMJobProperties import GeometryFlags as geoFlags if (rec.doMonitoring() and globalflags.DataSource() == 'data' and geoFlags.Run() == "RUN2" and conddb.dbdata == "CONDBR2"): # geoFlags.isIBL() == True may work too instead of geoFlags.Run() == "RUN2" if not conddb.folderRequested('/PIXEL/DCS/PIPES'): conddb.addFolder("DCS_OFL", "/PIXEL/DCS/PIPES") if not conddb.folderRequested('/PIXEL/DCS/LV'): conddb.addFolder("DCS_OFL", "/PIXEL/DCS/LV") if not conddb.folderRequested('/PIXEL/DCS/HVCURRENT'): conddb.addFolder("DCS_OFL", "/PIXEL/DCS/HVCURRENT") # not used anymore # if not conddb.folderRequested('/PIXEL/DCS/PLANTS'): # conddb.addFolder("DCS_OFL","/PIXEL/DCS/PLANTS") InDetPixelDCSSvc = PixelDCSSvc( RegisterCallback=TRUE, TemperatureFolder="/PIXEL/DCS/TEMPERATURE",
def getATLAS_RegionCreatorList(): regionCreatorList = [] from AtlasGeoModel.InDetGMJobProperties import GeometryFlags as geoFlags isUpgrade = geoFlags.Run() == "RUN3" or geoFlags.Run() == "RUN4" or ( geoFlags.Run() == "UNDEFINED" and geoFlags.isSLHC()) isRUN2 = geoFlags.Run() == "RUN2" or (geoFlags.Run() == "UNDEFINED" and geoFlags.isIBL()) from G4AtlasApps.SimFlags import simFlags from AthenaCommon.DetFlags import DetFlags from AthenaCommon.BeamFlags import jobproperties if jobproperties.Beam.beamType() == 'cosmics' or \ (simFlags.CavernBG.statusOn and not 'Signal' in simFlags.CavernBG.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
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration # FLS: copied the original IP2DTag.py and rename every occurrence of IP2D -> IP2DTrighHybrid # Configuration functions for IP2DTrigHybridTag # Author: Wouter van den Wollenberg (2013-2014) from BTagging.BTaggingFlags import BTaggingFlags from AtlasGeoModel.InDetGMJobProperties import GeometryFlags as geoFlags from IOVDbSvc.CondDB import conddb btagrun1 = False if conddb.dbdata == 'COMP200': btagrun1 = True elif conddb.isMC: btagrun1 = (geoFlags.Run() == "RUN1" or (geoFlags.Run() == "UNDEFINED" and geoFlags.isIBL() == False)) metaIP2DTrigHybridTag = {'IsATagger': True, 'xAODBaseName': 'IP2DTrigHybrid', 'DependsOn': ['AtlasExtrapolator', 'BTagTrackToVertexTool', 'InDetVKalVxInJetTool', 'BTagFullLinearizedTrackFactory', 'BTagTrackToVertexIPEstimator', 'IP2DTrigHybridDetailedTrackGradeFactory', 'IP2DTrigHybridBasicTrackGradeFactory', 'SVForIPTool_IP2DTrigHybrid', 'IP2DTrigHybridTrackSelector', 'IP2DTrigHybridNewLikelihoodTool'], 'PassByPointer': {'SVForIPTool': 'SVForIPTool_IP2DTrigHybrid', 'trackSelectorTool': 'IP2DTrigHybridTrackSelector', 'trackGradeFactory': 'IP2DTrigHybridDetailedTrackGradeFactory', # 'trackToVertexTool' : 'BTagTrackToVertexTool',
if rn is None: try: from G4AtlasApps.SimFlags import simFlags if simFlags.RunNumber.statusOn: rn = simFlags.RunNumber() except: msg.info("No SimFlags available - looks like HLT job") if rn is None: try: from RecExConfig.AutoConfiguration import GetRunNumber rn = GetRunNumber() except: msg.info("No Run Number available - assume latest cabling") from AtlasGeoModel.InDetGMJobProperties import GeometryFlags as geoFlags if geoFlags.Run() == "RUN1": if rn > 219651: # choose RUN2 cabling for old geometry tags starting from 26-MAR-2013 TileCablingType = 4 msg.warning("Forcing RUN2 cabling for run %s with geometry %s" % (rn, gbltg)) elif geoFlags.Run() == "RUN2": if ( globalflags.DataSource() != 'data' and rn >= 310000 ) or rn >= 343000 or rn < 1: # choose RUN2a cabling for R2 geometry tags starting from 31-Jan-2018 TileCablingType = 5 msg.info( "Forcing RUN2a (2018) cabling for run %s with geometry %s" % (rn, gbltg)) else: TileCablingType = 4 msg.info(