7 from argparse
import ArgumentParser
8 IDTPMparser = ArgumentParser( description=
'Parser for IDTPM configuration' )
9 IDTPMparser.add_argument(
"--inputFileNames", help=
"Comma-separated list of input files", required=
True)
10 IDTPMparser.add_argument(
"--maxEvents", help=
"Limit number of events. Default: all input events", default=-1, type=int )
11 IDTPMparser.add_argument(
"--debug", help=
"Enable debugging messages", action=
"store_true", default=
False )
12 IDTPMparser.add_argument(
"--dirName", help=
"Main directory name for storing plots", default=
"InDetTrackPerfMonPlots/" )
13 IDTPMparser.add_argument(
"--outputFilePrefix", help=
'Name of output file', default=
"myIDTPM_out" )
14 IDTPMparser.add_argument(
"--writeAOD_IDTPM", help=
"Write output file for reprocessing", action=
"store_true", default=
False )
15 IDTPMparser.add_argument(
"--trkAnaCfgFile", help=
'File with track analysis setup (.json format)', default=
'Default' )
16 IDTPMparser.add_argument(
"--unpackTrigChains", help=
"Run each configured trigger chain in a separate track analysis", action=
"store_true", default=
False )
17 IDTPMparser.add_argument(
"--plotsDefFormat", help=
'Format of the plots definition file', default=
"JSON" )
18 IDTPMparser.add_argument(
"--plotsDefFileList", help=
'Plain txt file containing the list of .json file names with the plots definitions', default=
"InDetTrackPerfMon/PlotsDefFileList_default.txt" )
19 IDTPMparser.add_argument(
"--plotsCommonValuesFile", help=
'JSON file listing all the default values to be used in plots', default=
"" )
20 IDTPMparser.add_argument(
"--sortPlotsByChain", help=
"Arrange plots first in subdirectories named after the current chain", action=
"store_true", default=
False )
21 return IDTPMparser.parse_args()
27 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
31 flags.Input.Files = []
32 for path
in MyArgs.inputFileNames.split(
',' ):
33 flags.Input.Files += glob( path )
38 flags.Exec.OutputLevel = DEBUG
40 from InDetTrackPerfMon.InDetTrackPerfMonFlags
import initializeIDTPMConfigFlags, initializeIDTPMTrkAnaConfigFlags
44 flags.PhysVal.IDTPM.DirName = MyArgs.dirName
45 flags.PhysVal.IDTPM.outputFilePrefix = MyArgs.outputFilePrefix
46 flags.PhysVal.IDTPM.plotsDefFormat = MyArgs.plotsDefFormat
47 flags.PhysVal.IDTPM.plotsDefFileList = MyArgs.plotsDefFileList
48 flags.PhysVal.IDTPM.plotsCommonValuesFile = MyArgs.plotsCommonValuesFile
49 flags.PhysVal.IDTPM.sortPlotsByChain = MyArgs.sortPlotsByChain
50 flags.PhysVal.IDTPM.trkAnaCfgFile = MyArgs.trkAnaCfgFile
51 flags.Output.doWriteAOD_IDTPM = MyArgs.writeAOD_IDTPM
52 flags.PhysVal.IDTPM.unpackTrigChains = MyArgs.unpackTrigChains
57 flags.PhysVal.doExample =
False
62 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
65 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
68 from InDetTrackPerfMon.InDetTrackPerfMonConfig
import InDetTrackPerfMonCfg
71 acc.printConfig( withDetails=
True )
74 sc = acc.run( maxEvents=MyArgs.maxEvents )
78 sys.exit(
not sc.isSuccess() )