106 float nan = numeric_limits<float>::quiet_NaN();
109 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",
110 "L6.X.1",
"L6.X.2",
"L6.X.3",
"L6.X.4",
"L6.X.5"
119 auto h_zs5countsU =
findHist(
"SVDExpReco/SVDDQM_StripCountsU");
120 auto h_zs5countsV =
findHist(
"SVDExpReco/SVDDQM_StripCountsV");
121 auto h_events =
findHist(
"SVDExpReco/SVDDQM_nEvents");
127 if (h_zs5countsU) h_zs5countsU->Draw(
"colz");
129 if (h_zs5countsV) h_zs5countsV->Draw(
"colz");
131 if (h_events) h_events->Draw(
"colz");
134 if (h_events) nE = h_events->GetEntries();
137 if (h_zs5countsU == NULL || h_zs5countsV == NULL || h_events == NULL) {
138 if (h_zs5countsU == NULL) {
139 B2INFO(
"Histograms needed for Average Offline Occupancy on U side are not found");
141 if (h_zs5countsV == NULL) {
142 B2INFO(
"Histograms needed for Average Offline Occupancy on V side are not found");
146 std::pair<float, float> avgOffOccL3UV =
avgOccupancyUV(h_zs5countsU, h_zs5countsV, nE, 3);
149 std::pair<float, float> avgOffOccL4UV =
avgOccupancyUV(h_zs5countsU, h_zs5countsV, nE, 4);
152 std::pair<float, float> avgOffOccL5UV =
avgOccupancyUV(h_zs5countsU, h_zs5countsV, nE, 5);
155 std::pair<float, float> avgOffOccL6UV =
avgOccupancyUV(h_zs5countsU, h_zs5countsV, nE, 6);
172 for (
const auto& it : ladderLabel) {
175 sscanf(it.c_str(),
"L%d.X.%d", &layer, &sensor);
176 std::pair<float, float> avgOffOccL =
avgOccupancyUV(h_zs5countsU, h_zs5countsV, nE, layer, -1, sensor);
177 addVariable(Form(
"avgOffOccL%dX%dUV", layer, sensor), avgOffOccL);
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 auto h_found_tracksU =
findHist(
"SVDEfficiency/TrackHitsU");
194 auto h_matched_clusU =
findHist(
"SVDEfficiency/MatchedHitsU");
195 auto h_found_tracksV =
findHist(
"SVDEfficiency/TrackHitsV");
196 auto h_matched_clusV =
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) {
239 sscanf(it.c_str(),
"L%d.X.%d", &layer, &sensor);
240 std::pair<float, float> avgEffL =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, layer, -1,
242 addVariable(Form(
"avgEffL%dX%dUV", layer, sensor), avgEffL);
251 sscanf(it.c_str(),
"%d.%d.%d", &layer, &ladder, &sensor);
252 std::pair<float, float> avgEffL =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, layer, ladder,
254 addVariable(Form(
"avgEffL%d%d%dUV", layer, ladder, sensor), avgEffL);
259 auto h_clusterCharge_L3U =
findHist(
"SVDClsTrk/SVDTRK_ClusterChargeU3");
260 auto h_clusterCharge_L3V =
findHist(
"SVDClsTrk/SVDTRK_ClusterChargeV3");
261 auto h_clusterCharge_L456U =
findHist(
"SVDClsTrk/SVDTRK_ClusterChargeU456");
262 auto h_clusterCharge_L456V =
findHist(
"SVDClsTrk/SVDTRK_ClusterChargeV456");
267 if (h_clusterCharge_L3U) h_clusterCharge_L3U->Draw();
269 if (h_clusterCharge_L3V) h_clusterCharge_L3V->Draw();
271 if (h_clusterCharge_L456U) h_clusterCharge_L456U->Draw();
273 if (h_clusterCharge_L456U) h_clusterCharge_L456U->Draw();
276 float MPVClusterChargeL3U = nan;
277 if (h_clusterCharge_L3U)
278 if (h_clusterCharge_L3U->GetEntries() != 0)
279 MPVClusterChargeL3U =
xForMaxY(h_clusterCharge_L3U);
280 float MPVClusterChargeL3V = nan;
281 if (h_clusterCharge_L3V)
282 if (h_clusterCharge_L3V->GetEntries() != 0)
283 MPVClusterChargeL3V =
xForMaxY(h_clusterCharge_L3V);
284 float MPVClusterChargeL456U = nan;
285 if (h_clusterCharge_L456U)
286 if (h_clusterCharge_L456U->GetEntries() != 0)
287 MPVClusterChargeL456U =
xForMaxY(h_clusterCharge_L456U);
288 float MPVClusterChargeL456V = nan;
289 if (h_clusterCharge_L456V)
290 if (h_clusterCharge_L456V->GetEntries() != 0)
291 MPVClusterChargeL456V =
xForMaxY(h_clusterCharge_L456V);
293 if (h_clusterCharge_L3U == NULL || h_clusterCharge_L456U == NULL) {
294 B2INFO(
"Histograms needed for MPV cluster charge on U side are not found");
296 m_monObj->setVariable(
"MPVClusterChargeL3U", MPVClusterChargeL3U);
297 m_monObj->setVariable(
"MPVClusterChargeL456U", MPVClusterChargeL456U);
300 if (h_clusterCharge_L3V == NULL || h_clusterCharge_L456V == NULL) {
301 B2INFO(
"Histograms needed for MPV cluster charge on V side are not found");
303 m_monObj->setVariable(
"MPVClusterChargeL3V", MPVClusterChargeL3V);
304 m_monObj->setVariable(
"MPVClusterChargeL456V", MPVClusterChargeL456V);
309 auto h_clusterSNR_L3U =
findHist(
"SVDClsTrk/SVDTRK_ClusterSNRU3");
310 auto h_clusterSNR_L3V =
findHist(
"SVDClsTrk/SVDTRK_ClusterSNRV3");
311 auto h_clusterSNR_L456U =
findHist(
"SVDClsTrk/SVDTRK_ClusterSNRU456");
312 auto h_clusterSNR_L456V =
findHist(
"SVDClsTrk/SVDTRK_ClusterSNRV456");
317 if (h_clusterSNR_L3U) h_clusterSNR_L3U->Draw();
319 if (h_clusterSNR_L3V) h_clusterSNR_L3V->Draw();
321 if (h_clusterSNR_L456U) h_clusterSNR_L456U->Draw();
323 if (h_clusterSNR_L456V) h_clusterSNR_L456V->Draw();
325 float MPVClusterSNRL3U = nan;
326 if (h_clusterSNR_L3U)
327 if (h_clusterSNR_L3U->GetEntries() != 0)
328 MPVClusterSNRL3U =
xForMaxY(h_clusterSNR_L3U);
329 float MPVClusterSNRL3V = nan;
330 if (h_clusterSNR_L3V)
331 if (h_clusterSNR_L3V->GetEntries() != 0)
332 MPVClusterSNRL3V =
xForMaxY(h_clusterSNR_L3V);
333 float MPVClusterSNRL456U = nan;
334 if (h_clusterSNR_L456U)
335 if (h_clusterSNR_L456U->GetEntries() != 0)
336 MPVClusterSNRL456U =
xForMaxY(h_clusterSNR_L456U);
337 float MPVClusterSNRL456V = nan;
338 if (h_clusterSNR_L456V)
339 if (h_clusterSNR_L456V->GetEntries() != 0)
340 MPVClusterSNRL456V =
xForMaxY(h_clusterSNR_L456V);
342 if (h_clusterSNR_L3U == NULL || h_clusterSNR_L456U == NULL) {
343 B2INFO(
"Histograms needed for MPV cluster SNR on U side are not found");
345 m_monObj->setVariable(
"MPVClusterSNRL3U", MPVClusterSNRL3U);
346 m_monObj->setVariable(
"MPVClusterSNRL456U", MPVClusterSNRL456U);
349 if (h_clusterSNR_L3V == NULL || h_clusterSNR_L456V == NULL) {
350 B2INFO(
"Histograms needed for MPV cluster SNR on V side are not found");
352 m_monObj->setVariable(
"MPVClusterSNRL3V", MPVClusterSNRL3V);
353 m_monObj->setVariable(
"MPVClusterSNRL456V", MPVClusterSNRL456V);
358 auto h_clusterTime_L3U =
findHist(
"SVDClsTrk/SVDTRK_ClusterTimeU3");
359 auto h_clusterTime_L3V =
findHist(
"SVDClsTrk/SVDTRK_ClusterTimeV3");
360 auto h_clusterTime_L456U =
findHist(
"SVDClsTrk/SVDTRK_ClusterTimeU456");
361 auto h_clusterTime_L456V =
findHist(
"SVDClsTrk/SVDTRK_ClusterTimeV456");
362 auto h_MeanSVD3EventT0 =
findHist(
"SVDHitTime/SVD3EventT0");
363 auto h_MeanSVD6EventT0 =
findHist(
"SVDHitTime/SVD6EventT0");
364 TH1F* h_MeanSVDEventT0 = 0x0;
366 if (h_MeanSVD3EventT0)
367 h_MeanSVDEventT0 =
dynamic_cast<TH1F*
>(h_MeanSVD3EventT0->Clone());
372 if (h_clusterTime_L3U) h_clusterTime_L3U->Draw();
374 if (h_clusterTime_L3V) h_clusterTime_L3V->Draw();
376 if (h_clusterTime_L456U) h_clusterTime_L456U->Draw();
378 if (h_clusterTime_L456V) h_clusterTime_L456V->Draw();
383 if (h_MeanSVD3EventT0) h_MeanSVD3EventT0->Draw();
385 if (h_MeanSVD6EventT0) h_MeanSVD6EventT0->Draw();
387 if (h_MeanSVDEventT0) {
388 if (h_MeanSVD6EventT0)
389 h_MeanSVDEventT0->Add(h_MeanSVD6EventT0);
390 h_MeanSVDEventT0->Draw();
393 float MPVClusterTimeL3U = nan;
394 if (h_clusterTime_L3U)
395 if (h_clusterTime_L3U->GetEntries() != 0)
396 MPVClusterTimeL3U =
xForMaxY(h_clusterTime_L3U);
397 float MPVClusterTimeL3V = nan;
398 if (h_clusterTime_L3V)
399 if (h_clusterTime_L3V->GetEntries() != 0)
400 MPVClusterTimeL3V =
xForMaxY(h_clusterTime_L3V);
401 float MPVClusterTimeL456U = nan;
402 if (h_clusterTime_L456U)
403 if (h_clusterTime_L456U->GetEntries() != 0)
404 MPVClusterTimeL456U =
xForMaxY(h_clusterTime_L456U);
405 float MPVClusterTimeL456V = nan;
406 if (h_clusterTime_L456V)
407 if (h_clusterTime_L456V->GetEntries() != 0)
408 MPVClusterTimeL456V =
xForMaxY(h_clusterTime_L456V);
409 float FWHMClusterTimeL3U = nan;
410 if (h_clusterTime_L3U)
411 if (h_clusterTime_L3U->GetEntries() != 0)
412 FWHMClusterTimeL3U =
histFWHM(h_clusterTime_L3U);
413 float FWHMClusterTimeL3V = nan;
414 if (h_clusterTime_L3V)
415 if (h_clusterTime_L3V->GetEntries() != 0)
416 FWHMClusterTimeL3V =
histFWHM(h_clusterTime_L3V);
417 float FWHMClusterTimeL456U = nan;
418 if (h_clusterTime_L456U)
419 if (h_clusterTime_L456U->GetEntries() != 0)
420 FWHMClusterTimeL456U =
histFWHM(h_clusterTime_L456U);
421 float FWHMClusterTimeL456V = nan;
422 if (h_clusterTime_L456V)
423 if (h_clusterTime_L456V->GetEntries() != 0)
424 FWHMClusterTimeL456V =
histFWHM(h_clusterTime_L456V);
426 float MeanSVD3EventT0 = nan;
427 if (h_MeanSVD3EventT0)
428 if (h_MeanSVD3EventT0->GetEntries() != 0)
429 MeanSVD3EventT0 =
xForMaxY(h_MeanSVD3EventT0);
431 float MeanSVD6EventT0 = nan;
432 if (h_MeanSVD6EventT0)
433 if (h_MeanSVD6EventT0->GetEntries() != 0)
434 MeanSVD6EventT0 =
xForMaxY(h_MeanSVD6EventT0);
436 float MeanSVDEventT0 = nan;
437 if (h_MeanSVDEventT0)
438 if (h_MeanSVDEventT0->GetEntries() != 0)
439 MeanSVDEventT0 =
xForMaxY(h_MeanSVDEventT0);
441 if (h_clusterTime_L3U == NULL || h_clusterTime_L456U == NULL) {
442 B2INFO(
"Histograms needed for MPV cluster time on U side are not found");
444 m_monObj->setVariable(
"MPVClusterTimeL3U", MPVClusterTimeL3U);
445 m_monObj->setVariable(
"MPVClusterTimeL456U", MPVClusterTimeL456U);
446 m_monObj->setVariable(
"FWHMClusterTimeL3U", FWHMClusterTimeL3U);
447 m_monObj->setVariable(
"FWHMClusterTimeL456U", FWHMClusterTimeL456U);
450 if (h_clusterTime_L3V == NULL || h_clusterTime_L456V == NULL) {
451 B2INFO(
"Histograms needed for MPV cluster time on V side are not found");
453 m_monObj->setVariable(
"MPVClusterTimeL3V", MPVClusterTimeL3V);
454 m_monObj->setVariable(
"MPVClusterTimeL456V", MPVClusterTimeL456V);
455 m_monObj->setVariable(
"FWHMClusterTimeL3V", FWHMClusterTimeL3V);
456 m_monObj->setVariable(
"FWHMClusterTimeL456V", FWHMClusterTimeL456V);
459 if (h_MeanSVD3EventT0 == NULL) {
460 B2INFO(
"Histograms needed for SVD Event T0 (3 samples) not found");
462 m_monObj->setVariable(
"MeanSVD3EventT0", MeanSVD3EventT0);
465 if (h_MeanSVD6EventT0 == NULL) {
466 B2INFO(
"Histograms needed for SVD Event T0 (6 samples) not found");
468 m_monObj->setVariable(
"MeanSVD6EventT0", MeanSVD6EventT0);
471 if (h_MeanSVDEventT0 == NULL) {
472 B2INFO(
"Histograms needed for SVD Event T0 (all samples) not found");
474 m_monObj->setVariable(
"MeanSVDEventT0", MeanSVDEventT0);
478 auto h_maxBinU =
findHist(
"SVDClsTrk/SVDTRK_StripMaxBinUAll");
479 auto h_maxBinV =
findHist(
"SVDClsTrk/SVDTRK_StripMaxBinVAll");
484 if (h_maxBinU) h_maxBinU->Draw();
486 if (h_maxBinV) h_maxBinV->Draw();
488 if (h_maxBinU == NULL) {
489 B2INFO(
"Histogram needed for Average MaxBin on U side is not found");
491 float avgMaxBinU = h_maxBinU->GetMean();
492 m_monObj->setVariable(
"avgMaxBinU", avgMaxBinU);
495 if (h_maxBinV == NULL) {
496 B2INFO(
"Histogram needed for Average MaxBin on V side is not found");
498 float avgMaxBinV = h_maxBinV->GetMean();
499 m_monObj->setVariable(
"avgMaxBinV", avgMaxBinV);
503 for (
const auto& it : ladderLabel) {
506 sscanf(it.c_str(),
"L%d.X.%d", &layer, &sensor);
508 TString name = Form(
"SVDClsTrk/SVDTRK_ClusterCharge_L%d.x.%d", layer, sensor);
509 TString title = Form(
"MPVClusterCharge_L%d.x.%d", layer, sensor);
510 auto h_clusterCharge =
findHist(name.Data());
511 float MPVClusterCharge = nan;
513 if (h_clusterCharge->GetEntries() != 0)
514 MPVClusterCharge =
xForMaxY(h_clusterCharge);
516 if (h_clusterCharge == NULL) {
517 B2INFO(
"Histograms needed for cluster charge not found");
519 m_monObj->setVariable(title.Data(), MPVClusterCharge);
522 name = Form(
"SVDClsTrk/SVDTRK_ClusterSNR_L%d.x.%d", layer, sensor);
523 title = Form(
"MPVClusterSNR_L%d.x.%d", layer, sensor);
524 auto h_clusterSNR =
findHist(name.Data());
525 float MPVClusterSNR = nan;
527 if (h_clusterSNR->GetEntries() != 0)
528 MPVClusterSNR =
xForMaxY(h_clusterSNR);
530 if (h_clusterSNR == NULL) {
531 B2INFO(
"Histograms needed for cluster SNR not found");
533 m_monObj->setVariable(title.Data(), MPVClusterSNR);
539 string sensorDescr = it;
540 string valueLabel = it;
541 replace(sensorDescr.begin(), sensorDescr.end(),
'.',
'_');
542 valueLabel.erase(remove(valueLabel.begin(), valueLabel.end(),
'.'), valueLabel.end());
544 TString name = Form(
"SVDClsTrk/SVDTRK_%s_ClusterChargeU", sensorDescr.c_str());
545 TString title = Form(
"MPVClusterChargeL%sU", valueLabel.c_str());
547 auto h_clusterChargeU =
findHist(name.Data());
548 float MPVClusterCharge = nan;
549 if (h_clusterChargeU)
550 if (h_clusterChargeU->GetEntries() != 0)
551 MPVClusterCharge =
xForMaxY(h_clusterChargeU);
553 if (h_clusterChargeU == NULL) {
554 B2INFO(
"Histograms needed for clusterU charge not found");
556 m_monObj->setVariable(title.Data(), MPVClusterCharge);
559 name = Form(
"SVDClsTrk/SVDTRK_%s_ClusterChargeV", sensorDescr.c_str());
560 title = Form(
"MPVClusterChargeL%sV", valueLabel.c_str());
561 auto h_clusterChargeV =
findHist(name.Data());
562 MPVClusterCharge = nan;
563 if (h_clusterChargeV)
564 if (h_clusterChargeV->GetEntries() != 0)
565 MPVClusterCharge =
xForMaxY(h_clusterChargeV);
567 if (h_clusterChargeV == NULL) {
568 B2INFO(
"Histograms needed for clusterV charge not found");
570 m_monObj->setVariable(title.Data(), MPVClusterCharge);
573 name = Form(
"SVDClsTrk/SVDTRK_%s_ClusterSNRU", sensorDescr.c_str());
574 title = Form(
"MPVClusterSNRL%sU", valueLabel.c_str());
575 auto h_clusterSNRU =
findHist(name.Data());
576 float MPVClusterSNR = nan;
578 if (h_clusterSNRU->GetEntries() != 0)
579 MPVClusterSNR =
xForMaxY(h_clusterSNRU);
581 if (h_clusterSNRU == NULL) {
582 B2INFO(
"Histograms needed for clusterU SNR not found");
584 m_monObj->setVariable(title.Data(), MPVClusterSNR);
587 name = Form(
"SVDClsTrk/SVDTRK_%s_ClusterSNRV", sensorDescr.c_str());
588 title = Form(
"MPVClusterSNRL%sV", valueLabel.c_str());
589 auto h_clusterSNRV =
findHist(name.Data());
592 if (h_clusterSNRV->GetEntries() != 0)
593 MPVClusterSNR =
xForMaxY(h_clusterSNRV);
595 if (h_clusterSNRV == NULL) {
596 B2INFO(
"Histograms needed for clusterV SNR not found");
598 m_monObj->setVariable(title.Data(), MPVClusterSNR);
601 name = Form(
"SVDClsTrk/SVDTRK_%s_ClusterTimeU", sensorDescr.c_str());
602 title = Form(
"MPVClusterTimeL%sU", valueLabel.c_str());
603 title1 = Form(
"FWHMClusterTimeL%sU", valueLabel.c_str());
604 auto h_clusterTimeU =
findHist(name.Data());
605 float MPVClusterTime = nan;
606 float FWHMClusterTime = nan;
608 if (h_clusterTimeU->GetEntries() != 0) {
609 MPVClusterTime =
xForMaxY(h_clusterTimeU);
610 FWHMClusterTime =
histFWHM(h_clusterTimeU);
613 if (h_clusterTimeU == NULL) {
614 B2INFO(
"Histograms needed for clusterU time not found");
616 m_monObj->setVariable(title.Data(), MPVClusterTime);
617 m_monObj->setVariable(title1.Data(), FWHMClusterTime);
620 name = Form(
"SVDClsTrk/SVDTRK_%s_ClusterTimeV", sensorDescr.c_str());
621 title = Form(
"MPVClusterTimeL%sV", valueLabel.c_str());
622 title1 = Form(
"FWHMClusterTimeL%sV", valueLabel.c_str());
623 auto h_clusterTimeV =
findHist(name.Data());
624 MPVClusterTime = nan;
625 FWHMClusterTime = nan;
627 if (h_clusterTimeV->GetEntries() != 0) {
628 MPVClusterTime =
xForMaxY(h_clusterTimeV);
629 FWHMClusterTime =
histFWHM(h_clusterTimeV);
632 if (h_clusterTimeV == NULL) {
633 B2INFO(
"Histograms needed for clusterV time not found");
635 m_monObj->setVariable(title.Data(), MPVClusterTime);
636 m_monObj->setVariable(title1.Data(), FWHMClusterTime);
640 B2INFO(
"DQMHistAnalysisSVDGeneral: endRun called");