Bin errors

Bin errors are always computed taking weights into account.

error = sqrt( SUM[ weight*weight ])

Bin error "propagation" for histogram operations

Depending on histogram operations, bin errors are combined in the error of the resulting bin. Formulas should be equivalent to the ones used in HBOOK.

Synopsis

error_

error of the first bin, other.error() is the error of the second bin;

value_

value of the first bin, other.value() is the error of the second bin.

 void add( const Like_Parent &other ) 
  error_ =  other.error()*other.error() + error_ ; 

void sub( const Like_Parent &other ) 
  error_ = other.error() * other.error() + error_ ; 

void mul( const Like_Parent &other ) 
  error_ = error_ * other.value()*other.value() +  
           other.error()*other.error() * value_*value_ ; 

void div( const Like_Parent &other ) 
  e = pow(other.error(),4) ;
  error_ = error_ * other.value()*other.value() +  
           other.error()*other.error() * value_*value_ ; 
  if( e != 0 ) 
    error_ = ( error_/e ); 

void binomial_div( const Like_Parent &other ) 
  e = other.error()*other.error() ;
  error_ = sqrt( error_ / e ); 
  error_ = error_ * (1-error_); 
  error_ = error_ * error_; 
  error_ = ( error_ / e );