ATLAS Offline Software
dumpTwinCabling.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 from AthenaConfiguration.ComponentFactory import CompFactory
3 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4 
5 def MdtToyTwinCablingDumpAlgCfg(flags, name="MdtToyTwinCablingDumpAlg",**kwargs):
6  result = ComponentAccumulator()
7  from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
8  result.merge(MuonGeoModelCfg(flags))
9 
10  from MuonConfig.MuonGeometryConfig import MuonIdHelperSvcCfg
11  kwargs.setdefault("MuonIdHelperSvc", result.getPrimaryAndMerge(MuonIdHelperSvcCfg(flags)))
12  the_alg = CompFactory.MdtToyTwinCablingDumpAlg(name, **kwargs)
13  result.addEventAlgo(the_alg, primary = True)
14  return result
15 
16 
17 if __name__ == "__main__":
18  from MuonGeoModelTestR4.testGeoModel import setupGeoR4TestCfg, SetupArgParser, executeTest, geoModelFileDefault
19  parser = SetupArgParser()
20  parser.set_defaults(nEvents = 1)
21  parser.set_defaults(noMM=True)
22  parser.set_defaults(noSTGC=True)
23  parser.set_defaults(noTgc=True)
24  parser.add_argument("--setupRun4", default=False, action="store_true")
25  parser.add_argument("--cablingMap", default="twinMap.json", help="External JSON file containing the cabling map of each channel")
26  parser.add_argument("--stationsToTwin",nargs='+', help="Specify the station names for which you want twin tubes",
27  default=[])
28  parser.add_argument("--chamberToTwin",nargs='+', help="Specify the station names for which you want twin tubes",
29  default=["BOL4A13M1", "BOL4C13M1"])
30  args = parser.parse_args()
31  args.geoModelFile = geoModelFileDefault(args.setupRun4)
32  flags, cfg = setupGeoR4TestCfg(args)
33  cfg.merge(MdtToyTwinCablingDumpAlgCfg(flags,
34  stationsToTwin = args.stationsToTwin,
35  outCablingJSON = args.cablingMap,
36  detElIdToTwin = args.chamberToTwin if "all" not in args.chamberToTwin else []))
37 
38  executeTest(cfg)
39 
40 
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.MdtCablingTester.SetupArgParser
def SetupArgParser()
Definition: MdtCablingTester.py:3
python.testGeoModel.geoModelFileDefault
def geoModelFileDefault(useR4Layout=False)
Definition: MuonPhaseII/MuonDetDescr/MuonGeoModelTestR4/python/testGeoModel.py:5
python.MuonGeometryConfig.MuonIdHelperSvcCfg
def MuonIdHelperSvcCfg(flags)
Definition: MuonGeometryConfig.py:15
python.testGeoModel.executeTest
def executeTest(cfg)
Definition: MuonPhaseII/MuonDetDescr/MuonGeoModelTestR4/python/testGeoModel.py:193
python.testGeoModel.setupGeoR4TestCfg
def setupGeoR4TestCfg(args, flags=None)
Definition: MuonPhaseII/MuonDetDescr/MuonGeoModelTestR4/python/testGeoModel.py:103
dumpTwinCabling.MdtToyTwinCablingDumpAlgCfg
def MdtToyTwinCablingDumpAlgCfg(flags, name="MdtToyTwinCablingDumpAlg", **kwargs)
Definition: dumpTwinCabling.py:5
python.MuonGeometryConfig.MuonGeoModelCfg
def MuonGeoModelCfg(flags)
Definition: MuonGeometryConfig.py:28