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