13 from ROOT
import Belle2
14 from simulation
import add_simulation
17 b2.set_random_seed(12345)
23 module which ckecks if two collections of ARICHDigits are equal
28 Use some digit information to sort the digits
29 Returns a python-list containing the sorted digits
33 py_list = [x
for x
in unsortedPyStoreArray]
45 load original ARICHDigits and the packed/unpacked ones, sort and compare them
54 digits_sorted = self.
sortDigitssortDigits(digits)
55 digitsUnpacked_sorted = self.
sortDigitssortDigits(digitsUnpacked)
58 if not len(digits_sorted) == len(digitsUnpacked_sorted):
59 b2.B2FATAL(
"ARICHDigits: size not equal after packing and unpacking")
62 for i
in range(len(digits_sorted)):
64 digit = digits_sorted[i]
65 digitUnpacked = digitsUnpacked_sorted[i]
68 assert digit.getModuleID() == digitUnpacked.getModuleID()
69 assert digit.getChannelID() == digitUnpacked.getChannelID()
70 assert digit.getBitmap() == digitUnpacked.getBitmap()
73 main = b2.create_path()
75 eventinfosetter = b2.register_module(
'EventInfoSetter')
76 eventinfosetter.param({
'evtNumList': [10]})
77 main.add_module(eventinfosetter)
79 particlegun = b2.register_module(
'ParticleGun')
80 particlegun.param(
'momentumGeneration',
'fixed')
81 particlegun.param(
'momentumParams', 6.0)
82 particlegun.param(
'pdgCodes', [13, -13])
83 particlegun.param(
'nTracks', 10)
84 particlegun.param(
'thetaGeneration',
'uniformCos')
85 particlegun.param(
'thetaParams', [20.0, 25.0])
87 main.add_module(particlegun)
89 add_simulation(main, components=[
'ARICH'])
90 b2.set_module_parameters(main, type=
"Geometry", useDB=
False, components=[
"ARICH"])
92 Packer = b2.register_module(
'ARICHPacker')
93 main.add_module(Packer)
95 unPacker = b2.register_module(
'ARICHUnpacker')
97 unPacker.param(
'outputDigitsName',
'ARICHDigitsUnpacked')
98 main.add_module(unPacker)
102 progress = b2.register_module(
'Progress')
103 main.add_module(progress)
a (simplified) python wrapper for StoreArray.
def sortDigits(self, unsortedPyStoreArray)