2 from iov_conditional
import phase_2_conditional, make_conditional_at
5 def add_ckf_based_merger(path, cdc_reco_tracks, svd_reco_tracks, use_mc_truth=False, direction="backward"):
7 Convenience function to add the SVD track finding using VXDTF2 and the merger based on the CKF to the path.
8 :param path: The path to add the module to
9 :param cdc_reco_tracks: The name of the already created CDC Reco Tracks
10 :param svd_reco_tracks: The name of the already created CDC Reco Tracks
11 :param use_mc_truth: Use the MC information in the CKF
12 :param direction: where to extrapolate to. Valid options are forward and backward
15 path.add_module(
"DAFRecoFitter", recoTracksStoreArrayName=cdc_reco_tracks)
19 path.add_module(
"MCRecoTracksMatcher", UsePXDHits=
False, UseSVDHits=
True, UseCDCHits=
False,
20 mcRecoTracksStoreArrayName=
"MCRecoTracks",
21 prRecoTracksStoreArrayName=svd_reco_tracks)
23 result_filter =
"truth_svd_cdc_relation"
24 result_filter_parameters = {}
26 result_filter =
"mva_with_relations"
27 result_filter_parameters = {
"cut": 0.6}
29 if direction ==
"forward":
34 path.add_module(
"CDCToSVDSeedCKF",
35 advanceHighFilterParameters={
"direction": direction},
37 fromRelationStoreArrayName=cdc_reco_tracks,
38 toRelationStoreArrayName=svd_reco_tracks,
40 writeOutDirection=direction,
42 inputRecoTrackStoreArrayName=cdc_reco_tracks,
43 relatedRecoTrackStoreArrayName=svd_reco_tracks,
44 relationCheckForDirection=direction,
45 cdcTracksStoreArrayName=cdc_reco_tracks,
46 vxdTracksStoreArrayName=svd_reco_tracks,
48 firstHighFilterParameters={
"direction": direction},
49 reverseSeed=reverse_seed,
52 filterParameters=result_filter_parameters
53 ).set_name(f
"CDCToSVDSeedCKF_{direction}")
56 def add_pxd_ckf(path, *args, **kwargs):
57 """Function basically calling _add_pxd_ckf_implementation for strict and loose settings (depending on the PXD setup)"""
58 if "PXDSpacePointCreator" not in [m.name()
for m
in path.modules()]:
59 path.add_module(
"PXDSpacePointCreator")
61 loose_settings_path = basf2.create_path()
62 _add_pxd_ckf_implementation(loose_settings_path, *args, loose_settings=
True, **kwargs)
63 strict_settings_path = basf2.create_path()
64 _add_pxd_ckf_implementation(strict_settings_path, *args, loose_settings=
False, **kwargs)
66 strict_settings_iovs = [(0, 0, 0, -1)]
67 make_conditional_at(path=path, iov_list=strict_settings_iovs,
68 path_when_in_iov=strict_settings_path, path_when_not_in_iov=loose_settings_path)
71 def _add_pxd_ckf_implementation(path, svd_cdc_reco_tracks, pxd_reco_tracks, loose_settings=False, use_mc_truth=False,
72 filter_cut=0.03, overlap_cut=0.2, use_best_seeds=10, use_best_results=2,
73 direction="backward"):
75 Convenience function to add the PXD ckf to the path.
76 :param path: The path to add the module to
77 :param svd_cdc_reco_tracks: The name of the already created SVD+CDC reco tracks
78 :param pxd_reco_tracks: The name to output the PXD reco tracks to
79 :param loose_settings: If true, use the setup used during early phase 3 (instead of full PXD setup)
80 :param use_mc_truth: Use the MC information in the CKF
81 :param filter_cut: CKF parameter for MVA state filter
82 :param overlap_cut: CKF parameter for MVA overlap filter.
83 :param use_best_results: CKF parameter for useBestNInSeed
84 :param use_best_seeds: CKF parameter for UseNStates
85 :param direction: where to extrapolate to. Valid options are forward and backward
87 path.add_module(
"DAFRecoFitter", recoTracksStoreArrayName=svd_cdc_reco_tracks)
89 if direction ==
"forward":
95 path.add_module(
"MCRecoTracksMatcher", UsePXDHits=
False, UseSVDHits=
True, UseCDCHits=
True,
96 mcRecoTracksStoreArrayName=
"MCRecoTracks",
97 prRecoTracksStoreArrayName=svd_cdc_reco_tracks)
99 module_parameters = dict(
100 firstHighFilter=
"truth",
101 secondHighFilter=
"all",
102 thirdHighFilter=
"all",
108 module_parameters = dict(
109 firstHighFilterParameters={
"cut": filter_cut,
"identifier":
"ckf_ToPXDStateFilter_1",
110 "direction": direction},
111 firstHighUseNStates=use_best_seeds,
113 secondHighFilterParameters={
"cut": filter_cut,
"identifier":
"ckf_ToPXDStateFilter_2"},
114 secondHighUseNStates=use_best_seeds,
116 thirdHighFilterParameters={
"cut": filter_cut,
"identifier":
"ckf_ToPXDStateFilter_3"},
117 thirdHighUseNStates=use_best_seeds,
119 filterParameters={
"cut": overlap_cut,
"identifier":
"ckf_PXDTrackCombination"},
120 useBestNInSeed=use_best_results,
124 module_parameters[
"seedHitJumping"] = 1
126 path.add_module(
"ToPXDCKF",
127 advanceHighFilterParameters={
"direction": direction},
129 writeOutDirection=direction,
131 inputRecoTrackStoreArrayName=svd_cdc_reco_tracks,
132 relatedRecoTrackStoreArrayName=pxd_reco_tracks,
133 relationCheckForDirection=direction,
135 outputRecoTrackStoreArrayName=pxd_reco_tracks,
136 outputRelationRecoTrackStoreArrayName=svd_cdc_reco_tracks,
138 reverseSeed=reverse_seed,
139 reverseSeedState=reverse_seed,
140 **module_parameters).set_name(f
"ToPXDCKF_{direction}")
143 def add_svd_ckf(path, cdc_reco_tracks, svd_reco_tracks, use_mc_truth=False, filter_cut=0.1,
144 overlap_cut=0.2, use_best_results=5, use_best_seeds=10, direction="backward"):
146 Convenience function to add the SVD ckf to the path.
147 :param path: The path to add the module to
148 :param cdc_reco_tracks: The name of the already created CDC reco tracks
149 :param svd_reco_tracks: The name to output the SVD reco tracks to
150 :param use_mc_truth: Use the MC information in the CKF
151 :param filter_cut: CKF parameter for MVA filter
152 :param overlap_cut: CKF parameter for MVA overlap filter
153 :param use_best_results: CKF parameter for useNResults
154 :param use_best_seeds: CKF parameter for useBestNInSeed
155 :param direction: where to extrapolate to. Valid options are forward and backward
157 if direction ==
"forward":
163 module_parameters = dict(
164 firstHighFilter=
"truth",
165 secondHighFilter=
"all",
166 thirdHighFilter=
"all",
172 module_parameters = dict(
173 firstHighFilterParameters={
"identifier":
"ckf_CDCSVDStateFilter_1",
"cut": filter_cut,
174 "direction": direction},
175 firstHighUseNStates=use_best_seeds,
177 secondHighFilterParameters={
"identifier":
"ckf_CDCSVDStateFilter_2",
"cut": filter_cut},
178 secondHighUseNStates=use_best_seeds,
180 thirdHighFilterParameters={
"identifier":
"ckf_CDCSVDStateFilter_3",
"cut": filter_cut},
181 thirdHighUseNStates=use_best_seeds,
183 filterParameters={
"cut": overlap_cut,
"identifier":
"ckf_CDCToSVDResult"},
184 useBestNInSeed=use_best_results,
187 path.add_module(
"CDCToSVDSpacePointCKF",
188 inputRecoTrackStoreArrayName=cdc_reco_tracks,
189 outputRecoTrackStoreArrayName=svd_reco_tracks,
190 outputRelationRecoTrackStoreArrayName=cdc_reco_tracks,
191 relatedRecoTrackStoreArrayName=svd_reco_tracks,
193 advanceHighFilterParameters={
"direction": direction},
194 reverseSeed=reverse_seed,
196 writeOutDirection=direction,
197 relationCheckForDirection=direction,
199 **module_parameters).set_name(f
"CDCToSVDSpacePointCKF_{direction}")
202 def add_cosmics_svd_ckf(path, cdc_reco_tracks, svd_reco_tracks, use_mc_truth=False, use_best_results=5,
203 use_best_seeds=10, direction="backward"):
205 Convenience function to add the SVD ckf to the path with cosmics settings valid for phase2 and 3.
206 :param path: The path to add the module to
207 :param cdc_reco_tracks: The name of the already created CDC reco tracks
208 :param svd_reco_tracks: The name to output the SVD reco tracks to
209 :param use_mc_truth: Use the MC information in the CKF
210 :param use_best_results: CKF parameter for useNResults
211 :param use_best_seeds: CKF parameter for useBestNInSeed
212 :param direction: where to extrapolate to. Valid options are forward and backward
214 if direction ==
"forward":
220 module_parameters = dict(
221 firstHighFilter=
"truth",
222 secondHighFilter=
"all",
223 thirdHighFilter=
"all",
229 module_parameters = dict(
233 firstHighFilter=
"non_ip_crossing",
234 firstHighFilterParameters={
"direction": direction},
235 firstHighUseNStates=0,
237 secondHighFilter=
"residual",
238 secondHighFilterParameters={},
239 secondHighUseNStates=use_best_seeds,
241 thirdHighFilter=
"residual",
242 thirdHighFilterParameters={},
243 thirdHighUseNStates=use_best_seeds,
247 useBestNInSeed=use_best_results,
250 path.add_module(
"CDCToSVDSpacePointCKF",
251 inputRecoTrackStoreArrayName=cdc_reco_tracks,
252 outputRecoTrackStoreArrayName=svd_reco_tracks,
253 outputRelationRecoTrackStoreArrayName=cdc_reco_tracks,
254 relatedRecoTrackStoreArrayName=svd_reco_tracks,
256 advanceHighFilterParameters={
"direction": direction},
257 reverseSeed=reverse_seed,
259 writeOutDirection=direction,
260 relationCheckForDirection=direction,
263 **module_parameters).set_name(f
"CDCToSVDSpacePointCKF_{direction}")
266 def add_cosmics_pxd_ckf(path, svd_cdc_reco_tracks, pxd_reco_tracks, use_mc_truth=False, use_best_results=5,
267 filter_cut=0.03, overlap_cut=0.2, use_best_seeds=10, direction="backward"):
269 Convenience function to add the PXD ckf to the path with cosmics settings valid for phase2 and 3.
270 :param path: The path to add the module to
271 :param svd_cdc_reco_tracks: The name of the already created CDC reco tracks
272 :param pxd_reco_tracks: The name to output the SVD reco tracks to
273 :param use_mc_truth: Use the MC information in the CKF
274 :param use_best_results: CKF parameter for useNResults
275 :param filter_cut: CKF parameter for MVA filter
276 :param overlap_cut: CKF parameter for MVA overlap filter
277 :param use_best_seeds: CKF parameter for useBestNInSeed
278 :param direction: where to extrapolate to. Valid options are forward and backward
280 if "PXDSpacePointCreator" not in [m.name()
for m
in path.modules()]:
281 path.add_module(
"PXDSpacePointCreator")
283 path.add_module(
"DAFRecoFitter", recoTracksStoreArrayName=svd_cdc_reco_tracks)
285 if direction ==
"forward":
291 path.add_module(
"MCRecoTracksMatcher", UsePXDHits=
False, UseSVDHits=
True, UseCDCHits=
True,
292 mcRecoTracksStoreArrayName=
"MCRecoTracks",
293 prRecoTracksStoreArrayName=svd_cdc_reco_tracks)
295 module_parameters = dict(
296 firstHighFilter=
"truth",
297 secondHighFilter=
"all",
298 thirdHighFilter=
"all",
304 module_parameters = dict(
310 firstHighFilterParameters={
"cut": filter_cut,
"identifier":
"ckf_ToPXDStateFilter_1",
311 "direction": direction},
312 firstHighUseNStates=use_best_seeds,
314 secondHighFilterParameters={
"cut": filter_cut,
"identifier":
"ckf_ToPXDStateFilter_2"},
315 secondHighUseNStates=use_best_seeds,
317 thirdHighFilterParameters={
"cut": filter_cut,
"identifier":
"ckf_ToPXDStateFilter_3"},
318 thirdHighUseNStates=use_best_seeds,
320 filterParameters={
"cut": overlap_cut,
"identifier":
"ckf_PXDTrackCombination"},
321 useBestNInSeed=use_best_results,
326 path.add_module(
"ToPXDCKF",
327 advanceHighFilterParameters={
"direction": direction},
329 writeOutDirection=direction,
331 inputRecoTrackStoreArrayName=svd_cdc_reco_tracks,
332 relatedRecoTrackStoreArrayName=pxd_reco_tracks,
333 relationCheckForDirection=direction,
335 outputRecoTrackStoreArrayName=pxd_reco_tracks,
336 outputRelationRecoTrackStoreArrayName=svd_cdc_reco_tracks,
338 reverseSeed=reverse_seed,
339 reverseSeedState=reverse_seed,
340 **module_parameters).set_name(f
"ToPXDCKF_{direction}")