void test_write(){ gSystem->Load("libMyTrack"); MyTrack* a=new MyTrack(); TFile f1("test.root","recreate"); TTree t1("t1","test"); t1.Branch("my","MyTrack",&a); TRandom* b=new TRandom(); for (Int_t i=0 ; i < 100 ; i++) { a.SetTrack(b); t1.Fill(); } f1.Write(); }