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

Public Member Functions

def __init__ (self, name, description, iovs, virtual, intolerable, lumi)
 
def name_with_url (self)
 
def content (self)
 

Public Attributes

 nlumi
 
 nlumi_rec
 
 rec_lb_frac
 
 users
 
 bots
 
 nruns
 
 latest_run
 
 lumi
 

Detailed Description

A defect instance. Forms a row in the table.

Definition at line 48 of file dq_defect_info_table.py.

Constructor & Destructor Documentation

◆ __init__()

def dq_defect_info_table.Defect.__init__ (   self,
  name,
  description,
  iovs,
  virtual,
  intolerable,
  lumi 
)

Definition at line 52 of file dq_defect_info_table.py.

52  def __init__(self, name, description, iovs, virtual, intolerable, lumi):
53  if description == name:
54  # Don't bother pretending that there is a description if it is just
55  # equal to the name
56  description = ""
57 
58  (self.name, self.description, self.iovs, self.lumi, self.virtual,
59  self.intolerable) = (
60  name, description, iovs, lumi / 1e6, virtual, intolerable)
61  self.nlumi = sum(iov.length for iov in iovs
62  if iov.since.run == iov.until.run)
63  self.nlumi_rec = sum(iov.length for iov in iovs
64  if iov.recoverable and iov.since.run == iov.until.run)
65  if self.nlumi and self.nlumi_rec:
66  self.rec_lb_frac = "{0:.0%}".format(self.nlumi_rec / self.nlumi)
67  else:
68  self.rec_lb_frac = "-"
69 
70  self.users = set(iov.user for iov in iovs)
71  self.users -= set(["sys:virtual"]) # exclude the "virtual" user.
72  self.bots = set(u for u in self.users if u.startswith("sys:"))
73  self.users -= self.bots
74 
75  runs = iovs.runs
76  self.nruns = len(runs) if runs else "-"
77  self.latest_run = max(runs) if runs else "-"
78  self.lumi = "{0:.3f}".format(self.lumi) if runs else "-"
79 

Member Function Documentation

◆ content()

def dq_defect_info_table.Defect.content (   self)

Definition at line 88 of file dq_defect_info_table.py.

88  def content(self):
89  td = '<td class="icon {class_}"><span>{0}</span></td>'
90  bot_cls = user_cls = ""
91  if len(self.users) == 1: user_cls = "user"
92  if len(self.users) > 1: user_cls = "users"
93  if len(self.bots): bot_cls = "bots"
94 
95  virt_class = "virtual" if self.virtual else "primary"
96  tol_class = "intolerable" if self.intolerable else "tolerable"
97  virt_sort = 1 if self.virtual else 0
98  tol_sort = 1 if self.virtual else 0
99 
100  c = [
101  td.format(virt_sort, class_=virt_class),
102  td.format(tol_sort, class_=tol_class),
103  td.format(", ".join(self.users), class_=user_cls),
104  td.format(", ".join(self.bots), class_=bot_cls),
105  content_string.format(d=self)
106  ]
107  return "".join(c)
108 

◆ name_with_url()

def dq_defect_info_table.Defect.name_with_url (   self)

Definition at line 81 of file dq_defect_info_table.py.

81  def name_with_url(self):
82  if self.virtual or self.intolerable:
83  return '<a href="{0}/{1}.svg">{1}</a>'.format(GRAPH_URL, self.name)
84  else:
85  return "{0}".format(self.name)
86 

Member Data Documentation

◆ bots

dq_defect_info_table.Defect.bots

Definition at line 72 of file dq_defect_info_table.py.

◆ latest_run

dq_defect_info_table.Defect.latest_run

Definition at line 77 of file dq_defect_info_table.py.

◆ lumi

dq_defect_info_table.Defect.lumi

Definition at line 78 of file dq_defect_info_table.py.

◆ nlumi

dq_defect_info_table.Defect.nlumi

Definition at line 61 of file dq_defect_info_table.py.

◆ nlumi_rec

dq_defect_info_table.Defect.nlumi_rec

Definition at line 63 of file dq_defect_info_table.py.

◆ nruns

dq_defect_info_table.Defect.nruns

Definition at line 76 of file dq_defect_info_table.py.

◆ rec_lb_frac

dq_defect_info_table.Defect.rec_lb_frac

Definition at line 66 of file dq_defect_info_table.py.

◆ users

dq_defect_info_table.Defect.users

Definition at line 70 of file dq_defect_info_table.py.


The documentation for this class was generated from the following file:
vtune_athena.format
format
Definition: vtune_athena.py:14
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
python.processes.powheg.ZZj_MiNNLO.ZZj_MiNNLO.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZj_MiNNLO.py:18
grepfile.content
string content
Definition: grepfile.py:56
convertTimingResiduals.sum
sum
Definition: convertTimingResiduals.py:55
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:232
TCS::join
std::string join(const std::vector< std::string > &v, const char c=',')
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/Root/StringUtils.cxx:10