376 if(timeperiodname.compare(
"day") == 0) {
379 }
else if(timeperiodname.compare(
"week") == 0) {
382 }
else if(timeperiodname.compare(
"month") == 0) {
386 std::cout <<
"Macro should take input of 'day', 'week', or 'month'. \n" 387 <<
"You have input '" << timeperiodname
388 <<
"'\nSomething's wrong. Abort.";
392 if(detectorname.compare(
"ND") == 0) {
395 }
else if(detectorname.compare(
"FD") == 0) {
399 std::cout <<
"Macro should take input of 1 for ND, 2 for FD" 400 <<
"You have input " << detector
401 <<
"... Something's wrong. Abort.";
405 gStyle->SetPalette(55);
406 gStyle->SetMarkerStyle(7);
407 gStyle->SetFillStyle(0);
413 if(timeperiod == 0) f =
new TFile(
"trees/dcs_db_readout_multichan_day_ND.root",
"read");
414 else if(timeperiod == 1) f =
new TFile(
"trees/dcs_db_readout_multichan_week_ND.root",
"read");
415 else if(timeperiod == 2) f =
new TFile(
"trees/dcs_db_readout_multichan_month_ND.root",
"read");
416 }
else if(detector == 2) {
417 if(timeperiod == 0) f =
new TFile(
"trees/dcs_db_readout_multichan_day_FD.root",
"read");
418 else if(timeperiod == 1) f =
new TFile(
"trees/dcs_db_readout_multichan_week_FD.root",
"read");
419 else if(timeperiod == 2) f =
new TFile(
"trees/dcs_db_readout_multichan_month_FD.root",
"read");
422 TTree *
t = (TTree*)f->Get(
"dcs_db_tree");
423 TCanvas *
c1 =
new TCanvas(
"c1",
"c1",1200,800);
424 TCanvas *
c2 =
new TCanvas(
"c2",
"c2",1200,800);
437 if(timeperiod == 0) filepath =
"dayplots/NearDet-";
438 else if(timeperiod == 1) filepath =
"weekplots/NearDet-";
439 else if(timeperiod == 2) filepath =
"monthplots/NearDet-";
440 }
else if(detector == 2){
442 if(timeperiod == 0) filepath =
"dayplots/FarDet-";
443 else if(timeperiod == 1) filepath =
"weekplots/FarDet-";
444 else if(timeperiod == 2) filepath =
"monthplots/FarDet-";
452 float zoom[2] = {99999, -99999};
453 float zoom2[2] = {99999, -99999};
456 t->UseCurrentStyle();
462 TDatime *
TNow =
new TDatime;
466 TNow->Set(TNow->GetYear(),TNow->GetMonth(),TNow->GetDay(),TNow->GetHour()+1,0,0);
470 UInt_t XNow = TNow->Convert(kFALSE);
478 if(timeperiod == 0) timeago = XNow - 60*60*24;
479 else if(timeperiod == 1) timeago = XNow - 60*60*24*7;
480 else if(timeperiod == 2) timeago = XNow - 60*60*24*30;
491 TDatime *Tfinish =
new TDatime;
499 sprintf(buff1,
"Last updated on: %s (central time)", Tfinish->AsString());
504 if(detector == 1) ndiblocks = 4;
505 else if(detector == 2) ndiblocks = 14;
510 if(detector == 1) ndevices = 4;
511 else if(detector == 2) ndevices = 12;
518 for(
int meas = 0;meas<nmeas;meas++)
520 if(meas == 0)strcpy(measstr,
"");
521 if(meas == 1)strcpy(measstr,
"MC");
522 if(meas == 2)strcpy(measstr,
"MV");
523 if(meas == 3)strcpy(measstr,
"TP");
525 for(
int ps = 0;
ps<nps;
ps++)
530 if(detector == 1 &&
diblock == 4)
537 else sprintf(name,
"%c%i", lmh[
ps],
diblock);
544 sprintf(title,
"Low V power supply, diblock %i: Voltage at device;;Voltage (V)",
diblock);
545 sprintf(title2,
"Low V power supply: Voltage at device;;Voltage (V)",
diblock);
550 sprintf(title,
"Medium V power supply, diblock %i: Voltage at device;;Voltage (V)",
diblock);
551 sprintf(title2,
"Medium V power supply: Voltage at device;;Voltage (V)",
diblock);
556 sprintf(title,
"High V power supply, diblock %i: Voltage at device;;Voltage (V)",
diblock);
557 sprintf(title2,
"High V power supply: Voltage at device;;Voltage (V)",
diblock);
566 sprintf(title,
"Low V power supply, diblock %i: Current;;Current (mA)",
diblock);
567 sprintf(title2,
"Low V power supply: Current;;Current (mA)",
diblock);
572 sprintf(title,
"Medium V power supply, diblock %i: Current;;Current (mA)",
diblock);
573 sprintf(title2,
"Medium V power supply: Current;;Current (mA)",
diblock);
578 sprintf(title,
"High V power supply, diblock %i: Current;;Current (A)",
diblock);
579 sprintf(title2,
"High V power supply: Current;;Current (A)",
diblock);
588 sprintf(title,
"Low V power supply, diblock %i: Voltage at source;;Voltage (V)",
diblock);
589 sprintf(title2,
"Low V power supply: Voltage at source;;Voltage (V)",
diblock);
594 sprintf(title,
"Medium V power supply, diblock %i: Voltage at source;;Voltage (V)",
diblock);
595 sprintf(title2,
"Medium V power supply: Voltage at source;;Voltage (V)",
diblock);
600 sprintf(title,
"High V power supply, diblock %i: Voltage at source;;Voltage (V)",
diblock);
601 sprintf(title2,
"High V power supply: Voltage at source;;Voltage (V)",
diblock);
610 sprintf(title,
"Low V power supply, diblock %i: Temperature;;Temperature (C)",
diblock);
611 sprintf(title2,
"Low V power supply: Temperature;;Temperature (C)",
diblock);
616 sprintf(title,
"Medium V power supply, diblock %i: Temperature;;Temperature (C)",
diblock);
617 sprintf(title2,
"Medium V power supply: Temperature;;Temperature (C)",
diblock);
622 sprintf(title,
"High V power supply, diblock %i: Temperature;;Temperature (C)",
diblock);
623 sprintf(title2,
"High V power supply: Temperature;;Temperature (C)",
diblock);
629 sprintf(saveme,
"%s%s%s", filepath, name, measstr);
630 sprintf(saveme2,
"%s%c%s", filepath, lmh[
ps], measstr);
632 for(
int device=1;device<ndevices+1;device++)
639 if(device<10) sprintf(branchname,
"%s0%i%s", name, device, measstr);
640 else sprintf(branchname,
"%s%i%s", name, device, measstr);
642 plot_with_zoom(t, branchname, device, 20, c1, title, ylimit, zoom, timeago, XNow, mode, saveme, timeperiod);
644 plot_with_zoom(t, branchname, device, 19+
diblock, c2, title2, ylimit, zoom2, timeago, XNow, mode2, saveme2, timeperiod);
653 if(detector == 1) ndevices = 4;
654 else if(detector == 2) ndevices = 12;
707 sprintf(title,
"Rack Air Flow");
710 sprintf(saveme,
"%sAirFlow", filepath);
712 sprintf(branchname,
"ENNALV1");
714 plot_with_zoom(t, branchname, 1, 20, c1, title, ylimit, zoom, timeago, XNow, 0, saveme, timeperiod);
715 sprintf(branchname,
"ENNALV2");
717 plot_with_zoom(t, branchname, 2, 20, c1, title, ylimit, zoom, timeago, XNow, 1, saveme, timeperiod);
718 sprintf(branchname,
"ENNAHV1");
720 plot_with_zoom(t, branchname, 3, 20, c1, title, ylimit, zoom, timeago, XNow, 2, saveme, timeperiod);
732 for(
int iter=0;iter<nmeas;iter++)
736 sprintf(title,
"Dewpoint;;Dewpoint (C)");
739 sprintf(saveme,
"%sDewPoint", filepath);
743 sprintf(title,
"Humidity;;Humidity (%)");
746 sprintf(saveme,
"%sHumidity", filepath);
749 sprintf(branchname,
"ENN%cDB1", dh[iter]);
751 plot_with_zoom(t, branchname, 1, 20, c1, title, ylimit, zoom, timeago, XNow, 0, saveme, timeperiod);
752 sprintf(branchname,
"ENN%cDB2", dh[iter]);
754 plot_with_zoom(t, branchname, 2, 20, c1, title, ylimit, zoom, timeago, XNow, 1, saveme, timeperiod);
755 sprintf(branchname,
"ENN%cDB3", dh[iter]);
757 plot_with_zoom(t, branchname, 3, 20, c1, title, ylimit, zoom, timeago, XNow, 1, saveme, timeperiod);
758 sprintf(branchname,
"ENN%cDME", dh[iter]);
760 plot_with_zoom(t, branchname, 4, 20, c1, title, ylimit, zoom, timeago, XNow, 1, saveme, timeperiod);
761 sprintf(branchname,
"ENN%cDMN", dh[iter]);
763 plot_with_zoom(t, branchname, 5, 20, c1, title, ylimit, zoom, timeago, XNow, 2, saveme, timeperiod);
769 else if(detector == 2){
770 sprintf(measstr,
"HT");
773 for(
int iter = 0;iter<nmeas;iter++)
779 sprintf(title,
"Dewpoint;;Dewpoint (F)");
785 sprintf(title,
"Temperature;;Temperature (F)");
787 sprintf(name,
"E%cL", measstr[iter]);
789 if(iter==0)sprintf(saveme,
"%sDewPoint", filepath);
790 else sprintf(saveme,
"%sTemperature", filepath);
792 sprintf(branchname,
"%s101", name);
793 plot_with_zoom(t, branchname, 1, 20, c1, title, ylimit, zoom, timeago, XNow, mode, saveme, timeperiod);
795 sprintf(branchname,
"%s102", name);
796 plot_with_zoom(t, branchname, 2, 20, c1, title, ylimit, zoom, timeago, XNow, mode, saveme, timeperiod);
797 sprintf(branchname,
"%s103", name);
798 plot_with_zoom(t, branchname, 3, 20, c1, title, ylimit, zoom, timeago, XNow, mode, saveme, timeperiod);
802 sprintf(branchname,
"%sL0ME", name);
803 plot_with_zoom(t, branchname, 95, 20, c1, title, ylimit, zoom, timeago, XNow, mode, saveme, timeperiod);
804 sprintf(branchname,
"%sL0NE", name);
805 plot_with_zoom(t, branchname, 11, 20, c1, title, ylimit, zoom, timeago, XNow, mode, saveme, timeperiod);
806 sprintf(branchname,
"%sL0SE", name);
807 plot_with_zoom(t, branchname, 14, 20, c1, title, ylimit, zoom, timeago, XNow, mode, saveme, timeperiod);
810 sprintf(branchname,
"%sL0MW", name);
811 plot_with_zoom(t, branchname, 4, 20, c1, title, ylimit, zoom, timeago, XNow, mode, saveme, timeperiod);
812 sprintf(branchname,
"%sL0NW", name);
813 plot_with_zoom(t, branchname, 5, 20, c1, title, ylimit, zoom, timeago, XNow, mode, saveme, timeperiod);
814 sprintf(branchname,
"%sL0SW", name);
815 plot_with_zoom(t, branchname, 6, 20, c1, title, ylimit, zoom, timeago, XNow, mode, saveme, timeperiod);
845 sprintf(branchname,
"%sL4MW", name);
846 plot_with_zoom(t, branchname, 7, 20, c1, title, ylimit, zoom, timeago, XNow, mode, saveme, timeperiod);
847 sprintf(branchname,
"%sL4NW", name);
848 plot_with_zoom(t, branchname, 8, 20, c1, title, ylimit, zoom, timeago, XNow, mode, saveme, timeperiod);
849 sprintf(branchname,
"%sL4SW", name);
851 plot_with_zoom(t, branchname, 9, 20, c1, title, ylimit, zoom, timeago, XNow, mode, saveme, timeperiod);
859 sprintf(title,
"Status of systems");
862 sprintf(saveme,
"%sStatuses", filepath);
865 for(
int dastatus=1;dastatus<ndastatuses+1;dastatus++)
868 sprintf(branchname,
"ENNDAS%i",dastatus);
869 if(dastatus==ndastatuses)mode = 2;
870 plot_with_zoom(t, branchname, dastatus, 20, c1, title, ylimit, zoom, timeago, XNow, mode, saveme, timeperiod);
880 char side[4] =
"WNS";
888 for(
int iter=0;iter<nsides;iter++)
900 if(
block == 0)sprintf(realblock,
"00");
901 if(
block == 1)sprintf(realblock,
"01");
902 if(
block == 2)sprintf(realblock,
"08");
903 if(
block == 3)sprintf(realblock,
"09");
904 if(
block == 4)sprintf(realblock,
"18");
905 if(
block == 5)sprintf(realblock,
"19");
906 if(
block == 6)sprintf(realblock,
"26");
907 if(
block == 7)sprintf(realblock,
"27");
909 if(iter==0)sprintf(title,
"Strain measured on West side of blocks;;Micro strain");
910 if(iter==1)sprintf(title,
"Strain measured on North side of blocks;;Micro strain");
928 for(
int x=1;
x<xmax+1;
x++)
931 for(
int y=1;
y<ymax+1;
y++)
933 if(
x==xmax &&
y==ymax) mode = 2;
936 sprintf(branchname,
"%s%i%c%i%i",name,
block,side[iter],
x,
y);
937 sprintf(saveme,
"%s%s%c",filepath, name,side[iter]);
939 plot_strain_with_zoom(t, branchname,
x,
y, marker, c1, title, ylimit, zoom, timeago, XNow, mode, saveme, timeperiod);
949 gStyle->SetMarkerSize(2);
956 gStyle->SetMarkerSize(1);
965 sprintf(saveme,
"%sDist%c", filepath, side[iter+1]);
970 if((
block==0 && iter==1) || (
block==27 && iter==0) || (
block==28 && iter==1))
continue;
972 if(iter==0) sprintf(title,
"Distance from original position (North side of blocks);;Distance (inches)");
973 if(iter==1) sprintf(title,
"Distance from original position (South side of blocks);;Distance (inches)");
976 else if (
block < 28) sprintf(name,
"ED%i",
block);
977 else sprintf(name,
"EDSB");
983 for(
int x=1;
x<xmax+1;
x++)
985 if(iter == 1 &&
x == 2)
988 if(
block==nblocks-2)mode = 2;
991 sprintf(branchname,
"%s%c%i1", name, side[iter+1],
x);
992 plot_with_zoom(t, branchname, col2, marker, c2, title, ylimit, zoom2, timeago, XNow, mode, saveme, timeperiod);
995 if(col2==910)col2=920;
999 if(
block!=28)sprintf(branchname,
"%s%c%i9",name, side[iter+1],
x);
1002 sprintf(branchname,
"%s%c%i6",name, side[iter+1],
x);
1003 if(
x==xmax &&
block==nblocks-1)mode = 2;
1005 plot_with_zoom(t, branchname, col2, marker, c2, title, ylimit, zoom2, timeago, XNow, mode, saveme, timeperiod);
1007 if(col2==910)col2=920;
1014 gStyle->SetMarkerSize(2);
1020 gStyle->SetMarkerSize(1);
1024 gStyle->SetMarkerSize(1);
1033 sprintf(title,
"Internal temperature;;Temperature (C)");
1034 sprintf(saveme,
"%sIntTemp", filepath);
1036 for(
int s=0;
s<nsides;
s++)
1038 if(
s==0) sprintf(name,
"ETN");
1039 else if(
s==1) sprintf(name,
"ETW");
1043 for(
int x=1;
x<xmax+1;
x++)
1045 if(
s==nsides-1 &&
block==nblocks-1 &&
x==xmax) mode = 2;
1047 sprintf(branchname,
"ET%i%c%i1",
block, side[s],
x);
1048 plot_with_zoom(t, branchname, col, 20+
block, c1, title, ylimit, zoom, timeago, XNow, mode, saveme, timeperiod);
1057 sprintf(title,
"Outside air temperature;;Temperature (F)");
1058 sprintf(saveme,
"%sOAT", filepath);
1059 sprintf(branchname,
"EOAT");
1062 plot_with_zoom(t, branchname, 1, 7, c1, title, ylimit, zoom, timeago, XNow, 3, saveme, timeperiod);
1064 sprintf(title,
"Cooling liquid temperature;;Temperature (F)");
1065 sprintf(saveme,
"%sGLYCOT", filepath);
1066 sprintf(branchname,
"EGLYCOT");
1069 plot_with_zoom(t, branchname, 1, 7, c1, title, ylimit, zoom, timeago, XNow, 3, saveme, timeperiod);
1071 sprintf(title,
"High Temperature warning status");
1072 sprintf(saveme,
"%sHTWarn", filepath);
1073 sprintf(branchname,
"EHTWARN");
1076 plot_with_zoom(t, branchname, 1, 7, c1, title, ylimit, zoom, timeago, XNow, 3, saveme, timeperiod);
diblock
print "ROW IS " print row
std::map< std::string, double > xmax
void plot_strain_with_zoom(TTree *t, char *branchname, int x, int y, int marker, TCanvas *c1, char *title, float *ylimit, float *zoom, int timeago, int XNow, int mode, char *saveme, int timeperiod)
block
print "ROW IS " print row
void plot_with_zoom(TTree *t, char *branchname, int color, int marker, TCanvas *c1, char *title, float *ylimit, float *zoom, UInt_t timeago, UInt_t XNow, int mode, char *saveme, int timeperiod)