Writing / Reading vectors of doubles, floats and ints

I currently write arrays using a construct such as

double x[1024];
size = 980;
tree->Branch(“size”, &size, “size/I”);
tree->Branch(“x”, x, “x[size]/D”);

I would like to switch to std::vector, for example. I believe ROOT supports these basic types.

The question is how to write it out. For example,

std::vector x;
x.push_back( 29.0 );
x.push_back( 38.0 );
/*** CREATE BRANCH HERE ***/

Thanks,

Joe

You need:std::vector<double> *px = new std::vector<double>; ... tree->Branch("x",&px);

Cheers,
Philippe.