ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
TileCellBuilderTestConfig.TestAlg Class Reference
Inheritance diagram for TileCellBuilderTestConfig.TestAlg:
Collaboration diagram for TileCellBuilderTestConfig.TestAlg:

Public Member Functions

def __init__ (self, name, prepAlg)
 
def initialize (self)
 
def finalize (self)
 
def execute (self)
 
def compare_cells (self, ccc, exp_cells, rctype)
 
def check_ei (self, extra_flags)
 
def make_bad_chan_lines (self, chans)
 
def check_bad_chan_lines (self)
 

Static Public Member Functions

def update_qbit (qb, rctype)
 

Public Attributes

 prepAlg
 
 tool1
 
 tool2
 
 tool5
 
 tool6
 
 tool7
 
 tool8
 
 tool9
 
 tool10
 
 tool11
 

Detailed Description

Definition at line 395 of file TileCellBuilderTestConfig.py.

Constructor & Destructor Documentation

◆ __init__()

def TileCellBuilderTestConfig.TestAlg.__init__ (   self,
  name,
  prepAlg 
)

Definition at line 396 of file TileCellBuilderTestConfig.py.

396  def __init__ (self, name, prepAlg):
397  Alg.__init__ (self, name)
398  self.prepAlg = prepAlg
399  return
400 

Member Function Documentation

◆ check_bad_chan_lines()

def TileCellBuilderTestConfig.TestAlg.check_bad_chan_lines (   self)

Definition at line 522 of file TileCellBuilderTestConfig.py.

522  def check_bad_chan_lines (self):
523  for name, (chans, lines) in baddefs.items():
524  xlines = self.make_bad_chan_lines (chans)
525  if xlines.strip() != lines.strip():
526  print ('xxx Bad chan lines need updating: ', name)
527  print (xlines)
528  return
529 
530 

◆ check_ei()

def TileCellBuilderTestConfig.TestAlg.check_ei (   self,
  extra_flags 
)

Definition at line 498 of file TileCellBuilderTestConfig.py.

498  def check_ei (self, extra_flags):
499  ei = self.evtStore['EventInfo']
500  assert ei.eventFlags (ROOT.xAOD.EventInfo.Tile) == (0xf0f0005 | extra_flags)
501  assert ei.errorState (ROOT.xAOD.EventInfo.Tile) == ROOT.xAOD.EventInfo.Error
502  return
503 
504 

◆ compare_cells()

def TileCellBuilderTestConfig.TestAlg.compare_cells (   self,
  ccc,
  exp_cells,
  rctype 
)

Definition at line 450 of file TileCellBuilderTestConfig.py.

450  def compare_cells (self, ccc, exp_cells, rctype):
451  exp_cells = exp_cells.copy()
452  idHelper = self.detStore['CaloCell_ID'].tile_idHelper()
453 
454  for c in ccc:
455  lcell = [c.ene1(), c.ene2(), c.time1(), c.time2(),
456  c.qual1(), c.qual2(),
457  c.qbit1(), c.qbit2(),
458  c.gain1(), c.gain2()]
459 
460  cid = c.ID()
461  addr = (idHelper.section(cid),
462  idHelper.side(cid),
463  idHelper.module(cid),
464  idHelper.tower(cid),
465  idHelper.sampling(cid))
466  l = exp_cells.get (addr)
467  if not l:
468  print ('xxx unexpected cell', addr, lcell)
469  assert 0
470  continue
471 
472  l = l[:]
473 
474  # Low 3 bits of qbit correspond to rctype, unless cell was masked.
475  if l[0] != 0: l[6] = TestAlg.update_qbit (l[6], rctype)
476  if l[1] != 0: l[7] = TestAlg.update_qbit (l[7], rctype)
477 
478  if (abs (lcell[0] - l[0]) > 1e-3 or
479  abs (lcell[1] - l[1]) > 1e-3 or
480  abs (lcell[2] - l[2]) > 1e-3 or
481  abs (lcell[3] - l[3]) > 1e-3 or
482  abs (lcell[4] != l[4]) or
483  abs (lcell[5] != l[5]) or
484  abs (lcell[6] != l[6]) or
485  abs (lcell[7] != l[7]) or
486  abs (lcell[8] != l[8]) or
487  abs (lcell[9] != l[9])):
488  print ('xxx cell mismatch: ', addr, lcell, l)
489  assert 0
490  del exp_cells[addr]
491 
492  for extra in exp_cells:
493  print ('xxx unfound cell', extra)
494  assert 0
495  return
496 
497 

◆ execute()

def TileCellBuilderTestConfig.TestAlg.execute (   self)

Definition at line 428 of file TileCellBuilderTestConfig.py.

428  def execute (self):
429  tool = getattr (self, self.prepAlg.tool)
430 
431  ccc = ROOT.CaloCellContainer()
432  if not tool.process (ccc, self.getContext()):
433  return StatusCode.Failure
434 
435  rctype = self.prepAlg.rctype
436  self.compare_cells (ccc, self.prepAlg.exp_cells, rctype)
437  self.compare_cells (self.evtStore['MBTSContainer'], self.prepAlg.exp_mbts, rctype)
438  self.compare_cells (self.evtStore['E4prContainer'], exp_e4_0, rctype)
439 
440  self.check_ei (self.prepAlg.extra_ei_flags)
441  return StatusCode.Success
442 
443 

◆ finalize()

def TileCellBuilderTestConfig.TestAlg.finalize (   self)

Definition at line 423 of file TileCellBuilderTestConfig.py.

423  def finalize (self):
424  self.check_bad_chan_lines()
425  return StatusCode.Success
426 
427 

◆ initialize()

def TileCellBuilderTestConfig.TestAlg.initialize (   self)

Definition at line 401 of file TileCellBuilderTestConfig.py.

401  def initialize (self):
402  ROOT.ICaloCellMakerTool
403 
404  def gettool (name):
405  tool = ROOT.ToolHandle(ROOT.ICaloCellMakerTool)('TileCellBuilder/' + name)
406  if not tool.retrieve():
407  assert 0
408  return tool
409 
410  self.tool1 = gettool ('tool1')
411  self.tool2 = gettool ('tool2')
412  self.tool5 = gettool ('tool5')
413  self.tool6 = gettool ('tool6')
414  self.tool7 = gettool ('tool7')
415  self.tool8 = gettool ('tool8')
416  self.tool9 = gettool ('tool9')
417  self.tool10 = gettool ('tool10')
418  self.tool11 = gettool ('tool11')
419 
420  return StatusCode.Success
421 
422 

◆ make_bad_chan_lines()

def TileCellBuilderTestConfig.TestAlg.make_bad_chan_lines (   self,
  chans 
)

Definition at line 505 of file TileCellBuilderTestConfig.py.

505  def make_bad_chan_lines (self, chans):
506  idHelper = self.detStore['CaloCell_ID'].tile_idHelper()
507  hwidHelper = self.detStore['TileHWID']
508  cabling = ROOT.TileCablingService.getInstance()
509 
510  lines = []
511  for addr, data in chans:
512  pmt_id = idHelper.pmt_id (*addr)
513  channel_id = cabling.s2h_channel_id (pmt_id)
514  frag = hwidHelper.frag (channel_id)
515  channel = hwidHelper.channel (channel_id)
516  line = '0x%03x %d 0 %d %d %d' % (frag, channel, data[0], data[1], data[2])
517  lines.append (line)
518 
519  return '\n'.join (lines)
520 
521 

◆ update_qbit()

def TileCellBuilderTestConfig.TestAlg.update_qbit (   qb,
  rctype 
)
static

Definition at line 445 of file TileCellBuilderTestConfig.py.

445  def update_qbit (qb, rctype):
446  if qb == 0: return 0
447  return qb&(~7) | rctype
448 
449 

Member Data Documentation

◆ prepAlg

TileCellBuilderTestConfig.TestAlg.prepAlg

Definition at line 398 of file TileCellBuilderTestConfig.py.

◆ tool1

TileCellBuilderTestConfig.TestAlg.tool1

Definition at line 410 of file TileCellBuilderTestConfig.py.

◆ tool10

TileCellBuilderTestConfig.TestAlg.tool10

Definition at line 417 of file TileCellBuilderTestConfig.py.

◆ tool11

TileCellBuilderTestConfig.TestAlg.tool11

Definition at line 418 of file TileCellBuilderTestConfig.py.

◆ tool2

TileCellBuilderTestConfig.TestAlg.tool2

Definition at line 411 of file TileCellBuilderTestConfig.py.

◆ tool5

TileCellBuilderTestConfig.TestAlg.tool5

Definition at line 412 of file TileCellBuilderTestConfig.py.

◆ tool6

TileCellBuilderTestConfig.TestAlg.tool6

Definition at line 413 of file TileCellBuilderTestConfig.py.

◆ tool7

TileCellBuilderTestConfig.TestAlg.tool7

Definition at line 414 of file TileCellBuilderTestConfig.py.

◆ tool8

TileCellBuilderTestConfig.TestAlg.tool8

Definition at line 415 of file TileCellBuilderTestConfig.py.

◆ tool9

TileCellBuilderTestConfig.TestAlg.tool9

Definition at line 416 of file TileCellBuilderTestConfig.py.


The documentation for this class was generated from the following file:
python.tests.PyTestsLib.finalize
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Definition: PyTestsLib.py:50
initialize
void initialize()
Definition: run_EoverP.cxx:894
LArG4FSStartPointFilterLegacy.execute
execute
Definition: LArG4FSStartPointFilterLegacy.py:20
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18