ATLAS Offline Software
MdtDataPreparator_test.py
Go to the documentation of this file.
1 #
2 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration.
3 #
4 # File: TrigL2MuonSA/share/MdtDataPreparator_test.py
5 # Author: scott snyder
6 # Date: Jul, 2019
7 # Brief: Test for MdtDataPreparator
8 # For now, only tests the dead tube handling.
9 #
10 
11 
12 from AthenaConfiguration.ComponentFactory import CompFactory
13 
14 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
15 from AthenaPython.PyAthenaComps import Alg, StatusCode
16 import ROOT
17 
18 
19 class TestAlg (Alg):
20  def __init__ (self, name):
21  Alg.__init__ (self, name)
22  return
23 
24  def initialize (self):
25  #ROOT.Muon.IMuonRdoToPrepDataTool
26 
27  self.tool = ROOT.ToolHandle(ROOT.AthAlgTool)('TrigL2MuonSA::MdtDataPreparator')
28  if not self.tool.retrieve():
29  assert 0
30  return StatusCode.Success
31 
32 
33  def execute (self):
34  return StatusCode.Success
35 
36 
37 def testCfg (configFlags):
38  result = ComponentAccumulator()
39 
40  from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
41  result.merge (MuonGeoModelCfg(configFlags))
42 
43  from MagFieldServices.MagFieldServicesConfig import AtlasFieldCacheCondAlgCfg
44  result.merge (AtlasFieldCacheCondAlgCfg(configFlags, UseDCS = False))
45 
46  TrigL2MuonSA__MdtDataPreparator=CompFactory.TrigL2MuonSA.MdtDataPreparator
47  result.addPublicTool (TrigL2MuonSA__MdtDataPreparator ('TrigL2MuonSA::MdtDataPreparator', OutputLevel = 1)) # noqa: ATL900
48 
49  result.addEventAlgo (TestAlg ('TestAlg'))
50  return result
51 
52 
53 from AthenaConfiguration.AllConfigFlags import initConfigFlags
54 from AthenaConfiguration.TestDefaults import defaultConditionsTags, defaultGeometryTags, defaultTestFiles
55 
56 flags = initConfigFlags()
57 flags.Input.Files = defaultTestFiles.RAW_RUN2
58 flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN2
59 flags.IOVDb.GlobalTag = defaultConditionsTags.RUN2_DATA
60 flags.lock()
61 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
62 acc=MainServicesCfg(flags)
63 
64 acc.merge (testCfg (flags))
65 
66 #Want to see all verbose messages in this test
67 acc.getService("MessageSvc").enableSuppression = False
68 
69 acc.run(1)
70 
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
MdtDataPreparator_test.TestAlg.initialize
def initialize(self)
Definition: MdtDataPreparator_test.py:24
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
MdtDataPreparator_test.testCfg
def testCfg(configFlags)
Definition: MdtDataPreparator_test.py:37
MdtDataPreparator_test.TestAlg.execute
def execute(self)
Definition: MdtDataPreparator_test.py:33
MdtDataPreparator_test.TestAlg
Definition: MdtDataPreparator_test.py:19
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:256
python.MuonGeometryConfig.MuonGeoModelCfg
def MuonGeoModelCfg(flags)
Definition: MuonGeometryConfig.py:28
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
MdtDataPreparator_test.TestAlg.tool
tool
Definition: MdtDataPreparator_test.py:27
MdtDataPreparator_test.TestAlg.__init__
def __init__(self, name)
Definition: MdtDataPreparator_test.py:20
python.MagFieldServicesConfig.AtlasFieldCacheCondAlgCfg
def AtlasFieldCacheCondAlgCfg(flags, **kwargs)
Definition: MagFieldServicesConfig.py:8