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
379 if icoll in dspcolls:
380 thiscont = dspcont
381 else:
382 thiscont = cont
383 thiscont.addCollection (coll, ROOT.IdentifierHash(icoll))
384 ROOT.SetOwnership (coll, False)
385
386 self.evtStore.record (cont, rawname, False)
387 if dspcont:
388 self.evtStore.record (dspcont, 'TileRawChannelCntDsp', False)
389 return
390
391