Belle II Software development
DQMHistAnalysisSVDOnMiraBelle.cc
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#include <numeric>
10#include <limits>
11#include <vxd/geometry/GeoCache.h>
12#include <dqm/analysis/modules/DQMHistAnalysisSVDOnMiraBelle.h>
13
14using namespace std;
15using namespace Belle2;
16
17//-----------------------------------------------------------------
18// Register the Module
19//-----------------------------------------------------------------
20REG_MODULE(DQMHistAnalysisSVDOnMiraBelle);
21
22//-----------------------------------------------------------------
23// Implementation
24//-----------------------------------------------------------------
25
28{
29 setDescription("DQM Analysis Module that extracts monitoring variables from SVD DQM histograms and provides input to MiraBelle.");
31 B2DEBUG(20, "DQMHistAnalysisSVDOnMiraBelle: Constructor done.");
32}
33
35
37{
38 gROOT->cd();
39
40 // add MonitoringObject
42
43 // list of canvases to be added to MonitoringObject
44 m_c_avgEfficiency = new TCanvas("svd_avgEfficiency", "matched clusters and found tracks", 0, 0, 800, 600);
45 m_c_avgOffOccupancy = new TCanvas("svd_avgOffOccupancy", "strips", 0, 0, 800, 600);
46 m_c_MPVChargeClusterOnTrack = new TCanvas("svd_MPVChargeClusterOnTrack", "charge from Clusters on Track Charge", 0, 0, 400, 400);
47 m_c_MPVSNRClusterOnTrack = new TCanvas("svd_MPVSNRClusterOnTrack", "SNR from Clusters on Track Charge", 0, 0, 400, 400);
48 m_c_MPVTimeClusterOnTrack = new TCanvas("svd_MPVTimeClusterOnTrack", "time from Clusters on Track Charge", 0, 0, 400, 400);
49 m_c_avgMaxBinClusterOnTrack = new TCanvas("svd_avgMaxBin", "average MaxBin", 0, 0, 800, 600);
50 m_c_MeanSVDEventT0 = new TCanvas("svd_MeanSVDEventT0", "Mean Event T0 from SVD for all samples", 0, 0, 400, 400);
51
52 // add canvases used to create monitoring variables to MonitoringObject
60
62
63 //collect the list of all SVD Modules in the geometry here
64 std::vector<VxdID> sensors = geo.getListOfSensors();
65 for (VxdID& aVxdID : sensors) {
66 VXD::SensorInfoBase info = geo.getSensorInfo(aVxdID);
67 // B2INFO("VXD " << aVxdID);
68 if (info.getType() != VXD::SensorInfoBase::SVD) continue;
69 m_SVDModules.push_back(aVxdID); // reorder, sort would be better
70 }
71 std::sort(m_SVDModules.begin(), m_SVDModules.end()); // back to natural order
72
73 B2DEBUG(20, "DQMHistAnalysisSVDOnMiraBelle: initialized.");
74}
75
77{
78 B2DEBUG(20, "DQMHistAnalysisSVDOnMiraBelle: beginRun called.");
79}
80
82{
83 B2DEBUG(20, "DQMHistAnalysisSVDOnMiraBelle: event called.");
84}
85
87{
88 float nan = numeric_limits<float>::quiet_NaN();
89
90 // offline occupancy - integrated number of ZS5 fired strips
91 TH1F* h_zs5countsU = (TH1F*)findHist("SVDExpReco/SVDDQM_StripCountsU"); // made by SVDDQMExperssRecoModule
92 TH1F* h_zs5countsV = (TH1F*)findHist("SVDExpReco/SVDDQM_StripCountsV");
93 TH1F* h_events = (TH1F*)findHist("SVDExpReco/SVDDQM_nEvents");
94
95 // adding histograms to canvas
96 m_c_avgOffOccupancy->Clear();
97 m_c_avgOffOccupancy->Divide(2, 2);
99 if (h_zs5countsU) h_zs5countsU->Draw("colz");
100 m_c_avgOffOccupancy->cd(2);
101 if (h_zs5countsV) h_zs5countsV->Draw("colz");
102 m_c_avgOffOccupancy->cd(3);
103 if (h_events) h_events->Draw("colz");
104
105 int nE = 0;
106 if (h_events) nE = h_events->GetEntries(); // number of events for all "clusters on track" histograms
107
108 // setting monitoring variables
109 if (h_zs5countsU == NULL || h_zs5countsV == NULL || h_events == NULL) {
110 if (h_zs5countsU == NULL) {
111 B2INFO("Histograms needed for Average Offline Occupancy on U side are not found");
112 }
113 if (h_zs5countsV == NULL) {
114 B2INFO("Histograms needed for Average Offline Occupancy on V side are not found");
115 }
116 } else {
117 // average occupancy for each layer
118 std::vector<float> avgOffOccL3UV = avgOccupancyUV(3, h_zs5countsU, h_zs5countsV, 0, 14, 1, 1, nE);
119
120 std::vector<float> avgOffOccL4UV = avgOccupancyUV(4, h_zs5countsU, h_zs5countsV, 0, 30, 15, 1, nE);
121
122 std::vector<float> avgOffOccL5UV = avgOccupancyUV(5, h_zs5countsU, h_zs5countsV, 0, 48, 45, 1, nE);
123
124 std::vector<float> avgOffOccL6UV = avgOccupancyUV(6, h_zs5countsU, h_zs5countsV, 0, 80, 93, 1, nE);
125
126 // average occupancy for each layer
127 std::vector<float> avgOffGrpId0OccL3UV = avgOccupancyGrpId0UV(3, nE);
128
129 std::vector<float> avgOffGrpId0OccL4UV = avgOccupancyGrpId0UV(4, nE);
130
131 std::vector<float> avgOffGrpId0OccL5UV = avgOccupancyGrpId0UV(5, nE);
132
133 std::vector<float> avgOffGrpId0OccL6UV = avgOccupancyGrpId0UV(6, nE);
134
135 // occupancy averaged over ladders
136 std::vector<float> avgOffOccL3X1UV = avgOccupancyUV(3, h_zs5countsU, h_zs5countsV, 0, 7, 0, 2, nE); // L3.X.1
137
138 std::vector<float> avgOffOccL3X2UV = avgOccupancyUV(3, h_zs5countsU, h_zs5countsV, 0, 7, 1, 2, nE); // L3.X.2
139
140 std::vector<float> avgOffOccL4X1UV = avgOccupancyUV(4, h_zs5countsU, h_zs5countsV, 0, 10, 15, 3, nE); // L4.X.1
141
142 std::vector<float> avgOffOccL4X2UV = avgOccupancyUV(4, h_zs5countsU, h_zs5countsV, 0, 10, 16, 3, nE); // L4.X.2
143
144 std::vector<float> avgOffOccL4X3UV = avgOccupancyUV(4, h_zs5countsU, h_zs5countsV, 0, 10, 17, 3, nE); // L4.X.3
145
146 std::vector<float> avgOffOccL5X1UV = avgOccupancyUV(5, h_zs5countsU, h_zs5countsV, 0, 12, 35, 4, nE); // L5.X.1
147
148 std::vector<float> avgOffOccL5X2UV = avgOccupancyUV(5, h_zs5countsU, h_zs5countsV, 0, 12, 36, 4, nE); // L5.X.2
149
150 std::vector<float> avgOffOccL5X3UV = avgOccupancyUV(5, h_zs5countsU, h_zs5countsV, 0, 12, 37, 4, nE); // L5.X.3
151
152 std::vector<float> avgOffOccL5X4UV = avgOccupancyUV(5, h_zs5countsU, h_zs5countsV, 0, 12, 38, 4, nE); // L5.X.4
153
154 std::vector<float> avgOffOccL6X1UV = avgOccupancyUV(6, h_zs5countsU, h_zs5countsV, 0, 16, 93, 5, nE); // L6.X.1
155
156 std::vector<float> avgOffOccL6X2UV = avgOccupancyUV(6, h_zs5countsU, h_zs5countsV, 0, 16, 94, 5, nE); // L6.X.2
157
158 std::vector<float> avgOffOccL6X3UV = avgOccupancyUV(6, h_zs5countsU, h_zs5countsV, 0, 16, 95, 5, nE); // L6.X.3
159
160 std::vector<float> avgOffOccL6X4UV = avgOccupancyUV(6, h_zs5countsU, h_zs5countsV, 0, 16, 96, 5, nE); // L6.X.4
161
162 std::vector<float> avgOffOccL6X5UV = avgOccupancyUV(6, h_zs5countsU, h_zs5countsV, 0, 16, 97, 5, nE); // L6.X.5
163
164 // average occupancy for high occupancy sensors
165 std::vector<float> avgOffOccL311UV = highOccupancySensor(3, h_zs5countsU, h_zs5countsV, 1, nE); // L3.1.1
166
167 std::vector<float> avgOffOccL312UV = highOccupancySensor(3, h_zs5countsU, h_zs5countsV, 2, nE); // L3.1.2
168
169 std::vector<float> avgOffOccL321UV = highOccupancySensor(3, h_zs5countsU, h_zs5countsV, 3, nE); // L3.2.1
170
171 std::vector<float> avgOffOccL322UV = highOccupancySensor(3, h_zs5countsU, h_zs5countsV, 4, nE); // L3.2.2
172
173 std::vector<float> avgOffOccL461UV = highOccupancySensor(4, h_zs5countsU, h_zs5countsV, 30, nE); // L4.6.1
174
175 std::vector<float> avgOffOccL462UV = highOccupancySensor(4, h_zs5countsU, h_zs5countsV, 31, nE); // L4.6.2
176
177 std::vector<float> avgOffOccL581UV = highOccupancySensor(5, h_zs5countsU, h_zs5countsV, 73, nE); // L5.8.1
178
179 std::vector<float> avgOffOccL582UV = highOccupancySensor(5, h_zs5countsU, h_zs5countsV, 74, nE); // L5.8.2
180
181 std::vector<float> avgOffOccL6101UV = highOccupancySensor(6, h_zs5countsU, h_zs5countsV, 138, nE); // L6.10.1
182
183 std::vector<float> avgOffOccL6102UV = highOccupancySensor(6, h_zs5countsU, h_zs5countsV, 139, nE); // L6.10.2
184
185 m_monObj->setVariable("avgOffOccL3U", avgOffOccL3UV[0]);
186 m_monObj->setVariable("avgOffOccL4U", avgOffOccL4UV[0]);
187 m_monObj->setVariable("avgOffOccL5U", avgOffOccL5UV[0]);
188 m_monObj->setVariable("avgOffOccL6U", avgOffOccL6UV[0]);
189
190 m_monObj->setVariable("avgOffGrpId0OccL3U", avgOffGrpId0OccL3UV[0]);
191 m_monObj->setVariable("avgOffGrpId0OccL4U", avgOffGrpId0OccL4UV[0]);
192 m_monObj->setVariable("avgOffGrpId0OccL5U", avgOffGrpId0OccL5UV[0]);
193 m_monObj->setVariable("avgOffGrpId0OccL6U", avgOffGrpId0OccL6UV[0]);
194
195 m_monObj->setVariable("avgOffOccL3X1U", avgOffOccL3X1UV[0]);
196 m_monObj->setVariable("avgOffOccL3X2U", avgOffOccL3X2UV[0]);
197 m_monObj->setVariable("avgOffOccL4X1U", avgOffOccL4X1UV[0]);
198 m_monObj->setVariable("avgOffOccL4X2U", avgOffOccL4X2UV[0]);
199 m_monObj->setVariable("avgOffOccL4X3U", avgOffOccL4X3UV[0]);
200 m_monObj->setVariable("avgOffOccL5X1U", avgOffOccL5X1UV[0]);
201 m_monObj->setVariable("avgOffOccL5X2U", avgOffOccL5X2UV[0]);
202 m_monObj->setVariable("avgOffOccL5X3U", avgOffOccL5X3UV[0]);
203 m_monObj->setVariable("avgOffOccL5X4U", avgOffOccL5X4UV[0]);
204 m_monObj->setVariable("avgOffOccL6X1U", avgOffOccL6X1UV[0]);
205 m_monObj->setVariable("avgOffOccL6X2U", avgOffOccL6X2UV[0]);
206 m_monObj->setVariable("avgOffOccL6X3U", avgOffOccL6X3UV[0]);
207 m_monObj->setVariable("avgOffOccL6X4U", avgOffOccL6X4UV[0]);
208 m_monObj->setVariable("avgOffOccL6X5U", avgOffOccL6X5UV[0]);
209 m_monObj->setVariable("avgOffOccL311U", avgOffOccL311UV[0]);
210 m_monObj->setVariable("avgOffOccL312U", avgOffOccL312UV[0]);
211 m_monObj->setVariable("avgOffOccL321U", avgOffOccL321UV[0]);
212 m_monObj->setVariable("avgOffOccL322U", avgOffOccL322UV[0]);
213 m_monObj->setVariable("avgOffOccL461U", avgOffOccL461UV[0]);
214 m_monObj->setVariable("avgOffOccL462U", avgOffOccL462UV[0]);
215 m_monObj->setVariable("avgOffOccL581U", avgOffOccL581UV[0]);
216 m_monObj->setVariable("avgOffOccL582U", avgOffOccL582UV[0]);
217 m_monObj->setVariable("avgOffOccL6101U", avgOffOccL6101UV[0]);
218 m_monObj->setVariable("avgOffOccL6102U", avgOffOccL6102UV[0]);
219
220 m_monObj->setVariable("avgOffOccL3V", avgOffOccL3UV[1]);
221 m_monObj->setVariable("avgOffOccL4V", avgOffOccL4UV[1]);
222 m_monObj->setVariable("avgOffOccL5V", avgOffOccL5UV[1]);
223 m_monObj->setVariable("avgOffOccL6V", avgOffOccL6UV[1]);
224
225 m_monObj->setVariable("avgOffGrpId0OccL3V", avgOffGrpId0OccL3UV[1]);
226 m_monObj->setVariable("avgOffGrpId0OccL4V", avgOffGrpId0OccL4UV[1]);
227 m_monObj->setVariable("avgOffGrpId0OccL5V", avgOffGrpId0OccL5UV[1]);
228 m_monObj->setVariable("avgOffGrpId0OccL6V", avgOffGrpId0OccL6UV[1]);
229
230 m_monObj->setVariable("avgOffOccL3X1V", avgOffOccL3X1UV[1]);
231 m_monObj->setVariable("avgOffOccL3X2V", avgOffOccL3X2UV[1]);
232 m_monObj->setVariable("avgOffOccL4X1V", avgOffOccL4X1UV[1]);
233 m_monObj->setVariable("avgOffOccL4X2V", avgOffOccL4X2UV[1]);
234 m_monObj->setVariable("avgOffOccL4X3V", avgOffOccL4X3UV[1]);
235 m_monObj->setVariable("avgOffOccL5X1V", avgOffOccL5X1UV[1]);
236 m_monObj->setVariable("avgOffOccL5X2V", avgOffOccL5X2UV[1]);
237 m_monObj->setVariable("avgOffOccL5X3V", avgOffOccL5X3UV[1]);
238 m_monObj->setVariable("avgOffOccL5X4V", avgOffOccL5X4UV[1]);
239 m_monObj->setVariable("avgOffOccL6X1V", avgOffOccL6X1UV[1]);
240 m_monObj->setVariable("avgOffOccL6X2V", avgOffOccL6X2UV[1]);
241 m_monObj->setVariable("avgOffOccL6X3V", avgOffOccL6X3UV[1]);
242 m_monObj->setVariable("avgOffOccL6X4V", avgOffOccL6X4UV[1]);
243 m_monObj->setVariable("avgOffOccL6X5V", avgOffOccL6X5UV[1]);
244 m_monObj->setVariable("avgOffOccL311V", avgOffOccL311UV[1]);
245 m_monObj->setVariable("avgOffOccL312V", avgOffOccL312UV[1]);
246 m_monObj->setVariable("avgOffOccL321V", avgOffOccL321UV[1]);
247 m_monObj->setVariable("avgOffOccL322V", avgOffOccL322UV[1]);
248 m_monObj->setVariable("avgOffOccL461V", avgOffOccL461UV[1]);
249 m_monObj->setVariable("avgOffOccL462V", avgOffOccL462UV[1]);
250 m_monObj->setVariable("avgOffOccL581V", avgOffOccL581UV[1]);
251 m_monObj->setVariable("avgOffOccL582V", avgOffOccL582UV[1]);
252 m_monObj->setVariable("avgOffOccL6101V", avgOffOccL6101UV[1]);
253 m_monObj->setVariable("avgOffOccL6102V", avgOffOccL6102UV[1]);
254 }
255
256
257 // efficiency of cluster reconstruction for U and V side
258 TH2F* h_found_tracksU = (TH2F*)findHist("SVDEfficiency/TrackHitsU");
259 TH2F* h_matched_clusU = (TH2F*)findHist("SVDEfficiency/MatchedHitsU");
260 TH2F* h_found_tracksV = (TH2F*)findHist("SVDEfficiency/TrackHitsV");
261 TH2F* h_matched_clusV = (TH2F*)findHist("SVDEfficiency/MatchedHitsV");
262
263 m_c_avgEfficiency->Clear();
264 m_c_avgEfficiency->Divide(2, 2);
265 m_c_avgEfficiency->cd(1);
266 if (h_found_tracksU) h_found_tracksU->Draw("colz");
267 m_c_avgEfficiency->cd(2);
268 if (h_found_tracksV) h_found_tracksV->Draw("colz");
269 m_c_avgEfficiency->cd(3);
270 if (h_matched_clusU) h_matched_clusU->Draw("colz");
271 m_c_avgEfficiency->cd(4);
272 if (h_matched_clusV) h_matched_clusV->Draw("colz");
273
274 // setting monitoring variables
275 if (h_matched_clusU == NULL || h_matched_clusV == NULL || h_found_tracksU == NULL) {
276 if (h_matched_clusU == NULL) {
277 B2INFO("Histograms needed for Average Efficiency on U side are not found");
278 }
279 if (h_matched_clusV == NULL) {
280 B2INFO("Histograms needed for Average Efficiency on V side are not found");
281 }
282 } else {
283 // average efficiency in each layer for both side (U, V)
284 std::vector<float> avgEffL3 = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 7, 2, 3);
285
286 std::vector<float> avgEffL4 = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 10, 5, 7);
287
288 std::vector<float> avgEffL5 = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 12, 9, 12);
289
290 std::vector<float> avgEffL6 = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 16, 14, 18);
291
292 // average efficiency for all layers
293 std::vector<float> avgEffL3456 = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 16, 2, 18);
294
295 // average efficiency for mid plane: L3.X.1
296 std::vector<float> avgEffL3X1 = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 7, 2, 2);
297
298 // average efficiency for mid plane: L3.X.2
299 std::vector<float> avgEffL3X2 = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 7, 3, 3);
300
301 // average efficiency for mid plane: L4.X.1
302 std::vector<float> avgEffL4X1 = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 10, 5, 5);
303
304 // average efficiency for mid plane: L4.X.2
305 std::vector<float> avgEffL4X2 = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 10, 6, 6);
306
307 // average efficiency for mid plane: L4.X.3
308 std::vector<float> avgEffL4X3 = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 10, 7, 7);
309
310 // average efficiency for mid plane: L5.X.1
311 std::vector<float> avgEffL5X1 = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 12, 9, 9);
312
313 // average efficiency for mid plane: L5.X.2
314 std::vector<float> avgEffL5X2 = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 12, 10, 10);
315
316 // average efficiency for mid plane: L5.X.3
317 std::vector<float> avgEffL5X3 = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 12, 11, 11);
318
319 // average efficiency for mid plane: L5.X.4
320 std::vector<float> avgEffL5X4 = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 12, 12, 12);
321
322 // average efficiency for mid plane: L6.X.1
323 std::vector<float> avgEffL6X1 = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 16, 14, 14);
324
325 // average efficiency for mid plane: L6.X.2
326 std::vector<float> avgEffL6X2 = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 16, 15, 15);
327
328 // average efficiency for mid plane: L6.X.3
329 std::vector<float> avgEffL6X3 = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 16, 16, 16);
330
331 // average efficiency for mid plane: L6.X.4
332 std::vector<float> avgEffL6X4 = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 16, 17, 17);
333
334 // average efficiency for mid plane: L6.X.5
335 std::vector<float> avgEffL6X5 = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 16, 18, 18);
336
337 // average efficiency for high occupancy sensors
338
339 std::vector<float> avgEffL311UV = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 1, 2,
340 2); // L3.1.1
341
342 std::vector<float> avgEffL312UV = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 1, 3,
343 3); // L3.1.2
344
345 std::vector<float> avgEffL321UV = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 2, 2, 2,
346 2); // L3.2.1
347
348 std::vector<float> avgEffL322UV = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 2, 2, 3,
349 3); // L3.2.2
350
351 std::vector<float> avgEffL461UV = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 6, 6, 5,
352 5); // L4.6.1
353
354 std::vector<float> avgEffL462UV = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 6, 6, 6,
355 6); // L4.6.2
356
357 std::vector<float> avgEffL581UV = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 8, 8, 9,
358 9); // L5.8.1
359
360 std::vector<float> avgEffL582UV = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 8, 8, 10,
361 10); // L5.8.2
362
363 std::vector<float> avgEffL6101UV = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 10, 10, 14,
364 14); // L6.10.1
365
366 std::vector<float> avgEffL6102UV = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 10, 10, 15,
367 15); // L6.10.2
368
369 m_monObj->setVariable("avgEffL3U", avgEffL3[0]);
370 m_monObj->setVariable("avgEffL4U", avgEffL4[0]);
371 m_monObj->setVariable("avgEffL5U", avgEffL5[0]);
372 m_monObj->setVariable("avgEffL6U", avgEffL6[0]);
373 m_monObj->setVariable("avgEffL3456U", avgEffL3456[0]);
374 m_monObj->setVariable("avgEffL3X1U", avgEffL3X1[0]);
375 m_monObj->setVariable("avgEffL3X2U", avgEffL3X2[0]);
376 m_monObj->setVariable("avgEffL4X1U", avgEffL4X1[0]);
377 m_monObj->setVariable("avgEffL4X2U", avgEffL4X2[0]);
378 m_monObj->setVariable("avgEffL4X3U", avgEffL4X3[0]);
379 m_monObj->setVariable("avgEffL5X1U", avgEffL5X1[0]);
380 m_monObj->setVariable("avgEffL5X2U", avgEffL5X2[0]);
381 m_monObj->setVariable("avgEffL5X3U", avgEffL5X3[0]);
382 m_monObj->setVariable("avgEffL5X4U", avgEffL5X4[0]);
383 m_monObj->setVariable("avgEffL6X1U", avgEffL6X1[0]);
384 m_monObj->setVariable("avgEffL6X2U", avgEffL6X2[0]);
385 m_monObj->setVariable("avgEffL6X3U", avgEffL6X3[0]);
386 m_monObj->setVariable("avgEffL6X4U", avgEffL6X4[0]);
387 m_monObj->setVariable("avgEffL6X5U", avgEffL6X5[0]);
388 m_monObj->setVariable("avgEffL311U", avgEffL311UV[0]);
389 m_monObj->setVariable("avgEffL312U", avgEffL312UV[0]);
390 m_monObj->setVariable("avgEffL321U", avgEffL321UV[0]);
391 m_monObj->setVariable("avgEffL322U", avgEffL322UV[0]);
392 m_monObj->setVariable("avgEffL461U", avgEffL461UV[0]);
393 m_monObj->setVariable("avgEffL462U", avgEffL462UV[0]);
394 m_monObj->setVariable("avgEffL581U", avgEffL581UV[0]);
395 m_monObj->setVariable("avgEffL582U", avgEffL582UV[0]);
396 m_monObj->setVariable("avgEffL6101U", avgEffL6101UV[0]);
397 m_monObj->setVariable("avgEffL6102U", avgEffL6102UV[0]);
398
399 m_monObj->setVariable("avgEffL3V", avgEffL3[1]);
400 m_monObj->setVariable("avgEffL4V", avgEffL4[1]);
401 m_monObj->setVariable("avgEffL5V", avgEffL5[1]);
402 m_monObj->setVariable("avgEffL6V", avgEffL6[1]);
403 m_monObj->setVariable("avgEffL3456V", avgEffL3456[1]);
404 m_monObj->setVariable("avgEffL3X1V", avgEffL3X1[1]);
405 m_monObj->setVariable("avgEffL3X2V", avgEffL3X2[1]);
406 m_monObj->setVariable("avgEffL4X1V", avgEffL4X1[1]);
407 m_monObj->setVariable("avgEffL4X2V", avgEffL4X2[1]);
408 m_monObj->setVariable("avgEffL4X3V", avgEffL4X3[1]);
409 m_monObj->setVariable("avgEffL5X1V", avgEffL5X1[1]);
410 m_monObj->setVariable("avgEffL5X2V", avgEffL5X2[1]);
411 m_monObj->setVariable("avgEffL5X3V", avgEffL5X3[1]);
412 m_monObj->setVariable("avgEffL5X4V", avgEffL5X4[1]);
413 m_monObj->setVariable("avgEffL6X1V", avgEffL6X1[1]);
414 m_monObj->setVariable("avgEffL6X2V", avgEffL6X2[1]);
415 m_monObj->setVariable("avgEffL6X3V", avgEffL6X3[1]);
416 m_monObj->setVariable("avgEffL6X4V", avgEffL6X4[1]);
417 m_monObj->setVariable("avgEffL6X5V", avgEffL6X5[1]);
418 m_monObj->setVariable("avgEffL311V", avgEffL311UV[1]);
419 m_monObj->setVariable("avgEffL312V", avgEffL312UV[1]);
420 m_monObj->setVariable("avgEffL321V", avgEffL321UV[1]);
421 m_monObj->setVariable("avgEffL322V", avgEffL322UV[1]);
422 m_monObj->setVariable("avgEffL461V", avgEffL461UV[1]);
423 m_monObj->setVariable("avgEffL462V", avgEffL462UV[1]);
424 m_monObj->setVariable("avgEffL581V", avgEffL581UV[1]);
425 m_monObj->setVariable("avgEffL582V", avgEffL582UV[1]);
426 m_monObj->setVariable("avgEffL6101V", avgEffL6101UV[1]);
427 m_monObj->setVariable("avgEffL6102V", avgEffL6102UV[1]);
428 }
429
430 // MPV cluster charge for clusters on track
431 TH1F* h_clusterCharge_L3U = (TH1F*)findHist("SVDClsTrk/SVDTRK_ClusterChargeU3");
432 TH1F* h_clusterCharge_L3V = (TH1F*)findHist("SVDClsTrk/SVDTRK_ClusterChargeV3");
433 TH1F* h_clusterCharge_L456U = (TH1F*)findHist("SVDClsTrk/SVDTRK_ClusterChargeU456");
434 TH1F* h_clusterCharge_L456V = (TH1F*)findHist("SVDClsTrk/SVDTRK_ClusterChargeV456");
435
437 m_c_MPVChargeClusterOnTrack->Divide(2, 2);
439 if (h_clusterCharge_L3U) h_clusterCharge_L3U->Draw();
441 if (h_clusterCharge_L3V) h_clusterCharge_L3V->Draw();
443 if (h_clusterCharge_L456U) h_clusterCharge_L456U->Draw();
445 if (h_clusterCharge_L456U) h_clusterCharge_L456U->Draw();
446
447 // find abscissa of max Y in histograms
448 float MPVClusterChargeL3U = nan;
449 if (h_clusterCharge_L3U)
450 if (h_clusterCharge_L3U->GetEntries() != 0)
451 MPVClusterChargeL3U = xForMaxY(h_clusterCharge_L3U);
452 float MPVClusterChargeL3V = nan;
453 if (h_clusterCharge_L3V)
454 if (h_clusterCharge_L3V->GetEntries() != 0)
455 MPVClusterChargeL3V = xForMaxY(h_clusterCharge_L3V);
456 float MPVClusterChargeL456U = nan;
457 if (h_clusterCharge_L456U)
458 if (h_clusterCharge_L456U->GetEntries() != 0)
459 MPVClusterChargeL456U = xForMaxY(h_clusterCharge_L456U);
460 float MPVClusterChargeL456V = nan;
461 if (h_clusterCharge_L456V)
462 if (h_clusterCharge_L456V->GetEntries() != 0)
463 MPVClusterChargeL456V = xForMaxY(h_clusterCharge_L456V);
464
465 if (h_clusterCharge_L3U == NULL || h_clusterCharge_L456U == NULL) {
466 B2INFO("Histograms needed for MPV cluster charge on U side are not found");
467 } else {
468 m_monObj->setVariable("MPVClusterChargeL3U", MPVClusterChargeL3U);
469 m_monObj->setVariable("MPVClusterChargeL456U", MPVClusterChargeL456U);
470 }
471
472 if (h_clusterCharge_L3V == NULL || h_clusterCharge_L456V == NULL) {
473 B2INFO("Histograms needed for MPV cluster charge on V side are not found");
474 } else {
475 m_monObj->setVariable("MPVClusterChargeL3V", MPVClusterChargeL3V);
476 m_monObj->setVariable("MPVClusterChargeL456V", MPVClusterChargeL456V);
477 }
478
479
480 // MPV SNR for the clusters on track
481 TH1F* h_clusterSNR_L3U = (TH1F*)findHist("SVDClsTrk/SVDTRK_ClusterSNRU3");
482 TH1F* h_clusterSNR_L3V = (TH1F*)findHist("SVDClsTrk/SVDTRK_ClusterSNRV3");
483 TH1F* h_clusterSNR_L456U = (TH1F*)findHist("SVDClsTrk/SVDTRK_ClusterSNRU456");
484 TH1F* h_clusterSNR_L456V = (TH1F*)findHist("SVDClsTrk/SVDTRK_ClusterSNRV456");
485
487 m_c_MPVSNRClusterOnTrack->Divide(2, 2);
489 if (h_clusterSNR_L3U) h_clusterSNR_L3U->Draw();
491 if (h_clusterSNR_L3V) h_clusterSNR_L3V->Draw();
493 if (h_clusterSNR_L456U) h_clusterSNR_L456U->Draw();
495 if (h_clusterSNR_L456V) h_clusterSNR_L456V->Draw();
496
497 float MPVClusterSNRL3U = nan;
498 if (h_clusterSNR_L3U)
499 if (h_clusterSNR_L3U->GetEntries() != 0)
500 MPVClusterSNRL3U = xForMaxY(h_clusterSNR_L3U);
501 float MPVClusterSNRL3V = nan;
502 if (h_clusterSNR_L3V)
503 if (h_clusterSNR_L3V->GetEntries() != 0)
504 MPVClusterSNRL3V = xForMaxY(h_clusterSNR_L3V);
505 float MPVClusterSNRL456U = nan;
506 if (h_clusterSNR_L456U)
507 if (h_clusterSNR_L456U->GetEntries() != 0)
508 MPVClusterSNRL456U = xForMaxY(h_clusterSNR_L456U);
509 float MPVClusterSNRL456V = nan;
510 if (h_clusterSNR_L456V)
511 if (h_clusterSNR_L456V->GetEntries() != 0)
512 MPVClusterSNRL456V = xForMaxY(h_clusterSNR_L456V);
513
514 if (h_clusterSNR_L3U == NULL || h_clusterSNR_L456U == NULL) {
515 B2INFO("Histograms needed for MPV cluster SNR on U side are not found");
516 } else {
517 m_monObj->setVariable("MPVClusterSNRL3U", MPVClusterSNRL3U);
518 m_monObj->setVariable("MPVClusterSNRL456U", MPVClusterSNRL456U);
519 }
520
521 if (h_clusterSNR_L3V == NULL || h_clusterSNR_L456V == NULL) {
522 B2INFO("Histograms needed for MPV cluster SNR on V side are not found");
523 } else {
524 m_monObj->setVariable("MPVClusterSNRL3V", MPVClusterSNRL3V);
525 m_monObj->setVariable("MPVClusterSNRL456V", MPVClusterSNRL456V);
526 }
527
528
529 // MPV SVD cluster time for the clusters on track
530 TH1F* h_clusterTime_L3U = (TH1F*)findHist("SVDClsTrk/SVDTRK_ClusterTimeU3");
531 TH1F* h_clusterTime_L3V = (TH1F*)findHist("SVDClsTrk/SVDTRK_ClusterTimeV3");
532 TH1F* h_clusterTime_L456U = (TH1F*)findHist("SVDClsTrk/SVDTRK_ClusterTimeU456");
533 TH1F* h_clusterTime_L456V = (TH1F*)findHist("SVDClsTrk/SVDTRK_ClusterTimeV456");
534 TH1F* h_MeanSVD3EventT0 = (TH1F*)findHist("SVDHitTime/SVD3EventT0");
535 TH1F* h_MeanSVD6EventT0 = (TH1F*)findHist("SVDHitTime/SVD6EventT0");
536 TH1F* h_MeanSVDEventT0 = 0x0;
537
538 if (h_MeanSVD3EventT0)
539 h_MeanSVDEventT0 = (TH1F*)h_MeanSVD3EventT0->Clone();
540
542 m_c_MPVTimeClusterOnTrack->Divide(2, 2);
544 if (h_clusterTime_L3U) h_clusterTime_L3U->Draw();
546 if (h_clusterTime_L3V) h_clusterTime_L3V->Draw();
548 if (h_clusterTime_L456U) h_clusterTime_L456U->Draw();
550 if (h_clusterTime_L456V) h_clusterTime_L456V->Draw();
551
552 m_c_MeanSVDEventT0->Clear();
553 m_c_MeanSVDEventT0->Divide(2, 2);
554 m_c_MeanSVDEventT0->cd(1);
555 if (h_MeanSVD3EventT0) h_MeanSVD3EventT0->Draw();
556 m_c_MeanSVDEventT0->cd(2);
557 if (h_MeanSVD6EventT0) h_MeanSVD6EventT0->Draw();
558 m_c_MeanSVDEventT0->cd(3);
559 if (h_MeanSVDEventT0) {
560 if (h_MeanSVD6EventT0)
561 h_MeanSVDEventT0->Add(h_MeanSVD6EventT0);
562 h_MeanSVDEventT0->Draw();
563 }
564
565 float MPVClusterTimeL3U = nan;
566 if (h_clusterTime_L3U)
567 if (h_clusterTime_L3U->GetEntries() != 0)
568 MPVClusterTimeL3U = xForMaxY(h_clusterTime_L3U);
569 float MPVClusterTimeL3V = nan;
570 if (h_clusterTime_L3V)
571 if (h_clusterTime_L3V->GetEntries() != 0)
572 MPVClusterTimeL3V = xForMaxY(h_clusterTime_L3V);
573 float MPVClusterTimeL456U = nan;
574 if (h_clusterTime_L456U)
575 if (h_clusterTime_L456U->GetEntries() != 0)
576 MPVClusterTimeL456U = xForMaxY(h_clusterTime_L456U);
577 float MPVClusterTimeL456V = nan;
578 if (h_clusterTime_L456V)
579 if (h_clusterTime_L456V->GetEntries() != 0)
580 MPVClusterTimeL456V = xForMaxY(h_clusterTime_L456V);
581 float FWHMClusterTimeL3U = nan;
582 if (h_clusterTime_L3U)
583 if (h_clusterTime_L3U->GetEntries() != 0)
584 FWHMClusterTimeL3U = histFWHM(h_clusterTime_L3U);
585 float FWHMClusterTimeL3V = nan;
586 if (h_clusterTime_L3V)
587 if (h_clusterTime_L3V->GetEntries() != 0)
588 FWHMClusterTimeL3V = histFWHM(h_clusterTime_L3V);
589 float FWHMClusterTimeL456U = nan;
590 if (h_clusterTime_L456U)
591 if (h_clusterTime_L456U->GetEntries() != 0)
592 FWHMClusterTimeL456U = histFWHM(h_clusterTime_L456U);
593 float FWHMClusterTimeL456V = nan;
594 if (h_clusterTime_L456V)
595 if (h_clusterTime_L456V->GetEntries() != 0)
596 FWHMClusterTimeL456V = histFWHM(h_clusterTime_L456V);
597
598 float MeanSVD3EventT0 = nan;
599 if (h_MeanSVD3EventT0)
600 if (h_MeanSVD3EventT0->GetEntries() != 0)
601 MeanSVD3EventT0 = xForMaxY(h_MeanSVD3EventT0);
602
603 float MeanSVD6EventT0 = nan;
604 if (h_MeanSVD6EventT0)
605 if (h_MeanSVD6EventT0->GetEntries() != 0)
606 MeanSVD6EventT0 = xForMaxY(h_MeanSVD6EventT0);
607
608 float MeanSVDEventT0 = nan;
609 if (h_MeanSVDEventT0)
610 if (h_MeanSVDEventT0->GetEntries() != 0)
611 MeanSVDEventT0 = xForMaxY(h_MeanSVDEventT0);
612
613 if (h_clusterTime_L3U == NULL || h_clusterTime_L456U == NULL) {
614 B2INFO("Histograms needed for MPV cluster time on U side are not found");
615 } else {
616 m_monObj->setVariable("MPVClusterTimeL3U", MPVClusterTimeL3U);
617 m_monObj->setVariable("MPVClusterTimeL456U", MPVClusterTimeL456U);
618 m_monObj->setVariable("FWHMClusterTimeL3U", FWHMClusterTimeL3U);
619 m_monObj->setVariable("FWHMClusterTimeL456U", FWHMClusterTimeL456U);
620 }
621
622 if (h_clusterTime_L3V == NULL || h_clusterTime_L456V == NULL) {
623 B2INFO("Histograms needed for MPV cluster time on V side are not found");
624 } else {
625 m_monObj->setVariable("MPVClusterTimeL3V", MPVClusterTimeL3V);
626 m_monObj->setVariable("MPVClusterTimeL456V", MPVClusterTimeL456V);
627 m_monObj->setVariable("FWHMClusterTimeL3V", FWHMClusterTimeL3V);
628 m_monObj->setVariable("FWHMClusterTimeL456V", FWHMClusterTimeL456V);
629 }
630
631 if (h_MeanSVD3EventT0 == NULL) {
632 B2INFO("Histograms needed for SVD Event T0 (3 samples) not found");
633 } else {
634 m_monObj->setVariable("MeanSVD3EventT0", MeanSVD3EventT0);
635 }
636
637 if (h_MeanSVD6EventT0 == NULL) {
638 B2INFO("Histograms needed for SVD Event T0 (6 samples) not found");
639 } else {
640 m_monObj->setVariable("MeanSVD6EventT0", MeanSVD6EventT0);
641 }
642
643 if (h_MeanSVDEventT0 == NULL) {
644 B2INFO("Histograms needed for SVD Event T0 (all samples) not found");
645 } else {
646 m_monObj->setVariable("MeanSVDEventT0", MeanSVDEventT0);
647 }
648
649 // average maxBin for clusters on track
650 TH1F* h_maxBinU = (TH1F*)findHist("SVDClsTrk/SVDTRK_StripMaxBinUAll");
651 TH1F* h_maxBinV = (TH1F*)findHist("SVDClsTrk/SVDTRK_StripMaxBinVAll");
652
654 m_c_avgMaxBinClusterOnTrack->Divide(2, 1);
656 if (h_maxBinU) h_maxBinU->Draw();
658 if (h_maxBinV) h_maxBinV->Draw();
659
660 if (h_maxBinU == NULL) {
661 B2INFO("Histogram needed for Average MaxBin on U side is not found");
662 } else {
663 float avgMaxBinU = h_maxBinU->GetMean();
664 m_monObj->setVariable("avgMaxBinU", avgMaxBinU);
665 }
666
667 if (h_maxBinV == NULL) {
668 B2INFO("Histogram needed for Average MaxBin on V side is not found");
669 } else {
670 float avgMaxBinV = h_maxBinV->GetMean();
671 m_monObj->setVariable("avgMaxBinV", avgMaxBinV);
672 }
673
674 std::map<std::pair<int, int>, int> ladderMap = {
675 {{3, 1}, 0}, {{3, 2}, 1},
676 {{4, 1}, 2}, {{4, 2}, 3}, {{4, 3}, 4},
677 {{5, 1}, 5}, {{5, 2}, 6}, {{5, 3}, 7}, {{5, 4}, 8},
678 {{6, 1}, 9}, {{6, 2}, 10}, {{6, 3}, 11}, {{6, 4}, 12}, {{6, 5}, 13}
679 };
680
681
682 for (const auto& it : ladderMap) {
683 std::pair<int, int> p = it.first;
684 int layer = p.first;
685 int sensor = p.second;
686
687 TString name = Form("SVDClsTrk/SVDTRK_ClusterCharge_L%d.x.%d", layer, sensor);
688 TString title = Form("MPVClusterCharge_L%d.x.%d", layer, sensor);
689 TH1F* h_clusterCharge = (TH1F*)findHist(name.Data());
690 float MPVClusterCharge = nan;
691 if (h_clusterCharge)
692 if (h_clusterCharge->GetEntries() != 0)
693 MPVClusterCharge = xForMaxY(h_clusterCharge);
694
695 if (h_clusterCharge == NULL) {
696 B2INFO("Histograms needed for cluster charge not found");
697 } else {
698 m_monObj->setVariable(title.Data(), MPVClusterCharge);
699 }
700
701 name = Form("SVDClsTrk/SVDTRK_ClusterSNR_L%d.x.%d", layer, sensor);
702 title = Form("MPVClusterSNR_L%d.x.%d", layer, sensor);
703 TH1F* h_clusterSNR = (TH1F*)findHist(name.Data());
704 float MPVClusterSNR = nan;
705 if (h_clusterSNR)
706 if (h_clusterSNR->GetEntries() != 0)
707 MPVClusterSNR = xForMaxY(h_clusterSNR);
708
709 if (h_clusterSNR == NULL) {
710 B2INFO("Histograms needed for cluster SNR not found");
711 } else {
712 m_monObj->setVariable(title.Data(), MPVClusterSNR);
713 }
714 }
715
716 for (int ladder = 1; ladder <= 2; ++ladder) {
717 for (int sensor = 1; sensor <= 2; ++sensor) {
718
719 TString name = Form("SVDClsTrk/SVDTRK_ClusterCharge_L3.%d.%d", ladder, sensor);
720 TString title = Form("MPVClusterCharge_L3.%d.%d", ladder, sensor);
721 float MPVClusterCharge = nan;
722 TH1F* h_clusterCharge = (TH1F*)findHist(name.Data());
723 if (h_clusterCharge)
724 if (h_clusterCharge->GetEntries() != 0)
725 MPVClusterCharge = xForMaxY(h_clusterCharge);
726
727 if (h_clusterCharge == NULL) {
728 B2INFO("Histograms needed for cluster charge not found");
729 } else {
730 m_monObj->setVariable(title.Data(), MPVClusterCharge);
731 }
732
733 name = Form("SVDClsTrk/SVDTRK_ClusterSNR_L3.%d.%d", ladder, sensor);
734 title = Form("MPVClusterSNR_L3.%d.%d", ladder, sensor);
735 TH1F* h_clusterSNR = (TH1F*)findHist(name.Data());
736 float MPVClusterSNR = nan;
737 if (h_clusterSNR)
738 if (h_clusterSNR->GetEntries() != 0)
739 MPVClusterSNR = xForMaxY(h_clusterSNR);
740
741 if (h_clusterSNR == NULL) {
742 B2INFO("Histograms needed for cluster SNR not found");
743 } else {
744 m_monObj->setVariable(title.Data(), MPVClusterSNR);
745 }
746 }
747 }
748
749 B2INFO("DQMHistAnalysisSVDGeneral: endRun called");
750}
751
752
754{
755 B2INFO("DQMHistAnalysisSVDOnMiraBelle: terminate called");
756}
757
758
759std::vector<float> DQMHistAnalysisSVDOnMiraBelleModule::highOccupancySensor(int iLayer, TH1F* hU, TH1F* hV, int iBin,
760 int nEvents) const
761{
762 int nStripsV = -1;
763 if (iLayer == 3) {
764 nStripsV = 768;
765 } else if (iLayer >= 4 && iLayer <= 6) {
766 nStripsV = 512;
767 } else {
768 B2DEBUG(20, "Layer out of range [3,6].");
769 }
770 std::vector<float> avgOffOccUV(2, 0.0);
771 avgOffOccUV[0] = 0;
772 if (hU) avgOffOccUV[0] = hU->GetBinContent(iBin) * 1.0 / 768 / nEvents * 100;
773 avgOffOccUV[1] = 0;
774 if (hV) avgOffOccUV[1] = hV->GetBinContent(iBin) * 1.0 / nStripsV / nEvents * 100;
775 return avgOffOccUV;
776}
777
778
779std::vector<float> DQMHistAnalysisSVDOnMiraBelleModule::avgOccupancyUV(int iLayer, TH1F* hU, TH1F* hV, int min, int max, int offset,
780 int step, int nEvents) const
781{
782 int nStripsV = -1;
783 if (iLayer == 3) {
784 nStripsV = 768;
785 } else if (iLayer >= 4 && iLayer <= 6) {
786 nStripsV = 512;
787 } else {
788 B2DEBUG(20, "Layer out of range [3,6].");
789 }
790 std::vector<float> avgOffOccUV(2, 0.0);
791 for (int bin = min; bin < max; bin++) {
792 avgOffOccUV[0] += hU->GetBinContent(offset + step * bin) / 768 * 100;
793 avgOffOccUV[1] += hV->GetBinContent(offset + step * bin) / nStripsV * 100;
794 }
795 avgOffOccUV[0] /= ((max - min) * nEvents);
796 avgOffOccUV[1] /= ((max - min) * nEvents);
797 return avgOffOccUV;
798}
799
800std::vector<float> DQMHistAnalysisSVDOnMiraBelleModule::avgOccupancyGrpId0UV(int iLayer, int nEvents) const
801{
802 int nStripsV = -1;
803 if (iLayer == 3) {
804 nStripsV = 768;
805 } else if (iLayer >= 4 && iLayer <= 6) {
806 nStripsV = 512;
807 } else {
808 B2DEBUG(20, "Layer out of range [3,6].");
809 }
810
811 Int_t nStripsU = 768;
812
813 std::vector<float> avgOffOccU;
814 std::vector<float> avgOffOccV;
815
816 for (unsigned int i = 0; i < m_SVDModules.size(); i++) {
817 int tmp_layer = m_SVDModules[i].getLayerNumber();
818 int tmp_ladder = m_SVDModules[i].getLadderNumber();
819 int tmp_sensor = m_SVDModules[i].getSensorNumber();
820
821 TString tmpnameGrpId0U = Form("SVDExpReco/SVDDQM_%d_%d_%d_StripCountGroupId0U", tmp_layer, tmp_ladder, tmp_sensor);
822 TH1F* htmpU = (TH1F*)findHist(tmpnameGrpId0U.Data());
823 if (htmpU == NULL) {
824 B2INFO("Occupancy U histogram for group Id0 not found");
825 } else {
826 if (tmp_layer == iLayer)
827 avgOffOccU.push_back(htmpU->GetEntries() / nStripsU / nEvents * 100);
828 }
829
830 TString tmpnameGrpId0V = Form("SVDExpReco/SVDDQM_%d_%d_%d_StripCountGroupId0V", tmp_layer, tmp_ladder, tmp_sensor);
831 TH1F* htmpV = (TH1F*)findHist(tmpnameGrpId0V.Data());
832 if (htmpV == NULL) {
833 B2INFO("Occupancy V histogram for group Id0 not found");
834 } else {
835 if (tmp_layer == iLayer)
836 avgOffOccV.push_back(htmpV->GetEntries() / nStripsV / nEvents * 100);
837 }
838 }
839
840 std::vector<float> avgOffOccUV(2, 0.);
841
842 avgOffOccUV[0] = accumulate(avgOffOccU.begin(), avgOffOccU.end(), 0.0);
843 avgOffOccUV[0] /= float(avgOffOccU.size());
844
845 avgOffOccUV[1] = accumulate(avgOffOccV.begin(), avgOffOccV.end(), 0.0);
846 avgOffOccUV[1] /= float(avgOffOccV.size());
847
848 return avgOffOccUV;
849}
850
851std::vector<float> DQMHistAnalysisSVDOnMiraBelleModule::avgEfficiencyUV(TH2F* hMCU, TH2F* hMCV, TH2F* hFTU, TH2F* hFTV, int minX,
852 int maxX, int minY, int maxY) const
853{
854 float nan = numeric_limits<float>::quiet_NaN();
855
856 std::vector<float> avgEffUV(2, 0.0);
857 std::vector<float> sumMatchedClustersUV(2, 0.0);
858 std::vector<float> sumFoundTracksUV(2, 0.0);
859 for (int binX = minX; binX < maxX + 1; binX++) {
860 for (int binY = minY; binY < maxY + 1; binY++) {
861 int binXY = hMCV->GetBin(binX, binY);
862 sumMatchedClustersUV[0] += hMCU->GetBinContent(binXY);
863 sumMatchedClustersUV[1] += hMCV->GetBinContent(binXY);
864 sumFoundTracksUV[0] += hFTU->GetBinContent(binXY);
865 sumFoundTracksUV[1] += hFTV->GetBinContent(binXY);
866 }
867 }
868 if (sumFoundTracksUV[0] > 0) {
869 avgEffUV[0] = sumMatchedClustersUV[0] / sumFoundTracksUV[0] * 100;
870 } else {
871 avgEffUV[0] = nan;
872 }
873 if (sumFoundTracksUV[1] > 0) {
874 avgEffUV[1] = sumMatchedClustersUV[1] / sumFoundTracksUV[1] * 100;
875 } else {
876 avgEffUV[1] = nan;
877 }
878 return avgEffUV;
879}
880
882{
883 int maxY = h->GetMaximumBin();
884 float xMaxY = h->GetXaxis()->GetBinCenter(maxY);
885 return xMaxY;
886}
887
889{
890 int bin1 = h->FindFirstBinAbove(h->GetMaximum() / 2);
891 int bin2 = h->FindLastBinAbove(h->GetMaximum() / 2);
892 float fwhm = h->GetBinCenter(bin2) - h->GetBinCenter(bin1);
893 return fwhm;
894}
The base class for the histogram analysis module.
static MonitoringObject * getMonitoringObject(const std::string &name)
Get MonitoringObject with given name (new object is created if non-existing)
static TH1 * findHist(const std::string &histname, bool onlyIfUpdated=false)
Get histogram from list (no other search).
void initialize() override final
Module function initialize.
float histFWHM(TH1F *h) const
Calculate full width at half maximum of histogram.
TCanvas * m_c_MPVTimeClusterOnTrack
time for clusters on track
std::vector< VxdID > m_SVDModules
IDs of all SVD Modules to iterate over.
std::vector< float > avgEfficiencyUV(TH2F *hMCU, TH2F *hMCV, TH2F *hFTU, TH2F *hFTV, int minX, int maxX, int minY, int maxY) const
Calculate avg efficiency for specified sensors.
std::vector< float > avgOccupancyUV(int iLayer, TH1F *hU, TH1F *hV, int min, int max, int offset, int step, int nEvents) const
Calculate avg offline occupancy for specified sensors.
TCanvas * m_c_MPVChargeClusterOnTrack
charge for clusters on track
MonitoringObject * m_monObj
Monitoring Object to be produced by this module, which contain defined canvases and monitoring variab...
TCanvas * m_c_avgEfficiency
List of canvases to be added to MonitoringObject.
void terminate() override final
Module function terminate.
void event() override final
Module function event.
TCanvas * m_c_MPVSNRClusterOnTrack
SNR for clusters on track.
void endRun() override final
Module function endRun.
std::vector< float > avgOccupancyGrpId0UV(int iLayer, int nEvents) const
Calculate avg offline occupancy for specified layer for time group id = 0.
float xForMaxY(TH1F *h) const
Calculate abscissa of max Y bin.
TCanvas * m_c_avgOffOccupancy
number of ZS5 fired strips
void beginRun() override final
Module function beginRun.
TCanvas * m_c_avgMaxBinClusterOnTrack
average number of the APV sample which corresponds to the maximum amplitude for clusters on track
std::vector< float > highOccupancySensor(int iLayer, TH1F *hU, TH1F *hV, int iBin, int nEvents) const
Calculate avg offline occupancy for one specific sensor, especially with high occupancy.
void setDescription(const std::string &description)
Sets the description of the module.
Definition: Module.cc:214
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
Definition: Module.cc:208
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
Definition: Module.h:80
void setVariable(const std::string &var, float val, float upErr=-1., float dwErr=-1)
set value to float variable (new variable is made if not yet existing)
void addCanvas(TCanvas *canv)
Add Canvas to monitoring object.
Class to faciliate easy access to sensor information of the VXD like coordinate transformations or pi...
Definition: GeoCache.h:39
const std::vector< VxdID > getListOfSensors() const
Get list of all sensors.
Definition: GeoCache.cc:59
const SensorInfoBase & getSensorInfo(Belle2::VxdID id) const
Return a referecne to the SensorInfo of a given SensorID.
Definition: GeoCache.cc:67
static GeoCache & getInstance()
Return a reference to the singleton instance.
Definition: GeoCache.cc:214
Base class to provide Sensor Information for PXD and SVD.
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:33
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:650
Abstract base class for different kinds of events.
STL namespace.