95 |
|
for file in fileList: |
96 |
|
outfile = ROOT.TFile.Open(file[0].replace('.root',newpostfix),'RECREATE') |
97 |
|
infile = ROOT.TFile.Open(file[0],"READ") |
98 |
< |
histoInfile = ROOT.TFile.Open(inclusive,"READ") |
98 |
> |
histoInfile = ROOT.TFile.Open(inclusive+'.root',"READ") |
99 |
|
histoInfile.cd() |
100 |
|
obj = ROOT.TObject |
101 |
|
for key in ROOT.gDirectory.GetListOfKeys(): |
175 |
|
weight_map = get_weights(fileList,lheBin) |
176 |
|
config.set('LHEWeights', 'weights_per_bin', '%s' %weight_map) |
177 |
|
f = open('8TeVconfig/lhe_weights', 'w') |
178 |
+ |
for section in config.sections(): |
179 |
+ |
if not section == 'LHEWeights': |
180 |
+ |
config.remove_section(section) |
181 |
|
config.write(f) |
182 |
|
f.close() |
183 |
|
elif opts.apply: |
184 |
< |
weight_map = config.get('LHEWeights', 'weights_per_bin') |
184 |
> |
weight_map = eval(config.get('LHEWeights', 'weights_per_bin')) |
185 |
|
if opts.apply: |
186 |
|
apply_weights(fileList,weight_map,prefix+inclusive,newpostfix) |
187 |
|
if opts.validate: |