auto myHist = new TH1F("h1","ntuple",100,-4,4); auto myFile = TFile::Open("hsimple.root"); if (!myFile || myFile->IsZombie()) { return; } TTreeReader myReader("ntuple", myFile); TTreeReaderValue myPx(myReader, "px"); TTreeReaderValue myPy(myReader, "py"); while (myReader.Next()) { // Just access the data as if myPx and myPy were iterators (note the '*' // in front of them): myHist->Fill(*myPx + *myPy); } myHist->Draw(); gROOT->GetListOfCanvases()->Draw()