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.10 by bortigno, Sun Sep 30 17:36:39 2012 UTC vs.
Revision 1.13 by bortigno, Mon Oct 1 11:33:24 2012 UTC

# Line 25 | 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 dictionary with the samples to run over
29 < samplesDict=opts.samples.split(",")
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)]
# Line 43 | Line 43 | shutil.copyfile(os.path.basename(btagLib
43   shutil.copyfile('/scratch/%s/%s'%(getpass.getuser(),os.path.basename(btagLibrary)),btagLibrary)
44   os.chdir(submitDir)
45   logPath = config.get("Directories","logpath")
46 < repDict = {'en':en,'logpath':logPath,'job':''}
46 > repDict = {'en':en,'logpath':logPath,'job':'','task':opts.task}
47   def submit(job,repDict):
48          repDict['job'] = job
49 <        command = 'qsub -V -cwd -q all.q -N %(job)s_%(en)s -o %(logpath)s/%(job)s_%(en)s.out -e %(logpath)s/%(job)s_%(en)s.err runAll.sh %(job)s %(en)s ' %(repDict) + opts.task
49 >        command = 'qsub -V -cwd -q all.q -N %(job)s_%(en)s -o %(logpath)s/%(job)s_%(en)s_%(task)s.out -e %(logpath)s/%(job)s_%(en)s_%(task)s.err runAll.sh %(job)s %(en)s ' %(repDict) + opts.task
50          print command
51          subprocess.call([command], shell=True)
52  
# Line 55 | 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 82 | Line 83 | elif opts.task == 'eval' or opts.task ==
83          for job in info:
84              submit(job.name,repDict)
85      else:
86 <        for sample in samplesDict:
86 >        for sample in samplesList:
87              submit(sample,repDict)
88              

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines