[HepData-svn] r1804 - trunk/hepdata-model/src/main/java/cedar/hepdata/model

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Fri Jul 11 18:58:45 BST 2014


Author: watt
Date: Fri Jul 11 18:58:45 2014
New Revision: 1804

Log:
Account for systematic uncertainties with flipped sign when combining in quadrature

Modified:
   trunk/hepdata-model/src/main/java/cedar/hepdata/model/Point.java

Modified: trunk/hepdata-model/src/main/java/cedar/hepdata/model/Point.java
==============================================================================
--- trunk/hepdata-model/src/main/java/cedar/hepdata/model/Point.java	Fri Jul 11 18:55:21 2014	(r1803)
+++ trunk/hepdata-model/src/main/java/cedar/hepdata/model/Point.java	Fri Jul 11 18:58:45 2014	(r1804)
@@ -330,8 +330,13 @@
         for (Uncertainty err : getAllErrors()) {
             try {
                 Uncertainty abserr = err.getAbsoluteError(this);
-                if(err.getSourceType() == ErrorSource.TOTAL){ totalPlusSq += abserr.getPlus() * abserr.getPlus(); }
-                else { errorPlusSq += abserr.getPlus() * abserr.getPlus(); }
+                if (err.getSourceType() == ErrorSource.TOTAL) {
+		    if (abserr.getPlus() < 0.0) { totalPlusSq += abserr.getMinus() * abserr.getMinus(); }
+		    else { totalPlusSq += abserr.getPlus() * abserr.getPlus(); }
+		} else {
+		    if (abserr.getPlus() < 0.0) { errorPlusSq += abserr.getMinus() * abserr.getMinus(); }
+		    else { errorPlusSq += abserr.getPlus() * abserr.getPlus(); }
+		}
             } catch (HDException ex) {
                 //
             }
@@ -348,8 +353,13 @@
         for (Uncertainty err : getAllErrors()) {
             try {
                 Uncertainty abserr = err.getAbsoluteError(this);
-                if(err.getSourceType() == ErrorSource.TOTAL){ totalMinusSq += abserr.getMinus() * abserr.getMinus(); }
-                else { errorMinusSq += abserr.getMinus() * abserr.getMinus(); }
+                if (err.getSourceType() == ErrorSource.TOTAL) {
+		    if (abserr.getPlus() < 0.0) { totalMinusSq += abserr.getPlus() * abserr.getPlus(); }
+		    else { totalMinusSq += abserr.getMinus() * abserr.getMinus(); }
+		} else {
+		    if (abserr.getPlus() < 0.0) { errorMinusSq += abserr.getPlus() * abserr.getPlus(); }
+		    else { errorMinusSq += abserr.getMinus() * abserr.getMinus(); }
+		}
             } catch (HDException ex) {
                 //
             }


More information about the HepData-svn mailing list