4 from argparse
import ArgumentParser
6 parser = ArgumentParser()
7 parser.add_argument(
"-t",
"--threads", dest=
"threads", type=int, help=
"number of threads", default=1)
8 parser.add_argument(
"-o",
"--output", dest=
"output", default=
'', help=
"Text file containing each cabling channel", metavar=
"FILE")
9 parser.add_argument(
"--inputFile",
"-i", default=[
"/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/data17_13TeV.00330470.physics_Main.daq.RAW._lb0310._SFO-1._0001.data"],
10 help=
"Input file to run on ", nargs=
"+")
11 parser.add_argument(
"--geometry", default=
"ATLAS-R2-2016-01-00-01", help=
"Geometry tag")
12 parser.add_argument(
"--conditionsTag", default=
"CONDBR2-BLKPA-RUN2-11", help=
"conditionsTag")
13 parser.add_argument(
"--mezzMap", default=
"", help=
"External JSON file containing the internal mapping of the mezzanine cards")
14 parser.add_argument(
"--cablingMap", default=
"", help=
"External JSON file containing the cabling map of each channel")
18 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
21 from AthenaConfiguration.Enums
import Format
22 if flags.Input.Format == Format.POOL:
23 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
25 elif flags.Input.Format == Format.BS:
26 from ByteStreamCnvSvc.ByteStreamConfig
import ByteStreamReadCfg
29 from MuonConfig.MuonGeometryConfig
import MuonGeoModelCfg
31 from MuonConfig.MuonGeometryConfig
import MuonIdHelperSvcCfg
36 name = "MdtCablingTestAlg",
42 from MuonConfig.MuonCablingConfig
import MDTCablingConfigCfg
43 from MuonConfig.MuonCondAlgConfig
import MdtCondDbAlgCfg
44 from AthenaConfiguration.ComponentFactory
import CompFactory
45 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
49 event_algo = CompFactory.MdtCablingTestAlg(name, DumpMap=dumpFile)
50 result.addEventAlgo(event_algo, primary =
True)
53 if __name__ ==
"__main__":
54 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
58 flags.Concurrency.NumThreads = args.threads
59 flags.Concurrency.NumConcurrentEvents = args.threads
60 flags.Output.ESDFileName = args.output
61 flags.Input.Files = args.inputFile
62 flags.GeoModel.AtlasVersion = args.geometry
63 if not flags.Input.isMC:
64 flags.IOVDb.GlobalTag = args.conditionsTag
69 mezzJSON=args.mezzMap,
70 cablingJSON=args.cablingMap,
71 dumpFile=args.output))
72 cfg.printConfig(withDetails=
True, summariseProps=
True)
76 if not sc.isSuccess():
78 sys.exit(
"Execution failed")