parameters: ( objects, masks, deltaRMin )
return_statement: return cleanObjects
docstring: Masks objects using a deltaR cut, another algorithm (same results).
docstring_summary: Masks objects using a deltaR cut, another algorithm (same results).
docstring_tokens: Masks objects using a deltaR cut another algorithm ( same results ) .
function: def cleanObjectCollection2( objects, masks, deltaRMin ):
      '''Masks objects using a deltaR cut, another algorithm (same results).'''
      if len(objects)==0:
          return objects
      deltaR2Min = deltaRMin*deltaRMin
      cleanObjects = copy.copy( objects )
      for mask in masks:
          tooClose = []
          for idx, object in enumerate(cleanObjects):
              dR2 = deltaR2( object.eta(), object.phi(),
                             mask.eta(), mask.phi() )
              if dR2 < deltaR2Min:
                  tooClose.append( idx )
          nRemoved = 0
          for idx in tooClose:
              # yes, everytime an object is removed, the list of objects is updated
              # so need to update the index accordingly.
              # example: to remove : ele 1 and 2
              #  first, ele 1 is removed
              #  -> ele 2 is now at index 1
              # one should again remove the element at index 1
              idx -= nRemoved
              del cleanObjects[idx]
              nRemoved += 1 
      return cleanObjects
function_tokens: def cleanObjectCollection2 ( objects , masks , deltaRMin ) : if len ( objects ) == 0 : return objects deltaR2Min = deltaRMin * deltaRMin cleanObjects = copy . copy ( objects ) for mask in masks : tooClose = [ ] for idx , object in enumerate ( cleanObjects ) : dR2 = deltaR2 ( object . eta ( ) , object . phi ( ) , mask . eta ( ) , mask . phi ( ) ) if dR2 < deltaR2Min : tooClose . append ( idx ) nRemoved = 0 for idx in tooClose : # yes, everytime an object is removed, the list of objects is updated # so need to update the index accordingly. # example: to remove : ele 1 and 2 #  first, ele 1 is removed #  -> ele 2 is now at index 1 # one should again remove the element at index 1 idx -= nRemoved del cleanObjects [ idx ] nRemoved += 1 return cleanObjects