//TChain for ttH_dilep std::ifstream file2 ("ttH_dilep.txt"); std::string str2; std::string file_contents2; std::string treename2; TChain *ch2 = new TChain ("nominal"); while (std::getline(file2,str2)) { file_contents2 = str2; const char* filename2 = file_contents2.c_str(); std::cout << "name: " << filename2 << "\n"; treename2 = file_contents2 + "/nominal"; const char* name2 = treename2.c_str(); ch2->AddFile(name2); } TTree *ttHTree_dilep = new TTree("ttH_dilep", "ttH_dilep"); ttHTree_dilep = (TTree*)ch2->CloneTree(0); for(Int_t ievt = 0; ievt < ch2->GetEntries(); ievt++){ ch2->GetEntry(ievt); if(jet_e_ttH_dilep->size() == 4 && ejets_2016_ttH_dilep == 1){ cross_section4 = 0.22276; ttHTree_dilep->Fill(); } }