Changeset 13095 for fact/tools/pyscripts
- Timestamp:
- 03/14/12 09:07:34 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/tools/pyscripts/pyfact/hist.py
r12814 r13095 10 10 11 11 class histogramList( object ): 12 """ maintain a list of ROOT histograms 13 """ 12 """ maintain a list of ROOT histograms """ 13 14 14 def __init__( self, name ): 15 15 """ set the name and create empty lists """ … … 21 21 self.book() 22 22 23 def __call__(self, tag, value): 24 """ fill value in the correct histo """ 25 26 self.dict[tag].Fill(value) 27 23 28 def __del__(self): 24 29 for h in self.list: … … 54 59 Create ROOT histo 55 60 """ 56 def __init__( self, n bins, first, last, name = 'name', title = 'title',61 def __init__( self, name, title, nbins, first, last, 57 62 xtitle = 'x', ytitle = 'y' ): 58 63 … … 69 74 70 75 def fill( self, x ): 71 h, b = np.histogram( x, self.nbins, self.first, self.last,72 new = True )76 h, b = np.histogram( x, self.nbins, (self.first,self.last) ) 77 self.b = b 73 78 self.y += h 79 80 def __call__(self, x): 81 self.fill(x) 82 74 83 75 84 def zero( self ): … … 81 90 self.rh = TH1F( self.name, self.title, self.nbins, 82 91 self.first, self.last ) 83 self.rh.GetXaxis().SetTitle( xtitle );84 self.rh.GetYaxis().SetTitle( ytitle );92 self.rh.GetXaxis().SetTitle( self.xtitle ); 93 self.rh.GetYaxis().SetTitle( self.ytitle ); 85 94 86 95 for i in range( self.nbins ):
Note:
See TracChangeset
for help on using the changeset viewer.