{ // usage: // root -b -q runStrProxy.C const string types[4] = {"Coulomb", "Touschek", "BHWide", "RBB"}; const string rings[2] = {"HER", "LER"}; for(int j = 0; j<3; j++){ string typ = types[j]; for(int k = 0; k<2; k++){ string ring = rings[k]; TFile* mcfile = new TFile(Form("/Users/andreafodor/analysis/sensitiveDetector/MCfiles/withMCinfo/output_%s_%s.root", typ.c_str(), ring.c_str())); ofstream outfile ("types.txt"); if (outfile.is_open()){ outfile << Form("%s_%s", typ.c_str(), ring.c_str()); outfile.close(); } TTree* tree = (TTree*)(mcfile->Get("strTree")); tree -> SetBranchStatus("*", 0); tree -> SetBranchStatus("StrSimHits*", 1); tree -> MakeProxy("proxy", "/Users/andreafodor/analysis/sensitiveDetector/MCfiles/analyze.C", "", "nohist"); tree ->Process("proxy.h+", ""); remove("types.txt"); } } }