10 from iov_conditional
import make_conditional_at
13 def 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", recoTracksStoreArrayName=cdc_reco_tracks)
27 path.add_module(
"MCRecoTracksMatcher", UsePXDHits=
False, UseSVDHits=
True, UseCDCHits=
False,
28 mcRecoTracksStoreArrayName=
"MCRecoTracks",
29 prRecoTracksStoreArrayName=svd_reco_tracks)
31 result_filter =
"truth_svd_cdc_relation"
32 result_filter_parameters = {}
34 result_filter =
"mva_with_relations"
35 result_filter_parameters = {
"cut": 0.6}
37 if direction ==
"forward":
42 path.add_module(
"CDCToSVDSeedCKF",
43 advanceHighFilterParameters={
"direction": direction},
45 fromRelationStoreArrayName=cdc_reco_tracks,
46 toRelationStoreArrayName=svd_reco_tracks,
48 writeOutDirection=direction,
50 inputRecoTrackStoreArrayName=cdc_reco_tracks,
51 relatedRecoTrackStoreArrayName=svd_reco_tracks,
52 relationCheckForDirection=direction,
53 cdcTracksStoreArrayName=cdc_reco_tracks,
54 vxdTracksStoreArrayName=svd_reco_tracks,
56 firstHighFilterParameters={
"direction": direction},
57 reverseSeed=reverse_seed,
60 filterParameters=result_filter_parameters
61 ).set_name(f
"CDCToSVDSeedCKF_{direction}")
64 def add_pxd_ckf(path, svd_cdc_reco_tracks, pxd_reco_tracks, use_mc_truth=False, filter_cut=0.03,
65 overlap_cut=0.2, use_best_seeds=10, use_best_results=2, direction="backward"):
67 Convenience function to add the PXD ckf to the path.
68 :param path: The path to add the module to
69 :param svd_cdc_reco_tracks: The name of the already created SVD+CDC reco tracks
70 :param pxd_reco_tracks: The name to output the PXD reco tracks to
71 :param use_mc_truth: Use the MC information in the CKF
72 :param filter_cut: CKF parameter for MVA state filter
73 :param overlap_cut: CKF parameter for MVA overlap filter.
74 :param use_best_results: CKF parameter for useBestNInSeed
75 :param use_best_seeds: CKF parameter for UseNStates
76 :param direction: where to extrapolate to. Valid options are forward and backward
78 if "PXDSpacePointCreator" not in [m.name()
for m
in path.modules()]:
79 path.add_module(
"PXDSpacePointCreator")
81 path.add_module(
"DAFRecoFitter", recoTracksStoreArrayName=svd_cdc_reco_tracks)
83 if direction ==
"forward":
89 path.add_module(
"MCRecoTracksMatcher", UsePXDHits=
False, UseSVDHits=
True, UseCDCHits=
True,
90 mcRecoTracksStoreArrayName=
"MCRecoTracks",
91 prRecoTracksStoreArrayName=svd_cdc_reco_tracks)
93 module_parameters = dict(
94 firstHighFilter=
"truth",
95 secondHighFilter=
"all",
96 thirdHighFilter=
"all",
102 module_parameters = dict(
103 firstHighFilterParameters={
"cut": filter_cut,
"identifier":
"ckf_ToPXDStateFilter_1",
104 "direction": direction},
105 firstHighUseNStates=use_best_seeds,
107 secondHighFilterParameters={
"cut": filter_cut,
"identifier":
"ckf_ToPXDStateFilter_2"},
108 secondHighUseNStates=use_best_seeds,
110 thirdHighFilterParameters={
"cut": filter_cut,
"identifier":
"ckf_ToPXDStateFilter_3"},
111 thirdHighUseNStates=use_best_seeds,
113 filterParameters={
"cut": overlap_cut,
"identifier":
"ckf_PXDTrackCombination"},
114 useBestNInSeed=use_best_results,
117 module_parameters[
"seedHitJumping"] = -1
118 module_parameters[
"hitHitJumping"] = 0
120 path.add_module(
"ToPXDCKF",
121 advanceHighFilterParameters={
"direction": direction},
123 writeOutDirection=direction,
125 inputRecoTrackStoreArrayName=svd_cdc_reco_tracks,
126 relatedRecoTrackStoreArrayName=pxd_reco_tracks,
127 relationCheckForDirection=direction,
129 outputRecoTrackStoreArrayName=pxd_reco_tracks,
130 outputRelationRecoTrackStoreArrayName=svd_cdc_reco_tracks,
132 reverseSeed=reverse_seed,
133 reverseSeedState=reverse_seed,
134 **module_parameters).set_name(f
"ToPXDCKF_{direction}")
137 def add_svd_ckf(path, cdc_reco_tracks, svd_reco_tracks, use_mc_truth=False, filter_cut=0.1,
138 overlap_cut=0.2, use_best_results=5, use_best_seeds=10, direction="backward"):
140 Convenience function to add the SVD ckf to the path.
141 :param path: The path to add the module to
142 :param cdc_reco_tracks: The name of the already created CDC reco tracks
143 :param svd_reco_tracks: The name to output the SVD reco tracks to
144 :param use_mc_truth: Use the MC information in the CKF
145 :param filter_cut: CKF parameter for MVA filter
146 :param overlap_cut: CKF parameter for MVA overlap filter
147 :param use_best_results: CKF parameter for useNResults
148 :param use_best_seeds: CKF parameter for useBestNInSeed
149 :param direction: where to extrapolate to. Valid options are forward and backward
151 if direction ==
"forward":
157 module_parameters = dict(
158 firstHighFilter=
"truth",
159 secondHighFilter=
"all",
160 thirdHighFilter=
"all",
166 module_parameters = dict(
167 firstHighFilterParameters={
"identifier":
"ckf_CDCSVDStateFilter_1",
"cut": filter_cut,
168 "direction": direction},
169 firstHighUseNStates=use_best_seeds,
171 secondHighFilterParameters={
"identifier":
"ckf_CDCSVDStateFilter_2",
"cut": filter_cut},
172 secondHighUseNStates=use_best_seeds,
174 thirdHighFilterParameters={
"identifier":
"ckf_CDCSVDStateFilter_3",
"cut": filter_cut},
175 thirdHighUseNStates=use_best_seeds,
177 filterParameters={
"cut": overlap_cut,
"identifier":
"ckf_CDCToSVDResult"},
178 useBestNInSeed=use_best_results,
181 path.add_module(
"CDCToSVDSpacePointCKF",
182 inputRecoTrackStoreArrayName=cdc_reco_tracks,
183 outputRecoTrackStoreArrayName=svd_reco_tracks,
184 outputRelationRecoTrackStoreArrayName=cdc_reco_tracks,
185 relatedRecoTrackStoreArrayName=svd_reco_tracks,
187 advanceHighFilterParameters={
"direction": direction},
188 reverseSeed=reverse_seed,
190 writeOutDirection=direction,
191 relationCheckForDirection=direction,
196 **module_parameters).set_name(f
"CDCToSVDSpacePointCKF_{direction}")
199 def add_cosmics_svd_ckf(path, cdc_reco_tracks, svd_reco_tracks, use_mc_truth=False, use_best_results=5,
200 use_best_seeds=10, direction="backward"):
202 Convenience function to add the SVD ckf to the path with cosmics settings valid for phase2 and 3.
203 :param path: The path to add the module to
204 :param cdc_reco_tracks: The name of the already created CDC reco tracks
205 :param svd_reco_tracks: The name to output the SVD reco tracks to
206 :param use_mc_truth: Use the MC information in the CKF
207 :param use_best_results: CKF parameter for useNResults
208 :param use_best_seeds: CKF parameter for useBestNInSeed
209 :param direction: where to extrapolate to. Valid options are forward and backward
211 if direction ==
"forward":
217 module_parameters = dict(
218 firstHighFilter=
"truth",
219 secondHighFilter=
"all",
220 thirdHighFilter=
"all",
226 module_parameters = dict(
230 firstHighFilter=
"non_ip_crossing",
231 firstHighFilterParameters={
"direction": direction},
232 firstHighUseNStates=0,
234 secondHighFilter=
"residual",
235 secondHighFilterParameters={},
236 secondHighUseNStates=use_best_seeds,
238 thirdHighFilter=
"residual",
239 thirdHighFilterParameters={},
240 thirdHighUseNStates=use_best_seeds,
244 useBestNInSeed=use_best_results,
247 path.add_module(
"CDCToSVDSpacePointCKF",
248 inputRecoTrackStoreArrayName=cdc_reco_tracks,
249 outputRecoTrackStoreArrayName=svd_reco_tracks,
250 outputRelationRecoTrackStoreArrayName=cdc_reco_tracks,
251 relatedRecoTrackStoreArrayName=svd_reco_tracks,
253 advanceHighFilterParameters={
"direction": direction},
254 reverseSeed=reverse_seed,
256 writeOutDirection=direction,
257 relationCheckForDirection=direction,
261 **module_parameters).set_name(f
"CDCToSVDSpacePointCKF_{direction}")
264 def add_cosmics_pxd_ckf(path, svd_cdc_reco_tracks, pxd_reco_tracks, use_mc_truth=False, use_best_results=5,
265 filter_cut=0.03, overlap_cut=0.2, use_best_seeds=10, direction="backward"):
267 Convenience function to add the PXD ckf to the path with cosmics settings valid for phase2 and 3.
268 :param path: The path to add the module to
269 :param svd_cdc_reco_tracks: The name of the already created CDC reco tracks
270 :param pxd_reco_tracks: The name to output the SVD reco tracks to
271 :param use_mc_truth: Use the MC information in the CKF
272 :param use_best_results: CKF parameter for useNResults
273 :param filter_cut: CKF parameter for MVA filter
274 :param overlap_cut: CKF parameter for MVA overlap filter
275 :param use_best_seeds: CKF parameter for useBestNInSeed
276 :param direction: where to extrapolate to. Valid options are forward and backward
278 if "PXDSpacePointCreator" not in [m.name()
for m
in path.modules()]:
279 path.add_module(
"PXDSpacePointCreator")
281 path.add_module(
"DAFRecoFitter", recoTracksStoreArrayName=svd_cdc_reco_tracks)
283 if direction ==
"forward":
289 path.add_module(
"MCRecoTracksMatcher", UsePXDHits=
False, UseSVDHits=
True, UseCDCHits=
True,
290 mcRecoTracksStoreArrayName=
"MCRecoTracks",
291 prRecoTracksStoreArrayName=svd_cdc_reco_tracks)
293 module_parameters = dict(
294 firstHighFilter=
"truth",
295 secondHighFilter=
"all",
296 thirdHighFilter=
"all",
302 module_parameters = dict(
308 firstHighFilterParameters={
"cut": filter_cut,
"identifier":
"ckf_ToPXDStateFilter_1",
309 "direction": direction},
310 firstHighUseNStates=use_best_seeds,
312 secondHighFilterParameters={
"cut": filter_cut,
"identifier":
"ckf_ToPXDStateFilter_2"},
313 secondHighUseNStates=use_best_seeds,
315 thirdHighFilterParameters={
"cut": filter_cut,
"identifier":
"ckf_ToPXDStateFilter_3"},
316 thirdHighUseNStates=use_best_seeds,
318 filterParameters={
"cut": overlap_cut,
"identifier":
"ckf_PXDTrackCombination"},
319 useBestNInSeed=use_best_results,
325 path.add_module(
"ToPXDCKF",
326 advanceHighFilterParameters={
"direction": direction},
328 writeOutDirection=direction,
330 inputRecoTrackStoreArrayName=svd_cdc_reco_tracks,
331 relatedRecoTrackStoreArrayName=pxd_reco_tracks,
332 relationCheckForDirection=direction,
334 outputRecoTrackStoreArrayName=pxd_reco_tracks,
335 outputRelationRecoTrackStoreArrayName=svd_cdc_reco_tracks,
337 reverseSeed=reverse_seed,
338 reverseSeedState=reverse_seed,
339 **module_parameters).set_name(f
"ToPXDCKF_{direction}")