Hi,
I have a .root file (attached), which contains a TTree that contains an object called BTagNtup. After opening the file I get the usual “no dictionary” messages (as expected). But what suprised me what that ROOT dosen’t seem to re-construct the full object graph on its own. So, I get “0” for the following:
C:\Users\gwatts\Documents\ATLAS\Projects\LINQToROOT>root -l output.root
root [0]
Attaching file output.root as _file0...
Warning in <TClass::TClass>: no dictionary for class BTagJet is available
Warning in <TClass::TClass>: no dictionary for class MuonInBJet is available
root [1] c = TClass::GetClass("BTagJet")
(class TClass*)0x2c87a08
root [2] b = c->GetListOfBases()
(class TList*)0x0
root [3]
int label;
std::vector<MuonInBJet> muons;
ClassDef(BTagJet, 1);
};[/code]
Further (and perhaps worse) I can’t plot any jets in this guy b/c ROOT doesn’t seem to have saved enough info in its dictoinary.
The file was written with a production version of 5.26 (not sure exactly which one), and is being read with a version of 5.27 from about the beginning of November from svn head (I think - could be a little earlier than that!!).
I just noticed that TBrowser knows that this BTagJet inherrits from TLorentzVector (i.e. Gamma and other things show up in there). So that information must be around somewhere (though I I double click on Gamma in the TBrowser I get the usual “root [2] Error in TTreeFormula::DefinedVariable: Can not call method Gamma().)
on class without dictionary (BTagJet)!”).
we don’t create a properly filled TClass object for classes emulated from the TStreamerInfo. I.e. this is expected, but not as optimal as it could be
For now you’ll have to ask the TStreamerInfo, just like the TVirtualBranchBrowsable-derived classes do, to query the reflection data of objects / collections of objects without dictionary that are stored in a TTree. You can use TClass::IsLoaded() to check whether the TClass is complete or whether you need to talk to the TStreamerInfo.
well, ROOT can read the data for !IsLoaded() - that’s what the emulated class is for. ROOT can even generate a header file containing the class definition (TTree::MakeProject()). I can’t tell whether you can read the data for !IsLoaded() - that depends on your code
Hi Axel,
Thanks. What I meant was that TTree::Draw can’t read the root-tuple w/out the classes loaded. I had thought that the new streamer definition meant the data was fully described. So while I understand why ROOT Might not be able to fully interpret the bits in the unknown classes, I was a bit surpised that it couldn’t read correctly the ones it knows (i.e. a class derived from a TLorentzVector).
seriously - it depends on how you read it. You can draw e.g. btag’s jets.fP.fX - i.e. by definition ROOT can read the data. What you are reporting is that the base class part of an emulated class is inaccessible through TTree::Draw(). I can reproduce that, and we should fix it. E.g. btag->Draw(“jets.fP.Mag2()”) does work, so it’s really only the base class.