ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/OSUT3Analysis/Configuration/scripts/makeCutFlows.py
(Generate patch)

Comparing UserCode/OSUT3Analysis/Configuration/scripts/makeCutFlows.py (file contents):
Revision 1.12 by lantonel, Tue Mar 12 21:10:44 2013 UTC vs.
Revision 1.14 by ahart, Mon Mar 25 18:17:40 2013 UTC

# Line 3 | Line 3 | import sys
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())
# Line 104 | Line 103 | firstChannel = True
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))

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines