12 from ROOT
import Belle2
13 from simulation
import add_simulation
16 b2.set_random_seed(12345)
22 module which ckecks if two collections of ARICHDigits are equal
27 Use some digit information to sort the digits
28 Returns a python-list containing the sorted digits
32 py_list = [x
for x
in unsortedPyStoreArray]
44 load original ARICHDigits and the packed/unpacked ones, sort and compare them
53 digits_sorted = self.
sortDigitssortDigits(digits)
54 digitsUnpacked_sorted = self.
sortDigitssortDigits(digitsUnpacked)
57 if not len(digits_sorted) == len(digitsUnpacked_sorted):
58 b2.B2FATAL(
"ARICHDigits: size not equal after packing and unpacking")
61 for i
in range(len(digits_sorted)):
63 digit = digits_sorted[i]
64 digitUnpacked = digitsUnpacked_sorted[i]
67 assert digit.getModuleID() == digitUnpacked.getModuleID()
68 assert digit.getChannelID() == digitUnpacked.getChannelID()
69 assert digit.getBitmap() == digitUnpacked.getBitmap()
72 main = b2.create_path()
74 eventinfosetter = b2.register_module(
'EventInfoSetter')
75 eventinfosetter.param({
'evtNumList': [10]})
76 main.add_module(eventinfosetter)
78 particlegun = b2.register_module(
'ParticleGun')
79 particlegun.param(
'momentumGeneration',
'fixed')
80 particlegun.param(
'momentumParams', 6.0)
81 particlegun.param(
'pdgCodes', [13, -13])
82 particlegun.param(
'nTracks', 10)
83 particlegun.param(
'thetaGeneration',
'uniformCos')
84 particlegun.param(
'thetaParams', [20.0, 25.0])
86 main.add_module(particlegun)
88 add_simulation(main, components=[
'ARICH'])
89 b2.set_module_parameters(main, type=
"Geometry", useDB=
False, components=[
"ARICH"])
91 Packer = b2.register_module(
'ARICHPacker')
92 main.add_module(Packer)
94 unPacker = b2.register_module(
'ARICHUnpacker')
96 unPacker.param(
'outputDigitsName',
'ARICHDigitsUnpacked')
97 main.add_module(unPacker)
101 progress = b2.register_module(
'Progress')
102 main.add_module(progress)
A (simplified) python wrapper for StoreArray.
def sortDigits(self, unsortedPyStoreArray)