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(
'--text-config', dest=
'text_config',
32 action=
'store', default=
None,
33 help=
'Configure the job with the provided text configuration')
34 athArgsParser.add_argument(
'--no-systematics', dest=
'no_systematics',
35 action=
'store_true', default=
False,
36 help=
'Configure the job to with no systematics')
37 athArgsParser.add_argument(
'--physlite', dest=
'physlite',
38 action=
'store_true', default=
False,
39 help=
'Run the job on physlite')
40 athArgsParser.add_argument(
'--run', action=
'store', dest=
'run',
42 help=
'Run number for the inputs')
43 athArgsParser.add_argument(
'--only-nominal-or', dest=
'onlyNominalOR',
44 action=
'store_true', default=
False,
45 help=
'Only run overlap removal for nominal (skip systematics)')
46 athArgsParser.add_argument(
'--bleeding-edge', dest=
'bleeding_edge',
47 action=
'store_true', default=
False,
48 help=
'Run on the latest bleeding edge input (usually from the CI output)')
49 athArgs = flags.fillFromArgs(parser=athArgsParser)
52 textConfig = athArgs.text_config
55 from PathResolver
import PathResolver
58 print(f
"Running on data type: {dataType.value}")
62 inputfile = {DataType.Data:
'ASG_TEST_FILE_LITE_RUN3_DATA',
63 DataType.FullSim:
'ASG_TEST_FILE_LITE_RUN3_MC',
64 DataType.FastSim:
'ASG_TEST_FILE_LITE_RUN3_MC_FASTSIM'}
66 inputfile = {DataType.Data:
'ASG_TEST_FILE_LITE_DATA',
67 DataType.FullSim:
'ASG_TEST_FILE_LITE_MC',
68 DataType.FastSim:
'ASG_TEST_FILE_LITE_MC_FASTSIM'}
71 inputfile = {DataType.Data:
'ASG_TEST_FILE_RUN3_DATA',
72 DataType.FullSim:
'ASG_TEST_FILE_RUN3_MC',
73 DataType.FastSim:
'ASG_TEST_FILE_RUN3_MC_FASTSIM'}
75 inputfile = {DataType.Data:
'ASG_TEST_FILE_DATA',
76 DataType.FullSim:
'ASG_TEST_FILE_MC',
77 DataType.FastSim:
'ASG_TEST_FILE_MC_FASTSIM'}
80 if athArgs.input_file:
81 flags.Input.Files = athArgs.input_file[:]
83 testFile = os.getenv(inputfile[dataType])
84 flags.Input.Files = [testFile]
87 flags.Exec.EventPrintoutInterval = 100
88 if flags.PerfMon.doFullMonMT
or flags.PerfMon.doFastMonMT:
89 flags.PerfMon.OutputJSON=
"perfmonmt_CPAnalysis.json"
101 noSystematics=athArgs.no_systematics,
102 isPhyslite=athArgs.physlite,
103 autoconfigFromFlags=flags, onlyNominalOR=athArgs.onlyNominalOR,
104 forceEGammaFullSimConfig=
True,
105 bleedingEdge=athArgs.bleeding_edge)
111 outputFile = f
"ANALYSIS DATAFILE='FullCPAlgorithmsTextConfigTest.{dataType.value}.hist.root' OPT='RECREATE'"
113 outputFile = f
"ANALYSIS DATAFILE='FullCPAlgorithmsConfigTest.{dataType.value}.hist.root' OPT='RECREATE'"
114 if athArgs.output_file:
115 outputFile = f
"ANALYSIS DATAFILE='{athArgs.output_file}' OPT='RECREATE'"
116 cfg.addService(CompFactory.THistSvc(Output=[outputFile]))
121 if athArgs.dump_config:
122 with open(athArgs.dump_config,
"wb")
as f:
124 if flags.Exec.MaxEvents>0:
125 sc=cfg.run(flags.Exec.MaxEvents)
128 sys.exit(sc.isFailure())