Belle II Software  release-06-01-15
vxdHoughTracking_functions.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 import basf2
13 
14 
15 def add_VXDHoughTracking(path,
16  svd_space_points='SVDSpacePoints',
17  svd_clusters='SVDClusters',
18  reco_tracks='VXDHoughTrackingRecoTracks',
19  use_simple_roi_calculation=False,
20  usePXDROIFinderModule=True,
21  pxd_intercepts_name='VXDHoughTrackingPXDIntercepts',
22  rois_name='VXDHoughTrackingROIs'):
23  """
24  Convenience function to add the optimized VXDHoughTracking to the path.
25  : param path: The path to add the VXDHoughTracking module to.
26  : param reco_tracks: Name of the StoreArray containing the RecoTracks found by VXDHoughTracking
27  : param use_simple_roi_calculation: Use a simple ROI calculation with a circle extrapolation in r-phi
28  and a straight line extrapolation in theta
29  : param usePXDROIFinderModule: Calculate ROI using the PXDROIFinderModule
30  : param pxd_intercepts_name: Name of the StoreArray containing the PXDIntercepts calculated by VXDHoughTracking.
31  If both simple and advanced ROI finding are selected, the StoreArray for the advanced ROI finding will get
32  the prefix PXDROIFinder,
33  : param rois_name: Name of the StoreArray containing the ROIs calculated by VXDHoughTracking.
34  If both simple and advanced ROI finding are selected, the StoreArray for the advanced ROI finding will get
35  the prefix PXDROIFinder,
36  """
37 
38  advancedPXDInterceptsName = pxd_intercepts_name
39  advancedROIName = rois_name
40  # If both simple VXDHoughTracking ROI finding and regular ROI finding using the PXDROIFinder with the RecoTracks found by
41  # VXDHoughTracking shall be performed, set a different name for the PXDInterecepts and the ROIs from the PXDROIFinder
42  # (advancedPXDInterceptsName and advancedROINames) to be able to distinguish them.
43  if use_simple_roi_calculation and usePXDROIFinderModule:
44  advancedPXDInterceptsName = 'PXDROIFinder' + advancedPXDInterceptsName
45  advancedROIName = 'PXDROIFinder' + advancedROIName
46 
47  path.add_module('VXDHoughTracking',
48  SVDSpacePointStoreArrayName=svd_space_points,
49  SVDClustersStoreArrayName=svd_clusters,
50  finalOverlapResolverNameSVDClusters=svd_clusters,
51  refinerOverlapResolverNameSVDClusters=svd_clusters,
52  RecoTracksStoreArrayName=reco_tracks,
53 
54  relationFilter='angleAndTime',
55  relationFilterParameters={'AngleAndTimeThetaCutDeltaL0': 0.03,
56  'AngleAndTimeThetaCutDeltaL1': 0.10,
57  'AngleAndTimeThetaCutDeltaL2': 0.20,
58  'AngleAndTimeDeltaUTime': 15.,
59  'AngleAndTimeDeltaVTime': 15., },
60 
61  twoHitUseNBestHits=5,
62  threeHitUseNBestHits=5,
63  fourHitUseNBestHits=3,
64  fiveHitUseNBestHits=2,
65  )
66 
67  if usePXDROIFinderModule:
68 
69  if 'SetupGenfitExtrapolation' not in path:
70  path.add_module('SetupGenfitExtrapolation').set_name('SetupGenfitExtrapolationForVXDHoughTracking')
71 
72  # TRACK FITTING
73  path.add_module('DAFRecoFitter', recoTracksStoreArrayName=reco_tracks).set_name('VXDHoughTracking-only DAFRecoFitter')
74 
75  path.add_module('PXDROIFinder',
76  recoTrackListName=reco_tracks,
77  PXDInterceptListName=advancedPXDInterceptsName,
78  ROIListName=advancedROIName,
79  tolerancePhi=0.15,
80  toleranceZ=0.5,
81  sigmaSystU=0.02,
82  sigmaSystV=0.02,
83  numSigmaTotU=10,
84  numSigmaTotV=10,
85  maxWidthU=0.5,
86  maxWidthV=0.5,).set_name('VXDHoughTrackingPXDROIFinder')