7 |
|
from HistoMaker import HistoMaker |
8 |
|
|
9 |
|
class StackMaker: |
10 |
< |
def __init__(self, config, var,region,SignalRegion): |
10 |
> |
def __init__(self, config, var,region,SignalRegion,setup=None): |
11 |
|
section='Plot:%s'%region |
12 |
|
self.var = var |
13 |
|
self.SignalRegion=SignalRegion |
16 |
|
if config.has_option('plotDef:%s'%var,'log') and not self.log: |
17 |
|
self.log = eval(config.get('plotDef:%s'%var,'log')) |
18 |
|
self.blind = eval(config.get(section,'blind')) |
19 |
< |
self.setup=config.get('Plot_general','setup') |
20 |
< |
if self.log: |
21 |
< |
self.setup=config.get('Plot_general','setupLog') |
22 |
< |
self.setup=self.setup.split(',') |
23 |
< |
if not SignalRegion: self.setup.remove('ZH') |
19 |
> |
if self.blind: blindopt='True' |
20 |
> |
else: blindopt = 'False' |
21 |
> |
if setup is None: |
22 |
> |
self.setup=config.get('Plot_general','setup') |
23 |
> |
if self.log: |
24 |
> |
self.setup=config.get('Plot_general','setupLog') |
25 |
> |
self.setup=self.setup.split(',') |
26 |
> |
else: |
27 |
> |
self.setup=setup |
28 |
> |
#if not SignalRegion: self.setup.remove('ZH') |
29 |
|
self.rebin = 1 |
30 |
|
if config.has_option(section,'rebin'): |
31 |
|
self.rebin = eval(config.get(section,'rebin')) |
48 |
|
if '<mass>' in self.name: |
49 |
|
self.name = self.name.replace('<mass>',self.mass) |
50 |
|
print self.name |
51 |
< |
cut = config.get('Cuts',region) |
51 |
> |
if config.has_option('Cuts',region): |
52 |
> |
cut = config.get('Cuts',region) |
53 |
> |
else: |
54 |
> |
cut = None |
55 |
|
if config.has_option(section, 'Datacut'): |
56 |
|
cut=config.get(section, 'Datacut') |
57 |
|
|
59 |
|
self.typLegendDict=eval(config.get('Plot_general','typLegendDict')) |
60 |
|
self.anaTag = config.get("Analysis","tag") |
61 |
|
self.xAxis = config.get('plotDef:%s'%var,'xAxis') |
62 |
< |
self.options = {'var': self.name,'name':'','xAxis': self.xAxis, 'nBins': self.nBins, 'xMin': self.xMin, 'xMax': self.xMax,'pdfName': '%s_%s_%s.pdf'%(region,var,self.mass),'cut':cut,'mass': self.mass, 'data': data, 'blind': self.blind} |
63 |
< |
self.options['weight'] = config.get('Weights','weightF') |
62 |
> |
self.options = {'var': self.name,'name':'','xAxis': self.xAxis, 'nBins': self.nBins, 'xMin': self.xMin, 'xMax': self.xMax,'pdfName': '%s_%s_%s.pdf'%(region,var,self.mass),'cut':cut,'mass': self.mass, 'data': data, 'blind': blindopt} |
63 |
> |
if config.has_option('Weights','weightF'): |
64 |
> |
self.options['weight'] = config.get('Weights','weightF') |
65 |
> |
else: |
66 |
> |
self.options['weight'] = None |
67 |
|
self.plotDir = config.get('Directories','plotpath') |
68 |
|
self.maxRatioUncert = 0.5 |
69 |
|
if self.SignalRegion: |