12from ROOT
import Belle2
17cdc_hits_pack_unpack_collection =
"CDCHits_test_output"
24 module which checks if two collection of CDCHits are equal
28 """ use a some information to sort the CDCHits list
29 Returns a python-list containing the CDCHits
33 py_list = [x
for x
in unsortedPyStoreArray]
55 cdcHitsPackedUnpacked = self.
sortHits(cdcHitsPackedUnpacked_unsorted)
56 cdcHits = self.
sortHits(cdcHits_unsorted)
58 if not len(cdcHits) == len(cdcHitsPackedUnpacked):
59 b2.B2FATAL(
"CDC Hit count not equal after packing and unpacking")
62 for i
in range(len(cdcHits)):
64 hitPackedUnpacked = cdcHitsPackedUnpacked[i]
66 assert hit.getILayer() == hitPackedUnpacked.getILayer()
67 assert hit.getISuperLayer() == hitPackedUnpacked.getISuperLayer()
68 assert hit.getIWire() == hitPackedUnpacked.getIWire()
69 assert hit.getID() == hitPackedUnpacked.getID()
70 assert hit.getTDCCount() == hitPackedUnpacked.getTDCCount()
71 assert hit.getADCCount() == hitPackedUnpacked.getADCCount()
72 assert hit.getStatus() == hitPackedUnpacked.getStatus()
75main = b2.create_path()
77eventinfosetter = b2.register_module(
'EventInfoSetter')
78eventinfosetter.param({
'evtNumList': [10]})
79main.add_module(eventinfosetter)
82particlegun = b2.register_module(
'ParticleGun')
83particlegun.param(
'pdgCodes', [13, -13])
84particlegun.param(
'nTracks', 10)
85main.add_module(particlegun)
89b2.set_module_parameters(main, type=
"Geometry", useDB=
False, components=[
"CDC"])
92cdc_packer = b2.register_module(
'CDCPacker')
93cdc_packer.param(
'cdcHitName',
"CDCHits")
94main.add_module(cdc_packer)
98cdc_unpacker = b2.register_module(
'CDCUnpacker')
99cdc_unpacker.param(
'cdcHitName', cdc_hits_pack_unpack_collection)
100cdc_unpacker.param(
'enablePrintOut',
False)
101cdc_unpacker.param(
'pedestalSubtraction',
False)
102main.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)