ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/VHbb/python/prepare_environment_with_config.py
Revision: 1.21
Committed: Thu Feb 28 16:38:49 2013 UTC (12 years, 2 months ago) by nmohr
Content type: text/x-python
Branch: MAIN
CVS Tags: lhcp_UnblindFix, hcp_Unblind, lhcp_11April, LHCP_PreAppFixAfterFreeze, LHCP_PreAppFreeze, HEAD
Changes since 1.20: +6 -0 lines
Log Message:
Prepare split jobs

File Contents

# Content
1 #! /usr/bin/env python
2 import os, pickle, sys, ROOT
3 ROOT.gROOT.SetBatch(True)
4 from optparse import OptionParser
5 from myutils import BetterConfigParser, copytree, ParseInfo
6
7 argv = sys.argv
8
9 #get files info from config
10 parser = OptionParser()
11 parser.add_option("-C", "--config", dest="config", default=[], action="append",
12 help="directory config")
13 parser.add_option("-S", "--samples", dest="names", default="",
14 help="samples you want to run on")
15
16 (opts, args) = parser.parse_args(argv)
17
18 config = BetterConfigParser()
19 config.read(opts.config)
20
21 namelist=opts.names.split(',')
22
23 pathIN = config.get('Directories','PREPin')
24 pathOUT = config.get('Directories','PREPout')
25 samplesinfo=config.get('Directories','samplesinfo')
26 prefix=config.get('General','prefix')
27
28 info = ParseInfo(samplesinfo,pathIN)
29
30 for job in info:
31 if not job.name in namelist:
32 continue
33 if job.subsample:
34 continue
35 copytree(pathIN,pathOUT,prefix,job.prefix,job.identifier,'',job.addtreecut)