About Warning in <TClass::Init>

_ROOT Version:6.24

When I use

root hpge1058.root 

to open a root file ,there is a warning

Warning in <TClass::Init>: no dictionary for class ndet is available

I use a vector to create my tree branch, and the ndet is a struct.
It seems like no data lost , but I want to know weather is having an influence about my data.

I use the rootcling to construct it.

Thank you very much

Dear @PalytoxinRK ,

By default ROOT doesn’t have knowledge about your custom classes, and you rightly addressed the issue by generating a class dictionary as it was explained in the screenshot you posted.
Now, even though you generated class dictionaries (and you also compiled that into into a shared library), I don’t think the root executable will automatically load that library unless you tell it to, e.g.

root
[0] gSystem->Load("libndet.so")
[1] TFile f{"hpge1058.root"};
[2] std::unique_ptr<TTree> t{f.Get<TTree>("MYEVENTS")};

Which should remove the warnings. The warning per se is not a problem and you won’t lose your data because of it. It becomes a problem when you start actually making use of objects of your dataset that are of your custom type, at some point your application will complain that it doesn’t know how to treat those objects.

@pcanal might suggest a more elegant solution here

Thank you .
These knowledge may be exceeding my knowledge reserve. If they may not be let data losed, I think ignoring these warning may be a good choose. I use function MakeClass to uses the data. It seems like good.

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