[HepData-svn] r1374 - trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/components

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Wed Aug 11 14:55:36 BST 2010


Author: whalley
Date: Wed Aug 11 14:55:35 2010
New Revision: 1374

Log:
a couple of tweak to do with sqrts and asymmetric errors

Modified:
   trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/components/DatasetAsHtml.java

Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/components/DatasetAsHtml.java
==============================================================================
--- trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/components/DatasetAsHtml.java	Thu Jul 29 16:02:32 2010	(r1373)
+++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/components/DatasetAsHtml.java	Wed Aug 11 14:55:35 2010	(r1374)
@@ -75,7 +75,6 @@
             for (Property property : y.getProperties()) {
                 j++;
                 String tempstr = property.getName().toString();
-                if(!tempstr.startsWith("sqrts")){
                     tempstr = tempstr.concat(" : ");
                     if (property.getFocus() != null){
                          tempstr = tempstr.concat(property.getFocus().toString());
@@ -95,12 +94,15 @@
                         tempstr = tempstr.concat(property.getUnit().toString());
                     }
                     storelist.add(tempstr);
-                }        
-            
             }
             Collections.sort(storelist);
+            int ij=-1;
             for (int i=0; i<storelist.size(); i++){
-                store[numy][i] = storelist.get(i);
+                if(i>0 && storelist.get(i).equals(storelist.get(i-1))){ nprop -= 1;}
+                else{
+                    ij += 1;
+                    store[numy][ij] = storelist.get(i).replaceFirst("sqrts","SQRT(S)");
+                } 
             }
         }
 
@@ -314,7 +316,8 @@
                                     writer.write(e.getNormType().toSymbol());
                                 } else {
                                     vale = new SignificantFigures(e.getPlus());
-                                    writer.write("+");
+                                    if(e.getPlus() > e.getMinus()) { writer.write("+"); }
+                                    else                           { writer.write(""); }
                                     if (e.getNormType() == ErrorNorm.PCT) {
                                         lsd = vale.getLSD();
                                     }
@@ -323,7 +326,8 @@
                                     writer.write(Formats.forms(e.getPlus(), msd, -lsd));
                                     writer.write(e.getNormType().toSymbol());
                                     vale = new SignificantFigures(e.getMinus());
-                                    writer.writeRaw(",-");
+                                    if(e.getPlus() > e.getMinus()) { writer.writeRaw(",-");}
+                                    else                           { writer.write(",+"); }
                                     if (e.getNormType() == ErrorNorm.PCT) {
                                         lsd = vale.getLSD();
                                     }


More information about the HepData-svn mailing list