def RenormalizeFunction(func,z_min,z_max):
	"""
	It re-normalizes the Function in the new limits (z_min,z_max).
	We assume that region of the function definition will be cut not extended.
	"""
	spline = SplineCH()					
	spline.compile(func)	
	integrator = GaussLegendreIntegrator(500)
	integrator.setLimits(z_min,z_max)
	integral = integrator.integral(spline)
	n_points = func.getSize()
	step = (z_max - z_min)/(n_points-1)
	new_func = Function()
	for i in range(n_points):
		x = z_min + step*i
		y = spline.getY(x)/integral
		new_func.add(x,y)
	new_func.setConstStep(1)
	return new_func