ATLAS Offline Software
Loading...
Searching...
No Matches
MdtDataPreparator_test.py
Go to the documentation of this file.
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
12from AthenaConfiguration.ComponentFactory import CompFactory
13
14from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
15from AthenaPython.PyAthenaComps import Alg, StatusCode
16import ROOT
17
18
19class 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
37def 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, isPhase2=configFlags.Muon.usePhaseIIGeoSetup)) # noqa: ATL900
48
49 result.addEventAlgo (TestAlg ('TestAlg'))
50 return result
51
52
53from AthenaConfiguration.AllConfigFlags import initConfigFlags
54from AthenaConfiguration.TestDefaults import defaultConditionsTags, defaultGeometryTags, defaultTestFiles
55
56flags = initConfigFlags()
57flags.Input.Files = defaultTestFiles.RAW_RUN2
58flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN2
59flags.IOVDb.GlobalTag = defaultConditionsTags.RUN2_DATA
60flags.lock()
61from AthenaConfiguration.MainServicesConfig import MainServicesCfg
62acc=MainServicesCfg(flags)
63
64acc.merge (testCfg (flags))
65
66#Want to see all verbose messages in this test
67acc.getService("MessageSvc").enableSuppression = False
68
69acc.run(1)
70
void initialize()