test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Attributes
utils_v2.StatisticalTest Class Reference

StatisticalTests. More...

Inheritance diagram for utils_v2.StatisticalTest:
utils_v2.Chi2Test utils_v2.KolmogorovTest

Public Member Functions

def do_test
 
def get_N_bins
 
def is_empty
 

Static Public Attributes

 name = None
 

Detailed Description

StatisticalTests.

Definition at line 299 of file utils_v2.py.

Member Function Documentation

def utils_v2.StatisticalTest.do_test (   self,
  h1,
  h2 
)

Definition at line 316 of file utils_v2.py.

References utils_v2.StatisticalTest.get_N_bins(), DEutils< T >.is_empty(), DEcompare< T >.is_empty(), dirstructure.Directory.is_empty(), create_public_lumi_plots.LumiDataBlock.is_empty(), and utils_v2.StatisticalTest.is_empty().

317  def do_test(self, h1, h2):
318  if not h1 or not h2:
319  raise ComparisonError('Missing histogram')
320  if type(h1) != type(h2):
321  return -104 # raise ComparisonError('Histograms have different types')
322  if not h1.InheritsFrom('TH1'):
323  return -105 # raise ComparisonError('Object is not a histogram')
324  if self.is_empty(h1) or self.is_empty(h2):
325  return 1
326  h1_bins = self.get_N_bins(h1)
327  if h1_bins != self.get_N_bins(h2):
328  return -103 # raise CoparisonError('Ranges of histograms are different')
329 
def utils_v2.StatisticalTest.get_N_bins (   self,
  h 
)

Definition at line 302 of file utils_v2.py.

Referenced by utils_v2.StatisticalTest.do_test(), utils_v2.Chi2Test.do_test(), and utils_v2.StatisticalTest.is_empty().

303  def get_N_bins(self, h):
304  x = h.GetNbinsX()
305  y = h.GetNbinsY()
306  z = h.GetNbinsZ()
307  if not (y and z): # Is this realy necessary?
308  return 0
309  return (x + 1) * (y + 1) * (z + 1)
def utils_v2.StatisticalTest.is_empty (   self,
  h 
)

Definition at line 310 of file utils_v2.py.

References utils_v2.StatisticalTest.get_N_bins().

Referenced by utils_v2.StatisticalTest.do_test().

311  def is_empty(self, h):
312  for i in xrange(1, self.get_N_bins(h)):
313  if h.GetBinContent(i) != 0:
314  return False
315  return True

Member Data Documentation

utils_v2.StatisticalTest.name = None
static

Definition at line 300 of file utils_v2.py.

Referenced by cuy.divideElement.__init__(), cuy.plotElement.__init__(), cuy.additionElement.__init__(), cuy.superimposeElement.__init__(), cuy.graphElement.__init__(), config.CFG.__str__(), validation.Sample.digest(), VIDSelectorBase.VIDSelectorBase.initialize(), and Vispa.Views.PropertyView.Property.valueChanged().