Belle II Software development
TestCopyLists Class Reference
Inheritance diagram for TestCopyLists:

Public Member Functions

def test_merge_two_lists_with_identical_daughters (self)
 
def test_merge_two_lists_with_different_mdst_objects (self)
 
def test_different_daughter_order (self)
 
def test_neutrals_in_decays_to_charge_conjugated_daughters (self)
 
def test_different_association_of_neutrals_same_number_of_daughters (self)
 
def test_ignore_mother_flavor (self)
 
def test_neutrons (self)
 

Protected Member Functions

def _count (self, listname)
 

Detailed Description

Analyse the output of ``run_copylists``

Definition at line 118 of file copylists.py.

Member Function Documentation

◆ _count()

def _count (   self,
  listname 
)
protected
Open the ntuple output and count the number of entries in the list.

Definition at line 121 of file copylists.py.

121 def _count(self, listname):
122 """Open the ntuple output and count the number of entries in the list."""
123 df = uproot.open("ntuple.root")[listname].arrays(library="pd")
124 return len(df)
125

◆ test_different_association_of_neutrals_same_number_of_daughters()

def test_different_association_of_neutrals_same_number_of_daughters (   self)
Different self-conjugated particles are daughters of charge-conjugated mother particles.
The two mother particles have the same amount of daughters.

Definition at line 148 of file copylists.py.

148 def test_different_association_of_neutrals_same_number_of_daughters(self):
149 """Different self-conjugated particles are daughters of charge-conjugated mother particles.
150 The two mother particles have the same amount of daughters."""
151 self.assertEqual(self._count("KS") + self._count("pi0"), self._count("KSpi0"))
152

◆ test_different_daughter_order()

def test_different_daughter_order (   self)
Merging two lists with daughters in a different order should not double count.

Definition at line 138 of file copylists.py.

138 def test_different_daughter_order(self):
139 """Merging two lists with daughters in a different order should not double count."""
140 self.assertEqual(self._count("e"), self._count("e"))
141 self.assertEqual(self._count("e"), self._count("ef"))
142

◆ test_ignore_mother_flavor()

def test_ignore_mother_flavor (   self)
Particle lists can be merged ignoring the flavor of the mother particle. If both particle
lists decay into the same final state, the size of the combined list is identical to one
individual list. Otherwise, it's the sum of the two.

Definition at line 153 of file copylists.py.

153 def test_ignore_mother_flavor(self):
154 """Particle lists can be merged ignoring the flavor of the mother particle. If both particle
155 lists decay into the same final state, the size of the combined list is identical to one
156 individual list. Otherwise, it's the sum of the two."""
157 self.assertEqual(self._count("D0"), self._count("ignore"))
158 self.assertEqual(self._count("D0") + self._count("anti"), self._count("flavor"))
159

◆ test_merge_two_lists_with_different_mdst_objects()

def test_merge_two_lists_with_different_mdst_objects (   self)
Merging two lists with different daughters but with the same mdst
object should include each of them twice.

Definition at line 132 of file copylists.py.

132 def test_merge_two_lists_with_different_mdst_objects(self):
133 """Merging two lists with different daughters but with the same mdst
134 object should include each of them twice."""
135 self.assertEqual(self._count("c"), self._count("d"))
136 self.assertEqual(self._count("c") + self._count("d"), self._count("cd"))
137

◆ test_merge_two_lists_with_identical_daughters()

def test_merge_two_lists_with_identical_daughters (   self)
Merging two lists with identical daughters should not double count.

Definition at line 126 of file copylists.py.

126 def test_merge_two_lists_with_identical_daughters(self):
127 """Merging two lists with identical daughters should not double count."""
128 self.assertEqual(self._count("a"), self._count("b"))
129 self.assertEqual(self._count("a"), self._count("ab"))
130 self.assertEqual(self._count("b"), self._count("ab"))
131

◆ test_neutrals_in_decays_to_charge_conjugated_daughters()

def test_neutrals_in_decays_to_charge_conjugated_daughters (   self)
Self-conjugated particles can be daughters of both charge-conjugated mother particles.
Those multiple candidates are no duplicates and copying the particle list should not remove them.

Definition at line 143 of file copylists.py.

143 def test_neutrals_in_decays_to_charge_conjugated_daughters(self):
144 """Self-conjugated particles can be daughters of both charge-conjugated mother particles.
145 Those multiple candidates are no duplicates and copying the particle list should not remove them."""
146 self.assertEqual(self._count("g") + self._count("h"), self._count("gh"))
147

◆ test_neutrons()

def test_neutrons (   self)
Merging a neutron and anti-neutron list should keep only the candidates of the first list

Definition at line 160 of file copylists.py.

160 def test_neutrons(self):
161 """Merging a neutron and anti-neutron list should keep only the candidates of the first list"""
162 self.assertEqual(self._count("n0"), self._count("nbar"))
163 self.assertEqual(self._count("n0"), self._count("allneutrons"))
164
165

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