ATLAS Offline Software
MuonPrepDataCnvCfg.py
Go to the documentation of this file.
1 
2 #Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 
4 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
5 from AthenaConfiguration.ComponentFactory import CompFactory
6 
7 def xRpcToRpcPrepDataCnvAlgCfg(flags,name = "xAODRpcToPrepDataCnvAlg", **kwargs):
8  result = ComponentAccumulator()
9  the_alg = CompFactory.MuonR4.xRpcMeasToRpcTrkPrdCnvAlg(name, **kwargs)
10  result.addEventAlgo(the_alg, primary = True)
11  return result
12 
13 def MuonPrepDataToxAODCnvAlg(flags,name="MuonPrepDataToxAODCnvAlg", **kwargs):
14  result = ComponentAccumulator()
15  the_alg = CompFactory.Muon.PRDxAODConvertorAlg(name=name, **kwargs)
16  result.addEventAlgo(the_alg, primary = True)
17  return result
18 
20  from argparse import ArgumentParser
21 
22  parser = ArgumentParser()
23  parser.add_argument("-t", "--threads", dest="threads", type=int, help="number of threads", default=1)
24  parser.add_argument("-o", "--output", dest="output", default='PrepDataTest.pool.root', help="Text file containing each cabling channel", metavar="FILE")
25  parser.add_argument("--inputFile", "-i", default=["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/MuonRecRTT/UnitTestInput/Run3MC.ESD.pool.root"],
26  help="Input file to run on ", nargs="+")
27  return parser
28 
29 def setupTestOutputCfg(flags,**kwargs):
30 
31  kwargs.setdefault("streamName","MPRDTestStream")
32  kwargs.setdefault("AcceptAlgs",[])
33 
34  result = ComponentAccumulator()
35 
39  container_items = ["xAOD::MdtDriftCircleContainer#", "xAOD::MdtDriftCircleAuxContainer#",
40  "xAOD::RpcStripContainer#", "xAOD::RpcStripAuxContainer#",
41  "xAOD::TgcStripContainer#", "xAOD::TgcStripAuxContainer#",
42  "xAOD::MMClusterContainer#", "xAOD::MMClusterAuxContainer#",
43  "xAOD::sTgcStripContainer#", "xAOD::sTgcStripAuxContaine#",
44  "xAOD::sTgcWireContainer#", "xAOD::sTgcWireAuxContainer#",
45  "xAOD::sTgcPadContainer#", "xAOD::sTgcPadAuxContainer#",
46  ]
47  from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
48  kwargs.setdefault("ItemList", container_items)
49  result.merge(OutputStreamCfg(flags, **kwargs))
50  return result
51 
52 
53 if __name__ == "__main__":
54  from MuonCondTest.MdtCablingTester import setupServicesCfg
55  from AthenaConfiguration.AllConfigFlags import initConfigFlags
57 
58  flags = initConfigFlags()
59  flags.Concurrency.NumThreads = args.threads
60  flags.Concurrency.NumConcurrentEvents = args.threads # Might change this later, but good enough for the moment.
61  flags.Output.doWriteDAOD = True
62  flags.Input.Files = args.inputFile
63  flags.addFlag("Output.MPRDTestStreamFileName", args.output)
64  flags.addFlag("Output.doWriteMPRDTestStream", True)
65  flags.lock()
66 
67  cfg = setupServicesCfg(flags)
68  from MuonConfig.MuonDataPrepConfig import xAODUncalibMeasPrepCfg
69  cfg.merge(xAODUncalibMeasPrepCfg(flags))
70  cfg.merge(MuonPrepDataToxAODCnvAlg(flags))
71  cfg.merge(setupTestOutputCfg(flags))
72 
73  cfg.printConfig(withDetails=True, summariseProps=True)
74  flags.dump()
75 
76  sc = cfg.run(-1)
77  if not sc.isSuccess():
78  import sys
79  sys.exit("Execution failed")
80 
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.OutputStreamConfig.OutputStreamCfg
def OutputStreamCfg(flags, streamName, ItemList=[], MetadataItemList=[], disableEventTag=False, trigNavThinningSvc=None, takeItemsFromInput=False, extendProvenanceRecord=True, AcceptAlgs=[], HelperTools=[])
Definition: OutputStreamConfig.py:12
python.MdtCablingTester.setupServicesCfg
def setupServicesCfg(flags)
Definition: MdtCablingTester.py:17
MuonPrepDataCnvCfg.xRpcToRpcPrepDataCnvAlgCfg
def xRpcToRpcPrepDataCnvAlgCfg(flags, name="xAODRpcToPrepDataCnvAlg", **kwargs)
Definition: MuonPrepDataCnvCfg.py:7
MuonPrepDataCnvCfg.MuonPrepDataToxAODCnvAlg
def MuonPrepDataToxAODCnvAlg(flags, name="MuonPrepDataToxAODCnvAlg", **kwargs)
Definition: MuonPrepDataCnvCfg.py:13
MuonPrepDataCnvCfg.SetupArgParser
def SetupArgParser()
Definition: MuonPrepDataCnvCfg.py:19
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
confTool.parse_args
def parse_args()
Definition: confTool.py:35
python.MuonDataPrepConfig.xAODUncalibMeasPrepCfg
def xAODUncalibMeasPrepCfg(flags)
Configuriation snippet to schedule all algorithms providing the Uncalibrated measurements.
Definition: MuonDataPrepConfig.py:29
MuonPrepDataCnvCfg.setupTestOutputCfg
def setupTestOutputCfg(flags, **kwargs)
Definition: MuonPrepDataCnvCfg.py:29