< status of the file. 1 for files which passed datacheck cuts.
14 gStyle->SetOptStat(0);
16 gStyle->SetOptTitle(1);
17 gStyle->SetPalette(1);
18 gStyle->SetFillColor(0);
19 gStyle->SetPadColor(0);
20 gStyle->SetCanvasColor(0);
21 gStyle->SetStatColor(0);
22 gStyle->SetTitleColor(1);
23 gStyle->SetTitleSize(0.06);
24 gStyle->SetPadBorderMode(0);
25 gStyle->SetPadBottomMargin(0.15);
26 gStyle->SetPadLeftMargin(0.12);
27 gStyle->SetPadRightMargin(0.09);
28 gStyle->SetFrameBorderMode(0);
29 gStyle->SetCanvasBorderMode(0);
31 TDatime da(2003,01,02,1,00,00);
32 gStyle->SetTimeOffset(da.Convert());
34 TDatime *
TNow =
new TDatime;
35 int XNow=TNow->Convert();
36 int XDayAgo =XNow - 60*60*24;
37 int XWeekAgo =XNow - 60*60*24*7;
38 int X2WeeksAgo =XNow - 60*60*24*7*2;
39 int XMonthAgo =XNow - 60*60*24*30;
40 int X2MonthsAgo=XNow - 60*60*24*30*2;
43 cout<<XNow<<
"\t"<<XDayAgo<<
"\t"<<60*60*24<<
"\t"<<XDayAgo-XNow<<
endl;
49 XPeriod[3]=X2WeeksAgo;
51 XPeriod[4]=X2MonthsAgo;
54 cout<<XPeriod[
i]<<
"\t"<<XNow - XPeriod[
i]<<
endl;
60 TString htitle[50][5];
65 TH2F *hNearline[50][5];
66 TGraph *gNearline[50][5];
75 Period[0][0]=
"24 hr";
79 Period[2][0]=
"month";
80 Period[2][1]=
"MONTH";
81 Period[3][0]=
"two weeks";
82 Period[3][1]=
"TWOWEEKS";
83 Period[4][0]=
"two months";
84 Period[4][1]=
"TWOMONTHS";
92 for(
int i=0;
i<NPeriods;
i++){
93 hname[0][
i] =
"NEvents" + Period[
i][1];
94 htitle[0][
i]=
"Number of events noise events for last "+Period[
i][0]+
";End subrun time; Number of events per subrun";
96 hname[1][
i] =
"CosmicRate"+Period[
i][1];
97 htitle[1][
i]=
"Cosmic trigger rate for last "+Period[
i][0]+
";End subrun time; Cosmic trigger rate per subrun (Hz)";
99 hname[2][
i] =
"RunNumber"+Period[
i][1];
100 htitle[2][
i]=
"Run Number for last "+Period[
i][0]+
";End subrun time; Run Number";
102 hname[3][
i] =
"SubrunNumber"+Period[
i][1];
103 htitle[3][
i]=
"Subrun Number for last "+Period[
i][0]+
";End subrun time; Subrun Number";
105 hname[4][
i] =
"NEmptyEvents"+Period[
i][1];
106 htitle[4][
i]=
"Fraction of empty events for last "+Period[
i][0]+
";End subrun time; Fraction of empty events per subrun (%)";
108 hname[5][
i] =
"NNoiseEvents"+Period[
i][1];
109 htitle[5][
i]=
"Fraction of noise events for last "+Period[
i][0]+
";End subrun time; noise slice only events percentage (%)";
111 hname[6][
i] =
"NGoodChannels"+Period[
i][1];
112 htitle[6][
i]=
"Number of active channels for last "+Period[
i][0]+
";End subrun time; # active channels per subrun";
114 hname[7][
i] =
"NSlices"+Period[
i][1];
115 htitle[7][
i]=
"Number of slices per event for last "+Period[
i][0]+
";End subrun time; # slices per event";
117 hname[8][
i] =
"NHitsPerSlices"+Period[
i][1];
118 htitle[8][
i]=
"Number of hits per slice with noise slice for last "+Period[
i][0]+
";End subrun time; # hits per slice";
120 hname[9][
i] =
"NHitsPerSlicesNoNoise"+Period[
i][1];
121 htitle[9][
i]=
"Number hits per slice without noise for last "+Period[
i][0]+
";End subrun time; # hits per slice";
123 hname[10][
i]=
"NHitPerEvent"+Period[
i][1];
124 htitle[10][
i]=
"Fraction of active channels per event for last "+Period[
i][0]+
";End subrun time; # hits /# active channels (%)";
126 hname[11][
i]=
"OccupancyMPV"+Period[
i][1];
127 htitle[11][
i]=
"Fit (Landau) MPV for hit occupancy for last "+Period[
i][0]+
";End subrun time; MPV";
129 hname[12][
i]=
"OccupancySigma"+Period[
i][1];
130 htitle[12][
i]=
"Fit (Landau) sigma for hit occupancy for last " +Period[
i][0]+
";End subrun time; sigma";
132 hname[13][
i]=
"SubrunDuration"+Period[
i][1];
133 htitle[13][
i]=
"Duration of the subrun for last " +Period[
i][0]+
";End subrun time;minutes";
135 hname[14][
i]=
"SliceDuration"+Period[
i][1];
136 htitle[14][
i]=
"Duration of slices for last " +Period[
i][0]+
";End subrun time;ns";
138 hname[15][
i]=
"DCM11"+Period[
i][1];
139 htitle[15][
i]=
"Number of active FEBs for DCM-3-1-1 for last " +Period[
i][0]+
";End subrun time;# active FEBs per subrun";
141 hname[16][
i]=
"DCM12"+Period[
i][1];
142 htitle[16][
i]=
"Number of active FEBs for DCM-3-1-2 for last " +Period[
i][0]+
";End subrun time;# active FEBs per subrun";
144 hname[17][
i]=
"DCM13"+Period[
i][1];
145 htitle[17][
i]=
"Number of active FEBs for DCM-3-1-3 for last " +Period[
i][0]+
";End subrun time;# active FEBs per subrun";
147 hname[18][
i]=
"DCM21"+Period[
i][1];
148 htitle[18][
i]=
"Number of active FEBs for DCM-3-2-1 for last " +Period[
i][0]+
";End subrun time;# active FEBs per subrun";
150 hname[19][
i]=
"DCM22"+Period[
i][1];
151 htitle[19][
i]=
"Number of active FEBs for DCM-3-2-2 for last " +Period[
i][0]+
";End subrun time;# active FEBs per subrun";
153 hname[20][
i]=
"DCM23"+Period[
i][1];
154 htitle[20][
i]=
"Number of active FEBs for DCM-3-2-3 for last " +Period[
i][0]+
";End subrun time;# active FEBs per subrun";
156 hname[21][
i]=
"DCM31"+Period[
i][1];
157 htitle[21][
i]=
"Number of active FEBs for DCM-3-3-1 for last " +Period[
i][0]+
";End subrun time;# active FEBs per subrun";
159 hname[22][
i]=
"DCM32"+Period[
i][1];
160 htitle[22][
i]=
"Number of active FEBs for DCM-3-3-2 for last " +Period[
i][0]+
";End subrun time;# active FEBs per subrun";
162 hname[23][
i]=
"DCM33"+Period[
i][1];
163 htitle[23][
i]=
"Number of active FEBs for DCM-3-3-3 for last " +Period[
i][0]+
";End subrun time;# active FEBs per subrun";
165 hname[24][
i]=
"DCM41"+Period[
i][1];
166 htitle[24][
i]=
"Number of active FEBs for DCM-3-4-1 for last " +Period[
i][0]+
";End subrun time;# active FEBs per subrun";
168 hname[25][
i]=
"DCM42"+Period[
i][1];
169 htitle[25][
i]=
"Number of active FEBs for DCM-3-4-2 for last " +Period[
i][0]+
";End subrun time;# active FEBs per subrun";
172 hname[26][
i]=
"nDCMs"+Period[
i][1];
173 htitle[26][
i]=
"Number of active DCMs for last " +Period[
i][0]+
";End subrun time;# active DCMs per subrun";
177 hname[27][
i]=
"CMNumberTracks"+Period[
i][1];
178 htitle[27][
i]=
"Number of cosmic muon tracks for last " +Period[
i][0]+
";End subrun time;number of tracks per subrun";
180 hname[28][
i]=
"CMLiveTime"+Period[
i][1];
181 htitle[28][
i]=
"Cosmic muons effective exposure time for last "+Period[
i][0]+
";End subrun time;( s)";
183 hname[29][
i]=
"CMRate"+Period[
i][1];
184 htitle[29][
i]=
"Normilized Cosmic muon rate for last "+Period[
i][0]+
";End subrun time;(Hz)/ # active channels";
186 hname[30][
i]=
"CMTrackLength"+Period[
i][1];
187 htitle[30][
i]=
"Cosmic muon trak length for last "+Period[
i][0]+
";End subrun time;(cm)";
189 hname[31][
i]=
"CMTrackRMS"+Period[
i][1];
190 htitle[31][
i]=
"Cosmic muon trak RMS for last "+Period[
i][0]+
";End subrun time;(cm)";
192 hname[32][
i] =
"NRawChannels"+Period[
i][1];
193 htitle[32][
i]=
"Number of active raw channels for last "+Period[
i][0]+
";End subrun time; # active raw channels per subrun";
195 hname[33][
i]=
"FEB"+Period[
i][1];
196 htitle[33][
i]=
"Number of active FEBs for last " +Period[
i][0]+
";End subrun time;# active FEBs per subrun";
198 hname[34][
i] =
"NHitsPerNoiseSlices"+Period[
i][1];
199 htitle[34][
i]=
"Number of hits per noise slice for last "+Period[
i][0]+
";End subrun time; # hits per slice";
201 hRunname[
i] =
"RunBoundry"+Period[
i][1];
202 hRuntitle[
i] =
"Time of the new run for last "+Period[
i][0]+
";Start subrun time; # hits per slice";
206 for(
int i=0;
i<NPeriods;
i++){
207 for(
int j=0;
j<NHist;
j++){
209 hNearline[
j][
i] =
new TH2F(hname[
j][
i],htitle[
j][i],1000,XPeriod[i], XNow, 100,0,0.1);
210 hNearline[
j][
i]->GetXaxis()->SetTimeDisplay(1);
211 hNearline[
j][
i]->GetXaxis()->SetLabelSize(0.03);
212 hNearline[
j][
i]->SetMarkerStyle(2);
213 hNearline[
j][
i]->SetMarkerSize(2);
214 hNearline[
j][
i]->SetMarkerColor(2);
217 if(
i==0) hNearline[
j][
i]->GetXaxis()->SetTimeFormat(
"%H:%M");
218 else hNearline[
j][
i]->GetXaxis()->SetTimeFormat(
"%m\/%d");
220 hNearline[
j][
i]->SetBit(TH1::kCanRebin);
225 hRun[
i] =
new TH2F(hRunname[
i],hRuntitle[i],1000,XPeriod[i], XNow, 1,0,100000);
226 hRun[
i]->GetXaxis()->SetTimeDisplay(1);
227 hRun[
i]->GetXaxis()->SetLabelSize(0.03);
228 hRun[
i]->SetMarkerStyle(2);
229 hRun[
i]->SetMarkerSize(2);
230 hRun[
i]->SetMarkerColor(1);
233 if(
i==0) hRun[
i]->GetXaxis()->SetTimeFormat(
"%H:%M");
234 else hRun[
i]->GetXaxis()->SetTimeFormat(
"%m\/%d");
236 hRun[
i]->SetBit(TH1::kCanRebin);
245 TChain *numichain0 =
new TChain(
"cana");
246 TChain *numichain1 =
new TChain(
"cana");
247 TChain *numichain2 =
new TChain(
"cana");
248 TChain *numichain3 =
new TChain(
"cana");
249 TChain *numichain4 =
new TChain(
"cana");
251 TChain *bnbchain0 =
new TChain(
"cana");
252 TChain *bnbchain1 =
new TChain(
"cana");
253 TChain *bnbchain2 =
new TChain(
"cana");
254 TChain *bnbchain3 =
new TChain(
"cana");
255 TChain *bnbchain4 =
new TChain(
"cana");
259 Int_t firstBin = -100;
261 Int_t
nBins = (lastBin - firstBin) / binSize;
265 const char* software_release=
"S12.02.14";
274 std::stringstream dbstream;
277 dbstream <<
"select * from nearline_metrics,subrun_cosmicmetrics where " 278 <<
" nearline_metrics.softwarerelease='"<<software_release<<
"' " 279 <<
" and nearline_metrics.triggertype="<<trig_type
280 <<
" and nearline_metrics.run=subrun_cosmicmetrics.run" 281 <<
" and nearline_metrics.subrun=subrun_cosmicmetrics.subrun" 282 <<
" and nearline_metrics.triggertype=subrun_cosmicmetrics.triggertype" 284 <<
" order by nearline_metrics.run desc";
289 dbstring = dbstream.str();
291 dbcstr =
new char [dbstring.size()+1];
292 strcpy(dbcstr, dbstring.c_str());
295 TSQLServer *
db = TSQLServer::Connect(
"pgsql://novadbdev.fnal.gov/nova_dev",
"nova_reader",
"");
296 TSQLStatement *
stmt = db->Statement(dbcstr,1000);
305 while (stmt->NextResultRow())
310 UInt_t
run = stmt->GetUInt(0);
311 Int_t
subrun = stmt->GetInt(1);
312 Int_t triggertype = stmt->GetInt(2);
313 Int_t
nevents = stmt->GetInt(3);
314 Int_t nemptyevents = stmt->GetInt(4);
315 Int_t nnoiseevents = stmt->GetInt(5);
317 Int_t nrawactivechannels = stmt->GetInt(7);
318 const char* firsteventtime = stmt->GetString(8);
319 const char* firstnonemptyeventtime = stmt->GetString(9);
320 const char* lastnonemptyeventtime = stmt->GetString(10);
321 const char* lasteventtime = stmt->GetString(11);
322 Double_t nslices = stmt->GetDouble(12);
323 Double_t sliceduration = stmt->GetDouble(13);
324 Double_t hitsperslice = stmt->GetDouble(14);
325 Double_t hitsperslicenonoise = stmt->GetDouble(15);
326 Double_t hitsperevent = stmt->GetDouble(16);
327 Double_t occupancympv = stmt->GetDouble (17);
328 Double_t occupancysigma = stmt->GetDouble(18);
329 const char*
detector = stmt->GetString(19);
330 const char* softwarerelease = stmt->GetString(20);
331 const char* inserttime = stmt->GetString(21);
332 const char* insertuser = stmt->GetString(22);
333 Int_t dcm11 = stmt->GetInt(21);
334 Int_t dcm12 = stmt->GetInt(22);
335 Int_t dcm13 = stmt->GetInt(23);
336 Int_t dcm21 = stmt->GetInt(24);
337 Int_t dcm22 = stmt->GetInt(25);
338 Int_t dcm23 = stmt->GetInt(26);
339 Int_t dcm31 = stmt->GetInt(27);
340 Int_t dcm32 = stmt->GetInt(28);
341 Int_t dcm33 = stmt->GetInt(29);
342 Int_t dcm41 = stmt->GetInt(30);
343 Int_t dcm42 = stmt->GetInt(31);
344 Int_t ndcms = stmt->GetInt(32);
345 Int_t
status = stmt->GetInt(33);
346 UInt_t crun = stmt->GetUInt(36);
347 Int_t csubrun = stmt->GetInt(37);
348 Int_t ctriggertype = stmt->GetInt(38);
349 Int_t cnevents = stmt->GetInt(39);
350 Double_t cntracks = stmt->GetDouble(40);
351 Double_t clivetime = stmt->GetDouble(41);
352 Double_t ccosmicrate = stmt->GetDouble(42);
353 Double_t ctracklength = stmt->GetDouble(43);
354 Double_t ctrackrms = stmt->GetDouble(44);
360 Double_t noisepercentage = 0;
364 emptypercentage=((double) nemptyevents*100)/((double) nevents);
365 noisepercentage=((double) nnoiseevents*100)/((double) nevents);
368 Int_t smallrun=run/100;
373 TDatime *FirstTime =
new TDatime(firstnonemptyeventtime);
375 TDatime *LastTime =
new TDatime(lasteventtime);
377 UInt_t FirstTimeSec = FirstTime->Convert();
378 Int_t FirstYear = FirstTime->GetYear();
379 UInt_t LastTimeSec = LastTime->Convert();
380 Int_t LastYear = LastTime->GetYear();
381 UInt_t Diff = LastTimeSec - FirstTimeSec;
385 for(
int i=0;
i<NPeriods;
i++){
388 cout<<LastTimeSec<<
"\t"<<XPeriod[
i]<<
"\t"<< LastTimeSec - XPeriod[
i] <<
endl;
391 if(LastTimeSec > XPeriod[
i]){
397 hNearline[0][
i]->Fill(LastTimeSec,nevents);
398 hNearline[1][
i]->Fill(LastTimeSec,(
float)nevents/(
float)Diff);
399 hNearline[2][
i]->Fill(LastTimeSec,run);
400 hNearline[3][
i]->Fill(LastTimeSec,subrun);
401 hNearline[4][
i]->Fill(LastTimeSec,emptypercentage);
402 hNearline[5][
i]->Fill(LastTimeSec,noisepercentage);
403 hNearline[6][
i]->Fill(LastTimeSec,nactivechannels);
404 hNearline[7][
i]->Fill(LastTimeSec,nslices);
405 hNearline[8][
i]->Fill(LastTimeSec,hitsperslice);
406 hNearline[9][
i]->Fill(LastTimeSec,hitsperslicenonoise);
407 hNearline[10][
i]->Fill(LastTimeSec,hitsperevent*100);
408 hNearline[11][
i]->Fill(LastTimeSec,occupancympv);
409 hNearline[12][
i]->Fill(LastTimeSec,occupancysigma);
410 hNearline[13][
i]->Fill(LastTimeSec,(
float)Diff/60.);
411 hNearline[14][
i]->Fill(LastTimeSec,sliceduration);
412 hNearline[15][
i]->Fill(LastTimeSec,dcm11);
413 hNearline[16][
i]->Fill(LastTimeSec,dcm12);
414 hNearline[17][
i]->Fill(LastTimeSec,dcm13);
415 hNearline[18][
i]->Fill(LastTimeSec,dcm21);
416 hNearline[19][
i]->Fill(LastTimeSec,dcm22);
417 hNearline[20][
i]->Fill(LastTimeSec,dcm23);
418 hNearline[21][
i]->Fill(LastTimeSec,dcm31);
419 hNearline[22][
i]->Fill(LastTimeSec,dcm32);
420 hNearline[23][
i]->Fill(LastTimeSec,dcm33);
421 hNearline[24][
i]->Fill(LastTimeSec,dcm41);
422 hNearline[25][
i]->Fill(LastTimeSec,dcm42);
423 hNearline[26][
i]->Fill(LastTimeSec,ndcms);
424 hNearline[27][
i]->Fill(LastTimeSec,cntracks);
425 hNearline[28][
i]->Fill(LastTimeSec,clivetime);
426 hNearline[29][
i]->Fill(LastTimeSec,ccosmicrate/
double(nactivechannels));
427 hNearline[30][
i]->Fill(LastTimeSec,ctracklength);
428 hNearline[31][
i]->Fill(LastTimeSec,ctrackrms);
429 hNearline[32][
i]->Fill(LastTimeSec,nrawactivechannels);
430 hNearline[33][
i]->Fill(LastTimeSec,dcm11+dcm12+dcm13+dcm21+dcm22+dcm23+dcm31+dcm32+dcm33+dcm41+dcm42);
431 hNearline[34][
i]->Fill(LastTimeSec,hitsperslice-hitsperslicenonoise);
432 if(subrun==0) hRun[
i]->Fill(FirstTimeSec,run);
434 int smallrun=run/100;
435 cout<<
"run="<<run<<
" subrun="<<subrun<<
endl;
447 if(i==0)numichain0->Add(Form(
"/scratch/nearline/NDOS/S12.02.14/000%d/%d/numi/cana_r000%d_s0%d_t00_numi_S12.02.14_hist.root/Cana/cana",smallrun,run,run,subrun )) ;
448 if(i==0)bnbchain0->Add(Form(
"/scratch/nearline/NDOS/S12.02.14/000%d/%d/bnb/cana_r000%d_s0%d_t01_bnb_S12.02.14_hist.root/Cana/cana",smallrun,run,run,subrun )) ;
449 if(i==1)numichain1->Add(Form(
"/scratch/nearline/NDOS/S12.02.14/000%d/%d/numi/cana_r000%d_s0%d_t00_numi_S12.02.14_hist.root/Cana/cana",smallrun,run,run,subrun )) ;
450 if(i==1)bnbchain1->Add(Form(
"/scratch/nearline/NDOS/S12.02.14/000%d/%d/bnb/cana_r000%d_s0%d_t01_bnb_S12.02.14_hist.root/Cana/cana",smallrun,run,run,subrun )) ;
451 if(i==2)numichain2->Add(Form(
"/scratch/nearline/NDOS/S12.02.14/000%d/%d/numi/cana_r000%d_s0%d_t00_numi_S12.02.14_hist.root/Cana/cana",smallrun,run,run,subrun )) ;
452 if(i==2)bnbchain2->Add(Form(
"/scratch/nearline/NDOS/S12.02.14/000%d/%d/bnb/cana_r000%d_s0%d_t01_bnb_S12.02.14_hist.root/Cana/cana",smallrun,run,run,subrun )) ;
454 if(i==3)numichain3->Add(Form(
"/scratch/nearline/NDOS/S12.02.14/000%d/%d/numi/cana_r000%d_s0%d_t00_numi_S12.02.14_hist.root/Cana/cana",smallrun,run,run,subrun )) ;
455 if(i==3)bnbchain3->Add(Form(
"/scratch/nearline/NDOS/S12.02.14/000%d/%d/bnb/cana_r000%d_s0%d_t01_bnb_S12.02.14_hist.root/Cana/cana",smallrun,run,run,subrun )) ;
456 if(i==4)numichain4->Add(Form(
"/scratch/nearline/NDOS/S12.02.14/000%d/%d/numi/cana_r000%d_s0%d_t00_numi_S12.02.14_hist.root/Cana/cana",smallrun,run,run,subrun )) ;
457 if(i==4)bnbchain4->Add(Form(
"/scratch/nearline/NDOS/S12.02.14/000%d/%d/bnb/cana_r000%d_s0%d_t01_bnb_S12.02.14_hist.root/Cana/cana",smallrun,run,run,subrun )) ;
460 if(i==0)numichain0->Add(Form(
"/scratch/nearline/NDOS/S12.02.14/000%d/%d/numi/cana_r000%d_s%d_t00_numi_S12.02.14_hist.root/Cana/cana",smallrun,run,run,subrun )) ;
461 if(i==0)bnbchain0->Add(Form(
"/scratch/nearline/NDOS/S12.02.14/000%d/%d/bnb/cana_r000%d_s%d_t01_bnb_S12.02.14_hist.root/Cana/cana",smallrun,run,run,subrun )) ;
462 if(i==1)numichain1->Add(Form(
"/scratch/nearline/NDOS/S12.02.14/000%d/%d/numi/cana_r000%d_s%d_t00_numi_S12.02.14_hist.root/Cana/cana",smallrun,run,run,subrun )) ;
463 if(i==1)bnbchain1->Add(Form(
"/scratch/nearline/NDOS/S12.02.14/000%d/%d/bnb/cana_r000%d_s%d_t01_bnb_S12.02.14_hist.root/Cana/cana",smallrun,run,run,subrun )) ;
464 if(i==2)numichain2->Add(Form(
"/scratch/nearline/NDOS/S12.02.14/000%d/%d/numi/cana_r000%d_s%d_t00_numi_S12.02.14_hist.root/Cana/cana",smallrun,run,run,subrun )) ;
465 if(i==2)bnbchain2->Add(Form(
"/scratch/nearline/NDOS/S12.02.14/000%d/%d/bnb/cana_r000%d_s%d_t01_bnb_S12.02.14_hist.root/Cana/cana",smallrun,run,run,subrun )) ;
466 if(i==3)numichain3->Add(Form(
"/scratch/nearline/NDOS/S12.02.14/000%d/%d/numi/cana_r000%d_s%d_t00_numi_S12.02.14_hist.root/Cana/cana",smallrun,run,run,subrun )) ;
467 if(i==3)bnbchain3->Add(Form(
"/scratch/nearline/NDOS/S12.02.14/000%d/%d/bnb/cana_r000%d_s%d_t01_bnb_S12.02.14_hist.root/Cana/cana",smallrun,run,run,subrun )) ;
468 if(i==4)numichain4->Add(Form(
"/scratch/nearline/NDOS/S12.02.14/000%d/%d/numi/cana_r000%d_s%d_t00_numi_S12.02.14_hist.root/Cana/cana",smallrun,run,run,subrun )) ;
469 if(i==4)bnbchain4->Add(Form(
"/scratch/nearline/NDOS/S12.02.14/000%d/%d/bnb/cana_r000%d_s%d_t01_bnb_S12.02.14_hist.root/Cana/cana",smallrun,run,run,subrun )) ;
502 const int NPoints[50][5]={0};
503 Float_t LastPoint[50][50]={0};
508 for(
int i=NPeriods-1; i>=0;i--){
509 for(
int j=0;
j<NHist;
j++){
514 for (
int ny=1; ny < hNearline[
j][
i]->GetYaxis()->GetNbins(); ny++){
515 for (
int nx=1; nx < hNearline[
j][
i]->GetXaxis()->GetNbins(); nx++){
518 if(i==0)
cout<<
"content="<<hNearline[
j][
i]->GetBinContent(nx,ny)<<
endl;
519 if (hNearline[
j][i]->GetBinContent(nx,ny)) {
522 if (ny < hMinBin) hMinBin = ny;
523 if (ny > hMaxBin) hMaxBin = ny;
530 const int Ntemp=NPoints[
j][
i];
531 Double_t Xpoints[Ntemp+200]={0};
532 Double_t Ypoints[Ntemp+200]={0};
535 for (
int nx=1; nx < hNearline[
j][
i]->GetXaxis()->GetNbins(); nx++){
536 for (
int ny=1; ny < hNearline[
j][
i]->GetYaxis()->GetNbins(); ny++){
539 if (hNearline[
j][i]->GetBinContent(nx,ny)) {
541 Xpoints[pindex]= hNearline[
j][
i]->GetXaxis()->GetBinCenter(nx);
542 if(
j==0 ||
j==2 ||
j==3 || (
j>14 &&
j<28) ||
j==32 ||
j==33){
543 Ypoints[pindex]=
ceil(hNearline[
j][i]->
GetYaxis()->GetBinCenter(ny));
545 else Ypoints[pindex]= hNearline[
j][
i]->GetYaxis()->GetBinCenter(ny);
550 LastPoint[
j][
i]=hNearline[
j][
i]->GetYaxis()->GetBinCenter(ny);
558 if (hMinBin >3 ) hMinBin = hMinBin - 2;
559 if (hMaxBin < hNearline[
j][i]->
GetXaxis()->GetNbins() -3 ) hMaxBin = hMaxBin + 2;
561 hNearline[
j][
i]->GetYaxis()->SetRange(hMinBin, hMaxBin);
565 gNearline[
j][
i] =
new TGraph(Ntemp, Xpoints, Ypoints);
566 gNearline[
j][
i]->SetTitle(htitle[
j][i]);
567 gNearline[
j][
i]->GetXaxis()->SetTimeDisplay(1);
568 gNearline[
j][
i]->GetXaxis()->SetLabelSize(0.03);
569 gNearline[
j][
i]->SetMarkerStyle(2);
570 gNearline[
j][
i]->SetMarkerSize(2);
571 gNearline[
j][
i]->SetMarkerColor(1);
574 if(i==0) gNearline[
j][
i]->GetXaxis()->SetTimeFormat(
"%H:%M");
575 else gNearline[
j][
i]->GetXaxis()->SetTimeFormat(
"%m\/%d");
578 c1 =
new TCanvas (
"c1",
"",10,10, 1000,500);
583 gNearline[
j][1]->Fit(
"pol1");
584 fNearline[
j] = gNearline[
j][1]->GetFunction(
"pol1");
587 cout<< fNearline[
j]->GetParameter(0)<<
"\t"<< fNearline[
j]->GetParameter(1)<<
endl;
588 cout<< fNearline[
j]->GetParameter(0) + fNearline[
j]->GetParameter(1) * XNow<<
endl;
596 float temp_value= fNearline[
j]->GetParameter(0) + fNearline[
j]->GetParameter(1) * XNow;
599 if (status != 2 || status !=5) status=3;
601 if (temp_value/LastPoint[
j][i]> 1.1 || temp_value/LastPoint[
j][i] < 0.9 ){
602 c1->SetFillColor(kYellow);
603 if(status !=2 ) status=5;
606 else if (temp_value/LastPoint[
j][i]> 1.3 || temp_value/LastPoint[
j][i] < 0.7 ){
612 if(temp_value/LastPoint[
j][i] > 1.1)
c1->SetFillColor(kWhite);
619 if(
j==0 ||
j==2 ||
j==3 || (
j>14 &&
j<28) ||
j==32 ||
j==33){
620 ll =
new TLegend(0.8,0.9,1.0,1.0,Form(
"Last point = %.0f",
ceil(LastPoint[
j][i])) );
622 else ll =
new TLegend(0.8,0.9,1.0,1.0,Form(
"Last point = %.2f",LastPoint[
j][i]) );
624 gNearline[
j][
i]->Draw(
"AP");
633 gNearline[
j][
i]->Draw(
"AP");
634 if(i==1) fNearline[
j]->Draw(
"same");
636 c1->Print(
"/nusoft/app/web/htdoc/nova/datacheck/nearline/plots/"+hname[
j][i]+
".png");
646 gStyle->SetCanvasPreferGL(kTRUE);
647 TCanvas *
c =
new TCanvas(
"glc",
"TH3 Drawing", 100, 10, 1000, 300);
648 TPaveLabel *
title =
new TPaveLabel(0.04, 0.86, 0.96, 0.98,
" NDOS Nearline status ");
649 TPaveLabel *runpad=
new TPaveLabel(0.04, 0.66, 0.96, 0.78, Form(
"Run/Subrun Number:%d/%d",LastRun,LastSubrun));
650 TPaveLabel *timepad =
new TPaveLabel(0.04, 0.46, 0.96, 0.58, TNow->AsString());
653 title->SetFillColor(status);
654 runpad ->SetFillColor(status);
655 timepad ->SetFillColor(status);
660 c->Print(
"/nusoft/app/web/htdoc/nova/datacheck/nearline/plots/StatusBox.png");
666 gStyle->SetOptStat(1111);
668 TH1F *TimeNuMIPeakDay =
new TH1F(
"TimeNuMIPeakDay",
";Time [#musec];Number of Events", nBins, firstBin, lastBin);
669 TH1F *TimeBNBPeakDay =
new TH1F(
"TimeBNBPeakDay",
";Time [#musec];Number of Events", nBins, firstBin, lastBin);
670 TH1F *InTimeNuMIPeakDay =
new TH1F(
"InTimeNuMIPeakDay",
";Time [#musec];Number of Events", nBins, firstBin, lastBin);
671 TH1F *InTimeBNBPeakDay =
new TH1F(
"InTimeBNBPeakDay",
";Time [#musec];Number of Events", nBins, firstBin, lastBin);
674 TH1F *TimeNuMIPeakWeek =
new TH1F(
"TimeNuMIPeakWeek",
";Time [#musec];Number of Events", nBins, firstBin, lastBin);
675 TH1F *TimeBNBPeakWeek =
new TH1F(
"TimeBNBPeakWeek",
";Time [#musec];Number of Events", nBins, firstBin, lastBin);
676 TH1F *InTimeNuMIPeakWeek =
new TH1F(
"InTimeNuMIPeakWeek",
";Time [#musec];Number of Events", nBins, firstBin, lastBin);
677 TH1F *InTimeBNBPeakWeek =
new TH1F(
"InTimeBNBPeakWeek",
";Time [#musec];Number of Events", nBins, firstBin, lastBin);
679 TH1F *TimeNuMIPeakMonth =
new TH1F(
"TimeNuMIPeakMonth",
";Time [#musec];Number of Events", nBins, firstBin, lastBin);
680 TH1F *TimeBNBPeakMonth =
new TH1F(
"TimeBNBPeakMonth",
";Time [#musec];Number of Events", nBins, firstBin, lastBin);
681 TH1F *InTimeNuMIPeakMonth =
new TH1F(
"InTimeNuMIPeakMonth",
";Time [#musec];Number of Events", nBins, firstBin, lastBin);
682 TH1F *InTimeBNBPeakMonth =
new TH1F(
"InTimeBNBPeakMonth",
";Time [#musec];Number of Events", nBins, firstBin, lastBin);
685 TH1F *TimeNuMIPeak2Weeks =
new TH1F(
"TimeNuMIPeak2Weeks",
";Time [#musec];Number of Events", nBins, firstBin, lastBin);
686 TH1F *TimeBNBPeak2Weeks =
new TH1F(
"TimeBNBPeak2Weeks",
";Time [#musec];Number of Events", nBins, firstBin, lastBin);
687 TH1F *InTimeNuMIPeak2Weeks =
new TH1F(
"InTimeNuMIPeak2Weeks",
";Time [#musec];Number of Events", nBins, firstBin, lastBin);
688 TH1F *InTimeBNBPeak2Weeks =
new TH1F(
"InTimeBNBPeak2Weeks",
";Time [#musec];Number of Events", nBins, firstBin, lastBin);
690 TH1F *TimeNuMIPeak2Months =
new TH1F(
"TimeNuMIPeak2Months",
";Time [#musec];Number of Events", nBins, firstBin, lastBin);
691 TH1F *TimeBNBPeak2Months =
new TH1F(
"TimeBNBPeak2Months",
";Time [#musec];Number of Events", nBins, firstBin, lastBin);
692 TH1F *InTimeNuMIPeak2Months =
new TH1F(
"InTimeNuMIPeak2Months",
";Time [#musec];Number of Events", nBins, firstBin, lastBin);
693 TH1F *InTimeBNBPeak2Months =
new TH1F(
"InTimeBNBPeak2Months",
";Time [#musec];Number of Events", nBins, firstBin, lastBin);
696 TCut
cuts =
"(nhitx+nhity>9) && nhitx>4 && nhity>4 && tave>0.0 && tave<550.0 && y1<150.0 && abs(x1)<110.0 && z1>25 && z1<770 && cosnumi>0.7";
697 TCut intimenumi=
"(nhitx+nhity>9) && nhitx>4 && nhity>4 && tave>215 && tave<230.0 && y1<150.0 && abs(x1)<110.0 && z1>25 && z1<770 && cosnumi>0.7";
699 TCut cutsbnb =
"(nhitx+nhity>6) && nhitx>3 && nhity>3 && tave>0.0 && tave<550.0 && y1<130.0 && abs(x1)<100.0 && z1>270 && z1<570 && cosnumi>0.7";
700 TCut intimebnb=
"(nhitx+nhity>6) && nhitx>3 && nhity>3 && tave>318 && tave<321.0 && y1<130.0 && abs(x1)<100.0 && z1>270 && z1<570 && cosnumi>0.7 ";
702 numichain0->Project(
"TimeNuMIPeakDay",
"tave",cuts);
703 numichain0->Project(
"InTimeNuMIPeakDay",
"tave",intimenumi);
705 bnbchain0 ->Project(
"TimeBNBPeakDay" ,
"tave",cutsbnb);
706 bnbchain0 ->Project(
"InTimeBNBPeakDay",
"tave",intimebnb);
708 cout<<TimeNuMIPeakDay->GetEntries()<<
endl;
709 cout<<InTimeNuMIPeakDay->GetEntries()<<
endl;
712 numichain1->Project(
"TimeNuMIPeakWeek",
"tave",cuts);
713 bnbchain1 ->Project(
"TimeBNBPeakWeek" ,
"tave",cutsbnb);
714 numichain1->Project(
"InTimeNuMIPeakWeek",
"tave",intimenumi);
715 bnbchain1 ->Project(
"InTimeBNBPeakWeek",
"tave",intimebnb);
717 numichain2->Project(
"TimeNuMIPeakMonth",
"tave",cuts);
718 bnbchain2 ->Project(
"TimeBNBPeakMonth" ,
"tave",cutsbnb);
719 numichain2->Project(
"InTimeNuMIPeakMonth",
"tave",intimenumi);
720 bnbchain2 ->Project(
"InTimeBNBPeakMonth",
"tave",intimebnb);
723 numichain3->Project(
"TimeNuMIPeak2Weeks",
"tave",cuts);
724 bnbchain3 ->Project(
"TimeBNBPeak2Weeks" ,
"tave",cutsbnb);
725 numichain3->Project(
"InTimeNuMIPeak2Weeks",
"tave",intimenumi);
726 bnbchain3 ->Project(
"InTimeBNBPeak2Weeks",
"tave",intimebnb);
728 numichain4->Project(
"TimeNuMIPeak2Month",
"tave",cuts);
729 bnbchain4 ->Project(
"TimeBNBPeak2Month" ,
"tave",cutsbnb);
730 numichain4->Project(
"InTimeNuMIPeak2Month",
"tave",intimenumi);
731 bnbchain4 ->Project(
"InTimeBNBPeak2Month",
"tave",intimebnb);
734 TimeNuMIPeakDay->SetTitle(Form(
"InTime NuMI Events=%.0f in last 24 hrs ", InTimeNuMIPeakDay->GetEntries()));
735 TimeNuMIPeakWeek->SetTitle(Form(
"InTime NuMI Events=%.0f in last week ", InTimeNuMIPeakWeek->GetEntries()));
736 TimeNuMIPeakMonth->SetTitle(Form(
"InTime NuMI Events=%.0f in last month ", InTimeNuMIPeakMonth->GetEntries()));
737 TimeNuMIPeak2Weeks->SetTitle(Form(
"InTime NuMI Events=%.0f in last week ", InTimeNuMIPeak2Weeks->GetEntries()));
738 TimeNuMIPeak2Months->SetTitle(Form(
"InTime NuMI Events=%.0f in last month ", InTimeNuMIPeak2Months->GetEntries()));
741 TimeBNBPeakDay->SetTitle(Form(
"InTime BNB Events=%.0f in last 24 hrs", InTimeBNBPeakDay->GetEntries()));
742 TimeBNBPeakWeek->SetTitle(Form(
"InTime BNB Events=%.0f in last week", InTimeBNBPeakWeek->GetEntries()));
743 TimeBNBPeakMonth->SetTitle(Form(
"InTime BNB Events=%.0f in last month", InTimeBNBPeakMonth->GetEntries()));
744 TimeBNBPeak2Weeks->SetTitle(Form(
"InTime BNB Events=%.0f in last week", InTimeBNBPeak2Weeks->GetEntries()));
745 TimeBNBPeak2Months->SetTitle(Form(
"InTime BNB Events=%.0f in last month", InTimeBNBPeak2Months->GetEntries()));
748 TCanvas *numi0=
new TCanvas(
"numi0",
"",10,10,1000,500);
749 TimeNuMIPeakDay->Draw();
751 TCanvas *numi1=
new TCanvas(
"numi1",
"",10,10,1000,500);
752 TimeNuMIPeakWeek->Draw();
754 TCanvas *numi2=
new TCanvas(
"numi2",
"",10,10,1000,500);
755 TimeNuMIPeakMonth->Draw();
757 TCanvas *numi3=
new TCanvas(
"numi3",
"",10,10,1000,500);
758 TimeNuMIPeak2Weeks->Draw();
760 TCanvas *numi4=
new TCanvas(
"numi4",
"",10,10,1000,500);
761 TimeNuMIPeak2Months->Draw();
764 TCanvas *bnb0=
new TCanvas(
"bnb0",
"",10,10,1000,500);
765 TimeBNBPeakDay->Draw();
766 TCanvas *bnb1=
new TCanvas(
"bnb1",
"",10,10,1000,500);
767 TimeBNBPeakWeek->Draw();
768 TCanvas *bnb2=
new TCanvas(
"bnb2",
"",10,10,1000,500);
769 TimeBNBPeakMonth->Draw();
770 TCanvas *bnb3=
new TCanvas(
"bnb3",
"",10,10,1000,500);
771 TimeBNBPeak2Weeks->Draw();
772 TCanvas *bnb4=
new TCanvas(
"bnb4",
"",10,10,1000,500);
773 TimeBNBPeak2Months->Draw();
776 numi0->Print(
"/nusoft/app/web/htdoc/nova/datacheck/nearline/plots/NuMITimePeakDAY.png");
777 numi1->Print(
"/nusoft/app/web/htdoc/nova/datacheck/nearline/plots/NuMITimePeakWEEK.png");
778 numi2->Print(
"/nusoft/app/web/htdoc/nova/datacheck/nearline/plots/NuMITimePeakMONTH.png");
779 numi3->Print(
"/nusoft/app/web/htdoc/nova/datacheck/nearline/plots/NuMITimePeak2WEEKS.png");
780 numi4->Print(
"/nusoft/app/web/htdoc/nova/datacheck/nearline/plots/NuMITimePeak2MONTHS.png");
782 bnb0->Print(
"/nusoft/app/web/htdoc/nova/datacheck/nearline/plots/BNBTimePeakDAY.png");
783 bnb1->Print(
"/nusoft/app/web/htdoc/nova/datacheck/nearline/plots/BNBTimePeakWEEK.png");
784 bnb2->Print(
"/nusoft/app/web/htdoc/nova/datacheck/nearline/plots/BNBTimePeakMONTH.png");
785 bnb2->Print(
"/nusoft/app/web/htdoc/nova/datacheck/nearline/plots/BNBTimePeakWEEK.png");
786 bnb3->Print(
"/nusoft/app/web/htdoc/nova/datacheck/nearline/plots/BNBTimePeak2MONTH.png");
correl_xv GetYaxis() -> SetDecimals()
correl_xv GetXaxis() -> SetDecimals()
fvar< T > ceil(const fvar< T > &x)