Belle II Software light-2406-ragdoll
TestCopyLists Class Reference
Inheritance diagram for TestCopyLists:
Collaboration 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)
 

Protected Member Functions

def _count (self, listname)
 

Detailed Description

Analyse the output of ``run_copylists``

Definition at line 111 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 114 of file copylists.py.

114 def _count(self, listname):
115 """Open the ntuple output and count the number of entries in the list."""
116 df = uproot.open("ntuple.root")[listname].arrays(library="pd")
117 return len(df)
118

◆ 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 141 of file copylists.py.

141 def test_different_association_of_neutrals_same_number_of_daughters(self):
142 """Different self-conjugated particles are daughters of charge-conjugated mother particles.
143 The two mother particles have the same amount of daughters."""
144 self.assertEqual(self._count("KS") + self._count("pi0"), self._count("KSpi0"))
145

◆ 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 131 of file copylists.py.

131 def test_different_daughter_order(self):
132 """Merging two lists with daughters in a different order should not double count."""
133 self.assertEqual(self._count("e"), self._count("e"))
134 self.assertEqual(self._count("e"), self._count("ef"))
135

◆ 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 146 of file copylists.py.

146 def test_ignore_mother_flavor(self):
147 """Particle lists can be merged ignoring the flavor of the mother particle. If both particle
148 lists decay into the same final state, the size of the combined list is identical to one
149 individual list. Otherwise, it's the sum of the two."""
150 self.assertEqual(self._count("D0"), self._count("ignore"))
151 self.assertEqual(self._count("D0") + self._count("anti"), self._count("flavor"))
152
153

◆ 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 125 of file copylists.py.

125 def test_merge_two_lists_with_different_mdst_objects(self):
126 """Merging two lists with different daughters but with the same mdst
127 object should include each of them twice."""
128 self.assertEqual(self._count("c"), self._count("d"))
129 self.assertEqual(self._count("c") + self._count("d"), self._count("cd"))
130

◆ 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 119 of file copylists.py.

119 def test_merge_two_lists_with_identical_daughters(self):
120 """Merging two lists with identical daughters should not double count."""
121 self.assertEqual(self._count("a"), self._count("b"))
122 self.assertEqual(self._count("a"), self._count("ab"))
123 self.assertEqual(self._count("b"), self._count("ab"))
124

◆ 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 136 of file copylists.py.

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

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