I am trying to draw a histogram, but I got a empty plot because of the following warning.
(TFile *) 0x1f93330
root [1] h_pion_invariant_mass_Stat_Syst->Draw("wo_Inf_NaN")
Info in <TCanvas::MakeDefCanvas>: created default TCanvas with name c1
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 [2] 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
I tried the way that h_pion_invariant_mass_Stat_Syst->Draw("wo_Inf_NaN")option but still got the empty plot.
Is there a way to get rid of “Inf/nan” values and draw the plot?
what is h_pion_invariant_mass_Stat_Syst ? an TTree ?
If yes it looks like your variable wo_Inf_NaN is corrupted with Inf and/or Nan and it cannot be drawn.
Wouldn’t Finite(weight_total) also catch a NaN? but I don’t know whether the mask in Finite behaves like isfinite, according to the docs. @Dil: Have you checked pion_invariant.M() too?
By the way, h_pion_invariant_mass_weight>Fill... is missing a “-” but I suppose it’s just here, not in the actual code.
h_pion_invariant_mass_Stat_Syst is follows.May be h_pion_invariant_mass_Stat_Syst is having problem because I cloned it to the h_pion_invariant_mass_weight histogram. h_pion_invariant_mass_weight crashes because of Inf/Nan values.
So try with: h_pion_invariant_mass_Stat_Syst->SetBinError(j, (TMath::Finite(Sys_error) ? Sys_error : 0.));
BTW. In one of your previous posts, you have “TH1D* h_pion_invariant_mass_weight” but in the last post, you have “(TH1F*)h_pion_invariant_mass_weight”. This is not allowed. You need to make sure that all involved histograms are of the same class.