Commit in java/branches/hps-java_HPSJAVA-88 on MAIN
analysis/pom.xml-51139 -> 1140
analysis/src/main/java/org/hps/analysis/dataquality/TrackingResiduals.java+50-301139 -> 1140
conditions/pom.xml-51139 -> 1140
conditions/src/main/java/org/hps/conditions/deprecated/CalibrationDriver.java+4-41139 -> 1140
conditions/src/test/java/org/hps/conditions/ConditionsDevTest.java+1-11139 -> 1140
                                           /ConditionsDriverTest.java+2-21139 -> 1140
conditions/src/test/java/org/hps/conditions/beam/BeamCurrentTest.java+2-21139 -> 1140
conditions/src/test/java/org/hps/conditions/ecal/PhysicalToGainTest.java+2-21139 -> 1140
datacat/pom.xml+1-61139 -> 1140
detector-data/detectors/HPSTestRunTracker2014-v0/HPSTestRunTracker2014-v0.lcdd+4659-2621139 -> 1140
                                                /compact.xml+79-51139 -> 1140
detector-data/pom.xml-51139 -> 1140
distribution/pom.xml+2-81139 -> 1140
ecal-readout-sim/pom.xml-51139 -> 1140
ecal-recon/pom.xml-101139 -> 1140
ecal-recon/src/main/java/org/hps/recon/ecal/EcalClusterIC.java+208-1161139 -> 1140
                                           /HPSEcalClusterIC.java+98-181139 -> 1140
integration-tests/pom.xml+32-121139 -> 1140
integration-tests/src/test/java/org/hps/EcalReadoutSimTest.java+12-91139 -> 1140
                                       /EtSystemTest.java+12-71139 -> 1140
                                       /GenerateEcalReadoutSimData.java-361139 removed
                                       /MockDataReconTest.java+6-101139 -> 1140
monitoring-app/pom.xml+1-21139 -> 1140
monitoring-app/src/main/java/org/hps/monitoring/gui/AbstractFieldsPanel.java+3-11139 -> 1140
                                                   /Commands.java+24-241139 -> 1140
                                                   /DataSourcePanel.java+46-391139 -> 1140
                                                   /ErrorHandler.java+3-41139 -> 1140
                                                   /Main.java+11139 -> 1140
                                                   /MonitoringApplication.java+466-2751139 -> 1140
                                                   /PlotFrame.java-291139 removed
                                                   /RunPanel.java+1-11139 -> 1140
                                                   /SystemStatusFrame.java-1701139 removed
monitoring-app/src/main/java/org/hps/monitoring/gui/model/AbstractModel.java+12-11139 -> 1140
                                                         /Configuration.java+9-11139 -> 1140
                                                         /ConfigurationModel.java+67-41139 -> 1140
                                                         /RunModel.java+1-11139 -> 1140
monitoring-app/src/main/java/org/hps/monitoring/plotting/MonitoringPlotFactory.java+12-71139 -> 1140
monitoring-app/src/test/java/org/hps/monitoring/subsys/et/EtSystemMonitorTest.java-681139 removed
parent/pom.xml+51139 -> 1140
plugin/pom.xml+1-11139 -> 1140
plugin/src/main/java/org/hps/plugin/HPSPlugin.java+1-11139 -> 1140
recon/pom.xml-191139 -> 1140
record-util/src/main/java/org/hps/record/AbstractRecordQueue.java+1-11139 -> 1140
record-util/src/main/java/org/hps/record/composite/CompositeLoop.java+14-211139 -> 1140
                                                  /CompositeLoopAdapter.java+11139 -> 1140
                                                  /CompositeLoopConfiguration.java+11139 -> 1140
                                                  /EventProcessingThread.java+21-231139 -> 1140
steering-files/pom.xml-41139 -> 1140
steering-files/src/main/resources/org/hps/steering/monitoring/DummyMonitoring.lcsim-121139 removed
                                                             /MonitoringTest.lcsim-91139 removed
steering-files/src/main/resources/org/hps/steering/production/DataQualityRecon.lcsim+5-11139 -> 1140
steering-files/src/main/resources/org/hps/steering/readout/HPS2014ReadoutToLcio.lcsim+1-11139 -> 1140
steering-files/src/main/resources/org/hps/steering/recon/GBLReco.lcsim+1-11139 -> 1140
                                                        /HPS2014OfflineRecon.lcsim+6-31139 -> 1140
                                                        /HPS2014OfflineTruthRecon.lcsim+6-31139 -> 1140
steering-files/src/main/resources/org/hps/steering/users/phansson/HPSTrackingDefaults.lcsim+46-251139 -> 1140
                                                                 /TestRunReadoutToLcio.lcsim+59-121139 -> 1140
                                                                 /TwoTrackAnalysis.lcsim+14-91139 -> 1140
tracking/pom.xml-111139 -> 1140
tracking/src/main/java/org/hps/readout/svt/SimpleSvtReadout.java+6-11139 -> 1140
tracking/src/main/java/org/hps/recon/tracking/MaterialSupervisor.java+127-651139 -> 1140
                                             /TrackerDigiDriver.java+4-21139 -> 1140
                                             /TrackerReconDriver.java+31-151139 -> 1140
users/src/main/java/org/hps/users/mgraham/ElwinsTrackingRecon.java-15701139 removed
                                         /ExamplePlotter.java+1-11139 -> 1140
                                         /TwoTrackAnalysis.java+1-11139 -> 1140
users/src/main/java/org/hps/users/phansson/TrackingGeometryChecker.java+601139 -> 1140
users/src/test/java/org/hps/users/ngraf/RotationMatrixTest.java+2-21139 -> 1140
util/pom.xml-101139 -> 1140
+6231-3011
7 removed + 62 modified, total 69 files
Merge trunk changes r936:1139 into hps-java_HPSJAVA-88

java/branches/hps-java_HPSJAVA-88/analysis
pom.xml 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/analysis/pom.xml	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/analysis/pom.xml	2014-10-06 19:40:35 UTC (rev 1140)
@@ -1,29 +1,24 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-    
     <modelVersion>4.0.0</modelVersion>
     <artifactId>hps-analysis</artifactId>
     <name>analysis</name>
     <description>HPS analysis code</description>
-    
     <parent>
         <groupId>org.hps</groupId>
         <artifactId>hps-parent</artifactId>
         <relativePath>../parent/pom.xml</relativePath>
         <version>3.0.3-SNAPSHOT</version>
     </parent>
-    
     <scm>
         <url>http://java.freehep.org/svn/repos/hps/list/java/trunk/analysis/</url>
         <connection>scm:svn:svn://svn.freehep.org/hps/java/trunk/analysis/</connection>
         <developerConnection>scm:svn:svn://svn.freehep.org/hps/java/trunk/analysis/</developerConnection>
     </scm>
-    
     <dependencies>
         <dependency>
             <groupId>org.hps</groupId>
             <artifactId>hps-recon</artifactId>
         </dependency>
     </dependencies>
-    
 </project>

java/branches/hps-java_HPSJAVA-88/analysis/src/main/java/org/hps/analysis/dataquality
TrackingResiduals.java 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/analysis/src/main/java/org/hps/analysis/dataquality/TrackingResiduals.java	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/analysis/src/main/java/org/hps/analysis/dataquality/TrackingResiduals.java	2014-10-06 19:40:35 UTC (rev 1140)
@@ -13,6 +13,7 @@
 import java.util.Map;
 import java.util.logging.Level;
 import java.util.logging.Logger;
+import org.hps.recon.tracking.gbl.GBLStripClusterData;
 import org.lcsim.event.EventHeader;
 import org.lcsim.event.GenericObject;
 import org.lcsim.geometry.Detector;
@@ -28,6 +29,7 @@
     // Collection Names
     String trackTimeDataCollectionName = "TrackTimeData";
     String trackResidualsCollectionName = "TrackResiduals";
+    String gblStripClusterDataCollectionName = "GBLStripClusterData";
 
     int nEvents = 0;
 
@@ -35,6 +37,7 @@
     String[] trackingQuantNames = {};
     int nmodules = 6;
     private String posresDir = "PostionResiduals/";
+    private String uresDir = "UResiduals/";
     private String timeresDir = "TimeResiduals/";
     private Map<String, Double> xposTopMeanResidMap;
     private Map<String, Double> yposTopMeanResidMap;
@@ -52,15 +55,17 @@
 
         aida.tree().cd("/");
         resetOccupancyMap();
-        for (int i = 0; i < nmodules; i++) {
-            IHistogram1D xresid = aida.histogram1D(plotDir + posresDir + "Module " + i + "Top x Residual", 50,-getRange(i,true),getRange(i,true));
-            IHistogram1D yresid = aida.histogram1D(plotDir + posresDir + "Module " + i + "Top y Residual", 50,-getRange(i,false),getRange(i,false));
-            IHistogram1D xresidbot = aida.histogram1D(plotDir + posresDir + "Module " + i + "Bot x Residual", 50,-getRange(i,true),getRange(i,true));
-            IHistogram1D yresidbot = aida.histogram1D(plotDir + posresDir + "Module " + i + "Bot y Residual", 50,-getRange(i,false),getRange(i,false));
+        for (int i = 1; i <= nmodules; i++) {
+            IHistogram1D xresid = aida.histogram1D(plotDir + posresDir + "Module " + i + " Top x Residual", 50, -getRange(i, true), getRange(i, true));
+            IHistogram1D yresid = aida.histogram1D(plotDir + posresDir + "Module " + i + " Top y Residual", 50, -getRange(i, false), getRange(i, false));
+            IHistogram1D xresidbot = aida.histogram1D(plotDir + posresDir + "Module " + i + " Bot x Residual", 50, -getRange(i, true), getRange(i, true));
+            IHistogram1D yresidbot = aida.histogram1D(plotDir + posresDir + "Module " + i + " Bot y Residual", 50, -getRange(i, false), getRange(i, false));
         }
 
-        for (int i = 0; i < nmodules * 2; i++) {
+        for (int i = 1; i <= nmodules * 2; i++) {
             IHistogram1D tresid = aida.histogram1D(plotDir + timeresDir + "HalfModule " + i + " t Residual", 50, -20, 20);
+            IHistogram1D utopresid = aida.histogram1D(plotDir + uresDir + "HalfModule " + i + " Top u Residual", 50, -getRange((i + 1) / 2, false), getRange((i + 1) / 2, false));
+            IHistogram1D ubotresid = aida.histogram1D(plotDir + uresDir + "HalfModule " + i + " Bot u Residual", 50, -getRange((i + 1) / 2, false), getRange((i + 1) / 2, false));
         }
     }
 
@@ -76,23 +81,39 @@
         for (GenericObject trd : trdList) {
             int nResid = trd.getNDouble();
             int isBot = trd.getIntVal(trd.getNInt() - 1);//last Int is the top/bottom flag
-            for (int i = 0; i < nResid; i++)
+            for (int i = 1; i <= nResid; i++)
+
                 if (isBot == 1) {
-                    aida.histogram1D(plotDir + posresDir + "Module " + i + "Bot x Residual").fill(trd.getDoubleVal(i));//x is the double value in the generic object
-                    aida.histogram1D(plotDir + posresDir + "Module " + i + "Bot y Residual").fill(trd.getFloatVal(i));//y is the float value in the generic object
+                    aida.histogram1D(plotDir + posresDir + "Module " + i + " Bot x Residual").fill(trd.getDoubleVal(i - 1));//x is the double value in the generic object
+                    aida.histogram1D(plotDir + posresDir + "Module " + i + " Bot y Residual").fill(trd.getFloatVal(i - 1));//y is the float value in the generic object
                 } else {
-                    aida.histogram1D(plotDir + posresDir + "Module " + i + "Top x Residual").fill(trd.getDoubleVal(i));//x is the double value in the generic object
-                    aida.histogram1D(plotDir + posresDir + "Module " + i + "Top y Residual").fill(trd.getFloatVal(i));//y is the float value in the generic object                    
+                    aida.histogram1D(plotDir + posresDir + "Module " + i + " Top x Residual").fill(trd.getDoubleVal(i - 1));//x is the double value in the generic object
+                    aida.histogram1D(plotDir + posresDir + "Module " + i + " Top y Residual").fill(trd.getFloatVal(i - 1));//y is the float value in the generic object                    
                 }
-
         }
 
         List<GenericObject> ttdList = event.get(GenericObject.class, trackTimeDataCollectionName);
         for (GenericObject ttd : ttdList) {
             int nResid = ttd.getNDouble();
-            for (int i = 0; i < nResid; i++)
-                aida.histogram1D(plotDir + timeresDir + "HalfModule " + i + " t Residual").fill(ttd.getDoubleVal(i));//x is the double value in the generic object               
+            for (int i = 1; i <= nResid; i++)
+                aida.histogram1D(plotDir + timeresDir + "HalfModule " + i + " t Residual").fill(ttd.getDoubleVal(i - 1));//x is the double value in the generic object               
         }
+        if (!event.hasCollection(GenericObject.class, gblStripClusterDataCollectionName))
+            return;
+        List<GenericObject> gblSCDList = event.get(GenericObject.class, gblStripClusterDataCollectionName);
+        for (GenericObject gblSCD : gblSCDList) {
+            double umeas = gblSCD.getDoubleVal(15);//TODO:  implement generic methods into GBLStripClusterData so this isn't hard coded
+            double utrk = gblSCD.getDoubleVal(16);//implement generic methods into GBLStripClusterData so this isn't hard coded
+            double resid = umeas - utrk;
+            double tanlambda = gblSCD.getDoubleVal(21);//use the slope as a proxy for the top/bottom half of tracker
+
+            int i = gblSCD.getIntVal(0);//implement generic methods into GBLStripClusterData so this isn't hard coded
+            if (tanlambda > 0)
+                aida.histogram1D(plotDir + uresDir + "HalfModule " + i + " Top u Residual").fill(resid);//x is the double value in the generic object                 
+            else
+                aida.histogram1D(plotDir + uresDir + "HalfModule " + i + " Bot u Residual").fill(resid);//x is the double value in the generic object                 
+
+        }
     }
 
     @Override
@@ -129,11 +150,11 @@
         int irXBot = 0;
         int irYTop = 0;
         int irYBot = 0;
-        for (int i = 0; i < nmodules; i++) {
-            IHistogram1D xresidTop = aida.histogram1D(plotDir + posresDir + "Module " + i + "Top x Residual");
-            IHistogram1D yresidTop = aida.histogram1D(plotDir + posresDir + "Module " + i + "Top y Residual");
-            IHistogram1D xresidBot = aida.histogram1D(plotDir + posresDir + "Module " + i + "Bot x Residual");
-            IHistogram1D yresidBot = aida.histogram1D(plotDir + posresDir + "Module " + i + "Bot y Residual");
+        for (int i = 1; i <= nmodules; i++) {
+            IHistogram1D xresidTop = aida.histogram1D(plotDir + posresDir + "Module " + i + " Top x Residual");
+            IHistogram1D yresidTop = aida.histogram1D(plotDir + posresDir + "Module " + i + " Top y Residual");
+            IHistogram1D xresidBot = aida.histogram1D(plotDir + posresDir + "Module " + i + " Bot x Residual");
+            IHistogram1D yresidBot = aida.histogram1D(plotDir + posresDir + "Module " + i + " Bot y Residual");
             IFitResult xresultTop = fitGaussian(xresidTop, fitter, "range=\"(-1.0,1.0)\"");
             IFitResult yresultTop = fitGaussian(yresidTop, fitter, "range=\"(-0.5,0.5)\"");
             IFitResult xresultBot = fitGaussian(xresidBot, fitter, "range=\"(-1.0,1.0)\"");
@@ -168,7 +189,7 @@
 
         }
         int iTime = 0;
-        for (int i = 0; i < nmodules * 2; i++) {
+        for (int i = 1; i <= nmodules * 2; i++) {
             IHistogram1D tresid = aida.histogram1D(plotDir + timeresDir + "HalfModule " + i + " t Residual");
             IFitResult tresult = fitGaussian(tresid, fitter, "range=\"(-15.0,15.0)\"");
             double[] parsTime = tresult.fittedParameters();
@@ -208,7 +229,6 @@
                 Logger.getLogger(SvtMonitoring.class.getName()).log(Level.SEVERE, null, ex);
             }
         }
-
     }
 
     private String getQuantityName(int itype, int iquant, int top, int nlayer) {
@@ -311,8 +331,8 @@
     }
 
     IFitResult fitGaussian(IHistogram1D h1d, IFitter fitter, String range) {
-         double[] init = {20.0, 0.0, 0.2};  
-        return fitter.fit(h1d, "g", init,range);
+        double[] init = {20.0, 0.0, 0.2};
+        return fitter.fit(h1d, "g", init, range);
 //        double[] init = {20.0, 0.0, 1.0, 20, -1};
 //        return fitter.fit(h1d, "g+p1", init, range);
     }
@@ -320,30 +340,30 @@
     private double getRange(int layer, boolean isX) {
         double range = 2.5;
         if (isX) {
-            if (layer == 0)
-                return 0.5;
             if (layer == 1)
                 return 0.5;
             if (layer == 2)
                 return 0.5;
             if (layer == 3)
-                return 1.0;
+                return 0.5;
             if (layer == 4)
                 return 1.0;
             if (layer == 5)
                 return 1.0;
+            if (layer == 6)
+                return 1.0;
         } else {
-            if (layer == 0)
+            if (layer == 1)
                 return 0.005;
-            if (layer == 1)
-                return 0.5;
             if (layer == 2)
                 return 0.5;
             if (layer == 3)
-                return 1.0;
+                return 0.5;
             if (layer == 4)
                 return 1.0;
             if (layer == 5)
+                return 1.0;
+            if (layer == 6)
                 return 1.5;
         }
         return range;

java/branches/hps-java_HPSJAVA-88/conditions
pom.xml 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/conditions/pom.xml	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/conditions/pom.xml	2014-10-06 19:40:35 UTC (rev 1140)
@@ -35,11 +35,6 @@
     </build>
     <dependencies>
         <dependency>
-            <groupId>org.lcsim</groupId>
-            <artifactId>lcsim-event-processing</artifactId>
-            <version>${lcsimVersion}</version>
-        </dependency>
-        <dependency>
             <groupId>org.hps</groupId>
             <artifactId>hps-util</artifactId>
         </dependency>

java/branches/hps-java_HPSJAVA-88/conditions/src/main/java/org/hps/conditions/deprecated
CalibrationDriver.java 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/conditions/src/main/java/org/hps/conditions/deprecated/CalibrationDriver.java	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/conditions/src/main/java/org/hps/conditions/deprecated/CalibrationDriver.java	2014-10-06 19:40:35 UTC (rev 1140)
@@ -23,7 +23,7 @@
 
     public CalibrationDriver() {
         add(new EcalConditions());
-        add(new HPSSVTSensorSetup());
+        //add(new HPSSVTSensorSetup());
     }
 
     public void setRunNumber(int runNumber) {
@@ -55,10 +55,10 @@
         	EcalConditions.setGainFilename(gainFilename);
         	EcalConditions.loadCalibration();
         }
-        if (fixRunNumber && (!HPSSVTCalibrationConstants.pedestalLoaded() || !HPSSVTCalibrationConstants.tpLoaded())) {
+        /*if (fixRunNumber && (!HPSSVTCalibrationConstants.pedestalLoaded() || !HPSSVTCalibrationConstants.tpLoaded())) {
             System.out.println("Loading calibration for set run: " + runNumber);
             loadCalibsByRun(runNumber);
-        }
+        }*/
     }
 
     @Override
@@ -76,7 +76,7 @@
     }
 
     private void loadCalibsByRun(int run) {
-        HPSSVTCalibrationConstants.loadCalibration(run);
+        //HPSSVTCalibrationConstants.loadCalibration(run);
         FieldMap.loadFieldMap(run);
     }
 

java/branches/hps-java_HPSJAVA-88/conditions/src/test/java/org/hps/conditions
ConditionsDevTest.java 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/conditions/src/test/java/org/hps/conditions/ConditionsDevTest.java	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/conditions/src/test/java/org/hps/conditions/ConditionsDevTest.java	2014-10-06 19:40:35 UTC (rev 1140)
@@ -33,7 +33,7 @@
                     System.out.println("Printing " + collection.getObjects().size()  + " objects in collection " + metaData.getKey() + " ...");
                     for (ConditionsObject object : collection.getObjects()) {
                         System.out.println(object.toString());
-                    }
+                    }                                        
                 }
             }
         }

java/branches/hps-java_HPSJAVA-88/conditions/src/test/java/org/hps/conditions
ConditionsDriverTest.java 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/conditions/src/test/java/org/hps/conditions/ConditionsDriverTest.java	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/conditions/src/test/java/org/hps/conditions/ConditionsDriverTest.java	2014-10-06 19:40:35 UTC (rev 1140)
@@ -22,7 +22,7 @@
 public class ConditionsDriverTest extends TestCase {
 
     // This test file has a few events from each of the "good runs" of the 2012 Test Run.
-    private static final String TEST_FILE_URL = "http://www.lcsim.org/test/hps/conditions_test.slcio";
+    private static final String fileLocation = "ftp://ftp-hps.slac.stanford.edu/hps/hps_data/hps_java_test_case_data/ConditionsTest.slcio";
 
     // Number of runs that should be processed in the job.
     static final int NRUNS = 9;
@@ -35,7 +35,7 @@
 
         // Cache a data file from the www.
         FileCache cache = new FileCache();
-        File testFile = cache.getCachedFile(new URL(TEST_FILE_URL));
+        File testFile = cache.getCachedFile(new URL(fileLocation));
 
         // Create the record loop.
         LCSimLoop loop = new LCSimLoop();

java/branches/hps-java_HPSJAVA-88/conditions/src/test/java/org/hps/conditions/beam
BeamCurrentTest.java 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/conditions/src/test/java/org/hps/conditions/beam/BeamCurrentTest.java	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/conditions/src/test/java/org/hps/conditions/beam/BeamCurrentTest.java	2014-10-06 19:40:35 UTC (rev 1140)
@@ -24,7 +24,7 @@
 public class BeamCurrentTest extends TestCase {
 
     /** This test file has a few events from the "good runs" of the Test Run. */
-    private static final String TEST_FILE_URL = "http://www.lcsim.org/test/hps/conditions_test.slcio";
+    private static final String fileLocation = "ftp://ftp-hps.slac.stanford.edu/hps/hps_data/hps_java_test_case_data/ConditionsTest.slcio";
 
     /** Answer key for beam current by run. */
     static Map<Integer, Double> beamCurrentAnswerKey = new HashMap<Integer, Double>();
@@ -50,7 +50,7 @@
 
         // Cache file locally from URL.
         FileCache cache = new FileCache();
-        File testFile = cache.getCachedFile(new URL(TEST_FILE_URL));
+        File testFile = cache.getCachedFile(new URL(fileLocation));
 
         // Create the LCSimLoop.
         LCSimLoop loop = new LCSimLoop();

java/branches/hps-java_HPSJAVA-88/conditions/src/test/java/org/hps/conditions/ecal
PhysicalToGainTest.java 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/conditions/src/test/java/org/hps/conditions/ecal/PhysicalToGainTest.java	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/conditions/src/test/java/org/hps/conditions/ecal/PhysicalToGainTest.java	2014-10-06 19:40:35 UTC (rev 1140)
@@ -29,14 +29,14 @@
 public class PhysicalToGainTest extends TestCase {
 
     // This test file has a few events from each of the "good runs" of the 2012 Test Run.
-    private static final String TEST_FILE_URL = "http://www.lcsim.org/test/hps/conditions_test.slcio";
+    private static final String fileLocation = "ftp://ftp-hps.slac.stanford.edu/hps/hps_data/hps_java_test_case_data/ConditionsTest.slcio";
 
     // Run the test.
     public void test() throws Exception {
 
         // Cache a data file from the www.
         FileCache cache = new FileCache();
-        File testFile = cache.getCachedFile(new URL(TEST_FILE_URL));
+        File testFile = cache.getCachedFile(new URL(fileLocation));
 
         // Create the record loop.
         LCSimLoop loop = new LCSimLoop();

java/branches/hps-java_HPSJAVA-88/datacat
pom.xml 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/datacat/pom.xml	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/datacat/pom.xml	2014-10-06 19:40:35 UTC (rev 1140)
@@ -36,11 +36,6 @@
     <dependencies>
         <dependency>
             <groupId>org.lcsim</groupId>
-            <artifactId>lcsim-distribution</artifactId>
-            <version>3.0.4-SNAPSHOT</version>
-        </dependency>
-        <dependency>
-            <groupId>org.lcsim</groupId>
             <artifactId>lcio</artifactId>
             <version>2.4.4-SNAPSHOT</version>
         </dependency>
@@ -124,4 +119,4 @@
             </plugin>                               
         </plugins>
     </build>
-</project>
\ No newline at end of file
+</project>

java/branches/hps-java_HPSJAVA-88/detector-data/detectors/HPSTestRunTracker2014-v0
HPSTestRunTracker2014-v0.lcdd 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/detector-data/detectors/HPSTestRunTracker2014-v0/HPSTestRunTracker2014-v0.lcdd	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/detector-data/detectors/HPSTestRunTracker2014-v0/HPSTestRunTracker2014-v0.lcdd	2014-10-06 19:40:35 UTC (rev 1140)
@@ -2,7 +2,7 @@
 <lcdd xmlns:lcdd="http://www.lcsim.org/schemas/lcdd/1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="http://www.lcsim.org/schemas/lcdd/1.0/lcdd.xsd">
   <header>
     <detector name="HPSTestRunTracker2014-v0" />
-    <generator name="GeomConverter" version="1.0" file="HPSTestRunTracker2014-v0/compact.xml" checksum="3555888184" />
+    <generator name="GeomConverter" version="1.0" file="../../hps-java/detector-data/detectors/HPSTestRunTracker2014-v0/compact.xml" checksum="1324664074" />
     <author name="NONE" />
     <comment>new SVT test run geometry</comment>
   </header>
@@ -16,11 +16,33 @@
       <idfield signed="true" label="side" length="2" start="32" />
       <idfield signed="false" label="strip" length="12" start="34" />
     </idspec>
+    <idspec name="TrackerHitsThin" length="46">
+      <idfield signed="false" label="system" length="6" start="0" />
+      <idfield signed="false" label="barrel" length="3" start="6" />
+      <idfield signed="false" label="layer" length="4" start="9" />
+      <idfield signed="false" label="module" length="12" start="13" />
+      <idfield signed="false" label="sensor" length="1" start="25" />
+      <idfield signed="true" label="side" length="2" start="32" />
+      <idfield signed="false" label="strip" length="12" start="34" />
+    </idspec>
+    <idspec name="EcalHits" length="22">
+      <idfield signed="false" label="system" length="6" start="0" />
+      <idfield signed="false" label="layer" length="2" start="6" />
+      <idfield signed="true" label="ix" length="8" start="8" />
+      <idfield signed="true" label="iy" length="6" start="16" />
+    </idspec>
   </iddict>
   <sensitive_detectors>
     <tracker name="Tracker" ecut="0.0" eunit="MeV" verbose="0" hits_collection="TrackerHits">
       <idspecref ref="TrackerHits" />
     </tracker>
+    <tracker name="TrackerFieldDef" ecut="0.0" eunit="MeV" verbose="0" hits_collection="TrackerHitsThin">
+      <idspecref ref="TrackerHitsThin" />
+    </tracker>
+    <calorimeter name="Ecal" ecut="0.0" eunit="MeV" verbose="0" hits_collection="EcalHits">
+      <idspecref ref="EcalHits" />
+      <grid_xyz grid_size_x="0.0" grid_size_y="0.0" grid_size_z="0.0" />
+    </calorimeter>
   </sensitive_detectors>
   <limits />
   <regions>
@@ -60,6 +82,9 @@
     <vis name="SupportVolumeVis" line_style="dashed" drawing_style="wireframe" show_daughters="true" visible="true">
       <color R="0.75" G="0.73" B="0.75" alpha="1.0" />
     </vis>
+    <vis name="ECALVis" line_style="unbroken" drawing_style="wireframe" show_daughters="true" visible="true">
+      <color R="0.8" G="0.5" B="0.1" alpha="1.0" />
+    </vis>
     <vis name="ComponentVis" line_style="unbroken" drawing_style="solid" show_daughters="false" visible="false">
       <color R="0.0" G="0.2" B="0.4" alpha="0.0" />
     </vis>
@@ -88,35 +113,39 @@
       <rotation name="reflect_rot" x="3.141592653589793" y="0.0" z="0.0" unit="radian" />
       <position name="identity_pos" x="0.0" y="0.0" z="0.0" unit="mm" />
       <constant name="constBFieldY" value="-0.491" />
+      <constant name="mm" value="1.0" />
       <constant name="world_side" value="5000.0" />
-      <constant name="mm" value="1.0" />
-      <constant name="dipoleMagnetLength" value="914.4" />
-      <constant name="tracking_region_min" value="50.0" />
+      <constant name="ecal_z" value="80.0" />
       <constant name="inch" value="25.4" />
       <constant name="dipoleMagnetPositionZ" value="457.2" />
+      <constant name="tracking_region_radius" value="2000.0" />
       <constant name="dipoleMagnetWidth" value="416.052" />
-      <constant name="tracking_region_radius" value="2000.0" />
       <constant name="world_y" value="5000.0" />
       <constant name="world_z" value="5000.0" />
+      <constant name="world_x" value="5000.0" />
+      <constant name="ecal_front" value="6.65" />
+      <constant name="dipoleMagnetLength" value="914.4" />
+      <constant name="tracking_region_min" value="50.0" />
+      <constant name="ecal_dx" value="41.27" />
       <constant name="tracking_region_zmax" value="1318.0" />
+      <constant name="ecal_back" value="8.0" />
       <constant name="dipoleMagnetHeight" value="177.8" />
-      <constant name="world_x" value="5000.0" />
       <position name="beamPlaneVol_position" x="0.0" y="4.999999999999999E-9" z="1.1368683772161603E-13" unit="mm" />
-      <rotation name="beamPlaneVol_rotation" x="1.5707963267948968" y="-0.0" z="0.0" unit="radian" />
+      <rotation name="beamPlaneVol_rotation" x="1.5707963267948963" y="-0.0" z="0.0" unit="radian" />
       <position name="base_position" x="30.19999999999999" y="0.9999999999999858" z="318.59000000000015" unit="mm" />
-      <rotation name="base_rotation" x="1.5707963267948968" y="-0.0" z="0.0" unit="radian" />
+      <rotation name="base_rotation" x="1.5707963267948963" y="-0.0" z="0.0" unit="radian" />
       <position name="baseplate_position" x="0.0" y="-1.1368683772161603E-13" z="-84.725" unit="mm" />
       <rotation name="baseplate_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="support_plate_bottom_position" x="-103.25405804451006" y="-95.60825753895892" z="-65.19999999999999" unit="mm" />
-      <rotation name="support_plate_bottom_rotation" x="0.0" y="-0.0" z="-0.03000463514883789" unit="radian" />
+      <rotation name="support_plate_bottom_rotation" x="0.0" y="-0.0" z="-0.030004635148837874" unit="radian" />
       <position name="support_plate_top_position" x="-103.25405804451009" y="-95.60825753895904" z="63.2" unit="mm" />
-      <rotation name="support_plate_top_rotation" x="0.0" y="-0.0" z="-0.030004635148837954" unit="radian" />
-      <position name="module_L1b_position" x="-49.47377368941051" y="199.18784744664742" z="-25.35" unit="mm" />
-      <rotation name="module_L1b_rotation" x="0.0" y="0.0" z="-0.03" unit="radian" />
-      <position name="module_L1b_halfmodule_axial_position" x="1.1500000000000057" y="-3.94375" z="0.26500000000000057" unit="mm" />
+      <rotation name="support_plate_top_rotation" x="0.0" y="-0.0" z="-0.030004635148837947" unit="radian" />
+      <position name="module_L1b_position" x="-44.47602421588729" y="199.33784811297414" z="-20.85" unit="mm" />
+      <rotation name="module_L1b_rotation" x="0.0" y="-0.0" z="-0.03000463514883733" unit="radian" />
+      <position name="module_L1b_halfmodule_axial_position" x="-3.8499999999999943" y="-3.94375" z="-4.234999999999999" unit="mm" />
       <rotation name="module_L1b_halfmodule_axial_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L1b_halfmodule_axial_sensor_position" x="30.0" y="0.48375" z="3.414999999999999" unit="mm" />
-      <rotation name="module_L1b_halfmodule_axial_sensor_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
+      <rotation name="module_L1b_halfmodule_axial_sensor_rotation" x="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
       <position name="module_L1b_halfmodule_axial_sensor_active_position" x="0.0" y="0.0" z="0.0" unit="mm" />
       <rotation name="module_L1b_halfmodule_axial_sensor_active_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L1b_halfmodule_axial_lamination_position" x="0.5" y="0.66875" z="2.414999999999999" unit="mm" />
@@ -125,12 +154,10 @@
       <rotation name="module_L1b_halfmodule_axial_cf_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L1b_halfmodule_axial_hybrid_position" x="-55.0" y="-0.1499999999999999" z="3.4149999999999956" unit="mm" />
       <rotation name="module_L1b_halfmodule_axial_hybrid_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
-      <position name="module_L1b_coldblock_position" x="-61.599999999999994" y="0.0" z="-2.8999999999999986" unit="mm" />
-      <rotation name="module_L1b_coldblock_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
-      <position name="module_L1b_halfmodule_stereo_position" x="0.9589439238103097" y="3.94375" z="4.082936725019614" unit="mm" />
-      <rotation name="module_L1b_halfmodule_stereo_rotation" x="3.141592653589793" y="-0.1" z="-0.0" unit="radian" />
+      <position name="module_L1b_halfmodule_stereo_position" x="-4.04105607618969" y="3.9437500000000005" z="-0.41706327498038576" unit="mm" />
+      <rotation name="module_L1b_halfmodule_stereo_rotation" x="-3.141592653589793" y="-0.09999999999999999" z="-1.2287453501294631E-17" unit="radian" />
       <position name="module_L1b_halfmodule_stereo_sensor_position" x="30.0" y="0.48375" z="3.414999999999999" unit="mm" />
-      <rotation name="module_L1b_halfmodule_stereo_sensor_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
+      <rotation name="module_L1b_halfmodule_stereo_sensor_rotation" x="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
       <position name="module_L1b_halfmodule_stereo_sensor_active_position" x="0.0" y="0.0" z="0.0" unit="mm" />
       <rotation name="module_L1b_halfmodule_stereo_sensor_active_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L1b_halfmodule_stereo_lamination_position" x="0.5" y="0.66875" z="2.414999999999999" unit="mm" />
@@ -139,12 +166,12 @@
       <rotation name="module_L1b_halfmodule_stereo_cf_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L1b_halfmodule_stereo_hybrid_position" x="-55.0" y="-0.1499999999999999" z="3.4149999999999956" unit="mm" />
       <rotation name="module_L1b_halfmodule_stereo_hybrid_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
-      <position name="module_L1t_position" x="-49.92377568839083" y="214.18109586721687" z="23.35000000000001" unit="mm" />
-      <rotation name="module_L1t_rotation" x="3.141592653589793" y="0.0" z="0.03000463514883735" unit="radian" />
-      <position name="module_L1t_halfmodule_axial_position" x="1.1500000000000057" y="-3.94375" z="0.26500000000000057" unit="mm" />
+      <position name="module_L1t_position" x="-44.92602621486762" y="214.3310965335436" z="18.85000000000001" unit="mm" />
+      <rotation name="module_L1t_rotation" x="3.141592653589793" y="-0.0" z="0.030004635148837337" unit="radian" />
+      <position name="module_L1t_halfmodule_axial_position" x="-3.8499999999999943" y="-3.94375" z="-4.234999999999999" unit="mm" />
       <rotation name="module_L1t_halfmodule_axial_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L1t_halfmodule_axial_sensor_position" x="30.0" y="0.48375" z="3.414999999999999" unit="mm" />
-      <rotation name="module_L1t_halfmodule_axial_sensor_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
+      <rotation name="module_L1t_halfmodule_axial_sensor_rotation" x="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
       <position name="module_L1t_halfmodule_axial_sensor_active_position" x="0.0" y="0.0" z="0.0" unit="mm" />
       <rotation name="module_L1t_halfmodule_axial_sensor_active_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L1t_halfmodule_axial_lamination_position" x="0.5" y="0.66875" z="2.414999999999999" unit="mm" />
@@ -153,12 +180,10 @@
       <rotation name="module_L1t_halfmodule_axial_cf_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L1t_halfmodule_axial_hybrid_position" x="-55.0" y="-0.1499999999999999" z="3.4149999999999956" unit="mm" />
       <rotation name="module_L1t_halfmodule_axial_hybrid_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
-      <position name="module_L1t_coldblock_position" x="-61.599999999999994" y="0.0" z="-2.8999999999999986" unit="mm" />
-      <rotation name="module_L1t_coldblock_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
-      <position name="module_L1t_halfmodule_stereo_position" x="0.9589439238103097" y="3.94375" z="4.082936725019614" unit="mm" />
-      <rotation name="module_L1t_halfmodule_stereo_rotation" x="3.141592653589793" y="-0.1" z="-0.0" unit="radian" />
+      <position name="module_L1t_halfmodule_stereo_position" x="-4.04105607618969" y="3.9437500000000005" z="-0.41706327498038576" unit="mm" />
+      <rotation name="module_L1t_halfmodule_stereo_rotation" x="-3.141592653589793" y="-0.09999999999999999" z="-1.2287453501294631E-17" unit="radian" />
       <position name="module_L1t_halfmodule_stereo_sensor_position" x="30.0" y="0.48375" z="3.414999999999999" unit="mm" />
-      <rotation name="module_L1t_halfmodule_stereo_sensor_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
+      <rotation name="module_L1t_halfmodule_stereo_sensor_rotation" x="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
       <position name="module_L1t_halfmodule_stereo_sensor_active_position" x="0.0" y="0.0" z="0.0" unit="mm" />
       <rotation name="module_L1t_halfmodule_stereo_sensor_active_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L1t_halfmodule_stereo_lamination_position" x="0.5" y="0.66875" z="2.414999999999999" unit="mm" />
@@ -167,12 +192,12 @@
       <rotation name="module_L1t_halfmodule_stereo_cf_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L1t_halfmodule_stereo_hybrid_position" x="-55.0" y="-0.1499999999999999" z="3.4149999999999956" unit="mm" />
       <rotation name="module_L1t_halfmodule_stereo_hybrid_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
-      <position name="module_L2b_position" x="-46.473760362875424" y="99.23285797618325" z="-26.85" unit="mm" />
-      <rotation name="module_L2b_rotation" x="0.0" y="-0.0" z="-0.03000463514883732" unit="radian" />
-      <position name="module_L2b_halfmodule_axial_position" x="1.1500000000000057" y="-3.94375" z="0.26500000000000057" unit="mm" />
+      <position name="module_L2b_position" x="-41.47601088935221" y="99.38285864250997" z="-22.35" unit="mm" />
+      <rotation name="module_L2b_rotation" x="0.0" y="-0.0" z="-0.03000463514883733" unit="radian" />
+      <position name="module_L2b_halfmodule_axial_position" x="-3.8499999999999943" y="-3.94375" z="-4.234999999999999" unit="mm" />
       <rotation name="module_L2b_halfmodule_axial_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L2b_halfmodule_axial_sensor_position" x="30.0" y="0.48375" z="3.414999999999999" unit="mm" />
-      <rotation name="module_L2b_halfmodule_axial_sensor_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
+      <rotation name="module_L2b_halfmodule_axial_sensor_rotation" x="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
       <position name="module_L2b_halfmodule_axial_sensor_active_position" x="0.0" y="0.0" z="0.0" unit="mm" />
       <rotation name="module_L2b_halfmodule_axial_sensor_active_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L2b_halfmodule_axial_lamination_position" x="0.5" y="0.66875" z="2.414999999999999" unit="mm" />
@@ -181,12 +206,10 @@
       <rotation name="module_L2b_halfmodule_axial_cf_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L2b_halfmodule_axial_hybrid_position" x="-55.0" y="-0.1499999999999999" z="3.4149999999999956" unit="mm" />
       <rotation name="module_L2b_halfmodule_axial_hybrid_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
-      <position name="module_L2b_coldblock_position" x="-61.599999999999994" y="0.0" z="-2.8999999999999986" unit="mm" />
-      <rotation name="module_L2b_coldblock_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
-      <position name="module_L2b_halfmodule_stereo_position" x="0.9589439238103097" y="3.94375" z="4.082936725019614" unit="mm" />
-      <rotation name="module_L2b_halfmodule_stereo_rotation" x="3.141592653589793" y="-0.1" z="-0.0" unit="radian" />
+      <position name="module_L2b_halfmodule_stereo_position" x="-4.04105607618969" y="3.9437500000000005" z="-0.41706327498038576" unit="mm" />
+      <rotation name="module_L2b_halfmodule_stereo_rotation" x="-3.141592653589793" y="-0.09999999999999999" z="-1.2287453501294631E-17" unit="radian" />
       <position name="module_L2b_halfmodule_stereo_sensor_position" x="30.0" y="0.48375" z="3.414999999999999" unit="mm" />
-      <rotation name="module_L2b_halfmodule_stereo_sensor_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
+      <rotation name="module_L2b_halfmodule_stereo_sensor_rotation" x="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
       <position name="module_L2b_halfmodule_stereo_sensor_active_position" x="0.0" y="0.0" z="0.0" unit="mm" />
       <rotation name="module_L2b_halfmodule_stereo_sensor_active_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L2b_halfmodule_stereo_lamination_position" x="0.5" y="0.66875" z="2.414999999999999" unit="mm" />
@@ -195,12 +218,12 @@
       <rotation name="module_L2b_halfmodule_stereo_cf_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L2b_halfmodule_stereo_hybrid_position" x="-55.0" y="-0.1499999999999999" z="3.4149999999999956" unit="mm" />
       <rotation name="module_L2b_halfmodule_stereo_hybrid_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
-      <position name="module_L2t_position" x="-46.92376236185575" y="114.2261063967527" z="24.85000000000001" unit="mm" />
-      <rotation name="module_L2t_rotation" x="3.141592653589793" y="-0.0" z="0.030004635148837347" unit="radian" />
-      <position name="module_L2t_halfmodule_axial_position" x="1.1500000000000057" y="-3.94375" z="0.26500000000000057" unit="mm" />
+      <position name="module_L2t_position" x="-41.92601288833254" y="114.37610706307942" z="20.35000000000001" unit="mm" />
+      <rotation name="module_L2t_rotation" x="3.141592653589793" y="-0.0" z="0.030004635148837337" unit="radian" />
+      <position name="module_L2t_halfmodule_axial_position" x="-3.8499999999999943" y="-3.94375" z="-4.234999999999999" unit="mm" />
       <rotation name="module_L2t_halfmodule_axial_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L2t_halfmodule_axial_sensor_position" x="30.0" y="0.48375" z="3.414999999999999" unit="mm" />
-      <rotation name="module_L2t_halfmodule_axial_sensor_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
+      <rotation name="module_L2t_halfmodule_axial_sensor_rotation" x="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
       <position name="module_L2t_halfmodule_axial_sensor_active_position" x="0.0" y="0.0" z="0.0" unit="mm" />
       <rotation name="module_L2t_halfmodule_axial_sensor_active_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L2t_halfmodule_axial_lamination_position" x="0.5" y="0.66875" z="2.414999999999999" unit="mm" />
@@ -209,12 +232,10 @@
       <rotation name="module_L2t_halfmodule_axial_cf_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L2t_halfmodule_axial_hybrid_position" x="-55.0" y="-0.1499999999999999" z="3.4149999999999956" unit="mm" />
       <rotation name="module_L2t_halfmodule_axial_hybrid_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
-      <position name="module_L2t_coldblock_position" x="-61.599999999999994" y="0.0" z="-2.8999999999999986" unit="mm" />
-      <rotation name="module_L2t_coldblock_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
-      <position name="module_L2t_halfmodule_stereo_position" x="0.9589439238103097" y="3.94375" z="4.082936725019614" unit="mm" />
-      <rotation name="module_L2t_halfmodule_stereo_rotation" x="3.141592653589793" y="-0.1" z="-0.0" unit="radian" />
+      <position name="module_L2t_halfmodule_stereo_position" x="-4.04105607618969" y="3.9437500000000005" z="-0.41706327498038576" unit="mm" />
+      <rotation name="module_L2t_halfmodule_stereo_rotation" x="-3.141592653589793" y="-0.09999999999999999" z="-1.2287453501294631E-17" unit="radian" />
       <position name="module_L2t_halfmodule_stereo_sensor_position" x="30.0" y="0.48375" z="3.414999999999999" unit="mm" />
-      <rotation name="module_L2t_halfmodule_stereo_sensor_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
+      <rotation name="module_L2t_halfmodule_stereo_sensor_rotation" x="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
       <position name="module_L2t_halfmodule_stereo_sensor_active_position" x="0.0" y="0.0" z="0.0" unit="mm" />
       <rotation name="module_L2t_halfmodule_stereo_sensor_active_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L2t_halfmodule_stereo_lamination_position" x="0.5" y="0.66875" z="2.414999999999999" unit="mm" />
@@ -223,12 +244,12 @@
       <rotation name="module_L2t_halfmodule_stereo_cf_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L2t_halfmodule_stereo_hybrid_position" x="-55.0" y="-0.1499999999999999" z="3.4149999999999956" unit="mm" />
       <rotation name="module_L2t_halfmodule_stereo_hybrid_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
-      <position name="module_L3b_position" x="-43.47374703634034" y="-0.7221314942810295" z="-28.35" unit="mm" />
-      <rotation name="module_L3b_rotation" x="0.0" y="-0.0" z="-0.03000463514883732" unit="radian" />
-      <position name="module_L3b_halfmodule_axial_position" x="1.1500000000000057" y="-3.94375" z="0.26500000000000057" unit="mm" />
+      <position name="module_L3b_position" x="-38.475997562817156" y="-0.5721308279543109" z="-23.85" unit="mm" />
+      <rotation name="module_L3b_rotation" x="0.0" y="-0.0" z="-0.03000463514883733" unit="radian" />
+      <position name="module_L3b_halfmodule_axial_position" x="-3.8499999999999943" y="-3.94375" z="-4.234999999999999" unit="mm" />
       <rotation name="module_L3b_halfmodule_axial_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L3b_halfmodule_axial_sensor_position" x="30.0" y="0.48375" z="3.414999999999999" unit="mm" />
-      <rotation name="module_L3b_halfmodule_axial_sensor_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
+      <rotation name="module_L3b_halfmodule_axial_sensor_rotation" x="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
       <position name="module_L3b_halfmodule_axial_sensor_active_position" x="0.0" y="0.0" z="0.0" unit="mm" />
       <rotation name="module_L3b_halfmodule_axial_sensor_active_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L3b_halfmodule_axial_lamination_position" x="0.5" y="0.66875" z="2.414999999999999" unit="mm" />
@@ -237,12 +258,10 @@
       <rotation name="module_L3b_halfmodule_axial_cf_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L3b_halfmodule_axial_hybrid_position" x="-55.0" y="-0.1499999999999999" z="3.4149999999999956" unit="mm" />
       <rotation name="module_L3b_halfmodule_axial_hybrid_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
-      <position name="module_L3b_coldblock_position" x="-61.599999999999994" y="0.0" z="-2.8999999999999986" unit="mm" />
-      <rotation name="module_L3b_coldblock_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
-      <position name="module_L3b_halfmodule_stereo_position" x="0.9589439238103097" y="3.94375" z="4.082936725019614" unit="mm" />
-      <rotation name="module_L3b_halfmodule_stereo_rotation" x="3.141592653589793" y="-0.1" z="-0.0" unit="radian" />
+      <position name="module_L3b_halfmodule_stereo_position" x="-4.04105607618969" y="3.9437500000000005" z="-0.41706327498038576" unit="mm" />
+      <rotation name="module_L3b_halfmodule_stereo_rotation" x="-3.141592653589793" y="-0.09999999999999999" z="-1.2287453501294631E-17" unit="radian" />
       <position name="module_L3b_halfmodule_stereo_sensor_position" x="30.0" y="0.48375" z="3.414999999999999" unit="mm" />
-      <rotation name="module_L3b_halfmodule_stereo_sensor_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
+      <rotation name="module_L3b_halfmodule_stereo_sensor_rotation" x="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
       <position name="module_L3b_halfmodule_stereo_sensor_active_position" x="0.0" y="0.0" z="0.0" unit="mm" />
       <rotation name="module_L3b_halfmodule_stereo_sensor_active_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L3b_halfmodule_stereo_lamination_position" x="0.5" y="0.66875" z="2.414999999999999" unit="mm" />
@@ -251,12 +270,12 @@
       <rotation name="module_L3b_halfmodule_stereo_cf_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L3b_halfmodule_stereo_hybrid_position" x="-55.0" y="-0.1499999999999999" z="3.4149999999999956" unit="mm" />
       <rotation name="module_L3b_halfmodule_stereo_hybrid_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
-      <position name="module_L3t_position" x="-43.92374903532067" y="14.271116926288641" z="26.35000000000001" unit="mm" />
+      <position name="module_L3t_position" x="-38.925999561797454" y="14.42111759261536" z="21.85000000000001" unit="mm" />
       <rotation name="module_L3t_rotation" x="3.141592653589793" y="-0.0" z="0.03000463514883896" unit="radian" />
-      <position name="module_L3t_halfmodule_axial_position" x="1.1500000000000057" y="-3.94375" z="0.26500000000000057" unit="mm" />
+      <position name="module_L3t_halfmodule_axial_position" x="-3.8499999999999943" y="-3.94375" z="-4.234999999999999" unit="mm" />
       <rotation name="module_L3t_halfmodule_axial_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L3t_halfmodule_axial_sensor_position" x="30.0" y="0.48375" z="3.414999999999999" unit="mm" />
-      <rotation name="module_L3t_halfmodule_axial_sensor_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
+      <rotation name="module_L3t_halfmodule_axial_sensor_rotation" x="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
       <position name="module_L3t_halfmodule_axial_sensor_active_position" x="0.0" y="0.0" z="0.0" unit="mm" />
       <rotation name="module_L3t_halfmodule_axial_sensor_active_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L3t_halfmodule_axial_lamination_position" x="0.5" y="0.66875" z="2.414999999999999" unit="mm" />
@@ -265,12 +284,10 @@
       <rotation name="module_L3t_halfmodule_axial_cf_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L3t_halfmodule_axial_hybrid_position" x="-55.0" y="-0.1499999999999999" z="3.4149999999999956" unit="mm" />
       <rotation name="module_L3t_halfmodule_axial_hybrid_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
-      <position name="module_L3t_coldblock_position" x="-61.599999999999994" y="0.0" z="-2.8999999999999986" unit="mm" />
-      <rotation name="module_L3t_coldblock_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
-      <position name="module_L3t_halfmodule_stereo_position" x="0.9589439238103097" y="3.94375" z="4.082936725019614" unit="mm" />
-      <rotation name="module_L3t_halfmodule_stereo_rotation" x="3.141592653589793" y="-0.1" z="-0.0" unit="radian" />
+      <position name="module_L3t_halfmodule_stereo_position" x="-4.04105607618969" y="3.9437500000000005" z="-0.41706327498038576" unit="mm" />
+      <rotation name="module_L3t_halfmodule_stereo_rotation" x="-3.141592653589793" y="-0.09999999999999999" z="-1.2287453501294631E-17" unit="radian" />
       <position name="module_L3t_halfmodule_stereo_sensor_position" x="30.0" y="0.48375" z="3.414999999999999" unit="mm" />
-      <rotation name="module_L3t_halfmodule_stereo_sensor_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
+      <rotation name="module_L3t_halfmodule_stereo_sensor_rotation" x="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
       <position name="module_L3t_halfmodule_stereo_sensor_active_position" x="0.0" y="0.0" z="0.0" unit="mm" />
       <rotation name="module_L3t_halfmodule_stereo_sensor_active_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L3t_halfmodule_stereo_lamination_position" x="0.5" y="0.66875" z="2.414999999999999" unit="mm" />
@@ -279,12 +296,12 @@
       <rotation name="module_L3t_halfmodule_stereo_cf_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L3t_halfmodule_stereo_hybrid_position" x="-55.0" y="-0.1499999999999999" z="3.4149999999999956" unit="mm" />
       <rotation name="module_L3t_halfmodule_stereo_hybrid_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
-      <position name="module_L4b_position" x="-37.473720383270205" y="-200.63211043520948" z="-28.85" unit="mm" />
-      <rotation name="module_L4b_rotation" x="0.0" y="-0.0" z="-0.03000463514883732" unit="radian" />
-      <position name="module_L4b_halfmodule_axial_position" x="1.1500000000000057" y="-3.94375" z="-2.232999999999997" unit="mm" />
+      <position name="module_L4b_position" x="-32.47597090974699" y="-200.4821097688827" z="-24.35" unit="mm" />
+      <rotation name="module_L4b_rotation" x="0.0" y="-0.0" z="-0.03000463514883733" unit="radian" />
+      <position name="module_L4b_halfmodule_axial_position" x="-3.8499999999999943" y="-3.94375" z="-6.732999999999997" unit="mm" />
       <rotation name="module_L4b_halfmodule_axial_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L4b_halfmodule_axial_sensor_position" x="30.0" y="0.48375" z="3.414999999999999" unit="mm" />
-      <rotation name="module_L4b_halfmodule_axial_sensor_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
+      <rotation name="module_L4b_halfmodule_axial_sensor_rotation" x="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
       <position name="module_L4b_halfmodule_axial_sensor_active_position" x="0.0" y="0.0" z="0.0" unit="mm" />
       <rotation name="module_L4b_halfmodule_axial_sensor_active_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L4b_halfmodule_axial_lamination_position" x="0.5" y="0.66875" z="2.414999999999999" unit="mm" />
@@ -293,12 +310,10 @@
       <rotation name="module_L4b_halfmodule_axial_cf_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L4b_halfmodule_axial_hybrid_position" x="-55.0" y="-0.1499999999999999" z="3.4149999999999956" unit="mm" />
       <rotation name="module_L4b_halfmodule_axial_hybrid_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
-      <position name="module_L4b_coldblock_position" x="-61.599999999999994" y="0.0" z="-1.1499999999999986" unit="mm" />
-      <rotation name="module_L4b_coldblock_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
-      <position name="module_L4b_halfmodule_stereo_position" x="1.016813325091647" y="3.9437499999999996" z="3.0933570611284615" unit="mm" />
-      <rotation name="module_L4b_halfmodule_stereo_rotation" x="3.141592653589793" y="-0.05" z="-3.856679734182209E-34" unit="radian" />
+      <position name="module_L4b_halfmodule_stereo_position" x="-3.983186674908353" y="3.9437500000000005" z="-1.4066429388715385" unit="mm" />
+      <rotation name="module_L4b_halfmodule_stereo_rotation" x="-3.141592653589793" y="-0.04999999999999999" z="-6.128341798596887E-18" unit="radian" />
       <position name="module_L4b_halfmodule_stereo_sensor_position" x="30.0" y="0.48375" z="3.414999999999999" unit="mm" />
-      <rotation name="module_L4b_halfmodule_stereo_sensor_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
+      <rotation name="module_L4b_halfmodule_stereo_sensor_rotation" x="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
       <position name="module_L4b_halfmodule_stereo_sensor_active_position" x="0.0" y="0.0" z="0.0" unit="mm" />
       <rotation name="module_L4b_halfmodule_stereo_sensor_active_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L4b_halfmodule_stereo_lamination_position" x="0.5" y="0.66875" z="2.414999999999999" unit="mm" />
@@ -307,12 +322,12 @@
       <rotation name="module_L4b_halfmodule_stereo_cf_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L4b_halfmodule_stereo_hybrid_position" x="-55.0" y="-0.1499999999999999" z="3.4149999999999956" unit="mm" />
       <rotation name="module_L4b_halfmodule_stereo_hybrid_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
-      <position name="module_L4t_position" x="-37.9237223822505" y="-185.63886201463993" z="26.85000000000001" unit="mm" />
-      <rotation name="module_L4t_rotation" x="3.141592653589793" y="-0.0" z="0.030004635148837347" unit="radian" />
-      <position name="module_L4t_halfmodule_axial_position" x="1.1500000000000057" y="-3.94375" z="-2.232999999999997" unit="mm" />
+      <position name="module_L4t_position" x="-32.92597290872729" y="-185.48886134831315" z="22.35000000000001" unit="mm" />
+      <rotation name="module_L4t_rotation" x="3.141592653589793" y="-0.0" z="0.030004635148837337" unit="radian" />
+      <position name="module_L4t_halfmodule_axial_position" x="-3.8499999999999943" y="-3.94375" z="-6.732999999999997" unit="mm" />
       <rotation name="module_L4t_halfmodule_axial_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L4t_halfmodule_axial_sensor_position" x="30.0" y="0.48375" z="3.414999999999999" unit="mm" />
-      <rotation name="module_L4t_halfmodule_axial_sensor_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
+      <rotation name="module_L4t_halfmodule_axial_sensor_rotation" x="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
       <position name="module_L4t_halfmodule_axial_sensor_active_position" x="0.0" y="0.0" z="0.0" unit="mm" />
       <rotation name="module_L4t_halfmodule_axial_sensor_active_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L4t_halfmodule_axial_lamination_position" x="0.5" y="0.66875" z="2.414999999999999" unit="mm" />
@@ -321,12 +336,10 @@
       <rotation name="module_L4t_halfmodule_axial_cf_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L4t_halfmodule_axial_hybrid_position" x="-55.0" y="-0.1499999999999999" z="3.4149999999999956" unit="mm" />
       <rotation name="module_L4t_halfmodule_axial_hybrid_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
-      <position name="module_L4t_coldblock_position" x="-61.599999999999994" y="0.0" z="-1.1499999999999986" unit="mm" />
-      <rotation name="module_L4t_coldblock_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
-      <position name="module_L4t_halfmodule_stereo_position" x="1.016813325091647" y="3.9437499999999996" z="3.0933570611284615" unit="mm" />
-      <rotation name="module_L4t_halfmodule_stereo_rotation" x="3.141592653589793" y="-0.05" z="-3.856679734182209E-34" unit="radian" />
+      <position name="module_L4t_halfmodule_stereo_position" x="-3.983186674908353" y="3.9437500000000005" z="-1.4066429388715385" unit="mm" />
+      <rotation name="module_L4t_halfmodule_stereo_rotation" x="-3.141592653589793" y="-0.04999999999999999" z="-6.128341798596887E-18" unit="radian" />
       <position name="module_L4t_halfmodule_stereo_sensor_position" x="30.0" y="0.48375" z="3.414999999999999" unit="mm" />
-      <rotation name="module_L4t_halfmodule_stereo_sensor_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
+      <rotation name="module_L4t_halfmodule_stereo_sensor_rotation" x="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
       <position name="module_L4t_halfmodule_stereo_sensor_active_position" x="0.0" y="0.0" z="0.0" unit="mm" />
       <rotation name="module_L4t_halfmodule_stereo_sensor_active_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L4t_halfmodule_stereo_lamination_position" x="0.5" y="0.66875" z="2.414999999999999" unit="mm" />
@@ -335,12 +348,12 @@
       <rotation name="module_L4t_halfmodule_stereo_cf_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L4t_halfmodule_stereo_hybrid_position" x="-55.0" y="-0.1499999999999999" z="3.4149999999999956" unit="mm" />
       <rotation name="module_L4t_halfmodule_stereo_hybrid_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
-      <position name="module_L5b_position" x="-31.47369373020007" y="-400.54208937613794" z="-31.85" unit="mm" />
-      <rotation name="module_L5b_rotation" x="0.0" y="-0.0" z="-0.03000463514883777" unit="radian" />
-      <position name="module_L5b_halfmodule_axial_position" x="1.1500000000000057" y="-3.94375" z="-2.232999999999997" unit="mm" />
+      <position name="module_L5b_position" x="-26.475944256676854" y="-400.39208870981116" z="-27.35" unit="mm" />
+      <rotation name="module_L5b_rotation" x="0.0" y="-0.0" z="-0.030004635148837742" unit="radian" />
+      <position name="module_L5b_halfmodule_axial_position" x="-3.8499999999999943" y="-3.94375" z="-6.732999999999997" unit="mm" />
       <rotation name="module_L5b_halfmodule_axial_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L5b_halfmodule_axial_sensor_position" x="30.0" y="0.48375" z="3.414999999999999" unit="mm" />
-      <rotation name="module_L5b_halfmodule_axial_sensor_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
+      <rotation name="module_L5b_halfmodule_axial_sensor_rotation" x="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
       <position name="module_L5b_halfmodule_axial_sensor_active_position" x="0.0" y="0.0" z="0.0" unit="mm" />
       <rotation name="module_L5b_halfmodule_axial_sensor_active_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L5b_halfmodule_axial_lamination_position" x="0.5" y="0.66875" z="2.414999999999999" unit="mm" />
@@ -349,12 +362,10 @@
       <rotation name="module_L5b_halfmodule_axial_cf_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L5b_halfmodule_axial_hybrid_position" x="-55.0" y="-0.1499999999999999" z="3.4149999999999956" unit="mm" />
       <rotation name="module_L5b_halfmodule_axial_hybrid_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
-      <position name="module_L5b_coldblock_position" x="-61.599999999999994" y="0.0" z="-1.1499999999999986" unit="mm" />
-      <rotation name="module_L5b_coldblock_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
-      <position name="module_L5b_halfmodule_stereo_position" x="1.016813325091647" y="3.9437499999999996" z="3.0933570611284615" unit="mm" />
-      <rotation name="module_L5b_halfmodule_stereo_rotation" x="3.141592653589793" y="-0.05" z="-3.856679734182209E-34" unit="radian" />
+      <position name="module_L5b_halfmodule_stereo_position" x="-3.983186674908353" y="3.9437500000000005" z="-1.4066429388715385" unit="mm" />
+      <rotation name="module_L5b_halfmodule_stereo_rotation" x="-3.141592653589793" y="-0.04999999999999999" z="-6.128341798596887E-18" unit="radian" />
       <position name="module_L5b_halfmodule_stereo_sensor_position" x="30.0" y="0.48375" z="3.414999999999999" unit="mm" />
-      <rotation name="module_L5b_halfmodule_stereo_sensor_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
+      <rotation name="module_L5b_halfmodule_stereo_sensor_rotation" x="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
       <position name="module_L5b_halfmodule_stereo_sensor_active_position" x="0.0" y="0.0" z="0.0" unit="mm" />
       <rotation name="module_L5b_halfmodule_stereo_sensor_active_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L5b_halfmodule_stereo_lamination_position" x="0.5" y="0.66875" z="2.414999999999999" unit="mm" />
@@ -363,12 +374,12 @@
       <rotation name="module_L5b_halfmodule_stereo_cf_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L5b_halfmodule_stereo_hybrid_position" x="-55.0" y="-0.1499999999999999" z="3.4149999999999956" unit="mm" />
       <rotation name="module_L5b_halfmodule_stereo_hybrid_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
-      <position name="module_L5t_position" x="-31.923695729180338" y="-385.54884095556827" z="29.85000000000001" unit="mm" />
-      <rotation name="module_L5t_rotation" x="3.141592653589793" y="-0.0" z="0.030004635148837753" unit="radian" />
-      <position name="module_L5t_halfmodule_axial_position" x="1.1500000000000057" y="-3.94375" z="-2.232999999999997" unit="mm" />
+      <position name="module_L5t_position" x="-26.925946255657124" y="-385.39884028924155" z="25.35000000000001" unit="mm" />
+      <rotation name="module_L5t_rotation" x="3.141592653589793" y="-0.0" z="0.030004635148837742" unit="radian" />
+      <position name="module_L5t_halfmodule_axial_position" x="-3.8499999999999943" y="-3.94375" z="-6.732999999999997" unit="mm" />
       <rotation name="module_L5t_halfmodule_axial_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L5t_halfmodule_axial_sensor_position" x="30.0" y="0.48375" z="3.414999999999999" unit="mm" />
-      <rotation name="module_L5t_halfmodule_axial_sensor_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
+      <rotation name="module_L5t_halfmodule_axial_sensor_rotation" x="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
       <position name="module_L5t_halfmodule_axial_sensor_active_position" x="0.0" y="0.0" z="0.0" unit="mm" />
       <rotation name="module_L5t_halfmodule_axial_sensor_active_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L5t_halfmodule_axial_lamination_position" x="0.5" y="0.66875" z="2.414999999999999" unit="mm" />
@@ -377,12 +388,10 @@
       <rotation name="module_L5t_halfmodule_axial_cf_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L5t_halfmodule_axial_hybrid_position" x="-55.0" y="-0.1499999999999999" z="3.4149999999999956" unit="mm" />
       <rotation name="module_L5t_halfmodule_axial_hybrid_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
-      <position name="module_L5t_coldblock_position" x="-61.599999999999994" y="0.0" z="-1.1499999999999986" unit="mm" />
-      <rotation name="module_L5t_coldblock_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
-      <position name="module_L5t_halfmodule_stereo_position" x="1.016813325091647" y="3.9437499999999996" z="3.0933570611284615" unit="mm" />
-      <rotation name="module_L5t_halfmodule_stereo_rotation" x="3.141592653589793" y="-0.05" z="-3.856679734182209E-34" unit="radian" />
+      <position name="module_L5t_halfmodule_stereo_position" x="-3.983186674908353" y="3.9437500000000005" z="-1.4066429388715385" unit="mm" />
+      <rotation name="module_L5t_halfmodule_stereo_rotation" x="-3.141592653589793" y="-0.04999999999999999" z="-6.128341798596887E-18" unit="radian" />
       <position name="module_L5t_halfmodule_stereo_sensor_position" x="30.0" y="0.48375" z="3.414999999999999" unit="mm" />
-      <rotation name="module_L5t_halfmodule_stereo_sensor_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
+      <rotation name="module_L5t_halfmodule_stereo_sensor_rotation" x="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
       <position name="module_L5t_halfmodule_stereo_sensor_active_position" x="0.0" y="0.0" z="0.0" unit="mm" />
       <rotation name="module_L5t_halfmodule_stereo_sensor_active_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L5t_halfmodule_stereo_lamination_position" x="0.5" y="0.66875" z="2.414999999999999" unit="mm" />
@@ -391,19 +400,930 @@
       <rotation name="module_L5t_halfmodule_stereo_cf_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
       <position name="module_L5t_halfmodule_stereo_hybrid_position" x="-55.0" y="-0.1499999999999999" z="3.4149999999999956" unit="mm" />
       <rotation name="module_L5t_halfmodule_stereo_hybrid_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
+      <position name="TestRunModuleFieldDefVolume_component0_position" x="0.0" y="0.0" z="0.0" unit="mm" />
+      <rotation name="TestRunModuleFieldDefVolume_component0_rotation" x="0.0" y="0.0" z="0.0" unit="radian" />
+      <position name="TestRunModuleFieldDefVolume_component0Sensor0Position" x="0.0" y="0.0" z="0.0" unit="mm" />
+      <rotation name="TestRunModuleFieldDefVolume_component0Sensor0Rotation" x="0.0" y="0.0" z="0.0" unit="radian" />
+      <position name="TrackerFieldDef_TestRunModuleFieldDef_layer1_module0_position" x="0.0" y="0.0" z="0.0" unit="mm" />
+      <rotation name="TrackerFieldDef_TestRunModuleFieldDef_layer1_module0_rotation" x="0.0" y="0.0" z="-1.5707963267948966" unit="radian" />
+      <position name="TrackerFieldDef_TestRunModuleFieldDef_layer2_module0_position" x="0.0" y="0.0" z="914.4" unit="mm" />
+      <rotation name="TrackerFieldDef_TestRunModuleFieldDef_layer2_module0_rotation" x="0.0" y="0.0" z="-1.5707963267948966" unit="radian" />
+      <position name="crystal1-1_pos_pos_bot" x="48.79473927539554" y="-51.17473927539554" z="1550.1626281236922" unit="mm" />
+      <rotation name="crystal1-1_rot_pos_bot" x="-0.0084372997827221" y="-0.0084372997827221" z="0.0" unit="radian" />
+      <position name="crystal1-1_pos_neg_bot" x="33.745260724604464" y="-51.17473927539554" z="1550.1626281236922" unit="mm" />
+      <rotation name="crystal1-1_rot_neg_bot" x="-0.0084372997827221" y="0.0084372997827221" z="0.0" unit="radian" />
+      <position name="crystal1-1_pos_pos_top" x="48.79473927539554" y="51.17473927539554" z="1550.1626281236922" unit="mm" />
+      <rotation name="crystal1-1_rot_pos_top" x="0.0084372997827221" y="-0.0084372997827221" z="0.0" unit="radian" />
+      <position name="crystal1-1_pos_neg_top" x="33.745260724604464" y="51.17473927539554" z="1550.1626281236922" unit="mm" />
+      <rotation name="crystal1-1_rot_neg_top" x="0.0084372997827221" y="0.0084372997827221" z="0.0" unit="radian" />
+      <position name="crystal2-1_pos_pos_bot" x="63.647812877938534" y="-51.17473927539554" z="1550.2520480856124" unit="mm" />
+      <rotation name="crystal2-1_rot_pos_bot" x="-0.0084372997827221" y="-0.0253118993481663" z="0.0" unit="radian" />
+      <position name="crystal2-1_pos_pos_top" x="63.647812877938534" y="51.17473927539554" z="1550.2520480856124" unit="mm" />
+      <rotation name="crystal2-1_rot_pos_top" x="0.0084372997827221" y="-0.0253118993481663" z="0.0" unit="radian" />
+      <position name="crystal3-1_pos_pos_bot" x="78.5078868703981" y="-51.17473927539554" z="1550.3186477918262" unit="mm" />
+      <rotation name="crystal3-1_rot_pos_bot" x="-0.0084372997827221" y="-0.042186498913610496" z="0.0" unit="radian" />
+      <position name="crystal3-1_pos_pos_top" x="78.5078868703981" y="51.17473927539554" z="1550.3186477918262" unit="mm" />
+      <rotation name="crystal3-1_rot_pos_top" x="0.0084372997827221" y="-0.042186498913610496" z="0.0" unit="radian" />
+      <position name="crystal4-1_pos_pos_bot" x="93.378374317979" y="-51.17473927539554" z="1550.3624082783765" unit="mm" />
+      <rotation name="crystal4-1_rot_pos_bot" x="-0.0084372997827221" y="-0.0590610984790547" z="0.0" unit="radian" />
+      <position name="crystal4-1_pos_pos_top" x="93.378374317979" y="51.17473927539554" z="1550.3624082783765" unit="mm" />
+      <rotation name="crystal4-1_rot_pos_top" x="0.0084372997827221" y="-0.0590610984790547" z="0.0" unit="radian" />
+      <position name="crystal5-1_pos_pos_bot" x="108.26270155521061" y="-51.17473927539554" z="1550.3833170846683" unit="mm" />
+      <rotation name="crystal5-1_rot_pos_bot" x="-0.0084372997827221" y="-0.0759356980444989" z="0.0" unit="radian" />
+      <position name="crystal5-1_pos_pos_top" x="108.26270155521061" y="51.17473927539554" z="1550.3833170846683" unit="mm" />
+      <rotation name="crystal5-1_rot_pos_top" x="0.0084372997827221" y="-0.0759356980444989" z="0.0" unit="radian" />
+      <position name="crystal6-1_pos_pos_bot" x="123.16431377551496" y="-51.17473927539554" z="1550.381368257016" unit="mm" />
+      <rotation name="crystal6-1_rot_pos_bot" x="-0.0084372997827221" y="-0.0928102976099431" z="0.0" unit="radian" />
+      <position name="crystal6-1_pos_pos_top" x="123.16431377551496" y="51.17473927539554" z="1550.381368257016" unit="mm" />
+      <rotation name="crystal6-1_rot_pos_top" x="0.0084372997827221" y="-0.0928102976099431" z="0.0" unit="radian" />
+      <position name="crystal7-1_pos_pos_bot" x="138.0866806873399" y="-51.17473927539554" z="1550.3565623503396" unit="mm" />
+      <rotation name="crystal7-1_rot_pos_bot" x="-0.0084372997827221" y="-0.10968489717538729" z="0.0" unit="radian" />
+      <position name="crystal7-1_pos_pos_top" x="138.0866806873399" y="51.17473927539554" z="1550.3565623503396" unit="mm" />
+      <rotation name="crystal7-1_rot_pos_top" x="0.0084372997827221" y="-0.10968489717538729" z="0.0" unit="radian" />
+      <position name="crystal8-1_pos_pos_bot" x="153.03330225657226" y="-51.17473927539554" z="1550.3089064280052" unit="mm" />
+      <rotation name="crystal8-1_rot_pos_bot" x="-0.0084372997827221" y="-0.1265594967408315" z="0.0" unit="radian" />
+      <position name="crystal8-1_pos_pos_top" x="153.03330225657226" y="51.17473927539554" z="1550.3089064280052" unit="mm" />
+      <rotation name="crystal8-1_rot_pos_top" x="0.0084372997827221" y="-0.1265594967408315" z="0.0" unit="radian" />
+      <position name="crystal9-1_pos_pos_bot" x="168.00771455551202" y="-51.17473927539554" z="1550.2384140598156" unit="mm" />
+      <rotation name="crystal9-1_rot_pos_bot" x="-0.0084372997827221" y="-0.14343409630627568" z="0.0" unit="radian" />
+      <position name="crystal9-1_pos_pos_top" x="168.00771455551202" y="51.17473927539554" z="1550.2384140598156" unit="mm" />
+      <rotation name="crystal9-1_rot_pos_top" x="0.0084372997827221" y="-0.14343409630627568" z="0.0" unit="radian" />
+      <position name="crystal10-1_pos_pos_bot" x="183.01349573939376" y="-51.17473927539554" z="1550.1451053181452" unit="mm" />
+      <rotation name="crystal10-1_rot_pos_bot" x="-0.0084372997827221" y="-0.1603086958717199" z="0.0" unit="radian" />
+      <position name="crystal10-1_pos_pos_top" x="183.01349573939376" y="51.17473927539554" z="1550.1451053181452" unit="mm" />
+      <rotation name="crystal10-1_rot_pos_top" x="0.0084372997827221" y="-0.1603086958717199" z="0.0" unit="radian" />
+      <position name="crystal11-1_pos_pos_bot" x="198.05427217228873" y="-51.17473927539554" z="1550.0290067722244" unit="mm" />
+      <rotation name="crystal11-1_rot_pos_bot" x="-0.0084372997827221" y="-0.1771832954371641" z="0.0" unit="radian" />
+      <position name="crystal11-1_pos_neg_bot" x="-115.51427217228871" y="-51.17473927539554" z="1550.0290067722244" unit="mm" />
+      <rotation name="crystal11-1_rot_neg_bot" x="-0.0084372997827221" y="0.1771832954371641" z="0.0" unit="radian" />
+      <position name="crystal11-1_pos_pos_top" x="198.05427217228873" y="51.17473927539554" z="1550.0290067722244" unit="mm" />
+      <rotation name="crystal11-1_rot_pos_top" x="0.0084372997827221" y="-0.1771832954371641" z="0.0" unit="radian" />
+      <position name="crystal11-1_pos_neg_top" x="-115.51427217228871" y="51.17473927539554" z="1550.0290067722244" unit="mm" />
+      <rotation name="crystal11-1_rot_neg_top" x="0.0084372997827221" y="0.1771832954371641" z="0.0" unit="radian" />
+      <position name="crystal12-1_pos_pos_bot" x="213.1337247252268" y="-51.17473927539554" z="1549.8901514805746" unit="mm" />
+      <rotation name="crystal12-1_rot_pos_bot" x="-0.0084372997827221" y="-0.19405789500260828" z="0.0" unit="radian" />
+      <position name="crystal12-1_pos_neg_bot" x="-130.5937247252268" y="-51.17473927539554" z="1549.8901514805746" unit="mm" />
+      <rotation name="crystal12-1_rot_neg_bot" x="-0.0084372997827221" y="0.19405789500260828" z="0.0" unit="radian" />
+      <position name="crystal12-1_pos_pos_top" x="213.1337247252268" y="51.17473927539554" z="1549.8901514805746" unit="mm" />
+      <rotation name="crystal12-1_rot_pos_top" x="0.0084372997827221" y="-0.19405789500260828" z="0.0" unit="radian" />
+      <position name="crystal12-1_pos_neg_top" x="-130.5937247252268" y="51.17473927539554" z="1549.8901514805746" unit="mm" />
+      <rotation name="crystal12-1_rot_neg_top" x="0.0084372997827221" y="0.19405789500260828" z="0.0" unit="radian" />
+      <position name="crystal13-1_pos_pos_bot" x="228.25559527054568" y="-51.17473927539554" z="1549.7285789815953" unit="mm" />
+      <rotation name="crystal13-1_rot_pos_bot" x="-0.0084372997827221" y="-0.2109324945680525" z="0.0" unit="radian" />
+      <position name="crystal13-1_pos_neg_bot" x="-145.71559527054566" y="-51.17473927539554" z="1549.7285789815953" unit="mm" />
+      <rotation name="crystal13-1_rot_neg_bot" x="-0.0084372997827221" y="0.2109324945680525" z="0.0" unit="radian" />
+      <position name="crystal13-1_pos_pos_top" x="228.25559527054568" y="51.17473927539554" z="1549.7285789815953" unit="mm" />
+      <rotation name="crystal13-1_rot_pos_top" x="0.0084372997827221" y="-0.2109324945680525" z="0.0" unit="radian" />
+      <position name="crystal13-1_pos_neg_top" x="-145.71559527054566" y="51.17473927539554" z="1549.7285789815953" unit="mm" />
+      <rotation name="crystal13-1_rot_neg_top" x="0.0084372997827221" y="0.2109324945680525" z="0.0" unit="radian" />
+      <position name="crystal14-1_pos_pos_bot" x="243.42369339782218" y="-51.17473927539554" z="1549.5443352823047" unit="mm" />
+      <rotation name="crystal14-1_rot_pos_bot" x="-0.0084372997827221" y="-0.22780709413349667" z="0.0" unit="radian" />
+      <position name="crystal14-1_pos_neg_bot" x="-160.88369339782216" y="-51.17473927539554" z="1549.5443352823047" unit="mm" />
+      <rotation name="crystal14-1_rot_neg_bot" x="-0.0084372997827221" y="0.22780709413349667" z="0.0" unit="radian" />
+      <position name="crystal14-1_pos_pos_top" x="243.42369339782218" y="51.17473927539554" z="1549.5443352823047" unit="mm" />
+      <rotation name="crystal14-1_rot_pos_top" x="0.0084372997827221" y="-0.22780709413349667" z="0.0" unit="radian" />
+      <position name="crystal14-1_pos_neg_top" x="-160.88369339782216" y="51.17473927539554" z="1549.5443352823047" unit="mm" />
+      <rotation name="crystal14-1_rot_neg_top" x="0.0084372997827221" y="0.22780709413349667" z="0.0" unit="radian" />
+      <position name="crystal15-1_pos_pos_bot" x="258.6419033782828" y="-51.17473927539554" z="1549.3374728452397" unit="mm" />
+      <rotation name="crystal15-1_rot_pos_bot" x="-0.0084372997827221" y="-0.24468169369894088" z="0.0" unit="radian" />
+      <position name="crystal15-1_pos_neg_bot" x="-176.1019033782828" y="-51.17473927539554" z="1549.3374728452397" unit="mm" />
+      <rotation name="crystal15-1_rot_neg_bot" x="-0.0084372997827221" y="0.24468169369894088" z="0.0" unit="radian" />
+      <position name="crystal15-1_pos_pos_top" x="258.6419033782828" y="51.17473927539554" z="1549.3374728452397" unit="mm" />
+      <rotation name="crystal15-1_rot_pos_top" x="0.0084372997827221" y="-0.24468169369894088" z="0.0" unit="radian" />
+      <position name="crystal15-1_pos_neg_top" x="-176.1019033782828" y="51.17473927539554" z="1549.3374728452397" unit="mm" />
+      <rotation name="crystal15-1_rot_neg_top" x="0.0084372997827221" y="0.24468169369894088" z="0.0" unit="radian" />
+      <position name="crystal16-1_pos_pos_bot" x="273.91419140634014" y="-51.17473927539554" z="1549.108050573519" unit="mm" />
+      <rotation name="crystal16-1_rot_pos_bot" x="-0.0084372997827221" y="-0.26155629326438506" z="0.0" unit="radian" />
+      <position name="crystal16-1_pos_neg_bot" x="-191.37419140634015" y="-51.17473927539554" z="1549.108050573519" unit="mm" />
+      <rotation name="crystal16-1_rot_neg_bot" x="-0.0084372997827221" y="0.26155629326438506" z="0.0" unit="radian" />
+      <position name="crystal16-1_pos_pos_top" x="273.91419140634014" y="51.17473927539554" z="1549.108050573519" unit="mm" />
+      <rotation name="crystal16-1_rot_pos_top" x="0.0084372997827221" y="-0.26155629326438506" z="0.0" unit="radian" />
+      <position name="crystal16-1_pos_neg_top" x="-191.37419140634015" y="51.17473927539554" z="1549.108050573519" unit="mm" />
+      <rotation name="crystal16-1_rot_neg_top" x="0.0084372997827221" y="0.26155629326438506" z="0.0" unit="radian" />
+      <position name="crystal17-1_pos_pos_bot" x="289.2446131488872" y="-51.17473927539554" z="1548.8561337940675" unit="mm" />
+      <rotation name="crystal17-1_rot_pos_bot" x="-0.0084372997827221" y="-0.2784308928298293" z="0.0" unit="radian" />
+      <position name="crystal17-1_pos_neg_bot" x="-206.7046131488872" y="-51.17473927539554" z="1548.8561337940675" unit="mm" />
+      <rotation name="crystal17-1_rot_neg_bot" x="-0.0084372997827221" y="0.2784308928298293" z="0.0" unit="radian" />
+      <position name="crystal17-1_pos_pos_top" x="289.2446131488872" y="51.17473927539554" z="1548.8561337940675" unit="mm" />
+      <rotation name="crystal17-1_rot_pos_top" x="0.0084372997827221" y="-0.2784308928298293" z="0.0" unit="radian" />
+      <position name="crystal17-1_pos_neg_top" x="-206.7046131488872" y="51.17473927539554" z="1548.8561337940675" unit="mm" />
+      <rotation name="crystal17-1_rot_neg_top" x="0.0084372997827221" y="0.2784308928298293" z="0.0" unit="radian" />
+      <position name="crystal18-1_pos_pos_bot" x="304.63732163521667" y="-51.17473927539554" z="1548.581794239018" unit="mm" />
+      <rotation name="crystal18-1_rot_pos_bot" x="-0.0084372997827221" y="-0.2953054923952735" z="0.0" unit="radian" />
+      <position name="crystal18-1_pos_neg_bot" x="-222.09732163521667" y="-51.17473927539554" z="1548.581794239018" unit="mm" />
+      <rotation name="crystal18-1_rot_neg_bot" x="-0.0084372997827221" y="0.2953054923952735" z="0.0" unit="radian" />
+      <position name="crystal18-1_pos_pos_top" x="304.63732163521667" y="51.17473927539554" z="1548.581794239018" unit="mm" />
+      <rotation name="crystal18-1_rot_pos_top" x="0.0084372997827221" y="-0.2953054923952735" z="0.0" unit="radian" />
+      <position name="crystal18-1_pos_neg_top" x="-222.09732163521667" y="51.17473927539554" z="1548.581794239018" unit="mm" />
+      <rotation name="crystal18-1_rot_neg_top" x="0.0084372997827221" y="0.2953054923952735" z="0.0" unit="radian" />
+      <position name="crystal19-1_pos_pos_bot" x="320.09657552295215" y="-51.17473927539554" z="1548.2851100252847" unit="mm" />
+      <rotation name="crystal19-1_rot_pos_bot" x="-0.0084372997827221" y="-0.31218009196071766" z="0.0" unit="radian" />
+      <position name="crystal19-1_pos_neg_bot" x="-237.55657552295216" y="-51.17473927539554" z="1548.2851100252847" unit="mm" />
+      <rotation name="crystal19-1_rot_neg_bot" x="-0.0084372997827221" y="0.31218009196071766" z="0.0" unit="radian" />
+      <position name="crystal19-1_pos_pos_top" x="320.09657552295215" y="51.17473927539554" z="1548.2851100252847" unit="mm" />
+      <rotation name="crystal19-1_rot_pos_top" x="0.0084372997827221" y="-0.31218009196071766" z="0.0" unit="radian" />
+      <position name="crystal19-1_pos_neg_top" x="-237.55657552295216" y="51.17473927539554" z="1548.2851100252847" unit="mm" />
+      <rotation name="crystal19-1_rot_neg_top" x="0.0084372997827221" y="0.31218009196071766" z="0.0" unit="radian" />
+      <position name="crystal20-1_pos_pos_bot" x="335.62674777820644" y="-51.17473927539554" z="1547.9661656323178" unit="mm" />
+      <rotation name="crystal20-1_rot_pos_bot" x="-0.0084372997827221" y="-0.3290546915261619" z="0.0" unit="radian" />
+      <position name="crystal20-1_pos_neg_bot" x="-253.08674777820644" y="-51.17473927539554" z="1547.9661656323178" unit="mm" />
+      <rotation name="crystal20-1_rot_neg_bot" x="-0.0084372997827221" y="0.3290546915261619" z="0.0" unit="radian" />
+      <position name="crystal20-1_pos_pos_top" x="335.62674777820644" y="51.17473927539554" z="1547.9661656323178" unit="mm" />
+      <rotation name="crystal20-1_rot_pos_top" x="0.0084372997827221" y="-0.3290546915261619" z="0.0" unit="radian" />
+      <position name="crystal20-1_pos_neg_top" x="-253.08674777820644" y="51.17473927539554" z="1547.9661656323178" unit="mm" />
+      <rotation name="crystal20-1_rot_neg_top" x="0.0084372997827221" y="0.3290546915261619" z="0.0" unit="radian" />
+      <position name="crystal21-1_pos_pos_bot" x="351.2323348113603" y="-51.17473927539554" z="1547.625051878052" unit="mm" />
+      <rotation name="crystal21-1_rot_pos_bot" x="-0.0084372997827221" y="-0.3459292910916061" z="0.0" unit="radian" />
+      <position name="crystal21-1_pos_neg_bot" x="-268.69233481136035" y="-51.17473927539554" z="1547.625051878052" unit="mm" />
+      <rotation name="crystal21-1_rot_neg_bot" x="-0.0084372997827221" y="0.3459292910916061" z="0.0" unit="radian" />
+      <position name="crystal21-1_pos_pos_top" x="351.2323348113603" y="51.17473927539554" z="1547.625051878052" unit="mm" />
+      <rotation name="crystal21-1_rot_pos_top" x="0.0084372997827221" y="-0.3459292910916061" z="0.0" unit="radian" />
+      <position name="crystal21-1_pos_neg_top" x="-268.69233481136035" y="51.17473927539554" z="1547.625051878052" unit="mm" />
+      <rotation name="crystal21-1_rot_neg_top" x="0.0084372997827221" y="0.3459292910916061" z="0.0" unit="radian" />
+      <position name="crystal22-1_pos_pos_bot" x="366.91796611341823" y="-51.17473927539554" z="1547.2618658930442" unit="mm" />
+      <rotation name="crystal22-1_rot_pos_bot" x="-0.0084372997827221" y="-0.36280389065705027" z="0.0" unit="radian" />
+      <position name="crystal22-1_pos_neg_bot" x="-284.37796611341827" y="-51.17473927539554" z="1547.2618658930442" unit="mm" />
+      <rotation name="crystal22-1_rot_neg_bot" x="-0.0084372997827221" y="0.36280389065705027" z="0.0" unit="radian" />
+      <position name="crystal22-1_pos_pos_top" x="366.91796611341823" y="51.17473927539554" z="1547.2618658930442" unit="mm" />
+      <rotation name="crystal22-1_rot_pos_top" x="0.0084372997827221" y="-0.36280389065705027" z="0.0" unit="radian" />
+      <position name="crystal22-1_pos_neg_top" x="-284.37796611341827" y="51.17473927539554" z="1547.2618658930442" unit="mm" />
+      <rotation name="crystal22-1_rot_neg_top" x="0.0084372997827221" y="0.36280389065705027" z="0.0" unit="radian" />
+      <position name="crystal23-1_pos_pos_bot" x="382.688414441894" y="-51.17473927539554" z="1546.8767110928152" unit="mm" />
+      <rotation name="crystal23-1_rot_pos_bot" x="-0.0084372997827221" y="-0.3796784902224945" z="0.0" unit="radian" />
+      <position name="crystal23-1_pos_neg_bot" x="-300.14841444189403" y="-51.17473927539554" z="1546.8767110928152" unit="mm" />
+      <rotation name="crystal23-1_rot_neg_bot" x="-0.0084372997827221" y="0.3796784902224945" z="0.0" unit="radian" />
+      <position name="crystal23-1_pos_pos_top" x="382.688414441894" y="51.17473927539554" z="1546.8767110928152" unit="mm" />
+      <rotation name="crystal23-1_rot_pos_top" x="0.0084372997827221" y="-0.3796784902224945" z="0.0" unit="radian" />
+      <position name="crystal23-1_pos_neg_top" x="-300.14841444189403" y="51.17473927539554" z="1546.8767110928152" unit="mm" />
+      <rotation name="crystal23-1_rot_neg_top" x="0.0084372997827221" y="0.3796784902224945" z="0.0" unit="radian" />
+      <position name="crystal1-2_pos_pos_bot" x="48.79473927539554" y="-66.17781287793854" z="1550.2520480856124" unit="mm" />
+      <rotation name="crystal1-2_rot_pos_bot" x="-0.0253118993481663" y="-0.0084372997827221" z="0.0" unit="radian" />
+      <position name="crystal1-2_pos_neg_bot" x="33.745260724604464" y="-66.17781287793854" z="1550.2520480856124" unit="mm" />
+      <rotation name="crystal1-2_rot_neg_bot" x="-0.0253118993481663" y="0.0084372997827221" z="0.0" unit="radian" />
+      <position name="crystal1-2_pos_pos_top" x="48.79473927539554" y="66.17781287793854" z="1550.2520480856124" unit="mm" />
+      <rotation name="crystal1-2_rot_pos_top" x="0.0253118993481663" y="-0.0084372997827221" z="0.0" unit="radian" />
+      <position name="crystal1-2_pos_neg_top" x="33.745260724604464" y="66.17781287793854" z="1550.2520480856124" unit="mm" />
+      <rotation name="crystal1-2_rot_neg_top" x="0.0253118993481663" y="0.0084372997827221" z="0.0" unit="radian" />
+      <position name="crystal2-2_pos_pos_bot" x="63.647812877938534" y="-66.17781287793854" z="1550.3414680475323" unit="mm" />
+      <rotation name="crystal2-2_rot_pos_bot" x="-0.0253118993481663" y="-0.0253118993481663" z="0.0" unit="radian" />
+      <position name="crystal2-2_pos_neg_bot" x="18.89218712206147" y="-66.17781287793854" z="1550.3414680475323" unit="mm" />
+      <rotation name="crystal2-2_rot_neg_bot" x="-0.0253118993481663" y="0.0253118993481663" z="0.0" unit="radian" />
+      <position name="crystal2-2_pos_pos_top" x="63.647812877938534" y="66.17781287793854" z="1550.3414680475323" unit="mm" />
+      <rotation name="crystal2-2_rot_pos_top" x="0.0253118993481663" y="-0.0253118993481663" z="0.0" unit="radian" />
+      <position name="crystal2-2_pos_neg_top" x="18.89218712206147" y="66.17781287793854" z="1550.3414680475323" unit="mm" />
+      <rotation name="crystal2-2_rot_neg_top" x="0.0253118993481663" y="0.0253118993481663" z="0.0" unit="radian" />
+      <position name="crystal3-2_pos_pos_bot" x="78.5078868703981" y="-66.17781287793854" z="1550.4080677537463" unit="mm" />
+      <rotation name="crystal3-2_rot_pos_bot" x="-0.0253118993481663" y="-0.042186498913610496" z="0.0" unit="radian" />
+      <position name="crystal3-2_pos_neg_bot" x="4.0321131296019175" y="-66.17781287793854" z="1550.4080677537463" unit="mm" />
+      <rotation name="crystal3-2_rot_neg_bot" x="-0.0253118993481663" y="0.042186498913610496" z="0.0" unit="radian" />
+      <position name="crystal3-2_pos_pos_top" x="78.5078868703981" y="66.17781287793854" z="1550.4080677537463" unit="mm" />
+      <rotation name="crystal3-2_rot_pos_top" x="0.0253118993481663" y="-0.042186498913610496" z="0.0" unit="radian" />
+      <position name="crystal3-2_pos_neg_top" x="4.0321131296019175" y="66.17781287793854" z="1550.4080677537463" unit="mm" />
+      <rotation name="crystal3-2_rot_neg_top" x="0.0253118993481663" y="0.042186498913610496" z="0.0" unit="radian" />
+      <position name="crystal4-2_pos_pos_bot" x="93.378374317979" y="-66.17781287793854" z="1550.4518282402964" unit="mm" />
+      <rotation name="crystal4-2_rot_pos_bot" x="-0.0253118993481663" y="-0.0590610984790547" z="0.0" unit="radian" />
+      <position name="crystal4-2_pos_neg_bot" x="-10.838374317978996" y="-66.17781287793854" z="1550.4518282402964" unit="mm" />
+      <rotation name="crystal4-2_rot_neg_bot" x="-0.0253118993481663" y="0.0590610984790547" z="0.0" unit="radian" />
+      <position name="crystal4-2_pos_pos_top" x="93.378374317979" y="66.17781287793854" z="1550.4518282402964" unit="mm" />
+      <rotation name="crystal4-2_rot_pos_top" x="0.0253118993481663" y="-0.0590610984790547" z="0.0" unit="radian" />
+      <position name="crystal4-2_pos_neg_top" x="-10.838374317978996" y="66.17781287793854" z="1550.4518282402964" unit="mm" />
+      <rotation name="crystal4-2_rot_neg_top" x="0.0253118993481663" y="0.0590610984790547" z="0.0" unit="radian" />
+      <position name="crystal5-2_pos_pos_bot" x="108.26270155521061" y="-66.17781287793854" z="1550.4727370465882" unit="mm" />
+      <rotation name="crystal5-2_rot_pos_bot" x="-0.0253118993481663" y="-0.0759356980444989" z="0.0" unit="radian" />
+      <position name="crystal5-2_pos_neg_bot" x="-25.722701555210598" y="-66.17781287793854" z="1550.4727370465882" unit="mm" />
+      <rotation name="crystal5-2_rot_neg_bot" x="-0.0253118993481663" y="0.0759356980444989" z="0.0" unit="radian" />
+      <position name="crystal5-2_pos_pos_top" x="108.26270155521061" y="66.17781287793854" z="1550.4727370465882" unit="mm" />
+      <rotation name="crystal5-2_rot_pos_top" x="0.0253118993481663" y="-0.0759356980444989" z="0.0" unit="radian" />
+      <position name="crystal5-2_pos_neg_top" x="-25.722701555210598" y="66.17781287793854" z="1550.4727370465882" unit="mm" />
+      <rotation name="crystal5-2_rot_neg_top" x="0.0253118993481663" y="0.0759356980444989" z="0.0" unit="radian" />
+      <position name="crystal6-2_pos_pos_bot" x="123.16431377551496" y="-66.17781287793854" z="1550.4707882189361" unit="mm" />
+      <rotation name="crystal6-2_rot_pos_bot" x="-0.0253118993481663" y="-0.0928102976099431" z="0.0" unit="radian" />
+      <position name="crystal6-2_pos_neg_bot" x="-40.62431377551494" y="-66.17781287793854" z="1550.4707882189361" unit="mm" />
+      <rotation name="crystal6-2_rot_neg_bot" x="-0.0253118993481663" y="0.0928102976099431" z="0.0" unit="radian" />
+      <position name="crystal6-2_pos_pos_top" x="123.16431377551496" y="66.17781287793854" z="1550.4707882189361" unit="mm" />
+      <rotation name="crystal6-2_rot_pos_top" x="0.0253118993481663" y="-0.0928102976099431" z="0.0" unit="radian" />
+      <position name="crystal6-2_pos_neg_top" x="-40.62431377551494" y="66.17781287793854" z="1550.4707882189361" unit="mm" />
+      <rotation name="crystal6-2_rot_neg_top" x="0.0253118993481663" y="0.0928102976099431" z="0.0" unit="radian" />
+      <position name="crystal7-2_pos_pos_bot" x="138.0866806873399" y="-66.17781287793854" z="1550.4459823122595" unit="mm" />
+      <rotation name="crystal7-2_rot_pos_bot" x="-0.0253118993481663" y="-0.10968489717538729" z="0.0" unit="radian" />
+      <position name="crystal7-2_pos_neg_bot" x="-55.546680687339894" y="-66.17781287793854" z="1550.4459823122595" unit="mm" />
+      <rotation name="crystal7-2_rot_neg_bot" x="-0.0253118993481663" y="0.10968489717538729" z="0.0" unit="radian" />
+      <position name="crystal7-2_pos_pos_top" x="138.0866806873399" y="66.17781287793854" z="1550.4459823122595" unit="mm" />
+      <rotation name="crystal7-2_rot_pos_top" x="0.0253118993481663" y="-0.10968489717538729" z="0.0" unit="radian" />
+      <position name="crystal7-2_pos_neg_top" x="-55.546680687339894" y="66.17781287793854" z="1550.4459823122595" unit="mm" />
+      <rotation name="crystal7-2_rot_neg_top" x="0.0253118993481663" y="0.10968489717538729" z="0.0" unit="radian" />
+      <position name="crystal8-2_pos_pos_bot" x="153.03330225657226" y="-66.17781287793854" z="1550.3983263899254" unit="mm" />
+      <rotation name="crystal8-2_rot_pos_bot" x="-0.0253118993481663" y="-0.1265594967408315" z="0.0" unit="radian" />
+      <position name="crystal8-2_pos_neg_bot" x="-70.49330225657226" y="-66.17781287793854" z="1550.3983263899254" unit="mm" />
+      <rotation name="crystal8-2_rot_neg_bot" x="-0.0253118993481663" y="0.1265594967408315" z="0.0" unit="radian" />
+      <position name="crystal8-2_pos_pos_top" x="153.03330225657226" y="66.17781287793854" z="1550.3983263899254" unit="mm" />
+      <rotation name="crystal8-2_rot_pos_top" x="0.0253118993481663" y="-0.1265594967408315" z="0.0" unit="radian" />
+      <position name="crystal8-2_pos_neg_top" x="-70.49330225657226" y="66.17781287793854" z="1550.3983263899254" unit="mm" />
+      <rotation name="crystal8-2_rot_neg_top" x="0.0253118993481663" y="0.1265594967408315" z="0.0" unit="radian" />
+      <position name="crystal9-2_pos_pos_bot" x="168.00771455551202" y="-66.17781287793854" z="1550.3278340217357" unit="mm" />
+      <rotation name="crystal9-2_rot_pos_bot" x="-0.0253118993481663" y="-0.14343409630627568" z="0.0" unit="radian" />
+      <position name="crystal9-2_pos_neg_bot" x="-85.467714555512" y="-66.17781287793854" z="1550.3278340217357" unit="mm" />
+      <rotation name="crystal9-2_rot_neg_bot" x="-0.0253118993481663" y="0.14343409630627568" z="0.0" unit="radian" />
+      <position name="crystal9-2_pos_pos_top" x="168.00771455551202" y="66.17781287793854" z="1550.3278340217357" unit="mm" />
+      <rotation name="crystal9-2_rot_pos_top" x="0.0253118993481663" y="-0.14343409630627568" z="0.0" unit="radian" />
+      <position name="crystal9-2_pos_neg_top" x="-85.467714555512" y="66.17781287793854" z="1550.3278340217357" unit="mm" />
+      <rotation name="crystal9-2_rot_neg_top" x="0.0253118993481663" y="0.14343409630627568" z="0.0" unit="radian" />
+      <position name="crystal10-2_pos_pos_bot" x="183.01349573939376" y="-66.17781287793854" z="1550.2345252800653" unit="mm" />
+      <rotation name="crystal10-2_rot_pos_bot" x="-0.0253118993481663" y="-0.1603086958717199" z="0.0" unit="radian" />
+      <position name="crystal10-2_pos_neg_bot" x="-100.47349573939374" y="-66.17781287793854" z="1550.2345252800653" unit="mm" />
+      <rotation name="crystal10-2_rot_neg_bot" x="-0.0253118993481663" y="0.1603086958717199" z="0.0" unit="radian" />
+      <position name="crystal10-2_pos_pos_top" x="183.01349573939376" y="66.17781287793854" z="1550.2345252800653" unit="mm" />
+      <rotation name="crystal10-2_rot_pos_top" x="0.0253118993481663" y="-0.1603086958717199" z="0.0" unit="radian" />
+      <position name="crystal10-2_pos_neg_top" x="-100.47349573939374" y="66.17781287793854" z="1550.2345252800653" unit="mm" />
+      <rotation name="crystal10-2_rot_neg_top" x="0.0253118993481663" y="0.1603086958717199" z="0.0" unit="radian" />
+      <position name="crystal11-2_pos_pos_bot" x="198.05427217228873" y="-66.17781287793854" z="1550.1184267341444" unit="mm" />
+      <rotation name="crystal11-2_rot_pos_bot" x="-0.0253118993481663" y="-0.1771832954371641" z="0.0" unit="radian" />
+      <position name="crystal11-2_pos_neg_bot" x="-115.51427217228871" y="-66.17781287793854" z="1550.1184267341444" unit="mm" />
+      <rotation name="crystal11-2_rot_neg_bot" x="-0.0253118993481663" y="0.1771832954371641" z="0.0" unit="radian" />
+      <position name="crystal11-2_pos_pos_top" x="198.05427217228873" y="66.17781287793854" z="1550.1184267341444" unit="mm" />
+      <rotation name="crystal11-2_rot_pos_top" x="0.0253118993481663" y="-0.1771832954371641" z="0.0" unit="radian" />
+      <position name="crystal11-2_pos_neg_top" x="-115.51427217228871" y="66.17781287793854" z="1550.1184267341444" unit="mm" />
+      <rotation name="crystal11-2_rot_neg_top" x="0.0253118993481663" y="0.1771832954371641" z="0.0" unit="radian" />
+      <position name="crystal12-2_pos_pos_bot" x="213.1337247252268" y="-66.17781287793854" z="1549.9795714424947" unit="mm" />
+      <rotation name="crystal12-2_rot_pos_bot" x="-0.0253118993481663" y="-0.19405789500260828" z="0.0" unit="radian" />
+      <position name="crystal12-2_pos_neg_bot" x="-130.5937247252268" y="-66.17781287793854" z="1549.9795714424947" unit="mm" />
+      <rotation name="crystal12-2_rot_neg_bot" x="-0.0253118993481663" y="0.19405789500260828" z="0.0" unit="radian" />
+      <position name="crystal12-2_pos_pos_top" x="213.1337247252268" y="66.17781287793854" z="1549.9795714424947" unit="mm" />
+      <rotation name="crystal12-2_rot_pos_top" x="0.0253118993481663" y="-0.19405789500260828" z="0.0" unit="radian" />
+      <position name="crystal12-2_pos_neg_top" x="-130.5937247252268" y="66.17781287793854" z="1549.9795714424947" unit="mm" />
+      <rotation name="crystal12-2_rot_neg_top" x="0.0253118993481663" y="0.19405789500260828" z="0.0" unit="radian" />
+      <position name="crystal13-2_pos_pos_bot" x="228.25559527054568" y="-66.17781287793854" z="1549.8179989435152" unit="mm" />
+      <rotation name="crystal13-2_rot_pos_bot" x="-0.0253118993481663" y="-0.2109324945680525" z="0.0" unit="radian" />
+      <position name="crystal13-2_pos_neg_bot" x="-145.71559527054566" y="-66.17781287793854" z="1549.8179989435152" unit="mm" />
+      <rotation name="crystal13-2_rot_neg_bot" x="-0.0253118993481663" y="0.2109324945680525" z="0.0" unit="radian" />
+      <position name="crystal13-2_pos_pos_top" x="228.25559527054568" y="66.17781287793854" z="1549.8179989435152" unit="mm" />
+      <rotation name="crystal13-2_rot_pos_top" x="0.0253118993481663" y="-0.2109324945680525" z="0.0" unit="radian" />
+      <position name="crystal13-2_pos_neg_top" x="-145.71559527054566" y="66.17781287793854" z="1549.8179989435152" unit="mm" />
+      <rotation name="crystal13-2_rot_neg_top" x="0.0253118993481663" y="0.2109324945680525" z="0.0" unit="radian" />
+      <position name="crystal14-2_pos_pos_bot" x="243.42369339782218" y="-66.17781287793854" z="1549.6337552442246" unit="mm" />
+      <rotation name="crystal14-2_rot_pos_bot" x="-0.0253118993481663" y="-0.22780709413349667" z="0.0" unit="radian" />
+      <position name="crystal14-2_pos_neg_bot" x="-160.88369339782216" y="-66.17781287793854" z="1549.6337552442246" unit="mm" />
+      <rotation name="crystal14-2_rot_neg_bot" x="-0.0253118993481663" y="0.22780709413349667" z="0.0" unit="radian" />
+      <position name="crystal14-2_pos_pos_top" x="243.42369339782218" y="66.17781287793854" z="1549.6337552442246" unit="mm" />
+      <rotation name="crystal14-2_rot_pos_top" x="0.0253118993481663" y="-0.22780709413349667" z="0.0" unit="radian" />
+      <position name="crystal14-2_pos_neg_top" x="-160.88369339782216" y="66.17781287793854" z="1549.6337552442246" unit="mm" />
+      <rotation name="crystal14-2_rot_neg_top" x="0.0253118993481663" y="0.22780709413349667" z="0.0" unit="radian" />
+      <position name="crystal15-2_pos_pos_bot" x="258.6419033782828" y="-66.17781287793854" z="1549.42689280716" unit="mm" />
+      <rotation name="crystal15-2_rot_pos_bot" x="-0.0253118993481663" y="-0.24468169369894088" z="0.0" unit="radian" />
+      <position name="crystal15-2_pos_neg_bot" x="-176.1019033782828" y="-66.17781287793854" z="1549.42689280716" unit="mm" />
+      <rotation name="crystal15-2_rot_neg_bot" x="-0.0253118993481663" y="0.24468169369894088" z="0.0" unit="radian" />
+      <position name="crystal15-2_pos_pos_top" x="258.6419033782828" y="66.17781287793854" z="1549.42689280716" unit="mm" />
+      <rotation name="crystal15-2_rot_pos_top" x="0.0253118993481663" y="-0.24468169369894088" z="0.0" unit="radian" />
+      <position name="crystal15-2_pos_neg_top" x="-176.1019033782828" y="66.17781287793854" z="1549.42689280716" unit="mm" />
+      <rotation name="crystal15-2_rot_neg_top" x="0.0253118993481663" y="0.24468169369894088" z="0.0" unit="radian" />
+      <position name="crystal16-2_pos_pos_bot" x="273.91419140634014" y="-66.17781287793854" z="1549.1974705354392" unit="mm" />
+      <rotation name="crystal16-2_rot_pos_bot" x="-0.0253118993481663" y="-0.26155629326438506" z="0.0" unit="radian" />
+      <position name="crystal16-2_pos_neg_bot" x="-191.37419140634015" y="-66.17781287793854" z="1549.1974705354392" unit="mm" />
+      <rotation name="crystal16-2_rot_neg_bot" x="-0.0253118993481663" y="0.26155629326438506" z="0.0" unit="radian" />
+      <position name="crystal16-2_pos_pos_top" x="273.91419140634014" y="66.17781287793854" z="1549.1974705354392" unit="mm" />
+      <rotation name="crystal16-2_rot_pos_top" x="0.0253118993481663" y="-0.26155629326438506" z="0.0" unit="radian" />
+      <position name="crystal16-2_pos_neg_top" x="-191.37419140634015" y="66.17781287793854" z="1549.1974705354392" unit="mm" />
+      <rotation name="crystal16-2_rot_neg_top" x="0.0253118993481663" y="0.26155629326438506" z="0.0" unit="radian" />
+      <position name="crystal17-2_pos_pos_bot" x="289.2446131488872" y="-66.17781287793854" z="1548.9455537559877" unit="mm" />
+      <rotation name="crystal17-2_rot_pos_bot" x="-0.0253118993481663" y="-0.2784308928298293" z="0.0" unit="radian" />
+      <position name="crystal17-2_pos_neg_bot" x="-206.7046131488872" y="-66.17781287793854" z="1548.9455537559877" unit="mm" />
+      <rotation name="crystal17-2_rot_neg_bot" x="-0.0253118993481663" y="0.2784308928298293" z="0.0" unit="radian" />
+      <position name="crystal17-2_pos_pos_top" x="289.2446131488872" y="66.17781287793854" z="1548.9455537559877" unit="mm" />
+      <rotation name="crystal17-2_rot_pos_top" x="0.0253118993481663" y="-0.2784308928298293" z="0.0" unit="radian" />
+      <position name="crystal17-2_pos_neg_top" x="-206.7046131488872" y="66.17781287793854" z="1548.9455537559877" unit="mm" />
+      <rotation name="crystal17-2_rot_neg_top" x="0.0253118993481663" y="0.2784308928298293" z="0.0" unit="radian" />
+      <position name="crystal18-2_pos_pos_bot" x="304.63732163521667" y="-66.17781287793854" z="1548.6712142009383" unit="mm" />
+      <rotation name="crystal18-2_rot_pos_bot" x="-0.0253118993481663" y="-0.2953054923952735" z="0.0" unit="radian" />
+      <position name="crystal18-2_pos_neg_bot" x="-222.09732163521667" y="-66.17781287793854" z="1548.6712142009383" unit="mm" />
+      <rotation name="crystal18-2_rot_neg_bot" x="-0.0253118993481663" y="0.2953054923952735" z="0.0" unit="radian" />
+      <position name="crystal18-2_pos_pos_top" x="304.63732163521667" y="66.17781287793854" z="1548.6712142009383" unit="mm" />
+      <rotation name="crystal18-2_rot_pos_top" x="0.0253118993481663" y="-0.2953054923952735" z="0.0" unit="radian" />
+      <position name="crystal18-2_pos_neg_top" x="-222.09732163521667" y="66.17781287793854" z="1548.6712142009383" unit="mm" />
+      <rotation name="crystal18-2_rot_neg_top" x="0.0253118993481663" y="0.2953054923952735" z="0.0" unit="radian" />
+      <position name="crystal19-2_pos_pos_bot" x="320.09657552295215" y="-66.17781287793854" z="1548.3745299872046" unit="mm" />
+      <rotation name="crystal19-2_rot_pos_bot" x="-0.0253118993481663" y="-0.31218009196071766" z="0.0" unit="radian" />
+      <position name="crystal19-2_pos_neg_bot" x="-237.55657552295216" y="-66.17781287793854" z="1548.3745299872046" unit="mm" />
+      <rotation name="crystal19-2_rot_neg_bot" x="-0.0253118993481663" y="0.31218009196071766" z="0.0" unit="radian" />
+      <position name="crystal19-2_pos_pos_top" x="320.09657552295215" y="66.17781287793854" z="1548.3745299872046" unit="mm" />
+      <rotation name="crystal19-2_rot_pos_top" x="0.0253118993481663" y="-0.31218009196071766" z="0.0" unit="radian" />
+      <position name="crystal19-2_pos_neg_top" x="-237.55657552295216" y="66.17781287793854" z="1548.3745299872046" unit="mm" />
+      <rotation name="crystal19-2_rot_neg_top" x="0.0253118993481663" y="0.31218009196071766" z="0.0" unit="radian" />
+      <position name="crystal20-2_pos_pos_bot" x="335.62674777820644" y="-66.17781287793854" z="1548.055585594238" unit="mm" />
+      <rotation name="crystal20-2_rot_pos_bot" x="-0.0253118993481663" y="-0.3290546915261619" z="0.0" unit="radian" />
+      <position name="crystal20-2_pos_neg_bot" x="-253.08674777820644" y="-66.17781287793854" z="1548.055585594238" unit="mm" />
+      <rotation name="crystal20-2_rot_neg_bot" x="-0.0253118993481663" y="0.3290546915261619" z="0.0" unit="radian" />
+      <position name="crystal20-2_pos_pos_top" x="335.62674777820644" y="66.17781287793854" z="1548.055585594238" unit="mm" />
+      <rotation name="crystal20-2_rot_pos_top" x="0.0253118993481663" y="-0.3290546915261619" z="0.0" unit="radian" />
+      <position name="crystal20-2_pos_neg_top" x="-253.08674777820644" y="66.17781287793854" z="1548.055585594238" unit="mm" />
+      <rotation name="crystal20-2_rot_neg_top" x="0.0253118993481663" y="0.3290546915261619" z="0.0" unit="radian" />
+      <position name="crystal21-2_pos_pos_bot" x="351.2323348113603" y="-66.17781287793854" z="1547.7144718399722" unit="mm" />
+      <rotation name="crystal21-2_rot_pos_bot" x="-0.0253118993481663" y="-0.3459292910916061" z="0.0" unit="radian" />
+      <position name="crystal21-2_pos_neg_bot" x="-268.69233481136035" y="-66.17781287793854" z="1547.7144718399722" unit="mm" />
+      <rotation name="crystal21-2_rot_neg_bot" x="-0.0253118993481663" y="0.3459292910916061" z="0.0" unit="radian" />
+      <position name="crystal21-2_pos_pos_top" x="351.2323348113603" y="66.17781287793854" z="1547.7144718399722" unit="mm" />
+      <rotation name="crystal21-2_rot_pos_top" x="0.0253118993481663" y="-0.3459292910916061" z="0.0" unit="radian" />
+      <position name="crystal21-2_pos_neg_top" x="-268.69233481136035" y="66.17781287793854" z="1547.7144718399722" unit="mm" />
+      <rotation name="crystal21-2_rot_neg_top" x="0.0253118993481663" y="0.3459292910916061" z="0.0" unit="radian" />
+      <position name="crystal22-2_pos_pos_bot" x="366.91796611341823" y="-66.17781287793854" z="1547.351285854964" unit="mm" />
+      <rotation name="crystal22-2_rot_pos_bot" x="-0.0253118993481663" y="-0.36280389065705027" z="0.0" unit="radian" />
+      <position name="crystal22-2_pos_neg_bot" x="-284.37796611341827" y="-66.17781287793854" z="1547.351285854964" unit="mm" />
+      <rotation name="crystal22-2_rot_neg_bot" x="-0.0253118993481663" y="0.36280389065705027" z="0.0" unit="radian" />
+      <position name="crystal22-2_pos_pos_top" x="366.91796611341823" y="66.17781287793854" z="1547.351285854964" unit="mm" />
+      <rotation name="crystal22-2_rot_pos_top" x="0.0253118993481663" y="-0.36280389065705027" z="0.0" unit="radian" />
+      <position name="crystal22-2_pos_neg_top" x="-284.37796611341827" y="66.17781287793854" z="1547.351285854964" unit="mm" />
+      <rotation name="crystal22-2_rot_neg_top" x="0.0253118993481663" y="0.36280389065705027" z="0.0" unit="radian" />
+      <position name="crystal23-2_pos_pos_bot" x="382.688414441894" y="-66.17781287793854" z="1546.9661310547353" unit="mm" />
+      <rotation name="crystal23-2_rot_pos_bot" x="-0.0253118993481663" y="-0.3796784902224945" z="0.0" unit="radian" />
+      <position name="crystal23-2_pos_neg_bot" x="-300.14841444189403" y="-66.17781287793854" z="1546.9661310547353" unit="mm" />
+      <rotation name="crystal23-2_rot_neg_bot" x="-0.0253118993481663" y="0.3796784902224945" z="0.0" unit="radian" />
+      <position name="crystal23-2_pos_pos_top" x="382.688414441894" y="66.17781287793854" z="1546.9661310547353" unit="mm" />
+      <rotation name="crystal23-2_rot_pos_top" x="0.0253118993481663" y="-0.3796784902224945" z="0.0" unit="radian" />
+      <position name="crystal23-2_pos_neg_top" x="-300.14841444189403" y="66.17781287793854" z="1546.9661310547353" unit="mm" />
+      <rotation name="crystal23-2_rot_neg_top" x="0.0253118993481663" y="0.3796784902224945" z="0.0" unit="radian" />
+      <position name="crystal1-3_pos_pos_bot" x="48.79473927539554" y="-81.18788687039807" z="1550.3186477918262" unit="mm" />
+      <rotation name="crystal1-3_rot_pos_bot" x="-0.042186498913610496" y="-0.0084372997827221" z="0.0" unit="radian" />
+      <position name="crystal1-3_pos_neg_bot" x="33.745260724604464" y="-81.18788687039807" z="1550.3186477918262" unit="mm" />
+      <rotation name="crystal1-3_rot_neg_bot" x="-0.042186498913610496" y="0.0084372997827221" z="0.0" unit="radian" />
+      <position name="crystal1-3_pos_pos_top" x="48.79473927539554" y="81.18788687039807" z="1550.3186477918262" unit="mm" />
+      <rotation name="crystal1-3_rot_pos_top" x="0.042186498913610496" y="-0.0084372997827221" z="0.0" unit="radian" />
+      <position name="crystal1-3_pos_neg_top" x="33.745260724604464" y="81.18788687039807" z="1550.3186477918262" unit="mm" />
+      <rotation name="crystal1-3_rot_neg_top" x="0.042186498913610496" y="0.0084372997827221" z="0.0" unit="radian" />
+      <position name="crystal2-3_pos_pos_bot" x="63.647812877938534" y="-81.18788687039807" z="1550.4080677537463" unit="mm" />
+      <rotation name="crystal2-3_rot_pos_bot" x="-0.042186498913610496" y="-0.0253118993481663" z="0.0" unit="radian" />
+      <position name="crystal2-3_pos_neg_bot" x="18.89218712206147" y="-81.18788687039807" z="1550.4080677537463" unit="mm" />
+      <rotation name="crystal2-3_rot_neg_bot" x="-0.042186498913610496" y="0.0253118993481663" z="0.0" unit="radian" />
+      <position name="crystal2-3_pos_pos_top" x="63.647812877938534" y="81.18788687039807" z="1550.4080677537463" unit="mm" />
+      <rotation name="crystal2-3_rot_pos_top" x="0.042186498913610496" y="-0.0253118993481663" z="0.0" unit="radian" />
+      <position name="crystal2-3_pos_neg_top" x="18.89218712206147" y="81.18788687039807" z="1550.4080677537463" unit="mm" />
+      <rotation name="crystal2-3_rot_neg_top" x="0.042186498913610496" y="0.0253118993481663" z="0.0" unit="radian" />
+      <position name="crystal3-3_pos_pos_bot" x="78.5078868703981" y="-81.18788687039807" z="1550.47466745996" unit="mm" />
+      <rotation name="crystal3-3_rot_pos_bot" x="-0.042186498913610496" y="-0.042186498913610496" z="0.0" unit="radian" />
+      <position name="crystal3-3_pos_neg_bot" x="4.0321131296019175" y="-81.18788687039807" z="1550.47466745996" unit="mm" />
+      <rotation name="crystal3-3_rot_neg_bot" x="-0.042186498913610496" y="0.042186498913610496" z="0.0" unit="radian" />
+      <position name="crystal3-3_pos_pos_top" x="78.5078868703981" y="81.18788687039807" z="1550.47466745996" unit="mm" />
+      <rotation name="crystal3-3_rot_pos_top" x="0.042186498913610496" y="-0.042186498913610496" z="0.0" unit="radian" />
+      <position name="crystal3-3_pos_neg_top" x="4.0321131296019175" y="81.18788687039807" z="1550.47466745996" unit="mm" />
+      <rotation name="crystal3-3_rot_neg_top" x="0.042186498913610496" y="0.042186498913610496" z="0.0" unit="radian" />
+      <position name="crystal4-3_pos_pos_bot" x="93.378374317979" y="-81.18788687039807" z="1550.5184279465104" unit="mm" />
+      <rotation name="crystal4-3_rot_pos_bot" x="-0.042186498913610496" y="-0.0590610984790547" z="0.0" unit="radian" />
+      <position name="crystal4-3_pos_neg_bot" x="-10.838374317978996" y="-81.18788687039807" z="1550.5184279465104" unit="mm" />
+      <rotation name="crystal4-3_rot_neg_bot" x="-0.042186498913610496" y="0.0590610984790547" z="0.0" unit="radian" />
+      <position name="crystal4-3_pos_pos_top" x="93.378374317979" y="81.18788687039807" z="1550.5184279465104" unit="mm" />
+      <rotation name="crystal4-3_rot_pos_top" x="0.042186498913610496" y="-0.0590610984790547" z="0.0" unit="radian" />
+      <position name="crystal4-3_pos_neg_top" x="-10.838374317978996" y="81.18788687039807" z="1550.5184279465104" unit="mm" />
+      <rotation name="crystal4-3_rot_neg_top" x="0.042186498913610496" y="0.0590610984790547" z="0.0" unit="radian" />
+      <position name="crystal5-3_pos_pos_bot" x="108.26270155521061" y="-81.18788687039807" z="1550.5393367528022" unit="mm" />
+      <rotation name="crystal5-3_rot_pos_bot" x="-0.042186498913610496" y="-0.0759356980444989" z="0.0" unit="radian" />
+      <position name="crystal5-3_pos_neg_bot" x="-25.722701555210598" y="-81.18788687039807" z="1550.5393367528022" unit="mm" />
+      <rotation name="crystal5-3_rot_neg_bot" x="-0.042186498913610496" y="0.0759356980444989" z="0.0" unit="radian" />
+      <position name="crystal5-3_pos_pos_top" x="108.26270155521061" y="81.18788687039807" z="1550.5393367528022" unit="mm" />
+      <rotation name="crystal5-3_rot_pos_top" x="0.042186498913610496" y="-0.0759356980444989" z="0.0" unit="radian" />
+      <position name="crystal5-3_pos_neg_top" x="-25.722701555210598" y="81.18788687039807" z="1550.5393367528022" unit="mm" />
+      <rotation name="crystal5-3_rot_neg_top" x="0.042186498913610496" y="0.0759356980444989" z="0.0" unit="radian" />
+      <position name="crystal6-3_pos_pos_bot" x="123.16431377551496" y="-81.18788687039807" z="1550.53738792515" unit="mm" />
+      <rotation name="crystal6-3_rot_pos_bot" x="-0.042186498913610496" y="-0.0928102976099431" z="0.0" unit="radian" />
+      <position name="crystal6-3_pos_neg_bot" x="-40.62431377551494" y="-81.18788687039807" z="1550.53738792515" unit="mm" />
+      <rotation name="crystal6-3_rot_neg_bot" x="-0.042186498913610496" y="0.0928102976099431" z="0.0" unit="radian" />
+      <position name="crystal6-3_pos_pos_top" x="123.16431377551496" y="81.18788687039807" z="1550.53738792515" unit="mm" />
+      <rotation name="crystal6-3_rot_pos_top" x="0.042186498913610496" y="-0.0928102976099431" z="0.0" unit="radian" />
+      <position name="crystal6-3_pos_neg_top" x="-40.62431377551494" y="81.18788687039807" z="1550.53738792515" unit="mm" />
+      <rotation name="crystal6-3_rot_neg_top" x="0.042186498913610496" y="0.0928102976099431" z="0.0" unit="radian" />
+      <position name="crystal7-3_pos_pos_bot" x="138.0866806873399" y="-81.18788687039807" z="1550.5125820184735" unit="mm" />
+      <rotation name="crystal7-3_rot_pos_bot" x="-0.042186498913610496" y="-0.10968489717538729" z="0.0" unit="radian" />
+      <position name="crystal7-3_pos_neg_bot" x="-55.546680687339894" y="-81.18788687039807" z="1550.5125820184735" unit="mm" />
+      <rotation name="crystal7-3_rot_neg_bot" x="-0.042186498913610496" y="0.10968489717538729" z="0.0" unit="radian" />
+      <position name="crystal7-3_pos_pos_top" x="138.0866806873399" y="81.18788687039807" z="1550.5125820184735" unit="mm" />
+      <rotation name="crystal7-3_rot_pos_top" x="0.042186498913610496" y="-0.10968489717538729" z="0.0" unit="radian" />
+      <position name="crystal7-3_pos_neg_top" x="-55.546680687339894" y="81.18788687039807" z="1550.5125820184735" unit="mm" />
+      <rotation name="crystal7-3_rot_neg_top" x="0.042186498913610496" y="0.10968489717538729" z="0.0" unit="radian" />
+      <position name="crystal8-3_pos_pos_bot" x="153.03330225657226" y="-81.18788687039807" z="1550.4649260961392" unit="mm" />
+      <rotation name="crystal8-3_rot_pos_bot" x="-0.042186498913610496" y="-0.1265594967408315" z="0.0" unit="radian" />
+      <position name="crystal8-3_pos_neg_bot" x="-70.49330225657226" y="-81.18788687039807" z="1550.4649260961392" unit="mm" />
+      <rotation name="crystal8-3_rot_neg_bot" x="-0.042186498913610496" y="0.1265594967408315" z="0.0" unit="radian" />
+      <position name="crystal8-3_pos_pos_top" x="153.03330225657226" y="81.18788687039807" z="1550.4649260961392" unit="mm" />
+      <rotation name="crystal8-3_rot_pos_top" x="0.042186498913610496" y="-0.1265594967408315" z="0.0" unit="radian" />
+      <position name="crystal8-3_pos_neg_top" x="-70.49330225657226" y="81.18788687039807" z="1550.4649260961392" unit="mm" />
+      <rotation name="crystal8-3_rot_neg_top" x="0.042186498913610496" y="0.1265594967408315" z="0.0" unit="radian" />
+      <position name="crystal9-3_pos_pos_bot" x="168.00771455551202" y="-81.18788687039807" z="1550.3944337279495" unit="mm" />
+      <rotation name="crystal9-3_rot_pos_bot" x="-0.042186498913610496" y="-0.14343409630627568" z="0.0" unit="radian" />
+      <position name="crystal9-3_pos_neg_bot" x="-85.467714555512" y="-81.18788687039807" z="1550.3944337279495" unit="mm" />
+      <rotation name="crystal9-3_rot_neg_bot" x="-0.042186498913610496" y="0.14343409630627568" z="0.0" unit="radian" />
+      <position name="crystal9-3_pos_pos_top" x="168.00771455551202" y="81.18788687039807" z="1550.3944337279495" unit="mm" />
+      <rotation name="crystal9-3_rot_pos_top" x="0.042186498913610496" y="-0.14343409630627568" z="0.0" unit="radian" />
+      <position name="crystal9-3_pos_neg_top" x="-85.467714555512" y="81.18788687039807" z="1550.3944337279495" unit="mm" />
+      <rotation name="crystal9-3_rot_neg_top" x="0.042186498913610496" y="0.14343409630627568" z="0.0" unit="radian" />
+      <position name="crystal10-3_pos_pos_bot" x="183.01349573939376" y="-81.18788687039807" z="1550.301124986279" unit="mm" />
+      <rotation name="crystal10-3_rot_pos_bot" x="-0.042186498913610496" y="-0.1603086958717199" z="0.0" unit="radian" />
+      <position name="crystal10-3_pos_neg_bot" x="-100.47349573939374" y="-81.18788687039807" z="1550.301124986279" unit="mm" />
+      <rotation name="crystal10-3_rot_neg_bot" x="-0.042186498913610496" y="0.1603086958717199" z="0.0" unit="radian" />
+      <position name="crystal10-3_pos_pos_top" x="183.01349573939376" y="81.18788687039807" z="1550.301124986279" unit="mm" />
+      <rotation name="crystal10-3_rot_pos_top" x="0.042186498913610496" y="-0.1603086958717199" z="0.0" unit="radian" />
+      <position name="crystal10-3_pos_neg_top" x="-100.47349573939374" y="81.18788687039807" z="1550.301124986279" unit="mm" />
+      <rotation name="crystal10-3_rot_neg_top" x="0.042186498913610496" y="0.1603086958717199" z="0.0" unit="radian" />
+      <position name="crystal11-3_pos_pos_bot" x="198.05427217228873" y="-81.18788687039807" z="1550.1850264403583" unit="mm" />
+      <rotation name="crystal11-3_rot_pos_bot" x="-0.042186498913610496" y="-0.1771832954371641" z="0.0" unit="radian" />
+      <position name="crystal11-3_pos_neg_bot" x="-115.51427217228871" y="-81.18788687039807" z="1550.1850264403583" unit="mm" />
+      <rotation name="crystal11-3_rot_neg_bot" x="-0.042186498913610496" y="0.1771832954371641" z="0.0" unit="radian" />
+      <position name="crystal11-3_pos_pos_top" x="198.05427217228873" y="81.18788687039807" z="1550.1850264403583" unit="mm" />
+      <rotation name="crystal11-3_rot_pos_top" x="0.042186498913610496" y="-0.1771832954371641" z="0.0" unit="radian" />
+      <position name="crystal11-3_pos_neg_top" x="-115.51427217228871" y="81.18788687039807" z="1550.1850264403583" unit="mm" />
+      <rotation name="crystal11-3_rot_neg_top" x="0.042186498913610496" y="0.1771832954371641" z="0.0" unit="radian" />
+      <position name="crystal12-3_pos_pos_bot" x="213.1337247252268" y="-81.18788687039807" z="1550.0461711487085" unit="mm" />
+      <rotation name="crystal12-3_rot_pos_bot" x="-0.042186498913610496" y="-0.19405789500260828" z="0.0" unit="radian" />
+      <position name="crystal12-3_pos_neg_bot" x="-130.5937247252268" y="-81.18788687039807" z="1550.0461711487085" unit="mm" />
+      <rotation name="crystal12-3_rot_neg_bot" x="-0.042186498913610496" y="0.19405789500260828" z="0.0" unit="radian" />
+      <position name="crystal12-3_pos_pos_top" x="213.1337247252268" y="81.18788687039807" z="1550.0461711487085" unit="mm" />
+      <rotation name="crystal12-3_rot_pos_top" x="0.042186498913610496" y="-0.19405789500260828" z="0.0" unit="radian" />
+      <position name="crystal12-3_pos_neg_top" x="-130.5937247252268" y="81.18788687039807" z="1550.0461711487085" unit="mm" />
+      <rotation name="crystal12-3_rot_neg_top" x="0.042186498913610496" y="0.19405789500260828" z="0.0" unit="radian" />
+      <position name="crystal13-3_pos_pos_bot" x="228.25559527054568" y="-81.18788687039807" z="1549.8845986497292" unit="mm" />
+      <rotation name="crystal13-3_rot_pos_bot" x="-0.042186498913610496" y="-0.2109324945680525" z="0.0" unit="radian" />
+      <position name="crystal13-3_pos_neg_bot" x="-145.71559527054566" y="-81.18788687039807" z="1549.8845986497292" unit="mm" />
+      <rotation name="crystal13-3_rot_neg_bot" x="-0.042186498913610496" y="0.2109324945680525" z="0.0" unit="radian" />
+      <position name="crystal13-3_pos_pos_top" x="228.25559527054568" y="81.18788687039807" z="1549.8845986497292" unit="mm" />
+      <rotation name="crystal13-3_rot_pos_top" x="0.042186498913610496" y="-0.2109324945680525" z="0.0" unit="radian" />
+      <position name="crystal13-3_pos_neg_top" x="-145.71559527054566" y="81.18788687039807" z="1549.8845986497292" unit="mm" />
+      <rotation name="crystal13-3_rot_neg_top" x="0.042186498913610496" y="0.2109324945680525" z="0.0" unit="radian" />
+      <position name="crystal14-3_pos_pos_bot" x="243.42369339782218" y="-81.18788687039807" z="1549.7003549504386" unit="mm" />
+      <rotation name="crystal14-3_rot_pos_bot" x="-0.042186498913610496" y="-0.22780709413349667" z="0.0" unit="radian" />
+      <position name="crystal14-3_pos_neg_bot" x="-160.88369339782216" y="-81.18788687039807" z="1549.7003549504386" unit="mm" />
+      <rotation name="crystal14-3_rot_neg_bot" x="-0.042186498913610496" y="0.22780709413349667" z="0.0" unit="radian" />
+      <position name="crystal14-3_pos_pos_top" x="243.42369339782218" y="81.18788687039807" z="1549.7003549504386" unit="mm" />
+      <rotation name="crystal14-3_rot_pos_top" x="0.042186498913610496" y="-0.22780709413349667" z="0.0" unit="radian" />
+      <position name="crystal14-3_pos_neg_top" x="-160.88369339782216" y="81.18788687039807" z="1549.7003549504386" unit="mm" />
+      <rotation name="crystal14-3_rot_neg_top" x="0.042186498913610496" y="0.22780709413349667" z="0.0" unit="radian" />
+      <position name="crystal15-3_pos_pos_bot" x="258.6419033782828" y="-81.18788687039807" z="1549.4934925133737" unit="mm" />
+      <rotation name="crystal15-3_rot_pos_bot" x="-0.042186498913610496" y="-0.24468169369894088" z="0.0" unit="radian" />
+      <position name="crystal15-3_pos_neg_bot" x="-176.1019033782828" y="-81.18788687039807" z="1549.4934925133737" unit="mm" />
+      <rotation name="crystal15-3_rot_neg_bot" x="-0.042186498913610496" y="0.24468169369894088" z="0.0" unit="radian" />
+      <position name="crystal15-3_pos_pos_top" x="258.6419033782828" y="81.18788687039807" z="1549.4934925133737" unit="mm" />
+      <rotation name="crystal15-3_rot_pos_top" x="0.042186498913610496" y="-0.24468169369894088" z="0.0" unit="radian" />
+      <position name="crystal15-3_pos_neg_top" x="-176.1019033782828" y="81.18788687039807" z="1549.4934925133737" unit="mm" />
+      <rotation name="crystal15-3_rot_neg_top" x="0.042186498913610496" y="0.24468169369894088" z="0.0" unit="radian" />
+      <position name="crystal16-3_pos_pos_bot" x="273.91419140634014" y="-81.18788687039807" z="1549.264070241653" unit="mm" />
+      <rotation name="crystal16-3_rot_pos_bot" x="-0.042186498913610496" y="-0.26155629326438506" z="0.0" unit="radian" />
+      <position name="crystal16-3_pos_neg_bot" x="-191.37419140634015" y="-81.18788687039807" z="1549.264070241653" unit="mm" />
+      <rotation name="crystal16-3_rot_neg_bot" x="-0.042186498913610496" y="0.26155629326438506" z="0.0" unit="radian" />
+      <position name="crystal16-3_pos_pos_top" x="273.91419140634014" y="81.18788687039807" z="1549.264070241653" unit="mm" />
+      <rotation name="crystal16-3_rot_pos_top" x="0.042186498913610496" y="-0.26155629326438506" z="0.0" unit="radian" />
+      <position name="crystal16-3_pos_neg_top" x="-191.37419140634015" y="81.18788687039807" z="1549.264070241653" unit="mm" />
+      <rotation name="crystal16-3_rot_neg_top" x="0.042186498913610496" y="0.26155629326438506" z="0.0" unit="radian" />
+      <position name="crystal17-3_pos_pos_bot" x="289.2446131488872" y="-81.18788687039807" z="1549.0121534622015" unit="mm" />
+      <rotation name="crystal17-3_rot_pos_bot" x="-0.042186498913610496" y="-0.2784308928298293" z="0.0" unit="radian" />
+      <position name="crystal17-3_pos_neg_bot" x="-206.7046131488872" y="-81.18788687039807" z="1549.0121534622015" unit="mm" />
+      <rotation name="crystal17-3_rot_neg_bot" x="-0.042186498913610496" y="0.2784308928298293" z="0.0" unit="radian" />
+      <position name="crystal17-3_pos_pos_top" x="289.2446131488872" y="81.18788687039807" z="1549.0121534622015" unit="mm" />
+      <rotation name="crystal17-3_rot_pos_top" x="0.042186498913610496" y="-0.2784308928298293" z="0.0" unit="radian" />
+      <position name="crystal17-3_pos_neg_top" x="-206.7046131488872" y="81.18788687039807" z="1549.0121534622015" unit="mm" />
+      <rotation name="crystal17-3_rot_neg_top" x="0.042186498913610496" y="0.2784308928298293" z="0.0" unit="radian" />
+      <position name="crystal18-3_pos_pos_bot" x="304.63732163521667" y="-81.18788687039807" z="1548.737813907152" unit="mm" />
+      <rotation name="crystal18-3_rot_pos_bot" x="-0.042186498913610496" y="-0.2953054923952735" z="0.0" unit="radian" />
+      <position name="crystal18-3_pos_neg_bot" x="-222.09732163521667" y="-81.18788687039807" z="1548.737813907152" unit="mm" />
+      <rotation name="crystal18-3_rot_neg_bot" x="-0.042186498913610496" y="0.2953054923952735" z="0.0" unit="radian" />
+      <position name="crystal18-3_pos_pos_top" x="304.63732163521667" y="81.18788687039807" z="1548.737813907152" unit="mm" />
+      <rotation name="crystal18-3_rot_pos_top" x="0.042186498913610496" y="-0.2953054923952735" z="0.0" unit="radian" />
+      <position name="crystal18-3_pos_neg_top" x="-222.09732163521667" y="81.18788687039807" z="1548.737813907152" unit="mm" />
+      <rotation name="crystal18-3_rot_neg_top" x="0.042186498913610496" y="0.2953054923952735" z="0.0" unit="radian" />
+      <position name="crystal19-3_pos_pos_bot" x="320.09657552295215" y="-81.18788687039807" z="1548.4411296934186" unit="mm" />
+      <rotation name="crystal19-3_rot_pos_bot" x="-0.042186498913610496" y="-0.31218009196071766" z="0.0" unit="radian" />
+      <position name="crystal19-3_pos_neg_bot" x="-237.55657552295216" y="-81.18788687039807" z="1548.4411296934186" unit="mm" />
+      <rotation name="crystal19-3_rot_neg_bot" x="-0.042186498913610496" y="0.31218009196071766" z="0.0" unit="radian" />
+      <position name="crystal19-3_pos_pos_top" x="320.09657552295215" y="81.18788687039807" z="1548.4411296934186" unit="mm" />
+      <rotation name="crystal19-3_rot_pos_top" x="0.042186498913610496" y="-0.31218009196071766" z="0.0" unit="radian" />
+      <position name="crystal19-3_pos_neg_top" x="-237.55657552295216" y="81.18788687039807" z="1548.4411296934186" unit="mm" />
+      <rotation name="crystal19-3_rot_neg_top" x="0.042186498913610496" y="0.31218009196071766" z="0.0" unit="radian" />
+      <position name="crystal20-3_pos_pos_bot" x="335.62674777820644" y="-81.18788687039807" z="1548.1221853004517" unit="mm" />
+      <rotation name="crystal20-3_rot_pos_bot" x="-0.042186498913610496" y="-0.3290546915261619" z="0.0" unit="radian" />
+      <position name="crystal20-3_pos_neg_bot" x="-253.08674777820644" y="-81.18788687039807" z="1548.1221853004517" unit="mm" />
+      <rotation name="crystal20-3_rot_neg_bot" x="-0.042186498913610496" y="0.3290546915261619" z="0.0" unit="radian" />
+      <position name="crystal20-3_pos_pos_top" x="335.62674777820644" y="81.18788687039807" z="1548.1221853004517" unit="mm" />
+      <rotation name="crystal20-3_rot_pos_top" x="0.042186498913610496" y="-0.3290546915261619" z="0.0" unit="radian" />
+      <position name="crystal20-3_pos_neg_top" x="-253.08674777820644" y="81.18788687039807" z="1548.1221853004517" unit="mm" />
+      <rotation name="crystal20-3_rot_neg_top" x="0.042186498913610496" y="0.3290546915261619" z="0.0" unit="radian" />
+      <position name="crystal21-3_pos_pos_bot" x="351.2323348113603" y="-81.18788687039807" z="1547.781071546186" unit="mm" />
+      <rotation name="crystal21-3_rot_pos_bot" x="-0.042186498913610496" y="-0.3459292910916061" z="0.0" unit="radian" />
+      <position name="crystal21-3_pos_neg_bot" x="-268.69233481136035" y="-81.18788687039807" z="1547.781071546186" unit="mm" />
+      <rotation name="crystal21-3_rot_neg_bot" x="-0.042186498913610496" y="0.3459292910916061" z="0.0" unit="radian" />
+      <position name="crystal21-3_pos_pos_top" x="351.2323348113603" y="81.18788687039807" z="1547.781071546186" unit="mm" />
+      <rotation name="crystal21-3_rot_pos_top" x="0.042186498913610496" y="-0.3459292910916061" z="0.0" unit="radian" />
+      <position name="crystal21-3_pos_neg_top" x="-268.69233481136035" y="81.18788687039807" z="1547.781071546186" unit="mm" />
+      <rotation name="crystal21-3_rot_neg_top" x="0.042186498913610496" y="0.3459292910916061" z="0.0" unit="radian" />
+      <position name="crystal22-3_pos_pos_bot" x="366.91796611341823" y="-81.18788687039807" z="1547.417885561178" unit="mm" />
+      <rotation name="crystal22-3_rot_pos_bot" x="-0.042186498913610496" y="-0.36280389065705027" z="0.0" unit="radian" />
+      <position name="crystal22-3_pos_neg_bot" x="-284.37796611341827" y="-81.18788687039807" z="1547.417885561178" unit="mm" />
+      <rotation name="crystal22-3_rot_neg_bot" x="-0.042186498913610496" y="0.36280389065705027" z="0.0" unit="radian" />
+      <position name="crystal22-3_pos_pos_top" x="366.91796611341823" y="81.18788687039807" z="1547.417885561178" unit="mm" />
+      <rotation name="crystal22-3_rot_pos_top" x="0.042186498913610496" y="-0.36280389065705027" z="0.0" unit="radian" />
+      <position name="crystal22-3_pos_neg_top" x="-284.37796611341827" y="81.18788687039807" z="1547.417885561178" unit="mm" />
+      <rotation name="crystal22-3_rot_neg_top" x="0.042186498913610496" y="0.36280389065705027" z="0.0" unit="radian" />
+      <position name="crystal23-3_pos_pos_bot" x="382.688414441894" y="-81.18788687039807" z="1547.032730760949" unit="mm" />
+      <rotation name="crystal23-3_rot_pos_bot" x="-0.042186498913610496" y="-0.3796784902224945" z="0.0" unit="radian" />
+      <position name="crystal23-3_pos_neg_bot" x="-300.14841444189403" y="-81.18788687039807" z="1547.032730760949" unit="mm" />
+      <rotation name="crystal23-3_rot_neg_bot" x="-0.042186498913610496" y="0.3796784902224945" z="0.0" unit="radian" />
+      <position name="crystal23-3_pos_pos_top" x="382.688414441894" y="81.18788687039807" z="1547.032730760949" unit="mm" />
+      <rotation name="crystal23-3_rot_pos_top" x="0.042186498913610496" y="-0.3796784902224945" z="0.0" unit="radian" />
+      <position name="crystal23-3_pos_neg_top" x="-300.14841444189403" y="81.18788687039807" z="1547.032730760949" unit="mm" />
+      <rotation name="crystal23-3_rot_neg_top" x="0.042186498913610496" y="0.3796784902224945" z="0.0" unit="radian" />
+      <position name="crystal1-4_pos_pos_bot" x="48.79473927539554" y="-96.20837431797901" z="1550.3624082783765" unit="mm" />
+      <rotation name="crystal1-4_rot_pos_bot" x="-0.0590610984790547" y="-0.0084372997827221" z="0.0" unit="radian" />
+      <position name="crystal1-4_pos_neg_bot" x="33.745260724604464" y="-96.20837431797901" z="1550.3624082783765" unit="mm" />
+      <rotation name="crystal1-4_rot_neg_bot" x="-0.0590610984790547" y="0.0084372997827221" z="0.0" unit="radian" />
+      <position name="crystal1-4_pos_pos_top" x="48.79473927539554" y="96.20837431797901" z="1550.3624082783765" unit="mm" />
+      <rotation name="crystal1-4_rot_pos_top" x="0.0590610984790547" y="-0.0084372997827221" z="0.0" unit="radian" />
+      <position name="crystal1-4_pos_neg_top" x="33.745260724604464" y="96.20837431797901" z="1550.3624082783765" unit="mm" />
+      <rotation name="crystal1-4_rot_neg_top" x="0.0590610984790547" y="0.0084372997827221" z="0.0" unit="radian" />
+      <position name="crystal2-4_pos_pos_bot" x="63.647812877938534" y="-96.20837431797901" z="1550.4518282402964" unit="mm" />
+      <rotation name="crystal2-4_rot_pos_bot" x="-0.0590610984790547" y="-0.0253118993481663" z="0.0" unit="radian" />
+      <position name="crystal2-4_pos_neg_bot" x="18.89218712206147" y="-96.20837431797901" z="1550.4518282402964" unit="mm" />
+      <rotation name="crystal2-4_rot_neg_bot" x="-0.0590610984790547" y="0.0253118993481663" z="0.0" unit="radian" />
+      <position name="crystal2-4_pos_pos_top" x="63.647812877938534" y="96.20837431797901" z="1550.4518282402964" unit="mm" />
+      <rotation name="crystal2-4_rot_pos_top" x="0.0590610984790547" y="-0.0253118993481663" z="0.0" unit="radian" />
+      <position name="crystal2-4_pos_neg_top" x="18.89218712206147" y="96.20837431797901" z="1550.4518282402964" unit="mm" />
+      <rotation name="crystal2-4_rot_neg_top" x="0.0590610984790547" y="0.0253118993481663" z="0.0" unit="radian" />
+      <position name="crystal3-4_pos_pos_bot" x="78.5078868703981" y="-96.20837431797901" z="1550.5184279465104" unit="mm" />
+      <rotation name="crystal3-4_rot_pos_bot" x="-0.0590610984790547" y="-0.042186498913610496" z="0.0" unit="radian" />
+      <position name="crystal3-4_pos_neg_bot" x="4.0321131296019175" y="-96.20837431797901" z="1550.5184279465104" unit="mm" />
+      <rotation name="crystal3-4_rot_neg_bot" x="-0.0590610984790547" y="0.042186498913610496" z="0.0" unit="radian" />
+      <position name="crystal3-4_pos_pos_top" x="78.5078868703981" y="96.20837431797901" z="1550.5184279465104" unit="mm" />
+      <rotation name="crystal3-4_rot_pos_top" x="0.0590610984790547" y="-0.042186498913610496" z="0.0" unit="radian" />
+      <position name="crystal3-4_pos_neg_top" x="4.0321131296019175" y="96.20837431797901" z="1550.5184279465104" unit="mm" />
+      <rotation name="crystal3-4_rot_neg_top" x="0.0590610984790547" y="0.042186498913610496" z="0.0" unit="radian" />
+      <position name="crystal4-4_pos_pos_bot" x="93.378374317979" y="-96.20837431797901" z="1550.5621884330608" unit="mm" />
+      <rotation name="crystal4-4_rot_pos_bot" x="-0.0590610984790547" y="-0.0590610984790547" z="0.0" unit="radian" />
+      <position name="crystal4-4_pos_neg_bot" x="-10.838374317978996" y="-96.20837431797901" z="1550.5621884330608" unit="mm" />
+      <rotation name="crystal4-4_rot_neg_bot" x="-0.0590610984790547" y="0.0590610984790547" z="0.0" unit="radian" />
+      <position name="crystal4-4_pos_pos_top" x="93.378374317979" y="96.20837431797901" z="1550.5621884330608" unit="mm" />
+      <rotation name="crystal4-4_rot_pos_top" x="0.0590610984790547" y="-0.0590610984790547" z="0.0" unit="radian" />
+      <position name="crystal4-4_pos_neg_top" x="-10.838374317978996" y="96.20837431797901" z="1550.5621884330608" unit="mm" />
+      <rotation name="crystal4-4_rot_neg_top" x="0.0590610984790547" y="0.0590610984790547" z="0.0" unit="radian" />
+      <position name="crystal5-4_pos_pos_bot" x="108.26270155521061" y="-96.20837431797901" z="1550.5830972393524" unit="mm" />
+      <rotation name="crystal5-4_rot_pos_bot" x="-0.0590610984790547" y="-0.0759356980444989" z="0.0" unit="radian" />
+      <position name="crystal5-4_pos_neg_bot" x="-25.722701555210598" y="-96.20837431797901" z="1550.5830972393524" unit="mm" />
+      <rotation name="crystal5-4_rot_neg_bot" x="-0.0590610984790547" y="0.0759356980444989" z="0.0" unit="radian" />
+      <position name="crystal5-4_pos_pos_top" x="108.26270155521061" y="96.20837431797901" z="1550.5830972393524" unit="mm" />
+      <rotation name="crystal5-4_rot_pos_top" x="0.0590610984790547" y="-0.0759356980444989" z="0.0" unit="radian" />
+      <position name="crystal5-4_pos_neg_top" x="-25.722701555210598" y="96.20837431797901" z="1550.5830972393524" unit="mm" />
+      <rotation name="crystal5-4_rot_neg_top" x="0.0590610984790547" y="0.0759356980444989" z="0.0" unit="radian" />
+      <position name="crystal6-4_pos_pos_bot" x="123.16431377551496" y="-96.20837431797901" z="1550.5811484117003" unit="mm" />
+      <rotation name="crystal6-4_rot_pos_bot" x="-0.0590610984790547" y="-0.0928102976099431" z="0.0" unit="radian" />
+      <position name="crystal6-4_pos_neg_bot" x="-40.62431377551494" y="-96.20837431797901" z="1550.5811484117003" unit="mm" />
+      <rotation name="crystal6-4_rot_neg_bot" x="-0.0590610984790547" y="0.0928102976099431" z="0.0" unit="radian" />
+      <position name="crystal6-4_pos_pos_top" x="123.16431377551496" y="96.20837431797901" z="1550.5811484117003" unit="mm" />
+      <rotation name="crystal6-4_rot_pos_top" x="0.0590610984790547" y="-0.0928102976099431" z="0.0" unit="radian" />
+      <position name="crystal6-4_pos_neg_top" x="-40.62431377551494" y="96.20837431797901" z="1550.5811484117003" unit="mm" />
+      <rotation name="crystal6-4_rot_neg_top" x="0.0590610984790547" y="0.0928102976099431" z="0.0" unit="radian" />
+      <position name="crystal7-4_pos_pos_bot" x="138.0866806873399" y="-96.20837431797901" z="1550.5563425050236" unit="mm" />
+      <rotation name="crystal7-4_rot_pos_bot" x="-0.0590610984790547" y="-0.10968489717538729" z="0.0" unit="radian" />
+      <position name="crystal7-4_pos_neg_bot" x="-55.546680687339894" y="-96.20837431797901" z="1550.5563425050236" unit="mm" />
+      <rotation name="crystal7-4_rot_neg_bot" x="-0.0590610984790547" y="0.10968489717538729" z="0.0" unit="radian" />
[truncated at 1000 lines; 4419 more skipped]

java/branches/hps-java_HPSJAVA-88/detector-data/detectors/HPSTestRunTracker2014-v0
compact.xml 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/detector-data/detectors/HPSTestRunTracker2014-v0/compact.xml	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/detector-data/detectors/HPSTestRunTracker2014-v0/compact.xml	2014-10-06 19:40:35 UTC (rev 1140)
@@ -29,15 +29,32 @@
 	<constant name="dipoleMagnetLength" value="dipoleMagnetPositionZ*2.0" />
 	<constant name="constBFieldY" value="-0.491" />
  
+	<!-- ECAL -->
+    <constant name="ecal_front" value="13.3/2*mm" />
+	<constant name="ecal_back" value="16/2*mm" />
+	<constant name="ecal_z" value="160/2*mm" />
+   	<constant name="ecal_dx" value="41.27*mm" />
  
   </define>
   
   <materials>
+  	<!-- Set the world material to vacuum. -->
+    <material name="WorldMaterial">
+    	<D type="density" unit="g/cm3" value="0.0000000000000001"/>
+    	<fraction n="1.0" ref="Vacuum" />
+    </material>
     <!-- Set tracking material to vacuum. -->
     <material name="TrackingMaterial">
       <D type="density" unit="g/cm3" value="0.0000000000000001" />
       <fraction n="1.0" ref="Vacuum" />
     </material>
+	<!-- ECal crystal material. -->
+	<material name="LeadTungstate">
+		<D value="8.28" unit="g/cm3" />
+		<composite n="1" ref="Pb" />
+		<composite n="1" ref="W" />
+		<composite n="4" ref="O" />
+	</material>
   </materials>
   
   <display>
@@ -56,7 +73,8 @@
     <vis name="LayerVis" alpha="0.0" r="0.0" g="0.0" b="1.0" drawingStyle="wireframe" showDaughters="true" visible="false"/>
     <vis name="ComponentVis" alpha="0.0" r="0.0" g="0.2" b="0.4" drawingStyle="solid" showDaughters="false" visible="false"/>
 	<vis name="BeamPlaneVis" alpha="1.0" r="1.0" g="1.0" b="1.0" drawingStyle="solid" lineStyle="unbroken" showDaughters="false" visible="true"/>
-    
+
+    <vis name="ECALVis" r="0.8" g="0.5" b="0.1" />
   </display>
   
   <detectors>
@@ -92,6 +110,44 @@
         </modules>
       </support_plate>
     </detector>
+
+	<detector id="30" name="TrackerFieldDef" type="HPSTracker2"
+		readout="TrackerHitsThin">
+		<comment>The Silicon Vertex Tracker</comment>
+		<module name="TestRunModuleFieldDef">
+			<box x="dipoleMagnetWidth*4+1" y="dipoleMagnetHeight*4+1" />
+			<module_component thickness="0.000000001*cm"
+				material="Vacuum" sensitive="true">
+				<dimensions x="dipoleMagnetWidth*4" y="dipoleMagnetHeight*4" />
+			</module_component>
+		</module>
+		<layer id="1">
+			<module_placement name="TestRunModuleFieldDef" id="0"
+				x="0" y="0" z="dipoleMagnetPositionZ-dipoleMagnetLength/2" rx="0"
+				ry="0" rz="-PI/2" />
+		</layer>
+		<layer id="2">
+			<module_placement name="TestRunModuleFieldDef" id="0"
+				x="0" y="0" z="dipoleMagnetPositionZ+dipoleMagnetLength/2" rx="0"
+				ry="0" rz="-PI/2" />
+		</layer>
+	</detector>
+
+	<detector id="13" name="Ecal" type="HPSEcal3"
+		insideTrackingVolume="false" readout="EcalHits" vis="ECALVis">
+		<comment>The crystal ECal</comment>
+		<material name="LeadTungstate" />
+		<dimensions x1="ecal_front" y1="ecal_front" x2="ecal_back"
+			y2="ecal_back" z="ecal_z" />
+		<!-- Measurements as found in installation by Stepan -->
+		<!-- Moving ecal halves out by 6.5mm from SVT ecal-track matching - Pelle -->
+		<!-- Moving ecal face to reflect latest survey calculation 2/17/14 - Pelle -->
+		<layout beamgap="43.5*mm" nx="46" ny="5" dface="147.0*cm">
+			<remove ixmin="-10" ixmax="-2" iymin="-1" iymax="1" />
+			<top dx="ecal_dx" dy="0." dz="0." />
+			<bottom dx="ecal_dx" dy="0." dz="0." />
+		</layout>
+	</detector>
     
      
     
@@ -100,10 +156,28 @@
     <readout name="TrackerHits">
       <id>system:6,barrel:3,layer:4,module:12,sensor:1,side:32:-2,strip:12</id>
     </readout>
+	<readout name="TrackerHitsThin">
+		<id>system:6,barrel:3,layer:4,module:12,sensor:1,side:32:-2,strip:12</id>
+	</readout>
+
+	<readout name="EcalHits">
+		<segmentation type="GridXYZ" gridSizeX="0.0" gridSizeY="0.0"
+			gridSizeZ="0.0" />
+		<id>system:6,layer:2,ix:-8,iy:-6</id>
+	</readout>
   </readouts>
-  
-   <fields>
-        <field type="BoxDipole" name="AnalyzingDipole" x="0*cm" y="0*cm" z="dipoleMagnetPositionZ" dx="dipoleMagnetWidth/2.0" dy="dipoleMagnetHeight/2.0" dz="dipoleMagnetLength/2.0" bx="0.0" by="constBFieldY" bz="0.0" />
-    </fields>
+
+	<fields>
+		<field type="BoxDipole" name="AnalyzingDipole" x="0*cm" y="0*cm"
+			z="dipoleMagnetPositionZ" dx="dipoleMagnetWidth/2.0" dy="dipoleMagnetHeight/2.0"
+			dz="dipoleMagnetLength/2.0" bx="0.0" by="constBFieldY" bz="0.0" />
+	</fields>
+
+<!-- 
+	<includes>
+		<gdmlFile
+			ref="http://www.lcsim.org/test/gdml/testRunDownstreamVacuumFlange.gdml" />
+	</includes>
+    -->
  
 </lccdd>
\ No newline at end of file

java/branches/hps-java_HPSJAVA-88/detector-data
pom.xml 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/detector-data/pom.xml	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/detector-data/pom.xml	2014-10-06 19:40:35 UTC (rev 1140)
@@ -1,24 +1,20 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-    
     <modelVersion>4.0.0</modelVersion>
     <artifactId>hps-detector-data</artifactId>
     <name>detector-data</name>
     <description>detector conditions data for the HPS experiment</description>
-    
     <parent>
         <groupId>org.hps</groupId>
         <artifactId>hps-parent</artifactId>
         <relativePath>../parent/pom.xml</relativePath>
         <version>3.0.3-SNAPSHOT</version>
     </parent>
-    
     <scm>
         <url>http://java.freehep.org/svn/repos/hps/list/java/trunk/detector-data/</url>
         <connection>scm:svn:svn://svn.freehep.org/hps/java/trunk/detector-data/</connection>
         <developerConnection>scm:svn:svn://svn.freehep.org/hps/java/trunk/detector-data/</developerConnection>
     </scm>
-    
     <build>
         <resources>
             <resource>
@@ -31,5 +27,4 @@
             </resource>
         </resources>
     </build>
-    
 </project>

java/branches/hps-java_HPSJAVA-88/distribution
pom.xml 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/distribution/pom.xml	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/distribution/pom.xml	2014-10-06 19:40:35 UTC (rev 1140)
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
     <modelVersion>4.0.0</modelVersion>
     <artifactId>hps-distribution</artifactId>
     <name>distribution</name>
@@ -8,20 +7,17 @@
     <properties>
         <maven.javadoc.skip>true</maven.javadoc.skip>
     </properties>
-
     <parent>
         <groupId>org.hps</groupId>
         <artifactId>hps-parent</artifactId>
         <relativePath>../parent/pom.xml</relativePath>
         <version>3.0.3-SNAPSHOT</version>
-    </parent>
-    
+    </parent>    
     <scm>
         <url>http://java.freehep.org/svn/repos/hps/list/java/trunk/distribution/</url>
         <connection>scm:svn:svn://svn.freehep.org/hps/java/trunk/distribution/</connection>
         <developerConnection>scm:svn:svn://svn.freehep.org/hps/java/trunk/distribution/</developerConnection>
     </scm>
-
     <build>       
         <plugins>
             <plugin>
@@ -63,9 +59,8 @@
             </plugin>
         </plugins>
     </build>
-
     <dependencies>
-        <!-- This pulls in analysis et al transitively. -->
+        <!-- This next dep pulls in analysis et al. transitively. -->
         <dependency>
             <groupId>org.hps</groupId>
             <artifactId>hps-users</artifactId>
@@ -79,5 +74,4 @@
             <artifactId>hps-steering-files</artifactId>
         </dependency>
     </dependencies>
-
 </project>

java/branches/hps-java_HPSJAVA-88/ecal-readout-sim
pom.xml 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/ecal-readout-sim/pom.xml	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/ecal-readout-sim/pom.xml	2014-10-06 19:40:35 UTC (rev 1140)
@@ -1,24 +1,20 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-    
     <modelVersion>4.0.0</modelVersion>
     <artifactId>hps-ecal-readout-sim</artifactId>
     <name>ecal-readout-sim</name>
     <description>HPS ECAL readout simulation</description>
-    
     <parent>
         <groupId>org.hps</groupId>
         <artifactId>hps-parent</artifactId>
         <relativePath>../parent/pom.xml</relativePath>
         <version>3.0.3-SNAPSHOT</version>
     </parent>
-    
     <scm>
         <url>http://java.freehep.org/svn/repos/hps/list/java/trunk/ecal-readout-sim/</url>
         <connection>scm:svn:svn://svn.freehep.org/hps/java/trunk/ecal-readout-sim/</connection>
         <developerConnection>scm:svn:svn://svn.freehep.org/hps/java/trunk/ecal-readout-sim/</developerConnection>
     </scm>
-    
     <dependencies>
         <dependency>
             <groupId>org.hps</groupId>
@@ -29,5 +25,4 @@
             <artifactId>hps-conditions</artifactId>
         </dependency>
     </dependencies>
-    
 </project>

java/branches/hps-java_HPSJAVA-88/ecal-recon
pom.xml 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/ecal-recon/pom.xml	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/ecal-recon/pom.xml	2014-10-06 19:40:35 UTC (rev 1140)
@@ -1,34 +1,24 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-    
     <modelVersion>4.0.0</modelVersion>
     <artifactId>hps-ecal-recon</artifactId>
     <name>ecal-recon</name>
     <description>HPS ECAL reconstruction module</description>
-    
     <parent>
         <groupId>org.hps</groupId>
         <artifactId>hps-parent</artifactId>
         <relativePath>../parent/pom.xml</relativePath>
         <version>3.0.3-SNAPSHOT</version>
     </parent>
-    
     <scm>
         <url>http://java.freehep.org/svn/repos/hps/list/java/trunk/ecal-recon/</url>
         <connection>scm:svn:svn://svn.freehep.org/hps/java/trunk/ecal-recon/</connection>
         <developerConnection>scm:svn:svn://svn.freehep.org/hps/java/trunk/ecal-recon/</developerConnection>
     </scm>
-
     <dependencies>
         <dependency>
-            <groupId>org.lcsim</groupId>
-            <artifactId>lcsim-distribution</artifactId>
-            <version>${lcsimVersion}</version>
-        </dependency>
-        <dependency>
             <groupId>org.hps</groupId>
             <artifactId>hps-conditions</artifactId>
         </dependency>
     </dependencies>
-    
 </project>

java/branches/hps-java_HPSJAVA-88/ecal-recon/src/main/java/org/hps/recon/ecal
EcalClusterIC.java 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/ecal-recon/src/main/java/org/hps/recon/ecal/EcalClusterIC.java	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/ecal-recon/src/main/java/org/hps/recon/ecal/EcalClusterIC.java	2014-10-06 19:40:35 UTC (rev 1140)
@@ -1,5 +1,9 @@
 package org.hps.recon.ecal;
+import hep.physics.vec.BasicHep3Vector;
+import hep.physics.vec.Hep3Vector;
+import hep.physics.vec.VecOp;
 
+import java.awt.Point;
 import java.io.FileWriter;
 import java.io.IOException;
 import java.util.ArrayList;
@@ -11,6 +15,9 @@
 import java.util.Map;
 import java.util.Set;
 
+import org.hps.recon.ecal.HPSEcalClusterIC;
+import org.lcsim.detector.IGeometryInfo;
+import org.lcsim.detector.solids.Trd;
 import org.lcsim.event.CalorimeterHit;
 import org.lcsim.event.EventHeader;
 import org.lcsim.geometry.Detector;
@@ -153,6 +160,8 @@
         this.timeWindow = timeWindow;
     }
     
+    // Make a map for quick calculation of the x-y position of crystal face
+    public Map<Point, double[]> correctedPositionMap = new HashMap<Point, double[]>();
     
     public void startOfData() {
     	// Make sure that the calorimeter hit collection name is defined.
@@ -186,8 +195,7 @@
     public void process(EventHeader event) {
     	// Make sure the current event contains calorimeter hits.
         if (event.hasCollection(CalorimeterHit.class, ecalCollectionName)) {
-            // Get the list of raw calorimeter hits.
-            
+        	
             // Generate clusters from the calorimeter hits.
             //List<HPSEcalClusterIC> clusterList = null;
             try { createClusters(event); }
@@ -204,10 +212,10 @@
         	hitList.add(r);
         }
         
-        // Create a list to store the newly created clusters in.
+        //Create a list to store the newly created clusters in.
         ArrayList<HPSEcalClusterIC> clusterList = new ArrayList<HPSEcalClusterIC>();
         
-        // Create a list to store the rejected hits in.
+        //Create a list to store the rejected hits in.
         ArrayList<CalorimeterHit> rejectedHitList = new ArrayList<CalorimeterHit>();
         
         // Sort the list of hits by energy.
@@ -231,18 +239,17 @@
         	else { continue; }
         }
         
-    	// Create a map to connect the cell ID of a calorimeter crystal
-        // to the hit which occurred in that crystal.
+    	//Create a map to connect the cell ID of a calorimeter crystal to the hit which occurred in that crystal.
     	HashMap<Long, CalorimeterHit> hitMap = new HashMap<Long, CalorimeterHit>();
         for (CalorimeterHit hit : hitList) { hitMap.put(hit.getCellID(), hit); }
         
-        // Map a crystal to a list of all clusters in which it is a member.
+        //Map a crystal to a list of all clusters in which it is a member.
         Map<CalorimeterHit, List<CalorimeterHit>> commonHits = new HashMap<CalorimeterHit, List<CalorimeterHit>>();
-        
-        // Map a crystal to the seed of the cluster of which it is a member.
+
+        //Map a crystal to the seed of the cluster of which it is a member.
         HashMap<CalorimeterHit, CalorimeterHit> hitSeedMap = new HashMap<CalorimeterHit, CalorimeterHit>();
         
-      	// Set containing hits immediately around a seed hit.
+      	//Set containing hits immediately around a seed hit.
       	HashSet<CalorimeterHit> surrSeedSet = new HashSet<CalorimeterHit>();
         
         // Loop through all calorimeter hits to locate seeds and perform
@@ -374,9 +381,7 @@
         	}
         }
         
-        
-        
-        
+                
         // Performs second pass calculations for common hits.
         commonHitsLoop:
         for (CalorimeterHit clusteredHit : hitSeedMap.keySet()) {
@@ -443,9 +448,7 @@
         
         
         /*
-         * All hits are sorted from above. The next part of the code is for calculating energies. Still 
-         * needs implementation into new cluster collection so as to preserve shared hit energy 
-         * distribution within clusters.
+         * All hits are sorted from above. The next part of the code is for calculating energies and positions.
          */
                 
         //Create map to contain the total energy of each cluster
@@ -466,112 +469,187 @@
             seedEnergy.put(eSeed, eEnergy);
         }
 
-        //Distribute common hit energies with clusters
+        // Create a map to contain final uncorrected cluster energies including common hit distributions.
         Map<CalorimeterHit, Double> seedEnergyTot = seedEnergy;
         
+        //Distribute common hit energies with clusters
         for (Map.Entry<CalorimeterHit, List<CalorimeterHit>> entry1 : commonHits.entrySet()) {
         	CalorimeterHit commonCell = entry1.getKey();
         	CalorimeterHit seedA = entry1.getValue().get(0);
         	CalorimeterHit seedB = entry1.getValue().get(1);    	
-        	double eFractionA = seedEnergy.get(seedA)/(seedEnergy.get(seedA)+seedEnergy.get(seedB));
-        	double eFractionB = seedEnergy.get(seedB)/(seedEnergy.get(seedA)+seedEnergy.get(seedB));
+        	double eFractionA = Math.log(seedEnergy.get(seedA))/Math.log((seedEnergy.get(seedA)+seedEnergy.get(seedB)));
+        	double eFractionB = Math.log(seedEnergy.get(seedB))/Math.log((seedEnergy.get(seedA)+seedEnergy.get(seedB)));
         	double currEnergyA = seedEnergyTot.get(seedA);
         	double currEnergyB = seedEnergyTot.get(seedB);
         	currEnergyA += eFractionA * commonCell.getCorrectedEnergy();
         	currEnergyB += eFractionB * commonCell.getCorrectedEnergy();
 
         	seedEnergyTot.put(seedA, currEnergyA);
-        	seedEnergyTot.put(seedB, currEnergyB);
+        	seedEnergyTot.put(seedB, currEnergyB);       	
         }
+        
+        
+        // Make mapping to contain clusters with corrected energy.
+        Map<CalorimeterHit, Double> seedEnergyCorr = new HashMap<CalorimeterHit, Double>();
+        
+        // Energy Corrections as per HPS Note 2014-001
+            // Iterate through known clusters with energies and apply correction.
+            for (Map.Entry<CalorimeterHit, Double> entryC : seedEnergyTot.entrySet()) {
+                double rawEnergy = entryC.getValue();
+                
+                // Energy correction for initial guess of electron:
+                int pdg = 11;
+                double corrEnergy = enCorrection(pdg, rawEnergy);
+              
+                seedEnergyCorr.put(entryC.getKey(), corrEnergy);    
+            }// end of energy corrections
+        
+                
+        // Cluster Position as per HPS Note 2014-001
+        // Create map with seed as key to position/centroid value
+        Map<CalorimeterHit, double[]> rawSeedPosition = new HashMap<CalorimeterHit, double[]>();
+        Map<CalorimeterHit, double[]> corrSeedPosition = new HashMap<CalorimeterHit, double[]>();
+        
+        // top level iterates through seeds
+        for (Map.Entry<CalorimeterHit, Double> entryS : seedEnergyTot.entrySet()) {
+        	//get the seed for this iteration
+           	CalorimeterHit seedP = entryS.getKey();
+           	
+           	double xCl = 0.0; // calculated cluster x position, prior to correction
+            double yCl = 0.0; // calculated cluster y position
+            double eNumX = 0.0; 
+            double eNumY = 0.0;
+            double eDen = 0.0;
+            double w0 = 3.1;
 
+        	// iterate through hits corresponding to seed
+        	for (Map.Entry<CalorimeterHit, CalorimeterHit> entryP : hitSeedMap.entrySet()) {
+        		if(entryP.getValue() == seedP){
+        			///////////////////////////////
+        			// This block fills a map with crystal to center of face of crystal 
+        			// Get the hit indices as a Point.
+        			int ix = entryP.getKey().getIdentifierFieldValue("ix");
+        			int iy = entryP.getKey().getIdentifierFieldValue("iy");
+        			Point hitIndex = new Point(ix, iy);
 
-        
-        /*
-         * Prints the results in event display format. Not analyzed
-         * for efficiency, as this will ultimately not be a part of
-         * the driver and should be handled by the event display output
-         * driver instead. Contains output loops to collection.
-         */
-        // Only write to the output file is something actually exists.
-        if (hitMap.size() != 0) {
-        	// Increment the event number.
-        	eventNum++;
+        			// Get the corrected position for this index pair.
+        			double[] position = correctedPositionMap.get(hitIndex);
+
+        			// If the result is null, it hasn't been calculated yet.
+        			if(position == null) {
+        				// Calculate the corrected position.
+        				IGeometryInfo geom = entryP.getKey().getDetectorElement().getGeometry();
+        				double[] pos = geom.transformLocalToGlobal(VecOp.add(geom.transformGlobalToLocal(geom.getPosition()),(Hep3Vector)new BasicHep3Vector(0,0,-1*((Trd)geom.getLogicalVolume().getSolid()).getZHalfLength()))).v();
+      
+        				// Convert the result to  a Double[] array.
+        				position = new double[3];
+        				position[0] = pos[0];
+        				position[1] = pos[1];
+        				position[2] = pos[2];
+      
+        				// Store the result in the map.
+        				correctedPositionMap.put(hitIndex, position);
+        			}
+        			///////////////////////////////
         	
-        	// Write the event header.
-//        	writeHits.append(String.format("Event\t%d%n", eventNum));
+        			//Use Method 3 weighting scheme described in note:
+        			eNumX += Math.max(0.0,(w0+Math.log(entryP.getKey().getCorrectedEnergy()
+        					/seedEnergyTot.get(seedP))))*(correctedPositionMap.get(hitIndex)[0]/10.0);    		
+        			eNumY += Math.max(0.0,(w0+Math.log(entryP.getKey().getCorrectedEnergy()
+        					/seedEnergyTot.get(seedP))))*(correctedPositionMap.get(hitIndex)[1]/10.0);
+        			eDen += Math.max(0.0, (w0+Math.log(entryP.getKey().getCorrectedEnergy()/
+        					seedEnergyTot.get(seedP))));        	        	
+        		}
+        		
+        	}
         	
-        	// Write the calorimeter hits that passed the energy cut.
-            for (CalorimeterHit n : hitList) {
-            	int hix = n.getIdentifierFieldValue("ix");
-            	int hiy = n.getIdentifierFieldValue("iy");
-            	double energy = n.getCorrectedEnergy();
-//            	writeHits.append(String.format("EcalHit\t%d\t%d\t%f%n", hix, hiy, energy));
-            }
+        	xCl = eNumX/eDen;
+            yCl = eNumY/eDen;
             
+            double[] rawPosition = new double[3];
+            rawPosition[0] = xCl;
+            rawPosition[1] = yCl;
+            int ix = seedP.getIdentifierFieldValue("ix");
+			int iy = seedP.getIdentifierFieldValue("iy");
+			Point hitIndex = new Point(ix, iy);
+            rawPosition[2] = correctedPositionMap.get(hitIndex)[2];
             
+            
+            
+            // Apply position correction factors:
+            // Position correction for electron:
+            int pdg = 11;
+            double xCorr = posCorrection(pdg, xCl, seedEnergyTot.get(seedP));
+           
+            double[] corrPosition = new double[3];
+            corrPosition[0] = xCorr;
+            corrPosition[1] = yCl;
+            corrPosition[2] = correctedPositionMap.get(hitIndex)[2];
+                        
+            corrSeedPosition.put(seedP, corrPosition);
+            rawSeedPosition.put(seedP, rawPosition);
+
+        	
+        }// end of cluster position calculation
+
+                
+        /*
+         * Outputs results to cluster collection. 
+         */
+        // Only write output if something actually exists.
+        if (hitMap.size() != 0) {
+            // Loop over seeds
             for (Map.Entry<CalorimeterHit, CalorimeterHit> entry2 : hitSeedMap.entrySet()) {
                 if (entry2.getKey() == entry2.getValue()){
                 	if((entry2.getKey().getCorrectedEnergy()<seedEnergyThreshold)
                 		||(seedEnergyTot.get(entry2.getKey())<clusterEnergyThreshold)) 
                 	{	
-                		rejectedHitList.add(entry2.getKey());
+                		//Not clustered for not passing cuts
+                		rejectedHitList.add(entry2.getKey()); 
                 	}
                 	
                 	else{
-                	
-                		int six = entry2.getKey().getIdentifierFieldValue("ix");
-                		int siy = entry2.getKey().getIdentifierFieldValue("iy");
-                		double energy = seedEnergyTot.get(entry2.getKey());
-//                		writeHits.append(String.format("Cluster\t%d\t%d\t%f%n", six, siy, energy));
-                	
+                		// New cluster
                 		HPSEcalClusterIC cluster = new HPSEcalClusterIC(entry2.getKey());
-                		cluster.addHit(entry2.getKey());
-
+                		clusterList.add(cluster);
+                		// Loop over hits belonging to seeds
                 		for (Map.Entry<CalorimeterHit, CalorimeterHit> entry3 : hitSeedMap.entrySet()) {
                 			if (entry3.getValue() == entry2.getValue()) {
                 				if(rejectedHitList.contains(entry2.getValue())){
                 					rejectedHitList.add(entry3.getKey());
                 				}
                 				else{
-                					int ix = entry3.getKey().getIdentifierFieldValue("ix");
-                					int iy = entry3.getKey().getIdentifierFieldValue("iy");
-//                       			writeHits.append(String.format("CompHit\t%d\t%d%n", ix, iy));
-                        	
+                					// Add hit to cluster
                 					cluster.addHit(entry3.getKey());
                 				}
                 			}
                 		}
                 		
                     for (Map.Entry<CalorimeterHit, List<CalorimeterHit>> entry4 : commonHits.entrySet()) {
-                        if (entry4.getValue().contains(entry2.getKey())) {
-                        	int ix = entry4.getKey().getIdentifierFieldValue("ix");
-                        	int iy = entry4.getKey().getIdentifierFieldValue("iy");
-//                        	writeHits.append(String.format("SharHit\t%d\t%d%n", ix, iy));
-                        	
-                        	// Added in shared hits for energy distribution between clusters, changed by HS 02JUN14
-//                            cluster.addHit(entry4.getKey());
-                            cluster.addSharedHit(entry4.getKey());
+                        if (entry4.getValue().contains(entry2.getKey())) {                       	
+                        	// Add shared hits for energy distribution between clusters
+                            cluster.addSharedHit(entry4.getKey()); 
                         }
                     }
-                    for(CalorimeterHit q : rejectedHitList)
-                    {// This does not output in correct event display format, just for de-bugging
-//                    	writeHits.append("Rejected"+q.getIdentifierFieldValue("ix")+"\t"+q.getIdentifierFieldValue("iy")+"\n");
-                    }
+                                        
+                    //Input both raw and corrected cluster energies
+            		if (seedEnergyCorr.values().size() > 0){
+            			cluster.setEnergy(seedEnergyCorr.get(entry2.getKey()));
+            			cluster.setRawEnergy(seedEnergyTot.get(entry2.getKey()));
+            			}
+
+            		//Input both uncorrected and corrected cluster positions. 
+            		cluster.setCorrPosition(corrSeedPosition.get(entry2.getKey()));
+            		cluster.setRawPosition(rawSeedPosition.get(entry2.getKey()));
+                  
                     
-                    
-                    cluster.setEnergy(energy);
-                   	clusterList.add(cluster);
                 	}// End checking thresholds and write out.
-                }
-                
-            
+                }                            
             } //End cluster loop
-         // Write the event termination header.
-//            writeHits.append("EndEvent\n");
 //            System.out.println("Number of clusters: "+clusterList.size());    
 
             
-        } //End event display out loop.
+        } //End event output loop.
         int flag = 1 << LCIOConstants.CLBIT_HITS;
         event.put(clusterCollectionName, clusterList, HPSEcalClusterIC.class, flag);
         event.put(rejectedHitName, rejectedHitList, CalorimeterHit.class, flag);
@@ -589,49 +667,11 @@
         }
     }
     
-  /*  private static class EnergyComparator implements Comparator<CalorimeterHit> {
-        public int compare(CalorimeterHit o1, CalorimeterHit o2) {
-        	// If the energies are equivalent, the same, the two hits
-        	// are considered equivalent.
-        	if(o1.getCorrectedEnergy() == o2.getCorrectedEnergy()) { return 0; }
-        	
-        	// Higher energy hits are ranked higher than lower energy hits.
-        	else if(o1.getCorrectedEnergy() > o2.getCorrectedEnergy()) { return -1; }
-        	
-        	// Lower energy hits are ranked lower than higher energy hits.
-        	else { return 1; }
-        }
-    }*/
-    
-/*    // Also accounts for pathological case of cluster hits that are EXACTLY the same.
+ 
     private static class EnergyComparator implements Comparator<CalorimeterHit> {
-        public int compare(CalorimeterHit o1, CalorimeterHit o2) {
-        	// If the energies are equivalent, the same, the two hits
-        	// are considered equivalent.
-        	if(o1.getCorrectedEnergy() == o2.getCorrectedEnergy()) { 
-        		if(Math.abs(o1.getIdentifierFieldValue("iy")) < Math.abs(o2.getIdentifierFieldValue("iy"))){
-        			return -1;
-        		}
-        		else if((Math.abs(o1.getIdentifierFieldValue("iy")) == Math.abs(o2.getIdentifierFieldValue("iy")))
-        			&& (o1.getIdentifierFieldValue("ix") < o2.getIdentifierFieldValue("ix"))){
-        			return -1; }
-        		else if (Math.abs(o1.getIdentifierFieldValue("iy")) > Math.abs(o2.getIdentifierFieldValue("iy"))){
-        			return 1;
-        		}
-        		else{return 1;}
-        	}
-        	// Higher energy hits are ranked higher than lower energy hits.
-        	else if(o1.getCorrectedEnergy() > o2.getCorrectedEnergy()) { return -1; }
-        	
-        	// Lower energy hits are ranked lower than higher energy hits.
-        	else { return 1; }
-        }
-    }
-*/
-    private static class EnergyComparator implements Comparator<CalorimeterHit> {
     	/**
     	 * Compares the first hit with respect to the second. This
-    	 * method will compare hits first by energy, and the spatially.
+    	 * method will compare hits first by energy, and then spatially.
     	 * In the case of equal energy hits, the hit closest to the
     	 * beam gap and closest to the positron side of the detector
     	 * will be selected. If all of these conditions are true, the
@@ -692,7 +732,12 @@
      
     
 
-    // Handles pathological case where multiple neighboring crystals have EXACTLY the same energy.
+    /**
+     * Handles pathological case where multiple neighboring crystals have EXACTLY the same energy.
+     * @param hit
+     * @param neighbor Neighbor to hit
+     * @return boolean value of if the hit is a seed
+     */
     private boolean equalEnergies(CalorimeterHit hit, CalorimeterHit neighbor){
     	boolean isSeed = true;
     	
@@ -713,7 +758,54 @@
     	}
     	return isSeed;	
     }
+    /**
+     * Calculates energy correction based on cluster raw energy and particle type as per HPS Note 2014-001
+     * @param pdg Particle id as per PDG
+     * @param rawEnergy Raw Energy of the cluster (sum of hits with shared hit distribution)
+     * @return Corrected Energy
+     */    
+    public double enCorrection(int pdg, double rawEnergy){
+  	   if (pdg == 11) { // Particle is electron
+  		   double corrEnergy = rawEnergy / (-0.0027 * rawEnergy - 0.06 / (Math.sqrt(rawEnergy)) + 0.95);
+  		  return corrEnergy;}
+  	   else if (pdg == -11) { //Particle is positron
+  		   double corrEnergy = rawEnergy / (-0.0096 * rawEnergy - 0.042 / (Math.sqrt(rawEnergy)) + 0.94);
+  		  return corrEnergy;}
+  	   else if (pdg == 22) { //Particle is photon
+  		   double corrEnergy = rawEnergy / (0.0015 * rawEnergy - 0.047 / (Math.sqrt(rawEnergy)) + 0.94);
+  		  return corrEnergy;}
+  	   else { //Unknown 
+  		   double corrEnergy = rawEnergy;
+  		  return corrEnergy;}
+  	   
+     }   
     
+    /**
+     * Calculates position correction based on cluster raw energy, x calculated position, 
+     * and particle type as per HPS Note 2014-001
+     * @param pdg Particle id as per PDG
+     * @param xCl Calculated x centroid position of the cluster, uncorrected, at face
+     * @param rawEnergy Raw energy of the cluster (sum of hits with shared hit distribution)
+     * @return Corrected x position
+     */
+    public double posCorrection(int pdg, double xCl, double rawEnergy){
+    	if (pdg == 11) { //Particle is electron
+    		double xCorr = xCl-(0.0066/Math.sqrt(rawEnergy)-0.03)*xCl-
+    				(0.028*rawEnergy-0.45/Math.sqrt(rawEnergy)+0.465);
+    		return xCorr;}
+    	else if (pdg == -11) {// Particle is positron
+    		double xCorr = xCl-(0.0072/Math.sqrt(rawEnergy)-0.031)*xCl-
+    				(0.007*rawEnergy+0.342/Math.sqrt(rawEnergy)+0.108);
+    		return xCorr;}
+    	else if (pdg == 22) {// Particle is photon
+    		double xCorr = xCl-(0.005/Math.sqrt(rawEnergy)-0.032)*xCl-
+    				(0.011*rawEnergy-0.037/Math.sqrt(rawEnergy)+0.294);
+    		return xCorr;}
+    	else { //Unknown 
+    		double xCorr = xCl;
+    		return xCorr;}
+    	}
     
     
-}    
\ No newline at end of file
+    	
+ }    
\ No newline at end of file

java/branches/hps-java_HPSJAVA-88/ecal-recon/src/main/java/org/hps/recon/ecal
HPSEcalClusterIC.java 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/ecal-recon/src/main/java/org/hps/recon/ecal/HPSEcalClusterIC.java	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/ecal-recon/src/main/java/org/hps/recon/ecal/HPSEcalClusterIC.java	2014-10-06 19:40:35 UTC (rev 1140)
@@ -1,30 +1,26 @@
 package org.hps.recon.ecal;
 
-import hep.physics.vec.BasicHep3Vector;
-import hep.physics.vec.Hep3Vector;
-import hep.physics.vec.VecOp;
-
 import java.util.ArrayList;
 import java.util.List;
 
-import org.lcsim.detector.IGeometryInfo;
-import org.lcsim.detector.solids.Trd;
 import org.lcsim.event.CalorimeterHit;
 import org.lcsim.event.base.BaseCluster;
 
 /**
- * Cluster with position defined by seed hit (for 1-bit trigger)
+ * Cluster with addition to include shared hits and set position
+ * as calculated in full cluster code. 
  *
  * @author Sho Uemura <[log in to unmask]>
  * @author Holly Szumila <[log in to unmask]>
  * 
- * @version $Id: HPSEcalCluster.java,v 1.11 2013/02/25 22:39:24 meeg Exp $
  */
 public class HPSEcalClusterIC extends BaseCluster {
 
     private CalorimeterHit seedHit = null;
     private long cellID;
     private ArrayList<CalorimeterHit> sharedHitList = new ArrayList<CalorimeterHit>(); 
+    private double[] rawPosition = new double[2];
+
     
     
     static final double eCriticalW = 800.0*ECalUtils.MeV/(74+1);
@@ -54,20 +50,100 @@
         }
         return seedHit;
     }
-    
+    /**
+     * Input shared hits between two clusters. 
+     */
     public void addSharedHit(CalorimeterHit sharedHit) {
     	sharedHitList.add(sharedHit);
     }
-    
+    /**
+     * Return shared hit list between two clusters. 
+     */
     public List<CalorimeterHit> getSharedHits() {
     	return sharedHitList;
+    }  
+    /**
+     * Inputs the uncorrected x,y,z position of the cluster.
+     */
+    public void setRawPosition(double[] Position) {
+    	rawPosition = Position;
+    }  
+    /**
+     * Returns the uncorrected x,y,z position of the cluster.
+     */
+    @Override
+    public double[] getPosition(){
+    	return this.rawPosition;
+    }   
+    /**
+     * Do an external calculation of the raw energy and set it. Includes shared hit distribution.
+     */
+    public void setRawEnergy(double rawEnergy){
+    	raw_energy = rawEnergy;
     }
+    /**
+     * Inputs the corrected position of the cluster, see HPS Note 2014-001.
+     */
+    public void setCorrPosition(double[] Position) {
+    	position = Position;
+    }    
+    /**
+     * Returns the corrected position of the cluster. 
+     */
+    public double[] getCorrPosition(){
+    	return this.position;
+    }
     
-//    public double[] getPosition() {
-//        return getSeedHit().getPosition();
-//    }
-//    
-    @Override
+    /**
+     * Calculates energy correction based on cluster raw energy and particle type as per HPS Note 2014-001
+     * @param pdg Particle id as per PDG
+     * @param rawEnergy Raw Energy of the cluster (sum of hits with shared hit distribution)
+     * @return Corrected Energy
+     */    
+    public double energyCorrection(int pdg, double rawEnergy){
+  	   if (pdg == 11) { // Particle is electron
+  		   double corrEnergy = rawEnergy / (-0.0027 * rawEnergy - 0.06 / (Math.sqrt(rawEnergy)) + 0.95);
+  		  return corrEnergy;}
+  	   else if (pdg == -11) { //Particle is positron
+  		   double corrEnergy = rawEnergy / (-0.0096 * rawEnergy - 0.042 / (Math.sqrt(rawEnergy)) + 0.94);
+  		  return corrEnergy;}
+  	   else if (pdg == 22) { //Particle is photon
+  		   double corrEnergy = rawEnergy / (0.0015 * rawEnergy - 0.047 / (Math.sqrt(rawEnergy)) + 0.94);
+  		  return corrEnergy;}
+  	   else { //Unknown 
+  		   double corrEnergy = rawEnergy;
+  		  return corrEnergy;}
+  	   
+     }   
+    
+    /**
+     * Calculates position correction based on cluster raw energy, x calculated position, 
+     * and particle type as per HPS Note 2014-001
+     * @param pdg Particle id as per PDG
+     * @param xCl Calculated x centroid position of the cluster, uncorrected, at face
+     * @param rawEnergy Raw energy of the cluster (sum of hits with shared hit distribution)
+     * @return Corrected x position
+     */
+    public double positionCorrection(int pdg, double xCl, double rawEnergy){
+    	if (pdg == 11) { //Particle is electron
+    		double xCorr = xCl-(0.0066/Math.sqrt(rawEnergy)-0.03)*xCl-
+    				(0.028*rawEnergy-0.45/Math.sqrt(rawEnergy)+0.465);
+    		return xCorr;}
+    	else if (pdg == -11) {// Particle is positron
+    		double xCorr = xCl-(0.0072/Math.sqrt(rawEnergy)-0.031)*xCl-
+    				(0.007*rawEnergy+0.342/Math.sqrt(rawEnergy)+0.108);
+    		return xCorr;}
+    	else if (pdg == 22) {// Particle is photon
+    		double xCorr = xCl-(0.005/Math.sqrt(rawEnergy)-0.032)*xCl-
+    				(0.011*rawEnergy-0.037/Math.sqrt(rawEnergy)+0.294);
+    		return xCorr;}
+    	else { //Unknown 
+    		double xCorr = xCl;
+    		return xCorr;}
+    	}
+    
+    
+ /*   @Override
     public double[] getPosition() {
         //Electron by default!?
         return this.getPositionAtShowerMax(true);
@@ -93,7 +169,8 @@
         double y = E/eCriticalW;
         double Cj = isElectron ? -0.5 : 0.5;
         double tmax = Math.log(y) + Cj; //Maximum of dE/dt profile in units of rad. len. 
-        double dmax = tmax*radLenW; //mm
+//        double dmax = tmax*radLenW; //mm
+        double dmax = 0.0; //Changed this to readout crystal centroid at face
         if(isElectron) {
             electronPosAtDepth =  calculatePositionAtDepth(dmax);
         } else {
@@ -165,7 +242,10 @@
             //Find position at shower max
             IGeometryInfo geom = hit.getDetectorElement().getGeometry();
             double[] pos = geom.transformLocalToGlobal(VecOp.add(geom.transformGlobalToLocal(geom.getPosition()),(Hep3Vector)new BasicHep3Vector(0,0,dmax-1*((Trd)geom.getLogicalVolume().getSolid()).getZHalfLength()))).v();
-                        
+
+
+            
+            
 //            System.out.println("global pos " + global_pos.toString());
 //            System.out.println("local pos " + local_pos.toString());
 //            System.out.println("local pos tmax " + local_pos_tmax.toString());
@@ -431,7 +511,7 @@
         return positionLocal;
     }
     
+  */  
     
     
-    
 }

java/branches/hps-java_HPSJAVA-88/integration-tests
pom.xml 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/integration-tests/pom.xml	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/integration-tests/pom.xml	2014-10-06 19:40:35 UTC (rev 1140)
@@ -2,7 +2,7 @@
     <modelVersion>4.0.0</modelVersion>
     <artifactId>hps-integration-tests</artifactId>
     <name>integration-tests</name>
-    <description>Integration test suite</description>
+    <description>Integration test suite for HPS Java</description>
     <parent>
         <groupId>org.hps</groupId>
         <artifactId>hps-parent</artifactId>
@@ -27,19 +27,40 @@
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
                     <excludes>
-                        <exclude>org/hps/GenerateEcalReadoutSimData.java</exclude>
+                        <exclude>org/hps/EtSystemTest.java</exclude>
                     </excludes>
+                    <redirectTestOutputToFile>true</redirectTestOutputToFile>
+                    <trimStackTrace>true</trimStackTrace>
                 </configuration>
             </plugin>
-        </plugins>            
+        </plugins>
     </build>
-    <profiles>
+     <profiles>
+        <!-- This profile is for deactivating all integration tests when building everything from trunk. -->
         <profile>
-            <id>non-slac</id>
+            <id>no-integration-tests</id>
             <activation>
                 <activeByDefault>false</activeByDefault>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-surefire-plugin</artifactId>
+                        <configuration>
+                            <skipTests>true</skipTests>
+                        </configuration>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>  
+        <!-- This profile activates automatically when not running tests on a SLAC Unix system with NFS access. -->
+        <profile>
+            <id>no-slac-nfs</id>
+            <activation>
+                <activeByDefault>false</activeByDefault>
                 <file>
-                    <missing>/nfs/slac/g/hps3/</missing>
+                    <missing>/nfs/slac/g/hps/</missing>
                 </file>
             </activation>
             <build>
@@ -48,14 +69,13 @@
                         <groupId>org.apache.maven.plugins</groupId>
                         <artifactId>maven-surefire-plugin</artifactId>
                         <configuration>
-                            <excludes>
-                                <exclude>org/hps/EcalReadoutSimTest.java</exclude>
-                                <exclude>org/hps/EtSystemTest.java</exclude>
+                            <excludes>                            
+                                <exclude>org/hps/EcalReadoutSimTest.java</exclude>                                
                             </excludes>
                         </configuration>
                     </plugin>
-                </plugins>            
-            </build>
-        </profile>    
+                </plugins>
+            </build>        
+        </profile>  
     </profiles>    
 </project>

java/branches/hps-java_HPSJAVA-88/integration-tests/src/test/java/org/hps
EcalReadoutSimTest.java 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/integration-tests/src/test/java/org/hps/EcalReadoutSimTest.java	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/integration-tests/src/test/java/org/hps/EcalReadoutSimTest.java	2014-10-06 19:40:35 UTC (rev 1140)
@@ -7,6 +7,7 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
+import java.net.URL;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
@@ -23,6 +24,7 @@
 import org.lcsim.job.JobControlManager;
 import org.lcsim.util.Driver;
 import org.lcsim.util.aida.AIDA;
+import org.lcsim.util.cache.FileCache;
 import org.lcsim.util.loop.LCSimLoop;
 
 /**
@@ -60,6 +62,7 @@
  * 
  * @author Jeremy McCormick <[log in to unmask]>
  */
+// FIXME: The input file for this test is too big and breaks the FileCache.  Use a smaller input file!
 public class EcalReadoutSimTest extends TestCase {
 
     // Expected values of event and collection object totals.
@@ -89,8 +92,10 @@
     static final String steeringResource = "/org/hps/steering/test/EcalReadoutSimTest.lcsim";
     static final String triggeredEventsResource = "/org/hps/test/EcalReadoutSimTest/triggered_events.txt";
     
-    // File information.
-    static final File inputFile = new File("/nfs/slac/g/hps3/data/testcase/ecal_readout_sim_input.slcio");
+    // File information.        
+    //static final String fileLocation = "http://www.lcsim.org/test/hps-java/EcalReadoutSimTest.slcio";
+    static final File inputFile = new File("/nfs/slac/g/lcd/mc/prj/www/lcsim/test/hps-java/EcalReadoutSimTest.slcio");
+    
     static final File outputDir = new File("./target/test-output/" + className);    
     static final File outputFile = new File(outputDir + File.separator + className);
     static final File aidaOutputFile = new File(outputDir + File.separator + className + ".aida");
@@ -118,7 +123,7 @@
     /**
      * Run an integration test of the ECAL readout simulation.
      */
-    public void testEcalReadoutSim() {
+    public void testEcalReadoutSim() throws Exception {
         
         // Run the ECAL readout simulation.
         runEcalReadoutSim();
@@ -131,13 +136,11 @@
      * This method runs the simulation and writes the data to an output LCIO file
      * located in the <tt>target</tt> directory.
      */
-    private void runEcalReadoutSim() {
+    private void runEcalReadoutSim() throws Exception {
         
-        if (!inputFile.exists()) {
-            System.err.println("File " + inputFile.getPath() + " is not accessible.");
-            throw new RuntimeException("Input file not found.");
-        }
-        
+        //FileCache cache = new FileCache();
+        //File inputFile = cache.getCachedFile(new URL(fileLocation));        
+                         
         outputDir.mkdirs();
         if (!outputDir.exists()) {
             System.err.println("Failed to create output directory " + outputDir.getPath());

java/branches/hps-java_HPSJAVA-88/integration-tests/src/test/java/org/hps
EtSystemTest.java 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/integration-tests/src/test/java/org/hps/EtSystemTest.java	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/integration-tests/src/test/java/org/hps/EtSystemTest.java	2014-10-06 19:40:35 UTC (rev 1140)
@@ -4,11 +4,13 @@
 import java.io.File;
 import java.io.IOException;
 import java.net.InetAddress;
+import java.net.URL;
 import java.util.ArrayList;
 import java.util.List;
 
 import junit.framework.TestCase;
 
+import org.hps.record.evio.EvioFileProducer;
 import org.jlab.coda.et.EtAttachment;
 import org.jlab.coda.et.EtConstants;
 import org.jlab.coda.et.EtEvent;
@@ -25,9 +27,8 @@
 import org.jlab.coda.et.exception.EtException;
 import org.jlab.coda.et.exception.EtTimeoutException;
 import org.jlab.coda.et.exception.EtWakeUpException;
+import org.lcsim.util.cache.FileCache;
 
-import org.hps.record.evio.EvioFileProducer;
-
 /**
  * <p>
  * This class runs an ET ring, EVIO file producer, and an ET station in separate system processes,
@@ -45,7 +46,8 @@
 
     static final String loadPath = new File("../et/lib/Linux-x86_64/").getAbsoluteFile().getAbsolutePath();
     //static final String evioFile = "/nfs/slac/g/hps3/data/testrun/runs/evio/hps_000975.evio.0";
-    static final String evioFile = "/nfs/slac/g/hps3/data/testcase/hps_000975.evio.0";
+    //static final String evioFile = "/nfs/slac/g/hps3/data/testcase/hps_000975.evio.0";
+    static final String fileLocation = "http://www.lcsim.org/test/hps-java/EtSystemTest.evio";
     static final String classPath = System.getProperty("java.class.path");
     static final String javaPath = System.getProperty("java.home") + File.separator + "bin" + File.separator + "java";        
     static final String etBuffer = "ETBuffer";
@@ -60,8 +62,11 @@
      * file onto the ring.  Each of these tasks is done on a separate operating system
      * process.
      */
-    public void testEtSystem() {
+    public void testEtSystem() throws Exception {
         
+        FileCache cache = new FileCache();
+        File inputFile = cache.getCachedFile(new URL(fileLocation));
+                
         // Add shutdown hook to cleanup processes in case test case is interrupted.
         Runtime.getRuntime().addShutdownHook(new ProcessCleanupThread());
                         
@@ -89,7 +94,7 @@
         processes.add(etStationProcess);
         
         // Start the file producer.
-        Process fileProducerProcess = execFileProducer();
+        Process fileProducerProcess = execFileProducer(inputFile);
         processes.add(fileProducerProcess);
                 
         // Wait for the file producer to finish.
@@ -154,7 +159,7 @@
      * Execute the EVIO file producer process.
      * @return The <tt>Process</tt> that was created by <tt>ProcessBuilder</tt>.
      */
-    Process execFileProducer() {        
+    Process execFileProducer(File file) {        
         
         ProcessBuilder processBuilder = new ProcessBuilder(
                 javaPath,
@@ -163,7 +168,7 @@
                 classPath,                
                 EvioFileProducer.class.getName(),                
                 "-e",
-                evioFile,
+                file.getPath(),
                 "-f",
                 etBuffer,
                 "-host",

java/branches/hps-java_HPSJAVA-88/integration-tests/src/test/java/org/hps
GenerateEcalReadoutSimData.java removed after 1139
--- java/branches/hps-java_HPSJAVA-88/integration-tests/src/test/java/org/hps/GenerateEcalReadoutSimData.java	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/integration-tests/src/test/java/org/hps/GenerateEcalReadoutSimData.java	2014-10-06 19:40:35 UTC (rev 1140)
@@ -1,36 +0,0 @@
-package org.hps;
-
-import java.io.File;
-
-import junit.framework.TestCase;
-
-import org.lcsim.job.JobControlManager;
-import org.lcsim.util.loop.LCSimLoop;
-import org.lcsim.util.test.TestUtil.TestOutputFile;
-
-/**
- * Run the ECAL readout simulation on current SLIC MC data.
- * @author Jeremy McCormick <[log in to unmask]>
- */
-public class GenerateEcalReadoutSimData extends TestCase {
-    
-    // This file is tridents, AP and backgrounds merged together into one event file.
-    static String dataPath = "/nfs/slac/g/hps3/data/testcase/ap050mev_egs_tri_6.6gev_0.0025x0_450na_5e5b_30mr_001_SLIC-v04-00-00_Geant4-v10-00-02_QGSP_BERT_HPS-Proposal2014-v8-6pt6.slcio";
-    
-    public void testGenerateReadoutSimData() throws Exception {
-        
-        // Generate ecal readout simulation data from an MC input file.
-        JobControlManager job = new JobControlManager();
-        job.addVariableDefinition("outputFile", new TestOutputFile("readout").getPath());
-        job.addInputFile(new File(dataPath));
-        job.setup("/org/hps/steering/readout/HPS2014TruthReadoutToLcio.lcsim");
-        job.configure();
-        job.run();
-        
-        // Read in the readout file and print summary info.
-        LCSimLoop loop = new LCSimLoop();
-        loop.setLCIORecordSource(new TestOutputFile("readout.slcio"));
-        loop.loop(-1);
-        System.out.println("# Events written: " + loop.getTotalSupplied());
-    }      
-}

java/branches/hps-java_HPSJAVA-88/integration-tests/src/test/java/org/hps
MockDataReconTest.java 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/integration-tests/src/test/java/org/hps/MockDataReconTest.java	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/integration-tests/src/test/java/org/hps/MockDataReconTest.java	2014-10-06 19:40:35 UTC (rev 1140)
@@ -1,7 +1,5 @@
 package org.hps;
 
-import hep.aida.IHistogram1D;
-
 import java.io.File;
 import java.io.IOException;
 import java.net.URL;
@@ -21,14 +19,15 @@
 import org.lcsim.util.loop.LCSimLoop;
 
 /**
- * This test runs the standard reconstruction on a small set of Mock Data events generated by the
- * trigger simulation. It then generates a set of diagnostic plots which are checked against an
- * answer key.
+ * This test runs the standard reconstruction on a small set of Mock Data input events.
  * 
  * @author Jeremy McCormick <[log in to unmask]>
  */
 public class MockDataReconTest extends TestCase {
 
+    static final String fileLocation = "http://www.lcsim.org/test/hps-java/MockDataReconTest.slcio";
+    //static final String mockDataUrl = "http://www.slac.stanford.edu/~meeg/hps2/meeg/mock_data/tritrig-beam-tri_1-10_readout.slcio";
+    
     static final String className = MockDataReconTest.class.getSimpleName();
     static final File outputDir = new File("./target/test-output/" + className);
     static final File outputFile = new File(outputDir.getAbsolutePath() + File.separator + className);
@@ -36,7 +35,6 @@
     static final File aidaFile = new File(outputFile.getAbsolutePath() + ".aida");    
 
     static final String steeringResource = "/org/hps/steering/test/MockDataReconTest.lcsim";
-    //static final String steeringResource = "/org/hps/steering/recon/HPS2014OfflineTruthRecon.lcsim";
     
     // TODO: Get some values for these and add test assertions!
     /*
@@ -53,8 +51,6 @@
 
     AIDA aida = AIDA.defaultInstance();
 
-    static final String mockDataUrl = "http://www.slac.stanford.edu/~meeg/hps2/meeg/mock_data/tritrig-beam-tri_1-10_readout.slcio";
-
     public void setUp() {
         // Delete files if they already exist.
         if (reconFile.exists())
@@ -84,12 +80,12 @@
     private void runRecon() {
         
         System.out.println("caching file ...");
-        System.out.println(mockDataUrl);
+        System.out.println(fileLocation);
         
         File mockDataFile = null;
         try {
             FileCache cache = new FileCache();
-            mockDataFile = cache.getCachedFile(new URL(mockDataUrl));
+            mockDataFile = cache.getCachedFile(new URL(fileLocation));
         } catch (IOException e) {
             throw new RuntimeException(e);
         }

java/branches/hps-java_HPSJAVA-88/monitoring-app
pom.xml 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/monitoring-app/pom.xml	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/monitoring-app/pom.xml	2014-10-06 19:40:35 UTC (rev 1140)
@@ -98,7 +98,6 @@
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
                     <excludes>
-                        <exclude>org/hps/monitoring/record/**/**.java</exclude>
                         <exclude>org/hps/monitoring/subsys/et/**.java</exclude>
                     </excludes>
                 </configuration>
@@ -125,7 +124,7 @@
         <dependency>
             <groupId>jfreechart-aida-experimental</groupId>
             <artifactId>jfreechart-aida-experimental</artifactId>
-            <version>1.2</version>
+            <version>1.3-SNAPSHOT</version>
             <exclusions>
                 <exclusion>  
                     <groupId>jdom</groupId>

java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/gui
AbstractFieldsPanel.java 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/gui/AbstractFieldsPanel.java	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/gui/AbstractFieldsPanel.java	2014-10-06 19:40:35 UTC (rev 1140)
@@ -1,6 +1,7 @@
 package org.hps.monitoring.gui;
 
 import java.awt.Color;
+import java.awt.Container;
 import java.awt.Dimension;
 import java.awt.GridBagConstraints;
 import java.awt.Insets;
@@ -11,6 +12,7 @@
 import javax.swing.JCheckBox;
 import javax.swing.JComboBox;
 import javax.swing.JFormattedTextField;
+import javax.swing.JFrame;
 import javax.swing.JLabel;
 import javax.swing.JPanel;
 import javax.swing.JTextField;
@@ -248,7 +250,7 @@
         ++currY;
         return button;
     }
-    
+        
     /**
      * Add an ActionListener to this component.  By default this does nothing, but 
      * individual sub-components should attach this to individual components.

java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/gui
Commands.java 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/gui/Commands.java	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/gui/Commands.java	2014-10-06 19:40:35 UTC (rev 1140)
@@ -5,43 +5,43 @@
  * A few commands handled only by sub-components are not listed here.
  */
 final class Commands {
-           
-    static final String DISCONNECT_ON_ERROR_CHANGED = "disconnectOnErrorChanged";
-    static final String DISCONNECT_ON_END_RUN_CHANGED = "disconnectOnEndRunChanged";
-    static final String STEERING_TYPE_CHANGED = "steeringTypeChanged";
-    static final String STEERING_RESOURCE_CHANGED = "steeringResourceChanged";
-    static final String LOG_TO_FILE_CHANGED = "logToFileChanged";
+
+    static final String AIDA_AUTO_SAVE = "aidaAutoSave";
     static final String AIDA_AUTO_SAVE_CHANGED = "aidaAutoSaveChanged";
-    static final String LOG_LEVEL_CHANGED = "logLevelChanged";    
-    
     static final String BLOCKING_CHANGED = "blockingChanged";
-    static final String VERBOSE_CHANGED = "verboseChanged";
-    static final String WAIT_MODE_CHANGED = "waitModeChanged";
-    
-    static final String DATA_SOURCE_TYPE_CHANGED = "dataSourceTypeChanged";
-    static final String PROCESSING_STAGE_CHANGED = "processingStageChanged";
-       
-    static final String AIDA_AUTO_SAVE = "aidaAutoSave";
-    static final String CLEAR_LOG_TABLE = "clearLogTable";
     static final String CHOOSE_LOG_FILE = "chooseLogFile";
+    static final String CHOOSE_FILE_SOURCE = "chooseFileSource";
     static final String CHOOSE_STEERING_FILE = "chooseSteeringFile";
     static final String CONNECT = "connect";
+    static final String CLEAR_LOG_TABLE = "clearLogTable";
+    static final String DATA_SOURCE_TYPE_CHANGED = "dataSourceTypeChanged";
     static final String DISCONNECT = "disconnect";
+    static final String DISCONNECT_ON_ERROR_CHANGED = "disconnectOnErrorChanged";
+    static final String DISCONNECT_ON_END_RUN_CHANGED = "disconnectOnEndRunChanged";
     static final String EXIT = "exit";
-    static final String LOAD_DEFAULT_CONFIG_FILE = "loadDefaultConfigFile";    
+    static final String LOAD_DEFAULT_CONFIG_FILE = "loadDefaultConfigFile";
+    static final String LOG_LEVEL_CHANGED = "logLevelChanged";
     static final String LOG_TO_FILE = "logToFile";
-    static final String LOG_TO_TERMINAL = "logToTerminal";    
+    static final String LOG_TO_FILE_CHANGED = "logToFileChanged";
+    static final String LOG_TO_TERMINAL = "logToTerminal";
     static final String NEXT = "next";
-    static final String PAUSE = "pause";
+    static final String PAUSE = "pause";    
+    static final String PROCESSING_STAGE_CHANGED = "processingStageChanged";
+    static final String RESTORE_DEFAULT_GUI_LAYOUT = "restoreDefaultGuiLayout";
     static final String RESUME = "resume";
+    static final String SAVE_CONFIG_FILE = "saveConfigFile";
+    static final String SAVE_LAYOUT = "saveLayout";
     static final String SAVE_LOG_TABLE = "saveLogTable";
     static final String SAVE_PLOTS = "savePlots";
     static final String SCREENSHOT = "screenshot";
-    static final String SAVE_CONFIG_FILE = "saveConfigFile";
-    static final String SET_EVENT_BUILDER = "setEventBuilder";    
-
-    static final String SET_STEERING_RESOURCE = "setSteeringResource";            
-    static final String SELECT_CONFIG_FILE = "selectConfigFile";
+    static final String SELECT_CONFIG_FILE = "selectConfigFile";    
     static final String SELECT_LOG_FILE = "logToFile";
+    static final String SET_EVENT_BUILDER = "setEventBuilder";
+    static final String SET_STEERING_RESOURCE = "setSteeringResource";
     static final String SHOW_SETTINGS = "showSettings";
+    static final String STEERING_TYPE_CHANGED = "steeringTypeChanged";
+    static final String STEERING_RESOURCE_CHANGED = "steeringResourceChanged";                   
+    static final String VERBOSE_CHANGED = "verboseChanged";
+    static final String VALIDATE_DATA_FILE = "validateDataFile";
+    static final String WAIT_MODE_CHANGED = "waitModeChanged";                         
 }
\ No newline at end of file

java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/gui
DataSourcePanel.java 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/gui/DataSourcePanel.java	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/gui/DataSourcePanel.java	2014-10-06 19:40:35 UTC (rev 1140)
@@ -1,20 +1,25 @@
 package org.hps.monitoring.gui;
 
+import static org.hps.monitoring.gui.Commands.CHOOSE_FILE_SOURCE;
 import static org.hps.monitoring.gui.Commands.DATA_SOURCE_TYPE_CHANGED;
 import static org.hps.monitoring.gui.Commands.PROCESSING_STAGE_CHANGED;
+import static org.hps.monitoring.gui.Commands.VALIDATE_DATA_FILE;
 import static org.hps.monitoring.gui.model.ConfigurationModel.DATA_SOURCE_PATH_PROPERTY;
 import static org.hps.monitoring.gui.model.ConfigurationModel.DATA_SOURCE_TYPE_PROPERTY;
 import static org.hps.monitoring.gui.model.ConfigurationModel.PROCESSING_STAGE_PROPERTY;
 
 import java.awt.GridBagLayout;
 import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
 import java.io.File;
 
+import javax.swing.JButton;
 import javax.swing.JComboBox;
 import javax.swing.JFileChooser;
 import javax.swing.JTextField;
+import javax.swing.filechooser.FileNameExtensionFilter;
 
 import org.hps.monitoring.gui.model.ConfigurationModel;
 import org.hps.record.enums.DataSourceType;
@@ -39,7 +44,9 @@
     };
     
     JComboBox<?> dataSourceTypeComboBox;
-    JTextField dataSourcePathField;    
+    JTextField dataSourcePathField;
+    JButton fileSourceButton;
+    JButton validateDataFileButton;
     JComboBox<?> processingStageComboBox;
     
     ConfigurationModel configurationModel;
@@ -53,25 +60,48 @@
         dataSourceTypeComboBox.addActionListener(this);
         
         dataSourcePathField = addField("Data Source Path", 40);
-        dataSourcePathField.addPropertyChangeListener(this);       
+        dataSourcePathField.addPropertyChangeListener(this);
         
+        fileSourceButton = addButton("Select data file");
+        fileSourceButton.setActionCommand(CHOOSE_FILE_SOURCE);
+        fileSourceButton.addActionListener(this);
+        
+        validateDataFileButton = addButton("Validate data file");
+        validateDataFileButton.setActionCommand(VALIDATE_DATA_FILE);
+                
         processingStageComboBox = addComboBox("Processing Stage", processingStages);
         processingStageComboBox.setSelectedIndex(2);
         processingStageComboBox.setActionCommand(PROCESSING_STAGE_CHANGED);
         processingStageComboBox.addActionListener(this);        
     }
+    
+    private String getFileExtension(String path) {
+        return path.substring(path.lastIndexOf(".") + 1);
+    }
        
-    private void chooseFile() {
+    private void chooseDataFile() {
         JFileChooser fc = new JFileChooser(System.getProperty("user.dir"));
-        fc.setDialogTitle("Select Data Source");        
+        fc.setAcceptAllFileFilterUsed(false);
+        fc.addChoosableFileFilter(new FileNameExtensionFilter("LCIO files", "slcio"));
+        fc.addChoosableFileFilter(new FileNameExtensionFilter("EVIO files", "evio"));        
+        fc.setDialogTitle("Select Data File");
         int r = fc.showDialog(this, "Select ...");
         File file = null;
         if (r == JFileChooser.APPROVE_OPTION) {
             file = fc.getSelectedFile();
             final String filePath = file.getPath();
+            final String extension = getFileExtension(filePath);
             
             // This will cause the GUI to be updated via a PropertyChangeListener.
-            configurationModel.setDataSourcePath(filePath);                      
+            configurationModel.setDataSourcePath(filePath);
+                                    
+            // This will set the combo box in the GUI to the correct state, which will then
+            // update the model.
+            if (extension.equals("slcio")) { 
+                dataSourceTypeComboBox.setSelectedIndex(DataSourceType.LCIO_FILE.ordinal());
+            } else if (extension.equals("evio")) {
+                dataSourceTypeComboBox.setSelectedIndex(DataSourceType.EVIO_FILE.ordinal());
+            } 
         }
     }
         
@@ -95,14 +125,14 @@
     public void actionPerformed(ActionEvent e) {
         if (DATA_SOURCE_TYPE_CHANGED.equals(e.getActionCommand())) {
             DataSourceType dataSourceType = DataSourceType.values()[dataSourceTypeComboBox.getSelectedIndex()];
-            configurationModel.setDataSourceType(dataSourceType);
-            if (dataSourceType.isFile()) { 
-                chooseFile();
-            }
+            configurationModel.setDataSourceType(dataSourceType);            
+            validateDataFileButton.setEnabled(dataSourceType.isFile());
         } else if (PROCESSING_STAGE_CHANGED.equals(e.getActionCommand())) {
             ProcessingStage processingStage = ProcessingStage.values()[processingStageComboBox.getSelectedIndex()];
             configurationModel.setProcessingStage(processingStage);
-        }
+        } else if (CHOOSE_FILE_SOURCE.equals(e.getActionCommand())) { 
+            chooseDataFile();
+        } 
     }
     
     public void propertyChange(PropertyChangeEvent evt) {
@@ -116,18 +146,11 @@
     public class DataSourceChangeListener implements PropertyChangeListener {
         @Override
         public void propertyChange(PropertyChangeEvent evt) {
-            
-            // FIXME: Anyway to make sure this is not needed?
             if (evt.getPropertyName().equals("ancestor"))
-                return;
-            
-            //System.out.println("DataSourceChangeListener.propertyChange");
-            //System.out.println("  source: " + evt.getSource());
-            //System.out.println("  name: " + evt.getPropertyName());
-            //System.out.println("  value: " + evt.getNewValue());
-            Object value = evt.getNewValue();            
+                return;            
+            Object value = evt.getNewValue();
             if (DATA_SOURCE_TYPE_PROPERTY.equals(evt.getPropertyName())) {
-                dataSourceTypeComboBox.setSelectedItem(value.toString());
+                dataSourceTypeComboBox.setSelectedIndex(((DataSourceType)evt.getNewValue()).ordinal());
             } else if (DATA_SOURCE_PATH_PROPERTY.equals(evt.getPropertyName())) {
                 dataSourcePathField.setText((String) value); 
             } else if (PROCESSING_STAGE_PROPERTY.equals(evt.getPropertyName())) {
@@ -136,24 +159,8 @@
         }
     }
     
-    /*
-    void checkFile() throws IOException {
-        DataSourceType dataSourceType = DataSourceType.values()[this.dataSourceTypeComboBox.getSelectedIndex()];
-        if (!dataSourceType.isFile())
-            return;
-        File file = new File(dataSourcePathField.getText());
-        if (!file.exists()) {
-            throw new IOException("File " + file + " does not exist!");
-        }
-        if (dataSourceType.equals(DataSourceType.EVIO_FILE)) {
-            try {
-                new EvioReader(file, false, false);
-            } catch (EvioException e) {
-                throw new IOException("Error with EVIO file.", e);
-            }
-        } else if (dataSourceType.equals(DataSourceType.LCIO_FILE)) {
-            new LCIOReader(file);
-        }
+    public void addActionListener(ActionListener listener) {
+        // Hook the validate button to the main app where that task actually executes.
+        validateDataFileButton.addActionListener(listener);
     }
-    */    
 }
\ No newline at end of file

java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/gui
ErrorHandler.java 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/gui/ErrorHandler.java	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/gui/ErrorHandler.java	2014-10-06 19:40:35 UTC (rev 1140)
@@ -10,12 +10,12 @@
 /**
  * <p>
  * An error handling class which is able to do any of the following,
- * depending on what the caller wants to do with the error.
+ * depending on how the users wants to handle the error.
  * </p>
  * <ul>
  * <li>Print a message</li>
  * <li>Print the stack trace</li>
- * <li>Log to a Logger</li>
+ * <li>Log message to a Logger</li>
  * <li>Show an error dialog</li>
  * <li>Raise an exception</li>
  * <li>Exit the application</li>
@@ -23,8 +23,7 @@
  * </p>
  * It mostly uses the "builder" pattern so that the various handling methods
  * can be easily chained, where appropriate.  Some methods are not available
- * for chaining when it doesn't make sense, e.g. popping up a dialog should
- * happen last so this is not chainable.
+ * for chaining when it doesn't make sense.
  * </p>
  */
 class ErrorHandler {

java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/gui
Main.java 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/gui/Main.java	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/gui/Main.java	2014-10-06 19:40:35 UTC (rev 1140)
@@ -17,6 +17,7 @@
  * This is the front-end for running the monitoring app via a 
  * {@link #main(String[])} method.
  */
+// FIXME: Move to org.hps.monitoring instead of gui package.
 public class Main {
 
     /**

java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/gui
MonitoringApplication.java 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/gui/MonitoringApplication.java	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/gui/MonitoringApplication.java	2014-10-06 19:40:35 UTC (rev 1140)
@@ -11,13 +11,20 @@
 import static org.hps.monitoring.gui.Commands.LOG_TO_TERMINAL;
 import static org.hps.monitoring.gui.Commands.NEXT;
 import static org.hps.monitoring.gui.Commands.PAUSE;
+import static org.hps.monitoring.gui.Commands.RESTORE_DEFAULT_GUI_LAYOUT;
 import static org.hps.monitoring.gui.Commands.RESUME;
 import static org.hps.monitoring.gui.Commands.SAVE_CONFIG_FILE;
+import static org.hps.monitoring.gui.Commands.SAVE_LAYOUT;
 import static org.hps.monitoring.gui.Commands.SAVE_LOG_TABLE;
 import static org.hps.monitoring.gui.Commands.SAVE_PLOTS;
 import static org.hps.monitoring.gui.Commands.SCREENSHOT;
 import static org.hps.monitoring.gui.Commands.SELECT_CONFIG_FILE;
 import static org.hps.monitoring.gui.Commands.SHOW_SETTINGS;
+import static org.hps.monitoring.gui.Commands.VALIDATE_DATA_FILE;
+import static org.hps.monitoring.gui.model.ConfigurationModel.MONITORING_APPLICATION_LAYOUT_PROPERTY;
+import static org.hps.monitoring.gui.model.ConfigurationModel.SAVE_LAYOUT_PROPERTY;
+import hep.aida.jfree.plotter.PlotterRegion;
+import hep.aida.jfree.plotter.PlotterRegionListener;
 
 import java.awt.Dimension;
 import java.awt.GridBagConstraints;
@@ -29,9 +36,10 @@
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.awt.event.KeyEvent;
-import java.awt.event.WindowAdapter;
 import java.awt.event.WindowEvent;
 import java.awt.image.BufferedImage;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
 import java.io.BufferedWriter;
 import java.io.File;
 import java.io.FileNotFoundException;
@@ -50,6 +58,7 @@
 import java.util.logging.Logger;
 
 import javax.imageio.ImageIO;
+import javax.swing.JCheckBoxMenuItem;
 import javax.swing.JDialog;
 import javax.swing.JFileChooser;
 import javax.swing.JFrame;
@@ -83,35 +92,35 @@
 import org.hps.record.composite.EventProcessingThread;
 import org.hps.record.enums.DataSourceType;
 import org.hps.record.et.EtConnection;
-import org.jlab.coda.et.EtAttachment;
-import org.jlab.coda.et.EtConstants;
-import org.jlab.coda.et.EtStation;
-import org.jlab.coda.et.EtStationConfig;
-import org.jlab.coda.et.EtSystem;
-import org.jlab.coda.et.EtSystemOpenConfig;
+import org.jlab.coda.jevio.EvioException;
+import org.jlab.coda.jevio.EvioReader;
 import org.lcsim.job.JobControlManager;
+import org.lcsim.lcio.LCIOReader;
 import org.lcsim.util.Driver;
 import org.lcsim.util.aida.AIDA;
 
 /**
  * This class is the implementation of the GUI for the Monitoring Application.
  */
-public final class MonitoringApplication extends JFrame implements ActionListener, SystemStatusListener {
+// TODO: Move GUI/window functionality to a new class.  (This one is too big!)
+public final class MonitoringApplication extends ApplicationWindow implements ActionListener, SystemStatusListener, PropertyChangeListener {
 
     // Top-level Swing components.
     private JPanel mainPanel;
     private EventButtonsPanel buttonsPanel;
     private ConnectionStatusPanel connectionStatusPanel;
     private RunPanel runPanel;
+    private SettingsDialog settingsDialog;
+    private PlotWindow plotWindow;
+    private PlotInfoWindow plotInfoWindow = new PlotInfoWindow();
+    private SystemStatusWindow systemStatusWindow;
     private JMenuBar menuBar;
-    private SettingsDialog settingsDialog;
-    private PlotFrame plotFrame;
-    private SystemStatusFrame systemStatusFrame;
 
     // References to menu items that will be toggled depending on application state.
     private JMenuItem savePlotsItem;
     private JMenuItem logItem;
     private JMenuItem terminalItem;
+    private JMenuItem saveLayoutItem;
 
     // Saved references to System.out and System.err in case need to reset.
     private final PrintStream sysOut = System.out;
@@ -122,7 +131,6 @@
 
     // ET connection parameters and state.
     private EtConnection connection;
-    //private ConnectionStatus connectionStatus = ConnectionStatus.DISCONNECTED;
 
     // Event processing objects.
     private JobControlManager jobManager;
@@ -139,17 +147,16 @@
     private JTable logTable;
     private static Level DEFAULT_LOG_LEVEL = Level.INFO;
 
-    // Format for screenshots.  
-    // FIXME: This is hard-coded to PNG format.
-    private static final String screenshotFormat = "png";
+    // Graogucs format for screenshots.  
+    private static final String SCREENSHOT_FORMAT = "png";
 
     // Format of date field for log.
     private final SimpleDateFormat dateFormat = new SimpleDateFormat("MMMM-dd-yyyy HH:mm:ss.SSS");
 
-    // GUI size settings.
+    // Some useful GUI size settings.
     private static final int SCREEN_WIDTH = ScreenUtil.getScreenWidth();
     private static final int SCREEN_HEIGHT = ScreenUtil.getScreenHeight();
-    private final static int LOG_TABLE_WIDTH = 700; // FIXME: Should be set from main panel width.
+    private final static int LOG_TABLE_WIDTH = 700; /* FIXME: Should be set from main panel width. */
     private final static int LOG_TABLE_HEIGHT = 270;
     private static final int MAIN_FRAME_HEIGHT = ScreenUtil.getScreenHeight() / 2;
     private static final int MAIN_FRAME_WIDTH = 650;
@@ -165,65 +172,241 @@
     
     // The RunModel for updating the RunPanel.
     private RunModel runModel = new RunModel();
+    
+    private FileValidationThread fileValidationThread;
                    
     /**
      * Constructor for the monitoring application.
      */
     public MonitoringApplication() {
+        
+        super(getApplicationTitle());
+        
+        // Add the application as a property change listener on the configuration model.
+        configurationModel.addPropertyChangeListener(this);
     }
         
     /**
-     * Perform all intialization on start up.
+     * Initialize GUI components and all other necessary objects
+     * to put the application in a usable state.
      */
     public void initialize() {
-        
+                
         // Create and configure the logger.
         setupLogger();
-        
+                
         // Setup the error handling class.
         setupErrorHandler();
         
         // Setup an uncaught exception handler.
         setupUncaughtExceptionHandler();
 
-        // Setup the application menus.
-        createApplicationMenu();
-
         // Create the main GUI panel.
         createMainPanel();
 
         // Create the log table GUI component.
         createLogTable();
-
+        
+        // Create settings dialog window.
+        createSettingsDialog();
+                
+        // Setup the application menus.
+        createMenuBar();
+                        
+        // Create the system status window.
+        createSystemStatusWindow();
+        
         // Configuration of window for showing plots.
-        createPlotFrame();
+        createPlotWindow();
         
-        // Create the system status window.
-        createSystemStatusFrame();
-
         // Setup AIDA.
         setupAida();
-
+       
         // Configure the application's primary JFrame.
         configApplicationFrame();
-
-        // Create settings dialog window.
-        createSettingsDialog();
         
-        // Register the ConfigurationModel with sub-components.
-        setupConfigurationModel();
-                
-        // Load the current configuration, either the default or from command line arg.
+        // Load the current configuration, which will push values into the GUI.
         loadConfiguration();
-
+        
         // Log that the application started successfully.
         log(Level.CONFIG, "Application initialized successfully.");
     }
-         
+    
+    /**
+     * The action handler method for the application.
+     * @param e The event to handle.
+     */
+    public void actionPerformed(ActionEvent e) {
+        
+        //System.out.println("MonitoringApplication. actionPerformed: " + e.getActionCommand());
+        
+        String cmd = e.getActionCommand();
+        if (CONNECT.equals(cmd)) {
+            // Run the start session method on a seperate thread.
+            new Thread() {
+                public void run() {
+                    startSession();
+                }                
+            }.start();
+        } else if (DISCONNECT.equals(cmd)) {
+            // Run the stop session method on a seperate thread.
+            new Thread() {
+                public void run() {
+                    stopSession();
+                }
+            }.start();            
+        } else if (SAVE_PLOTS.equals(cmd)) {
+            savePlots();
+        } else if (CHOOSE_LOG_FILE.equals(cmd)) {
+            chooseLogFile();
+        } else if (LOG_TO_TERMINAL.equals(cmd)) {
+            logToTerminal();
+        } else if (SCREENSHOT.equals(cmd)) {
+            chooseScreenshot();
+        } else if (EXIT.equals(cmd)) {
+            exit();
+        } else if (SAVE_LOG_TABLE.equals(cmd)) {
+            saveLogTableToFile();
+        } else if (CLEAR_LOG_TABLE.equals(cmd)) {
+            clearLogTable();
+        } else if (PAUSE.equals(cmd)) {
+            pauseEventProcessing();
+        } else if (NEXT.equals(cmd)) {
+            nextEvent();
+        } else if (RESUME.equals(cmd)) {
+            resumeEventProcessing();
+        } else if (LOG_LEVEL_CHANGED.equals(cmd)) {
+            setLogLevel();
+        } else if (AIDA_AUTO_SAVE.equals(cmd)) {
+            getJobSettingsPanel().chooseAidaAutoSaveFile();
+        } else if (SHOW_SETTINGS.equals(cmd)) {
+            showSettingsDialog();
+        } else if (SELECT_CONFIG_FILE.equals(cmd)) {
+            chooseConfigurationFile();
+        } else if (SAVE_CONFIG_FILE.equals(cmd)) {
+            updateLayoutConfiguration(); /* Save current GUI layout settings first, if needed. */
+            saveConfigurationFile();
+        } else if (LOAD_DEFAULT_CONFIG_FILE.equals(cmd)) {
+            loadDefaultConfigFile();
+        } else if (SAVE_LAYOUT.equals(cmd)) {
+            setSaveLayout();
+        } else if (RESTORE_DEFAULT_GUI_LAYOUT.equals(cmd)) {
+            restoreDefaultLayout();
+        } else if (VALIDATE_DATA_FILE.equals(cmd)) {
+            if (fileValidationThread == null) {
+                new FileValidationThread().start();
+            }
+        }
+    }
+           
+    /**
+     * Set the GUI to visible.
+     */
+    public void setVisible(boolean visible) {
+        
+        super.setVisible(true);
+        
+        this.systemStatusWindow.setVisible(true);
+        
+        // FIXME: If this is done earlier before app is visible, then the GUI will fail to show!
+        this.connectionStatusPanel.setConnectionStatus(ConnectionStatus.DISCONNECTED);
+    }
+    
+    /**
+     * Set the Configuration but don't update the ConfigurationModel.
+     * @param configuration
+     */
+    public void setConfiguration(Configuration configuration) {
+        this.configuration = configuration;
+    }    
+    
+    /**
+     * Handle a property change event.
+     * @evt The property change event.
+     */
+    @Override
+    public void propertyChange(PropertyChangeEvent evt) {
+                       
+        if (evt.getPropertyName().equals("ancestor"))
+            return;                                          
+        Object value = evt.getNewValue();
+        if (evt.getPropertyName().equals(SAVE_LAYOUT_PROPERTY)) {
+            saveLayoutItem.setSelected((Boolean) value);
+        } else if (evt.getPropertyName().equals(MONITORING_APPLICATION_LAYOUT_PROPERTY)){
+            updateWindowConfiguration(new WindowConfiguration((String) value));
+        } else if (evt.getPropertyName().equals(ConfigurationModel.SYSTEM_STATUS_FRAME_LAYOUT_PROPERTY)) {
+            if (systemStatusWindow != null) {
+                systemStatusWindow.updateWindowConfiguration(new WindowConfiguration((String) value));
+            } else {
+                System.err.println("ERROR: The systemStatusFrame is null!");
+            }
+        } else if (evt.getPropertyName().equals(ConfigurationModel.PLOT_FRAME_LAYOUT_PROPERTY)) {
+            if (plotWindow != null) {
+                plotWindow.updateWindowConfiguration(new WindowConfiguration((String) value));
+            } else {
+                System.err.println("ERROR: The plotWindow is null!");
+            }
+        } else if (evt.getPropertyName().equals(ConfigurationModel.LOG_TO_FILE_PROPERTY)) {
+            
+            //System.out.println("propertyChange - " + evt.getPropertyName());
+            //System.out.println("  value: " + value);
+            
+            if ((Boolean)value == true) {
+                //System.out.println("setting logToFile - " + configurationModel.getLogFileName());
+                logToFile(new File(configurationModel.getLogFileName()));
+            } else {
+                //System.out.println("setting logToTerminal");
+                logToTerminal();
+            }
+        }
+    }
+    
+    /**
+     * Hook for logging all status changes from the system status monitor.
+     */
+    @Override
+    public void statusChanged(SystemStatus status) {
+        
+        // Choose the appropriate log level.
+        Level level = Level.INFO;
+        if (status.getStatusCode().equals(Level.WARNING)) {
+            level = Level.WARNING;
+        } else if (status.getStatusCode().ordinal() >= StatusCode.ERROR.ordinal()) {
+            level = Level.SEVERE;
+        }
+       
+        // Log all status changes.
+        log(level, "STATUS, "
+                + "subsys: " + status.getSubsystem() + ", "
+                + "code: " + status.getStatusCode().name() + ", "                 
+                + "descr: " + status.getDescription() + ", "                 
+                + "mesg: " + status.getMessage());
+    }
+    
+    public void setEnabled(boolean enabled) {
+        super.setEnabled(enabled);
+        plotWindow.setEnabled(enabled);
+        systemStatusWindow.setEnabled(enabled);
+        //settingsDialog.setEnabled(false);
+        
+        //this.setFocusable(enabled);
+        //plotWindow.setFocusable(enabled);
+        //systemStatusWindow.setFocusable(enabled);
+        //settingsDialog.setFocusable(false);
+    }
+    
+    /* -------------------------- private methods ----------------------------- */
+               
+    /**
+     * Setup the error handler.
+     */
     private void setupErrorHandler() {
         errorHandler = new ErrorHandler(this, logger);
     }
     
+    /**
+     * Setup the uncaught exception handler which will trap unhandled errors.
+     */
     private void setupUncaughtExceptionHandler() {
         Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {            
             public void uncaughtException(Thread thread, Throwable exception) {
@@ -234,45 +417,69 @@
             }
         });
     }
-            
+     
+    /**
+     * Create the settings dialog GUI component.
+     */
     private void createSettingsDialog() {
+        
+        // Create and configure the settings dialog which has sub-panels for application configuration.
         settingsDialog = new SettingsDialog();
         settingsDialog.getSettingsPanel().addActionListener(this);
         getJobSettingsPanel().addActionListener(this);
+        settingsDialog.getSettingsPanel().getDataSourcePanel().addActionListener(this);
+        
+        // Push the ConfigurationModel to the job settings dialog.
+        getJobSettingsPanel().setConfigurationModel(configurationModel);
+        getConnectionSettingsPanel().setConfigurationModel(configurationModel);
+        settingsDialog.getSettingsPanel().getDataSourcePanel().setConfigurationModel(configurationModel);               
     }
 
-    private void createPlotFrame() {
-        plotFrame = new PlotFrame();                
-        plotFrame.setSize(SCREEN_WIDTH - MAIN_FRAME_WIDTH, SCREEN_HEIGHT);
-        plotFrame.setLocation(
-                (int)(ScreenUtil.getBoundsX(0)) + MAIN_FRAME_WIDTH,
-                plotFrame.getY());
+    /**
+     * Create the plot window.
+     */
+    private void createPlotWindow() {
+        
+        // Create the JFrame.
+        plotWindow = new PlotWindow();
+        
+        // Set initial size and position which might be overridden later.
+        plotWindow.setDefaultWindowConfiguration(
+                new WindowConfiguration(
+                        SCREEN_WIDTH - MAIN_FRAME_WIDTH,
+                        SCREEN_HEIGHT,
+                        (int)(ScreenUtil.getBoundsX(0)) + MAIN_FRAME_WIDTH,
+                        plotWindow.getY()
+                ));               
     }
     
-    private void createSystemStatusFrame() {
-        systemStatusFrame = new SystemStatusFrame();
-        systemStatusFrame.setLocation(
+    private void createSystemStatusWindow() {
+        systemStatusWindow = new SystemStatusWindow();
+        WindowConfiguration wc = new WindowConfiguration(
+                650, /* FIXME: Hard-coded width setting. */
+                ScreenUtil.getScreenHeight() / 2,
                 (int)ScreenUtil.getBoundsX(0),
                 MAIN_FRAME_HEIGHT);
+        systemStatusWindow.setMinimumSize(new Dimension(wc.width, wc.height));
+        systemStatusWindow.setDefaultWindowConfiguration(wc);
     }
     
-    public void setVisible(boolean visible) {
-        
-        super.setVisible(true);
-        
-        this.systemStatusFrame.setVisible(true);
-        
-        // FIXME: If this is done earlier before app is visible, the GUI will fail to show!
-        this.connectionStatusPanel.setConnectionStatus(ConnectionStatus.DISCONNECTED);
-    }
-
     /**
      * Configure the AIDA plotting backend.
      */
     private void setupAida() {
         MonitoringAnalysisFactory.register();
         MonitoringAnalysisFactory.configure();
-        MonitoringPlotFactory.setRootPane(this.plotFrame.getPlotPane());
+        MonitoringPlotFactory.setRootPane(this.plotWindow.getPlotPane());
+        MonitoringPlotFactory.setPlotterRegionListener(new PlotterRegionListener() {
+            @Override
+            public void regionSelected(PlotterRegion region) {                
+                if (region == null)
+                    throw new RuntimeException("The region arg is null!!!");
+                //System.out.println("MonitoringApplication - regionSelected - " + region.title());
+                plotInfoWindow.setCurrentRegion(region);
+            }
+        });
     }
 
     /**
@@ -320,7 +527,7 @@
     /**
      * Create the application menu bar and menu items.
      */
-    private void createApplicationMenu() {
+    private void createMenuBar() {
 
         menuBar = new JMenuBar();
 
@@ -332,28 +539,46 @@
         loadConfigItem.addActionListener(this);
         loadConfigItem.setMnemonic(KeyEvent.VK_C);
         loadConfigItem.setActionCommand(SELECT_CONFIG_FILE);
-        loadConfigItem.setToolTipText("Load application settings from a properties file.");
+        loadConfigItem.setToolTipText("Load application settings from a properties file");
         applicationMenu.add(loadConfigItem);
         
         JMenuItem saveConfigItem = new JMenuItem("Save Settings ...");
         saveConfigItem.addActionListener(this);
         saveConfigItem.setMnemonic(KeyEvent.VK_S);
         saveConfigItem.setActionCommand(SAVE_CONFIG_FILE);        
-        saveConfigItem.setToolTipText("Save settings to a properties file.");
+        saveConfigItem.setToolTipText("Save settings to a properties file");
         applicationMenu.add(saveConfigItem);
         
         JMenuItem settingsItem = new JMenuItem("Show Settings ...");
         settingsItem.setMnemonic(KeyEvent.VK_P);
         settingsItem.setActionCommand(SHOW_SETTINGS);
         settingsItem.addActionListener(this);
-        settingsItem.setToolTipText("Show application settings menu.");
+        settingsItem.setToolTipText("Show application settings menu");
         applicationMenu.add(settingsItem);
+       
+        applicationMenu.addSeparator();
+        
+        saveLayoutItem = new JCheckBoxMenuItem("Save GUI Layout");
+        saveLayoutItem.setActionCommand(SAVE_LAYOUT);
+        saveLayoutItem.addActionListener(this);
+        saveLayoutItem.setToolTipText("Include current GUI layout when saving settings.");
+        saveLayoutItem.setSelected(configurationModel.getSaveLayout()); /* Initial setting from config. */
+        saveLayoutItem.addPropertyChangeListener(this); /* Any subsequent changes to model will activate this. */
+        applicationMenu.add(saveLayoutItem);
+        
+        JMenuItem restoreLayoutItem = new JMenuItem("Restore Default GUI Layout");
+        restoreLayoutItem.setActionCommand(RESTORE_DEFAULT_GUI_LAYOUT);
+        restoreLayoutItem.addActionListener(this);
+        restoreLayoutItem.setToolTipText("Restore the GUI windows to their default positions and sizes");
+        applicationMenu.add(restoreLayoutItem);
+        
+        applicationMenu.addSeparator();
                 
         JMenuItem exitItem = new JMenuItem("Exit");
         exitItem.setMnemonic(KeyEvent.VK_X);
         exitItem.setActionCommand(EXIT);
         exitItem.addActionListener(this);
-        exitItem.setToolTipText("Exit from the application.");
+        exitItem.setToolTipText("Exit from the application");
         applicationMenu.add(exitItem);
         
         JMenu plotsMenu = new JMenu("Plots");
@@ -417,7 +642,7 @@
         screenshotItem.setMnemonic(KeyEvent.VK_N);
         screenshotItem.setActionCommand(SCREENSHOT);
         screenshotItem.addActionListener(this);
-        screenshotItem.setToolTipText("Save a full screenshot to a " + screenshotFormat + " file.");
+        screenshotItem.setToolTipText("Save a full screenshot to a " + SCREENSHOT_FORMAT + " file.");
         utilMenu.add(screenshotItem);
     }
    
@@ -484,64 +709,9 @@
     }
    
     /**
-     * The action handler method for the entire application.
-     * @param e The event to handle.
-     */
-    public void actionPerformed(ActionEvent e) {
-        String cmd = e.getActionCommand();
-        if (CONNECT.equals(cmd)) {
-            // Run the start session method on a seperate thread.
-            new Thread() {
-                public void run() {
-                    startSession();
-                }                
-            }.start();
-        } else if (DISCONNECT.equals(cmd)) {
-            // Run the stop session method on a seperate thread.
-            new Thread() {
-                public void run() {
-                    stopSession();
-                }
-            }.start();            
-        } else if (SAVE_PLOTS.equals(cmd)) {
-            savePlots();
-        } else if (CHOOSE_LOG_FILE.equals(cmd)) {
-            chooseLogFile();
-        } else if (LOG_TO_TERMINAL.equals(cmd)) {
-            logToTerminal();
-        } else if (SCREENSHOT.equals(cmd)) {
-            chooseScreenshot();
-        } else if (EXIT.equals(cmd)) {
-            exit();
-        } else if (SAVE_LOG_TABLE.equals(cmd)) {
-            saveLogTableToFile();
-        } else if (CLEAR_LOG_TABLE.equals(cmd)) {
-            clearLogTable();
-        } else if (PAUSE.equals(cmd)) {
-            pauseEventProcessing();
-        } else if (NEXT.equals(cmd)) {
-            nextEvent();
-        } else if (RESUME.equals(cmd)) {
-            resumeEventProcessing();
-        } else if (LOG_LEVEL_CHANGED.equals(cmd)) {
-            setLogLevel();
-        } else if (AIDA_AUTO_SAVE.equals(cmd)) {
-            getJobSettingsPanel().chooseAidaAutoSaveFile();
-        } else if (SHOW_SETTINGS.equals(cmd)) {
-            showSettingsWindow();
-        } else if (SELECT_CONFIG_FILE.equals(cmd)) {
-            chooseConfigurationFile();
-        } else if (SAVE_CONFIG_FILE.equals(cmd)) {
-            saveConfigurationFile();
-        } else if (LOAD_DEFAULT_CONFIG_FILE.equals(cmd)) {
-            loadDefaultConfigFile();
-        } 
-    }
-
-    /**
      * Show the settings window.
      */
-    private void showSettingsWindow() {
+    private void showSettingsDialog() {
         settingsDialog.setVisible(true);
     }
        
@@ -562,7 +732,6 @@
      * @param status The connection status.
      */
     private void setConnectionStatus(ConnectionStatus status) {
-        //connectionStatus = status;
         connectionStatusPanel.setConnectionStatus(status);
         log(Level.FINE, "Connection status changed to <" + status.name() + ">");
         logHandler.flush();
@@ -572,18 +741,27 @@
      * Setup the primary <code>JFrame</code> for the application.
      */
     private void configApplicationFrame() {
-        mainPanel.setOpaque(true);
-        setTitle(getApplicationTitle());
+        
+        mainPanel.setOpaque(true);        
+
+        // Configure window size and position.
+        WindowConfiguration wc = new WindowConfiguration(
+                MAIN_FRAME_WIDTH, 
+                MAIN_FRAME_HEIGHT, 
+                (int)ScreenUtil.getBoundsX(0), 
+                getY());
+        setMinimumSize(new Dimension(wc.width, wc.height));
+        setPreferredSize(new Dimension(wc.width, wc.height));
+        setDefaultWindowConfiguration(wc);
+        
+        setResizable(true);
         setContentPane(mainPanel);
         setJMenuBar(menuBar);
         setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
-        setPreferredSize(new Dimension(MAIN_FRAME_WIDTH, MAIN_FRAME_HEIGHT));
-        setMinimumSize(new Dimension(MAIN_FRAME_WIDTH, MAIN_FRAME_HEIGHT));        
-        setResizable(true);        
-        setLocation((int)ScreenUtil.getBoundsX(0), getY());
-        pack();              
+                                
+        pack();                                     
     }
-        
+               
     /**
      * Save all the plots to a file using a <code>JFileChooser</code>.
      */
@@ -663,7 +841,7 @@
             public void run() {
                 configurationModel.setLogToFile(false);
                 
-                // FIXME: These should be toggled via a PropertyChangeListener or ActionEvent.
+                // FIXME: These should be toggled via a PropertyChangeListener on the ConfigurationModel.
                 terminalItem.setEnabled(false);
                 logItem.setEnabled(true);
             }
@@ -749,10 +927,6 @@
         if (connection != null) {
             cleanupEtConnection();
         }
-        if (plotFrame.isVisible())
-            plotFrame.setVisible(false);
-        if (systemStatusFrame.isVisible())
-            systemStatusFrame.setVisible(false);
         setVisible(false);
         System.exit(0);
     }
@@ -768,8 +942,8 @@
         if (r == JFileChooser.APPROVE_OPTION) {
             String fileName = fc.getSelectedFile().getPath();
             int extIndex = fileName.lastIndexOf(".");
-            if ((extIndex == -1) || !(fileName.substring(extIndex + 1, fileName.length())).toLowerCase().equals(screenshotFormat)) {
-                fileName = fileName + "." + screenshotFormat;
+            if ((extIndex == -1) || !(fileName.substring(extIndex + 1, fileName.length())).toLowerCase().equals(SCREENSHOT_FORMAT)) {
+                fileName = fileName + "." + SCREENSHOT_FORMAT;
             }
             takeScreenshot(fileName);
             log(Level.INFO, "Screenshot saved to file <" + fileName + ">");
@@ -786,7 +960,7 @@
         try {
             Robot robot = new Robot();
             BufferedImage image = robot.createScreenCapture(screenRectangle);
-            ImageIO.write(image, screenshotFormat, new File(fileName));
+            ImageIO.write(image, SCREENSHOT_FORMAT, new File(fileName));
         } catch (Exception e) {
             errorHandler.setError(e)
                 .setMessage("Failed to take screenshot.")
@@ -806,7 +980,7 @@
         log(Level.FINE, "Starting a new monitoring session.");
         
         // Show a modal window that will block the GUI until connected or an error occurs.
-        JDialog dialog = showStatusDialog("Info", "Starting new session ...", true);
+        JDialog dialog = DialogUtil.showStatusDialog(this, "Info", "Starting new session ...");
         
         try {
                         
@@ -905,7 +1079,7 @@
      */
     private void disconnect(ConnectionStatus status) {
 
-        log(Level.FINE, "Disconnecting from the ET server.");
+        log(Level.FINE, "Disconnecting the current session.");
 
         // Cleanup the ET connection.
         cleanupEtConnection();
@@ -916,11 +1090,11 @@
         // Finally, change application state to fully disconnected.
         setConnectionStatus(ConnectionStatus.DISCONNECTED);
 
-        // Set the application status from the caller if an error had occurred.
+        // Set the application status from the caller if an error occurred.
         if (status == ConnectionStatus.ERROR)
             setConnectionStatus(status);
 
-        log(Level.INFO, "Disconnected from the ET server.");
+        log(Level.INFO, "Disconnected from the session.");
     }
 
     /**
@@ -929,7 +1103,9 @@
     private void cleanupEtConnection() {
         if (connection != null) {     
             if (connection.getEtSystem().alive()) {
+                log(Level.FINEST, "Cleaning up the ET connection.");
                 connection.cleanup();
+                log(Level.FINEST, "Done cleaning up the ET connection.");
             }
             connection = null;
         }
@@ -1172,6 +1348,8 @@
             loopConfig.add(driver);
         }        
 
+        
+        // DEBUG: Turn these off while doing other stuff!!!!        
         // Using ET server?
         if (usingEtServer()) {
 
@@ -1210,7 +1388,7 @@
      */
     private void setupSystemStatusMonitor() {
         // Clear the system status monitor table.        
-        systemStatusFrame.getTableModel().clear();
+        systemStatusWindow.getTableModel().clear();
         
         // Get the global registry of SystemStatus objects.
         SystemStatusRegistry registry = SystemStatusRegistry.getSystemStatusRegistery();
@@ -1218,7 +1396,7 @@
         // Process the SystemStatus objects.
         for (SystemStatus systemStatus : registry.getSystemStatuses()) {
             // Add a row to the table for every SystemStatus.
-            systemStatusFrame.getTableModel().addSystemStatus(systemStatus);
+            systemStatusWindow.getTableModel().addSystemStatus(systemStatus);
             
             // Add this class as a listener so all status changes can be logged.
             systemStatus.addListener(this);
@@ -1234,12 +1412,14 @@
         resetAidaTree();
 
         // Plot frame visible?
-        if (!plotFrame.isVisible())
+        if (!plotWindow.isVisible()) {
             // Turn on plot frame if it is off.
-            plotFrame.setVisible(true);
+            plotWindow.setVisible(true);
+            //plotInfoWindow.setVisible(true);
+        }
             
         // Reset plots.
-        plotFrame.reset(); 
+        plotWindow.reset(); 
     }
 
     /**
@@ -1267,25 +1447,22 @@
      */
     private void stopSession() {
         // Show a modal message window while this method executes.
-        JDialog dialog = showStatusDialog("Info", "Disconnecting from session ...", true);
+        JDialog dialog = DialogUtil.showStatusDialog(this, "Info", "Disconnecting from session ...");
         
         try {
             // Log message.
             logger.log(Level.FINER, "Stopping the session.");
+            
+            // Kill the watchdog thread which looks for disconnects, if it is active.
+            killSessionWatchdogThread();
                         
-            // Save AIDA file.
+            // Automatically write AIDA file from job settings.
             saveAidaFile();
         
-            // Disconnect from the ET system.
-            if (usingEtServer()) {
-                // Disconnect from the ET system.
-                disconnect();
-            } else { 
-                // When using direct file streaming, just need to toggle GUI state.
-                setDisconnectedGuiState();
-            }
+            // Disconnect from ET system, if using the ET server, and set the proper disconnected GUI state.           
+            disconnect();
             
-            // Terminate event processing.
+            // Stop the event processing, which is called after the ET system goes down to avoid hanging in calls to ET system.
             stopEventProcessing();
                 
             logger.log(Level.INFO, "Session was stopped.");
@@ -1295,107 +1472,53 @@
             dialog.dispatchEvent(new WindowEvent(dialog, WindowEvent.WINDOW_CLOSING));
         }
     }
-                         
+                                       
     /**
-     * Show a dialog which is modal-like but will not block the current thread
-     * from executing after <code>isVisible(true)</code> is called.  It does not 
-     * have any buttons so must be closed using an action event.
-     * @param title The title of the dialog box.
-     * @param message The message to display.
-     * @param visible Whether it should be immediately visible.
-     * @return The JDialog that was created.
+     * Stop the event processing by executing a <code>STOP</code> command on the 
+     * record loop and killing the event processing thread.  This is executed
+     * after the ET system is disconnected so that the event processing does
+     * not potentially hang in a call to <code>EtSystem.getEvents()</code> forever.
      */
-    private JDialog showStatusDialog(String title, String message, boolean visible) {
-        final JOptionPane optionPane = new JOptionPane(
-                message, 
-                JOptionPane.INFORMATION_MESSAGE,
-                JOptionPane.DEFAULT_OPTION, 
-                null, 
-                new Object[]{}, 
-                null);
-        final JDialog dialog = new JDialog();
-        dialog.setContentPane(optionPane);        
-        dialog.setTitle(title);
-        dialog.setAlwaysOnTop(true);
-        dialog.setLocationRelativeTo(null);
-        dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
-        dialog.pack();        
-        dialog.addWindowListener(new WindowAdapter() {
-            public void windowClosing(WindowEvent e) {
-                dialog.setVisible(false);
-                dialog.dispose();
-                MonitoringApplication.this.setEnabled(true);
-                plotFrame.setEnabled(true);
-            }
-        });
-        MonitoringApplication.this.setEnabled(false);
-        plotFrame.setEnabled(false);
-        dialog.setVisible(visible);
-        return dialog;
-    }    
-            
-    /**
-     * Finish event processing and stop its thread, first killing the session watchdog 
-     * thread, if necessary.  The event processing thread may still be alive after 
-     * this method, e.g. if there is a call to <code>EtSystem.getEvents()</code> happening.
-     * In this case, event processing will exit later when the ET system goes down.
-     */
     private void stopEventProcessing() {
-        //System.out.println("MonitoringApplication.stopEventProcessing");
-                       
+
+        // Is the event processing thread not null?
         if (processingThread != null) {
-            //System.out.println("processingThread not null");
+            
             // Is the event processing thread actually still alive?
             if (processingThread.isAlive()) {
                 
-                //System.out.println("processing thread is alive...");
-                //System.out.println("killing session watchdog");
-
-                // Interrupt and kill the event processing watchdog thread if necessary.
-                killSessionWatchdogThread();
-                
-                //System.out.println("stopping event processing chain...");
-
-                // Request the event processing to stop.          
+                // Request the event processing loop to execute stop.
                 loop.execute(Command.STOP);
                 
-                //System.out.println("requested stop of event processing");
+                try {
+                    // This should always work, because the ET system is disconnected before this.
+                    processingThread.join();
+                } catch (InterruptedException e) {
+                    // Don't know when this would ever happen.
+                    e.printStackTrace();                   
+                }
             }
 
-            // Wait for the event processing thread to finish.  This should just return
-            // immediately if it isn't alive so don't bother checking if alive is false.
-            try {
-                // In the case where ET is configured for sleep or timed wait, an untimed join could 
-                // block forever, so only wait for ~1 second before continuing.  The EventProcessingChain
-                // should still cleanup automatically when its thread completes after the ET system goes down.
-                //System.out.println("joining event processing thread...");
-                processingThread.join(1000);
-                //System.out.println("joined event processing thread!");
-            } catch (InterruptedException e) {
-                // Don't know when this would ever happen.
-                //System.out.println("join was interrupted!");
-            }
-       
-            // Handle last error that occurred in event processing.
+            // Notify of last error that occurred in event processing.
             if (loop.getLastError() != null) {
-                //System.out.println("last error: " + processingChain.getLastError().getMessage());
                 errorHandler.setError(loop.getLastError()).log().printStackTrace();
             }
-       
-            // Reset event processing objects.
-            //System.out.println("setting objects to null...");
-            loop.dispose();
-            loop = null;
+
+            // Set the event processing thread to null as it is unusable now.
             processingThread = null;
-            //System.out.println("stopEventProcessing - done!");
         }
+
+        // Set the loop to null as a new one will be created for next session.
+        loop = null;
     }
 
     /**
      * Kill the current session watchdog thread.
      */
     private void killSessionWatchdogThread() {
+        // Is the session watchdog thread not null?
         if (sessionWatchdogThread != null) {
+            // Is the thread still alive?
             if (sessionWatchdogThread.isAlive()) {
                 // Interrupt the thread which should cause it to stop.
                 sessionWatchdogThread.interrupt();
@@ -1403,8 +1526,11 @@
                     // This should always work once the thread is interupted.
                     sessionWatchdogThread.join();
                 } catch (InterruptedException e) {
+                    // This should never happen.
+                    e.printStackTrace();
                 }
             }
+            // Set the thread object to null.
             sessionWatchdogThread = null;
         }
     }
@@ -1428,7 +1554,8 @@
 
             } catch (InterruptedException e) {
                 // This probably just means that the disconnect button was pushed, and this thread should
-                // no longer wait on event processing to finish.
+                // no longer monitor the event processing.
+                e.printStackTrace();
             }
         }
     }
@@ -1446,9 +1573,9 @@
             if (file.exists()) {
                 throw new RuntimeException("Log file already exists.");
             } else {                    
-                configurationModel.setLogToFile(true);
                 try {
                     configurationModel.setLogFileName(file.getCanonicalPath());
+                    configurationModel.setLogToFile(true);
                 } catch (IOException e) {
                     errorHandler.setError(e).log().printStackTrace().showErrorDialog();
                 }
@@ -1485,28 +1612,44 @@
         int r = fc.showSaveDialog(mainPanel);
         if (r == JFileChooser.APPROVE_OPTION) {
             File f = fc.getSelectedFile();
-            log(Level.CONFIG, "Saving configuration to file <" + f.getPath() + ">");
-            configuration.writeToFile(f);            
+            log(Level.CONFIG, "Saving configuration to file <" + f.getPath() + ">");            
+            configuration.writeToFile(f);
         }
     }
-       
-    /**
-     * Setup the <code>ConfigurationModel</code> by registering it with sub-components.
-     */
-    private void setupConfigurationModel() {        
-        getJobSettingsPanel().setConfigurationModel(configurationModel);
-        getConnectionSettingsPanel().setConfigurationModel(configurationModel);
-        settingsDialog.getSettingsPanel().getDataSourcePanel().setConfigurationModel(configurationModel);
+    
+    private void updateLayoutConfiguration() {
+        // Should the GUI config be saved?
+        if (configurationModel.getSaveLayout()) {
[truncated at 1000 lines; 146 more skipped]

java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/gui
PlotFrame.java removed after 1139
--- java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/gui/PlotFrame.java	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/gui/PlotFrame.java	2014-10-06 19:40:35 UTC (rev 1140)
@@ -1,29 +0,0 @@
-package org.hps.monitoring.gui;
-
-import javax.swing.JFrame;
-import javax.swing.JTabbedPane;
-
-/**
- * A <code>JFrame</code> where monitoring plots will show in tabs.
- */
-class PlotFrame extends JFrame {
-    
-    private JTabbedPane plotPane;
-    
-    PlotFrame() {
-        plotPane = new JTabbedPane();
-        setContentPane(plotPane);
-        setTitle("Monitoring Plots");
-        setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
-        setResizable(true);
-        pack();           
-    }
-    
-    void reset() {
-        plotPane.removeAll();
-    }       
-    
-    JTabbedPane getPlotPane() {
-        return plotPane;
-    }
-}
\ No newline at end of file

java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/gui
RunPanel.java 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/gui/RunPanel.java	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/gui/RunPanel.java	2014-10-06 19:40:35 UTC (rev 1140)
@@ -38,7 +38,7 @@
 // TODO: Add event sequence number from CompositeRecord.
 // TODO: Add average data rate field (over entire session).
 // TODO: Add average proc time per event field (over entire session).
-public class RunPanel extends JPanel implements PropertyChangeListener {
+class RunPanel extends JPanel implements PropertyChangeListener {
 
     FieldPanel runNumberField = new FieldPanel("Run Number", "", 10, false);
     DatePanel startDateField = new DatePanel("Run Start", "", 16, false); 

java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/gui
SystemStatusFrame.java removed after 1139
--- java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/gui/SystemStatusFrame.java	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/gui/SystemStatusFrame.java	2014-10-06 19:40:35 UTC (rev 1140)
@@ -1,170 +0,0 @@
-package org.hps.monitoring.gui;
-
-import static org.hps.monitoring.gui.model.SystemStatusTableModel.ACTIVE_COL;
-import static org.hps.monitoring.gui.model.SystemStatusTableModel.CLEARABLE_COL;
-import static org.hps.monitoring.gui.model.SystemStatusTableModel.LAST_CHANGED_COL;
-import static org.hps.monitoring.gui.model.SystemStatusTableModel.RESET_COL;
-import static org.hps.monitoring.gui.model.SystemStatusTableModel.STATUS_COL;
-import static org.hps.monitoring.gui.model.SystemStatusTableModel.SYSTEM_COL;
-
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Dimension;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import javax.swing.JButton;
-import javax.swing.JFrame;
-import javax.swing.JLabel;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.table.DefaultTableCellRenderer;
-import javax.swing.table.TableCellRenderer;
-
-import org.hps.monitoring.gui.model.SystemStatusTableModel;
-import org.hps.monitoring.subsys.StatusCode;
-
-/**
- * A GUI window for showing changes to {@link org.hps.monitoring.subsys.SystemStatus} objects
- * using a <code>JTable</code>.
- */
-// TODO: It might be a good idea if there was a second table which logged all status changes as separate
-//       rows so they could be seen in order.
-class SystemStatusFrame extends JFrame {
-
-    JTable table;
-
-    int WIDTH = 650;
-    int HEIGHT = ScreenUtil.getScreenHeight() / 2;
-        
-    SystemStatusFrame() {
-        table = new JTable(new SystemStatusTableModel());
-        
-        // Rendering of system status cells using different background colors.
-        table.getColumnModel().getColumn(SystemStatusTableModel.STATUS_COL).setCellRenderer(new DefaultTableCellRenderer() {
-
-            @Override
-            public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int col) {
-
-                // Cells are by default rendered as a JLabel.
-                JLabel label = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, col);
-
-                // Color code the cell by its status.
-                StatusCode statusCode = StatusCode.valueOf((String) value);
-                if (statusCode.ordinal() >= StatusCode.ERROR.ordinal()) {
-                    // Any type of error is red.
-                    label.setBackground(Color.RED);
-                } else if (statusCode.equals(StatusCode.WARNING)) {
-                    // Warnings are yellow.
-                    label.setBackground(Color.YELLOW);
-                } else if (statusCode.equals(StatusCode.OKAY)) {
-                    // Okay is green.
-                    label.setBackground(Color.GREEN);
-                } else if (statusCode.equals(StatusCode.OFFLINE)) {
-                    // Offline is orange.
-                    label.setBackground(Color.ORANGE);
-                } else if (statusCode.equals(StatusCode.UNKNOWN)) {
-                    // Unknown is gray.
-                    label.setBackground(Color.GRAY);
-                } else if (statusCode.equals(StatusCode.CLEARED)) {
-                    // Cleared is light gray.
-                    label.setBackground(Color.LIGHT_GRAY);
-                } else {
-                    // Default is white, though this shouldn't happen!
-                    label.setBackground(Color.WHITE);
-                }
-                return label;
-            }
-        });
-        
-        // Date formatting for last changed.
-        table.getColumnModel().getColumn(LAST_CHANGED_COL).setCellRenderer(new DefaultTableCellRenderer() {
-
-            final SimpleDateFormat dateFormat = new SimpleDateFormat("MMMM-dd-yyyy HH:mm:ss.SSS");
-
-            @Override
-            public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
-                if (value instanceof Date) {
-                    value = dateFormat.format(value);
-                }
-                return super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
-            }
-        });
-        
-        // Button for clearing system statuses.
-        table.getColumnModel().getColumn(RESET_COL).setCellRenderer(new ButtonRenderer("Clear"));
-        table.addMouseListener(new JTableButtonMouseListener(table));
-        table.getColumn("Clearable").setWidth(0);
-        table.getColumn("Clearable").setMinWidth(0);
-        table.getColumn("Clearable").setMaxWidth(0);
-        
-        // Column widths.
-        table.getColumnModel().getColumn(ACTIVE_COL).setPreferredWidth(8);
-        table.getColumnModel().getColumn(STATUS_COL).setPreferredWidth(10);
-        table.getColumnModel().getColumn(SYSTEM_COL).setPreferredWidth(10);
-        // TODO: Add widths for every column.
-        
-        table.setAutoCreateRowSorter(true);
-                
-        // Scroll pane.
-        JScrollPane scrollPane = new JScrollPane(table);
-        scrollPane.setOpaque(true);
-
-        // Additional config.
-        setMinimumSize(new Dimension(WIDTH, HEIGHT));
-        setTitle("System Status Monitor");
-        setContentPane(scrollPane);
-        setResizable(true);
-        setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
-        pack();
-    }
-
-    public SystemStatusTableModel getTableModel() {
-        return (SystemStatusTableModel) table.getModel();
-    }
-    
-    /**
-     * Renders a button if the status is clearable.
-     */
-    private class ButtonRenderer extends JButton implements TableCellRenderer {
-                
-        public ButtonRenderer(String label) {
-            this.setText(label);
-        }
-
-        public Component getTableCellRendererComponent(
-                JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {            
-            boolean clearable = (Boolean)table.getModel().getValueAt(row, CLEARABLE_COL);
-            if (clearable)
-                return this;
-            else 
-                return null;
-        }
-    }
-    
-    /**
-     * Fires a mouse click event when the clear button is pressed, which in turn
-     * will activate the action event for the button.  The <code>ActionListener</code> 
-     * then sets the <code>StatusCode</code> to <code>CLEARED</code>.
-     */
-    private static class JTableButtonMouseListener extends MouseAdapter {
-        private final JTable table;
-        
-        public JTableButtonMouseListener(JTable table) {
-            this.table = table;
-        }
-
-        public void mouseClicked(MouseEvent e) {
-            int column = table.getColumnModel().getColumnIndexAtX(e.getX());
-            int row = e.getY() / table.getRowHeight(); 
-            if (row < table.getRowCount() && row >= 0 && column < table.getColumnCount() && column >= 0) {
-                Object value = table.getValueAt(row, column);
-                if (value instanceof JButton) {
-                    ((JButton)value).doClick();
-                }
-            }
-        }
-    }          
-}
\ No newline at end of file

java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/gui/model
AbstractModel.java 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/gui/model/AbstractModel.java	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/gui/model/AbstractModel.java	2014-10-06 19:40:35 UTC (rev 1140)
@@ -34,6 +34,10 @@
     protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
         if (listenersEnabled)
             propertyChangeSupport.firePropertyChange(propertyName, oldValue, newValue);
+        //System.out.println("firePropertyChange");
+        //System.out.println("  name: " + propertyName);
+        //System.out.println("  old value: " + oldValue);
+        //System.out.println("  new value: " + newValue);
     }
     
     protected void firePropertyChange(PropertyChangeEvent evt) {
@@ -56,7 +60,14 @@
                 }
             }
             try {
-                Object value = getMethod.invoke(this, (Object[])null);
+                Object value = null;
+                try {
+                    value = getMethod.invoke(this, (Object[])null);
+                } catch (NullPointerException e) {
+                    throw new RuntimeException("No get method exists for property: " + property, e);
+                }
+                // Is the value non-null?  
+                // (Null values are actually okay.  It just means the property is not set.)
                 if (value != null) {
                     firePropertyChange(property, value, value);                    
                     for (PropertyChangeListener listener : propertyChangeSupport.getPropertyChangeListeners()) {

java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/gui/model
Configuration.java 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/gui/model/Configuration.java	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/gui/model/Configuration.java	2014-10-06 19:40:35 UTC (rev 1140)
@@ -12,7 +12,7 @@
  * The accessor methods to get these values are not public, because the {@link ConfigurationModel}
  * should be used instead.
  */
-public class Configuration {
+public final class Configuration {
     
     Properties properties;
     File file;
@@ -138,6 +138,14 @@
     }
     
     /**
+     * Remove a configuration value.
+     * @param key The key of the value.
+     */
+    void remove(String key) {
+        properties.remove(key);
+    }
+    
+    /**
      * Convert this object to a string by printing out its properties list.
      */
     public String toString() {

java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/gui/model
ConfigurationModel.java 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/gui/model/ConfigurationModel.java	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/gui/model/ConfigurationModel.java	2014-10-06 19:40:35 UTC (rev 1140)
@@ -1,6 +1,7 @@
 package org.hps.monitoring.gui.model;
 
 import java.io.File;
+import java.util.List;
 import java.util.logging.Level;
 
 import org.hps.monitoring.enums.SteeringType;
@@ -30,6 +31,10 @@
     public static final String LOG_FILE_NAME_PROPERTY = "LogFileName";
     public static final String LOG_LEVEL_PROPERTY = "LogLevel";
     public static final String LOG_TO_FILE_PROPERTY = "LogToFile";    
+    public static final String MONITORING_APPLICATION_LAYOUT_PROPERTY = "MonitoringApplicationLayout";
+    public static final String PLOT_FRAME_LAYOUT_PROPERTY = "PlotFrameLayout";
+    public static final String SAVE_LAYOUT_PROPERTY = "SaveLayout";
+    public static final String SYSTEM_STATUS_FRAME_LAYOUT_PROPERTY = "SystemStatusFrameLayout";
     public static final String STEERING_TYPE_PROPERTY = "SteeringType";
     public static final String STEERING_FILE_PROPERTY = "SteeringFile";
     public static final String STEERING_RESOURCE_PROPERTY = "SteeringResource";
@@ -64,7 +69,7 @@
             EVENT_BUILDER_PROPERTY,
             LOG_FILE_NAME_PROPERTY,
             LOG_LEVEL_PROPERTY,
-            LOG_TO_FILE_PROPERTY,
+            LOG_TO_FILE_PROPERTY,            
             STEERING_FILE_PROPERTY,
             STEERING_RESOURCE_PROPERTY,
             STEERING_TYPE_PROPERTY,
@@ -86,7 +91,13 @@
             STATION_POSITION_PROPERTY,
             WAIT_MODE_PROPERTY,
             WAIT_TIME_PROPERTY,
-            PRESCALE_PROPERTY            
+            PRESCALE_PROPERTY,
+            
+            // GUI layout
+            SAVE_LAYOUT_PROPERTY,
+            MONITORING_APPLICATION_LAYOUT_PROPERTY,
+            PLOT_FRAME_LAYOUT_PROPERTY,
+            SYSTEM_STATUS_FRAME_LAYOUT_PROPERTY
     };        
     
     String detectorName;
@@ -103,6 +114,10 @@
         this.config = config;
         fireAllChanged();
     }
+    
+    public Configuration getConfiguration() {
+        return this.config;
+    }
            
     public Level getLogLevel() {
         return Level.parse(config.get(LOG_LEVEL_PROPERTY));        
@@ -378,9 +393,57 @@
         config.set(PRESCALE_PROPERTY, prescale);
         firePropertyChange(PRESCALE_PROPERTY, oldValue, getPrescale());
     }
-                
+    
+    public boolean getSaveLayout() {
+        return config.getBoolean(SAVE_LAYOUT_PROPERTY);
+    }
+    
+    public void setSaveLayout(boolean saveLayout) {
+        boolean oldValue = getSaveLayout();
+        config.set(SAVE_LAYOUT_PROPERTY, saveLayout);
+        firePropertyChange(SAVE_LAYOUT_PROPERTY, oldValue, getSaveLayout());
+    }
+       
+    public String getMonitoringApplicationLayout() {
+        return config.get(MONITORING_APPLICATION_LAYOUT_PROPERTY);
+    }
+    
+    public void setMonitoringApplicationLayout(String layout) {
+        String oldValue = getMonitoringApplicationLayout();
+        config.set(MONITORING_APPLICATION_LAYOUT_PROPERTY, layout);
+        firePropertyChange(MONITORING_APPLICATION_LAYOUT_PROPERTY, oldValue, getMonitoringApplicationLayout());
+    }
+    
+    public String getSystemStatusFrameLayout() {
+        return config.get(SYSTEM_STATUS_FRAME_LAYOUT_PROPERTY);
+    }
+    
+    public void setSystemStatusFrameLayout(String layout) {
+        String oldValue = getSystemStatusFrameLayout();
+        config.set(SYSTEM_STATUS_FRAME_LAYOUT_PROPERTY, layout);
+        firePropertyChange(SYSTEM_STATUS_FRAME_LAYOUT_PROPERTY, oldValue, getSystemStatusFrameLayout());
+    }
+    
+    public String getPlotFrameLayout() {
+        return config.get(PLOT_FRAME_LAYOUT_PROPERTY);
+    }
+    
+    public void setPlotFrameLayout(String layout) {
+        String oldValue = getPlotFrameLayout();
+        config.set(PLOT_FRAME_LAYOUT_PROPERTY, layout);
+        firePropertyChange(PLOT_FRAME_LAYOUT_PROPERTY, oldValue, getPlotFrameLayout());        
+    }
+    
+    public void remove(String property) {
+        Object oldValue = config.get(property);
+        if (oldValue != null) {
+            config.remove(property);
+            firePropertyChange(property, oldValue, null);
+        }
+    }
+                                          
     @Override
     public String[] getPropertyNames() {
         return CONFIG_PROPERTIES;
-    }
+    }    
 }
\ No newline at end of file

java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/gui/model
RunModel.java 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/gui/model/RunModel.java	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/gui/model/RunModel.java	2014-10-06 19:40:35 UTC (rev 1140)
@@ -5,7 +5,7 @@
 /**
  * Backing model for run information that shows in the {@link org.hps.monitoring.gui.RunPanel}.
  */
-public class RunModel extends AbstractModel {
+public final class RunModel extends AbstractModel {
     
     public final static String RUN_NUMBER_PROPERTY = "RunNumber"; 
     public final static String START_DATE_PROPERTY = "StartDate";

java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/plotting
MonitoringPlotFactory.java 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/plotting/MonitoringPlotFactory.java	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/plotting/MonitoringPlotFactory.java	2014-10-06 19:40:35 UTC (rev 1140)
@@ -2,6 +2,7 @@
 
 import hep.aida.IPlotter;
 import hep.aida.jfree.plotter.PlotterFactory;
+import hep.aida.jfree.plotter.PlotterRegionListener;
 import hep.aida.ref.plotter.PlotterUtilities;
 
 import java.awt.BorderLayout;
@@ -31,18 +32,22 @@
 
     // Root pane where this factory's top-level tab will be inserted.
     private static JTabbedPane rootPane = null;
+    
+    private static PlotterRegionListener regionListener;
+    
+    public static void setPlotterRegionListener(PlotterRegionListener regionListener) {
+        MonitoringPlotFactory.regionListener = regionListener;
+    }
 
     /**
      * Class constructor.
      */
     MonitoringPlotFactory() {
-        super();
-        
-        // Enable embedded mode.
+        super();        
         setEmbedded(true);
-
-        // Setup the root pane by adding an (unlabeled!) tab for this factory.
         setupRootPane("  ");
+        if (regionListener != null)
+            addPlotterRegionListener(regionListener);
     }
 
     /**
@@ -52,10 +57,10 @@
     MonitoringPlotFactory(String name) {
         super();
         this.name = name;
-        
         setEmbedded(true);
-        
         setupRootPane(name);
+        if (regionListener != null)
+            addPlotterRegionListener(regionListener);
     }
 
     private void setupRootPane(String name) {

java/branches/hps-java_HPSJAVA-88/monitoring-app/src/test/java/org/hps/monitoring/subsys/et
EtSystemMonitorTest.java removed after 1139
--- java/branches/hps-java_HPSJAVA-88/monitoring-app/src/test/java/org/hps/monitoring/subsys/et/EtSystemMonitorTest.java	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/monitoring-app/src/test/java/org/hps/monitoring/subsys/et/EtSystemMonitorTest.java	2014-10-06 19:40:35 UTC (rev 1140)
@@ -1,68 +0,0 @@
-package org.hps.monitoring.subsys.et;
-
-import junit.framework.TestCase;
-
-/**
- * Test that the {@link EtSystemMonitor} works.
- * @author Jeremy McCormick <[log in to unmask]>
- */
-public class EtSystemMonitorTest extends TestCase {
-
-    /*
-    public void testEtEventMonitoring() {
-        
-        EtEventLoop loop = new EtEventLoop();
-        EtSystemMonitor monitor = new EtSystemPrinter();
-        monitor.getSystemInfo().getStatus().addListener(new DummyListener());
-        loop.addEtEventProcessor(monitor);
-        EtEventQueue queue = new EtEventQueue();
-        queue.setTimeOutMillis(1000);
-        loop.setRecordSource(queue);
-               
-        for (int i=0; i<100000; i++) {                  
-            byte[] data = new byte[256];
-            EtEventImpl event = new EtEventImpl(256);
-            event.setData(data);            
-            queue.addRecord(event);
-        }
-        
-        try {
-            loop.loop(-1);
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-        
-        System.out.println("loop supplied " + loop.getTotalSupplied() + " records");
-        System.out.println("loop consumed " + loop.getCountableConsumed() + " records");
-    }    
-    
-    static class DummyListener implements SystemStatusListener {
-
-        public void statusChanged(SystemStatus status) {
-            System.out.println(this.getClass().getSimpleName() + " saw status changed to " + status.getStatusCode().toString() + " at " + status.getLastChangedMillis() + " millis");
-        }        
-    }
-    
-    static class EtSystemPrinter extends EtSystemMonitor{
-
-        int eventsProcessed = 0;
-        
-        public void start() {
-            super.start();
-            info.getStatistics().printSession(System.out);
-        }
-        
-        public void processEvent(EtEvent event) {
-            super.processEvent(event);
-            ++eventsProcessed;
-            if (eventsProcessed % 1000 == 0)
-                info.getStatistics().printTick(System.out);
-        }    
-        
-        public void stop() {
-            super.stop();
-            info.getStatistics().printSession(System.out);
-        }
-    }
-    */
-}

java/branches/hps-java_HPSJAVA-88/parent
pom.xml 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/parent/pom.xml	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/parent/pom.xml	2014-10-06 19:40:35 UTC (rev 1140)
@@ -70,6 +70,11 @@
             <artifactId>junit</artifactId>
             <version>4.11</version>
         </dependency>
+        <dependency>
+            <groupId>org.lcsim</groupId>
+            <artifactId>lcsim-distribution</artifactId>
+            <version>${lcsimVersion}</version>
+        </dependency>
     </dependencies>
     <!-- DO NOT EDIT THESE DEPENDENCY VERSIONS MANUALLY. -->
     <dependencyManagement>

java/branches/hps-java_HPSJAVA-88/plugin
pom.xml 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/plugin/pom.xml	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/plugin/pom.xml	2014-10-06 19:40:35 UTC (rev 1140)
@@ -59,7 +59,7 @@
                         <include>org.hps:hps-record-util</include>
                         <include>org.hps:hps-tracking</include>
                         <include>org.hps:hps-users</include>
-                        <include>org.hps:hps-util</include>                                                                                                                                              
+                        <include>org.hps:hps-util</include>
                         <include>mysql:mysql-connector-java</include>
                         <include>org.jlab.coda:jevio</include>
                         <include>org.jlab.coda:et</include>                        

java/branches/hps-java_HPSJAVA-88/plugin/src/main/java/org/hps/plugin
HPSPlugin.java 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/plugin/src/main/java/org/hps/plugin/HPSPlugin.java	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/plugin/src/main/java/org/hps/plugin/HPSPlugin.java	2014-10-06 19:40:35 UTC (rev 1140)
@@ -3,7 +3,7 @@
 import org.freehep.application.studio.Plugin;
 
 /**
- *
+ * This is just a dummy plugin class to make JAS3 happy.
  * @author Jeremy McCormick
  * @version $Id: HPSPlugin.java,v 1.1 2013/06/03 16:23:47 jeremy Exp $
  */

java/branches/hps-java_HPSJAVA-88/recon
pom.xml 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/recon/pom.xml	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/recon/pom.xml	2014-10-06 19:40:35 UTC (rev 1140)
@@ -1,24 +1,20 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-    
     <modelVersion>4.0.0</modelVersion>
     <artifactId>hps-recon</artifactId>
     <name>recon</name>
     <description>HPS recon code</description>
-    
     <parent>
         <groupId>org.hps</groupId>
         <artifactId>hps-parent</artifactId>
         <relativePath>../parent/pom.xml</relativePath>
         <version>3.0.3-SNAPSHOT</version>
     </parent>
-    
     <scm>
         <url>http://java.freehep.org/svn/repos/hps/list/java/trunk/recon/</url>
         <connection>scm:svn:svn://svn.freehep.org/hps/java/trunk/recon/</connection>
         <developerConnection>scm:svn:svn://svn.freehep.org/hps/java/trunk/recon/</developerConnection>
     </scm>
-    
     <dependencies>
         <!-- This will pull in the ECAL recon module transitively. -->
         <dependency>
@@ -26,19 +22,4 @@
             <artifactId>hps-tracking</artifactId>
         </dependency>
     </dependencies>
-    
-        <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-surefire-plugin</artifactId>
-                <configuration>
-                    <excludes>
-                        <exclude>org/hps/recon/mdc/MockDataReconTest.java</exclude>
-                    </excludes>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>    
-    
 </project>

java/branches/hps-java_HPSJAVA-88/record-util/src/main/java/org/hps/record
AbstractRecordQueue.java 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/record-util/src/main/java/org/hps/record/AbstractRecordQueue.java	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/record-util/src/main/java/org/hps/record/AbstractRecordQueue.java	2014-10-06 19:40:35 UTC (rev 1140)
@@ -14,7 +14,6 @@
  * {@link #next()} method to get the next record, which might not be immediately
  * available.
  */
-// TODO: Add max elements argument to limit pile up of unconsumed events.
 public abstract class AbstractRecordQueue<RecordType> extends AbstractRecordSource {
 
     // The queue, which is a linked list with blocking behavior. 
@@ -26,6 +25,7 @@
     // The amount of time to wait for an LCIO event from the queue before dying.
     long timeOutMillis = -1;
     
+    
     /**
      * Constructor that takes the timeout time in seconds.
      * @param timeoutSeconds the timeout time in seconds

java/branches/hps-java_HPSJAVA-88/record-util/src/main/java/org/hps/record/composite
CompositeLoop.java 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/record-util/src/main/java/org/hps/record/composite/CompositeLoop.java	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/record-util/src/main/java/org/hps/record/composite/CompositeLoop.java	2014-10-06 19:40:35 UTC (rev 1140)
@@ -33,16 +33,12 @@
     
     boolean paused = false;
     boolean stopOnErrors = true;
-    boolean done = false;
     
     CompositeLoopConfiguration config = null;
-            
-    // Look in javadoc API and DefaultRecordLoop for what this does.
-    //this._stopOnEOF
-                
+                            
     /**
      * No argument constructor.  
-     * The {@link #configure(CompositeLoopConfiguration)} method must be
+     * The {@link #setCompositeLoopConfiguration(CompositeLoopConfiguration)} method must be
      * called on the loop manually.
      */
     public CompositeLoop() {
@@ -55,7 +51,7 @@
      */
     public CompositeLoop(CompositeLoopConfiguration config) {
         setRecordSource(recordSource);
-        configure(config);
+        setCompositeLoopConfiguration(config);
     }
     
     /**
@@ -108,7 +104,6 @@
         
         // Stop the event processing.
         this.execute(Command.STOP);
-        done = true;
     }
 
     /**
@@ -129,7 +124,6 @@
         
         // Stop the event processing.
         this.execute(Command.STOP);
-        done = true;
     }        
     
     /**
@@ -175,17 +169,8 @@
             return false;
         }
     }
-        
+            
     /**
-     * True if the loop is done processing.  This is 
-     * set to <code>true</code> when fatal errors occur.
-     * @return
-     */
-    public boolean isDone() {
-        return done;
-    }
-    
-    /**
      * Get the last error that occurred.
      * @return The last error that occurred.
      */
@@ -230,12 +215,20 @@
         }
         return getSupplied();
     }
-        
+    
+    public void setConfiguration(Object object) {
+        if (object instanceof CompositeLoopConfiguration) {
+            setCompositeLoopConfiguration((CompositeLoopConfiguration)object);
+        } else {
+            throw new IllegalArgumentException("Wrong type of object to configure CompositeLoop: " + object.getClass().getCanonicalName());
+        }
+    }
+    
     /**
      * Configure the loop using a {@link CompositeLoopConfiguration} object.
      * @param config The CompositeLoopConfiguration object containing the loop configuration parameter values.
      */
-    public final void configure(CompositeLoopConfiguration config) {
+    void setCompositeLoopConfiguration(CompositeLoopConfiguration config) {
         
         if (this.config != null)
             throw new RuntimeException("CompositeLoop has already been configured.");

java/branches/hps-java_HPSJAVA-88/record-util/src/main/java/org/hps/record/composite
CompositeLoopAdapter.java 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/record-util/src/main/java/org/hps/record/composite/CompositeLoopAdapter.java	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/record-util/src/main/java/org/hps/record/composite/CompositeLoopAdapter.java	2014-10-06 19:40:35 UTC (rev 1140)
@@ -32,6 +32,7 @@
      * @param loopEvent 
      */
     public void finish(LoopEvent loopEvent) {
+        System.out.println(this.getClass().getCanonicalName() + ".finish");
         // Call end job hook on all processors.
         for (CompositeRecordProcessor processor : processors) {
             processor.endJob();

java/branches/hps-java_HPSJAVA-88/record-util/src/main/java/org/hps/record/composite
CompositeLoopConfiguration.java 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/record-util/src/main/java/org/hps/record/composite/CompositeLoopConfiguration.java	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/record-util/src/main/java/org/hps/record/composite/CompositeLoopConfiguration.java	2014-10-06 19:40:35 UTC (rev 1140)
@@ -24,6 +24,7 @@
  * may end up being ignored (e.g. setting a file path
  * when actually using an ET server, etc.).
  */
+// TODO: Add lcsim steering setting that uses JobControlManager to create Driver list.
 public class CompositeLoopConfiguration {
         
     boolean stopOnErrors = true;

java/branches/hps-java_HPSJAVA-88/record-util/src/main/java/org/hps/record/composite
EventProcessingThread.java 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/record-util/src/main/java/org/hps/record/composite/EventProcessingThread.java	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/record-util/src/main/java/org/hps/record/composite/EventProcessingThread.java	2014-10-06 19:40:35 UTC (rev 1140)
@@ -1,5 +1,7 @@
 package org.hps.record.composite;
 
+import org.freehep.record.loop.RecordLoop;
+
 /**
  * Class for running the {@link CompositeLoop} on a separate thread.
  */
@@ -22,33 +24,29 @@
     @Override
     public void run() {                
                 
-        // Keep looping until the event processing is flagged as done.
-        while (true) {
-            // Is the processing unpaused?            
-            // TODO: See if can check for IDLE state. (???)
-            if (!loop.isPaused()) {
+        // Flag that is turned on when looping starts.
+        boolean started = false;
+        
+        // Keep looping until the event processing is done.
+        while (true) {                        
+            
+            // If the loop was started and now is in the IDLE state, it means
+            // that STOP was executed, so break from the processing while loop.
+            if (started && loop.getState().equals(RecordLoop.State.IDLE)) {                
+                // Stop record processing.
+                break;
+            }
+                        
+            // Is the processing unpaused?
+            if (!loop.isPaused()) {                                                
                 
+                // Set a flag to indicate that looping has started.
+                started = true;
+                
                 // Loop until done, error occurs, or pause is requested.
                 // FIXME: The maximum number of records should be used here.
                 loop.loop(-1);
-                
-                // If paused, current record will still be completed!
-                
-                // Is loop done?
-                // TODO: See if can check for IDLE state instead.
-                if (loop.isDone()) {
-                    // Stop record processing.
-                    break;
-                }
-            }
-            
-            // Sleep for a little while between loop iterations (e.g. while paused).
-            try {
-                Thread.sleep(100);
-            } catch (InterruptedException e) {
-                e.printStackTrace();
-            }
+            }            
         }
-        
     }
 }
\ No newline at end of file

java/branches/hps-java_HPSJAVA-88/steering-files
pom.xml 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/steering-files/pom.xml	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/steering-files/pom.xml	2014-10-06 19:40:35 UTC (rev 1140)
@@ -1,22 +1,18 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-    
     <modelVersion>4.0.0</modelVersion>
     <artifactId>hps-steering-files</artifactId>
     <name>steering-files</name>
     <description>XML steering files</description>
-    
     <parent>
         <groupId>org.hps</groupId>
         <artifactId>hps-parent</artifactId>
         <relativePath>../parent/pom.xml</relativePath>
         <version>3.0.3-SNAPSHOT</version>
     </parent>
-    
     <scm>
         <url>http://java.freehep.org/svn/repos/hps/list/java/trunk/steering-files/</url>
         <connection>scm:svn:svn://svn.freehep.org/hps/java/trunk/steering-files/</connection>
         <developerConnection>scm:svn:svn://svn.freehep.org/hps/java/trunk/steering-files/</developerConnection>
     </scm>
-    
 </project>

java/branches/hps-java_HPSJAVA-88/steering-files/src/main/resources/org/hps/steering/monitoring
DummyMonitoring.lcsim removed after 1139
--- java/branches/hps-java_HPSJAVA-88/steering-files/src/main/resources/org/hps/steering/monitoring/DummyMonitoring.lcsim	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/steering-files/src/main/resources/org/hps/steering/monitoring/DummyMonitoring.lcsim	2014-10-06 19:40:35 UTC (rev 1140)
@@ -1,12 +0,0 @@
-<lcsim xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" 
-       xs:noNamespaceSchemaLocation="http://www.lcsim.org/schemas/lcsim/1.0/lcsim.xsd">       
-    <execute>
-        <driver name="EventMarkerDriver"/>
-    </execute>    
-    <drivers>
-        <driver name="EventMarkerDriver"
-                type="org.lcsim.job.EventMarkerDriver">
-            <eventInterval>1</eventInterval>
-        </driver>
-    </drivers>
-</lcsim>
\ No newline at end of file

java/branches/hps-java_HPSJAVA-88/steering-files/src/main/resources/org/hps/steering/monitoring
MonitoringTest.lcsim removed after 1139
--- java/branches/hps-java_HPSJAVA-88/steering-files/src/main/resources/org/hps/steering/monitoring/MonitoringTest.lcsim	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/steering-files/src/main/resources/org/hps/steering/monitoring/MonitoringTest.lcsim	2014-10-06 19:40:35 UTC (rev 1140)
@@ -1,9 +0,0 @@
-<lcsim xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" 
-       xs:noNamespaceSchemaLocation="http://www.lcsim.org/schemas/lcsim/1.0/lcsim.xsd">       
-    <execute>
-        <driver name="EcalMonitoringTestDriver"/>
-    </execute>   
-    <drivers>
-        <driver name="EcalMonitoringTestDriver" type="org.hps.monitoring.drivers.ecal.EcalMonitoringTestDriver" />
-    </drivers>
-</lcsim>

java/branches/hps-java_HPSJAVA-88/steering-files/src/main/resources/org/hps/steering/production
DataQualityRecon.lcsim 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/steering-files/src/main/resources/org/hps/steering/production/DataQualityRecon.lcsim	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/steering-files/src/main/resources/org/hps/steering/production/DataQualityRecon.lcsim	2014-10-06 19:40:35 UTC (rev 1140)
@@ -12,8 +12,9 @@
         <driver name="SVTMonitoring"/>  
         <driver name="SVTHitMCEfficiency"/>  
         <driver name="TrackingMonitoring"/>  
+        <driver name="TrackingResiduals"/>
         <driver name="TrackMCEfficiency"/> 
-        <driver name="FinalStateMonitoring"/>  
+        <driver name="FinalStateMonitoring"/>          
         <driver name="V0Monitoring"/>          
         <driver name="AidaSaveDriver"/>
         <driver name="CleanupDriver"/>
@@ -36,6 +37,9 @@
         <driver name="TrackingMonitoring" type="org.hps.analysis.dataquality.TrackingMonitoring">
             <overwriteDB>false</overwriteDB>
         </driver>
+        <driver name="TrackingResiduals" type="org.hps.analysis.dataquality.TrackingResiduals">
+            <overwriteDB>false</overwriteDB>
+        </driver>
         <driver name="FinalStateMonitoring" type="org.hps.analysis.dataquality.FinalStateMonitoring">
             <overwriteDB>false</overwriteDB>
         </driver>

java/branches/hps-java_HPSJAVA-88/steering-files/src/main/resources/org/hps/steering/readout
HPS2014ReadoutToLcio.lcsim 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/steering-files/src/main/resources/org/hps/steering/readout/HPS2014ReadoutToLcio.lcsim	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/steering-files/src/main/resources/org/hps/steering/readout/HPS2014ReadoutToLcio.lcsim	2014-10-06 19:40:35 UTC (rev 1140)
@@ -26,7 +26,7 @@
 
     <drivers>
         <driver name="EventMarkerDriver" type="org.lcsim.job.EventMarkerDriver">
-            <eventInterval>1000</eventInterval>
+            <eventInterval>1</eventInterval>
         </driver> 
         <driver name="CalibrationDriver" type="org.hps.conditions.deprecated.CalibrationDriver">
 <!--            <runNumber>1351</runNumber>    -->

java/branches/hps-java_HPSJAVA-88/steering-files/src/main/resources/org/hps/steering/recon
GBLReco.lcsim 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/steering-files/src/main/resources/org/hps/steering/recon/GBLReco.lcsim	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/steering-files/src/main/resources/org/hps/steering/recon/GBLReco.lcsim	2014-10-06 19:40:35 UTC (rev 1140)
@@ -23,7 +23,7 @@
     </execute>    
 
     <drivers>
-        <driver name="GBLDriver"
+		<driver name="GBLDriver"
                 type="org.hps.recon.tracking.gbl.GBLOutputDriver">
                 <debug>0</debug>
                 <isMC>${isMC}</isMC>

java/branches/hps-java_HPSJAVA-88/steering-files/src/main/resources/org/hps/steering/recon
HPS2014OfflineRecon.lcsim 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/steering-files/src/main/resources/org/hps/steering/recon/HPS2014OfflineRecon.lcsim	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/steering-files/src/main/resources/org/hps/steering/recon/HPS2014OfflineRecon.lcsim	2014-10-06 19:40:35 UTC (rev 1140)
@@ -30,16 +30,19 @@
         </driver>        
         <driver name="RawTrackerHitSensorSetup" type="org.lcsim.recon.tracking.digitization.sisim.config.RawTrackerHitSensorSetup"/>
         <driver name="RawTrackerHitFitterDriver" type="org.hps.recon.tracking.RawTrackerHitFitterDriver">
-            <fitAlgorithm>Analytic</fitAlgorithm>
+            <fitAlgorithm>Pileup</fitAlgorithm>
             <useTimestamps>true</useTimestamps>
             <correctT0Shift>false</correctT0Shift>
             <useTruthTime>false</useTruthTime>
             <subtractTOF>true</subtractTOF>
+            <debug>false</debug>
         </driver>
-        <driver name="TrackerHitDriver" type="org.hps.recon.tracking.DataTrackerHitDriver" />     
+        <driver name="TrackerHitDriver" type="org.hps.recon.tracking.DataTrackerHitDriver">
+            <neighborDeltaT>8.0</neighborDeltaT>
+        </driver>
         <driver name="HelicalTrackHitDriver" type="org.hps.recon.tracking.HelicalTrackHitDriver">
             <debug>false</debug>
-            <clusterTimeCut>16.0</clusterTimeCut>
+            <clusterTimeCut>12.0</clusterTimeCut>
             <maxSeperation>20.0</maxSeperation>
             <tolerance>1.0</tolerance>
         </driver>

java/branches/hps-java_HPSJAVA-88/steering-files/src/main/resources/org/hps/steering/recon
HPS2014OfflineTruthRecon.lcsim 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/steering-files/src/main/resources/org/hps/steering/recon/HPS2014OfflineTruthRecon.lcsim	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/steering-files/src/main/resources/org/hps/steering/recon/HPS2014OfflineTruthRecon.lcsim	2014-10-06 19:40:35 UTC (rev 1140)
@@ -29,16 +29,19 @@
         </driver>        
         <driver name="RawTrackerHitSensorSetup" type="org.lcsim.recon.tracking.digitization.sisim.config.RawTrackerHitSensorSetup"/>
         <driver name="RawTrackerHitFitterDriver" type="org.hps.recon.tracking.RawTrackerHitFitterDriver">
-            <fitAlgorithm>Analytic</fitAlgorithm>
+            <fitAlgorithm>Pileup</fitAlgorithm>
             <useTimestamps>false</useTimestamps>
             <correctT0Shift>false</correctT0Shift>
             <useTruthTime>true</useTruthTime>
             <subtractTOF>true</subtractTOF>
+            <debug>false</debug>
         </driver>
-        <driver name="TrackerHitDriver" type="org.hps.recon.tracking.DataTrackerHitDriver" />     
+        <driver name="TrackerHitDriver" type="org.hps.recon.tracking.DataTrackerHitDriver">
+            <neighborDeltaT>8.0</neighborDeltaT>
+        </driver>
         <driver name="HelicalTrackHitDriver" type="org.hps.recon.tracking.HelicalTrackHitDriver">
             <debug>false</debug>
-            <clusterTimeCut>16.0</clusterTimeCut>
+            <clusterTimeCut>12.0</clusterTimeCut>
             <maxSeperation>20.0</maxSeperation>
             <tolerance>1.0</tolerance>
         </driver>

java/branches/hps-java_HPSJAVA-88/steering-files/src/main/resources/org/hps/steering/users/phansson
HPSTrackingDefaults.lcsim 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/steering-files/src/main/resources/org/hps/steering/users/phansson/HPSTrackingDefaults.lcsim	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/steering-files/src/main/resources/org/hps/steering/users/phansson/HPSTrackingDefaults.lcsim	2014-10-06 19:40:35 UTC (rev 1140)
@@ -13,38 +13,48 @@
 
     <execute>
         <driver name="EventMarkerDriver"/>
-        <driver name="CalibrationDriver"/>
-        <driver name="TrackerDigiDriver"/>
+         <driver name="CalibrationDriver"/>   
+        <driver name="BadChannelFilter" />
+        <driver name="SimpleSVTReadout"/>
+        <driver name="RawTrackerHitFitterDriver"/>
+        <driver name="TrackerHitDriver"/>
+    <!--
+        <driver name="HPSSVTSensorSetup"/>   
+        <driver name="TrackerDigiDriver"/> 
+    -->
         <driver name="HelicalTrackHitDriver"/>
         <driver name="TrackerReconDriver"/>
-        <!-- <driver name="LCIOWriter"/> -->
-        <driver name="GBLDriver"/> 
+        <driver name="SVTEventInfo"/>
+        <driver name="SVTHitReconstructionPlots"/>
+        <driver name="TrackingReconstructionPlots"/>
+        <driver name="LCIOWriter"/>
 
 
-
     </execute>    
  
     <drivers>
-        <driver name="GBLDriver"
-                type="org.hps.recon.tracking.gbl.GBLOutputDriver">
-                <debug>0</debug>
-                <outputPlotFileName></outputPlotFileName>
-                <gblFileName>gblinput.txt</gblFileName>
-	</driver>
-        <driver name="CalibrationDriver" type="org.hps.conditions.deprecated.CalibrationDriver">
-<!--            <runNumber>1351</runNumber>    -->
-        </driver>
-
-        <driver name="EventMarkerDriver"
+       	<driver name="EventMarkerDriver"
                 type="org.lcsim.job.EventMarkerDriver">
             <eventInterval>100</eventInterval>
         </driver>
-    
-        <driver name="TrackerDigiDriver" type="org.hps.recon.tracking.SimpleTrackerDigiDriver">
-<!--            <dropBadChannels>true</dropBadChannels>-->
-            <debug>false</debug>
+        <driver name="CalibrationDriver" type="org.hps.conditions.deprecated.CalibrationDriver">
+            <runNumber>${runNumber}</runNumber>
         </driver>
-              
+         <driver name="BadChannelFilter" type="org.hps.recon.tracking.SVTBadChannelFilterDriver" />     
+ 		<driver name="HPSSVTSensorSetup" type="org.hps.conditions.deprecated.HPSSVTSensorSetup"/>
+        <driver name="SimpleSVTReadout" type="org.hps.readout.svt.SimpleSvtReadout">
+            <noPileup>true</noPileup>
+        </driver>
+        <driver name="RawTrackerHitFitterDriver" type="org.hps.recon.tracking.RawTrackerHitFitterDriver">
+            <fitAlgorithm>Analytic</fitAlgorithm>
+            <correctT0Shift>true</correctT0Shift>
+        </driver>
+        <driver name="TrackerHitDriver" type="org.hps.recon.tracking.DataTrackerHitDriver" />     
+        <driver name="TrackerDigiDriver"
+                type="org.hps.recon.tracking.SimpleTrackerDigiDriver">
+            <debug>true</debug>
+        </driver> 
+
         <driver name="HelicalTrackHitDriver"
                 type="org.hps.recon.tracking.HelicalTrackHitDriver">
             <debug>false</debug>
@@ -52,15 +62,26 @@
             <tolerance>1.0</tolerance>
         </driver>
         
-        <driver name="TrackerReconDriver"
-                type="org.hps.recon.tracking.TrackerReconDriver">
+         
+        <driver name="TrackerReconDriver" type="org.hps.recon.tracking.TrackerReconDriver">
             <debug>false</debug>
-            <strategyResource>/org/hps/recon/tracking/strategies/HPS-Full.xml</strategyResource>
+            <strategyResource>/org/hps/recon/tracking/strategies/HPS-Test-All.xml</strategyResource>
+        </driver>   
+
+        <driver name="TrackingReconstructionPlots" type="org.hps.monitoring.drivers.svt.TrackingReconstructionPlots">
+            <outputPlots>TrackingReconstructionPlots.aida</outputPlots>
         </driver>
 
+        <driver name="SVTHitReconstructionPlots" type="org.hps.monitoring.drivers.svt.SVTHitReconstructionPlots">
+            <outputPlots>SVTHitReconstructionPlots.aida</outputPlots>
+        </driver>
+        
+        <driver name="SVTEventInfo" type="org.hps.monitoring.drivers.svt.SVTEventInfo">
+        </driver>
+
         <driver name="LCIOWriter"
                 type="org.lcsim.util.loop.LCIODriver">
-            <!--<outputFilePath>${outputFile}</outputFilePath>-->
+            <outputFilePath>${outputFile}</outputFilePath>
         </driver>
                                                                     
     </drivers>

java/branches/hps-java_HPSJAVA-88/steering-files/src/main/resources/org/hps/steering/users/phansson
TestRunReadoutToLcio.lcsim 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/steering-files/src/main/resources/org/hps/steering/users/phansson/TestRunReadoutToLcio.lcsim	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/steering-files/src/main/resources/org/hps/steering/users/phansson/TestRunReadoutToLcio.lcsim	2014-10-06 19:40:35 UTC (rev 1140)
@@ -5,12 +5,18 @@
        xs:noNamespaceSchemaLocation="http://www.lcsim.org/schemas/lcsim/1.0/lcsim.xsd">
     <execute>
         <driver name="EventMarkerDriver"/>
-        <!--
-        <driver name="CalibrationDriver"/>   
+        <driver name="HPSSVTSensorSetup"/>   
+        <driver name="CalibrationDriver"/>
+        <driver name="BadChannelFilter" />
+<!--        <driver name="EcalReadout"/>
+        <driver name="EcalConverter"/>
+        <driver name="EcalTriggerFilter"/>
+        <driver name="EcalClusterer"/>
+        <driver name="EcalTrigger"/>
+-->
         <driver name="SimpleSVTReadout"/>
-        -->
-        <driver name="TrackingGeometryChecker"/>
-        <driver name="TrackerDigiDriver"/>
+        <driver name="ClockDriver"/>
+        <driver name="TestRunReconToLcio"/>
         <driver name="CleanupDriver"/>
     </execute> 
 
@@ -18,18 +24,59 @@
         <driver name="EventMarkerDriver" type="org.lcsim.job.EventMarkerDriver">
             <eventInterval>1000</eventInterval>
         </driver> 
+        <driver name="HPSSVTSensorSetup" type="org.hps.conditions.deprecated.HPSSVTSensorSetup"/>
+        
         <driver name="CalibrationDriver" type="org.hps.conditions.deprecated.CalibrationDriver">
-            <runNumber>1351</runNumber>
-        </driver>        
-        <driver name="SimpleSVTReadout" type="org.hps.readout.svt.SimpleSvtReadout"/>
-        <driver name="TrackerDigiDriver"
-                type="org.hps.recon.tracking.SimpleTrackerDigiDriver">
-            <debug>true</debug>
+            <runNumber>${runNumber}</runNumber>
         </driver>
+        <driver name="TestRunReconToLcio" type="org.hps.evio.TestRunTriggeredReconToLcio">
+            <outputFile>${outputFile}.slcio</outputFile>
+        </driver>
+        <driver name="BadChannelFilter" type="org.hps.recon.tracking.SVTBadChannelFilterDriver" /> 	
+        <driver name="EcalReadout" type="org.hps.readout.ecal.FADCEcalReadoutDriver">
+            <coincidenceWindow>8</coincidenceWindow>
+            <ecalName>Ecal</ecalName>
+            <ecalCollectionName>EcalHits</ecalCollectionName>
+            <ecalRawCollectionName>EcalRawHits</ecalRawCollectionName>
+            <constantTriggerWindow>false</constantTriggerWindow>
+            <scaleFactor>128</scaleFactor>
+            <triggerThreshold>80</triggerThreshold>
+            <readoutThreshold>50</readoutThreshold>
+            <pePerMeV>2.0</pePerMeV>
+            <use2014Gain>false</use2014Gain>
+            <pulseShape>CRRC</pulseShape>
+            <tp>14.0</tp>
+        </driver>
+
+        <driver name="EcalConverter" type="org.hps.recon.ecal.EcalConverterDriver">
+            <rawCollectionName>EcalRawHits</rawCollectionName>
+            <ecalCollectionName>EcalCorrectedHits</ecalCollectionName>
+            <scale>1</scale>
+        </driver>	
+        
+        <driver name="EcalTriggerFilter" type="org.hps.recon.ecal.EcalTriggerFilterDriver">
+            <inputCollection>EcalCorrectedHits</inputCollection>
+            <outputCollection>EcalFilteredHits</outputCollection>
+        </driver>
+
+        <driver name="EcalClusterer" type="org.hps.recon.ecal.CTPEcalClusterer">
+            <ecalName>Ecal</ecalName>
+            <clusterWindow>32.0</clusterWindow>
+            <ecalCollectionName>EcalFilteredHits</ecalCollectionName>
+        </driver>
+
+        <driver name="EcalTrigger" type="org.hps.readout.ecal.TestRunTriggerDriver">
+            <clusterCollectionName>EcalClusters</clusterCollectionName>
+            <deadTime>10</deadTime>
+            <outputFileName>${outputFile}.triggers</outputFileName>
+        </driver>	
+        <driver name="SimpleSVTReadout" type="org.hps.readout.svt.SimpleSvtReadout">
+        </driver>
+
+        <driver name="ClockDriver" type="org.hps.readout.ecal.ClockDriver"/>
         <driver name="CleanupDriver" type="org.lcsim.recon.tracking.digitization.sisim.config.ReadoutCleanupDriver">
             <collectionNames>TrackerHits</collectionNames>
         </driver> 
-        <driver name="TrackingGeometryChecker" type="org.hps.users.phansson.TrackingGeometryChecker"/>
     </drivers>
 </lcsim>
 	

java/branches/hps-java_HPSJAVA-88/steering-files/src/main/resources/org/hps/steering/users/phansson
TwoTrackAnalysis.lcsim 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/steering-files/src/main/resources/org/hps/steering/users/phansson/TwoTrackAnalysis.lcsim	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/steering-files/src/main/resources/org/hps/steering/users/phansson/TwoTrackAnalysis.lcsim	2014-10-06 19:40:35 UTC (rev 1140)
@@ -2,9 +2,12 @@
        xs:noNamespaceSchemaLocation="http://www.lcsim.org/schemas/lcsim/1.0/lcsim.xsd">
     <inputFiles>
         <!--<fileRegExp baseDir="./../data/mc/HPS-TestRun-v5/1.8-SNAPSHOT-recoil-101013/">egs_5.5gev_0.016x0_500mb_recoil_readout_[0-9].slcio</fileRegExp>-->
+    	<fileRegExp baseDir="./../data/testrun/mc/HPS-TestRun-v7/">egs_5.5gev_0.016x0_500mb_90na_readout_\d\d.slcio</fileRegExp>
+    
+    
     </inputFiles>
     <control>
-        <numberOfEvents>-1</numberOfEvents>
+        <numberOfEvents>1000000000</numberOfEvents>
         <printInputFiles>true</printInputFiles>
         <printDriversDetailed>true</printDriversDetailed>
     </control>    
@@ -19,12 +22,11 @@
         <driver name="TrackerReconDriver"/>
         <driver name="EcalRawConverter" />
         <driver name="EcalClusterer" />
-<!--        <driver name="TrackingReconstructionPlots"/> -->
 <!--    <driver name="MCParticlePlots"/> -->
 <!--    <driver name="TruthMomentumAnalysis"/> -->
 <!--    <driver name="LCIOWriter"/> -->
         <driver name="ROOTFlatTupleDriver"/> 
-<!--	    <driver name="GBLDriver"/> -->
+	    <driver name="GBLOutputDriver"/> 
 <!--        <driver name="PrintGeometryDriver"/>-->
 
 
@@ -32,13 +34,18 @@
     </execute>    
 
     <drivers>
-        <driver name="GBLDriver"
+        <driver name="GBLOutputDriver"
                 type="org.hps.recon.tracking.gbl.GBLOutputDriver">
                 <debug>0</debug>
                 <isMC>${isMC}</isMC>
                 <outputPlotFileName></outputPlotFileName>
                 <gblFileName>gblinput.txt</gblFileName>
 	</driver>
+ 	<driver name="GBLDriver"
+                type="org.hps.recon.tracking.gbl.GBLDriver">
+                <debug>0</debug>
+                
+	</driver>
         <driver name="ROOTFlatTupleDriver" 
                 type="org.hps.users.phansson.ROOTFlatTupleDriver">
                 <debug>false</debug>
@@ -53,10 +60,7 @@
                 <debug>false</debug>
          </driver>
          <driver name="MCParticlePlots" type="org.hps.analysis.ecal.HPSMCParticlePlotsDriver" />
-     	<driver name="TrackingReconstructionPlots" type="org.hps.monitoring.drivers.svt.TrackingReconstructionPlots">
-                <outputPlots></outputPlots>
-        </driver>
-        <driver name="PrintGeometryDriver" type="org.hps.analysis.examples.PrintGeometryDriver"/>
+     	<driver name="PrintGeometryDriver" type="org.hps.analysis.examples.PrintGeometryDriver"/>
         
 
 
@@ -90,7 +94,8 @@
         <driver name="TrackerReconDriver"
                 type="org.hps.recon.tracking.TrackerReconDriver">
             <debug>false</debug>
-            <strategyResource>/org/hps/recon/tracking/strategies/HPS-Test-All.xml</strategyResource>
+            <!--<strategyResource>/org/lcsim/hps/recon/tracking/strategies/HPS-Test-All.xml</strategyResource>-->
+            <strategyResource>/org/lcsim/hps/recon/tracking/strategies/${strategy}.xml</strategyResource>
         </driver>        
         <driver name="EcalRawConverter" type="org.hps.recon.ecal.EcalRawConverterDriver">
             <ecalCollectionName>EcalCalHits</ecalCollectionName>

java/branches/hps-java_HPSJAVA-88/tracking
pom.xml 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/tracking/pom.xml	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/tracking/pom.xml	2014-10-06 19:40:35 UTC (rev 1140)
@@ -1,24 +1,20 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-    
     <modelVersion>4.0.0</modelVersion>
     <artifactId>hps-tracking</artifactId>
     <name>tracking</name>
     <description>HPS tracking reconstruction module</description>
-    
     <parent>
         <groupId>org.hps</groupId>
         <artifactId>hps-parent</artifactId>
         <relativePath>../parent/pom.xml</relativePath>
         <version>3.0.3-SNAPSHOT</version>
     </parent>
-    
     <scm>
         <url>http://java.freehep.org/svn/repos/hps/list/java/trunk/tracking/</url>
         <connection>scm:svn:svn://svn.freehep.org/hps/java/trunk/tracking/</connection>
         <developerConnection>scm:svn:svn://svn.freehep.org/hps/java/trunk/tracking/</developerConnection>
     </scm>
-    
     <build>
         <plugins>
             <plugin>
@@ -35,14 +31,8 @@
             </plugin>
         </plugins>
     </build>
-
     <dependencies>
         <dependency>
-            <groupId>org.lcsim</groupId>
-            <artifactId>lcsim-distribution</artifactId>
-            <version>${lcsimVersion}</version>
-        </dependency>
-        <dependency>
             <groupId>org.hps</groupId>
             <artifactId>hps-conditions</artifactId>
         </dependency>
@@ -61,5 +51,4 @@
             <version>1.0.2-SNAPSHOT</version>
         </dependency>
     </dependencies>
-    
 </project>

java/branches/hps-java_HPSJAVA-88/tracking/src/main/java/org/hps/readout/svt
SimpleSvtReadout.java 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/tracking/src/main/java/org/hps/readout/svt/SimpleSvtReadout.java	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/tracking/src/main/java/org/hps/readout/svt/SimpleSvtReadout.java	2014-10-06 19:40:35 UTC (rev 1140)
@@ -361,14 +361,19 @@
                         double meanNoise = 0; 
                         for (int sampleN = 0; sampleN < 6; sampleN++) {
                             double sampleTime = firstSample + sampleN * HPSSVTConstants.SAMPLING_INTERVAL;
+                            System.out.println("sampleTime: " + sampleTime);
                             double tp = ((HpsSiSensor) sensor).getShapeFitParameters(channel)[HpsSiSensor.TP_INDEX];
+                            System.out.println("tp: " + tp);
                             double signalAtTime = hit.amplitude * pulseAmplitude(sampleTime - hit.time, tp);
+                            System.out.println("SignalAtTime: " + signalAtTime);
                             totalContrib += signalAtTime;
+                            System.out.println("totalContrib: " + totalContrib);
                             signal[sampleN] += signalAtTime;
                             meanNoise += ((HpsSiSensor) sensor).getNoise(channel, sampleN);
                             System.out.format("new value of signal[%d] = %f\n", sampleN, signal[sampleN]);
                         }
-                        meanNoise /= 6; 
+                        meanNoise /= 6;
+                        System.out.println("Mean noise: " + meanNoise);
                         // Compare to the mean noise of the six samples instead
                         if(totalContrib > 4.0*meanNoise){ 
                         	 System.out.format("adding %d simHits\n", hit.simHits.size());

java/branches/hps-java_HPSJAVA-88/tracking/src/main/java/org/hps/recon/tracking
MaterialSupervisor.java 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/tracking/src/main/java/org/hps/recon/tracking/MaterialSupervisor.java	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/tracking/src/main/java/org/hps/recon/tracking/MaterialSupervisor.java	2014-10-06 19:40:35 UTC (rev 1140)
@@ -25,56 +25,71 @@
 
 /**
  * Material manager using the detector geometry.
- * 
- * Uses a private class to set up detector volumes. This can probably make use of the
- * DetectorGeometry classes from lcsim instead for the model. Something to consider in the future.
- * 
+ *
+ * Uses a private class to set up detector volumes. This can probably make use
+ * of the DetectorGeometry classes from lcsim instead for the model. Something
+ * to consider in the future.
+ *
  * @author Per Hansson <[log in to unmask]>
  */
-public class MaterialSupervisor extends MaterialManager {
+public class MaterialSupervisor extends MaterialManager
+{
 
     private List<ScatteringDetectorVolume> _detectorVolumes = new ArrayList<ScatteringDetectorVolume>();
 
-    public MaterialSupervisor() {
+    public MaterialSupervisor()
+    {
         super();
         this._includeMS = true;
     }
 
-    public MaterialSupervisor(boolean includeMS) {
+    public MaterialSupervisor(boolean includeMS)
+    {
         super(includeMS);
     }
 
     @Override
-    public void setDebug(boolean debug) {
+    public void setDebug(boolean debug)
+    {
         super.setDebug(debug);
     }
 
-    public List<ScatteringDetectorVolume> getMaterialVolumes() {
+    public List<ScatteringDetectorVolume> getMaterialVolumes()
+    {
         return _detectorVolumes;
     }
 
     @Override
-    public void buildModel(Detector det) {
+    public void buildModel(Detector det)
+    {
         // super.buildModel(det);
-        // if(DEBUG)
-        System.out.printf("%s: ###########################################################\n", this.getClass().getSimpleName());
-        System.out.printf("%s: Build detector model\n", this.getClass().getSimpleName());
+        if (DEBUG) {
+            System.out.printf("%s: ###########################################################\n", this.getClass().getSimpleName());
+            System.out.printf("%s: Build detector model\n", this.getClass().getSimpleName());
+        }
         List<SiSensor> sensors = det.getSubdetector("Tracker").getDetectorElement().findDescendants(SiSensor.class);
         // List<SiTrackerModule> modules =
         // det.getDetectorElement().findDescendants(SiTrackerModule.class);
-        System.out.printf("%s: %d sensors\n", this.getClass().getSimpleName(), sensors.size());
-        System.out.printf("%s: %5s %32s %22s %15s %10s %10s\n", this.getClass().getSimpleName(), "ID", "Pos (mm)", "size(mm)", "t(mm)", "t(%R.L)", "type");
+        if (DEBUG) {
+            System.out.printf("%s: %d sensors\n", this.getClass().getSimpleName(), sensors.size());
+            System.out.printf("%s: %5s %32s %22s %15s %10s %10s\n", this.getClass().getSimpleName(), "ID", "Pos (mm)", "size(mm)", "t(mm)", "t(%R.L)", "type");
+        }
         for (SiSensor module : sensors) {
 
             SiStripPlane plane = new SiStripPlane(module);
 
-            System.out.printf("%s: %5d %32s %15.2fx%.2f %10.2f %10.3f %10s\n", this.getClass().getSimpleName(), plane.getId(), plane.origin().toString(), plane.getUnmeasuredDimension(), plane.getMeasuredDimension(), plane.getThickness(), plane.getThicknessInRL() * 100, SvtUtils.getInstance().isAxial(module) ? "axial" : "stereo");
+            if (DEBUG) {
+                System.out.printf("%s: %5d %32s %15.2fx%.2f %10.2f %10.3f %10s\n", this.getClass().getSimpleName(), plane.getId(), plane.origin().toString(), plane.getUnmeasuredDimension(), plane.getMeasuredDimension(), plane.getThickness(), plane.getThicknessInRL() * 100, SvtUtils.getInstance().isAxial(module) ? "axial" : "stereo");
+            }
             _detectorVolumes.add(plane);
         }
-        System.out.printf("%s: ###########################################################\n", this.getClass().getSimpleName());
+        if (DEBUG) {
+            System.out.printf("%s: ###########################################################\n", this.getClass().getSimpleName());
+        }
     }
 
-    public interface ScatteringDetectorVolume {
+    public interface ScatteringDetectorVolume
+    {
 
         public String getName();
 
@@ -88,7 +103,8 @@
     }
 
     // public abstract class DetectorPlane extends SiSensor {
-    public interface DetectorPlane extends ScatteringDetectorVolume {
+    public interface DetectorPlane extends ScatteringDetectorVolume
+    {
 
         public double getThickness();
 
@@ -106,12 +122,14 @@
 
     }
 
-    private abstract class SiPlane implements DetectorPlane {
+    private abstract class SiPlane implements DetectorPlane
+    {
 
         abstract void addMaterial();
     }
 
-    public class SiStripPlane extends SiPlane {
+    public class SiStripPlane extends SiPlane
+    {
 
         private Hep3Vector _org = null; // origin
         private Hep3Vector _w = null; // normal to plane
@@ -122,7 +140,8 @@
         private double _length;
         private double _width;
 
-        public SiStripPlane(SiSensor module) {
+        public SiStripPlane(SiSensor module)
+        {
             _sensor = module;
             setOrigin();
             setNormal();
@@ -134,32 +153,39 @@
         }
 
         @Override
-        public IDetectorElement getDetectorElement() {
+        public IDetectorElement getDetectorElement()
+        {
             return getSensor();
         }
 
-        private SiTrackerModule getModule() {
+        private SiTrackerModule getModule()
+        {
             return (SiTrackerModule) getGeometry().getDetectorElement().getParent();
         }
 
-        private IGeometryInfo getGeometry() {
+        private IGeometryInfo getGeometry()
+        {
             return getSensor().getGeometry();
         }
 
-        SiSensor getSensor() {
+        public SiSensor getSensor()
+        {
             return _sensor;
         }
 
-        Polygon3D getPsidePlane() {
+        public Polygon3D getPsidePlane()
+        {
             return getSensor().getBiasSurface(ChargeCarrier.HOLE);
         }
 
-        Polygon3D getNsidePlane() {
+        public Polygon3D getNsidePlane()
+        {
             return getSensor().getBiasSurface(ChargeCarrier.ELECTRON);
         }
 
         @Override
-        public double getMaterialTraversed(Hep3Vector dir) {
+        public double getMaterialTraversed(Hep3Vector dir)
+        {
             // the distance inside the plane (note I don't care about sign of unit vector only
             // projection distance)
             double cth = Math.abs(VecOp.dot(dir, _w));
@@ -168,7 +194,8 @@
         }
 
         @Override
-        public double getMaterialTraversedInRL(Hep3Vector dir) {
+        public double getMaterialTraversedInRL(Hep3Vector dir)
+        {
             // the distance inside the plane (note I don't care about sign of unit vector only
             // projection distance)
             double cth = Math.abs(VecOp.dot(dir, _w));
@@ -177,7 +204,8 @@
         }
 
         @Override
-        protected void addMaterial() {
+        protected void addMaterial()
+        {
 
             IPhysicalVolume parent = getModule().getGeometry().getPhysicalVolume();
             IPhysicalVolumeContainer daughters = parent.getLogicalVolume().getDaughters();
@@ -194,21 +222,25 @@
             }
         }
 
-        public void addMaterial(String type, double density, double radLen, double t) {
+        public void addMaterial(String type, double density, double radLen, double t)
+        {
             _materials.add(type, density, radLen, t);
         }
 
         @Override
-        public double getThickness() {
+        public double getThickness()
+        {
             return _materials.getThickness();
         }
 
         @Override
-        public double getThicknessInRL() {
+        public double getThicknessInRL()
+        {
             return _materials.getThicknessInRL();
         }
 
-        private void setDimensions() {
+        private void setDimensions()
+        {
             // The dimensions are taken from the full module
             IPhysicalVolume physVol_parent = getModule().getGeometry().getPhysicalVolume();
             ILogicalVolume logVol_parent = physVol_parent.getLogicalVolume();
@@ -225,17 +257,20 @@
         }
 
         @Override
-        public Hep3Vector origin() {
+        public Hep3Vector origin()
+        {
 
             return _org;
         }
 
-        public void setOrigin(Hep3Vector org) {
+        public void setOrigin(Hep3Vector org)
+        {
 
             this._org = org;
         }
 
-        private void setOrigin() {
+        private void setOrigin()
+        {
             // Use origin of p-side surface
             Hep3Vector origin = VecOp.mult(CoordinateTransformations.getMatrix(), _sensor.getGeometry().getPosition());
             // transform to p-side
@@ -245,7 +280,8 @@
         }
 
         @Override
-        public Hep3Vector normal() {
+        public Hep3Vector normal()
+        {
             if (_w == null) {
                 _w = this.getPsidePlane().getNormal();
                 System.out.printf("setting normal from pside normal %s\n", _w.toString());
@@ -255,57 +291,69 @@
             return this._w;
         }
 
-        private void setNormal() {
+        private void setNormal()
+        {
             _w = this.getPsidePlane().getNormal();
             _w = VecOp.mult(VecOp.mult(CoordinateTransformations.getMatrix(), getSensor().getReadoutElectrodes(ChargeCarrier.HOLE).getLocalToGlobal().getRotation().getRotationMatrix()), _w);
         }
 
-        public void setNormal(Hep3Vector w) {
+        public void setNormal(Hep3Vector w)
+        {
             this._w = w;
         }
 
         @Override
-        public void print() {
+        public void print()
+        {
             System.out.printf("DetectorPlane:  org %s normal vector %s %.2fx%.2fmm  thickness %f R.L. (%fmm)\n", origin().toString(), normal().toString(), getLength(), getWidth(), getThicknessInRL(), getThickness());
         }
 
         @Override
-        public int getId() {
+        public int getId()
+        {
             return _sensor.getSensorID();
         }
 
         @Override
-        public String getName() {
+        public String getName()
+        {
             return _sensor.getName();
         }
 
         @Override
-        public double getLength() {
+        public double getLength()
+        {
             return _length;
         }
 
         @Override
-        public double getWidth() {
+        public double getWidth()
+        {
             return _width;
         }
 
-        double getMeasuredDimension() {
+        public double getMeasuredDimension()
+        {
             return getLength();
         }
 
-        double getUnmeasuredDimension() {
+        public double getUnmeasuredDimension()
+        {
             return getWidth();
         }
 
-        Hep3Vector getUnmeasuredCoordinate() {
+        public Hep3Vector getUnmeasuredCoordinate()
+        {
             return _v;
         }
 
-        Hep3Vector getMeasuredCoordinate() {
+        public Hep3Vector getMeasuredCoordinate()
+        {
             return _u;
         }
 
-        private void setMeasuredCoordinate() {
+        private void setMeasuredCoordinate()
+        {
             // p-side unit vector
             ITransform3D electrodes_to_global = getSensor().getReadoutElectrodes(ChargeCarrier.HOLE).getLocalToGlobal();
             Hep3Vector measuredCoordinate = getSensor().getReadoutElectrodes(ChargeCarrier.HOLE).getMeasuredCoordinate(0);
@@ -313,7 +361,8 @@
             _u = measuredCoordinate;
         }
 
-        private void setUnmeasuredCoordinate() {
+        private void setUnmeasuredCoordinate()
+        {
             // p-side unit vector
             ITransform3D electrodes_to_global = getSensor().getReadoutElectrodes(ChargeCarrier.HOLE).getLocalToGlobal();
             Hep3Vector unmeasuredCoordinate = getSensor().getReadoutElectrodes(ChargeCarrier.HOLE).getUnmeasuredCoordinate(0);
@@ -323,51 +372,61 @@
 
     }
 
-    private static class Material {
+    private static class Material
+    {
 
         private String _name;
         private double _X0;
         private double _density;
         private double _thickness;
 
-        public Material(String _name, double _X0, double _density, double _thickness) {
+        public Material(String _name, double _X0, double _density, double _thickness)
+        {
             this._name = _name;
             this._X0 = _X0;
             this._density = _density;
             this._thickness = _thickness;
         }
 
-        private void add(double t) {
+        private void add(double t)
+        {
             _thickness += t;
         }
 
-        public double getThickness() {
+        public double getThickness()
+        {
             return _thickness;
         }
 
-        public double getDensity() {
+        public double getDensity()
+        {
             return _density;
         }
 
-        public double getX0() {
+        public double getX0()
+        {
             return _X0;
         }
 
     }
 
-    private static class Materials {
+    private static class Materials
+    {
 
         private List<Material> _materials = new ArrayList<Material>();
         private double _tot_X0 = -1;
 
-        public Materials() {
+        public Materials()
+        {
         }
 
-        public int numberOfMaterials() {
+        public int numberOfMaterials()
+        {
             return _materials.size();
         }
 
-        public void add(String mat, double density, double radLen, double t) {
+        public void add(String mat, double density, double radLen, double t)
+        {
             boolean found = false;
             for (Material m : _materials) {
                 if (m._name == mat) {
@@ -383,9 +442,11 @@
 
         }
 
-        public double getThicknessInRL() {
-            if (_materials.isEmpty())
+        public double getThicknessInRL()
+        {
+            if (_materials.isEmpty()) {
                 return 0;
+            }
             if (_tot_X0 < 0) {
                 double sum = 0.;
                 for (Material m : _materials) {
@@ -403,7 +464,8 @@
             return _tot_X0;
         }
 
-        private double getThickness() {
+        private double getThickness()
+        {
             double t_tot = 0.;
             for (Material m : _materials) {
                 t_tot += m.getThickness();

java/branches/hps-java_HPSJAVA-88/tracking/src/main/java/org/hps/recon/tracking
TrackerDigiDriver.java 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/tracking/src/main/java/org/hps/recon/tracking/TrackerDigiDriver.java	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/tracking/src/main/java/org/hps/recon/tracking/TrackerDigiDriver.java	2014-10-06 19:40:35 UTC (rev 1140)
@@ -291,7 +291,9 @@
 
         // Put output hits into collection.
         int flag = LCIOUtil.bitSet(0, 31, true); // Turn on 64-bit cell ID.
-        event.put(this.rawTrackerHitOutputCollectionName, rawHits, RawTrackerHit.class, flag, toString());
-        event.put(this.stripHitOutputCollectionName, stripHits1D, SiTrackerHitStrip1D.class, 0, toString());
+        //System.out.println("TrackerDigiDriver putting collection " + this.rawTrackerHitOutputCollectionName + " with readoutName " + readoutCollectionName);
+        event.put(this.rawTrackerHitOutputCollectionName, rawHits, RawTrackerHit.class, flag, readoutCollectionName);
+        //System.out.println("TrackerDigiDriver putting collection " + this.stripHitOutputCollectionName + " with readoutName " + readoutCollectionName);
+        event.put(this.stripHitOutputCollectionName, stripHits1D, SiTrackerHitStrip1D.class, 0, readoutCollectionName);
     }
 }
\ No newline at end of file

java/branches/hps-java_HPSJAVA-88/tracking/src/main/java/org/hps/recon/tracking
TrackerReconDriver.java 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/tracking/src/main/java/org/hps/recon/tracking/TrackerReconDriver.java	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/tracking/src/main/java/org/hps/recon/tracking/TrackerReconDriver.java	2014-10-06 19:40:35 UTC (rev 1140)
@@ -15,10 +15,10 @@
 import org.lcsim.util.Driver;
 
 /**
- * This class runs the Track Reconstruction for the HPS Test Proposal detector. The tracker
- * digitization must be run in front of it. It is intended to work with the
- * {@link TrackerDigiDriver} digitization Driver.
- * 
+ * This class runs the Track Reconstruction for the HPS Test Proposal detector.
+ * The tracker digitization must be run in front of it. It is intended to work
+ * with the {@link TrackerDigiDriver} digitization Driver.
+ *
  * @author Matt Graham
  */
 public final class TrackerReconDriver extends Driver {
@@ -47,6 +47,7 @@
     private boolean _useHPSMaterialManager = true;
     // enable the use of sectoring using sector binning in SeedTracker
     private boolean _applySectorBinning = true;
+    private double rmsTimeCut = -1;
 
     public TrackerReconDriver() {
     }
@@ -57,8 +58,9 @@
 
     /**
      * Set the tracking strategy resource.
-     * 
-     * @param strategyResource The absolute path to the strategy resource in the hps-java jar.
+     *
+     * @param strategyResource The absolute path to the strategy resource in the
+     * hps-java jar.
      */
     public void setStrategyResource(String strategyResource) {
         this.strategyResource = strategyResource;
@@ -78,7 +80,7 @@
 
     /**
      * Set to enable the use of the HPS material manager implementation
-     * 
+     *
      * @param useHPSMaterialManager switch
      */
     public void setUseHPSMaterialManager(boolean useHPSMaterialManager) {
@@ -90,8 +92,9 @@
     }
 
     /**
-     * Set to enable the sectoring to use the sector bins in checking for consistent hits.
-     * 
+     * Set to enable the sectoring to use the sector bins in checking for
+     * consistent hits.
+     *
      * @param applySectorBinning apply sector binning switch
      */
     public void setApplySectorBinning(boolean applySectorBinning) {
@@ -99,6 +102,14 @@
     }
 
     /**
+     * Set time cut.
+     * @param rmsTimeCut
+     */
+    public void setRmsTimeCut(double rmsTimeCut) {
+        this.rmsTimeCut = rmsTimeCut;
+    }
+
+    /**
      * This is used to setup the Drivers after XML config.
      */
     @Override
@@ -126,7 +137,6 @@
         //
         // 1) Driver to run Seed Tracker.
         //
-
         if (!strategyResource.startsWith("/")) {
             strategyResource = "/org/hps/recon/tracking/strategies/" + strategyResource;
         }
@@ -146,10 +156,15 @@
         // stFinal.setSectorParams(false); //this doesn't actually seem to do anything
         stFinal.setSectorParams(1, 10000);
         add(stFinal);
+
+        if (rmsTimeCut > 0) {
+            stFinal.setTrackCheck(new HitTimeTrackCheck(rmsTimeCut));
+        }
     }
 
     /**
-     * This method is used to run the reconstruction and print debug information.
+     * This method is used to run the reconstruction and print debug
+     * information.
      */
     @Override
     public void process(EventHeader event) {
@@ -174,7 +189,7 @@
                 System.out.println(this.getClass().getSimpleName() + ": chi2 = " + track.getChi2());
             }
         }
-        
+
         // Set the type of track to indicate B-field in Y e.g. for swimming in Wired.
         List<Track> tracks = event.get(Track.class, trackCollectionName);
         setTrackType(tracks);
@@ -185,14 +200,15 @@
         // Add to tracks found.
         ntracks += event.get(Track.class, trackCollectionName).size();
     }
-    
+
     /**
      * Set the track type to Y_FIELD so swimming is done correctly in Wired.
+     *
      * @param tracks The list of <code>Track</code> objects.
      */
     private void setTrackType(List<Track> tracks) {
         for (Track track : tracks) {
-            ((BaseTrack)track).setTrackType(BaseTrack.TrackType.Y_FIELD.ordinal());
+            ((BaseTrack) track).setTrackType(BaseTrack.TrackType.Y_FIELD.ordinal());
         }
     }
 
@@ -203,4 +219,4 @@
             System.out.println(this.getName() + " found " + ntracks + " tracks in " + nevents + " events which is " + ((double) ntracks / (double) nevents) + " tracks per event.");
         }
     }
-}
\ No newline at end of file
+}

java/branches/hps-java_HPSJAVA-88/users/src/main/java/org/hps/users/mgraham
ElwinsTrackingRecon.java removed after 1139
--- java/branches/hps-java_HPSJAVA-88/users/src/main/java/org/hps/users/mgraham/ElwinsTrackingRecon.java	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/users/src/main/java/org/hps/users/mgraham/ElwinsTrackingRecon.java	2014-10-06 19:40:35 UTC (rev 1140)
@@ -1,1570 +0,0 @@
-package org.hps.users.mgraham;
-
-import hep.aida.IAnalysisFactory;
-import hep.aida.IHistogram1D;
-import hep.aida.IHistogram2D;
-import hep.aida.IPlotter;
-import hep.aida.IPlotterStyle;
-import hep.physics.matrix.SymmetricMatrix;
-import hep.physics.vec.Hep3Vector;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.hps.conditions.deprecated.BeamlineConstants;
-import org.hps.conditions.deprecated.SvtUtils;
-import org.hps.recon.ecal.HPSEcalCluster;
-import org.hps.recon.tracking.DumbShaperFit;
-import org.hps.recon.tracking.HPSTrack;
-import org.hps.recon.tracking.HelixConverter;
-import org.hps.recon.tracking.ShaperFitAlgorithm;
-import org.hps.recon.tracking.StraightLineTrack;
-import org.hps.util.Resettable;
-import org.lcsim.detector.tracker.silicon.SiSensor;
-import org.lcsim.event.EventHeader;
-import org.lcsim.event.RawTrackerHit;
-import org.lcsim.event.Track;
-import org.lcsim.event.TrackerHit;
-import org.lcsim.fit.helicaltrack.HelicalTrackCross;
-import org.lcsim.fit.helicaltrack.HelicalTrackFit;
-import org.lcsim.fit.helicaltrack.HelicalTrackHit;
-import org.lcsim.geometry.Detector;
-import org.lcsim.geometry.IDDecoder;
-import org.lcsim.recon.tracking.seedtracker.SeedCandidate;
-import org.lcsim.recon.tracking.seedtracker.SeedTrack;
-import org.lcsim.util.Driver;
-import org.lcsim.util.aida.AIDA;
-
-import Jama.Matrix;
-import Jama.SingularValueDecomposition;
-
-/**
- *
- * @author elwinm
- */
-public class ElwinsTrackingRecon extends Driver implements Resettable {
-
-    //private AIDAFrame plotterFrame;
-    //private AIDAFrame topFrame;
-    //private AIDAFrame bottomFrame;
-    //private AIDAFrame chargeFrame;
-    //private AIDAFrame twotrackFrame;
-    private AIDA aida = AIDA.defaultInstance();
-    private String rawTrackerHitCollectionName = "SVTRawTrackerHits";
-    private String fittedTrackerHitCollectionName = "SVTFittedRawTrackerHits";
-    private String trackerHitCollectionName = "StripClusterer_SiTrackerHitStrip1D";
-    private String helicalTrackHitCollectionName = "HelicalTrackHits";
-    private String rotatedTrackHitCollectionName = "RotatedHelicalTrackHits";
-    private String helicalTrackHitRelationsCollectionName = "HelicalTrackHitRelations";
-    private String trackCollectionName = "MatchedTracks";
-    private String trackerName = "Tracker";
-    String ecalSubdetectorName = "Ecal";
-    String ecalCollectionName = "EcalClusters";
-    private Detector detector = null;
-    IDDecoder dec;
-    private int eventCount;
-    private List<SiSensor> sensors;
-    private String outputPlots = null;
-    IPlotter plotter;
-    IPlotter plotter2;
-    IPlotter plotter22;
-    IPlotter plotter222;
-    IPlotter plotter3;
-    IPlotter plotter3_1;
-    IPlotter plotter3_2;
-    IPlotter plotter4;
-    IPlotter plotter5;
-    IPlotter plotter5_1;
-    IPlotter plotter55;
-    IPlotter plotter6;
-    IPlotter plotter7;
-    IPlotter plotter9000;
-    IPlotter plotter9001;
-    IPlotter plotter9002;
-    IPlotter plotter9003;
-    IPlotter plotter9004;
-    IPlotter plotter9005;
-    IPlotter plotter9006;
-    IPlotter plotter9007;
-    IPlotter plotter9008;
-    IPlotter plotter9009;
-    IPlotter plotter9010;
-    IPlotter plotter9011;
-    IPlotter plotter9012;
-    IPlotter plotter9013;
-    IPlotter plotter9014;
-    IPlotter plotter9015;
-    IPlotter plotter9016;
-    IPlotter plotter9017;
-    IPlotter twotrkextra;
-    IPlotter twotrkextra2;
-    IPlotter threetrack;
-    IPlotter top1;
-    IPlotter top2;
-    IPlotter top3;
-    IPlotter top4;
-    IPlotter bot1;
-    IPlotter bot2;
-    IPlotter bot3;
-    IPlotter charge;
-    IPlotter bot4;
-    double zEcal = 1500;
-    double zAtDownStrPairSpec = 914.0; //mm
-    double zAtColl = -1500;
-    IHistogram1D trkPx;
-    IHistogram1D nTracks;
-    ShaperFitAlgorithm _shaper = new DumbShaperFit();
-
-    protected void detectorChanged(Detector detector) {
-        this.detector = detector;
-        aida.tree().cd("/");
-        //plotterFrame = new AIDAFrame();
-        //plotterFrame.setTitle("HPS Tracking Plots");
-
-        //twotrackFrame = new AIDAFrame();
-        //twotrackFrame.setTitle("Two Track Plots");
-
-        sensors = detector.getSubdetector(trackerName).getDetectorElement().findDescendants(SiSensor.class);
-
-        IAnalysisFactory fac = aida.analysisFactory();
-        plotter = fac.createPlotterFactory().create("HPS Tracking Plots");
-        plotter.setTitle("Momentum");
-        IPlotterStyle style = plotter.style();
-        style.dataStyle().fillStyle().setColor("yellow");
-        style.dataStyle().errorBarStyle().setVisible(false);
-        plotter.createRegions(2, 2);
-        //plotterFrame.addPlotter(plotter);
-
-        trkPx = aida.histogram1D("Track X Momentum", 25, -0.25, 0.25);
-        IHistogram1D trkPy = aida.histogram1D("Track Y Momentum", 25, -0.1, 0.1);
-        IHistogram1D trkPz = aida.histogram1D("Track Z Momentum", 25, 0, 3.5);
-        IHistogram1D trkChi2 = aida.histogram1D("Track Chi2", 25, 0, 25.0);
-
-        plotter.region(0).plot(trkPx);
-        plotter.region(1).plot(trkPy);
-        plotter.region(2).plot(trkPz);
-        plotter.region(3).plot(trkChi2);
-
-
-        plotter2 = fac.createPlotterFactory().create("HPS Tracking Plots");
-        plotter2.setTitle("Track extrapolation");
-        //plotterFrame.addPlotter(plotter2);
-        IPlotterStyle style2 = plotter2.style();
-        style2.dataStyle().fillStyle().setColor("yellow");
-        style2.dataStyle().errorBarStyle().setVisible(false);
-        plotter2.createRegions(2, 4);
-        IHistogram1D xAtConverter = aida.histogram1D("X (mm) @ Z=-60cm", 50, -50, 50);
-        IHistogram1D yAtConverter = aida.histogram1D("Y (mm) @ Z=-60cm", 50, -20, 20);
-        IHistogram1D xAtColl = aida.histogram1D("X (mm) @ Z=-150cm", 50, -200, 200);
-        IHistogram1D yAtColl = aida.histogram1D("Y (mm) @ Z=-150cm", 50, -200, 200);
-        IHistogram1D xAtEcal = aida.histogram1D("X (mm) @ ECAL", 50, -500, 500);
-        IHistogram1D yAtEcal = aida.histogram1D("Y (mm) @ ECAL", 50, -100, 100);
-        IHistogram1D xAtConvert = aida.histogram1D("X (mm) @ Converter", 50, -50, 50);
-        IHistogram1D yAtConvert = aida.histogram1D("Y (mm) @ Converter", 50, -20, 20);
-
-        plotter2.region(0).plot(xAtConverter);
-        plotter2.region(4).plot(yAtConverter);
-        plotter2.region(1).plot(xAtColl);
-        plotter2.region(5).plot(yAtColl);
-        plotter2.region(2).plot(xAtEcal);
-        plotter2.region(6).plot(yAtEcal);
-        plotter2.region(3).plot(xAtConvert);
-        plotter2.region(7).plot(yAtConvert);
-
-        twotrkextra = fac.createPlotterFactory().create("Two Trk Extrapolation");
-        twotrkextra.setTitle("Stuff");
-        //plotterFrame.addPlotter(twotrkextra);
-        IPlotterStyle styletwo = twotrkextra.style();
-        styletwo.dataStyle().fillStyle().setColor("blue");
-        styletwo.dataStyle().errorBarStyle().setVisible(false);
-        twotrkextra.createRegions(3, 2);
-        IHistogram1D x1AtTarget = aida.histogram1D("Trk1 X @ Target", 50, 0, 50);
-        IHistogram1D y1AtTarget = aida.histogram1D("Trk1 Y @ Target", 50, -5, 5);
-        IHistogram1D x2AtTarget = aida.histogram1D("Trk2 X @ Target", 50, 0, 50);
-        IHistogram1D y2AtTarget = aida.histogram1D("Trk2 Y @ Target", 50, -5, 5);
-        IHistogram1D distatt = aida.histogram1D("Distance btwn Trks @ Target", 40, 0, 40);
-        IHistogram1D zdiff = aida.histogram1D("Z Diff", 40, -.1, .1);
-
-        twotrkextra.region(0).plot(x1AtTarget);
-        twotrkextra.region(1).plot(y1AtTarget);
-        twotrkextra.region(2).plot(x2AtTarget);
-        twotrkextra.region(3).plot(y2AtTarget);
-        twotrkextra.region(4).plot(distatt);
-        twotrkextra.region(5).plot(zdiff);
-
-
-        plotter222 = fac.createPlotterFactory().create("HPS Tracking Plots");
-        plotter222.setTitle("Other");
-        //plotterFrame.addPlotter(plotter222);
-        IPlotterStyle style222 = plotter222.style();
-        style222.dataStyle().fillStyle().setColor("yellow");
-        style222.dataStyle().errorBarStyle().setVisible(false);
-        plotter222.createRegions(2, 3);
-
-        IHistogram1D nHits = aida.histogram1D("Hits per Track", 2, 4, 6);
-        IHistogram1D amp = aida.histogram1D("Amp (HitOnTrack)", 50, 0, 5000);
-        IHistogram1D ampcl = aida.histogram1D("Amp (CluOnTrack)", 50, 0, 5000);
-        IHistogram1D amp2 = aida.histogram1D("Amp Pz>1000 (HitOnTrack)", 50, 0, 5000);
-        IHistogram1D ampcl2 = aida.histogram1D("Amp Pz>1000 (CluOnTrack)", 50, 0, 5000);
-        nTracks = aida.histogram1D("Tracks per Event", 3, 0, 3);
-
-        plotter222.region(0).plot(nHits);
-        plotter222.region(3).plot(nTracks);
-        plotter222.region(1).plot(amp);
-        plotter222.region(4).plot(amp2);
-        plotter222.region(2).plot(ampcl);
-        plotter222.region(5).plot(ampcl2);
-
-
-        //plotterFrame.pack();
-        //plotterFrame.setVisible(true);
-
-
-        twotrkextra2 = fac.createPlotterFactory().create("Two Trk Uncertainties");
-        twotrkextra2.setTitle("Uncertainties");
-        plotter9000 = fac.createPlotterFactory().create("Two Track Plots");
-        plotter9000.setTitle("Two Track Plots Test");
-        IPlotterStyle TwoTracks = plotter9000.style();
-        plotter9001 = fac.createPlotterFactory().create("Two Track Plots 2");
-        plotter9001.setTitle("Two Track Plots Test 2");
-        IPlotterStyle TwoTracks1 = plotter9001.style();
-        plotter9002 = fac.createPlotterFactory().create("Two Track Plots");
-        plotter9002.setTitle("Two Track Plots Test");
-        IPlotterStyle TwoTracks2 = plotter9002.style();
-        plotter9003 = fac.createPlotterFactory().create("Two Track Plots");
-        plotter9003.setTitle("Two Track Plots Test");
-        IPlotterStyle TwoTracks3 = plotter9003.style();
-        plotter9004 = fac.createPlotterFactory().create("Two Track Plots");
-        plotter9004.setTitle("Two Track Plots Test");
-        IPlotterStyle TwoTracks4 = plotter9004.style();
-        plotter9005 = fac.createPlotterFactory().create("Two Track Plots");
-        plotter9005.setTitle("Two Track Plots Test");
-        IPlotterStyle TwoTracks5 = plotter9005.style();
-        plotter9006 = fac.createPlotterFactory().create("Two Track Versus");
-        plotter9006.setTitle("Two Track Versus");
-        IPlotterStyle TwoTracks6 = plotter9006.style();
-        plotter9007 = fac.createPlotterFactory().create("Two Track Plots");
-        plotter9007.setTitle("Two Track Plots Test");
-        IPlotterStyle TwoTracks7 = plotter9007.style();
-        plotter9008 = fac.createPlotterFactory().create("Two Track Plots");
-        plotter9008.setTitle("Two Track Plots Test");
-        IPlotterStyle TwoTracks8 = plotter9000.style();
-        plotter9009 = fac.createPlotterFactory().create("Two Track Plots");
-        plotter9009.setTitle("Two Track Plots Test");
-        IPlotterStyle TwoTracks9 = plotter9000.style();
-        plotter9010 = fac.createPlotterFactory().create("Two Track Plots");
-        plotter9010.setTitle("Two Track Plots Test");
-        IPlotterStyle TwoTracks10 = plotter9010.style();
-        plotter9011 = fac.createPlotterFactory().create("Two Track Plots");
-        plotter9011.setTitle("Two Track Plots Test");
-        IPlotterStyle TwoTracks11 = plotter9011.style();
-        plotter9012 = fac.createPlotterFactory().create("Two Track Plotz");
-        plotter9012.setTitle("Two Track Plotz Test");
-        IPlotterStyle TwoTracks12 = plotter9012.style();
-        plotter9013 = fac.createPlotterFactory().create("Two Track Plotz");
-        plotter9013.setTitle("Two Track Plotz Test");
-        IPlotterStyle TwoTracks13 = plotter9013.style();
-        plotter9014 = fac.createPlotterFactory().create("Two Track Plotz");
-        plotter9014.setTitle("Two Track Plotz Test");
-        IPlotterStyle TwoTracks14 = plotter9014.style();
-        plotter9015 = fac.createPlotterFactory().create("Two Track Plots");
-        plotter9015.setTitle("Two Track Plots Test");
-        IPlotterStyle TwoTracks15 = plotter9015.style();
-        plotter9016 = fac.createPlotterFactory().create("Two Track Plots");
-        plotter9016.setTitle("Test");
-        IPlotterStyle TwoTracks16 = plotter9016.style();
-        plotter9017 = fac.createPlotterFactory().create("Two Track Plots");
-        plotter9017.setTitle("Residuals");
-        IPlotterStyle TwoTracks17 = plotter9017.style();
-        threetrack = fac.createPlotterFactory().create("Three Track Plots");
-        threetrack.setTitle("Invariant Mass");
-
-
-        TwoTracks.dataStyle().fillStyle().setColor("green");
-        TwoTracks.dataStyle().errorBarStyle().setVisible(false);
-        TwoTracks.setParameter("hist2DStyle", "colorMap");
-        TwoTracks.dataStyle().fillStyle().setParameter("colorMapScheme", "rainbow");
-        TwoTracks1.dataStyle().fillStyle().setColor("green");
-        TwoTracks1.dataStyle().errorBarStyle().setVisible(false);
-        TwoTracks1.setParameter("hist2DStyle", "colorMap");
-        TwoTracks1.dataStyle().fillStyle().setParameter("colorMapScheme", "rainbow");
-        TwoTracks2.dataStyle().fillStyle().setColor("green");
-        TwoTracks2.dataStyle().errorBarStyle().setVisible(false);
-        TwoTracks2.setParameter("hist2DStyle", "colorMap");
-        TwoTracks2.dataStyle().fillStyle().setParameter("colorMapScheme", "rainbow");
-        TwoTracks3.dataStyle().fillStyle().setColor("green");
-        TwoTracks3.dataStyle().errorBarStyle().setVisible(false);
-        TwoTracks3.setParameter("hist2DStyle", "colorMap");
-        TwoTracks3.dataStyle().fillStyle().setParameter("colorMapScheme", "rainbow");
-        TwoTracks4.dataStyle().fillStyle().setColor("green");
-        TwoTracks4.dataStyle().errorBarStyle().setVisible(false);
-        TwoTracks4.setParameter("hist2DStyle", "colorMap");
-        TwoTracks4.dataStyle().fillStyle().setParameter("colorMapScheme", "rainbow");
-        TwoTracks5.dataStyle().fillStyle().setColor("green");
-        TwoTracks5.dataStyle().errorBarStyle().setVisible(false);
-        TwoTracks5.setParameter("hist2DStyle", "colorMap");
-        TwoTracks5.dataStyle().fillStyle().setParameter("colorMapScheme", "rainbow");
-        TwoTracks6.dataStyle().fillStyle().setColor("green");
-        TwoTracks6.dataStyle().errorBarStyle().setVisible(false);
-        TwoTracks6.setParameter("hist2DStyle", "colorMap");
-        TwoTracks6.dataStyle().fillStyle().setParameter("colorMapScheme", "rainbow");
-        TwoTracks7.dataStyle().fillStyle().setColor("green");
-        TwoTracks7.dataStyle().errorBarStyle().setVisible(false);
-        TwoTracks7.setParameter("hist2DStyle", "colorMap");
-        TwoTracks7.dataStyle().fillStyle().setParameter("colorMapScheme", "rainbow");
-        TwoTracks8.dataStyle().fillStyle().setColor("green");
-        TwoTracks8.dataStyle().errorBarStyle().setVisible(false);
-        TwoTracks8.setParameter("hist2DStyle", "colorMap");
-        TwoTracks8.dataStyle().fillStyle().setParameter("colorMapScheme", "rainbow");
-        TwoTracks9.dataStyle().fillStyle().setColor("green");
-        TwoTracks9.dataStyle().errorBarStyle().setVisible(false);
-        TwoTracks9.setParameter("hist2DStyle", "colorMap");
-        TwoTracks9.dataStyle().fillStyle().setParameter("colorMapScheme", "rainbow");
-        TwoTracks10.dataStyle().fillStyle().setColor("green");
-        TwoTracks10.dataStyle().errorBarStyle().setVisible(false);
-        TwoTracks10.setParameter("hist2DStyle", "colorMap");
-        TwoTracks10.dataStyle().fillStyle().setParameter("colorMapScheme", "rainbow");
-        TwoTracks11.dataStyle().fillStyle().setColor("green");
-        TwoTracks11.dataStyle().errorBarStyle().setVisible(false);
-        TwoTracks11.setParameter("hist2DStyle", "colorMap");
-        TwoTracks11.dataStyle().fillStyle().setParameter("colorMapScheme", "rainbow");
-        TwoTracks12.dataStyle().fillStyle().setColor("green");
-        TwoTracks12.dataStyle().errorBarStyle().setVisible(false);
-        TwoTracks13.dataStyle().fillStyle().setColor("green");
-        TwoTracks13.dataStyle().errorBarStyle().setVisible(false);
-        TwoTracks14.dataStyle().fillStyle().setColor("green");
-        TwoTracks14.dataStyle().errorBarStyle().setVisible(false);
-        TwoTracks15.dataStyle().fillStyle().setColor("green");
-        TwoTracks15.dataStyle().errorBarStyle().setVisible(false);
-        TwoTracks15.setParameter("hist2DStyle", "colorMap");
-        TwoTracks15.dataStyle().fillStyle().setParameter("colorMapScheme", "rainbow");
-        TwoTracks16.dataStyle().fillStyle().setColor("green");
-        TwoTracks16.dataStyle().errorBarStyle().setVisible(false);
-        TwoTracks16.setParameter("hist2DStyle", "colorMap");
-        TwoTracks16.dataStyle().fillStyle().setParameter("colorMapScheme", "rainbow");
-        IPlotterStyle styletwotwo = twotrkextra2.style();
-        styletwotwo.dataStyle().fillStyle().setColor("blue");
-        styletwotwo.dataStyle().errorBarStyle().setVisible(false);
-
-        IPlotterStyle threesty = threetrack.style();
-        threesty.dataStyle().fillStyle().setColor("blue");
-        threesty.dataStyle().errorBarStyle().setVisible(false);
-
-
-
-        twotrkextra2.createRegions(3, 2);
-        plotter9000.createRegion();
-        plotter9001.createRegion();
-        plotter9002.createRegions(2, 1);
-        plotter9003.createRegion();
-        plotter9004.createRegion();
-        plotter9005.createRegion();
-        plotter9006.createRegions(1, 3);
-        plotter9007.createRegions(2, 3);
-        plotter9008.createRegions(2, 2);
-        plotter9009.createRegions(2, 2);
-        plotter9010.createRegions(2, 2);
-        plotter9011.createRegions(2, 2);
-        plotter9012.createRegions(2, 2);
-        //   plotter9013.createRegions(2, 2);
-        //    plotter9014.createRegions(2, 2);
-        plotter9015.createRegions(2, 2);
-        plotter9016.createRegions(2, 2);
-        plotter9017.createRegions(2, 2);
-        threetrack.createRegion();
-
-//        twotrackFrame.addPlotter(plotter9000);
-//        twotrackFrame.addPlotter(plotter9001);
-//        twotrackFrame.addPlotter(plotter9002);
-//        twotrackFrame.addPlotter(plotter9003);
-//        twotrackFrame.addPlotter(plotter9004);
-//        twotrackFrame.addPlotter(plotter9005);
-//        twotrackFrame.addPlotter(plotter9006);
-//        twotrackFrame.addPlotter(plotter9007);
-//        twotrackFrame.addPlotter(plotter9008);
-//        twotrackFrame.addPlotter(plotter9009);
-//        twotrackFrame.addPlotter(plotter9010);
-//        twotrackFrame.addPlotter(plotter9011);
-//        twotrackFrame.addPlotter(plotter9012);
-        //   twotrackFrame.addPlotter(plotter9013);
-        //  twotrackFrame.addPlotter(plotter9014);
-//        twotrackFrame.addPlotter(plotter9015);
-//        twotrackFrame.addPlotter(plotter9016);
-//        twotrackFrame.addPlotter(plotter9017);
-//        twotrackFrame.addPlotter(twotrkextra2);
-//        twotrackFrame.addPlotter(threetrack);
-
-        IHistogram1D trkbins = aida.histogram1D("Track Distributions", 5, -2, 3);
-        IHistogram2D twtrkptot = aida.histogram2D("Total P+ vs. P-", 60, 0, 4, 60, 0, 4);
-        IHistogram1D sumtrks = aida.histogram1D("Sum of Track's Momentums", 100, -1, 7);
-        IHistogram1D invarmass = aida.histogram1D("Invariant Mass", 50, 0, .2);
-        IHistogram1D perptrks = aida.histogram1D("Perpendicular Momentum", 100, 0, .1);
-        IHistogram2D pyppm = aida.histogram2D("Py+ vs. Py-", 60, -.1, .1, 60, -.1, .1);
-        IHistogram2D pzppm = aida.histogram2D("Pz+ vs. Pz-", 60, -.1, .1, 60, -.1, .1);
-        IHistogram1D px = aida.histogram1D("Two Track X Momentum", 40, 0, 4);
-        IHistogram1D py = aida.histogram1D("Two Track Y Momentum", 40, -.1, .1);
-        IHistogram1D pz = aida.histogram1D("Two Track Z Momentum", 40, -.1, .1);
-        IHistogram1D chi2 = aida.histogram1D("Tracks Chi2", 25, 0, 25.0);
-        IHistogram1D bbpx = aida.histogram1D("Big Bump Track Momenta (Px)", 40, 0, 4);
-        IHistogram1D bbpy = aida.histogram1D("Big Bump Track Momenta (Py)", 40, -.1, .1);
-        IHistogram1D bbpz = aida.histogram1D("Big Bump Track Momenta (Pz)", 40, -.1, .1);
-        IHistogram1D bbchi2 = aida.histogram1D("Big Bump Tracks Chi2", 25, 0, 25.0);
-        IHistogram1D spx = aida.histogram1D("Split Track Momenta (Px)", 40, 0, 4);
-        IHistogram1D spy = aida.histogram1D("Split Track Momenta (Py)", 40, -.1, .1);
-        IHistogram1D spz = aida.histogram1D("Split Track Momenta (Pz)", 40, -.1, .1);
-        IHistogram1D schi2 = aida.histogram1D("Split Tracks Chi2", 25, 0, 25.0);
-        IHistogram1D bbsumtrks = aida.histogram1D("Big Bump Sum of Track's Momentums", 50, -1, 7);
-        IHistogram2D bbpppm = aida.histogram2D("Big Bump P+ vs. P-", 50, 0, 4, 50, 0, 4);
-        IHistogram2D lbpppm = aida.histogram2D("Little Bump P+ vs. P-", 50, 0, 4, 50, 0, 4);
-        IHistogram1D lbsumtrks = aida.histogram1D("Little Bump Sum of Track's Momentums", 50, -1, 7);
-        IHistogram1D lbpx = aida.histogram1D("Little Bump Track Momenta (Px)", 40, 0, 4);
-        IHistogram1D lbpy = aida.histogram1D("Little Bump Track Momenta (Py)", 40, -.1, .1);
-        IHistogram1D lbpz = aida.histogram1D("Little Bump Track Momenta (Pz)", 40, -.1, .1);
-        IHistogram1D lbchi2 = aida.histogram1D("Little Bump Tracks Chi2", 25, 0, 25.0);
-        //     IHistogram1D q0spx = aida.histogram1D("Net Charge 0 Split Track Momenta (Px)", 40, 0, 4);
-        //     IHistogram1D q0spy = aida.histogram1D("Net Charge 0 Split Track Momenta (Py)", 40, -.1, .1);
-        //     IHistogram1D q0spz = aida.histogram1D("Net Charge 0 Split Track Momenta (Pz)", 40, -.1, .1);
-        //     IHistogram1D q0schi2 = aida.histogram1D("Net Charge 0 Split Tracks Chi2", 25, 0, 25.0);
-        IHistogram2D xyemt = aida.histogram2D("X v Y - e- Top", 50, -30, 50, 50, -35, 30);
-        IHistogram2D xzemt = aida.histogram2D("X v Z - e- Top", 50, -30, 50, 50, -800, -450);
-        IHistogram2D yzemt = aida.histogram2D("Y v Z - e- Top", 50, -35, 30, 50, -800, -450);
-        IHistogram1D qbins = aida.histogram1D("Charge Distributions", 5, -2, 3);
-        IHistogram1D lbtp = aida.histogram1D("Little Bump Track Parity", 7, 0, 7);
-        IHistogram1D bbtp = aida.histogram1D("Big Bump Track Parity", 7, 0, 7);
-        IHistogram1D xvert = aida.histogram1D("XVertex", 40, -30, 50);
-        IHistogram1D yvert = aida.histogram1D("YVertex", 40, -35, 30);
-        IHistogram1D zvert = aida.histogram1D("ZVertex", 40, -800, -450);
-        IHistogram1D dist = aida.histogram1D("Distance btwn Trks @ Solution", 40, 0, 20);
-        IHistogram1D xres = aida.histogram1D("X Res Trk1", 40, -0.25, 0.25);
-        IHistogram1D yres = aida.histogram1D("Y Res Trk1", 40, -0.25, 0.25);
-        IHistogram1D xres2 = aida.histogram1D("X Res Trk2", 40, -0.25, 0.25);
-        IHistogram1D yres2 = aida.histogram1D("Y Res Trk2", 40, -0.25, 0.25);
-        IHistogram1D unx1 = aida.histogram1D("Uncert X Trk 1", 50, 0, 10);
-        IHistogram1D uny1 = aida.histogram1D("Uncert Y Trk 1", 50, 0, 10);
-        IHistogram1D unz1 = aida.histogram1D("Uncert Z Trk 1", 50, 0, 40);
-        IHistogram1D unx2 = aida.histogram1D("Uncert X Trk 2", 50, 0, 10);
-        IHistogram1D uny2 = aida.histogram1D("Uncert Y Trk 2", 50, 0, 10);
-        IHistogram1D unz2 = aida.histogram1D("Uncert Z Trk 2", 50, 0, 40);
-        IHistogram2D xy = aida.histogram2D("X v Y", 50, -30, 50, 50, -35, 30);
-        IHistogram2D xz = aida.histogram2D("X v Z", 50, -30, 50, 50, -800, -450);
-        IHistogram2D yz = aida.histogram2D("Y v Z", 50, -35, 30, 50, -800, -450);
-        IHistogram2D xyept = aida.histogram2D("X v Y - e+ Top", 50, -30, 50, 50, -35, 30);
-        IHistogram2D xzept = aida.histogram2D("X v Z - e+ Top", 50, -30, 50, 50, -800, -450);
-        IHistogram2D yzept = aida.histogram2D("Y v Z - e+ Top", 50, -35, 30, 50, -800, -450);
-        IHistogram1D three = aida.histogram1D("Three Track Invariant Mass", 50, 0, .4);
-
-        //twotrackFrame.pack();
-        //twotrackFrame.setVisible(true);
-
-        plotter9000.region(0).plot(trkbins);
-        plotter9001.region(0).plot(twtrkptot);
-        plotter9002.region(0).plot(sumtrks);
-        plotter9002.region(1).plot(invarmass);
-        plotter9003.region(0).plot(perptrks);
-        plotter9004.region(0).plot(pyppm);
-        plotter9005.region(0).plot(pzppm);
-        plotter9006.region(0).plot(xy);
-        plotter9006.region(1).plot(xz);
-        plotter9006.region(2).plot(yz);
-        plotter9007.region(0).plot(xyemt);
-        plotter9007.region(1).plot(xzemt);
-        plotter9007.region(2).plot(yzemt);
-        plotter9007.region(3).plot(xyept);
-        plotter9007.region(4).plot(xzept);
-        plotter9007.region(5).plot(yzept);
-        plotter9008.region(0).plot(px);
-        plotter9008.region(1).plot(py);
-        plotter9008.region(2).plot(pz);
-        plotter9008.region(3).plot(chi2);
-        plotter9009.region(0).plot(bbpx);
-        plotter9009.region(1).plot(bbpy);
-        plotter9009.region(2).plot(bbpz);
-        plotter9009.region(3).plot(bbchi2);
-        plotter9010.region(0).plot(spx);
-        plotter9010.region(1).plot(spy);
-        plotter9010.region(2).plot(spz);
-        plotter9010.region(3).plot(schi2);
-        plotter9011.region(0).plot(bbsumtrks);
-        plotter9011.region(1).plot(bbpppm);
-        plotter9011.region(2).plot(lbpppm);
-        plotter9011.region(3).plot(lbsumtrks);
-        plotter9012.region(0).plot(lbpx);
-        plotter9012.region(1).plot(lbpy);
-        plotter9012.region(2).plot(lbpz);
-        plotter9012.region(3).plot(lbchi2);
-        //    plotter9013.region(0).plot(q0spx);
-        //    plotter9013.region(1).plot(q0spy);
-        //    plotter9013.region(2).plot(q0spz);
-        //    plotter9013.region(3).plot(q0schi2);
-        plotter9015.region(0).plot(qbins);
-        plotter9015.region(1).plot(lbtp);
-        plotter9015.region(2).plot(bbtp);
-        plotter9016.region(0).plot(xvert);
-        plotter9016.region(1).plot(yvert);
-        plotter9016.region(2).plot(zvert);
-        plotter9016.region(3).plot(dist);
-        plotter9017.region(0).plot(xres);
-        plotter9017.region(1).plot(yres);
-        plotter9017.region(2).plot(xres2);
-        plotter9017.region(3).plot(yres2);
-
-        twotrkextra2.region(0).plot(unx1);
-        twotrkextra2.region(1).plot(uny1);
-        twotrkextra2.region(2).plot(unz1);
-        twotrkextra2.region(3).plot(unx2);
-        twotrkextra2.region(4).plot(uny2);
-        twotrkextra2.region(5).plot(unz2);
-        threetrack.region(0).plot(three);
-
-
-
-    }
-
-    public ElwinsTrackingRecon() {
-    }
-
-    public void setOutputPlots(String output) {
-        this.outputPlots = output;
-    }
-
-    public void setRawTrackerHitCollectionName(String rawTrackerHitCollectionName) {
-        this.rawTrackerHitCollectionName = rawTrackerHitCollectionName;
-    }
-
-    public void setFittedTrackerHitCollectionName(String fittedTrackerHitCollectionName) {
-        this.fittedTrackerHitCollectionName = fittedTrackerHitCollectionName;
-    }
-
-    public void setTrackerHitCollectionName(String trackerHitCollectionName) {
-        this.trackerHitCollectionName = trackerHitCollectionName;
-    }
-
-    public void setHelicalTrackHitCollectionName(String helicalTrackHitCollectionName) {
-        this.helicalTrackHitCollectionName = helicalTrackHitCollectionName;
-    }
-
-    public void setTrackCollectionName(String trackCollectionName) {
-        this.trackCollectionName = trackCollectionName;
-    }
-
-    public void process(EventHeader event) {
-        aida.tree().cd("/");
-        if (!event.hasCollection(HelicalTrackHit.class, helicalTrackHitCollectionName)) {
-            //       System.out.println(helicalTrackHitCollectionName + " does not exist; skipping event");
-            return;
-        }
-        if (event.get(Track.class, trackCollectionName).size() < 2) {
-            //    System.out.println(trackCollectionName + " has less than two tracks; skipping event");
-            return;
-        }
-
-        List<HelicalTrackHit> rotList = event.get(HelicalTrackHit.class, rotatedTrackHitCollectionName);
-        for (HelicalTrackHit hth : rotList) {
-            HelicalTrackCross htc = (HelicalTrackCross) hth;
-//            System.out.println("TrackingReconstructionPlots::original helical track position = "+hth.getPosition()[0]+","+hth.getPosition()[1]+","+hth.getPosition()[2]);
-//            System.out.println("TrackingReconstructionPlots::corrected helical track position = "+htc.getCorrectedPosition().toString());
-        }
-
-        List<HelicalTrackHit> hthList = event.get(HelicalTrackHit.class, helicalTrackHitCollectionName);
-        int[] layersTop = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
-        int[] layersBot = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
-        for (HelicalTrackHit hth : hthList) {
-            HelicalTrackCross htc = (HelicalTrackCross) hth;
-//            System.out.println("TrackingReconstructionPlots::original helical track position = "+hth.getPosition()[0]+","+hth.getPosition()[1]+","+hth.getPosition()[2]);
-//            System.out.println("TrackingReconstructionPlots::corrected helical track position = "+htc.getCorrectedPosition().toString());
-            //These Helical Track Hits are in the JLAB frame
-//            htc.resetTrackDirection();
-            double x = htc.getPosition()[0];
-            double y = htc.getPosition()[1];
-            SiSensor sensor = ((SiSensor) ((RawTrackerHit) htc.getRawHits().get(0)).getDetectorElement());
-            if (SvtUtils.getInstance().isTopLayer(sensor)) {
-                layersTop[htc.Layer() - 1]++;
-                Hep3Vector sensorPos = ((SiSensor) ((RawTrackerHit) htc.getRawHits().get(0)).getDetectorElement()).getGeometry().getPosition();
-                if (htc.Layer() == 1) {
-//                    System.out.println(sensorPos.toString());
-//                    System.out.println("Hit X = " + x + "; Hit Y = " + y);
-//                    aida.histogram2D("Layer 1 HTH Position:  Top").fill(x - sensorPos.x(), y - sensorPos.y());
-                }
-//                if (htc.Layer() == 7)
-//                    aida.histogram2D("Layer 7 HTH Position:  Top").fill(x - sensorPos.x(), y - sensorPos.y());
-            } else {
-                layersBot[htc.Layer() - 1]++;
-                Hep3Vector sensorPos = ((SiSensor) ((RawTrackerHit) htc.getRawHits().get(0)).getDetectorElement()).getGeometry().getPosition();
-                if (htc.Layer() == 1) {
-//                    System.out.println(sensorPos.toString());
-//                    System.out.println("Hit X = " + x + "; Hit Y = " + y);
-//                    aida.histogram2D("Layer 1 HTH Position:  Bottom").fill(x - sensorPos.x(), y - sensorPos.y());
-                }
-//                if (htc.Layer() == 7)
-//                    aida.histogram2D("Layer 7 HTH Position:  Bottom").fill(x - sensorPos.x(), y - sensorPos.y());
-            }
-        }
-
-        if (!event.hasCollection(Track.class, trackCollectionName)) {
-//            System.out.println(trackCollectionName + " does not exist; skipping event");
-            //      aida.histogram1D("Number Tracks/Event").fill(0);
-            return;
-        }
-
-
-        List<Track> tracks = event.get(Track.class, trackCollectionName);
-        nTracks.fill(tracks.size());
-
-
-        if (tracks.size() == 2) { //uncert can be used here  && (Ytrue || Ytrue2) && (Xtrue || Xtrue2)
-
-            Track trk1 = tracks.get(0);
-            Track trk2 = tracks.get(1);
-            int isTrk1Top = -1;
-            if (trk1.getTrackerHits().get(0).getPosition()[2] > 0) {
-                isTrk1Top = 1;
-            }
-            int isTrk2Top = -1;
-            if (trk2.getTrackerHits().get(0).getPosition()[2] > 0) {
-                isTrk2Top = 1;
-            }
-            boolean topbot = false;
-            if ((isTrk1Top + isTrk2Top) == 0) {
-                topbot = true;
-            }
-
-            SeedTrack stEle1 = (SeedTrack) trk1;
-            SeedCandidate seedEle1 = stEle1.getSeedCandidate();
-            HelicalTrackFit ht1 = seedEle1.getHelix();
-            HelixConverter converter1 = new HelixConverter(0);
-            StraightLineTrack slt1 = converter1.Convert(ht1);
-
-            SeedTrack stEle2 = (SeedTrack) trk2;
-            SeedCandidate seedEle2 = stEle2.getSeedCandidate();
-            HelicalTrackFit ht2 = seedEle2.getHelix();
-            HelixConverter converter2 = new HelixConverter(0);
-            StraightLineTrack slt2 = converter2.Convert(ht2);
-
-            HPSTrack hpstrack1 = new HPSTrack(ht1);
-            Hep3Vector[] trkatconver1 = hpstrack1.getPositionAtZMap(100, BeamlineConstants.HARP_POSITION_TESTRUN, 1);
-            HPSTrack hpstrack2 = new HPSTrack(ht2);
-            Hep3Vector[] trkatconver2 = hpstrack2.getPositionAtZMap(100, BeamlineConstants.HARP_POSITION_TESTRUN, 1);
-
-
-
-            List<TrackerHit> hitsOnTrack1 = trk1.getTrackerHits();
-            int layer1;
-            double y1 = 0;
-            double y2 = 0;
-            double z1 = 0;
-            double z2 = 0;
-            double dely1 = 0;
-            double dely2 = 0;
-            for (TrackerHit hit : hitsOnTrack1) {
-                HelicalTrackHit htc1 = (HelicalTrackHit) hit;
-                layer1 = htc1.Layer();
-                int y1layer = 0;
-                int y2layer = 0;
-                if (y1 == 0) {
-                    y1 = htc1.getPosition()[2]; //
-                    z1 = htc1.getPosition()[0]; // z1 is jlab but the get position refers to hps-tracking
-                    y1layer = layer1;
-                    SymmetricMatrix ErrorHitOne = htc1.getCorrectedCovMatrix();
-                    dely1 = Math.sqrt(ErrorHitOne.diagonal(2)); //y in jlab is z in hps
-                } else {
-
-                    if ((layer1 > y1layer) && (y2layer == 0)) {
-                        y2 = htc1.getPosition()[2]; //
-                        z2 = htc1.getPosition()[0]; // see above comments!
-                        y2layer = layer1;
-                        SymmetricMatrix ErrorHitTwo = htc1.getCorrectedCovMatrix();
-                        dely2 = Math.sqrt(ErrorHitTwo.diagonal(2));
-                    }
-
-                }
-
-            }
-            List<TrackerHit> hitsOnTrack2 = trk2.getTrackerHits();
-
-            double my1 = 0;
-            double my2 = 0;
-            double mz1 = 0;
-            double mz2 = 0;
-            double delymy1 = 0;
-            double delymy2 = 0;
-            int layer2;
-            for (TrackerHit hit : hitsOnTrack2) {
-                HelicalTrackHit htc2 = (HelicalTrackHit) hit;
-//            if (htc.getPosition()[2] < 0) {
-
-                layer2 = htc2.Layer();
-                int my1layer = 0;
-                int my2layer = 0;
-                if (my1 == 0) {
-                    my1 = htc2.getPosition()[2]; //see above comments
-                    mz1 = htc2.getPosition()[0];
-                    my1layer = layer2;
-                    SymmetricMatrix ErrorHitOne = htc2.getCorrectedCovMatrix();
-                    delymy1 = Math.sqrt(ErrorHitOne.diagonal(2));
-                } else {
-                    if ((layer2 > my1layer) && (my2layer == 0)) {
-                        my2 = htc2.getPosition()[2];
-                        mz2 = htc2.getPosition()[0];
-                        my2layer = layer2;
-                        SymmetricMatrix ErrorHitTwo = htc2.getCorrectedCovMatrix();
-                        delymy2 = Math.sqrt(ErrorHitTwo.diagonal(2));
-                    }
-                }
-            }
-            //   double dely = .00001; //mm
-            double b1;
-            double m1;
-            double b2;
-            double m2;
-            boolean check1 = true;
-            if (y1 == 0) {
-                check1 = false;
-            }
-            boolean check2 = true;
-            if (my1 == 0) {
-                check2 = false;
-            }
-            boolean check3 = true;
-            if (my2 == 0) {
-                check3 = false;
-            }
-
-
-
-
-            double X1 = slt1.getYZAtX(BeamlineConstants.HARP_POSITION_TESTRUN)[0];
-            double Y1 = slt1.getYZAtX(BeamlineConstants.HARP_POSITION_TESTRUN)[1];
-
-            //   boolean Y1top = false;
-            //    boolean X1plus = false;
-            //     boolean Y1bot = false;
-            //      boolean X1minus = false;
-            boolean X1cent = false;
-            boolean Y1cent = false; //for simulation
-
-            if (11 < X1 && X1 < 29) {
-                X1cent = true;
-            }
-            if (-3.5 < Y1 && Y1 < 3.5) {
-                Y1cent = true;
-            }
-
-            //    if (1 < Y1 && Y1 < 6) { //1 < Y1 && Y1 < 6 +-2.5
-            //       Y1top = true;
-            //  }
-            //     if (11 < X1 && X1 < 29) { // 4 < X1 && X1 < 16 +-6
-            //           X1minus = true;
-            //      }
-            //        if (-5 < Y1 && Y1 < 0) { // -5 < Y1 && Y1 < 0 +-2.5
-            //           Y1bot = true;
-            //      }
-            //       if (11 < X1 && X1 < 29) { // 24 < X1 && X1 < 36 +-6
-            //          X1plus = true;
-            //     }
-            double X2 = slt2.getYZAtX(BeamlineConstants.HARP_POSITION_TESTRUN)[0];
-            double Y2 = slt2.getYZAtX(BeamlineConstants.HARP_POSITION_TESTRUN)[1];
-
-            //      boolean Y2top = false; //for data
-            //     boolean X2plus = false;
-            //    boolean Y2bot = false; //in general
-            //      boolean X2minus = false;
-            boolean X2cent = false;
-            boolean Y2cent = false; //for simulation
-            if (11 < X2 && X2 < 29) {
-                X2cent = true;
-            }
-            if (-3.5 < Y2 && Y2 < 3.5) {
-                Y2cent = true;
-            }
-            //       if (1 < Y2 && Y2 < 6) {
-            //          Y2top = true;
-            //     }
-            //      if (11 < X2 && X2 < 29) {
-            //           X2minus = true;
-            //      }
-            //   if (-5 < Y2 && Y2 < 0) {
-            //      Y2bot = true;
-            // }
-            //       if (11 < X2 && X2 < 29) {
-            //           X2plus = true;
-            //       }
-
-
-            //      boolean Trk1Top = false;
-            //     boolean Trk2Top = false;
-            //    boolean Trk1Bot = false;
-            //   boolean Trk2Bot = false;
-            //  if (isTrk1Top == 1) {
-            //             Trk1Top = true;
-            //       }
-            //     if (isTrk2Top == 1) {
-            //       Trk2Top = true;
-            //         }
-            //       if (isTrk1Top == -1) {
-            //         Trk1Bot = true;
-            //   }
-            //  if (isTrk2Top == -1) {
-            //    Trk2Bot = true;
-            //      }
-            //  boolean Trk1goodTop = false;
-            //   boolean Trk2goodTop = false;
-            // boolean Trk1goodBot = false;
-            //   boolean Trk2goodBot = false;
-            //      if (Trk1Top && Y1top) {
-            //         Trk1goodTop = true;
-            //    }
-            //   if (Trk2Top && Y2top) {
-            //            Trk2goodTop = true;
-            //   }
-            //   if (Trk1Bot && Y1bot) {
-            //      Trk1goodBot = true;
-            //   }
-            //   if (Trk2Bot && Y2bot) {
-            //      Trk2goodBot = true;
-            //  }
-
-            int qtrk1 = trk1.getCharge();
-            int qtrk2 = trk2.getCharge();
-            boolean pm = false;
-            if ((qtrk1 + qtrk2) == 0) {
-                pm = true;
-            }
-
-            //   boolean Trk1Plus = false;
-            //    boolean Trk2Plus = false;
-            //      boolean Trk1Minus = false;
-            //       boolean Trk2Minus = false;
-            //       if (qtrk1 > 0) {
-            //           Trk1Plus = true;
-            //        } else {
-            //             Trk1Minus = true;
-            //        }
-            //       if (qtrk2 > 0) {
-            //           Trk2Plus = true;
-            //      } else {
-            //          Trk2Minus = true;
-            //     }
-
-            //    boolean Trk1goodPlus = false;
-            //     boolean Trk2goodPlus = false;
-            //     boolean Trk1goodMinus = false;
-            //    boolean Trk2goodMinus = false;
-
-            //       if (Trk1Plus && X1plus) {
-            //          Trk1goodPlus = true;
-            //       }
-            //       if (Trk2Plus && X2plus) {
-            //           Trk2goodPlus = true;
-            //        }
-            //       if (Trk1Minus && X1minus) {
-            //        Trk1goodMinus = true;
-            //       }
-            //        if (Trk2Minus && X2minus) {
-            //          Trk2goodMinus = true;
-            //       }
-            if (topbot && pm) {
-
-                double b1p;
-                double b2p;
-                double m1p;
-                double m2p;
-
-                if (check1 && check2 && check3) {
-                    if (isTrk1Top == 1) {
-                        double zc = -1 * z1 / (z2 - z1);
-                        b1 = (zc * (y2 - y1 + .5 * (dely2 + dely1))) + y1 - (.5 * dely1);
-                        m1 = (y2 - y1 + .5 * (dely2 + dely1)) / (z2 - z1);
-                        m1p = (y2 - y1 - .5 * (dely2 + dely1)) / (z2 - z1);
-                        b1p = y1 - (m1p * z1) + (.5 * dely1);
-                    } else {
-                        double zc = -1 * z1 / (z2 - z1);
-                        b1 = (zc * (y2 - y1 - .5 * (dely2 + dely1))) + y1 + (.5 * dely1);
-                        m1 = (y2 - y1 - .5 * (dely2 + dely1)) / (z2 - z1);
-                        m1p = (y2 - y1 + .5 * (dely2 + dely1)) / (z2 - z1);
-                        b1p = y1 - (m1p * z1) - (.5 * dely1);
-                    }
-
-                    if (isTrk2Top == 1) {
-                        double zc = -1 * mz1 / (mz2 - mz1);
-                        b2 = (zc * (my2 - my1 + .5 * (delymy2 + delymy1))) + my1 - (.5 * delymy1);
-                        m2 = (my2 - my1 + .5 * (delymy2 + delymy1)) / (mz2 - mz1);
-                        m2p = (my2 - my1 - .5 * (delymy2 + delymy1)) / (mz2 - mz1);
-                        b2p = my1 - (m2p * mz1) + (.5 * delymy1);
-                    } else {
-                        double zc = -1 * mz1 / (mz2 - mz1);
-                        b2 = (zc * (my2 - my1 - .5 * (delymy2 + delymy1))) + my1 + (.5 * delymy1);
-                        m2 = (my2 - my1 - .5 * (delymy2 + delymy1)) / (mz2 - mz1);
-                        m2p = (my2 - my1 + .5 * (delymy2 + delymy1)) / (mz2 - mz1);
-                        b2p = my1 - (m2p * mz1) - (.5 * delymy1);
-                    }
-                    //    System.out.println("y1 = " + y1);
-                    //    System.out.println("y2 = " + y2);
-                    //    System.out.println("y'1 = " + my1);
-                    //    System.out.println("y'2 = " + my2);
-                    double zi = (b2 - b1) / (m1 - m2);
-                    double zr = Math.abs(zi - BeamlineConstants.HARP_POSITION_TESTRUN);
-                    double zs = 2 * zr / 100;
-                    //      System.out.println("Closest Possible Z to Tracker");
-                    //      System.out.println(zi);
-
-
-                    List<double[]> Trk1 = new ArrayList<double[]>();
-                    for (int i = 0; i < 100; i++) {
-                        double z = BeamlineConstants.HARP_POSITION_TESTRUN - zr + (zs * i);
-                        double[] posvec = new double[3];
-                        Hep3Vector[] trk1atz = hpstrack1.getPositionAtZMap(100, z, 1);
-                        posvec[0] = trk1atz[0].x();
-                        posvec[1] = trk1atz[0].y();
-                        posvec[2] = z;
-
-                        Trk1.add(posvec);
-                    }
-                    //  System.out.println("Vectors ");
-
-                    //  System.out.println(Trk1);
-
-                    double xbar = 0;
-                    double ybar = 0;
-                    double zbar = 0;
-                    double xsqbar = 0;
-                    double ysqbar = 0;
-                    double zsqbar = 0;
-                    int n = 0;
-                    for (double[] inttrk : Trk1) {
-                        //      System.out.println(inttrk[0]);
-                        //    System.out.println(inttrk[1]);
-                        //    System.out.println(inttrk[2]);
-                        xbar = xbar + inttrk[0];
-                        ybar = ybar + inttrk[1];
-                        zbar = zbar + inttrk[2];
-                        n = n + 1;
-                    }
-                    //   System.out.println("n " + n);
-                    xbar = xbar / n;
-                    ybar = ybar / n;
-                    zbar = zbar / n;
-                    //    System.out.println("Xbar is " + xbar);
-                    //    System.out.println("Ybar is " + ybar);
-                    //    System.out.println("Zbar is " + zbar);
-                    Matrix d;
-                    Matrix A = Matrix.random(n, 3);
-                    int j1 = 0;
-                    for (double[] inttrk : Trk1) {
-                        A.set(j1, 0, inttrk[0] - xbar);
-                        A.set(j1, 1, inttrk[1] - ybar);
-                        A.set(j1, 2, inttrk[2] - zbar);
-                        j1++;
-                    }
-
-                    //           System.out.println("Matrix A");
-                    //           A.print(9, 6);
-                    A.svd();
-                    SingularValueDecomposition s = A.svd();
-                    Matrix S = s.getS();
-                    //         System.out.println("S Matrix");
-                    //         S.print(9, 6);
-                    Matrix V = s.getV();
-                    //         System.out.println("V Matrix");
-                    //         V.print(9, 6);
-                    d = V.getMatrix(0, 2, 0, 0);
-                    double[] dd;
-                    dd = new double[3];
-
-                    dd[0] = d.get(0, 0);
-                    dd[1] = d.get(1, 0);
-                    dd[2] = d.get(2, 0);
-                    double nd = Math.sqrt((Math.pow(dd[0], 2)) + (Math.pow(dd[1], 2)) + (Math.pow(dd[2], 2)));
-
-                    for (double[] inttrk : Trk1) {
-                        double t1 = (inttrk[2] - zbar) / dd[2];
-                        double restrk1[];
-                        restrk1 = new double[3];
-                        restrk1[0] = xbar + (t1) * dd[0] - inttrk[0];
-                        restrk1[1] = ybar + (t1) * dd[1] - inttrk[1];
-                        restrk1[2] = zbar + (t1) * dd[2] - inttrk[2];
-                        aida.histogram1D("X Res Trk1").fill(restrk1[0]);
-                        aida.histogram1D("Y Res Trk1").fill(restrk1[1]);
-                    }
-
-                    List<double[]> Trk2 = new ArrayList<double[]>();
-                    for (int i = 0; i < 100; i++) {
-                        double z = BeamlineConstants.HARP_POSITION_TESTRUN - zr + (zs * i);
-                        double[] posvec2 = new double[3];
-                        Hep3Vector[] trk2atz = hpstrack2.getPositionAtZMap(100, z, 1);
-                        posvec2[0] = trk2atz[0].x();
[truncated at 1000 lines; 573 more skipped]

java/branches/hps-java_HPSJAVA-88/users/src/main/java/org/hps/users/mgraham
ExamplePlotter.java 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/users/src/main/java/org/hps/users/mgraham/ExamplePlotter.java	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/users/src/main/java/org/hps/users/mgraham/ExamplePlotter.java	2014-10-06 19:40:35 UTC (rev 1140)
@@ -105,7 +105,7 @@
             try {
                 aida.saveAs(outputPlots);
             } catch (IOException ex) {
-                Logger.getLogger(ElwinsTrackingRecon.class.getName()).log(Level.SEVERE, null, ex);
+                Logger.getLogger(ExamplePlotter.class.getName()).log(Level.SEVERE, null, ex);
             }
         }
     }

java/branches/hps-java_HPSJAVA-88/users/src/main/java/org/hps/users/mgraham
TwoTrackAnalysis.java 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/users/src/main/java/org/hps/users/mgraham/TwoTrackAnalysis.java	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/users/src/main/java/org/hps/users/mgraham/TwoTrackAnalysis.java	2014-10-06 19:40:35 UTC (rev 1140)
@@ -981,7 +981,7 @@
             try {
                 aida.saveAs(outputPlots);
             } catch (IOException ex) {
-                Logger.getLogger(ElwinsTrackingRecon.class.getName()).log(Level.SEVERE, null, ex);
+                Logger.getLogger(TwoTrackAnalysis.class.getName()).log(Level.SEVERE, null, ex);
             }
         }
     }

java/branches/hps-java_HPSJAVA-88/users/src/main/java/org/hps/users/phansson
TrackingGeometryChecker.java 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/users/src/main/java/org/hps/users/phansson/TrackingGeometryChecker.java	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/users/src/main/java/org/hps/users/phansson/TrackingGeometryChecker.java	2014-10-06 19:40:35 UTC (rev 1140)
@@ -1,7 +1,14 @@
 package org.hps.users.phansson;
 
+import java.util.ArrayList;
 import java.util.List;
 
+import org.hps.conditions.deprecated.SvtUtils;
+import org.lcsim.detector.IDetectorElement;
+import org.lcsim.detector.identifier.IIdentifier;
+import org.lcsim.detector.identifier.IIdentifierHelper;
+import org.lcsim.detector.tracker.silicon.SiSensor;
+import org.lcsim.detector.tracker.silicon.SiTrackerIdentifierHelper;
 import org.lcsim.event.EventHeader;
 import org.lcsim.event.SimTrackerHit;
 import org.lcsim.geometry.Detector;
@@ -24,6 +31,57 @@
 	
 	protected void detectorChanged(Detector arg0) {
 		super.detectorChanged(arg0);
+		
+		 // Get all of the sensors composing the SVT and add them to the set of all sensors
+        IDetectorElement detectorElement = arg0.getDetectorElement().findDetectorElement("Tracker");
+        IIdentifierHelper helper = detectorElement.getIdentifierHelper();
+        List<SiSensor> sensors = new ArrayList<SiSensor>();
+		sensors.addAll(detectorElement.findDescendants(SiSensor.class));
+        System.out.printf("%s: Total number of sensors: %d\n",getClass().getSimpleName(), sensors.size());
+
+        IIdentifier sensorIdent;
+        SiTrackerIdentifierHelper sensorHelper;
+        String description;
+        // Loop through all of the sensors and fill the maps
+        for (SiSensor sensor : sensors) {
+
+            // Get the sensor identifier
+            sensorIdent = sensor.getIdentifier();
+
+            // Get the sensor identifier helper in order to decode the id fields
+            sensorHelper = (SiTrackerIdentifierHelper) sensor.getIdentifierHelper();
+
+            // Get the sensor layer and module id
+            int layerNumber = sensorHelper.getLayerValue(sensorIdent);
+            int moduleNumber = sensorHelper.getModuleValue(sensorIdent);
+            int sideNumber = sensorHelper.getSideValue(sensorIdent);
+            int sensorNumber = sensorHelper.getSensorValue(sensorIdent);
+            int elecNumber = sensorHelper.getElectrodeValue(sensorIdent);
+            
+            System.out.printf("%s: Sensor name %s\n",getClass().getSimpleName(), sensor.getName());
+            System.out.printf("%s: Sensor position %s\n",getClass().getSimpleName(), sensor.getGeometry().getPosition().toString());
+            System.out.printf("%s: Sensor is %s %s \n",getClass().getSimpleName(), SvtUtils.getInstance().isTopLayer(sensor)?"top":"bottom", SvtUtils.getInstance().isAxial(sensor)?"axial":"stereo");
+            System.out.printf("%s: layerNumber %d\n",getClass().getSimpleName(), layerNumber);
+            System.out.printf("%s: moduleNumber %d\n",getClass().getSimpleName(), moduleNumber);
+            System.out.printf("%s: sideNumber %d\n",getClass().getSimpleName(), sideNumber);
+            System.out.printf("%s: sensorNumber %d\n",getClass().getSimpleName(), sensorNumber);
+            System.out.printf("%s: elecNumber %d\n",getClass().getSimpleName(), elecNumber);
+            System.out.printf("%s: DE mother lists:\n",getClass().getSimpleName(), elecNumber);
+            IDetectorElement m = sensor;
+            int im=0;
+            while((m=m.getParent()) != null) {
+            	System.out.printf("%s: DE mother %d name %s\n",getClass().getSimpleName(), im, m.getName());
+            	if(m.hasGeometryInfo()) {
+            		System.out.printf("%s: DE mother %d pos  %s\n",getClass().getSimpleName(), im, m.getGeometry().getPosition().toString());
+            	} else {
+            		System.out.printf("%s: DE mother - no geom info - \n",getClass().getSimpleName(), im);            		
+            	}
+                im++;
+            }
+
+            
+        }
+		
 	}
 	
 	protected void startOfData() {
@@ -59,6 +117,8 @@
 		System.out.printf("\nSimTrackerHit:\n");
 		System.out.printf("\t position: %s\n",simTrackerHit.getPositionVec().toString());
 		System.out.printf("\t DetectorElement: %s\n",simTrackerHit.getDetectorElement().getName());
+		System.out.printf("\t DetectorElement position: %s\n",simTrackerHit.getDetectorElement().getGeometry().getPosition().toString());
+		System.out.printf("\t PhysVol name at position: %s\n",simTrackerHit.getDetectorElement().getGeometry().getPhysicalVolume(simTrackerHit.getPositionVec()).getName());
 	}
 }
 

java/branches/hps-java_HPSJAVA-88/users/src/test/java/org/hps/users/ngraf
RotationMatrixTest.java 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/users/src/test/java/org/hps/users/ngraf/RotationMatrixTest.java	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/users/src/test/java/org/hps/users/ngraf/RotationMatrixTest.java	2014-10-06 19:40:35 UTC (rev 1140)
@@ -42,8 +42,8 @@
         Vector3D axisZ = new Vector3D(0., 0., 1.);
 
         double alpha1 = PI / 4.;
-        double alpha2 = PI / 3.;
-        double alpha3 = PI / 2.;
+        double alpha2 = PI / 4.;
+        double alpha3 = 0.;
 
         //set up a rotation by alpha1 about the X axis
         Rotation r1 = new Rotation(axisX, alpha1);

java/branches/hps-java_HPSJAVA-88/util
pom.xml 1139 -> 1140
--- java/branches/hps-java_HPSJAVA-88/util/pom.xml	2014-10-06 16:07:35 UTC (rev 1139)
+++ java/branches/hps-java_HPSJAVA-88/util/pom.xml	2014-10-06 19:40:35 UTC (rev 1140)
@@ -1,34 +1,24 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-    
     <modelVersion>4.0.0</modelVersion>
     <artifactId>hps-util</artifactId>
     <name>util</name>
     <description>miscellaneous utility classes</description>
-    
     <parent>
         <groupId>org.hps</groupId>
         <artifactId>hps-parent</artifactId>
         <relativePath>../parent/pom.xml</relativePath>
         <version>3.0.3-SNAPSHOT</version>
     </parent>
-    
     <scm>
         <url>http://java.freehep.org/svn/repos/hps/list/java/trunk/util/</url>
         <connection>scm:svn:svn://svn.freehep.org/hps/java/trunk/util/</connection>
         <developerConnection>scm:svn:svn://svn.freehep.org/hps/java/trunk/util/</developerConnection>
     </scm>
-
     <dependencies>
         <dependency>
-            <groupId>org.lcsim</groupId>
-            <artifactId>lcsim-distribution</artifactId>
-            <version>${lcsimVersion}</version>
-        </dependency>
-        <dependency>
             <groupId>org.apache.commons</groupId>
             <artifactId>commons-math3</artifactId>
             <version>3.2</version>
         </dependency>
     </dependencies>
-    
 </project>
SVNspam 0.1