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

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Tue May 5 19:11:15 BST 2015


Author: watt
Date: Tue May  5 19:11:15 2015
New Revision: 1860

Log:
More careful treatment of sign of statistical uncertainty

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	Tue May  5 19:07:41 2015	(r1859)
+++ trunk/hepdata-model/src/main/java/cedar/hepdata/model/Point.java	Tue May  5 19:11:15 2015	(r1860)
@@ -298,7 +298,13 @@
           if(err.getSourceType() == ErrorSource.STAT){ 
             try {
                 Uncertainty abserr = err.getAbsoluteError(this);
-                errorPlusSq += abserr.getPlus() * abserr.getPlus();
+
+		// G.W. 05/05/2015: plus = max(abserr.getPlus(),abserr.getMinus(),0.0);
+		double plus = 0.0;
+		if (abserr.getPlus() > plus) { plus = abserr.getPlus(); }
+		if (abserr.getMinus() > plus) { plus = abserr.getMinus(); }
+
+                errorPlusSq += plus*plus;
             } catch (HDException ex) {
                 //
             }
@@ -314,7 +320,13 @@
           if(err.getSourceType() == ErrorSource.STAT){ 
             try {
                 Uncertainty abserr = err.getAbsoluteError(this);
-                errorMinusSq += abserr.getMinus() * abserr.getMinus();
+
+		// G.W. 05/05/2015: minus = min(abserr.getMinus(),abserr.getPlus(),0.0);
+		double minus = 0.0;
+		if (abserr.getMinus() < minus) { minus = abserr.getMinus(); }
+		if (abserr.getPlus() < minus) { minus = abserr.getPlus(); }
+
+                errorMinusSq += minus*minus;
             } catch (HDException ex) {
                 //
             }


More information about the HepData-svn mailing list