#include #include #include #include "TCanvas.h" #include "TH1.h" #include "TF1.h" #include "TFile.h" #include "TGraph.h" #include "TGaxis.h" #include "TPad.h" #include "TKey.h" void draw(){ TFile *f = new TFile("temperatures.root"); f->GetListOfKeys()->Sort(); //f->GetListOfKeys()->Print(); int numofgraphs = 0; int numofkeys = f->GetListOfKeys()->GetSize(); std::cout<<"Number of keys: "<GetListOfKeys()->At(i)->GetName()); if (histoname.rfind("Room", 0) == 0 || histoname.rfind("Crystal", 0) == 0){ std::cout << histoname << std::endl; graphs[numofgraphs] = (TGraph*) ((TKey*)f->GetListOfKeys()->At(i))->ReadObj(); numofgraphs++; } } std::cout << numofgraphs << std::endl; TCanvas *canvas = new TCanvas("Temperature","Temperature correlation",2000,1000); canvas->cd(1); graphs[0]->GetYaxis()->SetRangeUser(-200,40); graphs[0]->Draw("AL"); graphs[1]->SetLineColor(4); graphs[1]->Draw("L"); }