If the result of a calculation in your code is an infinite number or an imaginary number, this may lead to problems (when drawing histograms, etc.). The following two methods help to catch these cases.
Include TMath.h
in your header-file, and in the code write
if(!TMath::Finite(myexpression)){ ... }
to catch the cases where myexpression
becomes infinite.
Include TMath.h
in your header-file, and in the code write
if(TMath::IsNaN(myexpression)){ ... }
to catch the cases where myexpression
becomes a non-real number.