{ gROOT -> Reset(); TFile f("radioprotection_t3.root"); TDirectory* dir = (TDirectory*)f.Get("radioprotection_ntuple"); TTree* ntuple = (TTree*)f.Get("t"); ntuple -> Print(); // Assigned the TTree to the pointer ntuple Double_t ep[40]; Int_t nevent = Int_t(ntuple->GetEntries()); Double_t edep; Double_t xx; ntuple->GetBranch("edep")->SetAddress(&edep); ntuple->GetBranch("count")->SetAddress(&xx); Double_t x[40], y[40]; for (Int_t i=0;i<40;i++) { x[i] = i; y[i] = 0; } for ( Int_t i=0; iGetEvent(i); //std::cout << "ID " << xx << ": " << edep << " MeV" << std::endl; y[(Int_t)xx] += edep; std::cout<<" The sum is: " << y[i] <