void clone() { //cout << file<< " "<< outfile<Get("tree"); //TTree *chain1 = (TTree*)f1->Get("variables"); Double_t rank,BCSphipi_rank; chain->SetBranchAddress("BCSphipi_rank",&rank); //chain->SetBranchAddress("MVAFastBDT__ptroot_isNotContinuumEvent",&mva); TTree *new_signal = chain->CloneTree(0,"tree"); TBranch* NB1 =new_signal->Branch("rank", &rank); //TBranch* NB1 =new_signal->Branch("MVAContinnum", &mva); for(int i=0;iGetEntries();i++) { chain->GetEntry(i); //chain1->GetEntry(i); new_signal->Fill(); } new_signal->Write(); delete f; }