Belle II Software  release-05-01-25
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 14 of file cdc_packer_unpacker.py.

Member Function Documentation

◆ event()

def event (   self)
event function

Definition at line 36 of file cdc_packer_unpacker.py.

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

◆ sortHits()

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

Definition at line 20 of file cdc_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