{ //General root settings gROOT->SetStyle("Plain"); gStyle->SetPadTickX(1); gStyle->SetPadTickY(1); gStyle->SetPadGridX(1); gStyle->SetPadGridY(1); TCanvas *c1 = new TCanvas("c1","c1",600,400); //Opening input data produced by sql query ifstream* fdataFile = new ifstream; fdataFile->open("2h_data.txt"); double x[1000]; double y[1000]; int i=0; while (fdataFile->eof()==false){ *fdataFile >> y[i]; if (fdataFile->eof()==false)i++; } int n=i; TDatime *T =new TDatime(); int date=T->GetDate(); int hour=T->GetHour(); cout<AsString()<AsString(),10); date_short[10]='\0'; T->Set(date,20000); int X0 = T->Convert(); gStyle->SetTimeOffset(X0); //Plotting the graph TGraph *graph = new TGraph(); int hour_bins=0; for (int e=0;e=myhour) {graph->SetPoint(e,e*7200,y[e]);hour_bins++;} else graph->SetPoint(e,e*7200,0); //graph->SetPoint(e,e,y[e]); //cout<<"Processed until "<SetLineColor(102); line->SetLineWidth(3); TLatex *t1 = new TLatex(); t1->SetTextAlign(31); t1->SetTextColor(102); t1->SetTextSize(0.04); char text_t1[100]; sprintf(text_t1,"Total ~%.1fM events",total); graph->SetFillColor(40); graph->SetLineColor(1); graph->SetTitle(""); graph->Draw("AB"); graph->GetXaxis()->SetLimits(x_low,x_high); //graph->SetMaximum(22); graph->SetMinimum(0); graph->GetYaxis()->SetTitle("Millions of Events Processed"); graph->GetYaxis()->CenterTitle(); graph->GetXaxis()->SetTitle("Time [h]"); graph->GetXaxis()->CenterTitle(); if (n<=13) graph->GetXaxis()->SetNdivisions(-(n+1)); graph->GetXaxis()->SetTimeDisplay(1); graph->GetXaxis()->SetTimeFormat("%H"); line->Draw(); t1->DrawLatex(x_high,total+0.2,text_t1); graph->GetHistogram()->DrawCopy("sameaxis"); TPaveText l(.1,.912,.9,.962,"NDC"); l.SetTextColor(15); l.AddText("Data Processed by the CDF FARM since Midnight"); l.Draw(); l.SetTextColor(1); l.SetLineColor(0); l.SetFillColor(0); l.Draw(); TPaveText d(.129,.715,.258,.78,"NDC"); d.SetTextColor(15); d.AddText(date_short); d.Draw(); d.SetTextColor(1); d.SetLineColor(0); d.SetFillColor(0); d.Draw(); c1->Print("processing_bihourly.eps"); }