6 <contact>software-tracking@belle2.org</contact>
7 <output>ROIFindingValidation.root</output>
9 This module validates the ROI Finding module.
16 CONTACT =
'software-tracking@belle2.org'
19 OUTPUT_FILE =
'ROIFindingTrackingValidation.root'
24 from simulation
import add_simulation
25 from svd
import add_svd_reconstruction
31 from ROOT
import Belle2
36 basf2.set_random_seed(1509)
38 from tracking
import add_tracking_for_PXDDataReduction_simulation
43 """Module to collect information about the ROIs (PXDIntercepts & ROIs) and to
44 generate validation plots on the performance of the ROIFinding module."""
50 output_file_name=None,
74 """Receive signal at the start of event processing"""
82 self.
drf = collections.deque()
97 ''' ROIs quantities'''
103 sensor = roi.getSensorID()
104 if(sensor.getLayerNumber() == 1):
105 nL1_ROI = nL1_ROI + 1
107 nL2_ROI = nL2_ROI + 1
114 '''Data Reduction Factor '''
119 self.
drf.append(len(in_pxd) / len(tot_pxd))
121 ''' PXDIntercepts Statistical Error '''
125 if(sensor.getLayerNumber() == 1):
126 self.
statU_L1.append(inter.getSigmaU())
127 self.
statV_L1.append(inter.getSigmaV())
129 self.
statU_L2.append(inter.getSigmaU())
130 self.
statV_L2.append(inter.getSigmaV())
133 """Receive signal at the end of event processing"""
137 basf2.B2RESULT(
"total nROIs = {}".format(self.
nROIs))
144 h_nROIs_L1.hist(self.
nROIs_L1, bins=100, lower_bound=0, upper_bound=100)
145 h_nROIs_L1.contact = contact
146 h_nROIs_L1.check =
'average of 25 +/- 10 is expected'
147 h_nROIs_L1.description =
'ROIs on L1'
148 h_nROIs_L1.title =
'ROIs on L1'
149 h_nROIs_L1.xlabel =
'number of ROIs'
150 h_nROIs_L1.ylabel =
''
151 h_nROIs_L1.write(output_tfile)
154 h_nROIs_L2.hist(self.
nROIs_L2, bins=100, lower_bound=0, upper_bound=100)
155 h_nROIs_L2.contact = contact
156 h_nROIs_L2.check =
'average of 25 +/- 10 is expected'
157 h_nROIs_L2.description =
'ROIs on L2'
158 h_nROIs_L2.title =
'ROIs on L2'
159 h_nROIs_L2.xlabel =
'number of ROIs'
160 h_nROIs_L2.ylabel =
''
161 h_nROIs_L2.write(output_tfile)
164 h_drf.hist(self.
drf, bins=100, lower_bound=0, upper_bound=1)
165 h_drf.contact = contact
166 h_drf.check =
'with no bkg, the average should be around 70%'
167 h_drf.description =
'Fraction of PXDDDigits inside ROIs'
168 h_drf.title =
'Fraction of PXDDDigits inside ROIs'
171 h_drf.write(output_tfile)
174 h_statU_L1.hist(self.
statU_L1, bins=100, lower_bound=0, upper_bound=0.2)
175 h_statU_L1.contact = contact
176 h_statU_L1.check =
'average should be around 0.021 cm'
177 h_statU_L1.description =
'Statistical Error of the Intercept on L1 planes, along U'
178 h_statU_L1.title =
'L1 Intercept Statistical Uncertainity along U'
179 h_statU_L1.xlabel =
'U stat uncertainity'
180 h_statU_L1.ylabel =
''
181 h_statU_L1.write(output_tfile)
184 h_statV_L1.hist(self.
statV_L1, bins=100, lower_bound=0, upper_bound=0.2)
185 h_statV_L1.contact = contact
186 h_statV_L1.check =
'average should be around 0.021 cm'
187 h_statV_L1.description =
'Statistical Error of the Intercept on L1 planes, along V'
188 h_statV_L1.title =
'L1 Intercept Statistical Uncertainity along V'
189 h_statV_L1.xlabel =
'V stat uncertainity (cm)'
190 h_statV_L1.ylabel =
''
191 h_statV_L1.write(output_tfile)
194 h_statU_L2.hist(self.
statU_L2, bins=100, lower_bound=0, upper_bound=0.2)
195 h_statU_L2.contact = contact
196 h_statU_L2.check =
'average should be around 0.015 cm'
197 h_statU_L2.description =
'Statistical Error of the Intercept on L2 planes, along U'
198 h_statU_L2.title =
'L2 Intercept Statistical Uncertainity along U'
199 h_statU_L2.xlabel =
'U stat uncertainity (cm)'
200 h_statU_L2.ylabel =
''
201 h_statU_L2.write(output_tfile)
204 h_statV_L2.hist(self.
statV_L2, bins=100, lower_bound=0, upper_bound=0.2)
205 h_statV_L2.contact = contact
206 h_statV_L2.check =
'average should be around 0.016 cm'
207 h_statV_L2.description =
'Statistical Error of the Intercept on L2 planes, along V'
208 h_statV_L2.title =
'L2 Intercept Statistical Uncertainity along V'
209 h_statV_L2.xlabel =
'V stat uncertainity (cm)'
210 h_statV_L2.ylabel =
''
211 h_statV_L2.write(output_tfile)
218 path = basf2.create_path()
220 path.add_module(
'EventInfoSetter', evtNumList=N_EVENTS)
221 path.add_module(
'EvtGenInput')
222 add_simulation(path, forceSetPXDDataReduction=
True, usePXDDataReduction=
False)
223 add_svd_reconstruction(path, isROIsimulation=
True)
229 pxd_unfiltered_digits =
'PXDDigits'
230 pxd_filtered_digits =
'filteredPXDDigits'
233 svd_reco_tracks =
'__ROIsvdRecoTracks'
234 add_tracking_for_PXDDataReduction_simulation(path, [
'SVD',
'CDC'],
'__ROIsvdClusters')
237 pxdDataRed = basf2.register_module(
'PXDROIFinder')
239 'recoTrackListName': svd_reco_tracks,
240 'PXDInterceptListName':
'PXDIntercepts',
241 'ROIListName':
'ROIs',
242 'tolerancePhi': 0.15,
251 pxdDataRed.param(param_pxdDataRed)
252 path.add_module(pxdDataRed)
255 pxd_digifilter = basf2.register_module(
'PXDdigiFilter')
256 pxd_digifilter.param(
'ROIidsName',
'ROIs')
257 pxd_digifilter.param(
'PXDDigitsName', pxd_unfiltered_digits)
258 pxd_digifilter.param(
'PXDDigitsInsideROIName', pxd_filtered_digits)
259 pxd_digifilter.param(
'PXDDigitsOutsideROIName',
'PXDDigitsOutside')
260 path.add_module(pxd_digifilter)
263 path.add_module(ROIValidationPlots)
265 path.add_module(
'Progress')