Code to find Ave+std of the backgnd
code to plot intensity historgram