#include #include #include "TFile.h" #include "TTree.h" using namespace std; int main(){ TFile fDB("./testW.root","recreate","demo file"); TTree* t=new TTree("t","tree DB"); vector a; t->Branch("a", &a, "a"); for (int i=1; i<3; i++){ a.push_back(float(i)); } for (int i=0; i<2; i++){ cout<<"a["<Fill(); fDB.Write(); fDB.Close(); return 0; }