Belle II Software development
SVDValidationTrackingPerformance.py
1# !/usr/bin/env python3
2
3
10
11"""
12<header>
13 <input>SVDValidationTTreeRecoTrack.root</input>
14 <input>SVDValidationTTreeSpacePoint.root</input>
15 <output>SVDTrackingPerformance.root</output>
16 <description>
17 Validation plots related to tracking performance.
18 </description>
19 <contact>
20 SVD Software Group, svd-software@belle2.org
21 </contact>
22</header>
23"""
24
25import ROOT as R
26import plotUtils as pu
27
28inputRT = R.TFile.Open("../SVDValidationTTreeRecoTrack.root")
29inputSP = R.TFile.Open("../SVDValidationTTreeSpacePoint.root")
30
31treeRT = inputRT.Get("tree")
32treeSP = inputSP.Get("tree")
33
34histsTP = R.TFile.Open("SVDTrackingPerformance.root", "recreate")
35
36
37pu.plotter(
38 name='SpacePointTime_U',
39 title='SpacePoint time on U side',
40 nbins=200,
41 xmin=-100,
42 xmax=100,
43 x_label='SP-u time (ns)',
44 y_label='counts',
45 granules=pu.gD2,
46 tree=treeSP,
47 expr='time_u',
48 cut='',
49 descr='Time of the U cluster in the Space Point. Distribution for all clusters: signal + background.',
50 check='Signal peaks around 0.',
51 isShifter=True)
52
53
54pu.plotter(
55 name='SpacePointTime_V',
56 title='SpacePoint time on V side',
57 nbins=200,
58 xmin=-100,
59 xmax=100,
60 x_label='SP-v time (ns)',
61 y_label='counts',
62 granules=pu.gD2,
63 tree=treeSP,
64 expr='time_v',
65 cut='',
66 descr='Time of the V cluster which belong to SP. Distribution for all clusters: signal + background.',
67 check='Signal peaks around 0.',
68 isShifter=True)
69
70
71pu.plotter(
72 name='cluster_UVTimeDiff',
73 title='U-V time difference',
74 nbins=80,
75 xmin=-20,
76 xmax=20,
77 x_label='Cluster time difference (ns)',
78 y_label='counts',
79 granules=pu.gD2,
80 tree=treeRT,
81 expr='cluster_UVTimeDiff',
82 cut="",
83 descr='Time difference between opposite sides of clusters belonging to the same layer.\
84 Distribution for signal clusters.',
85 check='Signal peaks around 0.',
86 isShifter=True)
87
88
89pu.plotter(
90 name='cluster_UUTimeDiff',
91 title='U-U time difference',
92 nbins=80,
93 xmin=-20,
94 xmax=20,
95 x_label='Cluster time difference (ns)',
96 y_label='counts',
97 granules=pu.granulesTD,
98 tree=treeRT,
99 expr='cluster_UUTimeDiff',
100 cut=pu.cut_U,
101 descr='Time difference between clusters belonging to the neighbour layers.\
102 Distribution for signal clusters.',
103 check='Signal peaks around 0.',
104 isShifter=True)
105
106
107pu.plotter(
108 name='cluster_VVTimeDiff',
109 title='V-V time difference',
110 nbins=80,
111 xmin=-20,
112 xmax=20,
113 x_label='Cluster time difference (ns)',
114 y_label='counts',
115 granules=pu.granulesTD,
116 tree=treeRT,
117 expr='cluster_VVTimeDiff',
118 cut=pu.cut_V,
119 descr='Time difference between clusters belonging to the neighbour layers.\
120 Distribution for signal clusters.',
121 check='Signal peaks around 0.',
122 isShifter=True)
123
124
125pu.plotRegions(
126 name='ClusterizationPurity_U',
127 title='Purity of clusters from tracks for U side',
128 x_label='SVD regions',
129 y_label='Purity',
130 granules=pu.granulesLayersTypes,
131 tree=treeRT,
132 expr='strip_dir',
133 cutALL=pu.cut_U,
134 cut=pu.cut_U + pu.cut_matched,
135 descr='Definition: (number of clusters related to at least one TrueHit) / (number of clusters).\
136 Evaluates the fraction of signal cluster over the total number of signal and background clusters.',
137 check='Should be close to 1 in all bins',
138 isShifter=True)
139
140
141pu.plotRegions(
142 name='ClusterizationPurity_V',
143 title='Purity of clusters from tracks for V side',
144 x_label='SVD regions',
145 y_label='Purity',
146 granules=pu.granulesLayersTypes,
147 tree=treeRT,
148 expr='strip_dir',
149 cutALL=pu.cut_V,
150 cut=pu.cut_V + pu.cut_matched,
151 descr='Definition: (number of clusters related to at least one TrueHit) / (number of clusters).\
152 Evaluates the fraction of signal cluster over the total number of signal and background clusters.',
153 check='Should be close to 1 in all bins.',
154 isShifter=True)
155
156
157pu.plotter(
158 name='clusters_number',
159 title='Number of clusters in one track',
160 nbins=12,
161 xmin=0,
162 xmax=13,
163 x_label='Number of clusters in one track',
164 y_label='counts',
165 granules=pu.granulesL3456,
166 tree=treeRT,
167 expr='clusters_number',
168 cut=pu.cut_U,
169 descr='Number of all clusters (signal + background) in one track.',
170 check='An average of 8 is expected (one cluster on each side of each layer).',
171 isShifter=True)