6 |
|
import ROOT |
7 |
|
from array import array |
8 |
|
from BetterConfigParser import BetterConfigParser |
9 |
< |
import sys |
9 |
> |
import sys,os |
10 |
|
|
11 |
|
class HistoMaker: |
12 |
|
def __init__(self, path, config, region, optionsList,rescale=1,which_weightF='weightF'): |
57 |
|
plot_path = self.config.get('Directories','plotpath') |
58 |
|
addOverFlow=eval(self.config.get('Plot_general','addOverFlow')) |
59 |
|
|
60 |
+ |
scratchDir = os.environ["TMPDIR"] |
61 |
+ |
#scratchDir = '/shome/peller/' |
62 |
|
# define treeCut |
63 |
|
if job.type != 'DATA': |
64 |
|
if type(self.region)==str: |
77 |
|
treeCut='%s'%(cutcut) |
78 |
|
|
79 |
|
# get and skim the Trees |
80 |
< |
output=TFile.Open(plot_path+'/tmp_plotCache_%s_%s.root'%(self.region,job.identifier),'recreate') |
80 |
> |
output=TFile.Open(scratchDir+'/tmp_plotCache_%s_%s.root'%(self.region,job.identifier),'recreate') |
81 |
|
input = TFile.Open(self.path+'/'+job.getpath(),'read') |
82 |
|
Tree = input.Get(job.tree) |
83 |
|
output.cd() |
113 |
|
elif job.type == 'DATA': |
114 |
|
if options[11] == 'blind': |
115 |
|
output.cd() |
116 |
< |
CuttedTree.Draw('%s>>%s(%s,%s,%s)' %(treeVar,name,nBins,xMin,xMax),treeVar+'<0', "goff,e") |
116 |
> |
if treeVar == 'H.mass': |
117 |
> |
CuttedTree.Draw('%s>>%s(%s,%s,%s)' %(treeVar,name,nBins,xMin,xMax),treeVar+'<80. || '+treeVar + '>150.' , "goff,e") |
118 |
> |
else: |
119 |
> |
CuttedTree.Draw('%s>>%s(%s,%s,%s)' %(treeVar,name,nBins,xMin,xMax),treeVar+'<0', "goff,e") |
120 |
> |
|
121 |
|
else: |
122 |
|
output.cd() |
123 |
|
CuttedTree.Draw('%s>>%s(%s,%s,%s)' %(treeVar,name,nBins,xMin,xMax),'1', "goff,e") |