13@peelers.format_crop_keys
14def peel_segment2d(segment, key="{part_name}"):
15 superlayer_id = segment.getISuperLayer()
17 supercluster_id = segment.getISuperCluster()
19 trajectory2d = segment.getTrajectory2D()
20 trajectory2d_crops = peel_trajectory2d(trajectory2d, key=
"{part_name}")
24 superlayer_id=superlayer_id,
25 supercluster_id=supercluster_id,
26 stereo_kind=segment.getStereoKind(),
29 crops.update(trajectory2d_crops)
33@peelers.format_crop_keys
34def peel_trajectory2d(trajectory2d, key="{part_name}"):
35 chi2 = trajectory2d.getChi2()
36 ndf = trajectory2d.getNDF()
37 is_fitted = trajectory2d.isFitted()
40 curvature_estimate = trajectory2d.getCurvature()
41 curvature_variance = trajectory2d.getLocalVariance(i_curv)
47 p_value=prob(chi2, ndf),
48 curvature_estimate=curvature_estimate,
49 curvature_variance=curvature_variance,
53@peelers.format_crop_keys
54def peel_trajectory3d(trajectory3d, key="{part_name}"):
58 curvature_estimate = trajectory3d.getCurvatureXY()
59 curvature_variance = trajectory3d.getLocalVariance(i_curv)
61 tan_lambda_estimate = trajectory3d.getTanLambda()
62 tan_lambda_variance = trajectory3d.getLocalVariance(i_tan_lambda)
64 chi2 = trajectory3d.getChi2()
65 ndf = trajectory3d.getNDF()
70 p_value=prob(chi2, ndf),
71 curvature_estimate=curvature_estimate,
72 curvature_variance=curvature_variance,
73 tan_lambda_estimate=tan_lambda_estimate,
74 tan_lambda_variance=tan_lambda_variance,
78@peelers.format_crop_keys
79def peel_segment_pair(segment_pair, key="{part_name}"):
80 from_segment = segment_pair.getFromSegment()
81 to_segment = segment_pair.getToSegment()
83 from_segment_crops = peel_segment2d(from_segment, key=
"from_{part_name}")
84 to_segment_crops = peel_segment2d(to_segment, key=
"to_{part_name}")
86 sorted_superlayer_ids = sorted([from_segment_crops[
"from_superlayer_id"],
87 to_segment_crops[
"to_superlayer_id"]])
89 superlayer_id_pair = 10.0 * sorted_superlayer_ids[1] + sorted_superlayer_ids[0]
91 trajectory3d = segment_pair.getTrajectory3D()
92 trajectory3d_crops = peel_trajectory3d(trajectory3d, key=
"{part_name}")
95 superlayer_id_pair=superlayer_id_pair
98 crops.update(from_segment_crops)
99 crops.update(to_segment_crops)
100 crops.update(trajectory3d_crops)