Пример #1
0
def setupAthenaJob(algoClass, inputfile=defaultFile, EvtMax=None):
    "Setup athena job"
    import AthenaPoolCnvSvc.ReadAthenaPool  # EventSelector
    from AthenaCommon.AppMgr import ServiceMgr as svcMgr

    svcMgr.EventSelector.InputCollections = [inputfile]

    # Redefine the function InputFileNames to make autoconfiguration work
    # outside RecExCommon
    from RecExConfig import RecoFunctions
    RecoFunctions.InputFileNames = lambda: svcMgr.EventSelector.InputCollections
    from RecExConfig.AutoConfiguration import ConfigureFromListOfKeys
    ConfigureFromListOfKeys(['everything'])

    ###################

    from egammaRec.Factories import ToolFactory, AlgFactory
    from RecExConfig.RecFlags import rec
    import PhotonVertexSelection.PhotonVertexSelectionConf as PVS

    # Configure and PhotonVertexSelectionTool
    PhotonVertexSelectionTool = ToolFactory(PVS.CP__PhotonVertexSelectionTool)

    # Configure the test algorithm and add it to topSequence
    testAlg = AlgFactory(algoClass,
                         PhotonVertexSelectionTool=PhotonVertexSelectionTool)()

    # Maximum events
    if EvtMax:
        from Configurables import StopperAlg
        AlgFactory(StopperAlg, StopCount=EvtMax)()
Пример #2
0
# setup globalflags
from AthenaCommon.GlobalFlags import globalflags

import sys
sys.path.append('/afs/cern.ch/user/a/atlcond/utils/python/')  # CERN
from AtlCoolBKLib import resolveAlias
conditionsTag = resolveAlias.getCurrent()
printfunc(conditionsTag)
globalflags.ConditionsTag.set_Value_and_Lock(conditionsTag)

from AthenaCommon.BeamFlags import jobproperties
jobproperties.Beam.beamType.set_Value_and_Lock('cosmics')

from RecExConfig.AutoConfiguration import ConfigureFromListOfKeys, GetRunNumber
ConfigureFromListOfKeys(['everything'])

# database tag
from IOVDbSvc.CondDB import conddb
conddb.setGlobalTag(globalflags.ConditionsTag())

# setup detflags
import DetDescrCnvSvc.DetStoreConfig
from AthenaCommon.DetFlags import DetFlags
if doLAr: DetFlags.detdescr.LAr_setOn()
if doTile: DetFlags.detdescr.Tile_setOn()

# needed ....
#from RecExConfig.RecFlags import rec
rec.doLArg.set_Value_and_Lock(doLAr)
rec.doTile.set_Value_and_Lock(doTile)
Пример #3
0
#         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'):
    logRecExCommon_flags.info('Disabling track slimming for express stream.')
    include("RecJobTransforms/NoTrackSlimming.py")

#Some special (monitoring) setting for Heavy Ions:
if rec.doHeavyIon():
    logRecExCommon_flags.info('Heavy Ion case: Calling HIEarlyIncludes.py')
    include("HIRecExample/HIEarlyIncludes.py")
D3PDMakerFlags.ElectronSGKey  = Atlfast1D3PDMakerFlags.ContainerPrefix()+'AtlfastElectronCollection'
D3PDMakerFlags.MuonSGKey      = Atlfast1D3PDMakerFlags.ContainerPrefix()+'AtlfastMuonCollection'
D3PDMakerFlags.JetSGKey       = Atlfast1D3PDMakerFlags.ContainerPrefix()+'AtlfastJetContainer'
D3PDMakerFlags.MissingETSGKey = 'AtlfastMissingEt'
D3PDMakerFlags.TauSGKey       = 'AtlfastTauJetContainer'
D3PDMakerFlags.TrackSGKey     = 'AtlfastTrackParticles'
D3PDMakerFlags.DoTrigger = False

# Fix by hand mismatch in collection name for jets
if Atlfast1D3PDMakerFlags.UseAtlfast1Correction: D3PDMakerFlags.JetSGKey = 'CorrectedAtlfastJetCollection' 


from RecExConfig.AutoConfiguration import ConfigureFromListOfKeys
ConfigureFromListOfKeys (['ProjectName',
                          'BeamType',
                          'RealOrSim',
                          'DoTruth',
                          'LumiFlags'])

###################################################################
# Configure RecExCommon.
#
# Need to set dummy values for atlfast1 when running on pure atlfast1 AODs
# if you are running on normal AODs (full simulation), comment next 4 lines
from AthenaCommon.GlobalFlags import GlobalFlags,globalflags
GlobalFlags.DetGeo.set_atlas()
globalflags.ConditionsTag.set_Value_and_Lock('OFLCOND-CSC-00-00-00')
globalflags.DetDescrVersion.set_Value_and_Lock("ATLAS-CSC-02-00-00")

from RecExConfig.RecFlags import rec
rec.doCBNT.set_Value_and_Lock(False)
Пример #5
0
#-- set up BS reading ------------------------------------------------------------------------------

from ByteStreamCnvSvc import ReadByteStream
svcMgr.ByteStreamInputSvc.FullFileName = [InputFile]

#-- set up output histogram file ------------------------------------------------------------------------------

from GaudiSvc.GaudiSvcConf import THistSvc
svcMgr += THistSvc()
svcMgr.THistSvc.Output += ["GLOBAL DATAFILE='" + OutputFile + "' OPT='RECREATE'"]

#-- configure field and detector geometry ------------------------------------------------------------------------------

autokeys = ["FieldAndGeo","BeamType"]
from RecExConfig.AutoConfiguration import ConfigureFromListOfKeys
ConfigureFromListOfKeys(autokeys)

from IOVDbSvc.CondDB import conddb
conddb.setGlobalTag(globalflags.ConditionsTag())

include("RecExCond/AllDet_detDescr.py")

#-- import BS reading JO ------------------------------------------------------------------------------

include("RecExCommon/BSRead_config.py")

#-- get Trigger Configuration ------------------------------------------------------------------------------

from TriggerJobOpts.T0TriggerGetter import T0TriggerGetter
gettrigger = T0TriggerGetter()
Пример #6
0
from AthenaCommon.AthenaCommonFlags import athenaCommonFlags

athenaCommonFlags.FilesInput = [
    #"ESD.pool.root"
    "data09_900GeV.00142165.physics_L1CaloEM.merge.DESD_COLLCAND.f196_m326._lb0023-lb0067.1"
]

#--------------------------------------------------------------
# Try AutoConfiguration : in this way you don't need to
# specify geometry, conditions...
#--------------------------------------------------------------

from RecExConfig.InputFilePeeker import inputFileSummary
from RecExConfig.AutoConfiguration import ConfigureFromListOfKeys
ConfigureFromListOfKeys([
    'ProjectName', 'BeamType', 'RealOrSim', 'DoTruth', 'LumiFlags',
    'FieldAndGeo', 'ConditionsTag', 'InputType'
])
svcMgr.EventSelector.InputCollections = athenaCommonFlags.FilesInput()
theApp.EvtMax = -1

include("RecExCond/AllDet_detDescr.py")

#--------------------------------------------------------------
# Specify if you want to use GRL
#--------------------------------------------------------------

UseGRLSelection = True  # use xml good lumi blocks input file
# GoodRunsListVec  = [ 'allruns_collisions.xml' ]
## Find the most up-to-date good run list(s) here:
## https://twiki.cern.ch/twiki/bin/view/AtlasProtected/GoodRunListsForData
## and include the file name(s) in GoodRunsListVec list. Example: