Have a look at the ${ROOTSYS}/tutorials/tree/hvector.C (simple vectors) and $ROOTSYS/tutorials/tree/tree2.C (fixed and variable length arrays, see also ROOT User’s Guide -> Trees -> Example 2: A Tree with a C Structure) and ${ROOTSYS}/tutorials/tree/tree3.C (variable length arrays) tutorials.