10 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
11 from AthenaConfiguration.ComponentFactory
import CompFactory
12 from AthenaPython.PyAthenaComps
import Alg, StatusCode
21 ccc = ROOT.CaloCellContainer()
22 for i
in range (mgr.element_size()):
23 elt = mgr.get_element (ROOT.IdentifierHash (i))
25 cc = ROOT.CaloCell (elt, 0, 0, 0, 0)
27 ROOT.SetOwnership (cc,
False)
29 ccc.updateCaloIterators()
34 clc = ROOT.xAOD.CaloClusterContainer()
35 clc_store = ROOT.xAOD.CaloClusterAuxContainer()
36 clc.setStore (clc_store)
37 cellLinks = ROOT.CaloClusterCellLinkContainer()
38 ids = ROOT.vector(ROOT.IdentifierHash)()
41 cl = ROOT.xAOD.CaloCluster()
43 ROOT.SetOwnership (cl,
False)
48 cl.setClusterSize (ROOT.xAOD.CaloCluster.SW_37ele)
49 links = ROOT.CaloClusterCellLink (ccc)
50 cl.addCellLink (links)
51 ROOT.SetOwnership (links,
False)
53 mgr.cellsInZone (eta - 0.05, eta + 0.05, phi - 0.05, phi + 0.05, ids)
55 elt = mgr.get_element (hash)
58 idx = ccc.findIndex (hash)
60 print (
"??? Can't find cell with hash ", hash)
62 hashes.add (hash.value())
65 cl.setLink(cellLinks,ctx)
67 return (clc, clc_store, cellLinks)
72 ctx = self.getContext()
73 mgr = self.condStore[
'CaloDetDescrManager'].find (ctx.eventID())
74 ccc = make_calo_cells (mgr)
75 self.evtStore.record (ccc,
'AllCalo',
False)
79 (clc, clc_store, cellLinks) = make_clusters (mgr, ccc, cell_hashes, ctx)
80 self.evtStore.record (clc,
'Clusters',
False)
81 self.evtStore.record (clc_store,
'ClustersAux.',
False)
82 self.evtStore.record (cellLinks,
'Clusters_links',
False)
83 return StatusCode.Success
89 return (abs (elt.eta() - eta) < 3*0.025
and
90 abs (elt.phi() - phi) < 7*2*pi/256)
93 ctx = self.getContext()
94 mgr = self.condStore[
'CaloDetDescrManager'].find (ctx.eventID())
95 dec = self.evtStore[
'AllCalo_THINNED_StreamAOD.thinAlg']
98 for i
in range (dec.size()):
99 elt = mgr.get_element (ROOT.IdentifierHash (i))
100 if elt.getSampling() == 3:
103 if not dec.thinned(i):
108 if not dec.thinned(i):
109 assert i
in cell_hashes
111 assert i
not in cell_hashes
112 return StatusCode.Success
118 from LArGeoAlgsNV.LArGMConfig
import LArGMCfg
119 from TileGeoModel.TileGMConfig
import TileGMCfg
123 from LArCabling.LArCablingConfig
import LArOnOffIdMappingCfg
126 result.addEventAlgo (CreateDataAlg (
'CreateDataAlg'))
128 CaloThinCellsByClusterAlg=CompFactory.CaloThinCellsByClusterAlg
129 result.addEventAlgo (CaloThinCellsByClusterAlg (
'thinAlg',
130 StreamName =
'StreamAOD',
131 Clusters =
'Clusters',
132 SamplingCellsName = [
'EMB3']))
134 result.addEventAlgo (CheckThinningAlg (
'CheckThinningAlg'))
140 ROOT.xAOD.CaloClusterContainer_v1
143 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
144 from AthenaConfiguration.TestDefaults
import defaultTestFiles
146 flags.Input.Files = defaultTestFiles.RDO_RUN2
147 flags.Input.TimeStamps = [1000]
148 flags.Detector.GeometryLAr =
True
149 flags.Detector.GeometryTile =
True
150 flags.needFlagsCategory(
'Tile')
151 flags.needFlagsCategory(
'LAr')
154 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
157 from McEventSelector.McEventSelectorConfig
import McEventSelectorCfg
158 acc.merge (McEventSelectorCfg (flags))
160 acc.merge (testCfg (flags))