Branch of std::vector<int> or std::vector<int>* in TTree

Here is a piece of my code:

vector<float> phenV;
TTree *t1 = new TTree("t1", "t1");
 t1->Branch("phenV", &phenV);
for ( int i=0; i<nph; i++){
 phenV.push_back( phen[i] );

Then I do t1->MakeClass("t1Class"). The question is
Why in t1Class.h I see the following:

vector<float>   *phenV;

i.e. why is it pointer to vector<float> instead of just vector<float>?

@pcanal perhaps you can comment on this one? Thanks!

This is because SetBranchAddress currently can only take a pointer to a pointer rather than a pointer to an object.


PS. On the other hand, Branch has been upgraded to accept both.

So, why does similar situation not happen, for example, with arrays?

Simple type (and array thereof) are indeed historically treated differently from object (for simple type the user is solely responsible for the allocation, for object the responsabiliby is shared between the user and the TTree).