4 |
|
import sys |
5 |
|
import math |
6 |
|
import datetime |
7 |
+ |
import copy |
8 |
|
from optparse import OptionParser |
9 |
< |
#from OSUT3Analysis.Configuration.configurationOptions import * |
9 |
> |
import OSUT3Analysis.DBTools.osusub_cfg as osusub |
10 |
> |
import FWCore.ParameterSet.Config as cms |
11 |
|
|
12 |
|
def split_composite_datasets(datasets, composite_dataset_definitions): |
13 |
|
for dataset in datasets: |
46 |
|
sys.exit("Cannot find last condor working directory") |
47 |
|
dir_list.sort(reverse=True) |
48 |
|
condor_dir = "condor/%s" % dir_list[0] |
49 |
< |
print "Condor output directory set to ",condor_dir |
49 |
> |
#print "Condor output directory set to ",condor_dir |
50 |
|
return condor_dir |
51 |
|
|
52 |
|
def set_commandline_arguments(parser): |
73 |
|
|
74 |
|
parser.add_option("-r", "--ratio", action="store_true", dest="makeRatioPlots", default=False, |
75 |
|
help="draw (data-MC)/MC plots below all 1D histograms") |
76 |
< |
parser.add_option("-R", "--ratioYRange", dest="ratioYRange", default=1.15, |
76 |
> |
parser.add_option("-R", "--ratioYRange", dest="ratioYRange", |
77 |
|
help="maximum of range of vertical scale for ratio plots") |
78 |
|
parser.add_option("-d", "--diff", action="store_true", dest="makeDiffPlots", default=False, |
79 |
|
help="draw data-MC plots below all 1D histograms") |
86 |
|
parser.add_option("-p", "--pdfs", action="store_true", dest="savePDFs", default=False, |
87 |
|
help="Save pdfs files for all plots made") |
88 |
|
|
87 |
– |
|
89 |
|
return parser |
90 |
|
|
91 |
|
def get_short_name(dataset, dataset_names): |
140 |
|
options['labels'][bottomDatasetName] = "#tilde{t}#tilde{t}#rightarrowbbll (#LTc#tau#GT = " + str (ctau) + " mm)" |
141 |
|
options['labels'][topDatasetName] = "#tilde{t}#tilde{t}#rightarrowtt#nu#nu (#LTc#tau#GT = " + str (ctau) + " mm)" |
142 |
|
options['labels'][mixedDatasetName] = "#tilde{t}#tilde{t}#rightarrowbtl#nu (#LTc#tau#GT = " + str (ctau) + " mm)" |
143 |
+ |
|
144 |
+ |
def add_channels (process, channels): |
145 |
+ |
suffix = "" |
146 |
+ |
if osusub.batchMode: |
147 |
+ |
suffix = "_" + str (osusub.jobNumber) |
148 |
+ |
i = 0 |
149 |
+ |
for channel in channels: |
150 |
+ |
channelName = channel.name.pythonValue () |
151 |
+ |
channelName = channelName[1:-1] |
152 |
+ |
try: |
153 |
+ |
os.mkdir (channelName) |
154 |
+ |
except OSError: |
155 |
+ |
pass |
156 |
+ |
out = cms.OutputModule ("PoolOutputModule", |
157 |
+ |
fileName = cms.untracked.string (channelName + "/bean" + suffix + ".root"), |
158 |
+ |
SelectEvents = cms.untracked.PSet ( |
159 |
+ |
SelectEvents = cms.vstring ("myFilterPath" + str (i)) |
160 |
+ |
), |
161 |
+ |
outputCommands = cms.untracked.vstring ( |
162 |
+ |
"drop *", |
163 |
+ |
"keep *_BNproducer_*_*", |
164 |
+ |
"keep double_kt6PFJets*_rho_*", |
165 |
+ |
), |
166 |
+ |
dropMetaData = cms.untracked.string ("ALL") |
167 |
+ |
) |
168 |
+ |
myFilter = cms.EDFilter ("FilterOnChannelDecision", |
169 |
+ |
src = cms.InputTag ("OSUAnalysis", "channelDecisions"), |
170 |
+ |
channelName = cms.string (channelName) |
171 |
+ |
) |
172 |
+ |
myFilterPath = cms.Path (myFilter) |
173 |
+ |
myEndPath = cms.EndPath (out) |
174 |
+ |
process.__setattr__ ("out" + str (i), out) |
175 |
+ |
process.OSUAnalysis.channels.append (channel) |
176 |
+ |
process.OSUAnalysis.useEDMFormat = cms.bool (True) |
177 |
+ |
process.__setattr__ ("myFilter" + str (i), myFilter) |
178 |
+ |
process.__setattr__ ("myFilterPath" + str (i), myFilterPath) |
179 |
+ |
process.__setattr__ ("myEndPath" + str (i), myEndPath) |
180 |
+ |
i += 1 |