ATLAS Offline Software
runPhysValExample.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 
4 from glob import glob
5 
7  from argparse import ArgumentParser
8  parser = ArgumentParser(description='Parser for PhysValExample configuration')
9  parser.add_argument("--filesInput")
10  parser.add_argument("--outputFile", help='Name of output file', default="M_output.root")
11  return parser.parse_args()
12 
13 # Parse the arguments
14 MyArgs = GetCustomAthArgs()
15 
16 from AthenaConfiguration.AllConfigFlags import initConfigFlags
17 flags = initConfigFlags()
18 flags.Input.Files = []
19 for path in MyArgs.filesInput.split(','):
20  flags.Input.Files += glob(path)
21 flags.PhysVal.OutputFileName = MyArgs.outputFile
22 
23 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
24 acc = MainServicesCfg(flags)
25 from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
26 acc.merge(PoolReadCfg(flags))
27 
28 flags.lock()
29 
30 from PhysValMonitoring.PhysValMonitoringConfig import PhysValMonitoringCfg, PhysValExampleCfg
31 acc.merge(PhysValMonitoringCfg(flags, tools=[acc.popToolsAndMerge(PhysValExampleCfg(flags))]))
32 
33 acc.printConfig(withDetails=True)
34 
35 # Execute and finish
36 sc = acc.run(maxEvents=-1)
37 
38 # Success should be 0
39 import sys
40 sys.exit(not sc.isSuccess())
runPhysValExample.GetCustomAthArgs
def GetCustomAthArgs()
Definition: runPhysValExample.py:6
PhysValMonitoringConfig.PhysValMonitoringCfg
def PhysValMonitoringCfg(flags, name="PhysValMonManager", tools=None, **kwargs)
Definition: PhysValMonitoringConfig.py:35
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:256
PhysValMonitoringConfig.PhysValExampleCfg
def PhysValExampleCfg(flags, **kwargs)
Definition: PhysValMonitoringConfig.py:15
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:69