Belle II Software  release-06-00-14
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 20 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 43 of file arich_packer_unpacker.py.

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

◆ sortDigits()

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

Definition at line 26 of file arich_packer_unpacker.py.


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