ATLAS Offline Software
Loading...
Searching...
No Matches
python.subdetectors.tile Namespace Reference

Classes

class  Tile
class  Tile_NoHighVoltage

Functions

 make_blob (string)
 decode_status (chan, calib_blob)
 decode_tile_iov (i)
 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()

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.

30def 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())),
54 list(range(TileCalibUtils.max_gain())))
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
Class providing the association between TileCal problems and status word bits.
static std::string getDescription(const Prb &prb)
Get description of problem.
Class holding bad channel problems.
static const TileCalibDrawerBch * getInstance(const coral::Blob &blob)
Returns a pointer to a const TileCalibDrawerBch.
static unsigned int max_gain()
Python compatibility function.
static unsigned int max_chan()
Python compatibility function.

◆ decode_tile_iov()

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.

74def 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()

python.subdetectors.tile.decode_tile_iovs ( iovs)

Definition at line 80 of file tile.py.

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

◆ make_blob()

python.subdetectors.tile.make_blob ( string)

Definition at line 24 of file tile.py.

24def 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.