Dear experts,
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
[code]struct TS1{
double x;
float y;
int z;
};
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:
root [0]
Attaching file t1.root as _file0...
(class TFile *) 0x34666a0
root [1] t1->GetEntries()
(Long64_t) 100
root [2] t1->GetListOfBranches()->Print()
Collection name='TObjArray', class='TObjArray', size=16
root [3] t1->Show(0)
Error in <TTree::Show()>: Cannot read entry 0 (no data read)
What I’m missing? Thanks.
Dongliang