Dear you,
My ROOT is: ROOT 5.27/02 (trunk@33229…
I construct a TTree branch with a C struct as following (please pay attention to those ‘float’ data):
struct PPAC
{
unsigned short C2Px1,C2Px2,C2Py1,C2Py2;
float C2Px,C2Py;
unsigned short T2P1t,T2P1x1,T2P1x2,T2P1y1,T2P1y2;
float T2P1x,T2P1y;
unsigned short T2P2t,T2P2x1,T2P2x2,T2P2y1,T2P2y2;
float T2P2x,T2P2y;
};
for this data structure, those ‘float’ values always be very stange in the Tree(Please check the attached ps file).
However, if I change the ‘C struct’ to the following structure:
struct PPAC
{
unsigned short C2Px1,C2Px2,C2Py1,C2Py2;
unsigned short T2P1t,T2P1x1,T2P1x2,T2P1y1,T2P1y2;
unsigned short T2P2t,T2P2x1,T2P2x2,T2P2y1,T2P2y2;
float C2Px,C2Py;
float T2P1x,T2P1y;
float T2P2x,T2P2y;
};
the ‘Tree’ is correct.
I use the TTree function
TBranch* Branch(const char* name, void* address, const char* leaflist, Int_t bufsize /* = 32000 */)
to build the ‘Branch’. The ‘leaflist’ have been checked carefully (especially the ‘/F’ and ‘/s’, “C2Px1/s:… C2Px/F:…T2P1t/s:…” or “C2Px1:/s…T2P2y2/s:C2Px/F:…”) to match the C struct respectively.
Because the size of my binary data file is big, so I can not update it.
But, if you can not reproduce this problem, please reply the post, I will prepare a simple program.
Thank you!
Handong
T2P1x.ps (10.3 KB)