void gen() { Int_t runs,evts,pdg,seed; Double_t momentum; std::string path,geo,vol; cout << "Number of runs: "; cin >> runs; cout << "\nNumber of events in each run: "; cin >> evts; cout << "\nSelect PDG code (211 pi+, -211 pi-, ...): "; cin >> pdg; cout << "\nSelect momentum (GeV/c): "; cin >> momentum; cout << "\nSelect seed: "; cin >> seed; cout << "\nSelect path: "; cin >> path; cout << "\n" << endl; string lancio; string condor; string buff; string sub; string testo; string ana; string merge; string rundigi; string runreco; string runfit; std::string sim,digi,par,reco,fit; for (Int_t j = 0 ; j < runs ; j++) { // create scripts lancio = Form("lancio_%d",j+1); ofstream out(lancio.c_str()); out << "#!/bin/bash" << endl; buff = Form("root -b -q 'runTTSim.C(%d,%d,%d,%lf,\"%s\")' &> /dev/null;",seed+j,pdg,evts,momentum,path.c_str()); // testo = Form("name_%d.dat",seed+j); out << buff << endl; sim = Form("Sim_%lf_%d_%d.root",momentum,pdg,seed+j); par = Form("ParSim_%lf_%d_%d.root",momentum,pdg,seed+j); digi = Form("DigiSim_%lf_%d_%d.root",momentum,pdg,seed+j); reco = Form("RecoSim_%lf_%d_%d.root",momentum,pdg,seed+j); fit = Form("Fit_%lf_%d_%d.root",momentum,pdg,seed+j); rundigi = Form("root -b -q 'runTTDigi.C(\"%s\",\"%s\",%d,\"%s\")' &> /dev/null;",sim.c_str(),par.c_str(),pdg,path.c_str()); out << rundigi << endl; runreco = Form("root -b -q 'runTTReco.C(\"%s\",\"%s\",\"%s\",%d,\"%s\")' &> /dev/null;",sim.c_str(),digi.c_str(),par.c_str(),pdg,path.c_str()); out << runreco << endl; runfit = Form("root -b -q 'runFit.C(\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\")' &> /dev/null;",sim.c_str(),par.c_str(),digi.c_str(),reco.c_str(),fit.c_str(),path.c_str()); out << runfit << endl; out.close(); system("chmod 777 lancio_*"); // create condor script /* condor = Form("condor_%d.cmd",j+1); ofstream con(condor.c_str()); con << "universe = vanilla" << endl; std::string jjjj; jjjj = Form("executable = ./lancio_%d",j+1); con << jjjj << endl; // con << "executable = ./lancio_" << j+1 << 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+1); // system(sub.c_str()); */ } // end of loop on runs }