1 |
#include <iostream>
|
2 |
#include <fstream>
|
3 |
#include <string>
|
4 |
using namespace std;
|
5 |
|
6 |
int main()
|
7 |
{
|
8 |
ifstream mcDS("MC_datasets.txt");
|
9 |
string dataset;
|
10 |
string dir;
|
11 |
int count = 0;
|
12 |
while(1) {
|
13 |
mcDS >> dataset >> dir;
|
14 |
if(!mcDS.good()) break;
|
15 |
|
16 |
count++;
|
17 |
char name[15];
|
18 |
sprintf(name, "MC_%02i.cfg", count);
|
19 |
|
20 |
ofstream out(name);
|
21 |
|
22 |
out << "[CRAB]\n";
|
23 |
out << "\n";
|
24 |
out << "jobtype = cmssw\n";
|
25 |
out << "scheduler = condor\n";
|
26 |
out << "\n";
|
27 |
out << "[CMSSW]\n";
|
28 |
out << "datasetpath = " << dataset << endl;
|
29 |
out << "\n";
|
30 |
out << "pset = mcthesis_cfg.py\n";
|
31 |
out << "lumis_per_job = 300\n";
|
32 |
out << "total_number_of_lumis = -1\n";
|
33 |
out << "output_file = trees.root\n";
|
34 |
out << "\n";
|
35 |
out << "[USER]\n";
|
36 |
out << "return_data = 1\n";
|
37 |
out << "copy_data = 0\n";
|
38 |
out << "ui_working_dir = " << dir << endl;
|
39 |
out << "[GRID]\n";
|
40 |
out << "retry_count = 2\n";
|
41 |
out << "shallow_retry_count = 3\n";
|
42 |
|
43 |
out.close();
|
44 |
|
45 |
}
|
46 |
|
47 |
ofstream out("submitMC.sh");
|
48 |
out << "#!/bin/sh\n";
|
49 |
out << endl;
|
50 |
for(int i = 0; i != count; i++) {
|
51 |
char name[15];
|
52 |
sprintf(name, "MC_%02i.cfg", i+1);
|
53 |
out << "crab -create -submit -cfg " << name << endl;
|
54 |
}
|
55 |
out.close();
|
56 |
|
57 |
return 0;
|
58 |
|
59 |
}
|