Belle II Software  release-05-01-25
PackerUnpackerTest Class Reference
Inheritance diagram for PackerUnpackerTest:
Collaboration diagram for PackerUnpackerTest:

Public Member Functions

def sortDigits (self, unsortedPyStoreArray)
 
def event (self)
 

Detailed Description

module which ckecks if two collections of ARICHDigits are equal

Definition at line 14 of file arich_packer_unpacker.py.

Member Function Documentation

◆ event()

def event (   self)
load original ARICHDigits and the packed/unpacked ones, sort and compare them

Definition at line 37 of file arich_packer_unpacker.py.

37  def event(self):
38  """
39  load original ARICHDigits and the packed/unpacked ones, sort and compare them
40  """
41 
42  # direct from simulation
43  digits = Belle2.PyStoreArray("ARICHDigits")
44  # processed by packer and unpacker
45  digitsUnpacked = Belle2.PyStoreArray("ARICHDigitsUnpacked")
46 
47  # sort digits
48  digits_sorted = self.sortDigits(digits)
49  digitsUnpacked_sorted = self.sortDigits(digitsUnpacked)
50 
51  # check the sizes
52  if not len(digits_sorted) == len(digitsUnpacked_sorted):
53  B2FATAL("ARICHDigits: size not equal after packing and unpacking")
54 
55  # check all quantities between the direct and the packed/unpacked
56  for i in range(len(digits_sorted)):
57 
58  digit = digits_sorted[i]
59  digitUnpacked = digitsUnpacked_sorted[i]
60 
61  # check the content of the digit
62  assert digit.getModuleID() == digitUnpacked.getModuleID()
63  assert digit.getChannelID() == digitUnpacked.getChannelID()
64  assert digit.getBitmap() == digitUnpacked.getBitmap()
65 
66 

◆ sortDigits()

def sortDigits (   self,
  unsortedPyStoreArray 
)
Use some digit information to sort the digits
Returns a python-list containing the sorted digits

Definition at line 20 of file arich_packer_unpacker.py.


The documentation for this class was generated from the following file:
ClusterEfficiency.ClusterEfficiency.event
def event(self)
Definition: ClusterEfficiency.py:146
Belle2::PyStoreArray
a (simplified) python wrapper for StoreArray.
Definition: PyStoreArray.h:58