5 from ROOT
import Belle2
10 cdc_hits_pack_unpack_collection =
"CDCHits_test_output"
17 module which checks if two collection of CDCHits are equal
21 """ use a some information to sort the CDCHits list
22 Returns a python-list containing the CDCHits
26 py_list = [x
for x
in unsortedPyStoreArray]
48 cdcHitsPackedUnpacked = self.
sortHits(cdcHitsPackedUnpacked_unsorted)
49 cdcHits = self.
sortHits(cdcHits_unsorted)
51 if not len(cdcHits) == len(cdcHitsPackedUnpacked):
52 B2FATAL(
"CDC Hit count not equal after packing and unpacking")
55 for i
in range(len(cdcHits)):
57 hitPackedUnpacked = cdcHitsPackedUnpacked[i]
59 assert hit.getILayer() == hitPackedUnpacked.getILayer()
60 assert hit.getISuperLayer() == hitPackedUnpacked.getISuperLayer()
61 assert hit.getIWire() == hitPackedUnpacked.getIWire()
62 assert hit.getID() == hitPackedUnpacked.getID()
63 assert hit.getTDCCount() == hitPackedUnpacked.getTDCCount()
64 assert hit.getADCCount() == hitPackedUnpacked.getADCCount()
65 assert hit.getStatus() == hitPackedUnpacked.getStatus()
70 eventinfosetter = register_module(
'EventInfoSetter')
71 eventinfosetter.param({
'evtNumList': [10]})
72 main.add_module(eventinfosetter)
75 particlegun = register_module(
'ParticleGun')
76 particlegun.param(
'pdgCodes', [13, -13])
77 particlegun.param(
'nTracks', 10)
78 main.add_module(particlegun)
82 set_module_parameters(main, type=
"Geometry", useDB=
False, components=[
"CDC"])
85 cdc_packer = register_module(
'CDCPacker')
86 cdc_packer.param(
'cdcHitName',
"CDCHits")
87 main.add_module(cdc_packer)
91 cdc_unpacker = register_module(
'CDCUnpacker')
92 cdc_unpacker.param(
'cdcHitName', cdc_hits_pack_unpack_collection)
93 cdc_unpacker.param(
'enablePrintOut',
False)
94 cdc_unpacker.param(
'pedestalSubtraction',
False)
95 main.add_module(cdc_unpacker)