How to retrieve roofit object through gROOT?

First I create a RooFit object like this:
RooRealVar x(“namex”,“titlex”,-10,10);
and then I forgot the variable name “x”, so I tried to retrieve the object like this:
gROOT->FindObject(“namex”);
but it returns “0x0”.
How can I retrieve it? Thank you!