def inputFileNames(): from AthenaCommon.AthenaCommonFlags import athenaCommonFlags if athenaCommonFlags.FilesInput() != []: return athenaCommonFlags.FilesInput() from RecExConfig.RecFlags import rec inFiles = None # highest flag have precedence if rec.readTAG(): inFiles = athenaCommonFlags.PoolTAGInput() elif rec.readAOD(): inFiles = athenaCommonFlags.PoolAODInput() elif rec.readESD(): inFiles = athenaCommonFlags.PoolESDInput() elif rec.readRDO(): from AthenaCommon.GlobalFlags import globalflags if globalflags.InputFormat == 'bytestream': inFiles = athenaCommonFlags.BSRDOInput() else: inFiles = athenaCommonFlags.PoolRDOInput() else: raise RutimeError("Unable to determine input file") return inFiles
def get_runs_from_all_taginput(self): from AthenaCommon.AthenaCommonFlags import athenaCommonFlags # ifiles = athenaCommonFlags.PoolTAGInput() # not set correctly! ifiles = athenaCommonFlags.FilesInput() if ifiles is None or ifiles == []: ifiles = ServiceMgr.EventSelector.InputCollections self.all_runs = set() for file in ifiles: runs = self.get_runs_from_tagfile(file) self.all_runs |= set(runs) return self.all_runs
def _configure(): """Install the Athena-based TTree event selector and correctly configure a few other services. """ from AthenaCommon import CfgMgr from AthenaCommon.AppMgr import theApp from AthenaCommon.AppMgr import ServiceMgr as svcMgr from AthenaCommon.Logging import logging from AthenaCommon.AthenaCommonFlags import athenaCommonFlags msg = logging.getLogger('ReadAthenaRoot') msg.debug("Configuring Athena for reading ROOT files (via TChain)...") if hasattr(svcMgr, 'EventSelector'): err = "svcMgr already configured with another EventSelector: [%s]"%\ svcMgr.EventSelector.getFullJobOptName() msg.error(err) raise RuntimeError(err) #Setup our EventSelector svcMgr += CfgMgr.Athena__RootNtupleEventSelector("EventSelector") #for historical reasons, we now add configurables of a bunch of services #this could be gotten rid of in the future, just here to save existing jobo from errors if not hasattr(svcMgr, 'THistSvc'): svcMgr += CfgMgr.THistSvc() if not hasattr(svcMgr, 'ProxyProviderSvc'): svcMgr += CfgMgr.ProxyProviderSvc() if not hasattr(svcMgr, 'Athena::NtupleCnvSvc'): svcMgr += CfgMgr.Athena__NtupleCnvSvc() #Here we set various properties of things theApp.ExtSvc += [svcMgr.EventSelector.getFullName()] theApp.EvtSel = "EventSelector" #default the input collections to the FilesInput from AthenaCommonFlags #this is so that the eventselector picks up input files in grid jobs svcMgr.EventSelector.InputCollections = athenaCommonFlags.FilesInput() # suppress the event loop heartbeat as it is somewhat I/O hungry for # no real gain in n-tuple reading/writing scenarii if not hasattr(svcMgr, theApp.EventLoop): svcMgr += getattr(CfgMgr, theApp.EventLoop)() evtloop = getattr(svcMgr, theApp.EventLoop) try: evtloop.EventPrintoutInterval = 10000 except Exception as err: msg.info('disabling event loop heartbeat... [failed]') msg.info('performances might be sub-par... sorry.') pass msg.debug("Configuring Athena for reading ROOT files (via TChain)... [OK]") return
def __init__(self): """ Sets up logging and class variables needed """ from AthenaCommon.Logging import logging self.hforLog = logging.getLogger('Hfor') self.hforLog.debug( "****************** STARTING Hfor Configuration *****************") self.file = "" self.curr_DSID = "" self.config_String = "fail" from AthenaCommon.AthenaCommonFlags import athenaCommonFlags self.fList = athenaCommonFlags.FilesInput()
def InputFileNames(): from AthenaCommon.AthenaCommonFlags import athenaCommonFlags if athenaCommonFlags.FilesInput() != []: return athenaCommonFlags.FilesInput() from RecExConfig.RecFlags import rec inFiles = None ## FIXME ## if (not athenaCommonFlags.PoolTAGInput.isDefault() or rec.readTAG() ): ## inFiles=athenaCommonFlags.PoolTAGInput() ## elif (not athenaCommonFlags.PoolAODInput.isDefault() or rec.readAOD() ): ## inFiles=athenaCommonFlags.PoolAODInput() ## elif (not athenaCommonFlags.PoolESDInput.isDefault() or rec.readESD() ): ## inFiles=athenaCommonFlags.PoolESDInput() ## elif not athenaCommonFlags.BSRDOInput.isDefault(): ## inFiles=athenaCommonFlags.BSRDOInput() ## elif not athenaCommonFlags.PoolRDOInput.isDefault(): ## inFiles=athenaCommonFlags.PoolRDOInput() if rec.readTAG(): inFiles = athenaCommonFlags.PoolTAGInput() elif rec.readAOD(): inFiles = athenaCommonFlags.PoolAODInput() elif rec.readESD(): inFiles = athenaCommonFlags.PoolESDInput() elif rec.readRDO(): from AthenaCommon.GlobalFlags import globalflags if globalflags.InputFormat == 'bytestream': inFiles = athenaCommonFlags.BSRDOInput() else: inFiles = athenaCommonFlags.PoolRDOInput() else: raise RuntimeError("Unable to determine input file") return inFiles
# needed .... from RecExConfig.RecFlags import rec rec.doLArg = doLAr rec.doTile = doTile rec.doCalo = doLAr or doTile rec.Commissioning = True # setup geometry from AtlasGeoModel import SetGeometryVersion from AtlasGeoModel import GeoModelInit from AtlasGeoModel import SetupRecoGeometry # setup bytestream reading from ByteStreamCnvSvc import ReadByteStream svcMgr.EventSelector.Input = athenaCommonFlags.FilesInput() theApp.EvtMax = athenaCommonFlags.EvtMax() svcMgr.EventSelector.SkipEvents = athenaCommonFlags.SkipEvents() # Level-1 bs data include("TrigT1CaloByteStream/ReadLVL1CaloBS_jobOptions.py") # detector description include("CaloDetMgrDetDescrCnv/CaloDetMgrDetDescrCnv_joboptions.py") include("LArConditionsCommon/LArConditionsCommon_comm_jobOptions.py") # extra LAr setup if doLAr: include("LArConditionsCommon/LArIdMap_comm_jobOptions.py") include("LArIdCnv/LArIdCnv_joboptions.py") svcMgr.ByteStreamAddressProviderSvc.TypeNames += [ "LArFebHeaderContainer/LArFebHeader"
] ############################ # Auto configure everything ############################ import AthenaPoolCnvSvc.ReadAthenaPool ServiceMgr.EventSelector.InputCollections = InputFiles ServiceMgr.PoolSvc.AttemptCatalogPatch = True ServiceMgr.OutputLevel = ERROR # from AthenaCommon.AthenaCommonFlags import athenaCommonFlags if len(athenaCommonFlags.FilesInput()) == 0: athenaCommonFlags.FilesInput = ServiceMgr.EventSelector.InputCollections # import AthenaPoolCnvSvc.ReadAthenaPool import AthenaPoolCnvSvc.WriteAthenaPool # from RecExConfig.RecFlags import rec rec.AutoConfiguration.set_Value_and_Lock(["everything"]) rec.doCBNT.set_Value_and_Lock(False) rec.doESD.set_Value_and_Lock(False) rec.doHist.set_Value_and_Lock(False)
from PartPropSvc.PartPropSvcConf import PartPropSvc include("ParticleBuilderOptions/McAOD_PoolCnv_jobOptions.py") include("EventAthenaPool/EventAthenaPool_joboptions.py" ) #Use these lines if the NSW is included in the simulation #from GeoModelSvc.GeoModelSvcConf import GeoModelSvc #GeoModelSvc = GeoModelSvc() #GeoModelSvc.MuonVersionOverride="MuonSpectrometer-R.07.00-NSW" import os from glob import glob from AthenaCommon.AthenaCommonFlags import athenaCommonFlags athenaCommonFlags.FilesInput = glob( "/tmp/"+os.environ['USER']+"/"+"HITS*root*" ) ServiceMgr.EventSelector.InputCollections = athenaCommonFlags.FilesInput() # This is stupid and redundant, but necessary from AthenaCommon.AlgSequence import AlgSequence topSequence = AlgSequence() from HitAnalysis.HitAnalysisConf import RPCHitAnalysis topSequence += RPCHitAnalysis() RPCHitAnalysis = RPCHitAnalysis() RPCHitAnalysis.NtupleFileName = 'RPCHitAnalysis' from GaudiSvc.GaudiSvcConf import THistSvc ServiceMgr += THistSvc() ServiceMgr.THistSvc.Output += [ "RPCHitAnalysis DATAFILE='RPCHitAnalysis.root' OPT='RECREATE'" ] ServiceMgr.MessageSvc.OutputLevel = INFO ServiceMgr.MessageSvc.defaultLimit = 9999999
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration #-------------------------------------------------------------- # Import config #-------------------------------------------------------------- from AthenaCommon.AthenaCommonFlags import athenaCommonFlags from RecExConfig.RecFlags import rec from RecExConfig.RecAlgsFlags import recAlgs rec.AutoConfiguration = ['everything'] print athenaCommonFlags.FilesInput() from AthenaCommon.GlobalFlags import globalflags globalflags.ConditionsTag.set_Value_and_Lock("CONDBR2-BLKPA-2015-08") globalflags.DetDescrVersion.set_Value_and_Lock("ATLAS-R2-2015-03-01-00") globalflags.DataSource.set_Value_and_Lock("data") import MagFieldServices.SetupField from IOVDbSvc.CondDB import conddb conddb.setGlobalTag(globalflags.ConditionsTag()) # --- number of events to process athenaCommonFlags.EvtMax = 50 athenaCommonFlags.SkipEvents = 0 # --- disable error protection of RecExCommon athenaCommonFlags.AllowIgnoreConfigError.set_Value_and_Lock(False) #--------------------------------------------------------------
##################################################################################################### # # top level jobOptions to run Muon chains in the RTT or standalone # sets some global variables that adjust the execution of TrigInDetValidation_RTT_Common.py # # [email protected] # ##################################################################################################### from AthenaCommon.AthenaCommonFlags import athenaCommonFlags #set athenaCommonFlags.FilesInput to be able to use this job options standalone without RTT #secondSet of files can be activated by the if statement below if athenaCommonFlags.FilesInput() == []: athenaCommonFlags.FilesInput = [] secondSet = True if secondSet: athenaCommonFlags.FilesInput = [ "root://eosatlas//eos/atlas/atlascerngroupdisk/proj-sit/vchavda/TrigInDetValidation_muon/mc10_14TeV.106047.PythiaZmumu_no_filter.digit.RDO.e662_s1107_d459_tid285222_00/RDO.285222._000005.pool.root.1", "root://eosatlas//eos/atlas/atlascerngroupdisk/proj-sit/vchavda/TrigInDetValidation_muon/mc10_14TeV.106047.PythiaZmumu_no_filter.digit.RDO.e662_s1107_d459_tid285222_00/RDO.285222._000006.pool.root.1", "root://eosatlas//eos/atlas/atlascerngroupdisk/proj-sit/vchavda/TrigInDetValidation_muon/mc10_14TeV.106047.PythiaZmumu_no_filter.digit.RDO.e662_s1107_d459_tid285222_00/RDO.285222._000018.pool.root.1", "root://eosatlas//eos/atlas/atlascerngroupdisk/proj-sit/vchavda/TrigInDetValidation_muon/mc10_14TeV.106047.PythiaZmumu_no_filter.digit.RDO.e662_s1107_d459_tid285222_00/RDO.285222._000019.pool.root.1", "root://eosatlas//eos/atlas/atlascerngroupdisk/proj-sit/vchavda/TrigInDetValidation_muon/mc10_14TeV.106047.PythiaZmumu_no_filter.digit.RDO.e662_s1107_d459_tid285222_00/RDO.285222._000030.pool.root.1", "root://eosatlas//eos/atlas/atlascerngroupdisk/proj-sit/vchavda/TrigInDetValidation_muon/mc10_14TeV.106047.PythiaZmumu_no_filter.digit.RDO.e662_s1107_d459_tid285222_00/RDO.285222._000033.pool.root.1", "root://eosatlas//eos/atlas/atlascerngroupdisk/proj-sit/vchavda/TrigInDetValidation_muon/mc10_14TeV.106047.PythiaZmumu_no_filter.digit.RDO.e662_s1107_d459_tid285222_00/RDO.285222._000047.pool.root.1", "root://eosatlas//eos/atlas/atlascerngroupdisk/proj-sit/vchavda/TrigInDetValidation_muon/mc10_14TeV.106047.PythiaZmumu_no_filter.digit.RDO.e662_s1107_d459_tid285222_00/RDO.285222._000048.pool.root.1", "root://eosatlas//eos/atlas/atlascerngroupdisk/proj-sit/vchavda/TrigInDetValidation_muon/mc10_14TeV.106047.PythiaZmumu_no_filter.digit.RDO.e662_s1107_d459_tid285222_00/RDO.285222._000049.pool.root.1", "root://eosatlas//eos/atlas/atlascerngroupdisk/proj-sit/vchavda/TrigInDetValidation_muon/mc10_14TeV.106047.PythiaZmumu_no_filter.digit.RDO.e662_s1107_d459_tid285222_00/RDO.285222._000064.pool.root.1",
doReadBS = True from AthenaCommon.AthenaCommonFlags import athenaCommonFlags if not doReadBS: athenaCommonFlags.FilesInput = ["root://eosatlas//eos/atlas/atlascerngroupdisk/perf-idtracking/InDetRecExample/data10_cos.00151040.physics_IDCosmic.recon.ESD.f220/data10_cos.00151040.physics_IDCosmic.recon.ESD.f220._lb0002._0001.1"] if doReadBS: # Since BS doesn't yet support xrootd need to set import os os.environ['STAGE_HOST']="castoratlast3" os.environ['STAGE_SVCCLASS']="atlascerngroupdisk" athenaCommonFlags.FilesInput = ["root://eosatlas//eos/atlas/atlascerngroupdisk/proj-sit/tct/rec_input/tracking/data10_cos.00151040.physics_IDCosmic.merge.RAW._lb0002._0001.1"] import AthenaPython.ConfigLib as apcl cfg = apcl.AutoCfg(name = 'InDetRecExampleAutoConfig', input_files=athenaCommonFlags.FilesInput()) cfg.configure_job() if doReadBS: from AthenaCommon.GlobalFlags import globalflags if len(globalflags.ConditionsTag())!=0: from IOVDbSvc.CondDB import conddb conddb.setGlobalTag(globalflags.ConditionsTag()) # request TrackingGeo tag AtlasLayerMat_v18_ATLAS-GEO-16 # but there are only AtlasLayerMat_v16_ATLAS-GEO-16 # or AtlasLayerMat_v18_ATLAS-R1-2010-01 # @TODO switch to more recent data file ? conddb.addOverride('/GLOBAL/TrackingGeo/LayerMaterialV2','AtlasLayerMat_v19s0_ATLAS-R1-2010-01') #conddb.addOverride('/GLOBAL/TrackingGeo/LayerMaterialV2','AtlasLayerMat_v16_ATLAS-GEO-16') import MagFieldServices.SetupField
def _configure(): """Install the Athena-based xAOD event selector and correctly configure a few other services. """ from AthenaCommon import CfgMgr from AthenaCommon.AppMgr import theApp from AthenaCommon.AppMgr import ServiceMgr as svcMgr from AthenaCommon.Logging import logging from AthenaCommon.AthenaCommonFlags import athenaCommonFlags from AthenaCommon.Constants import ERROR msg = logging.getLogger('ReadAthenaxAODHybrid') msg.debug( "Configuring Athena for reading xAOD files (via TEvent, with POOL for Metadata)..." ) #check if we already have a selector set up if hasattr(svcMgr, 'EventSelector'): err = "svcMgr already configured with another EventSelector: [%s]"%\ svcMgr.EventSelector.getFullJobOptName() msg.error(err) raise RuntimeError(err) #Setup our EventSelector svcMgr += CfgMgr.Athena__xAODEventSelector("EventSelector") #for historical reasons, we now add configurables of a bunch of services if not hasattr(svcMgr, 'THistSvc'): svcMgr += CfgMgr.THistSvc() if not hasattr(svcMgr, 'ProxyProviderSvc'): svcMgr += CfgMgr.ProxyProviderSvc() if not hasattr(svcMgr, 'InputMetaDataStore'): svcMgr += CfgMgr.StoreGateSvc("InputMetaDataStore") if not hasattr(svcMgr, 'Athena::xAODCnvSvc'): svcMgr += CfgMgr.Athena__xAODCnvSvc() if not hasattr(svcMgr, 'EventPersistencySvc'): svcMgr += CfgMgr.EvtPersistencySvc("EventPersistencySvc") if not hasattr(svcMgr, 'MetaDataSvc'): svcMgr += CfgMgr.MetaDataSvc("MetaDataSvc") if not hasattr(svcMgr, 'PoolSvc'): svcMgr += CfgMgr.PoolSvc() #Here we set various properties of things theApp.ExtSvc += [svcMgr.EventSelector.getFullName()] theApp.EvtSel = "EventSelector" svcMgr.MetaDataSvc.MetaDataContainer = "MetaDataHdr" #this really should be the default for this property :-( svcMgr.PoolSvc.OutputLevel = ERROR svcMgr.EventSelector.ReadMetaDataWithPool = True #default the input collections to the FilesInput from AthenaCommonFlags #this is so that the eventselector picks up input files in grid jobs svcMgr.EventSelector.InputCollections = athenaCommonFlags.FilesInput() # suppress the event loop heartbeat as it is somewhat I/O hungry for # no real gain in n-tuple reading/writing scenarii if not hasattr(svcMgr, theApp.EventLoop): svcMgr += getattr(CfgMgr, theApp.EventLoop)() evtloop = getattr(svcMgr, theApp.EventLoop) try: evtloop.EventPrintoutInterval = 10000 except Exception as err: msg.info('disabling event loop heartbeat... [failed]') msg.info('performances might be sub-par... sorry.') pass msg.debug( "Configuring Athena for reading ROOT files (via TEvent, with POOL for Metadata)... [OK]" ) return
f.writelines('\n') f.writelines(str(BLINE2)) f.writelines('\n') f.close() del ALINE1 del ALINE2 del BLINE1 del BLINE2 doG4SimConfig = True from AthenaCommon.AthenaCommonFlags import athenaCommonFlags import PyUtils.AthFile as af try: f = af.fopen(athenaCommonFlags.FilesInput()[0]) if "StreamHITS" in f.infos["stream_names"]: from Digitization.DigitizationFlags import digitizationFlags simdict = digitizationFlags.specialConfiguration.get_Value() doG4SimConfig = False else: from G4AtlasApps.SimFlags import simFlags simdict = simFlags.specialConfiguration.get_Value() except: from G4AtlasApps.SimFlags import simFlags simdict = simFlags.specialConfiguration.get_Value() assert "MASS" in simdict assert "CHARGE" in simdict load_files_for_qball_scenario(simdict["MASS"], simdict["CHARGE"])
# for o in [ o for o in RecExCommonAlgs.keys() if not o in varInit ]: # exec '%s = RecExCommonAlgs[ "%s" ]' % (o,o) # else: # logRecExCommon_flags.info("By default switch off all algorithms") # # make sure RecExCommonAlgs is consistent (necessary for clarity # for o in [ o for o in RecExCommonAlgs.keys() if o in varInit ]: # exec 'RecExCommonAlgs["%s"] = %s' % (o,o) # for o in [ o for o in RecExCommonAlgs.keys() if not o in varInit ]: # exec '%s = False' % (o) # merge Algs flag with the other flags for future reference RecExCommonFlags.update(AthenaCommonFlags) RecExCommonFlags.update(RecExCommonAlgs) #FilesInput() triggers full auto-configuration. Only for a transition period. if len(athenaCommonFlags.FilesInput()) > 0: logRecExCommon_flags.info( "Full auto-configuration has been triggered by FilesInput()") rec.AutoConfiguration.append('everything') #Optional auto-configuration if len(rec.AutoConfiguration()) > 0: from RecExConfig.AutoConfiguration import ConfigureFromListOfKeys ConfigureFromListOfKeys(rec.AutoConfiguration()) include("RecExConfig/AutoConfigConsistencyCheck.py") #special commisioning job options if rec.Commissioning(): include("RecExCommission/RecExCommission.py") if rec.triggerStream().startswith('express'):
def EDMDecodingVersion(): log = logging.getLogger("EDMDecodingVersion") # BYTESTREAM: decide Run3 or later based on ROD version, decide Run1/Run2 based on run number if globalflags.InputFormat.is_bytestream(): # Check HLT ROD version in first event of first input file from AthenaCommon.AthenaCommonFlags import athenaCommonFlags inputFileName = athenaCommonFlags.FilesInput()[0] if not inputFileName and athenaCommonFlags.isOnline(): log.info( "Online reconstruction mode, no input file available. Leaving default TriggerFlags.EDMDecodingVersion=%d", TriggerFlags.EDMDecodingVersion()) return import eformat from libpyeformat_helper import SubDetector bs = eformat.istream(inputFileName) rodVersionM = -1 rodVersionL = -1 # Find the first HLT ROBFragment in the first event for robf in bs[0]: if robf.rob_source_id().subdetector_id() == SubDetector.TDAQ_HLT: rodVersionM = robf.rod_minor_version() >> 8 rodVersionL = robf.rod_minor_version() & 0xFF log.debug("HLT ROD minor version from input file is %d.%d", rodVersionM, rodVersionL) break if rodVersionM < 0 or rodVersionL < 0: log.warning( "Cannot determine HLT ROD version from input file, falling back to runNumber-based decision" ) elif rodVersionM >= 1: TriggerFlags.EDMDecodingVersion = 3 log.info( "Decoding version set to 3, because running on BS file with HLT ROD version %d.%d", rodVersionM, rodVersionL) return # Use run number to determine decoding version from RecExConfig.AutoConfiguration import GetRunNumber runNumber = GetRunNumber() boundary_run12 = 230000 boundary_run23 = 368000 if runNumber <= 0: log.error( "Cannot determine decoding version because run number %d is invalid. Leaving the default version %d", runNumber, TriggerFlags.EDMDecodingVersion()) elif runNumber < boundary_run12: # Run-1 data TriggerFlags.EDMDecodingVersion = 1 TriggerFlags.doMergedHLTResult = False log.info( "Decoding version set to 1 based on BS file run number (runNumber < %d)", boundary_run12) elif runNumber < boundary_run23: # Run-2 data TriggerFlags.EDMDecodingVersion = 2 log.info( "Decoding version set to 2 based on BS file run number (%d < runNumber < %d)", boundary_run12, boundary_run23) else: # Run-3 data TriggerFlags.EDMDecodingVersion = 3 log.info( "Decoding version set to 3 based on BS file run number (runNumber > %d)", boundary_run23) else: # POOL files: decide based on HLT output type present in file from RecExConfig.ObjKeyStore import cfgKeyStore from PyUtils.MetaReaderPeeker import convert_itemList cfgKeyStore.addManyTypesInputFile(convert_itemList(layout='#join')) TriggerFlags.doMergedHLTResult = True if cfgKeyStore.isInInputFile("HLT::HLTResult", "HLTResult_EF"): TriggerFlags.EDMDecodingVersion = 1 TriggerFlags.doMergedHLTResult = False log.info( "Decoding version set to 1, because HLTResult_EF found in POOL file" ) elif cfgKeyStore.isInInputFile("xAOD::TrigNavigation", "TrigNavigation"): TriggerFlags.EDMDecodingVersion = 2 log.info( "Decoding version set to 2, because TrigNavigation found in POOL file" ) elif cfgKeyStore.isInInputFile("xAOD::TrigCompositeContainer", "HLTNav_Summary"): TriggerFlags.EDMDecodingVersion = 3 log.info( "Decoding version set to 3, because HLTNav_Summary found in POOL file" ) elif rec.readRDO(): # If running Trigger on RDO input (without previous trigger result), choose Run-2 or Run-3 based on doMT if TriggerFlags.doMT(): TriggerFlags.EDMDecodingVersion = 3 log.info( "Decoding version set to 3, because running Trigger with doMT=True" ) else: TriggerFlags.EDMDecodingVersion = 2 log.info( "Decoding version set to 2, because running Trigger with doMT=False" ) else: log.warning( "Cannot recognise HLT EDM format, leaving default TriggerFlags.EDMDecodingVersion=%d", TriggerFlags.EDMDecodingVersion())
'Could not add TimingAlg, no timing info will be written out.') # Copy over timings if needed if not overlayFlags.isDataOverlay(): job += CfgGetter.getAlgorithm("CopyTimings") #------------------------- # Double event selector #------------------------- import AthenaPoolCnvSvc.ReadAthenaPoolDouble from AthenaCommon.AppMgr import ServiceMgr from AthenaCommon.AthenaCommonFlags import athenaCommonFlags if overlayFlags.isDataOverlay(): ServiceMgr.DoubleEventSelector.InputCollections = athenaCommonFlags.PoolHitsInput( ) ServiceMgr.SecondaryEventSelector.Input = athenaCommonFlags.FilesInput() ServiceMgr.SecondaryEventSelector.ProcessBadEvent = True else: ServiceMgr.DoubleEventSelector.InputCollections = athenaCommonFlags.PoolRDOInput( ) ServiceMgr.SecondaryEventSelector.InputCollections = athenaCommonFlags.PoolHitsInput( ) if athenaCommonFlags.SkipEvents.statusOn: ServiceMgr.DoubleEventSelector.SkipEvents = athenaCommonFlags.SkipEvents() # Properly generate event context from AthenaCommon.ConcurrencyFlags import jobproperties as jp nThreads = jp.ConcurrencyFlags.NumThreads() if nThreads > 0: EventLoop = Service("AthenaHiveEventLoopMgr") else:
msgSvc = theApp.service("MessageSvc") if msgSvc.OutputLevel <= DEBUG: msgSvc.defaultLimit = 0 msgSvc.enableSuppression = False # Define top sequence and output sequence from AthenaCommon.AlgSequence import AlgSequence, AthSequencer topSequence = AlgSequence() outSequence = AthSequencer("AthOutSeq") # Set input file to new-style flags from AthenaCommon.AthenaCommonFlags import athenaCommonFlags from AthenaConfiguration.AllConfigFlags import ConfigFlags ConfigFlags.Input.Files = athenaCommonFlags.FilesInput() # Use new-style config of ByteStream reading and import here into old-style JO from AthenaConfiguration.ComponentAccumulator import CAtoGlobalWrapper from ByteStreamCnvSvc.ByteStreamConfig import ByteStreamReadCfg CAtoGlobalWrapper(ByteStreamReadCfg, ConfigFlags) # Define the decoding sequence from TrigHLTResultByteStream.TrigHLTResultByteStreamConf import HLTResultMTByteStreamDecoderAlg from TrigOutputHandling.TrigOutputHandlingConf import TriggerEDMDeserialiserAlg from AthenaCommon.CFElements import seqAND decoder = HLTResultMTByteStreamDecoderAlg() deserialiser = TriggerEDMDeserialiserAlg("TrigDeserialiser")
#athenaCommonFlags.FilesInput = [ 'root://eosatlas//eos/atlas/atlasdatadisk/mc10_7TeV/DESD_MBIAS/e574_s932_s946_r2094/mc10_7TeV.105001.pythia_minbias.recon.DESD_MBIAS.e574_s932_s946_r2094_tid280668_00/DESD_MBIAS.280668._016228.pool.root.1'] #if doReadBS: import os os.environ['STAGE_HOST'] = "castoratlas" os.environ['STAGE_SVCCLASS'] = "atlcal" #os.environ['STAGE_HOST']="castoratlast3" #os.environ['STAGE_SVCCLASS']="atlascerngroupdisk" #//athenaCommonFlags.FilesInput = ["rfio:/castor/cern.ch/atlas/atlascerngroupdisk/perf-idtracking/InDetRecExample/data10_7TeV.00154817.physics_MinBias.merge.RAW/data10_7TeV.00154817.physics_MinBias.merge.RAW._lb0100._0001.1"] from AthenaCommon.GlobalFlags import globalflags #globalflags.ConditionsTag.set_Value_and_Lock("COMCOND-BLKPST-004-05") #globalflags.ConditionsTag.set_Value_and_Lock("COMCOND-BLKPST-005-06") #globalflags.ConditionsTag.set_Value_and_Lock("COMCOND-BLKPST-005-07") print athenaCommonFlags.FilesInput() import AthenaPython.ConfigLib as apcl cfg = apcl.AutoCfg(name='InDetRecExampleAutoConfig', input_files=athenaCommonFlags.FilesInput()) cfg.configure_job() if doReadBS: from AthenaCommon.GlobalFlags import globalflags if len(globalflags.ConditionsTag()) != 0: from IOVDbSvc.CondDB import conddb conddb.setGlobalTag(globalflags.ConditionsTag()) theApp.EvtMax = 10
# needed .... #from RecExConfig.RecFlags import rec rec.doLArg.set_Value_and_Lock(doLAr) rec.doTile.set_Value_and_Lock(doTile) rec.doCalo.set_Value_and_Lock(doLAr or doTile) rec.Commissioning.set_Value_and_Lock(True) # setup geometry from AtlasGeoModel import SetGeometryVersion from AtlasGeoModel import GeoModelInit from AtlasGeoModel import SetupRecoGeometry # setup bytestream reading from ByteStreamCnvSvc import ReadByteStream svcMgr.ByteStreamInputSvc.FullFileName = athenaCommonFlags.FilesInput() theApp.EvtMax = athenaCommonFlags.EvtMax() svcMgr.EventSelector.SkipEvents = athenaCommonFlags.SkipEvents() # Level-1 bs data include("TrigT1CaloByteStream/ReadLVL1CaloBS_jobOptions.py") # detector description include("CaloDetMgrDetDescrCnv/CaloDetMgrDetDescrCnv_joboptions.py") include("LArConditionsCommon/LArConditionsCommon_comm_jobOptions.py") include("TileIdCnv/TileIdCnv_jobOptions.py") include("TileConditions/TileConditions_jobOptions.py") # extra LAr setup if doLAr: include("LArConditionsCommon/LArIdMap_comm_jobOptions.py") include("LArIdCnv/LArIdCnv_joboptions.py")
from PartPropSvc.PartPropSvcConf import PartPropSvc include("ParticleBuilderOptions/McAOD_PoolCnv_jobOptions.py") include("EventAthenaPool/EventAthenaPool_joboptions.py") #---------------------------- # Input Dataset #---------------------------- import os from glob import glob from AthenaCommon.AthenaCommonFlags import athenaCommonFlags athenaCommonFlags.FilesInput = glob("/tmp/" + os.environ['USER'] + "/" + "RDO*.root*") #athenaCommonFlags.FilesInput = ['/afs/cern.ch/work/c/ctreado/RDOAnalysis/datasets/mc15_13TeV.110401.PowhegPythia_P2012_ttbar_nonallhad.recon.RDO.e4032_s2608_s2183_r6790_tid05706569_00/RDO.05706569._000011.pool.root.1'] ServiceMgr.EventSelector.InputCollections = athenaCommonFlags.FilesInput() #theApp.EvtMax = -1 theApp.EvtMax = 100 #---------------------------- # Message Service #---------------------------- # set output level threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL) ServiceMgr.MessageSvc.OutputLevel = INFO ServiceMgr.MessageSvc.defaultLimit = 9999999 #---------------------------- # Algorithms #---------------------------- from AthenaCommon.AlgSequence import AlgSequence
enabledSig = 'TriggerFlags.' + signature + 'Slice.setAll()' opt.enabledSignatures.append(enabledSig) else: disabledSig = 'TriggerFlags.' + signature + 'Slice.setAll()' opt.disabledSignatures.append(disabledSig) #------------------------------------------------------------- # Setting Global Flags #------------------------------------------------------------- from AthenaCommon.GlobalFlags import globalflags from AthenaCommon.AthenaCommonFlags import athenaCommonFlags from AthenaCommon.BeamFlags import jobproperties import TriggerJobOpts.Modifiers # Auto-configuration for athena if len(athenaCommonFlags.FilesInput()) > 0: ConfigFlags.Input.Files = athenaCommonFlags.FilesInput() import PyUtils.AthFile as athFile af = athFile.fopen(athenaCommonFlags.FilesInput()[0]) globalflags.InputFormat = 'bytestream' if af.fileinfos[ 'file_type'] == 'bs' else 'pool' globalflags.DataSource = 'data' if af.fileinfos['evt_type'][ 0] == 'IS_DATA' else 'geant4' ConfigFlags.Input.isMC = False if globalflags.DataSource == 'data' else True # Set isOnline=False for MC inputs unless specified in the options if globalflags.DataSource() != 'data' and 'isOnline' not in globals(): log.info("Setting isOnline = False for MC input") opt.isOnline = False # Set geometry and conditions tags if opt.setDetDescr is None: opt.setDetDescr = af.fileinfos.get('geometry', None)