ATLAS Offline Software
GeneratorAlgorithmsTest_jobOptions.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
2 #
3 # @author Tadej Novak
4 
5 # User options, which can be set from command line after a "-" character
6 # athena OverlapAlgorithmsTest_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 = "mc",
11  help = "Type of input to run over. Valid options are 'mc', 'afii'")
12 athArgs = athArgsParser.parse_args()
13 
14 dataType = athArgs.data_type
15 if not dataType in ["mc", "afii"] :
16  raise Exception ("invalid data type: " + dataType)
17 
18 print("Running on data type: " + dataType)
19 
20 inputfile = {"mc": 'ASG_TEST_FILE_MC',
21  "afii": 'ASG_TEST_FILE_MC_AFII'}
22 
23 # Set up the reading of the input file:
24 import AthenaPoolCnvSvc.ReadAthenaPool
25 theApp.EvtMax = 500
26 testFile = os.getenv ( inputfile[dataType] )
27 svcMgr.EventSelector.InputCollections = [testFile]
28 
29 from AsgAnalysisAlgorithms.AsgAnalysisAlgorithmsTest import makeGeneratorAlgorithmsSequence
30 algSeq = makeGeneratorAlgorithmsSequence (dataType)
31 print( algSeq ) # For debugging
32 
33 # Add all algorithms from the sequence to the job.
34 athAlgSeq += algSeq
35 
36 # Set up a histogram output file for the job:
37 ServiceMgr += CfgMgr.THistSvc()
38 ServiceMgr.THistSvc.Output += [
39  "ANALYSIS DATAFILE='GeneratorAlgorithmsTest." + dataType + ".hist.root' OPT='RECREATE'"
40 ]
41 
42 # Reduce the printout from Athena:
43 include( "AthAnalysisBaseComps/SuppressLogging.py" )
python.Include.include
include
Definition: Include.py:319
Muon::print
std::string print(const MuPatSegment &)
Definition: MuonTrackSteering.cxx:28