Пример #1
0
def _setupAtlasUnixStandardJob():
    from .AppMgr import theApp
    from .AppMgr import ServiceMgr as svcMgr

    ## basic Gaudi services
    import GaudiSvc.GaudiSvcConf as GaudiSvcConf
    svcMgr += GaudiSvcConf.IncidentSvc()
    svcMgr += GaudiSvcConf.EvtPersistencySvc("EventPersistencySvc")
    svcMgr += GaudiSvcConf.HistogramSvc("HistogramDataSvc")
    svcMgr += GaudiSvcConf.NTupleSvc()
    # ToolSvc is already added in AppMgr.py.
    svcMgr += GaudiSvcConf.RndmGenSvc()
    svcMgr += GaudiSvcConf.ChronoStatSvc()

    import GaudiAud.GaudiAudConf as GaudiAudConf
    svcMgr.AuditorSvc += GaudiAudConf.AlgContextAuditor()

    # make the message service available
    # from GaudiSvc.GaudiSvcConf import MessageSvc
    svcMgr.MessageSvc = theApp.service("MessageSvc")  # already instantiated

    # StoreGate services configuration
    import StoreGate.StoreGateConf as StoreGateConf
    svcMgr += StoreGateConf.StoreGateSvc()
    svcMgr += StoreGateConf.StoreGateSvc("DetectorStore")
    svcMgr += StoreGateConf.StoreGateSvc("HistoryStore")
    svcMgr += StoreGateConf.StoreGateSvc("ConditionStore")

    #ClassIDSvc configuration
    import CLIDComps.CLIDCompsConf as CLIDCompsConf
    svcMgr += CLIDCompsConf.ClassIDSvc()
    svcMgr.ClassIDSvc.CLIDDBFiles += ["Gaudi_clid.db"]

    #Ignore certain Service loops
    theApp.InitializationLoopCheck = False

    # dictionary services
    # the dict loader
    import AthenaServices.AthenaServicesConf as AthenaServicesConf
    if not hasattr(svcMgr, 'AthDictLoaderSvc'):
        svcMgr += AthenaServicesConf.AthDictLoaderSvc()
    theApp.CreateSvc += [svcMgr.AthDictLoaderSvc.getFullJobOptName()]

    # add-in a service to handle core-dumps
    if not hasattr(svcMgr, 'CoreDumpSvc'):
        svcMgr += AthenaServicesConf.CoreDumpSvc()
    theApp.CreateSvc += [svcMgr.CoreDumpSvc.getFullJobOptName()]
Пример #2
0
from AthenaCommon.AlgSequence import AlgSequence
topSequence = AlgSequence()

theApp.EvtMax = 20

from xAODEventInfoCnv.xAODEventInfoCreator import xAODMaker__EventInfoCnvAlg
topSequence+=xAODMaker__EventInfoCnvAlg()

#---------------------------------------------------------------------------------#
# NEW Conditions access infrastructure
#
from IOVSvc.IOVSvcConf import CondInputLoader
topSequence += CondInputLoader( "CondInputLoader", OutputLevel=DEBUG,  )

import StoreGate.StoreGateConf as StoreGateConf
svcMgr += StoreGateConf.StoreGateSvc("ConditionStore")

from IOVSvc.IOVSvcConf import CondSvc
svcMgr += CondSvc()
# NEW Conditions access infrastructure
#---------------------------------------------------------------------------------#

# Make sure PerfMon is off
include( "PerfMonGPerfTools/DisablePerfMon_jobOFragment.py" )

# Input file
dataFile = "/afs/cern.ch/atlas/project/rig/referencefiles/MC/valid1.110401.PowhegPythia_P2012_ttbar_nonallhad.e3099_s2578/RDO.04919495._000958.pool.root.1"

from AthenaCommon.AthenaCommonFlags  import athenaCommonFlags
athenaCommonFlags.FilesInput=[dataFile,dataFile]
Пример #3
0
def _setupAtlasUnixStandardJob():
    from AppMgr import theApp
    from AppMgr import ServiceMgr as svcMgr

    import SystemOfUnits as Units
    from Constants import VERBOSE, DEBUG, INFO, ERROR

    ## basic Gaudi services
    import GaudiSvc.GaudiSvcConf as GaudiSvcConf
    svcMgr += GaudiSvcConf.IncidentSvc()
    svcMgr += GaudiSvcConf.EvtPersistencySvc( "EventPersistencySvc" )
    svcMgr += GaudiSvcConf.HistogramSvc( "HistogramDataSvc" )
    svcMgr += GaudiSvcConf.NTupleSvc()
    svcMgr += GaudiSvcConf.ToolSvc()
    svcMgr += GaudiSvcConf.RndmGenSvc()
    svcMgr += GaudiSvcConf.ChronoStatSvc()

    import GaudiAud.GaudiAudConf as GaudiAudConf
    svcMgr.AuditorSvc += GaudiAudConf.AlgContextAuditor()

    # make sure StatusCodeSvc messages are always printed
    svcMgr += GaudiSvcConf.StatusCodeSvc()
    svcMgr.StatusCodeSvc.OutputLevel = INFO
    svcMgr.StatusCodeSvc.Filter += [
              "Reflex::NewDelFunctionsT<StatusCode>::delete_T(void*)",
        "ROOT::Reflex::NewDelFunctionsT<StatusCode>::delete_T(void*)",
        ]
    # make sure StatusCodes are always checked
    svcMgr.StatusCodeSvc.AbortOnError=True


    
    # make the message service available
    # from GaudiSvc.GaudiSvcConf import MessageSvc
    svcMgr.MessageSvc = theApp.service( "MessageSvc" )     # already instantiated

    # StoreGate services configuration
    import StoreGate.StoreGateConf as StoreGateConf
    svcMgr += StoreGateConf.StoreGateSvc()
    svcMgr += StoreGateConf.StoreGateSvc("DetectorStore")
    svcMgr += StoreGateConf.StoreGateSvc("HistoryStore")

    #ClassIDSvc configuration
    import CLIDComps.CLIDCompsConf as CLIDCompsConf
    svcMgr += CLIDCompsConf.ClassIDSvc()
    svcMgr.ClassIDSvc.CLIDDBFiles += [ "Gaudi_clid.db" ]

    #Ignore certain Service loops
    try:
        theApp.InitializationLoopCheck = False
##         theApp.LoopCheckIgnore += [
##             "StoreGateSvc", "DetectorStore",
##             "PerfMonSvc", "AuditorSvc", "GeoModelSvc",
##             "IOVSvc"
##             ]
    except AttributeError:
        # gaudi v19r9... were art thou ?
        pass

    # dictionary services
    # the dict loader
    import AthenaServices.AthenaServicesConf as AthenaServicesConf
    if not hasattr(svcMgr, 'AthDictLoaderSvc'):
        svcMgr += AthenaServicesConf.AthDictLoaderSvc()
    theApp.CreateSvc += [svcMgr.AthDictLoaderSvc.getFullJobOptName()]

    # the dict checker
    if not hasattr(svcMgr, 'AthenaSealSvc'):
        svcMgr += AthenaServicesConf.AthenaSealSvc()
    theApp.CreateSvc += [svcMgr.AthenaSealSvc.getFullJobOptName()]
    
    # add-in a service to handle core-dumps
    if not hasattr(svcMgr, 'CoreDumpSvc'):
        svcMgr += AthenaServicesConf.CoreDumpSvc()
    theApp.CreateSvc += [ svcMgr.CoreDumpSvc.getFullJobOptName() ]
Пример #4
0
def setupCommonServices():
    from AthenaCommon import CfgMgr
    from AthenaCommon.Logging import logging
    from AthenaCommon.Constants import INFO
    from AthenaCommon.AppMgr import ServiceMgr as svcMgr, theApp
    from AthenaCommon.ConcurrencyFlags import jobproperties as jps

    # Setup messaging for Python and C++
    from AthenaCommon.Logging import log
    log.setFormat("%(asctime)s  Py:%(name)-31s %(levelname)7s %(message)s")

    # Create our own logger
    log = logging.getLogger('TriggerUnixStandardSetup::setupCommonServices:')

    from TrigServices.TrigServicesConfig import setupMessageSvc
    setupMessageSvc()

    # Do the default Atlas job configuration first
    import AthenaCommon.AtlasUnixStandardJob  # noqa: F401

    # Now do HLT/thread specific configuration (see e.g. AtlasThreadedJob.py)
    from StoreGate.StoreGateConf import SG__HiveMgrSvc
    svcMgr += SG__HiveMgrSvc("EventDataSvc",
                             NSlots=jps.ConcurrencyFlags.NumConcurrentEvents())

    import StoreGate.StoreGateConf as StoreGateConf
    svcMgr += StoreGateConf.StoreGateSvc("ConditionStore")

    # Configure the CoreDumpSvc
    if not hasattr(svcMgr, "CoreDumpSvc"):
        from AthenaServices.Configurables import CoreDumpSvc
        svcMgr += CoreDumpSvc()

    # ThreadPoolService thread local initialization
    from GaudiHive.GaudiHiveConf import ThreadPoolSvc
    svcMgr += ThreadPoolSvc("ThreadPoolSvc")
    svcMgr.ThreadPoolSvc.ThreadInitTools = ["ThreadInitTool"]

    from GaudiHive.GaudiHiveConf import AlgResourcePool
    svcMgr += AlgResourcePool(OutputLevel=INFO,
                              TopAlg=["AthSequencer/AthMasterSeq"])

    from AthenaCommon.AlgSequence import AlgSequence
    from SGComps.SGCompsConf import SGInputLoader
    topSequence = AlgSequence()
    topSequence += SGInputLoader(
        FailIfNoProxy=False)  # change to True eventually

    from AthenaCommon.AlgScheduler import AlgScheduler
    AlgScheduler.ShowDataDependencies(False)
    AlgScheduler.ShowControlFlow(False)
    AlgScheduler.setDataLoaderAlg('SGInputLoader')

    # Setup SGCommitAuditor to sweep new DataObjects at end of Alg execute
    theApp.AuditAlgorithms = True
    from SGComps.SGCompsConf import SGCommitAuditor
    svcMgr.AuditorSvc += SGCommitAuditor()

    # setup ROOT6
    from PyUtils.Helpers import ROOT6Setup
    ROOT6Setup()

    # Setup online THistSvc unless specifically configured otherwise
    #    setup the THistSvc early and force the creation of the THistSvc
    #    so that it can be used by infrastructure services to book histograms
    #    (to avoid problems e.g. with histograms in ROBDataProviderSvc)
    if _Conf.useOnlineTHistSvc:
        if hasattr(svcMgr, 'THistSvc'):
            log.fatal(
                "The offline histogramming THistSvc is already in place.")
            raise RuntimeError(
                "Cannot setup online histogramming TrigMonTHistSvc")
        log.debug("Using online histogramming service (TrigMonTHistSvc)")
        from TrigServices.TrigServicesConf import TrigMonTHistSvc
        svcMgr += TrigMonTHistSvc("THistSvc")
    else:
        log.debug("Using offline histogramming service (THistSvc)")
        from GaudiSvc.GaudiSvcConf import THistSvc
        svcMgr += THistSvc()

    # StoreGateSvc
    svcMgr.StoreGateSvc.ActivateHistory = False

    # ProxyProviderSvc services configuration
    svcMgr += CfgMgr.ProxyProviderSvc()

    # --- ByteStreamAddressProviderSvc configuration
    svcMgr += CfgMgr.ByteStreamAddressProviderSvc()
    svcMgr.ProxyProviderSvc.ProviderNames += ["ByteStreamAddressProviderSvc"]
    theApp.CreateSvc += [svcMgr.ByteStreamAddressProviderSvc.getFullName()]

    # Initialization of DetDescrCnvSvc
    svcMgr += CfgMgr.DetDescrCnvSvc(
        # specify primary Identifier dictionary to be used
        IdDictName="IdDictParser/ATLAS_IDS.xml")

    theApp.CreateSvc += [svcMgr.DetDescrCnvSvc.getFullName()]
    svcMgr.EventPersistencySvc.CnvServices += ["DetDescrCnvSvc"]

    # Online services for ByteStream input/output
    from TrigByteStreamCnvSvc.TrigByteStreamCnvSvcConf import TrigEventSelectorByteStream
    from TrigByteStreamCnvSvc.TrigByteStreamCnvSvcConfig import TrigByteStreamInputSvc, TrigByteStreamCnvSvc
    svcMgr += TrigByteStreamCnvSvc(
        "ByteStreamCnvSvc")  # this name is hard-coded in some converters
    svcMgr.EventPersistencySvc.CnvServices += ["ByteStreamCnvSvc"]
    svcMgr += TrigByteStreamInputSvc("ByteStreamInputSvc")
    svcMgr += TrigEventSelectorByteStream(
        "EventSelector", ByteStreamInputSvc=svcMgr.ByteStreamInputSvc)
    theApp.EvtSel = "EventSelector"

    # Online event loop manager
    from TrigServices.TrigServicesConfig import HltEventLoopMgr
    loopMgr = HltEventLoopMgr("HltEventLoopMgr")
    loopMgr.WhiteboardSvc = "EventDataSvc"
    loopMgr.SchedulerSvc = AlgScheduler.getScheduler().getName()
    loopMgr.EvtSel = svcMgr.EventSelector
    loopMgr.OutputCnvSvc = svcMgr.ByteStreamCnvSvc
    svcMgr += loopMgr
    theApp.EventLoop = loopMgr.name()

    from TrigOutputHandling.TrigOutputHandlingConfig import HLTResultMTMakerCfg
    svcMgr.HltEventLoopMgr.ResultMaker = HLTResultMTMakerCfg()

    # Configuration of Interval of Validity Service
    svcMgr += CfgMgr.IOVSvc()

    # Configure COOL update helper tool
    from TrigServices.TrigServicesConfig import TrigCOOLUpdateHelper
    svcMgr.HltEventLoopMgr.CoolUpdateTool = TrigCOOLUpdateHelper()

    # Configure the online ROB data provider service
    from TrigServices.TrigServicesConfig import HltROBDataProviderSvc
    svcMgr += HltROBDataProviderSvc()

    # Explicitly set a few OutputLevels (needed because some services are created in
    # different order when running with the PSC)
    svcMgr.IncidentSvc.OutputLevel = theApp.OutputLevel
    svcMgr.ProxyProviderSvc.OutputLevel = theApp.OutputLevel
    svcMgr.StoreGateSvc.OutputLevel = theApp.OutputLevel

    return
def _setupAtlasThreadedJob():
    from AppMgr import theApp
    from AppMgr import ServiceMgr as svcMgr

    import SystemOfUnits as Units
    from Constants import VERBOSE, DEBUG, INFO, ERROR

    from ConcurrencyFlags import jobproperties as jps

    if (jps.ConcurrencyFlags.NumProcs() == 0):
        theApp.MessageSvcType = "InertMessageSvc"
    else:
        # InertMessageSvc doesn't play nice with MP
        theApp.MessageSvcType = "MessageSvc"

    svcMgr.MessageSvc.defaultLimit = 0
    msgFmt = "% F%40W%S%4W%e%s%7W%R%T %0W%M"
    svcMgr.MessageSvc.Format = msgFmt

    theApp.StatusCodeCheck = False

    from AthenaServices.AthenaServicesConf import AthenaHiveEventLoopMgr

    svcMgr += AthenaHiveEventLoopMgr()
    svcMgr.AthenaHiveEventLoopMgr.WhiteboardSvc = "EventDataSvc"
    #    svcMgr.AthenaHiveEventLoopMgr.OutputLevel = INFO

    theApp.EventLoop = "AthenaHiveEventLoopMgr"

    svcMgr.StatusCodeSvc.AbortOnError = False

    nThreads = jps.ConcurrencyFlags.NumThreads()
    numStores = nThreads
    numAlgsInFlight = nThreads
    numThreads = nThreads

    from StoreGate.StoreGateConf import SG__HiveMgrSvc
    svcMgr += SG__HiveMgrSvc("EventDataSvc")
    svcMgr.EventDataSvc.NSlots = numStores
    #    svcMgr.EventDataSvc.OutputLevel = INFO

    import StoreGate.StoreGateConf as StoreGateConf
    svcMgr += StoreGateConf.StoreGateSvc("ConditionStore")

    from GaudiHive.GaudiHiveConf import AlgResourcePool
    svcMgr += AlgResourcePool(OutputLevel=INFO)

    from GaudiHive.GaudiHiveConf import ForwardSchedulerSvc
    svcMgr += ForwardSchedulerSvc()
    svcMgr.ForwardSchedulerSvc.OutputLevel = INFO
    svcMgr.ForwardSchedulerSvc.MaxEventsInFlight = numStores
    svcMgr.ForwardSchedulerSvc.MaxAlgosInFlight = numAlgsInFlight
    svcMgr.ForwardSchedulerSvc.ThreadPoolSize = numThreads

    # enable timeline recording
    from GaudiHive.GaudiHiveConf import TimelineSvc
    svcMgr += TimelineSvc(RecordTimeline=True, Partial=False)

    #
    ## Setup SGCommitAuditor to sweep new DataObjects at end of Alg execute
    #

    theAuditorSvc = svcMgr.AuditorSvc
    theApp.AuditAlgorithms = True
    from SGComps.SGCompsConf import SGCommitAuditor
    theAuditorSvc += SGCommitAuditor()
Пример #6
0
# Based on AthExStoreGateExamples
#
#==============================================================

#--------------------------------------------------------------
# ATLAS default Application Configuration options
#--------------------------------------------------------------

# Configure the scheduler
from AthenaCommon.AlgScheduler import AlgScheduler
AlgScheduler.ShowControlFlow(True)
AlgScheduler.ShowDataDependencies(True)

# Make an extra StoreGate for the pileup events
import StoreGate.StoreGateConf as StoreGateConf
DigiStore = StoreGateConf.StoreGateSvc("digi_store")
DigiStore.OutputLevel = VERBOSE
svcMgr += DigiStore

# Control flow
from AthenaCommon.AlgSequence import AthSequencer
allViewAlgorithms = AthSequencer("allViewAlgorithms")
allViewAlgorithms.ModeOR = False
allViewAlgorithms.Sequential = False
allViewAlgorithms.StopOverride = False
makeViewSequence = AthSequencer("makeViewSequence")
makeViewSequence.ModeOR = False
makeViewSequence.Sequential = True
makeViewSequence.StopOverride = False

# Event-level algorithm sequence