#include "dataStruct.h" const int nBins = 100; int rate() { TFile *dataTFile = new TFile("treeTest.root"); TH2D *circle = new TH2D("circle", "circle", nBins, -1.2, 1.2, nBins, -1.2, 1.3); TH2D *cosTheta = new TH2D("cosTheta", "cosTheta", nBins, 0, 7, nBins, -1.2, 1.3); TH2D *line = new TH2D("line", "line", nBins, 0, 1.2, nBins, 0, 7); TTree* theTree = nullptr; TTreeReader theReader("business",dataTFile); TTreeReaderValue first(theReader, "first"); TTreeReaderValue coach(theReader, "coach"); int i = 0; while (theReader.Next() && (i < 100) ) { cout << "filling " << i << endl; i++; circle->Fill(first->cosTheta, first->sinTheta); cosTheta->Fill(first->theta, first->cosTheta); line->Fill(coach->def,first->theta); } dataTFile->Close(); dataTFile->~TFile(); return 1; }