Generic method for scalar products, based on integrate
.scalarProduct(object1, object2, ...)
object1, object2
...
integrate