ATLAS Offline Software
MetAnalysisAlgorithmsTest_jobOptions.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
2 #
3 # @author Nils Krumnack
4 
5 # User options, which can be set from command line after a "-" character
6 # athena EgammaAlgorithmsTest_jobOptions.py - --myOption ...
7 from AthenaCommon.AthArgumentParser import AthArgumentParser
8 athArgsParser = AthArgumentParser()
9 athArgsParser.add_argument("--data-type", action = "store", dest = "data_type",
10  default = "data",
11  help = "Type of input to run over. Valid options are 'data', 'mc', 'afii'")
12 athArgs = athArgsParser.parse_args()
13 
14 dataType = athArgs.data_type
15 if not dataType in ["data", "mc", "afii"] :
16  raise Exception ("invalid data type: " + dataType)
17 
18 print("Running on data type: " + dataType)
19 
20 inputfile = {"data": 'ASG_TEST_FILE_DATA',
21  "mc": 'ASG_TEST_FILE_MC',
22  "afii": 'ASG_TEST_FILE_MC_AFII'}
23 
24 # Set up the reading of the input file:
25 import AthenaPoolCnvSvc.ReadAthenaPool
26 theApp.EvtMax = 500
27 testFile = os.getenv ( inputfile[dataType] )
28 svcMgr.EventSelector.InputCollections = [testFile]
29 
30 from MetAnalysisAlgorithms.MetAnalysisAlgorithmsTest import makeSequence
31 algSeq = makeSequence (dataType)
32 print (algSeq) # For debugging
33 
34 # Add all algorithms from the sequence to the job.
35 athAlgSeq += algSeq
36 
37 # Set up a histogram output file for the job:
38 ServiceMgr += CfgMgr.THistSvc()
39 ServiceMgr.THistSvc.Output += [
40  "ANALYSIS DATAFILE='MetAnalysisAlgorithmsTest." + dataType + ".hist.root' OPT='RECREATE'"
41  ]
42 
43 # Reduce the printout from Athena:
44 include( "AthAnalysisBaseComps/SuppressLogging.py" )
python.Include.include
include
Definition: Include.py:318
dbg::print
void print(std::FILE *stream, std::format_string< Args... > fmt, Args &&... args)
Definition: SGImplSvc.cxx:70