28 const std::string DATA_DIR =
"/nusoft/app/web/htdoc/nova/datacheck/nearline/data";
62 TDatime *
TNow =
new TDatime;
63 TDatime *
SRtime =
new TDatime;
64 TDatime *SRtime_fine =
new TDatime;
66 int XNowGMT = TNowGMT->Convert(kTRUE);
67 int XNow = TNow ->Convert(kFALSE);
72 int XDayAgo = XNow - 60*60*24;
73 int XWeekAgo = XNow - 60*60*24*7;
74 int XMonthAgo = XNow - 60*60*24*30;
75 int XSixMonthsAgo = XNow - 60*60*24*26*7;
76 int XYearAgo = XNow - 60*60*24*52*7;
96 else if(t_prd ==
"Week"){
100 else if(t_prd ==
"Month"){
102 time_ago = XMonthAgo;
104 else if(t_prd ==
"6Months"){
106 time_ago = XSixMonthsAgo;
108 else if(t_prd ==
"Year"){
117 if (trigger ==
"t00"){
121 else if(trigger ==
"DDActivity1"){
122 trig =
"DDActivity1";
123 trigname =
"DDActivity";
125 else if(trigger ==
"t02"){
133 else if(t_prd ==
"Week"){
137 else if(t_prd ==
"Month"){
139 time_ago = XMonthAgo;
141 else if(t_prd ==
"6Months"){
143 time_ago = XSixMonthsAgo;
145 else if(t_prd ==
"Year"){
154 if (trigger ==
"Beamline"){
156 trigname =
"Beamline";
158 else if(trigger ==
"DDActivity1"){
159 trig =
"DDActivity1";
160 trigname =
"DDActivity";
162 else if(trigger ==
"t02"){
166 else if(trigger ==
"Spill"){
168 trigname =
"Full Spill";
174 else if(t_prd ==
"Week"){
178 else if(t_prd ==
"Month"){
180 time_ago = XMonthAgo;
182 else if(t_prd ==
"6Months"){
184 time_ago = XSixMonthsAgo;
186 else if(t_prd ==
"Year"){
192 unsigned int year = 0;
193 unsigned short int month = 0;
194 unsigned short int day = 0;
201 unsigned int run = 0;
208 unsigned int yearEnd = 0;
209 unsigned short int monthEnd = 0;
210 unsigned short int dayEnd = 0;
211 double HourEnd = 0.0;
216 gSystem->Setenv(
"TZ",
"UTC");
217 gStyle->SetTimeOffset(0);
225 const unsigned int Npar = 5;
229 const unsigned int Nerr = 10;
230 const unsigned int Nalert = 5;
233 if(t_prd ==
"Day") t_n = 1;
234 if(t_prd ==
"Week") t_n = 7;
235 if(t_prd ==
"Month") t_n = 30;
236 if(t_prd ==
"6Months") t_n = 7*26;
237 if(t_prd ==
"Year") t_n = 7*52;
238 const unsigned int Npoint = 1440 * t_n;
249 char SpillInfoFile[128]=
"";
254 sprintf(SpillInfoFile,
"%s/POTSpillRateDay.root",DATA_DIR.c_str());
256 sprintf(SpillInfoFile,
"%s/POTSpillRateWeek.root",DATA_DIR.c_str());
258 sprintf(SpillInfoFile,
"%s/POTSpillRateMonth.root",DATA_DIR.c_str());
259 if(t_prd ==
"6Months")
260 sprintf(SpillInfoFile,
"%s/POTSpillRate6Months.root",DATA_DIR.c_str());
262 sprintf(SpillInfoFile,
"%s/POTSpillRateYear.root",DATA_DIR.c_str());
281 inFile.open(
"FDOnMonDayFileList_t02-t00.txt");
283 else if(t_prd ==
"Week"){
285 inFile.open(
"FDOnMonWeekFileList_t02-t00.txt");
287 else if(t_prd ==
"Month"){
289 inFile.open(
"FDOnMonMonthFileList_t02-t00.txt");
291 else if(t_prd ==
"6Months"){
292 inFile.open(
"FDOnMon6MonthsFileList_t02-t00.txt");
294 else if(t_prd ==
"Year"){
295 inFile.open(
"FDOnMonYearFileList_t02-t00.txt");
303 inFile.open(
"NDOnMonDayFileList_t00.txt");
305 inFile.open(
"NDOnMonDayFileList_t02.txt");
306 else if(trig ==
"DDActivity1")
307 inFile.open(
"NDOnMonDayFileList_DDActivity1.txt");
309 else if(t_prd ==
"Week"){
312 inFile.open(
"NDOnMonWeekFileList_t00.txt");
314 inFile.open(
"NDOnMonWeekFileList_t02.txt");
315 else if(trig ==
"DDActivity1")
316 inFile.open(
"NDOnMonWeekFileList_DDActivity1.txt");
318 else if(t_prd ==
"Month"){
321 inFile.open(
"NDOnMonMonthFileList_t00.txt");
323 inFile.open(
"NDOnMonMonthFileList_t02.txt");
324 else if(trig ==
"DDActivity1")
325 inFile.open(
"NDOnMonMonthFileList_DDActivity1.txt");
327 else if(t_prd ==
"6Months"){
329 inFile.open(
"NDOnMon6MonthsFileList_t00.txt");
331 inFile.open(
"NDOnMon6MonthsFileList_t02.txt");
332 else if(trig ==
"DDActivity1")
333 inFile.open(
"NDOnMon6MonthsFileList_DDActivity1.txt");
335 else if(t_prd ==
"Year"){
337 inFile.open(
"NDOnMonYearFileList_t00.txt");
339 inFile.open(
"NDOnMonYearFileList_t02.txt");
340 else if(trig ==
"DDActivity1")
341 inFile.open(
"NDOnMonYearFileList_DDActivity1.txt");
348 if(trig ==
"Beamline")
349 inFile.open(
"TBOnMonDayFileList_Beamline.txt");
350 else if(trig ==
"t02")
351 inFile.open(
"TBOnMonDayFileList_t02.txt");
352 else if(trig ==
"DDActivity1")
353 inFile.open(
"TBOnMonDayFileList_DDActivity1.txt");
354 else if(trig ==
"Spill")
355 inFile.open(
"TBOnMonDayFileList_Spill.txt");
357 else if(t_prd ==
"Week"){
358 if(trig ==
"Beamline")
359 inFile.open(
"TBOnMonWeekFileList_Beamline.txt");
360 else if(trig ==
"t02")
361 inFile.open(
"TBOnMonWeekFileList_t02.txt");
362 else if(trig ==
"DDActivity1")
363 inFile.open(
"TBOnMonWeekFileList_DDActivity1.txt");
364 else if(trig ==
"Spill")
365 inFile.open(
"TBOnMonWeekFileList_Spill.txt");
367 else if(t_prd ==
"Month"){
368 if(trig ==
"Beamline")
369 inFile.open(
"TBOnMonMonthFileList_Beamline.txt");
370 else if(trig ==
"t02")
371 inFile.open(
"TBOnMonMonthFileList_t02.txt");
372 else if(trig ==
"DDActivity1")
373 inFile.open(
"TBOnMonMonthFileList_DDActivity1.txt");
374 else if(trig ==
"Spill")
375 inFile.open(
"TBOnMonMonthFileList_Spill.txt");
377 else if(t_prd ==
"6Months"){
378 if(trig==
"Beamline")
379 inFile.open(
"TBOnMon6MonthsFileList_Beamline.txt");
381 inFile.open(
"TBOnMon6MonthsFileList_t02.txt");
382 else if(trig ==
"DDActivity1")
383 inFile.open(
"TBOnMon6MonthsFileList_DDActivity1.txt");
384 else if(trig ==
"Spill")
385 inFile.open(
"TBOnMon6MonthsFileList_Spill.txt");
387 else if(t_prd ==
"Year"){
388 if(trig==
"Beamline")
389 inFile.open(
"TBOnMonYearFileList_Beamline.txt");
390 else if(trig==
"t02")
391 inFile.open(
"TBOnMonYearFileList_t02.txt");
392 else if(trig ==
"DDActivity1")
393 inFile.open(
"TBOnMonYearFileList_DDActivity1.txt");
394 else if(trig ==
"Spill")
395 inFile.open(
"TBOnMonYearFileList_Spill.txt");
400 if(trigger ==
"DDActivity1")
408 errorHistoNames[0] =
"ErrorEventIncomplete";
409 errorHistoNames[1] =
"ErrorDataMissing";
410 errorHistoNames[2] =
"ErrorMilliSliceIncomplete";
411 errorHistoNames[3] =
"ErrorDCMDataPresent";
412 errorHistoNames[4] =
"ErrorComm";
413 errorHistoNames[5] =
"ErrorADC";
414 errorHistoNames[6] =
"ErrorTECC";
415 errorHistoNames[7] =
"ErrorDataDrop";
416 errorHistoNames[8] =
"ErrorLinkStatus";
417 errorHistoNames[9] =
"ErrorFEBDataPresent";
421 errorHistoTitles[0] =
"Event Incomplete Error";
422 errorHistoTitles[1] =
"Data Missing Error";
423 errorHistoTitles[2] =
"Millislice Incomplete Error";
424 errorHistoTitles[3] =
"DCM Data Present Error";
425 errorHistoTitles[4] =
"Comm. Error";
426 errorHistoTitles[5] =
"ADC Error";
427 errorHistoTitles[6] =
"TECC Error";
428 errorHistoTitles[7] =
"Data Drop Error";
429 errorHistoTitles[8] =
"Link Status Error";
430 errorHistoTitles[9] =
"FEB Data Present Error";
435 alertHistoNames[0] =
"AlertSimulationsFlag";
436 alertHistoNames[1] =
"AlertDAQEnabled";
437 alertHistoNames[2] =
"AlertTECCEnable";
438 alertHistoNames[3] =
"AlertFIFOFull";
439 alertHistoNames[4] =
"AlertDebugMode";
443 alertHistoTitles[0] =
"Simulations Flag";
444 alertHistoTitles[1] =
"DAQ Enabled";
445 alertHistoTitles[2] =
"TECC Enabled";
446 alertHistoTitles[3] =
"Event FIFO Full";
447 alertHistoTitles[4] =
"Debug Mode";
451 TH1F *hErrorHistos[
Npar][Nerr];
452 TH1F *hAlertHistos[
Npar][Nalert];
455 TH2F *hFEBRateHitMapDay[
Npar];
456 TH2F *hFEBDropOutMapDay[
Npar];
457 TH2F *hFEBTimeHitMapDay[
Npar];
458 TH2F *hFEBaveADCHitMapDay[
Npar];
459 TH2F *hFEBhitsHitMapDay[
Npar];
461 TH1F *hFEBRateSpectrumDay[
Npar];
462 TH2F *hFEBRateSpectrumVsTimeDay[
Npar];
464 TH1F *hTPlotALLDay[
Npar];
465 TH2F *hTPlotALLVsTimeDay[
Npar];
467 TH1F *hTPlotZOOMDay[
Npar];
468 TH2F *hTPlotZOOMVsTimeDay[
Npar];
470 TH1F *hNormalizationVsTimeDay[
Npar];
471 TH1F *hTimingNormVsTimeDay[
Npar];
473 int *NDCMtimeDay[
Npar];
475 int NDCMDayCount[
Npar];
476 int *NFEBtimeDay[
Npar];
478 int NFEBDayCount[
Npar];
479 int *NFEBtimeDDay[
Npar];
481 int NFEBDDayCount[
Npar];
482 int *NPIXperSRtimeDay[
Npar];
483 int *NPIXperSRDay[
Npar];
484 int NPIXperSRDayCount[
Npar];
485 int *NPIXperEVTtimeDay[
Npar];
486 int *NPIXperEVTDay[
Npar];
487 int NPIXperEVTDayCount[
Npar];
489 double *Trig00timeDay[
Npar];
490 double *Trig00Day[
Npar];
491 double *Trig01timeDay[
Npar];
492 double *Trig01Day[
Npar];
493 double *Trig02timeDay[
Npar];
494 double *Trig02Day[
Npar];
495 double *TrigActtimeDay[
Npar];
496 double *TrigActDay[
Npar];
497 int NTrigDayCount[
Npar];
499 int NSpillEntryCount[
Npar];
500 double *SpillCountValue[
Npar];
501 double *SpillCountTime[
Npar];
507 double *dcm0timeDay[
Npar];
508 double *Ndcm0Day[
Npar];
509 int Ndcm0DayCount[
Npar];
514 for(
unsigned int i = 0;
i <
Npar;
i++){
515 NDCMtimeDay[
i] =
new int[Npoint];
516 NDCMDay[
i] =
new int[Npoint];
517 NFEBtimeDay[
i] =
new int[Npoint];
518 NFEBtimeDDay[
i] =
new int[Npoint];
519 NFEBDay[
i] =
new int[Npoint];
520 NFEBDDay[
i] =
new int[Npoint];
521 NPIXperSRtimeDay[
i] =
new int[Npoint];
522 NPIXperSRDay[
i] =
new int[Npoint];
523 NPIXperEVTtimeDay[
i] =
new int[Npoint];
524 NPIXperEVTDay[
i] =
new int[Npoint];
526 Trig00timeDay[
i] =
new double[Npoint];
527 Trig00Day[
i] =
new double[Npoint];
528 Trig01timeDay[
i] =
new double[Npoint];
529 Trig01Day[
i] =
new double[Npoint];
530 Trig02timeDay[
i] =
new double[Npoint];
531 Trig02Day[
i] =
new double[Npoint];
532 TrigActtimeDay[
i] =
new double[Npoint];
533 TrigActDay[
i] =
new double[Npoint];
535 SpillCountValue[
i] =
new double[Npoint];
536 SpillCountTime[
i] =
new double[Npoint];
541 dcm0timeDay[
i] =
new double[Npoint];
542 Ndcm0Day[
i] =
new double[Npoint];
546 if(period ==
"Day") time =
"past 24 hrs.";
547 if(period ==
"Week") time =
"past 7 days";
548 if(period ==
"Month") time =
"past 30 days";
549 if(period ==
"6Months") time =
"past 26 week";
550 if(period ==
"Year") time =
"past 52 weeks";
563 if( (
det_type ==
"NearDet" ||
det_type ==
"TestBeam") && period ==
"Day") Timebin_n = 18;
591 for(
unsigned int p = 0;
p <
Npar; ++
p) {
593 char histotitle[128];
595 for(
unsigned int e = 0;
e < Nerr; ++
e) {
596 sprintf(histoname,
"h%sP%.1u",errorHistoNames[
e].c_str(),
p);
597 sprintf(histotitle,
"%s %s (%s) - partition %.1u;(central time);",trigname.c_str(),errorHistoTitles[
e].c_str(),time.c_str(),
p);
598 hErrorHistos[
p][
e] =
new TH1F(histoname,histotitle,1440,time_ago,XNow);
602 for(
unsigned int a = 0;
a < Nalert; ++
a) {
603 sprintf(histoname,
"h%sP%.1u",alertHistoNames[
a].c_str(),
p);
604 sprintf(histotitle,
"%s %s (%s) - partition %.1u;(central time);",trigname.c_str(),alertHistoTitles[
a].c_str(),time.c_str(),
p);
605 hAlertHistos[
p][
a] =
new TH1F(histoname,histotitle,1440,time_ago,XNow);
609 sprintf(histoname,
"hQDayP%.1u",
p);
610 sprintf(histotitle,
"%s ADC Spectra (%s) - partition %.1u;ADC;",trigname.c_str(),time.c_str(),
p);
611 hQDay[
p] =
new TH1F(histoname,histotitle,4100,0,4100);
613 sprintf(histoname,
"hFEBRateHitMapDayP%.1u",
p);
614 sprintf(histotitle,
"%s FEB Hit Rates (%s) - partition %.1u",trigname.c_str(),time.c_str(),
p);
615 hFEBRateHitMapDay[
p] =
new TH2F(histoname,histotitle,FEBxbin_n,FEBxbin_min,FEBxbin_max,FEBybin_n,FEBybin_min,FEBybin_max);
617 sprintf(histoname,
"hFEBDropOutMapDayP%.1u",
p);
618 sprintf(histotitle,
"%s FEB Number of Drop Outs (%s) - partition %.1u",trigname.c_str(),time.c_str(),
p);
619 hFEBDropOutMapDay[
p] =
new TH2F(histoname,histotitle,FEBxbin_n,FEBxbin_min,FEBxbin_max,FEBybin_n,FEBybin_min,FEBybin_max);
621 sprintf(histoname,
"hFEBTimeHitMapDayP%.1u",
p);
622 sprintf(histotitle,
"%s FEB Live Time (%s) - partition %.1u",trigname.c_str(),time.c_str(),
p);
623 hFEBTimeHitMapDay[
p] =
new TH2F(histoname,histotitle,FEBxbin_n,FEBxbin_min,FEBxbin_max,FEBybin_n,FEBybin_min,FEBybin_max);
625 sprintf(histoname,
"hFEBaveADCHitMapDayP%.1u",
p);
626 sprintf(histotitle,
"%s Average ADC per FEB (%s) - partition %.1u",trigname.c_str(),time.c_str(),
p);
627 hFEBaveADCHitMapDay[
p] =
new TH2F(histoname,histotitle,FEBxbin_n,FEBxbin_min,FEBxbin_max,FEBybin_n,FEBybin_min,FEBybin_max);
629 sprintf(histoname,
"hFEBhitsHitMapDayP%.1u",
p);
630 sprintf(histotitle,
"%s FEB Number of Hits (%s) - partition %.1u",trigname.c_str(),time.c_str(),
p);
631 hFEBhitsHitMapDay[
p] =
new TH2F(histoname,histotitle,FEBxbin_n,FEBxbin_min,FEBxbin_max,FEBybin_n,FEBybin_min,FEBybin_max);
633 sprintf(histoname,
"hFEBRateSpectrumDayP%.1u",
p);
634 sprintf(histotitle,
"%s FEB Hit Rate Spectrum (%s) - partition %.1u;Log_{10}(rate);",trigname.c_str(),time.c_str(),
p);
635 hFEBRateSpectrumDay[
p] =
new TH1F(histoname,histotitle,200,1,6);
637 sprintf(histoname,
"hFEBRateSpectrumVsTimeDayP%.1u",
p);
638 sprintf(histotitle,
"%s FEB Hit Rate Spectra vs. Time - partition %.1u;(central time);Log_{10}(rate)",trigname.c_str(),
p);
639 hFEBRateSpectrumVsTimeDay[
p] =
new TH2F(histoname,histotitle,Timebin_n,time_ago,XNow,200,1,6);
641 sprintf(histoname,
"hTPlotALLDayP%.1u",
p);
642 sprintf(histotitle,
"%s Time Distribution for All Hits (%s) - partition %.1u;Hit Time [#musec];",trigname.c_str(),time.c_str(),
p);
643 hTPlotALLDay[
p] =
new TH1F(histoname,histotitle,350,-100,600);
644 sprintf(histoname,
"hTPlotALLVsTimeDayP%.1u",
p);
645 sprintf(histotitle,
"%s Time Distribution for All Hits vs. Time - partition %.1u;(central time);Hit Time [#musec]",trigname.c_str(),
p);
646 hTPlotALLVsTimeDay[
p] =
new TH2F(histoname,histotitle,Timebin_n,time_ago,XNow,350,-100,600);
647 sprintf(histoname,
"hTPlotZOOMDayP%.1u",
p);
648 sprintf(histotitle,
"%s Time Distribution for All Hits (%s) - partition %.1u;Hit Time [#musec];",trigname.c_str(),time.c_str(),
p);
649 hTPlotZOOMDay[
p] =
new TH1F(histoname,histotitle,200,212,237);
650 sprintf(histoname,
"hTPlotZOOMVsTimeDayP%.1u",
p);
651 sprintf(histotitle,
"%s Time Distribution for All Hits vs. Time - partition %.1u;(central time);Hit Time [#musec]",trigname.c_str(),
p);
652 hTPlotZOOMVsTimeDay[
p] =
new TH2F(histoname,histotitle,Timebin_n,time_ago,XNow,200,212,237);
653 sprintf(histoname,
"hNormalizationVsTimeDayP%.1u",
p);
654 sprintf(histotitle,
"%s Day Normalization - partition %.1u",trigname.c_str(),
p);
655 hNormalizationVsTimeDay[
p] =
new TH1F(histoname,histotitle,Timebin_n,time_ago,XNow);
656 sprintf(histoname,
"hTimingNormVsTimeDayP%.1u",
p);
657 sprintf(histotitle,
"%s Day Timing Normalization - partition %.1u",trigname.c_str(),
p);
658 hTimingNormVsTimeDay[
p] =
new TH1F(histoname,histotitle,Timebin_n,time_ago,XNow);
661 NFEBDDayCount[
p] = 0;
662 NPIXperSRDayCount[
p] = 0;
663 NPIXperEVTDayCount[
p] = 0;
664 NTrigDayCount[
p] = 0;
665 NSpillEntryCount[0] = 0;
667 Ndcm0DayCount[
p] = 0;
675 std::cout <<
"\n\nChecking for Beam Summary File...\n\n";
677 TFile* fileBeam = TFile::Open(SpillInfoFile);
678 TTree* BeamTree =
dynamic_cast<TTree*
>(fileBeam->Get(
"BeamMetrics"));
681 BeamTree->SetBranchAddress(
"Time", ×tamp);
682 BeamTree->SetBranchAddress(
"SpillRate", &spills);
684 int n_entries = BeamTree->GetEntries();
688 NSpillEntryCount[0] =0;
689 for (
int entryid = 0; entryid < n_entries; entryid++){
690 BeamTree->GetEntry(entryid);
694 if ( timestamp > time_ago && timestamp < XNow ){
696 SpillCountValue[0][entryid]=spills;
697 NSpillEntryCount[0] ++;
730 unsigned int nFilesProcessed = 0;
732 std::cout <<
"\n\nChecking for file...\n\n";
733 while(inFile.good()) {
734 if ((++nFilesProcessed % 100) == 0)
std::cout <<
"\nProcessed " << nFilesProcessed <<
" files.";
738 TFile fileD(filenameD);
741 TTree *
header = (TTree*)fileD.Get(
"Header");
743 header->SetBranchAddress(
"StartYear", &year);
744 header->SetBranchAddress(
"StartMonth", &month);
745 header->SetBranchAddress(
"StartDay", &day);
746 header->SetBranchAddress(
"StartHour", &Hour);
747 header->SetBranchAddress(
"EndYear", &yearEnd);
748 header->SetBranchAddress(
"EndMonth", &monthEnd);
749 header->SetBranchAddress(
"EndDay", &dayEnd);
750 header->SetBranchAddress(
"EndHour", &HourEnd);
751 header->SetBranchAddress(
"Run", &run);
752 header->SetBranchAddress(
"Subrun", &subrun);
753 header->SetBranchAddress(
"Partition", &par);
757 Min = (Hour-
hour)*60.0;
758 min = (Hour-
hour)*60.0;
759 sec = (Min-
min)*60.0;
762 SRtime->Set(year,month,day,hour,min,sec);
766 Min = (HourEnd-
hour)*60.0;
767 min = (HourEnd-
hour)*60.0;
768 sec = (Min-
min)*60.0;
771 SRtime->Set(yearEnd,monthEnd,dayEnd,hour,min,sec);
773 SRdur = 3600.0*(HourEnd-Hour);
775 SRdur = 3600.0*(HourEnd+24.0-Hour);
777 if(Xsrtime < time_ago)
continue;
784 else if(subrun > LastSR) {
794 if(SRdur == 0.0)
continue;
799 TH2F *hAEtemp = (TH2F*)fileD.FindObjectAny(
"AEVsHour");
802 if(hAEtemp != 0 && header != 0) {
804 for(
unsigned int e = 0;
e < Nerr; ++
e) {
806 for(
unsigned int xb = 61; xb < 1500; ++xb) {
809 double content = hAEtemp->GetBinContent(hAEtemp->GetBin(xb,2*
e+1));
811 double eventTime = hAEtemp->GetXaxis()->GetBinCenter(xb);
813 int hour_fine = (
int)eventTime;
814 int min_fine = (
int) ((eventTime - (
double)hour_fine)*60.0);
815 int sec_fine = (
int) ((eventTime - (
double)hour_fine - (double)min_fine/60.0)*3600.0);
817 SRtime_fine->Set(year,month,day,hour_fine,min_fine,sec_fine);
818 Xsrtime_fine = SRtime_fine->Convert() -
GMToffset;
820 hErrorHistos[
par][
e]->Fill(Xsrtime_fine,content);
826 TH2F *hAAtemp = (TH2F*)fileD.FindObjectAny(
"AAVsHour");
829 if(hAAtemp != 0 && header != 0) {
831 for(
unsigned int a = 0;
a < Nalert; ++
a) {
833 for(
unsigned int xb = 61; xb < 1500; ++xb) {
836 double content = hAAtemp->GetBinContent(hAAtemp->GetBin(xb,2*
a+1));
838 double eventTime = hAAtemp->GetXaxis()->GetBinCenter(xb);
840 int hour_fine = (
int)eventTime;
841 int min_fine = (
int) ((eventTime - (
double)hour_fine)*60.0);
842 int sec_fine = (
int) ((eventTime - (
double)hour_fine - (double)min_fine/60.0)*3600.0);
844 SRtime_fine->Set(year,month,day,hour_fine,min_fine,sec_fine);
845 Xsrtime_fine = SRtime_fine->Convert() -
GMToffset;
847 hAlertHistos[
par][
a]->Fill(Xsrtime_fine,content);
852 TH1F *hQtemp = (TH1F*)fileD.FindObjectAny(
"QPlotALL");
854 hQDay[
par]->Add(hQtemp,1.0);
857 TH2F *hFEBRateTemp = (TH2F*)fileD.FindObjectAny(
"FEBHitMap");
858 TH1F *hTime = (TH1F*)fileD.FindObjectAny(
"RecordedTime");
859 if(hFEBRateTemp != 0 && hTime != 0) {
860 livetime = (hTime->Integral())*(5.0
E-7);
861 hFEBRateHitMapDay[
par]->Add(hFEBRateTemp,1.0);
862 for(
int i = 1;
i <= hFEBRateTemp->GetNbinsX(); ++
i) {
863 for(
int j = 1;
j <= hFEBRateTemp->GetNbinsY(); ++
j) {
864 double bin1 = hFEBRateTemp->GetBinContent(hFEBRateTemp->GetBin(
i,
j));
865 double bin2 = hFEBTimeHitMapDay[
par]->GetBinContent(hFEBTimeHitMapDay[par]->GetBin(
i,
j));
866 if(bin1 > 0.0) hFEBTimeHitMapDay[
par]->SetBinContent(hFEBTimeHitMapDay[par]->GetBin(
i,
j),bin2+livetime);
871 TH2F *hFEBDropOut = (TH2F*)fileD.FindObjectAny(
"FEBShutOff");
872 if(hFEBDropOut != 0 && header !=0){
873 hFEBDropOutMapDay[
par]->Add(hFEBDropOut,1.0);
876 TH2F *hFEBtotADCTemp = (TH2F*)fileD.FindObjectAny(
"TotADCFEBHitMap");
877 if(hFEBtotADCTemp != 0 && hFEBRateTemp != 0) {
878 hFEBaveADCHitMapDay[
par]->Add(hFEBtotADCTemp,1.0);
879 hFEBhitsHitMapDay[
par]->Add(hFEBRateTemp,1.0);
882 TH2F *hDCMHit = (TH2F*)fileD.FindObjectAny(
"DCMHitMap");
883 if(hDCMHit != 0 && header !=0) {
885 for(
int i = 1;
i <= hDCMHit->GetNbinsX();
i++){
886 for(
int j = 1;
j <= hDCMHit->GetNbinsY();
j++){
887 if(hDCMHit->GetBinContent(hDCMHit->GetBin(
i,
j)) > 0)
891 NDCMtimeDay[
par][NDCMDayCount[
par]] = Xsrtime;
892 NDCMDay [
par][NDCMDayCount[
par]] = DCMhitcount;
896 TH2F *hFEBHit = (TH2F*)fileD.FindObjectAny(
"FEBHitMap");
897 TH2F *hFEBRate = (TH2F*)fileD.FindObjectAny(
"FEBHitRateMap");
898 TH2F *hFEBRateSpec = (TH2F*)fileD.FindObjectAny(
"FEBHitRateSpectrum");
899 if(hFEBRate != 0 && header != 0) {
900 hNormalizationVsTimeDay[
par]->Fill(Xsrtime);
901 hTimingNormVsTimeDay[
par]->Fill(Xsrtime, SRdur);
903 for(
int i = 1;
i <= hFEBRate->GetNbinsX(); ++
i) {
904 for(
int j = 1;
j <= hFEBRate->GetNbinsY(); ++
j) {
905 double rate = hFEBRate->GetBinContent(hFEBRate->GetBin(
i,
j));
912 hFEBRateSpectrumVsTimeDay[
par]->Fill(Xsrtime,rate);
916 if(hFEBHit != 0 && header != 0){
918 for(
int i = 1;
i <= hFEBHit->GetNbinsX();
i++){
919 for(
int j = 1;
j <= hFEBHit->GetNbinsY();
j++){
920 if(hFEBHit->GetBinContent(hFEBHit->GetBin(
i,
j)) > 0)
924 NFEBDay [
par][NFEBDayCount[
par]] = FEBhitcount;
926 NFEBtimeDay[
par][NFEBDayCount[
par]] = Xsrtime;
928 if(hFEBDropOut != 0 && header != 0){
929 int FEBdropoutcount = 0;
930 for(
int i = 1;
i <= hFEBDropOut->GetNbinsX();
i++){
931 for(
int j = 1;
j <= hFEBDropOut->GetNbinsY();
j++){
932 FEBdropoutcount += hFEBDropOut->GetBinContent(hFEBDropOut->GetBin(
i,
j));
935 NFEBDDay[
par][NFEBDDayCount[
par]] = FEBdropoutcount;
936 NFEBDDayCount[
par]++;
937 NFEBtimeDDay[
par][NFEBDDayCount[
par]] = Xsrtime;
939 TH1F *hTPlotALLTemp = (TH1F*)fileD.FindObjectAny(
"TPlotALL");
940 if(hTPlotALLTemp != 0 && header != 0) {
941 hTPlotALLDay[
par]->Add(hTPlotALLTemp);
943 for(
int i = 1;
i <= hTPlotALLTemp->GetNbinsX(); ++
i) {
944 double content = hTPlotALLTemp->GetBinContent(hTPlotALLTemp->GetBin(
i));
945 hTPlotALLVsTimeDay[
par]->Fill(Xsrtime,hTPlotALLTemp->GetBinCenter(
i),
content);
949 TH1F *hTPlotZOOMTemp = (TH1F*)fileD.FindObjectAny(
"TPlotZOOM");
950 if(hTPlotZOOMTemp != 0 && header != 0) {
951 hTPlotZOOMDay[
par]->Add(hTPlotZOOMTemp);
953 for(
int i = 1;
i <= hTPlotZOOMTemp->GetNbinsX(); ++
i) {
954 double content = hTPlotZOOMTemp->GetBinContent(hTPlotZOOMTemp->GetBin(
i));
955 hTPlotZOOMVsTimeDay[
par]->Fill(Xsrtime,hTPlotZOOMTemp->GetBinCenter(
i),
content);
959 TH2F *hPixelRateSpec = (TH2F*)fileD.FindObjectAny(
"PixelHitRateSpectrum");
960 if(hPixelRateSpec != 0 && header !=0) {
961 NPIXperSRtimeDay[
par][NPIXperSRDayCount[
par]] = Xsrtime;
962 NPIXperSRDay [
par][NPIXperSRDayCount[
par]] = hPixelRateSpec->Integral();
963 NPIXperSRDayCount[
par]++;
966 TH2F *hNPIXvsTime = (TH2F*)fileD.FindObjectAny(
"NhitVsHour");
967 if(hNPIXvsTime != 0 && header != 0) {
968 NPIXperEVTtimeDay[
par][NPIXperEVTDayCount[
par]] = Xsrtime;
969 NPIXperEVTDay [
par][NPIXperEVTDayCount[
par]] = hNPIXvsTime->GetMean(2);
970 NPIXperEVTDayCount[
par]++;
973 TH2F *hTrig = (TH2F*)fileD.FindObjectAny(
"TriggerVsHourGeneral");
974 if(hTrig != 0 && header != 0) {
975 double Trig00 = hTrig->Integral(61,1500,1,1);
976 double Trig01 = hTrig->Integral(61,1500,2,2);
977 double Trig02 = hTrig->Integral(61,1500,3,3);
978 double TrigAct= hTrig->Integral(61,1500,22,22);
979 Trig00timeDay[
par][NTrigDayCount[
par]] = Xsrtime;
980 Trig01timeDay[
par][NTrigDayCount[
par]] = Xsrtime;
981 Trig02timeDay[
par][NTrigDayCount[
par]] = Xsrtime;
982 TrigActtimeDay[
par][NTrigDayCount[
par]]= Xsrtime;
983 Trig00Day[
par][NTrigDayCount[
par]] = Trig00/SRdur;
984 Trig01Day[
par][NTrigDayCount[
par]] = Trig01/SRdur;
985 Trig02Day[
par][NTrigDayCount[
par]] = Trig02/SRdur;
986 TrigActDay[
par][NTrigDayCount[
par]] = TrigAct/SRdur;
987 NTrigDayCount[
par]++;
990 TH2F *hNdcm = (TH2F*)fileD.FindObjectAny(
"NdcmsVsHour");
991 double Zerodcm = 0.0;
992 if(hNdcm != 0 && header != 0) {
993 int NbinsY = hNdcm->GetNbinsY();
994 double total = hNdcm->Integral(61,1500,1,NbinsY);
996 Zerodcm = ((double)(hNdcm->Integral(61,1500,1,1)))/(
total)*100.0;
997 dcm0timeDay[
par][Ndcm0DayCount[
par]] = Xsrtime;
998 Ndcm0Day[
par][Ndcm0DayCount[
par]] = Zerodcm;
999 Ndcm0DayCount[
par]++;
1005 for(
unsigned int p = 0;
p <
Npar; ++
p) {
1006 hFEBaveADCHitMapDay[
p]->Divide(hFEBhitsHitMapDay[
p]);
1007 hFEBRateHitMapDay[
p]->Divide(hFEBTimeHitMapDay[p]);
1009 for(
int i = 1;
i <= hFEBRateHitMapDay[
p]->GetNbinsX(); ++
i) {
1010 for(
int j = 1;
j <= hFEBRateHitMapDay[
p]->GetNbinsY(); ++
j) {
1011 double rate = hFEBRateHitMapDay[
p]->GetBinContent(hFEBRateHitMapDay[p]->GetBin(
i,
j));
1016 hFEBRateSpectrumDay[
p]->Fill(rate);
1021 for(
int i = 1;
i <= hFEBRateSpectrumVsTimeDay[
p]->GetNbinsX(); ++
i) {
1022 double norm = hNormalizationVsTimeDay[
p]->GetBinContent(hNormalizationVsTimeDay[p]->GetBin(
i));
1023 for(
int j = 1;
j <= hFEBRateSpectrumVsTimeDay[
p]->GetNbinsY(); ++
j) {
1024 double content = 0.0;
1025 if(norm > 0.0) content = (hFEBRateSpectrumVsTimeDay[
p]->GetBinContent(hFEBRateSpectrumVsTimeDay[p]->GetBin(
i,
j)))/norm;
1026 hFEBRateSpectrumVsTimeDay[
p]->SetBinContent(hFEBRateSpectrumVsTimeDay[p]->GetBin(
i,
j),content);
1032 for(
int i = 1;
i <= hTPlotALLVsTimeDay[
p]->GetNbinsX(); ++
i) {
1033 double norm = hTimingNormVsTimeDay[
p]->GetBinContent(hTimingNormVsTimeDay[p]->GetBin(
i));
1034 for(
int j = 1;
j <= hTPlotALLVsTimeDay[
p]->GetNbinsY(); ++
j) {
1035 double content = 0.0;
1036 if(norm > 0.0) content = (hTPlotALLVsTimeDay[
p]->GetBinContent(hTPlotALLVsTimeDay[p]->GetBin(
i,
j)))/norm;
1037 hTPlotALLVsTimeDay[
p]->SetBinContent(hTPlotALLVsTimeDay[p]->GetBin(
i,
j),content);
1041 for(
int i = 1;
i <= hTPlotZOOMVsTimeDay[
p]->GetNbinsX(); ++
i) {
1042 double norm = hTimingNormVsTimeDay[
p]->GetBinContent(hTimingNormVsTimeDay[p]->GetBin(
i));
1043 for(
int j = 1;
j <= hTPlotZOOMVsTimeDay[
p]->GetNbinsY(); ++
j) {
1044 double content = 0.0;
1045 if(norm > 0.0) content = (hTPlotZOOMVsTimeDay[
p]->GetBinContent(hTPlotZOOMVsTimeDay[p]->GetBin(
i,
j)))/norm;
1046 hTPlotZOOMVsTimeDay[
p]->SetBinContent(hTPlotZOOMVsTimeDay[p]->GetBin(
i,
j),content);
1059 TDatime *Ttemp =
new TDatime;
1060 int Xfin = Ttemp->Convert() -
GMToffset;
1061 TDatime *Tfinish =
new TDatime(Xfin);
1062 TPaveText *
UpdateText =
new TPaveText(0.05, 0.0, 0.5, 0.06,
"NDC");
1063 UpdateText->SetLineColor(0);
1064 UpdateText->SetFillColor(0);
1065 UpdateText->SetBorderSize(1);
1066 UpdateText->SetMargin(0.0);
1067 UpdateText->SetTextAlign(11);
1069 sprintf(buff1,
"Last updated on: %s (central time)", Tfinish->AsString());
1070 UpdateText->AddText(buff1);
1072 sprintf(buff2,
"Last run / subrun: %d / %d", LastRun, LastSR);
1073 UpdateText->AddText(buff2);
1075 TPaveText *StatusText =
new TPaveText(0.1, 0.1, 0.9, 0.9,
"NDC");
1076 StatusText->SetLineColor(1);
1077 StatusText->SetFillColor(0);
1078 StatusText->SetBorderSize(1);
1080 StatusText->AddText(buff1);
1081 StatusText->AddText(buff2);
1087 int currentTime = 0;
1089 int timeVariable = 0;
1090 double current = 0.0, ave = 0.0,
max = 0.0, max2 = 0.0, min1 = 99999, min2 = 99998;
1091 TPaveText *LastPoint =
new TPaveText(0.3,0.88,0.93,0.93,
"NDC");
1092 TPaveText *
WarningText =
new TPaveText(0,0,1,1,
"NBNDC");
1095 WarningText->SetTextColor(kWhite);
1096 WarningText->SetFillColorAlpha(
kRed,0);
1097 WarningText->SetTextSize(0.07);
1098 LastPoint->SetLineColor(1);
1099 LastPoint->SetFillColor(0);
1100 LastPoint->SetBorderSize(1);
1103 bool send_spill_email=
false;
1104 bool send_feb_email=
false;
1105 bool send_ddactrate_email=
false;
1110 string taxis_labels;
1111 if(period ==
"Day"){
1112 taxis_labels =
"%H:%M";
1115 taxis_labels =
"%m/%d";
1122 for(
unsigned int p = 0; p <
Npar; ++
p) {
1126 for(
unsigned int e = 0;
e < Nerr; ++
e) {
1127 TCanvas *cErr =
new TCanvas(
"cErr",
"Errors",2000,800);
1130 hErrorHistos[
p][
e]->SetLineWidth(2);
1131 hErrorHistos[
p][
e]->SetLineColor(
kBlue);
1132 hErrorHistos[
p][
e]->Draw(
"hist");
1134 hErrorHistos[
p][
e]->GetXaxis()->SetTimeDisplay(1);
1135 hErrorHistos[
p][
e]->GetXaxis()->SetLabelSize(0.03);
1136 hErrorHistos[
p][
e]->GetXaxis()->SetTimeFormat(taxis_labels.c_str());
1137 hErrorHistos[
p][
e]->SetStats(kFALSE);
1139 sprintf(filename,
"%s/%s-%s-P%.1u%s%s.png",PLOT_DIR.c_str(),det.c_str(),trig.c_str(),
p,errorHistoNames[
e].c_str(),period.c_str());
1140 cErr->Print(filename);
1146 for(
unsigned int a = 0;
a < Nalert; ++
a) {
1147 TCanvas *cAlert =
new TCanvas(
"cAlert",
"Alerts",2000,800);
1150 hAlertHistos[
p][
a]->SetLineWidth(2);
1151 hAlertHistos[
p][
a]->SetLineColor(
kBlue);
1152 hAlertHistos[
p][
a]->Draw(
"hist");
1154 hAlertHistos[
p][
a]->GetXaxis()->SetTimeDisplay(1);
1155 hAlertHistos[
p][
a]->GetXaxis()->SetLabelSize(0.03);
1156 hAlertHistos[
p][
a]->GetXaxis()->SetTimeFormat(taxis_labels.c_str());
1157 hAlertHistos[
p][
a]->SetStats(kFALSE);
1159 sprintf(filename,
"%s/%s-%s-P%.1u%s%s.png",PLOT_DIR.c_str(),det.c_str(),trig.c_str(),
p,alertHistoNames[
a].c_str(),period.c_str());
1160 cAlert->Print(filename);
1167 TCanvas *cQday =
new TCanvas(
"cQday",
"Qplot Day",1200,800);
1171 gStyle->SetOptStat(111111);
1172 hQDay[
p]->SetAxisRange(5.0,5000.0,
"X");
1173 hQDay[
p]->SetLineWidth(2);
1174 hQDay[
p]->SetLineColor(
kRed);
1178 sprintf(filename,
"%s/%s-%s-P%.1uQPlot%s.png",PLOT_DIR.c_str(),det.c_str(),trig.c_str(),
p,period.c_str());
1179 cQday->Print(filename);
1183 TCanvas *cHMRday =
new TCanvas(
"cHMRday",
"FEB HitMap Rates Day",1200,800);
1186 gStyle->SetPalette(1);
1187 hFEBRateHitMapDay[
p]->SetAxisRange(100.0,40000.0,
"Z");
1188 hFEBRateHitMapDay[
p]->GetXaxis()->SetTickLength(0);
1189 hFEBRateHitMapDay[
p]->GetXaxis()->SetLabelColor(0);
1190 hFEBRateHitMapDay[
p]->GetYaxis()->SetTickLength(0);
1191 hFEBRateHitMapDay[
p]->GetYaxis()->SetLabelColor(0);
1192 hFEBRateHitMapDay[
p]->SetStats(kFALSE);
1193 hwdetlbl->
Config(hFEBRateHitMapDay[p]);
1194 hFEBRateHitMapDay[
p]->Draw(
"colz");
1197 sprintf(filename,
"%s/%s-%s-P%.1uFEBRateHitMap%s.png",PLOT_DIR.c_str(),det.c_str(),trig.c_str(),
p,period.c_str());
1198 cHMRday->Print(filename);
1202 TCanvas *cHMdropday =
new TCanvas(
"cHMdropday",
"FEB Dropouts Day",1200,800);
1204 cHMdropday->SetLogz();
1205 hFEBDropOutMapDay[
p]->SetAxisRange(1,100.0,
"Z");
1206 hFEBDropOutMapDay[
p]->GetXaxis()->SetTickLength(0);
1207 hFEBDropOutMapDay[
p]->GetXaxis()->SetLabelColor(0);
1208 hFEBDropOutMapDay[
p]->GetYaxis()->SetTickLength(0);
1209 hFEBDropOutMapDay[
p]->GetYaxis()->SetLabelColor(0);
1210 hFEBDropOutMapDay[
p]->SetStats(kFALSE);
1211 hwdetlbl->
Config(hFEBDropOutMapDay[p]);
1212 hFEBDropOutMapDay[
p]->Draw(
"colz");
1215 sprintf(filename,
"%s/%s-%s-P%.1uFEBDropOutMap%s.png",PLOT_DIR.c_str(),det.c_str(),trig.c_str(),
p,period.c_str());
1216 cHMdropday->Print(filename);
1220 TCanvas *cHMadcday =
new TCanvas(
"cHMadcday",
"FEB ave ADC HitMap Day",1200,800);
1222 cHMadcday->SetLogz();
1223 hFEBaveADCHitMapDay[
p]->SetAxisRange(0.5,1000,
"Z");
1224 hFEBaveADCHitMapDay[
p]->GetXaxis()->SetTickLength(0);
1225 hFEBaveADCHitMapDay[
p]->GetXaxis()->SetLabelColor(0);
1226 hFEBaveADCHitMapDay[
p]->GetYaxis()->SetTickLength(0);
1227 hFEBaveADCHitMapDay[
p]->GetYaxis()->SetLabelColor(0);
1228 hFEBaveADCHitMapDay[
p]->SetStats(kFALSE);
1229 hwdetlbl->
Config(hFEBaveADCHitMapDay[p]);
1230 hFEBaveADCHitMapDay[
p]->Draw(
"colz");
1233 sprintf(filename,
"%s/%s-%s-P%.1uFEBaveADCHitMap%s.png",PLOT_DIR.c_str(),det.c_str(),trig.c_str(),
p,period.c_str());
1234 cHMadcday->Print(filename);
1238 TCanvas *cFRday =
new TCanvas(
"cFRday",
"FEB Rate Day",1200,800);
1241 gStyle->SetOptStat(111111);
1242 hFEBRateSpectrumDay[
p]->SetLineWidth(2);
1243 hFEBRateSpectrumDay[
p]->SetLineColor(
kGreen+2);
1244 hFEBRateSpectrumDay[
p]->Draw();
1246 sprintf(filename,
"%s/%s-%s-P%.1uFEBRateSpectrum%s.png",PLOT_DIR.c_str(),det.c_str(),trig.c_str(),
p,period.c_str());
1247 cFRday->Print(filename);
1251 TCanvas *cFEBRTday =
new TCanvas(
"cFEBRTday",
"FEB Rate vs Time day",1200,800);
1255 hFEBRateSpectrumVsTimeDay[
p]->GetXaxis()->SetTimeDisplay(1);
1256 hFEBRateSpectrumVsTimeDay[
p]->GetXaxis()->SetLabelSize(0.03);
1257 hFEBRateSpectrumVsTimeDay[
p]->GetXaxis()->SetTimeFormat(taxis_labels.c_str());
1258 hFEBRateSpectrumVsTimeDay[
p]->SetStats(kFALSE);
1259 hFEBRateSpectrumVsTimeDay[
p]->Draw(
"colz");
1261 sprintf(filename,
"%s/%s-%s-P%.1uFEBRateSpectrumVsTime%s.png",PLOT_DIR.c_str(),det.c_str(),trig.c_str(),
p,period.c_str());
1262 cFEBRTday->Print(filename);
1266 TCanvas *cTPAday =
new TCanvas(
"cTPAday",
"TPlotALL Day",1200,800);
1268 gStyle->SetOptStat(111111);
1269 hTPlotALLDay[
p]->SetLineWidth(2);
1270 hTPlotALLDay[
p]->SetLineColor(
kBlue);
1271 hTPlotALLDay[
p]->Draw();
1272 hTPlotALLDay[
p]->GetYaxis()->UnZoom();
1274 sprintf(filename,
"%s/%s-%s-P%.1uTPlotALL%s.png",PLOT_DIR.c_str(),det.c_str(),trig.c_str(),
p,period.c_str());
1275 cTPAday->Print(filename);
1279 TCanvas *cTPATday =
new TCanvas(
"cTPATday",
"TPlotALL vs Time day",1200,800);
1282 hTPlotALLVsTimeDay[
p]->GetXaxis()->SetTimeDisplay(1);
1283 hTPlotALLVsTimeDay[
p]->GetXaxis()->SetLabelSize(0.03);
1284 hTPlotALLVsTimeDay[
p]->GetXaxis()->SetTimeFormat(taxis_labels.c_str());
1285 hTPlotALLVsTimeDay[
p]->SetStats(kFALSE);
1286 hTPlotALLVsTimeDay[
p]->Draw(
"colz");
1288 sprintf(filename,
"%s/%s-%s-P%.1uTPlotALLVsTime%s.png",PLOT_DIR.c_str(),det.c_str(),trig.c_str(),
p,period.c_str());
1289 cTPATday->Print(filename);
1293 TCanvas *cTPZday =
new TCanvas(
"cTPZday",
"TPlotZOOM Day",1200,800);
1295 gStyle->SetOptStat(111111);
1296 hTPlotZOOMDay[
p]->SetLineWidth(2);
1297 hTPlotZOOMDay[
p]->SetLineColor(
kBlue);
1298 hTPlotZOOMDay[
p]->Draw();
1299 hTPlotZOOMDay[
p]->GetYaxis()->UnZoom();
1301 sprintf(filename,
"%s/%s-%s-P%.1uTPloZOOM%s.png",PLOT_DIR.c_str(),det.c_str(),trig.c_str(),
p,period.c_str());
1302 cTPZday->Print(filename);
1306 TCanvas *cTPZTday =
new TCanvas(
"cTPZTday",
"TPlotZOOM vs Time day",1200,800);
1309 hTPlotZOOMVsTimeDay[
p]->GetXaxis()->SetTimeDisplay(1);
1310 hTPlotZOOMVsTimeDay[
p]->GetXaxis()->SetLabelSize(0.03);
1311 hTPlotZOOMVsTimeDay[
p]->GetXaxis()->SetTimeFormat(taxis_labels.c_str());
1312 hTPlotZOOMVsTimeDay[
p]->SetStats(kFALSE);
1313 hTPlotZOOMVsTimeDay[
p]->Draw(
"colz");
1315 sprintf(filename,
"%s/%s-%s-P%.1uTPlotZOOMVsTime%s.png",PLOT_DIR.c_str(),det.c_str(),trig.c_str(),
p,period.c_str());
1316 cTPZTday->Print(filename);
1326 for(
int i = 0;
i < NDCMDayCount[
p]; ++
i) {
1327 ave += (double)NDCMDay[p][
i];
1328 if(NDCMtimeDay[p][
i] > currentTime) {
1329 currentTime = NDCMtimeDay[
p][
i];
1330 current = NDCMDay[
p][
i];
1333 if(NDCMDayCount[p] > 0) ave = ave/(double)NDCMDayCount[p];
1334 sprintf(lptext,
"Last Point = %.f / Average = %f",current,ave);
1336 LastPoint->AddText(lptext);
1337 TCanvas *cNDCMday =
new TCanvas(
"cNDCMday",
"# of DCMs day",1200,800);
1340 TGraph *gNDCMday =
new TGraph(NDCMDayCount[p],NDCMtimeDay[p],NDCMDay[p]);
1341 sprintf(title,
"Number of Active DCMs per Subrun - partition %.1u",p);
1342 gNDCMday->SetTitle(title);
1343 gNDCMday->SetMarkerColor(
kBlue);
1344 gNDCMday->GetXaxis()->SetTimeDisplay(1);
1345 gNDCMday->GetXaxis()->SetLabelSize(0.03);
1346 gNDCMday->GetXaxis()->SetTimeFormat(taxis_labels.c_str());
1347 gNDCMday->GetXaxis()->SetLimits(time_ago,XNow);
1348 gNDCMday->GetXaxis()->SetTitle(
"(central time)");
1349 gNDCMday->Draw(
"A*");
1352 sprintf(filename,
"%s/%s-%s-P%.1uNDCMperSR%s.png",PLOT_DIR.c_str(),det.c_str(),trig.c_str(),
p,period.c_str());
1353 cNDCMday->Print(filename);
1363 for(
int i = 0;
i < NFEBDayCount[
p]; ++
i) {
1364 ave += (double)NFEBDay[p][
i];
1365 if(NFEBtimeDay[p][
i] > currentTime) {
1366 currentTime = NFEBtimeDay[
p][
i];
1367 current = NFEBDay[
p][
i];
1370 if(NFEBDayCount[p] > 0) ave = ave/(double)NFEBDayCount[p];
1371 sprintf(lptext,
"Last Point = %.f / Average = %f",current,ave);
1373 LastPoint->AddText(lptext);
1374 TCanvas *cNFEBday =
new TCanvas(
"cNFEBday",
"# of FEBs day",1200,800);
1377 TGraph *gNFEBday =
new TGraph(NFEBDayCount[p],NFEBtimeDay[p],NFEBDay[p]);
1378 sprintf(title,
"%s Number of Active FEBs per Subrun - partition %.1u",trigname.c_str(),
p);
1379 gNFEBday->SetTitle(title);
1382 gNFEBday->SetMarkerColor(
kBlue);
1383 gNFEBday->GetXaxis()->SetTimeDisplay(1);
1384 gNFEBday->GetXaxis()->SetLabelSize(0.03);
1385 gNFEBday->GetXaxis()->SetTimeFormat(taxis_labels.c_str());
1386 gNFEBday->GetXaxis()->SetLimits(time_ago,XNow);
1387 gNFEBday->GetXaxis()->SetTitle(
"(central time)");
1389 gNFEBday->SetMinimum(0);
1390 gNFEBday->SetMaximum(11700);
1392 double lmax=gPad->GetUymax();
1403 double range = FEBmax - 620;
1404 double rangeBuffer = 0.10 *
range;
1405 double thisMax = ((rangeBuffer > 1) ? FEBmax + rangeBuffer : FEBmax + 6);
1406 gNFEBday->SetMaximum(thisMax);
1407 gNFEBday->Draw(
"A*");
1409 TLine* lMaxFEBs =
new TLine(gPad->GetUxmin(),FEBmax,gPad->GetUxmax(),FEBmax);
1410 lMaxFEBs->SetLineColor(
kGreen+2);
1411 lMaxFEBs->SetLineWidth(3);
1412 lMaxFEBs->SetLineStyle(9);
1416 sprintf(filename,
"%s/%s-%s-P%.1uNFEBperSR%s.png",PLOT_DIR.c_str(),det.c_str(),trig.c_str(),
p,period.c_str());
1417 cNFEBday->Print(filename);
1425 for(
int i = 0;
i < NFEBDDayCount[
p]; ++
i) {
1426 ave += (double)NFEBDDay[p][
i];
1427 if(NFEBtimeDDay[p][
i] > currentTime) {
1428 currentTime = NFEBtimeDDay[
p][
i];
1429 current = NFEBDDay[
p][
i];
1432 if(NFEBDDayCount[p] > 0) ave = ave/(double)NFEBDDayCount[p];
1433 sprintf(lptext,
"Last Point = %.f / Average = %f",current,ave);
1435 LastPoint->AddText(lptext);
1436 TCanvas *cNFEBDday =
new TCanvas(
"cNFEBDday",
"# of FEB Drop Outs day",1200,800);
1439 TGraph *gNFEBDday =
new TGraph(NFEBDDayCount[p],NFEBtimeDDay[p],NFEBDDay[p]);
1440 sprintf(title,
"%s Number of FEB Drop Outs per Subrun - partition %.1u",trigname.c_str(),
p);
1441 gNFEBDday->SetTitle(title);
1443 gNFEBDday->SetMarkerColor(
kBlue);
1444 gNFEBDday->GetXaxis()->SetTimeDisplay(1);
1445 gNFEBDday->GetXaxis()->SetLabelSize(0.03);
1446 gNFEBDday->GetXaxis()->SetTimeFormat(taxis_labels.c_str());
1447 gNFEBDday->GetXaxis()->SetLimits(time_ago,XNow);
1448 gNFEBDday->GetXaxis()->SetTitle(
"(central time)");
1449 gNFEBDday->Draw(
"A*");
1452 sprintf(filename,
"%s/%s-%s-P%.1uNDropOutFEBperSR%s.png",PLOT_DIR.c_str(),det.c_str(),trig.c_str(),
p,period.c_str());
1453 cNFEBDday->Print(filename);
1461 for(
int i = 0;
i < NFEBDayCount[
p]; ++
i) {
1462 ave += (double)NFEBDay[p][
i];
1463 if(NFEBtimeDay[p][
i] > currentTime) {
1464 currentTime = NFEBtimeDay[
p][
i];
1465 current = NFEBDay[
p][
i];
1468 if(NFEBDayCount[p] > 0) ave = ave/(double)NFEBDayCount[p];
1469 sprintf(lptext,
"Last Point = %.f / Average = %f",current,ave);
1471 LastPoint->AddText(lptext);
1472 TCanvas *cNFEBdayTest =
new TCanvas(
"cNFEBdayTest",
"# of FEBs day",1200,800);
1473 cNFEBdayTest->SetFillColor(
kRed - 4);
1476 TGraph *gNFEBdayTest =
new TGraph(NFEBDayCount[p],NFEBtimeDay[p],NFEBDay[p]);
1477 sprintf(title,
"%s Number of Active FEBs per Subrun - partition %.1u",trigname.c_str(),
p);
1478 gNFEBdayTest->SetTitle(title);
1481 if((
det_type ==
"FarDet") && (current < 10690)) {
1485 gNFEBdayTest->SetMarkerColor(
kBlue);
1490 gNFEBdayTest->GetXaxis()->SetTimeDisplay(1);
1491 gNFEBdayTest->GetXaxis()->SetLabelSize(0.03);
1492 gNFEBdayTest->GetXaxis()->SetTimeFormat(taxis_labels.c_str());
1493 gNFEBdayTest->GetXaxis()->SetLimits(time_ago,XNow);
1494 gNFEBdayTest->GetXaxis()->SetTitle(
"(central time)");
1496 gNFEBdayTest->SetMinimum(10650);
1497 gNFEBdayTest->SetMaximum(10720);
1499 gNFEBdayTest->Draw(
"A*");
1502 sprintf(filename,
"%s/%s-%s-P%.1uNFEBperSR%s-TEST.png",PLOT_DIR.c_str(),det.c_str(),trig.c_str(),
p,period.c_str());
1503 cNFEBdayTest->Print(filename);
1504 delete cNFEBdayTest;
1521 for(
int i = 0;
i < NFEBDayCount[
p]; ++
i) {
1522 ave += (double)NFEBDay[p][
i];
1524 timeVariable = NFEBtimeDay[
p][
i];
1525 if(NFEBtimeDay[p][
i] > currentTime) {
1526 currentTime = NFEBtimeDay[
p][
i];
1527 current = NFEBDay[
p][
i];
1531 if(NFEBDay[p][
i] <= min1){
1533 if((NFEBDay[p][
i] == 0 ) && ((timeVariable - NFEBtimeDay[
p][
i]) > 7400))
1536 min1 = NFEBDay[
p][
i];
1538 if(NFEBDay[p][
i] > min1){
1539 if(NFEBDay[p][
i] < min2)
1540 min2 = NFEBDay[
p][
i];
1544 if(NFEBDay[p][
i] >=
max){
1546 max = NFEBDay[
p][
i];
1548 if(NFEBDay[p][
i] <
max){
1549 if(NFEBDay[p][
i] > max2)
1550 max2 = NFEBDay[
p][
i];
1555 threshold = max2 - 45;
1558 if(NFEBDayCount[p] > 0) ave = ave/(double)NFEBDayCount[p];
1559 sprintf(lptext,
"Last Point = %.f / Average = %f",current,ave);
1561 LastPoint->AddText(lptext);
1562 TCanvas *cNFEBday_zoom =
new TCanvas(
"cNFEBday_zoom",
"# of FEBs day",1200,800);
1563 cNFEBday_zoom->cd();
1565 TGraph *gNFEBday_zoom =
new TGraph(NFEBDayCount[p],NFEBtimeDay[p],NFEBDay[p]);
1566 sprintf(title,
"%s Number of Active FEBs per Subrun - partition %.1u",trigname.c_str(),
p);
1567 gNFEBday_zoom->SetTitle(title);
1581 if((
det_type ==
"FarDet" ||
det_type ==
"TestBeam") && (current < threshold) && (period ==
"Day")) {
1582 cNFEBday_zoom->SetFillColor(
kRed);
1583 sprintf(warntext,
"WARNING! Low Number of FEBs! (%.f)",current);
1584 WarningText->Clear();
1585 WarningText->SetFillColorAlpha(
kRed,0.5);
1586 WarningText->AddText(warntext);
1587 if (p==1 &&
det_type ==
"TestBeam") {
1588 send_feb_email=
true;
1592 else if((
det_type ==
"FarDet") && (current < 10500)){
1593 gNFEBday_zoom->SetMarkerColor(kWhite);
1594 cNFEBday_zoom->SetFillColor(
kRed);
1595 sprintf(warntext,
"WARNING! Low Number of FEBs! (%.f)",current);
1596 WarningText->Clear();
1597 WarningText->AddText(warntext);
1600 gNFEBday_zoom->SetMarkerColor(
kBlue);
1602 gNFEBday_zoom->GetXaxis()->SetTimeDisplay(1);
1603 gNFEBday_zoom->GetXaxis()->SetLabelSize(0.03);
1604 gNFEBday_zoom->GetXaxis()->SetTimeFormat(taxis_labels.c_str());
1605 gNFEBday_zoom->GetXaxis()->SetLimits(time_ago,XNow);
1606 gNFEBday_zoom->GetXaxis()->SetTitle(
"(central time)");
1607 if(period ==
"Month" || period ==
"Week"){
1608 gNFEBday_zoom->SetMinimum(ave-105);
1611 gNFEBday_zoom->SetMinimum(min2-(max2-min2)*0.1);
1613 double range = FEBmax - gNFEBday_zoom->GetMinimum();
1614 double rangeBuffer = 0.10 *
range;
1615 double thisMax = ((rangeBuffer > 1) ? FEBmax + rangeBuffer : FEBmax + 1);
1616 gNFEBday_zoom->SetMaximum(thisMax);
1617 gNFEBday_zoom->Draw(
"A*");
1618 cNFEBday_zoom->Update();
1619 TLine* lMaxFEBs =
new TLine(gPad->GetUxmin(),FEBmax,gPad->GetUxmax(),FEBmax);
1620 lMaxFEBs->SetLineColor(
kGreen+2);
1621 lMaxFEBs->SetLineWidth(3);
1622 lMaxFEBs->SetLineStyle(9);
1626 if(((
det_type ==
"FarDet" ||
det_type ==
"TestBeam") && (current < threshold) && (period ==
"Day")) || ((
det_type ==
"FarDet") && (current < 10500) && (period ==
"Day") )){
1627 WarningText->Draw();
1629 sprintf(filename,
"%s/%s-%s-P%.1uNFEBperSRzoom%s.png",PLOT_DIR.c_str(),det.c_str(),trig.c_str(),
p,period.c_str());
1630 cNFEBday_zoom->Print(filename);
1631 delete cNFEBday_zoom;
1641 for(
int i = 0;
i < NPIXperSRDayCount[
p]; ++
i) {
1642 ave += (double)NPIXperSRDay[p][
i];
1643 if(NPIXperSRtimeDay[p][
i] > currentTime) {
1644 currentTime = NPIXperSRtimeDay[
p][
i];
1645 current = NPIXperSRDay[
p][
i];
1648 if(NPIXperSRDayCount[p] > 0) ave = ave/(double)NPIXperSRDayCount[p];
1649 sprintf(lptext,
"Last Point = %.f / Average = %f",current,ave);
1651 LastPoint->AddText(lptext);
1652 TCanvas *cNPIXperSRday =
new TCanvas(
"cNPIXperSRday",
"# of channels per subrun day",1200,800);
1653 cNPIXperSRday->cd();
1655 TGraph *gNPIXperSRday =
new TGraph(NPIXperSRDayCount[p],NPIXperSRtimeDay[p],NPIXperSRDay[p]);
1656 sprintf(title,
"%s Number of Active Channels per Subrun - partition %.1u",trigname.c_str(),
p);
1657 gNPIXperSRday->SetTitle(title);
1658 gNPIXperSRday->SetMarkerColor(
kBlue);
1659 gNPIXperSRday->GetXaxis()->SetTimeDisplay(1);
1660 gNPIXperSRday->GetXaxis()->SetLabelSize(0.03);
1661 gNPIXperSRday->GetXaxis()->SetTimeFormat(taxis_labels.c_str());
1662 gNPIXperSRday->GetXaxis()->SetLimits(time_ago,XNow);
1663 gNPIXperSRday->GetXaxis()->SetTitle(
"(central time)");
1664 gNPIXperSRday->Draw(
"A*");
1667 sprintf(filename,
"%s/%s-%s-P%.1uNPIXperSR%s.png",PLOT_DIR.c_str(),det.c_str(),trig.c_str(),
p,period.c_str());
1668 cNPIXperSRday->Print(filename);
1669 delete cNPIXperSRday;
1678 for(
int i = 0;
i < NPIXperEVTDayCount[
p]; ++
i) {
1679 ave += (double)NPIXperEVTDay[p][
i];
1680 if(NPIXperEVTtimeDay[p][
i] > currentTime) {
1681 currentTime = NPIXperEVTtimeDay[
p][
i];
1682 current = NPIXperEVTDay[
p][
i];
1685 if(NPIXperEVTDayCount[p] > 0) ave = ave/(double)NPIXperEVTDayCount[p];
1686 sprintf(lptext,
"Last Point = %.f / Average = %f",current,ave);
1688 LastPoint->AddText(lptext);
1689 TCanvas *cNPIXperEVTday =
new TCanvas(
"cNPIXperEVTday",
"# of hits per spill day",1200,800);
1690 cNPIXperEVTday->cd();
1692 TGraph *gNPIXperEVTday =
new TGraph(NPIXperEVTDayCount[p],NPIXperEVTtimeDay[p],NPIXperEVTDay[p]);
1693 sprintf(title,
"%s Average Number of Hits per Spill - partition %.1u",trigname.c_str(),
p);
1694 gNPIXperEVTday->SetTitle(title);
1695 gNPIXperEVTday->SetMarkerColor(
kBlue);
1696 gNPIXperEVTday->GetXaxis()->SetTimeDisplay(1);
1697 gNPIXperEVTday->GetXaxis()->SetLabelSize(0.03);
1698 gNPIXperEVTday->GetXaxis()->SetTimeFormat(taxis_labels.c_str());
1699 gNPIXperEVTday->GetXaxis()->SetLimits(time_ago,XNow);
1700 gNPIXperEVTday->GetXaxis()->SetTitle(
"(central time)");
1701 gNPIXperEVTday->Draw(
"A*");
1704 sprintf(filename,
"%s/%s-%s-P%.1uNPIXperEVT%s.png",PLOT_DIR.c_str(),det.c_str(),trig.c_str(),
p,period.c_str());
1705 cNPIXperEVTday->Print(filename);
1706 delete cNPIXperEVTday;
1715 for(
int i = 0;
i < Ndcm0DayCount[
p]; ++
i) {
1716 ave += (double)Ndcm0Day[p][
i];
1717 if(dcm0timeDay[p][
i] > currentTime) {
1718 currentTime = dcm0timeDay[
p][
i];
1719 current = Ndcm0Day[
p][
i];
1722 if(Ndcm0DayCount[p] > 0) ave = ave/(double)Ndcm0DayCount[p];
1723 sprintf(lptext,
"Last Point = %.f / Average = %f",current,ave);
1725 LastPoint->AddText(lptext);
1726 TCanvas *cNdcm0day =
new TCanvas(
"cNdcm0day",
"# of zero DCM spills day",1200,800);
1729 TGraph *gNdcm0day =
new TGraph(Ndcm0DayCount[p],dcm0timeDay[p],Ndcm0Day[p]);
1730 sprintf(title,
"%s Percentage of Empty Spills (zero DCMs reporting) - partition %.1u",trigname.c_str(),
p);
1731 gNdcm0day->SetTitle(title);
1732 gNdcm0day->SetMarkerColor(
kBlue);
1733 gNdcm0day->GetXaxis()->SetTimeDisplay(1);
1734 gNdcm0day->GetXaxis()->SetLabelSize(0.03);
1735 gNdcm0day->GetXaxis()->SetTimeFormat(taxis_labels.c_str());
1736 gNdcm0day->GetXaxis()->SetLimits(time_ago,XNow);
1737 gNdcm0day->GetYaxis()->SetTitle(
"percent");
1738 gNdcm0day->GetXaxis()->SetTitle(
"(central time)");
1739 gNdcm0day->Draw(
"A*");
1742 sprintf(filename,
"%s/%s-%s-P%.1uNdcm0%s.png",PLOT_DIR.c_str(),det.c_str(),trig.c_str(),
p,period.c_str());
1743 cNdcm0day->Print(filename);
1753 for(
int i = 0;
i < NTrigDayCount[
p]; ++
i) {
1754 ave += (double)Trig00Day[p][
i];
1755 if(Trig00timeDay[p][
i] > currentTime) {
1756 currentTime = Trig00timeDay[
p][
i];
1757 current = Trig00Day[
p][
i];
1760 if(NTrigDayCount[p] > 0) ave = ave/(double)NTrigDayCount[p];
1761 sprintf(lptext,
"Last Point = %f / Average = %f",current,ave);
1763 LastPoint->AddText(lptext);
1764 TCanvas *cTrig00day =
new TCanvas(
"cTrig00day",
"trig00 rate day",1200,800);
1767 TGraph *gTrig00day =
new TGraph(NTrigDayCount[p],Trig00timeDay[p],Trig00Day[p]);
1768 sprintf(title,
"Average NuMI Trigger Rate (Hz) Seen by OnMon per Subrun - partition %.1u",p);
1769 gTrig00day->SetTitle(title);
1770 gTrig00day->SetMarkerColor(
kBlue);
1771 gTrig00day->GetXaxis()->SetTimeDisplay(1);
1772 gTrig00day->GetXaxis()->SetLabelSize(0.03);
1773 gTrig00day->GetXaxis()->SetTimeFormat(taxis_labels.c_str());
1774 gTrig00day->GetXaxis()->SetLimits(time_ago,XNow);
1775 gTrig00day->GetYaxis()->SetLimits(0,11);
1776 gTrig00day->GetXaxis()->SetTitle(
"(central time)");
1777 gTrig00day->Draw(
"A*");
1780 sprintf(filename,
"%s/%s-%s-P%.1uNuMITriggerRate%s.png",PLOT_DIR.c_str(),det.c_str(),trig.c_str(),
p,period.c_str());
1781 cTrig00day->Print(filename);
1789 for(
int i = 0;
i < NTrigDayCount[
p]; ++
i) {
1790 ave += (double)Trig01Day[p][
i];
1791 if(Trig01timeDay[p][
i] > currentTime) {
1792 currentTime = Trig01timeDay[
p][
i];
1793 current = Trig01Day[
p][
i];
1796 if(NTrigDayCount[p] > 0) ave = ave/(double)NTrigDayCount[p];
1797 sprintf(lptext,
"Last Point = %f / Average = %f",current,ave);
1799 LastPoint->AddText(lptext);
1800 TCanvas *cTrig01day =
new TCanvas(
"cTrig01day",
"trig01 rate day",1200,800);
1803 TGraph *gTrig01day =
new TGraph(NTrigDayCount[p],Trig01timeDay[p],Trig01Day[p]);
1804 sprintf(title,
"Average Beamline Trigger Rate (Hz) Seen by OnMon per Subrun - partition %.1u",p);
1805 gTrig01day->SetTitle(title);
1806 gTrig01day->SetMarkerColor(
kBlue);
1807 gTrig01day->GetXaxis()->SetTimeDisplay(1);
1808 gTrig01day->GetXaxis()->SetLabelSize(0.03);
1809 gTrig01day->GetXaxis()->SetTimeFormat(taxis_labels.c_str());
1810 gTrig01day->GetXaxis()->SetLimits(time_ago,XNow);
1811 gTrig01day->GetYaxis()->SetLimits(0,11);
1812 gTrig01day->GetXaxis()->SetTitle(
"(central time)");
1813 gTrig01day->Draw(
"A*");
1816 sprintf(filename,
"%s/%s-%s-P%.1uBeamlineTriggerRate%s.png",PLOT_DIR.c_str(),det.c_str(),trig.c_str(),
p,period.c_str());
1817 cTrig01day->Print(filename);
1825 for(
int i = 0;
i < NTrigDayCount[
p]; ++
i) {
1826 ave += (double)Trig02Day[p][
i];
1827 if(Trig02timeDay[p][
i] > currentTime) {
1828 currentTime = Trig02timeDay[
p][
i];
1829 current = Trig02Day[
p][
i];
1832 if(NTrigDayCount[p] > 0) ave = ave/(double)NTrigDayCount[p];
1833 sprintf(lptext,
"Last Point = %f / Average = %f",current,ave);
1835 LastPoint->AddText(lptext);
1836 TCanvas *cTrig02day =
new TCanvas(
"cTrig02day",
"trig02 rate day",1200,800);
1839 TGraph *gTrig02day =
new TGraph(NTrigDayCount[p],Trig02timeDay[p],Trig02Day[p]);
1840 sprintf(title,
"Average Cosmic Trigger Rate (Hz) Seen by OnMon per Subrun - partition %.1u",p);
1841 gTrig02day->SetTitle(title);
1842 gTrig02day->SetMarkerColor(
kBlue);
1843 gTrig02day->SetMarkerStyle(21);
1844 gTrig02day->GetXaxis()->SetTimeDisplay(1);
1845 gTrig02day->GetXaxis()->SetLabelSize(0.03);
1846 gTrig02day->GetXaxis()->SetTimeFormat(taxis_labels.c_str());
1847 gTrig02day->GetXaxis()->SetLimits(time_ago,XNow);
1848 gTrig02day->GetYaxis()->SetLimits(0,1.1);
1849 gTrig02day->GetXaxis()->SetTitle(
"(central time)");
1850 gTrig02day->Draw(
"A*");
1853 sprintf(filename,
"%s/%s-%s-P%.1uCosmicTriggerRate%s.png",PLOT_DIR.c_str(),det.c_str(),trig.c_str(),
p,period.c_str());
1854 cTrig02day->Print(filename);
1862 for(
int i = 0;
i < NTrigDayCount[
p]; ++
i) {
1863 ave += (double)TrigActDay[p][
i];
1864 if(TrigActtimeDay[p][
i] > currentTime) {
1865 currentTime = TrigActtimeDay[
p][
i];
1866 current = TrigActDay[
p][
i];
1869 if(NTrigDayCount[p] > 0) ave = ave/(double)NTrigDayCount[p];
1870 sprintf(lptext,
"Last Point = %f / Average = %f",current,ave);
1872 LastPoint->AddText(lptext);
1873 TCanvas *cTrigActday =
new TCanvas(
"cTrigActday",
"trigact rate day",1200,800);
1876 TGraph *gTrigActday =
new TGraph(NTrigDayCount[p],TrigActtimeDay[p],TrigActDay[p]);
1877 sprintf(title,
"Average DDActivity Trigger Rate (Hz) Seen by OnMon per Subrun - partition %.1u",p);
1878 gTrigActday->SetTitle(title);
1881 if((
det_type ==
"TestBeam") && (current < 10) && (period ==
"Day")) {
1882 cTrigActday->SetFillColor(
kRed);
1883 sprintf(warntext,
"WARNING! Trigger rate low! (%.2f Hz)",current);
1884 WarningText->Clear();
1885 WarningText->SetFillColorAlpha(
kRed,0.5);
1886 WarningText->AddText(warntext);
1888 send_ddactrate_email=
true;
1892 gTrigActday->SetMarkerColor(
kBlue);
1893 gTrigActday->GetXaxis()->SetTimeDisplay(1);
1894 gTrigActday->GetXaxis()->SetLabelSize(0.03);
1895 gTrigActday->GetXaxis()->SetTimeFormat(taxis_labels.c_str());
1896 gTrigActday->GetXaxis()->SetLimits(time_ago,XNow);
1897 gTrigActday->GetYaxis()->SetLimits(0,11);
1898 gTrigActday->GetXaxis()->SetTitle(
"(central time)");
1899 gTrigActday->Draw(
"A*");
1903 if((
det_type ==
"TestBeam") && (current < 10) && (period ==
"Day")) {
1904 WarningText->Draw();
1906 sprintf(filename,
"%s/%s-%s-P%.1uActTriggerRate%s.png",PLOT_DIR.c_str(),det.c_str(),trig.c_str(),
p,period.c_str());
1907 cTrigActday->Print(filename);
1915 TGraph *gSpillCount =
new TGraph(NSpillEntryCount[0],SpillCountTime[0],SpillCountValue[0]);
1920 for(
int i = 0;
i < NSpillEntryCount[0]; ++
i) {
1921 ave += (double)SpillCountValue[0][
i];
1922 if(SpillCountTime[0][
i] > currentTime) {
1923 currentTime = SpillCountTime[0][
i];
1924 current = SpillCountValue[0][
i];
1927 if(NSpillEntryCount[0] > 0) ave = ave/(double)NSpillEntryCount[0];
1928 sprintf(lptext,
"Last Point = %f / Average = %f",current,ave);
1930 LastPoint->AddText(lptext);
1931 TCanvas *cSpill =
new TCanvas(
"cSpill",
"Spill Count day",1200,800);
1935 sprintf(title,
"Spill count per bin interval");
1936 gSpillCount->SetTitle(title);
1937 gSpillCount->SetMarkerColor(kMagenta);
1938 gSpillCount->SetMarkerStyle(22);
1939 gSpillCount->GetXaxis()->SetTimeDisplay(1);
1940 gSpillCount->GetXaxis()->SetLabelSize(0.03);
1941 gSpillCount->GetXaxis()->SetTimeFormat(taxis_labels.c_str());
1942 gSpillCount->GetXaxis()->SetLimits(time_ago,XNow);
1943 gSpillCount->GetXaxis()->SetTitle(
"(central time)");
1944 gSpillCount->Draw(
"A*");
1947 sprintf(filename,
"%s/%s-%s-P%.1uSpillCount%s.png",PLOT_DIR.c_str(),det.c_str(),trig.c_str(),
p,period.c_str());
1948 cSpill->Print(filename);
1974 sprintf(title,
"Spill count per bin interval");
1991 TCanvas *cCombo =
new TCanvas(
"cCombo",
"feb active/dropout day", 1200, 800);
1992 TPad *activepad =
new TPad(
"activepad",
"",0,0,1,1);
1993 TPad *dropoutpad =
new TPad(
"dropoutpad",
"",0,0,1,1);
1995 dropoutpad->SetFillStyle(4000);
1996 dropoutpad->SetFillColor(0);
1997 dropoutpad->SetFrameFillStyle(4000);
2000 activepad->SetGridx();
2002 sprintf(title,
"Number of Active and Drop Out FEBs - partition %.1u",p);
2003 gNFEBday->SetTitle(title);
2004 gNFEBday->SetMarkerStyle(22);
2005 gNFEBday->SetMarkerColor(
kBlue);
2006 gNFEBday->SetFillColor(
kBlue);
2008 gNFEBday->GetYaxis()->SetLabelColor(
kBlue);
2010 if( det ==
"FarDet")
2011 gNFEBday->GetYaxis()->SetRangeUser(10740,10750);
2012 if( det ==
"NearDet")
2013 gNFEBday->GetYaxis()->SetRangeUser(625,635);
2014 gNFEBday->Draw(
"AP");
2016 activepad->Modified();
2017 activepad->Update();
2021 dropoutpad->SetGridx();
2023 gNFEBDday->SetTitle(
"");
2024 gNFEBDday->SetMarkerStyle(23);
2025 gNFEBDday->SetMarkerColor(
kOrange+7);
2026 gNFEBDday->SetFillColor(
kOrange+7);
2027 gNFEBDday->GetYaxis()->SetLabelColor(
kOrange+7);
2028 gNFEBDday->GetYaxis()->SetRangeUser(0,10);
2029 gNFEBDday->Draw(
"APY+");
2033 dropoutpad->Modified();
2034 dropoutpad->Update();
2036 TLegend *legc =
new TLegend(0.62,0.69,0.87,0.78);
2037 legc->SetFillColor(0);
2038 TLegendEntry *af = legc->AddEntry(gNFEBday,
"#bf{Active FEBs}",
"F");
2039 af->SetTextColor(
kBlue);
2040 TLegendEntry *
df = legc->AddEntry(gNFEBDday,
"#bf{FEB Drop Outs}",
"F");
2042 legc->SetFillStyle(4000);
2043 legc->SetLineColor(0);
2046 sprintf(filename,
"%s/%s-%s-P%.1uNDropOutActiveFEBperSR%s.png",PLOT_DIR.c_str(),det.c_str(),trig.c_str(),
p,period.c_str());
2047 cCombo->Print(filename);
2057 gTrig00day->SetMarkerColor(
kRed);
2058 TCanvas *cTrig =
new TCanvas(
"cTrig",
"trig rate day",1200, 800);
2060 float currentNuMITrigRate = Trig00Day[1][NTrigDayCount[1] - 1];
2061 float currentSpillRate = SpillCountValue[0][NSpillEntryCount[0] - 1];
2064 float triggerRateThreshold = 0.9;
2065 float spillNumiDiffThreshold = 0.05;
2067 TPad *
pad1 =
new TPad(
"pad1",
"",0,0,1,1);
2068 TPad *
pad2 =
new TPad(
"pad2",
"",0,0,1,1);
2069 TPad *
pad3 =
new TPad(
"pad3",
"",0,0,1,1);
2070 TPad *pad4 =
new TPad(
"pad4",
"",0,0,1,1);
2112 pad2->SetFillStyle(4000);
2113 pad2->SetFillColor(0);
2114 pad2->SetFrameFillStyle(4000);
2115 pad3->SetFillStyle(4000);
2116 pad3->SetFillColor(0);
2117 pad3->SetFrameFillStyle(4000);
2118 pad4->SetFillStyle(4000);
2119 pad4->SetFillColor(0);
2120 pad4->SetFrameFillStyle(4000);
2125 sprintf(title,
"Average Trigger and Spill Rates (Hz) - partition %.1u",p);
2126 gTrig00day->SetTitle(title);
2127 gTrig00day->SetMarkerStyle(21);
2128 gTrig00day->SetMarkerColor(
kRed+3);
2129 gTrig00day->SetFillColor(
kRed+3);
2130 if (t_prd !=
"Day") gTrig00day->SetMarkerStyle(7);
2131 gTrig00day->GetYaxis()->SetLabelOffset(1);
2132 gTrig00day->GetYaxis()->SetLabelColor(
kRed+3);
2133 gTrig00day->GetYaxis()->SetNdivisions(0, kFALSE);
2134 gTrig00day->GetYaxis()->SetRangeUser(0,1.1);
2136 WarningText->Clear();
2137 std::cout <<
"CHECKING FOR HIGH NUMI TRIGGER RATE......";
2139 if (currentNuMITrigRate > triggerRateThreshold){
2141 pad1->SetFillColor(
kRed);
2142 sprintf(warntext,
"WARNING! NuMI trigger rate too high! Call DAQ expert!");
2143 WarningText->AddText(warntext);
2144 send_spill_email=
true;
2149 std::cout <<
" (SpillRate=" << currentSpillRate <<
" TrigRate=" << currentNuMITrigRate
2150 <<
" Diff=" <<
std::abs(currentSpillRate - currentNuMITrigRate) <<
")" <<
std::endl;
2152 gTrig00day->Draw(
"AP");
2153 WarningText->Draw();
2175 gTrig02day->SetTitle(
"");
2176 gTrig02day->SetMarkerStyle(21);
2177 if (t_prd !=
"Day") gTrig02day->SetMarkerStyle(7);
2178 gTrig02day->SetFillColor(
kBlue);
2179 gTrig02day->GetYaxis()->SetLabelColor(
kBlue);
2180 gTrig02day->GetYaxis()->SetRangeUser(0,30);
2181 gTrig02day->Draw(
"AP");
2190 gSpillCount->SetTitle(
"");
2191 gSpillCount->GetYaxis()->SetRangeUser(0,1.1);
2192 gSpillCount->GetYaxis()->SetLabelColor(
kRed);
2193 gSpillCount->SetMarkerStyle(34);
2194 gSpillCount->SetFillColor(
kRed);
2195 gSpillCount->SetMarkerColor(
kRed);
2196 gSpillCount->Draw(
"APY+");
2202 TLegend *
leg =
new TLegend(0.62,0.69,0.87,0.78);
2203 leg->SetFillColor(0);
2205 TLegendEntry *l2 = leg->AddEntry(gTrig02day,
"#bf{Cosmic Trigger Rate}",
"F");
2206 l2->SetTextColor(
kBlue);
2210 TLegendEntry *
l1 = leg->AddEntry(gTrig00day,
"#bf{NuMI Trigger Rate}",
"F");
2211 l1->SetTextColor(
kRed+3);
2212 TLegendEntry *l3 = leg->AddEntry(gSpillCount,
"#bf{Delivered NuMI Spill Rate}",
"F");
2213 l3->SetTextColor(
kRed);
2214 leg->SetFillStyle(4000);
2215 leg->SetLineColor(0);
2218 sprintf(filename,
"%s/%s-%s-P%.1uCosmicNuMITriggerRate%s.png",PLOT_DIR.c_str(),det.c_str(),trig.c_str(),
p,period.c_str());
2219 cTrig->Print(filename);
2231 if (send_spill_email) {
2233 char to[1000] =
"tlackey@indiana.edu nova_runcoordinator@fnal.gov mcgroh@iu.edu jvasel@iu.edu nova_daq_support@fnal.gov";
2234 char subject[1000] =
"NuMI Trigger rate too high.";
2235 char body[1000] =
"NuMI Trigger rate is too high. There may be an issue with the spill server.";
2237 sprintf(cmd,
"echo -e \"%s\" | mail -s \"%s\" %s",body,subject,to);
2242 if (send_feb_email) {
2244 char to[1000] =
"tlackey@indiana.edu";
2245 char subject[1000] =
"NFEBs too low.";
2247 sprintf(body,
"Number of Active FEBs (%d) is too low. The TDU may be disconnected.",nfeb);
2249 sprintf(cmd,
"echo -e \"%s\" | mail -s \"%s\" %s",body,subject,to);
2253 if (send_ddactrate_email) {
2255 char to[1000] =
"tlackey@indiana.edu";
2256 char subject[1000] =
"DDActivity rate too low.";
2258 sprintf(body,
"DDActivity rate is too low: %f Hz. The run may need restarting.",ddactrate);
2260 sprintf(cmd,
"echo -e \"%s\" | mail -s \"%s\" %s",body,subject,to);
system("rm -rf microbeam.root")
::xsd::cxx::tree::time< char, simple_type > time
const std::string PLOT_DIR
static float min(const float a, const float b, const float c)
void Config(const TH1 *h)
T max(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
static constexpr Double_t year