I would like to write vector into Root file using following piece of code:
vector * pBool = &vBool;
tree->Branch(“pBool”, “vector”, &pBool);
The code compiles and runs. Unfortunately when I look into the Root file with TBrowser I do not see corresponding branch pBool.
The same type of code works just fine for vector:
vector * pInt = &vInt;
tree->Branch(“pInt”, “vector”, &pInt);
Different behavior for vector and vector seams strange. Is it expected? Or am I doing something wrong? Any help (or example) will be appreciated.
We do not provide a precompiled dictionary for vector, you will need to generate one explicitly (using ACLiC).
Philippe, thanks for hint.
I added following lines (like in hvector.C):
#pragma link C++ class vector<bool>;
and now my script is working fine.
Then I decided to make compiled executable and found out that above solution works only in CINT. But I found another thread on this issue http://root.cern.ch/phpBB2/viewtopic.php?t=8467. Following this thread I added following lines in my program:
gROOT->ProcessLine("#include <vector>"); Now it compiles and stores vector into Root file.