Belle II Software  release-08-01-10
MVAExtraInfoChecker Class Reference
Inheritance diagram for MVAExtraInfoChecker:
Collaboration diagram for MVAExtraInfoChecker:

Public Member Functions

def initialize (self)
 
def event (self)
 

Public Attributes

 plist
 Particle list object.
 
 comp_plist
 Composite particle list object.
 
 eventExtraInfo
 event extra info object
 

Detailed Description

Check if the extra Info values are correctly overwritten

Definition at line 24 of file test_MVAExpertModule.py.

Member Function Documentation

◆ event()

def event (   self)
check the extra info names are what we expect!

Definition at line 37 of file test_MVAExpertModule.py.

37  def event(self):
38  """check the extra info names are what we expect!"""
39  for multiclass in [False, True]:
40  for multiexpert_prefix in ['multi_', '']:
41  for name, value in [('low_never', 0.5),
42  ('low_always', 0.0),
43  ('low_higher', 0.5),
44  ('low_lower', 0.0),
45 
46  ('high_never', 0.5),
47  ('high_always', 1.0),
48  ('high_higher', 1.0),
49  ('high_lower', 0.5)]:
50  name = multiexpert_prefix+name
51  if multiclass:
52  for index in range(3):
53  compare_val = index + value
54  extra_info_name = f'multiclass_{name}_{index}'
55  # FSP use case
56  for p in self.plist:
57  ei_value = p.getExtraInfo(extra_info_name)
58  assert ei_value == compare_val,\
59  f'ExtraInfo "{extra_info_name}" value "{ei_value}" not what was expected {compare_val}'
60  # Decay string use case
61  for p in self.comp_plist:
62  if 'multi_' in extra_info_name:
63  continue
64  ei_value = p.getDaughter(0).getExtraInfo(extra_info_name)
65  assert ei_value == compare_val,\
66  f'ExtraInfo "{extra_info_name}" value "{ei_value}" not what was expected {compare_val}'
67 
68  ei_value = self.eventExtraInfo.getExtraInfo(extra_info_name)
69  assert ei_value == compare_val,\
70  f'eventExtraInfo "{extra_info_name}" value "{ei_value}" not what was expected {compare_val}'
71  else:
72  extra_info_name = name
73  # FSP use case
74  for p in self.plist:
75  ei_value = p.getExtraInfo(name)
76  assert ei_value == value,\
77  f'ExtraInfo "{name}" value "{ei_value}" not what was expected "{value}"'
78  # Decay string use case
79  for p in self.comp_plist:
80  if 'multi_' in extra_info_name:
81  continue
82  ei_value = p.getDaughter(0).getExtraInfo(name)
83  assert ei_value == value,\
84  f'ExtraInfo "{name}" value "{ei_value}" not what was expected "{value}"'
85  ei_value = self.eventExtraInfo.getExtraInfo(name)
86  assert ei_value == value,\
87  f'eventExtraInfo "{name}" value "{ei_value}" not what was expected "{value}"'
88 
89 
90 # prepare the weightfiles

◆ initialize()

def initialize (   self)
Create particle list object

Definition at line 27 of file test_MVAExpertModule.py.


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