3 |
|
import os |
4 |
|
import fileinput |
5 |
|
from array import * |
6 |
< |
import argparse |
6 |
> |
from optparse import OptionParser |
7 |
|
from OSUT3Analysis.Configuration.configurationOptions import * |
8 |
|
from OSUT3Analysis.Configuration.processingUtilities import * |
9 |
|
|
10 |
< |
parser = argparse.ArgumentParser() |
10 |
> |
parser = OptionParser() |
11 |
|
parser = set_commandline_arguments(parser) |
12 |
< |
|
13 |
< |
arguments = parser.parse_args() |
12 |
> |
(arguments, args) = parser.parse_args() |
13 |
|
|
14 |
|
if arguments.localConfig: |
15 |
|
sys.path.append(os.getcwd()) |
103 |
|
weight = intLumi / 10000.0 |
104 |
|
for dataset in processed_datasets: |
105 |
|
dataset_file = "%s/%s.root" % (condor_dir,dataset) |
106 |
< |
if types[dataset] != "data": |
106 |
> |
fin = TFile (dataset_file) |
107 |
> |
flags = fin.Get ("flags") |
108 |
> |
noWeights = flags and flags.GetBinContent (1) |
109 |
> |
fin.Close () |
110 |
> |
if types[dataset] != "data" and not noWeights: |
111 |
|
os.system("mergeTFileServiceHistograms -i %s -o %s -w %g" % (dataset_file, dataset_file + "_tmp", weight)) |
112 |
|
else: |
113 |
|
os.system("mergeTFileServiceHistograms -i %s -o %s -w %g" % (dataset_file, dataset_file + "_tmp", 1.0)) |