Belle II Software  release-08-01-10
OverlapResidualsModule.cc
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 #include <tracking/modules/VXDOverlaps/OverlapResidualsModule.h>
10 #include <framework/datastore/StoreArray.h>
11 #include <framework/gearbox/Unit.h>
12 #include <framework/core/Environment.h>
13 #include <svd/dataobjects/SVDCluster.h>
14 #include <svd/dataobjects/SVDRecoDigit.h>
15 #include <svd/dataobjects/SVDShaperDigit.h>
16 #include <svd/dataobjects/SVDTrueHit.h>
17 #include <vxd/dataobjects/VxdID.h>
18 #include <vxd/geometry/GeoCache.h>
19 #include <vxd/geometry/SensorInfoBase.h>
20 #include <tracking/dataobjects/RecoTrack.h>
21 #include <tracking/dataobjects/RecoHitInformation.h>
22 #include <genfit/TrackPoint.h>
23 #include <Math/Vector3D.h>
24 #include <TDirectory.h>
25 #include <Math/Boost.h>
26 #include <math.h>
27 #include <iostream>
28 #include <algorithm>
29 #include <mdst/dataobjects/Track.h>
30 #include <mdst/dataobjects/TrackFitResult.h>
31 
32 using namespace Belle2;
33 
34 
35 //-----------------------------------------------------------------
36 // Register the Module
37 //-----------------------------------------------------------------
38 REG_MODULE(OverlapResiduals);
39 
40 //-----------------------------------------------------------------
41 // Implementation
42 //-----------------------------------------------------------------
43 
45 {
46  //Set module properties
47  setDescription("The module studies consecutive hits in overlapping sensors of a same VXD layer, and the differences of their residuals, to monitor the detector alignment.");
48  //Parameter to take only specific RecoTracks as input
49  addParam("recoTracksStoreArrayName", m_recoTracksStoreArrayName, "StoreArray name of the input and output RecoTracks.",
51  //Parameter to produce TTrees storing global information on VXD overlaps
52  addParam("ExpertLevel", m_ExpertLevel,
53  "If set, enables the production of TTrees containing low level information on PXD and SVD overlaps", false);
54 }
55 
57 {
59  recoTracks.isOptional();
60  //Register histograms (calls back defineHisto)
61  REG_HISTOGRAM
62 }
63 
65 {
66  //Create directory to store monitoring histograms
67  TDirectory* oldDir = gDirectory;
68  TDirectory* ResDir = oldDir->mkdir("Monitoring_VXDOverlaps");
69  ResDir->cd();
70  //Define histograms of residuals differences
71  h_U_DeltaRes = new TH1F("h_U_DeltaRes", "Histrogram of residual difference #Delta res_{u} for overlapping hits", 100, -1000, 1000);
72  h_U_DeltaRes->GetXaxis()->SetTitle("#Delta res_{u} (#mum)");
73  h_U_DeltaRes->GetYaxis()->SetTitle("counts");
74  h_V_DeltaRes = new TH1F("h_V_DeltaRes", "Histrogram of residual difference #Delta res_{v} for overlapping hits", 100, -1000, 1000);
75  h_V_DeltaRes->GetXaxis()->SetTitle("#Delta res_{v} (#mum)");
76  h_V_DeltaRes->GetYaxis()->SetTitle("counts");
77  h_U_DeltaRes_PXD = new TH1F("h_U_DeltaRes_PXD", "Histrogram of residual difference #Delta res_{u} for overlapping PXD hits", 100,
78  -1000, 1000);
79  h_U_DeltaRes_PXD->GetXaxis()->SetTitle("#Delta res_{u} (#mum)");
80  h_U_DeltaRes_PXD->GetYaxis()->SetTitle("counts");
81  h_U_DeltaRes_PXD_Lyr1 = new TH1F("h_U_DeltaRes_PXD_Lyr1",
82  "Layer1: histrogram of residual difference #Delta res_{u} for overlapping PXD hits", 100, -1000, 1000);
83  h_U_DeltaRes_PXD_Lyr1->GetXaxis()->SetTitle("#Delta res_{u} (#mum)");
84  h_U_DeltaRes_PXD_Lyr1->GetYaxis()->SetTitle("counts");
85  h_U_DeltaRes_PXD_Lyr2 = new TH1F("h_U_DeltaRes_PXD_Lyr2",
86  "Layer 2: hstrogram of residual difference #Delta res_{u} for overlapping PXD hits", 100, -1000, 1000);
87  h_U_DeltaRes_PXD_Lyr2->GetXaxis()->SetTitle("#Delta res_{u} (#mum)");
88  h_U_DeltaRes_PXD_Lyr2->GetYaxis()->SetTitle("counts");
89  h_V_DeltaRes_PXD = new TH1F("h_V_DeltaRes_PXD", "Histrogram of residual difference #Delta res_{v} for overlapping PXD hits", 100,
90  -1000, 1000);
91  h_V_DeltaRes_PXD->GetXaxis()->SetTitle("#Delta res_{v} (#mum)");
92  h_V_DeltaRes_PXD->GetYaxis()->SetTitle("counts");
93  h_V_DeltaRes_PXD_Lyr1 = new TH1F("h_V_DeltaRes_PXD_Lyr1",
94  "Layer 1: histrogram of residual difference #Delta res_{v} for overlapping PXD hits", 100, -1000, 1000);
95  h_V_DeltaRes_PXD_Lyr1->GetXaxis()->SetTitle("#Delta res_{v} (#mum)");
96  h_V_DeltaRes_PXD_Lyr1->GetYaxis()->SetTitle("counts");
97  h_V_DeltaRes_PXD_Lyr2 = new TH1F("h_V_DeltaRes_PXD_Lyr2",
98  "Layer 2: histrogram of residual difference #Delta res_{v} for overlapping PXD hits", 100, -1000, 1000);
99  h_V_DeltaRes_PXD_Lyr2->GetXaxis()->SetTitle("#Delta res_{v} (#mum)");
100  h_V_DeltaRes_PXD_Lyr2->GetYaxis()->SetTitle("counts");
101  h_U_DeltaRes_SVD = new TH1F("h_U_DeltaRes_SVD", "Histrogram of residual difference #Delta res_{u} for overlapping SVD hits", 100,
102  -1000, 1000);
103  h_U_DeltaRes_SVD->GetXaxis()->SetTitle("#Delta res_{u} (#mum)");
104  h_U_DeltaRes_SVD->GetYaxis()->SetTitle("counts");
105  h_U_DeltaRes_SVD_Lyr3 = new TH1F("h_U_DeltaRes_SVD_Lyr3",
106  "Layer 3: histrogram of residual difference #Delta res_{u} for overlapping SVD hits", 100, -1000, 1000);
107  h_U_DeltaRes_SVD_Lyr3->GetXaxis()->SetTitle("#Delta res_{u} (#mum)");
108  h_U_DeltaRes_SVD_Lyr3->GetYaxis()->SetTitle("counts");
109  h_U_DeltaRes_SVD_Lyr4 = new TH1F("h_U_DeltaRes_SVD_Lyr4",
110  "Layer 4: histrogram of residual difference #Delta res_{u} for overlapping SVD hits", 100, -1000, 1000);
111  h_U_DeltaRes_SVD_Lyr4->GetXaxis()->SetTitle("#Delta res_{u} (#mum)");
112  h_U_DeltaRes_SVD_Lyr4->GetYaxis()->SetTitle("counts");
113  h_U_DeltaRes_SVD_Lyr5 = new TH1F("h_U_DeltaRes_SVD_Lyr5",
114  "Layer 5: histrogram of residual difference #Delta res_{u} for overlapping SVD hits", 100, -1000, 1000);
115  h_U_DeltaRes_SVD_Lyr5->GetXaxis()->SetTitle("#Delta res_{u} (#mum)");
116  h_U_DeltaRes_SVD_Lyr5->GetYaxis()->SetTitle("counts");
117  h_U_DeltaRes_SVD_Lyr6 = new TH1F("h_U_DeltaRes_SVD_Lyr6",
118  "Layer 6: histrogram of residual difference #Delta res_{u} for overlapping SVD hits", 100, -1000, 1000);
119  h_U_DeltaRes_SVD_Lyr6->GetXaxis()->SetTitle("#Delta res_{u} (#mum)");
120  h_U_DeltaRes_SVD_Lyr6->GetYaxis()->SetTitle("counts");
121  h_V_DeltaRes_SVD = new TH1F("h_V_DeltaRes_SVD", "Histrogram of residual difference #Delta res_{v} for overlapping SVD hits", 100,
122  -1000, 1000);
123  h_V_DeltaRes_SVD->GetXaxis()->SetTitle("#Delta res_{v} (#mum)");
124  h_V_DeltaRes_SVD->GetYaxis()->SetTitle("counts");
125  h_V_DeltaRes_SVD_Lyr3 = new TH1F("h_V_DeltaRes_SVD_Lyr3",
126  "Layer 3: histrogram of residual difference #Delta res_{v} for overlapping SVD hits", 100, -1000, 1000);
127  h_V_DeltaRes_SVD_Lyr3->GetXaxis()->SetTitle("#Delta res_{v} (#mum)");
128  h_V_DeltaRes_SVD_Lyr3->GetYaxis()->SetTitle("counts");
129  h_V_DeltaRes_SVD_Lyr4 = new TH1F("h_V_DeltaRes_SVD_Lyr4",
130  "Layer 4: histrogram of residual difference #Delta res_{v} for overlapping SVD hits", 100, -1000, 1000);
131  h_V_DeltaRes_SVD_Lyr4->GetXaxis()->SetTitle("#Delta res_{v} (#mum)");
132  h_V_DeltaRes_SVD_Lyr4->GetYaxis()->SetTitle("counts");
133  h_V_DeltaRes_SVD_Lyr5 = new TH1F("h_V_DeltaRes_SVD_Lyr5",
134  "Layer 5: histrogram of residual difference #Delta res_{v} for overlapping SVD hits", 100, -1000, 1000);
135  h_V_DeltaRes_SVD_Lyr5->GetXaxis()->SetTitle("#Delta res_{v} (#mum)");
136  h_V_DeltaRes_SVD_Lyr5->GetYaxis()->SetTitle("counts");
137  h_V_DeltaRes_SVD_Lyr6 = new TH1F("h_V_DeltaRes_SVD_Lyr6",
138  "Layer 6: histrogram of residual difference #Delta res_{v} for overlapping SVD hits", 100, -1000, 1000);
139  h_V_DeltaRes_SVD_Lyr6->GetXaxis()->SetTitle("#Delta res_{v} (#mum)");
140  h_V_DeltaRes_SVD_Lyr6->GetYaxis()->SetTitle("counts");
141  h_SVDstrips_Mult = new TH1F("h_SVDstrips_Mult", "SVD strips multipicity for SVD clusters in overlapping sensors", 15, 0.5, 15.5);
142  h_SVDstrips_Mult->GetXaxis()->SetTitle("N. of SVD strips contributing to the cluster");
143  h_SVDstrips_Mult->GetYaxis()->SetTitle("counts");
144  //Define 2D histograms: difference of u-residuals vs phi of VXD overlaps for each layer (1 to 6)
145  h_DeltaResUPhi_Lyr1 = new TH2F("h_DeltaResUPhi_Lyr1", "Layer 1: #Delta res_{u} vs #phi", 200, -3.4, 3.4, 100, -200, 200);
146  h_DeltaResUPhi_Lyr1->GetXaxis()->SetTitle("#phi(rad)");
147  h_DeltaResUPhi_Lyr1->GetYaxis()->SetTitle("#Delta res_{u} (#mum)");
148  h_DeltaResUPhi_Lyr2 = new TH2F("h_DeltaResUPhi_Lyr2", "Layer 2: #Delta res_{u} vs #phi", 200, -3.4, 3.4, 100, -200, 200);
149  h_DeltaResUPhi_Lyr2->GetXaxis()->SetTitle("#phi(rad)");
150  h_DeltaResUPhi_Lyr2->GetYaxis()->SetTitle("#Delta res_{u} (#mum)");
151  h_DeltaResUPhi_Lyr3 = new TH2F("h_DeltaResUPhi_Lyr3", "Layer 3: #Delta res_{u} vs #phi", 200, -3.4, 3.4, 100, -1000, 1000);
152  h_DeltaResUPhi_Lyr3->GetXaxis()->SetTitle("#phi(rad)");
153  h_DeltaResUPhi_Lyr3->GetYaxis()->SetTitle("#Delta res_{u} (#mum)");
154  h_DeltaResUPhi_Lyr4 = new TH2F("h_DeltaResUPhi_Lyr4", "Layer 4: #Delta res_{u} vs #phi", 200, -3.4, 3.4, 100, -1000, 1000);
155  h_DeltaResUPhi_Lyr4->GetXaxis()->SetTitle("#phi(rad)");
156  h_DeltaResUPhi_Lyr4->GetYaxis()->SetTitle("#Delta res_{u} (#mum)");
157  h_DeltaResUPhi_Lyr5 = new TH2F("h_DeltaResUPhi_Lyr5", "Layer 5: #Delta res_{u} vs #phi", 200, -3.4, 3.4, 100, -1000, 1000);
158  h_DeltaResUPhi_Lyr5->GetXaxis()->SetTitle("#phi(rad)");
159  h_DeltaResUPhi_Lyr5->GetYaxis()->SetTitle("#Delta res_{u} (#mum)");
160  h_DeltaResUPhi_Lyr6 = new TH2F("h_DeltaResUPhi_Lyr6", "Layer 6: #Delta res_{u} vs #phi", 200, -3.4, 3.4, 100, -1000, 1000);
161  h_DeltaResUPhi_Lyr6->GetXaxis()->SetTitle("#phi(rad)");
162  h_DeltaResUPhi_Lyr6->GetYaxis()->SetTitle("#Delta res_{u} (#mum)");
163  //Define 2D histograms: difference of u-residuals vs z of VXD overlaps for each layer (1 to 6)
164  h_DeltaResUz_Lyr1 = new TH2F("h_DeltaResUz_Lyr1", "Layer 1: #Delta res_{u} vs z", 100, -4, 8, 100, -200, 200);
165  h_DeltaResUz_Lyr1->GetXaxis()->SetTitle("z (cm)");
166  h_DeltaResUz_Lyr1->GetYaxis()->SetTitle("#Delta res_{u} (#mum)");
167  h_DeltaResUz_Lyr2 = new TH2F("h_DeltaResUz_Lyr2", "Layer 2: #Delta res_{u} vs z", 100, -10, 15, 100, -200, 200);
168  h_DeltaResUz_Lyr2->GetXaxis()->SetTitle("z (cm)");
169  h_DeltaResUz_Lyr2->GetYaxis()->SetTitle("#Delta res_{u} (#mum)");
170  h_DeltaResUz_Lyr3 = new TH2F("h_DeltaResUz_Lyr3", "Layer 3: #Delta res_{u} vs z", 250, -15, 20, 100, -1000, 1000);
171  h_DeltaResUz_Lyr3->GetXaxis()->SetTitle("z (cm)");
172  h_DeltaResUz_Lyr3->GetYaxis()->SetTitle("#Delta res_{u} (#mum)");
173  h_DeltaResUz_Lyr4 = new TH2F("h_DeltaResUz_Lyr4", "Layer 4: #Delta res_{u} vs z", 250, -20, 25, 100, -1000, 1000);
174  h_DeltaResUz_Lyr4->GetXaxis()->SetTitle("z (cm)");
175  h_DeltaResUz_Lyr4->GetYaxis()->SetTitle("#Delta res_{u} (#mum)");
176  h_DeltaResUz_Lyr5 = new TH2F("h_DeltaResUz_Lyr5", "Layer 5: #Delta res_{u} vs z", 250, -25, 35, 100, -1000, 1000);
177  h_DeltaResUz_Lyr5->GetXaxis()->SetTitle("z (cm)");
178  h_DeltaResUz_Lyr5->GetYaxis()->SetTitle("#Delta res_{u} (#mum)");
179  h_DeltaResUz_Lyr6 = new TH2F("h_DeltaResUz_Lyr6", "Layer 6: #Delta res_{u} vs z", 250, -30, 45, 100, -1000, 1000);
180  h_DeltaResUz_Lyr6->GetXaxis()->SetTitle("z (cm)");
181  h_DeltaResUz_Lyr6->GetYaxis()->SetTitle("#Delta res_{u} (#mum)");
182  //Define 2D histograms: difference of u-residuals vs phi of VXD overlaps for each layer (1 to 6)
183  h_DeltaResVPhi_Lyr1 = new TH2F("h_DeltaResVPhi_Lyr1", "Layer 1: #Delta res_{v} vs #phi", 200, -3.4, 3.4, 100, -200, 200);
184  h_DeltaResVPhi_Lyr1->GetXaxis()->SetTitle("#phi(rad)");
185  h_DeltaResVPhi_Lyr1->GetYaxis()->SetTitle("#Delta res_{v} (#mum)");
186  h_DeltaResVPhi_Lyr2 = new TH2F("h_DeltaResVPhi_Lyr2", "Layer 2: #Delta res_{v} vs #phi", 200, -3.4, 3.4, 100, -200, 200);
187  h_DeltaResVPhi_Lyr2->GetXaxis()->SetTitle("#phi(rad)");
188  h_DeltaResVPhi_Lyr2->GetYaxis()->SetTitle("#Delta res_{v} (#mum)");
189  h_DeltaResVPhi_Lyr3 = new TH2F("h_DeltaResVPhi_Lyr3", "Layer 3: #Delta res_{v} vs #phi", 200, -3.4, 3.4, 100, -1000, 1000);
190  h_DeltaResVPhi_Lyr3->GetXaxis()->SetTitle("#phi(rad)");
191  h_DeltaResVPhi_Lyr3->GetYaxis()->SetTitle("#Delta res_{v} (#mum)");
192  h_DeltaResVPhi_Lyr4 = new TH2F("h_DeltaResVPhi_Lyr4", "Layer 4: #Delta res_{v} vs #phi", 200, -3.4, 3.4, 100, -1000, 1000);
193  h_DeltaResVPhi_Lyr4->GetXaxis()->SetTitle("#phi(rad)");
194  h_DeltaResVPhi_Lyr4->GetYaxis()->SetTitle("#Delta res_{v} (#mum)");
195  h_DeltaResVPhi_Lyr5 = new TH2F("h_DeltaResVPhi_Lyr5", "Layer 5: #Delta res_{v} vs #phi", 200, -3.4, 3.4, 100, -1000, 1000);
196  h_DeltaResVPhi_Lyr5->GetXaxis()->SetTitle("#phi(rad)");
197  h_DeltaResVPhi_Lyr5->GetYaxis()->SetTitle("#Delta res_{v} (#mum)");
198  h_DeltaResVPhi_Lyr6 = new TH2F("h_DeltaResVPhi_Lyr6", "Layer 6: #Delta res_{v} vs #phi", 200, -3.4, 3.4, 100, -1000, 1000);
199  h_DeltaResVPhi_Lyr6->GetXaxis()->SetTitle("#phi(rad)");
200  h_DeltaResVPhi_Lyr6->GetYaxis()->SetTitle("#Delta res_{v} (#mum)");
201  //Define 2D histograms: difference of v-residuals vs z of VXD overlaps for each layer (1 to 6)
202  h_DeltaResVz_Lyr1 = new TH2F("h_DeltaResVz_Lyr1", "Layer 1: #Delta res_{v} vs z", 100, -4, 8, 100, -200, 200);
203  h_DeltaResVz_Lyr1->GetXaxis()->SetTitle("z (cm)");
204  h_DeltaResVz_Lyr1->GetYaxis()->SetTitle("#Delta res_{v} (#mum)");
205  h_DeltaResVz_Lyr2 = new TH2F("h_DeltaResVz_Lyr2", "Layer 2: #Delta res_{v} vs z", 100, -10, 15, 100, -200, 200);
206  h_DeltaResVz_Lyr2->GetXaxis()->SetTitle("z (cm)");
207  h_DeltaResVz_Lyr2->GetYaxis()->SetTitle("#Delta res_{v} (#mum)");
208  h_DeltaResVz_Lyr3 = new TH2F("h_DeltaResVz_Lyr3", "Layer 3: #Delta res_{v} vs z", 250, -15, 20, 100, -1000, 1000);
209  h_DeltaResVz_Lyr3->GetXaxis()->SetTitle("z (cm)");
210  h_DeltaResVz_Lyr3->GetYaxis()->SetTitle("#Delta res_{v} (#mum)");
211  h_DeltaResVz_Lyr4 = new TH2F("h_DeltaResVz_Lyr4", "Layer 4: #Delta res_{v} vs z", 250, -20, 25, 100, -1000, 1000);
212  h_DeltaResVz_Lyr4->GetXaxis()->SetTitle("z (cm)");
213  h_DeltaResVz_Lyr4->GetYaxis()->SetTitle("#Delta res_{v} (#mum)");
214  h_DeltaResVz_Lyr5 = new TH2F("h_DeltaResVz_Lyr5", "Layer 5: #Delta res_{v} vs z", 250, -25, 35, 100, -1000, 1000);
215  h_DeltaResVz_Lyr5->GetXaxis()->SetTitle("z (cm)");
216  h_DeltaResVz_Lyr5->GetYaxis()->SetTitle("#Delta res_{v} (#mum)");
217  h_DeltaResVz_Lyr6 = new TH2F("h_DeltaResVz_Lyr6", "Layer 6: #Delta res_{v} vs z", 250, -30, 45, 100, -1000, 1000);
218  h_DeltaResVz_Lyr6->GetXaxis()->SetTitle("z (cm)");
219  h_DeltaResVz_Lyr6->GetYaxis()->SetTitle("#Delta res_{v} (#mum)");
220  //Restricting to SVD clusters sizes
221  for (int i = 1; i < 5; i++) {
222  //The name is the product of cluster sizes for 2 consecutive hits (maximum size considered is 2)
223  TString h_name_U = "h_U_Cl1Cl2_" + std::to_string(i);
224  TString h_name_V = "h_V_Cl1Cl2_" + std::to_string(i);
225  TString title_U = "#Delta res_{u}: SVDClusterSize_1 x SVDClusterSize_2 = " + std::to_string(i);
226  TString title_V = "#Delta res_{v}: SVDClusterSize_1 x SVDClusterSize_2 = " + std::to_string(i);
227  h_U_Cl1Cl2_DeltaRes[i] = new TH1F(h_name_U, title_U, 100, -1000, 1000);
228  h_U_Cl1Cl2_DeltaRes[i]->GetXaxis()->SetTitle("#Delta res_{u} (#mum)");
229  h_U_Cl1Cl2_DeltaRes[i]->GetYaxis()->SetTitle("counts");
230  h_V_Cl1Cl2_DeltaRes[i] = new TH1F(h_name_V, title_V, 100, -1000, 1000);
231  h_V_Cl1Cl2_DeltaRes[i]->GetXaxis()->SetTitle("#Delta res_{v} (#mum)");
232  h_V_Cl1Cl2_DeltaRes[i]->GetYaxis()->SetTitle("counts");
233  }
234 
235  //Special case of ExpertLevel option enabled
236  if (m_ExpertLevel) {
237  //Create directory to store PXD and SVD hitmaps for overlapping hits
238  TDirectory* HMDir = oldDir->mkdir("HitMaps_VXDOverlaps");
239  HMDir->cd();
240  //Define 2D sensor hit-maps for reconstructed hits
241  for (int i = 1; i <= 5; i++) {
242  for (int j = 1; j <= 16; j++) {
243  TString h_name = "h_6" + std::to_string(j) + std::to_string(i);
244  TString title = "Layer:Ladder:Sensor = 6:" + std::to_string(j) + ":" + std::to_string(i);
245  h_Lyr6[j][i] = new TH2F(h_name, title, 100, -2.88, 2.88, 100, -6.14, 6.14);
246  h_Lyr6[j][i]->GetXaxis()->SetTitle("u (cm)");
247  h_Lyr6[j][i]->GetYaxis()->SetTitle("v (cm)");
248  }
249  }
250  for (int i = 1; i <= 4; i++) {
251  for (int j = 1; j <= 12; j++) {
252  TString h_name = "h_5" + std::to_string(j) + std::to_string(i);
253  TString title = "Layer:Ladder:Sensor = 5:" + std::to_string(j) + ":" + std::to_string(i);
254  h_Lyr5[j][i] = new TH2F(h_name, title, 100, -2.88, 2.88, 100, -6.14, 6.14);
255  h_Lyr5[j][i]->GetXaxis()->SetTitle("u (cm)");
256  h_Lyr5[j][i]->GetYaxis()->SetTitle("v (cm)");
257  }
258  }
259  for (int i = 1; i <= 3; i++) {
260  for (int j = 1; j <= 10; j++) {
261  TString h_name = "h_4" + std::to_string(j) + std::to_string(i);
262  TString title = "Layer:Ladder:Sensor = 4:" + std::to_string(j) + ":" + std::to_string(i);
263  h_Lyr4[j][i] = new TH2F(h_name, title, 100, -2.88, 2.88, 100, -6.14, 6.14);
264  h_Lyr4[j][i]->GetXaxis()->SetTitle("u (cm)");
265  h_Lyr4[j][i]->GetYaxis()->SetTitle("v (cm)");
266  }
267  }
268  for (int i = 1; i <= 2; i++) {
269  for (int j = 1; j <= 7; j++) {
270  TString h_name = "h_3" + std::to_string(j) + std::to_string(i);
271  TString title = "Layer:Ladder:Sensor = 3:" + std::to_string(j) + ":" + std::to_string(i);
272  h_Lyr3[j][i] = new TH2F(h_name, title, 100, -1.92, 1.92, 100, -6.14, 6.14);
273  h_Lyr3[j][i]->GetXaxis()->SetTitle("u (cm)");
274  h_Lyr3[j][i]->GetYaxis()->SetTitle("v (cm)");
275  }
276  }
277  for (int i = 1; i <= 2; i++) {
278  for (int j = 1; j <= 12; j++) {
279  TString h_name = "h_2" + std::to_string(j) + std::to_string(i);
280  TString title = "Layer:Ladder:Sensor = 2:" + std::to_string(j) + ":" + std::to_string(i);
281  h_Lyr2[j][i] = new TH2F(h_name, title, 100, -0.625, 0.625, 100, -3.072, 3.072);
282  h_Lyr2[j][i]->GetXaxis()->SetTitle("u (cm)");
283  h_Lyr2[j][i]->GetYaxis()->SetTitle("v (cm)");
284  }
285  }
286  for (int i = 1; i <= 2; i++) {
287  for (int j = 1; j <= 8; j++) {
288  TString h_name = "h_1" + std::to_string(j) + std::to_string(i);
289  TString title = "Layer:Ladder:Sensor = 1:" + std::to_string(j) + ":" + std::to_string(i);
290  h_Lyr1[j][i] = new TH2F(h_name, title, 100, -0.625, 0.625, 100, -2.24, 2.24);
291  h_Lyr1[j][i]->GetXaxis()->SetTitle("u (cm)");
292  h_Lyr1[j][i]->GetYaxis()->SetTitle("v (cm)");
293  }
294  }
295  //Create directory to store PXD and SVD trees
296  TDirectory* TreeDir = oldDir->mkdir("Trees_VXDOverlaps");
297  TreeDir->cd();
298  //Tree for PXD
299  t_PXD = new TTree("t_PXD", "Tree for PXD overlaps");
300  t_PXD->Branch("deltaResU_PXD", &deltaResU_PXD, "deltaResU_PXD/F");
301  t_PXD->Branch("intResU_PXD", &intResU_PXD, "intResU_PXD/F");
302  t_PXD->Branch("intResV_PXD", &intResV_PXD, "intResV_PXD/F");
303  t_PXD->Branch("intU_PXD", &intU_PXD, "intU_PXD/F");
304  t_PXD->Branch("intV_PXD", &intV_PXD, "intV_PXD/F");
305  t_PXD->Branch("intPhi_PXD", &intPhi_PXD, "intPhi_PXD/F");
306  t_PXD->Branch("intZ_PXD", &intZ_PXD, "intZ_PXD/F");
307  t_PXD->Branch("intLayer_PXD", &intLayer_PXD, "intLayer_PXD/i");
308  t_PXD->Branch("intLadder_PXD", &intLadder_PXD, "intLadder_PXD/i");
309  t_PXD->Branch("intSensor_PXD", &intSensor_PXD, "intSensor_PXD/i");
310  t_PXD->Branch("extResU_PXD", &extResU_PXD, "extResU_PXD/F");
311  t_PXD->Branch("extResV_PXD", &extResV_PXD, "extResV_PXD/F");
312  t_PXD->Branch("extU_PXD", &extU_PXD, "extU_PXD/F");
313  t_PXD->Branch("extV_PXD", &extV_PXD, "extV_PXD/F");
314  t_PXD->Branch("extPhi_PXD", &extPhi_PXD, "extPhi_PXD/F");
315  t_PXD->Branch("extZ_PXD", &extZ_PXD, "extZ_PXD/F");
316  t_PXD->Branch("extLayer_PXD", &extLayer_PXD, "extLayer_PXD/i");
317  t_PXD->Branch("extLadder_PXD", &extLadder_PXD, "extLadder_PXD/i");
318  t_PXD->Branch("extSensor_PXD", &extSensor_PXD, "extSensor_PXD/i");
319  //Tree for SVD u overlapping clusters
320  t_SVD_U = new TTree("t_SVD_U", "Tree for SVD u-overlaps");
321  t_SVD_U->Branch("svdDeltaRes", &svdDeltaRes_U, "svdDeltaRes/F");
322  t_SVD_U->Branch("svdTrkPXDHits", &svdTrkPXDHits, "svdTrkPXDHits/i");
323  t_SVD_U->Branch("svdTrkSVDHits", &svdTrkSVDHits, "svdTrkSVDHits/i");
324  t_SVD_U->Branch("svdTrkCDCHits", &svdTrkCDCHits, "svdTrkCDCHits/i");
325  t_SVD_U->Branch("svdTrkd0", &svdTrkd0, "svdTrkd0/F");
326  t_SVD_U->Branch("svdTrkz0", &svdTrkz0, "svdTrkz0/F");
327  t_SVD_U->Branch("svdTrkpT", &svdTrkpT, "svdTrkpT/F");
328  t_SVD_U->Branch("svdTrkpCM", &svdTrkpCM, "svdTrkpCM/F");
329  // Internal ladder variables
330  t_SVD_U->Branch("svdClSNR_int", &svdClSNR_U_int, "svdClSNR_int/F");
331  t_SVD_U->Branch("svdClCharge_int", &svdClCharge_U_int, "svdClCharge_int/F");
332  t_SVD_U->Branch("svdStripCharge_int", &svdStripCharge_U_int);
333  t_SVD_U->Branch("svdStrip6Samples_int", &svdStrip6Samples_U_int);
334  t_SVD_U->Branch("svdClTime_int", &svdClTime_U_int, "svdClTime_int/F");
335  t_SVD_U->Branch("svdStripTime_int", &svdStripTime_U_int);
336  t_SVD_U->Branch("svdStripPosition_int", &svdStripPosition_U_int);
337  t_SVD_U->Branch("svdRes_int", &svdRes_U_int, "svdRes_int/F");
338  t_SVD_U->Branch("svdClIntStrPos_int", &svdClIntStrPos_U_int, "svdClIntStrPos_int/F");
339  t_SVD_U->Branch("svdClPos_int", &svdClPos_U_int, "svdClPos_int/F");
340  t_SVD_U->Branch("svdClPosErr_int", &svdClPosErr_U_int, "svdClPosErr_int/F");
341  t_SVD_U->Branch("svdTruePos_int", &svdTruePos_U_int, "svdTruePos_int/F");
342  t_SVD_U->Branch("svdClPhi_int", &svdClPhi_U_int, "svdClPhi_int/F");
343  t_SVD_U->Branch("svdClZ_int", &svdClZ_U_int, "svdClZ_int/F");
344  t_SVD_U->Branch("svdTrkTraversedLength_int", &svdTrkTraversedLength_U_int, "svdTrkTraversedLength_int/F");
345  t_SVD_U->Branch("svdTrkPos_int", &svdTrkPos_U_int, "svdTrkPos_int/F");
346  t_SVD_U->Branch("svdTrkPosOS_int", &svdTrkPosOS_U_int, "svdTrkPosOS_int/F");
347  t_SVD_U->Branch("svdTrkPosErr_int", &svdTrkPosErr_U_int, "svdTrkPosErr_int/F");
348  t_SVD_U->Branch("svdTrkPosErrOS_int", &svdTrkPosErrOS_U_int, "svdTrkPosErrOS_int/F");
349  t_SVD_U->Branch("svdTrkQoP_int", &svdTrkQoP_U_int, "svdTrkQoP_int/F");
350  t_SVD_U->Branch("svdTrkPrime_int", &svdTrkPrime_U_int, "svdTrkPrime_int/F");
351  t_SVD_U->Branch("svdTrkPrimeOS_int", &svdTrkPrimeOS_U_int, "svdTrkPrimeOS_int/F");
352  t_SVD_U->Branch("svdTrkPosUnbiased_int", &svdTrkPosUnbiased_U_int, "svdTrkPosUnbiased_int/F");
353  t_SVD_U->Branch("svdTrkPosErrUnbiased_int", &svdTrkPosErrUnbiased_U_int, "svdTrkPosErrUnbiased_int/F");
354  t_SVD_U->Branch("svdTrkQoPUnbiased_int", &svdTrkQoPUnbiased_U_int, "svdTrkQoPUnbiased_int/F");
355  t_SVD_U->Branch("svdTrkPrimeUnbiased_int", &svdTrkPrimeUnbiased_U_int, "svdTrkPrimeUnbiased_int/F");
356  t_SVD_U->Branch("svdLayer_int", &svdLayer_U_int, "svdLayer_int/i");
357  t_SVD_U->Branch("svdLadder_int", &svdLadder_U_int, "svdLadder_int/i");
358  t_SVD_U->Branch("svdSensor_int", &svdSensor_U_int, "svdSensor_int/i");
359  t_SVD_U->Branch("svdSize_int", &svdSize_U_int, "svdSize_int/i");
360  // External ladder variables
361  t_SVD_U->Branch("svdClSNR_ext", &svdClSNR_U_ext, "svdClSNR_ext/F");
362  t_SVD_U->Branch("svdClCharge_ext", &svdClCharge_U_ext, "svdClCharge_ext/F");
363  t_SVD_U->Branch("svdStripCharge_ext", &svdStripCharge_U_ext);
364  t_SVD_U->Branch("svdStrip6Samples_ext", &svdStrip6Samples_U_ext);
365  t_SVD_U->Branch("svdClTime_ext", &svdClTime_U_ext, "svdClTime_ext/F");
366  t_SVD_U->Branch("svdStripTime_ext", &svdStripTime_U_ext);
367  t_SVD_U->Branch("svdStripPosition_ext", &svdStripPosition_U_ext);
368  t_SVD_U->Branch("svdRes_ext", &svdRes_U_ext, "svdRes_ext/F");
369  t_SVD_U->Branch("svdClIntStrPos_ext", &svdClIntStrPos_U_ext, "svdClIntStrPos_ext/F");
370  t_SVD_U->Branch("svdClPos_ext", &svdClPos_U_ext, "svdClPos_ext/F");
371  t_SVD_U->Branch("svdClPosErr_ext", &svdClPosErr_U_ext, "svdClPosErr_ext/F");
372  t_SVD_U->Branch("svdTruePos_ext", &svdTruePos_U_ext, "svdTruePos_ext/F");
373  t_SVD_U->Branch("svdClPhi_ext", &svdClPhi_U_ext, "svdClPhi_ext/F");
374  t_SVD_U->Branch("svdClZ_ext", &svdClZ_U_ext, "svdClZ_ext/F");
375  t_SVD_U->Branch("svdTrkTraversedLength_ext", &svdTrkTraversedLength_U_ext, "svdTrkTraversedLength_ext/F");
376  t_SVD_U->Branch("svdTrkPos_ext", &svdTrkPos_U_ext, "svdTrkPos_ext/F");
377  t_SVD_U->Branch("svdTrkPosOS_ext", &svdTrkPosOS_U_ext, "svdTrkPosOS_ext/F");
378  t_SVD_U->Branch("svdTrkPosErr_ext", &svdTrkPosErr_U_ext, "svdTrkPosErr_ext/F");
379  t_SVD_U->Branch("svdTrkPosErrOS_ext", &svdTrkPosErrOS_U_ext, "svdTrkPosErrOS_ext/F");
380  t_SVD_U->Branch("svdTrkQoP_ext", &svdTrkQoP_U_ext, "svdTrkQoP_ext/F");
381  t_SVD_U->Branch("svdTrkPrime_ext", &svdTrkPrime_U_ext, "svdTrkPrime_ext/F");
382  t_SVD_U->Branch("svdTrkPrimeOS_ext", &svdTrkPrimeOS_U_ext, "svdTrkPrimeOS_ext/F");
383  t_SVD_U->Branch("svdTrkPosUnbiased_ext", &svdTrkPosUnbiased_U_ext, "svdTrkPosUnbiased_ext/F");
384  t_SVD_U->Branch("svdTrkPosErrUnbiased_ext", &svdTrkPosErrUnbiased_U_ext, "svdTrkPosErrUnbiased_ext/F");
385  t_SVD_U->Branch("svdTrkQoPUnbiased_ext", &svdTrkQoPUnbiased_U_ext, "svdTrkQoPUnbiased_ext/F");
386  t_SVD_U->Branch("svdTrkPrimeUnbiased_ext", &svdTrkPrimeUnbiased_U_ext, "svdTrkPrimeUnbiased_ext/F");
387  t_SVD_U->Branch("svdLayer_ext", &svdLayer_U_ext, "svdLayer_ext/i");
388  t_SVD_U->Branch("svdLadder_ext", &svdLadder_U_ext, "svdLadder_ext/i");
389  t_SVD_U->Branch("svdSensor_ext", &svdSensor_U_ext, "svdSensor_ext/i");
390  t_SVD_U->Branch("svdSize_ext", &svdSize_U_ext, "svdSize_ext/i");
391  //Tree for SVD v overlapping clusters
392  t_SVD_V = new TTree("t_SVD_V", "Tree for SVD v-overlaps");
393  t_SVD_V->Branch("svdDeltaRes", &svdDeltaRes_V, "svdDeltaRes/F");
394  t_SVD_V->Branch("svdTrkPXDHits", &svdTrkPXDHits, "svdTrkPXDHits/i");
395  t_SVD_V->Branch("svdTrkSVDHits", &svdTrkSVDHits, "svdTrkSVDHits/i");
396  t_SVD_V->Branch("svdTrkCDCHits", &svdTrkCDCHits, "svdTrkCDCHits/i");
397  t_SVD_V->Branch("svdTrkd0", &svdTrkd0, "svdTrkd0/F");
398  t_SVD_V->Branch("svdTrkz0", &svdTrkz0, "svdTrkz0/F");
399  t_SVD_V->Branch("svdTrkpT", &svdTrkpT, "svdTrkpT/F");
400  t_SVD_V->Branch("svdTrkpCM", &svdTrkpCM, "svdTrkpCM/F");
401  // Internal ladder variables
402  t_SVD_V->Branch("svdClSNR_int", &svdClSNR_V_int, "svdClSNR_int/F");
403  t_SVD_V->Branch("svdClCharge_int", &svdClCharge_V_int, "svdClCharge_int/F");
404  t_SVD_V->Branch("svdStripCharge_int", &svdStripCharge_V_int);
405  t_SVD_V->Branch("svdStrip6Samples_int", &svdStrip6Samples_V_int);
406  t_SVD_V->Branch("svdClTime_int", &svdClTime_V_int, "svdClTime_int/F");
407  t_SVD_V->Branch("svdStripTime_int", &svdStripTime_V_int);
408  t_SVD_V->Branch("svdStripPosition_int", &svdStripPosition_V_int);
409  t_SVD_V->Branch("svdRes_int", &svdRes_V_int, "svdRes_int/F");
410  t_SVD_V->Branch("svdClIntStrPos_int", &svdClIntStrPos_V_int, "svdClIntStrPos_int/F");
411  t_SVD_V->Branch("svdClPos_int", &svdClPos_V_int, "svdClPos_int/F");
412  t_SVD_V->Branch("svdClPosErr_int", &svdClPosErr_V_int, "svdClPosErr_int/F");
413  t_SVD_V->Branch("svdTruePos_int", &svdTruePos_V_int, "svdTruePos_int/F");
414  t_SVD_V->Branch("svdClPhi_int", &svdClPhi_V_int, "svdClPhi_int/F");
415  t_SVD_V->Branch("svdClZ_int", &svdClZ_V_int, "svdClZ_int/F");
416  t_SVD_V->Branch("svdTrkTraversedLength_int", &svdTrkTraversedLength_V_int, "svdTrkTraversedLength_int/F");
417  t_SVD_V->Branch("svdTrkPos_int", &svdTrkPos_V_int, "svdTrkPos_int/F");
418  t_SVD_V->Branch("svdTrkPosOS_int", &svdTrkPosOS_V_int, "svdTrkPosOS_int/F");
419  t_SVD_V->Branch("svdTrkPosErr_int", &svdTrkPosErr_V_int, "svdTrkPosErr_int/F");
420  t_SVD_V->Branch("svdTrkPosErrOS_int", &svdTrkPosErrOS_V_int, "svdTrkPosErrOS_int/F");
421  t_SVD_V->Branch("svdTrkQoP_int", &svdTrkQoP_V_int, "svdTrkQoP_int/F");
422  t_SVD_V->Branch("svdTrkPrime_int", &svdTrkPrime_V_int, "svdTrkPrime_int/F");
423  t_SVD_V->Branch("svdTrkPrimeOS_int", &svdTrkPrimeOS_V_int, "svdTrkPrimeOS_int/F");
424  t_SVD_V->Branch("svdTrkPosUnbiased_int", &svdTrkPosUnbiased_V_int, "svdTrkPosUnbiased_int/F");
425  t_SVD_V->Branch("svdTrkPosErrUnbiased_int", &svdTrkPosErrUnbiased_V_int, "svdTrkPosErrUnbiased_int/F");
426  t_SVD_V->Branch("svdTrkQoPUnbiased_int", &svdTrkQoPUnbiased_V_int, "svdTrkQoPUnbiased_int/F");
427  t_SVD_V->Branch("svdTrkPrimeUnbiased_int", &svdTrkPrimeUnbiased_V_int, "svdTrkPrimeUnbiased_int/F");
428  t_SVD_V->Branch("svdLayer_int", &svdLayer_V_int, "svdLayer_int/i");
429  t_SVD_V->Branch("svdLadder_int", &svdLadder_V_int, "svdLadder_int/i");
430  t_SVD_V->Branch("svdSensor_int", &svdSensor_V_int, "svdSensor_int/i");
431  t_SVD_V->Branch("svdSize_int", &svdSize_V_int, "svdSize_int/i");
432  // External ladder variables
433  t_SVD_V->Branch("svdClSNR_ext", &svdClSNR_V_ext, "svdClSNR_ext/F");
434  t_SVD_V->Branch("svdClCharge_ext", &svdClCharge_V_ext, "svdClCharge_ext/F");
435  t_SVD_V->Branch("svdStripCharge_ext", &svdStripCharge_V_ext);
436  t_SVD_V->Branch("svdStrip6Samples_ext", &svdStrip6Samples_V_ext);
437  t_SVD_V->Branch("svdClTime_ext", &svdClTime_V_ext, "svdClTime_ext/F");
438  t_SVD_V->Branch("svdStripTime_ext", &svdStripTime_V_ext);
439  t_SVD_V->Branch("svdStripPosition_ext", &svdStripPosition_V_ext);
440  t_SVD_V->Branch("svdRes_ext", &svdRes_V_ext, "svdRes_ext/F");
441  t_SVD_V->Branch("svdClIntStrPos_ext", &svdClIntStrPos_V_ext, "svdClIntStrPos_ext/F");
442  t_SVD_V->Branch("svdClPos_ext", &svdClPos_V_ext, "svdClPos_ext/F");
443  t_SVD_V->Branch("svdClPosErr_ext", &svdClPosErr_V_ext, "svdClPosErr_ext/F");
444  t_SVD_V->Branch("svdTruePos_ext", &svdTruePos_V_ext, "svdTruePos_ext/F");
445  t_SVD_V->Branch("svdClPhi_ext", &svdClPhi_V_ext, "svdClPhi_ext/F");
446  t_SVD_V->Branch("svdClZ_ext", &svdClZ_V_ext, "svdClZ_ext/F");
447  t_SVD_V->Branch("svdTrkTraversedLength_ext", &svdTrkTraversedLength_V_ext, "svdTrkTraversedLength_ext/F");
448  t_SVD_V->Branch("svdTrkPos_ext", &svdTrkPos_V_ext, "svdTrkPos_ext/F");
449  t_SVD_V->Branch("svdTrkPosOS_ext", &svdTrkPosOS_V_ext, "svdTrkPosOS_ext/F");
450  t_SVD_V->Branch("svdTrkPosErr_ext", &svdTrkPosErr_V_ext, "svdTrkPosErr_ext/F");
451  t_SVD_V->Branch("svdTrkPosErrOS_ext", &svdTrkPosErrOS_V_ext, "svdTrkPosErrOS_ext/F");
452  t_SVD_V->Branch("svdTrkQoP_ext", &svdTrkQoP_V_ext, "svdTrkQoP_ext/F");
453  t_SVD_V->Branch("svdTrkPrime_ext", &svdTrkPrime_V_ext, "svdTrkPrime_ext/F");
454  t_SVD_V->Branch("svdTrkPrimeOS_ext", &svdTrkPrimeOS_V_ext, "svdTrkPrimeOS_ext/F");
455  t_SVD_V->Branch("svdTrkPosUnbiased_ext", &svdTrkPosUnbiased_V_ext, "svdTrkPosUnbiased_ext/F");
456  t_SVD_V->Branch("svdTrkPosErrUnbiased_ext", &svdTrkPosErrUnbiased_V_ext, "svdTrkPosErrUnbiased_ext/F");
457  t_SVD_V->Branch("svdTrkQoPUnbiased_ext", &svdTrkQoPUnbiased_V_ext, "svdTrkQoPUnbiased_ext/F");
458  t_SVD_V->Branch("svdTrkPrimeUnbiased_ext", &svdTrkPrimeUnbiased_V_ext, "svdTrkPrimeUnbiased_ext/F");
459  t_SVD_V->Branch("svdLayer_ext", &svdLayer_V_ext, "svdLayer_ext/i");
460  t_SVD_V->Branch("svdLadder_ext", &svdLadder_V_ext, "svdLadder_ext/i");
461  t_SVD_V->Branch("svdSensor_ext", &svdSensor_V_ext, "svdSensor_ext/i");
462  t_SVD_V->Branch("svdSize_ext", &svdSize_V_ext, "svdSize_ext/i");
463  }
464  //Go back to the default output directory
465  oldDir->cd();
466 }
467 
469 {
470  bool isMC = Environment::Instance().isMC();
471 
474  for (const auto& trk : recoTracks) {
475  if (! trk.wasFitSuccessful()) {
476  continue;
477  }
478  const std::vector<PXDCluster* > pxdClusters = trk.getPXDHitList();
479  const std::vector<SVDCluster* > svdClusters = trk.getSVDHitList();
480  B2DEBUG(29, "FITTED TRACK: NUMBER OF PXD HITS = " << pxdClusters.size() << " NUMBER OF SVD HITS = " << svdClusters.size());
481  //LOOKING FOR 2 CONSECUTIVE PXD HITS IN OVERLAPPING MODULES OF A SAME LAYER
482  for (unsigned int i = 0; i < pxdClusters.size(); i++) {
483  const PXDCluster* pxd_1 = pxdClusters[i];
484  const RecoHitInformation* infoPXD_1 = trk.getRecoHitInformation(pxd_1);
485  if (!infoPXD_1) {
486  continue;
487  }
488  const auto* hitTrackPoint_1 = trk.getCreatedTrackPoint(infoPXD_1);
489  const auto* fittedResult_1 = hitTrackPoint_1->getFitterInfo();
490  if (!fittedResult_1) {
491  continue;
492  }
493  const VxdID pxd_id_1 = pxd_1->getSensorID();
494  const unsigned short pxd_Layer_1 = pxd_id_1.getLayerNumber();
495  const unsigned short pxd_Ladder_1 = pxd_id_1.getLadderNumber();
496  const unsigned short pxd_Sensor_1 = pxd_id_1.getSensorNumber();
497  for (unsigned int l = i + 1; l < pxdClusters.size(); l++) {
498  const PXDCluster* pxd_2 = pxdClusters[l];
499  const RecoHitInformation* infoPXD_2 = trk.getRecoHitInformation(pxd_2);
500  if (!infoPXD_2) {
501  continue;
502  }
503  const auto* hitTrackPoint_2 = trk.getCreatedTrackPoint(infoPXD_2);
504  const auto* fittedResult_2 = hitTrackPoint_2->getFitterInfo();
505  if (!fittedResult_2) {
506  continue;
507  }
508  const VxdID pxd_id_2 = pxd_2->getSensorID();
509  const unsigned short pxd_Layer_2 = pxd_id_2.getLayerNumber();
510  const unsigned short pxd_Ladder_2 = pxd_id_2.getLadderNumber();
511  const unsigned short pxd_Sensor_2 = pxd_id_2.getSensorNumber();
512  if (pxd_Layer_1 == pxd_Layer_2 && ((pxd_Ladder_2 - pxd_Ladder_1) == -1.0 || (pxd_Ladder_2 - pxd_Ladder_1) == 7.0
513  || (pxd_Ladder_2 - pxd_Ladder_1) == 11.0)) {
514  B2DEBUG(29, " ============= 2 hits in a PXD overlap ============= ");
515  const TVectorD resUnBias_PXD_1 = fittedResult_1->getResidual(0, false).getState();
516  const TVectorD resUnBias_PXD_2 = fittedResult_2->getResidual(0, false).getState();
517  const float res_U_1 = resUnBias_PXD_1.GetMatrixArray()[0] * Unit::convertValueToUnit(1.0, "um");
518  const float res_V_1 = resUnBias_PXD_1.GetMatrixArray()[1] * Unit::convertValueToUnit(1.0, "um");
519  const double res_U_2 = resUnBias_PXD_2.GetMatrixArray()[0] * Unit::convertValueToUnit(1.0, "um");
520  const double res_V_2 = resUnBias_PXD_2.GetMatrixArray()[1] * Unit::convertValueToUnit(1.0, "um");
521  const float over_U_PXD = res_U_2 - res_U_1;
522  const float over_V_PXD = res_V_2 - res_V_1;
523  const ROOT::Math::XYZVector pxdLocal_1(pxd_1->getU(), pxd_1->getV(), 0.);
524  const ROOT::Math::XYZVector pxdLocal_2(pxd_2->getU(), pxd_2->getV(), 0.);
525  const VXD::SensorInfoBase& pxdSensor_1 = geo.get(pxd_id_1);
526  const VXD::SensorInfoBase& pxdSensor_2 = geo.get(pxd_id_2);
527  const ROOT::Math::XYZVector& pxdGlobal_1 = pxdSensor_1.pointToGlobal(pxdLocal_1);
528  const ROOT::Math::XYZVector& pxdGlobal_2 = pxdSensor_2.pointToGlobal(pxdLocal_2);
529  double pxdPhi_1 = atan2(pxdGlobal_1.Y(), pxdGlobal_1.X()); // maybe use pxdGlobal_1.Phi() instead
530  double pxdPhi_2 = atan2(pxdGlobal_2.Y(), pxdGlobal_2.X()); // maybe use pxdGlobal_2.Phi() instead
531  double pxdZ_1 = pxdGlobal_1.Z();
532  double pxdZ_2 = pxdGlobal_2.Z();
533  B2DEBUG(29, "PXD: difference of residuals " << over_U_PXD << " " << over_V_PXD);
534  //Fill PXD tree for overlaps if required by the user
535  if (m_ExpertLevel) {
536  deltaResU_PXD = over_U_PXD;
537  intResU_PXD = res_U_1;
538  intResV_PXD = res_V_1;
539  intU_PXD = pxd_1->getU();
540  intV_PXD = pxd_1->getV();
541  intPhi_PXD = pxdPhi_1;
542  intZ_PXD = pxdZ_1;
543  intLayer_PXD = pxd_Layer_1;
544  intLadder_PXD = pxd_Ladder_1;
545  intSensor_PXD = pxd_Sensor_1;
546  extResU_PXD = res_U_2;
547  extResV_PXD = res_V_2;
548  extU_PXD = pxd_2->getU();
549  extV_PXD = pxd_2->getV();
550  extPhi_PXD = pxdPhi_2;
551  extZ_PXD = pxdZ_2;
552  extLayer_PXD = pxd_Layer_2;
553  extLadder_PXD = pxd_Ladder_2;
554  extSensor_PXD = pxd_Sensor_2;
555  t_PXD->Fill();
556  }
557  //Fill histograms of residuals differences with PXD clusters
558  h_U_DeltaRes->Fill(over_U_PXD);
559  h_V_DeltaRes->Fill(over_V_PXD);
560  h_U_DeltaRes_PXD->Fill(over_U_PXD);
561  h_V_DeltaRes_PXD->Fill(over_V_PXD);
562  //Fill sensor hit-maps and 2D histograms with PXD clusters
563  if (pxd_Layer_1 == 1 && pxd_Layer_2 == 1) {
564  h_Lyr1[pxd_Ladder_1][pxd_Sensor_1]->Fill(pxd_1->getU(), pxd_1->getV());
565  h_Lyr1[pxd_Ladder_2][pxd_Sensor_2]->Fill(pxd_2->getU(), pxd_2->getV());
566  h_U_DeltaRes_PXD_Lyr1->Fill(over_U_PXD);
567  h_V_DeltaRes_PXD_Lyr1->Fill(over_V_PXD);
568  h_DeltaResUPhi_Lyr1->Fill(pxdPhi_1, over_U_PXD);
569  h_DeltaResUPhi_Lyr1->Fill(pxdPhi_2, over_U_PXD);
570  h_DeltaResVPhi_Lyr1->Fill(pxdPhi_1, over_V_PXD);
571  h_DeltaResVPhi_Lyr1->Fill(pxdPhi_2, over_V_PXD);
572  h_DeltaResVz_Lyr1->Fill(pxdZ_1, over_V_PXD);
573  h_DeltaResVz_Lyr1->Fill(pxdZ_2, over_V_PXD);
574  h_DeltaResUz_Lyr1->Fill(pxdZ_1, over_U_PXD);
575  h_DeltaResUz_Lyr1->Fill(pxdZ_2, over_U_PXD);
576  }
577  if (pxd_Layer_1 == 2 && pxd_Layer_2 == 2) {
578  h_Lyr2[pxd_Ladder_1][pxd_Sensor_1]->Fill(pxd_1->getU(), pxd_1->getV());
579  h_Lyr2[pxd_Ladder_2][pxd_Sensor_2]->Fill(pxd_2->getU(), pxd_2->getV());
580  h_U_DeltaRes_PXD_Lyr2->Fill(over_U_PXD);
581  h_V_DeltaRes_PXD_Lyr2->Fill(over_V_PXD);
582  h_DeltaResUPhi_Lyr2->Fill(pxdPhi_1, over_U_PXD);
583  h_DeltaResUPhi_Lyr2->Fill(pxdPhi_2, over_U_PXD);
584  h_DeltaResVPhi_Lyr2->Fill(pxdPhi_1, over_V_PXD);
585  h_DeltaResVPhi_Lyr2->Fill(pxdPhi_2, over_V_PXD);
586  h_DeltaResVz_Lyr2->Fill(pxdZ_1, over_V_PXD);
587  h_DeltaResVz_Lyr2->Fill(pxdZ_2, over_V_PXD);
588  h_DeltaResUz_Lyr2->Fill(pxdZ_1, over_U_PXD);
589  h_DeltaResUz_Lyr2->Fill(pxdZ_2, over_U_PXD);
590  }
591  }
592  }
593 
594  }
595 
596  //LOOKING FOR 2 CONSECUTIVE SVD HITS IN OVERLAPPING MODULES OF A SAME LAYER
597  RelationVector<Track> theTK = DataStore::getRelationsWithObj<Track>(&trk);
598 
599  const TrackFitResult* tfr = theTK[0]->getTrackFitResultWithClosestMass(Const::pion);
600  if (tfr) {
601  svdTrkd0 = tfr->getD0();
602  svdTrkz0 = tfr->getZ0();
603  svdTrkpT = tfr->getMomentum().Rho();
604  ROOT::Math::PxPyPzEVector pStar = tfr->get4Momentum();
605  ROOT::Math::BoostZ boost(3. / 11);
606  pStar = boost(pStar);
607  svdTrkpCM = pStar.P();
608  }
609 
610  svdTrkPXDHits = (trk.getPXDHitList()).size();
611  svdTrkSVDHits = (trk.getSVDHitList()).size();
612  svdTrkCDCHits = (trk.getCDCHitList()).size();
613 
614  for (unsigned int i = 0; i < svdClusters.size(); i++) {
615  const SVDCluster* svd_1 = svdClusters[i];
616 
617  //get true hits, used only if isMC
618  RelationVector<SVDTrueHit> trueHit_1 = DataStore::getRelationsWithObj<SVDTrueHit>(svd_1);
619 
620  const RecoHitInformation* infoSVD_1 = trk.getRecoHitInformation(svd_1);
621  if (!infoSVD_1) {
622  continue;
623  }
624  const auto* hitTrackPoint_1 = trk.getCreatedTrackPoint(infoSVD_1);
625  const auto* fittedResult_1 = hitTrackPoint_1->getFitterInfo();
626  if (!fittedResult_1) {
627  continue;
628  }
629  const VxdID svd_id_1 = svd_1->getSensorID();
630  const unsigned short svd_Layer_1 = svd_id_1.getLayerNumber();
631  const unsigned short svd_Ladder_1 = svd_id_1.getLadderNumber();
632  const unsigned short svd_Sensor_1 = svd_id_1.getSensorNumber();
633  for (unsigned int l = i + 1; l < svdClusters.size(); l++) {
634  const SVDCluster* svd_2 = svdClusters[l];
635 
636  //get true hits, used only if isMC
637  RelationVector<SVDTrueHit> trueHit_2 = DataStore::getRelationsWithObj<SVDTrueHit>(svd_2);
638 
639  const RecoHitInformation* infoSVD_2 = trk.getRecoHitInformation(svd_2);
640  if (!infoSVD_2) {
641  continue;
642  }
643  const auto* hitTrackPoint_2 = trk.getCreatedTrackPoint(infoSVD_2);
644  const auto* fittedResult_2 = hitTrackPoint_2->getFitterInfo();
645  if (!fittedResult_2) {
646  continue;
647  }
648  const VxdID svd_id_2 = svd_2->getSensorID();
649  const unsigned short svd_Layer_2 = svd_id_2.getLayerNumber();
650  const unsigned short svd_Ladder_2 = svd_id_2.getLadderNumber();
651  const unsigned short svd_Sensor_2 = svd_id_2.getSensorNumber();
652  if (svd_Layer_1 == svd_Layer_2 && ((svd_Ladder_2 - svd_Ladder_1) == 1.0 || (svd_Ladder_2 - svd_Ladder_1) == -6.0
653  || (svd_Ladder_2 - svd_Ladder_1) == -9.0 || (svd_Ladder_2 - svd_Ladder_1) == -11.0 || (svd_Ladder_2 - svd_Ladder_1) == -15.0)) {
654  B2DEBUG(29, " ============= 2 hits in a SVD overlap ============= ");
655  const TVectorD resUnBias_SVD_1 = fittedResult_1->getResidual(0, false).getState();
656  const TVectorD resUnBias_SVD_2 = fittedResult_2->getResidual(0, false).getState();
657  genfit::MeasuredStateOnPlane state_unbiased_1 = fittedResult_1->getFittedState(false);
658  genfit::MeasuredStateOnPlane state_unbiased_2 = fittedResult_2->getFittedState(false);
659  const TVectorD& svd_predIntersect_unbiased_1 = state_unbiased_1.getState();
660  const TVectorD& svd_predIntersect_unbiased_2 = state_unbiased_2.getState();
661  const TMatrixDSym& covMatrix_unbiased_1 = state_unbiased_1.getCov();
662  const TMatrixDSym& covMatrix_unbiased_2 = state_unbiased_2.getCov();
663  genfit::MeasuredStateOnPlane state_1 = trk.getMeasuredStateOnPlaneFromRecoHit(infoSVD_1);
664  genfit::MeasuredStateOnPlane state_2 = trk.getMeasuredStateOnPlaneFromRecoHit(infoSVD_2);
665  const TVectorD& svd_predIntersect_1 = state_1.getState();
666  const TVectorD& svd_predIntersect_2 = state_2.getState();
667  const TMatrixDSym& covMatrix_1 = state_1.getCov();
668  const TMatrixDSym& covMatrix_2 = state_2.getCov();
669  //Restricting to consecutive SVD u-clusters
670  if (svd_1->isUCluster() == true && svd_2->isUCluster() == true) {
671  const int strips_1 = svd_1->getSize();
672  h_SVDstrips_Mult->Fill(strips_1);
673  const int strips_2 = svd_2->getSize();
674  h_SVDstrips_Mult->Fill(strips_2);
675  const double res_U_1 = resUnBias_SVD_1.GetMatrixArray()[0] * Unit::convertValueToUnit(1.0, "um");
676  const double res_U_2 = resUnBias_SVD_2.GetMatrixArray()[0] * Unit::convertValueToUnit(1.0, "um");
677  const float over_U_SVD = res_U_2 - res_U_1;
678  const ROOT::Math::XYZVector svdLocal_1(svd_1->getPosition(), svd_predIntersect_1[4], 0.);
679  const ROOT::Math::XYZVector svdLocal_2(svd_2->getPosition(), svd_predIntersect_2[4], 0.);
680  const VXD::SensorInfoBase& svdSensor_1 = geo.get(svd_id_1);
681  const VXD::SensorInfoBase& svdSensor_2 = geo.get(svd_id_2);
682  const ROOT::Math::XYZVector& svdGlobal_1 = svdSensor_1.pointToGlobal(svdLocal_1);
683  const ROOT::Math::XYZVector& svdGlobal_2 = svdSensor_2.pointToGlobal(svdLocal_2);
684  double svdPhi_1 = atan2(svdGlobal_1.Y(), svdGlobal_1.X()); // maybe use svdGlobal_1.Phi() instead
685  double svdPhi_2 = atan2(svdGlobal_2.Y(), svdGlobal_2.X()); // maybe use svdGlobal_2.Phi() instead
686  double svdZ_1 = svdGlobal_1.Z();
687  double svdZ_2 = svdGlobal_2.Z();
688  B2DEBUG(29, "SVD: difference of u-residuals =========> " << over_U_SVD);
689  //Fill SVD tree for u-overlaps if required by the user
690  if (m_ExpertLevel) {
691  svdDeltaRes_U = over_U_SVD;
692  svdRes_U_int = res_U_1;
693  svdClTime_U_int = svd_1->getClsTime();
694  svdClSNR_U_int = svd_1->getSNR();
695  svdClCharge_U_int = svd_1->getCharge();
697  if (isMC && trueHit_1.size() > 0)
698  svdTruePos_U_int = trueHit_1[0]->getU();
699  else
700  svdTruePos_U_int = -99;
701  svdClPhi_U_int = svdPhi_1;
702  svdClZ_U_int = svdZ_1;
703  svdTrkPos_U_int = svd_predIntersect_1[3];
704  svdTrkPosOS_U_int = svd_predIntersect_1[4];
705  svdTrkPosErr_U_int = sqrt(covMatrix_1[3][3]);
706  svdTrkPosErrOS_U_int = sqrt(covMatrix_1[4][4]);
707  svdTrkQoP_U_int = svd_predIntersect_1[0];
708  svdTrkPrime_U_int = svd_predIntersect_1[1];
709  svdTrkPrimeOS_U_int = svd_predIntersect_1[2];
712  svdTrkPosUnbiased_U_int = svd_predIntersect_unbiased_1[3];
714  svdTrkPosErrUnbiased_U_int = sqrt(covMatrix_unbiased_1[3][3]);
715  svdTrkQoPUnbiased_U_int = svd_predIntersect_unbiased_1[0];
716  svdTrkPrimeUnbiased_U_int = svd_predIntersect_unbiased_1[1];
717  svdLayer_U_int = svd_Layer_1;
718  svdLadder_U_int = svd_Ladder_1;
719  svdSensor_U_int = svd_Sensor_1;
720  svdSize_U_int = strips_1;
721 
722  float pitch = 50e-4;
723  float halfLength = 1.92;
724  if (svdLayer_U_int > 3) {
725  pitch = 75e-4;
726  halfLength = 2.88;
727  }
728  svdClIntStrPos_U_int = fmod(svdClPos_U_int + halfLength, pitch) / pitch;
729 
730  svdStripCharge_U_int.clear();
731  svdStrip6Samples_U_int.clear();
732  svdStripTime_U_int.clear();
733  svdStripPosition_U_int.clear();
734  //retrieve relations and set strip charges and times
735  RelationVector<SVDRecoDigit> theRecoDigits_1 = DataStore::getRelationsWithObj<SVDRecoDigit>(svd_1);
736  if ((theRecoDigits_1.size() != svdSize_U_int) && (svdSize_U_int != 128)) //virtual cluster
737  B2ERROR(" Inconsistency with cluster size! # recoDigits = " << theRecoDigits_1.size() << " != " << svdSize_U_int <<
738  " cluster size");
739 
740  //skip clusters created beacuse of missing APV
741  if (svdSize_U_int < 128)
742  for (unsigned int d = 0; d < svdSize_U_int; d++) {
743  svdStripCharge_U_int.push_back(theRecoDigits_1[d]->getCharge());
744  SVDShaperDigit* ShaperDigit_1 = theRecoDigits_1[d]->getRelated<SVDShaperDigit>();
745  std::array<float, 6> Samples_1 = ShaperDigit_1->getSamples();
746  std::copy(std::begin(Samples_1), std::end(Samples_1), std::back_inserter(svdStrip6Samples_U_int));
747  svdStripTime_U_int.push_back(theRecoDigits_1[d]->getTime());
748  double misalignedStripPos = svdSensor_1.getUCellPosition(theRecoDigits_1[d]->getCellID());
749  //aligned strip pos = misaligned strip - ( misaligned cluster - aligned cluster)
750  svdStripPosition_U_int.push_back(misalignedStripPos - svd_1->getPosition() + svdClPos_U_int);
751  }
752 
753  svdRes_U_ext = res_U_2;
754  svdClTime_U_ext = svd_2->getClsTime();
755  svdClSNR_U_ext = svd_2->getSNR();
756  svdClCharge_U_ext = svd_2->getCharge();
758  if (isMC && trueHit_2.size() > 0)
759  svdTruePos_U_ext = trueHit_2[0]->getU();
760  else
761  svdTruePos_U_ext = -99;
762  svdClPhi_U_ext = svdPhi_2;
763  svdClZ_U_ext = svdZ_2;
764  svdTrkPos_U_ext = svd_predIntersect_2[3];
765  svdTrkPosOS_U_ext = svd_predIntersect_2[4];
766  svdTrkPosErr_U_ext = sqrt(covMatrix_2[3][3]);
767  svdTrkPosErrOS_U_ext = sqrt(covMatrix_2[4][4]);
768  svdTrkQoP_U_ext = svd_predIntersect_2[0];
769  svdTrkPrime_U_ext = svd_predIntersect_2[1];
770  svdTrkPrimeOS_U_ext = svd_predIntersect_2[2];
773  svdTrkPosUnbiased_U_ext = svd_predIntersect_unbiased_2[3];
775  svdTrkPosErrUnbiased_U_ext = sqrt(covMatrix_unbiased_2[3][3]);
776  svdTrkQoPUnbiased_U_ext = svd_predIntersect_unbiased_2[0];
777  svdTrkPrimeUnbiased_U_ext = svd_predIntersect_unbiased_2[1];
778  svdLayer_U_ext = svd_Layer_2;
779  svdLadder_U_ext = svd_Ladder_2;
780  svdSensor_U_ext = svd_Sensor_2;
781  svdSize_U_ext = strips_2;
782 
783  svdClIntStrPos_U_ext = fmod(svdClPos_U_ext + halfLength, pitch) / pitch;
784 
785  svdStripCharge_U_ext.clear();
786  svdStrip6Samples_U_ext.clear();
787  svdStripTime_U_ext.clear();
788  svdStripPosition_U_ext.clear();
789  //retrieve relations and set strip charges and times
790  RelationVector<SVDRecoDigit> theRecoDigits_2 = DataStore::getRelationsWithObj<SVDRecoDigit>(svd_2);
791  if ((theRecoDigits_2.size() != svdSize_U_ext) && (svdSize_U_ext != 128)) //virtual cluster
792  B2ERROR(" Inconsistency with cluster size! # recoDigits = " << theRecoDigits_2.size() << " != " << svdSize_U_ext <<
793  " cluster size");
794  //skip clusters created beacuse of missing APV
795  if (svdSize_U_ext < 128)
796  for (unsigned int d = 0; d < svdSize_U_ext; d++) {
797  svdStripCharge_U_ext.push_back(theRecoDigits_2[d]->getCharge());
798  SVDShaperDigit* ShaperDigit_2 = theRecoDigits_2[d]->getRelated<SVDShaperDigit>();
799  std::array<float, 6> Samples_2 = ShaperDigit_2->getSamples();
800  std::copy(std::begin(Samples_2), std::end(Samples_2), std::back_inserter(svdStrip6Samples_U_ext));
801  svdStripTime_U_ext.push_back(theRecoDigits_2[d]->getTime());
802  double misalignedStripPos = svdSensor_2.getUCellPosition(theRecoDigits_2[d]->getCellID());
803  //aligned strip pos = misaligned strip - ( misaligned cluster - aligned cluster)
804  svdStripPosition_U_ext.push_back(misalignedStripPos - svd_2->getPosition() + svdClPos_U_ext);
805  }
806  t_SVD_U->Fill();
807  }
808  //Fill histograms of residuals differences with SVD u clusters
809  h_U_DeltaRes->Fill(over_U_SVD);
810  h_U_DeltaRes_SVD->Fill(over_U_SVD);
811  if (svd_1->getSize() < 3 && svd_2->getSize() < 3) { //Consider only clusters with 3 or less strips involved
812  h_U_Cl1Cl2_DeltaRes[svd_1->getSize() * svd_2->getSize()]->Fill(over_U_SVD);
813  }
814  //Fill sensor hit-maps and 2D histograms with SVD u clusters
815  if (svd_Layer_1 == 3 && svd_Layer_2 == 3) {
816  h_Lyr3[svd_Ladder_1][svd_Sensor_1]->Fill(svd_1->getPosition(), 0.);
817  h_Lyr3[svd_Ladder_2][svd_Sensor_2]->Fill(svd_2->getPosition(), 0.);
818  h_U_DeltaRes_SVD_Lyr3->Fill(over_U_SVD);
819  h_DeltaResUPhi_Lyr3->Fill(svdPhi_1, over_U_SVD);
820  h_DeltaResUPhi_Lyr3->Fill(svdPhi_2, over_U_SVD);
821  h_DeltaResUz_Lyr3->Fill(svdZ_1, over_U_SVD);
822  h_DeltaResUz_Lyr3->Fill(svdZ_2, over_U_SVD);
823  }
824  if (svd_Layer_1 == 4 && svd_Layer_2 == 4) {
825  h_Lyr4[svd_Ladder_1][svd_Sensor_1]->Fill(svd_1->getPosition(), 0.);
826  h_Lyr4[svd_Ladder_2][svd_Sensor_2]->Fill(svd_2->getPosition(), 0.);
827  h_U_DeltaRes_SVD_Lyr4->Fill(over_U_SVD);
828  h_DeltaResUPhi_Lyr4->Fill(svdPhi_1, over_U_SVD);
829  h_DeltaResUPhi_Lyr4->Fill(svdPhi_2, over_U_SVD);
830  h_DeltaResUz_Lyr4->Fill(svdZ_1, over_U_SVD);
831  h_DeltaResUz_Lyr4->Fill(svdZ_2, over_U_SVD);
832  }
833  if (svd_Layer_1 == 5 && svd_Layer_2 == 5) {
834  h_Lyr5[svd_Ladder_1][svd_Sensor_1]->Fill(svd_1->getPosition(), 0.);
835  h_Lyr5[svd_Ladder_2][svd_Sensor_1]->Fill(svd_1->getPosition(), 0.);
836  h_U_DeltaRes_SVD_Lyr5->Fill(over_U_SVD);
837  h_DeltaResUPhi_Lyr5->Fill(svdPhi_1, over_U_SVD);
838  h_DeltaResUPhi_Lyr5->Fill(svdPhi_2, over_U_SVD);
839  h_DeltaResUz_Lyr5->Fill(svdZ_1, over_U_SVD);
840  h_DeltaResUz_Lyr5->Fill(svdZ_2, over_U_SVD);
841  }
842  if (svd_Layer_1 == 6 && svd_Layer_2 == 6) {
843  h_Lyr6[svd_Ladder_1][svd_Sensor_1]->Fill(svd_1->getPosition(), 0.);
844  h_Lyr6[svd_Ladder_2][svd_Sensor_2]->Fill(svd_2->getPosition(), 0.);
845  h_U_DeltaRes_SVD_Lyr6->Fill(over_U_SVD);
846  h_DeltaResUPhi_Lyr6->Fill(svdPhi_1, over_U_SVD);
847  h_DeltaResUPhi_Lyr6->Fill(svdPhi_2, over_U_SVD);
848  h_DeltaResUz_Lyr6->Fill(svdZ_1, over_U_SVD);
849  h_DeltaResUz_Lyr6->Fill(svdZ_2, over_U_SVD);
850  }
851  }
852  //Restricting to consecutive SVD v-clusters
853  if (svd_1->isUCluster() != true && svd_2->isUCluster() != true) {
854  const int strips_1 = svd_1->getSize();
855  h_SVDstrips_Mult->Fill(strips_1);
856  const int strips_2 = svd_2->getSize();
857  h_SVDstrips_Mult->Fill(strips_2);
858  const double res_V_1 = resUnBias_SVD_1.GetMatrixArray()[0] * Unit::convertValueToUnit(1.0, "um");
859  const double res_V_2 = resUnBias_SVD_2.GetMatrixArray()[0] * Unit::convertValueToUnit(1.0, "um");
860  const float over_V_SVD = res_V_2 - res_V_1;
861  const ROOT::Math::XYZVector svdLocal_1(svd_predIntersect_1[3], svd_1->getPosition(), 0.);
862  const ROOT::Math::XYZVector svdLocal_2(svd_predIntersect_2[3], svd_2->getPosition(), 0.);
863  const VXD::SensorInfoBase& svdSensor_1 = geo.get(svd_id_1);
864  const VXD::SensorInfoBase& svdSensor_2 = geo.get(svd_id_2);
865  const ROOT::Math::XYZVector& svdGlobal_1 = svdSensor_1.pointToGlobal(svdLocal_1);
866  const ROOT::Math::XYZVector& svdGlobal_2 = svdSensor_2.pointToGlobal(svdLocal_2);
867  double svdPhi_1 = atan2(svdGlobal_1.Y(), svdGlobal_1.X()); // maybe use svdGlobal_1.Phi() instead
868  double svdPhi_2 = atan2(svdGlobal_2.Y(), svdGlobal_2.X()); // maybe use svdGlobal_2.Phi() instead
869  double svdZ_1 = svdGlobal_1.Z();
870  double svdZ_2 = svdGlobal_2.Z();
871  B2DEBUG(29, "SVD: difference of v-residuals =========> " << over_V_SVD);
872  //Fill SVD tree for v-overlaps if required by the user
873  if (m_ExpertLevel) {
874  svdDeltaRes_V = over_V_SVD;
875  svdRes_V_int = res_V_1;
876  svdClTime_V_int = svd_1->getClsTime();
877  svdClSNR_V_int = svd_1->getSNR();
878  svdClCharge_V_int = svd_1->getCharge();
880  if (isMC && trueHit_1.size() > 0)
881  svdTruePos_V_int = trueHit_1[0]->getV();
882  else
883  svdTruePos_V_int = -99;
884  svdClPhi_V_int = svdPhi_1;
885  svdClZ_V_int = svdZ_1;
886  svdTrkPos_V_int = svd_predIntersect_1[4];
887  svdTrkPosOS_V_int = svd_predIntersect_1[3];
888  svdTrkPosErr_V_int = sqrt(covMatrix_1[4][4]);
889  svdTrkPosErrOS_V_int = sqrt(covMatrix_1[3][3]);
890  svdTrkQoP_V_int = svd_predIntersect_1[0];
891  svdTrkPrime_V_int = svd_predIntersect_1[2];
892  svdTrkPrimeOS_V_int = svd_predIntersect_1[1];
895  svdTrkPosUnbiased_V_int = svd_predIntersect_unbiased_1[4];
897  svdTrkPosErrUnbiased_V_int = sqrt(covMatrix_unbiased_1[4][4]);
898  svdTrkQoPUnbiased_V_int = svd_predIntersect_unbiased_1[0];
899  svdTrkPrimeUnbiased_V_int = svd_predIntersect_unbiased_1[2];
900  svdLayer_V_int = svd_Layer_1;
901  svdLadder_V_int = svd_Ladder_1;
902  svdSensor_V_int = svd_Sensor_1;
903  svdSize_V_int = strips_1;
904 
905  float pitch = 160e-4;
906  float halfLength = 6.144;
907  if (svdLayer_V_int > 3) {
908  pitch = 240e-4;
909  }
910  svdClIntStrPos_V_int = fmod(svdClPos_V_int + halfLength, pitch) / pitch;
911 
912  svdStripCharge_V_int.clear();
913  svdStrip6Samples_V_int.clear();
914  svdStripTime_V_int.clear();
915  svdStripPosition_V_int.clear();
916  //retrieve relations and set strip charges and times
917  RelationVector<SVDRecoDigit> theRecoDigits_1 = DataStore::getRelationsWithObj<SVDRecoDigit>(svd_1);
918  if ((theRecoDigits_1.size() != svdSize_V_int) && (svdSize_V_int != 128)) //virtual cluster
919  B2ERROR(" Inconsistency with cluster size! # recoDigits = " << theRecoDigits_1.size() << " != " << svdSize_V_int <<
920  " cluster size");
921  //skip clusters created beacuse of missing APV
922  if (svdSize_V_int < 128)
923  for (unsigned int d = 0; d < svdSize_V_int; d++) {
924  svdStripCharge_V_int.push_back(theRecoDigits_1[d]->getCharge());
925  SVDShaperDigit* ShaperDigit_1 = theRecoDigits_1[d]->getRelated<SVDShaperDigit>();
926  std::array<float, 6> Samples_1 = ShaperDigit_1->getSamples();
927  std::copy(std::begin(Samples_1), std::end(Samples_1), std::back_inserter(svdStrip6Samples_V_int));
928  svdStripTime_V_int.push_back(theRecoDigits_1[d]->getTime());
929  double misalignedStripPos = svdSensor_1.getVCellPosition(theRecoDigits_1[d]->getCellID());
930  //aligned strip pos = misaligned strip - ( misaligned cluster - aligned cluster)
931  svdStripPosition_V_int.push_back(misalignedStripPos - svd_1->getPosition() + svdClPos_V_int);
932  }
933 
934  svdRes_V_ext = res_V_2;
935  svdClTime_V_ext = svd_2->getClsTime();
936  svdClSNR_V_ext = svd_2->getSNR();
937  svdClCharge_V_ext = svd_2->getCharge();
939  if (isMC && trueHit_2.size() > 0)
940  svdTruePos_V_ext = trueHit_2[0]->getV();
941  else
942  svdTruePos_V_ext = -99;
943  svdClPhi_V_ext = svdPhi_2;
944  svdClZ_V_ext = svdZ_2;
945  svdTrkPos_V_ext = svd_predIntersect_2[4];
946  svdTrkPosOS_V_ext = svd_predIntersect_2[3];
947  svdTrkPosErr_V_ext = sqrt(covMatrix_2[4][4]);
948  svdTrkPosErrOS_V_ext = sqrt(covMatrix_1[3][3]);
949  svdTrkQoP_V_ext = svd_predIntersect_2[0];
950  svdTrkPrime_V_ext = svd_predIntersect_2[2];
951  svdTrkPrimeOS_V_ext = svd_predIntersect_2[1];
954  svdTrkPosUnbiased_V_ext = svd_predIntersect_unbiased_2[4];
956  svdTrkPosErrUnbiased_V_ext = sqrt(covMatrix_unbiased_2[4][4]);
957  svdTrkQoPUnbiased_V_ext = svd_predIntersect_unbiased_2[0];
958  svdTrkPrimeUnbiased_V_ext = svd_predIntersect_unbiased_2[2];
959  svdLayer_V_ext = svd_Layer_2;
960  svdLadder_V_ext = svd_Ladder_2;
961  svdSensor_V_ext = svd_Sensor_2;
962  svdSize_V_ext = strips_2;
963 
964  svdClIntStrPos_V_ext = fmod(svdClPos_V_ext + halfLength, pitch) / pitch;
965 
966  svdStripCharge_V_ext.clear();
967  svdStrip6Samples_V_ext.clear();
968  svdStripTime_V_ext.clear();
969  svdStripPosition_V_ext.clear();
970  //retrieve relations and set strip charges and times
971  RelationVector<SVDRecoDigit> theRecoDigits_2 = DataStore::getRelationsWithObj<SVDRecoDigit>(svd_2);
972  if ((theRecoDigits_2.size() != svdSize_V_ext) && (svdSize_V_ext != 128)) //virtual cluster
973  B2ERROR(" Inconsistency with cluster size! # recoDigits = " << theRecoDigits_2.size() << " != " << svdSize_V_ext <<
974  " cluster size");
975  //skip clusters created beacuse of missing APV
976  if (svdSize_V_ext < 128)
977  for (unsigned int d = 0; d < svdSize_V_ext; d++) {
978  svdStripCharge_V_ext.push_back(theRecoDigits_2[d]->getCharge());
979  SVDShaperDigit* ShaperDigit_2 = theRecoDigits_2[d]->getRelated<SVDShaperDigit>();
980  std::array<float, 6> Samples_2 = ShaperDigit_2->getSamples();
981  std::copy(std::begin(Samples_2), std::end(Samples_2), std::back_inserter(svdStrip6Samples_V_ext));
982  svdStripTime_V_ext.push_back(theRecoDigits_2[d]->getTime());
983  double misalignedStripPos = svdSensor_2.getVCellPosition(theRecoDigits_2[d]->getCellID());
984  //aligned strip pos = misaligned strip - ( misaligned cluster - aligned cluster)
985  svdStripPosition_V_ext.push_back(misalignedStripPos - svd_2->getPosition() + svdClPos_V_ext);
986  }
987 
988  t_SVD_V->Fill();
989  }
990  //Fill histograms of residuals differences with SVD v clusters
991  h_V_DeltaRes->Fill(over_V_SVD);
992  h_V_DeltaRes_SVD->Fill(over_V_SVD);
993  if (svd_1->getSize() < 3 && svd_2->getSize() < 3) { //Consider only clusters with 3 or less strips involved
994  h_V_Cl1Cl2_DeltaRes[svd_1->getSize() * svd_2->getSize()]->Fill(over_V_SVD);
995  }
996  //Fill sensor hit-maps and 2D histograms with SVD v clusters
997  if (svd_Layer_1 == 3 && svd_Layer_2 == 3) {
998  h_Lyr3[svd_Ladder_1][svd_Sensor_1]->Fill(0., svd_1->getPosition());
999  h_Lyr3[svd_Ladder_2][svd_Sensor_2]->Fill(0., svd_2->getPosition());
1000  h_V_DeltaRes_SVD_Lyr3->Fill(over_V_SVD);
1001  h_DeltaResVPhi_Lyr3->Fill(svdPhi_1, over_V_SVD);
1002  h_DeltaResVPhi_Lyr3->Fill(svdPhi_2, over_V_SVD);
1003  h_DeltaResVz_Lyr3->Fill(svdZ_1, over_V_SVD);
1004  h_DeltaResVz_Lyr3->Fill(svdZ_2, over_V_SVD);
1005  }
1006  if (svd_Layer_1 == 4 && svd_Layer_2 == 4) {
1007  h_Lyr4[svd_Ladder_1][svd_Sensor_1]->Fill(0., svd_1->getPosition());
1008  h_Lyr4[svd_Ladder_2][svd_Sensor_2]->Fill(0., svd_2->getPosition());
1009  h_V_DeltaRes_SVD_Lyr4->Fill(over_V_SVD);
1010  h_DeltaResVPhi_Lyr4->Fill(svdPhi_1, over_V_SVD);
1011  h_DeltaResVPhi_Lyr4->Fill(svdPhi_2, over_V_SVD);
1012  h_DeltaResVz_Lyr4->Fill(svdZ_1, over_V_SVD);
1013  h_DeltaResVz_Lyr4->Fill(svdZ_2, over_V_SVD);
1014  }
1015  if (svd_Layer_1 == 5 && svd_Layer_2 == 5) {
1016  h_Lyr5[svd_Ladder_1][svd_Sensor_1]->Fill(0., svd_1->getPosition());
1017  h_Lyr5[svd_Ladder_2][svd_Sensor_2]->Fill(0., svd_2->getPosition());
1018  h_V_DeltaRes_SVD_Lyr5->Fill(over_V_SVD);
1019  h_DeltaResVPhi_Lyr5->Fill(svdPhi_1, over_V_SVD);
1020  h_DeltaResVPhi_Lyr5->Fill(svdPhi_2, over_V_SVD);
1021  h_DeltaResVz_Lyr5->Fill(svdZ_1, over_V_SVD);
1022  h_DeltaResVz_Lyr5->Fill(svdZ_2, over_V_SVD);
1023  }
1024  if (svd_Layer_1 == 6 && svd_Layer_2 == 6) {
1025  h_Lyr6[svd_Ladder_1][svd_Sensor_1]->Fill(0., svd_1->getPosition());
1026  h_Lyr6[svd_Ladder_2][svd_Sensor_2]->Fill(0., svd_2->getPosition());
1027  h_V_DeltaRes_SVD_Lyr6->Fill(over_V_SVD);
1028  h_DeltaResVPhi_Lyr6->Fill(svdPhi_1, over_V_SVD);
1029  h_DeltaResVPhi_Lyr6->Fill(svdPhi_2, over_V_SVD);
1030  h_DeltaResVz_Lyr6->Fill(svdZ_1, over_V_SVD);
1031  h_DeltaResVz_Lyr6->Fill(svdZ_2, over_V_SVD);
1032  }
1033  }
1034  }
1035  }
1036  }
1037  }
1038 }
1039 
1040 
static const ChargedStable pion
charged pion particle
Definition: Const.h:652
bool isMC() const
Do we have generated, not real data?
Definition: Environment.cc:54
static Environment & Instance()
Static method to get a reference to the Environment instance.
Definition: Environment.cc:28
HistoModule.h is supposed to be used instead of Module.h for the modules with histogram definitions t...
Definition: HistoModule.h:29
void setDescription(const std::string &description)
Sets the description of the module.
Definition: Module.cc:214
float svdTrkQoP_V_int
V internal track q/p.
float svdTrkPosUnbiased_U_int
U internal unbiased track position.
TH2F * h_DeltaResVPhi_Lyr6
2D histogram of DeltaRes_v vs phi of VXD overlaps for layer 6
float svdTrkQoP_U_int
U internal track q/p.
TH1F * h_V_DeltaRes_SVD
Histogram of SVD v-coordinate differences of residuals.
float svdRes_U_int
U internal residual computed by genfit.
float svdTrkPosErr_U_int
U internal track position error.
std::vector< float > svdStrip6Samples_V_ext
V external 6 samples of the strips of the cluster.
std::vector< float > svdStripPosition_U_ext
U external position of the strips of the cluster.
TH2F * h_DeltaResVz_Lyr1
2D histogram of DeltaRes_v vs z of VXD overlaps for layer 1
float svdTrkQoPUnbiased_V_ext
V external unbiased track q/p.
TH2F * h_DeltaResUz_Lyr3
2D histogram of DeltaRes_u vs z of VXD overlaps for layer 3
float svdTrkPos_U_ext
U external track position.
float svdTruePos_V_int
V internal true position.
float svdClPhi_V_ext
V external cluster global phi.
float extResV_PXD
tree t_PXD branch extResV_PXD/F
float svdTrkPosUnbiased_V_ext
V external unbiased track position.
TH1F * h_U_DeltaRes_SVD_Lyr4
Histogram of SVD layer-4 u-coordinate differences of residuals.
std::vector< float > svdStripCharge_U_ext
U external charge of the strips of the cluster.
unsigned int svdLayer_U_ext
U external layer.
float svdTrkPrimeUnbiased_U_int
U internal unbiased tan of incident angle projected on u,w.
float extResU_PXD
tree t_PXD branch extResU_PXD/F
TH2F * h_DeltaResUPhi_Lyr2
2D histogram of DeltaRes_u vs phi of VXD overlaps for layer 2
TH2F * h_DeltaResUPhi_Lyr5
2D histogram of DeltaRes_u vs phi of VXD overlaps for layer 5
TH2F * h_DeltaResUPhi_Lyr3
2D histogram of DeltaRes_u vs phi of VXD overlaps for layer 3
float svdTrkPos_V_int
V internal track position.
TH1F * h_U_DeltaRes_PXD_Lyr1
Histogram of PXD layer-1 u-coordinate differences of residuals.
float svdTrkTraversedLength_V_int
V internal traversed length of the track in the sensor.
TH2F * h_DeltaResUz_Lyr2
2D histogram of DeltaRes_u vs z of VXD overlaps for layer 2
float svdTrkPosOS_V_ext
V external track position on the other side.
float svdClTime_V_ext
V external cluster time.
float svdRes_V_ext
V external residual computed by genfit.
float svdTrkPosOS_U_ext
U external track position on the other side.
float svdTrkPosErrUnbiased_V_int
V internal unbiased track position error.
float svdTrkPrimeOS_U_int
U internal tan of incident angle projected on v/u,w (other side)
std::vector< float > svdStripTime_V_ext
V external time of the strips of the cluster.
TH2F * h_DeltaResUPhi_Lyr1
2D Histogram of DeltaRes_u vs phi of VXD overlaps for layer 1
unsigned int svdLadder_U_ext
U external ladder.
TH2F * h_DeltaResVz_Lyr4
2D histogram of DeltaRes_v vs z of VXD overlaps for layer 4
int svdTrkPXDHits
number of PXD hits on the track
TH1F * h_U_DeltaRes_PXD
Histogram of PXD u-coordinate differences of residuals.
unsigned int extLayer_PXD
tree t_PXD branch extLayer_PXD/i
void initialize() override
Register input and output data.
TH2F * h_DeltaResVPhi_Lyr5
2D histogram of DeltaRes_v vs phi of VXD overlaps for layer 5
float svdTrkQoP_V_ext
V external track q/p.
float svdClIntStrPos_V_ext
V external cluster interstrip position.
std::vector< float > svdStrip6Samples_U_ext
U external 6 samples of the strips of the cluster.
float svdClSNR_V_int
V internal cluster SNR.
float svdTrkPrimeUnbiased_V_ext
V external unbiased tan of incident angle projected on u,w.
unsigned int svdLadder_V_ext
V external ladder.
TH2F * h_Lyr1[9][3]
Sensor hit-map for layer 1 from reconstructed u and v coordinates.
float svdClSNR_U_ext
U external cluster SNR.
unsigned int svdLadder_U_int
U internal ladder.
float svdClSNR_V_ext
V external cluster SNR.
unsigned int svdLayer_V_ext
V external layer.
float svdTrkQoPUnbiased_U_int
U internal unbiased track q/p.
float svdTrkPrimeUnbiased_U_ext
U external unbiased tan of incident angle projected on u,w.
void event() override
Compute the difference of coordinate residuals between two hits in overlapping sensors of a same VXD ...
TH2F * h_DeltaResVPhi_Lyr3
2D histogram of DeltaRes_v vs phi of VXD overlaps for layer 3
TH2F * h_DeltaResVPhi_Lyr4
2D histogram of DeltaRes_v vs phi of VXD overlaps for layer 4
TH1F * h_V_DeltaRes_PXD_Lyr1
Histogram of PXD layer-1 v-coordinate differences of residuals.
float extU_PXD
tree t_PXD branch extU_PXD/F
float svdTrkTraversedLength_U_ext
U external traversed length of the track in the sensor.
float extPhi_PXD
tree t_PXD branch extPhi/PXD/F
float svdClZ_U_int
U internal cluster global Z.
float svdTruePos_U_int
U internal true position.
TH2F * h_DeltaResVz_Lyr3
2D histogram of DeltaRes_v vs z of VXD overlaps for layer 3
float svdRes_U_ext
U external residual computed by genfit.
unsigned int extLadder_PXD
tree t_PXD branch extLadder_PXD/i
unsigned int svdSensor_V_int
V internal sensor.
float svdTruePos_V_ext
V external true position.
float svdClPos_U_int
U internal cluster position.
TH1F * h_U_DeltaRes_SVD_Lyr6
Histogram of SVD layer-6 u-coordinate differences of residuals.
TTree * t_SVD_V
Tree containing global information on SVD v-coordinate overlaps.
TH1F * h_V_DeltaRes_PXD
Histogram of PXD v-coordinate differences of residuals.
unsigned int intLayer_PXD
tree t_PXD branch intLayer_PXD/i
float svdClPosErr_U_ext
U external cluster position error.
TTree * t_SVD_U
Tree containing global information on SVD u-coordinate overlaps.
std::vector< float > svdStripCharge_V_int
V internal charge of the strips of the cluster.
float svdClCharge_U_int
U internal cluster charge.
float svdClCharge_U_ext
U external cluster charge.
std::vector< float > svdStrip6Samples_V_int
V internal 6 samples of the strips of the cluster.
TH2F * h_DeltaResUPhi_Lyr6
2D histogram of DeltaRes_u vs phi of VXD overlaps for layer 6
float svdClTime_U_int
U internal cluster time.
TH2F * h_DeltaResUz_Lyr5
2D histogram of DeltaRes_u vs z of VXD overlaps for layer 5
float svdTrkPosUnbiased_V_int
V internal unbiased track position.
float svdClIntStrPos_U_int
U internal cluster interstrip position.
float svdTrkQoPUnbiased_V_int
V internal unbiased track q/p.
float svdClTime_U_ext
U external cluster time.
std::vector< float > svdStripCharge_U_int
U internal charge of the strips of the cluster.
unsigned int svdLadder_V_int
V internal ladder.
unsigned int svdSize_V_int
V internal size.
TH2F * h_DeltaResVz_Lyr5
2D histogram of DeltaRes_v vs z of VXD overlaps for layer 5
unsigned int svdLayer_V_int
V internal layer.
float svdTrkPosErr_V_ext
V external track position error.
float svdTrkPrime_U_ext
U external tan of incident angle projected on u,w.
float svdDeltaRes_V
V difference between external and internal residual.
TH1F * h_U_Cl1Cl2_DeltaRes[5]
Histogram of SVD differences of u-coordinate residuals grouped by clusters sizes.
float svdTrkPosErrUnbiased_U_ext
U external unbiased track position error.
TH2F * h_DeltaResVz_Lyr6
2D histogram of DeltaRes_v vs z of VXD overlaps for layer 6
float extV_PXD
tree t_PXD branch extV_PXD/F
float svdTrkPosOS_U_int
U internal track position on the other side.
float svdTrkQoPUnbiased_U_ext
U external unbiased track q/p.
TH2F * h_Lyr4[11][4]
Sensor hit-map for layer 4 from reconstructed u and v coordinates.
TH1F * h_V_DeltaRes_SVD_Lyr6
Histogram of SVD layer-6 v-coordinate differences of residuals.
unsigned int svdSensor_V_ext
V external sensor.
int svdTrkCDCHits
number of PXD hits on the track
float svdClPosErr_V_int
V internal cluster position error.
TH1F * h_V_DeltaRes_SVD_Lyr3
Histogram of SVD layer-3 v-coordinate differences of residuals.
TH1F * h_V_Cl1Cl2_DeltaRes[5]
Histogram of SVD differences of v-coordinate residuals grouped by clusters sizes.
float svdTrkPosErr_U_ext
U external track position error.
float svdTrkPrime_U_int
U internal tan of incident angle projected on u,w.
float svdRes_V_int
V internal residual computed by genfit.
float svdTrkPrimeOS_V_ext
V external tan of incident angle projected on v/u,w (other side)
TH1F * h_V_DeltaRes_PXD_Lyr2
Histogram of PXD layer-2 v-coordinate differences of residuals.
TH1F * h_U_DeltaRes_SVD_Lyr5
Histogram of SVD layer-5 u-coordinate differences of residuals.
float svdTrkPosErr_V_int
V internal track position error.
TH1F * h_V_DeltaRes_SVD_Lyr5
Histogram of SVD layer-5 v-coordinate differences of residuals.
float svdClPosErr_V_ext
V external cluster position error.
float deltaResU_PXD
tree t_PXD branch deltaResU/F
TH2F * h_Lyr2[13][3]
Sensor hit-map for layer 2 from reconstructed u and v coordinates.
float svdDeltaRes_U
U difference between external and internal residual.
float intU_PXD
tree t_PXD branch intU_PXD/F
unsigned int extSensor_PXD
tree t_PXD branch extSensor_PXD/i
std::vector< float > svdStripPosition_V_ext
V external position of the strips of the cluster.
float svdClIntStrPos_V_int
V internal cluster interstrip position.
float svdTrkPosErrUnbiased_U_int
U internal unbiased track position error.
TH1F * h_V_DeltaRes_SVD_Lyr4
Histogram of SVD layer-4 v-coordinate differences of residuals.
float svdTrkPosErrUnbiased_V_ext
V external unbiased track position error.
std::vector< float > svdStripCharge_V_ext
V external charge of the strips of the cluster.
std::vector< float > svdStripTime_U_ext
U external time of the strips of the cluster.
TH2F * h_DeltaResUPhi_Lyr4
2D histogram of DeltaRes_u vs phi of VXD overlaps for layer 4
float intZ_PXD
tree t_PXD branch intZ_PXD/F
float svdClPos_V_ext
V external cluster position.
float svdTrkPosErrOS_V_int
V internal track position error on the other side.
std::vector< float > svdStripPosition_U_int
U internal position of the strips of the cluster.
bool m_ExpertLevel
Expert level switch.
unsigned int svdSensor_U_int
U internal sensor.
std::vector< float > svdStrip6Samples_U_int
U internal 6 samples of the strips of the cluster.
float svdClPosErr_U_int
U internal cluster position error.
float svdClIntStrPos_U_ext
U external cluster interstrip position.
float svdClTime_V_int
V internal cluster time.
TH2F * h_DeltaResVPhi_Lyr2
2D histogram of DeltaRes_v vs phi of VXD overlaps for layer 2
TH1F * h_U_DeltaRes
Histogram of VXD ( PXD + SVD ) differences of u-coordinate residuals.
float svdTrkPrime_V_ext
V external tan of incident angle projected on u,w.
float svdTrkTraversedLength_U_int
U internal traversed length of the track in the sensor.
TH2F * h_DeltaResUz_Lyr4
2D histogram of DeltaRes_u vs z of VXD overlaps for layer 4
TH2F * h_Lyr5[13][5]
Sensor hit-map for layer 5 from reconstructed u and v coordinates.
TH1F * h_SVDstrips_Mult
Histogram of SVD strips multiplicity.
TH2F * h_DeltaResUz_Lyr6
2D histogram of DeltaRes_u vs z of VXD overlaps for layer 6
float extZ_PXD
tree t_PXD branch extZ_PXD/F
TH2F * h_Lyr3[8][3]
Sensor hit-map for layer 3 from reconstructed u and v coordinates.
float svdClZ_V_int
V internal cluster global Z.
float svdTrkPrime_V_int
V internal tan of incident angle projected on u,w.
float svdTrkTraversedLength_V_ext
V external traversed length of the track in the sensor.
float svdClCharge_V_ext
V external cluster charge.
unsigned int svdSize_U_int
U internal size.
TH2F * h_DeltaResVPhi_Lyr1
2D histogram of DeltaRes_v vs phi of VXD overlaps for layer 1
std::vector< float > svdStripTime_V_int
V internal time of the strips of the cluster.
float svdClPhi_U_int
U internal cluster global phi.
TH2F * h_DeltaResUz_Lyr1
2D histogram of DeltaRes_u vs z of VXD overlaps for layer 1
float svdClSNR_U_int
U internal cluster SNR.
unsigned int svdLayer_U_int
U internal layer.
float svdClCharge_V_int
V internal cluster charge.
unsigned int svdSensor_U_ext
U external sensor.
float intV_PXD
tree t_PXD branch intV_PXD/F
TH2F * h_Lyr6[17][6]
Sensor hit-map for layer 6 from reconstructed u and v coordinates.
std::vector< float > svdStripPosition_V_int
V internal position of the strips of the cluster.
float svdTrkPrimeOS_U_ext
U external tan of incident angle projected on v/u,w (other side)
unsigned int intSensor_PXD
tree t_PXD branch intSensor_PXD/i
std::vector< float > svdStripTime_U_int
U internal time of the strips of the cluster.
float svdTrkPrimeUnbiased_V_int
V internal unbiased tan of incident angle projected on u,w.
TH2F * h_DeltaResVz_Lyr2
2D histogram of DeltaRes_v vs z of VXD overlaps for layer 2
unsigned int intLadder_PXD
tree t_PXD branch intLadder_PXD/i
float svdClPos_V_int
V internal cluster position.
std::string m_recoTracksStoreArrayName
StoreArray name of the input and output RecoTracks.
float svdTrkPos_V_ext
V external track position.
float svdClZ_U_ext
U external cluster global Z.
int svdTrkSVDHits
number of PXD hits on the track
float intPhi_PXD
tree t_PXD branch intPhi_PXD/F
float svdTrkPrimeOS_V_int
V internal tan of incident angle projected on v/u,w (other side)
float svdTrkPosErrOS_U_ext
U external track position error on the other side.
TTree * t_PXD
Tree containing global information on PXD overlaps.
float svdTrkPosErrOS_U_int
U internal track position error on the other side.
float svdTrkQoP_U_ext
U external track q/p.
float svdClZ_V_ext
V external cluster global Z.
float svdClPhi_V_int
V internal cluster global phi.
TH1F * h_V_DeltaRes
Histogram of VXD ( PXD + SVD ) differences of v-coordinate residuals.
float svdTrkPosOS_V_int
V internal track position on the other side.
unsigned int svdSize_V_ext
V external size.
float intResV_PXD
tree t_PXD branch intResV/PXD/F
TH1F * h_U_DeltaRes_SVD_Lyr3
Histogram of SVD layer-3 u-coordinate differences of residuals.
TH1F * h_U_DeltaRes_PXD_Lyr2
Histogram of PXD layer-2 u-coordinate differences of residuals.
float svdClPhi_U_ext
U external cluster global phi.
TH1F * h_U_DeltaRes_SVD
Histogram of SVD u-coordinate differences of residuals.
float svdClPos_U_ext
U external cluster position.
float svdTruePos_U_ext
U external true position.
float svdTrkPosErrOS_V_ext
V external track position error on the other side.
void defineHisto() override
Histogram definitions such as TH1(), TH2(), TNtuple(), TTree()....
float svdTrkPosUnbiased_U_ext
U external unbiased track position.
float svdTrkPos_U_int
U internal track position.
unsigned int svdSize_U_ext
U external size.
float intResU_PXD
tree t_PXD branch intResU_PXD/F
The PXD Cluster class This class stores all information about reconstructed PXD clusters The position...
Definition: PXDCluster.h:30
float getV() const
Get v coordinate of hit position.
Definition: PXDCluster.h:136
VxdID getSensorID() const
Get the sensor ID.
Definition: PXDCluster.h:126
float getU() const
Get u coordinate of hit position.
Definition: PXDCluster.h:131
This class stores additional information to every CDC/SVD/PXD hit stored in a RecoTrack.
Class for type safe access to objects that are referred to in relations.
size_t size() const
Get number of relations.
The SVD Cluster class This class stores all information about reconstructed SVD clusters.
Definition: SVDCluster.h:29
float getClsTime() const
Get average of waveform maximum times of cluster strip signals.
Definition: SVDCluster.h:134
float getSNR() const
Get cluster SNR.
Definition: SVDCluster.h:159
unsigned short getSize() const
Get cluster size.
Definition: SVDCluster.h:154
float getCharge() const
Get collected charge.
Definition: SVDCluster.h:144
VxdID getSensorID() const
Get the sensor ID.
Definition: SVDCluster.h:102
bool isUCluster() const
Get the direction of strips.
Definition: SVDCluster.h:110
float getPosition(double v=0) const
Get the coordinate of reconstructed hit.
Definition: SVDCluster.h:117
float getPositionSigma() const
Get the error of the reconstructed hit coordinate.
Definition: SVDCluster.h:129
The SVD ShaperDigit class.
APVFloatSamples getSamples() const
Get array of samples.
bool isOptional(const std::string &name="")
Tell the DataStore about an optional input.
Values of the result of a track fit with a given particle hypothesis.
ROOT::Math::PxPyPzEVector get4Momentum() const
Getter for the 4Momentum at the closest approach of the track in the r/phi projection.
double getD0() const
Getter for d0.
double getZ0() const
Getter for z0.
ROOT::Math::XYZVector getMomentum() const
Getter for vector of momentum at closest approach of track in r/phi projection.
Class to faciliate easy access to sensor information of the VXD like coordinate transformations or pi...
Definition: GeoCache.h:39
static GeoCache & getInstance()
Return a reference to the singleton instance.
Definition: GeoCache.cc:214
static const SensorInfoBase & get(Belle2::VxdID id)
Return a reference to the SensorInfo of a given SensorID.
Definition: GeoCache.h:139
Base class to provide Sensor Information for PXD and SVD.
double getVCellPosition(int vID) const
Return the position of a specific strip/pixel in v direction.
double getUCellPosition(int uID, int vID=-1) const
Return the position of a specific strip/pixel in u direction.
ROOT::Math::XYZVector pointToGlobal(const ROOT::Math::XYZVector &local, bool reco=false) const
Convert a point from local to global coordinates.
double getThickness() const
Return the thickness of the sensor.
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:33
baseType getSensorNumber() const
Get the sensor id.
Definition: VxdID.h:100
baseType getLadderNumber() const
Get the ladder id.
Definition: VxdID.h:98
baseType getLayerNumber() const
Get the layer id.
Definition: VxdID.h:96
#StateOnPlane with additional covariance matrix.
REG_MODULE(arichBtest)
Register the Module.
void addParam(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
Definition: Module.h:560
static double convertValueToUnit(double value, const std::string &unitString)
Converts a floating point value from the standard framework unit to the given unit.
Definition: UnitConst.cc:139
double sqrt(double a)
sqrt for double
Definition: beamHelpers.h:28
Abstract base class for different kinds of events.