Can not SetBranchAddress for std::vector

Dear Experts

I want to SetBranchAddress for a std::vector value:

SetBranchAddress("someVector", &someVector); 

but error occurred:

Error in <TTree::SetBranchAddress>: The pointer type given "Double_t" (8) does not correspond to the type needed "vector<double>" by the branch: charge

Why I can’t do this to a vector but to double or int?
I know if I use a pointer of vector it will work, but I’m curious why vector doesn’t work.

Thank you in advance.


Please read tips for efficient and successful posting and posting code

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided


std::vector<double> *v = 0; tree->SetBranchAddress("MyVectorBranch", &v);

@pcanal As I said…I know if I use a pointer of vector it will work, but I’m curious why vector doesn’t work.

Emm, anyone can give me some idea of what cause this?