Belle II Software  release-06-01-15
SVDValidationClusterPerformance.py
1 # !/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 """
13 <header>
14  <input>SVDValidationTTreeTrueHit.root</input>
15  <input>SVDValidationTTreeCluster.root</input>
16  <output>SVDClusterPerformance.root</output>
17  <description>
18  Validation plots related to cluster performance.
19  </description>
20  <contact>
21  SVD Software Group, svd-software@belle2.org
22  </contact>
23 </header>
24 """
25 
26 import ROOT as R
27 
28 import plotUtils as pu
29 
30 inputTH = R.TFile.Open("../SVDValidationTTreeTrueHit.root")
31 inputC = R.TFile.Open("../SVDValidationTTreeCluster.root")
32 
33 treeTH = inputTH.Get("tree")
34 treeC = inputC.Get("tree")
35 
36 histsCP = R.TFile.Open("SVDClusterPerformance.root", "recreate")
37 
38 
39 pu.plotter(
40  name='ClusterTime',
41  title='Cluster time',
42  nbins=200,
43  xmin=-100,
44  xmax=100,
45  x_label='Cluster time (ns)',
46  y_label='counts',
47  granules=pu.gD,
48  tree=treeC,
49  expr='cluster_clsTime',
50  cut=pu.cut_oneTH,
51  descr='Reconstructed time of the cluster for all clusters related to one TrueHit.\
52  Distribution for signal clusters.',
53  check='Distribution peak around 0.',
54  isShifter=True)
55 
56 
57 pu.plotter(
58  name='PositionResidual',
59  title='Cluster position residual',
60  nbins=100,
61  xmin=-0.01,
62  xmax=0.01,
63  x_label='Cluster position residual (cm)',
64  y_label='counts',
65  granules=pu.gD,
66  tree=treeC,
67  expr='cluster_position - truehit_position',
68  cut=pu.cut_oneTH,
69  descr='Definition: (reconstructed position of the cluster) - (position of the TrueHit).\
70  Distribution for signal clusters.',
71  check='Distribution peak around 0.',
72  isShifter=False)
73 
74 
75 pu.plotter(
76  name='PositionResidual_size1',
77  title='Cluster position residual for one strip',
78  nbins=100,
79  xmin=-0.01,
80  xmax=0.01,
81  x_label='Cluster position residual (cm)',
82  y_label='counts',
83  granules=pu.gD,
84  tree=treeC,
85  expr='cluster_position - truehit_position',
86  cut=pu.cut_oneTH+pu.cut_size1,
87  descr='Definition: (reconstructed position of the cluster) - (position of the TrueHit).\
88  Distribution for signal clusters.',
89  check='Distribution peak around 0.',
90  isShifter=False)
91 
92 
93 pu.plotter(
94  name='PositionResidual_size2',
95  title='Cluster position residual for two strips',
96  nbins=100,
97  xmin=-0.01,
98  xmax=0.01,
99  x_label='Cluster position residual (cm)',
100  y_label='counts',
101  granules=pu.gD,
102  tree=treeC,
103  expr='cluster_position - truehit_position',
104  cut=pu.cut_oneTH+pu.cut_size2,
105  descr='Definition: (reconstructed position of the cluster) - (position of the TrueHit).\
106  Distribution for signal clusters.',
107  check='Distribution peak around 0.',
108  isShifter=False)
109 
110 
111 pu.plotter(
112  name='PositionResidual_size3plus',
113  title='Cluster position residual for 3 or more strips',
114  nbins=100,
115  xmin=-0.01,
116  xmax=0.01,
117  x_label='Cluster position residual (cm)',
118  y_label='counts',
119  granules=pu.gD,
120  tree=treeC,
121  expr='cluster_position - truehit_position',
122  cut=pu.cut_oneTH+pu.cut_size3plus,
123  descr='Definition: (reconstructed position of the cluster) - (position of the TrueHit).\
124  Distribution for signal clusters.',
125  check='Distribution peak around 0.',
126  isShifter=False)
127 
128 
129 pu.plotter(
130  name='PositionPull',
131  title='Cluster position pull',
132  nbins=100,
133  xmin=-5,
134  xmax=5,
135  x_label='Cluster position pull',
136  y_label='counts',
137  granules=pu.gD,
138  tree=treeC,
139  expr='(cluster_position - truehit_position)/cluster_positionSigma',
140  cut=pu.cut_oneTH,
141  descr='Definition: (cluster_position - truehit_position)/cluster_positionSigma.\
142  Distribution for signal clusters.',
143  check='Distribution peaks around 0 with RMS less than 2.0.',
144  isShifter=True)
145 
146 
147 pu.plotter(
148  name='PositionPull_size1',
149  title='Cluster position pull for one strip',
150  nbins=100,
151  xmin=-5,
152  xmax=5,
153  x_label='Cluster position pull',
154  y_label='counts',
155  granules=pu.gD,
156  tree=treeC,
157  expr='(cluster_position - truehit_position)/cluster_positionSigma',
158  cut=pu.cut_oneTH+pu.cut_size1,
159  descr='Definition: (cluster_position - truehit_position)/cluster_positionSigma.\
160  Distribution for signal clusters.',
161  check='Distribution peaks around 0 with RMS less than 2.0.',
162  isShifter=False)
163 
164 
165 pu.plotter(
166  name='PositionPull_size2',
167  title='Cluster position pull for two strip',
168  nbins=100,
169  xmin=-5,
170  xmax=5,
171  x_label='Cluster position pull',
172  y_label='counts',
173  granules=pu.gD,
174  tree=treeC,
175  expr='(cluster_position - truehit_position)/cluster_positionSigma',
176  cut=pu.cut_oneTH+pu.cut_size2,
177  descr='Definition: (cluster_position - truehit_position)/cluster_positionSigma.\
178  Distribution for signal clusters.',
179  check='Distribution peaks around 0 with RMS less than 2.0.',
180  isShifter=False)
181 
182 
183 pu.plotter(
184  name='PositionPull_size3plus',
185  title='Cluster position pull for 3 or more strips',
186  nbins=100,
187  xmin=-5,
188  xmax=5,
189  x_label='Cluster position pull',
190  y_label='counts',
191  granules=pu.gD,
192  tree=treeC,
193  expr='(cluster_position - truehit_position)/cluster_positionSigma',
194  cut=pu.cut_oneTH+pu.cut_size3plus,
195  descr='Definition: (cluster_position - truehit_position)/cluster_positionSigma.\
196  Distribution for signal clusters.',
197  check='Distribution peaks around 0 with RMS less than 2.0.',
198  isShifter=False)
199 
200 
201 pu.plotter(
202  name='TimeResolution',
203  title='Cluster time resolution',
204  nbins=200,
205  xmin=-100,
206  xmax=100,
207  x_label='Cluster time resolution (ns)',
208  y_label='counts',
209  granules=pu.gD,
210  tree=treeC,
211  expr='cluster_clsTime - truehit_time',
212  cut=pu.cut_oneTH,
213  descr='Definition: (reconstructed time of the cluster) - (time of the TrueHit)\
214  for all signal clusters.',
215  check='Distribution peak around 0.',
216  isShifter=False)
217 
218 
219 pu.plotter(
220  name='ClusterCharge',
221  title='Cluster charge',
222  nbins=50,
223  xmin=0,
224  xmax=120000,
225  x_label='Cluster charge (# of electrons)',
226  y_label='counts',
227  granules=pu.gD,
228  tree=treeC,
229  expr='cluster_charge',
230  cut=pu.cut_oneTH,
231  descr='Reconstructed charge of the cluster related to one TrueHit.\
232  Distribution for signal clusters.',
233  check='Distribution peaks around 20-40 ke.',
234  isShifter=True)
235 
236 pu.plotter(
237  name='ClusterSN',
238  title='Cluster Signal/Noise ratio',
239  nbins=121,
240  xmin=-0.5,
241  xmax=120.5,
242  x_label='cluster SNR',
243  y_label='counts',
244  granules=pu.gD,
245  tree=treeC,
246  expr='cluster_snr',
247  cut=pu.cut_oneTH,
248  descr='Signal/Noise ratio of the cluster related to one TrueHit. Distribution for signal clusters.',
249  check='Distribution peaks around 20.',
250  isShifter=True)
251 
252 pu.plotter(
253  name='InterstripPosition',
254  title='Interstrip position',
255  nbins=50,
256  xmin=0.0,
257  xmax=1.0,
258  x_label='Interstrip Position',
259  y_label='counts',
260  granules=pu.gD,
261  tree=treeC,
262  expr='cluster_interstripPosition',
263  cut=pu.cut_oneTH,
264  descr='Definition: (cluster_position % strip_pitch / strip_pitch).\
265  Distribution for signal clusters.',
266  check='',
267  isShifter=False)
268 
269 pu.plotter(
270  name='ClusterSize',
271  title='Cluster size',
272  nbins=9,
273  xmin=0.5,
274  xmax=9.5,
275  x_label='Cluster size (# of strips in cluster)',
276  y_label='counts',
277  granules=pu.gD,
278  tree=treeC,
279  expr='cluster_size',
280  cut=pu.cut_oneTH,
281  descr='Number of strips in the Cluster related to one TrueHit. Distribution for signal clusters.',
282  check='Distribution peaks in range 2-3.',
283  isShifter=False)
284 
285 pu.plotRegions(
286  name='ClusterizationEfficiency_U',
287  title='Efficiency of clusterization for U side',
288  x_label='SVD regions',
289  y_label='Efficiency',
290  granules=pu.granulesLayersTypes,
291  tree=treeTH,
292  expr='strip_dir',
293  cutALL=pu.cut_noV,
294  cut=pu.cut_U,
295  descr='Definition: (number of clusters related to TrueHit) / (number of Truehits)',
296  check='Efficiency should be close to 1 in all bins.',
297  isShifter=True)
298 
299 
300 pu.plotRegions(
301  name='ClusterizationEfficiency_V',
302  title='Efficiency of clusterization for V side',
303  x_label='SVD regions',
304  y_label='Efficiency',
305  granules=pu.granulesLayersTypes,
306  tree=treeTH,
307  expr='strip_dir',
308  cutALL=pu.cut_noU,
309  cut=pu.cut_V,
310  descr='Definition: (number of clusters related to TrueHit) / (number of Truehits).',
311  check='Efficiency should be close to 1 in all bins.',
312  isShifter=True)
313 
314 
315 pu.plotRegions(
316  name='ClusterizationPurity_U',
317  title='Purity of clusterization for U side',
318  x_label='SVD regions',
319  y_label='Purity',
320  granules=pu.granulesLayersTypes,
321  tree=treeC,
322  expr='strip_dir',
323  cutALL=pu.cut_noV,
324  cut=pu.cut_oneTH,
325  descr='(number of clusters related to one TrueHit) / (number of clusters).\
326  Evaluates the fraction of signal cluster over the total number of signal and background clusters.',
327  check='Purity should be above 0 in all bins.',
328  isShifter=True)
329 
330 
331 pu.plotRegions(
332  name='ClusterizationPurity_V',
333  title='Purity of clusterization for V side',
334  x_label='SVD regions',
335  y_label='Purity',
336  granules=pu.granulesLayersTypes,
337  tree=treeC,
338  expr='strip_dir',
339  cutALL=pu.cut_noU,
340  cut=pu.cut_oneTH,
341  descr='(number of clusters related to one TrueHit) / (number of clusters).\
342  Evaluates the fraction of signal cluster over the total number of signal and background clusters.',
343  check='Purity should be above 0 in all bins.',
344  isShifter=True)