12import simulation
as sim
13from ROOT
import Belle2
15basf2.set_random_seed(321)
16basf2.set_log_level(basf2.LogLevel.INFO)
22 module which checks if two collections of EKLMDigits
and BKLMDigits are
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]
49 load original digits and the packed/unpacked ones, sort
and compare them
62 if not len(klm_digits_sorted) == len(klm_digits_unpacked_sorted):
63 basf2.B2FATAL(
"KLMDigits: size not equal after packing and unpacking")
65 for i
in range(len(klm_digits_sorted)):
67 digit = klm_digits_sorted[i]
68 digit_unpacked = klm_digits_unpacked_sorted[i]
71 assert digit.getSubdetector() == digit_unpacked.getSubdetector()
72 assert digit.getSection() == digit_unpacked.getSection()
73 assert digit.getSector() == digit_unpacked.getSector()
74 assert digit.getLayer() == digit_unpacked.getLayer()
75 assert digit.getPlane() == digit_unpacked.getPlane()
76 assert digit.getStrip() == digit_unpacked.getStrip()
77 assert digit.inRPC() == digit_unpacked.inRPC()
78 assert digit.getCharge() == digit_unpacked.getCharge()
79 assert digit.getCTime() == digit_unpacked.getCTime()
80 assert digit.getTDC() == digit_unpacked.getTDC()
81 assert digit.getFitStatus() == digit_unpacked.getFitStatus()
84main = basf2.create_path()
86eventinfosetter = basf2.register_module(
'EventInfoSetter')
87eventinfosetter.param(
'evtNumList', 50)
88main.add_module(eventinfosetter)
90particlegun = basf2.register_module(
'ParticleGun')
91particlegun.param(
'pdgCodes', [13, -13])
92particlegun.param(
'nTracks', 10)
93particlegun.param(
'momentumParams', [0.5, 4.0])
94main.add_module(particlegun)
96sim.add_simulation(main, components=[
'KLM'])
97basf2.set_module_parameters(main, type=
'Geometry', useDB=
False, components=[
'KLM'])
99klm_packer = basf2.register_module(
'KLMPacker')
100main.add_module(klm_packer)
102unpacker = basf2.register_module(
'KLMUnpacker')
103unpacker.param(
'outputKLMDigitsName',
'KLMDigitsUnpacked')
104main.add_module(unpacker)
108progress = basf2.register_module(
'Progress')
109main.add_module(progress)
112print(basf2.statistics)
A (simplified) python wrapper for StoreArray.
def sort_klm_digits(self, unsortedPyStoreArray)