Bin to bin average of 2 histograms

Hello,

I’d like to know if there is a way to do an average of 2 histograms . in bin i, let the value be v_i and the error dv_i.

Is there any function
TH1::Average(const TH1* h) that calculates for each bin the average :

v_i = (v_i / dv_i^2 + h->v_i / (h->dv_i)^2) / (1/dv_i^2 + 1/(h->dv_i)^2) );

and :

dv_i = 1 / sqrt ( 1/dv_i^2 + 1/(h->dv_i)^2 )

? If this function does not exist, could it be implemented ?
thanks,

Colin

Hi Colin,

Use TH1::Add

Rene