8 void bin2TTree(
int Nevents=1,
const Char_t *binFile =
"data.bin"){
10 gSystem->Load(
"EEmc.so");
13 fd=fopen(binFile,
"r");
17 TFile f(
"tree4.root",
"RECREATE");
20 TTree t4(
"t4",
"A Tree with Events");
24 EEevent *eve=
new EEevent();
25 t4.Branch(
"EEDst",
"EEevent", &eve,16000,99);
28 for (i=1; i<=Nevents; i++ ) {
35 for(j=0;j<
sizeof(int);j++) cLen[j]=fgetc(fd);
36 cerr <<
"actual data len=" << len <<
" bytes " << endl;
38 for(j=0;j<len;j++) hitBuf[j]=fgetc(fd);
42 int nbw = data.read(hitBuf,len);
52 Int_t nevent = (Int_t)t4->GetEntries();
53 printf(
"Total events in TTree=%d\n",nevent);