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

Public Member Functions

def sortHits (self, unsortedPyStoreArray)
 
def event (self)
 

Detailed Description

module which checks if two collection of CDCHits are equal

Definition at line 22 of file cdc_packer_unpacker.py.

Member Function Documentation

◆ event()

def event (   self)
event function

Definition at line 44 of file cdc_packer_unpacker.py.

44  def event(self):
45  """
46  event function
47  """
48 
49  # load the cdcHits and the collection which results from the packer and unpacker
50  # processed by packer and unpacker
51  cdcHitsPackedUnpacked_unsorted = Belle2.PyStoreArray(cdc_hits_pack_unpack_collection)
52  # direct from simulation
53  cdcHits_unsorted = Belle2.PyStoreArray(cdc_hits)
54 
55  # sort the hits, because they have been shuffled in the packing/unpacking process
56  cdcHitsPackedUnpacked = self.sortHits(cdcHitsPackedUnpacked_unsorted)
57  cdcHits = self.sortHits(cdcHits_unsorted)
58 
59  if not len(cdcHits) == len(cdcHitsPackedUnpacked):
60  b2.B2FATAL("CDC Hit count not equal after packing and unpacking")
61 
62  # check all quantities between the direct and the packed/unpacked CDC hit
63  for i in range(len(cdcHits)):
64  hit = cdcHits[i]
65  hitPackedUnpacked = cdcHitsPackedUnpacked[i]
66 
67  assert hit.getILayer() == hitPackedUnpacked.getILayer()
68  assert hit.getISuperLayer() == hitPackedUnpacked.getISuperLayer()
69  assert hit.getIWire() == hitPackedUnpacked.getIWire()
70  assert hit.getID() == hitPackedUnpacked.getID()
71  assert hit.getTDCCount() == hitPackedUnpacked.getTDCCount()
72  assert hit.getADCCount() == hitPackedUnpacked.getADCCount()
73  assert hit.getStatus() == hitPackedUnpacked.getStatus()
74 
75 
A (simplified) python wrapper for StoreArray.
Definition: PyStoreArray.h:72

◆ sortHits()

def sortHits (   self,
  unsortedPyStoreArray 
)
 use a some information to sort the CDCHits list
    Returns a python-list containing the CDCHits

Definition at line 28 of file cdc_packer_unpacker.py.


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