Dear Root experts,
Referring to Memory leak in pyroot, where Philippe kindly provided a workaround to the function related memory leak when reading in histograms from a TTree Branch (last reply before tpoic closed). I would like to know if there is a way to use the TTreeReader mechanism to read in the histograms. I.e. I currently use it like this
TFile *rtinput = TFile::Open("tribic2017_idxtest.root");
TTreeReader theReader("measurements", rtinput);
TTreeReaderValue<Int_t> gridx(theReader, "gridXbin");
...
...
while(theReader.Next()){
std::cout << *gridx << std::endl;
...
...
How can I best read in the histograms in this setting? The corresponding code not using the TTreeReader is in the topic referenced above.
Many thanks,
Thorsten
ROOT Version: 6.14/06
Platform: mac osx 10.14.2
Compiler: clang-1000.11.45.5