Error with TPad

Dear Experts, I am trying to make stacked histograms from files and I also have the pulls. But I am not able to get them correctly. I am getting the error message:

Processing plotter_stack_new.C...
Warning in <TPad::ResizePad>: Inf/NaN propagated to the pad. Check drawn objects.
Warning in <TPad::ResizePad>: pad2 height changed from 0 to 10
root [1] Warning in <TPad::ResizePad>: Inf/NaN propagated to the pad. Check drawn objects.
Warning in <TPad::ResizePad>: pad2 height changed from 0 to 10
Warning in <TPad::ResizePad>: Inf/NaN propagated to the pad. Check drawn objects.
Warning in <TPad::ResizePad>: pad2 height changed from 0 to 10

The plot that I am getting is shown below :

Will you please help me get the pulls. I am using the macros and files in the folder:
forum.zip (32.9 KB)

The loop filling h7 should be:

   for(int l = 1; l<= h6->GetNbinsX(); l++) {
      if (h->GetBinContent(l) != 0)
         h7->SetBinContent(l, h6->GetBinContent(l)/h->GetBinContent(l));
   }

1 Like

Dear @couet ,

Thank you very much. It worked.

Good ! that’s something general: When you divide by something make sure it is not equal to 0 :wink:

Yes. I was making these plots with other variables as well and this was not a problem with them…so i did did not check for this. :dotted_line_face:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.