ATLAS Offline Software
AlignmentErrorTestAlgConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaConfiguration.ComponentFactory import CompFactory
4 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
5 
6 def AlignmentErrorTestAlgCfg(flags, name="AlignmentErrorTestAlg", **kwargs):
8 
9  from MuonAlignErrorTool.AlignmentErrorToolConfig import AlignmentErrorToolCfg
10  kwargs.setdefault("alignmentErrorTool", acc.popToolsAndMerge(AlignmentErrorToolCfg(flags)))
11 
12  alg = CompFactory.MuonAlign.AlignmentErrorTestAlg(name, **kwargs)
13  acc.addEventAlgo(alg)
14 
15  return acc
16 
17 if __name__ == "__main__":
18  from AthenaConfiguration.AllConfigFlags import initConfigFlags
19  flags = initConfigFlags()
20 
21  parser = flags.getArgumentParser()
22  parser.add_argument('--postExec', help='Code to execute after setup')
23  parser.add_argument('--errorClobFileOverride', help='Optional path to an error clob file to use as override')
24 
25  # Set flags defaults
26  flags.Input.Files = ['/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/WorkflowReferences/main/q442/v32/myESD.pool.root']
27  flags.Exec.MaxEvents = 10
28  flags.Common.ShowMsgStats = True
29 
30  args, _ = parser.parse_known_args()
31 
32  flags.fillFromArgs(parser=parser)
33  flags.lock()
34 
35  flags.dump()
36 
37  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
38  cfg = MainServicesCfg(flags)
39 
40  from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
41  cfg.merge(PoolReadCfg(flags))
42 
43  cfg.merge(AlignmentErrorTestAlgCfg(flags))
44 
45  if args.errorClobFileOverride:
46  cfg.getCondAlgo("MuonAlignmentErrorDbAlg").clobFileOverride = args.errorClobFileOverride
47 
48  if args.postExec:
49  print('Executing postExec: %s', args.postExec)
50  exec(args.postExec)
51 
52  cfg.printConfig()
53 
54  cfg.run()
python.AlignmentErrorToolConfig.AlignmentErrorToolCfg
def AlignmentErrorToolCfg(flags, name="AlignmentErrorTool", **kwargs)
Definition: AlignmentErrorToolConfig.py:6
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.AlignmentErrorTestAlgConfig.AlignmentErrorTestAlgCfg
def AlignmentErrorTestAlgCfg(flags, name="AlignmentErrorTestAlg", **kwargs)
Definition: AlignmentErrorTestAlgConfig.py:6
LArG4FSStartPointFilter.exec
exec
Definition: LArG4FSStartPointFilter.py:103
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:260
print
void print(char *figname, TCanvas *c1)
Definition: TRTCalib_StrawStatusPlots.cxx:25
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:69