code: def find_all_primitives(pad):
      
      result = []
      for primitive in pad.GetListOfPrimitives():
          result.append(primitive)
          if hasattr(primitive, "GetListOfFunctions"):
              result.extend(primitive.GetListOfFunctions())
          if hasattr(primitive, "GetHistogram"):
              p = primitive.GetHistogram()
              if p:
                  result.append(p)
          if isinstance(primitive, ROOT.TPad):
              result.extend(find_all_primitives(primitive))
      return result
docs: Recursively find all primities on a pad, even those hiding behind a
      GetListOfFunctions() of a primitive