Belle II Software development
ValidationManyFiguresOfMerit Class Reference
Inheritance diagram for ValidationManyFiguresOfMerit:
ValidationFiguresOfMerit

Public Member Functions

 __str__ (self)
 
 write (self, tdirectory=None)
 
 __setitem__ (self, figure_name, value)
 
 __getitem__ (self, figure_name)
 
 __delitem__ (self, figure_name)
 
 __iter__ (self)
 
 __len__ (self)
 

Public Attributes

 name = root_save_name(name)
 cached name for this figure of merit
 
 description = description
 cached description for this figure of merit
 
 check = check
 cached user-check action for this figure of merit
 
 contact = contact
 cached contact person for this figure of merit
 
 title = title
 cached title for this figure of merit
 
 figures_by_name = collections.OrderedDict()
 cached dictionary of figures for this figure of merit
 

Detailed Description

Create and write an TNtuple with several validation figures of merit

Definition at line 144 of file fom.py.

Member Function Documentation

◆ __delitem__()

__delitem__ ( self,
figure_name )
inherited
Braketed item deletion for figures of merit

Definition at line 128 of file fom.py.

128 def __delitem__(self, figure_name):
129 """Braketed item deletion for figures of merit"""
130
131 del self.figures_by_name[figure_name]
132

◆ __getitem__()

__getitem__ ( self,
figure_name )
inherited
Braketed item lookup for figures of merit

Definition at line 123 of file fom.py.

123 def __getitem__(self, figure_name):
124 """Braketed item lookup for figures of merit"""
125
126 return self.figures_by_name[figure_name]
127

◆ __iter__()

__iter__ ( self)
inherited
Implements the iter() hook as if it was a dictionary.

Definition at line 133 of file fom.py.

133 def __iter__(self):
134 """Implements the iter() hook as if it was a dictionary."""
135
136 return iter(self.figures_by_name)
137

◆ __len__()

__len__ ( self)
inherited
Returns the number of figures of merit assigned. Implements the len() hook.

Definition at line 138 of file fom.py.

138 def __len__(self):
139 """Returns the number of figures of merit assigned. Implements the len() hook."""
140
141 return len(self.figures_by_name)
142
143

◆ __setitem__()

__setitem__ ( self,
figure_name,
value )
inherited
Braketed item assignment for figures of merit

Definition at line 118 of file fom.py.

118 def __setitem__(self, figure_name, value):
119 """Braketed item assignment for figures of merit"""
120
121 self.figures_by_name[figure_name] = value
122

◆ __str__()

__str__ ( self)
Describe myself

Definition at line 147 of file fom.py.

147 def __str__(self):
148 """Describe myself"""
149 return 'Not supported.'
150

◆ write()

write ( self,
tdirectory = None )
Writes the figures of merit as a TNtuple.

Parameters
----------
tdirectory : ROOT.TDirectory, optional
    The directory to which the TNtuple shall be written.
    Defaults to the current directory.

Reimplemented from ValidationFiguresOfMerit.

Definition at line 151 of file fom.py.

151 def write(self, tdirectory=None):
152 """Writes the figures of merit as a TNtuple.
153
154 Parameters
155 ----------
156 tdirectory : ROOT.TDirectory, optional
157 The directory to which the TNtuple shall be written.
158 Defaults to the current directory.
159 """
160 name = self.name
161 figure_names = [root_save_name(key) for key in list(self.figures_by_name.keys())]
162 values = list(self.figures_by_name.values())
163
164 leaf_specification = ':'.join(figure_names)
165 title = self.title or ""
166 ntuple = ROOT.TNtuple(name, title, leaf_specification)
167
168 for value in zip(*values):
169 ntuple.Fill(*value)
170
171 ntuple.SetAlias('Description', self.description)
172 ntuple.SetAlias('Check', self.check)
173 ntuple.SetAlias('Contact', self.contact)
174
175 with root_cd(tdirectory):
176 ntuple.Write()

Member Data Documentation

◆ check

check = check
inherited

cached user-check action for this figure of merit

Definition at line 37 of file fom.py.

◆ contact

contact = contact
inherited

cached contact person for this figure of merit

Definition at line 39 of file fom.py.

◆ description

description = description
inherited

cached description for this figure of merit

Definition at line 35 of file fom.py.

◆ figures_by_name

figures_by_name = collections.OrderedDict()
inherited

cached dictionary of figures for this figure of merit

Definition at line 44 of file fom.py.

◆ name

name = root_save_name(name)
inherited

cached name for this figure of merit

Definition at line 33 of file fom.py.

◆ title

title = title
inherited

cached title for this figure of merit

Definition at line 41 of file fom.py.


The documentation for this class was generated from the following file: