Belle II Software  release-08-01-10
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 <dqm/analysis/modules/DQMHistAnalysisSVDOnMiraBelle.h>
10 
11 using namespace std;
12 using namespace Belle2;
13 
14 //-----------------------------------------------------------------
15 // Register the Module
16 //-----------------------------------------------------------------
17 REG_MODULE(DQMHistAnalysisSVDOnMiraBelle);
18 
19 //-----------------------------------------------------------------
20 // Implementation
21 //-----------------------------------------------------------------
22 
23 DQMHistAnalysisSVDOnMiraBelleModule::DQMHistAnalysisSVDOnMiraBelleModule()
25 {
26  setDescription("DQM Analysis Module that extracts monitoring variables from SVD DQM histograms and provides input to MiraBelle.");
28  B2DEBUG(20, "DQMHistAnalysisSVDOnMiraBelle: Constructor done.");
29 }
30 
32 
34 {
35  gROOT->cd();
36 
37  // add MonitoringObject
39 
40  // list of canvases to be added to MonitoringObject
41  m_c_avgEfficiency = new TCanvas("svd_avgEfficiency", "matched clusters and found tracks", 0, 0, 800, 600);
42  m_c_avgOffOccupancy = new TCanvas("svd_avgOffOccupancy", "strips", 0, 0, 800, 600);
43  m_c_MPVChargeClusterOnTrack = new TCanvas("svd_MPVChargeClusterOnTrack", "charge from Clusters on Track Charge", 0, 0, 400, 400);
44  m_c_MPVSNRClusterOnTrack = new TCanvas("svd_MPVSNRClusterOnTrack", "SNR from Clusters on Track Charge", 0, 0, 400, 400);
45  m_c_MPVTimeClusterOnTrack = new TCanvas("svd_MPVTimeClusterOnTrack", "time from Clusters on Track Charge", 0, 0, 400, 400);
46  m_c_avgMaxBinClusterOnTrack = new TCanvas("svd_avgMaxBin", "average MaxBin", 0, 0, 800, 600);
47  m_c_MeanSVDEventT0 = new TCanvas("svd_MeanSVDEventT0", "Mean Event T0 from SVD for all samples", 0, 0, 400, 400);
48 
49  // add canvases used to create monitoring variables to MonitoringObject
57 
58  B2DEBUG(20, "DQMHistAnalysisSVDOnMiraBelle: initialized.");
59 }
60 
62 {
63  B2DEBUG(20, "DQMHistAnalysisSVDOnMiraBelle: beginRun called.");
64 }
65 
67 {
68  B2DEBUG(20, "DQMHistAnalysisSVDOnMiraBelle: event called.");
69 }
70 
72 {
73  // offline occupancy - integrated number of ZS5 fired strips
74  TH1F* h_zs5countsU = (TH1F*)findHist("SVDExpReco/SVDDQM_StripCountsU"); // made by SVDDQMExperssRecoModule
75  TH1F* h_zs5countsV = (TH1F*)findHist("SVDExpReco/SVDDQM_StripCountsV");
76  TH1F* h_events = (TH1F*)findHist("SVDExpReco/SVDDQM_nEvents");
77 
78  // adding histograms to canvas
79  m_c_avgOffOccupancy->Clear();
80  m_c_avgOffOccupancy->Divide(2, 2);
81  m_c_avgOffOccupancy->cd(1);
82  if (h_zs5countsU) h_zs5countsU->Draw("colz");
83  m_c_avgOffOccupancy->cd(2);
84  if (h_zs5countsV) h_zs5countsV->Draw("colz");
85  m_c_avgOffOccupancy->cd(3);
86  if (h_events) h_events->Draw("colz");
87 
88  int nE = 0;
89  if (h_events) nE = h_events->GetEntries(); // number of events for all "clusters on track" histograms
90 
91  // setting monitoring variables
92  if (h_zs5countsU == NULL || h_zs5countsV == NULL || h_events == NULL) {
93  if (h_zs5countsU == NULL) {
94  B2INFO("Histograms needed for Average Offline Occupancy on U side are not found");
95  }
96  if (h_zs5countsV == NULL) {
97  B2INFO("Histograms needed for Average Offline Occupancy on V side are not found");
98  }
99  } else {
100  // average occupancy for each layer
101  std::vector<float> avgOffOccL3UV = avgOccupancyUV(3, h_zs5countsU, h_zs5countsV, 0, 14, 1, 1, nE);
102 
103  std::vector<float> avgOffOccL4UV = avgOccupancyUV(4, h_zs5countsU, h_zs5countsV, 0, 30, 15, 1, nE);
104 
105  std::vector<float> avgOffOccL5UV = avgOccupancyUV(5, h_zs5countsU, h_zs5countsV, 0, 48, 45, 1, nE);
106 
107  std::vector<float> avgOffOccL6UV = avgOccupancyUV(6, h_zs5countsU, h_zs5countsV, 0, 80, 93, 1, nE);
108 
109  // occupancy averaged over ladders
110  std::vector<float> avgOffOccL3X1UV = avgOccupancyUV(3, h_zs5countsU, h_zs5countsV, 0, 7, 0, 2, nE); // L3.X.1
111 
112  std::vector<float> avgOffOccL3X2UV = avgOccupancyUV(3, h_zs5countsU, h_zs5countsV, 0, 7, 1, 2, nE); // L3.X.2
113 
114  std::vector<float> avgOffOccL4X1UV = avgOccupancyUV(4, h_zs5countsU, h_zs5countsV, 0, 10, 15, 3, nE); // L4.X.1
115 
116  std::vector<float> avgOffOccL4X2UV = avgOccupancyUV(4, h_zs5countsU, h_zs5countsV, 0, 10, 16, 3, nE); // L4.X.2
117 
118  std::vector<float> avgOffOccL4X3UV = avgOccupancyUV(4, h_zs5countsU, h_zs5countsV, 0, 10, 17, 3, nE); // L4.X.3
119 
120  std::vector<float> avgOffOccL5X1UV = avgOccupancyUV(5, h_zs5countsU, h_zs5countsV, 0, 12, 35, 4, nE); // L5.X.1
121 
122  std::vector<float> avgOffOccL5X2UV = avgOccupancyUV(5, h_zs5countsU, h_zs5countsV, 0, 12, 36, 4, nE); // L5.X.2
123 
124  std::vector<float> avgOffOccL5X3UV = avgOccupancyUV(5, h_zs5countsU, h_zs5countsV, 0, 12, 37, 4, nE); // L5.X.3
125 
126  std::vector<float> avgOffOccL5X4UV = avgOccupancyUV(5, h_zs5countsU, h_zs5countsV, 0, 12, 38, 4, nE); // L5.X.4
127 
128  std::vector<float> avgOffOccL6X1UV = avgOccupancyUV(6, h_zs5countsU, h_zs5countsV, 0, 16, 93, 5, nE); // L6.X.1
129 
130  std::vector<float> avgOffOccL6X2UV = avgOccupancyUV(6, h_zs5countsU, h_zs5countsV, 0, 16, 94, 5, nE); // L6.X.2
131 
132  std::vector<float> avgOffOccL6X3UV = avgOccupancyUV(6, h_zs5countsU, h_zs5countsV, 0, 16, 95, 5, nE); // L6.X.3
133 
134  std::vector<float> avgOffOccL6X4UV = avgOccupancyUV(6, h_zs5countsU, h_zs5countsV, 0, 16, 96, 5, nE); // L6.X.4
135 
136  std::vector<float> avgOffOccL6X5UV = avgOccupancyUV(6, h_zs5countsU, h_zs5countsV, 0, 16, 97, 5, nE); // L6.X.5
137 
138  // average occupancy for high occupancy sensors
139  std::vector<float> avgOffOccL311UV = highOccupancySensor(3, h_zs5countsU, h_zs5countsV, 1, nE); // L3.1.1
140 
141  std::vector<float> avgOffOccL312UV = highOccupancySensor(3, h_zs5countsU, h_zs5countsV, 2, nE); // L3.1.2
142 
143  std::vector<float> avgOffOccL321UV = highOccupancySensor(3, h_zs5countsU, h_zs5countsV, 3, nE); // L3.2.1
144 
145  std::vector<float> avgOffOccL322UV = highOccupancySensor(3, h_zs5countsU, h_zs5countsV, 4, nE); // L3.2.2
146 
147  std::vector<float> avgOffOccL461UV = highOccupancySensor(4, h_zs5countsU, h_zs5countsV, 30, nE); // L4.6.1
148 
149  std::vector<float> avgOffOccL462UV = highOccupancySensor(4, h_zs5countsU, h_zs5countsV, 31, nE); // L4.6.2
150 
151  std::vector<float> avgOffOccL581UV = highOccupancySensor(5, h_zs5countsU, h_zs5countsV, 73, nE); // L5.8.1
152 
153  std::vector<float> avgOffOccL582UV = highOccupancySensor(5, h_zs5countsU, h_zs5countsV, 74, nE); // L5.8.2
154 
155  std::vector<float> avgOffOccL6101UV = highOccupancySensor(6, h_zs5countsU, h_zs5countsV, 138, nE); // L6.10.1
156 
157  std::vector<float> avgOffOccL6102UV = highOccupancySensor(6, h_zs5countsU, h_zs5countsV, 139, nE); // L6.10.2
158 
159  m_monObj->setVariable("avgOffOccL3U", avgOffOccL3UV[0]);
160  m_monObj->setVariable("avgOffOccL4U", avgOffOccL4UV[0]);
161  m_monObj->setVariable("avgOffOccL5U", avgOffOccL5UV[0]);
162  m_monObj->setVariable("avgOffOccL6U", avgOffOccL6UV[0]);
163  m_monObj->setVariable("avgOffOccL3X1U", avgOffOccL3X1UV[0]);
164  m_monObj->setVariable("avgOffOccL3X2U", avgOffOccL3X2UV[0]);
165  m_monObj->setVariable("avgOffOccL4X1U", avgOffOccL4X1UV[0]);
166  m_monObj->setVariable("avgOffOccL4X2U", avgOffOccL4X2UV[0]);
167  m_monObj->setVariable("avgOffOccL4X3U", avgOffOccL4X3UV[0]);
168  m_monObj->setVariable("avgOffOccL5X1U", avgOffOccL5X1UV[0]);
169  m_monObj->setVariable("avgOffOccL5X2U", avgOffOccL5X2UV[0]);
170  m_monObj->setVariable("avgOffOccL5X3U", avgOffOccL5X3UV[0]);
171  m_monObj->setVariable("avgOffOccL5X4U", avgOffOccL5X4UV[0]);
172  m_monObj->setVariable("avgOffOccL6X1U", avgOffOccL6X1UV[0]);
173  m_monObj->setVariable("avgOffOccL6X2U", avgOffOccL6X2UV[0]);
174  m_monObj->setVariable("avgOffOccL6X3U", avgOffOccL6X3UV[0]);
175  m_monObj->setVariable("avgOffOccL6X4U", avgOffOccL6X4UV[0]);
176  m_monObj->setVariable("avgOffOccL6X5U", avgOffOccL6X5UV[0]);
177  m_monObj->setVariable("avgOffOccL311U", avgOffOccL311UV[0]);
178  m_monObj->setVariable("avgOffOccL312U", avgOffOccL312UV[0]);
179  m_monObj->setVariable("avgOffOccL321U", avgOffOccL321UV[0]);
180  m_monObj->setVariable("avgOffOccL322U", avgOffOccL322UV[0]);
181  m_monObj->setVariable("avgOffOccL461U", avgOffOccL461UV[0]);
182  m_monObj->setVariable("avgOffOccL462U", avgOffOccL462UV[0]);
183  m_monObj->setVariable("avgOffOccL581U", avgOffOccL581UV[0]);
184  m_monObj->setVariable("avgOffOccL582U", avgOffOccL582UV[0]);
185  m_monObj->setVariable("avgOffOccL6101U", avgOffOccL6101UV[0]);
186  m_monObj->setVariable("avgOffOccL6102U", avgOffOccL6102UV[0]);
187 
188  m_monObj->setVariable("avgOffOccL3V", avgOffOccL3UV[1]);
189  m_monObj->setVariable("avgOffOccL4V", avgOffOccL4UV[1]);
190  m_monObj->setVariable("avgOffOccL5V", avgOffOccL5UV[1]);
191  m_monObj->setVariable("avgOffOccL6V", avgOffOccL6UV[1]);
192  m_monObj->setVariable("avgOffOccL3X1V", avgOffOccL3X1UV[1]);
193  m_monObj->setVariable("avgOffOccL3X2V", avgOffOccL3X2UV[1]);
194  m_monObj->setVariable("avgOffOccL4X1V", avgOffOccL4X1UV[1]);
195  m_monObj->setVariable("avgOffOccL4X2V", avgOffOccL4X2UV[1]);
196  m_monObj->setVariable("avgOffOccL4X3V", avgOffOccL4X3UV[1]);
197  m_monObj->setVariable("avgOffOccL5X1V", avgOffOccL5X1UV[1]);
198  m_monObj->setVariable("avgOffOccL5X2V", avgOffOccL5X2UV[1]);
199  m_monObj->setVariable("avgOffOccL5X3V", avgOffOccL5X3UV[1]);
200  m_monObj->setVariable("avgOffOccL5X4V", avgOffOccL5X4UV[1]);
201  m_monObj->setVariable("avgOffOccL6X1V", avgOffOccL6X1UV[1]);
202  m_monObj->setVariable("avgOffOccL6X2V", avgOffOccL6X2UV[1]);
203  m_monObj->setVariable("avgOffOccL6X3V", avgOffOccL6X3UV[1]);
204  m_monObj->setVariable("avgOffOccL6X4V", avgOffOccL6X4UV[1]);
205  m_monObj->setVariable("avgOffOccL6X5V", avgOffOccL6X5UV[1]);
206  m_monObj->setVariable("avgOffOccL311V", avgOffOccL311UV[1]);
207  m_monObj->setVariable("avgOffOccL312V", avgOffOccL312UV[1]);
208  m_monObj->setVariable("avgOffOccL321V", avgOffOccL321UV[1]);
209  m_monObj->setVariable("avgOffOccL322V", avgOffOccL322UV[1]);
210  m_monObj->setVariable("avgOffOccL461V", avgOffOccL461UV[1]);
211  m_monObj->setVariable("avgOffOccL462V", avgOffOccL462UV[1]);
212  m_monObj->setVariable("avgOffOccL581V", avgOffOccL581UV[1]);
213  m_monObj->setVariable("avgOffOccL582V", avgOffOccL582UV[1]);
214  m_monObj->setVariable("avgOffOccL6101V", avgOffOccL6101UV[1]);
215  m_monObj->setVariable("avgOffOccL6102V", avgOffOccL6102UV[1]);
216  }
217 
218 
219  // efficiency of cluster recontruction for U and V side
220  TH2F* h_found_tracksU = (TH2F*)findHist("SVDEfficiency/TrackHitsU");
221  TH2F* h_matched_clusU = (TH2F*)findHist("SVDEfficiency/MatchedHitsU");
222  TH2F* h_found_tracksV = (TH2F*)findHist("SVDEfficiency/TrackHitsV");
223  TH2F* h_matched_clusV = (TH2F*)findHist("SVDEfficiency/MatchedHitsV");
224 
225  m_c_avgEfficiency->Clear();
226  m_c_avgEfficiency->Divide(2, 2);
227  m_c_avgEfficiency->cd(1);
228  if (h_found_tracksU) h_found_tracksU->Draw("colz");
229  m_c_avgEfficiency->cd(2);
230  if (h_found_tracksV) h_found_tracksV->Draw("colz");
231  m_c_avgEfficiency->cd(3);
232  if (h_matched_clusU) h_matched_clusU->Draw("colz");
233  m_c_avgEfficiency->cd(4);
234  if (h_matched_clusV) h_matched_clusV->Draw("colz");
235 
236  // setting monitoring variables
237  if (h_matched_clusU == NULL || h_matched_clusV == NULL || h_found_tracksU == NULL) {
238  if (h_matched_clusU == NULL) {
239  B2INFO("Histograms needed for Average Efficiency on U side are not found");
240  }
241  if (h_matched_clusV == NULL) {
242  B2INFO("Histograms needed for Average Efficiency on V side are not found");
243  }
244  } else {
245  // average efficiency in each layer for both side (U, V)
246  std::vector<float> avgEffL3 = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 7, 2, 3);
247 
248  std::vector<float> avgEffL4 = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 10, 5, 7);
249 
250  std::vector<float> avgEffL5 = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 12, 9, 12);
251 
252  std::vector<float> avgEffL6 = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 16, 14, 18);
253 
254  // average efficiency for all layers
255  std::vector<float> avgEffL3456 = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 16, 2, 18);
256 
257  // average efficiency for mid plane: L3.X.1
258  std::vector<float> avgEffL3X1 = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 7, 2, 2);
259 
260  // average efficiency for mid plane: L3.X.2
261  std::vector<float> avgEffL3X2 = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 7, 3, 3);
262 
263  // average efficiency for mid plane: L4.X.1
264  std::vector<float> avgEffL4X1 = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 10, 5, 5);
265 
266  // average efficiency for mid plane: L4.X.2
267  std::vector<float> avgEffL4X2 = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 10, 6, 6);
268 
269  // average efficiency for mid plane: L4.X.3
270  std::vector<float> avgEffL4X3 = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 10, 7, 7);
271 
272  // average efficiency for mid plane: L5.X.1
273  std::vector<float> avgEffL5X1 = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 12, 9, 9);
274 
275  // average efficiency for mid plane: L5.X.2
276  std::vector<float> avgEffL5X2 = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 12, 10, 10);
277 
278  // average efficiency for mid plane: L5.X.3
279  std::vector<float> avgEffL5X3 = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 12, 11, 11);
280 
281  // average efficiency for mid plane: L5.X.4
282  std::vector<float> avgEffL5X4 = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 12, 12, 12);
283 
284  // average efficiency for mid plane: L6.X.1
285  std::vector<float> avgEffL6X1 = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 16, 14, 14);
286 
287  // average efficiency for mid plane: L6.X.2
288  std::vector<float> avgEffL6X2 = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 16, 15, 15);
289 
290  // average efficiency for mid plane: L6.X.3
291  std::vector<float> avgEffL6X3 = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 16, 16, 16);
292 
293  // average efficiency for mid plane: L6.X.4
294  std::vector<float> avgEffL6X4 = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 16, 17, 17);
295 
296  // average efficiency for mid plane: L6.X.5
297  std::vector<float> avgEffL6X5 = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 16, 18, 18);
298 
299  // average efficiency for high occupancy sensors
300 
301  std::vector<float> avgEffL311UV = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 1, 2,
302  2); // L3.1.1
303 
304  std::vector<float> avgEffL312UV = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 1, 3,
305  3); // L3.1.2
306 
307  std::vector<float> avgEffL321UV = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 2, 2, 2,
308  2); // L3.2.1
309 
310  std::vector<float> avgEffL322UV = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 2, 2, 3,
311  3); // L3.2.2
312 
313  std::vector<float> avgEffL461UV = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 6, 6, 5,
314  5); // L4.6.1
315 
316  std::vector<float> avgEffL462UV = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 6, 6, 6,
317  6); // L4.6.2
318 
319  std::vector<float> avgEffL581UV = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 8, 8, 9,
320  9); // L5.8.1
321 
322  std::vector<float> avgEffL582UV = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 8, 8, 10,
323  10); // L5.8.2
324 
325  std::vector<float> avgEffL6101UV = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 10, 10, 14,
326  14); // L6.10.1
327 
328  std::vector<float> avgEffL6102UV = avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 10, 10, 15,
329  15); // L6.10.2
330 
331  m_monObj->setVariable("avgEffL3U", avgEffL3[0]);
332  m_monObj->setVariable("avgEffL4U", avgEffL4[0]);
333  m_monObj->setVariable("avgEffL5U", avgEffL5[0]);
334  m_monObj->setVariable("avgEffL6U", avgEffL6[0]);
335  m_monObj->setVariable("avgEffL3456U", avgEffL3456[0]);
336  m_monObj->setVariable("avgEffL3X1U", avgEffL3X1[0]);
337  m_monObj->setVariable("avgEffL3X2U", avgEffL3X2[0]);
338  m_monObj->setVariable("avgEffL4X1U", avgEffL4X1[0]);
339  m_monObj->setVariable("avgEffL4X2U", avgEffL4X2[0]);
340  m_monObj->setVariable("avgEffL4X3U", avgEffL4X3[0]);
341  m_monObj->setVariable("avgEffL5X1U", avgEffL5X1[0]);
342  m_monObj->setVariable("avgEffL5X2U", avgEffL5X2[0]);
343  m_monObj->setVariable("avgEffL5X3U", avgEffL5X3[0]);
344  m_monObj->setVariable("avgEffL5X4U", avgEffL5X4[0]);
345  m_monObj->setVariable("avgEffL6X1U", avgEffL6X1[0]);
346  m_monObj->setVariable("avgEffL6X2U", avgEffL6X2[0]);
347  m_monObj->setVariable("avgEffL6X3U", avgEffL6X3[0]);
348  m_monObj->setVariable("avgEffL6X4U", avgEffL6X4[0]);
349  m_monObj->setVariable("avgEffL6X5U", avgEffL6X5[0]);
350  m_monObj->setVariable("avgEffL311U", avgEffL311UV[0]);
351  m_monObj->setVariable("avgEffL312U", avgEffL312UV[0]);
352  m_monObj->setVariable("avgEffL321U", avgEffL321UV[0]);
353  m_monObj->setVariable("avgEffL322U", avgEffL322UV[0]);
354  m_monObj->setVariable("avgEffL461U", avgEffL461UV[0]);
355  m_monObj->setVariable("avgEffL462U", avgEffL462UV[0]);
356  m_monObj->setVariable("avgEffL581U", avgEffL581UV[0]);
357  m_monObj->setVariable("avgEffL582U", avgEffL582UV[0]);
358  m_monObj->setVariable("avgEffL6101U", avgEffL6101UV[0]);
359  m_monObj->setVariable("avgEffL6102U", avgEffL6102UV[0]);
360 
361  m_monObj->setVariable("avgEffL3V", avgEffL3[1]);
362  m_monObj->setVariable("avgEffL4V", avgEffL4[1]);
363  m_monObj->setVariable("avgEffL5V", avgEffL5[1]);
364  m_monObj->setVariable("avgEffL6V", avgEffL6[1]);
365  m_monObj->setVariable("avgEffL3456V", avgEffL3456[1]);
366  m_monObj->setVariable("avgEffL3X1V", avgEffL3X1[1]);
367  m_monObj->setVariable("avgEffL3X2V", avgEffL3X2[1]);
368  m_monObj->setVariable("avgEffL4X1V", avgEffL4X1[1]);
369  m_monObj->setVariable("avgEffL4X2V", avgEffL4X2[1]);
370  m_monObj->setVariable("avgEffL4X3V", avgEffL4X3[1]);
371  m_monObj->setVariable("avgEffL5X1V", avgEffL5X1[1]);
372  m_monObj->setVariable("avgEffL5X2V", avgEffL5X2[1]);
373  m_monObj->setVariable("avgEffL5X3V", avgEffL5X3[1]);
374  m_monObj->setVariable("avgEffL5X4V", avgEffL5X4[1]);
375  m_monObj->setVariable("avgEffL6X1V", avgEffL6X1[1]);
376  m_monObj->setVariable("avgEffL6X2V", avgEffL6X2[1]);
377  m_monObj->setVariable("avgEffL6X3V", avgEffL6X3[1]);
378  m_monObj->setVariable("avgEffL6X4V", avgEffL6X4[1]);
379  m_monObj->setVariable("avgEffL6X5V", avgEffL6X5[1]);
380  m_monObj->setVariable("avgEffL311V", avgEffL311UV[1]);
381  m_monObj->setVariable("avgEffL312V", avgEffL312UV[1]);
382  m_monObj->setVariable("avgEffL321V", avgEffL321UV[1]);
383  m_monObj->setVariable("avgEffL322V", avgEffL322UV[1]);
384  m_monObj->setVariable("avgEffL461V", avgEffL461UV[1]);
385  m_monObj->setVariable("avgEffL462V", avgEffL462UV[1]);
386  m_monObj->setVariable("avgEffL581V", avgEffL581UV[1]);
387  m_monObj->setVariable("avgEffL582V", avgEffL582UV[1]);
388  m_monObj->setVariable("avgEffL6101V", avgEffL6101UV[1]);
389  m_monObj->setVariable("avgEffL6102V", avgEffL6102UV[1]);
390  }
391 
392  // MPV cluster charge for clusters on track
393  TH1F* h_clusterCharge_L3U = (TH1F*)findHist("SVDClsTrk/SVDTRK_ClusterChargeU3");
394  TH1F* h_clusterCharge_L3V = (TH1F*)findHist("SVDClsTrk/SVDTRK_ClusterChargeV3");
395  TH1F* h_clusterCharge_L456U = (TH1F*)findHist("SVDClsTrk/SVDTRK_ClusterChargeU456");
396  TH1F* h_clusterCharge_L456V = (TH1F*)findHist("SVDClsTrk/SVDTRK_ClusterChargeV456");
397 
399  m_c_MPVChargeClusterOnTrack->Divide(2, 2);
401  if (h_clusterCharge_L3U) h_clusterCharge_L3U->Draw();
403  if (h_clusterCharge_L3V) h_clusterCharge_L3V->Draw();
405  if (h_clusterCharge_L456U) h_clusterCharge_L456U->Draw();
407  if (h_clusterCharge_L456U) h_clusterCharge_L456U->Draw();
408 
409  // find abscissa of max Y in histograms
410  float MPVClusterChargeL3U = -99;
411  if (h_clusterCharge_L3U)
412  if (h_clusterCharge_L3U->GetEntries() != 0)
413  MPVClusterChargeL3U = xForMaxY(h_clusterCharge_L3U);
414  float MPVClusterChargeL3V = -99;
415  if (h_clusterCharge_L3V)
416  if (h_clusterCharge_L3V->GetEntries() != 0)
417  MPVClusterChargeL3V = xForMaxY(h_clusterCharge_L3V);
418  float MPVClusterChargeL456U = -99;
419  if (h_clusterCharge_L456U)
420  if (h_clusterCharge_L456U->GetEntries() != 0)
421  MPVClusterChargeL456U = xForMaxY(h_clusterCharge_L456U);
422  float MPVClusterChargeL456V = -99;
423  if (h_clusterCharge_L456V)
424  if (h_clusterCharge_L456V->GetEntries() != 0)
425  MPVClusterChargeL456V = xForMaxY(h_clusterCharge_L456V);
426 
427  if (h_clusterCharge_L3U == NULL || h_clusterCharge_L456U == NULL) {
428  B2INFO("Histograms needed for MPV cluster charge on U side are not found");
429  } else {
430  m_monObj->setVariable("MPVClusterChargeL3U", MPVClusterChargeL3U);
431  m_monObj->setVariable("MPVClusterChargeL456U", MPVClusterChargeL456U);
432  }
433 
434  if (h_clusterCharge_L3V == NULL || h_clusterCharge_L456V == NULL) {
435  B2INFO("Histograms needed for MPV cluster charge on V side are not found");
436  } else {
437  m_monObj->setVariable("MPVClusterChargeL3V", MPVClusterChargeL3V);
438  m_monObj->setVariable("MPVClusterChargeL456V", MPVClusterChargeL456V);
439  }
440 
441 
442  // MPV SNR for the clusters on track
443  TH1F* h_clusterSNR_L3U = (TH1F*)findHist("SVDClsTrk/SVDTRK_ClusterSNRU3");
444  TH1F* h_clusterSNR_L3V = (TH1F*)findHist("SVDClsTrk/SVDTRK_ClusterSNRV3");
445  TH1F* h_clusterSNR_L456U = (TH1F*)findHist("SVDClsTrk/SVDTRK_ClusterSNRU456");
446  TH1F* h_clusterSNR_L456V = (TH1F*)findHist("SVDClsTrk/SVDTRK_ClusterSNRV456");
447 
448  m_c_MPVSNRClusterOnTrack->Clear();
449  m_c_MPVSNRClusterOnTrack->Divide(2, 2);
451  if (h_clusterSNR_L3U) h_clusterSNR_L3U->Draw();
453  if (h_clusterSNR_L3V) h_clusterSNR_L3V->Draw();
455  if (h_clusterSNR_L456U) h_clusterSNR_L456U->Draw();
457  if (h_clusterSNR_L456V) h_clusterSNR_L456V->Draw();
458 
459  float MPVClusterSNRL3U = -99;
460  if (h_clusterSNR_L3U)
461  if (h_clusterSNR_L3U->GetEntries() != 0)
462  MPVClusterSNRL3U = xForMaxY(h_clusterSNR_L3U);
463  float MPVClusterSNRL3V = -99;
464  if (h_clusterSNR_L3V)
465  if (h_clusterSNR_L3V->GetEntries() != 0)
466  MPVClusterSNRL3V = xForMaxY(h_clusterSNR_L3V);
467  float MPVClusterSNRL456U = -99;
468  if (h_clusterSNR_L456U)
469  if (h_clusterSNR_L456U->GetEntries() != 0)
470  MPVClusterSNRL456U = xForMaxY(h_clusterSNR_L456U);
471  float MPVClusterSNRL456V = -99;
472  if (h_clusterSNR_L456V)
473  if (h_clusterSNR_L456V->GetEntries() != 0)
474  MPVClusterSNRL456V = xForMaxY(h_clusterSNR_L456V);
475 
476  if (h_clusterSNR_L3U == NULL || h_clusterSNR_L456U == NULL) {
477  B2INFO("Histograms needed for MPV cluster SNR on U side are not found");
478  } else {
479  m_monObj->setVariable("MPVClusterSNRL3U", MPVClusterSNRL3U);
480  m_monObj->setVariable("MPVClusterSNRL456U", MPVClusterSNRL456U);
481  }
482 
483  if (h_clusterSNR_L3V == NULL || h_clusterSNR_L456V == NULL) {
484  B2INFO("Histograms needed for MPV cluster SNR on V side are not found");
485  } else {
486  m_monObj->setVariable("MPVClusterSNRL3V", MPVClusterSNRL3V);
487  m_monObj->setVariable("MPVClusterSNRL456V", MPVClusterSNRL456V);
488  }
489 
490 
491  // MPV SVD cluster time for the clusters on track
492  TH1F* h_clusterTime_L3U = (TH1F*)findHist("SVDClsTrk/SVDTRK_ClusterTimeU3");
493  TH1F* h_clusterTime_L3V = (TH1F*)findHist("SVDClsTrk/SVDTRK_ClusterTimeV3");
494  TH1F* h_clusterTime_L456U = (TH1F*)findHist("SVDClsTrk/SVDTRK_ClusterTimeU456");
495  TH1F* h_clusterTime_L456V = (TH1F*)findHist("SVDClsTrk/SVDTRK_ClusterTimeV456");
496  TH1F* h_MeanSVD3EventT0 = (TH1F*)findHist("SVDHitTime/SVD3EventT0");
497  TH1F* h_MeanSVD6EventT0 = (TH1F*)findHist("SVDHitTime/SVD6EventT0");
498  TH1F* h_MeanSVDEventT0 = 0x0;
499 
500  if (h_MeanSVD3EventT0)
501  h_MeanSVDEventT0 = (TH1F*)h_MeanSVD3EventT0->Clone();
502 
503  m_c_MPVTimeClusterOnTrack->Clear();
504  m_c_MPVTimeClusterOnTrack->Divide(2, 2);
506  if (h_clusterTime_L3U) h_clusterTime_L3U->Draw();
508  if (h_clusterTime_L3V) h_clusterTime_L3V->Draw();
510  if (h_clusterTime_L456U) h_clusterTime_L456U->Draw();
512  if (h_clusterTime_L456V) h_clusterTime_L456V->Draw();
513 
514  m_c_MeanSVDEventT0->Clear();
515  m_c_MeanSVDEventT0->Divide(2, 2);
516  m_c_MeanSVDEventT0->cd(1);
517  if (h_MeanSVD3EventT0) h_MeanSVD3EventT0->Draw();
518  m_c_MeanSVDEventT0->cd(2);
519  if (h_MeanSVD6EventT0) h_MeanSVD6EventT0->Draw();
520  m_c_MeanSVDEventT0->cd(3);
521  if (h_MeanSVDEventT0) {
522  if (h_MeanSVD6EventT0)
523  h_MeanSVDEventT0->Add(h_MeanSVD6EventT0);
524  h_MeanSVDEventT0->Draw();
525  }
526 
527  float MPVClusterTimeL3U = -99;
528  if (h_clusterTime_L3U)
529  if (h_clusterTime_L3U->GetEntries() != 0)
530  MPVClusterTimeL3U = xForMaxY(h_clusterTime_L3U);
531  float MPVClusterTimeL3V = -99;
532  if (h_clusterTime_L3V)
533  if (h_clusterTime_L3V->GetEntries() != 0)
534  MPVClusterTimeL3V = xForMaxY(h_clusterTime_L3V);
535  float MPVClusterTimeL456U = -99;
536  if (h_clusterTime_L456U)
537  if (h_clusterTime_L456U->GetEntries() != 0)
538  MPVClusterTimeL456U = xForMaxY(h_clusterTime_L456U);
539  float MPVClusterTimeL456V = -99;
540  if (h_clusterTime_L456V)
541  if (h_clusterTime_L456V->GetEntries() != 0)
542  MPVClusterTimeL456V = xForMaxY(h_clusterTime_L456V);
543  float FWHMClusterTimeL3U = -99;
544  if (h_clusterTime_L3U)
545  if (h_clusterTime_L3U->GetEntries() != 0)
546  FWHMClusterTimeL3U = histFWHM(h_clusterTime_L3U);
547  float FWHMClusterTimeL3V = -99;
548  if (h_clusterTime_L3V)
549  if (h_clusterTime_L3V->GetEntries() != 0)
550  FWHMClusterTimeL3V = histFWHM(h_clusterTime_L3V);
551  float FWHMClusterTimeL456U = -99;
552  if (h_clusterTime_L456U)
553  if (h_clusterTime_L456U->GetEntries() != 0)
554  FWHMClusterTimeL456U = histFWHM(h_clusterTime_L456U);
555  float FWHMClusterTimeL456V = -99;
556  if (h_clusterTime_L456V)
557  if (h_clusterTime_L456V->GetEntries() != 0)
558  FWHMClusterTimeL456V = histFWHM(h_clusterTime_L456V);
559 
560  float MeanSVD3EventT0 = -99;
561  if (h_MeanSVD3EventT0)
562  if (h_MeanSVD3EventT0->GetEntries() != 0)
563  MeanSVD3EventT0 = xForMaxY(h_MeanSVD3EventT0);
564 
565  float MeanSVD6EventT0 = -99;
566  if (h_MeanSVD6EventT0)
567  if (h_MeanSVD6EventT0->GetEntries() != 0)
568  MeanSVD6EventT0 = xForMaxY(h_MeanSVD6EventT0);
569 
570  float MeanSVDEventT0 = -99;
571  if (h_MeanSVDEventT0)
572  if (h_MeanSVDEventT0->GetEntries() != 0)
573  MeanSVDEventT0 = xForMaxY(h_MeanSVDEventT0);
574 
575  if (h_clusterTime_L3U == NULL || h_clusterTime_L456U == NULL) {
576  B2INFO("Histograms needed for MPV cluster time on U side are not found");
577  } else {
578  m_monObj->setVariable("MPVClusterTimeL3U", MPVClusterTimeL3U);
579  m_monObj->setVariable("MPVClusterTimeL456U", MPVClusterTimeL456U);
580  m_monObj->setVariable("FWHMClusterTimeL3U", FWHMClusterTimeL3U);
581  m_monObj->setVariable("FWHMClusterTimeL456U", FWHMClusterTimeL456U);
582  }
583 
584  if (h_clusterTime_L3V == NULL || h_clusterTime_L456V == NULL) {
585  B2INFO("Histograms needed for MPV cluster time on V side are not found");
586  } else {
587  m_monObj->setVariable("MPVClusterTimeL3V", MPVClusterTimeL3V);
588  m_monObj->setVariable("MPVClusterTimeL456V", MPVClusterTimeL456V);
589  m_monObj->setVariable("FWHMClusterTimeL3V", FWHMClusterTimeL3V);
590  m_monObj->setVariable("FWHMClusterTimeL456V", FWHMClusterTimeL456V);
591  }
592 
593  if (h_MeanSVD3EventT0 == NULL) {
594  B2INFO("Histograms needed for SVD Event T0 (3 samples) not found");
595  } else {
596  m_monObj->setVariable("MeanSVD3EventT0", MeanSVD3EventT0);
597  }
598 
599  if (h_MeanSVD6EventT0 == NULL) {
600  B2INFO("Histograms needed for SVD Event T0 (6 samples) not found");
601  } else {
602  m_monObj->setVariable("MeanSVD6EventT0", MeanSVD6EventT0);
603  }
604 
605  if (h_MeanSVDEventT0 == NULL) {
606  B2INFO("Histograms needed for SVD Event T0 (all samples) not found");
607  } else {
608  m_monObj->setVariable("MeanSVDEventT0", MeanSVDEventT0);
609  }
610 
611  // average maxBin for clusters on track
612  TH1F* h_maxBinU = (TH1F*)findHist("SVDClsTrk/SVDTRK_StripMaxBinUAll");
613  TH1F* h_maxBinV = (TH1F*)findHist("SVDClsTrk/SVDTRK_StripMaxBinVAll");
614 
616  m_c_avgMaxBinClusterOnTrack->Divide(2, 1);
618  if (h_maxBinU) h_maxBinU->Draw();
620  if (h_maxBinV) h_maxBinV->Draw();
621 
622  if (h_maxBinU == NULL) {
623  B2INFO("Histogram needed for Average MaxBin on U side is not found");
624  } else {
625  float avgMaxBinU = h_maxBinU->GetMean();
626  m_monObj->setVariable("avgMaxBinU", avgMaxBinU);
627  }
628 
629  if (h_maxBinV == NULL) {
630  B2INFO("Histogram needed for Average MaxBin on V side is not found");
631  } else {
632  float avgMaxBinV = h_maxBinV->GetMean();
633  m_monObj->setVariable("avgMaxBinV", avgMaxBinV);
634  }
635 
636  std::map<std::pair<int, int>, int> ladderMap = {
637  {{3, 1}, 0}, {{3, 2}, 1},
638  {{4, 1}, 2}, {{4, 2}, 3}, {{4, 3}, 4},
639  {{5, 1}, 5}, {{5, 2}, 6}, {{5, 3}, 7}, {{5, 4}, 8},
640  {{6, 1}, 9}, {{6, 2}, 10}, {{6, 3}, 11}, {{6, 4}, 12}, {{6, 5}, 13}
641  };
642 
643 
644  for (const auto& it : ladderMap) {
645  std::pair<int, int> p = it.first;
646  int layer = p.first;
647  int sensor = p.second;
648 
649  TString name = Form("SVDClsTrk/SVDTRK_ClusterCharge_L%d.x.%d", layer, sensor);
650  TString title = Form("MPVClusterCharge_L%d.x.%d", layer, sensor);
651  TH1F* h_clusterCharge = (TH1F*)findHist(name.Data());
652  float MPVClusterCharge = -99;
653  if (h_clusterCharge)
654  if (h_clusterCharge->GetEntries() != 0)
655  MPVClusterCharge = xForMaxY(h_clusterCharge);
656 
657  if (h_clusterCharge == NULL) {
658  B2INFO("Histograms needed for cluster charge not found");
659  } else {
660  m_monObj->setVariable(title.Data(), MPVClusterCharge);
661  }
662 
663  name = Form("SVDClsTrk/SVDTRK_ClusterSNR_L%d.x.%d", layer, sensor);
664  title = Form("MPVClusterSNR_L%d.x.%d", layer, sensor);
665  TH1F* h_clusterSNR = (TH1F*)findHist(name.Data());
666  float MPVClusterSNR = -99;
667  if (h_clusterSNR)
668  if (h_clusterSNR->GetEntries() != 0)
669  MPVClusterSNR = xForMaxY(h_clusterSNR);
670 
671  if (h_clusterSNR == NULL) {
672  B2INFO("Histograms needed for cluster SNR not found");
673  } else {
674  m_monObj->setVariable(title.Data(), MPVClusterSNR);
675  }
676  }
677 
678  for (int ladder = 1; ladder <= 2; ++ladder) {
679  for (int sensor = 1; sensor <= 2; ++sensor) {
680 
681  TString name = Form("SVDClsTrk/SVDTRK_ClusterCharge_L3.%d.%d", ladder, sensor);
682  TString title = Form("MPVClusterCharge_L3.%d.%d", ladder, sensor);
683  float MPVClusterCharge = -99;
684  TH1F* h_clusterCharge = (TH1F*)findHist(name.Data());
685  if (h_clusterCharge)
686  if (h_clusterCharge->GetEntries() != 0)
687  MPVClusterCharge = xForMaxY(h_clusterCharge);
688 
689  if (h_clusterCharge == NULL) {
690  B2INFO("Histograms needed for cluster charge not found");
691  } else {
692  m_monObj->setVariable(title.Data(), MPVClusterCharge);
693  }
694 
695  name = Form("SVDClsTrk/SVDTRK_ClusterSNR_L3.%d.%d", ladder, sensor);
696  title = Form("MPVClusterSNR_L3.%d.%d", ladder, sensor);
697  TH1F* h_clusterSNR = (TH1F*)findHist(name.Data());
698  float MPVClusterSNR = -99;
699  if (h_clusterSNR)
700  if (h_clusterSNR->GetEntries() != 0)
701  MPVClusterSNR = xForMaxY(h_clusterSNR);
702 
703  if (h_clusterSNR == NULL) {
704  B2INFO("Histograms needed for cluster SNR not found");
705  } else {
706  m_monObj->setVariable(title.Data(), MPVClusterSNR);
707  }
708  }
709  }
710 
711  B2INFO("DQMHistAnalysisSVDGeneral: endRun called");
712 }
713 
714 
716 {
717  B2INFO("DQMHistAnalysisSVDOnMiraBelle: terminate called");
718 }
719 
720 
721 std::vector<float> DQMHistAnalysisSVDOnMiraBelleModule::highOccupancySensor(int iLayer, TH1F* hU, TH1F* hV, int iBin,
722  int nEvents) const
723 {
724  int nStripsV = -1;
725  if (iLayer == 3) {
726  nStripsV = 768;
727  } else if (iLayer >= 4 && iLayer <= 6) {
728  nStripsV = 512;
729  } else {
730  B2DEBUG(20, "Layer out of range [3,6].");
731  }
732  std::vector<float> avgOffOccUV(2, 0.0);
733  avgOffOccUV[0] = 0;
734  if (hU) avgOffOccUV[0] = hU->GetBinContent(iBin) * 1.0 / 768 / nEvents * 100;
735  avgOffOccUV[1] = 0;
736  if (hV) avgOffOccUV[1] = hV->GetBinContent(iBin) * 1.0 / nStripsV / nEvents * 100;
737  return avgOffOccUV;
738 }
739 
740 
741 std::vector<float> DQMHistAnalysisSVDOnMiraBelleModule::avgOccupancyUV(int iLayer, TH1F* hU, TH1F* hV, int min, int max, int offset,
742  int step, int nEvents) const
743 {
744  int nStripsV = -1;
745  if (iLayer == 3) {
746  nStripsV = 768;
747  } else if (iLayer >= 4 && iLayer <= 6) {
748  nStripsV = 512;
749  } else {
750  B2DEBUG(20, "Layer out of range [3,6].");
751  }
752  std::vector<float> avgOffOccUV(2, 0.0);
753  for (int bin = min; bin < max; bin++) {
754  avgOffOccUV[0] += hU->GetBinContent(offset + step * bin) / 768 * 100;
755  avgOffOccUV[1] += hV->GetBinContent(offset + step * bin) / nStripsV * 100;
756  }
757  avgOffOccUV[0] /= ((max - min) * nEvents);
758  avgOffOccUV[1] /= ((max - min) * nEvents);
759  return avgOffOccUV;
760 }
761 
762 
763 std::vector<float> DQMHistAnalysisSVDOnMiraBelleModule::avgEfficiencyUV(TH2F* hMCU, TH2F* hMCV, TH2F* hFTU, TH2F* hFTV, int minX,
764  int maxX, int minY, int maxY) const
765 {
766  std::vector<float> avgEffUV(2, 0.0);
767  std::vector<float> sumMatchedClustersUV(2, 0.0);
768  std::vector<float> sumFoundTracksUV(2, 0.0);
769  for (int binX = minX; binX < maxX + 1; binX++) {
770  for (int binY = minY; binY < maxY + 1; binY++) {
771  int binXY = hMCV->GetBin(binX, binY);
772  sumMatchedClustersUV[0] += hMCU->GetBinContent(binXY);
773  sumMatchedClustersUV[1] += hMCV->GetBinContent(binXY);
774  sumFoundTracksUV[0] += hFTU->GetBinContent(binXY);
775  sumFoundTracksUV[1] += hFTV->GetBinContent(binXY);
776  }
777  }
778  if (sumFoundTracksUV[0] > 0) {
779  avgEffUV[0] = sumMatchedClustersUV[0] / sumFoundTracksUV[0] * 100;
780  } else {
781  avgEffUV[0] = -1;
782  }
783  if (sumFoundTracksUV[1] > 0) {
784  avgEffUV[1] = sumMatchedClustersUV[1] / sumFoundTracksUV[1] * 100;
785  } else {
786  avgEffUV[1] = -1;
787  }
788  return avgEffUV;
789 }
790 
792 {
793  int maxY = h->GetMaximumBin();
794  float xMaxY = h->GetXaxis()->GetBinCenter(maxY);
795  return xMaxY;
796 }
797 
799 {
800  int bin1 = h->FindFirstBinAbove(h->GetMaximum() / 2);
801  int bin2 = h->FindLastBinAbove(h->GetMaximum() / 2);
802  float fwhm = h->GetBinCenter(bin2) - h->GetBinCenter(bin1);
803  return fwhm;
804 }
The base class for the histogram analysis module.
static TH1 * findHist(const std::string &histname, bool onlyIfUpdated=false)
Get histogram from list (no other search).
static MonitoringObject * getMonitoringObject(const std::string &histname)
Get MonitoringObject with given name (new object is created if non-existing)
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< 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.
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.
#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.