ATLAS Offline Software
DumpABLines.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 from AthenaConfiguration.ComponentFactory import CompFactory
3 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4 
5 def MuonABLineJsonDumpAlgCfg(flags, name = "MuonABLineJsonDumpAlg", **kwargs):
6  result = ComponentAccumulator()
7  event_algo = CompFactory.MuonABLineJsonDumpAlg(name,**kwargs)
8  result.addEventAlgo(event_algo, primary = True)
9  return result
10 
11 if __name__ == "__main__":
12  from AthenaConfiguration.AllConfigFlags import initConfigFlags
13  from MuonCondTest.MdtCablingTester import SetupArgParser
14  parser = SetupArgParser()
15  parser.set_defaults(output="ForkLiftTruckDrivingIsFun.json")
16  parser.set_defaults(inputFile = ["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/CampaignInputs/data23/ESD/data23_cos.00448208.express_express.recon.ESD.x721/73events.data23_cos.00448208.express_express.recon.ESD.x721._lb0003._SFO-ALL._0001.1"])
17  parser.add_argument("--alignJsonFile",
18  help="External JSON file parsed to the Alignment algorithm",
19  default="")
20  args = parser.parse_args()
21  flags = initConfigFlags()
22  flags.Concurrency.NumThreads = args.threads
23  flags.Concurrency.NumConcurrentEvents = args.threads # Might change this later, but good enough for the moment.
24  flags.Output.ESDFileName = args.output
25  flags.Input.Files = args.inputFile
26  flags.lock()
27 
28  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
29  cfg = MainServicesCfg(flags)
30 
31  from AthenaConfiguration.Enums import Format
32  if flags.Input.Format == Format.POOL:
33  from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
34  cfg.merge(PoolReadCfg(flags))
35  elif flags.Input.Format == Format.BS:
36  from ByteStreamCnvSvc.ByteStreamConfig import ByteStreamReadCfg
37  cfg.merge(ByteStreamReadCfg(flags))
38 
39  from MuonConfig.MuonGeometryConfig import MuonAlignmentCondAlgCfg
40  cfg.merge(MuonAlignmentCondAlgCfg(flags, readFromJSON = args.alignJsonFile))
41  from MuonConfig.MuonGeometryConfig import MuonIdHelperSvcCfg
42  cfg.merge(MuonIdHelperSvcCfg(flags))
43 
44  cfg.merge(MuonABLineJsonDumpAlgCfg(flags, OutFile=args.output))
45  cfg.printConfig(withDetails=True, summariseProps=True)
46  flags.dump()
47 
48  sc = cfg.run(1)
49  if not sc.isSuccess():
50  import sys
51  sys.exit("Execution failed")
52 
53 
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.MdtCablingTester.SetupArgParser
def SetupArgParser()
Definition: MdtCablingTester.py:3
python.ByteStreamConfig.ByteStreamReadCfg
def ByteStreamReadCfg(flags, type_names=None)
Definition: Event/ByteStreamCnvSvc/python/ByteStreamConfig.py:25
python.MuonGeometryConfig.MuonAlignmentCondAlgCfg
def MuonAlignmentCondAlgCfg(flags, name="MuonAlignmentCondAlg", **kwargs)
Definition: MuonGeometryConfig.py:100
python.MuonGeometryConfig.MuonIdHelperSvcCfg
def MuonIdHelperSvcCfg(flags)
Definition: MuonGeometryConfig.py:15
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:260
DumpABLines.MuonABLineJsonDumpAlgCfg
def MuonABLineJsonDumpAlgCfg(flags, name="MuonABLineJsonDumpAlg", **kwargs)
Definition: DumpABLines.py:5
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:69