|
[HepData-svn] r1784 - in trunk/hepdata-webapp/src/main: java/cedar/hepdata/formats java/cedar/hepdata/webapp/pages resources/cedar/hepdata/webapp/components resources/cedar/hepdata/webapp/pagesblackhole at projects.hepforge.org blackhole at projects.hepforge.orgWed Apr 16 15:12:35 BST 2014
Author: watt Date: Wed Apr 16 15:12:34 2014 New Revision: 1784 Log: Improve output of x values in InputFormatter. Corrections to ViewBase when using DOI in URL. Remove explicit email addresses in attempt to reduce spam. Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/InputFormatter.java trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/Edit.java trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/ViewBase.java trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/ViewTable.java trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/ViewTest.java trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/components/Layout.tml trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/AboutHepdata.tml trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/Form.tml trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/SubmittingData.tml Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/InputFormatter.java ============================================================================== --- trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/InputFormatter.java Tue Apr 15 17:38:41 2014 (r1783) +++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/InputFormatter.java Wed Apr 16 15:12:34 2014 (r1784) @@ -209,12 +209,27 @@ lsd = -ds.getXAxis(nx+1).getBin(i+1).getFocusLength(); } String foc = Formats.forms(ds.getXAxis(nx+1).getBin(i+1).getFocus(),msd,-lsd); - s.append(" " + foc); - // s.append(" " + ds.getXAxis(nx+1).getBin(i+1).getFocus()); - if(ds.getXAxis(nx+1).getBin(i+1).getLowValue() != null - && ds.getXAxis(nx+1).getBin(i+1).getHighValue() != null - && !ds.getXAxis(nx+1).getBin(i+1).getLowValue().equals(ds.getXAxis(nx+1).getBin(i+1).getHighValue())){ - s.append(" (BIN=" + ds.getXAxis(nx+1).getBin(i+1).getLowValue() + " TO " + ds.getXAxis(nx+1).getBin(i+1).getHighValue() + ")"); + boolean asymmfocus = false; + if (ds.getXAxis(nx+1).getBin(i+1).getLowValue() != null && ds.getXAxis(nx+1).getBin(i+1).getHighValue() != null && ds.getXAxis(nx+1).getBin(i+1).getFocus() != null) { + double diff = ds.getXAxis(nx+1).getBin(i+1).getFocus() - (ds.getXAxis(nx+1).getBin(i+1).getLowValue() + ds.getXAxis(nx+1).getBin(i+1).getHighValue()) / 2.0; + if (Math.abs(diff/ds.getXAxis(nx+1).getBin(i+1).getFocus()) > 1E-6) { + asymmfocus = true; + } + } + boolean haswidth = false; + if (ds.getXAxis(nx+1).getBin(i+1).getLowValue() != null && ds.getXAxis(nx+1).getBin(i+1).getHighValue() != null) { + double diff = ds.getXAxis(nx+1).getBin(i+1).getHighValue() - ds.getXAxis(nx+1).getBin(i+1).getLowValue(); + double mean = (ds.getXAxis(nx+1).getBin(i+1).getLowValue() + ds.getXAxis(nx+1).getBin(i+1).getHighValue()) / 2.0; + if((Math.abs(diff/mean) > 1E-6) || (mean == 0.0 && Math.abs(diff) > 1E-6)){ + haswidth = true; + } + } + if (asymmfocus && haswidth) { + s.append(" " + foc + " (BIN=" + ds.getXAxis(nx+1).getBin(i+1).getLowValue() + " TO " + ds.getXAxis(nx+1).getBin(i+1).getHighValue() + ")"); + } else if (!haswidth || ds.getXAxis(nx+1).getBin(i+1).getLowValue() == null || ds.getXAxis(nx+1).getBin(i+1).getHighValue() == null) { + s.append(" " + foc); + } else { + s.append(" " + ds.getXAxis(nx+1).getBin(i+1).getLowValue() + " TO " + ds.getXAxis(nx+1).getBin(i+1).getHighValue()); } } else { if(ds.getXAxis(nx+1).getBin(i+1).getLowValue() != null && ds.getXAxis(nx+1).getBin(i+1).getHighValue()==null){ Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/Edit.java ============================================================================== --- trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/Edit.java Tue Apr 15 17:38:41 2014 (r1783) +++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/Edit.java Wed Apr 16 15:12:34 2014 (r1784) @@ -106,7 +106,8 @@ } public StreamResponse asYODA() { Set<Dataset> ds = getDatasets(); - String asYODA = YodaFormatter.format(ds); + String stype="s"; + String asYODA = YodaFormatter.format(ds,stype); if (asYODA == null) { asYODA = "No valid paper and dataset specified"; } Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/ViewBase.java ============================================================================== --- trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/ViewBase.java Tue Apr 15 17:38:41 2014 (r1783) +++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/ViewBase.java Wed Apr 16 15:12:34 2014 (r1784) @@ -85,6 +85,7 @@ // Only initialise here, otherwise Tapestry pools the page object and session info is shared if (_params == null) _params = new TreeMap(); Matcher m = null; + Matcher mPTEP = null, mEPJC = null, mEPL = null, mJPG = null; String firstnextlast = "no"; @@ -128,16 +129,30 @@ _params.put("cds", m.group(1)); continue; } + m = Pattern.compile("\\A" + "10.1" + "(\\d+)\\Z").matcher(ps); - if (m.matches()) { - String doi=""; - for (int ii=i; ii<context.getCount(); ii++){ + mPTEP = Pattern.compile("\\A" + "10.1093" + "\\Z").matcher(ps); + mEPJC = Pattern.compile("\\A" + "10.1140" + "\\Z").matcher(ps); + mEPL = Pattern.compile("\\A" + "10.1209" + "\\Z").matcher(ps); + mJPG = Pattern.compile("\\A" + "10.1088" + "\\Z").matcher(ps); + int iimax = i+1; + if (mPTEP.matches() || mEPJC.matches()) { + iimax = i+2; + } else if (mEPL.matches()) { + iimax = i+3; + } else if (mJPG.matches()) { + iimax = i+4; + } + if (m.matches()) { + String doi=""; + for (int ii=i; ii<=iimax; ii++) { if(ii>i) { doi += "/"; } - doi += context.get(String.class, ii); - _params.put("doi",doi); - } - continue; + doi += context.get(String.class, ii); + } + _params.put("doi",doi); + continue; } + m = Pattern.compile("\\A" + "red" + "(-?\\d+)\\Z").matcher(ps); if (m.matches()) { _params.put("red", m.group(1)); Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/ViewTable.java ============================================================================== --- trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/ViewTable.java Tue Apr 15 17:38:41 2014 (r1783) +++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/ViewTable.java Wed Apr 16 15:12:34 2014 (r1784) @@ -125,7 +125,8 @@ } public StreamResponse asYODA() { Set<Dataset> ds = getDatasets(); - String asYODA = YodaFormatter.format(ds); + String stype="s"; + String asYODA = YodaFormatter.format(ds,stype); if (asYODA == null) { asYODA = "No valid paper and dataset specified"; } Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/ViewTest.java ============================================================================== --- trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/ViewTest.java Tue Apr 15 17:38:41 2014 (r1783) +++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/ViewTest.java Wed Apr 16 15:12:34 2014 (r1784) @@ -137,7 +137,8 @@ } public StreamResponse asYODA() { Set<Dataset> ds = getDatasets(); - String asYODA = YodaFormatter.format(ds); + String stype="s"; + String asYODA = YodaFormatter.format(ds,stype); if (asYODA == null) { asYODA = "No valid paper and dataset specified"; } Modified: trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/components/Layout.tml ============================================================================== --- trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/components/Layout.tml Tue Apr 15 17:38:41 2014 (r1783) +++ trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/components/Layout.tml Wed Apr 16 15:12:34 2014 (r1784) @@ -30,7 +30,7 @@ <table width="100%"> <tr> <td align="center"> - Contact us at: <a href="mailto:hepdata at projects.hepforge.org">hepdata at projects.hepforge.org</a> + Contact us at: hepdata(at)projects.hepforge.org </td> </tr> </table> Modified: trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/AboutHepdata.tml ============================================================================== --- trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/AboutHepdata.tml Tue Apr 15 17:38:41 2014 (r1783) +++ trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/AboutHepdata.tml Wed Apr 16 15:12:34 2014 (r1784) @@ -21,6 +21,7 @@ </ul> <p/> An overview of the HepData project was presented in a <a href="http://hepdata.cedar.ac.uk/resource/hepdata-aahep7.pdf">talk</a> (3 MB) at <a href="http://indico.cern.ch/event/aahep7/">AAHEP7</a> on 2nd April 2014. +<p/> </td> </tr> </table> Modified: trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/Form.tml ============================================================================== --- trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/Form.tml Tue Apr 15 17:38:41 2014 (r1783) +++ trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/Form.tml Wed Apr 16 15:12:34 2014 (r1784) @@ -83,7 +83,7 @@ database, with its in-house BDMS management system, to a new relational system using MySQL and modern Java-based tools. This will allow better long-term management of the project and also improved searching and display facilities. -Please send any comments or suggestions to <a HREF="mailto:hepdata at projects.hepforge.org">hepdata at projects.hepforge.org</a>. +Please send any comments or suggestions to hepdata(at)projects.hepforge.org. </p> </div> Modified: trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/SubmittingData.tml ============================================================================== --- trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/SubmittingData.tml Tue Apr 15 17:38:41 2014 (r1783) +++ trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/SubmittingData.tml Wed Apr 16 15:12:34 2014 (r1784) @@ -13,7 +13,7 @@ The compilers of the Reaction Database regularly scan the archives and literature to locate suitable new data sets for inclusion in the database, often contacting the experiments directly to obtain the exact numerical data. <p/> -If you have, or know of, data which you think should be in the database, then please <a href='mailto:hepdata at projects.hepforge.org'>email</a> us about this. +If you have, or know of, data which you think should be in the database, then please email us at hepdata(at)projects.hepforge.org. <p/> The criteria for data to be included is that it be data of a publishable form and not preliminary data. Data from conferences often fall into the latter category. If it is possible that data will change following peer review, it may be better to delay HepData submission until after journal acceptance. <p/> @@ -31,7 +31,7 @@ <p/> You can also include other things like <b>xfocus</b> (mean of the distribution within the bin); just specify the column definitions when submitting the data. <p/> -Any text files you send us will be processed into a standard format, which can be seen from the "input" link on any of the existing records. Data submissions provided in text formats closer to the "input" format can therefore be entered more quickly into the database. You can start by looking at the "input" file for an existing record that is similar to your submitted data. An annotated <a href="http://hepdata.cedar.ac.uk/resource/sample.input">sample input file</a> is available, as is the historical 1970s <a href="http://hepdata.cedar.ac.uk/resource/EncodingManual.pdf">encoding manual</a> (14 MB) defining some nomenclature that is still used in practice. It is useful to provide key metadata for each table such as a caption, the process being considered (initial-state and final-state particles), important kinematic cuts, and headers for the x and y columns specifying the quantity with units. Multiple x and y values can be given in the same row separated by semicolons an d non-existent entries can be indicated by dashes "-". Numerical values should be given with an appropriate and not excessive number of significant figures (in general, a maximum of 4), avoiding giving more decimal places for the errors than the central values. An <a href='http://hepdata.cedar.ac.uk/resource-cgi/input'>online form</a> is available to test data input. Click on "Browse..." to select your input file, followed by "Upload" and "Process", then click "Display" for the first 10 tables, or "All" for the whole record. Please note that this <a href='http://hepdata.cedar.ac.uk/resource-cgi/input'>online form</a> is only for testing purposes, and the final submittal to HepData must still be done by <a href='mailto:hepdata at projects.hepforge.org'>email</a>. +Any text files you send us will be processed into a standard format, which can be seen from the "input" link on any of the existing records. Data submissions provided in text formats closer to the "input" format can therefore be entered more quickly into the database. You can start by looking at the "input" file for an existing record that is similar to your submitted data. An annotated <a href="http://hepdata.cedar.ac.uk/resource/sample.input">sample input file</a> is available, as is the historical 1970s <a href="http://hepdata.cedar.ac.uk/resource/EncodingManual.pdf">encoding manual</a> (14 MB) defining some nomenclature that is still used in practice. It is useful to provide key metadata for each table such as a caption, the process being considered (initial-state and final-state particles), important kinematic cuts, and headers for the x and y columns specifying the quantity with units. Multiple x and y values can be given in the same row separated by semicolons an d non-existent entries can be indicated by dashes "-". Numerical values should be given with an appropriate and not excessive number of significant figures (in general, a maximum of 4), avoiding giving more decimal places for the errors than the central values. An <a href='http://hepdata.cedar.ac.uk/resource-cgi/input'>online form</a> is available to test data input. Click on "Browse..." to select your input file, followed by "Upload" and "Process", then click "Display" for the first 10 tables, or "All" for the whole record. Please note that this <a href='http://hepdata.cedar.ac.uk/resource-cgi/input'>online form</a> is only for testing purposes, and the final submittal to HepData must still be done by email. </td> </tr> </table>
More information about the HepData-svn mailing list |