{ struct gps_struct { float time; float date; float lat; float lon; float hdp; float alt; float geoid_height; float update_time; float speed; float mag_variation; float course; short station_id; char lat_hemisphere; char lon_hemisphere; char fix_quality; char alt_unit; char geoid_height_unit; char gpgga_checksum; char mode; char mode_dim; char rec_warning; char mag_variation_hemisphere; char gprmc_checksum; char sat_mode; unsigned char sat_num; }; TFile *f = new TFile("test_tree.root", "read"); TTree *t = (TTree*)f->Get("tevent"); t->Print(); gps_struct *gps2; gps_struct *gps1 = new gps_struct; //TBranch *b = tevent->GetBranch("clkb_event_gps"); //b.SetAddress(gps1); t->SetBranchAddress("clkb_event_gps", gps1); t.GetEntry(1); cout << gps1->time << endl; }