parameters: (self, tdirectory)
return_statement: return ret
docstring: Create and return the fake+duplicate histogram from a TDirectory
docstring_summary: Create and return the fake+duplicate histogram from a TDirectory
docstring_tokens: Create and return the fake + duplicate histogram from a TDirectory
function: def create(self, tdirectory):
          """Create and return the fake+duplicate histogram from a TDirectory"""
          histoA = _getObject(tdirectory, self._nameA)
          histoB = _getObject(tdirectory, self._nameB)
  
          if not histoA or not histoB:
              return None
  
          ret = histoA.Clone(self._name)
          ret.SetTitle(self._title)
  
          # Disable canExtend if it is set, otherwise setting the
          # overflow bin will extend instead, possibly causing weird
          # effects downstream
          ret.SetCanExtend(False)
  
          for i in range(0, histoA.GetNbinsX()+2): # include under- and overflow too
              val = histoA.GetBinContent(i)-histoB.GetBinContent(i)
              ret.SetBinContent(i, val)
              ret.SetBinError(i, math.sqrt(val))
  
          return ret
function_tokens: def create ( self , tdirectory ) : histoA = _getObject ( tdirectory , self . _nameA ) histoB = _getObject ( tdirectory , self . _nameB ) if not histoA or not histoB : return None ret = histoA . Clone ( self . _name ) ret . SetTitle ( self . _title ) # Disable canExtend if it is set, otherwise setting the # overflow bin will extend instead, possibly causing weird # effects downstream ret . SetCanExtend ( False ) for i in range ( 0 , histoA . GetNbinsX ( ) + 2 ) : # include under- and overflow too val = histoA . GetBinContent ( i ) - histoB . GetBinContent ( i ) ret . SetBinContent ( i , val ) ret . SetBinError ( i , math . sqrt ( val ) ) return ret