ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/VHbb/python/submitThem.py
(Generate patch)

Comparing UserCode/VHbb/python/submitThem.py (file contents):
Revision 1.9 by peller, Fri Sep 28 14:15:01 2012 UTC vs.
Revision 1.12 by peller, Mon Oct 1 09:16:34 2012 UTC

# Line 11 | Line 11 | parser.add_option("-T", "--tag", dest="t
11   parser.add_option("-J", "--task", dest="task", default="",
12                        help="Task to be done, i.e. 'dc' for Datacards, 'prep' for preparation of Trees, 'plot' to produce plots or 'eval' to write the MVA output or 'sys' to write regression and systematics. ")
13   parser.add_option("-M", "--mass", dest="mass", default="125",
14 <                      help="Mass for DC or Plots, 110...135")
14 >                      help="Mass for DC or Plots, 110...135")
15 > parser.add_option("-S","--samples",dest="samples",default="",
16 >                      help="samples you want to run on")
17 >
18  
19   (opts, args) = parser.parse_args(sys.argv)
20   if opts.tag == "":
# Line 22 | Line 25 | if opts.task == "":
25      print "Please provide a task.\n-J prep:\tpreparation of Trees\n-J sys:\t\twrite regression and systematics\n-J eval:\tcreate MVA output\n-J plot:\tproduce Plots\n-J dc:\t\twrite workspaces and datacards"
26      sys.exit(123)
27  
28 + #create the list with the samples to run over
29 + samplesList=opts.samples.split(",")
30 +
31   en = opts.tag
32   configs = ['config%s'%(en),'pathConfig%s'%(en)]
33 +        
34   print configs
35   config = BetterConfigParser()
36   config.read(configs)
# Line 48 | Line 55 | if opts.task == 'dc':
55   if opts.task == 'plot':
56      Plot_vars= config.items('Plot')
57  
58 < path = config.get("Directories","samplepath")
59 < infofile = open(path+'/env/samples.info','r')
60 < info = pickle.load(infofile)
61 < infofile.close()
58 > if not opts.task == 'prep':
59 >    path = config.get("Directories","samplepath")
60 >    infofile = open(path+'/env/samples.info','r')
61 >    info = pickle.load(infofile)
62 >    infofile.close()
63  
64  
65   if opts.task == 'plot':
# Line 71 | Line 79 | elif opts.task == 'prep':
79      submit('prepare',repDict)
80  
81   elif opts.task == 'eval' or opts.task == 'sys':
82 <    for job in info:
83 <        submit(job.name,repDict)
82 >    if ( opts.samples == ""):
83 >        for job in info:
84 >            submit(job.name,repDict)
85 >    else:
86 >        for sample in samplesList:
87 >            submit(sample,repDict)
88 >            

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines