105 |
|
gDict = {} |
106 |
|
if self._rebin: |
107 |
|
gDict[group] = self.mybinning.rebin(hTree) |
108 |
+ |
del hTree |
109 |
|
else: |
110 |
|
gDict[group] = hTree |
111 |
|
hTreeList.append(gDict) |
112 |
+ |
CuttedTree.IsA().Destructor(CuttedTree) |
113 |
+ |
del CuttedTree |
114 |
|
return hTreeList |
115 |
|
|
116 |
|
@property |
141 |
|
i=0 |
142 |
|
#add all together: |
143 |
|
for job in bg_list: |
144 |
+ |
print job |
145 |
+ |
htree = self.get_histos_from_tree(job)[0].values()[0] |
146 |
|
if not i: |
147 |
< |
totalBG = self.get_histos_from_tree(job)[0].values()[0] |
147 |
> |
totalBG = copy(htree) |
148 |
|
else: |
149 |
< |
totalBG.Add(self.get_histos_from_tree(job)[0].values()[0],1) |
149 |
> |
totalBG.Add(htree,1) |
150 |
> |
del htree |
151 |
|
i+=1 |
152 |
|
ErrorR=0 |
153 |
|
ErrorL=0 |
198 |
|
|
199 |
|
@staticmethod |
200 |
|
def orderandadd(histo_dicts,setup): |
195 |
– |
print histo_dicts |
201 |
|
ordered_histo_dict = {} |
202 |
|
for sample in setup: |
203 |
|
nSample = 0 |
204 |
|
for histo_dict in histo_dicts: |
205 |
|
if histo_dict.has_key(sample): |
206 |
|
if nSample == 0: |
207 |
< |
ordered_histo_dict[sample] = histo_dict[sample] |
207 |
> |
ordered_histo_dict[sample] = histo_dict[sample].Clone() |
208 |
|
else: |
209 |
|
printc('magenta','','\t--> added %s to %s'%(sample,sample)) |
210 |
|
ordered_histo_dict[sample].Add(histo_dict[sample]) |
211 |
|
nSample += 1 |
212 |
+ |
del histo_dicts |
213 |
|
return ordered_histo_dict |
214 |
|
|
215 |
|
class Rebinner: |
219 |
|
self.active=active |
220 |
|
def rebin(self, histo): |
221 |
|
if not self.active: return histo |
216 |
– |
#print 'rebinning' |
222 |
|
#print histo.Integral() |
223 |
|
ROOT.gDirectory.Delete('hnew') |
224 |
|
histo.Rebin(self.nBins,'hnew',self.lowedgearray) |
232 |
|
newhisto.SetName(binhisto.GetName()) |
233 |
|
newhisto.SetTitle(binhisto.GetTitle()) |
234 |
|
#print newhisto.Integral() |
235 |
+ |
del histo |
236 |
+ |
del binhisto |
237 |
|
return copy(newhisto) |