13 from ROOT
import Belle2
18 cdc_hits_pack_unpack_collection =
"CDCHits_test_output"
19 b2.set_random_seed(42)
25 module which checks if two collection of CDCHits are equal
29 """ use a some information to sort the CDCHits list
30 Returns a python-list containing the CDCHits
34 py_list = [x
for x
in unsortedPyStoreArray]
56 cdcHitsPackedUnpacked = self.
sortHitssortHits(cdcHitsPackedUnpacked_unsorted)
57 cdcHits = self.
sortHitssortHits(cdcHits_unsorted)
59 if not len(cdcHits) == len(cdcHitsPackedUnpacked):
60 b2.B2FATAL(
"CDC Hit count not equal after packing and unpacking")
63 for i
in range(len(cdcHits)):
65 hitPackedUnpacked = cdcHitsPackedUnpacked[i]
67 assert hit.getILayer() == hitPackedUnpacked.getILayer()
68 assert hit.getISuperLayer() == hitPackedUnpacked.getISuperLayer()
69 assert hit.getIWire() == hitPackedUnpacked.getIWire()
70 assert hit.getID() == hitPackedUnpacked.getID()
71 assert hit.getTDCCount() == hitPackedUnpacked.getTDCCount()
72 assert hit.getADCCount() == hitPackedUnpacked.getADCCount()
73 assert hit.getStatus() == hitPackedUnpacked.getStatus()
76 main = b2.create_path()
78 eventinfosetter = b2.register_module(
'EventInfoSetter')
79 eventinfosetter.param({
'evtNumList': [10]})
80 main.add_module(eventinfosetter)
83 particlegun = b2.register_module(
'ParticleGun')
84 particlegun.param(
'pdgCodes', [13, -13])
85 particlegun.param(
'nTracks', 10)
86 main.add_module(particlegun)
90 b2.set_module_parameters(main, type=
"Geometry", useDB=
False, components=[
"CDC"])
93 cdc_packer = b2.register_module(
'CDCPacker')
94 cdc_packer.param(
'cdcHitName',
"CDCHits")
95 main.add_module(cdc_packer)
99 cdc_unpacker = b2.register_module(
'CDCUnpacker')
100 cdc_unpacker.param(
'cdcHitName', cdc_hits_pack_unpack_collection)
101 cdc_unpacker.param(
'enablePrintOut',
False)
102 cdc_unpacker.param(
'pedestalSubtraction',
False)
103 main.add_module(cdc_unpacker)
A (simplified) python wrapper for StoreArray.
def sortHits(self, unsortedPyStoreArray)
def add_simulation(path, components=None, bkgfiles=None, bkgOverlay=True, forceSetPXDDataReduction=False, usePXDDataReduction=True, cleanupPXDDataReduction=True, generate_2nd_cdc_hits=False, simulateT0jitter=True, isCosmics=False, FilterEvents=False, usePXDGatedMode=False, skipExperimentCheckForBG=False, save_slow_pions_in_mc=False)