Hi,
I would like to get the bin array from the ~.root data file.
I try…
#include "TH1.h"
#include "TAxis.h"
TH1F *hA = (TH1F *)fFileA->Get("fileA");
TAxis *xaxis = hA->GetXbins();
TH1F* hResult = new TH1F("hResult", "hResult", hA->GetNbinsX(), xaxis);
But it does not work. GetLowEdge(hA) does not work.
The bin of fileA is:
Float_t xAxis[41] = {-5.0, -4.0, -3.5, -3.0, -2.5, -2.0, -1.8, -1.6, -1.4, -1.2, -1.0,
-0.9, -0.8, -0.7, -0.6, -0.5, -0.4, -0.3, -0.2, -0.1, 0.0, 0.1,
0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.2, 1.4,
1.6, 1.8, 2.0, 2.5, 3.0, 3.5, 4.0, 5.0};
So, the bin width is different.
Would you tell me how to get fileA bin array?
Thank you!