13from ROOT
import Belle2
17import PXDROIUnpackerModule
25 module which checks if the roy payload
from HLT can be created
and depacked correctly
30 Returns a python-list containing the ROIs
34 py_list = list(unsortedPyStoreArray)
37 return sorted(py_list,
46 """ load the PXD Digits of the simulation and the packed/unpacked ones
51 b2.B2FATAL(
"ROIs not in file")
55 if not unpackedroisuns:
56 b2.B2FATAL(
"PXDROIsPayHLT not in file")
65 unpackedrois = self.
sortROIs(unpackedroisuns)
75 print(f
"Comparing {len(orgrois)} ROIs ")
98 for i
in range(len(orgrois)):
100 if i != 0
and f(org) == f(orgrois[i - 1]):
101 b2.B2WARNING(
"Found the same ROI a second time (Double ROI)!")
103 f
"Check ${org.getSensorID().getID():X} {int(org.getMinUid()):3d} {int(org.getMaxUid()):3d} " +
104 f
"{int(org.getMinVid()):3d} {int(org.getMaxVid()):3d}")
105 if i == 0
or f(org) != f(orgrois[i - 1]):
106 if j == len(unpackedrois):
107 b2.B2FATAL(
"Unpacked ROIs comparison exceeds array limit!")
110 unp = unpackedrois[j]
113 f
"Check Org ${org.getSensorID().getID():X} {org.getMinUid():3d} {org.getMaxUid():3d} " +
114 f
"{org.getMinVid():3d} {org.getMaxVid():3d} Unp ${unp.getSensorID().getID():X} {unp.getMinUid():3d} " +
115 f
"{unp.getMaxUid():3d} {unp.getMinVid():3d} {unp.getMaxVid():3d}")
117 if unp.getMinUid() == 0
and unp.getMinVid() == 0
and unp.getMaxUid() == 250 - 1
and unp.getMaxVid() == 768 - 1:
118 b2.B2INFO(
"Full size ROI")
119 if org.getSensorID().getID() != unp.getSensorID().getID():
120 b2.B2INFO(
"DHHID changed")
121 if j == len(unpackedrois):
122 b2.B2FATAL(
"Unpacked ROIs comparison exceeds array limit!")
125 unp = unpackedrois[j]
127 if not (unp.getMinUid() == 0
128 and unp.getMinVid() == 0
129 and unp.getMaxUid() == 250 - 1
130 and unp.getMaxVid() == 768 - 1):
131 assert org.getSensorID().getID() == unp.getSensorID().getID()
132 assert org.getMinUid() == unp.getMinUid()
133 assert org.getMaxUid() == unp.getMaxUid()
134 assert org.getMinVid() == unp.getMinVid()
135 assert org.getMaxVid() == unp.getMaxVid()
140particlegun = b2.register_module(
'ParticleGun')
141particlegun.param(
'pdgCodes', [13, -13])
142particlegun.param(
'nTracks', 40)
145eventinfosetter = b2.register_module(
'EventInfoSetter')
146eventinfosetter.param({
'evtNumList': [10]})
148main = b2.create_path()
150main.add_module(eventinfosetter)
151main.add_module(particlegun)
155 usePXDDataReduction=
True, cleanupPXDDataReduction=
False)
156b2.set_module_parameters(main, type=
"Geometry", useDB=
False, components=[
'PXD',
'SVD',
'MagneticFieldConstant4LimitedRSVD'])
158roiPayloadAssembler = b2.register_module(
'ROIPayloadAssembler')
159roiPayloadAssembler.param({
"ROIListName":
"ROIs",
"SendAllDownscaler": 0,
160 "SendROIsDownscaler": 0,
"CutNrROIs": 5,
"AcceptAll":
True})
162main.add_module(roiPayloadAssembler)
165main.add_module(
'Progress')
A (simplified) python wrapper for StoreArray.
def sortROIs(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, save_all_charged_particles_in_mc=False)