{ //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("day_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(); cout<AsString()<Set(date,180000); int X0 = T->Convert(); gStyle->SetTimeOffset(X0-n*86400); //Plotting the graph and calculate average TGraph *graph = new TGraph(); double average=0; for (int e=0;eSetPoint(e,e*86400,y[e]); //graph->SetPoint(e,e,y[e]); //cout<<"Today -"<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,"Average ~%.1fM events",average); graph->SetFillColor(40); graph->SetLineColor(1); graph->SetTitle(""); graph->Draw("AB"); graph->GetXaxis()->SetLimits(x_low,x_high); //graph->GetXaxis()->SetLabelSize(0.035); //graph->SetMaximum(22); graph->SetMinimum(0); graph->GetYaxis()->SetTitle("Millions of Events Processed"); graph->GetYaxis()->CenterTitle(); if (n<12) graph->GetXaxis()->SetNdivisions(n+1); graph->GetXaxis()->SetTimeDisplay(1); graph->GetXaxis()->SetTimeFormat("%b%d"); //line->Draw(); //t1->DrawLatex(x_high,average+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 (past week)"); l.Draw(); l.SetTextColor(1); l.SetLineColor(0); l.SetFillColor(0); l.Draw(); c1->Print("processing_dayly.eps"); //c1->Print("processing_dayly.gif","gif"); }