Beispiel #1
0
def _setupAtlasUnixGeneratorJob():
    from AthenaCommon import AtlasUnixStandardJob  # noqa: F401
    from AthenaCommon.AppMgr import theApp
    from AthenaCommon.AppMgr import ServiceMgr as svcMgr
    from AthenaCommon.Logging import logging
    log = logging.getLogger('AtlasUnixGeneratorJob')

    # General Application Configuration options
    from McEventSelector.McEventSelectorConf import McCnvSvc
    svcMgr += McCnvSvc()
    if hasattr(svcMgr, 'EventSelector'):
        log.warning(
            'EventSelector of type %s already exists. Will not add McEventSelector.',
            svcMgr.EventSelector.getType())
    else:
        from McEventSelector.McEventSelectorConf import McEventSelector
        svcMgr += McEventSelector("EventSelector")
        theApp.EvtSel = svcMgr.EventSelector.getFullName()

    # Persistency services
    svcMgr.EventPersistencySvc.CnvServices += ["McCnvSvc"]

    # Temporarily inject the xAOD::EventInfo converter here to allow for adiabatic migration of the clients
    from AthenaCommon.AlgSequence import AthSequencer
    topSequence = AthSequencer("AthAlgSeq")
    from xAODEventInfoCnv.xAODEventInfoCnvConf import xAODMaker__EventInfoCnvAlg
    topSequence += xAODMaker__EventInfoCnvAlg(AODKey='McEventInfo')

    return
Beispiel #2
0
def xAODEventInfoCreator(sequence=None,
                         stream=None,
                         key="",
                         outkey="EventInfo"):
    """
    Helper function that schedules the algorithm for creating an xAOD::EventInfo
    object out of the AOD's EventInfo one.

    Arguments:
      sequence: Optional sequence to which the components should be added.
                If not specified, the main algorithm sequence is used.
      stream: Optional stream that the objects should be written to.
              If not specified, the objects are added to StreamXAOD.
      key: Optional StoreGate key for the AOD object that is supposed to be
           translated.
    """

    from AthenaCommon.Logging import logging
    logger = logging.getLogger("xAODEventInfoCreator")

    # Tell the user what's happening:
    logger.info("Creating xAOD::EventInfo")

    # Get the main sequence if necessary:
    if sequence is None:
        from AthenaCommon.AlgSequence import AlgSequence
        sequence = AlgSequence()
        pass

    # Access the stream if necessary:
    if stream is None:
        from OutputStreamAthenaPool.MultipleStreamManager import MSMgr
        stream = MSMgr.GetStream("StreamXAOD")
        pass

    # Add the converter algorithm:
    alg = xAODMaker__EventInfoCnvAlg()
    alg.AODKey = key
    alg.xAODKey = outkey
    sequence += alg

    # Add the created objects to the output:
    stream.AddItem("xAOD::EventInfo#%s" % outkey)
    stream.AddItem("xAOD::EventAuxInfo#%sAux." % outkey)
    stream.AddItem("xAOD::EventInfoContainer#PileUp%s" % outkey)
    stream.AddItem("xAOD::EventInfoAuxContainer#PileUp%sAux." % outkey)

    return
#--------------------------------------------------------------
# Event related parameters
#--------------------------------------------------------------

## get a handle on the ServiceManager
from AthenaCommon.AppMgr import ServiceMgr

from CLIDComps.CLIDCompsConf import ClassIDSvc

svcMgr += ClassIDSvc()

from AthenaCommon.Constants import INFO
from AthenaCommon.AlgSequence import AlgSequence

topSequence = AlgSequence()

from xAODEventInfoCnv.xAODEventInfoCnvConf import xAODMaker__EventInfoCnvAlg

alg = xAODMaker__EventInfoCnvAlg()
alg.xAODKey = ""
topSequence += alg

from AthenaPoolTools.AthenaPoolToolsConf import EventCount

topSequence += EventCount(OutputLevel=INFO, Dump=True)
#==============================================================
#
# End of job options file
#
###############################################################
Beispiel #4
0
# ROOT.SetSignalPolicy( ROOT.kSignalFast )
#------------------------------------------------------------------------------#

#
## AlgSequence
#

from AthenaCommon.AlgSequence import AlgSequence
topSequence = AlgSequence()

from SGComps.SGCompsConf import SGInputLoader
topSequence+=SGInputLoader(OutputLevel=DEBUG, ShowEventDump=False)
topSequence.SGInputLoader.Load = [ ('EventInfo','StoreGateSvc+McEventInfo') ]

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

from AthExHive.AthExHiveConf import *

topSequence+=AlgT(OutputLevel=DEBUG)

AlgT = topSequence.AlgT
AlgT.Key_W1 = "t1"
#
## uncomment this line to force an explicit circular data dep in AlgT
# AlgT.Key_R1 = "t1"

#
## implicit circular data dep with parent AlgT
AlgT.Tool1 = HiveTool( "HiveTool1")
AlgT.Tool1.Key_R1 = "t1"
Beispiel #5
0
#
#  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
#

import AthenaCommon.AtlasUnixGeneratorJob

# Full job is a list of algorithms
from AthenaCommon.AlgSequence import AlgSequence
job = AlgSequence()

from SGComps.SGCompsConf import SGInputLoader
job += SGInputLoader(OutputLevel=INFO, ShowEventDump=False)
job.SGInputLoader.Load = [('EventInfo', 'McEventInfo')]

from xAODEventInfoCnv.xAODEventInfoCnvConf import xAODMaker__EventInfoCnvAlg
job += xAODMaker__EventInfoCnvAlg()

from AthExHive.AthExHiveConf import *
job += HiveAlgA(OutputLevel=DEBUG, Time=20)
job += HiveAlgB(OutputLevel=DEBUG, Time=10)
job += HiveAlgC(OutputLevel=DEBUG, Time=190)
job += HiveAlgD(OutputLevel=DEBUG, Time=10)
job += HiveAlgE(OutputLevel=DEBUG, Time=30)
job += HiveAlgG(OutputLevel=DEBUG, Time=10)
job += HiveAlgF(OutputLevel=DEBUG, Time=30)

#from StoreGate.StoreGateConf import StoreGateSvc
#svcMgr.StoreGateSvc.Dump=True

#--------------------------------------------------------------
# Event related parameters
Beispiel #6
0
  ServiceMgr.AthenaPoolCnvSvc.PoolAttributes += [ "TREE_BRANCH_OFFSETTAB_LEN ='100'" ]
  if 'athenaCommonFlags' in dir() and athenaCommonFlags.FilesInput():
    ServiceMgr.EventSelector.InputCollections   = athenaCommonFlags.FilesInput()
    ServiceMgr.EventSelector.SkipEvents         = athenaCommonFlags.SkipEvents()


# ---- Beam Spot service
include("InDetBeamSpotService/BeamCondSvc.py")
# --- particle property service
include("PartPropSvc/PartPropSvc.py")
# --- if truth, get corresponding POOL converters
if InDetFlags.doTruth():
  include("GeneratorObjectsAthenaPool/GeneratorObjectsAthenaPool_joboptions.py")

from xAODEventInfoCnv.xAODEventInfoCnvConf import xAODMaker__EventInfoCnvAlg
alg = xAODMaker__EventInfoCnvAlg()
print alg
topSequence += alg

#------------------------------------------------------------
# Event Data Model Monitor
#------------------------------------------------------------

if doEdmMonitor:
  from TrkValAlgs.TrkValAlgsConf import Trk__EventDataModelMonitor
  InDetEdmMonitor = Trk__EventDataModelMonitor (name = 'InDetEdmMonitor')
  topSequence += InDetEdmMonitor
  if (InDetFlags.doPrintConfigurables()):
    print          InDetEdmMonitor
## DBM TruthLinks
if (InDetFlags.doDBMstandalone() or InDetFlags.doDBM()) and InDetFlags.doTruth():