コード例 #1
0
    def __init__(self, name="ApplicationMgr", **kw):
        kw['name'] = name
        if 'outputLevel' not in kw: kw['outputLevel'] = 3
        if 'jobOptions' not in kw: kw['jobOptions'] = None

        # some Atlas defaults
        if 'JobOptionsPath' not in kw: kw['JobOptionsPath'] = ""
        if 'JobOptionsType' not in kw: kw['JobOptionsType'] = "NONE"
        if 'EventLoop' not in kw: kw['EventLoop'] = "AthenaEventLoopMgr"
        if 'OutStreamType' not in kw:
            kw['OutStreamType'] = "AthenaOutputStream"
        if 'StatusCodeCheck' not in kw: kw['StatusCodeCheck'] = False

        # always the case in ATLAS (need early or ExtSvc should be a no-op, too)
        kw['ExtSvcCreates'] = False

        super(AthAppMgr, self).__init__(**kw)
        self.__dict__['_cppApp'] = None  # proxy to C++/App.
        self.__dict__['_sequences'] = []
        self.__dict__['_streams'] = AlgSequence.AlgSequence("Streams")
        self.__dict__['CreateSvc'] = []  # block the property
        self.__dict__['_exitstate'] = ExitCodes.ALL_OK

        self.__dict__['state'] = lambda: AthAppMgr.State.OFFLINE
        self.__dict__['Dlls'] = []

        # install sequence proxies
        self.__class__.TopAlg = OldToNewSequenceProxy(
            AlgSequence.AlgSequence("TopAlg"))
        self.__class__.OutStream = OldToNewSequenceProxy(
            self.__dict__['_streams'])

        # install services
        svcMgr = self.serviceMgr()  # noqa: F841

        # external option (TODO: receive this cleanly; AthOptionsParser doesn't manage results, and
        # can't be called directly due to transforms etc.)
        self.__dict__['_opts'] = None

        # this code is to be factored out; for now flag it with 'minimal' to test
        # the effects of its removal

        # figure out which release are we running, for logging purposes
        d = release_metadata()
        msg = Logging.log.info
        msg('using release [%(project name)s-%(release)s] [%(platform)s] [%(nightly name)s/%(nightly release)s] -- built on [%(date)s]'
            % d)
        # -- end of (proposed) minimal

        return
コード例 #2
0
 def getOutputStream(self, stream):
     athOutSeq = AlgSequence.AthSequencer("AthOutSeq")
     for o in athOutSeq.getChildren():
         if o.name() == stream:
             return o
     for o in self._streams.getChildren():
         if o.name() == stream:
             return o
     return None
コード例 #3
0
#  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
"""Functionality core of the Rivet_tf transform"""

##==============================================================
## Basic configuration
##==============================================================

## Create sequence for Rivet
import os, re, string
import AthenaCommon.AlgSequence as acas
import AthenaCommon.AppMgr as acam
from AthenaCommon.AthenaCommonFlags import jobproperties
theApp = acam.theApp
topSeq = acas.AlgSequence()
anaSeq = topSeq

##==============================================================
## Configure standard Athena services
##==============================================================

## Special setup for event generation
include("AthenaCommon/Atlas.UnixStandardJob.py")

## Run performance monitoring (memory logging)
from PerfMonComps.PerfMonFlags import jobproperties as perfmonjp
perfmonjp.PerfMonFlags.doMonitoring = True
perfmonjp.PerfMonFlags.doSemiDetailedMonitoring = True

## Jobs should stop if an include fails.
jobproperties.AthenaCommonFlags.AllowIgnoreConfigError = False
コード例 #4
0
#  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
"""Functionality core of the Generate_tf transform"""

##==============================================================
## Basic configuration
##==============================================================

## Create sequences for generators, clean-up algs, filters and analyses
## and import standard framework objects with standard local scope names
import os, re, string, subprocess
import AthenaCommon.AlgSequence as acas
import AthenaCommon.AppMgr as acam
from AthenaCommon.AthenaCommonFlags import jobproperties
theApp = acam.theApp
acam.athMasterSeq += acas.AlgSequence("EvgenGenSeq")
genSeq = acam.athMasterSeq.EvgenGenSeq
acam.athMasterSeq += acas.AlgSequence("EvgenFixSeq")
fixSeq = acam.athMasterSeq.EvgenFixSeq
acam.athMasterSeq += acas.AlgSequence("EvgenPreFilterSeq")
prefiltSeq = acam.athMasterSeq.EvgenPreFilterSeq
acam.athFilterSeq += acas.AlgSequence("EvgenTestSeq")
testSeq = acam.athFilterSeq.EvgenTestSeq
## NOTE: LogicalExpressionFilter is an algorithm, not a sequence
from EvgenProdTools.LogicalExpressionFilter import LogicalExpressionFilter
acam.athFilterSeq += LogicalExpressionFilter("EvgenFilterSeq")
filtSeq = acam.athFilterSeq.EvgenFilterSeq
topSeq = acas.AlgSequence()
anaSeq = topSeq
topSeq += acas.AlgSequence("EvgenPostSeq")
postSeq = topSeq.EvgenPostSeq
#topAlg = topSeq #< alias commented out for now, so that accidental use throws an error
コード例 #5
0
# testing interactive athena scriptability
# @author Sebastien Binet
# @date April 2010

import AthenaCommon.AlgSequence as acas
job = acas.AlgSequence()

import AthenaPython.PyAthena as PyAthena
StatusCode = PyAthena.StatusCode


class TestAlg(PyAthena.Alg):
    def initialize(self):
        self.msg.info("initialize...")
        self.nevts = 0
        self.ievt = 0
        self.msg.info("initialize... [ok]")
        return StatusCode.Success

    def execute(self):
        self.msg.info("execute...")
        self.nevts += 1
        self.ievt = self.nevts - 1
        self.msg.info("--> evt: %s/%s", self.ievt, self.nevts)
        self.msg.info("execute... [ok]")
        return StatusCode.Success

    def finalize(self):
        self.msg.info("finalize...")
        self.msg.info("processed [%s] evts", self.nevts)
        self.msg.info("finalize... [ok]")
コード例 #6
0
theAuditorSvc = ServiceMgr.AuditorSvc


def AuditorSvc():  # backwards compatibility
    global theAuditorSvc
    return theAuditorSvc


### create default sequences:
#      athMasterSeq
#         |
#         +--- athAlgEvtSeq
#                 |
#                 +--- athBeginSeq
#                 |
#                 +--- athAllAlgSeq
#                         |
#                         +--- athCondSeq (after athAlgSeq in MT)
#                         |
#                         +--- athAlgSeq == TopAlg
#                 |
#                 +--- athEndSeq
#         |
#         +--- athOutSeq
athMasterSeq = AlgSequence.AthSequencer("AthMasterSeq")
athCondSeq = AlgSequence.AthSequencer("AthCondSeq")
athAlgSeq = AlgSequence.AthSequencer("AthAlgSeq")
athOutSeq = AlgSequence.AthSequencer("AthOutSeq")

topSequence = AlgSequence.AlgSequence("TopAlg")  # for backward compatibility
コード例 #7
0
##/cvmfs/atlas.cern.ch/repo/sw/software/x86_64-slc6-gcc48-opt/20.1.3//AtlasCore/20.1.3/Control/AthenaCommon/python/AlgSequence.py
from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr, ToolSvc)
#from AthenaCommon.AlgSequence import AlgSequence
from AthenaCommon.AlgSequence import *
topSequence = AlgSequence()
#filterSequence = AthSequencer('AthFilterSeq')
outSequence = AthSequencer('AthOutSeq')

###################### Trigger Filter
from LArStudies.LArStudiesConf import *
LArSamplesTriggerFilter = LArSamples__TriggerFilter(
    name="LArSamplesTriggerFilter")
LArSamplesTriggerFilter.Triggers = ['L1_RD1_EMPTY']
#LArSamplesTriggerFilter.Triggers = trigPathList4
LArSamplesTriggerFilter.enabled = 1
ToolSvc += LArSamplesTriggerFilter
print LArSamplesTriggerFilter
LArSamplesSkim = LArSamples__SkimmingKernel(
    "LArSamplesSkim", SkimmingTools=[LArSamplesTriggerFilter])
print LArSamplesSkim

#############################################################
#include("LArConditionsCommon/LArMinimalSetup.py")

from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
from AthenaCommon.GlobalFlags import globalflags
globalflags.DetGeo.set_Value_and_Lock('atlas')
#globalflags.Luminosity.set_Value_and_Lock('zero')
globalflags.DataSource.set_Value_and_Lock('data')
globalflags.InputFormat.set_Value_and_Lock('bytestream')
#globalflags.DatabaseInstance.set_Value_and_Lock('CONDBR2')
コード例 #8
0
# main jobOption - must always be included
##############################
include("RecExCommon/RecExCommon_topOptions.py")
##############################

if not ReadESD and WriteESD:
    if not rec.doLArg:
        topSequence.CaloCellMaker.CaloCellMakerToolNames = [
            ToolSvc.TileCellBuilder.getFullName()
        ]
    #ToolSvc.TileCellBuilder.OutputLevel=2

# define filter
import AthenaCommon.AlgSequence as acas

job = acas.AlgSequence()

seq = acas.AthSequencer("AthFilterSeq")

# example how to copy few events from input to output
#
#import AthenaCommon.Constants as Lvl
#from GaudiSequencer.PyComps import PyEvtFilter
#seq += PyEvtFilter(
#    'alg',
#    # the store-gate key. leave as an empty string to take any eventinfo instance
#    evt_info='',
#    OutputLevel=Lvl.INFO)
#
################################################################
##       List of event to keep
コード例 #9
0
# Set up a logger:
from AthenaCommon.Logging import logging
TopBoostJSD3PDStream_msg = logging.getLogger( 'TopBoostJSD3PD_prodJobOFragment' )

from D3PDMakerConfig.D3PDMakerFlags         import D3PDMakerFlags,_string_prop
from AthenaCommon.AlgSequence               import *


## not behaving well..savannah bug 91703
## truth bug
#if rec.doTruth():
#  from McParticleAlgs.ReOrderMcEventCollection import  FixMcEventCollection
#  topSequence.insert(1, FixMcEventCollection() )

preseq = AlgSequence (D3PDMakerFlags.PreD3PDAlgSeqName())

#######
from BoostedTopD3PDMaker.BoostJSjets import createJSJets

from BoostedTopD3PDMaker.GroomedJetsConfig import getGroomedJetsConfig
dictsConfig = getGroomedJetsConfig()

myJetKeys = []

for dC in dictsConfig:
   xx = createJSJets(dC[0], dC[1], preseq)
   myJetKeys += [xx]

#########