7 from argparse
import ArgumentParser
8 parser = ArgumentParser(description=
'Parser for IDPVM configuration')
9 parser.add_argument(
"--filesInput", required=
True)
10 parser.add_argument(
"--maxEvents", help=
"Limit number of events. Default: all input events", default=-1, type=int)
11 parser.add_argument(
"--skipEvents", help=
"Skip this number of events. Default: no events are skipped", default=0, type=int)
12 parser.add_argument(
"--outputDBFile", help=
"Name of output DB file", default=
"beamspot.db", type=str)
13 parser.add_argument(
"--outputHistFile", help=
"Name of output hist file", default=
"nt.root", type=str)
14 parser.add_argument(
"--doMonitoring", help=
"Run monitoring", action=
'store_true')
15 parser.add_argument(
"--outputMonFile", help=
"Name of output monitoring file",
16 default=
"beamspotmonitoring.root", type=str)
17 return parser.parse_args()
22 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
25 flags.Input.Files = []
26 for path
in MyArgs.filesInput.split(
','):
27 flags.Input.Files += glob(path)
29 flags.Exec.SkipEvents = MyArgs.skipEvents
30 flags.Exec.MaxEvents = MyArgs.maxEvents
32 flags.Trigger.triggerConfig =
"DB"
33 flags.DQ.enableLumiAccess =
False
34 flags.Output.HISTFileName = MyArgs.outputMonFile
38 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
40 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
43 from InDetBeamSpotFinder.InDetBeamSpotFinderConfig
import InDetBeamSpotFinderCfg
46 from AthenaConfiguration.ComponentFactory
import CompFactory
47 acc.addService(CompFactory.THistSvc(
48 Output = [
"INDETBEAMSPOTFINDER DATAFILE='%s' OPT='RECREATE'" % MyArgs.outputHistFile]))
50 if MyArgs.doMonitoring:
51 from AthenaMonitoring
import AthMonitorCfgHelper
52 helper = AthMonitorCfgHelper(flags,
"BeamSpotMonitoring")
53 from InDetGlobalMonitoringRun3Test.InDetGlobalBeamSpotMonAlgCfg
import (
54 InDetGlobalBeamSpotMonAlgCfg )
56 acc.merge(helper.result())
58 acc.printConfig(withDetails=
True)
65 sys.exit(
not sc.isSuccess())