Skip to content
Snippets Groups Projects
Commit 280c859f authored by Walter Lampl's avatar Walter Lampl
Browse files

Merge branch 'asg/pool' into 'master'

CP algs: Use POOL access for now and unify Athena tests

See merge request atlas/athena!39393
parents 5330376a a8af5475
No related branches found
No related tags found
No related merge requests found
Showing
with 33 additions and 55 deletions
...@@ -22,7 +22,7 @@ inputfile = {"data": 'ASG_TEST_FILE_DATA', ...@@ -22,7 +22,7 @@ inputfile = {"data": 'ASG_TEST_FILE_DATA',
"afii": 'ASG_TEST_FILE_MC_AFII'} "afii": 'ASG_TEST_FILE_MC_AFII'}
# Set up the reading of the input file: # Set up the reading of the input file:
import AthenaRootComps.ReadAthenaxAODHybrid import AthenaPoolCnvSvc.ReadAthenaPool
theApp.EvtMax = 500 theApp.EvtMax = 500
testFile = os.getenv ( inputfile[dataType] ) testFile = os.getenv ( inputfile[dataType] )
svcMgr.EventSelector.InputCollections = [testFile] svcMgr.EventSelector.InputCollections = [testFile]
......
...@@ -21,7 +21,7 @@ inputfile = {"mc": 'ASG_TEST_FILE_MC', ...@@ -21,7 +21,7 @@ inputfile = {"mc": 'ASG_TEST_FILE_MC',
"afii": 'ASG_TEST_FILE_MC_AFII'} "afii": 'ASG_TEST_FILE_MC_AFII'}
# Set up the reading of the input file: # Set up the reading of the input file:
import AthenaRootComps.ReadAthenaxAODHybrid import AthenaPoolCnvSvc.ReadAthenaPool
theApp.EvtMax = 500 theApp.EvtMax = 500
testFile = os.getenv ( inputfile[dataType] ) testFile = os.getenv ( inputfile[dataType] )
svcMgr.EventSelector.InputCollections = [testFile] svcMgr.EventSelector.InputCollections = [testFile]
......
...@@ -22,7 +22,7 @@ inputfile = {"data": 'ASG_TEST_FILE_DATA', ...@@ -22,7 +22,7 @@ inputfile = {"data": 'ASG_TEST_FILE_DATA',
"afii": 'ASG_TEST_FILE_MC_AFII'} "afii": 'ASG_TEST_FILE_MC_AFII'}
# Set up the reading of the input file: # Set up the reading of the input file:
import AthenaRootComps.ReadAthenaxAODHybrid import AthenaPoolCnvSvc.ReadAthenaPool
theApp.EvtMax = 500 theApp.EvtMax = 500
testFile = os.getenv ( inputfile[dataType] ) testFile = os.getenv ( inputfile[dataType] )
svcMgr.EventSelector.InputCollections = [testFile] svcMgr.EventSelector.InputCollections = [testFile]
......
...@@ -22,7 +22,7 @@ inputfile = {"data": 'ASG_TEST_FILE_DATA', ...@@ -22,7 +22,7 @@ inputfile = {"data": 'ASG_TEST_FILE_DATA',
"afii": 'ASG_TEST_FILE_MC_AFII'} "afii": 'ASG_TEST_FILE_MC_AFII'}
# Set up the reading of the input file: # Set up the reading of the input file:
import AthenaRootComps.ReadAthenaxAODHybrid import AthenaPoolCnvSvc.ReadAthenaPool
theApp.EvtMax = 500 theApp.EvtMax = 500
testFile = os.getenv ( inputfile[dataType] ) testFile = os.getenv ( inputfile[dataType] )
svcMgr.EventSelector.InputCollections = [testFile] svcMgr.EventSelector.InputCollections = [testFile]
......
...@@ -22,7 +22,7 @@ inputfile = {"data": 'ASG_TEST_FILE_DATA', ...@@ -22,7 +22,7 @@ inputfile = {"data": 'ASG_TEST_FILE_DATA',
"afii": 'ASG_TEST_FILE_MC_AFII'} "afii": 'ASG_TEST_FILE_MC_AFII'}
# Set up the reading of the input file: # Set up the reading of the input file:
import AthenaRootComps.ReadAthenaxAODHybrid import AthenaPoolCnvSvc.ReadAthenaPool
theApp.EvtMax = 500 theApp.EvtMax = 500
testFile = os.getenv ( inputfile[dataType] ) testFile = os.getenv ( inputfile[dataType] )
svcMgr.EventSelector.InputCollections = [testFile] svcMgr.EventSelector.InputCollections = [testFile]
......
...@@ -24,7 +24,7 @@ inputfile = {"data": 'ASG_TEST_FILE_DATA', ...@@ -24,7 +24,7 @@ inputfile = {"data": 'ASG_TEST_FILE_DATA',
jetContainer = "AntiKt4EMTopoJets" jetContainer = "AntiKt4EMTopoJets"
# Set up the reading of the input file: # Set up the reading of the input file:
import AthenaRootComps.ReadAthenaxAODHybrid import AthenaPoolCnvSvc.ReadAthenaPool
theApp.EvtMax = 500 theApp.EvtMax = 500
testFile = os.getenv ( inputfile[dataType] ) testFile = os.getenv ( inputfile[dataType] )
svcMgr.EventSelector.InputCollections = [testFile] svcMgr.EventSelector.InputCollections = [testFile]
......
...@@ -24,7 +24,7 @@ inputfile = {"data": 'ASG_TEST_FILE_DATA', ...@@ -24,7 +24,7 @@ inputfile = {"data": 'ASG_TEST_FILE_DATA',
jetContainer = "AntiKt4EMTopoJets" jetContainer = "AntiKt4EMTopoJets"
# Set up the reading of the input file: # Set up the reading of the input file:
import AthenaRootComps.ReadAthenaxAODHybrid import AthenaPoolCnvSvc.ReadAthenaPool
theApp.EvtMax = 500 theApp.EvtMax = 500
testFile = os.getenv ( inputfile[dataType] ) testFile = os.getenv ( inputfile[dataType] )
svcMgr.EventSelector.InputCollections = [testFile] svcMgr.EventSelector.InputCollections = [testFile]
......
...@@ -22,7 +22,7 @@ inputfile = {"data": 'ASG_TEST_FILE_DATA', ...@@ -22,7 +22,7 @@ inputfile = {"data": 'ASG_TEST_FILE_DATA',
"afii": 'ASG_TEST_FILE_MC_AFII'} "afii": 'ASG_TEST_FILE_MC_AFII'}
# Set up the reading of the input file: # Set up the reading of the input file:
import AthenaRootComps.ReadAthenaxAODHybrid import AthenaPoolCnvSvc.ReadAthenaPool
theApp.EvtMax = 500 theApp.EvtMax = 500
testFile = os.getenv ( inputfile[dataType] ) testFile = os.getenv ( inputfile[dataType] )
svcMgr.EventSelector.InputCollections = [testFile] svcMgr.EventSelector.InputCollections = [testFile]
......
# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
# #
# @author Nils Krumnack, Will Buttinger # @author Nils Krumnack
#User options, which can be set from command line after a "-" character # User options, which can be set from command line after a "-" character
#athena MuonAnalysisAlgorithmsTest_jobOptions.py - --myOption ... # athena MuonAnalysisAlgorithmsTest_jobOptions.py - --myOption ...
from AthenaCommon.AthArgumentParser import AthArgumentParser from AthenaCommon.AthArgumentParser import AthArgumentParser
athArgsParser = AthArgumentParser() athArgsParser = AthArgumentParser()
athArgsParser.add_argument("--data-type",action="store",dest="data_type", athArgsParser.add_argument("--data-type", action = "store", dest = "data_type",
default="data", default = "data",
help="Type of data to run over. Valid options are data, mc, afii") help = "Type of input to run over. Valid options are 'data', 'mc', 'afii'")
athArgsParser.add_argument("--write-xaod",action="store",dest="write_xaod",
default=False,
help="Specify if you want xaod writing to happen (which means slower access mode for now)")
athArgs = athArgsParser.parse_args() athArgs = athArgsParser.parse_args()
if athArgs.write_xaod:
#currently we must use POOLAccess mode when writing an xAOD
jps.AthenaCommonFlags.AccessMode = "POOLAccess"
else:
#ClassAccess is much faster than POOLAccess
jps.AthenaCommonFlags.AccessMode = "ClassAccess"
dataType = athArgs.data_type dataType = athArgs.data_type
if not dataType in ["data", "mc", "afii"] :
raise Exception ("invalid data type: " + dataType)
# Set up a histogram/tree output file for the job: print("Running on data type: " + dataType)
jps.AthenaCommonFlags.HistOutputs = ["ANALYSIS:MuonAnalysisAlgorithmsTest." + dataType + ".hist.root"]
svcMgr.THistSvc.MaxFileSize=-1 #make job run faster by disabling file size check
#set a default file and number of events to process
#can override with standard athena command line options (--evtMax and --filesInput)
jps.AthenaCommonFlags.EvtMax = 500
if dataType=="data":
testFile = os.getenv ('ASG_TEST_FILE_DATA')
elif dataType=="mc":
testFile = os.getenv ('ASG_TEST_FILE_MC')
elif dataType=="afii":
testFile = os.getenv ('ASG_TEST_FILE_MC_AFII')
jps.AthenaCommonFlags.FilesInput = [testFile]
inputfile = {"data": 'ASG_TEST_FILE_DATA',
"mc": 'ASG_TEST_FILE_MC',
"afii": 'ASG_TEST_FILE_MC_AFII'}
# Set up the reading of the input file:
import AthenaPoolCnvSvc.ReadAthenaPool
theApp.EvtMax = 500
testFile = os.getenv ( inputfile[dataType] )
svcMgr.EventSelector.InputCollections = [testFile]
from MuonAnalysisAlgorithms.MuonAnalysisAlgorithmsTest import makeSequence from MuonAnalysisAlgorithms.MuonAnalysisAlgorithmsTest import makeSequence
algSeq = makeSequence (dataType) algSeq = makeSequence (dataType)
...@@ -50,17 +34,11 @@ print (algSeq) # For debugging ...@@ -50,17 +34,11 @@ print (algSeq) # For debugging
# Add all algorithms from the sequence to the job. # Add all algorithms from the sequence to the job.
athAlgSeq += algSeq athAlgSeq += algSeq
# Write a mini-xAOD if requested: # Set up a histogram output file for the job:
if athArgs.write_xaod: ServiceMgr += CfgMgr.THistSvc()
from OutputStreamAthenaPool.MultipleStreamManager import MSMgr ServiceMgr.THistSvc.Output += [
minixAOD = MSMgr.NewPoolRootStream( 'AAOD_MUON', "ANALYSIS DATAFILE='MuonAnalysisAlgorithmsTest." + dataType + ".hist.root' OPT='RECREATE'"
FileName = 'MuonAnalysisAlgorithmsTest.AAOD_MUON.pool.root' ) ]
minixAOD.AddItem(
[ 'xAOD::EventInfo#EventInfo',
'xAOD::EventAuxInfo#EventInfoAux.-',
'xAOD::MuonContainer#AnalysisMuons_NOSYS',
'xAOD::AuxContainerBase#AnalysisMuons_NOSYSAux.eta.phi.pt' ] )
# Reduce the printout from Athena: # Reduce the printout from Athena:
include( "AthAnalysisBaseComps/SuppressLogging.py" ) include( "AthAnalysisBaseComps/SuppressLogging.py" )
...@@ -22,7 +22,7 @@ inputfile = {"data": 'ASG_TEST_FILE_DATA', ...@@ -22,7 +22,7 @@ inputfile = {"data": 'ASG_TEST_FILE_DATA',
"afii": 'ASG_TEST_FILE_MC_AFII'} "afii": 'ASG_TEST_FILE_MC_AFII'}
# Set up the reading of the input file: # Set up the reading of the input file:
import AthenaRootComps.ReadAthenaxAODHybrid import AthenaPoolCnvSvc.ReadAthenaPool
theApp.EvtMax = 500 theApp.EvtMax = 500
testFile = os.getenv ( inputfile[dataType] ) testFile = os.getenv ( inputfile[dataType] )
svcMgr.EventSelector.InputCollections = [testFile] svcMgr.EventSelector.InputCollections = [testFile]
......
...@@ -22,7 +22,7 @@ inputfile = {"data": 'ASG_TEST_FILE_DATA', ...@@ -22,7 +22,7 @@ inputfile = {"data": 'ASG_TEST_FILE_DATA',
"afii": 'ASG_TEST_FILE_MC_AFII'} "afii": 'ASG_TEST_FILE_MC_AFII'}
# Set up the reading of the input file: # Set up the reading of the input file:
import AthenaRootComps.ReadAthenaxAODHybrid import AthenaPoolCnvSvc.ReadAthenaPool
theApp.EvtMax = 500 theApp.EvtMax = 500
testFile = os.getenv ( inputfile[dataType] ) testFile = os.getenv ( inputfile[dataType] )
svcMgr.EventSelector.InputCollections = [testFile] svcMgr.EventSelector.InputCollections = [testFile]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment