void genZ() { Int_t runs,evts,pdg,seed; Double_t momentum; std::string outpath, geo; cout << "Number of runs: "; cin >> runs; cout << "\nNumber of events in each run: "; cin >> evts; cout << "\nSelect seed: "; cin >> seed; cout << "\n" << endl; cout << "\nSelect Output path: "; cin >> outpath; cout << "\nSelect Geometry: "; cin >> geo; cout << endl; string lancio; string condor; string buff; string sub; string testo; string zip; for (Int_t j = 0 ; j < runs ; j++) { // create scripts // lancio = Form("lancio_%d",j+1); lancio = Form("lancio_%d",seed+j); ofstream out(lancio.c_str()); out << "#!/bin/bash" << endl; buff = Form("root -b -q 'runMvdSimZ.C(%d,%d,\"%s\",\"%s\")' &> /dev/null;",seed+j,evts,outpath.c_str(),geo.c_str()); testo = Form("name_%d.dat",seed+j); out << buff << endl; testo = Form("name_%d.dat",seed+j); zip = Form("root -b -q 'zipZ.C(\"%s\", %d )' &> /dev/null;",testo.c_str(),1); out << zip << endl; out.close(); system("chmod 777 lancio*_*"); // create condor script condor = Form("condor_%d.cmd",j+seed); ofstream con(condor.c_str()); con << "universe = vanilla" << endl; // con << "executable = ./lancio_" << j+1 << endl; con << "executable = ./lancio_" << seed+j << endl; con << "output = /hiskp1/bianco/start2.out" << endl; con << "error = /hiskp1/bianco/start2.err" << endl; con << "log = /hiskp1/bianco/start2.log" << endl; con << "getenv = true" << endl; con << "nice_user = true" << endl; con << "arguments = " << endl; con << "should_transfer_files = IF_NEEDED" << endl; con << "when_to_transfer_output = ON_EXIT" << endl; con << "queue" << endl; con.close(); sub = Form("condor_submit condor_%d.cmd",j+seed); system(sub.c_str()); } // end of loop on runs }