349 rawname = 'TileRawChannelCnt'):
350 idHelper = self.detStore['CaloCell_ID'].tile_idHelper()
351
352 unit = 0
353 cont = ROOT.TileRawChannelContainer (False, typ, unit)
354 cont.set_bsflags (bsflags)
355 hashFunc = cont.hashFunc()
356
357 dspcont = None
358 if dspcolls:
359 dspcont = ROOT.TileRawChannelContainer (False, typ, unit)
360 dspcont.set_bsflags (dspbsflags)
361
362 for icoll, colldata in hits:
363 coll = ROOT.TileRawChannelCollection (hashFunc.identifier(icoll))
364
365 mask = 0
366 for chan in baddq.get (icoll, []):
367 mask |= (1<<(chan//3))
368 coll.setFragMemoryPar(mask)
369
370 for addr, data in colldata:
371 if isinstance(addr, tuple):
372 adc_id = idHelper.adc_id (*addr)
373 chan = ROOT.TileRawChannel (adc_id, *data)
374 else:
375 hwid = ROOT.HWIdentifier (addr)
376 chan = ROOT.TileRawChannel (hwid, *data)
377 coll.push_back (chan)
378 ROOT.SetOwnership (chan, False)
379
380 if icoll in dspcolls:
381 thiscont = dspcont
382 else:
383 thiscont = cont
384 thiscont.addCollection (coll, ROOT.IdentifierHash(icoll))
385 ROOT.SetOwnership (coll, False)
386
387 self.evtStore.record (cont, rawname, False)
388 if dspcont:
389 self.evtStore.record (dspcont, 'TileRawChannelCntDsp', False)
390 return
391
392