|
[HepData-svn] r1443 - trunk/hepdata-model/src/main/java/cedar/hepdata/modelblackhole at projects.hepforge.org blackhole at projects.hepforge.orgWed Mar 2 11:04:47 GMT 2011
Author: whalley Date: Wed Mar 2 11:04:47 2011 New Revision: 1443 Log: adding stat errors to root output 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 Feb 15 16:02:14 2011 (r1442) +++ trunk/hepdata-model/src/main/java/cedar/hepdata/model/Point.java Wed Mar 2 11:04:47 2011 (r1443) @@ -273,6 +273,38 @@ ////////////////////////////////////////////////////////// + /** Plus statistical error */ + public Double getStatPlusError() { + double errorPlusSq = 0.0; + for (Uncertainty err : getAllErrors()) { + if(err.getSourceType() == ErrorSource.STAT){ + try { + Uncertainty abserr = err.getAbsoluteError(this); + errorPlusSq += abserr.getPlus() * abserr.getPlus(); + } catch (HDException ex) { + // + } + } + } + return Math.sqrt(errorPlusSq); + } + + /** Minus statistical error */ + public Double getStatMinusError() { + double errorMinusSq = 0.0; + for (Uncertainty err : getAllErrors()) { + if(err.getSourceType() == ErrorSource.STAT){ + try { + Uncertainty abserr = err.getAbsoluteError(this); + errorMinusSq += abserr.getMinus() * abserr.getMinus(); + } catch (HDException ex) { + // + } + } + } + return Math.sqrt(errorMinusSq); + } + /** Plus error combined in quadrature (uncorrelated). */ public Double getQuadCombinedPlusError() { double errorPlusSq = 0.0;
More information about the HepData-svn mailing list |