#include "time.h" void ControlPlots() { // Put here the name of the root file you want to view: TFile f("SCIFIJ_HV_Voltage.root"); TIter nextkey(f.GetListOfKeys()); TKey *key; UInt_t time; Float_t value; Int_t n=1; TCanvas *c1 = new TCanvas("c1","DCS data",800,600); c1->Print("MyPlots.ps["); // This example is showing HV trends. Replace the label and axis scales // to you case. x-axis is time in seconds (from 1970, according to TDatime) // 2004 Run: 1.08e9 - 1.102e9 (seconds) // 2003 Run: // 2002 Run: TH2F *h = new TH2F("h","VMon vs time",100,1.08e9,1.102e9,100,0.,4000.); while ( key = (TKey*)nextkey()) { TTree *t = (TTree*)key->ReadObj(); Int_t nentries = (Int_t)t->GetEntries(); t->SetBranchAddress("value",&value); t->SetBranchAddress("time",&time); char *titulo = (char*)t->GetName(); // printf("%s %d\n",titulo,n); gStyle->SetStatX(0.7); h->GetYaxis()->SetLabelSize(0.025); h->GetXaxis()->SetLabelSize(0.025); h->GetXaxis()->SetTimeDisplay(1); h->GetXaxis()->SetTimeOffset(0); h->GetXaxis()->SetTitle(titulo); for (Int_t i=0; iGetEntry(i); h->Fill(time,value); } h->SetOption("COLZ"); h->Draw(); c1->Print("MyPlots.ps"); n++; h->Reset(); } c1->Print("MyPlots.ps]"); }