Exemple #1
0
 public void divide(H2D h) {
   if (h.getXAxis().getNBins() == this.getXAxis().getNBins()
       && h.getYAxis().getNBins() == this.getYAxis().getNBins()) {
     for (int loop = 0; loop < this.hBuffer.length; loop++) {
       if (h.hBuffer[loop] == 0) {
         this.hBuffer[loop] = 0.0;
       } else {
         this.hBuffer[loop] = this.hBuffer[loop] / h.hBuffer[loop];
       }
     }
   } else {
     System.err.println("[H2D::divide] error the bins in 2d histogram do not match");
   }
 }
Exemple #2
0
 public void add(H2D h) {
   if (h.getXAxis().getNBins() == this.getXAxis().getNBins()
       && h.getYAxis().getNBins() == this.getYAxis().getNBins()) {
     for (int loop = 0; loop < this.hBuffer.length; loop++) {
       this.hBuffer[loop] = this.hBuffer[loop] + h.hBuffer[loop];
     }
   } else {
     System.out.println(
         "[warning] ---> error adding histograms "
             + this.getName()
             + "  "
             + h.getName()
             + ". inconsistent bin numbers");
   }
 }