104 float nan = numeric_limits<float>::quiet_NaN();
107 std::vector<string> ladderLabel = {
"L3.X.1",
"L3.X.2",
"L4.X.1",
"L4.X.2",
"L4.X.3",
"L5.X.1",
"L5.X.2",
"L5.X.3",
"L5.X.4",
108 "L6.X.1",
"L6.X.2",
"L6.X.3",
"L6.X.4",
"L6.X.5"
117 TH1F* h_zs5countsU = (TH1F*)
findHist(
"SVDExpReco/SVDDQM_StripCountsU");
118 TH1F* h_zs5countsV = (TH1F*)
findHist(
"SVDExpReco/SVDDQM_StripCountsV");
119 TH1F* h_events = (TH1F*)
findHist(
"SVDExpReco/SVDDQM_nEvents");
125 if (h_zs5countsU) h_zs5countsU->Draw(
"colz");
127 if (h_zs5countsV) h_zs5countsV->Draw(
"colz");
129 if (h_events) h_events->Draw(
"colz");
132 if (h_events) nE = h_events->GetEntries();
135 if (h_zs5countsU == NULL || h_zs5countsV == NULL || h_events == NULL) {
136 if (h_zs5countsU == NULL) {
137 B2INFO(
"Histograms needed for Average Offline Occupancy on U side are not found");
139 if (h_zs5countsV == NULL) {
140 B2INFO(
"Histograms needed for Average Offline Occupancy on V side are not found");
144 std::pair<float, float> avgOffOccL3UV =
avgOccupancyUV(h_zs5countsU, h_zs5countsV, nE, 3);
147 std::pair<float, float> avgOffOccL4UV =
avgOccupancyUV(h_zs5countsU, h_zs5countsV, nE, 4);
150 std::pair<float, float> avgOffOccL5UV =
avgOccupancyUV(h_zs5countsU, h_zs5countsV, nE, 5);
153 std::pair<float, float> avgOffOccL6UV =
avgOccupancyUV(h_zs5countsU, h_zs5countsV, nE, 6);
170 for (
const auto& it : ladderLabel) {
171 string sensorDescr = it;
174 sscanf(it.c_str(),
"L%d.X.%d", &layer, &sensor);
175 std::pair<float, float> avgOffOccL =
avgOccupancyUV(h_zs5countsU, h_zs5countsV, nE, layer, -1, sensor);
176 addVariable(Form(
"avgOffOccL%dX%dUV", layer, sensor), avgOffOccL);
181 string sensorDescr = it;
185 sscanf(it.c_str(),
"%d.%d.%d", &layer, &ladder, &sensor);
186 std::pair<float, float> avgOffOccL =
avgOccupancyUV(h_zs5countsU, h_zs5countsV, nE, layer, ladder, sensor);
187 addVariable(Form(
"avgOffOccL%d%d%dUV", layer, ladder, sensor), avgOffOccL);
193 TH2F* h_found_tracksU = (TH2F*)
findHist(
"SVDEfficiency/TrackHitsU");
194 TH2F* h_matched_clusU = (TH2F*)
findHist(
"SVDEfficiency/MatchedHitsU");
195 TH2F* h_found_tracksV = (TH2F*)
findHist(
"SVDEfficiency/TrackHitsV");
196 TH2F* h_matched_clusV = (TH2F*)
findHist(
"SVDEfficiency/MatchedHitsV");
201 if (h_found_tracksU) h_found_tracksU->Draw(
"colz");
203 if (h_found_tracksV) h_found_tracksV->Draw(
"colz");
205 if (h_matched_clusU) h_matched_clusU->Draw(
"colz");
207 if (h_matched_clusV) h_matched_clusV->Draw(
"colz");
210 if (h_matched_clusU == NULL || h_matched_clusV == NULL || h_found_tracksU == NULL) {
211 if (h_matched_clusU == NULL) {
212 B2INFO(
"Histograms needed for Average Efficiency on U side are not found");
214 if (h_matched_clusV == NULL) {
215 B2INFO(
"Histograms needed for Average Efficiency on V side are not found");
219 std::pair<float, float> avgEffL3 =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 3);
222 std::pair<float, float> avgEffL4 =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 4);
225 std::pair<float, float> avgEffL5 =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 5);
228 std::pair<float, float> avgEffL6 =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 6);
232 std::pair<float, float> avgEffL3456 =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV);
236 for (
const auto& it : ladderLabel) {
237 string sensorDescr = it;
240 sscanf(it.c_str(),
"L%d.X.%d", &layer, &sensor);
241 std::pair<float, float> avgEffL =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, layer, -1,
243 addVariable(Form(
"avgEffL%dX%dUV", layer, sensor), avgEffL);
249 string sensorDescr = it;
253 sscanf(it.c_str(),
"%d.%d.%d", &layer, &ladder, &sensor);
254 std::pair<float, float> avgEffL =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, layer, ladder,
256 addVariable(Form(
"avgEffL%d%d%dUV", layer, ladder, sensor), avgEffL);
261 TH1F* h_clusterCharge_L3U = (TH1F*)
findHist(
"SVDClsTrk/SVDTRK_ClusterChargeU3");
262 TH1F* h_clusterCharge_L3V = (TH1F*)
findHist(
"SVDClsTrk/SVDTRK_ClusterChargeV3");
263 TH1F* h_clusterCharge_L456U = (TH1F*)
findHist(
"SVDClsTrk/SVDTRK_ClusterChargeU456");
264 TH1F* h_clusterCharge_L456V = (TH1F*)
findHist(
"SVDClsTrk/SVDTRK_ClusterChargeV456");
269 if (h_clusterCharge_L3U) h_clusterCharge_L3U->Draw();
271 if (h_clusterCharge_L3V) h_clusterCharge_L3V->Draw();
273 if (h_clusterCharge_L456U) h_clusterCharge_L456U->Draw();
275 if (h_clusterCharge_L456U) h_clusterCharge_L456U->Draw();
278 float MPVClusterChargeL3U = nan;
279 if (h_clusterCharge_L3U)
280 if (h_clusterCharge_L3U->GetEntries() != 0)
281 MPVClusterChargeL3U =
xForMaxY(h_clusterCharge_L3U);
282 float MPVClusterChargeL3V = nan;
283 if (h_clusterCharge_L3V)
284 if (h_clusterCharge_L3V->GetEntries() != 0)
285 MPVClusterChargeL3V =
xForMaxY(h_clusterCharge_L3V);
286 float MPVClusterChargeL456U = nan;
287 if (h_clusterCharge_L456U)
288 if (h_clusterCharge_L456U->GetEntries() != 0)
289 MPVClusterChargeL456U =
xForMaxY(h_clusterCharge_L456U);
290 float MPVClusterChargeL456V = nan;
291 if (h_clusterCharge_L456V)
292 if (h_clusterCharge_L456V->GetEntries() != 0)
293 MPVClusterChargeL456V =
xForMaxY(h_clusterCharge_L456V);
295 if (h_clusterCharge_L3U == NULL || h_clusterCharge_L456U == NULL) {
296 B2INFO(
"Histograms needed for MPV cluster charge on U side are not found");
298 m_monObj->setVariable(
"MPVClusterChargeL3U", MPVClusterChargeL3U);
299 m_monObj->setVariable(
"MPVClusterChargeL456U", MPVClusterChargeL456U);
302 if (h_clusterCharge_L3V == NULL || h_clusterCharge_L456V == NULL) {
303 B2INFO(
"Histograms needed for MPV cluster charge on V side are not found");
305 m_monObj->setVariable(
"MPVClusterChargeL3V", MPVClusterChargeL3V);
306 m_monObj->setVariable(
"MPVClusterChargeL456V", MPVClusterChargeL456V);
311 TH1F* h_clusterSNR_L3U = (TH1F*)
findHist(
"SVDClsTrk/SVDTRK_ClusterSNRU3");
312 TH1F* h_clusterSNR_L3V = (TH1F*)
findHist(
"SVDClsTrk/SVDTRK_ClusterSNRV3");
313 TH1F* h_clusterSNR_L456U = (TH1F*)
findHist(
"SVDClsTrk/SVDTRK_ClusterSNRU456");
314 TH1F* h_clusterSNR_L456V = (TH1F*)
findHist(
"SVDClsTrk/SVDTRK_ClusterSNRV456");
319 if (h_clusterSNR_L3U) h_clusterSNR_L3U->Draw();
321 if (h_clusterSNR_L3V) h_clusterSNR_L3V->Draw();
323 if (h_clusterSNR_L456U) h_clusterSNR_L456U->Draw();
325 if (h_clusterSNR_L456V) h_clusterSNR_L456V->Draw();
327 float MPVClusterSNRL3U = nan;
328 if (h_clusterSNR_L3U)
329 if (h_clusterSNR_L3U->GetEntries() != 0)
330 MPVClusterSNRL3U =
xForMaxY(h_clusterSNR_L3U);
331 float MPVClusterSNRL3V = nan;
332 if (h_clusterSNR_L3V)
333 if (h_clusterSNR_L3V->GetEntries() != 0)
334 MPVClusterSNRL3V =
xForMaxY(h_clusterSNR_L3V);
335 float MPVClusterSNRL456U = nan;
336 if (h_clusterSNR_L456U)
337 if (h_clusterSNR_L456U->GetEntries() != 0)
338 MPVClusterSNRL456U =
xForMaxY(h_clusterSNR_L456U);
339 float MPVClusterSNRL456V = nan;
340 if (h_clusterSNR_L456V)
341 if (h_clusterSNR_L456V->GetEntries() != 0)
342 MPVClusterSNRL456V =
xForMaxY(h_clusterSNR_L456V);
344 if (h_clusterSNR_L3U == NULL || h_clusterSNR_L456U == NULL) {
345 B2INFO(
"Histograms needed for MPV cluster SNR on U side are not found");
347 m_monObj->setVariable(
"MPVClusterSNRL3U", MPVClusterSNRL3U);
348 m_monObj->setVariable(
"MPVClusterSNRL456U", MPVClusterSNRL456U);
351 if (h_clusterSNR_L3V == NULL || h_clusterSNR_L456V == NULL) {
352 B2INFO(
"Histograms needed for MPV cluster SNR on V side are not found");
354 m_monObj->setVariable(
"MPVClusterSNRL3V", MPVClusterSNRL3V);
355 m_monObj->setVariable(
"MPVClusterSNRL456V", MPVClusterSNRL456V);
360 TH1F* h_clusterTime_L3U = (TH1F*)
findHist(
"SVDClsTrk/SVDTRK_ClusterTimeU3");
361 TH1F* h_clusterTime_L3V = (TH1F*)
findHist(
"SVDClsTrk/SVDTRK_ClusterTimeV3");
362 TH1F* h_clusterTime_L456U = (TH1F*)
findHist(
"SVDClsTrk/SVDTRK_ClusterTimeU456");
363 TH1F* h_clusterTime_L456V = (TH1F*)
findHist(
"SVDClsTrk/SVDTRK_ClusterTimeV456");
364 TH1F* h_MeanSVD3EventT0 = (TH1F*)
findHist(
"SVDHitTime/SVD3EventT0");
365 TH1F* h_MeanSVD6EventT0 = (TH1F*)
findHist(
"SVDHitTime/SVD6EventT0");
366 TH1F* h_MeanSVDEventT0 = 0x0;
368 if (h_MeanSVD3EventT0)
369 h_MeanSVDEventT0 = (TH1F*)h_MeanSVD3EventT0->Clone();
374 if (h_clusterTime_L3U) h_clusterTime_L3U->Draw();
376 if (h_clusterTime_L3V) h_clusterTime_L3V->Draw();
378 if (h_clusterTime_L456U) h_clusterTime_L456U->Draw();
380 if (h_clusterTime_L456V) h_clusterTime_L456V->Draw();
385 if (h_MeanSVD3EventT0) h_MeanSVD3EventT0->Draw();
387 if (h_MeanSVD6EventT0) h_MeanSVD6EventT0->Draw();
389 if (h_MeanSVDEventT0) {
390 if (h_MeanSVD6EventT0)
391 h_MeanSVDEventT0->Add(h_MeanSVD6EventT0);
392 h_MeanSVDEventT0->Draw();
395 float MPVClusterTimeL3U = nan;
396 if (h_clusterTime_L3U)
397 if (h_clusterTime_L3U->GetEntries() != 0)
398 MPVClusterTimeL3U =
xForMaxY(h_clusterTime_L3U);
399 float MPVClusterTimeL3V = nan;
400 if (h_clusterTime_L3V)
401 if (h_clusterTime_L3V->GetEntries() != 0)
402 MPVClusterTimeL3V =
xForMaxY(h_clusterTime_L3V);
403 float MPVClusterTimeL456U = nan;
404 if (h_clusterTime_L456U)
405 if (h_clusterTime_L456U->GetEntries() != 0)
406 MPVClusterTimeL456U =
xForMaxY(h_clusterTime_L456U);
407 float MPVClusterTimeL456V = nan;
408 if (h_clusterTime_L456V)
409 if (h_clusterTime_L456V->GetEntries() != 0)
410 MPVClusterTimeL456V =
xForMaxY(h_clusterTime_L456V);
411 float FWHMClusterTimeL3U = nan;
412 if (h_clusterTime_L3U)
413 if (h_clusterTime_L3U->GetEntries() != 0)
414 FWHMClusterTimeL3U =
histFWHM(h_clusterTime_L3U);
415 float FWHMClusterTimeL3V = nan;
416 if (h_clusterTime_L3V)
417 if (h_clusterTime_L3V->GetEntries() != 0)
418 FWHMClusterTimeL3V =
histFWHM(h_clusterTime_L3V);
419 float FWHMClusterTimeL456U = nan;
420 if (h_clusterTime_L456U)
421 if (h_clusterTime_L456U->GetEntries() != 0)
422 FWHMClusterTimeL456U =
histFWHM(h_clusterTime_L456U);
423 float FWHMClusterTimeL456V = nan;
424 if (h_clusterTime_L456V)
425 if (h_clusterTime_L456V->GetEntries() != 0)
426 FWHMClusterTimeL456V =
histFWHM(h_clusterTime_L456V);
428 float MeanSVD3EventT0 = nan;
429 if (h_MeanSVD3EventT0)
430 if (h_MeanSVD3EventT0->GetEntries() != 0)
431 MeanSVD3EventT0 =
xForMaxY(h_MeanSVD3EventT0);
433 float MeanSVD6EventT0 = nan;
434 if (h_MeanSVD6EventT0)
435 if (h_MeanSVD6EventT0->GetEntries() != 0)
436 MeanSVD6EventT0 =
xForMaxY(h_MeanSVD6EventT0);
438 float MeanSVDEventT0 = nan;
439 if (h_MeanSVDEventT0)
440 if (h_MeanSVDEventT0->GetEntries() != 0)
441 MeanSVDEventT0 =
xForMaxY(h_MeanSVDEventT0);
443 if (h_clusterTime_L3U == NULL || h_clusterTime_L456U == NULL) {
444 B2INFO(
"Histograms needed for MPV cluster time on U side are not found");
446 m_monObj->setVariable(
"MPVClusterTimeL3U", MPVClusterTimeL3U);
447 m_monObj->setVariable(
"MPVClusterTimeL456U", MPVClusterTimeL456U);
448 m_monObj->setVariable(
"FWHMClusterTimeL3U", FWHMClusterTimeL3U);
449 m_monObj->setVariable(
"FWHMClusterTimeL456U", FWHMClusterTimeL456U);
452 if (h_clusterTime_L3V == NULL || h_clusterTime_L456V == NULL) {
453 B2INFO(
"Histograms needed for MPV cluster time on V side are not found");
455 m_monObj->setVariable(
"MPVClusterTimeL3V", MPVClusterTimeL3V);
456 m_monObj->setVariable(
"MPVClusterTimeL456V", MPVClusterTimeL456V);
457 m_monObj->setVariable(
"FWHMClusterTimeL3V", FWHMClusterTimeL3V);
458 m_monObj->setVariable(
"FWHMClusterTimeL456V", FWHMClusterTimeL456V);
461 if (h_MeanSVD3EventT0 == NULL) {
462 B2INFO(
"Histograms needed for SVD Event T0 (3 samples) not found");
464 m_monObj->setVariable(
"MeanSVD3EventT0", MeanSVD3EventT0);
467 if (h_MeanSVD6EventT0 == NULL) {
468 B2INFO(
"Histograms needed for SVD Event T0 (6 samples) not found");
470 m_monObj->setVariable(
"MeanSVD6EventT0", MeanSVD6EventT0);
473 if (h_MeanSVDEventT0 == NULL) {
474 B2INFO(
"Histograms needed for SVD Event T0 (all samples) not found");
476 m_monObj->setVariable(
"MeanSVDEventT0", MeanSVDEventT0);
480 TH1F* h_maxBinU = (TH1F*)
findHist(
"SVDClsTrk/SVDTRK_StripMaxBinUAll");
481 TH1F* h_maxBinV = (TH1F*)
findHist(
"SVDClsTrk/SVDTRK_StripMaxBinVAll");
486 if (h_maxBinU) h_maxBinU->Draw();
488 if (h_maxBinV) h_maxBinV->Draw();
490 if (h_maxBinU == NULL) {
491 B2INFO(
"Histogram needed for Average MaxBin on U side is not found");
493 float avgMaxBinU = h_maxBinU->GetMean();
494 m_monObj->setVariable(
"avgMaxBinU", avgMaxBinU);
497 if (h_maxBinV == NULL) {
498 B2INFO(
"Histogram needed for Average MaxBin on V side is not found");
500 float avgMaxBinV = h_maxBinV->GetMean();
501 m_monObj->setVariable(
"avgMaxBinV", avgMaxBinV);
505 for (
const auto& it : ladderLabel) {
506 string sensorDescr = it;
509 sscanf(it.c_str(),
"L%d.X.%d", &layer, &sensor);
511 TString name = Form(
"SVDClsTrk/SVDTRK_ClusterCharge_L%d.x.%d", layer, sensor);
512 TString title = Form(
"MPVClusterCharge_L%d.x.%d", layer, sensor);
513 TH1F* h_clusterCharge = (TH1F*)
findHist(name.Data());
514 float MPVClusterCharge = nan;
516 if (h_clusterCharge->GetEntries() != 0)
517 MPVClusterCharge =
xForMaxY(h_clusterCharge);
519 if (h_clusterCharge == NULL) {
520 B2INFO(
"Histograms needed for cluster charge not found");
522 m_monObj->setVariable(title.Data(), MPVClusterCharge);
525 name = Form(
"SVDClsTrk/SVDTRK_ClusterSNR_L%d.x.%d", layer, sensor);
526 title = Form(
"MPVClusterSNR_L%d.x.%d", layer, sensor);
527 TH1F* h_clusterSNR = (TH1F*)
findHist(name.Data());
528 float MPVClusterSNR = nan;
530 if (h_clusterSNR->GetEntries() != 0)
531 MPVClusterSNR =
xForMaxY(h_clusterSNR);
533 if (h_clusterSNR == NULL) {
534 B2INFO(
"Histograms needed for cluster SNR not found");
536 m_monObj->setVariable(title.Data(), MPVClusterSNR);
542 string sensorDescr = it;
543 string valueLabel = it;
544 replace(sensorDescr.begin(), sensorDescr.end(),
'.',
'_');
545 valueLabel.erase(remove(valueLabel.begin(), valueLabel.end(),
'.'), valueLabel.end());
547 TString name = Form(
"SVDClsTrk/SVDTRK_%s_ClusterChargeU", sensorDescr.c_str());
548 TString title = Form(
"MPVClusterChargeL%sU", valueLabel.c_str());
550 TH1F* h_clusterCharge = (TH1F*)
findHist(name.Data());
551 float MPVClusterCharge = nan;
553 if (h_clusterCharge->GetEntries() != 0)
554 MPVClusterCharge =
xForMaxY(h_clusterCharge);
556 if (h_clusterCharge == NULL) {
557 B2INFO(
"Histograms needed for clusterU charge not found");
559 m_monObj->setVariable(title.Data(), MPVClusterCharge);
562 name = Form(
"SVDClsTrk/SVDTRK_%s_ClusterChargeV", sensorDescr.c_str());
563 title = Form(
"MPVClusterChargeL%sV", valueLabel.c_str());
564 h_clusterCharge = (TH1F*)
findHist(name.Data());
565 MPVClusterCharge = nan;
567 if (h_clusterCharge->GetEntries() != 0)
568 MPVClusterCharge =
xForMaxY(h_clusterCharge);
570 if (h_clusterCharge == NULL) {
571 B2INFO(
"Histograms needed for clusterV charge not found");
573 m_monObj->setVariable(title.Data(), MPVClusterCharge);
576 name = Form(
"SVDClsTrk/SVDTRK_%s_ClusterSNRU", sensorDescr.c_str());
577 title = Form(
"MPVClusterSNRL%sU", valueLabel.c_str());
578 TH1F* h_clusterSNR = (TH1F*)
findHist(name.Data());
579 float MPVClusterSNR = nan;
581 if (h_clusterSNR->GetEntries() != 0)
582 MPVClusterSNR =
xForMaxY(h_clusterSNR);
584 if (h_clusterSNR == NULL) {
585 B2INFO(
"Histograms needed for clusterU SNR not found");
587 m_monObj->setVariable(title.Data(), MPVClusterSNR);
590 name = Form(
"SVDClsTrk/SVDTRK_%s_ClusterSNRV", sensorDescr.c_str());
591 title = Form(
"MPVClusterSNRL%sV", valueLabel.c_str());
592 h_clusterSNR = (TH1F*)
findHist(name.Data());
595 if (h_clusterSNR->GetEntries() != 0)
596 MPVClusterSNR =
xForMaxY(h_clusterSNR);
598 if (h_clusterSNR == NULL) {
599 B2INFO(
"Histograms needed for clusterV SNR not found");
601 m_monObj->setVariable(title.Data(), MPVClusterSNR);
604 name = Form(
"SVDClsTrk/SVDTRK_%s_ClusterTimeU", sensorDescr.c_str());
605 title = Form(
"MPVClusterTimeL%sU", valueLabel.c_str());
606 title1 = Form(
"FWHMClusterTimeL%sU", valueLabel.c_str());
607 TH1F* h_clusterTime = (TH1F*)
findHist(name.Data());
608 float MPVClusterTime = nan;
609 float FWHMClusterTime = nan;
611 if (h_clusterTime->GetEntries() != 0) {
612 MPVClusterTime =
xForMaxY(h_clusterTime);
613 FWHMClusterTime =
histFWHM(h_clusterTime);
616 if (h_clusterTime == NULL) {
617 B2INFO(
"Histograms needed for clusterU time not found");
619 m_monObj->setVariable(title.Data(), MPVClusterTime);
620 m_monObj->setVariable(title1.Data(), FWHMClusterTime);
623 name = Form(
"SVDClsTrk/SVDTRK_%s_ClusterTimeV", sensorDescr.c_str());
624 title = Form(
"MPVClusterTimeL%sV", valueLabel.c_str());
625 title1 = Form(
"FWHMClusterTimeL%sV", valueLabel.c_str());
626 h_clusterTime = (TH1F*)
findHist(name.Data());
627 MPVClusterTime = nan;
628 FWHMClusterTime = nan;
630 if (h_clusterTime->GetEntries() != 0) {
631 MPVClusterTime =
xForMaxY(h_clusterTime);
632 FWHMClusterTime =
histFWHM(h_clusterTime);
635 if (h_clusterTime == NULL) {
636 B2INFO(
"Histograms needed for clusterU time not found");
638 m_monObj->setVariable(title.Data(), MPVClusterTime);
639 m_monObj->setVariable(title1.Data(), FWHMClusterTime);
643 B2INFO(
"DQMHistAnalysisSVDGeneral: endRun called");