{ #include "iostream.h" ifstream in; ofstream out; in.open("di_jet.dat"); char c[1000]; int N = 1; bool end = false; while(N<700 &!end) { //open file TString filename("dijet_"); char ss[2]; sprintf(ss,"%i",N); filename.Append(ss); filename.Append(".C"); cout << "Writting out: " << filename << endl; out.open(filename); TString outputfilename("dijet_"); outputfilename.Append(ss); outputfilename.Append(".root"); //write header out << " {" << endl; out << " TString comp = gSystem->GetMakeSharedLib();" << endl; out << " comp.ReplaceAll(\" +K3\",\" -g\");" << endl; out << " comp.ReplaceAll(\" +K2\",\" -g\");" << endl; out << " comp.ReplaceAll(\" +K1\",\" -g\");" << endl; out << " comp.ReplaceAll(\" -O2\",\" -g\");" << endl; out << " comp.ReplaceAll(\" -O1\",\" -g\");" << endl; out << " gSystem->SetMakeSharedLib(comp.Data());" << endl; out << endl; out << " gSystem->Load(\"libPhysics.so\");" << endl; out << endl; out << " gROOT->ProcessLine(\".L style.cpp+\");" << endl; out << " gROOT->ProcessLine(\".L Util.cpp+c\");" << endl; out << " gROOT->ProcessLine(\".L TestV13.C+\");" << endl; out << " gROOT->ProcessLine(\".L JetAnalyze.C+\");" << endl; out << endl; out << " //---------------------------------------------------" << endl; out << " // Input file" << endl; out << " //----------------------------------------------------" << endl; out << " TChain ch(\"Global\");" << endl << endl; Int_t nlines = 0; while (1 && nlines < 15) { in >> c; if (!in.good()) break; //if (nlines < 5) cout << c << endl << endl; out << " ch.Add(\"" << c << "\");" << endl; nlines++; } if(nlines<15) end = true; //close file out << endl; out << " cout << Global->GetEntries() << \" events to process\" << endl;" << endl; out << " JetAnalyze j(Global);" << endl; out << " j.FilterDiJetEvents(\"" << outputfilename << "\");" << endl; out << "}" << endl; out.close(); N++; } in.close(); }