17from ROOT.Belle2
import PyStoreArray, DataStore
27 for _
in range(n_events):
29 sensor_ids = np.linspace(0, 40, ndigits, dtype=int)
30 ucell_ids = np.linspace(0, 250, ndigits, dtype=int)
31 vcell_ids = np.linspace(0, 756, ndigits, dtype=int)
32 charges = np.linspace(0, 255, ndigits, dtype=int)
33 digits.append({
"uCellID": ucell_ids,
"vCellID": vcell_ids,
"charge": charges,
"sensorID": sensor_ids})
40 Simple basf2 module to fill a PyStoreArray with PXD digits.
41 Takes as arguments the digits to fill the PyStoreArray with,
42 and then for each event it calls the fillArray function.
49 digits_array: array of digits with lenght equal to the number of events
57 Initialization of the PyStoreArray and registration in the DataStore
60 self.
pxddigits = PyStoreArray(
"PXDDigits", DataStore.c_Event)
61 self.
pxddigits.registerInDataStore(
"PXDDigits")
67 For each event take the corresponding entry of digits_array and write it
71 keys = [
"sensorID",
"uCellID",
"vCellID",
"charge"]
72 sensorID, uCellID, vCellID, charge = [
74 digits[key].astype(np.ushort)
for key
in keys]
78 self.
pxddigits.fillArray(uCellID=uCellID, vCellID=vCellID, sensorID=sensorID, charge=charge)
81digits = create_digits()
82path = basf2.create_path()
83path.add_module(
"EventInfoSetter", evtNumList=len(digits))
84path.add_module(
"Geometry")
86path.add_module(
"RootOutput", branchNames=[
"PXDDigits"], outputFileName=
"digits_test.root")
87path.add_module(
"Progress")
digits_arrays
Array of digits.
__init__(self, digits_arrays)
it_digits
Iterator of the digits array.