Dear experts
I want to read a std::vector<TVector3>
branch and here is what I do:
//include files
#pragma link C++ class std::vector<TVector3>+;
void drawShape(){
TFile* f = new TFile("file.root", "READ");
TTree* t = (TTree*)f->Get("t");
std::vector<TVector3>* pos;
t->SetBranchAddress("pos", &pos);
for(int i=0; i<t->GetEntries(); ++t){
t->GetEntry(i);
for(auto& p : (*pos)){
//do something
}
}
}
And I do: root -l drawShape.cxx+
But I got seg fault with the message:
Sorry I was not able to copy error message, what did I do wrong to get this error?
_ROOT Version: 6.18.00
_Platform: CentOS 7
Compiler: Not Provided