Inf/NaN propagated to the pad

Hello all,

My weight histogram still has the same Inf/Nan issue even if I used following. I used How to skip nan numbers in txt file - #7 by Wile_E_Coyote too

This happens when I running more data. For few data files, this works.

if(weight_total > 0.0){
                                           
       if(TMath::Finite(weight_total) && !TMath::IsNaN(weight_total)){ h_pion_invariant_mass_weight->Fill(pion_invariant.M(),weight_total);
                          }
                                           
     }