16 def add_pxd_unpacker(path):
17 pxdunpacker = b2.register_module(
'PXDUnpacker')
18 path.add_module(pxdunpacker)
20 pxderrorcheck = b2.register_module(
'PXDPostErrorChecker')
21 path.add_module(pxderrorcheck)
23 pxdhitsorter = b2.register_module(
'PXDRawHitSorter')
24 path.add_module(pxdhitsorter)
25 if 'ActivatePXDPixelMasker' not in [e.name()
for e
in path.modules()]:
26 path.add_module(
'ActivatePXDPixelMasker')
29 def add_pxd_packer(path):
30 pxdpacker = b2.register_module(
'PXDPacker')
31 pxdpacker.param(
'dhe_to_dhc', [
98 path.add_module(pxdpacker)
101 def add_pxd_reconstruction(path, clusterName=None, digitsName=None, usePXDClusterShapes=False):
104 if 'RegisterEventLevelTrackingInfo' not in path:
105 path.add_module(
'RegisterEventLevelTrackingInfo')
107 if usePXDClusterShapes:
108 if 'ActivatePXDClusterPositionEstimator' not in [e.name()
for e
in path.modules()]:
109 shape_activator = b2.register_module(
'ActivatePXDClusterPositionEstimator')
110 shape_activator.set_name(
'ActivatePXDClusterPositionEstimator')
111 path.add_module(shape_activator)
113 if 'PXDClusterizer' not in [e.name()
for e
in path.modules()]:
114 clusterizer = b2.register_module(
'PXDClusterizer')
115 clusterizer.set_name(
'PXDClusterizer')
117 clusterizer.param(
'Clusters', clusterName)
119 clusterizer.param(
'Digits', digitsName)
120 path.add_module(clusterizer)
122 path.add_module(
'PXDTrackingEventLevelMdstInfoFiller')
125 def add_pxd_simulation(path, digitsName=None, activatePixelMasks=True, activateGainCorrection=True):
127 if activatePixelMasks
and 'ActivatePXDPixelMasker' not in [e.name()
for e
in path.modules()]:
128 path.add_module(
'ActivatePXDPixelMasker')
129 if activateGainCorrection
and 'ActivatePXDGainCalibrator' not in [e.name()
for e
in path.modules()]:
130 path.add_module(
'ActivatePXDGainCalibrator')
132 digitizer = b2.register_module(
'PXDDigitizer')
134 digitizer.param(
'Digits', digitsName)
135 path.add_module(digitizer)
138 def add_pxd_fullframe(path, min_ladders=(1, 1), max_ladders=(8, 12)):
141 min_ladder = min_ladders[layer - 1]
142 max_ladder = max_ladders[layer - 1]
143 for ladder
in range(min_ladder, max_ladder + 1):
144 for sensor
in [1, 2]:
145 modules.append((layer, ladder, sensor))
147 for (layer, ladder, sensor)
in modules:
148 path.add_module(
'ROIGenerator', ROIListName=
'ROIs', nROIs=1, TrigDivider=1,
149 Layer=layer, Ladder=ladder, Sensor=sensor,
150 MinU=0, MaxU=249, MinV=0, MaxV=767)
153 def add_pxd_fullframe_phase3_early(path):
154 add_pxd_fullframe(path, min_ladders=(1, 4), max_ladders=(8, 5))
157 def add_pxd_percentframe(path, min_ladders=(1, 1), max_ladders=(8, 12), fraction=0.1, random_position=
False):
160 min_ladder = min_ladders[layer - 1]
161 max_ladder = max_ladders[layer - 1]
162 for ladder
in range(min_ladder, max_ladder + 1):
163 for sensor
in [1, 2]:
164 modules.append((layer, ladder, sensor))
168 s = math.sqrt(fraction)
169 MinU = max(0, int(250 / 2 * (1 - 0.5 * s)))
171 MinV = max(0, int(768 / 2 * (1 - 2.0 * s)))
174 for (layer, ladder, sensor)
in modules:
175 path.add_module(
'ROIGenerator', ROIListName=
'ROIs', nROIs=1, TrigDivider=1,
176 Layer=layer, Ladder=ladder, Sensor=sensor,
177 MinU=MinU, MaxU=MaxU, MinV=MinV, MaxV=MaxV, Random=random_position)
180 def add_pxd_percentframe_phase3_early(path, fraction=0.1, random_position=False):
181 add_pxd_percentframe(path, min_ladders=(1, 4), max_ladders=(8, 5), fraction=fraction, random_position=random_position)
184 def add_roi_payload_assembler(path, ignore_hlt_decision):
185 path.add_module(
'ROIPayloadAssembler',
186 ROIListName=
'ROIs', ROIpayloadName=
'ROIpayload',
187 SendAllDownscaler=0, SendROIsDownscaler=1,
188 AcceptAll=ignore_hlt_decision, NoRejectFlag=
False)
191 def add_roi_finder(path):
193 Add the PXDDataReduction module to preserve the tracking informaiton for ROI calculation
194 :param path: The path to which the module should be added
195 :param calcROIs: True: turn on the ROI calculation, False: turn off
198 path.add_module(
'PXDROIFinder', recoTrackListName=
'RecoTracks',
199 PXDInterceptListName=
'PXDIntercepts', ROIListName=
'ROIs',
200 tolerancePhi=0.15, toleranceZ=0.5,
201 sigmaSystU=0.02, sigmaSystV=0.02,
202 numSigmaTotU=10, numSigmaTotV=10,
203 maxWidthU=0.5, maxWidthV=0.5)