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
41
42 return None
43
44
45 b = make_blob(calib_blob)
47
48 bad, good, affected = [], [], []
49
50 probs = {}
51
55
56
57
58 for chn, adc in chn_adcs:
59 adcBits, chnBits = bch.getData(chn, adc, 0), bch.getData(chn, 2, 0)
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
68 for prb in prbs:
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.