◆ __init__()
def TileCellBuilderFromHitTestConfig.TestAlg.__init__ |
( |
|
self, |
|
|
|
name |
|
) |
| |
◆ compare_cells()
def TileCellBuilderFromHitTestConfig.TestAlg.compare_cells |
( |
|
self, |
|
|
|
ccc, |
|
|
|
exp_cells, |
|
|
|
noise_thresh = 0 |
|
) |
| |
Definition at line 238 of file TileCellBuilderFromHitTestConfig.py.
238 def compare_cells (self, ccc, exp_cells, noise_thresh=0):
239 exp_cells = exp_cells.copy()
240 idHelper = self.detStore[
'CaloCell_ID'].tile_idHelper()
243 lcell = [c.ene1(), c.ene2(), c.time1(), c.time2(),
244 c.qual1(), c.qual2(),
245 c.qbit1(), c.qbit2(),
246 c.gain1(), c.gain2()]
249 addr = (idHelper.section(cid),
251 idHelper.module(cid),
253 idHelper.sampling(cid))
254 l = exp_cells.get (addr)
256 if abs(lcell[0]) > noise_thresh:
257 print (
'xxx unexpected cell', addr, lcell, flush=
True)
263 thr = max (1e-3, noise_thresh)
264 if (abs (lcell[0] - l[0]) > thr
or
265 abs (lcell[1] - l[1]) > thr
or
266 abs (lcell[2] - l[2]) > thr
or
267 abs (lcell[3] - l[3]) > thr
or
268 abs (lcell[4] != l[4])
or
269 abs (lcell[5] != l[5])
or
270 abs (lcell[6] != l[6])
or
271 abs (lcell[7] != l[7])
or
272 abs (lcell[8] != l[8])
or
273 abs (lcell[9] != l[9])):
274 print (
'xxx cell mismatch: ', addr, lcell, l, flush=
True)
278 for extra
in exp_cells:
279 print (
'xxx unfound cell', extra, flush=
True)
◆ execute()
def TileCellBuilderFromHitTestConfig.TestAlg.execute |
( |
|
self | ) |
|
Definition at line 177 of file TileCellBuilderFromHitTestConfig.py.
178 iev = self.getContext().
evt()
180 rctype = TileFragHash.OptFilterOffline
183 exp_cells = exp_cells_0
184 exp_mbts = exp_mbts_0
192 exp_cells = exp_cells_1
193 exp_mbts = exp_mbts_1
202 self.record_hits (hits, rctype, bsflags,
'TileHitCnt')
204 ccc = ROOT.CaloCellContainer()
205 if not tool.process (ccc, self.getContext()):
206 return StatusCode.Failure
208 self.compare_cells (ccc, exp_cells, noise_thresh)
209 self.compare_cells (self.evtStore[
'MBTSContainer'], exp_mbts)
210 self.compare_cells (self.evtStore[
'E4prContainer'], exp_e4_0)
212 return StatusCode.Success
◆ initialize()
def TileCellBuilderFromHitTestConfig.TestAlg.initialize |
( |
|
self | ) |
|
Definition at line 161 of file TileCellBuilderFromHitTestConfig.py.
162 ROOT.ICaloCellMakerTool
165 tool = ROOT.ToolHandle(ROOT.ICaloCellMakerTool)(
'TileCellBuilderFromHit/' + name)
166 if not tool.retrieve():
170 self.tool1 = gettool (
'tool1')
171 self.tool2 = gettool (
'tool2')
172 self.tool3 = gettool (
'tool3')
174 return StatusCode.Success
◆ record_hits()
def TileCellBuilderFromHitTestConfig.TestAlg.record_hits |
( |
|
self, |
|
|
|
hits, |
|
|
|
typ, |
|
|
|
bsflags, |
|
|
|
key |
|
) |
| |
Definition at line 215 of file TileCellBuilderFromHitTestConfig.py.
215 def record_hits (self, hits, typ, bsflags, key):
216 idHelper = self.detStore[
'CaloCell_ID'].tile_idHelper()
219 cont = ROOT.TileHitContainer (
False, typ, unit)
220 cont.set_bsflags (bsflags)
221 hashFunc = cont.hashFunc()
223 for icoll, colldata
in hits:
224 coll = ROOT.TileHitCollection (hashFunc.identifier(icoll))
226 for addr, data
in colldata:
227 adc_id = idHelper.adc_id (*addr)
228 hit = ROOT.TileHit (adc_id, *data)
231 cont.addCollection (coll, ROOT.IdentifierHash(icoll))
232 ROOT.SetOwnership (coll,
False)
234 self.evtStore.record (cont, key,
False)
◆ tool1
TileCellBuilderFromHitTestConfig.TestAlg.tool1 |
◆ tool2
TileCellBuilderFromHitTestConfig.TestAlg.tool2 |
◆ tool3
TileCellBuilderFromHitTestConfig.TestAlg.tool3 |
The documentation for this class was generated from the following file: