ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/VHbb/python/myutils/HistoMaker.py
(Generate patch)

Comparing UserCode/VHbb/python/myutils/HistoMaker.py (file contents):
Revision 1.7 by peller, Wed Feb 6 12:55:04 2013 UTC vs.
Revision 1.8 by peller, Wed Feb 6 15:02:59 2013 UTC

# Line 9 | Line 9 | from math import sqrt
9   from copy import copy
10  
11   class HistoMaker:
12 <    def __init__(self, samples, path, config, optionsList):
12 >    def __init__(self, samples, path, config, optionsList,GroupDict=None):
13          self.path = path
14          self.config = config
15          self.optionsList = optionsList
# Line 22 | Line 22 | class HistoMaker:
22          self.tc = TreeCache(self.cuts,samples,path,config)
23          self._rebin = False
24          self.mybinning = None
25 +        self.GroupDict=GroupDict
26  
27      def get_histos_from_tree(self,job):
28          if self.lumi == 0:
# Line 40 | Line 41 | class HistoMaker:
41          # get all Histos at once
42          for options in self.optionsList:
43              name=job.name
44 <            group=job.group
44 >            if self.GroupDict is None:
45 >                group=job.group
46 >            else:
47 >                group=self.GroupDict[job.name]
48              treeVar=options['var']
49              name=options['name']
50              nBins=self.nBins
# Line 140 | Line 144 | class HistoMaker:
144          self.nBins = nBins_start
145          i=0
146          #add all together:
147 +        print '\n\t...calculating rebinning...'
148          for job in bg_list:
144            print job
149              htree = self.get_histos_from_tree(job)[0].values()[0]
150              if not i:
151                  totalBG = copy(htree)
# Line 194 | Line 198 | class HistoMaker:
198  
199          self.mybinning = Rebinner(int(self.norebin_nBins),array('d',[-1.0]+[totalBG.GetBinLowEdge(i) for i in binlist]),True)
200          self._rebin = True
201 <
201 >        print '\t > rebinning is set <\n'
202  
203      @staticmethod
204      def orderandadd(histo_dicts,setup):

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines