Dear ROOT Experts,
I am trying to divide two THnSparseF histograms in the following method:
TFile *f1 = new TFile("histos.root");
THnSparseF *fTHGeneratedEff = ccontainer0->FindObject("fTHnGeneratedEff");
THnSparseF *fTHnReconstructedEff = ccontainer0->FindObject("fTHnReconstructedEff");
const Int_t nDims = 4;
Int_t fBins[nDims] = {15, 10, 16, 100 };
Double_t fMin[nDims] = { 0.0, -10.0, -0.8, 0.0};
Double_t fMax[nDims] = { 100.0, 10.0, 0.8, 30};
const Int_t nVarBins0 = 15;
Double_t varBins0[nVarBins0+1] = {0., 1., 2., 3., 4., 5., 10., 20., 30., 40., 50., 60., 70., 80., 90., 100};
THnSparseF *fTHnEff = new THnSparseF("fTHnEff","Cent-zVtx-Eta-pT", nDims, fBins, fMin, fMax);
fTHnEff->GetAxis(0)->Set(nVarBins0, varBins0);
fTHnEff->Divide(fTHnReconstructedEff, fTHGeneratedEff, 1., 1.,"b");
TFile *file = new TFile("THnEfficiency.root", "RECREATE");
fTHnEff->Write();
But, the resulting thnsparse I get has wrong entries. I have attached the root files containing the thnsparse I divide, as well as the thnsparse after division.
Histos.root (1.21 MB)
THnEfficiency.root (759 KB)
Thanks for any help