Getting a vector<TObject> from a tree

Hi rooters,

I wrote a code to create an std::vector of pSignal, a custom class representing particle signals that inherits from TGraph, so as a “zero-order approximation” you can say this is a vector of TGraph.

I put the vector in a TTree and finally i save the TTree on a TFile.

The aim is to read the stored signals back once the file is ready.

I loaded all necessary libraries and generate the dictionaries.

When I try to read i get this error:

Error in TTree::SetBranchAddress: Unable to determine the type given for the address for “Wsignals”. This is probably due to a missing dictionary, the original data class for this branch is vector

This is the first time i do something like this, so i do not know what to do to fix this problem and that’s why I am asking your help.

Thanks in advance
stl.C (2.0 KB)

Hi,

is it possible to have the necessary headers to make the example standalone and allow us to reproduce?

D

Hi, thanks for the reply

pADC.h (8.7 KB)
pADC.cpp (3.5 KB)
pSignal.cpp (21.2 KB)
pSignal.h (16.7 KB)

(I’m not the author of these classes, but i think there are no problems, because you can freely download them all)

Just a reply to keep the topic open…some news about this problem @dipiparo? Thanks in advance

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