> if(obj->InheritsFrom(TH1::Class)) obj->Draw();
Did you forget the brackets ?
if( obj->InheritsFrom(TH1::Class()) ) obj->Draw();