TBranch with structure including pointers

I have a structure that includes pointers to float, which point to float arrays. Is there any way to create a branch that will hold such a structure in a proper way - filling the arrays from the place in memory pointed by the pointer? An example is below:

struct something
 int header;
 int evt_number;
 int time;
 float *pkt_type;
 float *datalength;

something packet;
packet.pkt_type = new float[2304];
packet.datalength = new float[2304];


It magically half worked this way in root, but the order of elements in arrays got mixed. I assume it worked by an accident, for the tcal TTree expects a block of 2304 float values acctually where it finds a pointer to float.