예제 #1
0
## Automatically turn ON/OFF and set output file name of each possible NTUP
listOfFlags = []
try:
    listOfFlags.append(prodFlags)
except ImportError:
    print "WARNING SkimNTUPProdFlags.py is not available. Only OK if you're using job transforms without the AtlasAnalysis project."

from NTUPtoNTUPCore.NTUPUtils import SetupOutputSkimNTUPs
from AthenaCommon.JobProperties import jobproperties
prodFlags.SkimNTUPScripts.append(SetupOutputSkimNTUPs(runArgs, listOfFlags))

from PATJobTransforms.OutputsMgr import outputsMgr, magicKey
for key in dir(runArgs):
    if key.startswith(magicKey):
        outputsMgr.addOutput(key, getattr(runArgs, key))

## Pre-exec
if hasattr(runArgs, "preExec"):
    recoLog.info("transform pre-exec")
    for cmd in runArgs.preExec:
        recoLog.info(cmd)
        exec(cmd)

## Pre-include
if hasattr(runArgs, "preInclude"):
    for fragment in runArgs.preInclude:
        include(fragment)

#========================================================
# Central topOptions (this is one is a string not a list)
except ImportError:
    print "WARNING TopPhysD2PDFlags not available. Only OK if you're using job transforms without the AtlasAnalysis project."
try:
    from D3PDMakerConfig.D3PDProdFlags import prodFlags
    listOfFlags.append( prodFlags )
except ImportError:
    print "WARNING D3PDProdFlags not available. Only OK if you're using job transforms without the AtlasAnalysis project."

from PATJobTransforms.DPDUtils import SetupOutputDPDs
rec.DPDMakerScripts.append(SetupOutputDPDs(runArgs,listOfFlags))


from PATJobTransforms.OutputsMgr import outputsMgr,magicKey
for key in dir(runArgs):
    if key.startswith(magicKey):
        outputsMgr.addOutput(key,getattr(runArgs,key))

## Input
if hasattr(runArgs,"inputFile"): athenaCommonFlags.FilesInput.set_Value_and_Lock( runArgs.inputFile )
if hasattr(runArgs,"inputEVNTFile"): athenaCommonFlags.FilesInput.set_Value_and_Lock( runArgs.inputEVNTFile )
if hasattr(runArgs,"inputAODFile"):
    globalflags.InputFormat.set_Value_and_Lock('pool')
    rec.readAOD.set_Value_and_Lock( True )
    rec.readRDO.set_Value_and_Lock( False )
    athenaCommonFlags.PoolAODInput.set_Value_and_Lock( runArgs.inputAODFile )
if hasattr(runArgs,"inputTAGFile") or hasattr(runArgs,"inputTAG_AODFile"):
    #for TAG->AOD->skimmedAOD
    rec.readTAG.set_Value_and_Lock( True )
    rec.readAOD.set_Value_and_Lock( True )
    rec.doAOD.set_Value_and_Lock( False )
    rec.TAGFromRDO.set_Value_and_Lock( False )