15def add_pxd_unpacker(path):
16 pxdunpacker = b2.register_module(
'PXDUnpacker')
17 path.add_module(pxdunpacker)
19 pxderrorcheck = b2.register_module(
'PXDPostErrorChecker')
20 path.add_module(pxderrorcheck)
22 pxdhitsorter = b2.register_module(
'PXDRawHitSorter')
23 path.add_module(pxdhitsorter)
24 if 'ActivatePXDPixelMasker' not in [e.name()
for e
in path.modules()]:
25 path.add_module(
'ActivatePXDPixelMasker')
28def add_pxd_packer(path):
29 pxdpacker = b2.register_module(
'PXDPacker')
30 pxdpacker.param(
'dhe_to_dhc', [
97 path.add_module(pxdpacker)
100def add_pxd_reconstruction(
104 usePXDClusterShapes=False,
105 spacePointsName='PXDSpacePoints'):
107 Add the PXD reconstruction modules
108 RegisterEventLevelTrackingInfo (if not already
in path)
109 ActivatePXDClusterPositionEstimator (
if required by usePXDClusterShapes
and not already
in path)
111 PXDTrackingEventLevelMdstInfoFilter
112 PXDSpacePointCreator (
if not already
in path)
114 :param path The path to add the modules tu
115 :param clusterName Name of the PXDCluster StoreArray
if it should be custom
116 :param digitsName Name of the PXDDigits StoreArray
if it should be custom
117 :param usePXDClusterShapes If
True, use ActivatePXDClusterPositionEstimator
for estimating PXDClusterPositions
118 :param spacePointsName Name of the PXDSpacePoints, defaults to PXDSpacePoints
122 if 'RegisterEventLevelTrackingInfo' not in path:
123 path.add_module(
'RegisterEventLevelTrackingInfo')
125 if usePXDClusterShapes:
126 if 'ActivatePXDClusterPositionEstimator' not in [e.name()
for e
in path.modules()]:
127 shape_activator = b2.register_module(
'ActivatePXDClusterPositionEstimator')
128 shape_activator.set_name(
'ActivatePXDClusterPositionEstimator')
129 path.add_module(shape_activator)
131 if 'PXDClusterizer' not in [e.name()
for e
in path.modules()]:
132 clusterizer = b2.register_module(
'PXDClusterizer')
133 clusterizer.set_name(
'PXDClusterizer')
135 clusterizer.param(
'Clusters', clusterName)
137 clusterizer.param(
'Digits', digitsName)
138 path.add_module(clusterizer)
140 path.add_module(
'PXDTrackingEventLevelMdstInfoFiller')
142 path.add_module(
'PXDSpacePointCreator',
143 PXDClusters=clusterName
if clusterName
else '',
144 SpacePoints=spacePointsName)
147def add_pxd_simulation(path, digitsName=None, activatePixelMasks=True, activateGainCorrection=True):
149 if activatePixelMasks
and 'ActivatePXDPixelMasker' not in [e.name()
for e
in path.modules()]:
150 path.add_module(
'ActivatePXDPixelMasker')
151 if activateGainCorrection
and 'ActivatePXDGainCalibrator' not in [e.name()
for e
in path.modules()]:
152 path.add_module(
'ActivatePXDGainCalibrator')
154 digitizer = b2.register_module(
'PXDDigitizer')
156 digitizer.param(
'Digits', digitsName)
157 path.add_module(digitizer)
160def add_pxd_fullframe(path, min_ladders=(1, 1), max_ladders=(8, 12)):
163 min_ladder = min_ladders[layer - 1]
164 max_ladder = max_ladders[layer - 1]
165 for ladder
in range(min_ladder, max_ladder + 1):
166 for sensor
in [1, 2]:
167 modules.append((layer, ladder, sensor))
169 for (layer, ladder, sensor)
in modules:
170 path.add_module(
'ROIGenerator', ROIListName=
'ROIs', nROIs=1, TrigDivider=1,
171 Layer=layer, Ladder=ladder, Sensor=sensor,
172 MinU=0, MaxU=249, MinV=0, MaxV=767)
175def add_pxd_fullframe_phase3_early(path):
176 add_pxd_fullframe(path, min_ladders=(1, 4), max_ladders=(8, 5))
179def add_pxd_percentframe(path, min_ladders=(1, 1), max_ladders=(8, 12), fraction=0.1, random_position=
False):
182 min_ladder = min_ladders[layer - 1]
183 max_ladder = max_ladders[layer - 1]
184 for ladder
in range(min_ladder, max_ladder + 1):
185 for sensor
in [1, 2]:
186 modules.append((layer, ladder, sensor))
190 s = math.sqrt(fraction)
191 MinU = max(0, int(250 / 2 * (1 - 0.5 * s)))
193 MinV = max(0, int(768 / 2 * (1 - 2.0 * s)))
196 for (layer, ladder, sensor)
in modules:
197 path.add_module(
'ROIGenerator', ROIListName=
'ROIs', nROIs=1, TrigDivider=1,
198 Layer=layer, Ladder=ladder, Sensor=sensor,
199 MinU=MinU, MaxU=MaxU, MinV=MinV, MaxV=MaxV, Random=random_position)
202def add_pxd_percentframe_phase3_early(path, fraction=0.1, random_position=False):
203 add_pxd_percentframe(path, min_ladders=(1, 4), max_ladders=(8, 5), fraction=fraction, random_position=random_position)
206def add_roi_payload_assembler(path, ignore_hlt_decision):
207 path.add_module(
'ROIPayloadAssembler',
208 ROIListName=
'ROIs', ROIpayloadName=
'ROIpayload',
209 SendAllDownscaler=0, SendROIsDownscaler=1,
210 AcceptAll=ignore_hlt_decision, NoRejectFlag=
False)
213def add_roi_finder(path):
215 Add the PXDDataReduction module to preserve the tracking informaiton for ROI calculation
216 :param path: The path to which the module should be added
217 :param calcROIs:
True: turn on the ROI calculation,
False: turn off
220 path.add_module('PXDROIFinder', recoTrackListName=
'RecoTracks',
221 PXDInterceptListName=
'PXDIntercepts', ROIListName=
'ROIs')