21 const unsigned int nbins_x_widened = nbins_x + 2;
22 const unsigned int nbins_y_widened = nbins_y + 2;
24 if((nbins_x_widened*nbins_y_widened) != cont.size()){
25 std::cout<<
"ERROR in xAOD::sumEntries: nbins and container size don't match!!"<<std::endl;
28 if(nbins_x*nbins_y == 0 ){
29 std::cout<<
"ERROR in xAOD::sumEntries: nbins_x * nbins_y = 0"<<std::endl;
31 unsigned int ibin(0), ibin_x(0), ibin_y(0), ibin_x_selected(0), ibin_y_selected(0);
32 const float binWidth_x = (max_x - min_x)/((
float)nbins_x);
33 const float binWidth_y = (max_y - min_y)/((
float)nbins_y);
40 else if( !(value_x < max_x) ) {
44 while(value_x > (ibin_x*binWidth_x+min_x) && ibin_x <= nbins_x) {
53 else if( !(value_y < max_y) ) {
57 while(value_y > (ibin_y*binWidth_y+min_y) && ibin_y <= nbins_y) {
63 ibin_x_selected = ibin_x;
66 ibin_y_selected = ibin_y;
69 for(ibin_x = 0; ibin_x <= ibin_x_selected; ibin_x++) {
70 for(ibin_y = 0; ibin_y <= ibin_y_selected; ibin_y++) {
71 ibin = ibin_y*(nbins_x_widened) + ibin_x;
77 for(ibin_x = ibin_x_selected; ibin_x < nbins_x_widened; ibin_x++) {
78 for(ibin_y = 0; ibin_y <= ibin_y_selected; ibin_y++) {
79 ibin = ibin_y*(nbins_x_widened) + ibin_x;
85 for(ibin_x = 0; ibin_x <= ibin_x_selected; ibin_x++) {
86 for(ibin_y = ibin_y_selected; ibin_y < nbins_y_widened; ibin_y++) {
87 ibin = ibin_y*(nbins_x_widened) + ibin_x;
93 for(ibin_x = ibin_x_selected; ibin_x < nbins_x_widened; ibin_x++) {
94 for(ibin_y = ibin_y_selected; ibin_y < nbins_y_widened; ibin_y++) {
95 ibin = ibin_y*(nbins_x_widened) + ibin_x;