My Problem is the following:
I have a TH1F array histo[i][j] that is filled into a .root File. Afterwards I’m accessing the data File from an other routine. I want to include the histos into a new array histos2[i][j], so I want to loop over all the histos from the old file with
I can access all the histos from the first file with the above structure (static_cast etc…), but I can not fill them into the histo2[i][j] array correctly. I also tried Clone() but it returned
Error: illegal pointer to class object det_mean_E_T_jetshape[i][j] 0x0 163
The way for accesing histos via loop as above was described in other posts here, but does not seem to work correctly in this case for some reason.
Any help would be gladly appreciated, also if there is a better or more elegant way to do this
I’m sorry, I think I did not emphasize my problem well enough in the first place.
The problem is that the histograms from the old file are not filled into the histogramm correctly. Whenever I try to access them via e.g. ->GetBinContent(i); it returns:
Error: illegal pointer to class object histo2[i][j] 0x0 163
and the same for .GetBinContent(i); .
So the problem really seems to be that the array is not filled correctly, no matter which current directory I set.