I’m trying to add a vector of struct branch to a ttree. Here is an example: the struct and a vector of it are defined as
typedef std::vector VTS1;[/code]
and I use the following code to add it to TTree:
VTS1* vts1 = new VTS1();
t1->Branch("ts1", "std::vector<TS1>", &vts1); I create the dictionaries using rootcint and there is no error in the compiling. But following message appears when I run the executable:
[quote]Warning in TClass::Init: no dictionary for class TS1 is available
Error in TTree::Bronch: Container with no dictionary defined in branch: ts1[/quote]
and the output file seems having the expected number of entries but no real data:
Attaching file t1.root as _file0...
(class TFile *) 0x34666a0
root  t1->GetEntries()
root  t1->GetListOfBranches()->Print()
Collection name='TObjArray', class='TObjArray', size=16
root  t1->Show(0)
Error in <TTree::Show()>: Cannot read entry 0 (no data read)
What I’m missing? Thanks.