Profile Histograms

Profile histograms are implemented both with fixed and variable partitions. The bin errors are computed as in HBOOK, but only the ' ' and 'S' options are supported (see the HBOOK manual for a definition of these options and the associated error calculation). However, unlike in HBOOK these are not a booking time options; you can ask each bin to compute either the Spread or the Spread/sqrt(N) error at run-time.

HepRef(PProfileHisto) histo = new (db_) PProfileHisto("Profile",20,0.,1.); 
long i; 
double x; 
for( i=0; i<50000; i++ ) { 
  x = drand48(); 
  histo->fill(x,x,1.); 
} 

for( i=0; i<histo->bin_count(); i++ ) { 
  cout << endl << ". " << setw(2) << i << ": " 
<< setw(9) << histo->i_bin(i).value() << " Error " 
<< setw(4) << histo->i_bin(i).error(0) << " Spread Error " 
<< setw(4) << histo->i_bin(i).error(1); 
} 

As you can see the error() method on the bin interface allows to access a set of errors: in this case the Profile_Bin class accepts either the 0 or 1 index, which map respectively to Spread/sqrt(N) and Spread errors.

Profile histograms can be filled with weights, but use of negative weights yield meaningless results. With weights different from 1. the errors are calculated properly only for bins with non-zero spread, and set to 0. for bins with zero spread (HBOOK-like).