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 TH1F* h_zs5countsU = (TH1F*)
findHist(
"SVDExpReco/SVDDQM_StripCountsU");
120 TH1F* h_zs5countsV = (TH1F*)
findHist(
"SVDExpReco/SVDDQM_StripCountsV");
121 TH1F* h_events = (TH1F*)
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) {
173 string sensorDescr = it;
176 sscanf(it.c_str(),
"L%d.X.%d", &layer, &sensor);
177 std::pair<float, float> avgOffOccL =
avgOccupancyUV(h_zs5countsU, h_zs5countsV, nE, layer, -1, sensor);
178 addVariable(Form(
"avgOffOccL%dX%dUV", layer, sensor), avgOffOccL);
183 string sensorDescr = it;
187 sscanf(it.c_str(),
"%d.%d.%d", &layer, &ladder, &sensor);
188 std::pair<float, float> avgOffOccL =
avgOccupancyUV(h_zs5countsU, h_zs5countsV, nE, layer, ladder, sensor);
189 addVariable(Form(
"avgOffOccL%d%d%dUV", layer, ladder, sensor), avgOffOccL);
195 TH2F* h_found_tracksU = (TH2F*)
findHist(
"SVDEfficiency/TrackHitsU");
196 TH2F* h_matched_clusU = (TH2F*)
findHist(
"SVDEfficiency/MatchedHitsU");
197 TH2F* h_found_tracksV = (TH2F*)
findHist(
"SVDEfficiency/TrackHitsV");
198 TH2F* h_matched_clusV = (TH2F*)
findHist(
"SVDEfficiency/MatchedHitsV");
203 if (h_found_tracksU) h_found_tracksU->Draw(
"colz");
205 if (h_found_tracksV) h_found_tracksV->Draw(
"colz");
207 if (h_matched_clusU) h_matched_clusU->Draw(
"colz");
209 if (h_matched_clusV) h_matched_clusV->Draw(
"colz");
212 if (h_matched_clusU == NULL || h_matched_clusV == NULL || h_found_tracksU == NULL) {
213 if (h_matched_clusU == NULL) {
214 B2INFO(
"Histograms needed for Average Efficiency on U side are not found");
216 if (h_matched_clusV == NULL) {
217 B2INFO(
"Histograms needed for Average Efficiency on V side are not found");
221 std::pair<float, float> avgEffL3 =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 3);
224 std::pair<float, float> avgEffL4 =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 4);
227 std::pair<float, float> avgEffL5 =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 5);
230 std::pair<float, float> avgEffL6 =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, 6);
234 std::pair<float, float> avgEffL3456 =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV);
238 for (
const auto& it : ladderLabel) {
239 string sensorDescr = it;
242 sscanf(it.c_str(),
"L%d.X.%d", &layer, &sensor);
243 std::pair<float, float> avgEffL =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, layer, -1,
245 addVariable(Form(
"avgEffL%dX%dUV", layer, sensor), avgEffL);
251 string sensorDescr = it;
255 sscanf(it.c_str(),
"%d.%d.%d", &layer, &ladder, &sensor);
256 std::pair<float, float> avgEffL =
avgEfficiencyUV(h_matched_clusU, h_matched_clusV, h_found_tracksU, h_found_tracksV, layer, ladder,
258 addVariable(Form(
"avgEffL%d%d%dUV", layer, ladder, sensor), avgEffL);
263 TH1F* h_clusterCharge_L3U = (TH1F*)
findHist(
"SVDClsTrk/SVDTRK_ClusterChargeU3");
264 TH1F* h_clusterCharge_L3V = (TH1F*)
findHist(
"SVDClsTrk/SVDTRK_ClusterChargeV3");
265 TH1F* h_clusterCharge_L456U = (TH1F*)
findHist(
"SVDClsTrk/SVDTRK_ClusterChargeU456");
266 TH1F* h_clusterCharge_L456V = (TH1F*)
findHist(
"SVDClsTrk/SVDTRK_ClusterChargeV456");
271 if (h_clusterCharge_L3U) h_clusterCharge_L3U->Draw();
273 if (h_clusterCharge_L3V) h_clusterCharge_L3V->Draw();
275 if (h_clusterCharge_L456U) h_clusterCharge_L456U->Draw();
277 if (h_clusterCharge_L456U) h_clusterCharge_L456U->Draw();
280 float MPVClusterChargeL3U = nan;
281 if (h_clusterCharge_L3U)
282 if (h_clusterCharge_L3U->GetEntries() != 0)
283 MPVClusterChargeL3U =
xForMaxY(h_clusterCharge_L3U);
284 float MPVClusterChargeL3V = nan;
285 if (h_clusterCharge_L3V)
286 if (h_clusterCharge_L3V->GetEntries() != 0)
287 MPVClusterChargeL3V =
xForMaxY(h_clusterCharge_L3V);
288 float MPVClusterChargeL456U = nan;
289 if (h_clusterCharge_L456U)
290 if (h_clusterCharge_L456U->GetEntries() != 0)
291 MPVClusterChargeL456U =
xForMaxY(h_clusterCharge_L456U);
292 float MPVClusterChargeL456V = nan;
293 if (h_clusterCharge_L456V)
294 if (h_clusterCharge_L456V->GetEntries() != 0)
295 MPVClusterChargeL456V =
xForMaxY(h_clusterCharge_L456V);
297 if (h_clusterCharge_L3U == NULL || h_clusterCharge_L456U == NULL) {
298 B2INFO(
"Histograms needed for MPV cluster charge on U side are not found");
300 m_monObj->setVariable(
"MPVClusterChargeL3U", MPVClusterChargeL3U);
301 m_monObj->setVariable(
"MPVClusterChargeL456U", MPVClusterChargeL456U);
304 if (h_clusterCharge_L3V == NULL || h_clusterCharge_L456V == NULL) {
305 B2INFO(
"Histograms needed for MPV cluster charge on V side are not found");
307 m_monObj->setVariable(
"MPVClusterChargeL3V", MPVClusterChargeL3V);
308 m_monObj->setVariable(
"MPVClusterChargeL456V", MPVClusterChargeL456V);
313 TH1F* h_clusterSNR_L3U = (TH1F*)
findHist(
"SVDClsTrk/SVDTRK_ClusterSNRU3");
314 TH1F* h_clusterSNR_L3V = (TH1F*)
findHist(
"SVDClsTrk/SVDTRK_ClusterSNRV3");
315 TH1F* h_clusterSNR_L456U = (TH1F*)
findHist(
"SVDClsTrk/SVDTRK_ClusterSNRU456");
316 TH1F* h_clusterSNR_L456V = (TH1F*)
findHist(
"SVDClsTrk/SVDTRK_ClusterSNRV456");
321 if (h_clusterSNR_L3U) h_clusterSNR_L3U->Draw();
323 if (h_clusterSNR_L3V) h_clusterSNR_L3V->Draw();
325 if (h_clusterSNR_L456U) h_clusterSNR_L456U->Draw();
327 if (h_clusterSNR_L456V) h_clusterSNR_L456V->Draw();
329 float MPVClusterSNRL3U = nan;
330 if (h_clusterSNR_L3U)
331 if (h_clusterSNR_L3U->GetEntries() != 0)
332 MPVClusterSNRL3U =
xForMaxY(h_clusterSNR_L3U);
333 float MPVClusterSNRL3V = nan;
334 if (h_clusterSNR_L3V)
335 if (h_clusterSNR_L3V->GetEntries() != 0)
336 MPVClusterSNRL3V =
xForMaxY(h_clusterSNR_L3V);
337 float MPVClusterSNRL456U = nan;
338 if (h_clusterSNR_L456U)
339 if (h_clusterSNR_L456U->GetEntries() != 0)
340 MPVClusterSNRL456U =
xForMaxY(h_clusterSNR_L456U);
341 float MPVClusterSNRL456V = nan;
342 if (h_clusterSNR_L456V)
343 if (h_clusterSNR_L456V->GetEntries() != 0)
344 MPVClusterSNRL456V =
xForMaxY(h_clusterSNR_L456V);
346 if (h_clusterSNR_L3U == NULL || h_clusterSNR_L456U == NULL) {
347 B2INFO(
"Histograms needed for MPV cluster SNR on U side are not found");
349 m_monObj->setVariable(
"MPVClusterSNRL3U", MPVClusterSNRL3U);
350 m_monObj->setVariable(
"MPVClusterSNRL456U", MPVClusterSNRL456U);
353 if (h_clusterSNR_L3V == NULL || h_clusterSNR_L456V == NULL) {
354 B2INFO(
"Histograms needed for MPV cluster SNR on V side are not found");
356 m_monObj->setVariable(
"MPVClusterSNRL3V", MPVClusterSNRL3V);
357 m_monObj->setVariable(
"MPVClusterSNRL456V", MPVClusterSNRL456V);
362 TH1F* h_clusterTime_L3U = (TH1F*)
findHist(
"SVDClsTrk/SVDTRK_ClusterTimeU3");
363 TH1F* h_clusterTime_L3V = (TH1F*)
findHist(
"SVDClsTrk/SVDTRK_ClusterTimeV3");
364 TH1F* h_clusterTime_L456U = (TH1F*)
findHist(
"SVDClsTrk/SVDTRK_ClusterTimeU456");
365 TH1F* h_clusterTime_L456V = (TH1F*)
findHist(
"SVDClsTrk/SVDTRK_ClusterTimeV456");
366 TH1F* h_MeanSVD3EventT0 = (TH1F*)
findHist(
"SVDHitTime/SVD3EventT0");
367 TH1F* h_MeanSVD6EventT0 = (TH1F*)
findHist(
"SVDHitTime/SVD6EventT0");
368 TH1F* h_MeanSVDEventT0 = 0x0;
370 if (h_MeanSVD3EventT0)
371 h_MeanSVDEventT0 = (TH1F*)h_MeanSVD3EventT0->Clone();
376 if (h_clusterTime_L3U) h_clusterTime_L3U->Draw();
378 if (h_clusterTime_L3V) h_clusterTime_L3V->Draw();
380 if (h_clusterTime_L456U) h_clusterTime_L456U->Draw();
382 if (h_clusterTime_L456V) h_clusterTime_L456V->Draw();
387 if (h_MeanSVD3EventT0) h_MeanSVD3EventT0->Draw();
389 if (h_MeanSVD6EventT0) h_MeanSVD6EventT0->Draw();
391 if (h_MeanSVDEventT0) {
392 if (h_MeanSVD6EventT0)
393 h_MeanSVDEventT0->Add(h_MeanSVD6EventT0);
394 h_MeanSVDEventT0->Draw();
397 float MPVClusterTimeL3U = nan;
398 if (h_clusterTime_L3U)
399 if (h_clusterTime_L3U->GetEntries() != 0)
400 MPVClusterTimeL3U =
xForMaxY(h_clusterTime_L3U);
401 float MPVClusterTimeL3V = nan;
402 if (h_clusterTime_L3V)
403 if (h_clusterTime_L3V->GetEntries() != 0)
404 MPVClusterTimeL3V =
xForMaxY(h_clusterTime_L3V);
405 float MPVClusterTimeL456U = nan;
406 if (h_clusterTime_L456U)
407 if (h_clusterTime_L456U->GetEntries() != 0)
408 MPVClusterTimeL456U =
xForMaxY(h_clusterTime_L456U);
409 float MPVClusterTimeL456V = nan;
410 if (h_clusterTime_L456V)
411 if (h_clusterTime_L456V->GetEntries() != 0)
412 MPVClusterTimeL456V =
xForMaxY(h_clusterTime_L456V);
413 float FWHMClusterTimeL3U = nan;
414 if (h_clusterTime_L3U)
415 if (h_clusterTime_L3U->GetEntries() != 0)
416 FWHMClusterTimeL3U =
histFWHM(h_clusterTime_L3U);
417 float FWHMClusterTimeL3V = nan;
418 if (h_clusterTime_L3V)
419 if (h_clusterTime_L3V->GetEntries() != 0)
420 FWHMClusterTimeL3V =
histFWHM(h_clusterTime_L3V);
421 float FWHMClusterTimeL456U = nan;
422 if (h_clusterTime_L456U)
423 if (h_clusterTime_L456U->GetEntries() != 0)
424 FWHMClusterTimeL456U =
histFWHM(h_clusterTime_L456U);
425 float FWHMClusterTimeL456V = nan;
426 if (h_clusterTime_L456V)
427 if (h_clusterTime_L456V->GetEntries() != 0)
428 FWHMClusterTimeL456V =
histFWHM(h_clusterTime_L456V);
430 float MeanSVD3EventT0 = nan;
431 if (h_MeanSVD3EventT0)
432 if (h_MeanSVD3EventT0->GetEntries() != 0)
433 MeanSVD3EventT0 =
xForMaxY(h_MeanSVD3EventT0);
435 float MeanSVD6EventT0 = nan;
436 if (h_MeanSVD6EventT0)
437 if (h_MeanSVD6EventT0->GetEntries() != 0)
438 MeanSVD6EventT0 =
xForMaxY(h_MeanSVD6EventT0);
440 float MeanSVDEventT0 = nan;
441 if (h_MeanSVDEventT0)
442 if (h_MeanSVDEventT0->GetEntries() != 0)
443 MeanSVDEventT0 =
xForMaxY(h_MeanSVDEventT0);
445 if (h_clusterTime_L3U == NULL || h_clusterTime_L456U == NULL) {
446 B2INFO(
"Histograms needed for MPV cluster time on U side are not found");
448 m_monObj->setVariable(
"MPVClusterTimeL3U", MPVClusterTimeL3U);
449 m_monObj->setVariable(
"MPVClusterTimeL456U", MPVClusterTimeL456U);
450 m_monObj->setVariable(
"FWHMClusterTimeL3U", FWHMClusterTimeL3U);
451 m_monObj->setVariable(
"FWHMClusterTimeL456U", FWHMClusterTimeL456U);
454 if (h_clusterTime_L3V == NULL || h_clusterTime_L456V == NULL) {
455 B2INFO(
"Histograms needed for MPV cluster time on V side are not found");
457 m_monObj->setVariable(
"MPVClusterTimeL3V", MPVClusterTimeL3V);
458 m_monObj->setVariable(
"MPVClusterTimeL456V", MPVClusterTimeL456V);
459 m_monObj->setVariable(
"FWHMClusterTimeL3V", FWHMClusterTimeL3V);
460 m_monObj->setVariable(
"FWHMClusterTimeL456V", FWHMClusterTimeL456V);
463 if (h_MeanSVD3EventT0 == NULL) {
464 B2INFO(
"Histograms needed for SVD Event T0 (3 samples) not found");
466 m_monObj->setVariable(
"MeanSVD3EventT0", MeanSVD3EventT0);
469 if (h_MeanSVD6EventT0 == NULL) {
470 B2INFO(
"Histograms needed for SVD Event T0 (6 samples) not found");
472 m_monObj->setVariable(
"MeanSVD6EventT0", MeanSVD6EventT0);
475 if (h_MeanSVDEventT0 == NULL) {
476 B2INFO(
"Histograms needed for SVD Event T0 (all samples) not found");
478 m_monObj->setVariable(
"MeanSVDEventT0", MeanSVDEventT0);
482 TH1F* h_maxBinU = (TH1F*)
findHist(
"SVDClsTrk/SVDTRK_StripMaxBinUAll");
483 TH1F* h_maxBinV = (TH1F*)
findHist(
"SVDClsTrk/SVDTRK_StripMaxBinVAll");
488 if (h_maxBinU) h_maxBinU->Draw();
490 if (h_maxBinV) h_maxBinV->Draw();
492 if (h_maxBinU == NULL) {
493 B2INFO(
"Histogram needed for Average MaxBin on U side is not found");
495 float avgMaxBinU = h_maxBinU->GetMean();
496 m_monObj->setVariable(
"avgMaxBinU", avgMaxBinU);
499 if (h_maxBinV == NULL) {
500 B2INFO(
"Histogram needed for Average MaxBin on V side is not found");
502 float avgMaxBinV = h_maxBinV->GetMean();
503 m_monObj->setVariable(
"avgMaxBinV", avgMaxBinV);
507 for (
const auto& it : ladderLabel) {
508 string sensorDescr = it;
511 sscanf(it.c_str(),
"L%d.X.%d", &layer, &sensor);
513 TString name = Form(
"SVDClsTrk/SVDTRK_ClusterCharge_L%d.x.%d", layer, sensor);
514 TString title = Form(
"MPVClusterCharge_L%d.x.%d", layer, sensor);
515 TH1F* h_clusterCharge = (TH1F*)
findHist(name.Data());
516 float MPVClusterCharge = nan;
518 if (h_clusterCharge->GetEntries() != 0)
519 MPVClusterCharge =
xForMaxY(h_clusterCharge);
521 if (h_clusterCharge == NULL) {
522 B2INFO(
"Histograms needed for cluster charge not found");
524 m_monObj->setVariable(title.Data(), MPVClusterCharge);
527 name = Form(
"SVDClsTrk/SVDTRK_ClusterSNR_L%d.x.%d", layer, sensor);
528 title = Form(
"MPVClusterSNR_L%d.x.%d", layer, sensor);
529 TH1F* h_clusterSNR = (TH1F*)
findHist(name.Data());
530 float MPVClusterSNR = nan;
532 if (h_clusterSNR->GetEntries() != 0)
533 MPVClusterSNR =
xForMaxY(h_clusterSNR);
535 if (h_clusterSNR == NULL) {
536 B2INFO(
"Histograms needed for cluster SNR not found");
538 m_monObj->setVariable(title.Data(), MPVClusterSNR);
544 string sensorDescr = it;
545 string valueLabel = it;
546 replace(sensorDescr.begin(), sensorDescr.end(),
'.',
'_');
547 valueLabel.erase(remove(valueLabel.begin(), valueLabel.end(),
'.'), valueLabel.end());
549 TString name = Form(
"SVDClsTrk/SVDTRK_%s_ClusterChargeU", sensorDescr.c_str());
550 TString title = Form(
"MPVClusterChargeL%sU", valueLabel.c_str());
552 TH1F* h_clusterCharge = (TH1F*)
findHist(name.Data());
553 float MPVClusterCharge = nan;
555 if (h_clusterCharge->GetEntries() != 0)
556 MPVClusterCharge =
xForMaxY(h_clusterCharge);
558 if (h_clusterCharge == NULL) {
559 B2INFO(
"Histograms needed for clusterU charge not found");
561 m_monObj->setVariable(title.Data(), MPVClusterCharge);
564 name = Form(
"SVDClsTrk/SVDTRK_%s_ClusterChargeV", sensorDescr.c_str());
565 title = Form(
"MPVClusterChargeL%sV", valueLabel.c_str());
566 h_clusterCharge = (TH1F*)
findHist(name.Data());
567 MPVClusterCharge = nan;
569 if (h_clusterCharge->GetEntries() != 0)
570 MPVClusterCharge =
xForMaxY(h_clusterCharge);
572 if (h_clusterCharge == NULL) {
573 B2INFO(
"Histograms needed for clusterV charge not found");
575 m_monObj->setVariable(title.Data(), MPVClusterCharge);
578 name = Form(
"SVDClsTrk/SVDTRK_%s_ClusterSNRU", sensorDescr.c_str());
579 title = Form(
"MPVClusterSNRL%sU", valueLabel.c_str());
580 TH1F* h_clusterSNR = (TH1F*)
findHist(name.Data());
581 float MPVClusterSNR = nan;
583 if (h_clusterSNR->GetEntries() != 0)
584 MPVClusterSNR =
xForMaxY(h_clusterSNR);
586 if (h_clusterSNR == NULL) {
587 B2INFO(
"Histograms needed for clusterU SNR not found");
589 m_monObj->setVariable(title.Data(), MPVClusterSNR);
592 name = Form(
"SVDClsTrk/SVDTRK_%s_ClusterSNRV", sensorDescr.c_str());
593 title = Form(
"MPVClusterSNRL%sV", valueLabel.c_str());
594 h_clusterSNR = (TH1F*)
findHist(name.Data());
597 if (h_clusterSNR->GetEntries() != 0)
598 MPVClusterSNR =
xForMaxY(h_clusterSNR);
600 if (h_clusterSNR == NULL) {
601 B2INFO(
"Histograms needed for clusterV SNR not found");
603 m_monObj->setVariable(title.Data(), MPVClusterSNR);
606 name = Form(
"SVDClsTrk/SVDTRK_%s_ClusterTimeU", sensorDescr.c_str());
607 title = Form(
"MPVClusterTimeL%sU", valueLabel.c_str());
608 title1 = Form(
"FWHMClusterTimeL%sU", valueLabel.c_str());
609 TH1F* h_clusterTime = (TH1F*)
findHist(name.Data());
610 float MPVClusterTime = nan;
611 float FWHMClusterTime = nan;
613 if (h_clusterTime->GetEntries() != 0) {
614 MPVClusterTime =
xForMaxY(h_clusterTime);
615 FWHMClusterTime =
histFWHM(h_clusterTime);
618 if (h_clusterTime == NULL) {
619 B2INFO(
"Histograms needed for clusterU time not found");
621 m_monObj->setVariable(title.Data(), MPVClusterTime);
622 m_monObj->setVariable(title1.Data(), FWHMClusterTime);
625 name = Form(
"SVDClsTrk/SVDTRK_%s_ClusterTimeV", sensorDescr.c_str());
626 title = Form(
"MPVClusterTimeL%sV", valueLabel.c_str());
627 title1 = Form(
"FWHMClusterTimeL%sV", valueLabel.c_str());
628 h_clusterTime = (TH1F*)
findHist(name.Data());
629 MPVClusterTime = nan;
630 FWHMClusterTime = nan;
632 if (h_clusterTime->GetEntries() != 0) {
633 MPVClusterTime =
xForMaxY(h_clusterTime);
634 FWHMClusterTime =
histFWHM(h_clusterTime);
637 if (h_clusterTime == NULL) {
638 B2INFO(
"Histograms needed for clusterU time not found");
640 m_monObj->setVariable(title.Data(), MPVClusterTime);
641 m_monObj->setVariable(title1.Data(), FWHMClusterTime);
645 B2INFO(
"DQMHistAnalysisSVDGeneral: endRun called");