#include #include "TGraph2D.h" #include "TFile.h" #include "TCanvas.h" #include "TTree.h" #include "TString.h" using namespace std; //====================================================================== void tester( const TString& fname ) { TGraph2D *gr = new TGraph2D(); gr->SetName("gr"); TFile *f = new TFile(fname); TTree *t = (TTree *) f->Get("limit"); if (!t) { std::cerr<<"TFile "<GetName()<<" does not contain the tree"<GetEntries() << " entries." << endl; Float_t x,y,z; t->SetBranchAddress("lZ", &x); t->SetBranchAddress("dkg", &y); t->SetBranchAddress("deltaNLL", &z); for (size_t j = 0, n = t->GetEntries(); j < n; ++j) { t->GetEntry(j); gr->SetPoint(j,x,y,z); } // tree entry loop f->Close(); delete f; cout << endl; double *vx = gr->GetX(); double *vy = gr->GetY(); double *vz = gr->GetZ(); for(int i=0; iGetN(); i++) printf ("%d\t%f\t%f\t%f\n",i,vx[i],vy[i],vz[i]); TCanvas *canv = new TCanvas("tester","tester",500,500); cout << gr->GetN()<<" points. " <Draw("SURF3"); // "TRI"); }