Belle II Software  release-05-02-19
TrackDQMModule.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2017 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Peter Kodys *
7  * *
8  * Prepared for Tracking DQM *
9  * *
10  * This software is provided "as is" without any warranty. *
11  **************************************************************************/
12 
13 #include <tracking/modules/trackingDQM/TrackDQMModule.h>
14 
15 #include <framework/datastore/StoreArray.h>
16 #include <mdst/dataobjects/Track.h>
17 #include <tracking/dataobjects/RecoTrack.h>
18 #include <tracking/dataobjects/RecoHitInformation.h>
19 #include <svd/geometry/SensorInfo.h>
20 #include <pxd/geometry/SensorInfo.h>
21 
22 #include <vxd/geometry/GeoTools.h>
23 
24 #include <TDirectory.h>
25 #include <TVectorD.h>
26 
27 using namespace Belle2;
28 using namespace std;
29 using boost::format;
30 
31 //-----------------------------------------------------------------
32 // Register the Module
33 //-----------------------------------------------------------------
34 REG_MODULE(TrackDQM)
35 
36 
37 //-----------------------------------------------------------------
38 // Implementation
39 //-----------------------------------------------------------------
40 
42 {
43  //Set module properties
44  setDescription("DQM of finding tracks, their momentum, "
45  "Number of hits in tracks, "
46  "Number of tracks. "
47  );
48  setPropertyFlags(c_ParallelProcessingCertified);
49 
50 }
51 
52 
53 TrackDQMModule::~TrackDQMModule()
54 {
55 }
56 
57 //------------------------------------------------------------------
58 // Function to define histograms
59 //-----------------------------------------------------------------
60 
62 {
63  StoreArray<RecoTrack> recoTracks(m_RecoTracksStoreArrayName);
64  if (!recoTracks.isOptional()) {
65  B2WARNING("Missing recoTracks array, Track-DQM is skipped.");
66  return;
67  }
68  StoreArray<Track> Tracks(m_TracksStoreArrayName);
69  if (!Tracks.isOptional()) {
70  B2WARNING("Missing Tracks array, Track-DQM is skipped.");
71  return;
72  }
73 
74  // eventLevelTrackingInfo is currently only set by VXDTF2, if VXDTF2 is not in path the StoreObject is not there
75  m_eventLevelTrackingInfo.isOptional();
76 
77  // Register histograms (calls back defineHisto)
78  REG_HISTOGRAM
79 
80 }
81 
83 {
84 
85  auto gTools = VXD::GeoCache::getInstance().getGeoTools();
86  if (gTools->getNumberOfLayers() == 0) {
87  B2WARNING("Missing geometry for VXD.");
88  }
89 
90  // basic constants presets:
91  int nVXDLayers = gTools->getNumberOfLayers();
92  int nVXDSensors = gTools->getNumberOfSensors();
93  float ResidualRange = 400; // in um
95 
96  // Create a separate histogram directories and cd into it.
97  TDirectory* oldDir = gDirectory;
98 
99 // There might be problems with nullptr if the directory with the same name already exists (but I am not sure because there isn't anything like that in AlignmentDQM)
100  TDirectory* TracksDQM = oldDir->GetDirectory("TracksDQM");
101  if (!TracksDQM)
102  TracksDQM = oldDir->mkdir("TracksDQM");
103 
104  TDirectory* TracksDQMAlignment = oldDir->GetDirectory("TracksDQMAlignment");
105  if (!TracksDQMAlignment)
106  TracksDQMAlignment = oldDir->mkdir("TracksDQMAlignment");
107 
108  // half-shells
109  TDirectory* HalfShells = TracksDQM->GetDirectory("HalfShells");
110  if (!HalfShells)
111  HalfShells = TracksDQM->mkdir("HalfShells");
112 
113  TracksDQM->cd();
114 
115  // Momentum Phi
116  string name = str(format("MomPhi"));
117  string title = str(format("Momentum Phi of fit"));
118  m_MomPhi = new TH1F(name.c_str(), title.c_str(), 180, -180, 180);
119  m_MomPhi->GetXaxis()->SetTitle("Mom Phi [deg]");
120  m_MomPhi->GetYaxis()->SetTitle("counts");
121  // Momentum CosTheta
122  name = str(format("MomCosTheta"));
123  title = str(format("Cos of Momentum Theta of fit"));
124  m_MomCosTheta = new TH1F(name.c_str(), title.c_str(), 100, -1, 1);
125  m_MomCosTheta->GetXaxis()->SetTitle("Mom CosTheta");
126  m_MomCosTheta->GetYaxis()->SetTitle("counts");
127 
129  name = str(format("PValue"));
130  title = str(format("P value of fit"));
131  m_PValue = new TH1F(name.c_str(), title.c_str(), 100, 0, 1);
132  m_PValue->GetXaxis()->SetTitle("p value");
133  m_PValue->GetYaxis()->SetTitle("counts");
135  name = str(format("Chi2"));
136  title = str(format("Chi2 of fit"));
137  m_Chi2 = new TH1F(name.c_str(), title.c_str(), 200, 0, 150);
138  m_Chi2->GetXaxis()->SetTitle("Chi2");
139  m_Chi2->GetYaxis()->SetTitle("counts");
141  name = str(format("NDF"));
142  title = str(format("NDF of fit"));
143  m_NDF = new TH1F(name.c_str(), title.c_str(), 200, 0, 200);
144  m_NDF->GetXaxis()->SetTitle("NDF");
145  m_NDF->GetYaxis()->SetTitle("counts");
147  name = str(format("Chi2NDF"));
148  title = str(format("Chi2 div NDF of fit"));
149  m_Chi2NDF = new TH1F(name.c_str(), title.c_str(), 200, 0, 10);
150  m_Chi2NDF->GetXaxis()->SetTitle("Chi2NDF");
151  m_Chi2NDF->GetYaxis()->SetTitle("counts");
152 
154  name = str(format("UBResidualsPXD"));
155  title = str(format("Unbiased residuals for PXD"));
156  m_UBResidualsPXD = new TH2F(name.c_str(), title.c_str(), 200, -ResidualRange, ResidualRange, 200, -ResidualRange, ResidualRange);
157  m_UBResidualsPXD->GetXaxis()->SetTitle("u residual [#mum]");
158  m_UBResidualsPXD->GetYaxis()->SetTitle("v residual [#mum]");
159  m_UBResidualsPXD->GetZaxis()->SetTitle("counts");
161  name = str(format("UBResidualsSVD"));
162  title = str(format("Unbiased residuals for SVD"));
163  m_UBResidualsSVD = new TH2F(name.c_str(), title.c_str(), 200, -ResidualRange, ResidualRange, 200, -ResidualRange, ResidualRange);
164  m_UBResidualsSVD->GetXaxis()->SetTitle("u residual [#mum]");
165  m_UBResidualsSVD->GetYaxis()->SetTitle("v residual [#mum]");
166  m_UBResidualsSVD->GetZaxis()->SetTitle("counts");
168  name = str(format("UBResidualsPXDU"));
169  title = str(format("Unbiased residuals in U for PXD"));
170  m_UBResidualsPXDU = new TH1F(name.c_str(), title.c_str(), 200, -ResidualRange, ResidualRange);
171  m_UBResidualsPXDU->GetXaxis()->SetTitle("residual [#mum]");
172  m_UBResidualsPXDU->GetYaxis()->SetTitle("counts");
173  name = str(format("UBResidualsPXDV"));
174  title = str(format("Unbiased residuals in V for PXD"));
175  m_UBResidualsPXDV = new TH1F(name.c_str(), title.c_str(), 200, -ResidualRange, ResidualRange);
176  m_UBResidualsPXDV->GetXaxis()->SetTitle("residual [#mum]");
177  m_UBResidualsPXDV->GetYaxis()->SetTitle("counts");
179  name = str(format("UBResidualsSVDU"));
180  title = str(format("Unbiased residuals in U for SVD"));
181  m_UBResidualsSVDU = new TH1F(name.c_str(), title.c_str(), 200, -ResidualRange, ResidualRange);
182  m_UBResidualsSVDU->GetXaxis()->SetTitle("residual [#mum]");
183  m_UBResidualsSVDU->GetYaxis()->SetTitle("counts");
184  name = str(format("UBResidualsSVDV"));
185  title = str(format("Unbiased residuals in V for SVD"));
186  m_UBResidualsSVDV = new TH1F(name.c_str(), title.c_str(), 200, -ResidualRange, ResidualRange);
187  m_UBResidualsSVDV->GetXaxis()->SetTitle("residual [#mum]");
188  m_UBResidualsSVDV->GetYaxis()->SetTitle("counts");
189 
190  // half-shells
191  HalfShells->cd();
192 
193  // X
194  // Unbiased residuals in X for PXD for Ying
195  name = "Alig_UBResidualsPXDX_Ying";
196  title = "Unbiased residuals in X for PXD for Ying";
197  m_UBResidualsPXDX_Ying = new TH1F(name.c_str(), title.c_str(), 200, -ResidualRange, ResidualRange);
198  m_UBResidualsPXDX_Ying->GetXaxis()->SetTitle("residual [#mum]");
199  m_UBResidualsPXDX_Ying->GetYaxis()->SetTitle("counts");
200 
201  // Unbiased residuals in X for PXD for Yang
202  name = "Alig_UBResidualsPXDX_Yang";
203  title = "Unbiased residuals in X for PXD for Yang";
204  m_UBResidualsPXDX_Yang = new TH1F(name.c_str(), title.c_str(), 200, -ResidualRange, ResidualRange);
205  m_UBResidualsPXDX_Yang->GetXaxis()->SetTitle("residual [#mum]");
206  m_UBResidualsPXDX_Yang->GetYaxis()->SetTitle("counts");
207 
208  // Unbiased residuals in X for SVD for Pat
209  name = "Alig_UBResidualsSVDX_Pat";
210  title = "Unbiased residuals in X for SVD for Pat";
211  m_UBResidualsSVDX_Pat = new TH1F(name.c_str(), title.c_str(), 200, -ResidualRange, ResidualRange);
212  m_UBResidualsSVDX_Pat->GetXaxis()->SetTitle("residual [#mum]");
213  m_UBResidualsSVDX_Pat->GetYaxis()->SetTitle("counts");
214 
215  // Unbiased residuals in X for SVD for Mat
216  name = "Alig_UBResidualsSVDX_Mat";
217  title = "Unbiased residuals in X for SVD for Mat";
218  m_UBResidualsSVDX_Mat = new TH1F(name.c_str(), title.c_str(), 200, -ResidualRange, ResidualRange);
219  m_UBResidualsSVDX_Mat->GetXaxis()->SetTitle("residual [#mum]");
220  m_UBResidualsSVDX_Mat->GetYaxis()->SetTitle("counts");
221 
222  // Y
223  // Unbiased residuals in Y for PXD for Ying
224  name = "Alig_UBResidualsPXDY_Ying";
225  title = "Unbiased residuals in Y for PXD for Ying";
226  m_UBResidualsPXDY_Ying = new TH1F(name.c_str(), title.c_str(), 200, -ResidualRange, ResidualRange);
227  m_UBResidualsPXDY_Ying->GetXaxis()->SetTitle("residual [#mum]");
228  m_UBResidualsPXDY_Ying->GetYaxis()->SetTitle("counts");
229 
230  // Unbiased residuals in Y for PXD for Yang
231  name = "Alig_UBResidualsPXDY_Yang";
232  title = "Unbiased residuals in Y for PXD for Yang";
233  m_UBResidualsPXDY_Yang = new TH1F(name.c_str(), title.c_str(), 200, -ResidualRange, ResidualRange);
234  m_UBResidualsPXDY_Yang->GetXaxis()->SetTitle("residual [#mum]");
235  m_UBResidualsPXDY_Yang->GetYaxis()->SetTitle("counts");
236 
237  // Unbiased residuals in Y for SVD for Pat
238  name = "Alig_UBResidualsSVDY_Pat";
239  title = "Unbiased residuals in Y for SVD for Pat";
240  m_UBResidualsSVDY_Pat = new TH1F(name.c_str(), title.c_str(), 200, -ResidualRange, ResidualRange);
241  m_UBResidualsSVDY_Pat->GetXaxis()->SetTitle("residual [#mum]");
242  m_UBResidualsSVDY_Pat->GetYaxis()->SetTitle("counts");
243 
244  // Unbiased residuals in Y for SVD for Mat
245  name = "Alig_UBResidualsSVDY_Mat";
246  title = "Unbiased residuals in Y for SVD for Mat";
247  m_UBResidualsSVDY_Mat = new TH1F(name.c_str(), title.c_str(), 200, -ResidualRange, ResidualRange);
248  m_UBResidualsSVDY_Mat->GetXaxis()->SetTitle("residual [#mum]");
249  m_UBResidualsSVDY_Mat->GetYaxis()->SetTitle("counts");
250 
251  // Z
252  // Unbiased residuals in Z for PXD for Ying
253  name = "Alig_UBResidualsPXDZ_Ying";
254  title = "Unbiased residuals in Z for PXD for Ying";
255  m_UBResidualsPXDZ_Ying = new TH1F(name.c_str(), title.c_str(), 200, -ResidualRange, ResidualRange);
256  m_UBResidualsPXDZ_Ying->GetXaxis()->SetTitle("residual [#mum]");
257  m_UBResidualsPXDZ_Ying->GetYaxis()->SetTitle("counts");
258 
259  // Unbiased residuals in Z for PXD for Yang
260  name = "Alig_UBResidualsPXDZ_Yang";
261  title = "Unbiased residuals in Z for PXD for Yang";
262  m_UBResidualsPXDZ_Yang = new TH1F(name.c_str(), title.c_str(), 200, -ResidualRange, ResidualRange);
263  m_UBResidualsPXDZ_Yang->GetXaxis()->SetTitle("residual [#mum]");
264  m_UBResidualsPXDZ_Yang->GetYaxis()->SetTitle("counts");
265 
266  // Unbiased residuals in Z for SVD for Pat
267  name = "Alig_UBResidualsSVDZ_Pat";
268  title = "Unbiased residuals in Z for SVD for Pat";
269  m_UBResidualsSVDZ_Pat = new TH1F(name.c_str(), title.c_str(), 200, -ResidualRange, ResidualRange);
270  m_UBResidualsSVDZ_Pat->GetXaxis()->SetTitle("residual [#mum]");
271  m_UBResidualsSVDZ_Pat->GetYaxis()->SetTitle("counts");
272 
273  // Unbiased residuals in Z for SVD for Mat
274  name = "Alig_UBResidualsSVDZ_Mat";
275  title = "Unbiased residuals in Z for SVD for Mat";
276  m_UBResidualsSVDZ_Mat = new TH1F(name.c_str(), title.c_str(), 200, -ResidualRange, ResidualRange);
277  m_UBResidualsSVDZ_Mat->GetXaxis()->SetTitle("residual [#mum]");
278  m_UBResidualsSVDZ_Mat->GetYaxis()->SetTitle("counts");
279 
280  TracksDQM->cd();
281 
282  m_MomX = nullptr;
283  m_MomY = nullptr;
284  m_MomZ = nullptr;
285  m_Mom = nullptr;
286  m_HitsPXD = nullptr;
287  m_HitsSVD = nullptr;
288  m_HitsCDC = nullptr;
289  m_Hits = nullptr;
290  m_TracksVXD = nullptr;
291  m_TracksCDC = nullptr;
292  m_TracksVXDCDC = nullptr;
293  m_Tracks = nullptr;
294 
295  int iHitsInPXD = 10;
296  int iHitsInSVD = 20;
297  int iHitsInCDC = 200;
298  int iHits = 200;
299  int iTracks = 30;
300  int iMomRange = 600;
301  float fMomRange = 6.0;
302  name = str(format("TrackMomentumX"));
303  title = str(format("Track Momentum X"));
304  m_MomX = new TH1F(name.c_str(), title.c_str(), 2 * iMomRange, -fMomRange, fMomRange);
305  m_MomX->GetXaxis()->SetTitle("Momentum");
306  m_MomX->GetYaxis()->SetTitle("counts");
307  name = str(format("TrackMomentumY"));
308  title = str(format("Track Momentum Y"));
309  m_MomY = new TH1F(name.c_str(), title.c_str(), 2 * iMomRange, -fMomRange, fMomRange);
310  m_MomY->GetXaxis()->SetTitle("Momentum");
311  m_MomY->GetYaxis()->SetTitle("counts");
312  name = str(format("TrackMomentumZ"));
313  title = str(format("Track Momentum Z"));
314  m_MomZ = new TH1F(name.c_str(), title.c_str(), 2 * iMomRange, -fMomRange, fMomRange);
315  m_MomZ->GetXaxis()->SetTitle("Momentum");
316  m_MomZ->GetYaxis()->SetTitle("counts");
317  name = str(format("TrackMomentumPt"));
318  title = str(format("Track Momentum pT"));
319  m_MomPt = new TH1F(name.c_str(), title.c_str(), 2 * iMomRange, 0.0, fMomRange);
320  m_MomPt->GetXaxis()->SetTitle("Momentum");
321  m_MomPt->GetYaxis()->SetTitle("counts");
322  name = str(format("TrackMomentumMag"));
323  title = str(format("Track Momentum Magnitude"));
324  m_Mom = new TH1F(name.c_str(), title.c_str(), 2 * iMomRange, 0.0, fMomRange);
325  m_Mom->GetXaxis()->SetTitle("Momentum");
326  m_Mom->GetYaxis()->SetTitle("counts");
327  name = str(format("TrackZ0"));
328  title = str(format("z0 - the z coordinate of the perigee (beam spot position)"));
329  m_Z0 = new TH1F(name.c_str(), title.c_str(), 200, -10.0, 10.0);
330  m_Z0->GetXaxis()->SetTitle("z0 [cm]");
331  m_Z0->GetYaxis()->SetTitle("Arb. Units");
332  name = str(format("TrackD0"));
333  title = str(format("d0 - the signed distance to the IP in the r-phi plane"));
334  m_D0 = new TH1F(name.c_str(), title.c_str(), 200, -1.0, 1.0);
335  m_D0->GetXaxis()->SetTitle("d0 [cm]");
336  m_D0->GetYaxis()->SetTitle("Arb. Units");
337  name = str(format("TrackD0Phi"));
338  title = str(format("d0 vs Phi - the signed distance to the IP in the r-phi plane"));
339  m_D0Phi = new TH2F(name.c_str(), title.c_str(), 72, -180.0, 180.0, 80, -0.4, 0.4);
340  m_D0Phi->GetXaxis()->SetTitle("#phi0 [deg]");
341  m_D0Phi->GetYaxis()->SetTitle("d0 [cm]");
342  m_D0Phi->GetZaxis()->SetTitle("Arb. Units");
343  name = str(format("TrackD0Z0"));
344  title = str(
345  format("z0 vs d0 - signed distance to the IP in r-phi vs. z0 of the perigee (to see primary vertex shifts along R or z)"));
346  m_D0Z0 = new TH2F(name.c_str(), title.c_str(), 200, -10.0, 10.0, 80, -0.4, 0.4);
347  m_D0Z0->GetXaxis()->SetTitle("z0 [cm]");
348  m_D0Z0->GetYaxis()->SetTitle("d0 [cm]");
349  m_D0Z0->GetZaxis()->SetTitle("Arb. Units");
350 
351  name = str(format("TrackPhi"));
352  title = str(format("Phi - angle of the transverse momentum in the r-phi plane, with CDF naming convention"));
353  m_Phi = new TH1F(name.c_str(), title.c_str(), 72, -180.0, 180.0);
354  m_Phi->GetXaxis()->SetTitle("#phi [deg]");
355  m_Phi->GetYaxis()->SetTitle("Arb. Units");
356  name = str(format("TrackTanLambda"));
357  title = str(format("TanLambda - the slope of the track in the r-z plane"));
358  m_TanLambda = new TH1F(name.c_str(), title.c_str(), 400, -4.0, 4.0);
359  m_TanLambda->GetXaxis()->SetTitle("Tan Lambda");
360  m_TanLambda->GetYaxis()->SetTitle("Arb. Units");
361  name = str(format("TrackOmega"));
362  title = str(format("Omega - the curvature of the track. It's sign is defined by the charge of the particle"));
363  m_Omega = new TH1F(name.c_str(), title.c_str(), 400, -0.1, 0.1);
364  m_Omega->GetXaxis()->SetTitle("Omega");
365  m_Omega->GetYaxis()->SetTitle("Arb. Units");
366 
367  name = str(format("NoOfHitsInTrack_PXD"));
368  title = str(format("No Of Hits In Track - PXD"));
369  m_HitsPXD = new TH1F(name.c_str(), title.c_str(), iHitsInPXD, 0, iHitsInPXD);
370  m_HitsPXD->GetXaxis()->SetTitle("# hits");
371  m_HitsPXD->GetYaxis()->SetTitle("counts");
372  name = str(format("NoOfHitsInTrack_SVD"));
373  title = str(format("No Of Hits In Track - SVD"));
374  m_HitsSVD = new TH1F(name.c_str(), title.c_str(), iHitsInSVD, 0, iHitsInSVD);
375  m_HitsSVD->GetXaxis()->SetTitle("# hits");
376  m_HitsSVD->GetYaxis()->SetTitle("counts");
377  name = str(format("NoOfHitsInTrack_CDC"));
378  title = str(format("No Of Hits In Track - CDC"));
379  m_HitsCDC = new TH1F(name.c_str(), title.c_str(), iHitsInCDC, 0, iHitsInCDC);
380  m_HitsCDC->GetXaxis()->SetTitle("# hits");
381  m_HitsCDC->GetYaxis()->SetTitle("counts");
382  name = str(format("NoOfHitsInTrack"));
383  title = str(format("No Of Hits In Track"));
384  m_Hits = new TH1F(name.c_str(), title.c_str(), iHits, 0, iHits);
385  m_Hits->GetXaxis()->SetTitle("# hits");
386  m_Hits->GetYaxis()->SetTitle("counts");
387 
388  name = str(format("NoOfTracksInVXDOnly"));
389  title = str(format("No Of Tracks Per Event, Only In VXD"));
390  m_TracksVXD = new TH1F(name.c_str(), title.c_str(), iTracks, 0, iTracks);
391  m_TracksVXD->GetXaxis()->SetTitle("# tracks");
392  m_TracksVXD->GetYaxis()->SetTitle("counts");
393  name = str(format("NoOfTracksInCDCOnly"));
394  title = str(format("No Of Tracks Per Event, Only In CDC"));
395  m_TracksCDC = new TH1F(name.c_str(), title.c_str(), iTracks, 0, iTracks);
396  m_TracksCDC->GetXaxis()->SetTitle("# tracks");
397  m_TracksCDC->GetYaxis()->SetTitle("counts");
398  name = str(format("NoOfTracksInVXDCDC"));
399  title = str(format("No Of Tracks Per Event, In VXD+CDC"));
400  m_TracksVXDCDC = new TH1F(name.c_str(), title.c_str(), iTracks, 0, iTracks);
401  m_TracksVXDCDC->GetXaxis()->SetTitle("# tracks");
402  m_TracksVXDCDC->GetYaxis()->SetTitle("counts");
403  name = str(format("NoOfTracks"));
404  title = str(format("No Of All Tracks Per Event"));
405  m_Tracks = new TH1F(name.c_str(), title.c_str(), iTracks, 0, iTracks);
406  m_Tracks->GetXaxis()->SetTitle("# tracks");
407  m_Tracks->GetYaxis()->SetTitle("counts");
408 
409  if (gTools->getNumberOfLayers() == 0) {
410  B2WARNING("Missing geometry for VXD, VXD-DQM related are skiped.");
411  return;
412  }
413 
414  m_TRClusterHitmap = (TH2F**) new TH2F*[nVXDLayers];
415  m_TRClusterCorrelationsPhi = (TH2F**) new TH2F*[nVXDLayers - 1];
416  m_TRClusterCorrelationsTheta = (TH2F**) new TH2F*[nVXDLayers - 1];
417  m_UBResidualsSensor = (TH2F**) new TH2F*[nVXDSensors];
418  m_UBResidualsSensorU = (TH1F**) new TH1F*[nVXDSensors];
419  m_UBResidualsSensorV = (TH1F**) new TH1F*[nVXDSensors];
420 
421  for (VxdID layer : geo.getLayers()) {
422  int i = layer.getLayerNumber();
423  int index = gTools->getLayerIndex(layer.getLayerNumber());
425  name = str(format("TRClusterHitmapLayer%1%") % i);
426  title = str(format("Cluster Hitmap for layer %1%") % i);
427  m_TRClusterHitmap[index] = new TH2F(name.c_str(), title.c_str(), 360, -180.0, 180.0, 180, 0.0, 180.0);
428  m_TRClusterHitmap[index]->GetXaxis()->SetTitle("Phi angle [deg]");
429  m_TRClusterHitmap[index]->GetYaxis()->SetTitle("Theta angle [deg]");
430  m_TRClusterHitmap[index]->GetZaxis()->SetTitle("counts");
431  }
432 
433 
434  for (VxdID layer : geo.getLayers()) {
435  int i = layer.getLayerNumber();
436  if (i == gTools->getLastLayer()) continue;
437  int index = gTools->getLayerIndex(layer.getLayerNumber());
439  name = str(format("CorrelationsPhiLayers_%1%_%2%") % i % (i + 1));
440  title = str(format("Correlations in Phi for Layers %1% %2%") % i % (i + 1));
441  m_TRClusterCorrelationsPhi[index] = new TH2F(name.c_str(), title.c_str(), 360, -180.0, 180.0, 360, -180.0, 180.0);
442  title = str(format("angle layer %1% [deg]") % i);
443  m_TRClusterCorrelationsPhi[index]->GetXaxis()->SetTitle(title.c_str());
444  title = str(format("angle layer %1% [deg]") % (i + 1));
445  m_TRClusterCorrelationsPhi[index]->GetYaxis()->SetTitle(title.c_str());
446  m_TRClusterCorrelationsPhi[index]->GetZaxis()->SetTitle("counts");
448  name = str(format("CorrelationsThetaLayers_%1%_%2%") % i % (i + 1));
449  title = str(format("Correlations in Theta for Layers %1% %2%") % i % (i + 1));
450  m_TRClusterCorrelationsTheta[index] = new TH2F(name.c_str(), title.c_str(), 180, 0.0, 180.0, 180, 0.0, 180.0);
451  title = str(format("angle layer %1% [deg]") % i);
452  m_TRClusterCorrelationsTheta[index]->GetXaxis()->SetTitle(title.c_str());
453  title = str(format("angle layer %1% [deg]") % (i + 1));
454  m_TRClusterCorrelationsTheta[index]->GetYaxis()->SetTitle(title.c_str());
455  m_TRClusterCorrelationsTheta[index]->GetZaxis()->SetTitle("counts");
456  }
457 
458  // only monitor if any flag was set so only 2 bins needed
459  m_trackingErrorFlags = new TH1F("NumberTrackingErrorFlags", "Tracking error summary."
460  " Mean = errors/event (should be 0 or very close to 0); Error occured yes or no; Number of events", 2, -0.5, 1.5);
461  m_trackingErrorFlags->GetXaxis()->SetBinLabel(1, "No Error");
462  m_trackingErrorFlags->GetXaxis()->SetBinLabel(2, "Error occured");
463 
464  TracksDQMAlignment->cd();
465 
466  for (int i = 0; i < nVXDSensors; i++) {
467  VxdID id = gTools->getSensorIDFromIndex(i);
468  int iLayer = id.getLayerNumber();
469  int iLadder = id.getLadderNumber();
470  int iSensor = id.getSensorNumber();
472  string sensorDescr = str(format("%1%_%2%_%3%") % iLayer % iLadder % iSensor);
473  name = str(format("UBResidualsU_%1%") % sensorDescr);
474  sensorDescr = str(format("Layer %1% Ladder %2% Sensor %3%") % iLayer % iLadder % iSensor);
475  title = str(format("PXD Unbiased U residuals for sensor %1%") % sensorDescr);
476  m_UBResidualsSensorU[i] = new TH1F(name.c_str(), title.c_str(), 200, -ResidualRange, ResidualRange);
477  m_UBResidualsSensorU[i]->GetXaxis()->SetTitle("residual [#mum]");
478  m_UBResidualsSensorU[i]->GetYaxis()->SetTitle("counts");
479  sensorDescr = str(format("%1%_%2%_%3%") % iLayer % iLadder % iSensor);
480  name = str(format("UBResidualsV_%1%") % sensorDescr);
481  sensorDescr = str(format("Layer %1% Ladder %2% Sensor %3%") % iLayer % iLadder % iSensor);
482  title = str(format("PXD Unbiased V residuals for sensor %1%") % sensorDescr);
483  m_UBResidualsSensorV[i] = new TH1F(name.c_str(), title.c_str(), 200, -ResidualRange, ResidualRange);
484  m_UBResidualsSensorV[i]->GetXaxis()->SetTitle("residual [#mum]");
485  m_UBResidualsSensorV[i]->GetYaxis()->SetTitle("counts");
486  sensorDescr = str(format("%1%_%2%_%3%") % iLayer % iLadder % iSensor);
487  name = str(format("UBResiduals_%1%") % sensorDescr);
488  sensorDescr = str(format("Layer %1% Ladder %2% Sensor %3%") % iLayer % iLadder % iSensor);
489  title = str(format("PXD Unbiased residuals for sensor %1%") % sensorDescr);
490  m_UBResidualsSensor[i] = new TH2F(name.c_str(), title.c_str(), 200, -ResidualRange, ResidualRange, 200, -ResidualRange,
491  ResidualRange);
492  m_UBResidualsSensor[i]->GetXaxis()->SetTitle("residual U [#mum]");
493  m_UBResidualsSensor[i]->GetYaxis()->SetTitle("residual V [#mum]");
494  m_UBResidualsSensor[i]->GetZaxis()->SetTitle("counts");
495  }
496 
497 
498 
499  oldDir->cd();
500 }
501 
503 {
504  StoreArray<RecoTrack> recoTracks(m_RecoTracksStoreArrayName);
505  if (!recoTracks.isOptional()) return;
506  StoreArray<Track> Tracks(m_TracksStoreArrayName);
507  if (!Tracks.isOptional()) return;
508 
509  auto gTools = VXD::GeoCache::getInstance().getGeoTools();
511 
512  if (m_MomPhi != nullptr) m_MomPhi->Reset();
513  if (m_MomCosTheta != nullptr) m_MomCosTheta->Reset();
514  if (m_PValue != nullptr) m_PValue->Reset();
515  if (m_Chi2 != nullptr) m_Chi2->Reset();
516  if (m_NDF != nullptr) m_NDF->Reset();
517  if (m_Chi2NDF != nullptr) m_Chi2NDF->Reset();
518  if (m_UBResidualsPXD != nullptr) m_UBResidualsPXD->Reset();
519  if (m_UBResidualsSVD != nullptr) m_UBResidualsSVD->Reset();
520  if (m_UBResidualsPXDU != nullptr) m_UBResidualsPXDU->Reset();
521  if (m_UBResidualsSVDU != nullptr) m_UBResidualsSVDU->Reset();
522  if (m_UBResidualsPXDV != nullptr) m_UBResidualsPXDV->Reset();
523  if (m_UBResidualsSVDV != nullptr) m_UBResidualsSVDV->Reset();
524 
525  // half-shells
526  if (m_UBResidualsPXDX_Ying != nullptr) m_UBResidualsPXDX_Ying->Reset();
527  if (m_UBResidualsPXDX_Yang != nullptr) m_UBResidualsPXDX_Yang->Reset();
528  if (m_UBResidualsSVDX_Pat != nullptr) m_UBResidualsSVDX_Pat->Reset();
529  if (m_UBResidualsSVDX_Mat != nullptr) m_UBResidualsSVDX_Mat->Reset();
530 
531  if (m_UBResidualsPXDY_Ying != nullptr) m_UBResidualsPXDY_Ying->Reset();
532  if (m_UBResidualsPXDY_Yang != nullptr) m_UBResidualsPXDY_Yang->Reset();
533  if (m_UBResidualsSVDY_Pat != nullptr) m_UBResidualsSVDY_Pat->Reset();
534  if (m_UBResidualsSVDY_Mat != nullptr) m_UBResidualsSVDY_Mat->Reset();
535 
536  if (m_UBResidualsPXDZ_Ying != nullptr) m_UBResidualsPXDZ_Ying->Reset();
537  if (m_UBResidualsPXDZ_Yang != nullptr) m_UBResidualsPXDZ_Yang->Reset();
538  if (m_UBResidualsSVDZ_Pat != nullptr) m_UBResidualsSVDZ_Pat->Reset();
539  if (m_UBResidualsSVDZ_Mat != nullptr) m_UBResidualsSVDZ_Mat->Reset();
540 
541 
542  if (m_MomX != nullptr) m_MomX->Reset();
543  if (m_MomY != nullptr) m_MomY->Reset();
544  if (m_MomZ != nullptr) m_MomZ->Reset();
545  if (m_Mom != nullptr) m_Mom->Reset();
546  if (m_D0 != nullptr) m_D0->Reset();
547  if (m_D0Phi != nullptr) m_D0Phi->Reset();
548  if (m_D0Z0 != nullptr) m_D0Z0->Reset();
549 
550  if (m_Z0 != nullptr) m_Z0->Reset();
551  if (m_Phi != nullptr) m_Phi->Reset();
552  if (m_TanLambda != nullptr) m_TanLambda->Reset();
553  if (m_Omega != nullptr) m_Omega->Reset();
554  if (m_HitsPXD != nullptr) m_HitsPXD->Reset();
555  if (m_HitsSVD != nullptr) m_HitsSVD->Reset();
556  if (m_HitsCDC != nullptr) m_HitsCDC->Reset();
557  if (m_Hits != nullptr) m_Hits->Reset();
558  if (m_TracksVXD != nullptr) m_TracksVXD->Reset();
559  if (m_TracksCDC != nullptr) m_TracksCDC->Reset();
560  if (m_TracksVXDCDC != nullptr) m_TracksVXDCDC->Reset();
561  if (m_Tracks != nullptr) m_Tracks->Reset();
562 
563  if (m_trackingErrorFlags != nullptr) m_trackingErrorFlags->Reset();
564 
565 
566  if (gTools->getNumberOfLayers() == 0) return;
567 
568  for (VxdID layer : geo.getLayers()) {
569  int i = gTools->getLayerIndex(layer.getLayerNumber());
570  if (m_TRClusterHitmap && m_TRClusterHitmap[i] != nullptr) m_TRClusterHitmap[i]->Reset();
571  }
572 
573  for (VxdID layer : geo.getLayers()) {
574  int i = layer.getLayerNumber();
575  if (i == gTools->getLastLayer()) continue;
576  i = gTools->getLayerIndex(i);
577  if (m_TRClusterCorrelationsPhi && m_TRClusterCorrelationsPhi[i] != nullptr) m_TRClusterCorrelationsPhi[i]->Reset();
578  if (m_TRClusterCorrelationsTheta && m_TRClusterCorrelationsTheta[i] != nullptr) m_TRClusterCorrelationsTheta[i]->Reset();
579  }
580 
581  for (int i = 0; i < gTools->getNumberOfSensors(); i++) {
582  if (m_UBResidualsSensor && m_UBResidualsSensor[i] != nullptr) m_UBResidualsSensor[i]->Reset();
583  if (m_UBResidualsSensorU && m_UBResidualsSensorU[i] != nullptr) m_UBResidualsSensorU[i]->Reset();
584  if (m_UBResidualsSensorV && m_UBResidualsSensorV[i] != nullptr) m_UBResidualsSensorV[i]->Reset();
585  }
586 
587 }
588 
589 
591 {
592 
593  StoreArray<RecoTrack> recoTracks(m_RecoTracksStoreArrayName);
594  if (!recoTracks.isOptional() || !recoTracks.getEntries()) return;
595  StoreArray<Track> tracks(m_TracksStoreArrayName);
596  if (!tracks.isOptional() || !tracks.getEntries()) return;
597 
598  auto gTools = VXD::GeoCache::getInstance().getGeoTools();
599  try {
600  int iTrack = 0;
601  int iTrackVXD = 0;
602  int iTrackCDC = 0;
603  int iTrackVXDCDC = 0;
604 
605  for (const Track& track : tracks) { // over tracks
606  RelationVector<RecoTrack> recoTrack = track.getRelationsTo<RecoTrack>(m_RecoTracksStoreArrayName);
607  if (!recoTrack.size()) continue;
608  RelationVector<PXDCluster> pxdClustersTrack = DataStore::getRelationsWithObj<PXDCluster>(recoTrack[0]);
609  int nPXD = (int)pxdClustersTrack.size();
610  RelationVector<SVDCluster> svdClustersTrack = DataStore::getRelationsWithObj<SVDCluster>(recoTrack[0]);
611  int nSVD = (int)svdClustersTrack.size();
612  RelationVector<CDCHit> cdcHitTrack = DataStore::getRelationsWithObj<CDCHit>(recoTrack[0]);
613  int nCDC = (int)cdcHitTrack.size();
614  const TrackFitResult* tfr = track.getTrackFitResultWithClosestMass(Const::pion);
615  /*
616  const auto& resmap = track.getTrackFitResults();
617  auto hypot = max_element(
618  resmap.begin(),
619  resmap.end(),
620  [](const pair<Const::ChargedStable, const TrackFitResult*>& x1, const pair<Const::ChargedStable, const TrackFitResult*>& x2)->bool
621  {return x1.second->getPValue() < x2.second->getPValue();}
622  );
623  const TrackFitResult* tfr = hypot->second;
624  */
625  if (tfr == nullptr) continue;
626 
627  TString message = Form("TrackDQM: track %3i, Mom: %f, %f, %f, Pt: %f, Mag: %f, Hits: PXD %i SVD %i CDC %i Suma %i\n",
628  iTrack,
629  (float)tfr->getMomentum().Px(),
630  (float)tfr->getMomentum().Py(),
631  (float)tfr->getMomentum().Pz(),
632  (float)tfr->getMomentum().Pt(),
633  (float)tfr->getMomentum().Mag(),
634  nPXD, nSVD, nCDC, nPXD + nSVD + nCDC
635  );
636  B2DEBUG(20, message.Data());
637  iTrack++;
638 
639  float Phi = atan2(tfr->getMomentum().Py(), tfr->getMomentum().Px()) * TMath::RadToDeg();
640  float pxy = sqrt(tfr->getMomentum().Px() * tfr->getMomentum().Px() + tfr->getMomentum().Py() * tfr->getMomentum().Py());
641  float Theta = atan2(pxy, tfr->getMomentum().Pz());
642  m_MomPhi->Fill(Phi);
643  m_MomCosTheta->Fill(cos(Theta));
644 
645  if (recoTrack[0]->wasFitSuccessful()) {
646  if (!recoTrack[0]->getTrackFitStatus())
647  continue;
648 
649 
650  // add NDF:
651  float NDF = recoTrack[0]->getTrackFitStatus()->getNdf();
652  m_NDF->Fill(NDF);
653  // add Chi2/NDF:
654  m_Chi2->Fill(recoTrack[0]->getTrackFitStatus()->getChi2());
655  if (NDF) {
656  float Chi2NDF = recoTrack[0]->getTrackFitStatus()->getChi2() / NDF;
657  m_Chi2NDF->Fill(Chi2NDF);
658  }
659  // add p-value:
660  float pValue = recoTrack[0]->getTrackFitStatus()->getPVal();
661  m_PValue->Fill(pValue);
662 
663  VxdID sensorIDPrew;
664 
665  float ResidUPlaneRHUnBias = 0;
666  float ResidVPlaneRHUnBias = 0;
667  float fPosSPUPrev = 0;
668  float fPosSPVPrev = 0;
669  float fPosSPU = 0;
670  float fPosSPV = 0;
671  int iLayerPrev = 0;
672  int iLayer = 0;
673 
674  bool isNotFirstHit = false;
675 
676  int IsSVDU = -1;
677  for (auto recoHitInfo : recoTrack[0]->getRecoHitInformations(true)) { // over recohits
678  if (!recoHitInfo) {
679  B2DEBUG(20, "No genfit::pxd recoHitInfo is missing.");
680  continue;
681  }
682  if (!recoHitInfo->useInFit())
683  continue;
684  if (!((recoHitInfo->getTrackingDetector() == RecoHitInformation::c_PXD) ||
685  (recoHitInfo->getTrackingDetector() == RecoHitInformation::c_SVD)))
686  continue;
687 
688  bool biased = false;
689  if (!recoTrack[0]->getCreatedTrackPoint(recoHitInfo)->getFitterInfo()) continue;
690  TVectorD resUnBias = recoTrack[0]->getCreatedTrackPoint(recoHitInfo)->getFitterInfo()->getResidual(0, biased).getState();
691  IsSVDU = -1;
692  if (recoHitInfo->getTrackingDetector() == RecoHitInformation::c_PXD) {
693  TVector3 rLocal(recoHitInfo->getRelatedTo<PXDCluster>()->getU(), recoHitInfo->getRelatedTo<PXDCluster>()->getV(), 0);
694  VxdID sensorID = recoHitInfo->getRelatedTo<PXDCluster>()->getSensorID();
695  auto info = dynamic_cast<const PXD::SensorInfo&>(VXD::GeoCache::get(sensorID));
696  iLayer = sensorID.getLayerNumber();
697  TVector3 ral = info.pointToGlobal(rLocal, true);
698  fPosSPU = ral.Phi() / TMath::Pi() * 180;
699  fPosSPV = ral.Theta() / TMath::Pi() * 180;
700  ResidUPlaneRHUnBias = resUnBias.GetMatrixArray()[0] * Unit::convertValueToUnit(1.0, "um");
701  ResidVPlaneRHUnBias = resUnBias.GetMatrixArray()[1] * Unit::convertValueToUnit(1.0, "um");
702  if (isNotFirstHit && ((iLayer - iLayerPrev) == 1)) {
703  int index = gTools->getLayerIndex(sensorID.getLayerNumber()) - gTools->getFirstLayer();
704  m_TRClusterCorrelationsPhi[index]->Fill(fPosSPUPrev, fPosSPU);
705  m_TRClusterCorrelationsTheta[index]->Fill(fPosSPVPrev, fPosSPV);
706  } else
707  isNotFirstHit = true;
708  iLayerPrev = iLayer;
709  fPosSPUPrev = fPosSPU;
710  fPosSPVPrev = fPosSPV;
711  m_UBResidualsPXD->Fill(ResidUPlaneRHUnBias, ResidVPlaneRHUnBias);
712  m_UBResidualsPXDU->Fill(ResidUPlaneRHUnBias);
713  m_UBResidualsPXDV->Fill(ResidVPlaneRHUnBias);
714  int index = gTools->getSensorIndex(sensorID);
715  m_UBResidualsSensor[index]->Fill(ResidUPlaneRHUnBias, ResidVPlaneRHUnBias);
716  m_UBResidualsSensorU[index]->Fill(ResidUPlaneRHUnBias);
717  m_UBResidualsSensorV[index]->Fill(ResidVPlaneRHUnBias);
718  m_TRClusterHitmap[gTools->getLayerIndex(sensorID.getLayerNumber())]->Fill(fPosSPU, fPosSPV);
719 
720  // half-shells
721  TVector3 localResidual(ResidUPlaneRHUnBias, ResidVPlaneRHUnBias, 0);
722  auto globalResidual = info.vectorToGlobal(localResidual, true);
723 
724  if (IsNotYang(sensorID.getLadderNumber(), sensorID.getLayerNumber())) {
725  m_UBResidualsPXDX_Ying->Fill(globalResidual.x());
726  m_UBResidualsPXDY_Ying->Fill(globalResidual.y());
727  m_UBResidualsPXDZ_Ying->Fill(globalResidual.z());
728  } else {
729  m_UBResidualsPXDX_Yang->Fill(globalResidual.x());
730  m_UBResidualsPXDY_Yang->Fill(globalResidual.y());
731  m_UBResidualsPXDZ_Yang->Fill(globalResidual.z());
732  }
733  }
734  if (recoHitInfo->getTrackingDetector() == RecoHitInformation::c_SVD) {
735  IsSVDU = recoHitInfo->getRelatedTo<SVDCluster>()->isUCluster();
736  VxdID sensorID = recoHitInfo->getRelatedTo<SVDCluster>()->getSensorID();
737  auto info = dynamic_cast<const SVD::SensorInfo&>(VXD::GeoCache::get(sensorID));
738  iLayer = sensorID.getLayerNumber();
739  if (IsSVDU) {
740  TVector3 rLocal(recoHitInfo->getRelatedTo<SVDCluster>()->getPosition(), 0 , 0);
741  TVector3 ral = info.pointToGlobal(rLocal, true);
742  fPosSPU = ral.Phi() / TMath::Pi() * 180;
743  ResidUPlaneRHUnBias = resUnBias.GetMatrixArray()[0] * Unit::convertValueToUnit(1.0, "um");
744  if (sensorIDPrew != sensorID) { // other sensor, reset
745  ResidVPlaneRHUnBias = 0;
746  fPosSPV = 0;
747  }
748  sensorIDPrew = sensorID;
749  } else {
750  TVector3 rLocal(0, recoHitInfo->getRelatedTo<SVDCluster>()->getPosition(), 0);
751  TVector3 ral = info.pointToGlobal(rLocal, true);
752  fPosSPV = ral.Theta() / TMath::Pi() * 180;
753  ResidVPlaneRHUnBias = resUnBias.GetMatrixArray()[0] * Unit::convertValueToUnit(1.0, "um");
754  if (sensorIDPrew == sensorID) { // evaluate
755  if (isNotFirstHit && ((iLayer - iLayerPrev) == 1)) {
756  int index = gTools->getLayerIndex(sensorID.getLayerNumber()) - gTools->getFirstLayer();
757  m_TRClusterCorrelationsPhi[index]->Fill(fPosSPUPrev, fPosSPU);
758  m_TRClusterCorrelationsTheta[index]->Fill(fPosSPVPrev, fPosSPV);
759  } else
760  isNotFirstHit = true;
761  iLayerPrev = iLayer;
762  fPosSPUPrev = fPosSPU;
763  fPosSPVPrev = fPosSPV;
764  m_UBResidualsSVD->Fill(ResidUPlaneRHUnBias, ResidVPlaneRHUnBias);
765  m_UBResidualsSVDU->Fill(ResidUPlaneRHUnBias);
766  m_UBResidualsSVDV->Fill(ResidVPlaneRHUnBias);
767  int index = gTools->getSensorIndex(sensorID);
768  m_UBResidualsSensor[index]->Fill(ResidUPlaneRHUnBias, ResidVPlaneRHUnBias);
769  m_UBResidualsSensorU[index]->Fill(ResidUPlaneRHUnBias);
770  m_UBResidualsSensorV[index]->Fill(ResidVPlaneRHUnBias);
771  m_TRClusterHitmap[gTools->getLayerIndex(sensorID.getLayerNumber())]->Fill(fPosSPU, fPosSPV);
772 
773  // half-shells
774  TVector3 localResidual(ResidUPlaneRHUnBias, ResidVPlaneRHUnBias, 0);
775  auto globalResidual = info.vectorToGlobal(localResidual, true);
776 
777  if (IsNotMat(sensorID.getLadderNumber(), sensorID.getLayerNumber())) {
778  m_UBResidualsSVDX_Pat->Fill(globalResidual.x());
779  m_UBResidualsSVDY_Pat->Fill(globalResidual.y());
780  m_UBResidualsSVDZ_Pat->Fill(globalResidual.z());
781  } else {
782  m_UBResidualsSVDX_Mat->Fill(globalResidual.x());
783  m_UBResidualsSVDY_Mat->Fill(globalResidual.y());
784  m_UBResidualsSVDZ_Mat->Fill(globalResidual.z());
785  }
786  }
787  if (sensorIDPrew != sensorID) { // other sensor, reset
788  ResidUPlaneRHUnBias = 0;
789  fPosSPU = 0;
790  }
791  sensorIDPrew = sensorID;
792  }
793  }
794  }
795  }
796  if (((nPXD > 0) || (nSVD > 0)) && (nCDC > 0)) iTrackVXDCDC++;
797  if (((nPXD > 0) || (nSVD > 0)) && (nCDC == 0)) iTrackVXD++;
798  if (((nPXD == 0) && (nSVD == 0)) && (nCDC > 0)) iTrackCDC++;
799  if (m_MomX != nullptr) m_MomX->Fill(tfr->getMomentum().Px());
800  if (m_MomY != nullptr) m_MomY->Fill(tfr->getMomentum().Py());
801  if (m_MomZ != nullptr) m_MomZ->Fill(tfr->getMomentum().Pz());
802  if (m_MomPt != nullptr) m_MomPt->Fill(tfr->getMomentum().Pt());
803  if (m_Mom != nullptr) m_Mom->Fill(tfr->getMomentum().Mag());
804  if (m_D0 != nullptr) m_D0->Fill(tfr->getD0());
805  if (m_D0Phi != nullptr) m_D0Phi->Fill(tfr->getPhi0() * Unit::convertValueToUnit(1.0, "deg"), tfr->getD0());
806  if (m_Z0 != nullptr) m_Z0->Fill(tfr->getZ0());
807  if (m_D0Z0 != nullptr) m_D0Z0->Fill(tfr->getZ0(), tfr->getD0());
808 
809  if (m_Phi != nullptr) m_Phi->Fill(tfr->getPhi() * Unit::convertValueToUnit(1.0, "deg"));
810  if (m_TanLambda != nullptr) m_TanLambda->Fill(tfr->getTanLambda());
811  if (m_Omega != nullptr) m_Omega->Fill(tfr->getOmega());
812 
813  if (m_HitsPXD != nullptr) m_HitsPXD->Fill(nPXD);
814  if (m_HitsSVD != nullptr) m_HitsSVD->Fill(nSVD);
815  if (m_HitsCDC != nullptr) m_HitsCDC->Fill(nCDC);
816  if (m_Hits != nullptr) m_Hits->Fill(nPXD + nSVD + nCDC);
817  }
818  if (m_TracksVXD != nullptr) m_TracksVXD->Fill(iTrackVXD);
819  if (m_TracksCDC != nullptr) m_TracksCDC->Fill(iTrackCDC);
820  if (m_TracksVXDCDC != nullptr) m_TracksVXDCDC->Fill(iTrackVXDCDC);
821  if (m_Tracks != nullptr) m_Tracks->Fill(iTrack);
822  } catch (...) {
823  B2DEBUG(20, "Some problem in Track DQM module!");
824  }
825 
826 
827  // eventLevelTrackingInfo is currently only set by VXDTF2, if VXDTF2 is not in path the StoreObject is not there. If the Object is not there
828  // the option "no error" seen is filled to not scare any shifters.
829  if (m_eventLevelTrackingInfo.isValid()) m_trackingErrorFlags->Fill((double)m_eventLevelTrackingInfo->hasAnErrorFlag());
830  else m_trackingErrorFlags->Fill(0.0);
831 }
832 
833 bool TrackDQMModule::IsNotYang(int ladderNumber, int layerNumber)
834 {
835  switch (layerNumber) {
836  case 1:
837  return ladderNumber < 5 || ladderNumber > 8;
838  case 2:
839  return ladderNumber < 7 || ladderNumber > 12;
840  default:
841  return true;
842  }
843 }
844 
845 bool TrackDQMModule::IsNotMat(int ladderNumber, int layerNumber)
846 {
847  switch (layerNumber) {
848  case 3:
849  return ladderNumber < 3 || ladderNumber > 5;
850  case 4:
851  return ladderNumber < 4 || ladderNumber > 8;
852  case 5:
853  return ladderNumber < 5 || ladderNumber > 10;
854  case 6:
855  return ladderNumber < 6 || ladderNumber > 13;
856  default:
857  return true;
858  }
859 }
Belle2::RelationVector::size
size_t size() const
Get number of relations.
Definition: RelationVector.h:98
Belle2::VxdID
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:43
Belle2::TrackDQMModule::initialize
void initialize() override final
Module functions.
Definition: TrackDQMModule.cc:61
Belle2::TrackDQMModule::IsNotYang
bool IsNotYang(int ladderNumber, int layerNumber)
Returns true if sensor with given ladderNumber and layerNumber isn't in the Yang half-shell,...
Definition: TrackDQMModule.cc:833
Belle2::TrackFitResult::getMomentum
TVector3 getMomentum() const
Getter for vector of momentum at closest approach of track in r/phi projection.
Definition: TrackFitResult.h:116
Belle2::VXD::GeoCache::get
static const SensorInfoBase & get(Belle2::VxdID id)
Return a reference to the SensorInfo of a given SensorID.
Definition: GeoCache.h:141
REG_MODULE
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:652
Belle2::TrackFitResult::getOmega
double getOmega() const
Getter for omega.
Definition: TrackFitResult.h:194
Belle2::PXDCluster::getU
float getU() const
Get u coordinate of hit position.
Definition: PXDCluster.h:136
Belle2::VxdID::getLadderNumber
baseType getLadderNumber() const
Get the ladder id.
Definition: VxdID.h:108
Belle2::TrackDQMModule::defineHisto
void defineHisto() override final
Histogram definitions such as TH1(), TH2(), TNtuple(), TTree()....
Definition: TrackDQMModule.cc:82
Belle2::TrackFitResult::getTanLambda
double getTanLambda() const
Getter for tanLambda.
Definition: TrackFitResult.h:206
Belle2::SVD::SensorInfo
Specific implementation of SensorInfo for SVD Sensors which provides additional sensor specific infor...
Definition: SensorInfo.h:35
Belle2::VXD::GeoCache::getLayers
const std::set< Belle2::VxdID > getLayers(SensorInfoBase::SensorType sensortype=SensorInfoBase::VXD)
Return a set of all known Layers.
Definition: GeoCache.cc:177
Belle2::TrackFitResult
Values of the result of a track fit with a given particle hypothesis.
Definition: TrackFitResult.h:59
Belle2::TrackFitResult::getZ0
double getZ0() const
Getter for z0.
Definition: TrackFitResult.h:200
Belle2::RecoTrack
This is the Reconstruction Event-Data Model Track.
Definition: RecoTrack.h:78
Belle2::Const::pion
static const ChargedStable pion
charged pion particle
Definition: Const.h:535
Belle2::PXD::SensorInfo
Specific implementation of SensorInfo for PXD Sensors which provides additional pixel specific inform...
Definition: SensorInfo.h:34
Belle2::RelationVector
Class for type safe access to objects that are referred to in relations.
Definition: DataStore.h:38
Belle2::VXD::GeoCache::getInstance
static GeoCache & getInstance()
Return a reference to the singleton instance.
Definition: GeoCache.cc:215
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::VXD::GeoCache::getGeoTools
const GeoTools * getGeoTools()
Return a raw pointer to a GeoTools object.
Definition: GeoCache.h:149
Belle2::TrackFitResult::getPhi0
double getPhi0() const
Getter for phi0.
Definition: TrackFitResult.h:184
Belle2::PXDCluster
The PXD Cluster class This class stores all information about reconstructed PXD clusters The position...
Definition: PXDCluster.h:41
Belle2::Unit::convertValueToUnit
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:146
Belle2::SVDCluster::getPosition
float getPosition(double v=0) const
Get the coordinate of reconstructed hit.
Definition: SVDCluster.h:125
Belle2::TrackDQMModule::IsNotMat
bool IsNotMat(int ladderNumber, int layerNumber)
Returns true if sensor with given ladderNumber and layerNumber isn't in the Mat half-shell,...
Definition: TrackDQMModule.cc:845
Belle2::TrackDQMModule::event
void event() override final
Function to process event record.
Definition: TrackDQMModule.cc:590
Belle2::SVDCluster
The SVD Cluster class This class stores all information about reconstructed SVD clusters.
Definition: SVDCluster.h:38
Belle2::VXD::GeoCache
Class to faciliate easy access to sensor information of the VXD like coordinate transformations or pi...
Definition: GeoCache.h:41
Belle2::TrackDQMModule::beginRun
void beginRun() override final
Function to process begin_run record.
Definition: TrackDQMModule.cc:502
Belle2::Track
Class that bundles various TrackFitResults.
Definition: Track.h:35
Belle2::StoreArray
Accessor to arrays stored in the data store.
Definition: ECLMatchingPerformanceExpertModule.h:33
Belle2::VxdID::getLayerNumber
baseType getLayerNumber() const
Get the layer id.
Definition: VxdID.h:106
Belle2::PXDCluster::getV
float getV() const
Get v coordinate of hit position.
Definition: PXDCluster.h:141
Belle2::StoreArray::getEntries
int getEntries() const
Get the number of objects in the array.
Definition: StoreArray.h:226
Belle2::HistoModule
HistoModule.h is supposed to be used instead of Module.h for the modules with histogram definitions t...
Definition: HistoModule.h:29
Belle2::TrackFitResult::getPhi
double getPhi() const
Getter for phi0 with CDF naming convention.
Definition: TrackFitResult.h:187
Belle2::TrackFitResult::getD0
double getD0() const
Getter for d0.
Definition: TrackFitResult.h:178
Belle2::TrackDQMModule
DQM of tracks their momentum, Number of hits in tracks, Number of tracks.
Definition: TrackDQMModule.h:49