37 ctx = self.getContext()
38 for (e, gain)
in elist:
39 if isinstance(e,
type(())):
40 cell = ROOT.TileCell(elt, e[0])
41 cell.setEnergy (e[0], e[1], 0, 0)
43 cell = ROOT.CaloCell (elt, e, 0, 0, 0)
44 g =
i32(self.
tool.estimatedGain (ctx, elt, e, 0))
45 assert g == gain, (e, g, gain)
46 g =
i32(self.
tool.estimatedGain (ctx, elt, e, 1))
47 assert g == gain, (e, g, gain)
49 g =
i32(self.
tool.estimatedGain (ctx, cell, 0))
50 assert g == gain, (e, g, gain)
51 g =
i32(self.
tool.estimatedGain (ctx, cell, elt, 0))
52 assert g == gain, (e, g, gain)
53 g =
i32(self.
tool.estimatedGain (ctx, cell, 1))
54 assert g == gain, (e, g, gain)
55 g =
i32(self.
tool.estimatedGain (ctx, cell, elt, 1))
56 assert g == gain, (e, g, gain)
60 log = logging.getLogger (
'TestAlg')
61 ctx = self.getContext()
62 mgr = self.condStore[
'CaloDetDescrManager'].find (ctx.eventID())
63 elt1 = mgr.get_element (ROOT.CaloCell_ID.LAREM,
65 self.
testcell (elt1, [(1000, 0), (50000, 1), (300000, 2)])
67 elt2 = mgr.get_element (ROOT.CaloCell_ID.LARHEC,
69 self.
testcell (elt2, [(1000, 1), (50000, 1), (300000, 2)])
71 elt3 = mgr.get_element (ROOT.CaloCell_ID.LARFCAL,
73 self.
testcell (elt3, [(1000, 0), (50000, 1), (800000, 2)])
75 elt4 = mgr.get_element (ROOT.CaloCell_ID.TileBar1, 0.3, 0.1)
76 self.
testcell (elt4, [((1000, 1000),
i32(ROOT.CaloGain.TILEHIGHHIGH)),
77 ((1000, 50000),
i32(ROOT.CaloGain.TILEHIGHLOW)),
78 ((50000, 1000),
i32(ROOT.CaloGain.TILEHIGHLOW)),
79 ((50000, 50000),
i32(ROOT.CaloGain.TILELOWLOW)),
82 return StatusCode.Success