8 from ROOT
import Belle2
13 import PXDROIUnpackerModule
21 module which checks if the roy payload from HLT can be created and depacked correctly
26 Returns a python-list containing the ROIs
30 py_list = list(unsortedPyStoreArray)
33 return sorted(py_list,
42 """ load the PXD Digits of the simulation and the packed/unpacked ones
47 B2FATAL(
"ROIs not in file")
51 if not unpackedroisuns:
52 B2FATAL(
"PXDROIsPayHLT not in file")
61 unpackedrois = self.
sortROIs(unpackedroisuns)
71 print(
"Comparing %i ROIs " % len(orgrois))
94 for i
in range(len(orgrois)):
96 if i != 0
and f(org) == f(orgrois[i - 1]):
97 B2WARNING(
"Found the same ROI a second time (Double ROI)!")
99 "Check Org $%X %3d %3d %3d %3d Unp $%X %3d %3d %3d %3d" %
100 (org.getSensorID().
getID(),
105 unp.getSensorID().
getID(),
110 if i == 0
or f(org) != f(orgrois[i - 1]):
111 if j == len(unpackedrois):
112 B2FATAL(
"Unpacked ROIs comparison exceeds array limit!")
115 unp = unpackedrois[j]
118 "Check Org $%X %3d %3d %3d %3d Unp $%X %3d %3d %3d %3d" %
119 (org.getSensorID().
getID(),
124 unp.getSensorID().
getID(),
130 if unp.getMinUid() == 0
and unp.getMinVid() == 0
and unp.getMaxUid() == 250 - 1
and unp.getMaxVid() == 768 - 1:
131 B2INFO(
"Full size ROI")
132 if org.getSensorID().
getID() != unp.getSensorID().
getID():
133 B2INFO(
"DHHID changed")
134 if j == len(unpackedrois):
135 B2FATAL(
"Unpacked ROIs comparison exceeds array limit!")
138 unp = unpackedrois[j]
140 if not(unp.getMinUid() == 0
and unp.getMinVid() == 0
and unp.getMaxUid() == 250 - 1
and unp.getMaxVid() == 768 - 1):
141 assert org.getSensorID().
getID() == unp.getSensorID().
getID()
142 assert org.getMinUid() == unp.getMinUid()
143 assert org.getMaxUid() == unp.getMaxUid()
144 assert org.getMinVid() == unp.getMinVid()
145 assert org.getMaxVid() == unp.getMaxVid()
150 particlegun = register_module(
'ParticleGun')
151 particlegun.param(
'pdgCodes', [13, -13])
152 particlegun.param(
'nTracks', 40)
155 eventinfosetter = register_module(
'EventInfoSetter')
156 eventinfosetter.param({
'evtNumList': [10]})
158 progress = register_module(
'Progress')
162 main.add_module(eventinfosetter)
163 main.add_module(particlegun)
167 usePXDDataReduction=
True, cleanupPXDDataReduction=
False)
168 set_module_parameters(main, type=
"Geometry", useDB=
False, components=[
'PXD',
'SVD',
'MagneticFieldConstant4LimitedRSVD'])
170 roiPayloadAssembler = register_module(
'ROIPayloadAssembler')
171 roiPayloadAssembler.param({
"ROIListName":
"ROIs",
"SendAllDownscaler": 0,
172 "SendROIsDownscaler": 0,
"CutNrROIs": 5,
"AcceptAll":
True})
174 main.add_module(roiPayloadAssembler)
176 main.add_module(progress)