ATLAS Offline Software
Loading...
Searching...
No Matches
CaloCellContainerAliasAlg_test.py
Go to the documentation of this file.
2# Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration.
3#
4# File: CaloRec/python/CaloCellContainerAliasAlg_test.py
5# Author: scott snyder
6# Date: Nov, 2019
7# Brief: Test for CaloCellContainerAliasAlg.
8#
9
10from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
11from AthenaConfiguration.ComponentFactory import CompFactory
12from AthenaPython.PyAthenaComps import Alg, StatusCode
13import ROOT
14
15
16class CreateDataAlg (Alg):
17 def execute (self):
18 ccc = ROOT.CaloCellContainer()
19 self.evtStore.record (ccc, 'AllCalo', False)
20 return StatusCode.Success
21
22
23class CheckAliasAlg (Alg):
24 def execute (self):
25 ccc1 = self.evtStore['AllCalo']
26 ccc2 = self.evtStore['CellAlias']
27 assert (repr(ccc1) == repr(ccc2))
28 return StatusCode.Success
29
30
31def testCfg (flags):
32 result = ComponentAccumulator()
33
34 from LArGeoAlgsNV.LArGMConfig import LArGMCfg
35 from TileGeoModel.TileGMConfig import TileGMCfg
36 result.merge(LArGMCfg(flags))
37 result.merge(TileGMCfg(flags))
38
39 from LArCabling.LArCablingConfig import LArOnOffIdMappingCfg
40 result.merge(LArOnOffIdMappingCfg(flags))
41
42 result.addEventAlgo (CreateDataAlg ('CreateDataAlg'))
43
44 CaloCellContainerAliasAlg=CompFactory.CaloCellContainerAliasAlg
45 result.addEventAlgo (CaloCellContainerAliasAlg ('aliasAlg',
46 Cells = 'AllCalo',
47 Alias = 'CellAlias'))
48
49 result.addEventAlgo (CheckAliasAlg ('CheckAliasAlg'))
50 return result
51
52
53from AthenaConfiguration.AllConfigFlags import initConfigFlags
54from AthenaConfiguration.TestDefaults import defaultTestFiles
55flags = initConfigFlags()
56flags.Input.Files = defaultTestFiles.RDO_RUN2
57flags.Input.TimeStamps = [1000]
58flags.Detector.GeometryLAr = True
59flags.Detector.GeometryTile = True
60flags.needFlagsCategory('Tile')
61flags.needFlagsCategory('LAr')
62
63flags.lock()
64from AthenaConfiguration.MainServicesConfig import MainServicesCfg
65acc = MainServicesCfg(flags)
66
67from McEventSelector.McEventSelectorConfig import McEventSelectorCfg
68acc.merge (McEventSelectorCfg (flags))
69
70acc.merge (testCfg (flags))
71acc.run(1)