def setDefaultRecoFlags(self, readESD=False): print "setDefaultRecoFlags" muonRecFlags.doMuonboy.set_Value_and_Lock(False) muonRecFlags.doCalib.set_Value_and_Lock(False) muonRecFlags.doCalibNtuple.set_Value_and_Lock(False) #recFlags.readESD = readESD #print "readESD set to ",recFlags.readESD recFlags.oldFlagTopSteering.set_Off() #recFlags.doESD = True recFlags.doWriteESD = False recFlags.doWriteAOD = False recFlags.doWriteTAG = False recFlags.doCBNT = False recFlags.doTrigger = False recFlags.doTruth.set_Value_and_Lock(False) recFlags.doAOD.set_Value_and_Lock(False) recFlags.doDetailedPerfMon.set_Value_and_Lock(False) recFlags.doPerfMon.set_Value_and_Lock(False) DQMonFlags.doMuonPhysicsMon.set_Value_and_Lock(False) DQMonFlags.doMuonRawMon.set_Value_and_Lock(False) DQMonFlags.doMuonSegmentMon.set_Value_and_Lock(False) DQMonFlags.doMuonTrackMon.set_Value_and_Lock(False) perfMonFlags.doDsoMonitoring.set_Value_and_Lock(False) perfMonFlags.doDetailedMonitoring.set_Value_and_Lock(False) perfMonFlags.doFullMon.set_Value_and_Lock(False) perfMonFlags.doMonitoring.set_Value_and_Lock(False) perfMonFlags.doPersistencyMonitoring.set_Value_and_Lock(False) from AthenaCommon.Include import include include.block("PerfMonComps/DomainsRegistry.py")
def BasicPixelDigitizationTool(name="PixelDigitizationTool", **kwargs): from AthenaCommon import CfgGetter kwargs.setdefault("RndmSvc", digitizationFlags.rndmSvc()) streamName = kwargs.setdefault("RndmEngine", "PixelDigitization") if not digitizationFlags.rndmSeedList.checkForExistingSeed(streamName): digitizationFlags.rndmSeedList.addSeed(streamName, 10513239, 492615104 ) from AthenaCommon.BeamFlags import jobproperties from AthenaCommon.Resilience import protectedInclude from AthenaCommon.Include import include from AthenaCommon.AppMgr import ServiceMgr from AthenaCommon.CfgGetter import getService protectedInclude( "PixelConditionsServices/SpecialPixelMapSvc_jobOptions.py" ) include.block( "PixelConditionsServices/SpecialPixelMapSvc_jobOptions.py" ) protectedInclude( "PixelConditionsServices/PixelDCSSvc_jobOptions.py" ) include.block( "PixelConditionsServices/PixelDCSSvc_jobOptions.py" ) protectedInclude("PixelConditionsServices/PixelCalibSvc_jobOptions.py") from IOVDbSvc.CondDB import conddb conddb.addFolderSplitMC("PIXEL","/PIXEL/ReadoutSpeed","/PIXEL/ReadoutSpeed") PixelCablingSvc = getService("PixelCablingSvc") ServiceMgr += PixelCablingSvc print PixelCablingSvc if not hasattr(ServiceMgr, "PixelSiPropertiesSvc"): from SiLorentzAngleSvc.LorentzAngleSvcSetup import lorentzAngleSvc from SiPropertiesSvc.SiPropertiesSvcConf import SiPropertiesSvc pixelSiPropertiesSvc = SiPropertiesSvc(name = "PixelSiPropertiesSvc",DetectorName="Pixel",SiConditionsServices = lorentzAngleSvc.pixelSiliconConditionsSvc) ServiceMgr += pixelSiPropertiesSvc kwargs.setdefault("InputObjectName", "PixelHits") procTools = [] chargeTools = [] #Tools in array for flexibility feSimTools = [] if GeometryFlags.isSLHC(): procTools += ['PixelRadDamDiodeCrossTalkGenerator'] chargeTools += ['RadDamSensorSimPlanarTool'] feSimTools += ['RadDamRD53SimTool'] else: procTools += ['PixelRadDamDiodeCrossTalkGenerator'] procTools += ['PixelRadDamChargeSmearer'] procTools += ['PixelRadDamNoisyCellGenerator'] procTools += ['PixelRadDamRandomDisabledCellGenerator'] chargeTools += ['RadDamSensorSimPlanarTool'] chargeTools += ['RadDamSensorSim3DTool'] feSimTools += ['RadDamFEI4SimTool'] feSimTools += ['RadDamFEI3SimTool'] kwargs.setdefault("PixelProcessorTools", procTools) kwargs.setdefault("ChargeTools", chargeTools) kwargs.setdefault("FrontEndSimTools", feSimTools) kwargs.setdefault("EnergyDepositionTool", "RadDamEnergyDepositionTool") if digitizationFlags.doXingByXingPileUp(): # PileUpTool approach kwargs.setdefault("FirstXing", Pixel_FirstXing() ) kwargs.setdefault("LastXing", Pixel_LastXing() ) return CfgMgr.RadDam__PixelDigitizationTool(name, **kwargs)
def BasicPixelDigitizationTool(name="PixelDigitizationTool", **kwargs): from AthenaCommon import CfgGetter kwargs.setdefault("RndmSvc", digitizationFlags.rndmSvc()) streamName = kwargs.setdefault("RndmEngine", "PixelDigitization") if not digitizationFlags.rndmSeedList.checkForExistingSeed(streamName): digitizationFlags.rndmSeedList.addSeed(streamName, 10513239, 492615104) from AthenaCommon.BeamFlags import jobproperties from AthenaCommon.Resilience import protectedInclude from AthenaCommon.Include import include protectedInclude("PixelConditionsServices/SpecialPixelMapSvc_jobOptions.py") include.block("PixelConditionsServices/SpecialPixelMapSvc_jobOptions.py") protectedInclude("PixelConditionsServices/PixelDCSSvc_jobOptions.py") include.block("PixelConditionsServices/PixelDCSSvc_jobOptions.py") from AthenaCommon.AppMgr import ServiceMgr if not hasattr(ServiceMgr, "PixelSiPropertiesSvc"): from SiLorentzAngleSvc.LorentzAngleSvcSetup import lorentzAngleSvc from SiPropertiesSvc.SiPropertiesSvcConf import SiPropertiesSvc pixelSiPropertiesSvc = SiPropertiesSvc( name="PixelSiPropertiesSvc", DetectorName="Pixel", SiConditionsServices=lorentzAngleSvc.pixelSiliconConditionsSvc, ) ServiceMgr += pixelSiPropertiesSvc kwargs.setdefault("InputObjectName", "PixelHits") kwargs.setdefault("EnableNoise", digitizationFlags.doInDetNoise.get_Value()) # Start of special cosmics tuning: if jobproperties.Beam.beamType == "cosmics": kwargs.setdefault("CosmicsRun", True) kwargs.setdefault("UseComTime", True) else: # For LVL1Latency, ToTMinCut, ApplyDupli and LowTOTduplication, first component [0] is always for IBL, even for run 1 production. # The order is IBL, BL, L1, L2, EC, DBM # For IBL and DBM, values of LVL1Latency and LowToTDupli are superseded by values driven by HitDiscCnfg settings, in PixelDigitizationTool.cxx LVL1Latency = [16, 150, 255, 255, 255, 16] kwargs.setdefault("LVL1Latency", LVL1Latency) ToTMinCut = [0, 4, 4, 4, 4, 0] kwargs.setdefault("ToTMinCut", ToTMinCut) ApplyDupli = [True, True, True, True, True, True] kwargs.setdefault("ApplyDupli", ApplyDupli) LowTOTduplication = [0, 7, 7, 7, 7, 0] kwargs.setdefault("LowTOTduplication", LowTOTduplication) if digitizationFlags.doXingByXingPileUp(): # PileUpTool approach kwargs.setdefault("FirstXing", Pixel_FirstXing()) kwargs.setdefault("LastXing", Pixel_LastXing()) return CfgMgr.PixelDigitizationTool(name, **kwargs)
def FastClusterMakerTool(name="FastClusterMakerTool", **kwargs): from Digitization.DigitizationFlags import digitizationFlags #FIXME: at some point we should move away from being dependent on the experimentalDigi flags. if 'doFastSCT_Digi' in digitizationFlags.experimentalDigi( ) and not 'doFastPixelDigi' in digitizationFlags.experimentalDigi(): kwargs.setdefault("UsePixelCalibCondDB", False) kwargs.setdefault("PixelCalibSvc", "") kwargs.setdefault("PixelOfflineCalibSvc", "") else: from AthenaCommon.Include import include include("PixelConditionsServices/PixelDCSSvc_jobOptions.py") include.block("PixelConditionsServices/PixelDCSSvc_jobOptions.py") from AthenaCommon.AppMgr import ToolSvc if not hasattr(ToolSvc, "PixelRecoDbTool"): from PixelConditionsTools.PixelConditionsToolsConf import PixelRecoDbTool ToolSvc += PixelRecoDbTool() ToolSvc.PixelRecoDbTool.InputSource = 1 # setup PixelCalibDbTool in ToolSvc if not hasattr(ToolSvc, "PixelCalibDbTool"): from PixelConditionsTools.PixelConditionsToolsConf import PixelCalibDbTool ToolSvc += PixelCalibDbTool() from IOVDbSvc.CondDB import conddb if not conddb.folderRequested('/PIXEL/PixCalib'): conddb.addFolder("PIXEL_OFL", "/PIXEL/PixCalib") if not conddb.folderRequested('/PIXEL/ReadoutSpeed'): conddb.addFolder("PIXEL_OFL", "/PIXEL/ReadoutSpeed") from AthenaCommon.AppMgr import ServiceMgr if not hasattr(ServiceMgr, "PixelCalibSvc"): from PixelConditionsServices.PixelConditionsServicesConf import PixelCalibSvc InDetPixelCalibSvc = PixelCalibSvc() ServiceMgr += InDetPixelCalibSvc if not hasattr(ServiceMgr, "PixelSiPropertiesSvc"): from SiLorentzAngleSvc.LorentzAngleSvcSetup import lorentzAngleSvc from SiPropertiesSvc.SiPropertiesSvcConf import SiPropertiesSvc PixelSiPropertiesSvc = SiPropertiesSvc( name="PixelSiPropertiesSvc", DetectorName="Pixel", SiConditionsServices=lorentzAngleSvc.pixelSiliconConditionsSvc) ServiceMgr += PixelSiPropertiesSvc if not hasattr(ServiceMgr, "PixelOfflineCalibSvc"): from PixelConditionsServices.PixelConditionsServicesConf import PixelOfflineCalibSvc ServiceMgr += PixelOfflineCalibSvc() ServiceMgr.PixelOfflineCalibSvc.HDCFromCOOL = False from AthenaCommon import CfgMgr return CfgMgr.InDet__ClusterMakerTool(name, **kwargs)
print 'Usage: makeSLHAFilesForSM.py run1 run2 run3,run4,run5 run6...' sys.exit(0) print 'Getting SLHA files for run(s)',listOfRuns # Fake some things that we won't need later from PyJobTransforms.trfJobOptions import RunArguments runArgs = RunArguments() runArgs.randomSeed = 1234 from AthenaCommon import Logging evgenLog = Logging.logging.getLogger('SLHAGetter') # only really need this once from AthenaCommon.Include import IncludeError, include include.setShowIncludes(False) include('/cvmfs/atlas.cern.ch/repo/sw/Generators/MC12JobOptions/latest/susycontrol/MadGraphControl_SimplifiedModelPreInclude.py') include.block('MC12JobOptions/MadGraphControl_SimplifiedModelPreInclude.py') include.block('MC12JobOptions/MadGraphControl_SimplifiedModelPostInclude.py') for run in listOfRuns: loc_l = glob.glob('/cvmfs/atlas.cern.ch/repo/sw/Generators/MC12JobOptions/latest/share/DSID'+run[0:3]+'xxx/MC12.'+run+'.*') if 0==len(loc_l): print 'Run not found:',run,'in','/cvmfs/atlas.cern.ch/repo/sw/Generators/MC12JobOptions/latest/share/DSID'+run[0:3]+'xxx/MC12.'+run+'.*' continue if len(loc_l)>1: print 'Multiple runs found:',loc_l,'for run',run,'- Using first.' loc = loc_l[0] jobO = open(loc,'r') main_jobO = '' for line in jobO: if 'include' in line and 'MadGraphControl' in line:
theApp._exitstate = ExitCodes.INCLUDE_ERROR sys.exit(theApp._exitstate) elif isinstance(e, ImportError): print sys.exc_type, e theApp._exitstate = ExitCodes.IMPORT_ERROR sys.exit(theApp._exitstate) raise print " +------------------------------------------------+ " print " | Execute command before jobOptions script END. | " print " +------------------------------------------------+ " print "\n" ### basic job configuration before user configuration ------------------------ try: include(pscServiceSetupBegin) include.block(pscServiceSetupBegin) except Exception, e: print sys.exc_type, e if isinstance(e, IncludeError): theApp._exitstate = ExitCodes.INCLUDE_ERROR sys.exit(theApp._exitstate) raise if 'interactive' in dir(): import TrigPSC.PscConfig TrigPSC.PscConfig.interactive = bool(interactive) del interactive ### run user jobOptions file ------------------------------------------------- try: include("%s" % PscConfig.optmap['JOBOPTIONSPATH'])
# Constructor arguments: # level, type, threshold, isIsolated # # e.g. level=L2, type=muon, threshold=30, isIsolated=None # level=EF, type=egamma, threshold=20, isIsolated=isolated # # Methods: # instanceName() : returns name of algorithm instance # classAndInstanceName() : returns a string to be entered in the sequence file. This string # defines the class and instance name # # from AthenaCommon.Include import include include.block("InDetTrigRecExample/EFInDetConfig.py") include("InDetTrigRecExample/InDetTrigRec_jobOptions.py" ) # this is needed to get InDetTrigFlags from AthenaCommon.Logging import logging log = logging.getLogger("EFInDetConfig.py") from InDetTrigRecExample.InDetTrigConfigRecPreProcessing import * from InDetTrigRecExample.InDetTrigConfigRecNewTracking import \ SiTrigTrackFinder_EF, SiTrigTrackSeededFinder_EF, SiTrigSimpleTrackFinder_EF, \ TrigAmbiguitySolver_EF,TRTTrackExtAlg_EF,\ TrigExtProcessor_EF, InDetTrigDetailedTrackTruthMaker_EF from InDetTrigRecExample.InDetTrigConfigRecNewTracking import SimpleTrigTrackCollMerger_EF
from AthenaCommon.OldStyleConfig import * from AthenaCommon.Constants import * preconfig = "AthenaCommon" ### Athena configuration ----------------------------------------------------- theApp = iService( "ApplicationMgr" ) # proxy theApp.Dlls += [ 'AthenaServices' ] include( "%s/Bootstrap.py" % preconfig ) ## create the application manager and start in a non-initialised state from AthenaCommon.AppMgr import theApp, ToolSvc, ServiceMgr, theAuditorSvc ## basic job configuration include( "AthenaCommon/Atlas.UnixStandardJob.py" ) include.block( "AthenaCommon/Atlas.UnixStandardJob.py" ) EventLoopMgr = iService( 'EventLoopMgr' ) AthenaEventLoopMgr = EventLoopMgr # for historic reasons ### execution ---------------------------------------------------------------- from AthenaCommon.ResourceLimits import SetMaxLimits SetMaxLimits() del SetMaxLimits include( sys.argv[1] ) try: theApp.run() # runs until theApp.EvtMax events reached except RuntimeError, e: print 'RuntimeError:', str(e)
if hasattr(runArgs, "maxEvents"): athenaCommonFlags.EvtMax.set_Value_and_Lock(runArgs.maxEvents) if hasattr(runArgs, "skipEvents"): athenaCommonFlags.SkipEvents.set_Value_and_Lock(runArgs.skipEvents) print '################################################' print runArgs.triggerConfig print '########### DetFlags before ###############' DetFlags.Print() DetFlags.detdescr.all_setOn() DetFlags.all_setOn() include("RecExCond/AllDet_detDescr.py") print '########### DetFlags after ###############' DetFlags.Print() include.block("RecExCond/RecExCommon_flags.py") TriggerFlags.doID = True TriggerFlags.doMuon = True TriggerFlags.doCalo = True TriggerFlags.doCalo = True TriggerFlags.writeBS = True #TriggerFlags.doID(): from InDetTrigRecExample.InDetTrigConfigConditions import \ PixelConditionsSetup, SCT_ConditionsSetup, TRT_ConditionsSetup # PixelConditionsSetup.config(useDCS=False, onlineMode=True, prefix='') PixelConditionsSetup.lock() PixelConditionsSetup.createSvc() SCT_ConditionsSetup.config(useDCS=False, onlineMode=True, prefix='') SCT_ConditionsSetup.lock() SCT_ConditionsSetup.createSvc()
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration from AthenaCommon.Include import include, printfunc include.block("TriggerJobOpts/TriggerConfigCheckHLTpsk.py") from AthenaCommon.Logging import logging mlog = logging.getLogger('TriggerConfigCheckHLTpsk') ## get the logger runNumbers = [] from AthenaCommon.AthenaCommonFlags import athenaCommonFlags if len(athenaCommonFlags.BSRDOInput()) > 0: from PyUtils.MetaReaderPeeker import metadata if 'runNumbers' in metadata: # online monitoring does not provide a run_number in the file metadata (hence the rest of this program will be skipped) runNumbers = metadata['runNumbers'] if len(runNumbers) > 0: #from RecExConfig.RecAlgsFlags import recAlgs #from RecExConfig.RecFlags import rec from TriggerJobOpts.TriggerFlags import TriggerFlags ### Loop over the input files and find if a problematic one is there. ### If so, turn off the trigger. from PyCool import cool from CoolConvUtilities.AtlCoolLib import indirectOpen # get connection to COOL and find the HLT ps key from IOVDbSvc.CondDB import conddb coolDbConn = indirectOpen("COOLONL_TRIGGER/%s" % conddb.dbdata, oracle=True) hltfolder = coolDbConn.getFolder('/TRIGGER/HLT/PrescaleKey')
def BasicPixelDigitizationTool(name="PixelDigitizationTool", **kwargs): from AthenaCommon import CfgGetter kwargs.setdefault("RndmSvc", digitizationFlags.rndmSvc()) streamName = kwargs.setdefault("RndmEngine", "PixelDigitization") if not digitizationFlags.rndmSeedList.checkForExistingSeed(streamName): digitizationFlags.rndmSeedList.addSeed(streamName, 10513239, 492615104 ) from AthenaCommon.BeamFlags import jobproperties from AthenaCommon.Resilience import protectedInclude from AthenaCommon.Include import include from AthenaCommon.AppMgr import ServiceMgr protectedInclude( "PixelConditionsServices/SpecialPixelMapSvc_jobOptions.py" ) include.block( "PixelConditionsServices/SpecialPixelMapSvc_jobOptions.py" ) protectedInclude( "PixelConditionsServices/PixelDCSSvc_jobOptions.py" ) include.block( "PixelConditionsServices/PixelDCSSvc_jobOptions.py" ) protectedInclude("PixelConditionsServices/PixelCalibSvc_jobOptions.py") from IOVDbSvc.CondDB import conddb conddb.addFolderSplitMC("PIXEL","/PIXEL/ReadoutSpeed","/PIXEL/ReadoutSpeed") kwargs.setdefault("PixelCablingSvc","PixelCablingSvc") if not hasattr(ServiceMgr, "PixelSiPropertiesSvc"): from SiLorentzAngleSvc.LorentzAngleSvcSetup import lorentzAngleSvc from SiPropertiesSvc.SiPropertiesSvcConf import SiPropertiesSvc pixelSiPropertiesSvc = SiPropertiesSvc(name = "PixelSiPropertiesSvc",DetectorName="Pixel",SiConditionsServices = lorentzAngleSvc.pixelSiliconConditionsSvc) ServiceMgr += pixelSiPropertiesSvc kwargs.setdefault("InputObjectName", "PixelHits") pixTools = [] pixTools += ['PixelDiodeCrossTalkGenerator'] pixTools += ['PixelChargeSmearer'] if digitizationFlags.doInDetNoise.get_Value(): pixTools += ['PixelNoisyCellGenerator'] pixTools += ['PixelGangedMerger'] pixTools += ['SpecialPixelGenerator'] pixTools += ['PixelRandomDisabledCellGenerator'] pixTools += ['PixelCellDiscriminator'] kwargs.setdefault("PixelTools", pixTools) # Start of special cosmics tuning: if jobproperties.Beam.beamType == "cosmics" : kwargs.setdefault("UseComTime", True) if GeometryFlags.isSLHC(): LVL1Latency = [255, 255, 255, 255, 255, 16, 255] ToTMinCut = [0, 0, 0, 0, 0, 0, 0] ApplyDupli = [False, False, False, False, False, False, False] LowTOTduplication = [0, 0, 0, 0, 0, 0, 0] kwargs.setdefault("LVL1Latency", LVL1Latency) kwargs.setdefault("ToTMinCut", ToTMinCut) kwargs.setdefault("ApplyDupli", ApplyDupli) kwargs.setdefault("LowTOTduplication", LowTOTduplication) else: # For LVL1Latency, ToTMinCut, ApplyDupli and LowTOTduplication, first component [0] is always for IBL, even for run 1 production. # The order is IBL, BL, L1, L2, EC, DBM # For IBL and DBM, values of LVL1Latency and LowToTDupli are superseded by values driven by HitDiscCnfg settings, in PixelDigitizationTool.cxx LVL1Latency = [16, 150, 255, 255, 255, 16] ToTMinCut = [0, 6, 6, 6, 6, 0] ApplyDupli = [True, False, False, False, False, False] LowTOTduplication = [0, 7, 7, 7, 7, 0] kwargs.setdefault("LVL1Latency", LVL1Latency) kwargs.setdefault("ToTMinCut", ToTMinCut) kwargs.setdefault("ApplyDupli", ApplyDupli) kwargs.setdefault("LowTOTduplication", LowTOTduplication) if digitizationFlags.doXingByXingPileUp(): # PileUpTool approach kwargs.setdefault("FirstXing", Pixel_FirstXing() ) kwargs.setdefault("LastXing", Pixel_LastXing() ) return CfgMgr.PixelDigitizationTool(name, **kwargs)
print 'Getting SLHA files for run(s)', listOfRuns # Fake some things that we won't need later from PyJobTransforms.trfJobOptions import RunArguments runArgs = RunArguments() runArgs.randomSeed = 1234 from AthenaCommon import Logging evgenLog = Logging.logging.getLogger('SLHAGetter') # only really need this once from AthenaCommon.Include import IncludeError, include include.setShowIncludes(False) include( '/cvmfs/atlas.cern.ch/repo/sw/Generators/MC12JobOptions/latest/susycontrol/MadGraphControl_SimplifiedModelPreInclude.py' ) include.block('MC12JobOptions/MadGraphControl_SimplifiedModelPreInclude.py') include.block('MC12JobOptions/MadGraphControl_SimplifiedModelPostInclude.py') for run in listOfRuns: loc_l = glob.glob( '/cvmfs/atlas.cern.ch/repo/sw/Generators/MC12JobOptions/latest/share/DSID' + run[0:3] + 'xxx/MC12.' + run + '.*') if 0 == len(loc_l): print 'Run not found:', run, 'in', '/cvmfs/atlas.cern.ch/repo/sw/Generators/MC12JobOptions/latest/share/DSID' + run[ 0:3] + 'xxx/MC12.' + run + '.*' continue if len(loc_l) > 1: print 'Multiple runs found:', loc_l, 'for run', run, '- Using first.' loc = loc_l[0] jobO = open(loc, 'r')