ATLAS Offline Software
Classes | Functions | Variables
python.subdetectors.tile Namespace Reference

Classes

class  Tile
 
class  Tile_NoHighVoltage
 

Functions

def make_blob (string)
 
def decode_status (chan, calib_blob)
 
def decode_tile_iov (i)
 
def decode_tile_iovs (iovs)
 

Variables

 log
 
 Blob = C.gbl.coral.Blob
 
 WHITE
 
 BLACK
 
 GREY
 
 RED
 
 YELLOW
 
 GREEN
 
 TILBA
 
 TILBC
 
 TIEBA
 
 TIEBC
 
list N_CHANNELS_PER_MODULE = [90]*148+[64]*14+[60]+[64]*66+[60]+[64]*46
 

Function Documentation

◆ decode_status()

def python.subdetectors.tile.decode_status (   chan,
  calib_blob 
)
Given a module number `chan` and a `calib_blob` string, return the number
of bad, good and affected channels in this module.

It also returns a dictionary `prob` containing as keys the problem identifier
and values the number of channels affected by that problem.

Definition at line 30 of file tile.py.

30 def decode_status(chan, calib_blob):
31  """
32  Given a module number `chan` and a `calib_blob` string, return the number
33  of bad, good and affected channels in this module.
34 
35  It also returns a dictionary `prob` containing as keys the problem identifier
36  and values the number of channels affected by that problem.
37  """
38 
39  if chan == 1000 or len(calib_blob) <= 24:
40  # chan 1000 is a comment, and calib_blobs less than 24 in length cause
41  # a crash.
42  return None
43 
44  # Decode a Coral BLOB into a string
45  b = make_blob(calib_blob)
47 
48  bad, good, affected = [], [], []
49 
50  probs = {}
51 
52  decoder = TileBchDecoder(bch.getBitPatternVersion())
53  chn_adcs = product(list(range(TileCalibUtils.max_chan())),
55  # Stolen from near
56  # http://alxr.usatlas.bnl.gov/lxr/source/atlas/TileCalorimeter/TileCalib/
57  # TileCalibBlobPython/python/TileBchTools.py#072
58  for chn, adc in chn_adcs:
59  adcBits, chnBits = bch.getData(chn, adc, 0), bch.getData(chn, 2, 0)
60  status = TileBchStatus(decoder.decode(chnBits, adcBits))
61  if status.isBad(): bad.append((chn, adc))
62  if status.isGood(): good.append((chn, adc))
63  if status.isAffected(): affected.append((chn, adc))
64 
65  if not status.isGood():
66  prbs = status.getPrbs()
67  # Build a dictionary
68  for prb in prbs:
69  key = prb, TileBchPrbs.getDescription(prb)
70  probs[key] = probs.get(key, 0) + 1
71 
72  return len(bad), len(good), len(affected), probs
73 

◆ decode_tile_iov()

def python.subdetectors.tile.decode_tile_iov (   i)
Rewrite the TileCalibBlob field to contain the result of `decode_status`

Definition at line 74 of file tile.py.

74 def decode_tile_iov(i):
75  """
76  Rewrite the TileCalibBlob field to contain the result of `decode_status`
77  """
78  return i._replace(TileCalibBlob=decode_status(i.channel, i.TileCalibBlob))
79 

◆ decode_tile_iovs()

def python.subdetectors.tile.decode_tile_iovs (   iovs)

Definition at line 80 of file tile.py.

80 def decode_tile_iovs(iovs):
81  return iovs.empty(decode_tile_iov(i) for i in iovs)
82 

◆ make_blob()

def python.subdetectors.tile.make_blob (   string)

Definition at line 24 of file tile.py.

24 def make_blob(string):
25  b = Blob()
26  b.write(string)
27  b.seek(0)
28  return b
29 

Variable Documentation

◆ BLACK

python.subdetectors.tile.BLACK

Definition at line 19 of file tile.py.

◆ Blob

python.subdetectors.tile.Blob = C.gbl.coral.Blob

Definition at line 17 of file tile.py.

◆ GREEN

python.subdetectors.tile.GREEN

Definition at line 19 of file tile.py.

◆ GREY

python.subdetectors.tile.GREY

Definition at line 19 of file tile.py.

◆ log

python.subdetectors.tile.log

Definition at line 3 of file tile.py.

◆ N_CHANNELS_PER_MODULE

list python.subdetectors.tile.N_CHANNELS_PER_MODULE = [90]*148+[64]*14+[60]+[64]*66+[60]+[64]*46

Definition at line 22 of file tile.py.

◆ RED

python.subdetectors.tile.RED

Definition at line 19 of file tile.py.

◆ TIEBA

python.subdetectors.tile.TIEBA

Definition at line 21 of file tile.py.

◆ TIEBC

python.subdetectors.tile.TIEBC

Definition at line 21 of file tile.py.

◆ TILBA

python.subdetectors.tile.TILBA

Definition at line 21 of file tile.py.

◆ TILBC

python.subdetectors.tile.TILBC

Definition at line 21 of file tile.py.

◆ WHITE

python.subdetectors.tile.WHITE

Definition at line 19 of file tile.py.

◆ YELLOW

python.subdetectors.tile.YELLOW

Definition at line 19 of file tile.py.

TileBchDecoder
Class providing the association between TileCal problems and status word bits.
Definition: TileBchDecoder.h:37
TileCalibDrawerBch::getInstance
static const TileCalibDrawerBch * getInstance(const coral::Blob &blob)
Returns a pointer to a const TileCalibDrawerBch.
Definition: TileCalibDrawerBch.cxx:28
TileBchStatus
Class holding bad channel problems.
Definition: TileBchStatus.h:20
python.subdetectors.tile.Blob
Blob
Definition: tile.py:17
python.subdetectors.tile.decode_status
def decode_status(chan, calib_blob)
Definition: tile.py:30
TileCalibUtils::max_gain
static unsigned int max_gain()
Python compatibility function.
Definition: TileCalibUtils.h:114
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
python.subdetectors.tile.make_blob
def make_blob(string)
Definition: tile.py:24
python.subdetectors.tile.decode_tile_iov
def decode_tile_iov(i)
Definition: tile.py:74
python.subdetectors.tile.decode_tile_iovs
def decode_tile_iovs(iovs)
Definition: tile.py:80
TileCalibUtils::max_chan
static unsigned int max_chan()
Python compatibility function.
Definition: TileCalibUtils.h:112
TileBchPrbs::getDescription
static std::string getDescription(const Prb &prb)
Get description of problem.
Definition: TileBchPrbs.cxx:11