GetUserInfo()->FindObject() not returning the class properly

I got stuck trying to use the GetUserInfo() method to store metadata in a ROOT TTree.
I have a class, inheriting from TNamed, which has a data member that is a std::vector of pairs of std::string, where I intend to store the parameters of my simulation.

class MacrosInfo: public TNamed
    /// Constructor
  MacrosInfo(const char* name, const char* title): TNamed(name, title) {}
    /// Destructor
    ~MacrosInfo() {}

    void AddContent(const std::string& k, const std::string& v);
    std::vector<std::pair<std::string, std::string> > GetContent() const;

    std::vector<std::pair<std::string, std::string> > _content;

  inline void MacrosInfo::AddContent(const std::string& k, const std::string& v) {_content.push_back(std::make_pair(k, v));}
  inline std::vector<std::pair<std::string, std::string> > MacrosInfo::GetContent() const {return _content;}

Im my simulation, I do

MacrosInfo* myinfo = new MacrosInfo("all", "all");

and a ROOT file is created correctly and it seems to have UserInfo stored, when inspected with TBrowser().
The problem arises when I try to open the file and read the metadata. Doing

MacrosInfo* myinfo = (MacrosInfo*) fEvtTree->GetUserInfo()->FindObject("all");

the myinfo->Print() method gives

OBJ: TNamed all all

but the second line (myinfo->GetContent()) causes a crash. It seems to me that the cast is not done correctly.
I attach the root file.

Anyone can see where is the problem?

Thank you very much


Hi, problem solved! I had forgotten to add my class to the dictionary, thus it was stored as a TNamed class, not MyClass.
Thanks to delo for the help!