11#include <vxd/geometry/GeoCache.h>
12#include <dqm/analysis/modules/DQMHistAnalysisSVDOnMiraBelle.h>
29 setDescription(
"DQM Analysis Module that extracts monitoring variables from SVD DQM histograms and provides input to MiraBelle.");
31 B2DEBUG(20,
"DQMHistAnalysisSVDOnMiraBelle: Constructor done.");
44 m_c_avgEfficiency =
new TCanvas(
"svd_avgEfficiency",
"matched clusters and found tracks", 0, 0, 800, 600);
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);
50 m_c_MeanSVDEventT0 =
new TCanvas(
"svd_MeanSVDEventT0",
"Mean Event T0 from SVD for all samples", 0, 0, 400, 400);
65 for (
VxdID& aVxdID : sensors) {
73 B2DEBUG(20,
"DQMHistAnalysisSVDOnMiraBelle: initialized.");
78 B2DEBUG(20,
"DQMHistAnalysisSVDOnMiraBelle: beginRun called.");
83 B2DEBUG(20,
"DQMHistAnalysisSVDOnMiraBelle: event called.");
88 float nan = numeric_limits<float>::quiet_NaN();
91 TH1F* h_zs5countsU = (TH1F*)
findHist(
"SVDExpReco/SVDDQM_StripCountsU");
92 TH1F* h_zs5countsV = (TH1F*)
findHist(
"SVDExpReco/SVDDQM_StripCountsV");
93 TH1F* h_events = (TH1F*)
findHist(
"SVDExpReco/SVDDQM_nEvents");
99 if (h_zs5countsU) h_zs5countsU->Draw(
"colz");
101 if (h_zs5countsV) h_zs5countsV->Draw(
"colz");
103 if (h_events) h_events->Draw(
"colz");
106 if (h_events) nE = h_events->GetEntries();
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");
113 if (h_zs5countsV == NULL) {
114 B2INFO(
"Histograms needed for Average Offline Occupancy on V side are not found");
118 std::vector<float> avgOffOccL3UV =
avgOccupancyUV(3, h_zs5countsU, h_zs5countsV, 0, 14, 1, 1, nE);
120 std::vector<float> avgOffOccL4UV =
avgOccupancyUV(4, h_zs5countsU, h_zs5countsV, 0, 30, 15, 1, nE);
122 std::vector<float> avgOffOccL5UV =
avgOccupancyUV(5, h_zs5countsU, h_zs5countsV, 0, 48, 45, 1, nE);
124 std::vector<float> avgOffOccL6UV =
avgOccupancyUV(6, h_zs5countsU, h_zs5countsV, 0, 80, 93, 1, nE);
136 std::vector<float> avgOffOccL3X1UV =
avgOccupancyUV(3, h_zs5countsU, h_zs5countsV, 0, 7, 0, 2, nE);
138 std::vector<float> avgOffOccL3X2UV =
avgOccupancyUV(3, h_zs5countsU, h_zs5countsV, 0, 7, 1, 2, nE);
140 std::vector<float> avgOffOccL4X1UV =
avgOccupancyUV(4, h_zs5countsU, h_zs5countsV, 0, 10, 15, 3, nE);
142 std::vector<float> avgOffOccL4X2UV =
avgOccupancyUV(4, h_zs5countsU, h_zs5countsV, 0, 10, 16, 3, nE);
144 std::vector<float> avgOffOccL4X3UV =
avgOccupancyUV(4, h_zs5countsU, h_zs5countsV, 0, 10, 17, 3, nE);
146 std::vector<float> avgOffOccL5X1UV =
avgOccupancyUV(5, h_zs5countsU, h_zs5countsV, 0, 12, 35, 4, nE);
148 std::vector<float> avgOffOccL5X2UV =
avgOccupancyUV(5, h_zs5countsU, h_zs5countsV, 0, 12, 36, 4, nE);
150 std::vector<float> avgOffOccL5X3UV =
avgOccupancyUV(5, h_zs5countsU, h_zs5countsV, 0, 12, 37, 4, nE);
152 std::vector<float> avgOffOccL5X4UV =
avgOccupancyUV(5, h_zs5countsU, h_zs5countsV, 0, 12, 38, 4, nE);
154 std::vector<float> avgOffOccL6X1UV =
avgOccupancyUV(6, h_zs5countsU, h_zs5countsV, 0, 16, 93, 5, nE);
156 std::vector<float> avgOffOccL6X2UV =
avgOccupancyUV(6, h_zs5countsU, h_zs5countsV, 0, 16, 94, 5, nE);
158 std::vector<float> avgOffOccL6X3UV =
avgOccupancyUV(6, h_zs5countsU, h_zs5countsV, 0, 16, 95, 5, nE);
160 std::vector<float> avgOffOccL6X4UV =
avgOccupancyUV(6, h_zs5countsU, h_zs5countsV, 0, 16, 96, 5, nE);
162 std::vector<float> avgOffOccL6X5UV =
avgOccupancyUV(6, h_zs5countsU, h_zs5countsV, 0, 16, 97, 5, nE);
165 std::vector<float> avgOffOccL311UV =
highOccupancySensor(3, h_zs5countsU, h_zs5countsV, 1, nE);
167 std::vector<float> avgOffOccL312UV =
highOccupancySensor(3, h_zs5countsU, h_zs5countsV, 2, nE);
169 std::vector<float> avgOffOccL321UV =
highOccupancySensor(3, h_zs5countsU, h_zs5countsV, 3, nE);
171 std::vector<float> avgOffOccL322UV =
highOccupancySensor(3, h_zs5countsU, h_zs5countsV, 4, nE);
173 std::vector<float> avgOffOccL461UV =
highOccupancySensor(4, h_zs5countsU, h_zs5countsV, 30, nE);
175 std::vector<float> avgOffOccL462UV =
highOccupancySensor(4, h_zs5countsU, h_zs5countsV, 31, nE);
177 std::vector<float> avgOffOccL581UV =
highOccupancySensor(5, h_zs5countsU, h_zs5countsV, 73, nE);
179 std::vector<float> avgOffOccL582UV =
highOccupancySensor(5, h_zs5countsU, h_zs5countsV, 74, nE);
181 std::vector<float> avgOffOccL6101UV =
highOccupancySensor(6, h_zs5countsU, h_zs5countsV, 138, nE);
183 std::vector<float> avgOffOccL6102UV =
highOccupancySensor(6, h_zs5countsU, h_zs5countsV, 139, nE);
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");
266 if (h_found_tracksU) h_found_tracksU->Draw(
"colz");
268 if (h_found_tracksV) h_found_tracksV->Draw(
"colz");
270 if (h_matched_clusU) h_matched_clusU->Draw(
"colz");
272 if (h_matched_clusV) h_matched_clusV->Draw(
"colz");
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");
279 if (h_matched_clusV == NULL) {
280 B2INFO(
"Histograms needed for Average Efficiency on V side are not found");
284 std::vector<float> avgEffL3 =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 7, 2, 3);
286 std::vector<float> avgEffL4 =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 10, 5, 7);
288 std::vector<float> avgEffL5 =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 12, 9, 12);
290 std::vector<float> avgEffL6 =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 16, 14, 18);
293 std::vector<float> avgEffL3456 =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 16, 2, 18);
296 std::vector<float> avgEffL3X1 =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 7, 2, 2);
299 std::vector<float> avgEffL3X2 =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 7, 3, 3);
302 std::vector<float> avgEffL4X1 =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 10, 5, 5);
305 std::vector<float> avgEffL4X2 =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 10, 6, 6);
308 std::vector<float> avgEffL4X3 =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 10, 7, 7);
311 std::vector<float> avgEffL5X1 =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 12, 9, 9);
314 std::vector<float> avgEffL5X2 =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 12, 10, 10);
317 std::vector<float> avgEffL5X3 =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 12, 11, 11);
320 std::vector<float> avgEffL5X4 =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 12, 12, 12);
323 std::vector<float> avgEffL6X1 =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 16, 14, 14);
326 std::vector<float> avgEffL6X2 =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 16, 15, 15);
329 std::vector<float> avgEffL6X3 =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 16, 16, 16);
332 std::vector<float> avgEffL6X4 =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 16, 17, 17);
335 std::vector<float> avgEffL6X5 =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 16, 18, 18);
339 std::vector<float> avgEffL311UV =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 1, 2,
342 std::vector<float> avgEffL312UV =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 1, 1, 3,
345 std::vector<float> avgEffL321UV =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 2, 2, 2,
348 std::vector<float> avgEffL322UV =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 2, 2, 3,
351 std::vector<float> avgEffL461UV =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 6, 6, 5,
354 std::vector<float> avgEffL462UV =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 6, 6, 6,
357 std::vector<float> avgEffL581UV =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 8, 8, 9,
360 std::vector<float> avgEffL582UV =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 8, 8, 10,
363 std::vector<float> avgEffL6101UV =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 10, 10, 14,
366 std::vector<float> avgEffL6102UV =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 10, 10, 15,
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");
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();
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);
465 if (h_clusterCharge_L3U == NULL || h_clusterCharge_L456U == NULL) {
466 B2INFO(
"Histograms needed for MPV cluster charge on U side are not found");
472 if (h_clusterCharge_L3V == NULL || h_clusterCharge_L456V == NULL) {
473 B2INFO(
"Histograms needed for MPV cluster charge on V side are not found");
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");
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();
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);
514 if (h_clusterSNR_L3U == NULL || h_clusterSNR_L456U == NULL) {
515 B2INFO(
"Histograms needed for MPV cluster SNR on U side are not found");
521 if (h_clusterSNR_L3V == NULL || h_clusterSNR_L456V == NULL) {
522 B2INFO(
"Histograms needed for MPV cluster SNR on V side are not found");
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;
538 if (h_MeanSVD3EventT0)
539 h_MeanSVDEventT0 = (TH1F*)h_MeanSVD3EventT0->Clone();
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();
555 if (h_MeanSVD3EventT0) h_MeanSVD3EventT0->Draw();
557 if (h_MeanSVD6EventT0) h_MeanSVD6EventT0->Draw();
559 if (h_MeanSVDEventT0) {
560 if (h_MeanSVD6EventT0)
561 h_MeanSVDEventT0->Add(h_MeanSVD6EventT0);
562 h_MeanSVDEventT0->Draw();
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);
598 float MeanSVD3EventT0 = nan;
599 if (h_MeanSVD3EventT0)
600 if (h_MeanSVD3EventT0->GetEntries() != 0)
601 MeanSVD3EventT0 =
xForMaxY(h_MeanSVD3EventT0);
603 float MeanSVD6EventT0 = nan;
604 if (h_MeanSVD6EventT0)
605 if (h_MeanSVD6EventT0->GetEntries() != 0)
606 MeanSVD6EventT0 =
xForMaxY(h_MeanSVD6EventT0);
608 float MeanSVDEventT0 = nan;
609 if (h_MeanSVDEventT0)
610 if (h_MeanSVDEventT0->GetEntries() != 0)
611 MeanSVDEventT0 =
xForMaxY(h_MeanSVDEventT0);
613 if (h_clusterTime_L3U == NULL || h_clusterTime_L456U == NULL) {
614 B2INFO(
"Histograms needed for MPV cluster time on U side are not found");
622 if (h_clusterTime_L3V == NULL || h_clusterTime_L456V == NULL) {
623 B2INFO(
"Histograms needed for MPV cluster time on V side are not found");
631 if (h_MeanSVD3EventT0 == NULL) {
632 B2INFO(
"Histograms needed for SVD Event T0 (3 samples) not found");
637 if (h_MeanSVD6EventT0 == NULL) {
638 B2INFO(
"Histograms needed for SVD Event T0 (6 samples) not found");
643 if (h_MeanSVDEventT0 == NULL) {
644 B2INFO(
"Histograms needed for SVD Event T0 (all samples) not found");
650 TH1F* h_maxBinU = (TH1F*)
findHist(
"SVDClsTrk/SVDTRK_StripMaxBinUAll");
651 TH1F* h_maxBinV = (TH1F*)
findHist(
"SVDClsTrk/SVDTRK_StripMaxBinVAll");
656 if (h_maxBinU) h_maxBinU->Draw();
658 if (h_maxBinV) h_maxBinV->Draw();
660 if (h_maxBinU == NULL) {
661 B2INFO(
"Histogram needed for Average MaxBin on U side is not found");
663 float avgMaxBinU = h_maxBinU->GetMean();
667 if (h_maxBinV == NULL) {
668 B2INFO(
"Histogram needed for Average MaxBin on V side is not found");
670 float avgMaxBinV = h_maxBinV->GetMean();
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}
682 for (
const auto& it : ladderMap) {
683 std::pair<int, int> p = it.first;
685 int sensor = p.second;
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;
692 if (h_clusterCharge->GetEntries() != 0)
693 MPVClusterCharge =
xForMaxY(h_clusterCharge);
695 if (h_clusterCharge == NULL) {
696 B2INFO(
"Histograms needed for cluster charge not found");
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;
706 if (h_clusterSNR->GetEntries() != 0)
707 MPVClusterSNR =
xForMaxY(h_clusterSNR);
709 if (h_clusterSNR == NULL) {
710 B2INFO(
"Histograms needed for cluster SNR not found");
716 for (
int ladder = 1; ladder <= 2; ++ladder) {
717 for (
int sensor = 1; sensor <= 2; ++sensor) {
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());
724 if (h_clusterCharge->GetEntries() != 0)
725 MPVClusterCharge =
xForMaxY(h_clusterCharge);
727 if (h_clusterCharge == NULL) {
728 B2INFO(
"Histograms needed for cluster charge not found");
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;
738 if (h_clusterSNR->GetEntries() != 0)
739 MPVClusterSNR =
xForMaxY(h_clusterSNR);
741 if (h_clusterSNR == NULL) {
742 B2INFO(
"Histograms needed for cluster SNR not found");
749 B2INFO(
"DQMHistAnalysisSVDGeneral: endRun called");
755 B2INFO(
"DQMHistAnalysisSVDOnMiraBelle: terminate called");
765 }
else if (iLayer >= 4 && iLayer <= 6) {
768 B2DEBUG(20,
"Layer out of range [3,6].");
770 std::vector<float> avgOffOccUV(2, 0.0);
772 if (hU) avgOffOccUV[0] = hU->GetBinContent(iBin) * 1.0 / 768 / nEvents * 100;
774 if (hV) avgOffOccUV[1] = hV->GetBinContent(iBin) * 1.0 / nStripsV / nEvents * 100;
780 int step,
int nEvents)
const
785 }
else if (iLayer >= 4 && iLayer <= 6) {
788 B2DEBUG(20,
"Layer out of range [3,6].");
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;
795 avgOffOccUV[0] /= ((max - min) * nEvents);
796 avgOffOccUV[1] /= ((max - min) * nEvents);
805 }
else if (iLayer >= 4 && iLayer <= 6) {
808 B2DEBUG(20,
"Layer out of range [3,6].");
811 Int_t nStripsU = 768;
813 std::vector<float> avgOffOccU;
814 std::vector<float> avgOffOccV;
816 for (
unsigned int i = 0; i <
m_SVDModules.size(); i++) {
821 TString tmpnameGrpId0U = Form(
"SVDExpReco/SVDDQM_%d_%d_%d_StripCountGroupId0U", tmp_layer, tmp_ladder, tmp_sensor);
822 TH1F* htmpU = (TH1F*)
findHist(tmpnameGrpId0U.Data());
824 B2INFO(
"Occupancy U histogram for group Id0 not found");
826 if (tmp_layer == iLayer)
827 avgOffOccU.push_back(htmpU->GetEntries() / nStripsU / nEvents * 100);
830 TString tmpnameGrpId0V = Form(
"SVDExpReco/SVDDQM_%d_%d_%d_StripCountGroupId0V", tmp_layer, tmp_ladder, tmp_sensor);
831 TH1F* htmpV = (TH1F*)
findHist(tmpnameGrpId0V.Data());
833 B2INFO(
"Occupancy V histogram for group Id0 not found");
835 if (tmp_layer == iLayer)
836 avgOffOccV.push_back(htmpV->GetEntries() / nStripsV / nEvents * 100);
840 std::vector<float> avgOffOccUV(2, 0.);
842 avgOffOccUV[0] = accumulate(avgOffOccU.begin(), avgOffOccU.end(), 0.0);
843 avgOffOccUV[0] /= float(avgOffOccU.size());
845 avgOffOccUV[1] = accumulate(avgOffOccV.begin(), avgOffOccV.end(), 0.0);
846 avgOffOccUV[1] /= float(avgOffOccV.size());
852 int maxX,
int minY,
int maxY)
const
854 float nan = numeric_limits<float>::quiet_NaN();
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);
868 if (sumFoundTracksUV[0] > 0) {
869 avgEffUV[0] = sumMatchedClustersUV[0] / sumFoundTracksUV[0] * 100;
873 if (sumFoundTracksUV[1] > 0) {
874 avgEffUV[1] = sumMatchedClustersUV[1] / sumFoundTracksUV[1] * 100;
883 int maxY = h->GetMaximumBin();
884 float xMaxY = h->GetXaxis()->GetBinCenter(maxY);
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);
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).
DQMHistAnalysisSVDOnMiraBelleModule()
Constructor.
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< 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.
~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.
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.
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.
Class to faciliate easy access to sensor information of the VXD like coordinate transformations or pi...
const std::vector< VxdID > getListOfSensors() const
Get list of all sensors.
const SensorInfoBase & getSensorInfo(Belle2::VxdID id) const
Return a referecne to the SensorInfo of a given SensorID.
static GeoCache & getInstance()
Return a reference to the singleton instance.
Base class to provide Sensor Information for PXD and SVD.
Class to uniquely identify a any structure of the PXD and SVD.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.