Belle II Software development
InjectPXDDigits Class Reference
Inheritance diagram for InjectPXDDigits:

Public Member Functions

 __init__ (self, digits_arrays)
 
 initialize (self)
 
 event (self)
 

Public Attributes

 digits_arrays = digits_arrays
 Array of digits.
 
 pxddigits = PyStoreArray("PXDDigits", DataStore.c_Event)
 PyStoreArray.
 
 it_digits = iter(self.digits_arrays)
 Iterator of the digits array.
 

Detailed Description

Simple basf2 module to fill a PyStoreArray with PXD digits.
Takes as arguments the digits to fill the PyStoreArray with,
and then for each event it calls the fillArray function.

Definition at line 38 of file fill_array_example.py.

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
digits_arrays )
Initialization
--------------
digits_array: array of digits with lenght equal to the number of events

Definition at line 45 of file fill_array_example.py.

45 def __init__(self, digits_arrays):
46 '''
47 Initialization
48 --------------
49 digits_array: array of digits with lenght equal to the number of events
50 '''
51
52 self.digits_arrays = digits_arrays
53 super().__init__()
54

Member Function Documentation

◆ event()

event ( self)
For each event take the corresponding entry of digits_array and write it
into the PyStoreArray

Definition at line 65 of file fill_array_example.py.

65 def event(self):
66 '''
67 For each event take the corresponding entry of digits_array and write it
68 into the PyStoreArray
69 '''
70 digits = next(self.it_digits)
71 keys = ["sensorID", "uCellID", "vCellID", "charge"]
72 sensorID, uCellID, vCellID, charge = [
73 # it's important we ensure the correct type here (unsigned short)
74 digits[key].astype(np.ushort) for key in keys]
75
76 # call the function fillArray to fill the PyStoreArray
77 # Note: this function appends the new digits to the array if it is non empty
78 self.pxddigits.fillArray(uCellID=uCellID, vCellID=vCellID, sensorID=sensorID, charge=charge)
79
80

◆ initialize()

initialize ( self)
Initialization of the PyStoreArray and registration in the DataStore

Definition at line 55 of file fill_array_example.py.

55 def initialize(self):
56 '''
57 Initialization of the PyStoreArray and registration in the DataStore
58 '''
59
60 self.pxddigits = PyStoreArray("PXDDigits", DataStore.c_Event)
61 self.pxddigits.registerInDataStore("PXDDigits")
62
63 self.it_digits = iter(self.digits_arrays)
64

Member Data Documentation

◆ digits_arrays

digits_arrays = digits_arrays

Array of digits.

Definition at line 52 of file fill_array_example.py.

◆ it_digits

it_digits = iter(self.digits_arrays)

Iterator of the digits array.

Definition at line 63 of file fill_array_example.py.

◆ pxddigits

pxddigits = PyStoreArray("PXDDigits", DataStore.c_Event)

PyStoreArray.

Definition at line 60 of file fill_array_example.py.


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