9 #include <dqm/analysis/modules/DQMHistAnalysisSVDOnMiraBelle.h>
23 DQMHistAnalysisSVDOnMiraBelleModule::DQMHistAnalysisSVDOnMiraBelleModule()
26 setDescription(
"DQM Analysis Module that extracts monitoring variables from SVD DQM histograms and provides input to MiraBelle.");
28 B2DEBUG(20,
"DQMHistAnalysisSVDOnMiraBelle: Constructor done.");
41 m_c_avgEfficiency =
new TCanvas(
"svd_avgEfficiency",
"matched clusters and found tracks", 0, 0, 800, 600);
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);
47 m_c_MeanSVDEventT0 =
new TCanvas(
"svd_MeanSVDEventT0",
"Mean Event T0 from SVD for all samples", 0, 0, 400, 400);
58 B2DEBUG(20,
"DQMHistAnalysisSVDOnMiraBelle: initialized.");
63 B2DEBUG(20,
"DQMHistAnalysisSVDOnMiraBelle: beginRun called.");
68 B2DEBUG(20,
"DQMHistAnalysisSVDOnMiraBelle: event called.");
74 TH1F* h_zs5countsU = (TH1F*)
findHist(
"SVDExpReco/SVDDQM_StripCountsU");
75 TH1F* h_zs5countsV = (TH1F*)
findHist(
"SVDExpReco/SVDDQM_StripCountsV");
76 TH1F* h_events = (TH1F*)
findHist(
"SVDExpReco/SVDDQM_nEvents");
82 if (h_zs5countsU) h_zs5countsU->Draw(
"colz");
84 if (h_zs5countsV) h_zs5countsV->Draw(
"colz");
86 if (h_events) h_events->Draw(
"colz");
89 if (h_events) nE = h_events->GetEntries();
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");
96 if (h_zs5countsV == NULL) {
97 B2INFO(
"Histograms needed for Average Offline Occupancy on V side are not found");
101 std::vector<float> avgOffOccL3UV =
avgOccupancyUV(3, h_zs5countsU, h_zs5countsV, 0, 14, 1, 1, nE);
103 std::vector<float> avgOffOccL4UV =
avgOccupancyUV(4, h_zs5countsU, h_zs5countsV, 0, 30, 15, 1, nE);
105 std::vector<float> avgOffOccL5UV =
avgOccupancyUV(5, h_zs5countsU, h_zs5countsV, 0, 48, 45, 1, nE);
107 std::vector<float> avgOffOccL6UV =
avgOccupancyUV(6, h_zs5countsU, h_zs5countsV, 0, 80, 93, 1, nE);
110 std::vector<float> avgOffOccL3X1UV =
avgOccupancyUV(3, h_zs5countsU, h_zs5countsV, 0, 7, 0, 2, nE);
112 std::vector<float> avgOffOccL3X2UV =
avgOccupancyUV(3, h_zs5countsU, h_zs5countsV, 0, 7, 1, 2, nE);
114 std::vector<float> avgOffOccL4X1UV =
avgOccupancyUV(4, h_zs5countsU, h_zs5countsV, 0, 10, 15, 3, nE);
116 std::vector<float> avgOffOccL4X2UV =
avgOccupancyUV(4, h_zs5countsU, h_zs5countsV, 0, 10, 16, 3, nE);
118 std::vector<float> avgOffOccL4X3UV =
avgOccupancyUV(4, h_zs5countsU, h_zs5countsV, 0, 10, 17, 3, nE);
120 std::vector<float> avgOffOccL5X1UV =
avgOccupancyUV(5, h_zs5countsU, h_zs5countsV, 0, 12, 35, 4, nE);
122 std::vector<float> avgOffOccL5X2UV =
avgOccupancyUV(5, h_zs5countsU, h_zs5countsV, 0, 12, 36, 4, nE);
124 std::vector<float> avgOffOccL5X3UV =
avgOccupancyUV(5, h_zs5countsU, h_zs5countsV, 0, 12, 37, 4, nE);
126 std::vector<float> avgOffOccL5X4UV =
avgOccupancyUV(5, h_zs5countsU, h_zs5countsV, 0, 12, 38, 4, nE);
128 std::vector<float> avgOffOccL6X1UV =
avgOccupancyUV(6, h_zs5countsU, h_zs5countsV, 0, 16, 93, 5, nE);
130 std::vector<float> avgOffOccL6X2UV =
avgOccupancyUV(6, h_zs5countsU, h_zs5countsV, 0, 16, 94, 5, nE);
132 std::vector<float> avgOffOccL6X3UV =
avgOccupancyUV(6, h_zs5countsU, h_zs5countsV, 0, 16, 95, 5, nE);
134 std::vector<float> avgOffOccL6X4UV =
avgOccupancyUV(6, h_zs5countsU, h_zs5countsV, 0, 16, 96, 5, nE);
136 std::vector<float> avgOffOccL6X5UV =
avgOccupancyUV(6, h_zs5countsU, h_zs5countsV, 0, 16, 97, 5, nE);
139 std::vector<float> avgOffOccL311UV =
highOccupancySensor(3, h_zs5countsU, h_zs5countsV, 1, nE);
141 std::vector<float> avgOffOccL312UV =
highOccupancySensor(3, h_zs5countsU, h_zs5countsV, 2, nE);
143 std::vector<float> avgOffOccL321UV =
highOccupancySensor(3, h_zs5countsU, h_zs5countsV, 3, nE);
145 std::vector<float> avgOffOccL322UV =
highOccupancySensor(3, h_zs5countsU, h_zs5countsV, 4, nE);
147 std::vector<float> avgOffOccL461UV =
highOccupancySensor(4, h_zs5countsU, h_zs5countsV, 30, nE);
149 std::vector<float> avgOffOccL462UV =
highOccupancySensor(4, h_zs5countsU, h_zs5countsV, 31, nE);
151 std::vector<float> avgOffOccL581UV =
highOccupancySensor(5, h_zs5countsU, h_zs5countsV, 73, nE);
153 std::vector<float> avgOffOccL582UV =
highOccupancySensor(5, h_zs5countsU, h_zs5countsV, 74, nE);
155 std::vector<float> avgOffOccL6101UV =
highOccupancySensor(6, h_zs5countsU, h_zs5countsV, 138, nE);
157 std::vector<float> avgOffOccL6102UV =
highOccupancySensor(6, h_zs5countsU, h_zs5countsV, 139, nE);
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");
228 if (h_found_tracksU) h_found_tracksU->Draw(
"colz");
230 if (h_found_tracksV) h_found_tracksV->Draw(
"colz");
232 if (h_matched_clusU) h_matched_clusU->Draw(
"colz");
234 if (h_matched_clusV) h_matched_clusV->Draw(
"colz");
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");
241 if (h_matched_clusV == NULL) {
242 B2INFO(
"Histograms needed for Average Efficiency on V side are not found");
246 std::vector<float> avgEffL3 =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 7, 2, 3);
248 std::vector<float> avgEffL4 =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 10, 5, 7);
250 std::vector<float> avgEffL5 =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 12, 9, 12);
252 std::vector<float> avgEffL6 =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 16, 14, 18);
255 std::vector<float> avgEffL3456 =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 16, 2, 18);
258 std::vector<float> avgEffL3X1 =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 7, 2, 2);
261 std::vector<float> avgEffL3X2 =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 7, 3, 3);
264 std::vector<float> avgEffL4X1 =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 10, 5, 5);
267 std::vector<float> avgEffL4X2 =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 10, 6, 6);
270 std::vector<float> avgEffL4X3 =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 10, 7, 7);
273 std::vector<float> avgEffL5X1 =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 12, 9, 9);
276 std::vector<float> avgEffL5X2 =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 12, 10, 10);
279 std::vector<float> avgEffL5X3 =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 12, 11, 11);
282 std::vector<float> avgEffL5X4 =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 12, 12, 12);
285 std::vector<float> avgEffL6X1 =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 16, 14, 14);
288 std::vector<float> avgEffL6X2 =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 16, 15, 15);
291 std::vector<float> avgEffL6X3 =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 16, 16, 16);
294 std::vector<float> avgEffL6X4 =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 16, 17, 17);
297 std::vector<float> avgEffL6X5 =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 16, 18, 18);
301 std::vector<float> avgEffL311UV =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 1, 2,
304 std::vector<float> avgEffL312UV =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 1, 3,
307 std::vector<float> avgEffL321UV =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 2, 2, 2,
310 std::vector<float> avgEffL322UV =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 2, 2, 3,
313 std::vector<float> avgEffL461UV =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 6, 6, 5,
316 std::vector<float> avgEffL462UV =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 6, 6, 6,
319 std::vector<float> avgEffL581UV =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 8, 8, 9,
322 std::vector<float> avgEffL582UV =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 8, 8, 10,
325 std::vector<float> avgEffL6101UV =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 10, 10, 14,
328 std::vector<float> avgEffL6102UV =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 10, 10, 15,
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");
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();
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);
427 if (h_clusterCharge_L3U == NULL || h_clusterCharge_L456U == NULL) {
428 B2INFO(
"Histograms needed for MPV cluster charge on U side are not found");
434 if (h_clusterCharge_L3V == NULL || h_clusterCharge_L456V == NULL) {
435 B2INFO(
"Histograms needed for MPV cluster charge on V side are not found");
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");
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();
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);
476 if (h_clusterSNR_L3U == NULL || h_clusterSNR_L456U == NULL) {
477 B2INFO(
"Histograms needed for MPV cluster SNR on U side are not found");
483 if (h_clusterSNR_L3V == NULL || h_clusterSNR_L456V == NULL) {
484 B2INFO(
"Histograms needed for MPV cluster SNR on V side are not found");
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;
500 if (h_MeanSVD3EventT0)
501 h_MeanSVDEventT0 = (TH1F*)h_MeanSVD3EventT0->Clone();
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();
517 if (h_MeanSVD3EventT0) h_MeanSVD3EventT0->Draw();
519 if (h_MeanSVD6EventT0) h_MeanSVD6EventT0->Draw();
521 if (h_MeanSVDEventT0) {
522 if (h_MeanSVD6EventT0)
523 h_MeanSVDEventT0->Add(h_MeanSVD6EventT0);
524 h_MeanSVDEventT0->Draw();
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);
560 float MeanSVD3EventT0 = -99;
561 if (h_MeanSVD3EventT0)
562 if (h_MeanSVD3EventT0->GetEntries() != 0)
563 MeanSVD3EventT0 =
xForMaxY(h_MeanSVD3EventT0);
565 float MeanSVD6EventT0 = -99;
566 if (h_MeanSVD6EventT0)
567 if (h_MeanSVD6EventT0->GetEntries() != 0)
568 MeanSVD6EventT0 =
xForMaxY(h_MeanSVD6EventT0);
570 float MeanSVDEventT0 = -99;
571 if (h_MeanSVDEventT0)
572 if (h_MeanSVDEventT0->GetEntries() != 0)
573 MeanSVDEventT0 =
xForMaxY(h_MeanSVDEventT0);
575 if (h_clusterTime_L3U == NULL || h_clusterTime_L456U == NULL) {
576 B2INFO(
"Histograms needed for MPV cluster time on U side are not found");
584 if (h_clusterTime_L3V == NULL || h_clusterTime_L456V == NULL) {
585 B2INFO(
"Histograms needed for MPV cluster time on V side are not found");
593 if (h_MeanSVD3EventT0 == NULL) {
594 B2INFO(
"Histograms needed for SVD Event T0 (3 samples) not found");
599 if (h_MeanSVD6EventT0 == NULL) {
600 B2INFO(
"Histograms needed for SVD Event T0 (6 samples) not found");
605 if (h_MeanSVDEventT0 == NULL) {
606 B2INFO(
"Histograms needed for SVD Event T0 (all samples) not found");
612 TH1F* h_maxBinU = (TH1F*)
findHist(
"SVDClsTrk/SVDTRK_StripMaxBinUAll");
613 TH1F* h_maxBinV = (TH1F*)
findHist(
"SVDClsTrk/SVDTRK_StripMaxBinVAll");
618 if (h_maxBinU) h_maxBinU->Draw();
620 if (h_maxBinV) h_maxBinV->Draw();
622 if (h_maxBinU == NULL) {
623 B2INFO(
"Histogram needed for Average MaxBin on U side is not found");
625 float avgMaxBinU = h_maxBinU->GetMean();
629 if (h_maxBinV == NULL) {
630 B2INFO(
"Histogram needed for Average MaxBin on V side is not found");
632 float avgMaxBinV = h_maxBinV->GetMean();
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}
644 for (
const auto& it : ladderMap) {
645 std::pair<int, int> p = it.first;
647 int sensor = p.second;
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;
654 if (h_clusterCharge->GetEntries() != 0)
655 MPVClusterCharge =
xForMaxY(h_clusterCharge);
657 if (h_clusterCharge == NULL) {
658 B2INFO(
"Histograms needed for cluster charge not found");
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;
668 if (h_clusterSNR->GetEntries() != 0)
669 MPVClusterSNR =
xForMaxY(h_clusterSNR);
671 if (h_clusterSNR == NULL) {
672 B2INFO(
"Histograms needed for cluster SNR not found");
678 for (
int ladder = 1; ladder <= 2; ++ladder) {
679 for (
int sensor = 1; sensor <= 2; ++sensor) {
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());
686 if (h_clusterCharge->GetEntries() != 0)
687 MPVClusterCharge =
xForMaxY(h_clusterCharge);
689 if (h_clusterCharge == NULL) {
690 B2INFO(
"Histograms needed for cluster charge not found");
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;
700 if (h_clusterSNR->GetEntries() != 0)
701 MPVClusterSNR =
xForMaxY(h_clusterSNR);
703 if (h_clusterSNR == NULL) {
704 B2INFO(
"Histograms needed for cluster SNR not found");
711 B2INFO(
"DQMHistAnalysisSVDGeneral: endRun called");
717 B2INFO(
"DQMHistAnalysisSVDOnMiraBelle: terminate called");
727 }
else if (iLayer >= 4 && iLayer <= 6) {
730 B2DEBUG(20,
"Layer out of range [3,6].");
732 std::vector<float> avgOffOccUV(2, 0.0);
734 if (hU) avgOffOccUV[0] = hU->GetBinContent(iBin) * 1.0 / 768 / nEvents * 100;
736 if (hV) avgOffOccUV[1] = hV->GetBinContent(iBin) * 1.0 / nStripsV / nEvents * 100;
742 int step,
int nEvents)
const
747 }
else if (iLayer >= 4 && iLayer <= 6) {
750 B2DEBUG(20,
"Layer out of range [3,6].");
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;
757 avgOffOccUV[0] /= ((max - min) * nEvents);
758 avgOffOccUV[1] /= ((max - min) * nEvents);
764 int maxX,
int minY,
int maxY)
const
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);
778 if (sumFoundTracksUV[0] > 0) {
779 avgEffUV[0] = sumMatchedClustersUV[0] / sumFoundTracksUV[0] * 100;
783 if (sumFoundTracksUV[1] > 0) {
784 avgEffUV[1] = sumMatchedClustersUV[1] / sumFoundTracksUV[1] * 100;
793 int maxY = h->GetMaximumBin();
794 float xMaxY = h->GetXaxis()->GetBinCenter(maxY);
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);
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
TCanvas * m_c_MeanSVDEventT0
Mean Event T0 from SVD.
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.
~DQMHistAnalysisSVDOnMiraBelleModule()
Destructor.
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.
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
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.
Abstract base class for different kinds of events.