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)
|