Dear rooters,
my two questions are loosely summarized in the subject…
I create a TTree
with a branch that contains a class Physics
, i.e. this kind of approach:
https://root.cern.ch/doc/master/classTTree.html#addingacolumnofobjs
Now this class Physics
has as a member a vector of class Data
, here is a simplified example:
class Data {
public:
Data(){};
~Data(){};
friend std::ostream& operator<<( std::ostream& os, const Data& NPPData );
public:
unsigned short ID;
public:
Data(unsigned short ID_) : ID(ID_) {};
ClassDef(Data, 1)
}
class Physics {
private:
vector<Data> NP;
public:
Physics(){};
~Physics(){};
friend std::ostream& operator<<( std::ostream& os, const Physics& NPP);
ClassDef(Physics, 1)
}
I also have a linkdef.h
file to generate the dictionary:
#ifdef __CINT__
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
#pragma link C++ class Data+ ;
#pragma link C++ class Physics+ ;
#pragma link C++ class vector<Data>+ ;
#endif
Everything compile, the TTree
is generated and I can draw the member of the Data
class, i.e.
tree->Draw("NP.ID")
tree->Scan("NP.ID","","",5)
***********************************
* Row * Instance * NP.ID *
***********************************
* 0 * 0 * *
* 1 * 0 * *
* 2 * 0 * *
* 3 * 0 * 90 *
* 3 * 1 * 66 *
* 3 * 2 * 38 *
* 3 * 3 * 18 *
* 3 * 4 * 89 *
* 3 * 5 * 41 *
* 3 * 6 * 19 *
* 4 * 0 * *
***********************************
works and give me what I expect.
Now I would like to see the details of Data
members when I do a Print
, but as you can see below the display stops at vector<Data>
:
******************************************************************************
*Tree :PhysicsTree: *
*Entries : 13877025 : Total = 1244231045 bytes File Size = 322446257 *
* : : Tree compression factor = 3.86 *
******************************************************************************
*Branch : Physics *
*Entries : 13877025 : BranchElement (see below) *
*............................................................................*
*Br 0 :NP : vector<Data> *
*Entries : 13877025 : Total Size= 483516781 bytes File Size = 196297478 *
*Baskets : 1500 : Basket Size= 25600000 bytes Compression= 2.46 *
*............................................................................*
I would like the corresponding line to look like:
*Br 0 :NP : vector<Data> .ID/I *
Is it possible? And if yes, what am I missing? Note that I can not access the splitlevel of the branch as this is located in a common code for all collaborators (my code in embedded in a much bigger one).
When I use “TBrowser” I can see the leaves but then I have the following error message:
Error in <TClass::LoadClassInfo>: no interpreter information for class Data is available even though it has a TClass initialization routine.
I checked the forum for this error but could not find a similar case as mine. What I am missing?
Thank you very much in advance
ROOT Version: 6.28/06
Platform: Linux ubuntu20 5.4.0-187-generic
Compiler: linuxx8664gcc