◆ __init__()
def TileRawChannelBuilderTestConfig.TestAlg.__init__ |
( |
|
self, |
|
|
|
name |
|
) |
| |
◆ compare_chans()
def TileRawChannelBuilderTestConfig.TestAlg.compare_chans |
( |
|
self, |
|
|
|
chans, |
|
|
|
exp_chans |
|
) |
| |
Definition at line 361 of file TileRawChannelBuilderTestConfig.py.
361 def compare_chans (self, chans, exp_chans):
362 assert chans.get_type() == 0
363 assert chans.get_unit() == 0
364 assert chans.get_bsflags() == (3<<28)
366 exp_chans = exp_chans.copy()
367 idHelper = self.detStore[
'CaloCell_ID'].tile_idHelper()
371 lchan = [c.amplitude(),
377 addr = (idHelper.section(cid),
379 idHelper.module(cid),
381 idHelper.sampling(cid),
384 l = exp_chans.get (addr)
386 print (
'xxx unexpected chan', addr, lchan)
392 if (reldiff (lchan[0], l[0]) > 1e-3
or
393 reldiff (lchan[1], l[1]) > 1e-3
or
394 reldiff (lchan[2], l[2]) > 1e-3
or
395 reldiff (lchan[3], l[3]) > 1e-3):
396 print (
'xxx chan mismatch: ', addr, lchan, l)
400 for extra
in exp_chans:
401 print (
'xxx unfound chan', extra)
◆ execute()
def TileRawChannelBuilderTestConfig.TestAlg.execute |
( |
|
self | ) |
|
Definition at line 275 of file TileRawChannelBuilderTestConfig.py.
276 ctx = self.getContext()
280 return StatusCode.Success
283 exp_chans = exp_chans_0
291 exp_chans = exp_chans_1
296 exp_chans = exp_chans_2
300 exp_chans = exp_chans_3
302 digits = self.make_digits (digits_0)
304 if not tool.createContainer(ctx):
305 return StatusCode.Failure
308 if not tool.build (coll, ctx):
309 return StatusCode.Failure
311 if not tool.commitContainer(ctx):
312 return StatusCode.Failure
314 chans = self.evtStore[
'TileRawChannelFiltered']
315 self.compare_chans (chans, exp_chans)
317 return StatusCode.Success
◆ finalize()
def TileRawChannelBuilderTestConfig.TestAlg.finalize |
( |
|
self | ) |
|
◆ initialize()
def TileRawChannelBuilderTestConfig.TestAlg.initialize |
( |
|
self | ) |
|
Definition at line 255 of file TileRawChannelBuilderTestConfig.py.
256 ROOT.ICaloCellMakerTool
259 tool = ROOT.ToolHandle(ROOT.TileRawChannelBuilder)(
'TileRawChannelBuilderTest/' + name)
260 if not tool.retrieve():
264 self.tool1 = gettool (
'tool1')
265 self.tool2 = gettool (
'tool2')
267 return StatusCode.Success
◆ make_digit_coll()
def TileRawChannelBuilderTestConfig.TestAlg.make_digit_coll |
( |
|
self, |
|
|
|
idHelper, |
|
|
|
hashFunc, |
|
|
|
icoll, |
|
|
|
colldata |
|
) |
| |
Definition at line 346 of file TileRawChannelBuilderTestConfig.py.
346 def make_digit_coll (self, idHelper, hashFunc, icoll, colldata):
347 coll = ROOT.TileDigitsCollection (hashFunc.identifier(icoll))
349 for addr, data
in colldata:
350 if isinstance(addr, tuple):
351 adc_id = idHelper.adc_id (*addr)
352 chan = ROOT.TileDigits (adc_id, TestAlg.make_vec (data))
354 hwid = ROOT.HWIdentifier (addr)
355 chan = ROOT.TileDigits (hwid, TestAlg.make_vec (data))
356 coll.push_back (chan)
◆ make_digits()
def TileRawChannelBuilderTestConfig.TestAlg.make_digits |
( |
|
self, |
|
|
|
digits |
|
) |
| |
Definition at line 329 of file TileRawChannelBuilderTestConfig.py.
329 def make_digits (self, digits):
330 idHelper = self.detStore[
'CaloCell_ID'].tile_idHelper()
333 typ = TileFragHash.Default
334 cont = ROOT.TileDigitsContainer (
False, typ, unit)
335 hashFunc = cont.hashFunc()
337 for icoll, colldata
in digits:
339 coll = self.make_digit_coll (idHelper, hashFunc, icoll, colldata)
340 cont.addCollection (coll, ROOT.IdentifierHash(icoll))
341 ROOT.SetOwnership (coll,
False)
◆ make_vec()
def TileRawChannelBuilderTestConfig.TestAlg.make_vec |
( |
|
data | ) |
|
|
static |
◆ tool1
TileRawChannelBuilderTestConfig.TestAlg.tool1 |
◆ tool2
TileRawChannelBuilderTestConfig.TestAlg.tool2 |
The documentation for this class was generated from the following file: