Problem adding std::map< int, std::pair< int, const TGeoNode * > > to TTree


ROOT Version:6.20.04
Platform:Centos 7
Compiler:gcc 4.8.5


When adding a std::map< int, std::pair< int, const TGeoNode * > > as TBranch of a TTree we get the error message:
Warning in <TStreamerInfo::Build>: pair<int,pair<int,const TGeoNode*> >: pair<int,const TGeoNode*> has no streamer or dictionary, data member "second" will not be saved

So presumably I have somehow get a streamer for a TGeoNode included. How do I do that. I tried adding

#pragma link C++ class TGeoNode+;
to the linkdef file but it didn’t help. I also tried

#pragma link C++ class std::pair<int, TGeoNode>+;

but that fails with the message

Warning: Unused class rule: std::pair<int, TGeoNode>

How about:
#pragma link C++ class std::pair<int, TGeoNode*>+;
or:
#pragma link C++ class std::pair<int, const TGeoNode*>+;

Well that was easy! I assumed the pointer version would be implicitly included.
Thanks.

You will also need:
#pragma link C++ class std::map< int, std::pair< int, const TGeoNode * > >+;
(actually that should be the only you need).

Really? The error message went away with Wile_E_Coyote’s suggestion.

Well, to be on the “safe side”, I would add three lines (even if some are “redundant”):

#pragma link C++ class TGeoNode+;
#pragma link C++ class std::pair<int, const TGeoNode*>+;
#pragma link C++ class std::map<int, std::pair<int, const TGeoNode*> >+;

OK, thanks.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.