#include "TROOT.h" #include "TF1.h" #include "TMath.h" #include "TFile.h" #include "TTree.h" #include #include #include #include #include #include using namespace std; int main(int argc, char* argv[]) { //TTree t2; // Declaration of leaf types UInt_t evntid; TFile *infile = new TFile("input_file_1.root"); TTree *h22 = (TTree*)infile->Get("h22"); h22->SetBranchAddress("evntid", &evntid); for (Int_t i=0;i<10;i++) { h22->GetEntry(i); cout << i << "\t" << evntid << endl; } }