@@ -67,15 +67,15 @@ def setTH2sparse(sparse, yminBin, ymaxBin, th2):
6767# "Public" methods; what we want to attach to the Histogram as a mix-in.
6868
6969class HistogramMethods (object ):
70- def root (self , name , title = "" , binType = "D" ):
70+ def plotroot (self , name , title = "" , binType = "D" ):
7171 import ROOT
7272 constructor = getattr (ROOT , "TH1" + binType )
7373 th1 = constructor (name , title , len (self .values ), self .low , self .high )
7474 setTH1 (self .entries , [x .entries for x in self .values ], self .underflow .entries , self .overflow .entries , th1 )
7575 return th1
7676
7777class SparselyHistogramMethods (object ):
78- def root (self , name , title = "" , binType = "D" ):
78+ def plotroot (self , name , title = "" , binType = "D" ):
7979 import ROOT
8080 constructor = getattr (ROOT , "TH1" + binType )
8181 if self .minBin is None or self .maxBin is None :
@@ -87,7 +87,7 @@ def root(self, name, title="", binType="D"):
8787 return th1
8888
8989class ProfileMethods (object ):
90- def root (self , name , title = "" ):
90+ def plotroot (self , name , title = "" ):
9191 import ROOT
9292 tprofile = ROOT .TProfile (name , title , len (self .values ), self .low , self .high )
9393 tprofile .SetBinContent (0 , self .underflow .entries * self .underflow .entries )
@@ -103,7 +103,7 @@ def root(self, name, title=""):
103103 return tprofile
104104
105105class SparselyProfileMethods (object ):
106- def root (self , name , title = "" ):
106+ def plotroot (self , name , title = "" ):
107107 import ROOT
108108 if self .minBin is None or self .maxBin is None :
109109 tprofile = ROOT .TProfile (name , title , 1 , self .origin , self .origin + 1.0 )
@@ -124,7 +124,7 @@ def root(self, name, title=""):
124124 return tprofile
125125
126126class ProfileErrMethods (object ):
127- def root (self , name , title = "" ):
127+ def plotroot (self , name , title = "" ):
128128 import ROOT
129129 tprofile = ROOT .TProfile (name , title , len (self .values ), self .low , self .high )
130130 tprofile .SetBinContent (0 , self .underflow .entries * self .underflow .entries )
@@ -140,7 +140,7 @@ def root(self, name, title=""):
140140 return tprofile
141141
142142class SparselyProfileErrMethods (object ):
143- def root (self , name , title = "" ):
143+ def plotroot (self , name , title = "" ):
144144 import ROOT
145145 if self .minBin is None or self .maxBin is None :
146146 tprofile = ROOT .TProfile (name , title , 1 , self .origin , self .origin + 1.0 )
@@ -161,15 +161,15 @@ def root(self, name, title=""):
161161 return tprofile
162162
163163class StackedHistogramMethods (object ):
164- def root (self , * names ):
164+ def plotroot (self , * names ):
165165 import ROOT
166166 out = OrderedDict ()
167167 for n , (c , v ) in zip (names , self .cuts ):
168168 if isinstance (n , (list , tuple )) and len (n ) == 2 :
169169 name , title = n
170170 else :
171171 name , title = n , ""
172- out [c ] = v .root (name , title )
172+ out [c ] = v .plotroot (name , title )
173173
174174 def Draw (self , options = "" ):
175175 first = True
@@ -183,15 +183,15 @@ def Draw(self, options=""):
183183 return out
184184
185185class PartitionedHistogramMethods (object ):
186- def root (self , * names ):
186+ def plotroot (self , * names ):
187187 import ROOT
188188 out = OrderedDict ()
189189 for n , (c , v ) in zip (names , self .cuts ):
190190 if isinstance (n , (list , tuple )) and len (n ) == 2 :
191191 name , title = n
192192 else :
193193 name , title = n , ""
194- out [c ] = v .root (name , title )
194+ out [c ] = v .plotroot (name , title )
195195
196196 def Draw (self , options = "" ):
197197 first = True
@@ -205,9 +205,9 @@ def Draw(self, options=""):
205205 return out
206206
207207class FractionedHistogramMethods (object ):
208- def root (self , numeratorName , denominatorName ):
208+ def plotroot (self , numeratorName , denominatorName ):
209209 import ROOT
210- denominator = self .denominator .root (denominatorName )
210+ denominator = self .denominator .plotroot (denominatorName )
211211 num = denominator .GetNbinsX ()
212212 low = denominator .GetBinLowEdge (1 )
213213 high = denominator .GetBinLowEdge (num ) + denominator .GetBinWidth (num )
@@ -225,7 +225,7 @@ def root(self, numeratorName, denominatorName):
225225 return ROOT .TEfficiency (numerator , denominator )
226226
227227class TwoDimensionallyHistogramMethods (object ):
228- def root (self , name , title = "" , binType = "D" ):
228+ def plotroot (self , name , title = "" , binType = "D" ):
229229 import ROOT
230230 constructor = getattr (ROOT , "TH2" + binType )
231231 sample = self .values [0 ]
@@ -236,7 +236,7 @@ def root(self, name, title="", binType="D"):
236236 return th2
237237
238238class SparselyTwoDimensionallyHistogramMethods (object ):
239- def root (self , name , title = "" , binType = "D" ):
239+ def plotroot (self , name , title = "" , binType = "D" ):
240240 import ROOT
241241 constructor = getattr (ROOT , "TH2" + binType )
242242 yminBin , ymaxBin , ynum , ylow , yhigh = prepareTH2sparse (self )
0 commit comments