12from ROOT
import Belle2
13from simulation
import add_simulation
16b2.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
54 digitsUnpacked_sorted = self.
sortDigits(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()
72main = b2.create_path()
74eventinfosetter = b2.register_module(
'EventInfoSetter')
75eventinfosetter.param({
'evtNumList': [10]})
76main.add_module(eventinfosetter)
78particlegun = b2.register_module(
'ParticleGun')
79particlegun.param(
'momentumGeneration',
'fixed')
80particlegun.param(
'momentumParams', 6.0)
81particlegun.param(
'pdgCodes', [13, -13])
82particlegun.param(
'nTracks', 10)
83particlegun.param(
'thetaGeneration',
'uniformCos')
84particlegun.param(
'thetaParams', [20.0, 25.0])
86main.add_module(particlegun)
88add_simulation(main, components=[
'ARICH'])
89b2.set_module_parameters(main, type=
"Geometry", useDB=
False, components=[
"ARICH"])
91Packer = b2.register_module(
'ARICHPacker')
92main.add_module(Packer)
94unPacker = b2.register_module(
'ARICHUnpacker')
96unPacker.param(
'outputDigitsName',
'ARICHDigitsUnpacked')
97main.add_module(unPacker)
101progress = b2.register_module(
'Progress')
102main.add_module(progress)
A (simplified) python wrapper for StoreArray.
def sortDigits(self, unsortedPyStoreArray)