Division of 2D histograms

I have two 2D histograms(h1 and h2) that I am trying to divide, I create a third 2D histogram (h3) and call the divide function as follows:
but it is not working, any ideas! :smiley:

Send thye shortest possible running script showing your problem.


I have two 2D TH2F histograms with variables (x,y) i want to plot third 2D histogram with variables (x,y) but filled with the ratio of first two. I am using following for this. But getting empty plots, any ideas why?
TH2F *histo2_m1 = new TH2F(“histo2_m1”,“Module1”,40,0.4,2.5,20,0,0.392);
TH2F *histo2e_m1 = new TH2F(“histo2e_m1”,“Module1”,40,0.4,2.5,20,0,0.392);

TH2F histo2ee_m1 =(*histo2e_m1)/(*histo2_m1);

Just give empty plots.


TH2F *histo2ee_m1 = new TH2F(*histo2_m1);
histo2ee_m1->SetNameTitle("histo2ee_m1", "histo2e_m1 / histo2_m1");

Thanks a lot it works. Just a naive question when we write h1->Divide(h2) this means h2/h1 or h1/h2. Just some confusion with what is numerator and what is denominator. :grinning:

Bool_t TH1::Divide ( const TH1 *h1 )

Thanks a lot for clarification :grinning: