5 gStyle->SetOptStat(
" ");
6 gStyle->SetLabelSize(0.025);
7 gStyle->SetLegendBorderSize(1);
14 TDatime *
TNow =
new TDatime;
15 TDatime *
SRtime =
new TDatime;
17 int XNowGMT = TNowGMT->Convert(kTRUE);
18 int XNow = TNow ->Convert(kFALSE);
23 int XDayAgo = XNow - 60 * 60 * 24;
24 int XWeekAgo = XNow - 60 * 60 * 24 * 7;
25 int XMonthAgo = XNow - 60 * 60 * 24 * 30;
29 unsigned int year = 0;
30 unsigned short int month = 0;
31 unsigned short int day = 0;
45 unsigned int yearEnd = 0;
46 unsigned short int monthEnd = 0;
47 unsigned short int dayEnd = 0;
53 gSystem->Setenv(
"TZ",
"UTC");
54 gStyle->SetTimeOffset(0);
60 TDatime *Ttemp =
new TDatime;
61 int Xfin = Ttemp->Convert();
62 TDatime *Tfinish =
new TDatime(Xfin);
63 TPaveText *UpdateTextTB =
new TPaveText(0.1, 0.0, 0.5, 0.05,
"NDC");
64 UpdateTextTB->SetLineColor(0);
65 UpdateTextTB->SetFillColor(0);
66 UpdateTextTB->SetBorderSize(1);
67 UpdateTextTB->SetMargin(0.0);
68 UpdateTextTB->SetTextAlign(11);
72 sprintf(buff1,
"Last updated on: %s (central time)", Tfinish->AsString());
73 UpdateTextTB->AddText(buff1);
75 sprintf(buff2TB,
"Last run: %d", TBRunH);
76 UpdateTextTB->AddText(buff2TB);
81 in.open(
"TBNearline.txt");
82 int Runnum,RawBeamlinelarge,OnMonBeamline,OnMonBeamlineSmall,RecoBeamline,RecoBeamlineSMALL,RawDDActivity1bigfile,OnMonDDActivity1,OnMonDDActivity1small,recoDDActivity1files,recoDDActivity1SMALLfiles,TBSubrun;
86 int nbin=TBRunH-TBRunL;
88 THStack *BeamlineLarplusSmall =
new THStack (
"BeamlineLarplusSmall",
";Run Number; Number of Subruns");
90 THStack *BeamlineOnMonLarplusSmall =
new THStack (
"BeamlineOnMonLarplusSmall",
";Run Number; Number of Subruns");
92 THStack *DDALarplusSmall =
new THStack (
"DDALarplusSmall",
";Run Number; Number of Subruns");
94 THStack *DDAOnMonLarplusSmall =
new THStack (
"DDAOnMonLarplusSmall",
";Run Number; Number of Subruns");
96 TH1F *BeamlineRecofiles =
new TH1F(
"BeamlineRecofiles",
"Nearline TestBeam Beamline Trigger: Last 7 days",nbin,tbrun1,tbrun2);
98 TH1F *DBtbsubrun =
new TH1F(
"DBtbsubrun",
"", nbin,tbrun1, tbrun2);
100 TH1F *BeamlineRecoSMALLfiles =
new TH1F(
"BeamlineRecoSMALLfiles",
"", nbin,tbrun1, tbrun2);
102 TH1F *BeamlineOnMonfiles =
new TH1F(
"BeamlineOnMonfiles",
";Run Number; Number of Subruns", nbin , tbrun1 , tbrun2);
104 TH1F *BeamlineOnMonsmallfiles =
new TH1F(
"BeamlineOnMonsmallfiles",
";Run Number; Number of Subruns", nbin , tbrun1 , tbrun2);
106 TH1F *BeamlineRawlargefiles =
new TH1F(
"BeamlineRawlargefiles",
"", nbin , tbrun1 , tbrun2);
108 TH1F *DDARecofiles =
new TH1F(
"DDARecofiles",
"Nearline TestBeam DDActitivy1 Trigger: Last 7 day", nbin , tbrun1 , tbrun2);
110 TH1F *DDARecoSMALLfiles =
new TH1F(
"DDARecoSMALLfiles",
"", nbin , tbrun1 , tbrun2);
112 TH1F *DDARawlargefiles =
new TH1F(
"DDARawlargefiles",
"", nbin , tbrun1 , tbrun2);
114 TH1F *TBDDAOnMon =
new TH1F(
"TBDDAOnMOn",
";Run Number;Number of Subruns", nbin , tbrun1 , tbrun2);
116 TH1F *TBDDAOnMonsmall =
new TH1F(
"TBDDAOnMOnsmall",
";Run Number;Number of Subruns", nbin , tbrun1 , tbrun2);
118 TH1F *DBtbsubrun1 =
new TH1F(
"DBtbsubrun1",
"", nbin,tbrun1, tbrun2);
126 in>>Runnum>>RawBeamlinelarge>>OnMonBeamline>>OnMonBeamlineSmall>>RecoBeamline>>RecoBeamlineSMALL>>RawDDActivity1bigfile>>OnMonDDActivity1>>OnMonDDActivity1small>>recoDDActivity1files>>recoDDActivity1SMALLfiles>>TBSubrun;
136 BeamlineRecofiles->SetBinContent(BeamlineRecofiles->FindBin(Runnum),RecoBeamline);
139 BeamlineRecoSMALLfiles->SetBinContent(BeamlineRecoSMALLfiles->FindBin(Runnum),RecoBeamlineSMALL);
142 BeamlineOnMonfiles->SetBinContent(BeamlineOnMonfiles->FindBin(Runnum),OnMonBeamline);
144 BeamlineOnMonsmallfiles->SetBinContent(BeamlineOnMonsmallfiles->FindBin(Runnum),OnMonBeamlineSmall);
147 BeamlineRawlargefiles->SetBinContent(BeamlineRawlargefiles->FindBin(Runnum),RawBeamlinelarge);
150 DBtbsubrun->SetBinContent(DBtbsubrun->FindBin(Runnum),TBSubrun);
152 DDARecofiles->SetBinContent(DDARecofiles->FindBin(Runnum),recoDDActivity1files);
154 TBDDAOnMon->SetBinContent(TBDDAOnMon->FindBin(Runnum),OnMonDDActivity1);
156 TBDDAOnMonsmall->SetBinContent(TBDDAOnMonsmall->FindBin(Runnum),OnMonDDActivity1small);
158 DDARecoSMALLfiles->SetBinContent(DDARecoSMALLfiles->FindBin(Runnum),recoDDActivity1SMALLfiles);
161 DDARawlargefiles->SetBinContent(DDARawlargefiles->FindBin(Runnum),RawDDActivity1bigfile);
164 DBtbsubrun1->SetBinContent(DBtbsubrun1->FindBin(Runnum),TBSubrun);
174 TCanvas *beamreco =
new TCanvas (
"beamreco",
"",700,700);
176 BeamlineRecofiles->SetFillColor(kAzure+1);
177 BeamlineRecofiles->SetLineColor(kAzure+1);
179 BeamlineRecoSMALLfiles->SetFillStyle(3001);
180 BeamlineRecoSMALLfiles->SetFillColor(kAzure+1);
181 BeamlineRecoSMALLfiles->SetLineColor(kAzure+1);
185 DBtbsubrun->SetLineColor(kBlack);
186 DBtbsubrun->SetLineWidth(3);
188 BeamlineRawlargefiles->SetLineColor(
kRed);
189 BeamlineRawlargefiles->SetLineWidth(3);
192 BeamlineLarplusSmall->Add(BeamlineRecofiles);
193 BeamlineLarplusSmall->Add(BeamlineRecoSMALLfiles);
195 BeamlineLarplusSmall->Draw();
196 BeamlineLarplusSmall->GetYaxis()->SetTitleOffset(1.4);
197 BeamlineLarplusSmall->SetMaximum(120);
198 BeamlineLarplusSmall->SetMinimum(0);
200 BeamlineRawlargefiles->Draw(
"SAME");
201 DBtbsubrun->Draw(
"SAME");
204 auto leg =
new TLegend(0.12,0.75,0.45,0.9);
205 leg->SetTextFont(62);
206 leg->SetLineColor(1);
207 leg->SetLineStyle(1);
208 leg->SetLineWidth(3);
209 leg->SetFillColor(0);
210 leg->SetFillStyle(1001);
211 leg->SetShadowColor(0);
212 leg->SetDrawOption(0);
213 leg->SetBorderSize(0);
214 leg->SetTextSize(0.02);
216 leg->AddEntry(
"BeamlineRecofiles",
"Beamline Reco Files",
"f");
217 leg->AddEntry(
"BeamlineRecoSMALLfiles",
"Beamline Reco SMALL files",
"f");
218 leg->AddEntry(
"BeamlineRawlargefiles",
"Beamline Raw files",
"l");
219 leg->AddEntry(
"DBtbsubrun",
"DB Subrun",
"l");
221 UpdateTextTB->Draw();
227 TCanvas *TBBeamlineOnMon =
new TCanvas(
"TBBeamlineOnMon",
"",700,700);
229 BeamlineOnMonfiles->SetFillColor(
kOrange-2);
230 BeamlineOnMonfiles->SetLineColor(
kOrange-2);
232 BeamlineOnMonsmallfiles->SetFillStyle(3001);
233 BeamlineOnMonsmallfiles->SetFillColor(
kOrange-2);
234 BeamlineOnMonsmallfiles->SetLineColor(
kOrange-2);
236 DBtbsubrun->SetLineColor(kBlack);
237 DBtbsubrun->SetLineWidth(3);
239 BeamlineRawlargefiles->SetLineColor(
kRed);
240 BeamlineRawlargefiles->SetLineWidth(3);
242 BeamlineOnMonLarplusSmall->Add(BeamlineOnMonfiles);
243 BeamlineOnMonLarplusSmall->Add(BeamlineOnMonsmallfiles);
244 BeamlineOnMonLarplusSmall->Draw();
245 BeamlineOnMonLarplusSmall->GetYaxis()->SetTitleOffset(1.4);
246 BeamlineOnMonLarplusSmall->SetMaximum(120);
247 BeamlineOnMonLarplusSmall->SetMinimum(0);
248 BeamlineRawlargefiles->Draw(
"same");
249 DBtbsubrun->Draw(
"same");
252 auto leg5 =
new TLegend(0.12,0.75,0.45,0.9);
253 leg5->SetTextFont(62);
254 leg5->SetLineColor(1);
255 leg5->SetLineStyle(1);
256 leg5->SetLineWidth(3);
257 leg5->SetFillColor(0);
258 leg5->SetFillStyle(1001);
259 leg5->SetShadowColor(0);
260 leg5->SetDrawOption(0);
261 leg5->SetBorderSize(0);
262 leg5->SetTextSize(0.02);
264 leg5->AddEntry(
"BeamlineOnMonfiles",
"Beamline OnMon files",
"f");
265 leg5->AddEntry(
"BeamlineOnMonsmallfiles",
"Beamline OnMon SMALL files",
"f");
266 leg5->AddEntry(
"BeamlineRawlargefiles",
"Beamline Raw files",
"l");
267 leg5->AddEntry(
"DBtbsubrun",
"DB Subrun",
"l");
270 UpdateTextTB->Draw();
278 TCanvas *ddareco =
new TCanvas (
"ddareco",
"",700,700);
281 DDARecofiles->SetFillColor(kAzure+1);
282 DDARecofiles->SetLineColor(kAzure+1);
284 DDARecoSMALLfiles->SetFillStyle(3001);
285 DDARecoSMALLfiles->SetFillColor(kAzure+1);
286 DDARecoSMALLfiles->SetLineColor(kAzure+1);
289 DBtbsubrun1->SetLineColor(kBlack);
290 DBtbsubrun1->SetLineWidth(3);
292 DDARawlargefiles->SetLineColor(
kRed);
293 DDARawlargefiles->SetLineWidth(3);
296 DDALarplusSmall->Add(DDARecofiles);
297 DDALarplusSmall->Add(DDARecoSMALLfiles);
298 DDALarplusSmall->Draw();
299 DDALarplusSmall->SetMaximum(90);
300 DDALarplusSmall->SetMinimum(0);
301 DDARawlargefiles->Draw(
"SAME");
302 DBtbsubrun1->Draw(
"SAME");
304 auto leg1 =
new TLegend(0.12,0.75,0.45,0.9);
305 leg1->SetTextFont(62);
306 leg1->SetLineColor(1);
307 leg1->SetLineStyle(1);
308 leg1->SetLineWidth(3);
309 leg1->SetFillColor(0);
310 leg1->SetFillStyle(1001);
311 leg1->SetShadowColor(0);
312 leg1->SetDrawOption(0);
313 leg1->SetBorderSize(0);
314 leg1->SetTextSize(0.02);
315 leg1->AddEntry(
"DDARecofiles",
"DDActivity1 Reco files",
"f");
316 leg1->AddEntry(
"DDARecoSMALLfiles",
"DDActivity1 Reco SMALL files",
"f");
317 leg1->AddEntry(
"DDARawlargefiles",
"DDActivity1 Raw files",
"l");
318 leg1->AddEntry(
"DBtbsubrun1",
"DB Subrun",
"l");
321 UpdateTextTB->Draw();
330 TCanvas *TBddaOnmon =
new TCanvas(
"TBddaOnmon",
"",700,700);
333 TBDDAOnMon->SetFillColor(
kOrange-2);
334 TBDDAOnMon->SetLineColor(
kOrange-2);
336 TBDDAOnMonsmall->SetFillStyle(3001);
337 TBDDAOnMonsmall->SetFillColor(
kOrange-2);
338 TBDDAOnMonsmall->SetLineColor(
kOrange-2);
341 DBtbsubrun1->SetLineColor(kBlack);
342 DBtbsubrun1->SetLineWidth(3);
344 DDARawlargefiles->SetLineColor(
kRed);
345 DDARawlargefiles->SetLineWidth(3);
347 DDAOnMonLarplusSmall->Add(TBDDAOnMon);
348 DDAOnMonLarplusSmall->Add(TBDDAOnMonsmall);
349 DDAOnMonLarplusSmall->Draw();
350 DDAOnMonLarplusSmall->SetMaximum(90);
351 DDAOnMonLarplusSmall->SetMinimum(0);
352 DDARawlargefiles->Draw(
"SAME");
353 DBtbsubrun1->Draw(
"SAME");
356 auto leg4 =
new TLegend(0.12,0.75,0.45,0.9);
357 leg4->SetTextFont(62);
358 leg4->SetLineColor(1);
359 leg4->SetLineStyle(1);
360 leg4->SetLineWidth(3);
361 leg4->SetFillColor(0);
362 leg4->SetFillStyle(1001);
363 leg4->SetShadowColor(0);
364 leg4->SetDrawOption(0);
365 leg4->SetBorderSize(0);
366 leg4->SetTextSize(0.02);
367 leg4->AddEntry(TBDDAOnMon,
"DDActivity1 OnMon files",
"f");
368 leg4->AddEntry(TBDDAOnMonsmall,
"DDActivity1 OnMon SMALL files",
"f");
369 leg4->AddEntry(
"DDARawlargefiles",
"DDActivity1 Raw files",
"l");
370 leg4->AddEntry(
"DBtbsubrun1",
"DB Subrun",
"l");
375 UpdateTextTB->Draw();
381 TBBeamlineOnMon->Print(
"/nusoft/app/web/htdoc/nova/datacheck/nearline/plots/TestBeam-Beamline-P1NearlineOnMonFilesDay.png");
382 TBddaOnmon->Print(
"/nusoft/app/web/htdoc/nova/datacheck/nearline/plots/TestBeam-Act-P1NearlineOnMonFilesDay.png");
383 beamreco->Print(
"/nusoft/app/web/htdoc/nova/datacheck/nearline/plots/TestBeam-Beamline-P1NearlineRecoFilesDay.png");
384 ddareco->Print(
"/nusoft/app/web/htdoc/nova/datacheck/nearline/plots/TestBeam-Act-P1NearlineRecoFilesDay.png");
void TB_Nearline_Watchdog_Plots(int TBRunL, int TBRunH)
static float min(const float a, const float b, const float c)
static constexpr Double_t year