Profile Histogram

Dear All,
I am trying to draw a profile histogram

hpt_v->Fill(P[j],g2);

I have got the warning and the canvas I am drawing remains blank.
//---------------------------------------------------------------------------------------------------------------------
Warning in TCanvas::ResizePad: Inf/NaN propagated to the pad. Check drawn objects.
Warning in TCanvas::ResizePad: c1 height changed from 0 to 10

root [1] Warning in TCanvas::ResizePad: Inf/NaN propagated to the pad. Check drawn objects.
Warning in TCanvas::ResizePad: c1 height changed from 0 to 10

Warning in TCanvas::ResizePad: Inf/NaN propagated to the pad. Check drawn objects.
Warning in TCanvas::ResizePad: c1 height changed from 0 to 10
//-------------------------------------------------------------------------------------------------------------------------

Please note that

The variable "Float_t g2 = (c1[j]/c2[j]);

Whenever I try to draw “hpt_v->Fill(P[j], c1[j]);” or “hpt_v->Fill(P[j], c2[j]);” I am getting the histogram without any error/waning. I am getting error only when I try to plot the ratio c1[j]/c2[j] i.e "hpt_v->Fill(P[j], g2);

With Best Regards
Kalyan

Try:
Float_t g2 = ((c2[j] != 0.0) ? (c1[j]/c2[j]) : 0.0);