9 from AnalysisAlgorithmsConfig.ConfigAccumulator
import DataType
10 from AnalysisAlgorithmsConfig.FullCPAlgorithmsTest
import makeSequence
11 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
12 from AthenaConfiguration.ComponentFactory
import CompFactory
13 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
14 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
15 from EventBookkeeperTools.EventBookkeeperToolsConfig
import CutFlowSvcCfg
18 athArgsParser = flags.getArgumentParser()
19 athArgsParser.add_argument(
"--input-file", action=
"append", dest=
"input_file",
21 help=
"Specify the input file")
22 athArgsParser.add_argument(
"--output-file", action=
"store", dest=
"output_file",
24 help=
"Specify the output file")
25 athArgsParser.add_argument(
"--dump-config", action=
"store", dest=
"dump_config",
27 help=
"Dump the config in a pickle file")
28 athArgsParser.add_argument(
"--data-type", action=
"store", dest=
"data_type",
30 help=
"Type of input to run over. Valid options are 'data', 'fullsim', 'fastsim'")
31 athArgsParser.add_argument(
'--block-config', dest=
'block_config',
32 action=
'store_true', default=
False,
33 help=
'Configure the job with block configuration')
34 athArgsParser.add_argument(
'--text-config', dest=
'text_config',
35 action=
'store', default=
'',
36 help=
'Configure the job with the provided text configuration')
37 athArgsParser.add_argument(
'--for-compare', dest=
'for_compare',
38 action=
'store_true', default=
False,
39 help=
'Configure the job for comparison of sequences vs blocks')
40 athArgsParser.add_argument(
'--no-systematics', dest=
'no_systematics',
41 action=
'store_true', default=
False,
42 help=
'Configure the job to with no systematics')
43 athArgsParser.add_argument(
'--physlite', dest=
'physlite',
44 action=
'store_true', default=
False,
45 help=
'Run the job on physlite')
46 athArgsParser.add_argument(
'--only-nominal-or', dest=
'onlyNominalOR',
47 action=
'store_true', default=
False,
48 help=
'Only run overlap removal for nominal (skip systematics)')
49 athArgs = flags.fillFromArgs(parser=athArgsParser)
52 blockConfig = athArgs.block_config
53 textConfig = athArgs.text_config
54 forCompare = athArgs.for_compare
56 print(f
"Running on data type: {dataType.value}")
59 inputfile = {DataType.Data:
'ASG_TEST_FILE_LITE_DATA',
60 DataType.FullSim:
'ASG_TEST_FILE_LITE_MC',
61 DataType.FastSim:
'ASG_TEST_FILE_LITE_MC_AFII'}
63 inputfile = {DataType.Data:
'ASG_TEST_FILE_DATA',
64 DataType.FullSim:
'ASG_TEST_FILE_MC',
65 DataType.FastSim:
'ASG_TEST_FILE_MC_AFII'}
68 if athArgs.input_file:
69 flags.Input.Files = athArgs.input_file[:]
71 testFile = os.getenv(inputfile[dataType])
72 flags.Input.Files = [testFile]
75 flags.Exec.EventPrintoutInterval = 100
87 forCompare=forCompare,
88 noSystematics=athArgs.no_systematics,
89 isPhyslite=athArgs.physlite,
90 autoconfigFromFlags=flags, onlyNominalOR=athArgs.onlyNominalOR,
91 forceEGammaFullSimConfig=
True)
97 outputFile = f
"ANALYSIS DATAFILE='FullCPAlgorithmsConfigTest.{dataType.value}.hist.root' OPT='RECREATE'"
99 outputFile = f
"ANALYSIS DATAFILE='FullCPAlgorithmsTextConfigTest.{dataType.value}.hist.root' OPT='RECREATE'"
101 outputFile = f
"ANALYSIS DATAFILE='FullCPAlgorithmsTest.{dataType.value}.hist.root' OPT='RECREATE'"
102 if athArgs.output_file:
103 outputFile = f
"ANALYSIS DATAFILE='{athArgs.output_file}' OPT='RECREATE'"
104 cfg.addService(CompFactory.THistSvc(Output=[outputFile]))
109 if athArgs.dump_config:
110 with open(athArgs.dump_config,
"wb")
as f:
114 sys.exit(sc.isFailure())