def writeConfigFiles(self,level="all"):
        """ Writes all config files, and checks consistency"""

        #self.alignChains(self.theL2HLTChains)
        #self.alignChains(self.theEFHLTChains)


        teRenaming = self.resolveDuplicateTEs()
        self.checkChainUniqueness(teRenaming)
        
        #self.checkStreamConsistency()
        
        # disable python tracing
        from AthenaCommon.Include import excludeTracePattern
        excludeTracePattern.append("*/dom/*")

        smk_psk_Name = self.get_smk_psk_Name(self.menuName)

        # HLT XML
        if level=="all" or level=="hlt":
            self.writeHLTConfigFile(smk_psk_Name)

        # L1 XML
        if level=="all" or level=="l1":
            self.writeL1ConfigFile(smk_psk_Name)

        if self.checkMenuConsistency() is False:
            raise Exception( "Trigger menu inconsistent, aborting...." )
Пример #2
0
    def writeConfigFiles(self, level="all"):
        """ Writes all config files, and checks consistency"""

        teRenaming = self.resolveDuplicateTEs()
        self.checkChainUniqueness(teRenaming)

        #self.checkStreamConsistency()

        # disable python tracing
        from AthenaCommon.Include import excludeTracePattern
        excludeTracePattern.append("*/dom/*")

        smk_psk_Name = self.get_smk_psk_Name(self.menuName)

        # HLT XML
        if level == "all" or level == "hlt":
            self.writeHLTConfigFile(smk_psk_Name)

        # L1 XML no longer supported (now done by Lvl1Menu.py)
        if level == "l1":
            log.error("Lvl1 menu writing no longer supported here")

        if self.checkMenuConsistency() is False:
            raise Exception("Trigger menu inconsistent, aborting....")
Пример #3
0
# import usual flags container (except indet for now, because of ordering problem)
# FIXME do not load muon, and muon combined flags (ordering problem)
from RecExConfig.RecFlags import rec
from RecExConfig.RecAlgsFlags import recAlgs

from AthenaCommon.GlobalFlags import globalflags
from AthenaCommon.BeamFlags import jobproperties
from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
from AthenaCommon.BFieldFlags import jobproperties

from InDetRecExample.InDetJobProperties import InDetFlags

from AthenaCommon.Include import excludeTracePattern
excludeTracePattern.append("*/BTagging/BTaggingFlags.py")
excludeTracePattern.append("*/RecExConfig/RecoFunctions.py")

try:
    from AthenaMonitoring.DQMonFlags import DQMonFlags
except Exception:
    print "WARNING could not load DQMonFlags"

try:
    from TriggerJobOpts.TriggerFlags import TriggerFlags
except Exception:
    print "WARNING could not load TriggerFlags"

#      from InDetRecExample.InDetJobProperties import InDetFlags
try:
    from LArConditionsCommon.LArCondFlags import larCondFlags
except Exception:
    print "WARNING could not load LArCondFlags"
Пример #4
0
from AthenaCommon.AppMgr import ServiceMgr, ToolSvc
from AthenaCommon.Logging import logging

from RecExConfig.RecFlags import jobproperties
from RecExConfig.RecFlags import rec
from RecExConfig.RecAlgsFlags import recAlgs
from RecExConfig.Configured import Configured

from TriggerJobOpts.TriggerFlags import TriggerFlags as TF
from TriggerMenu.menu.GenerateMenu import GenerateMenu

log = logging.getLogger("TriggerGetter.py")

# this is to limit messags when running with -s
from AthenaCommon.Include import excludeTracePattern
excludeTracePattern.append("*/TriggerPythonConfig.py")
excludeTracePattern.append(
    "*/TrigMonitorBase/TrigGenericMonitoringToolConfig.py")
excludeTracePattern.append("*/TriggerMenu/*")
excludeTracePattern.append("*/TrigSteering/TrigSteeringConfig.py")


class TriggerGetter(Configured):
    #    _output = {"HLT::HLTResult" : ["HLTResult_L2", "HLTResult_EF"] }
    _configured = True
    _done = False

    def __init__(self):
        # tell the Configured machinery that we do not care about the objects already there
        if not TF.doFEX() and TF.doHypo():
            Configured.__init__(self, ignoreExistingDataObject=True)
Пример #5
0
        logAnaCommon_topOptions.warning("could not set TimeOut (temporary)")
        pass
    pass
if rec.Production():
    AthenaCommon.Configurable.log.setLevel( WARNING )
    pass


# reduce amount of tracing from the most verbose
#to spot the most verbose jobo:
#  RecExCommon_links.sh
#  athena >! all.log
#grep "\-\ " all.log | awk {'print $2'} | sort | uniq -c | sort -n | tail -20
# then find jobo number in log file and add the jobo to exclude list
from AthenaCommon.Include import excludeTracePattern
excludeTracePattern.append("*/CLIDComps/clidGenerator.py")
excludeTracePattern.append("*/RecExConfig/Resilience.py")
excludeTracePattern.append("*/AthenaCommmon/Resilience.py")
excludeTracePattern.append("*/OutputStreamAthenaPool/MultipleStreamManager.py")
excludeTracePattern.append("*/GaudiKernel/GaudiHandles.py")
excludeTracePattern.append ( "*/MuonRecExample/MuonRecUtils.py")
excludeTracePattern.append ("athfile-cache.ascii")
excludeTracePattern.append ("*/IOVDbSvc/CondDB.py")
excludeTracePattern.append("*/TrigConfigSvcConfig.py")
excludeTracePattern.append("*/LArCalib.py")
excludeTracePattern.append("*/_xmlplus/*")
excludeTracePattern.append("*/InDetTrigRecExample/EFInDetConfig.py")
excludeTracePattern.append("*/CaloClusterCorrection/CaloSwEtaoff*")
excludeTracePattern.append("*/PyUtils/Helpers.py")
excludeTracePattern.append("*/RecExConfig/RecoFunctions.py")
excludeTracePattern.append("*/TrigEgammaHypo/TrigEFElectronHypoMonitoring.py")
Пример #6
0
# -------------------------------------------------------------
# TriggerFlags
# -------------------------------------------------------------
from TriggerJobOpts.TriggerFlags import TriggerFlags
TriggerFlags.triggerMenuSetup = 'lumi1E31'
TriggerFlags.readLVL1configFromXML = True
TriggerFlags.readHLTconfigFromXML = True  # this we need to make L1 working correctly
TriggerFlags.inputLVL1configFile = "../AthenaP1RDO/outputLVL1config.xml"

# -------------------------------------------------------------
# Menu generation
# -------------------------------------------------------------
# this is to limit messags when running with -s
from AthenaCommon.Include import excludeTracePattern
excludeTracePattern.append("*/TrigConfigSvc/TriggerPythonConfig.py")
excludeTracePattern.append("*/TrigConfigSvc/TrigConfigSvcConfig.py")
from TriggerMenuPython.GenerateMenu import GenerateMenu
g = GenerateMenu()
g.generate()

# -------------------------------------------------------------
# Setup LVL1 simulation
# -------------------------------------------------------------
from TriggerJobOpts.Lvl1TriggerOnlineGetter import Lvl1SimulationGetter
lvl1 = Lvl1SimulationGetter()

# -------------------------------------------------------------
# Add AthenaOutputStream
# -------------------------------------------------------------
include("ByteStreamCnvSvc/WriteByteStream_EventStorage_jobOptions.py")
Пример #7
0
            or TriggerFlags.doHLT()) and 'forceMuonDataPrep' in dir():
        if (TriggerFlags.MuonSlice.doEFRoIDrivenAccess()):
            include("MuonRdoToPrepData/CscRdoToCscPrepData_jobOptions.py")
        else:
            include("MuonRdoToPrepData/MuonRdoToMuonPrepData_jobOptions.py")
        if DetFlags.makeRIO.CSC_on():
            include("CscClusterization/CscThresholdClusterizationOptions.py")

    if globalflags.InputFormat() == 'pool':
        include("MuonByteStreamCnvTest/jobOptions_MuonRDOToDigit.py")

    include("MuonRecExample/MuonRecLoadTools.py")

# this is to limit messags when running with -s
from AthenaCommon.Include import excludeTracePattern
excludeTracePattern.append("*/TriggerMenu/menu/TriggerPythonConfig.py")
excludeTracePattern.append("*/TriggerMenu/menu/HltConfig.py")

# trigger menu files generation
log.info("generating menu")
from TriggerMenu.menu.GenerateMenu import GenerateMenu
import time

g = GenerateMenu()
t0 = time.time()
g.generate()
log.info('Trigger menu generation took %0.fs', time.time() - t0)

log = logging.getLogger(
    'Trigger_topOptions_standalone.py')  # generate modifies the log
Пример #8
0
    if rec.readRDO():
        logRecExCommon_flags.info("readESD : switch readRDO off ")
        rec.readRDO = False

# consistency check in case of lock
_allRead = rec.readRDO() + rec.readESD() + rec.readAOD()
if _allRead != 1:
    raise RuntimeError, " one and only one of readRDO (%s)  readESD (%s) readAOD (%s) should be on !!!" % (
        rec.readRDO(), rec.readESD(), rec.readAOD())

#now read input file to set up some flags accordingly if possible
# load an OKS with the input data file
from AthenaCommon.Include import excludeTracePattern

excludeTracePattern.append("*/PyUtils/*")

# if autoconfig not used, switched of doTruth for data
if globalflags.DataSource == 'data' and not 'DoTruth' in rec.AutoConfiguration(
):
    rec.doTruth = False

try:
    if rec.doTrigger():
        from TriggerJobOpts.TriggerFlags import TriggerFlags, sync_Trigger2Reco
except Exception:
    logRecExCommon_flags.info(
        "Could not load TriggerFlags. OK only if AtlasReconstruction. Switching of rec.doTrigger"
    )
    rec.doTrigger = False
Пример #9
0
    from LArROD.LArRODFlags import larRODFlags
    if larRODFlags.doLArFebErrorSummary():
        try:
            include("LArROD/LArFebErrorSummaryMaker_jobOptions.py")
        except Exception:
            treatException(
                "Problem with LArFebErrorSummaryMaker_jobOptions.py switch larRODFlags.doLArFebErrorSummary "
            )
            larRODFlags.doLArFebErrorSummary = False

#
# functionality: Calorimeter cells
#
if DetFlags.makeRIO.Calo_on() and not rec.doWriteBS():
    from AthenaCommon.Include import excludeTracePattern
    excludeTracePattern.append("*/CaloClusterCorrection/common.py")

    try:
        include("TileRec/TileDefaults_jobOptions.py")
    except Exception:
        treatException("Could not set up Tile default options.")

# CaloCellGetter
#
    try:
        from CaloRec.CaloCellGetter import CaloCellGetter
        CaloCellGetter()

        # for data09_calophys project, force to use the same quality cut as in BS converter
        if globalflags.DataSource() == 'data':
            if rec.projectName() == "data09_calophys":
Пример #10
0
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration

# Author Sebastien Binet

__all__ = ['ObjKeyStore', 'objKeyStore', 'cfgKeyStore']

# do not trace within ObjKeyStore
from AthenaCommon.Include import excludeTracePattern
excludeTracePattern.append("*/RecExConfig/ObjKeyStore*")

from AthenaCommon.KeyStore import CfgItemList, CfgKeyStore


class _ObjKeyStore(object):
    def __init__(self, name="KeyStore"):
        object.__init__(self)

        self._store = CfgKeyStore(name)
        for label in CfgKeyStore.__slots__['Labels']:
            labelName = "%s%s" % (
                str(label)[0].upper(),  # capitalize first letter
                str(label)[1:])
            self.__dict__['isIn%s' % labelName] = self.__isInDict(label)
            self.__dict__['add%s' % labelName] = self.__addToDict(label)
            self.__dict__['addManyTypes%s' %
                          labelName] = self.__addDictToDict(label)
            self.__dict__['write%s' % labelName] = self.__writePy(label)
            self.__dict__['read%s' % labelName] = self.__readPy(label)

        return
    if len(config)>1:
        setMenu=config[1]
    else:
        setMenu=config[0]
    recoLog.info("setMenu="+setMenu)
else:
    # set Menu by default to Cosmic2009_v1
    recoLog.info("Set testCosmic2009V1=True")
    testCosmic2009V1=True

## no longer default in flags
TriggerFlags.outputHLTconfigFile="outputHLTconfig.xml"

##reduce output from TriggerMenuPython
from AthenaCommon.Include import excludeTracePattern,includeTracePattern
excludeTracePattern.append("*/TriggerMenuPython/*.py")
includeTracePattern.append("*/TriggerMenuPython/GenerateMenu.py")

## main job options 
include("TriggerRelease/runHLT_standalone.py")

# rename special root output files from trigger
if hasattr(runArgs,"outputNTUP_MUFASTFile"):
    svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='%s' OPT='NEW'" % runArgs.outputNTUP_MUFASTFile ]

if hasattr(runArgs,"outputHIST_TRIGEXPERTFile"):
    output=svcMgr.THistSvc.Output
    for idx in range(len(output)):
        if output[idx].count('EXPERT'):
            output[idx]="EXPERT DATAFILE='%s' TYPE='ROOT' OPT='RECREATE'" % runArgs.outputHIST_TRIGEXPERTFile
        svcMgr.THistSvc.Output=output
Пример #12
0
from __future__ import with_statement, print_function

__author__  = "Sebastien Binet"
__doc__ = "implementation of AthFile-server behind a set of proxies to isolate environments"

import errno
import os
import six

import PyUtils.Helpers as H
from .timerdecorator import timelimit, TimeoutError

# see bug #95942 for the excruciating details
try:
    from AthenaCommon.Include import excludeTracePattern
    excludeTracePattern.append("*cache.ascii.gz")
    del excludeTracePattern
except Exception:
    pass

### globals -------------------------------------------------------------------
DEFAULT_AF_RUN = os.environ.get('DEFAULT_AF_RUN', False)
'''Revert to old file peeking via Athena sub-process if True.'''

DEFAULT_AF_CACHE_FNAME = os.environ.get('DEFAULT_AF_CACHE_FNAME',
                                        'athfile-cache.ascii.gz')

DEFAULT_AF_TIMEOUT = 20
'''Default timeout for commands to be completed.'''

### utils ----------------------------------------------------------------------
Пример #13
0
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration

# File: 
# Author: 

## for messaging
from AthenaCommon.Logging import logging
#log = logging.getLogger( 'Configured' )

# do not trace within ObjKeyStore 
from AthenaCommon.Include import excludeTracePattern
excludeTracePattern.append("*/RecExConfig/Configured*")

import traceback

### base class for fully configured algorithm and public tool ======
class Configured( object ):
   _nNewed = 0  
   _nInitialized = 0
   _disabled = False
   _configured = False
   _existingOutput = False   
   _ignoreExistingDataObject= False # if ignore existing data object
   _ignoreConfigError=False # if ignore python configuration error
   _output = {}


   def __new__ ( cls, *args, **kwargs ):

      cls._nNewed +=1
      mlog = logging.getLogger( 'Configured::__new__:%s:' % cls.__name__.replace( ".", '_' ) )