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