How to check if TF1 is properly initialized


I have some code that initializes a TF1 using the constructor TF1(&TF1). Is there a way to check if the TF1 is properly initialized?

More specifically:
I have one TF1 which is created by calling TF1(const char * name, const char * formula, Double_t xmin, Double_t xmax). It has TFormula TMath::GammaDist(x,[0],[1],[2]). A second call is made to set the parameters (which are supplied run time).
Later in the code, a second TF1 is initialized as a copy of the first one, so I use the constructor TF1(&TF1). However, in cases where the parameters are not valid, TMath::GammaDist(x,[0],[1],[2]) complains when the second TF1 is initialized, but apparently TF1 it self does not care.

Is there a way to detect if the TF1 is not properly initialized so the program can be terminated before using the TF1?



Perhaps looking at the definition of TMath::GammaDist may be illuminating:

You can impose the same constraints.