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)
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 return (clc, clc_store)
70 ctx = self.getContext()
71 mgr = self.condStore[
'CaloDetDescrManager'].find (ctx.eventID())
72 ccc = make_calo_cells (mgr)
73 self.evtStore.record (ccc,
'AllCalo',
False)
77 (clc, clc_store) = make_clusters (mgr, ccc, cell_hashes)
78 self.evtStore.record (clc,
'Clusters',
False)
79 self.evtStore.record (clc_store,
'ClustersAux.',
False)
80 return StatusCode.Success
86 return (abs (elt.eta() - eta) < 3*0.025
and
87 abs (elt.phi() - phi) < 7*2*pi/256)
90 ctx = self.getContext()
91 mgr = self.condStore[
'CaloDetDescrManager'].find (ctx.eventID())
92 dec = self.evtStore[
'AllCalo_THINNED_StreamAOD.thinAlg']
95 for i
in range (dec.size()):
96 elt = mgr.get_element (ROOT.IdentifierHash (i))
97 if elt.getSampling() == 3:
100 if not dec.thinned(i):
105 if not dec.thinned(i):
106 assert i
in cell_hashes
108 assert i
not in cell_hashes
109 return StatusCode.Success
115 from LArGeoAlgsNV.LArGMConfig
import LArGMCfg
116 from TileGeoModel.TileGMConfig
import TileGMCfg
120 from LArCabling.LArCablingConfig
import LArOnOffIdMappingCfg
123 result.addEventAlgo (CreateDataAlg (
'CreateDataAlg'))
125 CaloThinCellsByClusterAlg=CompFactory.CaloThinCellsByClusterAlg
126 result.addEventAlgo (CaloThinCellsByClusterAlg (
'thinAlg',
127 StreamName =
'StreamAOD',
128 Clusters =
'Clusters',
129 SamplingCellsName = [
'EMB3']))
131 result.addEventAlgo (CheckThinningAlg (
'CheckThinningAlg'))
137 ROOT.xAOD.CaloClusterContainer_v1
140 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
141 from AthenaConfiguration.TestDefaults
import defaultTestFiles
143 flags.Input.Files = defaultTestFiles.RDO_RUN2
144 flags.Input.TimeStamps = [1000]
145 flags.Detector.GeometryLAr =
True
146 flags.Detector.GeometryTile =
True
147 flags.needFlagsCategory(
'Tile')
148 flags.needFlagsCategory(
'LAr')
151 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
154 from McEventSelector.McEventSelectorConfig
import McEventSelectorCfg
155 acc.merge (McEventSelectorCfg (flags))
157 acc.merge (testCfg (flags))