Belle II Software  release-05-02-19
AlignDQMModule.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 Alignment DQM *
9  * *
10  * This software is provided "as is" without any warranty. *
11  **************************************************************************/
12 
13 #include <alignment/modules/AlignmentDQM/AlignDQMModule.h>
14 
15 #include <framework/datastore/StoreArray.h>
16 #include <framework/geometry/B2Vector3.h>
17 #include <mdst/dataobjects/Track.h>
18 #include <pxd/geometry/SensorInfo.h>
19 #include <svd/geometry/SensorInfo.h>
20 #include <tracking/dataobjects/RecoTrack.h>
21 #include <tracking/dataobjects/RecoHitInformation.h>
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(AlignDQM)
35 
36 
37 //-----------------------------------------------------------------
38 // Implementation
39 //-----------------------------------------------------------------
40 
42 {
43  //Set module properties
44  setDescription("DQM of Alignment for off line "
45  "residuals per sensor, layer, "
46  "keep also On-Line DQM from tracking: "
47  "their momentum, "
48  "Number of hits in tracks, "
49  "Number of tracks. "
50  );
51 
52  addParam("TracksStoreArrayName", m_param_TracksStoreArrayName,
53  "StoreArray name where the merged Tracks are written.",
54  m_param_TracksStoreArrayName);
55 
56  addParam("RecoTracksStoreArrayName", m_param_RecoTracksStoreArrayName,
57  "StoreArray name where the merged RecoTracks are written.",
58  m_param_RecoTracksStoreArrayName);
59 
60  setPropertyFlags(c_ParallelProcessingCertified);
61 
62 }
63 
64 
65 AlignDQMModule::~AlignDQMModule()
66 {
67 }
68 
69 //------------------------------------------------------------------
70 // Function to define histograms
71 //-----------------------------------------------------------------
72 
74 {
75  StoreArray<RecoTrack> recoTracks(m_param_RecoTracksStoreArrayName);
76  recoTracks.isOptional();
77 
78  StoreArray<Track> tracks(m_param_TracksStoreArrayName);
79  tracks.isOptional();
80 
81  // Register histograms (calls back defineHisto)
82  REG_HISTOGRAM
83 
84 }
85 
87 {
88  auto gTools = VXD::GeoCache::getInstance().getGeoTools();
89  if (gTools->getNumberOfLayers() == 0) {
90  B2WARNING("Missing geometry for VXD.");
91  }
92 
93  // basic constants presets:
94  int nVXDLayers = gTools->getNumberOfLayers();
95  int nVXDSensors = gTools->getNumberOfSensors();
96  float ResidualRange = 400; // in um
98 
99  // Create a separate histogram directories and cd into it.
100  TDirectory* oldDir = gDirectory;
101  TDirectory* DirAlign = oldDir->mkdir("AlignmentDQM");
102  TDirectory* DirAlignSensors = oldDir->mkdir("AlignmentDQMSensors");
103  TDirectory* DirAlignSensResids = DirAlignSensors->mkdir("Residuals2D");
104  TDirectory* DirAlignSensResids1D = DirAlignSensors->mkdir("Residuals1D");
105 
106  TDirectory* DirAlignSensResMeanUPosUV = DirAlignSensors->mkdir("ResidMeanUPositUV");
107  TDirectory* DirAlignSensResMeanVPosUV = DirAlignSensors->mkdir("ResidMeanVPositUV");
108  TDirectory* DirAlignSensResMeanUPosU = DirAlignSensors->mkdir("ResidMeanUPositU");
109  TDirectory* DirAlignSensResMeanVPosU = DirAlignSensors->mkdir("ResidMeanVPositU");
110  TDirectory* DirAlignSensResMeanUPosV = DirAlignSensors->mkdir("ResidMeanUPositV");
111  TDirectory* DirAlignSensResMeanVPosV = DirAlignSensors->mkdir("ResidMeanVPositV");
112  TDirectory* DirAlignSensResUPosU = DirAlignSensors->mkdir("ResidUPositU");
113  TDirectory* DirAlignSensResVPosU = DirAlignSensors->mkdir("ResidVPositU");
114  TDirectory* DirAlignSensResUPosV = DirAlignSensors->mkdir("ResidUPositV");
115  TDirectory* DirAlignSensResVPosV = DirAlignSensors->mkdir("ResidVPositV");
116 
117  TDirectory* DirAlignLayers = oldDir->mkdir("AlignmentDQMLayers");
118 
119  TDirectory* DirAlignLayerResMeanUPosUV = DirAlignLayers->mkdir("ResidLayerMeanUPositPhiTheta");
120  TDirectory* DirAlignLayerResMeanVPosUV = DirAlignLayers->mkdir("ResidLayerMeanVPositPhiTheta");
121  TDirectory* DirAlignLayerResMeanUPosU = DirAlignLayers->mkdir("ResidLayerMeanUPositPhi");
122  TDirectory* DirAlignLayerResMeanVPosU = DirAlignLayers->mkdir("ResidLayerMeanVPositPhi");
123  TDirectory* DirAlignLayerResMeanUPosV = DirAlignLayers->mkdir("ResidLayerMeanUPositTheta");
124  TDirectory* DirAlignLayerResMeanVPosV = DirAlignLayers->mkdir("ResidLayerMeanVPositTheta");
125  TDirectory* DirAlignLayerResUPosU = DirAlignLayers->mkdir("ResidLayerUPositPhi");
126  TDirectory* DirAlignLayerResVPosU = DirAlignLayers->mkdir("ResidLayerVPositPhi");
127  TDirectory* DirAlignLayerResUPosV = DirAlignLayers->mkdir("ResidLayerUPositTheta");
128  TDirectory* DirAlignLayerResVPosV = DirAlignLayers->mkdir("ResidLayerVPositTheta");
129 
131  TDirectory* DirAlignHelixParameters = DirAlign->mkdir("HelixPars");
132  TDirectory* DirAlignHelixCorrelations = DirAlign->mkdir("HelixCorrelations");
133 
134  // half-shells
135  TDirectory* DirAlignHalfShells = DirAlign->mkdir("HalfShells");
136 
137  float fMomRange = 3.0;
138  int iMomRange = 60;
139  float fZ0Range = 10.0; // Half range in cm
140  float fD0Range = 1.0; // Half range in cm
141  int iPhiRange = 180;
142  float fPhiRange = 180.0; // Half range in deg
143 
144  DirAlignHelixParameters->cd();
145 
146  string name = str(format("Alig_Z0"));
147  string title = str(format("z0 - the z coordinate of the perigee (beam spot position)"));
148  m_Z0 = new TH1F(name.c_str(), title.c_str(), 100, -fZ0Range, fZ0Range);
149  m_Z0->GetXaxis()->SetTitle("z0 [cm]");
150  m_Z0->GetYaxis()->SetTitle("Arb. Units");
151  name = str(format("Alig_D0"));
152  title = str(format("d0 - the signed distance to the IP in the r-phi plane"));
153  m_D0 = new TH1F(name.c_str(), title.c_str(), 100, -fD0Range, fD0Range);
154  m_D0->GetXaxis()->SetTitle("d0 [cm]");
155  m_D0->GetYaxis()->SetTitle("Arb. Units");
156  name = str(format("Alig_Phi"));
157  title = str(format("Phi - angle of the transverse momentum in the r-phi plane, with CDF naming convention"));
158  m_Phi = new TH1F(name.c_str(), title.c_str(), iPhiRange, -fPhiRange, fPhiRange);
159  m_Phi->GetXaxis()->SetTitle("#phi [deg]");
160  m_Phi->GetYaxis()->SetTitle("Arb. Units");
161  name = str(format("Alig_Omega"));
162  title = str(format("Omega - the curvature of the track. It's sign is defined by the charge of the particle"));
163  m_Omega = new TH1F(name.c_str(), title.c_str(), 100, -0.1, 0.1);
164  m_Omega->GetXaxis()->SetTitle("Omega");
165  m_Omega->GetYaxis()->SetTitle("Arb. Units");
166  name = str(format("Alig_TanLambda"));
167  title = str(format("TanLambda - the slope of the track in the r-z plane"));
168  m_TanLambda = new TH1F(name.c_str(), title.c_str(), 100, -4.0, 4.0);
169  m_TanLambda->GetXaxis()->SetTitle("Tan Lambda");
170  m_TanLambda->GetYaxis()->SetTitle("Arb. Units");
171 
172  DirAlignHelixCorrelations->cd();
173 
174  name = str(format("Alig_PhiD0"));
175  title = str(
176  format("Phi - angle of the transverse momentum in the r-phi plane vs. d0 - signed distance to the IP in r-phi "));
177  m_PhiD0 = new TH2F(name.c_str(), title.c_str(), iPhiRange, -fPhiRange, fPhiRange, 100, -fD0Range, fD0Range);
178  m_PhiD0->GetXaxis()->SetTitle("#phi [deg]");
179  m_PhiD0->GetYaxis()->SetTitle("d0 [cm]");
180  m_PhiD0->GetZaxis()->SetTitle("Arb. Units");
181  name = str(format("Alig_PhiZ0"));
182  title = str(
183  format("Phi - angle of the transverse momentum in the r-phi plane vs. "
184  "z0 of the perigee (to see primary vertex shifts along R or z)"));
185  m_PhiZ0 = new TH2F(name.c_str(), title.c_str(), iPhiRange, -fPhiRange, fPhiRange, 100, -fZ0Range, fZ0Range);
186  m_PhiZ0->GetXaxis()->SetTitle("#phi [deg]");
187  m_PhiZ0->GetYaxis()->SetTitle("z0 [cm]");
188  m_PhiZ0->GetZaxis()->SetTitle("Arb. Units");
189  name = str(format("Alig_PhiMomPt"));
190  title = str(
191  format("Phi - angle of the transverse momentum in the r-phi plane vs. Track momentum Pt"));
192  m_PhiMomPt = new TH2F(name.c_str(), title.c_str(), iPhiRange, -fPhiRange, fPhiRange, 2 * iMomRange, 0.0, fMomRange);
193  m_PhiMomPt->GetXaxis()->SetTitle("#phi [deg]");
194  m_PhiMomPt->GetYaxis()->SetTitle("Momentum");
195  m_PhiMomPt->GetZaxis()->SetTitle("Arb. Units");
196  name = str(format("Alig_PhiOmega"));
197  title = str(
198  format("Phi - angle of the transverse momentum in the r-phi plane vs. Omega - the curvature of the track"));
199  m_PhiOmega = new TH2F(name.c_str(), title.c_str(), iPhiRange, -fPhiRange, fPhiRange, 100, -0.1, 0.1);
200  m_PhiOmega->GetXaxis()->SetTitle("#phi [deg]");
201  m_PhiOmega->GetYaxis()->SetTitle("Omega");
202  m_PhiOmega->GetZaxis()->SetTitle("Arb. Units");
203  name = str(format("Alig_PhiTanLambda"));
204  title = str(
205  format("dPhi - angle of the transverse momentum in the r-phi plane vs. "
206  "TanLambda - the slope of the track in the r-z plane"));
207  m_PhiTanLambda = new TH2F(name.c_str(), title.c_str(), iPhiRange, -fPhiRange, fPhiRange, 100, -4.0, 4.0);
208  m_PhiTanLambda->GetXaxis()->SetTitle("#phi [deg]");
209  m_PhiTanLambda->GetYaxis()->SetTitle("Tan Lambda");
210  m_PhiTanLambda->GetZaxis()->SetTitle("Arb. Units");
211  name = str(format("Alig_D0Z0"));
212  title = str(
213  format("d0 - signed distance to the IP in r-phi vs. z0 of the perigee (to see primary vertex shifts along R or z)"));
214  m_D0Z0 = new TH2F(name.c_str(), title.c_str(), 100, -fD0Range, fD0Range, 100, -fZ0Range, fZ0Range);
215  m_D0Z0->GetXaxis()->SetTitle("d0 [cm]");
216  m_D0Z0->GetYaxis()->SetTitle("z0 [cm]");
217  m_D0Z0->GetZaxis()->SetTitle("Arb. Units");
218  name = str(format("Alig_D0MomPt"));
219  title = str(
220  format("d0 - signed distance to the IP in r-phi vs. Track momentum Pt"));
221  m_D0MomPt = new TH2F(name.c_str(), title.c_str(), 100, -fD0Range, fD0Range, 2 * iMomRange, 0.0, fMomRange);
222  m_D0MomPt->GetXaxis()->SetTitle("d0 [cm]");
223  m_D0MomPt->GetYaxis()->SetTitle("Momentum");
224  m_D0MomPt->GetZaxis()->SetTitle("Arb. Units");
225  name = str(format("Alig_D0Omega"));
226  title = str(
227  format("d0 - signed distance to the IP in r-phi vs. Omega - the curvature of the track"));
228  m_D0Omega = new TH2F(name.c_str(), title.c_str(), 100, -fD0Range, fD0Range, 100, -0.1, 0.1);
229  m_D0Omega->GetXaxis()->SetTitle("d0 [cm]");
230  m_D0Omega->GetYaxis()->SetTitle("Omega");
231  m_D0Omega->GetZaxis()->SetTitle("Arb. Units");
232  name = str(format("Alig_D0TanLambda"));
233  title = str(
234  format("d0 - signed distance to the IP in r-phi vs. TanLambda - the slope of the track in the r-z plane"));
235  m_D0TanLambda = new TH2F(name.c_str(), title.c_str(), 100, -fD0Range, fD0Range, 100, -4.0, 4.0);
236  m_D0TanLambda->GetXaxis()->SetTitle("d0 [cm]");
237  m_D0TanLambda->GetYaxis()->SetTitle("Tan Lambda");
238  m_D0TanLambda->GetZaxis()->SetTitle("Arb. Units");
239  name = str(format("Alig_Z0MomPt"));
240  title = str(
241  format("z0 - the z0 coordinate of the perigee vs. Track momentum Pt"));
242  m_Z0MomPt = new TH2F(name.c_str(), title.c_str(), 100, -fZ0Range, fZ0Range, 2 * iMomRange, 0.0, fMomRange);
243  m_Z0MomPt->GetXaxis()->SetTitle("z0 [cm]");
244  m_Z0MomPt->GetYaxis()->SetTitle("Momentum");
245  m_Z0MomPt->GetZaxis()->SetTitle("Arb. Units");
246  name = str(format("Alig_Z0Omega"));
247  title = str(
248  format("z0 - the z0 coordinate of the perigee vs. Omega - the curvature of the track"));
249  m_Z0Omega = new TH2F(name.c_str(), title.c_str(), 100, -fZ0Range, fZ0Range, 100, -0.1, 0.1);
250  m_Z0Omega->GetXaxis()->SetTitle("z0 [cm]");
251  m_Z0Omega->GetYaxis()->SetTitle("Omega");
252  m_Z0Omega->GetZaxis()->SetTitle("Arb. Units");
253  name = str(format("Alig_Z0TanLambda"));
254  title = str(
255  format("z0 - the z0 coordinate of the perigee vs. TanLambda - the slope of the track in the r-z plane"));
256  m_Z0TanLambda = new TH2F(name.c_str(), title.c_str(), 100, -fZ0Range, fZ0Range, 100, -4.0, 4.0);
257  m_Z0TanLambda->GetXaxis()->SetTitle("z0 [cm]");
258  m_Z0TanLambda->GetYaxis()->SetTitle("Tan Lambda");
259  m_Z0TanLambda->GetZaxis()->SetTitle("Arb. Units");
260  name = str(format("Alig_MomPtOmega"));
261  title = str(
262  format("Track momentum Pt vs. Omega - the curvature of the track"));
263  m_MomPtOmega = new TH2F(name.c_str(), title.c_str(), 2 * iMomRange, 0.0, fMomRange, 100, -0.1, 0.1);
264  m_MomPtOmega->GetXaxis()->SetTitle("Momentum");
265  m_MomPtOmega->GetYaxis()->SetTitle("Omega");
266  m_MomPtOmega->GetZaxis()->SetTitle("Arb. Units");
267  name = str(format("Alig_MomPtTanLambda"));
268  title = str(
269  format("Track momentum Pt vs. TanLambda - the slope of the track in the r-z plane"));
270  m_MomPtTanLambda = new TH2F(name.c_str(), title.c_str(), 2 * iMomRange, 0.0, fMomRange, 100, -4.0, 4.0);
271  m_MomPtTanLambda->GetXaxis()->SetTitle("Momentum");
272  m_MomPtTanLambda->GetYaxis()->SetTitle("Tan Lambda");
273  m_MomPtTanLambda->GetZaxis()->SetTitle("Arb. Units");
274  name = str(format("Alig_OmegaTanLambda"));
275  title = str(
276  format("Omega - the curvature of the track vs. TanLambda - the slope of the track in the r-z plane"));
277  m_OmegaTanLambda = new TH2F(name.c_str(), title.c_str(), 100, -0.1, 0.1, 100, -4.0, 4.0);
278  m_OmegaTanLambda->GetXaxis()->SetTitle("Omega");
279  m_OmegaTanLambda->GetYaxis()->SetTitle("Tan Lambda");
280  m_OmegaTanLambda->GetZaxis()->SetTitle("Arb. Units");
281 
282  iMomRange = 600;
283 
284  DirAlign->cd();
285  // Momentum Phi
286  name = str(format("Alig_MomPhi"));
287  title = str(format("Momentum Phi of fit"));
288  m_MomPhi = new TH1F(name.c_str(), title.c_str(), 180, -180, 180);
289  m_MomPhi->GetXaxis()->SetTitle("Mom Phi [deg]");
290  m_MomPhi->GetYaxis()->SetTitle("counts");
291  // Momentum Theta
292  name = str(format("Alig_MomTheta"));
293  title = str(format("Momentum Theta of fit"));
294  m_MomTheta = new TH1F(name.c_str(), title.c_str(), 90, 0, 180);
295  m_MomTheta->GetXaxis()->SetTitle("Mom Theta [deg]");
296  m_MomTheta->GetYaxis()->SetTitle("counts");
297  // Momentum CosTheta
298  name = str(format("Alig_MomCosTheta"));
299  title = str(format("Cos of Momentum Theta of fit"));
300  m_MomCosTheta = new TH1F(name.c_str(), title.c_str(), 100, -1, 1);
301  m_MomCosTheta->GetXaxis()->SetTitle("Mom CosTheta");
302  m_MomCosTheta->GetYaxis()->SetTitle("counts");
303 
305  name = str(format("Alig_PValue"));
306  title = str(format("P value of fit"));
307  m_PValue = new TH1F(name.c_str(), title.c_str(), 100, 0, 1);
308  m_PValue->GetXaxis()->SetTitle("p value");
309  m_PValue->GetYaxis()->SetTitle("counts");
311  name = str(format("Alig_Chi2"));
312  title = str(format("Chi2 of fit"));
313  m_Chi2 = new TH1F(name.c_str(), title.c_str(), 200, 0, 150);
314  m_Chi2->GetXaxis()->SetTitle("Chi2");
315  m_Chi2->GetYaxis()->SetTitle("counts");
317  name = str(format("Alig_NDF"));
318  title = str(format("NDF of fit"));
319  m_NDF = new TH1F(name.c_str(), title.c_str(), 200, 0, 200);
320  m_NDF->GetXaxis()->SetTitle("NDF");
321  m_NDF->GetYaxis()->SetTitle("counts");
323  name = str(format("Alig_Chi2NDF"));
324  title = str(format("Chi2 div NDF of fit"));
325  m_Chi2NDF = new TH1F(name.c_str(), title.c_str(), 200, 0, 10);
326  m_Chi2NDF->GetXaxis()->SetTitle("Chi2NDF");
327  m_Chi2NDF->GetYaxis()->SetTitle("counts");
328 
330  name = str(format("Alig_UBResidualsPXD"));
331  title = str(format("Unbiased residuals for PXD"));
332  m_UBResidualsPXD = new TH2F(name.c_str(), title.c_str(), 200, -ResidualRange, ResidualRange, 200, -ResidualRange, ResidualRange);
333  m_UBResidualsPXD->GetXaxis()->SetTitle("u residual [#mum]");
334  m_UBResidualsPXD->GetYaxis()->SetTitle("v residual [#mum]");
335  m_UBResidualsPXD->GetZaxis()->SetTitle("counts");
337  name = str(format("Alig_UBResidualsSVD"));
338  title = str(format("Unbiased residuals for SVD"));
339  m_UBResidualsSVD = new TH2F(name.c_str(), title.c_str(), 200, -ResidualRange, ResidualRange, 200, -ResidualRange, ResidualRange);
340  m_UBResidualsSVD->GetXaxis()->SetTitle("u residual [#mum]");
341  m_UBResidualsSVD->GetYaxis()->SetTitle("v residual [#mum]");
342  m_UBResidualsSVD->GetZaxis()->SetTitle("counts");
344  name = str(format("Alig_UBResidualsPXDU"));
345  title = str(format("Unbiased residuals in U for PXD"));
346  m_UBResidualsPXDU = new TH1F(name.c_str(), title.c_str(), 200, -ResidualRange, ResidualRange);
347  m_UBResidualsPXDU->GetXaxis()->SetTitle("residual [#mum]");
348  m_UBResidualsPXDU->GetYaxis()->SetTitle("counts");
349  name = str(format("Alig_UBResidualsPXDV"));
350  title = str(format("Unbiased residuals in V for PXD"));
351  m_UBResidualsPXDV = new TH1F(name.c_str(), title.c_str(), 200, -ResidualRange, ResidualRange);
352  m_UBResidualsPXDV->GetXaxis()->SetTitle("residual [#mum]");
353  m_UBResidualsPXDV->GetYaxis()->SetTitle("counts");
355  name = str(format("Alig_UBResidualsSVDU"));
356  title = str(format("Unbiased residuals in U for SVD"));
357  m_UBResidualsSVDU = new TH1F(name.c_str(), title.c_str(), 200, -ResidualRange, ResidualRange);
358  m_UBResidualsSVDU->GetXaxis()->SetTitle("residual [#mum]");
359  m_UBResidualsSVDU->GetYaxis()->SetTitle("counts");
360  name = str(format("Alig_UBResidualsSVDV"));
361  title = str(format("Unbiased residuals in V for SVD"));
362  m_UBResidualsSVDV = new TH1F(name.c_str(), title.c_str(), 200, -ResidualRange, ResidualRange);
363  m_UBResidualsSVDV->GetXaxis()->SetTitle("residual [#mum]");
364  m_UBResidualsSVDV->GetYaxis()->SetTitle("counts");
365 
366  // half-shells
367  DirAlignHalfShells->cd();
368  // X
369  // Unbiased residuals in X for PXD for Ying
370  name = "Alig_UBResidualsPXDX_Ying";
371  title = "Unbiased residuals in X for PXD for Ying";
372  m_UBResidualsPXDX_Ying = new TH1F(name.c_str(), title.c_str(), 200, -ResidualRange, ResidualRange);
373  m_UBResidualsPXDX_Ying->GetXaxis()->SetTitle("residual [#mum]");
374  m_UBResidualsPXDX_Ying->GetYaxis()->SetTitle("counts");
375 
376  // Unbiased residuals in X for PXD for Yang
377  name = "Alig_UBResidualsPXDX_Yang";
378  title = "Unbiased residuals in X for PXD for Yang";
379  m_UBResidualsPXDX_Yang = new TH1F(name.c_str(), title.c_str(), 200, -ResidualRange, ResidualRange);
380  m_UBResidualsPXDX_Yang->GetXaxis()->SetTitle("residual [#mum]");
381  m_UBResidualsPXDX_Yang->GetYaxis()->SetTitle("counts");
382 
383  // Unbiased residuals in X for SVD for Pat
384  name = "Alig_UBResidualsSVDX_Pat";
385  title = "Unbiased residuals in X for SVD for Pat";
386  m_UBResidualsSVDX_Pat = new TH1F(name.c_str(), title.c_str(), 200, -ResidualRange, ResidualRange);
387  m_UBResidualsSVDX_Pat->GetXaxis()->SetTitle("residual [#mum]");
388  m_UBResidualsSVDX_Pat->GetYaxis()->SetTitle("counts");
389 
390  // Unbiased residuals in X for SVD for Mat
391  name = "Alig_UBResidualsSVDX_Mat";
392  title = "Unbiased residuals in X for SVD for Mat";
393  m_UBResidualsSVDX_Mat = new TH1F(name.c_str(), title.c_str(), 200, -ResidualRange, ResidualRange);
394  m_UBResidualsSVDX_Mat->GetXaxis()->SetTitle("residual [#mum]");
395  m_UBResidualsSVDX_Mat->GetYaxis()->SetTitle("counts");
396 
397  // Y
398  // Unbiased residuals in Y for PXD for Ying
399  name = "Alig_UBResidualsPXDY_Ying";
400  title = "Unbiased residuals in Y for PXD for Ying";
401  m_UBResidualsPXDY_Ying = new TH1F(name.c_str(), title.c_str(), 200, -ResidualRange, ResidualRange);
402  m_UBResidualsPXDY_Ying->GetXaxis()->SetTitle("residual [#mum]");
403  m_UBResidualsPXDY_Ying->GetYaxis()->SetTitle("counts");
404 
405  // Unbiased residuals in Y for PXD for Yang
406  name = "Alig_UBResidualsPXDY_Yang";
407  title = "Unbiased residuals in Y for PXD for Yang";
408  m_UBResidualsPXDY_Yang = new TH1F(name.c_str(), title.c_str(), 200, -ResidualRange, ResidualRange);
409  m_UBResidualsPXDY_Yang->GetXaxis()->SetTitle("residual [#mum]");
410  m_UBResidualsPXDY_Yang->GetYaxis()->SetTitle("counts");
411 
412  // Unbiased residuals in Y for SVD for Pat
413  name = "Alig_UBResidualsSVDY_Pat";
414  title = "Unbiased residuals in Y for SVD for Pat";
415  m_UBResidualsSVDY_Pat = new TH1F(name.c_str(), title.c_str(), 200, -ResidualRange, ResidualRange);
416  m_UBResidualsSVDY_Pat->GetXaxis()->SetTitle("residual [#mum]");
417  m_UBResidualsSVDY_Pat->GetYaxis()->SetTitle("counts");
418 
419  // Unbiased residuals in Y for SVD for Mat
420  name = "Alig_UBResidualsSVDY_Mat";
421  title = "Unbiased residuals in Y for SVD for Mat";
422  m_UBResidualsSVDY_Mat = new TH1F(name.c_str(), title.c_str(), 200, -ResidualRange, ResidualRange);
423  m_UBResidualsSVDY_Mat->GetXaxis()->SetTitle("residual [#mum]");
424  m_UBResidualsSVDY_Mat->GetYaxis()->SetTitle("counts");
425 
426  // Z
427  // Unbiased residuals in Z for PXD for Ying
428  name = "Alig_UBResidualsPXDZ_Ying";
429  title = "Unbiased residuals in Z for PXD for Ying";
430  m_UBResidualsPXDZ_Ying = new TH1F(name.c_str(), title.c_str(), 200, -ResidualRange, ResidualRange);
431  m_UBResidualsPXDZ_Ying->GetXaxis()->SetTitle("residual [#mum]");
432  m_UBResidualsPXDZ_Ying->GetYaxis()->SetTitle("counts");
433 
434  // Unbiased residuals in Z for PXD for Yang
435  name = "Alig_UBResidualsPXDZ_Yang";
436  title = "Unbiased residuals in Z for PXD for Yang";
437  m_UBResidualsPXDZ_Yang = new TH1F(name.c_str(), title.c_str(), 200, -ResidualRange, ResidualRange);
438  m_UBResidualsPXDZ_Yang->GetXaxis()->SetTitle("residual [#mum]");
439  m_UBResidualsPXDZ_Yang->GetYaxis()->SetTitle("counts");
440 
441  // Unbiased residuals in Z for SVD for Pat
442  name = "Alig_UBResidualsSVDZ_Pat";
443  title = "Unbiased residuals in Z for SVD for Pat";
444  m_UBResidualsSVDZ_Pat = new TH1F(name.c_str(), title.c_str(), 200, -ResidualRange, ResidualRange);
445  m_UBResidualsSVDZ_Pat->GetXaxis()->SetTitle("residual [#mum]");
446  m_UBResidualsSVDZ_Pat->GetYaxis()->SetTitle("counts");
447 
448  // Unbiased residuals in Z for SVD for Mat
449  name = "Alig_UBResidualsSVDZ_Mat";
450  title = "Unbiased residuals in Z for SVD for Mat";
451  m_UBResidualsSVDZ_Mat = new TH1F(name.c_str(), title.c_str(), 200, -ResidualRange, ResidualRange);
452  m_UBResidualsSVDZ_Mat->GetXaxis()->SetTitle("residual [#mum]");
453  m_UBResidualsSVDZ_Mat->GetYaxis()->SetTitle("counts");
454 
455  DirAlign->cd();
456 
457  if (gTools->getNumberOfLayers() == 0) {
458  B2WARNING("Missing geometry for VXD, VXD-DQM related are skiped.");
459  return;
460  }
461 
462  m_TRClusterHitmap = (TH2F**) new TH2F*[nVXDLayers];
463  m_TRClusterCorrelationsPhi = (TH2F**) new TH2F*[nVXDLayers - 1];
464  m_TRClusterCorrelationsTheta = (TH2F**) new TH2F*[nVXDLayers - 1];
465  m_UBResidualsSensor = (TH2F**) new TH2F*[nVXDSensors];
466  m_UBResidualsSensorU = (TH1F**) new TH2F*[nVXDSensors];
467  m_UBResidualsSensorV = (TH1F**) new TH2F*[nVXDSensors];
468 
469  for (VxdID layer : geo.getLayers()) {
470  int i = layer.getLayerNumber();
471  int index = gTools->getLayerIndex(layer.getLayerNumber());
473  name = str(format("Alig_TRClusterHitmapLayer%1%") % i);
474  title = str(format("Cluster Hitmap for layer %1%") % i);
475  m_TRClusterHitmap[index] = new TH2F(name.c_str(), title.c_str(), 360, -180.0, 180.0, 180, 0.0, 180.0);
476  m_TRClusterHitmap[index]->GetXaxis()->SetTitle("Phi angle [deg]");
477  m_TRClusterHitmap[index]->GetYaxis()->SetTitle("Theta angle [deg]");
478  m_TRClusterHitmap[index]->GetZaxis()->SetTitle("counts");
479  }
480  for (VxdID layer : geo.getLayers()) {
481  int i = layer.getLayerNumber();
482  if (i == gTools->getLastLayer()) continue;
483  int index = gTools->getLayerIndex(layer.getLayerNumber());
485  name = str(format("Alig_CorrelationsPhiLayers_%1%_%2%") % i % (i + 1));
486  title = str(format("Correlations in Phi for Layers %1% %2%") % i % (i + 1));
487  m_TRClusterCorrelationsPhi[index] = new TH2F(name.c_str(), title.c_str(), 360, -180.0, 180.0, 360, -180.0, 180.0);
488  title = str(format("angle layer %1% [deg]") % i);
489  m_TRClusterCorrelationsPhi[index]->GetXaxis()->SetTitle(title.c_str());
490  title = str(format("angle layer %1% [deg]") % (i + 1));
491  m_TRClusterCorrelationsPhi[index]->GetYaxis()->SetTitle(title.c_str());
492  m_TRClusterCorrelationsPhi[index]->GetZaxis()->SetTitle("counts");
494  name = str(format("Alig_CorrelationsThetaLayers_%1%_%2%") % i % (i + 1));
495  title = str(format("Correlations in Theta for Layers %1% %2%") % i % (i + 1));
496  m_TRClusterCorrelationsTheta[index] = new TH2F(name.c_str(), title.c_str(), 180, 0.0, 180.0, 180, 0.0, 180.0);
497  title = str(format("angle layer %1% [deg]") % i);
498  m_TRClusterCorrelationsTheta[index]->GetXaxis()->SetTitle(title.c_str());
499  title = str(format("angle layer %1% [deg]") % (i + 1));
500  m_TRClusterCorrelationsTheta[index]->GetYaxis()->SetTitle(title.c_str());
501  m_TRClusterCorrelationsTheta[index]->GetZaxis()->SetTitle("counts");
502  }
503 
504  m_MomX = NULL;
505  m_MomY = NULL;
506  m_MomZ = NULL;
507  m_Mom = NULL;
508  m_HitsPXD = NULL;
509  m_HitsSVD = NULL;
510  m_HitsCDC = NULL;
511  m_Hits = NULL;
512  m_TracksVXD = NULL;
513  m_TracksCDC = NULL;
514  m_TracksVXDCDC = NULL;
515  m_Tracks = NULL;
516 
517  int iHitsInPXD = 10;
518  int iHitsInSVD = 20;
519  int iHitsInCDC = 200;
520  int iHits = 200;
521  int iTracks = 30;
522  name = str(format("Alig_TrackMomentumX"));
523  title = str(format("Track Momentum X"));
524  m_MomX = new TH1F(name.c_str(), title.c_str(), 2 * iMomRange, -fMomRange, fMomRange);
525  m_MomX->GetXaxis()->SetTitle("Momentum");
526  m_MomX->GetYaxis()->SetTitle("counts");
527  name = str(format("Alig_TrackMomentumY"));
528  title = str(format("Track Momentum Y"));
529  m_MomY = new TH1F(name.c_str(), title.c_str(), 2 * iMomRange, -fMomRange, fMomRange);
530  m_MomY->GetXaxis()->SetTitle("Momentum");
531  m_MomY->GetYaxis()->SetTitle("counts");
532  name = str(format("Alig_TrackMomentumZ"));
533  title = str(format("Track Momentum Z"));
534  m_MomZ = new TH1F(name.c_str(), title.c_str(), 2 * iMomRange, -fMomRange, fMomRange);
535  m_MomZ->GetXaxis()->SetTitle("Momentum");
536  m_MomZ->GetYaxis()->SetTitle("counts");
537 
538  DirAlignHelixParameters->cd();
539  name = str(format("Alig_TrackMomentumPt"));
540  title = str(format("Track Momentum pT"));
541  m_MomPt = new TH1F(name.c_str(), title.c_str(), 2 * iMomRange, 0.0, fMomRange);
542  m_MomPt->GetXaxis()->SetTitle("Momentum");
543  m_MomPt->GetYaxis()->SetTitle("counts");
544 
545  DirAlign->cd();
546  name = str(format("Alig_TrackMomentumMag"));
547  title = str(format("Track Momentum Magnitude"));
548  m_Mom = new TH1F(name.c_str(), title.c_str(), 2 * iMomRange, 0.0, fMomRange);
549  m_Mom->GetXaxis()->SetTitle("Momentum");
550  m_Mom->GetYaxis()->SetTitle("counts");
551 
552  name = str(format("Alig_NoOfHitsInTrack_PXD"));
553  title = str(format("No Of Hits In Track - PXD"));
554  m_HitsPXD = new TH1F(name.c_str(), title.c_str(), iHitsInPXD, 0, iHitsInPXD);
555  m_HitsPXD->GetXaxis()->SetTitle("# hits");
556  m_HitsPXD->GetYaxis()->SetTitle("counts");
557  name = str(format("Alig_NoOfHitsInTrack_SVD"));
558  title = str(format("No Of Hits In Track - SVD"));
559  m_HitsSVD = new TH1F(name.c_str(), title.c_str(), iHitsInSVD, 0, iHitsInSVD);
560  m_HitsSVD->GetXaxis()->SetTitle("# hits");
561  m_HitsSVD->GetYaxis()->SetTitle("counts");
562  name = str(format("Alig_NoOfHitsInTrack_CDC"));
563  title = str(format("No Of Hits In Track - CDC"));
564  m_HitsCDC = new TH1F(name.c_str(), title.c_str(), iHitsInCDC, 0, iHitsInCDC);
565  m_HitsCDC->GetXaxis()->SetTitle("# hits");
566  m_HitsCDC->GetYaxis()->SetTitle("counts");
567  name = str(format("Alig_NoOfHitsInTrack"));
568  title = str(format("No Of Hits In Track"));
569  m_Hits = new TH1F(name.c_str(), title.c_str(), iHits, 0, iHits);
570  m_Hits->GetXaxis()->SetTitle("# hits");
571  m_Hits->GetYaxis()->SetTitle("counts");
572 
573  name = str(format("Alig_NoOfTracksInVXDOnly"));
574  title = str(format("No Of Tracks Per Event, Only In VXD"));
575  m_TracksVXD = new TH1F(name.c_str(), title.c_str(), iTracks, 0, iTracks);
576  m_TracksVXD->GetXaxis()->SetTitle("# tracks");
577  m_TracksVXD->GetYaxis()->SetTitle("counts");
578  name = str(format("Alig_NoOfTracksInCDCOnly"));
579  title = str(format("No Of Tracks Per Event, Only In CDC"));
580  m_TracksCDC = new TH1F(name.c_str(), title.c_str(), iTracks, 0, iTracks);
581  m_TracksCDC->GetXaxis()->SetTitle("# tracks");
582  m_TracksCDC->GetYaxis()->SetTitle("counts");
583  name = str(format("Alig_NoOfTracksInVXDCDC"));
584  title = str(format("No Of Tracks Per Event, In VXD+CDC"));
585  m_TracksVXDCDC = new TH1F(name.c_str(), title.c_str(), iTracks, 0, iTracks);
586  m_TracksVXDCDC->GetXaxis()->SetTitle("# tracks");
587  m_TracksVXDCDC->GetYaxis()->SetTitle("counts");
588  name = str(format("Alig_NoOfTracks"));
589  title = str(format("No Of All Tracks Per Event"));
590  m_Tracks = new TH1F(name.c_str(), title.c_str(), iTracks, 0, iTracks);
591  m_Tracks->GetXaxis()->SetTitle("# tracks");
592  m_Tracks->GetYaxis()->SetTitle("counts");
593 
594  DirAlignSensResids->cd();
595  for (int i = 0; i < nVXDSensors; i++) {
596  VxdID id = gTools->getSensorIDFromIndex(i);
597  int iLayer = id.getLayerNumber();
598  int iLadder = id.getLadderNumber();
599  int iSensor = id.getSensorNumber();
601  string sensorDescr = str(format("%1%_%2%_%3%") % iLayer % iLadder % iSensor);
602  name = str(format("Alig_UBResiduals_%1%") % sensorDescr);
603  sensorDescr = str(format("Layer %1% Ladder %2% Sensor %3%") % iLayer % iLadder % iSensor);
604  title = str(format("PXD Unbiased residuals for sensor %1%") % sensorDescr);
605  m_UBResidualsSensor[i] = new TH2F(name.c_str(), title.c_str(), 200, -ResidualRange, ResidualRange, 200, -ResidualRange,
606  ResidualRange);
607  m_UBResidualsSensor[i]->GetXaxis()->SetTitle("residual U [#mum]");
608  m_UBResidualsSensor[i]->GetYaxis()->SetTitle("residual V [#mum]");
609  m_UBResidualsSensor[i]->GetZaxis()->SetTitle("counts");
610  }
611  DirAlignSensResids1D->cd();
612  for (int i = 0; i < nVXDSensors; i++) {
613  VxdID id = gTools->getSensorIDFromIndex(i);
614  int iLayer = id.getLayerNumber();
615  int iLadder = id.getLadderNumber();
616  int iSensor = id.getSensorNumber();
618  string sensorDescr = str(format("%1%_%2%_%3%") % iLayer % iLadder % iSensor);
619  name = str(format("Alig_UBResidualsU_%1%") % sensorDescr);
620  sensorDescr = str(format("Layer %1% Ladder %2% Sensor %3%") % iLayer % iLadder % iSensor);
621  title = str(format("PXD Unbiased U residuals for sensor %1%") % sensorDescr);
622  m_UBResidualsSensorU[i] = new TH1F(name.c_str(), title.c_str(), 200, -ResidualRange, ResidualRange);
623  m_UBResidualsSensorU[i]->GetXaxis()->SetTitle("residual [#mum]");
624  m_UBResidualsSensorU[i]->GetYaxis()->SetTitle("counts");
625  sensorDescr = str(format("%1%_%2%_%3%") % iLayer % iLadder % iSensor);
626  name = str(format("Alig_UBResidualsV_%1%") % sensorDescr);
627  sensorDescr = str(format("Layer %1% Ladder %2% Sensor %3%") % iLayer % iLadder % iSensor);
628  title = str(format("PXD Unbiased V residuals for sensor %1%") % sensorDescr);
629  m_UBResidualsSensorV[i] = new TH1F(name.c_str(), title.c_str(), 200, -ResidualRange, ResidualRange);
630  m_UBResidualsSensorV[i]->GetXaxis()->SetTitle("residual [#mum]");
631  m_UBResidualsSensorV[i]->GetYaxis()->SetTitle("counts");
632  }
633 
634  m_ResMeanPosUVSensCounts = (TH2F**) new TH2F*[nVXDSensors];
635  m_ResMeanUPosUVSens = (TH2F**) new TH2F*[nVXDSensors];
636  m_ResMeanVPosUVSens = (TH2F**) new TH2F*[nVXDSensors];
637  m_ResUPosUSens = (TH2F**) new TH2F*[nVXDSensors];
638  m_ResUPosVSens = (TH2F**) new TH2F*[nVXDSensors];
639  m_ResVPosUSens = (TH2F**) new TH2F*[nVXDSensors];
640  m_ResVPosVSens = (TH2F**) new TH2F*[nVXDSensors];
641  m_ResMeanUPosUSens = (TH1F**) new TH1F*[nVXDSensors];
642  m_ResMeanUPosVSens = (TH1F**) new TH1F*[nVXDSensors];
643  m_ResMeanVPosUSens = (TH1F**) new TH1F*[nVXDSensors];
644  m_ResMeanVPosVSens = (TH1F**) new TH1F*[nVXDSensors];
645 
646  int iSizeBins = 20;
647  float fSizeMin = -50; // in mm
648  float fSizeMax = -fSizeMin;
649  DirAlignSensResMeanUPosUV->cd();
650  for (int i = 0; i < nVXDSensors; i++) {
651  VxdID id = gTools->getSensorIDFromIndex(i);
652  int iLayer = id.getLayerNumber();
653  int iLadder = id.getLadderNumber();
654  int iSensor = id.getSensorNumber();
655  string sensorDescr = str(format("%1%_%2%_%3%") % iLayer % iLadder % iSensor);
656  name = str(format("ResMeanUPosUVSens_%1%") % sensorDescr);
657  sensorDescr = str(format("Layer %1% Ladder %2% Sensor %3%") % iLayer % iLadder % iSensor);
658  title = str(format("Residual Mean U in Position UV, %1%") % sensorDescr);
659  m_ResMeanUPosUVSens[i] = new TH2F(name.c_str(), title.c_str(), iSizeBins, fSizeMin, fSizeMax, iSizeBins, fSizeMin, fSizeMax);
660  m_ResMeanUPosUVSens[i]->GetXaxis()->SetTitle("position U [mm]");
661  m_ResMeanUPosUVSens[i]->GetYaxis()->SetTitle("position V [mm]");
662  m_ResMeanUPosUVSens[i]->GetZaxis()->SetTitle("residual U [#mum]");
663  }
664  for (int i = 0; i < nVXDSensors; i++) {
665  VxdID id = gTools->getSensorIDFromIndex(i);
666  int iLayer = id.getLayerNumber();
667  int iLadder = id.getLadderNumber();
668  int iSensor = id.getSensorNumber();
669  string sensorDescr = str(format("%1%_%2%_%3%") % iLayer % iLadder % iSensor);
670  name = str(format("ResMeanPosUVCountsSens_%1%") % sensorDescr);
671  sensorDescr = str(format("Layer %1% Ladder %2% Sensor %3%") % iLayer % iLadder % iSensor);
672  title = str(format("Residual Mean Counts in Position UV, %1%") % sensorDescr);
673  m_ResMeanPosUVSensCounts[i] = new TH2F(name.c_str(), title.c_str(), iSizeBins, fSizeMin, fSizeMax, iSizeBins, fSizeMin, fSizeMax);
674  m_ResMeanPosUVSensCounts[i]->GetXaxis()->SetTitle("position U [mm]");
675  m_ResMeanPosUVSensCounts[i]->GetYaxis()->SetTitle("position V [mm]");
676  m_ResMeanPosUVSensCounts[i]->GetZaxis()->SetTitle("counts");
677  }
678 
679  DirAlignSensResMeanVPosUV->cd();
680  for (int i = 0; i < nVXDSensors; i++) {
681  VxdID id = gTools->getSensorIDFromIndex(i);
682  int iLayer = id.getLayerNumber();
683  int iLadder = id.getLadderNumber();
684  int iSensor = id.getSensorNumber();
685  string sensorDescr = str(format("%1%_%2%_%3%") % iLayer % iLadder % iSensor);
686  name = str(format("ResMeanVPosUVSens_%1%") % sensorDescr);
687  sensorDescr = str(format("Layer %1% Ladder %2% Sensor %3%") % iLayer % iLadder % iSensor);
688  title = str(format("Residual Mean V in Position UV, %1%") % sensorDescr);
689  m_ResMeanVPosUVSens[i] = new TH2F(name.c_str(), title.c_str(), iSizeBins, fSizeMin, fSizeMax, iSizeBins, fSizeMin, fSizeMax);
690  m_ResMeanVPosUVSens[i]->GetXaxis()->SetTitle("position U [mm]");
691  m_ResMeanVPosUVSens[i]->GetYaxis()->SetTitle("position V [mm]");
692  m_ResMeanVPosUVSens[i]->GetZaxis()->SetTitle("residual V [#mum]");
693  }
694 
695  DirAlignSensResMeanUPosU->cd();
696  for (int i = 0; i < nVXDSensors; i++) {
697  VxdID id = gTools->getSensorIDFromIndex(i);
698  int iLayer = id.getLayerNumber();
699  int iLadder = id.getLadderNumber();
700  int iSensor = id.getSensorNumber();
701  string sensorDescr = str(format("%1%_%2%_%3%") % iLayer % iLadder % iSensor);
702  name = str(format("ResMeanUPosUSens_%1%") % sensorDescr);
703  sensorDescr = str(format("Layer %1% Ladder %2% Sensor %3%") % iLayer % iLadder % iSensor);
704  title = str(format("Residual Mean U in Position U, %1%") % sensorDescr);
705  m_ResMeanUPosUSens[i] = new TH1F(name.c_str(), title.c_str(), iSizeBins, fSizeMin, fSizeMax);
706  m_ResMeanUPosUSens[i]->GetXaxis()->SetTitle("position U [mm]");
707  m_ResMeanUPosUSens[i]->GetYaxis()->SetTitle("residual mean U [#mum]");
708  }
709 
710  DirAlignSensResMeanVPosU->cd();
711  for (int i = 0; i < nVXDSensors; i++) {
712  VxdID id = gTools->getSensorIDFromIndex(i);
713  int iLayer = id.getLayerNumber();
714  int iLadder = id.getLadderNumber();
715  int iSensor = id.getSensorNumber();
716  string sensorDescr = str(format("%1%_%2%_%3%") % iLayer % iLadder % iSensor);
717  name = str(format("ResMeanVPosUSens_%1%") % sensorDescr);
718  sensorDescr = str(format("Layer %1% Ladder %2% Sensor %3%") % iLayer % iLadder % iSensor);
719  title = str(format("Residual Mean V in Position U, %1%") % sensorDescr);
720  m_ResMeanVPosUSens[i] = new TH1F(name.c_str(), title.c_str(), iSizeBins, fSizeMin, fSizeMax);
721  m_ResMeanVPosUSens[i]->GetXaxis()->SetTitle("position U [mm]");
722  m_ResMeanVPosUSens[i]->GetYaxis()->SetTitle("residual mean V [#mum]");
723  }
724 
725  DirAlignSensResMeanUPosV->cd();
726  for (int i = 0; i < nVXDSensors; i++) {
727  VxdID id = gTools->getSensorIDFromIndex(i);
728  int iLayer = id.getLayerNumber();
729  int iLadder = id.getLadderNumber();
730  int iSensor = id.getSensorNumber();
731  string sensorDescr = str(format("%1%_%2%_%3%") % iLayer % iLadder % iSensor);
732  name = str(format("ResMeanUPosVSens_%1%") % sensorDescr);
733  sensorDescr = str(format("Layer %1% Ladder %2% Sensor %3%") % iLayer % iLadder % iSensor);
734  title = str(format("Residual Mean U in Position V, %1%") % sensorDescr);
735  m_ResMeanUPosVSens[i] = new TH1F(name.c_str(), title.c_str(), iSizeBins, fSizeMin, fSizeMax);
736  m_ResMeanUPosVSens[i]->GetXaxis()->SetTitle("position V [mm]");
737  m_ResMeanUPosVSens[i]->GetYaxis()->SetTitle("residual mean U [#mum]");
738  }
739 
740  DirAlignSensResMeanVPosV->cd();
741  for (int i = 0; i < nVXDSensors; i++) {
742  VxdID id = gTools->getSensorIDFromIndex(i);
743  int iLayer = id.getLayerNumber();
744  int iLadder = id.getLadderNumber();
745  int iSensor = id.getSensorNumber();
746  string sensorDescr = str(format("%1%_%2%_%3%") % iLayer % iLadder % iSensor);
747  name = str(format("ResMeanVPosVSens_%1%") % sensorDescr);
748  sensorDescr = str(format("Layer %1% Ladder %2% Sensor %3%") % iLayer % iLadder % iSensor);
749  title = str(format("Residual Mean V in Position V, %1%") % sensorDescr);
750  m_ResMeanVPosVSens[i] = new TH1F(name.c_str(), title.c_str(), iSizeBins, fSizeMin, fSizeMax);
751  m_ResMeanVPosVSens[i]->GetXaxis()->SetTitle("position V [mm]");
752  m_ResMeanVPosVSens[i]->GetYaxis()->SetTitle("residual mean V [#mum]");
753  }
754 
755  DirAlignSensResUPosU->cd();
756  for (int i = 0; i < nVXDSensors; i++) {
757  VxdID id = gTools->getSensorIDFromIndex(i);
758  int iLayer = id.getLayerNumber();
759  int iLadder = id.getLadderNumber();
760  int iSensor = id.getSensorNumber();
761  string sensorDescr = str(format("%1%_%2%_%3%") % iLayer % iLadder % iSensor);
762  name = str(format("ResUPosUSensor_%1%") % sensorDescr);
763  sensorDescr = str(format("Layer %1% Ladder %2% Sensor %3%") % iLayer % iLadder % iSensor);
764  title = str(format("Residual U in Position U, %1%") % sensorDescr);
765  m_ResUPosUSens[i] = new TH2F(name.c_str(), title.c_str(), iSizeBins, fSizeMin, fSizeMax, 200, -ResidualRange, ResidualRange);
766  m_ResUPosUSens[i]->GetXaxis()->SetTitle("position U [mm]");
767  m_ResUPosUSens[i]->GetYaxis()->SetTitle("residual U [#mum]");
768  m_ResUPosUSens[i]->GetZaxis()->SetTitle("counts");
769  }
770 
771  DirAlignSensResVPosU->cd();
772  for (int i = 0; i < nVXDSensors; i++) {
773  VxdID id = gTools->getSensorIDFromIndex(i);
774  int iLayer = id.getLayerNumber();
775  int iLadder = id.getLadderNumber();
776  int iSensor = id.getSensorNumber();
777  string sensorDescr = str(format("%1%_%2%_%3%") % iLayer % iLadder % iSensor);
778  name = str(format("ResVPosUSensor_%1%") % sensorDescr);
779  sensorDescr = str(format("Layer %1% Ladder %2% Sensor %3%") % iLayer % iLadder % iSensor);
780  title = str(format("Residual V in Position U, %1%") % sensorDescr);
781  m_ResVPosUSens[i] = new TH2F(name.c_str(), title.c_str(), iSizeBins, fSizeMin, fSizeMax, 200, -ResidualRange, ResidualRange);
782  m_ResVPosUSens[i]->GetXaxis()->SetTitle("position U [mm]");
783  m_ResVPosUSens[i]->GetYaxis()->SetTitle("residual V [#mum]");
784  m_ResVPosUSens[i]->GetZaxis()->SetTitle("counts");
785  }
786 
787  DirAlignSensResUPosV->cd();
788  for (int i = 0; i < nVXDSensors; i++) {
789  VxdID id = gTools->getSensorIDFromIndex(i);
790  int iLayer = id.getLayerNumber();
791  int iLadder = id.getLadderNumber();
792  int iSensor = id.getSensorNumber();
793  string sensorDescr = str(format("%1%_%2%_%3%") % iLayer % iLadder % iSensor);
794  name = str(format("ResUPosVSensor_%1%") % sensorDescr);
795  sensorDescr = str(format("Layer %1% Ladder %2% Sensor %3%") % iLayer % iLadder % iSensor);
796  title = str(format("Residual U in Position V, %1%") % sensorDescr);
797  m_ResUPosVSens[i] = new TH2F(name.c_str(), title.c_str(), iSizeBins, fSizeMin, fSizeMax, 200, -ResidualRange, ResidualRange);
798  m_ResUPosVSens[i]->GetXaxis()->SetTitle("position V [mm]");
799  m_ResUPosVSens[i]->GetYaxis()->SetTitle("residual U [#mum]");
800  m_ResUPosVSens[i]->GetZaxis()->SetTitle("counts");
801  }
802 
803  DirAlignSensResVPosV->cd();
804  for (int i = 0; i < nVXDSensors; i++) {
805  VxdID id = gTools->getSensorIDFromIndex(i);
806  int iLayer = id.getLayerNumber();
807  int iLadder = id.getLadderNumber();
808  int iSensor = id.getSensorNumber();
809  string sensorDescr = str(format("%1%_%2%_%3%") % iLayer % iLadder % iSensor);
810  name = str(format("ResVPosVSensor_%1%") % sensorDescr);
811  sensorDescr = str(format("Layer %1% Ladder %2% Sensor %3%") % iLayer % iLadder % iSensor);
812  title = str(format("Residual V in Position V, %1%") % sensorDescr);
813  m_ResVPosVSens[i] = new TH2F(name.c_str(), title.c_str(), iSizeBins, fSizeMin, fSizeMax, 200, -ResidualRange, ResidualRange);
814  m_ResVPosVSens[i]->GetXaxis()->SetTitle("position V [mm]");
815  m_ResVPosVSens[i]->GetYaxis()->SetTitle("residual V [#mum]");
816  m_ResVPosVSens[i]->GetZaxis()->SetTitle("counts");
817  }
818 
819  m_ResMeanPhiThetaLayerCounts = (TH2F**) new TH2F*[nVXDLayers];
820  m_ResMeanUPhiThetaLayer = (TH2F**) new TH2F*[nVXDLayers];
821  m_ResMeanVPhiThetaLayer = (TH2F**) new TH2F*[nVXDLayers];
822  m_ResUPhiLayer = (TH2F**) new TH2F*[nVXDLayers];
823  m_ResVPhiLayer = (TH2F**) new TH2F*[nVXDLayers];
824  m_ResUThetaLayer = (TH2F**) new TH2F*[nVXDLayers];
825  m_ResVThetaLayer = (TH2F**) new TH2F*[nVXDLayers];
826  m_ResMeanUPhiLayer = (TH1F**) new TH1F*[nVXDLayers];
827  m_ResMeanVPhiLayer = (TH1F**) new TH1F*[nVXDLayers];
828  m_ResMeanUThetaLayer = (TH1F**) new TH1F*[nVXDLayers];
829  m_ResMeanVThetaLayer = (TH1F**) new TH1F*[nVXDLayers];
830 
831  int iPhiGran = 90;
832  int iThetGran = iPhiGran / 2;
833  int iYResGran = 200;
834 
835  DirAlignLayerResMeanUPosUV->cd();
836  for (VxdID layer : geo.getLayers()) {
837  int iLayer = layer.getLayerNumber();
838  int iLay = gTools->getLayerIndex(layer.getLayerNumber());
839  name = str(format("ResMeanUPhiThetaLayer_%1%") % iLayer);
840  title = str(format("Residuals Mean U in Phi Theta, Layer %1%") % iLayer);
841  m_ResMeanUPhiThetaLayer[iLay] = new TH2F(name.c_str(), title.c_str(), iPhiGran, -180, 180, iThetGran, 0, 180);
842  m_ResMeanUPhiThetaLayer[iLay]->GetXaxis()->SetTitle("Phi [deg]");
843  m_ResMeanUPhiThetaLayer[iLay]->GetYaxis()->SetTitle("Theta [deg]");
844  m_ResMeanUPhiThetaLayer[iLay]->GetZaxis()->SetTitle("residual [#mum]");
845  }
846  for (VxdID layer : geo.getLayers()) {
847  int iLayer = layer.getLayerNumber();
848  int iLay = gTools->getLayerIndex(layer.getLayerNumber());
849  name = str(format("ResCounterPhiThetaLayer_%1%") % iLayer);
850  title = str(format("Residuals counter in Phi Theta, Layer %1%") % iLayer);
851  m_ResMeanPhiThetaLayerCounts[iLay] = new TH2F(name.c_str(), title.c_str(), iPhiGran, -180, 180, iThetGran, 0, 180);
852  m_ResMeanPhiThetaLayerCounts[iLay]->GetXaxis()->SetTitle("Phi [deg]");
853  m_ResMeanPhiThetaLayerCounts[iLay]->GetYaxis()->SetTitle("Theta [deg]");
854  m_ResMeanPhiThetaLayerCounts[iLay]->GetZaxis()->SetTitle("counts");
855  }
856 
857  DirAlignLayerResMeanVPosUV->cd();
858  for (VxdID layer : geo.getLayers()) {
859  int iLayer = layer.getLayerNumber();
860  int iLay = gTools->getLayerIndex(layer.getLayerNumber());
861  name = str(format("ResMeanVPhiThetaLayer_%1%") % iLayer);
862  title = str(format("Residuals Mean V in Phi Theta, Layer %1%") % iLayer);
863  m_ResMeanVPhiThetaLayer[iLay] = new TH2F(name.c_str(), title.c_str(), iPhiGran, -180, 180, iThetGran, 0, 180);
864  m_ResMeanVPhiThetaLayer[iLay]->GetXaxis()->SetTitle("Phi [deg]");
865  m_ResMeanVPhiThetaLayer[iLay]->GetYaxis()->SetTitle("Theta [deg]");
866  m_ResMeanVPhiThetaLayer[iLay]->GetZaxis()->SetTitle("residual [#mum]");
867  }
868 
869  DirAlignLayerResMeanUPosU->cd();
870  for (VxdID layer : geo.getLayers()) {
871  int iLayer = layer.getLayerNumber();
872  int iLay = gTools->getLayerIndex(layer.getLayerNumber());
873  name = str(format("ResMeanUPhiLayer_%1%") % iLayer);
874  title = str(format("Residuals Mean U in Phi, Layer %1%") % iLayer);
875  m_ResMeanUPhiLayer[iLay] = new TH1F(name.c_str(), title.c_str(), iPhiGran, -180, 180);
876  m_ResMeanUPhiLayer[iLay]->GetXaxis()->SetTitle("Phi [deg]");
877  m_ResMeanUPhiLayer[iLay]->GetYaxis()->SetTitle("residual [#mum]");
878  }
879 
880  DirAlignLayerResMeanVPosU->cd();
881  for (VxdID layer : geo.getLayers()) {
882  int iLayer = layer.getLayerNumber();
883  int iLay = gTools->getLayerIndex(layer.getLayerNumber());
884  name = str(format("ResMeanVPhiLayer_%1%") % iLayer);
885  title = str(format("Residuals Mean V in Phi, Layer %1%") % iLayer);
886  m_ResMeanVPhiLayer[iLay] = new TH1F(name.c_str(), title.c_str(), iPhiGran, -180, 180);
887  m_ResMeanVPhiLayer[iLay]->GetXaxis()->SetTitle("Phi [deg]");
888  m_ResMeanVPhiLayer[iLay]->GetYaxis()->SetTitle("residual [#mum]");
889  }
890 
891  DirAlignLayerResMeanUPosV->cd();
892  for (VxdID layer : geo.getLayers()) {
893  int iLayer = layer.getLayerNumber();
894  int iLay = gTools->getLayerIndex(layer.getLayerNumber());
895  name = str(format("ResMeanUThetaLayer_%1%") % iLayer);
896  title = str(format("Residuals Mean U in Theta, Layer %1%") % iLayer);
897  m_ResMeanUThetaLayer[iLay] = new TH1F(name.c_str(), title.c_str(), iThetGran, 0, 180);
898  m_ResMeanUThetaLayer[iLay]->GetXaxis()->SetTitle("Theta [deg]");
899  m_ResMeanUThetaLayer[iLay]->GetYaxis()->SetTitle("residual [#mum]");
900  }
901 
902  DirAlignLayerResMeanVPosV->cd();
903  for (VxdID layer : geo.getLayers()) {
904  int iLayer = layer.getLayerNumber();
905  int iLay = gTools->getLayerIndex(layer.getLayerNumber());
906  name = str(format("ResMeanVThetaLayer_%1%") % iLayer);
907  title = str(format("Residuals Mean V in Theta, Layer %1%") % iLayer);
908  m_ResMeanVThetaLayer[iLay] = new TH1F(name.c_str(), title.c_str(), iThetGran, 0, 180);
909  m_ResMeanVThetaLayer[iLay]->GetXaxis()->SetTitle("Theta [deg]");
910  m_ResMeanVThetaLayer[iLay]->GetYaxis()->SetTitle("residual [#mum]");
911  }
912 
913  DirAlignLayerResUPosU->cd();
914  for (VxdID layer : geo.getLayers()) {
915  int iLayer = layer.getLayerNumber();
916  int iLay = gTools->getLayerIndex(layer.getLayerNumber());
917  name = str(format("ResUPhiLayer_%1%") % iLayer);
918  title = str(format("Residuals U in Phi, Layer %1%") % iLayer);
919  m_ResUPhiLayer[iLay] = new TH2F(name.c_str(), title.c_str(), iPhiGran, -180, 180, iYResGran, -ResidualRange, ResidualRange);
920  m_ResUPhiLayer[iLay]->GetXaxis()->SetTitle("Phi [deg]");
921  m_ResUPhiLayer[iLay]->GetYaxis()->SetTitle("residual [#mum]");
922  m_ResUPhiLayer[iLay]->GetZaxis()->SetTitle("counts");
923  }
924 
925  DirAlignLayerResVPosU->cd();
926  for (VxdID layer : geo.getLayers()) {
927  int iLayer = layer.getLayerNumber();
928  int iLay = gTools->getLayerIndex(layer.getLayerNumber());
929  name = str(format("ResVPhiLayer_%1%") % iLayer);
930  title = str(format("Residuals V in Phi, Layer %1%") % iLayer);
931  m_ResVPhiLayer[iLay] = new TH2F(name.c_str(), title.c_str(), iPhiGran, -180, 180, iYResGran, -ResidualRange, ResidualRange);
932  m_ResVPhiLayer[iLay]->GetXaxis()->SetTitle("Phi [deg]");
933  m_ResVPhiLayer[iLay]->GetYaxis()->SetTitle("residual [#mum]");
934  m_ResVPhiLayer[iLay]->GetZaxis()->SetTitle("counts");
935  }
936 
937  DirAlignLayerResUPosV->cd();
938  for (VxdID layer : geo.getLayers()) {
939  int iLayer = layer.getLayerNumber();
940  int iLay = gTools->getLayerIndex(layer.getLayerNumber());
941  name = str(format("ResUThetaLayer_%1%") % iLayer);
942  title = str(format("Residuals U in Theta, Layer %1%") % iLayer);
943  m_ResUThetaLayer[iLay] = new TH2F(name.c_str(), title.c_str(), iThetGran, 0, 180, iYResGran, -ResidualRange, ResidualRange);
944  m_ResUThetaLayer[iLay]->GetXaxis()->SetTitle("Theta [deg]");
945  m_ResUThetaLayer[iLay]->GetYaxis()->SetTitle("residual [#mum]");
946  m_ResUThetaLayer[iLay]->GetZaxis()->SetTitle("counts");
947  }
948 
949  DirAlignLayerResVPosV->cd();
950  for (VxdID layer : geo.getLayers()) {
951  int iLayer = layer.getLayerNumber();
952  int iLay = gTools->getLayerIndex(layer.getLayerNumber());
953  name = str(format("ResVThetaLayer_%1%") % iLayer);
954  title = str(format("Residuals V in Theta, Layer %1%") % iLayer);
955  m_ResVThetaLayer[iLay] = new TH2F(name.c_str(), title.c_str(), iThetGran, 0, 180, iYResGran, -ResidualRange, ResidualRange);
956  m_ResVThetaLayer[iLay]->GetXaxis()->SetTitle("Theta [deg]");
957  m_ResVThetaLayer[iLay]->GetYaxis()->SetTitle("residual [#mum]");
958  m_ResVThetaLayer[iLay]->GetZaxis()->SetTitle("counts");
959  }
960 
961  oldDir->cd();
962 
963 }
964 
966 {
967  auto gTools = VXD::GeoCache::getInstance().getGeoTools();
969 
970  if (m_D0 != NULL) m_D0->Reset();
971  if (m_Z0 != NULL) m_Z0->Reset();
972  if (m_Phi != NULL) m_Phi->Reset();
973  if (m_MomPt != NULL) m_MomPt->Reset();
974  if (m_Omega != NULL) m_Omega->Reset();
975  if (m_TanLambda != NULL) m_TanLambda->Reset();
976 
977  if (m_PhiD0 != NULL) m_PhiD0->Reset();
978  if (m_PhiZ0 != NULL) m_PhiZ0->Reset();
979  if (m_PhiMomPt != NULL) m_PhiMomPt->Reset();
980  if (m_PhiOmega != NULL) m_PhiOmega->Reset();
981  if (m_PhiTanLambda != NULL) m_PhiTanLambda->Reset();
982 
983  if (m_D0Z0 != NULL) m_D0Z0->Reset();
984  if (m_D0MomPt != NULL) m_D0MomPt->Reset();
985  if (m_D0Omega != NULL) m_D0Omega->Reset();
986  if (m_D0TanLambda != NULL) m_D0TanLambda->Reset();
987  if (m_Z0MomPt != NULL) m_Z0MomPt->Reset();
988  if (m_Z0Omega != NULL) m_Z0Omega->Reset();
989  if (m_Z0TanLambda != NULL) m_Z0TanLambda->Reset();
990  if (m_MomPtOmega != NULL) m_MomPtOmega->Reset();
991  if (m_MomPtTanLambda != NULL) m_MomPtTanLambda->Reset();
992  if (m_OmegaTanLambda != NULL) m_OmegaTanLambda->Reset();
993 
994  if (m_MomPhi != NULL) m_MomPhi->Reset();
995  if (m_MomTheta != NULL) m_MomTheta->Reset();
996  if (m_MomCosTheta != NULL) m_MomCosTheta->Reset();
997  if (m_PValue != NULL) m_PValue->Reset();
998  if (m_Chi2 != NULL) m_Chi2->Reset();
999  if (m_NDF != NULL) m_NDF->Reset();
1000  if (m_Chi2NDF != NULL) m_Chi2NDF->Reset();
1001  if (m_UBResidualsPXD != NULL) m_UBResidualsPXD->Reset();
1002  if (m_UBResidualsSVD != NULL) m_UBResidualsSVD->Reset();
1003  if (m_UBResidualsPXDU != NULL) m_UBResidualsPXDU->Reset();
1004  if (m_UBResidualsSVDU != NULL) m_UBResidualsSVDU->Reset();
1005  if (m_UBResidualsPXDV != NULL) m_UBResidualsPXDV->Reset();
1006  if (m_UBResidualsSVDV != NULL) m_UBResidualsSVDV->Reset();
1007 
1008  // half-shells
1009  if (m_UBResidualsPXDX_Ying != NULL) m_UBResidualsPXDX_Ying->Reset();
1010  if (m_UBResidualsPXDX_Yang != NULL) m_UBResidualsPXDX_Yang->Reset();
1011  if (m_UBResidualsSVDX_Pat != NULL) m_UBResidualsSVDX_Pat->Reset();
1012  if (m_UBResidualsSVDX_Mat != NULL) m_UBResidualsSVDX_Mat->Reset();
1013 
1014  if (m_UBResidualsPXDY_Ying != NULL) m_UBResidualsPXDY_Ying->Reset();
1015  if (m_UBResidualsPXDY_Yang != NULL) m_UBResidualsPXDY_Yang->Reset();
1016  if (m_UBResidualsSVDY_Pat != NULL) m_UBResidualsSVDY_Pat->Reset();
1017  if (m_UBResidualsSVDY_Mat != NULL) m_UBResidualsSVDY_Mat->Reset();
1018 
1019  if (m_UBResidualsPXDZ_Ying != NULL) m_UBResidualsPXDZ_Ying->Reset();
1020  if (m_UBResidualsPXDZ_Yang != NULL) m_UBResidualsPXDZ_Yang->Reset();
1021  if (m_UBResidualsSVDZ_Pat != NULL) m_UBResidualsSVDZ_Pat->Reset();
1022  if (m_UBResidualsSVDZ_Mat != NULL) m_UBResidualsSVDZ_Mat->Reset();
1023 
1024  for (VxdID layer : geo.getLayers()) {
1025  int i = gTools->getLayerIndex(layer.getLayerNumber());
1026  if (m_TRClusterHitmap[i] != NULL) m_TRClusterHitmap[i]->Reset();
1027  }
1028  for (VxdID layer : geo.getLayers()) {
1029  int i = layer.getLayerNumber();
1030  if (i == gTools->getLastLayer()) continue;
1031  i = gTools->getLayerIndex(i);
1032  if (m_TRClusterCorrelationsPhi[i] != NULL) m_TRClusterCorrelationsPhi[i]->Reset();
1033  if (m_TRClusterCorrelationsTheta[i] != NULL) m_TRClusterCorrelationsTheta[i]->Reset();
1034  }
1035  for (int i = 0; i < gTools->getNumberOfSensors(); i++) {
1036  if (m_UBResidualsSensor[i] != NULL) m_UBResidualsSensor[i]->Reset();
1037  if (m_UBResidualsSensorU[i] != NULL) m_UBResidualsSensorU[i]->Reset();
1038  if (m_UBResidualsSensorV[i] != NULL) m_UBResidualsSensorV[i]->Reset();
1039  }
1040  if (m_MomX != NULL) m_MomX->Reset();
1041  if (m_MomY != NULL) m_MomY->Reset();
1042  if (m_MomZ != NULL) m_MomZ->Reset();
1043  if (m_Mom != NULL) m_Mom->Reset();
1044  if (m_HitsPXD != NULL) m_HitsPXD->Reset();
1045  if (m_HitsSVD != NULL) m_HitsSVD->Reset();
1046  if (m_HitsCDC != NULL) m_HitsCDC->Reset();
1047  if (m_Hits != NULL) m_Hits->Reset();
1048  if (m_TracksVXD != NULL) m_TracksVXD->Reset();
1049  if (m_TracksCDC != NULL) m_TracksCDC->Reset();
1050  if (m_TracksVXDCDC != NULL) m_TracksVXDCDC->Reset();
1051  if (m_Tracks != NULL) m_Tracks->Reset();
1052 }
1053 
1054 
1056 {
1057  auto gTools = VXD::GeoCache::getInstance().getGeoTools();
1058 
1059  try {
1060  int iTrack = 0;
1061  int iTrackVXD = 0;
1062  int iTrackCDC = 0;
1063  int iTrackVXDCDC = 0;
1064  StoreArray<Track> tracks(m_param_TracksStoreArrayName);
1065  if (!tracks || !tracks.getEntries()) return;
1066  for (const Track& track : tracks) { // over tracks
1067  RelationVector<RecoTrack> theRC = track.getRelationsTo<RecoTrack>(m_param_RecoTracksStoreArrayName);
1068  if (!theRC.size()) continue;
1069  RelationVector<PXDCluster> pxdClustersTrack = DataStore::getRelationsWithObj<PXDCluster>(theRC[0]);
1070  int nPXD = (int)pxdClustersTrack.size();
1071  RelationVector<SVDCluster> svdClustersTrack = DataStore::getRelationsWithObj<SVDCluster>(theRC[0]);
1072  int nSVD = (int)svdClustersTrack.size();
1073  RelationVector<CDCHit> cdcHitTrack = DataStore::getRelationsWithObj<CDCHit>(theRC[0]);
1074  int nCDC = (int)cdcHitTrack.size();
1075  const TrackFitResult* tfr = track.getTrackFitResultWithClosestMass(Const::pion);
1086  if (tfr == nullptr) continue;
1087  TString message = Form("AlignDQM: track %3i, Mom: %f, %f, %f, Pt: %f, Mag: %f, Hits: PXD %i SVD %i CDC %i Suma %i\n",
1088  iTrack,
1089  (float)tfr->getMomentum().Px(),
1090  (float)tfr->getMomentum().Py(),
1091  (float)tfr->getMomentum().Pz(),
1092  (float)tfr->getMomentum().Pt(),
1093  (float)tfr->getMomentum().Mag(),
1094  nPXD, nSVD, nCDC, nPXD + nSVD + nCDC
1095  );
1096  B2DEBUG(230, message.Data());
1097  iTrack++;
1098 
1099  float Phi = 90;
1100  if (fabs(tfr->getMomentum().Px()) > 0.00000001) {
1101  Phi = atan2(tfr->getMomentum().Py(), tfr->getMomentum().Px()) * TMath::RadToDeg();
1102  }
1103  float pxy = sqrt(tfr->getMomentum().Px() * tfr->getMomentum().Px() + tfr->getMomentum().Py() * tfr->getMomentum().Py());
1104  float Theta = 90;
1105  if (fabs(tfr->getMomentum().Pz()) > 0.00000001) {
1106  Theta = atan2(pxy, tfr->getMomentum().Pz()) * TMath::RadToDeg();
1107  }
1108  m_MomPhi->Fill(Phi);
1109  m_MomTheta->Fill(Theta);
1110  m_MomCosTheta->Fill(cos(Theta - 90.0));
1111 
1112  if (theRC[0]->wasFitSuccessful()) {
1113  if (!theRC[0]->getTrackFitStatus())
1114  continue;
1115  // add NDF:
1116  float NDF = theRC[0]->getTrackFitStatus()->getNdf();
1117  m_NDF->Fill(NDF);
1118  // add Chi2/NDF:
1119  m_Chi2->Fill(theRC[0]->getTrackFitStatus()->getChi2());
1120  if (NDF) {
1121  float Chi2NDF = theRC[0]->getTrackFitStatus()->getChi2() / NDF;
1122  m_Chi2NDF->Fill(Chi2NDF);
1123  }
1124  // add p-value:
1125  float pValue = theRC[0]->getTrackFitStatus()->getPVal();
1126  m_PValue->Fill(pValue);
1127 
1128  VxdID sensorIDPrew;
1129 
1130  float ResidUPlaneRHUnBias = 0;
1131  float ResidVPlaneRHUnBias = 0;
1132  float fPosSPUPrev = 0;
1133  float fPosSPVPrev = 0;
1134  float fPosSPU = 0;
1135  float fPosSPV = 0;
1136  float posU = 0;
1137  float posV = 0;
1138  int iLayerPrev = 0;
1139  int iLayer = 0;
1140 
1141  bool isNotFirstHit = false;
1142 
1143  int IsSVDU = -1;
1144  for (auto recoHitInfo : theRC[0]->getRecoHitInformations(true)) { // over recohits
1145  if (!recoHitInfo) {
1146  B2DEBUG(200, "No genfit::pxd recoHitInfo is missing.");
1147  continue;
1148  }
1149  if (!recoHitInfo->useInFit())
1150  continue;
1151  if (!((recoHitInfo->getTrackingDetector() == RecoHitInformation::c_PXD) ||
1152  (recoHitInfo->getTrackingDetector() == RecoHitInformation::c_SVD)))
1153  continue;
1154 
1155  bool biased = false;
1156  if (!theRC[0]->getCreatedTrackPoint(recoHitInfo)->getFitterInfo()) continue;
1157  TVectorD resUnBias = theRC[0]->getCreatedTrackPoint(recoHitInfo)->getFitterInfo()->getResidual(0, biased).getState();
1158  IsSVDU = -1;
1159  if (recoHitInfo->getTrackingDetector() == RecoHitInformation::c_PXD) {
1160  posU = recoHitInfo->getRelatedTo<PXDCluster>()->getU();
1161  posV = recoHitInfo->getRelatedTo<PXDCluster>()->getV();
1162  B2Vector3D rLocal(posU, posV, 0);
1163  VxdID sensorID = recoHitInfo->getRelatedTo<PXDCluster>()->getSensorID();
1164  auto info = dynamic_cast<const PXD::SensorInfo&>(VXD::GeoCache::get(sensorID));
1165  iLayer = sensorID.getLayerNumber();
1166  B2Vector3D ral = info.pointToGlobal(rLocal);
1167  fPosSPU = ral.Phi() / TMath::Pi() * 180;
1168  fPosSPV = ral.Theta() / TMath::Pi() * 180;
1169  ResidUPlaneRHUnBias = resUnBias.GetMatrixArray()[0] * Unit::convertValueToUnit(1.0, "um");
1170  ResidVPlaneRHUnBias = resUnBias.GetMatrixArray()[1] * Unit::convertValueToUnit(1.0, "um");
1171  if (isNotFirstHit && ((iLayer - iLayerPrev) == 1)) {
1172  int index = gTools->getLayerIndex(sensorID.getLayerNumber()) - gTools->getFirstLayer();
1173  m_TRClusterCorrelationsPhi[index]->Fill(fPosSPUPrev, fPosSPU);
1174  m_TRClusterCorrelationsTheta[index]->Fill(fPosSPVPrev, fPosSPV);
1175  } else
1176  isNotFirstHit = true;
1177  iLayerPrev = iLayer;
1178  fPosSPUPrev = fPosSPU;
1179  fPosSPVPrev = fPosSPV;
1180  m_UBResidualsPXD->Fill(ResidUPlaneRHUnBias, ResidVPlaneRHUnBias);
1181  m_UBResidualsPXDU->Fill(ResidUPlaneRHUnBias);
1182  m_UBResidualsPXDV->Fill(ResidVPlaneRHUnBias);
1183 
1184 
1185  int index = gTools->getSensorIndex(sensorID);
1186  int indexLayer = gTools->getLayerIndex(sensorID.getLayerNumber());
1187  m_UBResidualsSensor[index]->Fill(ResidUPlaneRHUnBias, ResidVPlaneRHUnBias);
1188  m_UBResidualsSensorU[index]->Fill(ResidUPlaneRHUnBias);
1189  m_UBResidualsSensorV[index]->Fill(ResidVPlaneRHUnBias);
1190  m_TRClusterHitmap[indexLayer]->Fill(fPosSPU, fPosSPV);
1191 
1192  // half-shells
1193  TVector3 localResidual(ResidUPlaneRHUnBias, ResidVPlaneRHUnBias, 0);
1194  auto globalResidual = info.vectorToGlobal(localResidual, true);
1195 
1196  if (IsNotYang(sensorID.getLadderNumber(), sensorID.getLayerNumber())) {
1197  m_UBResidualsPXDX_Ying->Fill(globalResidual.x());
1198  m_UBResidualsPXDY_Ying->Fill(globalResidual.y());
1199  m_UBResidualsPXDZ_Ying->Fill(globalResidual.z());
1200  } else {
1201  m_UBResidualsPXDX_Yang->Fill(globalResidual.x());
1202  m_UBResidualsPXDY_Yang->Fill(globalResidual.y());
1203  m_UBResidualsPXDZ_Yang->Fill(globalResidual.z());
1204  }
1205 
1206  posU *= Unit::convertValueToUnit(1.0, "mm");
1207  posV *= Unit::convertValueToUnit(1.0, "mm");
1208 
1209  m_ResMeanPosUVSensCounts[index]->Fill(posU, posV);
1210  m_ResMeanUPosUVSens[index]->Fill(posU, posV, ResidUPlaneRHUnBias);
1211  m_ResMeanVPosUVSens[index]->Fill(posU, posV, ResidVPlaneRHUnBias);
1212  m_ResUPosUSens[index]->Fill(posU, ResidUPlaneRHUnBias);
1213  m_ResUPosVSens[index]->Fill(posV, ResidUPlaneRHUnBias);
1214  m_ResVPosUSens[index]->Fill(posU, ResidVPlaneRHUnBias);
1215  m_ResVPosVSens[index]->Fill(posV, ResidVPlaneRHUnBias);
1216 
1217  m_ResMeanPhiThetaLayerCounts[indexLayer]->Fill(fPosSPU, fPosSPV);
1218  m_ResMeanUPhiThetaLayer[indexLayer]->Fill(fPosSPU, fPosSPV, ResidUPlaneRHUnBias);
1219  m_ResMeanVPhiThetaLayer[indexLayer]->Fill(fPosSPU, fPosSPV, ResidVPlaneRHUnBias);
1220  m_ResUPhiLayer[indexLayer]->Fill(fPosSPU, ResidUPlaneRHUnBias);
1221  m_ResVPhiLayer[indexLayer]->Fill(fPosSPU, ResidVPlaneRHUnBias);
1222  m_ResUThetaLayer[indexLayer]->Fill(fPosSPV, ResidUPlaneRHUnBias);
1223  m_ResVThetaLayer[indexLayer]->Fill(fPosSPV, ResidVPlaneRHUnBias);
1224 
1225  }
1226  if (recoHitInfo->getTrackingDetector() == RecoHitInformation::c_SVD) {
1227  IsSVDU = recoHitInfo->getRelatedTo<SVDCluster>()->isUCluster();
1228  VxdID sensorID = recoHitInfo->getRelatedTo<SVDCluster>()->getSensorID();
1229  auto info = dynamic_cast<const SVD::SensorInfo&>(VXD::GeoCache::get(sensorID));
1230  iLayer = sensorID.getLayerNumber();
1231  if (IsSVDU) {
1232  posU = recoHitInfo->getRelatedTo<SVDCluster>()->getPosition();
1233  B2Vector3D rLocal(posU, 0, 0);
1234  B2Vector3D ral = info.pointToGlobal(rLocal);
1235  fPosSPU = ral.Phi() / TMath::Pi() * 180;
1236  ResidUPlaneRHUnBias = resUnBias.GetMatrixArray()[0] * Unit::convertValueToUnit(1.0, "um");
1237  if (sensorIDPrew != sensorID) { // other sensor, reset
1238  ResidVPlaneRHUnBias = 0;
1239  fPosSPV = 0;
1240  }
1241  sensorIDPrew = sensorID;
1242  } else {
1243  posV = recoHitInfo->getRelatedTo<SVDCluster>()->getPosition();
1244  B2Vector3D rLocal(0, posV, 0);
1245  B2Vector3D ral = info.pointToGlobal(rLocal);
1246  fPosSPV = ral.Theta() / TMath::Pi() * 180;
1247  ResidVPlaneRHUnBias = resUnBias.GetMatrixArray()[0] * Unit::convertValueToUnit(1.0, "um");
1248  if (sensorIDPrew == sensorID) { // evaluate
1249  if (isNotFirstHit && ((iLayer - iLayerPrev) == 1)) {
1250  int index = gTools->getLayerIndex(sensorID.getLayerNumber()) - gTools->getFirstLayer();
1251  m_TRClusterCorrelationsPhi[index]->Fill(fPosSPUPrev, fPosSPU);
1252  m_TRClusterCorrelationsTheta[index]->Fill(fPosSPVPrev, fPosSPV);
1253  } else
1254  isNotFirstHit = true;
1255  iLayerPrev = iLayer;
1256  fPosSPUPrev = fPosSPU;
1257  fPosSPVPrev = fPosSPV;
1258  m_UBResidualsSVD->Fill(ResidUPlaneRHUnBias, ResidVPlaneRHUnBias);
1259  m_UBResidualsSVDU->Fill(ResidUPlaneRHUnBias);
1260  m_UBResidualsSVDV->Fill(ResidVPlaneRHUnBias);
1261  int index = gTools->getSensorIndex(sensorID);
1262  int indexLayer = gTools->getLayerIndex(sensorID.getLayerNumber());
1263  m_UBResidualsSensor[index]->Fill(ResidUPlaneRHUnBias, ResidVPlaneRHUnBias);
1264  m_UBResidualsSensorU[index]->Fill(ResidUPlaneRHUnBias);
1265  m_UBResidualsSensorV[index]->Fill(ResidVPlaneRHUnBias);
1266  m_TRClusterHitmap[indexLayer]->Fill(fPosSPU, fPosSPV);
1267 
1268  // half-shells
1269  TVector3 localResidual(ResidUPlaneRHUnBias, ResidVPlaneRHUnBias, 0);
1270  auto globalResidual = info.vectorToGlobal(localResidual, true);
1271 
1272  if (IsNotMat(sensorID.getLadderNumber(), sensorID.getLayerNumber())) {
1273  m_UBResidualsSVDX_Pat->Fill(globalResidual.x());
1274  m_UBResidualsSVDY_Pat->Fill(globalResidual.y());
1275  m_UBResidualsSVDZ_Pat->Fill(globalResidual.z());
1276  } else {
1277  m_UBResidualsSVDX_Mat->Fill(globalResidual.x());
1278  m_UBResidualsSVDY_Mat->Fill(globalResidual.y());
1279  m_UBResidualsSVDZ_Mat->Fill(globalResidual.z());
1280  }
1281 
1282  posU *= Unit::convertValueToUnit(1.0, "mm");
1283  posV *= Unit::convertValueToUnit(1.0, "mm");
1284 
1285  m_ResMeanPosUVSensCounts[index]->Fill(posU, posV);
1286  m_ResMeanUPosUVSens[index]->Fill(posU, posV, ResidUPlaneRHUnBias);
1287  m_ResMeanVPosUVSens[index]->Fill(posU, posV, ResidVPlaneRHUnBias);
1288  m_ResUPosUSens[index]->Fill(posU, ResidUPlaneRHUnBias);
1289  m_ResUPosVSens[index]->Fill(posV, ResidUPlaneRHUnBias);
1290  m_ResVPosUSens[index]->Fill(posU, ResidVPlaneRHUnBias);
1291  m_ResVPosVSens[index]->Fill(posV, ResidVPlaneRHUnBias);
1292 
1293  m_ResMeanPhiThetaLayerCounts[indexLayer]->Fill(fPosSPU, fPosSPV);
1294  m_ResMeanUPhiThetaLayer[indexLayer]->Fill(fPosSPU, fPosSPV, ResidUPlaneRHUnBias);
1295  m_ResMeanVPhiThetaLayer[indexLayer]->Fill(fPosSPU, fPosSPV, ResidVPlaneRHUnBias);
1296  m_ResUPhiLayer[indexLayer]->Fill(fPosSPU, ResidUPlaneRHUnBias);
1297  m_ResVPhiLayer[indexLayer]->Fill(fPosSPU, ResidVPlaneRHUnBias);
1298  m_ResUThetaLayer[indexLayer]->Fill(fPosSPV, ResidUPlaneRHUnBias);
1299  m_ResVThetaLayer[indexLayer]->Fill(fPosSPV, ResidVPlaneRHUnBias);
1300 
1301  }
1302  if (sensorIDPrew != sensorID) { // other sensor, reset
1303  ResidUPlaneRHUnBias = 0;
1304  fPosSPU = 0;
1305  }
1306  sensorIDPrew = sensorID;
1307  }
1308  }
1309  }
1310  }
1311  if (((nPXD > 0) || (nSVD > 0)) && (nCDC > 0)) iTrackVXDCDC++;
1312  if (((nPXD > 0) || (nSVD > 0)) && (nCDC == 0)) iTrackVXD++;
1313  if (((nPXD == 0) && (nSVD == 0)) && (nCDC > 0)) iTrackCDC++;
1314  if (m_MomX != NULL) m_MomX->Fill(tfr->getMomentum().Px());
1315  if (m_MomY != NULL) m_MomY->Fill(tfr->getMomentum().Py());
1316  if (m_MomZ != NULL) m_MomZ->Fill(tfr->getMomentum().Pz());
1317  if (m_MomPt != NULL) m_MomPt->Fill(tfr->getMomentum().Pt());
1318  if (m_Mom != NULL) m_Mom->Fill(tfr->getMomentum().Mag());
1319  if (m_HitsPXD != NULL) m_HitsPXD->Fill(nPXD);
1320  if (m_HitsSVD != NULL) m_HitsSVD->Fill(nSVD);
1321  if (m_HitsCDC != NULL) m_HitsCDC->Fill(nCDC);
1322  if (m_Hits != NULL) m_Hits->Fill(nPXD + nSVD + nCDC);
1323 
1324  if (m_D0 != NULL) m_D0->Fill(tfr->getD0());
1325  if (m_Z0 != NULL) m_Z0->Fill(tfr->getZ0());
1326  if (m_Phi != NULL) m_Phi->Fill(tfr->getPhi0() * Unit::convertValueToUnit(1.0, "deg"));
1327  if (m_Omega != NULL) m_Omega->Fill(tfr->getOmega());
1328  if (m_TanLambda != NULL) m_TanLambda->Fill(tfr->getTanLambda());
1329 
1330  if (m_PhiD0 != NULL) m_PhiD0->Fill(tfr->getPhi0() * Unit::convertValueToUnit(1.0, "deg"), tfr->getD0());
1331  if (m_PhiZ0 != NULL) m_PhiZ0->Fill(tfr->getPhi0() * Unit::convertValueToUnit(1.0, "deg"), tfr->getZ0());
1332  if (m_PhiMomPt != NULL) m_PhiMomPt->Fill(tfr->getPhi0() * Unit::convertValueToUnit(1.0, "deg"), tfr->getMomentum().Pt());
1333  if (m_PhiOmega != NULL) m_PhiOmega->Fill(tfr->getPhi0() * Unit::convertValueToUnit(1.0, "deg"), tfr->getOmega());
1334  if (m_PhiTanLambda != NULL)
1335  m_PhiTanLambda->Fill(tfr->getPhi0() * Unit::convertValueToUnit(1.0, "deg"), tfr->getTanLambda());
1336 
1337  if (m_D0Z0 != NULL) m_D0Z0->Fill(tfr->getD0(), tfr->getZ0());
1338  if (m_D0MomPt != NULL) m_D0MomPt->Fill(tfr->getD0(), tfr->getMomentum().Pt());
1339  if (m_D0Omega != NULL) m_D0Omega->Fill(tfr->getD0(), tfr->getOmega());
1340  if (m_D0TanLambda != NULL) m_D0TanLambda->Fill(tfr->getD0(), tfr->getTanLambda());
1341  if (m_Z0MomPt != NULL) m_Z0MomPt->Fill(tfr->getZ0(), tfr->getMomentum().Pt());
1342  if (m_Z0Omega != NULL) m_Z0Omega->Fill(tfr->getZ0(), tfr->getOmega());
1343  if (m_Z0TanLambda != NULL) m_Z0TanLambda->Fill(tfr->getZ0(), tfr->getTanLambda());
1344  if (m_MomPtOmega != NULL) m_MomPtOmega->Fill(tfr->getMomentum().Pt(), tfr->getOmega());
1345  if (m_MomPtTanLambda != NULL) m_MomPtTanLambda->Fill(tfr->getMomentum().Pt(), tfr->getTanLambda());
1346  if (m_OmegaTanLambda != NULL) m_OmegaTanLambda->Fill(tfr->getOmega(), tfr->getTanLambda());
1347 
1348 
1349  }
1350  if (m_TracksVXD != NULL) m_TracksVXD->Fill(iTrackVXD);
1351  if (m_TracksCDC != NULL) m_TracksCDC->Fill(iTrackCDC);
1352  if (m_TracksVXDCDC != NULL) m_TracksVXDCDC->Fill(iTrackVXDCDC);
1353  if (m_Tracks != NULL) m_Tracks->Fill(iTrack);
1354 
1355  } catch (...) {
1356  B2DEBUG(70, "Some problem in Alignment DQM module!");
1357  }
1358 }
1359 
1360 bool AlignDQMModule::IsNotYang(int ladderNumber, int layerNumber)
1361 {
1362  switch (layerNumber) {
1363  case 1:
1364  return ladderNumber < 5 || ladderNumber > 8;
1365  case 2:
1366  return ladderNumber < 7 || ladderNumber > 12;
1367  default:
1368  return true;
1369  }
1370 }
1371 
1372 bool AlignDQMModule::IsNotMat(int ladderNumber, int layerNumber)
1373 {
1374  switch (layerNumber) {
1375  case 3:
1376  return ladderNumber < 3 || ladderNumber > 5;
1377  case 4:
1378  return ladderNumber < 4 || ladderNumber > 8;
1379  case 5:
1380  return ladderNumber < 5 || ladderNumber > 10;
1381  case 6:
1382  return ladderNumber < 6 || ladderNumber > 13;
1383  default:
1384  return true;
1385  }
1386 }
1387 
1389 {
1390  auto gTools = VXD::GeoCache::getInstance().getGeoTools();
1392  for (VxdID layer : geo.getLayers()) {
1393  int iLay = gTools->getLayerIndex(layer.getLayerNumber());
1394  m_ResMeanUPhiThetaLayer[iLay]->Divide(m_ResMeanPhiThetaLayerCounts[iLay]);
1395  m_ResMeanVPhiThetaLayer[iLay]->Divide(m_ResMeanPhiThetaLayerCounts[iLay]);
1396  for (int i = 0; i < m_ResUPhiLayer[iLay]->GetNbinsX(); i++) {
1397  float SumResU = 0;
1398  float SumResV = 0;
1399  float CountsU = 0;
1400  float CountsV = 0;
1401  for (int j = 0; j < m_ResUPhiLayer[iLay]->GetNbinsY(); j++) {
1402  SumResU += m_ResUPhiLayer[iLay]->GetBinContent(i + 1, j + 1) * m_ResUPhiLayer[iLay]->GetYaxis()->GetBinCenter(j + 1);
1403  SumResV += m_ResVPhiLayer[iLay]->GetBinContent(i + 1, j + 1) * m_ResVPhiLayer[iLay]->GetYaxis()->GetBinCenter(j + 1);
1404  CountsU += m_ResUPhiLayer[iLay]->GetBinContent(i + 1, j + 1);
1405  CountsV += m_ResVPhiLayer[iLay]->GetBinContent(i + 1, j + 1);
1406  }
1407  float valU = 0;
1408  float valV = 0;
1409  if (CountsU != 0) {
1410  valU = SumResU / CountsU;
1411  }
1412  if (CountsV != 0) {
1413  valV = SumResV / CountsV;
1414  }
1415  m_ResMeanUPhiLayer[iLay]->SetBinContent(i + 1, valU);
1416  m_ResMeanVPhiLayer[iLay]->SetBinContent(i + 1, valV);
1417  }
1418 
1419  for (int i = 0; i < m_ResUThetaLayer[iLay]->GetNbinsX(); i++) {
1420  float SumResU = 0;
1421  float SumResV = 0;
1422  float CountsU = 0;
1423  float CountsV = 0;
1424  for (int j = 0; j < m_ResUThetaLayer[iLay]->GetNbinsY(); j++) {
1425  SumResU += m_ResUThetaLayer[iLay]->GetBinContent(i + 1, j + 1) * m_ResUThetaLayer[iLay]->GetYaxis()->GetBinCenter(j + 1);
1426  SumResV += m_ResVThetaLayer[iLay]->GetBinContent(i + 1, j + 1) * m_ResVThetaLayer[iLay]->GetYaxis()->GetBinCenter(j + 1);
1427  CountsU += m_ResUThetaLayer[iLay]->GetBinContent(i + 1, j + 1);
1428  CountsV += m_ResVThetaLayer[iLay]->GetBinContent(i + 1, j + 1);
1429  }
1430  float valU = 0;
1431  float valV = 0;
1432  if (CountsU != 0) {
1433  valU = SumResU / CountsU;
1434  }
1435  if (CountsV != 0) {
1436  valV = SumResV / CountsV;
1437  }
1438  m_ResMeanUThetaLayer[iLay]->SetBinContent(i + 1, valU);
1439  m_ResMeanVThetaLayer[iLay]->SetBinContent(i + 1, valV);
1440  }
1441  }
1442 
1443  for (int iSen = 0; iSen < gTools->getNumberOfSensors(); iSen++) {
1444  m_ResMeanUPosUVSens[iSen]->Divide(m_ResMeanPosUVSensCounts[iSen]);
1445  m_ResMeanVPosUVSens[iSen]->Divide(m_ResMeanPosUVSensCounts[iSen]);
1446  for (int i = 0; i < m_ResUPosUSens[iSen]->GetNbinsX(); i++) {
1447  float SumResU = 0;
1448  float SumResV = 0;
1449  float CountsU = 0;
1450  float CountsV = 0;
1451  for (int j = 0; j < m_ResUPosUSens[iSen]->GetNbinsY(); j++) {
1452  SumResU += m_ResUPosUSens[iSen]->GetBinContent(i + 1, j + 1) * m_ResUPosUSens[iSen]->GetYaxis()->GetBinCenter(j + 1);
1453  SumResV += m_ResVPosUSens[iSen]->GetBinContent(i + 1, j + 1) * m_ResVPosUSens[iSen]->GetYaxis()->GetBinCenter(j + 1);
1454  CountsU += m_ResUPosUSens[iSen]->GetBinContent(i + 1, j + 1);
1455  CountsV += m_ResVPosUSens[iSen]->GetBinContent(i + 1, j + 1);
1456  }
1457  float valU = 0;
1458  float valV = 0;
1459  if (CountsU != 0) {
1460  valU = SumResU / CountsU;
1461  }
1462  if (CountsV != 0) {
1463  valV = SumResV / CountsV;
1464  }
1465  m_ResMeanUPosUSens[iSen]->SetBinContent(i + 1, valU);
1466  m_ResMeanVPosUSens[iSen]->SetBinContent(i + 1, valV);
1467  }
1468 
1469  for (int i = 0; i < m_ResUPosVSens[iSen]->GetNbinsX(); i++) {
1470  float SumResU = 0;
1471  float SumResV = 0;
1472  float CountsU = 0;
1473  float CountsV = 0;
1474  for (int j = 0; j < m_ResUPosVSens[iSen]->GetNbinsY(); j++) {
1475  SumResU += m_ResUPosVSens[iSen]->GetBinContent(i + 1, j + 1) * m_ResUPosVSens[iSen]->GetYaxis()->GetBinCenter(j + 1);
1476  SumResV += m_ResVPosVSens[iSen]->GetBinContent(i + 1, j + 1) * m_ResVPosVSens[iSen]->GetYaxis()->GetBinCenter(j + 1);
1477  CountsU += m_ResUPosVSens[iSen]->GetBinContent(i + 1, j + 1);
1478  CountsV += m_ResVPosVSens[iSen]->GetBinContent(i + 1, j + 1);
1479  }
1480  float valU = 0;
1481  float valV = 0;
1482  if (CountsU != 0) {
1483  valU = SumResU / CountsU;
1484  }
1485  if (CountsV != 0) {
1486  valV = SumResV / CountsV;
1487  }
1488  m_ResMeanUPosVSens[iSen]->SetBinContent(i + 1, valU);
1489  m_ResMeanVPosVSens[iSen]->SetBinContent(i + 1, valV);
1490  }
1491  }
1492 }
Belle2::RelationVector::size
size_t size() const
Get number of relations.
Definition: RelationVector.h:98
Belle2::AlignDQMModule::IsNotYang
bool IsNotYang(int ladderNumber, int layerNumber)
Returns true if sensor with given ladderNumber and layerNumber isn't in the Yang half-shell,...
Definition: AlignDQMModule.cc:1360
Belle2::VxdID
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:43
Belle2::AlignDQMModule::initialize
void initialize() override final
Module function initialize.
Definition: AlignDQMModule.cc:73
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::AlignDQMModule::defineHisto
void defineHisto() override final
Histogram definitions such as TH1(), TH2(), TNtuple(), TTree()....
Definition: AlignDQMModule.cc:86
Belle2::TrackFitResult::getOmega
double getOmega() const
Getter for omega.
Definition: TrackFitResult.h:194
Belle2::VxdID::getLadderNumber
baseType getLadderNumber() const
Get the ladder id.
Definition: VxdID.h:108
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::B2Vector3< double >
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::B2Vector3::Phi
DataType Phi() const
The azimuth angle.
Definition: B2Vector3.h:150
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::AlignDQMModule::IsNotMat
bool IsNotMat(int ladderNumber, int layerNumber)
Returns true if sensor with given ladderNumber and layerNumber isn't in the Mat half-shell,...
Definition: AlignDQMModule.cc:1372
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
The SVD Cluster class This class stores all information about reconstructed SVD clusters.
Definition: SVDCluster.h:38
Belle2::AlignDQMModule::event
void event() override final
Module function event.
Definition: AlignDQMModule.cc:1055
Belle2::VXD::GeoCache
Class to faciliate easy access to sensor information of the VXD like coordinate transformations or pi...
Definition: GeoCache.h:41
Belle2::AlignDQMModule::beginRun
void beginRun() override final
Module function beginRun.
Definition: AlignDQMModule.cc:965
Belle2::AlignDQMModule::endRun
void endRun() override final
Module function endRun.
Definition: AlignDQMModule.cc:1388
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::getPosition
ExpRunEvt getPosition(const std::vector< Evt > &events, double tEdge)
Get the exp-run-evt number from the event time [hours].
Definition: Splitter.h:344
Belle2::B2Vector3::Theta
DataType Theta() const
The polar angle.
Definition: B2Vector3.h:152
Belle2::AlignDQMModule
DQM of Alignment for off line residuals per sensor, layer, keep also On-Line DQM from tracking: their...
Definition: AlignDQMModule.h:49
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::getD0
double getD0() const
Getter for d0.
Definition: TrackFitResult.h:178