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 49 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 53 of file dq_defect_info_table.py.

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

Member Function Documentation

◆ content()

def dq_defect_info_table.Defect.content (   self)

Definition at line 89 of file dq_defect_info_table.py.

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

◆ name_with_url()

def dq_defect_info_table.Defect.name_with_url (   self)

Definition at line 82 of file dq_defect_info_table.py.

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

Member Data Documentation

◆ bots

dq_defect_info_table.Defect.bots

Definition at line 73 of file dq_defect_info_table.py.

◆ latest_run

dq_defect_info_table.Defect.latest_run

Definition at line 78 of file dq_defect_info_table.py.

◆ lumi

dq_defect_info_table.Defect.lumi

Definition at line 79 of file dq_defect_info_table.py.

◆ nlumi

dq_defect_info_table.Defect.nlumi

Definition at line 62 of file dq_defect_info_table.py.

◆ nlumi_rec

dq_defect_info_table.Defect.nlumi_rec

Definition at line 64 of file dq_defect_info_table.py.

◆ nruns

dq_defect_info_table.Defect.nruns

Definition at line 77 of file dq_defect_info_table.py.

◆ rec_lb_frac

dq_defect_info_table.Defect.rec_lb_frac

Definition at line 67 of file dq_defect_info_table.py.

◆ users

dq_defect_info_table.Defect.users

Definition at line 71 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
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
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18