void saveAllCuts(const char* filename = "alphaCuts.root") { TFile* f = new TFile(filename, "UPDATE"); TIter next(gROOT->GetListOfSpecials()); TObject* obj; while ((obj = next())) { if (obj->InheritsFrom("TCutG")) { obj->Write("", TObject::kOverwrite); std::cout << "Saved: " << obj->GetName() << std::endl; } } f->Close(); // Return to the originally attached file if (_file0) _file0->cd(); }