10from ROOT.Belle2
import DAFConfiguration
13def add_ckf_based_merger(path, cdc_reco_tracks, svd_reco_tracks, use_mc_truth=False, direction="backward"):
15 Convenience function to add the SVD track finding using VXDTF2 and the merger based on the CKF to the path.
16 :param path: The path to add the module to
17 :param cdc_reco_tracks: The name of the already created CDC Reco Tracks
18 :param svd_reco_tracks: The name of the already created CDC Reco Tracks
19 :param use_mc_truth: Use the MC information in the CKF
20 :param direction: where to extrapolate to. Valid options are forward and backward
23 path.add_module(
"DAFRecoFitter", trackFitType=DAFConfiguration.c_CDConly,
24 recoTracksStoreArrayName=cdc_reco_tracks).set_name(f
"DAFRecoFitter {cdc_reco_tracks}")
28 path.add_module(
"MCRecoTracksMatcher", UsePXDHits=
False, UseSVDHits=
True, UseCDCHits=
False,
29 mcRecoTracksStoreArrayName=
"MCRecoTracks",
30 prRecoTracksStoreArrayName=svd_reco_tracks)
32 result_filter =
"truth_svd_cdc_relation"
33 result_filter_parameters = {}
35 result_filter =
"mva_with_relations"
36 result_filter_parameters = {
'DBPayloadName':
'ckf_SeededCDCToSVDResultParameters'}
38 if direction ==
"forward":
43 path.add_module(
"CDCToSVDSeedCKF",
44 advanceHighFilterParameters={
"direction": direction},
46 fromRelationStoreArrayName=cdc_reco_tracks,
47 toRelationStoreArrayName=svd_reco_tracks,
49 writeOutDirection=direction,
51 inputRecoTrackStoreArrayName=cdc_reco_tracks,
52 relatedRecoTrackStoreArrayName=svd_reco_tracks,
53 relationCheckForDirection=direction,
54 cdcTracksStoreArrayName=cdc_reco_tracks,
55 vxdTracksStoreArrayName=svd_reco_tracks,
57 firstHighFilterParameters={
"direction": direction},
58 reverseSeed=reverse_seed,
61 filterParameters=result_filter_parameters,
63 trackFitType=DAFConfiguration.c_CDConly
64 ).set_name(f
"CDCToSVDSeedCKF_{direction}")
74 direction="backward"):
76 Convenience function to add the PXD ckf to the path.
77 :param path: The path to add the module to
78 :param svd_cdc_reco_tracks: The name of the already created SVD+CDC reco tracks
79 :param pxd_reco_tracks: The name to output the PXD reco tracks to
80 :param use_mc_truth: Use the MC information in the CKF
81 :param use_best_results: CKF parameter for useBestNInSeed
82 :param use_best_seeds: CKF parameter for UseNStates
83 :param direction: where to extrapolate to. Valid options are forward and backward
85 if "PXDSpacePointCreator" not in [m.name()
for m
in path.modules()]:
86 path.add_module(
"PXDSpacePointCreator")
88 path.add_module(
"DAFRecoFitter", recoTracksStoreArrayName=svd_cdc_reco_tracks).set_name(f
"DAFRecoFitter {svd_cdc_reco_tracks}")
90 if direction ==
"forward":
96 module_parameters = dict(
97 firstHighFilter=
"truth",
98 secondHighFilter=
"all",
99 thirdHighFilter=
"all",
105 module_parameters = dict(
106 firstHighFilterParameters={
107 'DBPayloadName':
'ckf_ToPXDStateFilter_1Parameters',
108 "direction": direction},
109 firstHighUseNStates=use_best_seeds,
110 secondHighFilterParameters={
111 'DBPayloadName':
'ckf_ToPXDStateFilter_2Parameters'},
112 secondHighUseNStates=use_best_seeds,
113 thirdHighFilterParameters={
114 'DBPayloadName':
'ckf_ToPXDStateFilter_3Parameters'},
115 thirdHighUseNStates=use_best_seeds,
117 'DBPayloadName':
'ckf_PXDTrackCombinationParameters'},
118 useBestNInSeed=use_best_results,
121 module_parameters[
"seedHitJumping"] = -1
122 module_parameters[
"hitHitJumping"] = 0
124 path.add_module(
"ToPXDCKF",
125 advanceHighFilterParameters={
"direction": direction},
127 writeOutDirection=direction,
129 inputRecoTrackStoreArrayName=svd_cdc_reco_tracks,
130 relatedRecoTrackStoreArrayName=pxd_reco_tracks,
131 relationCheckForDirection=direction,
133 outputRecoTrackStoreArrayName=pxd_reco_tracks,
134 outputRelationRecoTrackStoreArrayName=svd_cdc_reco_tracks,
136 reverseSeed=reverse_seed,
137 reverseSeedState=reverse_seed,
138 **module_parameters).set_name(f
"ToPXDCKF_{direction}")
148 direction="backward"):
150 Convenience function to add the SVD ckf to the path.
151 :param path: The path to add the module to
152 :param cdc_reco_tracks: The name of the already created CDC reco tracks
153 :param svd_reco_tracks: The name to output the SVD reco tracks to
154 :param use_mc_truth: Use the MC information in the CKF
155 :param use_best_results: CKF parameter for useNResults
156 :param use_best_seeds: CKF parameter for useBestNInSeed
157 :param direction: where to extrapolate to. Valid options are forward and backward
159 if direction ==
"forward":
165 module_parameters = dict(
166 firstHighFilter=
"truth",
167 secondHighFilter=
"all",
168 thirdHighFilter=
"all",
174 module_parameters = dict(
175 firstHighFilterParameters={
176 "direction": direction,
177 'DBPayloadName': f
'ckf_CDCSVDStateFilter_1_{direction}_Parameters'},
178 firstHighUseNStates=use_best_seeds,
179 secondHighFilterParameters={
180 'DBPayloadName': f
'ckf_CDCSVDStateFilter_2_{direction}_Parameters'},
181 secondHighUseNStates=use_best_seeds,
182 thirdHighFilterParameters={
183 'DBPayloadName': f
'ckf_CDCSVDStateFilter_3_{direction}_Parameters'},
184 thirdHighUseNStates=use_best_seeds,
186 'DBPayloadName':
'ckf_CDCToSVDResultParameters'},
187 useBestNInSeed=use_best_results,
190 path.add_module(
"CDCToSVDSpacePointCKF",
191 inputRecoTrackStoreArrayName=cdc_reco_tracks,
192 outputRecoTrackStoreArrayName=svd_reco_tracks,
193 outputRelationRecoTrackStoreArrayName=cdc_reco_tracks,
194 relatedRecoTrackStoreArrayName=svd_reco_tracks,
196 advanceHighFilterParameters={
"direction": direction},
197 reverseSeed=reverse_seed,
199 writeOutDirection=direction,
200 relationCheckForDirection=direction,
205 trackFitType=DAFConfiguration.c_CDConly,
207 **module_parameters).set_name(f
"CDCToSVDSpacePointCKF_{direction}")
210def add_cosmics_svd_ckf(
217 direction="backward"):
219 Convenience function to add the SVD ckf to the path with cosmics settings valid for phase2 and 3.
220 :param path: The path to add the module to
221 :param cdc_reco_tracks: The name of the already created CDC reco tracks
222 :param svd_reco_tracks: The name to output the SVD reco tracks to
223 :param use_mc_truth: Use the MC information in the CKF
224 :param use_best_results: CKF parameter for useNResults
225 :param use_best_seeds: CKF parameter for useBestNInSeed
226 :param direction: where to extrapolate to. Valid options are forward and backward
228 if direction ==
"forward":
234 module_parameters = dict(
235 firstHighFilter=
"truth",
236 secondHighFilter=
"all",
237 thirdHighFilter=
"all",
243 module_parameters = dict(
247 firstHighFilter=
"non_ip_crossing",
248 firstHighFilterParameters={
"direction": direction},
249 firstHighUseNStates=0,
251 secondHighFilter=
"residual",
252 secondHighFilterParameters={},
253 secondHighUseNStates=use_best_seeds,
255 thirdHighFilter=
"residual",
256 thirdHighFilterParameters={},
257 thirdHighUseNStates=use_best_seeds,
261 useBestNInSeed=use_best_results,
264 path.add_module(
"CDCToSVDSpacePointCKF",
265 inputRecoTrackStoreArrayName=cdc_reco_tracks,
266 outputRecoTrackStoreArrayName=svd_reco_tracks,
267 outputRelationRecoTrackStoreArrayName=cdc_reco_tracks,
268 relatedRecoTrackStoreArrayName=svd_reco_tracks,
270 advanceHighFilterParameters={
"direction": direction},
271 reverseSeed=reverse_seed,
273 writeOutDirection=direction,
274 relationCheckForDirection=direction,
278 **module_parameters).set_name(f
"CDCToSVDSpacePointCKF_{direction}")
281def add_cosmics_pxd_ckf(
288 direction="backward"):
290 Convenience function to add the PXD ckf to the path with cosmics settings valid for phase2 and 3.
291 :param path: The path to add the module to
292 :param svd_cdc_reco_tracks: The name of the already created CDC reco tracks
293 :param pxd_reco_tracks: The name to output the SVD reco tracks to
294 :param use_mc_truth: Use the MC information in the CKF
295 :param use_best_results: CKF parameter for useNResults
296 :param use_best_seeds: CKF parameter for useBestNInSeed
297 :param direction: where to extrapolate to. Valid options are forward and backward
299 if "PXDSpacePointCreator" not in [m.name()
for m
in path.modules()]:
300 path.add_module(
"PXDSpacePointCreator")
302 path.add_module(
"DAFRecoFitter", recoTracksStoreArrayName=svd_cdc_reco_tracks).set_name(f
"DAFRecoFitter {svd_cdc_reco_tracks}")
304 if direction ==
"forward":
310 path.add_module(
"MCRecoTracksMatcher", UsePXDHits=
False, UseSVDHits=
True, UseCDCHits=
True,
311 mcRecoTracksStoreArrayName=
"MCRecoTracks",
312 prRecoTracksStoreArrayName=svd_cdc_reco_tracks)
314 module_parameters = dict(
315 firstHighFilter=
"truth",
316 secondHighFilter=
"all",
317 thirdHighFilter=
"all",
323 module_parameters = dict(
328 firstHighFilterParameters={
329 'DBPayloadName':
'ckf_ToPXDStateFilter_1Parameters',
330 "direction": direction},
331 firstHighUseNStates=use_best_seeds,
332 secondHighFilterParameters={
333 'DBPayloadName':
'ckf_ToPXDStateFilter_2Parameters'},
334 secondHighUseNStates=use_best_seeds,
335 thirdHighFilterParameters={
336 'DBPayloadName':
'ckf_ToPXDStateFilter_3Parameters'},
337 thirdHighUseNStates=use_best_seeds,
339 'DBPayloadName':
'ckf_PXDTrackCombinationParameters'},
340 useBestNInSeed=use_best_results,
345 path.add_module(
"ToPXDCKF",
346 advanceHighFilterParameters={
"direction": direction},
348 writeOutDirection=direction,
350 inputRecoTrackStoreArrayName=svd_cdc_reco_tracks,
351 relatedRecoTrackStoreArrayName=pxd_reco_tracks,
352 relationCheckForDirection=direction,
354 outputRecoTrackStoreArrayName=pxd_reco_tracks,
355 outputRelationRecoTrackStoreArrayName=svd_cdc_reco_tracks,
357 reverseSeed=reverse_seed,
358 reverseSeedState=reverse_seed,
359 **module_parameters).set_name(f
"ToPXDCKF_{direction}")