Print

Print


Author: [log in to unmask]
Date: Mon Nov  3 01:04:28 2014
New Revision: 1421

Log:
Merge trunk changes through r1420 into hps_java_trunk_HPSJAVA-255.  This is the final merge before attempting to merge into the trunk.

Added:
    java/branches/hps_java_trunk_HPSJAVA-255/conditions/src/main/java/org/hps/conditions/cli/
      - copied from r1420, java/trunk/conditions/src/main/java/org/hps/conditions/cli/
    java/branches/hps_java_trunk_HPSJAVA-255/detector-data/detectors/HPSTestRunTracker2014-v0-test1/
      - copied from r1420, java/trunk/detector-data/detectors/HPSTestRunTracker2014-v0-test1/
    java/branches/hps_java_trunk_HPSJAVA-255/ecal-event-display/src/main/java/org/hps/monitoring/ecal/eventdisplay/ui/DataFileViewer.java
      - copied unchanged from r1420, java/trunk/ecal-event-display/src/main/java/org/hps/monitoring/ecal/eventdisplay/ui/DataFileViewer.java
    java/branches/hps_java_trunk_HPSJAVA-255/ecal-event-display/src/main/java/org/hps/monitoring/ecal/eventdisplay/ui/PDataEventViewer.java
      - copied unchanged from r1420, java/trunk/ecal-event-display/src/main/java/org/hps/monitoring/ecal/eventdisplay/ui/PDataEventViewer.java
    java/branches/hps_java_trunk_HPSJAVA-255/ecal-event-display/src/main/java/org/hps/monitoring/ecal/eventdisplay/ui/ResizableFieldPanel.java
      - copied unchanged from r1420, java/trunk/ecal-event-display/src/main/java/org/hps/monitoring/ecal/eventdisplay/ui/ResizableFieldPanel.java
    java/branches/hps_java_trunk_HPSJAVA-255/ecal-event-display/src/main/java/org/hps/monitoring/ecal/eventdisplay/util/CrystalDataSet.java
      - copied unchanged from r1420, java/trunk/ecal-event-display/src/main/java/org/hps/monitoring/ecal/eventdisplay/util/CrystalDataSet.java
    java/branches/hps_java_trunk_HPSJAVA-255/ecal-event-display/src/main/java/org/hps/monitoring/ecal/eventdisplay/util/EcalWiringManager.java
      - copied unchanged from r1420, java/trunk/ecal-event-display/src/main/java/org/hps/monitoring/ecal/eventdisplay/util/EcalWiringManager.java
    java/branches/hps_java_trunk_HPSJAVA-255/integration-tests/src/test/java/org/hps/DataQualityMonitorTest.java
      - copied unchanged from r1420, java/trunk/integration-tests/src/test/java/org/hps/DataQualityMonitorTest.java
    java/branches/hps_java_trunk_HPSJAVA-255/integration-tests/src/test/resources/org/hps/steering/test/DataQualityTest.lcsim
      - copied unchanged from r1420, java/trunk/integration-tests/src/test/resources/org/hps/steering/test/DataQualityTest.lcsim
    java/branches/hps_java_trunk_HPSJAVA-255/steering-files/src/main/resources/org/hps/steering/users/phansson/TestRunOfflineRecon.lcsim
      - copied unchanged from r1420, java/trunk/steering-files/src/main/resources/org/hps/steering/users/phansson/TestRunOfflineRecon.lcsim
    java/branches/hps_java_trunk_HPSJAVA-255/tracking/src/main/java/org/hps/recon/tracking/nobfield/StraightTrack2DFitter.java
      - copied unchanged from r1420, java/trunk/tracking/src/main/java/org/hps/recon/tracking/nobfield/StraightTrack2DFitter.java
    java/branches/hps_java_trunk_HPSJAVA-255/tracking/src/main/java/org/hps/recon/tracking/nobfield/StraightTrackConfirmerExtender.java
      - copied unchanged from r1420, java/trunk/tracking/src/main/java/org/hps/recon/tracking/nobfield/StraightTrackConfirmerExtender.java
    java/branches/hps_java_trunk_HPSJAVA-255/tracking/src/main/java/org/hps/recon/tracking/nobfield/StraightTrackFitter.java
      - copied unchanged from r1420, java/trunk/tracking/src/main/java/org/hps/recon/tracking/nobfield/StraightTrackFitter.java
    java/branches/hps_java_trunk_HPSJAVA-255/tracking/src/main/java/org/hps/recon/tracking/nobfield/StraightTrackReconDriver.java
      - copied unchanged from r1420, java/trunk/tracking/src/main/java/org/hps/recon/tracking/nobfield/StraightTrackReconDriver.java
    java/branches/hps_java_trunk_HPSJAVA-255/tracking/src/main/java/org/hps/recon/tracking/nobfield/StraightTracker.java
      - copied unchanged from r1420, java/trunk/tracking/src/main/java/org/hps/recon/tracking/nobfield/StraightTracker.java
    java/branches/hps_java_trunk_HPSJAVA-255/tracking/src/main/java/org/hps/svt/alignment/BuildMillepedeCompact.java
      - copied unchanged from r1420, java/trunk/tracking/src/main/java/org/hps/svt/alignment/BuildMillepedeCompact.java
    java/branches/hps_java_trunk_HPSJAVA-255/users/src/main/java/org/hps/users/luca/TruthReader.java
      - copied unchanged from r1420, java/trunk/users/src/main/java/org/hps/users/luca/TruthReader.java
    java/branches/hps_java_trunk_HPSJAVA-255/users/src/main/java/org/hps/users/phansson/TrackingReconstructionPlots.java
      - copied unchanged from r1420, java/trunk/users/src/main/java/org/hps/users/phansson/TrackingReconstructionPlots.java
Removed:
    java/branches/hps_java_trunk_HPSJAVA-255/conditions/src/test/java/org/hps/conditions/ecal/EcalDaqTest.java
    java/branches/hps_java_trunk_HPSJAVA-255/tracking/src/main/java/org/hps/recon/tracking/nobfield/HitOnTrackChecker.java
    java/branches/hps_java_trunk_HPSJAVA-255/tracking/src/main/java/org/hps/recon/tracking/nobfield/StraightTrack.java
    java/branches/hps_java_trunk_HPSJAVA-255/tracking/src/main/java/org/hps/recon/tracking/nobfield/TrackChecker.java
    java/branches/hps_java_trunk_HPSJAVA-255/tracking/src/main/java/org/hps/recon/tracking/nobfield/TrackCollectionUtilities.java
Modified:
    java/branches/hps_java_trunk_HPSJAVA-255/   (props changed)
    java/branches/hps_java_trunk_HPSJAVA-255/analysis/pom.xml
    java/branches/hps_java_trunk_HPSJAVA-255/analysis/src/main/java/org/hps/analysis/examples/TrackAnalysis.java
    java/branches/hps_java_trunk_HPSJAVA-255/conditions/   (props changed)
    java/branches/hps_java_trunk_HPSJAVA-255/conditions/pom.xml
    java/branches/hps_java_trunk_HPSJAVA-255/conditions/src/main/java/org/hps/conditions/DatabaseConditionsManager.java
    java/branches/hps_java_trunk_HPSJAVA-255/conditions/src/main/java/org/hps/conditions/QueryBuilder.java
    java/branches/hps_java_trunk_HPSJAVA-255/conditions/src/test/java/org/hps/conditions/ecal/PhysicalToGainTest.java
    java/branches/hps_java_trunk_HPSJAVA-255/detector-data/detectors/HPSTestRunTracker2014-v0/HPSTestRunTracker2014-v0.lcdd
    java/branches/hps_java_trunk_HPSJAVA-255/detector-data/detectors/HPSTestRunTracker2014-v0/compact.xml
    java/branches/hps_java_trunk_HPSJAVA-255/detector-data/pom.xml
    java/branches/hps_java_trunk_HPSJAVA-255/distribution/   (props changed)
    java/branches/hps_java_trunk_HPSJAVA-255/distribution/pom.xml
    java/branches/hps_java_trunk_HPSJAVA-255/ecal-event-display/pom.xml
    java/branches/hps_java_trunk_HPSJAVA-255/ecal-event-display/src/main/java/org/hps/monitoring/ecal/eventdisplay/ui/ActiveViewer.java
    java/branches/hps_java_trunk_HPSJAVA-255/ecal-event-display/src/main/java/org/hps/monitoring/ecal/eventdisplay/ui/ClusterViewer.java
    java/branches/hps_java_trunk_HPSJAVA-255/ecal-event-display/src/main/java/org/hps/monitoring/ecal/eventdisplay/ui/FileViewer.java
    java/branches/hps_java_trunk_HPSJAVA-255/ecal-event-display/src/main/java/org/hps/monitoring/ecal/eventdisplay/ui/OccupancyViewer.java
    java/branches/hps_java_trunk_HPSJAVA-255/ecal-event-display/src/main/java/org/hps/monitoring/ecal/eventdisplay/ui/PEventViewer.java
    java/branches/hps_java_trunk_HPSJAVA-255/ecal-event-display/src/main/java/org/hps/monitoring/ecal/eventdisplay/ui/POccupancyViewer.java
    java/branches/hps_java_trunk_HPSJAVA-255/ecal-event-display/src/main/java/org/hps/monitoring/ecal/eventdisplay/ui/PassiveViewer.java
    java/branches/hps_java_trunk_HPSJAVA-255/ecal-event-display/src/main/java/org/hps/monitoring/ecal/eventdisplay/ui/StatusPanel.java
    java/branches/hps_java_trunk_HPSJAVA-255/ecal-readout-sim/pom.xml
    java/branches/hps_java_trunk_HPSJAVA-255/ecal-readout-sim/src/main/java/org/hps/readout/ecal/FADCPrimaryTriggerDriver.java
    java/branches/hps_java_trunk_HPSJAVA-255/ecal-readout-sim/src/main/java/org/hps/readout/ecal/MollerTriggerDriver.java
    java/branches/hps_java_trunk_HPSJAVA-255/ecal-recon/pom.xml
    java/branches/hps_java_trunk_HPSJAVA-255/evio/pom.xml
    java/branches/hps_java_trunk_HPSJAVA-255/integration-tests/   (props changed)
    java/branches/hps_java_trunk_HPSJAVA-255/integration-tests/pom.xml
    java/branches/hps_java_trunk_HPSJAVA-255/integration-tests/src/test/java/org/hps/HPSTestRunTracker2014GeometryTrackReconTest.java
    java/branches/hps_java_trunk_HPSJAVA-255/integration-tests/src/test/java/org/hps/SimpleSvtReadoutTest.java
    java/branches/hps_java_trunk_HPSJAVA-255/monitoring-app/pom.xml
    java/branches/hps_java_trunk_HPSJAVA-255/monitoring-app/src/main/java/org/hps/monitoring/gui/MonitoringApplication.java
    java/branches/hps_java_trunk_HPSJAVA-255/monitoring-app/src/main/java/org/hps/monitoring/subsys/SystemStatusImpl.java
    java/branches/hps_java_trunk_HPSJAVA-255/monitoring-drivers/pom.xml
    java/branches/hps_java_trunk_HPSJAVA-255/monitoring-drivers/src/main/java/org/hps/monitoring/drivers/example/DummyErrorDriver.java
    java/branches/hps_java_trunk_HPSJAVA-255/parent/pom.xml
    java/branches/hps_java_trunk_HPSJAVA-255/plugin/pom.xml
    java/branches/hps_java_trunk_HPSJAVA-255/pom.xml
    java/branches/hps_java_trunk_HPSJAVA-255/recon/pom.xml
    java/branches/hps_java_trunk_HPSJAVA-255/recon/src/main/java/org/hps/recon/particle/HpsReconParticleDriver.java
    java/branches/hps_java_trunk_HPSJAVA-255/recon/src/main/java/org/hps/recon/particle/ReconParticleDriver.java
    java/branches/hps_java_trunk_HPSJAVA-255/recon/src/main/java/org/hps/recon/particle/TestRunReconParticleDriver.java
    java/branches/hps_java_trunk_HPSJAVA-255/record-util/pom.xml
    java/branches/hps_java_trunk_HPSJAVA-255/steering-files/pom.xml
    java/branches/hps_java_trunk_HPSJAVA-255/steering-files/src/main/resources/org/hps/steering/monitoring/DummyError.lcsim
    java/branches/hps_java_trunk_HPSJAVA-255/tracking/pom.xml
    java/branches/hps_java_trunk_HPSJAVA-255/tracking/src/main/java/org/hps/recon/tracking/MultipleScattering.java
    java/branches/hps_java_trunk_HPSJAVA-255/tracking/src/main/java/org/hps/recon/tracking/nobfield/StraightTrackFinder.java
    java/branches/hps_java_trunk_HPSJAVA-255/tracking/src/main/java/org/hps/svt/alignment/BuildCompact.java
    java/branches/hps_java_trunk_HPSJAVA-255/tracking/src/test/java/org/hps/recon/tracking/TrackRecoFromScratchTest.java   (contents, props changed)
    java/branches/hps_java_trunk_HPSJAVA-255/users/pom.xml
    java/branches/hps_java_trunk_HPSJAVA-255/users/src/main/java/org/hps/users/luca/FEETrigger.java
    java/branches/hps_java_trunk_HPSJAVA-255/users/src/main/java/org/hps/users/luca/RawDataReader.java
    java/branches/hps_java_trunk_HPSJAVA-255/users/src/main/java/org/hps/users/mgraham/StraightTrackAnalysis.java
    java/branches/hps_java_trunk_HPSJAVA-255/util/pom.xml

Modified: java/branches/hps_java_trunk_HPSJAVA-255/analysis/pom.xml
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/analysis/pom.xml	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/analysis/pom.xml	Mon Nov  3 01:04:28 2014
@@ -8,7 +8,7 @@
         <groupId>org.hps</groupId>
         <artifactId>hps-parent</artifactId>
         <relativePath>../parent/pom.xml</relativePath>
-        <version>3.0.3-SNAPSHOT</version>
+        <version>3.1-SNAPSHOT</version>
     </parent>
     <scm>
         <url>http://java.freehep.org/svn/repos/hps/list/java/trunk/analysis/</url>

Modified: java/branches/hps_java_trunk_HPSJAVA-255/analysis/src/main/java/org/hps/analysis/examples/TrackAnalysis.java
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/analysis/src/main/java/org/hps/analysis/examples/TrackAnalysis.java	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/analysis/src/main/java/org/hps/analysis/examples/TrackAnalysis.java	Mon Nov  3 01:04:28 2014
@@ -97,9 +97,6 @@
         _hasLayerOne = false;
         //  Loop over the hits on the track and make sure we have HelicalTrackHits (which contain the MC particle)
         for (TrackerHit hit : trk.getTrackerHits()) {
-            HelicalTrackHit htc = (HelicalTrackHit) hit;
-            if (htc.Detector().equals("BeamSpot"))
-                continue;
 
             //  get the set of MCParticles associated with this hit and update the hit count for each MCParticle
             Set<MCParticle> mclist = hittomc.allFrom(hit);
@@ -115,7 +112,7 @@
                 countHit((HelicalTrackCross) hit);
             else if (hit instanceof HelicalTrack2DHit)
                 countHit((HelicalTrack2DHit) hit);
-            else
+            else if (!(hit  instanceof HelicalTrack2DHit )) //probably SOITrackerHit
                 countHit(hit, rthtosimhit, hittostrip, hittorotated);
         }
 

Modified: java/branches/hps_java_trunk_HPSJAVA-255/conditions/pom.xml
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/conditions/pom.xml	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/conditions/pom.xml	Mon Nov  3 01:04:28 2014
@@ -8,7 +8,7 @@
         <groupId>org.hps</groupId>
         <artifactId>hps-parent</artifactId>
         <relativePath>../parent/pom.xml</relativePath>
-        <version>3.0.3-SNAPSHOT</version>
+        <version>3.1-SNAPSHOT</version>
     </parent>
     <scm>
         <url>http://java.freehep.org/svn/repos/hps/list/java/trunk/conditions/</url>

Modified: java/branches/hps_java_trunk_HPSJAVA-255/conditions/src/main/java/org/hps/conditions/DatabaseConditionsManager.java
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/conditions/src/main/java/org/hps/conditions/DatabaseConditionsManager.java	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/conditions/src/main/java/org/hps/conditions/DatabaseConditionsManager.java	Mon Nov  3 01:04:28 2014
@@ -26,8 +26,6 @@
 import org.lcsim.conditions.ConditionsConverter;
 import org.lcsim.conditions.ConditionsManager;
 import org.lcsim.conditions.ConditionsManagerImplementation;
-import org.lcsim.conditions.ConditionsReader;
-import org.lcsim.conditions.readers.BaseClasspathConditionsReader;
 import org.lcsim.geometry.Detector;
 import org.lcsim.util.loop.DetectorConditionsConverter;
 
@@ -269,6 +267,33 @@
         logger.fine("new collection ID " + collectionId + " created for table " + tableName);
         return collectionId;
     }
+    
+    /**
+     * This method will return true if the given collection ID already exists in the table.
+     * @param tableName The name of the table.
+     * @param collectionID The collection ID value.
+     * @return True if collection exists.
+     */
+    public boolean collectionExists(String tableName, int collectionID) {
+        String sql = "SELECT * FROM " + tableName + " where collection_id = " + collectionID;
+        ResultSet resultSet = selectQuery(sql);
+        try {
+            resultSet.last();
+        } catch (SQLException e) {
+            e.printStackTrace();
+        }
+        int rowCount = 0;
+        try {
+            rowCount = resultSet.getRow();
+        } catch (SQLException e) {
+            e.printStackTrace();
+        }
+        if (rowCount != 0) {
+            return true;
+        } else {
+            return false;
+        }
+    }
 
     /**
      * Get the list of table meta data.
@@ -297,6 +322,7 @@
      * @param type The collection class.
      * @return The table meta data.
      */
+    // FIXME: This should return a list in case of multiple conditions defined with same type.
     public TableMetaData findTableMetaData(Class type) {
         for (TableMetaData meta : tableMetaData) {
             if (meta.getCollectionClass().equals(type)) {

Modified: java/branches/hps_java_trunk_HPSJAVA-255/conditions/src/main/java/org/hps/conditions/QueryBuilder.java
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/conditions/src/main/java/org/hps/conditions/QueryBuilder.java	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/conditions/src/main/java/org/hps/conditions/QueryBuilder.java	Mon Nov  3 01:04:28 2014
@@ -1,16 +1,18 @@
 package org.hps.conditions;
+
+import java.util.List;
 
 /**
  * This is a static utility class for building SQL queries for the conditions system.
  * 
  * @author Jeremy McCormick <[log in to unmask]>
  */
-final class QueryBuilder {
+public final class QueryBuilder {
 
     private QueryBuilder() {
     }
 
-    static String buildSelect(String tableName, int collectionId, String[] fields, String order) {
+    public static String buildSelect(String tableName, int collectionId, String[] fields, String order) {
         StringBuffer buff = new StringBuffer();
         buff.append("SELECT ");
         if (fields == null) {
@@ -32,7 +34,7 @@
         return buff.toString();
     }
 
-    static String buildUpdate(String tableName, int rowId, String[] fields, Object[] values) {
+    public static String buildUpdate(String tableName, int rowId, String[] fields, Object[] values) {
         if (fields.length != values.length)
             throw new IllegalArgumentException("The field and value arrays are different lengths.");
         StringBuffer buff = new StringBuffer();
@@ -45,7 +47,7 @@
         return buff.toString();
     }
 
-    static String buildInsert(String tableName, int collectionId, String[] fields, Object[] values) {
+    public static String buildInsert(String tableName, int collectionId, String[] fields, Object[] values) {
         if (fields.length != values.length)
             throw new IllegalArgumentException("The field and value arrays are different lengths.");
         StringBuffer buff = new StringBuffer();
@@ -60,12 +62,31 @@
         buff.append(") ");
         return buff.toString();
     }
+    
+    public static String buildInsert(String tableName, int collectionID, List<String> columnNames, List<List<String>> rows) {
+        StringBuffer buff = new StringBuffer();
+        buff.append("INSERT INTO " + tableName + " ( collection_id");
+        for (String column : columnNames) {
+            buff.append(", " + column);
+        }
+        buff.append(" ) VALUES ");
+        for (List<String> values : rows) {
+            buff.append("( ");
+            buff.append(collectionID);
+            for (String value : values) {
+                buff.append(", '" + value + "'");
+            }
+            buff.append("), ");
+        }        
+        buff.setLength(buff.length() - 2);
+        return buff.toString();
+    }
+    
 
-    static String buildDelete(String tableName, int rowId) {
+    public static String buildDelete(String tableName, int rowId) {
         if (rowId <= 0)
             throw new IllegalArgumentException("Invalid row ID: " + rowId);
         String query = "DELETE FROM " + tableName + " WHERE id = " + rowId;
         return query;
-    }
-
+    }        
 }

Modified: java/branches/hps_java_trunk_HPSJAVA-255/conditions/src/test/java/org/hps/conditions/ecal/PhysicalToGainTest.java
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/conditions/src/test/java/org/hps/conditions/ecal/PhysicalToGainTest.java	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/conditions/src/test/java/org/hps/conditions/ecal/PhysicalToGainTest.java	Mon Nov  3 01:04:28 2014
@@ -25,8 +25,6 @@
  * This is a simple example of how to retrieve the gain and noise by physical ID (X,Y) in
  * the ECAL.
  * @author Jeremy McCormick <[log in to unmask]>
- * 
- * @version $Id$
  * 
  */
 public class PhysicalToGainTest extends TestCase {

Modified: java/branches/hps_java_trunk_HPSJAVA-255/detector-data/detectors/HPSTestRunTracker2014-v0/HPSTestRunTracker2014-v0.lcdd
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/detector-data/detectors/HPSTestRunTracker2014-v0/HPSTestRunTracker2014-v0.lcdd	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/detector-data/detectors/HPSTestRunTracker2014-v0/HPSTestRunTracker2014-v0.lcdd	Mon Nov  3 01:04:28 2014
@@ -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="../../hps-java/detector-data/detectors/HPSTestRunTracker2014-v0/compact.xml" checksum="1324664074" />
+    <generator name="GeomConverter" version="1.0" file="compact.xml" checksum="3588067236" />
     <author name="NONE" />
     <comment>new SVT test run geometry</comment>
   </header>
@@ -130,275 +130,273 @@
       <constant name="tracking_region_zmax" value="1318.0" />
       <constant name="ecal_back" value="8.0" />
       <constant name="dipoleMagnetHeight" value="177.8" />
-      <position name="beamPlaneVol_position" x="0.0" y="4.999999999999999E-9" z="1.1368683772161603E-13" unit="mm" />
-      <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.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.030004635148837874" unit="radian" />
+      <position name="support_plate_bottom_position" x="-103.25405804451009" y="-95.60825753895904" z="-65.19999999999999" unit="mm" />
+      <rotation name="support_plate_bottom_rotation" x="0.0" y="-0.0" z="-0.030004635148837944" 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.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" />
+      <rotation name="support_plate_top_rotation" x="0.0" y="-0.0" z="-0.030004635148837944" unit="radian" />
+      <position name="module_L1b_position" x="-44.47602421588735" y="199.33784811297414" z="-20.85" unit="mm" />
+      <rotation name="module_L1b_rotation" x="0.0" y="-0.0" z="-0.030004635148837944" 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="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
+      <rotation name="module_L1b_halfmodule_axial_rotation" x="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
+      <position name="module_L1b_halfmodule_axial_sensor_position" x="3.414999999999999" y="30.0" z="0.48375" unit="mm" />
+      <rotation name="module_L1b_halfmodule_axial_sensor_rotation" x="0.0" y="-0.0" z="0.0" 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" />
+      <position name="module_L1b_halfmodule_axial_lamination_position" x="2.414999999999999" y="0.5" z="0.66875" unit="mm" />
       <rotation name="module_L1b_halfmodule_axial_lamination_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
-      <position name="module_L1b_halfmodule_axial_cf_position" x="0.0" y="0.8187500000000001" z="-1.0850000000000009" unit="mm" />
+      <position name="module_L1b_halfmodule_axial_cf_position" x="-1.0850000000000009" y="0.0" z="0.8187500000000001" unit="mm" />
       <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" />
+      <position name="module_L1b_halfmodule_axial_hybrid_position" x="3.414999999999999" y="-55.0" z="-0.1499999999999999" 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_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="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
+      <rotation name="module_L1b_halfmodule_stereo_rotation" x="-1.5707963267948963" y="5.551115123125783E-17" z="1.4707963267948965" unit="radian" />
+      <position name="module_L1b_halfmodule_stereo_sensor_position" x="3.414999999999999" y="30.0" z="0.48375" unit="mm" />
+      <rotation name="module_L1b_halfmodule_stereo_sensor_rotation" x="0.0" y="-0.0" z="0.0" 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" />
+      <position name="module_L1b_halfmodule_stereo_lamination_position" x="2.414999999999999" y="0.5" z="0.66875" unit="mm" />
       <rotation name="module_L1b_halfmodule_stereo_lamination_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
-      <position name="module_L1b_halfmodule_stereo_cf_position" x="0.0" y="0.8187500000000001" z="-1.0850000000000009" unit="mm" />
+      <position name="module_L1b_halfmodule_stereo_cf_position" x="-1.0850000000000009" y="0.0" z="0.8187500000000001" unit="mm" />
       <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" />
+      <position name="module_L1b_halfmodule_stereo_hybrid_position" x="3.414999999999999" y="-55.0" z="-0.1499999999999999" 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="-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_position" x="-44.92602621486762" y="214.3310965335438" z="18.85000000000001" unit="mm" />
+      <rotation name="module_L1t_rotation" x="3.141592653589793" y="-0.0" z="0.030004635148837944" 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="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
+      <rotation name="module_L1t_halfmodule_axial_rotation" x="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
+      <position name="module_L1t_halfmodule_axial_sensor_position" x="3.414999999999999" y="30.0" z="0.48375" unit="mm" />
+      <rotation name="module_L1t_halfmodule_axial_sensor_rotation" x="0.0" y="-0.0" z="0.0" 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" />
+      <position name="module_L1t_halfmodule_axial_lamination_position" x="2.414999999999999" y="0.5" z="0.66875" unit="mm" />
       <rotation name="module_L1t_halfmodule_axial_lamination_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
-      <position name="module_L1t_halfmodule_axial_cf_position" x="0.0" y="0.8187500000000001" z="-1.0850000000000009" unit="mm" />
+      <position name="module_L1t_halfmodule_axial_cf_position" x="-1.0850000000000009" y="0.0" z="0.8187500000000001" unit="mm" />
       <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" />
+      <position name="module_L1t_halfmodule_axial_hybrid_position" x="3.414999999999999" y="-55.0" z="-0.1499999999999999" 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_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="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
+      <rotation name="module_L1t_halfmodule_stereo_rotation" x="-1.5707963267948963" y="5.551115123125783E-17" z="1.4707963267948965" unit="radian" />
+      <position name="module_L1t_halfmodule_stereo_sensor_position" x="3.414999999999999" y="30.0" z="0.48375" unit="mm" />
+      <rotation name="module_L1t_halfmodule_stereo_sensor_rotation" x="0.0" y="-0.0" z="0.0" 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" />
+      <position name="module_L1t_halfmodule_stereo_lamination_position" x="2.414999999999999" y="0.5" z="0.66875" unit="mm" />
       <rotation name="module_L1t_halfmodule_stereo_lamination_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
-      <position name="module_L1t_halfmodule_stereo_cf_position" x="0.0" y="0.8187500000000001" z="-1.0850000000000009" unit="mm" />
+      <position name="module_L1t_halfmodule_stereo_cf_position" x="-1.0850000000000009" y="0.0" z="0.8187500000000001" unit="mm" />
       <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" />
+      <position name="module_L1t_halfmodule_stereo_hybrid_position" x="3.414999999999999" y="-55.0" z="-0.1499999999999999" 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="-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_position" x="-41.47601088935227" y="99.38285864250997" z="-22.35" unit="mm" />
+      <rotation name="module_L2b_rotation" x="0.0" y="-0.0" z="-0.030004635148837944" 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="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
+      <rotation name="module_L2b_halfmodule_axial_rotation" x="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
+      <position name="module_L2b_halfmodule_axial_sensor_position" x="3.414999999999999" y="30.0" z="0.48375" unit="mm" />
+      <rotation name="module_L2b_halfmodule_axial_sensor_rotation" x="0.0" y="-0.0" z="0.0" 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" />
+      <position name="module_L2b_halfmodule_axial_lamination_position" x="2.414999999999999" y="0.5" z="0.66875" unit="mm" />
       <rotation name="module_L2b_halfmodule_axial_lamination_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
-      <position name="module_L2b_halfmodule_axial_cf_position" x="0.0" y="0.8187500000000001" z="-1.0850000000000009" unit="mm" />
+      <position name="module_L2b_halfmodule_axial_cf_position" x="-1.0850000000000009" y="0.0" z="0.8187500000000001" unit="mm" />
       <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" />
+      <position name="module_L2b_halfmodule_axial_hybrid_position" x="3.414999999999999" y="-55.0" z="-0.1499999999999999" 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_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="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
+      <rotation name="module_L2b_halfmodule_stereo_rotation" x="-1.5707963267948963" y="5.551115123125783E-17" z="1.4707963267948965" unit="radian" />
+      <position name="module_L2b_halfmodule_stereo_sensor_position" x="3.414999999999999" y="30.0" z="0.48375" unit="mm" />
+      <rotation name="module_L2b_halfmodule_stereo_sensor_rotation" x="0.0" y="-0.0" z="0.0" 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" />
+      <position name="module_L2b_halfmodule_stereo_lamination_position" x="2.414999999999999" y="0.5" z="0.66875" unit="mm" />
       <rotation name="module_L2b_halfmodule_stereo_lamination_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
-      <position name="module_L2b_halfmodule_stereo_cf_position" x="0.0" y="0.8187500000000001" z="-1.0850000000000009" unit="mm" />
+      <position name="module_L2b_halfmodule_stereo_cf_position" x="-1.0850000000000009" y="0.0" z="0.8187500000000001" unit="mm" />
       <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" />
+      <position name="module_L2b_halfmodule_stereo_hybrid_position" x="3.414999999999999" y="-55.0" z="-0.1499999999999999" 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="-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_position" x="-41.92601288833254" y="114.37610706307953" z="20.35000000000001" unit="mm" />
+      <rotation name="module_L2t_rotation" x="3.141592653589793" y="-0.0" z="0.030004635148837944" 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="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
+      <rotation name="module_L2t_halfmodule_axial_rotation" x="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
+      <position name="module_L2t_halfmodule_axial_sensor_position" x="3.414999999999999" y="30.0" z="0.48375" unit="mm" />
+      <rotation name="module_L2t_halfmodule_axial_sensor_rotation" x="0.0" y="-0.0" z="0.0" 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" />
+      <position name="module_L2t_halfmodule_axial_lamination_position" x="2.414999999999999" y="0.5" z="0.66875" unit="mm" />
       <rotation name="module_L2t_halfmodule_axial_lamination_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
-      <position name="module_L2t_halfmodule_axial_cf_position" x="0.0" y="0.8187500000000001" z="-1.0850000000000009" unit="mm" />
+      <position name="module_L2t_halfmodule_axial_cf_position" x="-1.0850000000000009" y="0.0" z="0.8187500000000001" unit="mm" />
       <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" />
+      <position name="module_L2t_halfmodule_axial_hybrid_position" x="3.414999999999999" y="-55.0" z="-0.1499999999999999" 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_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="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
+      <rotation name="module_L2t_halfmodule_stereo_rotation" x="-1.5707963267948963" y="5.551115123125783E-17" z="1.4707963267948965" unit="radian" />
+      <position name="module_L2t_halfmodule_stereo_sensor_position" x="3.414999999999999" y="30.0" z="0.48375" unit="mm" />
+      <rotation name="module_L2t_halfmodule_stereo_sensor_rotation" x="0.0" y="-0.0" z="0.0" 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" />
+      <position name="module_L2t_halfmodule_stereo_lamination_position" x="2.414999999999999" y="0.5" z="0.66875" unit="mm" />
       <rotation name="module_L2t_halfmodule_stereo_lamination_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
-      <position name="module_L2t_halfmodule_stereo_cf_position" x="0.0" y="0.8187500000000001" z="-1.0850000000000009" unit="mm" />
+      <position name="module_L2t_halfmodule_stereo_cf_position" x="-1.0850000000000009" y="0.0" z="0.8187500000000001" unit="mm" />
       <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" />
+      <position name="module_L2t_halfmodule_stereo_hybrid_position" x="3.414999999999999" y="-55.0" z="-0.1499999999999999" 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="-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_position" x="-38.475997562817184" y="-0.5721308279543109" z="-23.85" unit="mm" />
+      <rotation name="module_L3b_rotation" x="0.0" y="-0.0" z="-0.030004635148837944" 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="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
+      <rotation name="module_L3b_halfmodule_axial_rotation" x="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
+      <position name="module_L3b_halfmodule_axial_sensor_position" x="3.414999999999999" y="30.0" z="0.48375" unit="mm" />
+      <rotation name="module_L3b_halfmodule_axial_sensor_rotation" x="0.0" y="-0.0" z="0.0" 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" />
+      <position name="module_L3b_halfmodule_axial_lamination_position" x="2.414999999999999" y="0.5" z="0.66875" unit="mm" />
       <rotation name="module_L3b_halfmodule_axial_lamination_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
-      <position name="module_L3b_halfmodule_axial_cf_position" x="0.0" y="0.8187500000000001" z="-1.0850000000000009" unit="mm" />
+      <position name="module_L3b_halfmodule_axial_cf_position" x="-1.0850000000000009" y="0.0" z="0.8187500000000001" unit="mm" />
       <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" />
+      <position name="module_L3b_halfmodule_axial_hybrid_position" x="3.414999999999999" y="-55.0" z="-0.1499999999999999" 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_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="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
+      <rotation name="module_L3b_halfmodule_stereo_rotation" x="-1.5707963267948963" y="5.551115123125783E-17" z="1.4707963267948965" unit="radian" />
+      <position name="module_L3b_halfmodule_stereo_sensor_position" x="3.414999999999999" y="30.0" z="0.48375" unit="mm" />
+      <rotation name="module_L3b_halfmodule_stereo_sensor_rotation" x="0.0" y="-0.0" z="0.0" 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" />
+      <position name="module_L3b_halfmodule_stereo_lamination_position" x="2.414999999999999" y="0.5" z="0.66875" unit="mm" />
       <rotation name="module_L3b_halfmodule_stereo_lamination_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
-      <position name="module_L3b_halfmodule_stereo_cf_position" x="0.0" y="0.8187500000000001" z="-1.0850000000000009" unit="mm" />
+      <position name="module_L3b_halfmodule_stereo_cf_position" x="-1.0850000000000009" y="0.0" z="0.8187500000000001" unit="mm" />
       <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" />
+      <position name="module_L3b_halfmodule_stereo_hybrid_position" x="3.414999999999999" y="-55.0" z="-0.1499999999999999" 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="-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" />
+      <rotation name="module_L3t_rotation" x="3.141592653589793" y="-0.0" z="0.030004635148837944" unit="radian" />
       <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="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
+      <rotation name="module_L3t_halfmodule_axial_rotation" x="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
+      <position name="module_L3t_halfmodule_axial_sensor_position" x="3.414999999999999" y="30.0" z="0.48375" unit="mm" />
+      <rotation name="module_L3t_halfmodule_axial_sensor_rotation" x="0.0" y="-0.0" z="0.0" 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" />
+      <position name="module_L3t_halfmodule_axial_lamination_position" x="2.414999999999999" y="0.5" z="0.66875" unit="mm" />
       <rotation name="module_L3t_halfmodule_axial_lamination_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
-      <position name="module_L3t_halfmodule_axial_cf_position" x="0.0" y="0.8187500000000001" z="-1.0850000000000009" unit="mm" />
+      <position name="module_L3t_halfmodule_axial_cf_position" x="-1.0850000000000009" y="0.0" z="0.8187500000000001" unit="mm" />
       <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" />
+      <position name="module_L3t_halfmodule_axial_hybrid_position" x="3.414999999999999" y="-55.0" z="-0.1499999999999999" 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_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="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
+      <rotation name="module_L3t_halfmodule_stereo_rotation" x="-1.5707963267948963" y="5.551115123125783E-17" z="1.4707963267948965" unit="radian" />
+      <position name="module_L3t_halfmodule_stereo_sensor_position" x="3.414999999999999" y="30.0" z="0.48375" unit="mm" />
+      <rotation name="module_L3t_halfmodule_stereo_sensor_rotation" x="0.0" y="-0.0" z="0.0" 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" />
+      <position name="module_L3t_halfmodule_stereo_lamination_position" x="2.414999999999999" y="0.5" z="0.66875" unit="mm" />
       <rotation name="module_L3t_halfmodule_stereo_lamination_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
-      <position name="module_L3t_halfmodule_stereo_cf_position" x="0.0" y="0.8187500000000001" z="-1.0850000000000009" unit="mm" />
+      <position name="module_L3t_halfmodule_stereo_cf_position" x="-1.0850000000000009" y="0.0" z="0.8187500000000001" unit="mm" />
       <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" />
+      <position name="module_L3t_halfmodule_stereo_hybrid_position" x="3.414999999999999" y="-55.0" z="-0.1499999999999999" 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="-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_position" x="-32.47597090974702" y="-200.48210976888276" z="-24.35" unit="mm" />
+      <rotation name="module_L4b_rotation" x="0.0" y="-0.0" z="-0.030004635148837944" 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="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
+      <rotation name="module_L4b_halfmodule_axial_rotation" x="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
+      <position name="module_L4b_halfmodule_axial_sensor_position" x="3.414999999999999" y="30.0" z="0.48375" unit="mm" />
+      <rotation name="module_L4b_halfmodule_axial_sensor_rotation" x="0.0" y="-0.0" z="0.0" 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" />
+      <position name="module_L4b_halfmodule_axial_lamination_position" x="2.414999999999999" y="0.5" z="0.66875" unit="mm" />
       <rotation name="module_L4b_halfmodule_axial_lamination_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
-      <position name="module_L4b_halfmodule_axial_cf_position" x="0.0" y="0.8187500000000001" z="-1.0850000000000009" unit="mm" />
+      <position name="module_L4b_halfmodule_axial_cf_position" x="-1.0850000000000009" y="0.0" z="0.8187500000000001" unit="mm" />
       <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" />
+      <position name="module_L4b_halfmodule_axial_hybrid_position" x="3.414999999999999" y="-55.0" z="-0.1499999999999999" 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_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="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
+      <rotation name="module_L4b_halfmodule_stereo_rotation" x="-1.5707963267948963" y="5.551115123125783E-17" z="1.5207963267948965" unit="radian" />
+      <position name="module_L4b_halfmodule_stereo_sensor_position" x="3.414999999999999" y="30.0" z="0.48375" unit="mm" />
+      <rotation name="module_L4b_halfmodule_stereo_sensor_rotation" x="0.0" y="-0.0" z="0.0" 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" />
+      <position name="module_L4b_halfmodule_stereo_lamination_position" x="2.414999999999999" y="0.5" z="0.66875" unit="mm" />
       <rotation name="module_L4b_halfmodule_stereo_lamination_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
-      <position name="module_L4b_halfmodule_stereo_cf_position" x="0.0" y="0.8187500000000001" z="-1.0850000000000009" unit="mm" />
+      <position name="module_L4b_halfmodule_stereo_cf_position" x="-1.0850000000000009" y="0.0" z="0.8187500000000001" unit="mm" />
       <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" />
+      <position name="module_L4b_halfmodule_stereo_hybrid_position" x="3.414999999999999" y="-55.0" z="-0.1499999999999999" 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="-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_position" x="-32.92597290872729" y="-185.4888613483131" z="22.35000000000001" unit="mm" />
+      <rotation name="module_L4t_rotation" x="3.141592653589793" y="-0.0" z="0.030004635148837944" 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="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
+      <rotation name="module_L4t_halfmodule_axial_rotation" x="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
+      <position name="module_L4t_halfmodule_axial_sensor_position" x="3.414999999999999" y="30.0" z="0.48375" unit="mm" />
+      <rotation name="module_L4t_halfmodule_axial_sensor_rotation" x="0.0" y="-0.0" z="0.0" 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" />
+      <position name="module_L4t_halfmodule_axial_lamination_position" x="2.414999999999999" y="0.5" z="0.66875" unit="mm" />
       <rotation name="module_L4t_halfmodule_axial_lamination_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
-      <position name="module_L4t_halfmodule_axial_cf_position" x="0.0" y="0.8187500000000001" z="-1.0850000000000009" unit="mm" />
+      <position name="module_L4t_halfmodule_axial_cf_position" x="-1.0850000000000009" y="0.0" z="0.8187500000000001" unit="mm" />
       <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" />
+      <position name="module_L4t_halfmodule_axial_hybrid_position" x="3.414999999999999" y="-55.0" z="-0.1499999999999999" 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_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="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
+      <rotation name="module_L4t_halfmodule_stereo_rotation" x="-1.5707963267948963" y="5.551115123125783E-17" z="1.5207963267948965" unit="radian" />
+      <position name="module_L4t_halfmodule_stereo_sensor_position" x="3.414999999999999" y="30.0" z="0.48375" unit="mm" />
+      <rotation name="module_L4t_halfmodule_stereo_sensor_rotation" x="0.0" y="-0.0" z="0.0" 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" />
+      <position name="module_L4t_halfmodule_stereo_lamination_position" x="2.414999999999999" y="0.5" z="0.66875" unit="mm" />
       <rotation name="module_L4t_halfmodule_stereo_lamination_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
-      <position name="module_L4t_halfmodule_stereo_cf_position" x="0.0" y="0.8187500000000001" z="-1.0850000000000009" unit="mm" />
+      <position name="module_L4t_halfmodule_stereo_cf_position" x="-1.0850000000000009" y="0.0" z="0.8187500000000001" unit="mm" />
       <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" />
+      <position name="module_L4t_halfmodule_stereo_hybrid_position" x="3.414999999999999" y="-55.0" z="-0.1499999999999999" 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="-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_position" x="-26.475944256676854" y="-400.3920887098111" z="-27.35" unit="mm" />
+      <rotation name="module_L5b_rotation" x="0.0" y="-0.0" z="-0.030004635148837944" 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="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
+      <rotation name="module_L5b_halfmodule_axial_rotation" x="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
+      <position name="module_L5b_halfmodule_axial_sensor_position" x="3.414999999999999" y="30.0" z="0.48375" unit="mm" />
+      <rotation name="module_L5b_halfmodule_axial_sensor_rotation" x="0.0" y="-0.0" z="0.0" 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" />
+      <position name="module_L5b_halfmodule_axial_lamination_position" x="2.414999999999999" y="0.5" z="0.66875" unit="mm" />
       <rotation name="module_L5b_halfmodule_axial_lamination_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
-      <position name="module_L5b_halfmodule_axial_cf_position" x="0.0" y="0.8187500000000001" z="-1.0850000000000009" unit="mm" />
+      <position name="module_L5b_halfmodule_axial_cf_position" x="-1.0850000000000009" y="0.0" z="0.8187500000000001" unit="mm" />
       <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" />
+      <position name="module_L5b_halfmodule_axial_hybrid_position" x="3.414999999999999" y="-55.0" z="-0.1499999999999999" 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_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="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
+      <rotation name="module_L5b_halfmodule_stereo_rotation" x="-1.5707963267948963" y="5.551115123125783E-17" z="1.5207963267948965" unit="radian" />
+      <position name="module_L5b_halfmodule_stereo_sensor_position" x="3.414999999999999" y="30.0" z="0.48375" unit="mm" />
+      <rotation name="module_L5b_halfmodule_stereo_sensor_rotation" x="0.0" y="-0.0" z="0.0" 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" />
+      <position name="module_L5b_halfmodule_stereo_lamination_position" x="2.414999999999999" y="0.5" z="0.66875" unit="mm" />
       <rotation name="module_L5b_halfmodule_stereo_lamination_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
-      <position name="module_L5b_halfmodule_stereo_cf_position" x="0.0" y="0.8187500000000001" z="-1.0850000000000009" unit="mm" />
+      <position name="module_L5b_halfmodule_stereo_cf_position" x="-1.0850000000000009" y="0.0" z="0.8187500000000001" unit="mm" />
       <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" />
+      <position name="module_L5b_halfmodule_stereo_hybrid_position" x="3.414999999999999" y="-55.0" z="-0.1499999999999999" 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="-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" />
+      <rotation name="module_L5t_rotation" x="3.141592653589793" y="-0.0" z="0.030004635148837944" 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="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
+      <rotation name="module_L5t_halfmodule_axial_rotation" x="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
+      <position name="module_L5t_halfmodule_axial_sensor_position" x="3.414999999999999" y="30.0" z="0.48375" unit="mm" />
+      <rotation name="module_L5t_halfmodule_axial_sensor_rotation" x="0.0" y="-0.0" z="0.0" 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" />
+      <position name="module_L5t_halfmodule_axial_lamination_position" x="2.414999999999999" y="0.5" z="0.66875" unit="mm" />
       <rotation name="module_L5t_halfmodule_axial_lamination_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
-      <position name="module_L5t_halfmodule_axial_cf_position" x="0.0" y="0.8187500000000001" z="-1.0850000000000009" unit="mm" />
+      <position name="module_L5t_halfmodule_axial_cf_position" x="-1.0850000000000009" y="0.0" z="0.8187500000000001" unit="mm" />
       <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" />
+      <position name="module_L5t_halfmodule_axial_hybrid_position" x="3.414999999999999" y="-55.0" z="-0.1499999999999999" 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_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="1.5707963267948966" y="-0.0" z="1.5707963267948966" unit="radian" />
+      <rotation name="module_L5t_halfmodule_stereo_rotation" x="-1.5707963267948963" y="5.551115123125783E-17" z="1.5207963267948965" unit="radian" />
+      <position name="module_L5t_halfmodule_stereo_sensor_position" x="3.414999999999999" y="30.0" z="0.48375" unit="mm" />
+      <rotation name="module_L5t_halfmodule_stereo_sensor_rotation" x="0.0" y="-0.0" z="0.0" 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" />
+      <position name="module_L5t_halfmodule_stereo_lamination_position" x="2.414999999999999" y="0.5" z="0.66875" unit="mm" />
       <rotation name="module_L5t_halfmodule_stereo_lamination_rotation" x="0.0" y="-0.0" z="0.0" unit="radian" />
-      <position name="module_L5t_halfmodule_stereo_cf_position" x="0.0" y="0.8187500000000001" z="-1.0850000000000009" unit="mm" />
+      <position name="module_L5t_halfmodule_stereo_cf_position" x="-1.0850000000000009" y="0.0" z="0.8187500000000001" unit="mm" />
       <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" />
+      <position name="module_L5t_halfmodule_stereo_hybrid_position" x="3.414999999999999" y="-55.0" z="-0.1499999999999999" 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" />
@@ -1384,152 +1382,146 @@
     <solids>
       <box name="world_box" x="world_x" y="world_y" z="world_z" />
       <tube name="tracking_cylinder" deltaphi="6.283185307179586" rmin="0.0" rmax="tracking_region_radius" z="2*tracking_region_zmax" />
-      <box name="beamPlaneVolBox" x="385.0" y="2432.0" z="1.0E-8" />
       <box name="baseBox" x="385.0" y="1216.0" z="175.79999999999998" />
       <box name="baseplateBox" x="385.0" y="1216.0" z="6.35" />
       <box name="support_plate_bottomBox" x="120.0" y="736.1" z="12.7" />
       <box name="support_plate_topBox" x="120.0" y="736.1" z="12.7" />
       <box name="module_L1bBox" x="215.2" y="13.5" z="73.3" />
-      <box name="module_L1b_halfmodule_axialBox" x="200.0" y="1.8875" z="47.17" />
+      <box name="module_L1b_halfmodule_axialBox" x="47.17" y="200.0" z="1.8875" />
       <box name="module_L1b_halfmodule_axial_sensorBox" x="40.34" y="100.0" z="0.32" />
       <box name="module_L1b_halfmodule_axial_sensor_activeBox" x="38.3399" y="98.33" z="0.32" />
-      <box name="module_L1b_halfmodule_axial_laminationBox" x="184.0" y="0.05" z="40.0" />
-      <box name="module_L1b_halfmodule_axial_cfBox" x="200.0" y="0.25" z="45.0" />
-      <box name="module_L1b_halfmodule_axial_hybridBox" x="70.0" y="1.5875" z="40.34" />
-      <box name="module_L1b_halfmodule_stereoBox" x="200.0" y="1.8875" z="47.17" />
+      <box name="module_L1b_halfmodule_axial_laminationBox" x="40.0" y="184.0" z="0.05" />
+      <box name="module_L1b_halfmodule_axial_cfBox" x="45.0" y="200.0" z="0.25" />
+      <box name="module_L1b_halfmodule_axial_hybridBox" x="40.34" y="70.0" z="1.5875" />
+      <box name="module_L1b_halfmodule_stereoBox" x="47.17" y="200.0" z="1.8875" />
       <box name="module_L1b_halfmodule_stereo_sensorBox" x="40.34" y="100.0" z="0.32" />
       <box name="module_L1b_halfmodule_stereo_sensor_activeBox" x="38.3399" y="98.33" z="0.32" />
-      <box name="module_L1b_halfmodule_stereo_laminationBox" x="184.0" y="0.05" z="40.0" />
-      <box name="module_L1b_halfmodule_stereo_cfBox" x="200.0" y="0.25" z="45.0" />
-      <box name="module_L1b_halfmodule_stereo_hybridBox" x="70.0" y="1.5875" z="40.34" />
+      <box name="module_L1b_halfmodule_stereo_laminationBox" x="40.0" y="184.0" z="0.05" />
+      <box name="module_L1b_halfmodule_stereo_cfBox" x="45.0" y="200.0" z="0.25" />
+      <box name="module_L1b_halfmodule_stereo_hybridBox" x="40.34" y="70.0" z="1.5875" />
       <box name="module_L1tBox" x="215.2" y="13.5" z="73.3" />
-      <box name="module_L1t_halfmodule_axialBox" x="200.0" y="1.8875" z="47.17" />
+      <box name="module_L1t_halfmodule_axialBox" x="47.17" y="200.0" z="1.8875" />
       <box name="module_L1t_halfmodule_axial_sensorBox" x="40.34" y="100.0" z="0.32" />
       <box name="module_L1t_halfmodule_axial_sensor_activeBox" x="38.3399" y="98.33" z="0.32" />
-      <box name="module_L1t_halfmodule_axial_laminationBox" x="184.0" y="0.05" z="40.0" />
-      <box name="module_L1t_halfmodule_axial_cfBox" x="200.0" y="0.25" z="45.0" />
-      <box name="module_L1t_halfmodule_axial_hybridBox" x="70.0" y="1.5875" z="40.34" />
-      <box name="module_L1t_halfmodule_stereoBox" x="200.0" y="1.8875" z="47.17" />
+      <box name="module_L1t_halfmodule_axial_laminationBox" x="40.0" y="184.0" z="0.05" />
+      <box name="module_L1t_halfmodule_axial_cfBox" x="45.0" y="200.0" z="0.25" />
+      <box name="module_L1t_halfmodule_axial_hybridBox" x="40.34" y="70.0" z="1.5875" />
+      <box name="module_L1t_halfmodule_stereoBox" x="47.17" y="200.0" z="1.8875" />
       <box name="module_L1t_halfmodule_stereo_sensorBox" x="40.34" y="100.0" z="0.32" />
       <box name="module_L1t_halfmodule_stereo_sensor_activeBox" x="38.3399" y="98.33" z="0.32" />
-      <box name="module_L1t_halfmodule_stereo_laminationBox" x="184.0" y="0.05" z="40.0" />
-      <box name="module_L1t_halfmodule_stereo_cfBox" x="200.0" y="0.25" z="45.0" />
-      <box name="module_L1t_halfmodule_stereo_hybridBox" x="70.0" y="1.5875" z="40.34" />
+      <box name="module_L1t_halfmodule_stereo_laminationBox" x="40.0" y="184.0" z="0.05" />
+      <box name="module_L1t_halfmodule_stereo_cfBox" x="45.0" y="200.0" z="0.25" />
+      <box name="module_L1t_halfmodule_stereo_hybridBox" x="40.34" y="70.0" z="1.5875" />
       <box name="module_L2bBox" x="215.2" y="13.5" z="73.3" />
-      <box name="module_L2b_halfmodule_axialBox" x="200.0" y="1.8875" z="47.17" />
+      <box name="module_L2b_halfmodule_axialBox" x="47.17" y="200.0" z="1.8875" />
       <box name="module_L2b_halfmodule_axial_sensorBox" x="40.34" y="100.0" z="0.32" />
       <box name="module_L2b_halfmodule_axial_sensor_activeBox" x="38.3399" y="98.33" z="0.32" />
-      <box name="module_L2b_halfmodule_axial_laminationBox" x="184.0" y="0.05" z="40.0" />
-      <box name="module_L2b_halfmodule_axial_cfBox" x="200.0" y="0.25" z="45.0" />
-      <box name="module_L2b_halfmodule_axial_hybridBox" x="70.0" y="1.5875" z="40.34" />
-      <box name="module_L2b_halfmodule_stereoBox" x="200.0" y="1.8875" z="47.17" />
+      <box name="module_L2b_halfmodule_axial_laminationBox" x="40.0" y="184.0" z="0.05" />
+      <box name="module_L2b_halfmodule_axial_cfBox" x="45.0" y="200.0" z="0.25" />
+      <box name="module_L2b_halfmodule_axial_hybridBox" x="40.34" y="70.0" z="1.5875" />
+      <box name="module_L2b_halfmodule_stereoBox" x="47.17" y="200.0" z="1.8875" />
       <box name="module_L2b_halfmodule_stereo_sensorBox" x="40.34" y="100.0" z="0.32" />
       <box name="module_L2b_halfmodule_stereo_sensor_activeBox" x="38.3399" y="98.33" z="0.32" />
-      <box name="module_L2b_halfmodule_stereo_laminationBox" x="184.0" y="0.05" z="40.0" />
-      <box name="module_L2b_halfmodule_stereo_cfBox" x="200.0" y="0.25" z="45.0" />
-      <box name="module_L2b_halfmodule_stereo_hybridBox" x="70.0" y="1.5875" z="40.34" />
+      <box name="module_L2b_halfmodule_stereo_laminationBox" x="40.0" y="184.0" z="0.05" />
+      <box name="module_L2b_halfmodule_stereo_cfBox" x="45.0" y="200.0" z="0.25" />
+      <box name="module_L2b_halfmodule_stereo_hybridBox" x="40.34" y="70.0" z="1.5875" />
       <box name="module_L2tBox" x="215.2" y="13.5" z="73.3" />
-      <box name="module_L2t_halfmodule_axialBox" x="200.0" y="1.8875" z="47.17" />
+      <box name="module_L2t_halfmodule_axialBox" x="47.17" y="200.0" z="1.8875" />
       <box name="module_L2t_halfmodule_axial_sensorBox" x="40.34" y="100.0" z="0.32" />
       <box name="module_L2t_halfmodule_axial_sensor_activeBox" x="38.3399" y="98.33" z="0.32" />
-      <box name="module_L2t_halfmodule_axial_laminationBox" x="184.0" y="0.05" z="40.0" />
-      <box name="module_L2t_halfmodule_axial_cfBox" x="200.0" y="0.25" z="45.0" />
-      <box name="module_L2t_halfmodule_axial_hybridBox" x="70.0" y="1.5875" z="40.34" />
-      <box name="module_L2t_halfmodule_stereoBox" x="200.0" y="1.8875" z="47.17" />
+      <box name="module_L2t_halfmodule_axial_laminationBox" x="40.0" y="184.0" z="0.05" />
+      <box name="module_L2t_halfmodule_axial_cfBox" x="45.0" y="200.0" z="0.25" />
+      <box name="module_L2t_halfmodule_axial_hybridBox" x="40.34" y="70.0" z="1.5875" />
+      <box name="module_L2t_halfmodule_stereoBox" x="47.17" y="200.0" z="1.8875" />
       <box name="module_L2t_halfmodule_stereo_sensorBox" x="40.34" y="100.0" z="0.32" />
       <box name="module_L2t_halfmodule_stereo_sensor_activeBox" x="38.3399" y="98.33" z="0.32" />
-      <box name="module_L2t_halfmodule_stereo_laminationBox" x="184.0" y="0.05" z="40.0" />
-      <box name="module_L2t_halfmodule_stereo_cfBox" x="200.0" y="0.25" z="45.0" />
-      <box name="module_L2t_halfmodule_stereo_hybridBox" x="70.0" y="1.5875" z="40.34" />
+      <box name="module_L2t_halfmodule_stereo_laminationBox" x="40.0" y="184.0" z="0.05" />
+      <box name="module_L2t_halfmodule_stereo_cfBox" x="45.0" y="200.0" z="0.25" />
+      <box name="module_L2t_halfmodule_stereo_hybridBox" x="40.34" y="70.0" z="1.5875" />
       <box name="module_L3bBox" x="215.2" y="13.5" z="73.3" />
-      <box name="module_L3b_halfmodule_axialBox" x="200.0" y="1.8875" z="47.17" />
+      <box name="module_L3b_halfmodule_axialBox" x="47.17" y="200.0" z="1.8875" />
       <box name="module_L3b_halfmodule_axial_sensorBox" x="40.34" y="100.0" z="0.32" />
       <box name="module_L3b_halfmodule_axial_sensor_activeBox" x="38.3399" y="98.33" z="0.32" />
-      <box name="module_L3b_halfmodule_axial_laminationBox" x="184.0" y="0.05" z="40.0" />
-      <box name="module_L3b_halfmodule_axial_cfBox" x="200.0" y="0.25" z="45.0" />
-      <box name="module_L3b_halfmodule_axial_hybridBox" x="70.0" y="1.5875" z="40.34" />
-      <box name="module_L3b_halfmodule_stereoBox" x="200.0" y="1.8875" z="47.17" />
+      <box name="module_L3b_halfmodule_axial_laminationBox" x="40.0" y="184.0" z="0.05" />
+      <box name="module_L3b_halfmodule_axial_cfBox" x="45.0" y="200.0" z="0.25" />
+      <box name="module_L3b_halfmodule_axial_hybridBox" x="40.34" y="70.0" z="1.5875" />
+      <box name="module_L3b_halfmodule_stereoBox" x="47.17" y="200.0" z="1.8875" />
       <box name="module_L3b_halfmodule_stereo_sensorBox" x="40.34" y="100.0" z="0.32" />
       <box name="module_L3b_halfmodule_stereo_sensor_activeBox" x="38.3399" y="98.33" z="0.32" />
-      <box name="module_L3b_halfmodule_stereo_laminationBox" x="184.0" y="0.05" z="40.0" />
-      <box name="module_L3b_halfmodule_stereo_cfBox" x="200.0" y="0.25" z="45.0" />
-      <box name="module_L3b_halfmodule_stereo_hybridBox" x="70.0" y="1.5875" z="40.34" />
+      <box name="module_L3b_halfmodule_stereo_laminationBox" x="40.0" y="184.0" z="0.05" />
+      <box name="module_L3b_halfmodule_stereo_cfBox" x="45.0" y="200.0" z="0.25" />
+      <box name="module_L3b_halfmodule_stereo_hybridBox" x="40.34" y="70.0" z="1.5875" />
       <box name="module_L3tBox" x="215.2" y="13.5" z="73.3" />
-      <box name="module_L3t_halfmodule_axialBox" x="200.0" y="1.8875" z="47.17" />
+      <box name="module_L3t_halfmodule_axialBox" x="47.17" y="200.0" z="1.8875" />
       <box name="module_L3t_halfmodule_axial_sensorBox" x="40.34" y="100.0" z="0.32" />
       <box name="module_L3t_halfmodule_axial_sensor_activeBox" x="38.3399" y="98.33" z="0.32" />
-      <box name="module_L3t_halfmodule_axial_laminationBox" x="184.0" y="0.05" z="40.0" />
-      <box name="module_L3t_halfmodule_axial_cfBox" x="200.0" y="0.25" z="45.0" />
-      <box name="module_L3t_halfmodule_axial_hybridBox" x="70.0" y="1.5875" z="40.34" />
-      <box name="module_L3t_halfmodule_stereoBox" x="200.0" y="1.8875" z="47.17" />
+      <box name="module_L3t_halfmodule_axial_laminationBox" x="40.0" y="184.0" z="0.05" />
+      <box name="module_L3t_halfmodule_axial_cfBox" x="45.0" y="200.0" z="0.25" />
+      <box name="module_L3t_halfmodule_axial_hybridBox" x="40.34" y="70.0" z="1.5875" />
+      <box name="module_L3t_halfmodule_stereoBox" x="47.17" y="200.0" z="1.8875" />
       <box name="module_L3t_halfmodule_stereo_sensorBox" x="40.34" y="100.0" z="0.32" />
       <box name="module_L3t_halfmodule_stereo_sensor_activeBox" x="38.3399" y="98.33" z="0.32" />
-      <box name="module_L3t_halfmodule_stereo_laminationBox" x="184.0" y="0.05" z="40.0" />
-      <box name="module_L3t_halfmodule_stereo_cfBox" x="200.0" y="0.25" z="45.0" />
-      <box name="module_L3t_halfmodule_stereo_hybridBox" x="70.0" y="1.5875" z="40.34" />
+      <box name="module_L3t_halfmodule_stereo_laminationBox" x="40.0" y="184.0" z="0.05" />
+      <box name="module_L3t_halfmodule_stereo_cfBox" x="45.0" y="200.0" z="0.25" />
+      <box name="module_L3t_halfmodule_stereo_hybridBox" x="40.34" y="70.0" z="1.5875" />
       <box name="module_L4bBox" x="215.2" y="13.5" z="68.3" />
-      <box name="module_L4b_halfmodule_axialBox" x="200.0" y="1.8875" z="47.17" />
+      <box name="module_L4b_halfmodule_axialBox" x="47.17" y="200.0" z="1.8875" />
       <box name="module_L4b_halfmodule_axial_sensorBox" x="40.34" y="100.0" z="0.32" />
       <box name="module_L4b_halfmodule_axial_sensor_activeBox" x="38.3399" y="98.33" z="0.32" />
-      <box name="module_L4b_halfmodule_axial_laminationBox" x="184.0" y="0.05" z="40.0" />
-      <box name="module_L4b_halfmodule_axial_cfBox" x="200.0" y="0.25" z="45.0" />
-      <box name="module_L4b_halfmodule_axial_hybridBox" x="70.0" y="1.5875" z="40.34" />
-      <box name="module_L4b_halfmodule_stereoBox" x="200.0" y="1.8875" z="47.17" />
+      <box name="module_L4b_halfmodule_axial_laminationBox" x="40.0" y="184.0" z="0.05" />
+      <box name="module_L4b_halfmodule_axial_cfBox" x="45.0" y="200.0" z="0.25" />
+      <box name="module_L4b_halfmodule_axial_hybridBox" x="40.34" y="70.0" z="1.5875" />
+      <box name="module_L4b_halfmodule_stereoBox" x="47.17" y="200.0" z="1.8875" />
       <box name="module_L4b_halfmodule_stereo_sensorBox" x="40.34" y="100.0" z="0.32" />
       <box name="module_L4b_halfmodule_stereo_sensor_activeBox" x="38.3399" y="98.33" z="0.32" />
-      <box name="module_L4b_halfmodule_stereo_laminationBox" x="184.0" y="0.05" z="40.0" />
-      <box name="module_L4b_halfmodule_stereo_cfBox" x="200.0" y="0.25" z="45.0" />
-      <box name="module_L4b_halfmodule_stereo_hybridBox" x="70.0" y="1.5875" z="40.34" />
+      <box name="module_L4b_halfmodule_stereo_laminationBox" x="40.0" y="184.0" z="0.05" />
+      <box name="module_L4b_halfmodule_stereo_cfBox" x="45.0" y="200.0" z="0.25" />
+      <box name="module_L4b_halfmodule_stereo_hybridBox" x="40.34" y="70.0" z="1.5875" />
       <box name="module_L4tBox" x="215.2" y="13.5" z="68.3" />
-      <box name="module_L4t_halfmodule_axialBox" x="200.0" y="1.8875" z="47.17" />
+      <box name="module_L4t_halfmodule_axialBox" x="47.17" y="200.0" z="1.8875" />
       <box name="module_L4t_halfmodule_axial_sensorBox" x="40.34" y="100.0" z="0.32" />
       <box name="module_L4t_halfmodule_axial_sensor_activeBox" x="38.3399" y="98.33" z="0.32" />
-      <box name="module_L4t_halfmodule_axial_laminationBox" x="184.0" y="0.05" z="40.0" />
-      <box name="module_L4t_halfmodule_axial_cfBox" x="200.0" y="0.25" z="45.0" />
-      <box name="module_L4t_halfmodule_axial_hybridBox" x="70.0" y="1.5875" z="40.34" />
-      <box name="module_L4t_halfmodule_stereoBox" x="200.0" y="1.8875" z="47.17" />
+      <box name="module_L4t_halfmodule_axial_laminationBox" x="40.0" y="184.0" z="0.05" />
+      <box name="module_L4t_halfmodule_axial_cfBox" x="45.0" y="200.0" z="0.25" />
+      <box name="module_L4t_halfmodule_axial_hybridBox" x="40.34" y="70.0" z="1.5875" />
+      <box name="module_L4t_halfmodule_stereoBox" x="47.17" y="200.0" z="1.8875" />
       <box name="module_L4t_halfmodule_stereo_sensorBox" x="40.34" y="100.0" z="0.32" />
       <box name="module_L4t_halfmodule_stereo_sensor_activeBox" x="38.3399" y="98.33" z="0.32" />
-      <box name="module_L4t_halfmodule_stereo_laminationBox" x="184.0" y="0.05" z="40.0" />
-      <box name="module_L4t_halfmodule_stereo_cfBox" x="200.0" y="0.25" z="45.0" />
-      <box name="module_L4t_halfmodule_stereo_hybridBox" x="70.0" y="1.5875" z="40.34" />
+      <box name="module_L4t_halfmodule_stereo_laminationBox" x="40.0" y="184.0" z="0.05" />
+      <box name="module_L4t_halfmodule_stereo_cfBox" x="45.0" y="200.0" z="0.25" />
+      <box name="module_L4t_halfmodule_stereo_hybridBox" x="40.34" y="70.0" z="1.5875" />
       <box name="module_L5bBox" x="215.2" y="13.5" z="68.3" />
-      <box name="module_L5b_halfmodule_axialBox" x="200.0" y="1.8875" z="47.17" />
+      <box name="module_L5b_halfmodule_axialBox" x="47.17" y="200.0" z="1.8875" />
       <box name="module_L5b_halfmodule_axial_sensorBox" x="40.34" y="100.0" z="0.32" />
       <box name="module_L5b_halfmodule_axial_sensor_activeBox" x="38.3399" y="98.33" z="0.32" />
-      <box name="module_L5b_halfmodule_axial_laminationBox" x="184.0" y="0.05" z="40.0" />
-      <box name="module_L5b_halfmodule_axial_cfBox" x="200.0" y="0.25" z="45.0" />
-      <box name="module_L5b_halfmodule_axial_hybridBox" x="70.0" y="1.5875" z="40.34" />
-      <box name="module_L5b_halfmodule_stereoBox" x="200.0" y="1.8875" z="47.17" />
+      <box name="module_L5b_halfmodule_axial_laminationBox" x="40.0" y="184.0" z="0.05" />
+      <box name="module_L5b_halfmodule_axial_cfBox" x="45.0" y="200.0" z="0.25" />
+      <box name="module_L5b_halfmodule_axial_hybridBox" x="40.34" y="70.0" z="1.5875" />
+      <box name="module_L5b_halfmodule_stereoBox" x="47.17" y="200.0" z="1.8875" />
       <box name="module_L5b_halfmodule_stereo_sensorBox" x="40.34" y="100.0" z="0.32" />
       <box name="module_L5b_halfmodule_stereo_sensor_activeBox" x="38.3399" y="98.33" z="0.32" />
-      <box name="module_L5b_halfmodule_stereo_laminationBox" x="184.0" y="0.05" z="40.0" />
-      <box name="module_L5b_halfmodule_stereo_cfBox" x="200.0" y="0.25" z="45.0" />
-      <box name="module_L5b_halfmodule_stereo_hybridBox" x="70.0" y="1.5875" z="40.34" />
+      <box name="module_L5b_halfmodule_stereo_laminationBox" x="40.0" y="184.0" z="0.05" />
+      <box name="module_L5b_halfmodule_stereo_cfBox" x="45.0" y="200.0" z="0.25" />
+      <box name="module_L5b_halfmodule_stereo_hybridBox" x="40.34" y="70.0" z="1.5875" />
       <box name="module_L5tBox" x="215.2" y="13.5" z="68.3" />
-      <box name="module_L5t_halfmodule_axialBox" x="200.0" y="1.8875" z="47.17" />
+      <box name="module_L5t_halfmodule_axialBox" x="47.17" y="200.0" z="1.8875" />
       <box name="module_L5t_halfmodule_axial_sensorBox" x="40.34" y="100.0" z="0.32" />
       <box name="module_L5t_halfmodule_axial_sensor_activeBox" x="38.3399" y="98.33" z="0.32" />
-      <box name="module_L5t_halfmodule_axial_laminationBox" x="184.0" y="0.05" z="40.0" />
-      <box name="module_L5t_halfmodule_axial_cfBox" x="200.0" y="0.25" z="45.0" />
-      <box name="module_L5t_halfmodule_axial_hybridBox" x="70.0" y="1.5875" z="40.34" />
-      <box name="module_L5t_halfmodule_stereoBox" x="200.0" y="1.8875" z="47.17" />
+      <box name="module_L5t_halfmodule_axial_laminationBox" x="40.0" y="184.0" z="0.05" />
+      <box name="module_L5t_halfmodule_axial_cfBox" x="45.0" y="200.0" z="0.25" />
+      <box name="module_L5t_halfmodule_axial_hybridBox" x="40.34" y="70.0" z="1.5875" />
+      <box name="module_L5t_halfmodule_stereoBox" x="47.17" y="200.0" z="1.8875" />
       <box name="module_L5t_halfmodule_stereo_sensorBox" x="40.34" y="100.0" z="0.32" />
       <box name="module_L5t_halfmodule_stereo_sensor_activeBox" x="38.3399" y="98.33" z="0.32" />
-      <box name="module_L5t_halfmodule_stereo_laminationBox" x="184.0" y="0.05" z="40.0" />
-      <box name="module_L5t_halfmodule_stereo_cfBox" x="200.0" y="0.25" z="45.0" />
-      <box name="module_L5t_halfmodule_stereo_hybridBox" x="70.0" y="1.5875" z="40.34" />
+      <box name="module_L5t_halfmodule_stereo_laminationBox" x="40.0" y="184.0" z="0.05" />
+      <box name="module_L5t_halfmodule_stereo_cfBox" x="45.0" y="200.0" z="0.25" />
+      <box name="module_L5t_halfmodule_stereo_hybridBox" x="40.34" y="70.0" z="1.5875" />
       <box name="TestRunModuleFieldDefBox" x="712.2" y="1665.208" z="1.0E-8" />
       <box name="TestRunModuleFieldDefVolume_component0Box" x="712.2" y="1665.208" z="1.0E-8" />
       <box name="TestRunModuleFieldDefVolume_component0Sensor0Box" x="711.2" y="1664.208" z="1.0E-8" />
       <trd name="crystal_trap" x1="13.3" x2="16.0" y1="13.3" y2="16.0" z="160.0" />
     </solids>
     <structure>
-      <volume name="beamPlaneVol_volume">
-        <materialref ref="Vacuum" />
-        <solidref ref="beamPlaneVolBox" />
-        <visref ref="BeamPlaneVis" />
-      </volume>
       <volume name="baseplate_volume">
         <materialref ref="Aluminum" />
         <solidref ref="baseplateBox" />
@@ -3088,11 +3080,6 @@
       <volume name="tracking_volume">
         <materialref ref="TrackingMaterial" />
         <solidref ref="tracking_cylinder" />
-        <physvol>
-          <volumeref ref="beamPlaneVol_volume" />
-          <positionref ref="beamPlaneVol_position" />
-          <rotationref ref="beamPlaneVol_rotation" />
-        </physvol>
         <physvol>
           <volumeref ref="base_volume" />
           <positionref ref="base_position" />

Modified: java/branches/hps_java_trunk_HPSJAVA-255/detector-data/detectors/HPSTestRunTracker2014-v0/compact.xml
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/detector-data/detectors/HPSTestRunTracker2014-v0/compact.xml	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/detector-data/detectors/HPSTestRunTracker2014-v0/compact.xml	Mon Nov  3 01:04:28 2014
@@ -79,36 +79,159 @@
   
   <detectors>
     <detector id="1" name="Tracker" type="HPSTestRunTracker2014" readout="TrackerHits">
-	  
-      <!-- Definition of half module logical volume. -->
-      <half_modules>
-        <half_module name="SvtHalfModuleLayers1-3">
-          <component x="50.0" y="100.0" z="0.0" material="Silicon" sensitive="true" />
-        </half_module>
-      </half_modules>
-      
-      <!-- Alignment of entire tracker box. -->
-      <alignment x="0.0" y="0.0" z="0.0" />
-      <support_plate name="SupportPlateL1-3bot">
-        <position name="ball" x="0.0" y="0.0" z="0.0"/>
-        <position name="vee" x="0.0" y="0.0" z="0.0"/>
-        <position name="flat" x="0.0" y="0.0" z="0.0"/>
-        <alignment x="5.0" y="5.0" z="5.0" rx="0.1" ry="0.1" rz="0.1"/>
-        <modules>
-          <module layer="1" ref="SvtModule">
-            <position name="ball" x="0.0" y="0.0" z="0.0"/>
-        	<position name="vee" x="0.0" y="0.0" z="0.0"/>
-        	<position name="flat" x="0.0" y="0.0" z="0.0"/>
-        	<alignment x="4.0" y="4.0" z="4.0" rx="0.1" ry="0.1" rz="0.1"/>
-        	<half_module type="axial" ref="SvtHalfModuleLayers1-3">
-	        	<position name="ball" x="0.0" y="0.0" z="0.0"/>
-    	    	<position name="vee" x="0.0" y="0.0" z="0.0"/>
-        		<position name="flat" x="0.0" y="0.0" z="0.0"/>
-            	<alignment x="3.0" y="3.0" z="3.0" rx="0.1" ry="0.1" rz="0.1" />
-            </half_module>
-          </module>
-        </modules>
-      </support_plate>
+	   <millepede_constants>
+            <!-- top translations -->
+            <millepede_constant name="11101" value="0.0"/>
+            <millepede_constant name="11102" value="0.0"/>
+            <millepede_constant name="11103" value="0.0"/>
+            <millepede_constant name="11104" value="0.0"/>
+            <millepede_constant name="11105" value="0.0"/>
+            <millepede_constant name="11106" value="0.0"/>
+            <millepede_constant name="11107" value="0.0"/>
+            <millepede_constant name="11108" value="0.0"/>
+            <millepede_constant name="11109" value="0.0"/>
+            <millepede_constant name="11110" value="0.0"/>
+
+            <millepede_constant name="11201" value="0.0"/>
+            <millepede_constant name="11202" value="0.0"/>
+            <millepede_constant name="11203" value="0.0"/>
+            <millepede_constant name="11204" value="0.0"/>
+            <millepede_constant name="11205" value="0.0"/>
+            <millepede_constant name="11206" value="0.0"/>
+            <millepede_constant name="11207" value="0.0"/>
+            <millepede_constant name="11208" value="0.0"/>
+            <millepede_constant name="11209" value="0.0"/>
+            <millepede_constant name="11210" value="0.0"/>
+
+            <millepede_constant name="11301" value="0.0"/>
+            <millepede_constant name="11302" value="0.0"/>
+            <millepede_constant name="11303" value="0.0"/>
+            <millepede_constant name="11304" value="0.0"/>
+            <millepede_constant name="11305" value="0.0"/>
+            <millepede_constant name="11306" value="0.0"/>
+            <millepede_constant name="11307" value="0.0"/>
+            <millepede_constant name="11308" value="0.0"/>
+            <millepede_constant name="11309" value="0.0"/>
+            <millepede_constant name="11310" value="0.0"/>
+            
+            <!-- top rotations -->
+            
+            <millepede_constant name="12101" value="0.0"/>
+            <millepede_constant name="12102" value="0.0"/>
+            <millepede_constant name="12103" value="0.0"/>
+            <millepede_constant name="12104" value="0.0"/>
+            <millepede_constant name="12105" value="0.0"/>
+            <millepede_constant name="12106" value="0.0"/>
+            <millepede_constant name="12107" value="0.0"/>
+            <millepede_constant name="12108" value="0.0"/>
+            <millepede_constant name="12109" value="0.0"/>
+            <millepede_constant name="12110" value="0.0"/>
+
+            <millepede_constant name="12201" value="0.0"/>
+            <millepede_constant name="12202" value="0.0"/>
+            <millepede_constant name="12203" value="0.0"/>
+            <millepede_constant name="12204" value="0.0"/>
+            <millepede_constant name="12205" value="0.0"/>
+            <millepede_constant name="12206" value="0.0"/>
+            <millepede_constant name="12207" value="0.0"/>
+            <millepede_constant name="12208" value="0.0"/>
+            <millepede_constant name="12209" value="0.0"/>
+            <millepede_constant name="12210" value="0.0"/>
+
+            <millepede_constant name="12301" value="0.0"/>
+            <millepede_constant name="12302" value="0.0"/>
+            <millepede_constant name="12303" value="0.0"/>
+            <millepede_constant name="12304" value="0.0"/>
+            <millepede_constant name="12305" value="0.0"/>
+            <millepede_constant name="12306" value="0.0"/>
+            <millepede_constant name="12307" value="0.0"/>
+            <millepede_constant name="12308" value="0.0"/>
+            <millepede_constant name="12309" value="0.0"/>
+            <millepede_constant name="12310" value="0.0"/>
+            
+            <!-- bottom translations -->
+            
+            <millepede_constant name="21101" value="0.0"/>
+            <millepede_constant name="21102" value="0.0"/>
+            <millepede_constant name="21103" value="0.0"/>
+            <millepede_constant name="21104" value="0.0"/>
+            <millepede_constant name="21105" value="0.0"/>
+            <millepede_constant name="21106" value="0.0"/>
+            <millepede_constant name="21107" value="0.0"/>
+            <millepede_constant name="21108" value="0.0"/>
+            <millepede_constant name="21109" value="0.0"/>
+            <millepede_constant name="21110" value="0.0"/>
+
+            <millepede_constant name="21201" value="0.0"/>
+            <millepede_constant name="21202" value="0.0"/>
+            <millepede_constant name="21203" value="0.0"/>
+            <millepede_constant name="21204" value="0.0"/>
+            <millepede_constant name="21205" value="0.0"/>
+            <millepede_constant name="21206" value="0.0"/>
+            <millepede_constant name="21207" value="0.0"/>
+            <millepede_constant name="21208" value="0.0"/>
+            <millepede_constant name="21209" value="0.0"/>
+            <millepede_constant name="21210" value="0.0"/>
+
+            <millepede_constant name="21301" value="0.0"/>
+            <millepede_constant name="21302" value="0.0"/>
+            <millepede_constant name="21303" value="0.0"/>
+            <millepede_constant name="21304" value="0.0"/>
+            <millepede_constant name="21305" value="0.0"/>
+            <millepede_constant name="21306" value="0.0"/>
+            <millepede_constant name="21307" value="0.0"/>
+            <millepede_constant name="21308" value="0.0"/>
+            <millepede_constant name="21309" value="0.0"/>
+            <millepede_constant name="21310" value="0.0"/>
+            
+            <!-- bottom rotations -->
+            
+            <millepede_constant name="22101" value="0.0"/>
+            <millepede_constant name="22102" value="0.0"/>
+            <millepede_constant name="22103" value="0.0"/>
+            <millepede_constant name="22104" value="0.0"/>
+            <millepede_constant name="22105" value="0.0"/>
+            <millepede_constant name="22106" value="0.0"/>
+            <millepede_constant name="22107" value="0.0"/>
+            <millepede_constant name="22108" value="0.0"/>
+            <millepede_constant name="22109" value="0.0"/>
+            <millepede_constant name="22110" value="0.0"/>
+
+            <millepede_constant name="22201" value="0.0"/>
+            <millepede_constant name="22202" value="0.0"/>
+            <millepede_constant name="22203" value="0.0"/>
+            <millepede_constant name="22204" value="0.0"/>
+            <millepede_constant name="22205" value="0.0"/>
+            <millepede_constant name="22206" value="0.0"/>
+            <millepede_constant name="22207" value="0.0"/>
+            <millepede_constant name="22208" value="0.0"/>
+            <millepede_constant name="22209" value="0.0"/>
+            <millepede_constant name="22210" value="0.0"/>
+
+            <millepede_constant name="22301" value="0.0"/>
+            <millepede_constant name="22302" value="0.0"/>
+            <millepede_constant name="22303" value="0.0"/>
+            <millepede_constant name="22304" value="0.0"/>
+            <millepede_constant name="22305" value="0.0"/>
+            <millepede_constant name="22306" value="0.0"/>
+            <millepede_constant name="22307" value="0.0"/>
+            <millepede_constant name="22308" value="0.0"/>
+            <millepede_constant name="22309" value="0.0"/>
+            <millepede_constant name="22310" value="0.0"/>
+            
+            
+            <!-- top support tilt angles -->
+            <millepede_constant name="13100" value="0.0"/>
+            <millepede_constant name="13200" value="0.0"/>
+            <millepede_constant name="13300" value="0.0"/>
+            
+            <!-- bottom support tilt angles -->
+            <millepede_constant name="23100" value="0.0"/>
+            <millepede_constant name="23200" value="0.0"/>
+            <millepede_constant name="23300" value="0.0"/>
+            
+        </millepede_constants>
+     
     </detector>
 
 	<detector id="30" name="TrackerFieldDef" type="HPSTracker2"

Modified: java/branches/hps_java_trunk_HPSJAVA-255/detector-data/pom.xml
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/detector-data/pom.xml	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/detector-data/pom.xml	Mon Nov  3 01:04:28 2014
@@ -8,7 +8,7 @@
         <groupId>org.hps</groupId>
         <artifactId>hps-parent</artifactId>
         <relativePath>../parent/pom.xml</relativePath>
-        <version>3.0.3-SNAPSHOT</version>
+        <version>3.1-SNAPSHOT</version>
     </parent>
     <scm>
         <url>http://java.freehep.org/svn/repos/hps/list/java/trunk/detector-data/</url>

Modified: java/branches/hps_java_trunk_HPSJAVA-255/distribution/pom.xml
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/distribution/pom.xml	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/distribution/pom.xml	Mon Nov  3 01:04:28 2014
@@ -11,7 +11,7 @@
         <groupId>org.hps</groupId>
         <artifactId>hps-parent</artifactId>
         <relativePath>../parent/pom.xml</relativePath>
-        <version>3.0.3-SNAPSHOT</version>
+        <version>3.1-SNAPSHOT</version>
     </parent>    
     <scm>
         <url>http://java.freehep.org/svn/repos/hps/list/java/trunk/distribution/</url>

Modified: java/branches/hps_java_trunk_HPSJAVA-255/ecal-event-display/pom.xml
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/ecal-event-display/pom.xml	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/ecal-event-display/pom.xml	Mon Nov  3 01:04:28 2014
@@ -7,7 +7,7 @@
         <groupId>org.hps</groupId>
         <artifactId>hps-parent</artifactId>
         <relativePath>../parent/pom.xml</relativePath>
-        <version>3.0.3-SNAPSHOT</version>
+        <version>3.1-SNAPSHOT</version>
     </parent>
     <scm>
         <url>http://java.freehep.org/svn/repos/hps/list/java/trunk/ecal-event-display/</url>

Modified: java/branches/hps_java_trunk_HPSJAVA-255/ecal-event-display/src/main/java/org/hps/monitoring/ecal/eventdisplay/ui/ActiveViewer.java
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/ecal-event-display/src/main/java/org/hps/monitoring/ecal/eventdisplay/ui/ActiveViewer.java	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/ecal-event-display/src/main/java/org/hps/monitoring/ecal/eventdisplay/ui/ActiveViewer.java	Mon Nov  3 01:04:28 2014
@@ -19,50 +19,43 @@
  * @author Kyle McCarty
  */
 public abstract class ActiveViewer extends Viewer {
-	private static final long serialVersionUID = -6107646224627009923L;
-	// Stores whether the background color is set or not.
-	private boolean background = false;
-	// Gets events from some file.
-	protected final EventManager em;
-	
-	/**
-     * Creates an active-type <code>Viewer</code> window which draws
-     * events from the indicated data source.
-	 * @param em - The data source event manager.
-	 */
-	public ActiveViewer(EventManager em) { this(em, new String[0]); }
-	
-	/**
+    private static final long serialVersionUID = -6107646224627009923L;
+    // Stores whether the background color is set or not.
+    private boolean background = false;
+    // Gets events from some file.
+    protected final EventManager em;
+    
+    /**
      * Creates an active-type <code>Viewer</code> window which draws
      * events from the indicated data source with additional status
      * fields defined by the <code>fieldNames</code> argument.
-	 * @param em - The data source event manager.
-	 * @param fieldNames - An array of additional status fields
-	 * that should be displayed.
-	 */
-	public ActiveViewer(EventManager em, String... fieldNames) {
-		// Pass any additional field values to the super class.
-		super(fieldNames);
-		
-		// Set the data source.
-		this.em = em;
-		
+     * @param em - The data source event manager.
+     * @param fieldNames - An array of additional status fields
+     * that should be displayed.
+     */
+    public ActiveViewer(EventManager em) {
+        // Pass any additional field values to the super class.
+        super();
+        
+        // Set the data source.
+        this.em = em;
+        
         // Make a key listener to change events.
         addKeyListener(new EcalKeyListener());
-	}
-	
+    }
+    
     /**
      * Feeds the calorimeter panel the data from the next event.
      * @throws IOException Occurs when there is an issue with reading the data file.
      **/
-	public abstract void displayNextEvent() throws IOException;
-	
+    public abstract void displayNextEvent() throws IOException;
+    
     /**
      * Feeds the calorimeter panel the data from the previous event.
      * @throws IOException Occurs when there is an issue with reading the data file.
      **/
-	public abstract void displayPreviousEvent() throws IOException;
-	
+    public abstract void displayPreviousEvent() throws IOException;
+    
     /**
      * The <code>EcalListener</code> class binds keys to actions.
      * Bound actions include:
@@ -71,7 +64,7 @@
      * b             :: Toggle color-mapping for 0 energy crystals
      * h             :: Toggle selected crystal highlighting
      * l             :: Toggle logarithmic versus linear scaling
-     * s			 :: Saves the current display to a file
+     * s             :: Saves the current display to a file
      **/
     private class EcalKeyListener implements KeyListener {
         public void keyPressed(KeyEvent e) { }
@@ -97,9 +90,9 @@
             
             // 'b' toggles the default white background.
             else if(e.getKeyCode() == 66) {
-            	if(background) { ecalPanel.setDefaultCrystalColor(null); }
-            	else { ecalPanel.setDefaultCrystalColor(Color.GRAY); }
-            	background = !background;
+                if(background) { ecalPanel.setDefaultCrystalColor(null); }
+                else { ecalPanel.setDefaultCrystalColor(Color.GRAY); }
+                background = !background;
             }
             
             // 'h' toggles highlighting the crystal under the cursor.
@@ -107,45 +100,45 @@
             
             // 'l' toggles linear or logarithmic scaling.
             else if(e.getKeyCode() == 76) {
-            	if(ecalPanel.isScalingLinear()) { ecalPanel.setScalingLogarithmic(); }
-            	else { ecalPanel.setScalingLinear(); }
+                if(ecalPanel.isScalingLinear()) { ecalPanel.setScalingLogarithmic(); }
+                else { ecalPanel.setScalingLinear(); }
             }
             
             // 'x' toggles x-axis mirroring.
             else if(e.getKeyCode() == 88) {
-            	ecalPanel.setMirrorX(!ecalPanel.isMirroredX());
-            	updateStatusPanel();
+                ecalPanel.setMirrorX(!ecalPanel.isMirroredX());
+                updateStatusPanel();
             }
             
             // 'y' toggles y-axis mirroring.
             else if(e.getKeyCode() == 89) {
-            	ecalPanel.setMirrorY(!ecalPanel.isMirroredY());
-            	updateStatusPanel();
+                ecalPanel.setMirrorY(!ecalPanel.isMirroredY());
+                updateStatusPanel();
             }
             
             // 's' saves the panel to a file.
             else if(e.getKeyCode() == 83) {
-            	// Make a new buffered image on which to draw the content pane.
-            	BufferedImage screenshot = new BufferedImage(getContentPane().getWidth(),
-            			getContentPane().getHeight(), BufferedImage.TYPE_INT_ARGB);
-            	
-            	// Paint the content pane to image.
-            	getContentPane().paint(screenshot.getGraphics());
-            	
-            	// Get the lowest available file name.
-            	int fileNum = 0;
-            	File imageFile = new File("screenshot_" + fileNum + ".png");
-            	while(imageFile.exists()) {
-            		fileNum++;
-            		imageFile = new File("screenshot_" + fileNum + ".png");
-            	}
-            	
-            	// Save the image to a PNG file.
-            	try { ImageIO.write(screenshot, "PNG", imageFile); }
-            	catch(IOException ioe) {
-            		System.err.println("Error saving file \"screenshot.png\".");
-            	}
-            	System.out.println("Screenshot saved to: " + imageFile.getAbsolutePath());
+                // Make a new buffered image on which to draw the content pane.
+                BufferedImage screenshot = new BufferedImage(getContentPane().getWidth(),
+                        getContentPane().getHeight(), BufferedImage.TYPE_INT_ARGB);
+                
+                // Paint the content pane to image.
+                getContentPane().paint(screenshot.getGraphics());
+                
+                // Get the lowest available file name.
+                int fileNum = 0;
+                File imageFile = new File("screenshot_" + fileNum + ".png");
+                while(imageFile.exists()) {
+                    fileNum++;
+                    imageFile = new File("screenshot_" + fileNum + ".png");
+                }
+                
+                // Save the image to a PNG file.
+                try { ImageIO.write(screenshot, "PNG", imageFile); }
+                catch(IOException ioe) {
+                    System.err.println("Error saving file \"screenshot.png\".");
+                }
+                System.out.println("Screenshot saved to: " + imageFile.getAbsolutePath());
             }
             
             // Otherwise, print out the key code for the pressed key.

Modified: java/branches/hps_java_trunk_HPSJAVA-255/ecal-event-display/src/main/java/org/hps/monitoring/ecal/eventdisplay/ui/ClusterViewer.java
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/ecal-event-display/src/main/java/org/hps/monitoring/ecal/eventdisplay/ui/ClusterViewer.java	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/ecal-event-display/src/main/java/org/hps/monitoring/ecal/eventdisplay/ui/ClusterViewer.java	Mon Nov  3 01:04:28 2014
@@ -31,10 +31,11 @@
  * 
  * @author Kyle McCarty
  */
+@Deprecated
 public class ClusterViewer extends ActiveViewer {
-	private static final long serialVersionUID = 17058336873349781L;
-	// Stores whether the background color is set or not.
-	private boolean background = false;
+    private static final long serialVersionUID = 17058336873349781L;
+    // Stores whether the background color is set or not.
+    private boolean background = false;
     // Store the index in the buffer of the displayed event.
     private int bufferIndex;
     // Map cluster location to a cluster object.
@@ -50,197 +51,205 @@
     // Additional status display field names for this data type.
     private static final String[] fieldNames = { "Shared Hits", "Component Hits", "Cluster Energy", "Buffer Index" };
     
-	/**
-	 * <b>ClusterViewer</b><br/><br/>
+    /**
+     * <b>ClusterViewer</b><br/><br/>
      * <code>public <b>ClusterViewer</b>()</code><br/><br/>
      * Constructs a new <code>Viewer</code> for displaying data read
      * from a file.
-	 * @param dataSource - The <code>EventManager</code> responsible
-	 * for reading data from a file.
-	 * @throws NullPointerException Occurs if the event manager is
-	 * <code>null</code>.
-	 */
-	public ClusterViewer(EventManager dataSource, int eventWindow) throws NullPointerException {
-		// Pass any additional fields required by the event manager
-		// to the underlying Viewer object to be added to the status
-		// display panel.
-		super(dataSource, fieldNames);
-		
-		// Define the event window and initialize the event data.
-		this.eventWindow = eventWindow;
-		eventEnergyBuffer = new LinkedList<Double[][]>();
-		eventHitBuffer = new LinkedList<List<EcalHit>>();
-		
-		// Prepare the event buffer to display the first event.
-		try {
-			// Make an empty array. At the start, there are no previous
-			// events to load.
-			Double[][] emptyArray = new Double[46][11];
-			for(int x = 0; x < 46; x++) {
-				for(int y = 0; y < 11; y++) { emptyArray[x][y] = new Double(0.0); }
-			}
-			
-			// Populate the eventWindow before section of the buffer
-			// with the empty events.
-			for(int i = 0; i <= eventWindow; i++) {
-				eventEnergyBuffer.addFirst(emptyArray);
-				eventHitBuffer.addFirst(new ArrayList<EcalHit>());
-			}
-			
-			// Fill the rest of the array with future events.
-			for(int i = 0; i < eventWindow; i++) {
-				em.nextEvent();
-				eventEnergyBuffer.addFirst(toEnergyArray(em.getHits()));
-				eventHitBuffer.addFirst(em.getHits());
-			}
-		}
-		catch(java.io.IOException e) { System.exit(1); }
-		
+     * @param dataSource - The <code>EventManager</code> responsible
+     * for reading data from a file.
+     * @throws NullPointerException Occurs if the event manager is
+     * <code>null</code>.
+     */
+    public ClusterViewer(EventManager dataSource, int eventWindow) throws NullPointerException {
+        // Initialize the superclass.
+        super(dataSource);
+        
+        // Add the additional fields.
+        for(String field : fieldNames) {
+            addStatusField(field);
+        }
+        
+        // Define the event window and initialize the event data.
+        this.eventWindow = eventWindow;
+        eventEnergyBuffer = new LinkedList<Double[][]>();
+        eventHitBuffer = new LinkedList<List<EcalHit>>();
+        
+        // Prepare the event buffer to display the first event.
+        try {
+            // Make an empty array. At the start, there are no previous
+            // events to load.
+            Double[][] emptyArray = new Double[46][11];
+            for(int x = 0; x < 46; x++) {
+                for(int y = 0; y < 11; y++) { emptyArray[x][y] = new Double(0.0); }
+            }
+            
+            // Populate the eventWindow before section of the buffer
+            // with the empty events.
+            for(int i = 0; i <= eventWindow; i++) {
+                eventEnergyBuffer.addFirst(emptyArray);
+                eventHitBuffer.addFirst(new ArrayList<EcalHit>());
+            }
+            
+            // Fill the rest of the array with future events.
+            for(int i = 0; i < eventWindow; i++) {
+                em.nextEvent();
+                eventEnergyBuffer.addFirst(toEnergyArray(em.getHits()));
+                eventHitBuffer.addFirst(em.getHits());
+            }
+        }
+        catch(java.io.IOException e) { System.exit(1); }
+        
         // Make a key listener to change events.
         addKeyListener(new EcalKeyListener());
-	}
-    
-    /**
-     * <b>displayNextEvent</b><br/><br/>
-     * <code>public void <b>displayNextEvent</b>()</code><br/><br/>
+    }
+    
+    /**
      * Feeds the calorimeter panel the data from the next event.
      * @throws IOException Occurs when there is an issue with reading the data file.
      **/
+    @Override
     public void displayNextEvent() throws IOException { getEvent(true); }
     
     /**
-     * <b>displayPreviousEvent</b><br/><br/>
-     * <code>public void <b>displayPreviousEvent</b>()</code><br/><br/>
      * Feeds the calorimeter panel the data from the previous event.
      * @throws IOException Occurs when there is an issue with reading the data file.
      **/
+    @Override
     public void displayPreviousEvent() throws IOException { getEvent(false); }
-	
-	public List<Cluster> getClusters() {
-		// Get the set of hits in the middle of the buffer. This is
-		// the "current" event.
-		List<EcalHit> activeEvent = eventHitBuffer.get(eventWindow);
-		
-		// Store clusters.
-		ArrayList<Cluster> clusterList = new ArrayList<Cluster>();
-		
-		// For each hit, check if it meets the criteria for a cluster.
-		for(EcalHit hit : activeEvent) {
-			// Track whether this hit is a cluster.
-			boolean isCluster = true;
-			
-			// Track the current hit's cluster energy.
-			double clusterEnergy = 0.0;
-			
-			// Convert the current hit to the proper coordinates.
-			Point hitLoc = toPanelPoint(hit.getLocation());
-			
-			// Track which crystals are part of the cluster.
-			HashSet<Point> componentSet = new HashSet<Point>();
-			
-			// Get the set of the current hit's neighbors.
-			Set<Point> neighbors = ecalPanel.getNeighbors(hitLoc);
-			
-			// Loop through the buffer and perform comparisons.
-			for(Double[][] event : eventEnergyBuffer) {
-				// Increment the cluster energy by the hit's energy at
-				// the current time in the buffer.
-				clusterEnergy += event[hitLoc.x][hitLoc.y];
-				
-				// A hit must be larger than itself at all other times
-				// stored in the buffer.
-				if(event[hitLoc.x][hitLoc.y] > hit.getEnergy()) {
-					isCluster = false;
-					break;
-				}
-				
-				// A hit must be larger than its immediate neighbors
-				// at all times in the buffer as well.
-				for(Point neighbor : neighbors) {
-					// Increment the cluster energy by the neighbor's
-					// energy at the current time in the buffer.
-					clusterEnergy += event[neighbor.x][neighbor.y];
-					
-					// Check that the neighbor's energy is not higher
-					// than the present hit's.
-					if(event[neighbor.x][neighbor.y] > hit.getEnergy()) {
-						isCluster = false;
-						break;
-					}
-					
-					// If this neighbor has a non-zero energy, it is
-					// a component of the potential cluster.
-					if(event[neighbor.x][neighbor.y] != 0) { componentSet.add(neighbor); }
-				}
-			}
-			
-			// If the current hit did not fail any of the preceding
-			// checks, then it is a cluster and should be added to
-			// the cluster list.
-			if(isCluster) {
-				Cluster cluster = new Cluster(hit.getLocation(), clusterEnergy);
-				for(Point neighbor : componentSet) { cluster.addComponentHit(toEcalPoint(neighbor)); }
-				clusterList.add(cluster);
-			}
-		}
-		
-		// Return the list of clusters.
-		return clusterList;
-	}
-    
+    
+    /**
+     * Generates a list of clusters from the list of hits in the event.
+     * This was used as a debugging method for the current clustering
+     * algorithm.
+     * @return Returns a generated list of clusters.
+     */
+    public List<Cluster> getClusters() {
+        // Get the set of hits in the middle of the buffer. This is
+        // the "current" event.
+        List<EcalHit> activeEvent = eventHitBuffer.get(eventWindow);
+        
+        // Store clusters.
+        ArrayList<Cluster> clusterList = new ArrayList<Cluster>();
+        
+        // For each hit, check if it meets the criteria for a cluster.
+        for(EcalHit hit : activeEvent) {
+            // Track whether this hit is a cluster.
+            boolean isCluster = true;
+            
+            // Track the current hit's cluster energy.
+            double clusterEnergy = 0.0;
+            
+            // Convert the current hit to the proper coordinates.
+            Point hitLoc = toPanelPoint(hit.getLocation());
+            
+            // Track which crystals are part of the cluster.
+            HashSet<Point> componentSet = new HashSet<Point>();
+            
+            // Get the set of the current hit's neighbors.
+            Set<Point> neighbors = ecalPanel.getNeighbors(hitLoc);
+            
+            // Loop through the buffer and perform comparisons.
+            for(Double[][] event : eventEnergyBuffer) {
+                // Increment the cluster energy by the hit's energy at
+                // the current time in the buffer.
+                clusterEnergy += event[hitLoc.x][hitLoc.y];
+                
+                // A hit must be larger than itself at all other times
+                // stored in the buffer.
+                if(event[hitLoc.x][hitLoc.y] > hit.getEnergy()) {
+                    isCluster = false;
+                    break;
+                }
+                
+                // A hit must be larger than its immediate neighbors
+                // at all times in the buffer as well.
+                for(Point neighbor : neighbors) {
+                    // Increment the cluster energy by the neighbor's
+                    // energy at the current time in the buffer.
+                    clusterEnergy += event[neighbor.x][neighbor.y];
+                    
+                    // Check that the neighbor's energy is not higher
+                    // than the present hit's.
+                    if(event[neighbor.x][neighbor.y] > hit.getEnergy()) {
+                        isCluster = false;
+                        break;
+                    }
+                    
+                    // If this neighbor has a non-zero energy, it is
+                    // a component of the potential cluster.
+                    if(event[neighbor.x][neighbor.y] != 0) { componentSet.add(neighbor); }
+                }
+            }
+            
+            // If the current hit did not fail any of the preceding
+            // checks, then it is a cluster and should be added to
+            // the cluster list.
+            if(isCluster) {
+                Cluster cluster = new Cluster(hit.getLocation(), clusterEnergy);
+                for(Point neighbor : componentSet) { cluster.addComponentHit(toEcalPoint(neighbor)); }
+                clusterList.add(cluster);
+            }
+        }
+        
+        // Return the list of clusters.
+        return clusterList;
+    }
+    
+    @Override
     protected void updateStatusPanel() {
-    	super.updateStatusPanel();
-    	
-		// Get the currently selected crystal.
-		Point crystal = ecalPanel.getSelectedCrystal();
-    	
-		// If the active crystal is not null, see if it is a cluster.
-		if(crystal != null) {
-			// Get the cluster associated with this point.
-			Cluster activeCluster = clusterMap.get(crystal);
-			
-			// If the cluster is null, we set everything to undefined.
-			if(activeCluster == null) {
-				for(String field : fieldNames) { setStatusField(field, StatusPanel.NULL_VALUE); }
-			}
-			
-			// Otherwise, define the fields based on the cluster.
-			else {
-				// Get the shared and component hit counts.
-				setStatusField(fieldNames[0], Integer.toString(activeCluster.getSharedHitCount()));
-				setStatusField(fieldNames[1], Integer.toString(activeCluster.getComponentHitCount()));
-				
-				// Format the cluster energy, or account for it if it
-				// doesn't exist.
-				String energy;
-				if(activeCluster.getClusterEnergy() != Double.NaN) {
-					DecimalFormat formatter = new DecimalFormat("0.####E0");
-					energy = formatter.format(activeCluster.getClusterEnergy());
-				}
-				else { energy = "---"; }
-				setStatusField(fieldNames[2], energy);
-			}
-		}
-		// Otherwise, clear the field values.
-		else { for(String field : fieldNames) { setStatusField(field, StatusPanel.NULL_VALUE); } }
-		
-		// Write the current buffer index.
-		
-		setStatusField(fieldNames[3], Integer.toString(eventWindow - bufferIndex));
-    }
-    
-	/**
-	 * <b>displayEvent</b><br/><br/>
-	 * <code>private void <b>displayEvent</b></code><br/><br/>
-	 * Displays the given lists of hits and clusters on the calorimeter
-	 * panel.
-	 * @param hitList - A list of hits for the current event.
-	 * @param clusterList  - A list of clusters for the current event.
-	 */
-	private void displayEvent(List<EcalHit> hitList, List<Cluster> clusterList) {
-		// Suppress the calorimeter panel.
-		ecalPanel.setSuppressRedraw(true);
-		
+        super.updateStatusPanel();
+        
+        // Get the currently selected crystal.
+        Point crystal = ecalPanel.getSelectedCrystal();
+        
+        // If the active crystal is not null, see if it is a cluster.
+        if(crystal != null) {
+            // Get the cluster associated with this point.
+            Cluster activeCluster = clusterMap.get(crystal);
+            
+            // If the cluster is null, we set everything to undefined.
+            if(activeCluster == null) {
+                for(String field : fieldNames) { setStatusField(field, StatusPanel.NULL_VALUE); }
+            }
+            
+            // Otherwise, define the fields based on the cluster.
+            else {
+                // Get the shared and component hit counts.
+                setStatusField(fieldNames[0], Integer.toString(activeCluster.getSharedHitCount()));
+                setStatusField(fieldNames[1], Integer.toString(activeCluster.getComponentHitCount()));
+                
+                // Format the cluster energy, or account for it if it
+                // doesn't exist.
+                String energy;
+                if(activeCluster.getClusterEnergy() != Double.NaN) {
+                    DecimalFormat formatter = new DecimalFormat("0.####E0");
+                    energy = formatter.format(activeCluster.getClusterEnergy());
+                }
+                else { energy = "---"; }
+                setStatusField(fieldNames[2], energy);
+            }
+        }
+        // Otherwise, clear the field values.
+        else { for(String field : fieldNames) { setStatusField(field, StatusPanel.NULL_VALUE); } }
+        
+        // Write the current buffer index.
+        
+        setStatusField(fieldNames[3], Integer.toString(eventWindow - bufferIndex));
+    }
+    
+    /**
+     * <b>displayEvent</b><br/><br/>
+     * <code>private void <b>displayEvent</b></code><br/><br/>
+     * Displays the given lists of hits and clusters on the calorimeter
+     * panel.
+     * @param hitList - A list of hits for the current event.
+     * @param clusterList  - A list of clusters for the current event.
+     */
+    private void displayEvent(List<EcalHit> hitList, List<Cluster> clusterList) {
+        // Suppress the calorimeter panel.
+        ecalPanel.setSuppressRedraw(true);
+        
         // Display the hits.
         for (EcalHit h : hitList) {
             int ix = toPanelX(h.getX());
@@ -250,28 +259,28 @@
         
         // Display the clusters.
         for(Cluster cluster : clusterList) {
-        	Point rawCluster = cluster.getClusterCenter();
-        	Point clusterCenter = toPanelPoint(rawCluster);
+            Point rawCluster = cluster.getClusterCenter();
+            Point clusterCenter = toPanelPoint(rawCluster);
             ecalPanel.setCrystalCluster(clusterCenter.x, clusterCenter.y, true);
             
-        	// Add component hits to the calorimeter panel.
-        	for(Point ch : cluster.getComponentHits()) {
-        		ecalPanel.addAssociation(new Association(clusterCenter, toPanelPoint(ch), HIGHLIGHT_CLUSTER_COMPONENT));
-        	}
-        	
-        	// Add shared hits to the calorimeter panel.
-        	for(Point sh : cluster.getSharedHits()) {
-        		ecalPanel.addAssociation(new Association(clusterCenter, toPanelPoint(sh), HIGHLIGHT_CLUSTER_SHARED));
-        	}
-        }
-        
-		// Stop suppressing the panel and order it to redraw.
-		ecalPanel.setSuppressRedraw(false);
-		ecalPanel.repaint();
+            // Add component hits to the calorimeter panel.
+            for(Point ch : cluster.getComponentHits()) {
+                ecalPanel.addAssociation(new Association(clusterCenter, toPanelPoint(ch), HIGHLIGHT_CLUSTER_COMPONENT));
+            }
+            
+            // Add shared hits to the calorimeter panel.
+            for(Point sh : cluster.getSharedHits()) {
+                ecalPanel.addAssociation(new Association(clusterCenter, toPanelPoint(sh), HIGHLIGHT_CLUSTER_SHARED));
+            }
+        }
+        
+        // Stop suppressing the panel and order it to redraw.
+        ecalPanel.setSuppressRedraw(false);
+        ecalPanel.repaint();
         
         // Update the status panel to account for the new event.
         updateStatusPanel();
-	}
+    }
     
     /**
      * <b>getEvent</b><br/><br/>
@@ -294,16 +303,16 @@
         
         // Remove the last buffer event and add the new one.
         if(forward) {
-        	eventEnergyBuffer.removeLast();
-        	eventHitBuffer.removeLast();
-        	eventEnergyBuffer.addFirst(toEnergyArray(em.getHits()));
-        	eventHitBuffer.addFirst(em.getHits());
+            eventEnergyBuffer.removeLast();
+            eventHitBuffer.removeLast();
+            eventEnergyBuffer.addFirst(toEnergyArray(em.getHits()));
+            eventHitBuffer.addFirst(em.getHits());
         }
         else {
-        	eventEnergyBuffer.removeFirst();
-        	eventHitBuffer.removeFirst();
-        	eventEnergyBuffer.addLast(toEnergyArray(em.getHits()));
-        	eventHitBuffer.addLast(em.getHits());
+            eventEnergyBuffer.removeFirst();
+            eventHitBuffer.removeFirst();
+            eventEnergyBuffer.addLast(toEnergyArray(em.getHits()));
+            eventHitBuffer.addLast(em.getHits());
         }
         
         // Determine if any of the hits in the active event are
@@ -321,29 +330,36 @@
         // Display it.
         displayEvent(eventHitBuffer.get(eventWindow), eventClusters);
     }
-	
-	private Double[][] toEnergyArray(List<EcalHit> hits) {
-		// Define the energy array.
-		Double[][] energy = new Double[46][11];
-		for(int x = 0; x < energy.length; x++) {
-			for(int y = 0; y < energy[x].length; y++) {
-				energy[x][y] = new Double(0);
-			}
-		}
-		
-		// For each hit, place its energy in the array.
-		for(EcalHit hit : hits) {
-			// Get the converted crystal index.
-			Point panelLoc = toPanelPoint(hit.getLocation());
-			
-			// Add the energy to the array.
-			energy[panelLoc.x][panelLoc.y] += hit.getEnergy(); 
-		}
-		
-		// Return the resulting array.
-		return energy;
-	}
-	
+    
+    /**
+     * Gets the energy that should be stored in each crystal of the
+     * calorimeter.
+     * @param hits - The list of hits for the event.
+     * @return Returns the energy of each crystal as an array of <code>
+     * Double</code> objects.
+     */
+    private Double[][] toEnergyArray(List<EcalHit> hits) {
+        // Define the energy array.
+        Double[][] energy = new Double[46][11];
+        for(int x = 0; x < energy.length; x++) {
+            for(int y = 0; y < energy[x].length; y++) {
+                energy[x][y] = new Double(0);
+            }
+        }
+        
+        // For each hit, place its energy in the array.
+        for(EcalHit hit : hits) {
+            // Get the converted crystal index.
+            Point panelLoc = toPanelPoint(hit.getLocation());
+            
+            // Add the energy to the array.
+            energy[panelLoc.x][panelLoc.y] += hit.getEnergy(); 
+        }
+        
+        // Return the resulting array.
+        return energy;
+    }
+    
     /**
      * The <code>EcalListener</code> class binds keys to actions.
      * Bound actions include:
@@ -352,11 +368,13 @@
      * b             :: Toggle color-mapping for 0 energy crystals
      * h             :: Toggle selected crystal highlighting
      * l             :: Toggle logarithmic versus linear scaling
-     * s			 :: Saves the current display to a file
+     * s             :: Saves the current display to a file
      **/
     private class EcalKeyListener implements KeyListener {
+        @Override
         public void keyPressed(KeyEvent e) { }
         
+        @Override
         public void keyReleased(KeyEvent e) {
             // If right-arrow was pressed, go to the next event.
             if (e.getKeyCode() == 39) {
@@ -379,30 +397,30 @@
             // If the down-arrow was pressed, move down a time step in
             // the buffer and display it.
             else if(e.getKeyCode() == 40) {
-            	if(bufferIndex == eventHitBuffer.size() - 1) { return; }
-            	else {
-                	bufferIndex++;
-            		ecalPanel.clearCrystals();
-            		displayEvent(eventHitBuffer.get(bufferIndex), eventClusters);
-            	}
+                if(bufferIndex == eventHitBuffer.size() - 1) { return; }
+                else {
+                    bufferIndex++;
+                    ecalPanel.clearCrystals();
+                    displayEvent(eventHitBuffer.get(bufferIndex), eventClusters);
+                }
             }
             
             // If the up-arrow was pressed, move up a time step in
             // the buffer and display it.
             else if(e.getKeyCode() == 38) {
-            	if(bufferIndex == 0) { return; }
-            	else {
-            		bufferIndex--;
-            		ecalPanel.clearCrystals();
-            		displayEvent(eventHitBuffer.get(bufferIndex), eventClusters);
-            	}
+                if(bufferIndex == 0) { return; }
+                else {
+                    bufferIndex--;
+                    ecalPanel.clearCrystals();
+                    displayEvent(eventHitBuffer.get(bufferIndex), eventClusters);
+                }
             }
             
             // 'b' toggles the default white background.
             else if(e.getKeyCode() == 66) {
-            	if(background) { ecalPanel.setDefaultCrystalColor(null); }
-            	else { ecalPanel.setDefaultCrystalColor(Color.GRAY); }
-            	background = !background;
+                if(background) { ecalPanel.setDefaultCrystalColor(null); }
+                else { ecalPanel.setDefaultCrystalColor(Color.GRAY); }
+                background = !background;
             }
             
             // 'h' toggles highlighting the crystal under the cursor.
@@ -410,39 +428,40 @@
             
             // 'l' toggles linear or logarithmic scaling.
             else if(e.getKeyCode() == 76) {
-            	if(ecalPanel.isScalingLinear()) { ecalPanel.setScalingLogarithmic(); }
-            	else { ecalPanel.setScalingLinear(); }
+                if(ecalPanel.isScalingLinear()) { ecalPanel.setScalingLogarithmic(); }
+                else { ecalPanel.setScalingLinear(); }
             }
             
             // 's' saves the panel to a file.
             else if(e.getKeyCode() == 83) {
-            	// Make a new buffered image on which to draw the content pane.
-            	BufferedImage screenshot = new BufferedImage(getContentPane().getWidth(),
-            			getContentPane().getHeight(), BufferedImage.TYPE_INT_ARGB);
-            	
-            	// Paint the content pane to image.
-            	getContentPane().paint(screenshot.getGraphics());
-            	
-            	// Get the lowest available file name.
-            	int fileNum = 0;
-            	File imageFile = new File("screenshot_" + fileNum + ".png");
-            	while(imageFile.exists()) {
-            		fileNum++;
-            		imageFile = new File("screenshot_" + fileNum + ".png");
-            	}
-            	
-            	// Save the image to a PNG file.
-            	try { ImageIO.write(screenshot, "PNG", imageFile); }
-            	catch(IOException ioe) {
-            		System.err.println("Error saving file \"screenshot.png\".");
-            	}
-            	System.out.println("Screenshot saved to: " + imageFile.getAbsolutePath());
+                // Make a new buffered image on which to draw the content pane.
+                BufferedImage screenshot = new BufferedImage(getContentPane().getWidth(),
+                        getContentPane().getHeight(), BufferedImage.TYPE_INT_ARGB);
+                
+                // Paint the content pane to image.
+                getContentPane().paint(screenshot.getGraphics());
+                
+                // Get the lowest available file name.
+                int fileNum = 0;
+                File imageFile = new File("screenshot_" + fileNum + ".png");
+                while(imageFile.exists()) {
+                    fileNum++;
+                    imageFile = new File("screenshot_" + fileNum + ".png");
+                }
+                
+                // Save the image to a PNG file.
+                try { ImageIO.write(screenshot, "PNG", imageFile); }
+                catch(IOException ioe) {
+                    System.err.println("Error saving file \"screenshot.png\".");
+                }
+                System.out.println("Screenshot saved to: " + imageFile.getAbsolutePath());
             }
             
             // Otherwise, print out the key code for the pressed key.
             else { System.out.printf("Key Code: %d%n", e.getKeyCode()); }
         }
         
+        @Override
         public void keyTyped(KeyEvent e) { }
     }
 }

Modified: java/branches/hps_java_trunk_HPSJAVA-255/ecal-event-display/src/main/java/org/hps/monitoring/ecal/eventdisplay/ui/FileViewer.java
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/ecal-event-display/src/main/java/org/hps/monitoring/ecal/eventdisplay/ui/FileViewer.java	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/ecal-event-display/src/main/java/org/hps/monitoring/ecal/eventdisplay/ui/FileViewer.java	Mon Nov  3 01:04:28 2014
@@ -21,7 +21,7 @@
  * @author Kyle McCarty
  */
 public class FileViewer extends ActiveViewer {
-	private static final long serialVersionUID = 17058336873349781L;
+    private static final long serialVersionUID = 17058336873349781L;
     // Map cluster location to a cluster object.
     private HashMap<Point, Cluster> clusterMap = new HashMap<Point, Cluster>();
     // Additional status display field names for this data type.
@@ -32,80 +32,87 @@
     private static final int COMPONENT_HITS = 2;
     private static final int CLUSTER_ENERGY = 3;
     
-	/**
-	 * <b>FileViewer</b><br/><br/>
+    /**
+     * <b>FileViewer</b><br/><br/>
      * <code>public <b>FileViewer</b>()</code><br/><br/>
      * Constructs a new <code>Viewer</code> for displaying data read
      * from a file.
-	 * @param dataSource - The <code>EventManager</code> responsible
-	 * for reading data from a file.
-	 * @throws NullPointerException Occurs if the event manager is
-	 * <code>null</code>.
-	 */
-	public FileViewer(EventManager dataSource) throws NullPointerException {
-		// Pass any additional fields required by the event manager
-		// to the underlying Viewer object to be added to the status
-		// display panel.
-		super(dataSource, fieldNames);
-	}
+     * @param dataSource - The <code>EventManager</code> responsible
+     * for reading data from a file.
+     * @throws NullPointerException Occurs if the event manager is
+     * <code>null</code>.
+     */
+    public FileViewer(EventManager dataSource) throws NullPointerException {
+        // Initialize the superclass viewer.
+        super(dataSource);
+        
+        // Add additional fields.
+        insertStatusField(0, fieldNames[0]);
+        for(int index = 1; index < fieldNames.length; index++) {
+            addStatusField(fieldNames[index]);
+        }
+    }
     
+    @Override
     public void displayNextEvent() throws IOException { getEvent(true); }
     
+    @Override
     public void displayPreviousEvent() throws IOException { getEvent(false); }
     
+    @Override
     protected void updateStatusPanel() {
-    	// Update the superclass status fields.
-    	super.updateStatusPanel();
-    	
-		// Get the currently selected crystal.
-		Point crystal = ecalPanel.getSelectedCrystal();
-    	
-		// If the active crystal is not null, see if it is a cluster.
-		if(crystal != null) {
-			// Get the cluster associated with this point.
-			Cluster activeCluster = clusterMap.get(crystal);
-			
-			// If the cluster is null, we set everything to undefined.
-			if(activeCluster == null) {
-				for(String field : fieldNames) { setStatusField(field, StatusPanel.NULL_VALUE); }
-			}
-			
-			// Otherwise, define the fields based on the cluster.
-			else {
-				// Get the shared and component hit counts.
-				setStatusField(fieldNames[SHARED_HITS], Integer.toString(activeCluster.getSharedHitCount()));
-				setStatusField(fieldNames[COMPONENT_HITS], Integer.toString(activeCluster.getComponentHitCount()));
-				
-				// Format the cluster energy, or account for it if it
-				// doesn't exist.
-				String energy;
-				if(activeCluster.getClusterEnergy() != Double.NaN) {
-					DecimalFormat formatter = new DecimalFormat("0.####E0");
-					energy = formatter.format(activeCluster.getClusterEnergy());
-				}
-				else { energy = "---"; }
-				setStatusField(fieldNames[CLUSTER_ENERGY], energy);
-			}
-		}
-		// Otherwise, clear the field values.
-		else { for(String field : fieldNames) { setStatusField(field, StatusPanel.NULL_VALUE); } }
-    	
-    	// Set the event number.
-    	setStatusField(fieldNames[EVENT_NUMBER], Integer.toString(em.getEventNumber()));
+        // Update the superclass status fields.
+        super.updateStatusPanel();
+        
+        // Get the currently selected crystal.
+        Point crystal = ecalPanel.getSelectedCrystal();
+        
+        // If the active crystal is not null, see if it is a cluster.
+        if(crystal != null) {
+            // Get the cluster associated with this point.
+            Cluster activeCluster = clusterMap.get(crystal);
+            
+            // If the cluster is null, we set everything to undefined.
+            if(activeCluster == null) {
+                for(String field : fieldNames) { setStatusField(field, ResizableFieldPanel.NULL_VALUE); }
+            }
+            
+            // Otherwise, define the fields based on the cluster.
+            else {
+                // Get the shared and component hit counts.
+                setStatusField(fieldNames[SHARED_HITS], Integer.toString(activeCluster.getSharedHitCount()));
+                setStatusField(fieldNames[COMPONENT_HITS], Integer.toString(activeCluster.getComponentHitCount()));
+                
+                // Format the cluster energy, or account for it if it
+                // doesn't exist.
+                String energy;
+                if(activeCluster.getClusterEnergy() != Double.NaN) {
+                    DecimalFormat formatter = new DecimalFormat("0.####E0");
+                    energy = formatter.format(activeCluster.getClusterEnergy());
+                }
+                else { energy = "---"; }
+                setStatusField(fieldNames[CLUSTER_ENERGY], energy);
+            }
+        }
+        // Otherwise, clear the field values.
+        else { for(String field : fieldNames) { setStatusField(field, ResizableFieldPanel.NULL_VALUE); } }
+        
+        // Set the event number.
+        setStatusField(fieldNames[EVENT_NUMBER], Integer.toString(em.getEventNumber()));
     }
     
-	/**
-	 * <b>displayEvent</b><br/><br/>
-	 * <code>private void <b>displayEvent</b>(List<EcalHit> hitList, List<Cluster> clusterList)</code><br/><br/>
-	 * Displays the given lists of hits and clusters on the calorimeter
-	 * panel.
-	 * @param hitList - A list of hits for the current event.
-	 * @param clusterList  - A list of clusters for the current event.
-	 */
-	private void displayEvent(List<EcalHit> hitList, List<Cluster> clusterList) {
-		// Suppress the calorimeter panel's redrawing.
-		ecalPanel.setSuppressRedraw(true);
-		
+    /**
+     * <b>displayEvent</b><br/><br/>
+     * <code>private void <b>displayEvent</b>(List<EcalHit> hitList, List<Cluster> clusterList)</code><br/><br/>
+     * Displays the given lists of hits and clusters on the calorimeter
+     * panel.
+     * @param hitList - A list of hits for the current event.
+     * @param clusterList  - A list of clusters for the current event.
+     */
+    private void displayEvent(List<EcalHit> hitList, List<Cluster> clusterList) {
+        // Suppress the calorimeter panel's redrawing.
+        ecalPanel.setSuppressRedraw(true);
+        
         // Display the hits.
         for (EcalHit h : hitList) {
             int ix = toPanelX(h.getX());
@@ -115,19 +122,19 @@
         
         // Display the clusters.
         for(Cluster cluster : clusterList) {
-        	Point rawCluster = cluster.getClusterCenter();
-        	Point clusterCenter = toPanelPoint(rawCluster);
+            Point rawCluster = cluster.getClusterCenter();
+            Point clusterCenter = toPanelPoint(rawCluster);
             ecalPanel.setCrystalCluster(clusterCenter.x, clusterCenter.y, true);
             
-        	// Add component hits to the calorimeter panel.
-        	for(Point ch : cluster.getComponentHits()) {
-        		ecalPanel.addAssociation(new Association(clusterCenter, toPanelPoint(ch), HIGHLIGHT_CLUSTER_COMPONENT));
-        	}
-        	
-        	// Add shared hits to the calorimeter panel.
-        	for(Point sh : cluster.getSharedHits()) {
-        		ecalPanel.addAssociation(new Association(clusterCenter, toPanelPoint(sh), HIGHLIGHT_CLUSTER_SHARED));
-        	}
+            // Add component hits to the calorimeter panel.
+            for(Point ch : cluster.getComponentHits()) {
+                ecalPanel.addAssociation(new Association(clusterCenter, toPanelPoint(ch), HIGHLIGHT_CLUSTER_COMPONENT));
+            }
+            
+            // Add shared hits to the calorimeter panel.
+            for(Point sh : cluster.getSharedHits()) {
+                ecalPanel.addAssociation(new Association(clusterCenter, toPanelPoint(sh), HIGHLIGHT_CLUSTER_SHARED));
+            }
         }
         
         // Stop suppressing the redraw and order the panel to update.
@@ -136,7 +143,7 @@
         
         // Update the status panel to account for the new event.
         updateStatusPanel();
-	}
+    }
     
     /**
      * <b>getEvent</b><br/><br/>

Modified: java/branches/hps_java_trunk_HPSJAVA-255/ecal-event-display/src/main/java/org/hps/monitoring/ecal/eventdisplay/ui/OccupancyViewer.java
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/ecal-event-display/src/main/java/org/hps/monitoring/ecal/eventdisplay/ui/OccupancyViewer.java	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/ecal-event-display/src/main/java/org/hps/monitoring/ecal/eventdisplay/ui/OccupancyViewer.java	Mon Nov  3 01:04:28 2014
@@ -17,63 +17,59 @@
  * @author Kyle McCarty
  */
 public class OccupancyViewer extends ActiveViewer {
-	private static final long serialVersionUID = 3712604287904215617L;
-	// The number of events that have been read so far.
-	private long events = 0;
-	// The total number of hits for each crystal position.
-	private long[][] hits;
-	
-	/**
-	 * <b>OccupancyViewer</b><br/><br/>
-     * <code>public <b>OccupancyViewer</b>(EventManager em)</code><br/><br/>
+    private static final long serialVersionUID = 3712604287904215617L;
+    // The number of events that have been read so far.
+    private long events = 0;
+    // The total number of hits for each crystal position.
+    private long[][] hits;
+    
+    /**
      * Creates a new occupancy display that draws event data from the
      * indicated data source.
-	 * @param em - The data source from which to draw events.
-	 */
-	public OccupancyViewer(EventManager em) {
-		// Initialize the super class.
-		super(em);
-		
-		// Set the title and scale.
-		setTitle("HPS Calorimeter Occupancies");
-		ecalPanel.setScaleMaximum(1.0);
-		
-		// Initialize the hit counts array.
-		Dimension ecalSize = ecalPanel.getCrystalBounds();
-		hits = new long[ecalSize.width][ecalSize.height];
-	}
+     * @param em - The data source from which to draw events.
+     */
+    public OccupancyViewer(EventManager em) {
+        // Initialize the super class.
+        super(em);
+        
+        // Set the title and scale.
+        setTitle("HPS Calorimeter Occupancies");
+        ecalPanel.setScaleMaximum(1.0);
+        
+        // Initialize the hit counts array.
+        Dimension ecalSize = ecalPanel.getCrystalBounds();
+        hits = new long[ecalSize.width][ecalSize.height];
+    }
     
+    @Override
     public void displayNextEvent() throws IOException { getEvent(true); }
     
+    @Override
     public void displayPreviousEvent() throws IOException { getEvent(false); }
     
     /**
-     * <b>resetOccupancies</b><br/><br/>
-     * <code>public void <b>resetOccupancies</b>()</code><br/><br/>
      * Clears the current occupancy data.
      */
     public void resetOccupancies() {
-    	// Clear the crystal hit counts.
-    	for(int x = 0; x < hits.length; x++) {
-    		for(int y = 0; y < hits[0].length; y++) {
-    			hits[x][y] = 0;
-    		}
-    	}
-    	
-    	// Clear the number of events.
-    	events = 0;
+        // Clear the crystal hit counts.
+        for(int x = 0; x < hits.length; x++) {
+            for(int y = 0; y < hits[0].length; y++) {
+                hits[x][y] = 0;
+            }
+        }
+        
+        // Clear the number of events.
+        events = 0;
     }
     
-	/**
-	 * <b>displayEvent</b><br/><br/>
-	 * <code>private void <b>displayEvent</b>(List<EcalHit> hitList)</code><br/><br/>
-	 * Displays the given lists of hits on the calorimeter panel.
-	 * @param hitList - A list of hits for the current event.
-	 */
-	private void displayEvent(List<EcalHit> hitList) {
-		// Suppress the calorimeter panel's redrawing.
-		ecalPanel.setSuppressRedraw(true);
-		
+    /**
+     * Displays the given lists of hits on the calorimeter panel.
+     * @param hitList - A list of hits for the current event.
+     */
+    private void displayEvent(List<EcalHit> hitList) {
+        // Suppress the calorimeter panel's redrawing.
+        ecalPanel.setSuppressRedraw(true);
+        
         // Display the hits.
         for (EcalHit h : hitList) {
             ecalPanel.addCrystalEnergy(h.getX(), h.getY(), h.getEnergy());
@@ -85,11 +81,9 @@
         
         // Update the status panel to account for the new event.
         updateStatusPanel();
-	}
+    }
     
     /**
-     * <b>getEvent</b><br/><br/>
-     * <code>private void <b>getEvent</b>(boolean forward)</code><br/><br/>
      * Reads either the next or the previous event from the event manager.
      * @param forward - Whether the event data should be read forward
      * or backward.
@@ -104,44 +98,44 @@
         
         // Get the next event.
         if(forward) {
-        	// Get the next event.
-        	em.nextEvent();
-        	
-        	// Increment the event count.
-        	events++;
-        	
-        	// For each hit, increment the hit count for the relevant
-        	// crystal by one.
-        	for(EcalHit hit : em.getHits()) {
-        		hits[toPanelX(hit.getX())][toPanelY(hit.getY())]++;
-        	}
+            // Get the next event.
+            em.nextEvent();
+            
+            // Increment the event count.
+            events++;
+            
+            // For each hit, increment the hit count for the relevant
+            // crystal by one.
+            for(EcalHit hit : em.getHits()) {
+                hits[toPanelX(hit.getX())][toPanelY(hit.getY())]++;
+            }
         }
         else {
-        	// Get the previous event.
-        	em.previousEvent();
-        	
-        	// Decrement the event count.
-        	events--;
-        	
-        	// For each hit, decrement the hit count for the relevant
-        	// crystal by one.
-        	for(EcalHit hit : em.getHits()) {
-        		hits[toPanelX(hit.getX())][toPanelY(hit.getY())]--;
-        	}
+            // Get the previous event.
+            em.previousEvent();
+            
+            // Decrement the event count.
+            events--;
+            
+            // For each hit, decrement the hit count for the relevant
+            // crystal by one.
+            for(EcalHit hit : em.getHits()) {
+                hits[toPanelX(hit.getX())][toPanelY(hit.getY())]--;
+            }
         }
         
         // Build a "hit list" from the occupancies.
         ArrayList<EcalHit> occupancyList = new ArrayList<EcalHit>();
         for(int x = 0; x < hits.length; x++) {
-        	for(int y = 0; y < hits[0].length; y++) {
-        		if(hits[x][y] != 0) {
-        			// Define the crystal ID and "energy."
-        			Point cid = new Point(x, y);
-        			double occupancy = ((double) hits[x][y]) / events;
-        			EcalHit occupancyHit = new EcalHit(cid, occupancy);
-        			occupancyList.add(occupancyHit);
-        		}
-        	}
+            for(int y = 0; y < hits[0].length; y++) {
+                if(hits[x][y] != 0) {
+                    // Define the crystal ID and "energy."
+                    Point cid = new Point(x, y);
+                    double occupancy = ((double) hits[x][y]) / events;
+                    EcalHit occupancyHit = new EcalHit(cid, occupancy);
+                    occupancyList.add(occupancyHit);
+                }
+            }
         }
         
         // Display it the occupancies.

Modified: java/branches/hps_java_trunk_HPSJAVA-255/ecal-event-display/src/main/java/org/hps/monitoring/ecal/eventdisplay/ui/PEventViewer.java
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/ecal-event-display/src/main/java/org/hps/monitoring/ecal/eventdisplay/ui/PEventViewer.java	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/ecal-event-display/src/main/java/org/hps/monitoring/ecal/eventdisplay/ui/PEventViewer.java	Mon Nov  3 01:04:28 2014
@@ -22,60 +22,58 @@
  * @author Kyle McCarty
  */
 public class PEventViewer extends PassiveViewer {
-	private static final long serialVersionUID = -7479125553259270894L;
-	// Stores whether the background color is set or not.
-	private boolean background = false;
-	// Stores cluster objects.
-	protected ArrayList<Cluster> clusterList = new ArrayList<Cluster>();
-	// Stores hit objects.
-	protected ArrayList<EcalHit> hitList = new ArrayList<EcalHit>();
-	
-	/**
-	 * <b>PEventViewer</b><br/><br/>
-	 * <code>public <b>PEventViewer</b>(String... fieldValues)</code><br/><br/>
-	 * Creates a passive viewer for displaying hits and clusters in
-	 * an event.
-	 * @param fieldValues - Any additional status fields to display.
-	 */
-	public PEventViewer(String... fieldValues) {
-		// Pass the field values to the superclass.
-		super(fieldValues);
-		
-		// Set the key bindings.
-		addKeyListener(new EcalKeyListener());
-	}
-	
-	public void addHit(EcalHit hit) { hitList.add(hit); }
-	
-	public void addCluster(Cluster cluster) { clusterList.add(cluster); }
-	
-	/**
-	 * <b>clearHits</b><br/><br/>
-	 * <code>public void <b>clearHits</b>()</code><br/><br/>
-	 * Removes all of the hit data from the viewer.
-	 */
-	public void clearHits() { hitList.clear(); }
-	
-	/**
-	 * <b>clearClusters</b><br/><br/>
-	 * <code>public void <b>clearClusters</b>()</code><br/><br/>
-	 * Removes all of the cluster data from the viewer.
-	 */
-	public void clearClusters() { hitList.clear(); }
-	
-	public void resetDisplay() {
-		// Reset the hit and cluster lists.
-		hitList.clear();
-		clusterList.clear();
-	}
-	
-	public void updateDisplay() {
-		// Suppress the calorimeter panel's redrawing.
-		ecalPanel.setSuppressRedraw(true);
-		
-		// Clear the panel data.
-		ecalPanel.clearCrystals();
-		
+    private static final long serialVersionUID = -7479125553259270894L;
+    // Stores whether the background color is set or not.
+    private boolean background = false;
+    // Stores cluster objects.
+    protected ArrayList<Cluster> clusterList = new ArrayList<Cluster>();
+    // Stores hit objects.
+    protected ArrayList<EcalHit> hitList = new ArrayList<EcalHit>();
+    
+    /**
+     * Creates a passive viewer for displaying hits and clusters in
+     * an event.
+     * @param fieldValues - Any additional status fields to display.
+     */
+    public PEventViewer() {
+        // Initialize the superclass.
+        super();
+        
+        // Set the key bindings.
+        addKeyListener(new EcalKeyListener());
+    }
+    
+    @Override
+    public void addHit(EcalHit hit) { hitList.add(hit); }
+    
+    @Override
+    public void addCluster(Cluster cluster) { clusterList.add(cluster); }
+    
+    /**
+     * Removes all of the hit data from the viewer.
+     */
+    public void clearHits() { hitList.clear(); }
+    
+    /**
+     * Removes all of the cluster data from the viewer.
+     */
+    public void clearClusters() { hitList.clear(); }
+    
+    @Override
+    public void resetDisplay() {
+        // Reset the hit and cluster lists.
+        hitList.clear();
+        clusterList.clear();
+    }
+    
+    @Override
+    public void updateDisplay() {
+        // Suppress the calorimeter panel's redrawing.
+        ecalPanel.setSuppressRedraw(true);
+        
+        // Clear the panel data.
+        ecalPanel.clearCrystals();
+        
         // Display the hits.
         for (EcalHit h : hitList) {
             int ix = toPanelX(h.getX());
@@ -85,19 +83,19 @@
         
         // Display the clusters.
         for(Cluster cluster : clusterList) {
-        	Point rawCluster = cluster.getClusterCenter();
-        	Point clusterCenter = toPanelPoint(rawCluster);
+            Point rawCluster = cluster.getClusterCenter();
+            Point clusterCenter = toPanelPoint(rawCluster);
             ecalPanel.setCrystalCluster(clusterCenter.x, clusterCenter.y, true);
             
-        	// Add component hits to the calorimeter panel.
-        	for(Point ch : cluster.getComponentHits()) {
-        		ecalPanel.addAssociation(new Association(clusterCenter, toPanelPoint(ch), HIGHLIGHT_CLUSTER_COMPONENT));
-        	}
-        	
-        	// Add shared hits to the calorimeter panel.
-        	for(Point sh : cluster.getSharedHits()) {
-        		ecalPanel.addAssociation(new Association(clusterCenter, toPanelPoint(sh), HIGHLIGHT_CLUSTER_SHARED));
-        	}
+            // Add component hits to the calorimeter panel.
+            for(Point ch : cluster.getComponentHits()) {
+                ecalPanel.addAssociation(new Association(clusterCenter, toPanelPoint(ch), HIGHLIGHT_CLUSTER_COMPONENT));
+            }
+            
+            // Add shared hits to the calorimeter panel.
+            for(Point sh : cluster.getSharedHits()) {
+                ecalPanel.addAssociation(new Association(clusterCenter, toPanelPoint(sh), HIGHLIGHT_CLUSTER_SHARED));
+            }
         }
         
         // Stop suppressing the redraw and order the panel to update.
@@ -106,25 +104,27 @@
         
         // Update the status panel to account for the new event.
         updateStatusPanel();
-	}
-	
+    }
+    
     /**
      * The <code>EcalListener</code> class binds keys to actions.
      * Bound actions include:
      * b             :: Toggle color-mapping for 0 energy crystals
      * h             :: Toggle selected crystal highlighting
      * l             :: Toggle logarithmic versus linear scaling
-     * s			 :: Saves the current display to a file
+     * s             :: Saves the current display to a file
      **/
     private class EcalKeyListener implements KeyListener {
+        @Override
         public void keyPressed(KeyEvent e) { }
         
+        @Override
         public void keyReleased(KeyEvent e) {
             // 'b' toggles the default white background.
             if(e.getKeyCode() == 66) {
-            	if(background) { ecalPanel.setDefaultCrystalColor(null); }
-            	else { ecalPanel.setDefaultCrystalColor(Color.GRAY); }
-            	background = !background;
+                if(background) { ecalPanel.setDefaultCrystalColor(null); }
+                else { ecalPanel.setDefaultCrystalColor(Color.GRAY); }
+                background = !background;
             }
             
             // 'h' toggles highlighting the crystal under the cursor.
@@ -132,39 +132,40 @@
             
             // 'l' toggles linear or logarithmic scaling.
             else if(e.getKeyCode() == 76) {
-            	if(ecalPanel.isScalingLinear()) { ecalPanel.setScalingLogarithmic(); }
-            	else { ecalPanel.setScalingLinear(); }
+                if(ecalPanel.isScalingLinear()) { ecalPanel.setScalingLogarithmic(); }
+                else { ecalPanel.setScalingLinear(); }
             }
             
             // 's' saves the panel to a file.
             else if(e.getKeyCode() == 83) {
-            	// Make a new buffered image on which to draw the content pane.
-            	BufferedImage screenshot = new BufferedImage(getContentPane().getWidth(),
-            			getContentPane().getHeight(), BufferedImage.TYPE_INT_ARGB);
-            	
-            	// Paint the content pane to image.
-            	getContentPane().paint(screenshot.getGraphics());
-            	
-            	// Get the lowest available file name.
-            	int fileNum = 0;
-            	File imageFile = new File("screenshot_" + fileNum + ".png");
-            	while(imageFile.exists()) {
-            		fileNum++;
-            		imageFile = new File("screenshot_" + fileNum + ".png");
-            	}
-            	
-            	// Save the image to a PNG file.
-            	try { ImageIO.write(screenshot, "PNG", imageFile); }
-            	catch(IOException ioe) {
-            		System.err.println("Error saving file \"screenshot.png\".");
-            	}
-            	System.out.println("Screenshot saved to: " + imageFile.getAbsolutePath());
+                // Make a new buffered image on which to draw the content pane.
+                BufferedImage screenshot = new BufferedImage(getContentPane().getWidth(),
+                        getContentPane().getHeight(), BufferedImage.TYPE_INT_ARGB);
+                
+                // Paint the content pane to image.
+                getContentPane().paint(screenshot.getGraphics());
+                
+                // Get the lowest available file name.
+                int fileNum = 0;
+                File imageFile = new File("screenshot_" + fileNum + ".png");
+                while(imageFile.exists()) {
+                    fileNum++;
+                    imageFile = new File("screenshot_" + fileNum + ".png");
+                }
+                
+                // Save the image to a PNG file.
+                try { ImageIO.write(screenshot, "PNG", imageFile); }
+                catch(IOException ioe) {
+                    System.err.println("Error saving file \"screenshot.png\".");
+                }
+                System.out.println("Screenshot saved to: " + imageFile.getAbsolutePath());
             }
             
             // Otherwise, print out the key code for the pressed key.
             else { System.out.printf("Key Code: %d%n", e.getKeyCode()); }
         }
         
+        @Override
         public void keyTyped(KeyEvent e) { }
     }
 }

Modified: java/branches/hps_java_trunk_HPSJAVA-255/ecal-event-display/src/main/java/org/hps/monitoring/ecal/eventdisplay/ui/POccupancyViewer.java
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/ecal-event-display/src/main/java/org/hps/monitoring/ecal/eventdisplay/ui/POccupancyViewer.java	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/ecal-event-display/src/main/java/org/hps/monitoring/ecal/eventdisplay/ui/POccupancyViewer.java	Mon Nov  3 01:04:28 2014
@@ -16,100 +16,93 @@
  * @author Kyle McCarty
  */
 public class POccupancyViewer extends PassiveViewer {
-	private static final long serialVersionUID = 3712604287904215617L;
-	// Store the number of hits for each crystal.
-	private long[][] hits;
-	// Store the total number of events read.
-	private long events = 0;
-	// Stores hit objects.
-	protected ArrayList<EcalHit> hitList = new ArrayList<EcalHit>();
-	
-	/**
-	 * <b>POccupancyViewer</b><br/><br/>
-     * <code>public <b>POccupancyViewer</b>(int updateRate, boolean resetAtUpdate)</code><br/><br/>
+    private static final long serialVersionUID = 3712604287904215617L;
+    // Store the number of hits for each crystal.
+    private long[][] hits;
+    // Store the total number of events read.
+    private long events = 0;
+    // Stores hit objects.
+    protected ArrayList<EcalHit> hitList = new ArrayList<EcalHit>();
+    
+    /**
      * Initializes a <code>Viewer</code> window that displays will
      * occupancies from a data stream.
-	 */
-	public POccupancyViewer() {
-		// Set the title and scale.
-		setTitle("HPS Calorimeter Occupancies");
-		ecalPanel.setScaleMaximum(1.0);
-		
-		// Initialize the hit counts array.
-		Dimension ecalSize = ecalPanel.getCrystalBounds();
-		hits = new long[ecalSize.width][ecalSize.height];
-	}
+     */
+    public POccupancyViewer() {
+        // Set the title and scale.
+        setTitle("HPS Calorimeter Occupancies");
+        ecalPanel.setScaleMaximum(1.0);
+        
+        // Initialize the hit counts array.
+        Dimension ecalSize = ecalPanel.getCrystalBounds();
+        hits = new long[ecalSize.width][ecalSize.height];
+    }
     
-	public void addHit(EcalHit hit) {
-		// Get the panel coordinates of the hit.
-		int ix = toPanelX(hit.getX());
-		int iy = toPanelY(hit.getY());
-		
-		// Increment the hit count at the indicated location.
-		hits[ix][iy]++;
-	}
-	
-	/**
-	 * <b>addCluster</b><br/><br/>
-	 * <code>public void <b>addCluster</b>(Cluster cluster)</code><br/><br/>
-	 * Adds a new cluster to the display.<br/><br/>
-	 * <b>Note:</b> This operation is not supported for occupancies.
-	 */
-	public void addCluster(Cluster cluster) { }
-	
-	/**
-	 * <b>removeHit</b><br/><br/>
-	 * <code>public void <b>removeHit</b>(EcalHit hit)</code><br/><br/>
-	 * Removes a hit from the display.
-	 * @param hit - The hit to be removed.
-	 */
-	public void removeHit(EcalHit hit) {
-		// Get the panel coordinates of the hit.
-		int ix = toPanelX(hit.getX());
-		int iy = toPanelY(hit.getY());
-		
-		// Decrement the hit count at the indicated location.
-		hits[ix][iy]--;
-	}
-	
-	public void resetDisplay() { hitList.clear(); }
-	
-	/**
-	 * <b>incrementEventCount</b><br/><br/>
-	 * <code>public void <b>incrementEventCount</b>(int amount)</code><br/><br/>
-	 * Increments the number of events represented by the current data
-	 * set by the indicated amount. Note that this may be negative to
-	 * reduce the number of events.
-	 * @param amount - The number of events to add.
-	 */
-	public void incrementEventCount(int amount) { events += amount; }
-	
-	/**
-	 * <b>updateDisplay</b><br/><br/>
-	 * <code>public void <b>updateDisplay</b>()</code><br/><br/>
-	 * Displays the hits and clusters added by the <code>addHit</code>
-	 * and <code>addCluster</code> methods.
-	 */
-	public void updateDisplay() { 
+    @Override
+    public void addHit(EcalHit hit) {
+        // Get the panel coordinates of the hit.
+        int ix = toPanelX(hit.getX());
+        int iy = toPanelY(hit.getY());
+        
+        // Increment the hit count at the indicated location.
+        hits[ix][iy]++;
+    }
+    
+    /**
+     * Adds a new cluster to the display.<br/><br/>
+     * <b>Note:</b> This operation is not supported for occupancies.
+     */
+    public void addCluster(Cluster cluster) { }
+    
+    /**
+     * Removes a hit from the display.
+     * @param hit - The hit to be removed.
+     */
+    public void removeHit(EcalHit hit) {
+        // Get the panel coordinates of the hit.
+        int ix = toPanelX(hit.getX());
+        int iy = toPanelY(hit.getY());
+        
+        // Decrement the hit count at the indicated location.
+        hits[ix][iy]--;
+    }
+    
+    @Override
+    public void resetDisplay() { hitList.clear(); }
+    
+    /**
+     * Increments the number of events represented by the current data
+     * set by the indicated amount. Note that this may be negative to
+     * reduce the number of events.
+     * @param amount - The number of events to add.
+     */
+    public void incrementEventCount(int amount) { events += amount; }
+    
+    /**
+     * Displays the hits and clusters added by the <code>addHit</code>
+     * and <code>addCluster</code> methods.
+     */
+    @Override
+    public void updateDisplay() { 
         // Build a "hit list" from the occupancies.
         for(int x = 0; x < hits.length; x++) {
-        	for(int y = 0; y < hits[0].length; y++) {
-        		// Don't bother performing calculations or building
-        		// any objects if there are zero hits.
-        		if(hits[x][y] != 0) {
-        			// Define the crystal ID and "energy."
-        			Point cid = new Point(x, y);
-        			double occupancy = ((double) hits[x][y]) / events;
-        			
-        			// Add a "hit" formed from these values.
-        			hitList.add(new EcalHit(cid, occupancy));
-        		}
-        	}
+            for(int y = 0; y < hits[0].length; y++) {
+                // Don't bother performing calculations or building
+                // any objects if there are zero hits.
+                if(hits[x][y] != 0) {
+                    // Define the crystal ID and "energy."
+                    Point cid = new Point(x, y);
+                    double occupancy = ((double) hits[x][y]) / events;
+                    
+                    // Add a "hit" formed from these values.
+                    hitList.add(new EcalHit(cid, occupancy));
+                }
+            }
         }
         
-		// Suppress the calorimeter panel's redrawing.
-		ecalPanel.setSuppressRedraw(true);
-		
+        // Suppress the calorimeter panel's redrawing.
+        ecalPanel.setSuppressRedraw(true);
+        
         // Display the hits.
         for (EcalHit h : hitList) {
             int ix = toPanelX(h.getX());
@@ -123,5 +116,5 @@
         
         // Update the status panel to account for the new event.
         updateStatusPanel();
-	}
+    }
 }

Modified: java/branches/hps_java_trunk_HPSJAVA-255/ecal-event-display/src/main/java/org/hps/monitoring/ecal/eventdisplay/ui/PassiveViewer.java
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/ecal-event-display/src/main/java/org/hps/monitoring/ecal/eventdisplay/ui/PassiveViewer.java	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/ecal-event-display/src/main/java/org/hps/monitoring/ecal/eventdisplay/ui/PassiveViewer.java	Mon Nov  3 01:04:28 2014
@@ -20,94 +20,94 @@
  * @author Kyle McCarty
  */
 public abstract class PassiveViewer extends Viewer {
-	private static final long serialVersionUID = -7479125553259270894L;
-	// Stores whether the background color is set or not.
-	private boolean background = false;
-	
-	/**
-	 * <b>PassiveViewer</b><br/><br/>
-	 * <code>public <b>PassiveViewer</b>(String... fieldValues)</code><br/><br/>
-	 * @param fieldValues
-	 */
-	public PassiveViewer(String... fieldValues) {
-		// Pass the field values to the superclass.
-		super(fieldValues);
-		
-		// Set the key bindings.
-		addKeyListener(new EcalKeyListener());
-	}
-	
-	/**
-	 * <b>addHit</b><br/><br/>
-	 * <code>public void <b>addHit</b>(EcalHit hit)</code><br/><br/>
-	 * Adds a new hit to the display.
-	 * @param hit - The hit to be added.
-	 */
-	public abstract void addHit(EcalHit hit);
-	
-	/**
-	 * <b>addCluster</b><br/><br/>
-	 * <code>public void <b>addCluster</b>(Cluster cluster)</code><br/><br/>
-	 * Adds a new cluster to the display.
-	 * @param cluster - The cluster to be added.
-	 */
-	public abstract void addCluster(Cluster cluster);
-	
-	/**
-	 * <b>resetDisplay</b><br/><br/>
-	 * <code>public void <b>resetDisplay</b>()</code><br/><br/>
-	 * Clears any hits or clusters that have been added to the viewer.
-	 * Note that this does not automatically update the displayed panel.
-	 * <code>updateDisplay</code> must be called separately.
-	 */
-	public abstract void resetDisplay();
-	
-	/**
-	 * <b>setScale</b><br/><br/>
-	 * <code>public void <b>setScale</b>(int min, int max)</code><br/><br/>
-	 * Sets the upper and lower bounds of for the calorimeter display's
-	 * color mapping scale.
-	 * @param min - The lower bound.
-	 * @param max - The upper bound.
-	 */
-	public void setScale(int min, int max) {
-		ecalPanel.setScaleMinimum(min);
-		ecalPanel.setScaleMaximum(max);
-	}
-	
-	/**
-	 * <b>setScaleMaximum</b><br/><br/>
-	 * <code>public void <b>setScaleMaximum</b>(int max)</code><br/><br/>
-	 * Sets the upper bound for the calorimeter display's color mapping
-	 * scale.
-	 * @param max - The upper bound.
-	 */
-	public void setScaleMaximum(int max) { ecalPanel.setScaleMaximum(max); }
-	
-	/**
-	 * <b>setScaleMinimum</b><br/><br/>
-	 * <code>public void <b>setScaleMinimum</b>(int min)</code><br/><br/>
-	 * Sets the lower bound for the calorimeter display's color mapping
-	 * scale.
-	 * @param min - The lower bound.
-	 */
-	public void setScaleMinimum(int min) { ecalPanel.setScaleMinimum(min); }
-	
-	/**
-	 * <b>updateDisplay</b><br/><br/>
-	 * <code>public void <b>updateDisplay</b>()</code><br/><br/>
-	 * Displays the hits and clusters added by the <code>addHit</code>
-	 * and <code>addCluster</code> methods.
-	 */
-	public abstract void updateDisplay();
-	
+    private static final long serialVersionUID = -7479125553259270894L;
+    // Stores whether the background color is set or not.
+    private boolean background = false;
+    
+    /**
+     * <b>PassiveViewer</b><br/><br/>
+     * <code>public <b>PassiveViewer</b>(String... fieldValues)</code><br/><br/>
+     * @param fieldValues
+     */
+    public PassiveViewer() {
+        // Initialize the superclass.
+        super();
+        
+        // Set the key bindings.
+        addKeyListener(new EcalKeyListener());
+    }
+    
+    /**
+     * <b>addHit</b><br/><br/>
+     * <code>public void <b>addHit</b>(EcalHit hit)</code><br/><br/>
+     * Adds a new hit to the display.
+     * @param hit - The hit to be added.
+     */
+    public abstract void addHit(EcalHit hit);
+    
+    /**
+     * <b>addCluster</b><br/><br/>
+     * <code>public void <b>addCluster</b>(Cluster cluster)</code><br/><br/>
+     * Adds a new cluster to the display.
+     * @param cluster - The cluster to be added.
+     */
+    public abstract void addCluster(Cluster cluster);
+    
+    /**
+     * <b>resetDisplay</b><br/><br/>
+     * <code>public void <b>resetDisplay</b>()</code><br/><br/>
+     * Clears any hits or clusters that have been added to the viewer.
+     * Note that this does not automatically update the displayed panel.
+     * <code>updateDisplay</code> must be called separately.
+     */
+    public abstract void resetDisplay();
+    
+    /**
+     * <b>setScale</b><br/><br/>
+     * <code>public void <b>setScale</b>(int min, int max)</code><br/><br/>
+     * Sets the upper and lower bounds of for the calorimeter display's
+     * color mapping scale.
+     * @param min - The lower bound.
+     * @param max - The upper bound.
+     */
+    public void setScale(int min, int max) {
+        ecalPanel.setScaleMinimum(min);
+        ecalPanel.setScaleMaximum(max);
+    }
+    
+    /**
+     * <b>setScaleMaximum</b><br/><br/>
+     * <code>public void <b>setScaleMaximum</b>(int max)</code><br/><br/>
+     * Sets the upper bound for the calorimeter display's color mapping
+     * scale.
+     * @param max - The upper bound.
+     */
+    public void setScaleMaximum(int max) { ecalPanel.setScaleMaximum(max); }
+    
+    /**
+     * <b>setScaleMinimum</b><br/><br/>
+     * <code>public void <b>setScaleMinimum</b>(int min)</code><br/><br/>
+     * Sets the lower bound for the calorimeter display's color mapping
+     * scale.
+     * @param min - The lower bound.
+     */
+    public void setScaleMinimum(int min) { ecalPanel.setScaleMinimum(min); }
+    
+    /**
+     * <b>updateDisplay</b><br/><br/>
+     * <code>public void <b>updateDisplay</b>()</code><br/><br/>
+     * Displays the hits and clusters added by the <code>addHit</code>
+     * and <code>addCluster</code> methods.
+     */
+    public abstract void updateDisplay();
+    
     /**
      * The <code>EcalListener</code> class binds keys to actions.
      * Bound actions include:
      * b             :: Toggle color-mapping for 0 energy crystals
      * h             :: Toggle selected crystal highlighting
      * l             :: Toggle logarithmic versus linear scaling
-     * s			 :: Saves the current display to a file
+     * s             :: Saves the current display to a file
      **/
     private class EcalKeyListener implements KeyListener {
         public void keyPressed(KeyEvent e) { }
@@ -115,9 +115,9 @@
         public void keyReleased(KeyEvent e) {
             // 'b' toggles the default white background.
             if(e.getKeyCode() == 66) {
-            	if(background) { ecalPanel.setDefaultCrystalColor(null); }
-            	else { ecalPanel.setDefaultCrystalColor(Color.GRAY); }
-            	background = !background;
+                if(background) { ecalPanel.setDefaultCrystalColor(null); }
+                else { ecalPanel.setDefaultCrystalColor(Color.GRAY); }
+                background = !background;
             }
             
             // 'h' toggles highlighting the crystal under the cursor.
@@ -125,33 +125,33 @@
             
             // 'l' toggles linear or logarithmic scaling.
             else if(e.getKeyCode() == 76) {
-            	if(ecalPanel.isScalingLinear()) { ecalPanel.setScalingLogarithmic(); }
-            	else { ecalPanel.setScalingLinear(); }
+                if(ecalPanel.isScalingLinear()) { ecalPanel.setScalingLogarithmic(); }
+                else { ecalPanel.setScalingLinear(); }
             }
             
             // 's' saves the panel to a file.
             else if(e.getKeyCode() == 83) {
-            	// Make a new buffered image on which to draw the content pane.
-            	BufferedImage screenshot = new BufferedImage(getContentPane().getWidth(),
-            			getContentPane().getHeight(), BufferedImage.TYPE_INT_ARGB);
-            	
-            	// Paint the content pane to image.
-            	getContentPane().paint(screenshot.getGraphics());
-            	
-            	// Get the lowest available file name.
-            	int fileNum = 0;
-            	File imageFile = new File("screenshot_" + fileNum + ".png");
-            	while(imageFile.exists()) {
-            		fileNum++;
-            		imageFile = new File("screenshot_" + fileNum + ".png");
-            	}
-            	
-            	// Save the image to a PNG file.
-            	try { ImageIO.write(screenshot, "PNG", imageFile); }
-            	catch(IOException ioe) {
-            		System.err.println("Error saving file \"screenshot.png\".");
-            	}
-            	System.out.println("Screenshot saved to: " + imageFile.getAbsolutePath());
+                // Make a new buffered image on which to draw the content pane.
+                BufferedImage screenshot = new BufferedImage(getContentPane().getWidth(),
+                        getContentPane().getHeight(), BufferedImage.TYPE_INT_ARGB);
+                
+                // Paint the content pane to image.
+                getContentPane().paint(screenshot.getGraphics());
+                
+                // Get the lowest available file name.
+                int fileNum = 0;
+                File imageFile = new File("screenshot_" + fileNum + ".png");
+                while(imageFile.exists()) {
+                    fileNum++;
+                    imageFile = new File("screenshot_" + fileNum + ".png");
+                }
+                
+                // Save the image to a PNG file.
+                try { ImageIO.write(screenshot, "PNG", imageFile); }
+                catch(IOException ioe) {
+                    System.err.println("Error saving file \"screenshot.png\".");
+                }
+                System.out.println("Screenshot saved to: " + imageFile.getAbsolutePath());
             }
             
             // Otherwise, print out the key code for the pressed key.

Modified: java/branches/hps_java_trunk_HPSJAVA-255/ecal-event-display/src/main/java/org/hps/monitoring/ecal/eventdisplay/ui/StatusPanel.java
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/ecal-event-display/src/main/java/org/hps/monitoring/ecal/eventdisplay/ui/StatusPanel.java	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/ecal-event-display/src/main/java/org/hps/monitoring/ecal/eventdisplay/ui/StatusPanel.java	Mon Nov  3 01:04:28 2014
@@ -9,188 +9,180 @@
 
 /**
  * Class <code>StatusPanel</code> displays text in a set of fields.
+ * This class is being phased out in favor of <code>ResizableFieldPanel
+ * </code> and should no longer be used. It will be removed next update.
  *
  * @author Kyle McCarty
  */
+@Deprecated
 public class StatusPanel extends JPanel {
-	private static final long serialVersionUID = -8353479383875379010L;
-	// The panel that displays behind the status field.
-	private BackPanel background = new BackPanel();
-	// The status fields. The first array index represents which status
-	// field and the second is always of size two, with index 0 mapping
-	// to the label that displays the field name and index 1 mapping to
-	// the label displaying the field value.
-	private JLabel[][] field;
-	// Spacing variables for panel layout.
-	private int leftBuffer = 10;
-	private int upperBuffer = 10;
-	
-	/**
-	 * <b>NULL_VALUE</b><br/><br/>
-	 * <code><b>static final String <b>NULL_VALUE</b></code><br/><br/>
-	 * A <code>String</code> representing the default value to be
-	 * displayed on the status panel whenever there is no value for
-	 * that field.
-	 */
-	static final String NULL_VALUE = "---";
-	
-	/**
-	 * <b>StatusPanel</b><br/><br/>
-	 * <code>public <b>StatusPanel</b>(String... fieldName)</code><br/><br/>
-	 * Creates a new status panel with display fields with the indicated
-	 * names. They will be assigned a field index in the order that they
-	 * are given starting with zero.
-	 * @param fieldName - The names of the fields to display.
-	 */
-	public StatusPanel(String... fieldName) {
-		// Initialize the component.
-		super();
-		
-		// Set the layout manager to manual.
-		setLayout(null);
-		
-		// Build the text fields.
-		int curZ = 0;
-		field = new JLabel[fieldName.length][2];
-		for(int i = 0; i < field.length; i++) {
-			for(int j = 0; j < field[i].length; j++) {
-				field[i][j] = new JLabel();
-				field[i][j].setOpaque(true);
-				field[i][j].setBackground(Color.WHITE);
-				add(field[i][j]);
-				setComponentZOrder(field[i][j], curZ);
-				curZ++;
-			}
-			field[i][0].setText(fieldName[i] + ":   ");
-			field[i][0].setHorizontalAlignment(JLabel.RIGHT);
-		}
-		
-		// Start the fields as null by default.
-		clearValues();
-		
-		// Build the background panel.
-		add(background);
-		setComponentZOrder(background, curZ);
-	}
-	
-	/**
-	 * <b>clearValues</b><br/><br/>
-	 * <code>public void <b>clearValues</b>()</code><br/><br/>
-	 * Sets all of the fields on the status display to the null value.
-	 */
-	public void clearValues() {
-		for(int i = 0; i < field.length; i++) {
-			field[i][1].setText(NULL_VALUE);
-		}
-	}
-	
-	/**
-	 * <b>setFieldValue</b><br/><br/>
-	 * Sets the value of the indicated field.
-	 * @param index - The field's index.
-	 * @param value - The new value to display.
-	 * @throws IndexOutOfBoundsException Occurs when the field index
-	 * is neither more than the existing number of fields or is negative.
-	 */
-	public void setFieldValue(int index, String value) throws IndexOutOfBoundsException {
-		if(index >= 0 && index < field.length) {
-			if(value == null) { field[index][1].setText(NULL_VALUE); }
-			else  { field[index][1].setText(value); }
-		}
-		else { throw new IndexOutOfBoundsException("Invalid field index."); }
-	}
-	
-	public void setSize(int width, int height) {
-		super.setSize(width, height);
-		resize();
-	}
-	
-	public void setSize(Dimension d) {
-		super.setSize(d);
-		resize();
-	}
-	
-	/**
-	 *<b>getNextX</b><br/><br/>
-	 * <code>private int <b>getNextX</b>(Component c)</code><br/><br/>
-	 * Finds the x-coordinate immediately after the component.
-	 * @param c - The component of which to find the end.
-	 * @return Returns the x-coordinate at the end of the component. 
-	 */
-	private final static int getNextX(Component c) { return getNextX(c, 0); }
-	
-	/**
-	/**
-	 *<b>getNextX</b><br/><br/>
-	 * <code>private int <b>getNextX</b>(Component c, int buffer)</code><br/><br/>
-	 * Finds the x-coordinate after the component with a given buffer.
-	 * @param c - The component of which to find the end.
-	 * @param buffer - The extra space after the component to be included.
-	 * @return Returns the x-coordinate at the end of the component,
-	 * with a buffer length.
-	 */
-	private final static int getNextX(Component c, int buffer) {
-		return c.getX() + c.getWidth() + buffer;
-	}
-	
-	/**
-	 * <b>resize</b><br/><br/>
-	 * <code>private void <b>resize</b>()</code><br/><br/>
-	 * Updates the layout of the component to the panel's current size.
-	 */
-	private void resize() {
-		// Define the width an height as convenience variables.
-		int width = getWidth();
-		int height = getHeight();
-		
-		// Size the background panel.
-		background.setBounds(0, 0, width, height);
-		
-		// Size and place the text labels.
-		if(field.length != 0) {
-			int labelHeight = (height - (int)(upperBuffer + 5)) / 3;
-			int labelRem = (height - upperBuffer - 8) % field.length;
-			int curX = leftBuffer;
-			int curY = (int)(upperBuffer + 2);
-			for(int i = 0; i < field.length; i++) {
-				// Determine the appropriate field height.
-				int thisHeight = labelHeight;
-				if(labelRem > 0) {
-					thisHeight++;
-					labelRem--;
-				}
-				
-				// Place the field.
-				field[i][0].setBounds(curX, curY, 130, thisHeight);
-				field[i][1].setBounds(getNextX(field[i][0]), curY, 75, thisHeight);
-				
-				// If we have written three labels, then start a new column.
-				if(i % 3 == 2) {
-					curX = getNextX(field[i][1], 10);
-					curY = (int)(upperBuffer + 2);
-				}
-				
-				// Otherwise just increment the current height.
-				else { curY += thisHeight; }
-			}
-		}
-	}
-	
-	/**
-	 * Class <code>BackPanel</code> simply renders the background panel
-	 * for the status panel.
-	 */
-	private class BackPanel extends JPanel {
-		private static final long serialVersionUID = 4997805650267243080L;
+    private static final long serialVersionUID = -8353479383875379010L;
+    // The panel that displays behind the status field.
+    private BackPanel background = new BackPanel();
+    // The status fields. The first array index represents which status
+    // field and the second is always of size two, with index 0 mapping
+    // to the label that displays the field name and index 1 mapping to
+    // the label displaying the field value.
+    private JLabel[][] field;
+    // Spacing variables for panel layout.
+    private int leftBuffer = 10;
+    private int upperBuffer = 10;
+    
+    /**
+     * A <code>String</code> representing the default value to be
+     * displayed on the status panel whenever there is no value for
+     * that field.
+     */
+    static final String NULL_VALUE = "---";
+    
+    /**
+     * Creates a new status panel with display fields with the indicated
+     * names. They will be assigned a field index in the order that they
+     * are given starting with zero.
+     * @param fieldName - The names of the fields to display.
+     */
+    public StatusPanel(String... fieldName) {
+        // Initialize the component.
+        super();
+        
+        // Set the layout manager to manual.
+        setLayout(null);
+        
+        // Build the text fields.
+        int curZ = 0;
+        field = new JLabel[fieldName.length][2];
+        for(int i = 0; i < field.length; i++) {
+            for(int j = 0; j < field[i].length; j++) {
+                field[i][j] = new JLabel();
+                field[i][j].setOpaque(true);
+                field[i][j].setBackground(Color.WHITE);
+                add(field[i][j]);
+                setComponentZOrder(field[i][j], curZ);
+                curZ++;
+            }
+            field[i][0].setText(fieldName[i] + ":   ");
+            field[i][0].setHorizontalAlignment(JLabel.RIGHT);
+        }
+        
+        // Start the fields as null by default.
+        clearValues();
+        
+        // Build the background panel.
+        add(background);
+        setComponentZOrder(background, curZ);
+    }
+    
+    /**
+     * Sets all of the fields on the status display to the null value.
+     */
+    public void clearValues() {
+        for(int i = 0; i < field.length; i++) {
+            field[i][1].setText(NULL_VALUE);
+        }
+    }
+    
+    /**
+     * Sets the value of the indicated field.
+     * @param index - The field's index.
+     * @param value - The new value to display.
+     * @throws IndexOutOfBoundsException Occurs when the field index
+     * is neither more than the existing number of fields or is negative.
+     */
+    public void setFieldValue(int index, String value) throws IndexOutOfBoundsException {
+        if(index >= 0 && index < field.length) {
+            if(value == null) { field[index][1].setText(NULL_VALUE); }
+            else  { field[index][1].setText(value); }
+        }
+        else { throw new IndexOutOfBoundsException("Invalid field index."); }
+    }
+    
+    @Override
+    public void setSize(int width, int height) {
+        super.setSize(width, height);
+        resize();
+    }
+    
+    @Override
+    public void setSize(Dimension d) {
+        super.setSize(d);
+        resize();
+    }
+    
+    /**
+     * Finds the x-coordinate immediately after the component.
+     * @param c - The component of which to find the end.
+     * @return Returns the x-coordinate at the end of the component. 
+     */
+    private final static int getNextX(Component c) { return getNextX(c, 0); }
+    
+    /**
+    /**
+     * Finds the x-coordinate after the component with a given buffer.
+     * @param c - The component of which to find the end.
+     * @param buffer - The extra space after the component to be included.
+     * @return Returns the x-coordinate at the end of the component,
+     * with a buffer length.
+     */
+    private final static int getNextX(Component c, int buffer) {
+        return c.getX() + c.getWidth() + buffer;
+    }
+    
+    /**
+     * Updates the layout of the component to the panel's current size.
+     */
+    private void resize() {
+        // Define the width an height as convenience variables.
+        int width = getWidth();
+        int height = getHeight();
+        
+        // Size the background panel.
+        background.setBounds(0, 0, width, height);
+        
+        // Size and place the text labels.
+        if(field.length != 0) {
+            int labelHeight = (height - (int)(upperBuffer + 5)) / 3;
+            int labelRem = (height - upperBuffer - 8) % field.length;
+            int curX = leftBuffer;
+            int curY = (int)(upperBuffer + 2);
+            for(int i = 0; i < field.length; i++) {
+                // Determine the appropriate field height.
+                int thisHeight = labelHeight;
+                if(labelRem > 0) {
+                    thisHeight++;
+                    labelRem--;
+                }
+                
+                // Place the field.
+                field[i][0].setBounds(curX, curY, 130, thisHeight);
+                field[i][1].setBounds(getNextX(field[i][0]), curY, 75, thisHeight);
+                
+                // If we have written three labels, then start a new column.
+                if(i % 3 == 2) {
+                    curX = getNextX(field[i][1], 10);
+                    curY = (int)(upperBuffer + 2);
+                }
+                
+                // Otherwise just increment the current height.
+                else { curY += thisHeight; }
+            }
+        }
+    }
+    
+    /**
+     * Class <code>BackPanel</code> simply renders the background panel
+     * for the status panel.
+     */
+    private class BackPanel extends JPanel {
+        private static final long serialVersionUID = 4997805650267243080L;
 
-		public void paint(Graphics g) {
-			// Render the panel background.
-			g.setColor(Color.WHITE);
-			g.fillRect(0, upperBuffer, getWidth(), getHeight() - upperBuffer);
-			g.setColor(Color.GRAY);
-			g.drawRect(0, upperBuffer, getWidth() - 1, getHeight() - upperBuffer - 1);
-			g.setColor(Color.LIGHT_GRAY);
-			g.drawRect(1, upperBuffer + 1, getWidth() - 3, getHeight() - upperBuffer - 3);
-		}
-	}
+        public void paint(Graphics g) {
+            // Render the panel background.
+            g.setColor(Color.WHITE);
+            g.fillRect(0, upperBuffer, getWidth(), getHeight() - upperBuffer);
+            g.setColor(Color.GRAY);
+            g.drawRect(0, upperBuffer, getWidth() - 1, getHeight() - upperBuffer - 1);
+            g.setColor(Color.LIGHT_GRAY);
+            g.drawRect(1, upperBuffer + 1, getWidth() - 3, getHeight() - upperBuffer - 3);
+        }
+    }
 }

Modified: java/branches/hps_java_trunk_HPSJAVA-255/ecal-readout-sim/pom.xml
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/ecal-readout-sim/pom.xml	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/ecal-readout-sim/pom.xml	Mon Nov  3 01:04:28 2014
@@ -8,7 +8,7 @@
         <groupId>org.hps</groupId>
         <artifactId>hps-parent</artifactId>
         <relativePath>../parent/pom.xml</relativePath>
-        <version>3.0.3-SNAPSHOT</version>
+        <version>3.1-SNAPSHOT</version>
     </parent>
     <scm>
         <url>http://java.freehep.org/svn/repos/hps/list/java/trunk/ecal-readout-sim/</url>

Modified: java/branches/hps_java_trunk_HPSJAVA-255/ecal-readout-sim/src/main/java/org/hps/readout/ecal/FADCPrimaryTriggerDriver.java
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/ecal-readout-sim/src/main/java/org/hps/readout/ecal/FADCPrimaryTriggerDriver.java	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/ecal-readout-sim/src/main/java/org/hps/readout/ecal/FADCPrimaryTriggerDriver.java	Mon Nov  3 01:04:28 2014
@@ -21,7 +21,8 @@
  * The code for generating trigger pairs and handling the coincidence
  * window comes from <code>FADCTriggerDriver</code>.
  * 
- * @author Kyle McCarty
+ * @author Kyle McCarty <[log in to unmask]>
+ * @author Sho Uemura <[log in to unmask]>
  * @see FADCTriggerDriver
  */
 public class FADCPrimaryTriggerDriver extends TriggerDriver {
@@ -46,7 +47,7 @@
     private int pairCoincidence = 2;                              // Maximum allowed time difference between clusters. (4 ns clock-cycles)
     private double energySlopeParamF = 0.005500;                  // A parameter value used for the energy slope calculation.
     private double originX = 1393.0 * Math.tan(0.03052);          // ECal mid-plane, defined by photon beam position (30.52 mrad) at ECal face (z=1393 mm)
-    private int backgroundLevel = -1;                            // Automatically sets the cuts to achieve a predetermined background rate.
+    private int backgroundLevel = -1;                             // Automatically sets the cuts to achieve a predetermined background rate.
     
     // ==================================================================
     // ==== Driver Internal Variables ===================================
@@ -94,7 +95,16 @@
     IHistogram2D clusterDistributionSingle = aida.histogram2D("Trigger Plots :: Cluster Seed Distribution (Passed Single Cuts)", 46, -23, 23, 11, -5.5, 5.5);
     IHistogram2D clusterDistributionAll = aida.histogram2D("Trigger Plots :: Cluster Seed Distribution (Passed All Cuts)", 46, -23, 23, 11, -5.5, 5.5);
     
-    IHistogram1D hotCrystalEnergy = aida.histogram1D("Trigger Plots :: Hot Crystal Energy Distribution", 176, 0.0, 2.2);
+    // ==================================================================
+    // ==== Hardware Diagnostic Variables ===============================
+    // ==================================================================
+    IHistogram2D diagClusters = aida.histogram2D("Diagnostic Plots :: Cluster Seed Distribution", 46, -23, 23, 11, -5.5, 5.5);
+    IHistogram1D diagHitCount = aida.histogram1D("Diagnostic Plots :: Cluster Hit Count Distribution", 9, 1, 10);
+    IHistogram1D diagTotalEnergy = aida.histogram1D("Diagnostic Plots :: Cluster Total Energy Distribution", 176, 0.0, 2.2);
+    // TODO: Implement cluster latency plot.
+    
+    private boolean verbose = false;
+    
     
     /**
      * Prints out the results of the trigger at the end of the run.
@@ -118,6 +128,19 @@
         System.out.printf("%n");
         System.out.printf("\tTrigger Count :: %d%n", numTriggers);
         
+        // Print the trigger cuts.
+        System.out.printf("%nCut Values:%n");
+        System.out.printf("\tSeed Energy Low        :: %.2f%n", seedEnergyLow);
+        System.out.printf("\tSeed Energy High       :: %.2f%n", seedEnergyHigh);
+        System.out.printf("\tCluster Energy Low     :: %.2f%n", clusterEnergyLow);
+        System.out.printf("\tCluster Energy High    :: %.2f%n", clusterEnergyHigh);
+        System.out.printf("\tCluster Hit Count      :: %d%n", minHitCount);
+        System.out.printf("\tPair Energy Sum Low    :: %.2f%n", energySumLow);
+        System.out.printf("\tPair Energy Sum High   :: %.2f%n", energySumHigh);
+        System.out.printf("\tPair Energy Difference :: %.2f%n", energyDifferenceHigh);
+        System.out.printf("\tPair Energy Slope      :: %.2f%n", energySlopeLow);
+        System.out.printf("\tPair Coplanarity       :: %.2f%n", coplanarityHigh);
+        
         // Run the superclass method.
         super.endOfData();
     }
@@ -151,10 +174,9 @@
                 int ix = cluster.getSeedHit().getIdentifierFieldValue("ix");
                 int iy = cluster.getSeedHit().getIdentifierFieldValue("iy");
                 
-                // If the cluster is in the "hot" region, write out its
-                // energy to a special plot.
-                if((iy == 1 || iy == -1) && (ix == -1 || ix == 1 || ix == 2)) {
-                    hotCrystalEnergy.fill(clusterEnergy, 1);
+                // VERBOSE :: Note that a cluster is being processed.
+                if(verbose) {
+                	System.out.printf("%nProcessing cluster at (% 2d, % 2d)%n", ix, iy);
                 }
                 
                 // Correct for "hole" on the x-axis for plotting.
@@ -174,8 +196,18 @@
                     clusterDistribution100.fill(ix, iy, 1);
                 }
                 
+                // Populate the diagnostic plots.
+                diagClusters.fill(ix, iy, 1);
+                diagTotalEnergy.fill(clusterEnergy, 1);
+                diagHitCount.fill(hitCount, 1);
+                
                 // ==== Seed Hit Energy Cut ====================================
                 // =============================================================
+                // VERBOSE :: Print the seed energy comparison check.
+                if(verbose) {
+                	System.out.printf("\tSeed Energy Cut    :: %.3f < %.3f < %.3f --> %b%n", seedEnergyLow, seedEnergy, seedEnergyHigh, clusterSeedEnergyCut(cluster));
+                }
+                
                 // If the cluster fails the cut, skip to the next cluster.
                 if(!clusterSeedEnergyCut(cluster)) { continue clusterLoop; }
                 
@@ -184,6 +216,11 @@
                 
                 // ==== Cluster Hit Count Cut ==================================
                 // =============================================================
+                // VERBOSE :: Print the hit count comparison check.
+                if(verbose) {
+                	System.out.printf("\tHit Count Cut      :: %d >= %d --> %b%n", hitCount, minHitCount, clusterHitCountCut(cluster));
+                }
+                
                 // If the cluster fails the cut, skip to the next cluster.
                 if(!clusterHitCountCut(cluster)) { continue clusterLoop; }
                 
@@ -192,6 +229,11 @@
                 
                 // ==== Cluster Total Energy Cut ===============================
                 // =============================================================
+                // VERBOSE :: Print the cluster energy comparison check.
+                if(verbose) {
+                	System.out.printf("\tCluster Energy Cut :: %.3f < %.3f < %.3f --> %b%n", clusterEnergyLow, clusterEnergy, clusterEnergyHigh, clusterTotalEnergyCut(cluster));
+                }
+                
                 // If the cluster fails the cut, skip to the next cluster.
                 if(!clusterTotalEnergyCut(cluster)) { continue clusterLoop; }
                 
@@ -661,7 +703,7 @@
     
     private void setBackgroundCuts(int backgroundLevel) {
         // Make sure that the background level is valid.
-        if(backgroundLevel < 1 || backgroundLevel > 10) {
+        if(backgroundLevel < 0 || backgroundLevel > 10) {
             throw new RuntimeException(String.format("Trigger cuts are undefined for background level %d.", backgroundLevel));
         }
         
@@ -761,6 +803,17 @@
             energySlopeLow = 0.5;
             coplanarityHigh = 65;
             minHitCount = 2;
+        } else if(backgroundLevel == 0) {
+        	seedEnergyLow = 0.100;
+            seedEnergyHigh = 6.6;
+            clusterEnergyLow = 0.100;
+            clusterEnergyHigh = 1.500;
+            energySumLow = 0.000;
+            energySumHigh = 1.900;
+            energyDifferenceHigh = 2.200;
+            energySlopeLow = 1.10;
+            coplanarityHigh = 35;
+            minHitCount = 1;
         }
     }
     

Modified: java/branches/hps_java_trunk_HPSJAVA-255/ecal-readout-sim/src/main/java/org/hps/readout/ecal/MollerTriggerDriver.java
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/ecal-readout-sim/src/main/java/org/hps/readout/ecal/MollerTriggerDriver.java	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/ecal-readout-sim/src/main/java/org/hps/readout/ecal/MollerTriggerDriver.java	Mon Nov  3 01:04:28 2014
@@ -30,7 +30,7 @@
  * supports a verbose mode where it will output more details with every
  * event to help with diagnostics.
  * 
- * @author Kyle McCarty
+ * @author Kyle McCarty <[log in to unmask]>
  */
 public class MollerTriggerDriver extends TriggerDriver {
     
@@ -55,7 +55,10 @@
     }
     
     @Override
-    public void process(EventHeader event) { super.process(event); }
+    public void process(EventHeader event) {
+    	// Run the superclass process event.
+    	super.process(event);
+    }
     
     @Override
     public void startOfData() {
@@ -74,20 +77,39 @@
         // Initialize the seed distribution diagnostic plots.
         clusterDistribution = aida.histogram2D("Trigger Plots :: Cluster Seed Distribution", 46, -23, 23, 11, -5.5, 5.5);
         aClusterDistribution = aida.histogram2D("Trigger Plots :: Cluster Seed Distribution (Passed All Cuts)", 46, -23, 23, 11, -5.5, 5.5);
+        clusterDistribution100 = aida.histogram2D("Trigger Plots :: Cluster Seed Distribution (Over 100 MeV)", 46, -23, 23, 11, -5.5, 5.5);
         
         // Initialize the seed percentage of cluster energy.
         seedPercent = aida.histogram1D("Analysis Plots :: Seed Percentage of Total Energy", 400, 0.0, 1.0);
         
+        // Initialize the momentum angle plot.
+        momentumAngle = aida.histogram2D("Trigger Plots :: Particle Momentum Distribution (t = 0)", 500, -0.01, 0.06, 500, -0.04, 0.04);
+        aMomentumAngle = aida.histogram2D("Trigger Plots :: Particle Momentum Distribution (t = 0, Passed All Cuts)", 500, -0.01, 0.06, 500, -0.04, 0.04);
+        
         // Add the allowed seed crystal positions to the seed set.
-        // y = +/- 1, x = -11 -> -15
-        for(int ix = -15; ix <= -11; ix++) {
-            allowedSeedSet.add(new Point(ix, 1));
-            allowedSeedSet.add(new Point(ix, -1));
-        } // y = +/- 2, x = -9 -> -15
-        for(int ix = -15; ix <= -9; ix++) {
-            allowedSeedSet.add(new Point(ix, 2));
-            allowedSeedSet.add(new Point(ix, -2));
-        }
+		if(useVersionOne) {
+	        // Add the allowed seed crystal positions to the seed set.
+	        // y = +/- 1, x = -11 -> -15
+	        for(int ix = -15; ix <= -11; ix++) {
+	            allowedSeedSet.add(new Point(ix, 1));
+	            allowedSeedSet.add(new Point(ix, -1));
+	        } // y = +/- 2, x = -9 -> -15
+	        for(int ix = -15; ix <= -9; ix++) {
+	            allowedSeedSet.add(new Point(ix, 2));
+	            allowedSeedSet.add(new Point(ix, -2));
+	        }
+		}
+		else {
+	        // y = +/- 1, x = -11 -> -13
+	        for(int ix = -13; ix <= -11; ix++) {
+	            allowedSeedSet.add(new Point(ix, 1));
+	            allowedSeedSet.add(new Point(ix, -1));
+	        } // y = +/- 2, x = -10 -> -14
+	        for(int ix = -14; ix <= -10; ix++) {
+	            allowedSeedSet.add(new Point(ix, 2));
+	            allowedSeedSet.add(new Point(ix, -2));
+	        }
+		}
     }
     
     @Override
@@ -139,6 +161,7 @@
             clusterTotalEnergy.fill(cluster.getEnergy());
             clusterSeedEnergy.fill(cluster.getSeedHit().getCorrectedEnergy());
             clusterDistribution.fill(ix > 0 ? ix - 1 : ix, iy, 1);
+            if(cluster.getSeedHit().getCorrectedEnergy() > 0.100) { clusterDistribution100.fill(ix > 0 ? ix - 1 : ix, iy, 1); }
             
             // VERBOSE :: Output the single cluster trigger thresholds.
             if(verbose) {
@@ -178,20 +201,31 @@
             // Require that the cluster pass each of the cuts in
             // order to qualify for a trigger.
             if(totalEnergyCut && seedEnergyCut && hitCountCut && positionCut) {
-                // Add the clusters to the cut histograms.
-                aClusterHitCount.fill(cluster.getCalorimeterHits().size());
-                aClusterTotalEnergy.fill(cluster.getEnergy());
-                aClusterSeedEnergy.fill(cluster.getSeedHit().getCorrectedEnergy());
-                aClusterDistribution.fill(ix > 0 ? ix - 1 : ix, iy, 1);
-                
-                // Increment the trigger count.
-                triggers++;
-                
-                // VERBOSE :: Indicate that a trigger occurred.
-                if(verbose) { System.out.printf("\tTriggered!%n%n"); }
-                
-                // Return a trigger.
-                return true;
+            	// Increment the number of events that have passed
+            	// the cuts.
+            	passedEvents++;
+            	
+            	// If the number of passed events exceeds the prescaling
+            	// threshold, throw a trigger.
+            	if(passedEvents >= prescale) {
+            		// Reset the number of passed events.
+            		passedEvents = 0;
+            		
+	                // Add the clusters to the cut histograms.
+	                aClusterHitCount.fill(cluster.getCalorimeterHits().size());
+	                aClusterTotalEnergy.fill(cluster.getEnergy());
+	                aClusterSeedEnergy.fill(cluster.getSeedHit().getCorrectedEnergy());
+	                aClusterDistribution.fill(ix > 0 ? ix - 1 : ix, iy, 1);
+	                
+	                // Increment the trigger count.
+	                triggers++;
+	                
+	                // VERBOSE :: Indicate that a trigger occurred.
+	                if(verbose) { System.out.printf("\tTriggered!%n%n"); }
+	                
+	                // Return a trigger.
+	                return true;
+            	}
             }
         }
         
@@ -331,6 +365,16 @@
     }
     
     /**
+     * Sets the number of events that must pass the trigger before a
+     * proper trigger flag is thrown.
+     * @param prescale - The number of passing events before a trigger
+     * will be thrown.
+     */
+    public void setPrescale(int prescale) {
+    	this.prescale = prescale;
+    }
+    
+    /**
      * Toggles whether the driver will output its actions to the console
      * during run time or not.
      * @param verbose - <code>true</code> indicates that the console
@@ -339,6 +383,18 @@
     public void setVerbose(boolean verbose) {
         this.verbose = verbose;
     }
+	
+    /**
+     * Toggles whether the more inclusive acceptance region version 1
+     * is used, or the slightly smaller and more exclusive acceptance
+     * region version 2.
+     * @param useVersionOne - <code>true</code> indicates that version
+     * 1 of the acceptance region should be used and <code>false</code>
+     * that version 2 should be used.
+     */
+	public void setUseVersionOne(boolean useVersionOne) {
+		this.useVersionOne = useVersionOne;
+	}
     
     // ==================================================================
     // ==== AIDA Plots ==================================================
@@ -351,86 +407,85 @@
     IHistogram1D clusterHitCount;
     IHistogram1D clusterSeedEnergy;
     IHistogram1D clusterTotalEnergy;
-    IHistogram1D pClusterHitCount;
-    IHistogram2D pClusterDistribution;
-    IHistogram1D pClusterSeedEnergy;
-    IHistogram1D pClusterTotalEnergy;
     IHistogram1D seedPercent;
+    IHistogram2D momentumAngle;
+    IHistogram2D aMomentumAngle;
+    IHistogram2D clusterDistribution100;
     
     // ==================================================================
     // ==== Variables ===================================================
     // ==================================================================
     
     /**
-     * <b>aida</b><br/><br/>
-     * <code>private AIDA <b>aida</b></code><br/><br/>
      * Factory for generating histograms.
      */
     private AIDA aida = AIDA.defaultInstance();
     
     /**
-     * <b>allowedSeedSet</b><br/><br/>
-     * <code>private Set<Point> <b>allowedSeedSet</b></code><br/><br/>
      * Contains all allowed seed crystal indices. Seeds outside of this
      * set will be rejected and not produce a trigger.
      */
     private Set<Point> allowedSeedSet = new HashSet<Point>();
     
     /**
-     * <b>clusterCollectionName</b><br/><br/>
-     * <code>private String <b>clusterCollectionName</b></code><br/><br/>
      * The name of the LCIO collection containing <code>HPSEcalCluster
      * </code> objects.
      */
     private String clusterCollectionName = "EcalClusters";
     
     /**
-     * <b>clusterHitCountThreshold</b><br/><br/>
-     * <code>private int <b>clusterHitCountThreshold</b></code><br/><br/>
      * Defines the minimum number of hits required for a cluster to
      * be used in triggering.
      */
-    private int clusterHitCountThreshold = 0;
-    
-    /**
-     * <b>clusterSeedEnergyThresholdLow</b><br/><br/>
-     * <code>private double <b>clusterSeedEnergyThresholdLow</b></code><br/><br/>
+    private int clusterHitCountThreshold = 5;
+    
+    /**
      * Defines the threshold for the cluster seed energy under which
      * a cluster will be rejected.
      */
-    private double clusterSeedEnergyThresholdLow = 0.00;
-    
-    /**
-     * <b>clusterSeedEnergyThresholdHigh</b><br/><br/>
-     * <code>private double <b>clusterSeedEnergyThresholdHigh</b></code><br/><br/>
+    private double clusterSeedEnergyThresholdLow = 0.300;
+    
+    /**
      * Defines the threshold for the cluster seed energy above which
      * a cluster will be rejected.
      */
-    private double clusterSeedEnergyThresholdHigh = Double.MAX_VALUE;
-    
-    /**
-     * <b>clusterTotalEnergyThresholdLow</b><br/><br/>
-     * <code>private double <b>clusterTotalEnergyThreshold</b></code><br/><br/>
+    private double clusterSeedEnergyThresholdHigh = 0.700;
+    
+    /**
      * Defines the threshold for the total cluster energy under which
      * a cluster will be rejected.
      */
-    private double clusterTotalEnergyThresholdLow = 0.0;
-    
-    /**
-     * <b>clusterTotalEnergyThresholdHigh</b><br/><br/>
-     * <code>private double <b>clusterTotalEnergyThresholdHigh</b></code><br/><br/>
+    private double clusterTotalEnergyThresholdLow = 0.600;
+    
+    /**
      * Defines the threshold for the total cluster energy above which
      * a cluster will be rejected.
      */
-    private double clusterTotalEnergyThresholdHigh = Double.MAX_VALUE;
-    
-    /**
-     * <b>verbose</b><br/><br/>
-     * <code>private boolean <b>verbose</b></code><br/><br/>
+    private double clusterTotalEnergyThresholdHigh = 0.775;
+    
+    /**
+     * The number of events that have passed the trigger cuts. This is
+     * used to determine when a trigger should be thrown for prescaling.
+     */
+    private int passedEvents = 0;
+    
+    /**
+     * Indicates how many events must pass the trigger cuts before a
+     * trigger is thrown.
+     */
+    private int prescale = 100;
+    
+    /**
      * Sets whether the driver outputs its clustering decisions to the
      * console or not.
      */
     private boolean verbose = false;
+    
+    /**
+     * Indicates whether trigger region version 1 or version 2 should
+     * be used.
+     */
+    private boolean useVersionOne = false;
     
     private int triggers = 0;                                      // Track the number of triggers.
     private int allClusters = 0;                                   // Track the number of clusters processed.

Modified: java/branches/hps_java_trunk_HPSJAVA-255/ecal-recon/pom.xml
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/ecal-recon/pom.xml	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/ecal-recon/pom.xml	Mon Nov  3 01:04:28 2014
@@ -8,7 +8,7 @@
         <groupId>org.hps</groupId>
         <artifactId>hps-parent</artifactId>
         <relativePath>../parent/pom.xml</relativePath>
-        <version>3.0.3-SNAPSHOT</version>
+        <version>3.1-SNAPSHOT</version>
     </parent>
     <scm>
         <url>http://java.freehep.org/svn/repos/hps/list/java/trunk/ecal-recon/</url>

Modified: java/branches/hps_java_trunk_HPSJAVA-255/evio/pom.xml
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/evio/pom.xml	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/evio/pom.xml	Mon Nov  3 01:04:28 2014
@@ -8,7 +8,7 @@
         <groupId>org.hps</groupId>
         <artifactId>hps-parent</artifactId>
         <relativePath>../parent/pom.xml</relativePath>
-        <version>3.0.3-SNAPSHOT</version>
+        <version>3.1-SNAPSHOT</version>
     </parent>
     <scm>
         <url>http://java.freehep.org/svn/repos/hps/list/java/trunk/evio/</url>

Modified: java/branches/hps_java_trunk_HPSJAVA-255/integration-tests/pom.xml
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/integration-tests/pom.xml	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/integration-tests/pom.xml	Mon Nov  3 01:04:28 2014
@@ -7,7 +7,7 @@
         <groupId>org.hps</groupId>
         <artifactId>hps-parent</artifactId>
         <relativePath>../parent/pom.xml</relativePath>
-        <version>3.0.3-SNAPSHOT</version>
+        <version>3.1-SNAPSHOT</version>
     </parent>
     <scm>
         <url>http://java.freehep.org/svn/repos/hps/list/java/trunk/integration-tests/</url>
@@ -33,6 +33,8 @@
                         <exclude>org/hps/TestRunEvioToLcioTest.java</exclude>
                         <exclude>org/hps/TestRunReadoutToEvio.java</exclude>
                         <exclude>org/hps/TestRunReconTest.java</exclude>
+                        <exclude>org/hps/DataQualityMonitorTest.java</exclude>
+                        <exclude>org/hps/EcalReadoutSimTest.java</exclude>
                     </excludes>
                     <redirectTestOutputToFile>true</redirectTestOutputToFile>
                     <trimStackTrace>true</trimStackTrace>
@@ -81,6 +83,7 @@
                                 <exclude>org/hps/TestRunEvioToLcioTest.java</exclude>
                                 <exclude>org/hps/TestRunReadoutToEvio.java</exclude>
                                 <exclude>org/hps/TestRunReconTest.java</exclude>
+                                <exclude>org/hps/DataQualityMonitorTest.java</exclude>
                             </excludes>
                         </configuration>
                     </plugin>

Modified: java/branches/hps_java_trunk_HPSJAVA-255/integration-tests/src/test/java/org/hps/HPSTestRunTracker2014GeometryTrackReconTest.java
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/integration-tests/src/test/java/org/hps/HPSTestRunTracker2014GeometryTrackReconTest.java	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/integration-tests/src/test/java/org/hps/HPSTestRunTracker2014GeometryTrackReconTest.java	Mon Nov  3 01:04:28 2014
@@ -6,12 +6,9 @@
 
 import junit.framework.TestCase;
 
-import org.hps.users.jeremym.MockDataChallengeDiagnosticDriver;
-import org.lcsim.event.Cluster;
 import org.lcsim.event.EventHeader;
 import org.lcsim.event.ReconstructedParticle;
 import org.lcsim.event.Track;
-import org.lcsim.job.AidaSaveDriver;
 import org.lcsim.job.JobControlManager;
 import org.lcsim.util.Driver;
 import org.lcsim.util.aida.AIDA;
@@ -157,7 +154,7 @@
             System.out.println("  <nparticles / nevents> = " + ((double)nparticles / (double)nevents));
 
             // check that there is one track per event
-            assertTrue((Math.abs((double)ntracks / (double)nevents) - 1) < 0.000001);
+            assertTrue("Failed to find expected number of tracks.",Math.abs(((double)ntracks / (double)nevents) - 1) < 0.000001);
             
             System.out.println("CheckDriver compare to following ...");
             

Modified: java/branches/hps_java_trunk_HPSJAVA-255/integration-tests/src/test/java/org/hps/SimpleSvtReadoutTest.java
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/integration-tests/src/test/java/org/hps/SimpleSvtReadoutTest.java	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/integration-tests/src/test/java/org/hps/SimpleSvtReadoutTest.java	Mon Nov  3 01:04:28 2014
@@ -50,6 +50,7 @@
         job.setup("/org/hps/steering/readout/HPS2014TruthReadoutToLcio.lcsim");
         job.setNumberOfEvents(10000);
         job.getLCSimLoop().add(checker);
+        job.setNumberOfEvents(1000);
         job.run();
         
         this.printDebug("=========== Summary ===========");

Modified: java/branches/hps_java_trunk_HPSJAVA-255/monitoring-app/pom.xml
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/monitoring-app/pom.xml	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/monitoring-app/pom.xml	Mon Nov  3 01:04:28 2014
@@ -7,7 +7,7 @@
         <groupId>org.hps</groupId>
         <artifactId>hps-parent</artifactId>
         <relativePath>../parent/pom.xml</relativePath>
-        <version>3.0.3-SNAPSHOT</version>
+        <version>3.1-SNAPSHOT</version>
     </parent>
     <scm>
         <url>http://java.freehep.org/svn/repos/hps/list/java/trunk/monitoring-app/</url>
@@ -124,7 +124,7 @@
         <dependency>
             <groupId>jfreechart-aida-experimental</groupId>
             <artifactId>jfreechart-aida-experimental</artifactId>
-            <version>1.3-SNAPSHOT</version>
+            <version>1.4</version>
             <exclusions>
                 <exclusion>  
                     <groupId>jdom</groupId>

Modified: java/branches/hps_java_trunk_HPSJAVA-255/monitoring-app/src/main/java/org/hps/monitoring/gui/MonitoringApplication.java
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/monitoring-app/src/main/java/org/hps/monitoring/gui/MonitoringApplication.java	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/monitoring-app/src/main/java/org/hps/monitoring/gui/MonitoringApplication.java	Mon Nov  3 01:04:28 2014
@@ -23,6 +23,7 @@
 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.AnalysisFactory;
 import hep.aida.jfree.plotter.PlotterRegion;
 import hep.aida.jfree.plotter.PlotterRegionListener;
 
@@ -480,6 +481,7 @@
                 plotInfoWindow.setCurrentRegion(region);
             }
         });
+        AnalysisFactory.configure();
     }
 
     /**

Modified: java/branches/hps_java_trunk_HPSJAVA-255/monitoring-app/src/main/java/org/hps/monitoring/subsys/SystemStatusImpl.java
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/monitoring-app/src/main/java/org/hps/monitoring/subsys/SystemStatusImpl.java	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/monitoring-app/src/main/java/org/hps/monitoring/subsys/SystemStatusImpl.java	Mon Nov  3 01:04:28 2014
@@ -52,7 +52,7 @@
     }
 
     @Override
-    public void setStatus(StatusCode code, String message) {
+    synchronized public void setStatus(StatusCode code, String message) {
         if (isActive()) {
             this.code = code;
             this.message = message;
@@ -74,7 +74,7 @@
     /**
      * Notify listeners of changes to the system status.
      */
-    void notifyListeners() {
+    synchronized void notifyListeners() {
         for (SystemStatusListener listener : listeners) {
             listener.statusChanged(this);
         }

Modified: java/branches/hps_java_trunk_HPSJAVA-255/monitoring-drivers/pom.xml
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/monitoring-drivers/pom.xml	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/monitoring-drivers/pom.xml	Mon Nov  3 01:04:28 2014
@@ -7,7 +7,7 @@
         <groupId>org.hps</groupId>
         <artifactId>hps-parent</artifactId>
         <relativePath>../parent/pom.xml</relativePath>
-        <version>3.0.3-SNAPSHOT</version>
+        <version>3.1-SNAPSHOT</version>
     </parent>
     <scm>
         <url>http://java.freehep.org/svn/repos/hps/list/java/trunk/monitoring-drivers/</url>

Modified: java/branches/hps_java_trunk_HPSJAVA-255/monitoring-drivers/src/main/java/org/hps/monitoring/drivers/example/DummyErrorDriver.java
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/monitoring-drivers/src/main/java/org/hps/monitoring/drivers/example/DummyErrorDriver.java	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/monitoring-drivers/src/main/java/org/hps/monitoring/drivers/example/DummyErrorDriver.java	Mon Nov  3 01:04:28 2014
@@ -15,19 +15,19 @@
     boolean throwStartOfData = false;
     boolean throwDetectorChanged = false;
     
-    public void throwProcess(boolean throwProcess) {
+    public void setThrowProcess(boolean throwProcess) {
         this.throwProcess = throwProcess;
     }
     
-    public void throwEndOfData(boolean throwEndOfData) {
+    public void setThrowEndOfData(boolean throwEndOfData) {
         this.throwEndOfData = throwEndOfData;
     }
     
-    public void throwStartOfData(boolean throwStartOfData) {
+    public void setThrowStartOfData(boolean throwStartOfData) {
         this.throwStartOfData = throwStartOfData;
     }
     
-    public void throwDetectorChanged(boolean throwDetectorChanged) {
+    public void setThrowDetectorChanged(boolean throwDetectorChanged) {
         this.throwDetectorChanged = throwDetectorChanged;
     }
     

Modified: java/branches/hps_java_trunk_HPSJAVA-255/parent/pom.xml
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/parent/pom.xml	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/parent/pom.xml	Mon Nov  3 01:04:28 2014
@@ -6,14 +6,15 @@
     <groupId>org.hps</groupId>
     <artifactId>hps-parent</artifactId>
     <packaging>pom</packaging>
-    <version>3.0.3-SNAPSHOT</version>
+    <version>3.1-SNAPSHOT</version>
     <name>parent</name>
     <description>HPS Java parent POM</description>
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <org.lcsim.cacheDir>${user.home}</org.lcsim.cacheDir>
-        <lcsimVersion>3.0.7-SNAPSHOT</lcsimVersion>
+        <lcsimVersion>3.0.8-SNAPSHOT</lcsimVersion>
         <skipSite>false</skipSite>
+        <skipPlugin>false</skipPlugin>
     </properties>
     <scm>
         <url>http://java.freehep.org/svn/repos/hps/list/java/trunk/parent/</url>
@@ -72,10 +73,28 @@
             <artifactId>junit</artifactId>
             <version>4.11</version>
         </dependency>
+        <!--
+        <dependency>
+            <groupId>dom4j</groupId>
+            <artifactId>dom4j</artifactId>
+            <version>1.6.1</version>
+            <scope>provided</scope>
+        </dependency>
+        -->
         <dependency>
             <groupId>org.lcsim</groupId>
             <artifactId>lcsim-distribution</artifactId>
             <version>${lcsimVersion}</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>jdom</groupId>
+                    <artifactId>jdom</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>commons-math</groupId>
+                    <artifactId>commons-math</artifactId>
+                </exclusion>
+            </exclusions>
         </dependency>
     </dependencies>
     <!-- DO NOT EDIT THESE DEPENDENCY VERSIONS MANUALLY. -->
@@ -84,82 +103,82 @@
             <dependency>
                 <groupId>org.hps</groupId>
                 <artifactId>hps-util</artifactId>
-                <version>3.0.3-SNAPSHOT</version>
+                <version>3.1-SNAPSHOT</version>
             </dependency>
             <dependency>
                 <groupId>org.hps</groupId>
                 <artifactId>hps-detector-data</artifactId>
-                <version>3.0.3-SNAPSHOT</version>
+                <version>3.1-SNAPSHOT</version>
             </dependency>
             <dependency>
                 <groupId>org.hps</groupId>
                 <artifactId>hps-conditions</artifactId>
-                <version>3.0.3-SNAPSHOT</version>
+                <version>3.1-SNAPSHOT</version>
             </dependency>
             <dependency>
                 <groupId>org.hps</groupId>
                 <artifactId>hps-ecal-recon</artifactId>
-                <version>3.0.3-SNAPSHOT</version>
+                <version>3.1-SNAPSHOT</version>
             </dependency>
             <dependency>
                 <groupId>org.hps</groupId>
                 <artifactId>hps-ecal-readout-sim</artifactId>
-                <version>3.0.3-SNAPSHOT</version>
+                <version>3.1-SNAPSHOT</version>
             </dependency>
             <dependency>
                 <groupId>org.hps</groupId>
                 <artifactId>hps-tracking</artifactId>
-                <version>3.0.3-SNAPSHOT</version>
+                <version>3.1-SNAPSHOT</version>
             </dependency>
             <dependency>
                 <groupId>org.hps</groupId>
                 <artifactId>hps-evio</artifactId>
-                <version>3.0.3-SNAPSHOT</version>
+                <version>3.1-SNAPSHOT</version>
             </dependency>
             <dependency>
                 <groupId>org.hps</groupId>
                 <artifactId>hps-recon</artifactId>
-                <version>3.0.3-SNAPSHOT</version>
+                <version>3.1-SNAPSHOT</version>
             </dependency>
             <dependency>
                 <groupId>org.hps</groupId>
                 <artifactId>hps-analysis</artifactId>
-                <version>3.0.3-SNAPSHOT</version>
+                <version>3.1-SNAPSHOT</version>
             </dependency>
             <dependency>
                 <groupId>org.hps</groupId>
                 <artifactId>hps-monitoring-drivers</artifactId>
-                <version>3.0.3-SNAPSHOT</version>
+                <version>3.1-SNAPSHOT</version>
             </dependency>
             <dependency>
                 <groupId>org.hps</groupId>
                 <artifactId>hps-monitoring-app</artifactId>
-                <version>3.0.3-SNAPSHOT</version>
+                <version>3.1-SNAPSHOT</version>
             </dependency>
             <dependency>
                 <groupId>org.hps</groupId>
                 <artifactId>hps-users</artifactId>
-                <version>3.0.3-SNAPSHOT</version>
+                <version>3.1-SNAPSHOT</version>
             </dependency>
             <dependency>
                 <groupId>org.hps</groupId>
                 <artifactId>hps-steering-files</artifactId>
-                <version>3.0.3-SNAPSHOT</version>
+                <version>3.1-SNAPSHOT</version>
             </dependency>
             <dependency>
                 <groupId>org.hps</groupId>
                 <artifactId>hps-distribution</artifactId>
-                <version>3.0.3-SNAPSHOT</version>
+                <version>3.1-SNAPSHOT</version>
             </dependency>
             <dependency>
                 <groupId>org.hps</groupId>
                 <artifactId>hps-ecal-event-display</artifactId>
-                <version>3.0.3-SNAPSHOT</version>
+                <version>3.1-SNAPSHOT</version>
             </dependency>
             <dependency>
                 <groupId>org.hps</groupId>
                 <artifactId>hps-record-util</artifactId>
-                <version>3.0.3-SNAPSHOT</version>
+                <version>3.1-SNAPSHOT</version>
             </dependency>
         </dependencies>
     </dependencyManagement>
@@ -200,11 +219,11 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-report-plugin</artifactId>
-                <version>2.16</version>
+                <version>2.17</version>
             </plugin>
             <plugin>
                 <artifactId>maven-resources-plugin</artifactId>
-                <version>2.6</version>
+                <version>2.7</version>
             </plugin>
         </plugins>
     </reporting>
@@ -222,7 +241,7 @@
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-site-plugin</artifactId>
-                    <version>3.3</version>
+                    <version>3.4</version>
                     <configuration>
                         <chmod>false</chmod>
                         <skip>${skipSite}</skip>
@@ -266,14 +285,14 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-scm-plugin</artifactId>
-                <version>1.8.1</version>
+                <version>1.9.2</version>
                 <configuration>
                     <connectionType>connection</connectionType>
                 </configuration>
             </plugin>
             <plugin>
                 <artifactId>maven-compiler-plugin</artifactId>
-                <version>3.1</version>
+                <version>3.2</version>
                 <configuration>
                     <source>1.7</source>
                     <target>1.7</target>
@@ -284,8 +303,11 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
-                <version>2.16</version>
+                <version>2.17</version>
                 <configuration>
+<!--                
+                    <disableXmlReport>true</disableXmlReport>
+-->                    
                     <argLine>-Xmx1024m</argLine>
                     <forkMode>pertest</forkMode>
                     <!-- This allows the cacheDir to be overridden by settings.xml, 
@@ -301,7 +323,7 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-release-plugin</artifactId>
-                <version>2.4.2</version>
+                <version>2.5.1</version>
                 <configuration>
                     <tagBase>svn://svn.freehep.org/hps/java/tags/</tagBase>
                 </configuration>
@@ -309,7 +331,6 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-antrun-plugin</artifactId>
-                <version>1.7</version>
                 <executions>
                     <execution>
                         <phase>generate-test-resources</phase>
@@ -328,7 +349,7 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-shade-plugin</artifactId>
-                <version>2.2</version>
+                <version>2.3</version>
             </plugin>
         </plugins>
     </build>
@@ -462,4 +483,15 @@
         <system>Jenkins</system>
         <url>http://srs.slac.stanford.edu/hudson/view/HPS/</url>
     </ciManagement>
+    <profiles>
+        <profile>
+            <id>no-plugin</id>
+            <activation>
+                <activeByDefault>false</activeByDefault>
+            </activation>
+            <properties>
+                <skipPlugin>true</skipPlugin>
+            </properties>
+        </profile>
+    </profiles>
 </project>

Modified: java/branches/hps_java_trunk_HPSJAVA-255/plugin/pom.xml
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/plugin/pom.xml	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/plugin/pom.xml	Mon Nov  3 01:04:28 2014
@@ -7,7 +7,7 @@
         <groupId>org.hps</groupId>
         <artifactId>hps-parent</artifactId>
         <relativePath>../parent/pom.xml</relativePath>
-        <version>3.0.3-SNAPSHOT</version>
+        <version>3.1-SNAPSHOT</version>
     </parent>
     <scm>
         <url>http://java.freehep.org/svn/repos/hps/list/java/trunk/plugin/</url>
@@ -30,6 +30,7 @@
                 <artifactId>freehep-jas-plugin</artifactId>
                 <version>3.1.7</version>
                 <configuration>
+                    <skip>${skipPlugin}</skip>
                     <urls>
                         <property>
                             <name>org.hps:*</name>

Modified: java/branches/hps_java_trunk_HPSJAVA-255/pom.xml
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/pom.xml	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/pom.xml	Mon Nov  3 01:04:28 2014
@@ -10,7 +10,7 @@
         <groupId>org.hps</groupId>
         <artifactId>hps-parent</artifactId>
         <relativePath>parent/pom.xml</relativePath>
-        <version>3.0.3-SNAPSHOT</version>
+        <version>3.1-SNAPSHOT</version>
     </parent>   
     <scm>
         <url>svn://svn.freehep.org/hps/java/trunk/</url>
@@ -38,7 +38,12 @@
                         <generateProjectInfo>true</generateProjectInfo>
                     </configuration>
                 </plugin>
-            </plugins>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-eclipse-plugin</artifactId>
+                    <version>2.9</version>
+                </plugin>
+            </plugins>            
         </pluginManagement>
     </build>
     <reporting>
@@ -72,6 +77,7 @@
                     <aggregate>true</aggregate>
                 </configuration>
             </plugin>
+            <!--
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-changes-plugin</artifactId>
@@ -91,6 +97,7 @@
                     </reportSet>
                 </reportSets>
             </plugin>
+            -->
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-javadoc-plugin</artifactId>
@@ -119,7 +126,9 @@
     <modules>
         <module>analysis</module>
         <module>conditions</module>
+<!--        
         <module>datacat</module>
+-->        
         <module>detector-data</module>
         <module>distribution</module>
         <module>ecal-event-display</module>

Modified: java/branches/hps_java_trunk_HPSJAVA-255/recon/pom.xml
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/recon/pom.xml	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/recon/pom.xml	Mon Nov  3 01:04:28 2014
@@ -8,7 +8,7 @@
         <groupId>org.hps</groupId>
         <artifactId>hps-parent</artifactId>
         <relativePath>../parent/pom.xml</relativePath>
-        <version>3.0.3-SNAPSHOT</version>
+        <version>3.1-SNAPSHOT</version>
     </parent>
     <scm>
         <url>http://java.freehep.org/svn/repos/hps/list/java/trunk/recon/</url>

Modified: java/branches/hps_java_trunk_HPSJAVA-255/recon/src/main/java/org/hps/recon/particle/HpsReconParticleDriver.java
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/recon/src/main/java/org/hps/recon/particle/HpsReconParticleDriver.java	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/recon/src/main/java/org/hps/recon/particle/HpsReconParticleDriver.java	Mon Nov  3 01:04:28 2014
@@ -20,147 +20,188 @@
 import org.hps.recon.vertexing.BilliorVertex;
 import org.hps.recon.vertexing.BilliorVertexer;
 
-
 /**
- * The Main HPS implementation of ReconParticleDriver...makes V0 candidates and does vertex fits
+ * The main HPS implementation of ReconParticleDriver. Method generates
+ * V0 candidates and does vertex fits.
+ * 
  * @author Omar Moreno <[log in to unmask]>
  * @version $Id$
  */
 public class HpsReconParticleDriver extends ReconParticleDriver {
-	
-	private enum Constraint { 
-		UNCONSTRAINED, 
-		BS_CONSTRAINED, 
-		TARGET_CONSTRAINED
-	}
-	
-	public HpsReconParticleDriver(){}		
-
-	@Override
-	protected void startOfData(){
-		
-//		unconstrainedV0CandidatesColName    = "UnconstrainedV0Candidates";
-//		beamConV0CandidatesColName   		= "BeamspotConstrainedV0Candidates";
-//		targetConV0CandidatesColName 		= "TargetConstrainedV0Candidates";	
-//		unconstrainedV0VerticesColName 		= "UnconstrainedV0Vertices";
-//		beamConV0VerticesColName 			= "BeamspotConstrainedV0Vertices";
-//		targetConV0VerticesColName			= "TargetConstrainedV0Vertices";
-	}
-
-	/**
-	 * 
-	 */
-	@Override
-	void findVertices(List<ReconstructedParticle> electrons, List<ReconstructedParticle> positrons) {
-		
-		ReconstructedParticle candidate = null; 
-		BilliorVertex vtxFit = null;
-		// Loop through both electrons and positrons and try to find a common vertex
-		for(ReconstructedParticle positron : positrons){
-			for(ReconstructedParticle electron : electrons){
-				
-				// Get the tracks associated with the electron and the positron
-				Track electronTrack = electron.getTracks().get(0); 
-				Track positronTrack = positron.getTracks().get(0); 
-				
-				// Covert the tracks to BilliorTracks used by the vertexer
-				BilliorTrack electronBTrack = toBilliorTrack(electronTrack); 
-				BilliorTrack positronBTrack = toBilliorTrack(positronTrack);
-			
-				for(Constraint constraint : Constraint.values()){
-					
-					vtxFit = fitVertex(constraint, electronBTrack, positronBTrack);
-				
-					candidate = makeReconstructedParticle(electron, positron, vtxFit); 
-					
-					
-					switch(constraint){
-						case UNCONSTRAINED: 
-							unconstrainedV0Vertices.add(vtxFit);
-							unconstrainedV0Candidates.add(candidate); 
-							break;
-						case BS_CONSTRAINED:
-							beamConV0Vertices.add(vtxFit);
-							beamConV0Candidates.add(candidate);
-							break;
-						case TARGET_CONSTRAINED:
-							targetConV0Vertices.add(vtxFit);
-							targetConV0Candidates.add(candidate);
-							break;
-					}
-				}
-			}
-		}
-	}
-	
-	/**
-	 * 
-	 */
-	BilliorVertex fitVertex(Constraint constraint, BilliorTrack electron, BilliorTrack positron){
-		
-		BilliorVertexer vtxFitter = new BilliorVertexer(bField);
-		// TODO: The beam size should come from the conditions database
-		vtxFitter.setBeamSize(beamsize);
-		
-		switch(constraint){
-			case UNCONSTRAINED: 
-				vtxFitter.doBeamSpotConstraint(false); 
-				break;
-			case BS_CONSTRAINED:
-				vtxFitter.doBeamSpotConstraint(true); 
-				break;
-			case TARGET_CONSTRAINED:
-				vtxFitter.doTargetConstraint(true);
-				break;
-		}
-				
-		List<BilliorTrack> billiorTracks = new ArrayList<BilliorTrack>();
-		billiorTracks.add(electron);
-		billiorTracks.add(positron);
-		
-		return vtxFitter.fitVertex(billiorTracks);
-	}
-	
-	/**
-	 * 
-	 */
-	ReconstructedParticle makeReconstructedParticle(ReconstructedParticle electron, ReconstructedParticle positron, BilliorVertex vtxFit){
-		
-		ReconstructedParticle candidate = new BaseReconstructedParticle();
-		((BaseReconstructedParticle) candidate).setStartVertex(vtxFit);
-		candidate.addParticle(electron);
-		candidate.addParticle(positron);
-					
-		// TODO: The calculation of the total fitted momentum should be done within 
-		// 		 BilloirVertex
-		((BaseReconstructedParticle) candidate).setMass(vtxFit.getParameters().get("invMass"));
-		Hep3Vector fittedMomentum = new BasicHep3Vector(vtxFit.getParameters().get("p1X"), 
-		   											    vtxFit.getParameters().get("p1Y"), 
-														vtxFit.getParameters().get("p1Z"));
-		fittedMomentum = VecOp.add(fittedMomentum, new BasicHep3Vector(vtxFit.getParameters().get("p2X"), 
-																   	   vtxFit.getParameters().get("p2Y"),
-																       vtxFit.getParameters().get("p2Z")));
-		this.printDebug("Fitted momentum in tracking frame: " + fittedMomentum.toString());
-		fittedMomentum = CoordinateTransformations.transformVectorToDetector(fittedMomentum);
-		this.printDebug("Fitted momentum in detector frame: " + fittedMomentum.toString());
-		HepLorentzVector fourVector = new BasicHepLorentzVector(0, 0, 0, 0); 
-		((BasicHepLorentzVector) fourVector).setV3(fourVector.t(), fittedMomentum);
-		((BaseReconstructedParticle) candidate).set4Vector(fourVector);
-		
-		// Add the ReconstructedParticle to the Vertex 
-		vtxFit.setAssociatedParticle(candidate);
-		
-		return candidate;
-		
-	}
-	
-
-	/**
-	 * 
-	 */
+    /**
+     * Represents a type of constraint for vertex fitting.
+     * 
+     * @author Omar Moreno <[log in to unmask]>
+     */
+    private enum Constraint { 
+        /** Represents a fit with no constraints. */
+        UNCONSTRAINED, 
+        /** Represents a fit with beam spot constraints. */
+        BS_CONSTRAINED, 
+        /** Represents a fit with target constraints. */
+        TARGET_CONSTRAINED
+    }
+    
+    /**
+     * Creates reconstructed V0 candidate particles and vertices for
+     * electron positron pairs using no constraints, beam constraints,
+     * and target constraints. These are saved to the appropriate lists
+     * in the super class.
+     * @param electrons - The list of electrons.
+     * @param positrons - The list of positrons.
+     */
+    @Override
+    protected void findVertices(List<ReconstructedParticle> electrons, List<ReconstructedParticle> positrons) {
+        // Iterate over the positrons and electrons to perform vertexing
+        // on the pairs.
+        for(ReconstructedParticle positron : positrons) {
+            for(ReconstructedParticle electron : electrons) {
+                // Get the tracks associated with the electron and
+                // the positron.
+                Track electronTrack = electron.getTracks().get(0); 
+                Track positronTrack = positron.getTracks().get(0); 
+                
+                // Covert the tracks to BilliorTracks.
+                BilliorTrack electronBTrack = toBilliorTrack(electronTrack); 
+                BilliorTrack positronBTrack = toBilliorTrack(positronTrack);
+                
+                // Create candidate particles for each constraint.
+                for(Constraint constraint : Constraint.values()) {
+                    // Generate a candidate vertex and particle.
+                    BilliorVertex vtxFit = fitVertex(constraint, electronBTrack, positronBTrack);
+                    ReconstructedParticle candidate = makeReconstructedParticle(electron, positron, vtxFit); 
+                    
+                    // Add the candidate vertex and particle to the
+                    // appropriate LCIO collection.
+                    switch(constraint){
+                        case UNCONSTRAINED: 
+                            unconstrainedV0Vertices.add(vtxFit);
+                            unconstrainedV0Candidates.add(candidate); 
+                            break;
+                        case BS_CONSTRAINED:
+                            beamConV0Vertices.add(vtxFit);
+                            beamConV0Candidates.add(candidate);
+                            break;
+                        case TARGET_CONSTRAINED:
+                            targetConV0Vertices.add(vtxFit);
+                            targetConV0Candidates.add(candidate);
+                            break;
+                    }
+                }
+            }
+        }
+    }
+    
+    /**
+     * Sets the default LCIO collection names if they are not already
+     * defined previously.
+     */
+    @Override
+    protected void startOfData(){
+        // If the LCIO collection names have not been defined, assign
+        // them to the default names.
+        if(unconstrainedV0CandidatesColName == null) { unconstrainedV0CandidatesColName = "UnconstrainedV0Candidates"; }
+        if(beamConV0CandidatesColName == null) { beamConV0CandidatesColName = "BeamspotConstrainedV0Candidates"; }
+        if(targetConV0CandidatesColName == null) { targetConV0CandidatesColName = "TargetConstrainedV0Candidates";     }
+        if(unconstrainedV0VerticesColName == null) { unconstrainedV0VerticesColName = "UnconstrainedV0Vertices"; }
+        if(beamConV0VerticesColName == null) { beamConV0VerticesColName = "BeamspotConstrainedV0Vertices"; }
+        if(targetConV0VerticesColName == null) { targetConV0VerticesColName = "TargetConstrainedV0Vertices"; }
+    }
+    
+    /**
+     * Fits a vertex from an electron/positron track pair using the
+     * indicated constraint.
+     * @param constraint - The constraint type to use.
+     * @param electron - The electron track.
+     * @param positron - The positron track.
+     * @return Returns the reconstructed vertex as a <code>BilliorVertex
+     * </code> object.
+     */
+    private BilliorVertex fitVertex(Constraint constraint, BilliorTrack electron, BilliorTrack positron){
+        // Create a vertex fitter from the magnetic field.
+        BilliorVertexer vtxFitter = new BilliorVertexer(bField);
+        // TODO: The beam size should come from the conditions database.
+        vtxFitter.setBeamSize(beamSize);
+        
+        // Perform the vertexing based on the specified constraint.
+        switch(constraint){
+            case UNCONSTRAINED: 
+                vtxFitter.doBeamSpotConstraint(false); 
+                break;
+            case BS_CONSTRAINED:
+                vtxFitter.doBeamSpotConstraint(true); 
+                break;
+            case TARGET_CONSTRAINED:
+                vtxFitter.doTargetConstraint(true);
+                break;
+        }
+        
+        // Add the electron and positron tracks to a track list for
+        // the vertex fitter.
+        List<BilliorTrack> billiorTracks = new ArrayList<BilliorTrack>();
+        billiorTracks.add(electron);
+        billiorTracks.add(positron);
+        
+        // Find and return a vertex based on the tracks.
+        return vtxFitter.fitVertex(billiorTracks);
+    }
+    
+    /**
+     * Creates a reconstructed V0 candidate particle from an electron,
+     * positron, and billior vertex.
+     * @param electron - The electron.
+     * @param positron - The positron.
+     * @param vtxFit - The billior vertex.
+     * @return Returns a reconstructed particle with properties generated
+     * from the child particles and vertex given as an argument.
+     */
+    private ReconstructedParticle makeReconstructedParticle(ReconstructedParticle electron, ReconstructedParticle positron, BilliorVertex vtxFit){
+        // Create a new reconstructed particle to represent the V0
+        // candidate and populate it with the electron and positron.
+        ReconstructedParticle candidate = new BaseReconstructedParticle();
+        ((BaseReconstructedParticle) candidate).setStartVertex(vtxFit);
+        candidate.addParticle(electron);
+        candidate.addParticle(positron);
+        
+        // TODO: The calculation of the total fitted momentum should be
+        //       done within BilloirVertex.
+        // Calculate the candidate particle momentum and associate it
+        // with the reconstructed candidate particle.
+        ((BaseReconstructedParticle) candidate).setMass(vtxFit.getParameters().get("invMass"));
+        Hep3Vector fittedMomentum = new BasicHep3Vector(vtxFit.getParameters().get("p1X"), 
+                                                           vtxFit.getParameters().get("p1Y"), 
+                                                        vtxFit.getParameters().get("p1Z"));
+        fittedMomentum = VecOp.add(fittedMomentum, new BasicHep3Vector(vtxFit.getParameters().get("p2X"), 
+                                                                          vtxFit.getParameters().get("p2Y"),
+                                                                       vtxFit.getParameters().get("p2Z")));
+        fittedMomentum = CoordinateTransformations.transformVectorToDetector(fittedMomentum);
+        HepLorentzVector fourVector = new BasicHepLorentzVector(0, 0, 0, 0); 
+        ((BasicHepLorentzVector) fourVector).setV3(fourVector.t(), fittedMomentum);
+        ((BaseReconstructedParticle) candidate).set4Vector(fourVector);
+        
+        // VERBOSE :: Output the fitted momentum data.
+        printDebug("Fitted momentum in tracking frame: " + fittedMomentum.toString());
+        printDebug("Fitted momentum in detector frame: " + fittedMomentum.toString());
+        
+        // Add the ReconstructedParticle to the vertex.
+        vtxFit.setAssociatedParticle(candidate);
+        
+        // Return the V0 candidate.
+        return candidate;
+    }
+    
+    /**
+     * Converts a <code>Track</code> object to a <code>BilliorTrack
+     * </code> object.
+     * @param track - The original track.
+     * @return Returns the original track as a <code>BilliorTrack
+     * </code> object.
+     */
     private BilliorTrack toBilliorTrack(Track track) {
-    	
-    	HelicalTrackFit trackFit = ((SeedTrack) track).getSeedCandidate().getHelix();
-    	return new BilliorTrack(trackFit);
+        // Convert the track to a helical track fit.
+        HelicalTrackFit trackFit = ((SeedTrack) track).getSeedCandidate().getHelix();
+        
+        // Generate and return the billior track.
+        return new BilliorTrack(trackFit);
     }
 }

Modified: java/branches/hps_java_trunk_HPSJAVA-255/recon/src/main/java/org/hps/recon/particle/ReconParticleDriver.java
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/recon/src/main/java/org/hps/recon/particle/ReconParticleDriver.java	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/recon/src/main/java/org/hps/recon/particle/ReconParticleDriver.java	Mon Nov  3 01:04:28 2014
@@ -21,150 +21,318 @@
 import org.hps.recon.tracking.TrackUtils;
 
 /**
- * Driver that matches SVT Tracks and Ecal Clusters and creates
- * ReconstructedParticles.
+ * Driver framework for generating reconstructed particles and matching
+ * clusters and tracks.
  *
  * @author Mathew Graham <[log in to unmask]>
  * @author Omar Moreno <[log in to unmask]>
  * @version $Id$
  */
 public abstract class ReconParticleDriver extends Driver {
-
-    // Flags
-    boolean debug = false;
-
-    // Reconstructed particle collections
-    List<ReconstructedParticle> finalStateParticles;
-    List<ReconstructedParticle> unconstrainedV0Candidates;
-    List<ReconstructedParticle> beamConV0Candidates;
-    List<ReconstructedParticle> targetConV0Candidates;
-    List<ReconstructedParticle> electrons;
-    List<ReconstructedParticle> positrons;
-    List<Vertex> unconstrainedV0Vertices;
-    List<Vertex> beamConV0Vertices;
-    List<Vertex> targetConV0Vertices;
-
-    // Collections
-    String ecalClustersCollectionName = "EcalClusters";
-    String tracksCollectionName = "MatchedTracks";
-    String finalStateParticlesColName = "FinalStateParticles";
-    String unconstrainedV0CandidatesColName = "UnconstrainedV0Candidates";
-    String beamConV0CandidatesColName = "BeamspotConstrainedV0Candidates";
-    String targetConV0CandidatesColName = "TargetConstrainedV0Candidates";
-    String unconstrainedV0VerticesColName = "UnconstrainedV0Vertices";
-    String beamConV0VerticesColName = "BeamspotConstrainedV0Vertices";
-    String targetConV0VerticesColName = "TargetConstrainedV0Vertices";
-//    String unconstrainedV0CandidatesColName = null;
-//    String beamConV0CandidatesColName = null;
-//    String targetConV0CandidatesColName = null;
-//    String vertexCandidatesColName = null;
-//    String vertexBeamConsCandidatesName = null;
-//	String unconstrainedV0VerticesColName = null;
-//	String beamConV0VerticesColName = null;
-//	String targetConV0VerticesColName = null;
-
-    // The beamsize array is in the tracking frame
-    /* TODO  mg-May 14, 2014:  the the beam size from the conditions db...also beam position!  */
-    double[] beamsize = {0.001, 0.2, 0.02};
-    double maxTrackClusterDistance = 10000; // [mm] 
-    double bField;
-
-    //  flipSign is a kludge...
-    //  HelicalTrackFitter doesn't deal with B-fields in -ive Z correctly
-    //  so we set the B-field in +iveZ and flip signs of fitted tracks
-    //  
-    //  Note:  This should be -1 for test run configurations and +1 for 
-    //         prop-2014 configurations 
-    int flipSign = 1;
-
-    public ReconParticleDriver() {
-    }
-
-    public void setDebug(boolean debug) {
-        this.debug = debug;
-    }
-
-    public void setMaxTrackClusterDistance(double maxTrackClusterDistance) {
-        this.maxTrackClusterDistance = maxTrackClusterDistance;
-    }
-
-    public void setBeamSigmaX(double sigma_x) {
-        beamsize[1] = sigma_x;
-    }
-
-    public void setBeamSigmaY(double sigma_y) {
-        beamsize[2] = sigma_y;
-    }
-
+    /**
+     * Sets the name of the LCIO collection for beam spot constrained
+     * V0 candidate particles.
+     * @param beamConV0CandidatesColName - The LCIO collection name.
+     */
+    public void setBeamConV0CandidatesColName(String beamConV0CandidatesColName) {
+        this.beamConV0CandidatesColName = beamConV0CandidatesColName;
+    }
+    
+    /**
+     * Sets the name of the LCIO collection for beam spot constrained
+     * V0 candidate vertices.
+     * @param beamConV0VerticesColName - The LCIO collection name.
+     */
+    public void setBeamConV0VerticesColName(String beamConV0VerticesColName) {
+        this.beamConV0VerticesColName = beamConV0VerticesColName;
+    }
+    
+    /**
+     * Sets the beam size sigma in the x-direction.
+     * @param sigmaX - The standard deviation of the beam width in the
+     * x-direction.
+     */
+    public void setBeamSigmaX(double sigmaX) { beamSize[1] = sigmaX; }
+    
+    /**
+     * Sets the beam size sigma in the y-direction.
+     * @param sigmaY - The standard deviation of the beam width in the
+     * y-direction.
+     */
+    public void setBeamSigmaY(double sigmaY) { beamSize[2] = sigmaY; }
+    
+    /**
+     * Indicates whether verbose debug text should be written out during
+     * runtime or note. Defaults to <code>false</code>.
+     * @param debug - <code>true</code> indicates that debug text should
+     * be written and <code>false</code> that it should be suppressed.
+     */
+    public void setDebug(boolean debug) { this.debug = debug; }
+    
+    /**
+     * Sets the maximum allowed separation distance between a matched
+     * cluster and track pair.
+     * @param dxCut - The maximum separation distance in the x-direction.
+     */
+    public void setDxCut(double dxCut) {
+        this.dxCut = dxCut;
+    }
+    
+    /**
+     * Sets the maximum allowed separation distance between a matched
+     * cluster and track pair.
+     * @param dyCut - The maximum separation distance in the y-direction.
+     */
+    public void setDyCut(double dyCut) {
+        this.dyCut = dyCut;
+    }
+    
+    /**
+     * Sets the LCIO collection name for calorimeter cluster data.
+     * @param ecalClustersCollectionName - The LCIO collection name.
+     */
     public void setEcalClusterCollectionName(String ecalClustersCollectionName) {
         this.ecalClustersCollectionName = ecalClustersCollectionName;
     }
-
+    
+    /**
+     * Sets the name of the LCIO collection for reconstructed particles.
+     * @param finalStateParticlesColName - The LCIO collection name.
+     */
+    public void setFinalStateParticlesColName(String finalStateParticlesColName) {
+        this.finalStateParticlesColName = finalStateParticlesColName;
+    }
+    
+    /**
+     * Sets the name of the LCIO collection for target constrained V0
+     * candidate particles.
+     * @param targetConV0CandidatesColName - The LCIO collection name.
+     */
+    public void setTargetConV0CandidatesColName(String targetConV0CandidatesColName) {
+        this.targetConV0CandidatesColName = targetConV0CandidatesColName;
+    }
+    
+    /**
+     * Sets the name of the LCIO collection for target constrained V0
+     * candidate vertices.
+     * @param targetConV0VerticesColName - The LCIO collection name.
+     */
+    public void setTargetConV0VerticesColName(String targetConV0VerticesColName) {
+        this.targetConV0VerticesColName = targetConV0VerticesColName;
+    }
+    
+    /**
+     * Sets the LCIO collection name for particle track data.
+     * @param tracksCollectionName - The LCIO collection name.
+     */
     public void setTracksCollectionName(String tracksCollectionName) {
         this.tracksCollectionName = tracksCollectionName;
     }
     
-    public void setFinalStateParticlesColName(String finalStateParticlesColName) {
-        this.finalStateParticlesColName = finalStateParticlesColName;
-    }
-    
-     
+    /**
+     * Sets the name of the LCIO collection for unconstrained V0
+     * candidate particles.
+     * @param unconstrainedV0CandidatesColName - The LCIO collection name.
+     */
     public void setUnconstrainedV0CandidatesColName(String unconstrainedV0CandidatesColName) {
         this.unconstrainedV0CandidatesColName = unconstrainedV0CandidatesColName;
     }
     
-    
-    public void setBeamConV0CandidatesColName(String beamConV0CandidatesColName) {
-        this.beamConV0CandidatesColName = beamConV0CandidatesColName;
-    }
-    
-     
-    public void setTargetConV0CandidatesColName(String targetV0CandidatesColName) {
-        this.targetConV0CandidatesColName = targetConV0CandidatesColName;
-    }
-    
-    
+    /**
+     * Sets the name of the LCIO collection for unconstrained V0
+     * candidate vertices.
+     * @param unconstrainedV0VerticesColName - The LCIO collection name.
+     */
     public void setUnconstrainedV0VerticesColName(String unconstrainedV0VerticesColName) {
         this.unconstrainedV0VerticesColName = unconstrainedV0VerticesColName;
     }
     
-    
-    public void setBeamConV0VerticesColName(String beamConV0VerticesColName) {
-        this.beamConV0VerticesColName = beamConV0VerticesColName;
-    }
-    
-     
-    public void setTargetConV0VerticesColName(String targetV0VerticesColName) {
-        this.targetConV0VerticesColName = targetConV0VerticesColName;
-    }
-
+    /**
+     * Updates the magnetic field parameters to match the appropriate
+     * values for the current detector settings.
+     */
     @Override
     protected void detectorChanged(Detector detector) {
-
+        // Set the magnetic field parameters to the appropriate values.
         Hep3Vector ip = new BasicHep3Vector(0., 0., 1.);
         bField = detector.getFieldMap().getField(ip).y();
-        if (bField < 0)
-            flipSign = -1;
-
-    }
-
-    public void process(EventHeader event) {
-
-        // All events should have a collection of Ecal clusters.  If the event 
-        // doesn't have one, skip the event.
-        if (!event.hasCollection(Cluster.class, ecalClustersCollectionName))
+        if (bField < 0) { flipSign = -1; }
+    }
+    
+    /**
+     * Generates reconstructed V0 candidate particles and vertices from
+     * sets of positrons and electrons. Implementing methods should
+     * place the reconstructed vertices and candidate particles into the
+     * appropriate class variable lists in <code>ReconParticleDriver
+     * </code>.
+     * @param electrons - The list of electrons.
+     * @param positrons - The list of positrons.
+     */
+    protected abstract void findVertices(List<ReconstructedParticle> electrons, List<ReconstructedParticle> positrons);
+    
+    /**
+     * Create the set of final state particles from the event tracks
+     * and clusters. Clusters will be matched with tracks when this
+     * is possible.
+     * @param clusters - The list of event clusters.
+     * @param tracks - The list of event tracks.
+     * @return Returns a <code>List</code> collection containing all
+     * of the <code>ReconstructedParticle</code> objects generated from
+     * the argument data.
+     */
+    protected List<ReconstructedParticle> makeReconstructedParticles(List<Cluster> clusters, List<Track> tracks) {
+        // Create a list in which to store reconstructed particles.
+        List<ReconstructedParticle> particles = new ArrayList<ReconstructedParticle>();
+        
+        // Create a list of unmatched clusters. A cluster should be
+        // removed from the list if a matching track is found.
+        //List<Cluster> unmatchedClusters = new ArrayList<Cluster>(clusters);
+        java.util.Set<Cluster> unmatchedClusters = new java.util.HashSet<Cluster>(clusters);
+        
+        // Iterate over all of the tracks and generate reconstructed
+        // particles for each one. If possible, match a cluster to the
+        // track as well.
+        for (Track track : tracks) {
+            // Create a reconstructed particle to represent the track.
+            ReconstructedParticle particle = new BaseReconstructedParticle();
+            HepLorentzVector fourVector = new BasicHepLorentzVector(0, 0, 0, 0);
+            
+            // Store the track in the particle.
+            particle.addTrack(track);
+            
+            // Store the momentum derived from the track in the particle.
+            Hep3Vector momentum = new BasicHep3Vector(track.getTrackStates().get(0).getMomentum());
+            momentum = CoordinateTransformations.transformVectorToDetector(momentum);
+            ((BasicHepLorentzVector) fourVector).setV3(fourVector.t(), momentum);
+            
+            // Derive the charge of the particle from the track.
+            ((BaseReconstructedParticle) particle).setCharge(track.getCharge() * flipSign);
+            
+            // Extrapolate the particle ID from the track. Positively
+            // charged particles are assumed to be positrons and those
+            // with negative charges are assumed to be electrons.
+            if (particle.getCharge() > 0) {
+                ((BaseReconstructedParticle) particle).setParticleIdUsed(new SimpleParticleID(-11, 0, 0, 0));
+            }
+            else if (particle.getCharge() < 0) {
+                ((BaseReconstructedParticle) particle).setParticleIdUsed(new SimpleParticleID(11, 0, 0, 0));
+            }
+            
+            // Track the best matching cluster for the track. A null
+            // value indicates that no cluster matches the track to
+            // within the maximum displacement limits.
+            Cluster matchedCluster = null;
+            
+            // Loop through all the unmatched clusters and select the
+            // cluster, if any, that best fits with the track.
+            clusterLoop:
+            for (Cluster cluster : unmatchedClusters) {
+                // Check if the cluster and track are a valid match.
+                if (isMatch(cluster, track)) {
+                    // Store the matched cluster.
+                    matchedCluster = cluster;
+                    
+                    // Since a match has been found, the loop can be
+                    // terminated.
+                    break clusterLoop;
+                }
+            }
+            
+            // If a cluster was found that matches the track...
+            if (matchedCluster != null) {
+                // Update the reconstructed particle with the data from
+                // the cluster.
+                particle.addCluster(matchedCluster);
+                ((BasicHepLorentzVector) fourVector).setT(matchedCluster.getEnergy());
+                
+                // Remove the cluster from the set of unmatched clusters.
+                unmatchedClusters.remove(matchedCluster);
+            }
+            
+            // Store the momentum vector in the reconstructed particle.
+            ((BaseReconstructedParticle) particle).set4Vector(fourVector);
+            
+            // Add the particle to the list of reconstructed particles.
+            particles.add(particle);
+        }
+        
+        // If any cluster remain unmatched after the tracks are finished,
+        // they should be processed into additional reconstructed particles.
+        if (!unmatchedClusters.isEmpty())
+            // Iterate over the remaining unmatched clusters.
+            for (Cluster unmatchedCluster : unmatchedClusters) {
+                // Create a reconstructed particle to represent the
+                // unmatched cluster.
+                ReconstructedParticle particle = new BaseReconstructedParticle();
+                HepLorentzVector fourVector = new BasicHepLorentzVector(0, 0, 0, 0);
+                
+                // Add the cluster to the particle.
+                particle.addCluster(unmatchedCluster);
+                
+                // Set the reconstructed particle properties based on
+                // the cluster properties.
+                ((BasicHepLorentzVector) fourVector).setT(unmatchedCluster.getEnergy());
+                ((BaseReconstructedParticle) particle).setCharge(0);
+                ((BaseReconstructedParticle) particle).set4Vector(fourVector);
+                
+                // The particle is assumed to be a photon, since it
+                // did not leave any track.
+                ((BaseReconstructedParticle) particle).setParticleIdUsed(new SimpleParticleID(22, 0, 0, 0));
+                
+                // Add the particle to the reconstructed particle list.
+                particles.add(particle);
+            }
+        
+        // Return the list of reconstructed particles.
+        return particles;
+    }
+
+    /**
+     * Prints a message as per <code>System.out.println</code> to the
+     * output stream if the verbose debug output option is enabled.
+     * @param debugMessage - The message to print.
+     */
+    protected void printDebug(String debugMessage) {
+        // If verbose debug mode is enabled, print out the message.
+        if(debug) { System.out.printf("%s :: %s%n", simpleName, debugMessage); }
+    }
+    
+    /**
+     * Processes the track and cluster collections in the event into
+     * reconstructed particles and V0 candidate particles and vertices.
+     * These reconstructed particles are then stored in the event.
+     * @param event - The event to process.
+     */
+    @Override
+    protected void process(EventHeader event) {
+        // All events are required to contain calorimeter clusters. If
+        // the event lacks these, then it should be skipped.
+        if (!event.hasCollection(Cluster.class, ecalClustersCollectionName)) {
             return;
-
-        // Get the collection of Ecal clusters from the event. A triggered 
-        // event should have Ecal clusters.  If it doesn't, skip the event.
+        }
+        
+        // VERBOSE :: Note that a new event is being read.
+        printDebug("\nProcessing Event...");
+        
+        // Otherwise, get the list of calorimeter clusters.
         List<Cluster> clusters = event.get(Cluster.class, ecalClustersCollectionName);
-        //if(clusters.isEmpty()) return;  
-        this.printDebug("Number of Ecal clusters: " + clusters.size());
-
-        // Get the collection of tracks from the event
-        List<Track> tracks = event.get(Track.class, tracksCollectionName);
-        this.printDebug("Number of Tracks in "+tracksCollectionName+" : " + tracks.size());
-
+        
+        // VERBOSE :: Output the number of clusters in the event.
+        printDebug("Clusters :: " + clusters.size());
+        
+        // Get the set of tracks from the event. If no such collection
+        // exists, initialize an empty list instead.
+        List<Track> tracks;
+        if(event.hasCollection(Track.class, tracksCollectionName)) {
+            tracks = event.get(Track.class, tracksCollectionName);
+        }
+        else { tracks = new ArrayList<Track>(0); }
+        
+        // VERBOSE :: Output the number of tracks in the event.
+        printDebug("Tracks :: " + tracks.size());
+        
+        // Instantiate new lists to store reconstructed particles and
+        // V0 candidate particles and vertices.
         finalStateParticles = new ArrayList<ReconstructedParticle>();
         electrons = new ArrayList<ReconstructedParticle>();
         positrons = new ArrayList<ReconstructedParticle>();
@@ -174,193 +342,227 @@
         unconstrainedV0Vertices = new ArrayList<Vertex>();
         beamConV0Vertices = new ArrayList<Vertex>();
         targetConV0Vertices = new ArrayList<Vertex>();
-
-        // 
-        finalStateParticles = this.makeReconstructedParticles(clusters, tracks);
-        this.printDebug("Total number of Final State Particles: " + finalStateParticles.size());
-
-        // Put all the reconstructed particles in the event
+        
+        // Generate the reconstructed particles.
+        finalStateParticles = makeReconstructedParticles(clusters, tracks);
+        
+        // VERBOSE :: Output the number of reconstructed particles.
+        printDebug("Final State Particles :: " + finalStateParticles.size());
+        
+        // Store the reconstructed particles collection.
         event.put(finalStateParticlesColName, finalStateParticles, ReconstructedParticle.class, 0);
-
-        // Loop through the list of final state particles and separate the
-        // charged particles to either electrons or positrons.  These lists
-        // will be used for vertexing purposes.
-        for (ReconstructedParticle finalStateParticle : finalStateParticles)
-            if (finalStateParticle.getCharge() > 0)
-                positrons.add(finalStateParticle);
-            else if (finalStateParticle.getCharge() < 0)
-                electrons.add(finalStateParticle);
-        this.printDebug("Number of Electrons: " + electrons.size());
-        this.printDebug("Number of Positrons: " + positrons.size());
-
-        // Vertex electron and positron candidates 
+        
+        // Separate the reconstructed particles into electrons and
+        // positrons so that V0 candidates can be generated from them.
+        for (ReconstructedParticle finalStateParticle : finalStateParticles) {
+            // If the charge is positive, assume an electron.
+            if(finalStateParticle.getCharge() > 0) { positrons.add(finalStateParticle); }
+            
+            // Otherwise, assume the particle is a positron.
+            else if(finalStateParticle.getCharge() < 0) { electrons.add(finalStateParticle); }
+        }
+        
+        // VERBOSE :: Output the number of reconstructed positrons
+        // and electrons.
+        printDebug("Number of Electrons: " + electrons.size());
+        printDebug("Number of Positrons: " + positrons.size());
+        
+        // Form V0 candidate particles and vertices from the electron
+        // and positron reconstructed particles.
         findVertices(electrons, positrons);
-
-        // If the list exist, put the vertexed candidates and vertices into the event
+        
+        // Store the V0 candidate particles and vertices for each type
+        // of constraint in the appropriate collection in the event,
+        // as long as a collection name is defined.
         if (unconstrainedV0CandidatesColName != null) {
-            this.printDebug("Total number of unconstrained V0 candidates: " + unconstrainedV0Candidates.size());
+            printDebug("Unconstrained V0 Candidates: " + unconstrainedV0Candidates.size());
             event.put(unconstrainedV0CandidatesColName, unconstrainedV0Candidates, ReconstructedParticle.class, 0);
         }
         if (beamConV0CandidatesColName != null) {
-            this.printDebug("Total number of beam constrained V0 candidates: " + unconstrainedV0Candidates.size());
+            printDebug("Beam-Constrained V0 Candidates: " + unconstrainedV0Candidates.size());
             event.put(beamConV0CandidatesColName, beamConV0Candidates, ReconstructedParticle.class, 0);
         }
         if (targetConV0CandidatesColName != null) {
-            this.printDebug("Total number of target constrained V0 candidates: " + unconstrainedV0Candidates.size());
+            printDebug("Target-Constrained V0 Candidates: " + unconstrainedV0Candidates.size());
             event.put(targetConV0CandidatesColName, targetConV0Candidates, ReconstructedParticle.class, 0);
         }
         if (unconstrainedV0VerticesColName != null) {
-            this.printDebug("Total number of unconstrained V0 vertices: " + unconstrainedV0Vertices.size());
+            printDebug("Unconstrained V0 Vertices: " + unconstrainedV0Vertices.size());
             event.put(unconstrainedV0VerticesColName, unconstrainedV0Vertices, Vertex.class, 0);
         }
         if (beamConV0VerticesColName != null) {
-            this.printDebug("Total number of beam constrained V0 vertices: " + beamConV0Vertices.size());
+            printDebug("Beam-Constrained V0 Vertices: " + beamConV0Vertices.size());
             event.put(beamConV0VerticesColName, beamConV0Vertices, Vertex.class, 0);
         }
         if (targetConV0VerticesColName != null) {
-            this.printDebug("Total number of target constrained V0 vertices: " + beamConV0Vertices.size());
+            printDebug("Target-Constrained V0 Vertices: " + beamConV0Vertices.size());
             event.put(targetConV0VerticesColName, targetConV0Vertices, Vertex.class, 0);
         }
     }
-
-    /**
-     *
-     */
-    abstract void findVertices(List<ReconstructedParticle> electrons, List<ReconstructedParticle> positrons);
-
-    /**
-     * make the final state particles from clusters & tracks
-     * loop over the tracks first and try to match with clusters
-     */
-    protected List<ReconstructedParticle> makeReconstructedParticles(List<Cluster> clusters, List<Track> tracks) {
-
-        // Instantiate the list of reconstructed particles
-        List<ReconstructedParticle> particles = new ArrayList<ReconstructedParticle>();
-
-        // Instantiate the list of unmatched  clusters.  Remove if we find track match
-        List<Cluster> unmatchedClusters = new ArrayList<Cluster>(clusters);
-
-        for (Track track : tracks) {
-
-            ReconstructedParticle particle = new BaseReconstructedParticle();
-            HepLorentzVector fourVector = new BasicHepLorentzVector(0, 0, 0, 0);
-
-            //
-            // Add all track information to the ReconstructedParticle
-            //
-            particle.addTrack(track);
-
-            // Set the momentum of the ReconstructedParticle
-            Hep3Vector momentum = new BasicHep3Vector(track.getTrackStates().get(0).getMomentum());
-            momentum = CoordinateTransformations.transformVectorToDetector(momentum);
-            ((BasicHepLorentzVector) fourVector).setV3(fourVector.t(), momentum);
-            // Set the charge of the ReconstructedParticle
-            ((BaseReconstructedParticle) particle).setCharge(track.getCharge() * flipSign);
-            // Set the particle ID
-            if (particle.getCharge() > 0)
-                ((BaseReconstructedParticle) particle).setParticleIdUsed(new SimpleParticleID(-11, 0, 0, 0));
-            else if (particle.getCharge() < 0)
-                ((BaseReconstructedParticle) particle).setParticleIdUsed(new SimpleParticleID(11, 0, 0, 0));
-
-            Cluster matchedCluster = null;
-            // Loop through all of the clusters and find the one that best matches
-            // the track.
-            for (Cluster cluster : unmatchedClusters) {
-
-                // Get the position of the Ecal cluster
-                Hep3Vector clusterPosition = new BasicHep3Vector(cluster.getPosition());
-
-                // Extrapolate the track to the Ecal cluster position
-                Hep3Vector trackPosAtEcal = TrackUtils.extrapolateTrack(track, clusterPosition.z());
-                this.printDebug("Ecal cluster position: " + clusterPosition.toString());
-
-                double rMax = Double.MAX_VALUE;
-
-                // Check if any of the extrapolated values are invalid.
-                // TODO: There are some track whose extrapolated coordinates
-                //        are NaN. The problem seems to be that the y-coordinate
-                //        of the extrapolated helix is found to be non-real. This
-                //        needs to be fixed.
-                if (Double.isNaN(trackPosAtEcal.x()) || Double.isNaN(trackPosAtEcal.y()))
-                    continue;
-                this.printDebug("Track position at shower max: " + trackPosAtEcal.toString());
-
-//                double r = VecOp.sub(trackPosAtEcal, clusterPosition).magnitude();
-                // Don't trust extrapolation...just do y-difference for now
-                double r = Math.abs(clusterPosition.y() - trackPosAtEcal.y());
-                this.printDebug("Distance between Ecal cluster and track position: " + r + " mm");
-
-                // Check if the Ecal cluster and track are within the same 
-                // detector volume i.e. both top or bottom
-                if (clusterPosition.y() * trackPosAtEcal.y() < 0) {
-                    this.printDebug("Track and Ecal cluster are in opposite volumes. Track Y @ ECAL = " + trackPosAtEcal.z());
-                    continue;
-                }
-
-                // TODO: Checking whether r < rMax should be occuring within isMatch.  isMatch 
-                // 		 is basically repeating a lot of the same code as above.
-                if (r < rMax && isMatch(cluster, track)) {
-                    rMax = r;
-                    matchedCluster = cluster;
-                }
-            }
-
-            if (matchedCluster != null) {
-                particle.addCluster(matchedCluster);
-                ((BasicHepLorentzVector) fourVector).setT(matchedCluster.getEnergy());
-                unmatchedClusters.remove(matchedCluster);
-            }
-            ((BaseReconstructedParticle) particle).set4Vector(fourVector);
-            particles.add(particle);
-        }
-
-        if (!unmatchedClusters.isEmpty())
-            for (Cluster unmatchedCluster : unmatchedClusters) {
-                // Create a reconstructed particle and add it to the 
-                // collection of particles
-                ReconstructedParticle particle = new BaseReconstructedParticle();
-                HepLorentzVector fourVector = new BasicHepLorentzVector(0, 0, 0, 0);
-
-                particle.addCluster(unmatchedCluster);
-                ((BasicHepLorentzVector) fourVector).setT(unmatchedCluster.getEnergy());
-                ((BaseReconstructedParticle) particle).setCharge(0);
-                ((BaseReconstructedParticle) particle).set4Vector(fourVector);
-                ((BaseReconstructedParticle) particle).setParticleIdUsed(new SimpleParticleID(22, 0, 0, 0));
-                particles.add(particle);
-            }
-
-        return particles;
-    }
-
-    /**
-     *
-     * @param debugMessage
-     */
-    protected void printDebug(String debugMessage) {
-        if (debug)
-            System.out.println(this.getClass().getSimpleName() + ": " + debugMessage);
-    }
-
-    /**
-     *
-     */
-    boolean isMatch(Cluster cluster, Track track) {
-
-        // Get the position of the Ecal cluster
+    
+    /**
+     * Sets the LCIO collection names to their default values if they
+     * are not already defined.
+     */
+    @Override
+    protected void startOfData() {
+        // If any of the LCIO collection names are not properly defined, define them now.
+        if(ecalClustersCollectionName == null) { ecalClustersCollectionName = "EcalClusters"; }
+        if(tracksCollectionName == null) { tracksCollectionName = "MatchedTracks"; }
+        if(finalStateParticlesColName == null) { finalStateParticlesColName = "FinalStateParticles"; }
+        if(unconstrainedV0CandidatesColName == null) { unconstrainedV0CandidatesColName = "UnconstrainedV0Candidates"; }
+        if(beamConV0CandidatesColName == null) { beamConV0CandidatesColName = "BeamspotConstrainedV0Candidates"; }
+        if(targetConV0CandidatesColName == null) { targetConV0CandidatesColName = "TargetConstrainedV0Candidates"; }
+        if(unconstrainedV0VerticesColName == null) { unconstrainedV0VerticesColName = "UnconstrainedV0Vertices"; }
+        if(beamConV0VerticesColName == null) { beamConV0VerticesColName = "BeamspotConstrainedV0Vertices"; }
+        if(targetConV0VerticesColName == null) { targetConV0VerticesColName = "TargetConstrainedV0Vertices"; }
+    }
+    
+    /**
+     * Determines if a cluster is a potential match for a given track.
+     * If it is, returns the distance between the extrapolation of the
+     * track to the z-position of the cluster and the cluster position.
+     * Otherwise, returns <code>null</code> to indicate that the pair
+     * is not a valid match.
+     * @param cluster - The cluster to check.
+     * @param track - The track to check.
+     * @return Returns the distance between the cluster and extrapolated
+     * track position in millimeters as a <code>Double</code> if the
+     * pair is a potential match. Returns <code>null</code> otherwise.
+     */
+    private boolean isMatch(Cluster cluster, Track track) {
+        // Get the position of the cluster and extrapolate the position
+        // of the track at the z-position of the cluster.
         Hep3Vector clusterPosition = new BasicHep3Vector(cluster.getPosition());
-
-        // Extrapolate the track to the Ecal cluster position
         Hep3Vector trackPosAtEcal = TrackUtils.extrapolateTrack(track, clusterPosition.z());
-
-        double dxCut = 20.0;
-        double dyCut = 20.0;
-
-        if (Math.abs(trackPosAtEcal.x() - clusterPosition.x()) > dxCut)
+        
+        // TODO: There are some track whose extrapolated coordinates
+        //       are NaN. The problem seems to be that the y-coordinate
+        //       of the extrapolated helix is found to be non-real. This
+        //       needs to be fixed.
+        // There is an issue with track extrapolation that sometimes
+        // yields NaN for extrapolated track parameters. Tracks with
+        // this issue are not usable and thusly the check should be
+        // skipped.
+        if (Double.isNaN(trackPosAtEcal.x()) || Double.isNaN(trackPosAtEcal.y())) {
+            // VERBOSE :: Indicate the reason for the match failing.
+            printDebug("\tFailure :: Track extrapolation error.");
+
+            // Return false to indicate that the pair do not match.
             return false;
-
-        if (Math.abs(trackPosAtEcal.y() - clusterPosition.y()) > dyCut)
+        }
+        
+        // VERBOSE :: Output the position of the extrapolated track
+        //            and the cluster.
+        printDebug("\tCluster Position :: " + clusterPosition.toString());
+        printDebug("\tTrack Position   :: " + trackPosAtEcal.toString());
+        
+        // If one of either the cluster or extrapolated track fall on
+        // one volume of the detector and the other is in the other
+        // volume, then they can not be a match. (i.e. both parts of
+        // the pair must be on the top or bottom of the detector.)
+        if (clusterPosition.y() * trackPosAtEcal.y() < 0) {
+            // VERBOSE :: Indicate the reason for the match failing.
+            printDebug("\tFailure :: Cluster/Track pair in opposite volumes.");
+
+            // Return false to indicate that the pair do not match.
             return false;
-
+        }
+        
+        // Check to make sure that the x and y displacements between
+        // the extrapolated track position and cluster position are
+        // within the allowed bounds. If they are not, this pair is
+        // not a match.
+        if (Math.abs(trackPosAtEcal.x() - clusterPosition.x()) > dxCut) {
+            // VERBOSE :: Indicate the reason for the match failing.
+            printDebug("\tFailure :: Pair x-displacement exceeds allowed threshold.");
+
+            // Return false to indicate that the pair do not match.
+            return false;
+        }
+        
+        if (Math.abs(trackPosAtEcal.y() - clusterPosition.y()) > dyCut) {
+            // VERBOSE :: Indicate the reason for the match failing.
+            printDebug("\tFailure :: Pair y-displacement exceeds allowed threshold.");
+            
+            // Return false to indicate that the pair do not match.
+            return false;
+        }
+        
+        // VERBOSE :: Indicate the reason for the match failing.
+        printDebug("\tSuccess :: Cluster/track pair match!.");
+        
+        // A pair that has reached this point is a potential match.
+        // Return true to indicate a match.
         return true;
     }
+    
+    // ==============================================================
+    // ==== Class Variables =========================================
+    // ==============================================================
+    // Local variables.
+    /** The maximum separation distance in the x-direction beyond which
+     * a cluster and track will be rejected for pairing. */
+    private double dxCut = 20.0;
+    /** The maximum separation distance in the y-direction beyond which
+     * a cluster and track will be rejected for pairing. */
+    private double dyCut = 20.0;
+    /** Indicates whether debug text should be output or not. */
+    private boolean debug = false;
+    /** The simple name of the class used for debug print statements. */
+    private final String simpleName = getClass().getSimpleName();
+    
+    // Reconstructed Particle Lists
+    /** Stores reconstructed electron particles. */
+    private List<ReconstructedParticle> electrons;
+    /** Stores reconstructed positron particles. */
+    private List<ReconstructedParticle> positrons;
+    /** Stores particles reconstructed from an event. */
+    protected List<ReconstructedParticle> finalStateParticles;
+    /** Stores reconstructed V0 candidate particles generated without constraints. */
+    protected List<ReconstructedParticle> unconstrainedV0Candidates;
+    /** Stores reconstructed V0 candidate particles generated with beam spot constraints. */
+    protected List<ReconstructedParticle> beamConV0Candidates;
+    /** Stores reconstructed V0 candidate particles generated with target constraints. */
+    protected List<ReconstructedParticle> targetConV0Candidates;
+    /** Stores reconstructed V0 candidate vertices generated without constraints. */
+    protected List<Vertex> unconstrainedV0Vertices;
+    /** Stores reconstructed V0 candidate vertices generated with beam spot constraints. */
+    protected List<Vertex> beamConV0Vertices;
+    /** Stores reconstructed V0 candidate vertices generated with target constraints. */
+    protected List<Vertex> targetConV0Vertices;
+    
+    // LCIO Collection Names
+    /** LCIO collection name for calorimeter clusters. */
+    private String ecalClustersCollectionName = "EcalClusters";
+    /** LCIO collection name for tracks. */
+    private String tracksCollectionName = "MatchedTracks";
+    /** LCIO collection name for reconstructed particles. */
+    private String finalStateParticlesColName = "FinalStateParticles";
+    /** LCIO collection name for V0 candidate particles generated without constraints. */
+    protected String unconstrainedV0CandidatesColName = null;
+    /** LCIO collection name for V0 candidate particles generated with beam spot constraints. */
+    protected String beamConV0CandidatesColName = null;
+    /** LCIO collection name for V0 candidate particles generated with target constraints. */
+    protected String targetConV0CandidatesColName = null;
+    /** LCIO collection name for V0 candidate vertices generated without constraints. */
+    protected String unconstrainedV0VerticesColName = null;
+    /** LCIO collection name for V0 candidate vertices generated with beam spot constraints. */
+    protected String beamConV0VerticesColName = null;
+    /** LCIO collection name for V0 candidate vertices generated with target constraints. */
+    protected String targetConV0VerticesColName = null;
+    
+    // Beam size variables.
+    // The beamsize array is in the tracking frame
+    /* TODO  mg-May 14, 2014:  the the beam size from the conditions db...also beam position!  */
+    protected double[] beamSize = {0.001, 0.2, 0.02};
+    protected double bField;
+    
+    //  flipSign is a kludge...
+    //  HelicalTrackFitter doesn't deal with B-fields in -ive Z correctly
+    //  so we set the B-field in +iveZ and flip signs of fitted tracks
+    //  
+    //  Note:  This should be -1 for test run configurations and +1 for 
+    //         prop-2014 configurations 
+    private int flipSign = 1;
 }

Modified: java/branches/hps_java_trunk_HPSJAVA-255/recon/src/main/java/org/hps/recon/particle/TestRunReconParticleDriver.java
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/recon/src/main/java/org/hps/recon/particle/TestRunReconParticleDriver.java	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/recon/src/main/java/org/hps/recon/particle/TestRunReconParticleDriver.java	Mon Nov  3 01:04:28 2014
@@ -10,41 +10,59 @@
 import org.hps.recon.vertexing.TwoTrackVertexer;
 
 /**
+ * Method creates reconstructed particles from tracks and clusters for
+ * test run data. Also generates candidate A' reconstructed particles.
+ * This method does not generate a separate vertex collection.
  * 
  * @author Omar Moreno <[log in to unmask]>
  * @version $Id$
  */
 public class TestRunReconParticleDriver extends ReconParticleDriver {
-
-	public TestRunReconParticleDriver(){}; 
-	
-	@Override
-	protected void startOfData(){
-		unconstrainedV0CandidatesColName = "V0Candidates";
-	}
-	
-	@Override
-	void findVertices(List<ReconstructedParticle> electrons, List<ReconstructedParticle> positrons) {
-		
-		TwoTrackVertexer vtxFitter = new TwoTrackVertexer(); 
-	
-		// Loop through both electrons and positrons and try to vertex them
-		for(ReconstructedParticle positron : positrons){
-			for(ReconstructedParticle electron : electrons){
-				
-				// Get the tracks associated with the electrons and positrons
-				Track electronTrack = electron.getTracks().get(0); 
-				Track positronTrack = positron.getTracks().get(0); 
-				vtxFitter.setTracks(electronTrack, positronTrack);
-				vtxFitter.fitVertex();
-				Vertex vertex = vtxFitter.getFittedVertex();
-				
-				ReconstructedParticle candidate = new BaseReconstructedParticle(); 
-				((BaseReconstructedParticle) candidate).setStartVertex(vertex);
-				candidate.addParticle(electron);
-				candidate.addParticle(positron);
-				unconstrainedV0Candidates.add(candidate); 
-			}
-		}
-	}
+    /**
+     * Generates reconstructed V0 candidate particles from electron
+     * and positron pairs.
+     * @param electrons - The list of electrons.
+     * @param positrons - The list of positrons.
+     */
+    @Override
+    protected void findVertices(List<ReconstructedParticle> electrons, List<ReconstructedParticle> positrons) {
+        // Create a vertex fitter.
+        TwoTrackVertexer vtxFitter = new TwoTrackVertexer();
+        
+        // Iterate over the electrons and positrons and try to generate
+        // an A' candidate from them.
+        for(ReconstructedParticle positron : positrons){
+            for(ReconstructedParticle electron : electrons){
+                // Get the electron and positron tracks.
+                Track electronTrack = electron.getTracks().get(0);
+                Track positronTrack = positron.getTracks().get(0);
+                
+                // Feed the tracks to the vertex fitter.
+                vtxFitter.setTracks(electronTrack, positronTrack);
+                vtxFitter.fitVertex();
+                
+                // Get the reconstructed vertex.
+                Vertex vertex = vtxFitter.getFittedVertex();
+                
+                // Create a reconstructed particle for the candidate
+                // particle generated from the electron/positron pair.
+                ReconstructedParticle candidate = new BaseReconstructedParticle(); 
+                ((BaseReconstructedParticle) candidate).setStartVertex(vertex);
+                candidate.addParticle(electron);
+                candidate.addParticle(positron);
+                
+                // Add the candidate particle to list.
+                unconstrainedV0Candidates.add(candidate); 
+            }
+        }
+    }
+    
+    /**
+     * Sets the unconstrained A' candidate particle collection name if
+     * it has not already been defined.
+     */
+    @Override
+    protected void startOfData(){
+        if(unconstrainedV0CandidatesColName == null) { unconstrainedV0CandidatesColName = "V0Candidates"; }
+    }
 }

Modified: java/branches/hps_java_trunk_HPSJAVA-255/record-util/pom.xml
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/record-util/pom.xml	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/record-util/pom.xml	Mon Nov  3 01:04:28 2014
@@ -7,7 +7,7 @@
         <groupId>org.hps</groupId>
         <artifactId>hps-parent</artifactId>
         <relativePath>../parent/pom.xml</relativePath>
-        <version>3.0.3-SNAPSHOT</version>
+        <version>3.1-SNAPSHOT</version>
     </parent>
     <scm>
         <url>http://java.freehep.org/svn/repos/hps/list/java/trunk/record-util/</url>

Modified: java/branches/hps_java_trunk_HPSJAVA-255/steering-files/pom.xml
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/steering-files/pom.xml	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/steering-files/pom.xml	Mon Nov  3 01:04:28 2014
@@ -8,7 +8,7 @@
         <groupId>org.hps</groupId>
         <artifactId>hps-parent</artifactId>
         <relativePath>../parent/pom.xml</relativePath>
-        <version>3.0.3-SNAPSHOT</version>
+        <version>3.1-SNAPSHOT</version>
     </parent>
     <scm>
         <url>http://java.freehep.org/svn/repos/hps/list/java/trunk/steering-files/</url>

Modified: java/branches/hps_java_trunk_HPSJAVA-255/steering-files/src/main/resources/org/hps/steering/monitoring/DummyError.lcsim
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/steering-files/src/main/resources/org/hps/steering/monitoring/DummyError.lcsim	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/steering-files/src/main/resources/org/hps/steering/monitoring/DummyError.lcsim	Mon Nov  3 01:04:28 2014
@@ -4,6 +4,8 @@
         <driver name="DummyErrorDriver"/>
     </execute>   
     <drivers>
-        <driver name="DummyErrorDriver" type="org.hps.monitoring.drivers.test.DummyErrorDriver"/>
+        <driver name="DummyErrorDriver" type="org.hps.monitoring.drivers.example.DummyErrorDriver">
+            <throwProcess>true</throwProcess>
+        </driver>
     </drivers>
 </lcsim>

Modified: java/branches/hps_java_trunk_HPSJAVA-255/tracking/pom.xml
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/tracking/pom.xml	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/tracking/pom.xml	Mon Nov  3 01:04:28 2014
@@ -8,7 +8,7 @@
         <groupId>org.hps</groupId>
         <artifactId>hps-parent</artifactId>
         <relativePath>../parent/pom.xml</relativePath>
-        <version>3.0.3-SNAPSHOT</version>
+        <version>3.1-SNAPSHOT</version>
     </parent>
     <scm>
         <url>http://java.freehep.org/svn/repos/hps/list/java/trunk/tracking/</url>
@@ -46,10 +46,5 @@
             <artifactId>commons-math3</artifactId>
             <version>3.2</version>
         </dependency>
-        <dependency>
-            <groupId>org.freehep</groupId>
-            <artifactId>freehep-jminuit</artifactId>
-            <version>1.0.2-SNAPSHOT</version>
-        </dependency>
     </dependencies>
 </project>

Modified: java/branches/hps_java_trunk_HPSJAVA-255/tracking/src/main/java/org/hps/recon/tracking/MultipleScattering.java
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/tracking/src/main/java/org/hps/recon/tracking/MultipleScattering.java	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/tracking/src/main/java/org/hps/recon/tracking/MultipleScattering.java	Mon Nov  3 01:04:28 2014
@@ -17,8 +17,10 @@
 import org.lcsim.recon.tracking.seedtracker.ScatterAngle;
 
 /**
- * Extention of lcsim class to allow use of local classes. Finds scatter points and magnitude from
+ * Extention of lcsim class to allow use of local classes. Finds scatter points
+ * and magnitude from
  * detector geometry directly.
+ *
  * @author Per Hansson <[log in to unmask]>
  */
 public class MultipleScattering extends org.lcsim.recon.tracking.seedtracker.MultipleScattering {
@@ -28,9 +30,11 @@
     }
 
     /**
-     * Override lcsim version and select material manager depending on object type. This allows to
-     * use a local extension of the material manager in teh lcsim track fitting code.
-     * 
+     * Override lcsim version and select material manager depending on object
+     * type. This allows to
+     * use a local extension of the material manager in teh lcsim track fitting
+     * code.
+     *
      * @param helix
      * @return a list of ScatterAngle.
      */
@@ -50,8 +54,9 @@
     }
 
     /**
-     * Extra interface to keep a function returning the same type as the lcsim version
-     * 
+     * Extra interface to keep a function returning the same type as the lcsim
+     * version
+     *
      * @param helix
      * @return a list of ScatterAngle.
      */
@@ -62,19 +67,19 @@
 
     /**
      * Find scatter points along helix using the local material manager
-     * 
+     *
      * @param helix
      * @return the points of scatter along the helix
      */
     public ScatterPoints FindHPSScatterPoints(HelicalTrackFit helix) {
         if (_debug) {
             System.out.printf("\n%s: FindHPSScatters() for helix:\n%s\n", this.getClass().getSimpleName(), helix.toString());
-            System.out.printf("%s: momentum is p=%f,R=%f,B=%f \n", this.getClass().getSimpleName(),helix.p(Math.abs(_bfield)),helix.R(),_bfield);
-        }
-        
-        // Check that B Field is set
-        if (_bfield == 0.)
-            throw new RuntimeException("B Field must be set before calling FindScatters method");
+            System.out.printf("%s: momentum is p=%f,R=%f,B=%f \n", this.getClass().getSimpleName(), helix.p(Math.abs(_bfield)), helix.R(), _bfield);
+        }
+//        MG TURN THIS OFF SO IT DOESN'T ABORT STRAIGHT TRACKS
+//        // Check that B Field is set
+//        if (_bfield == 0.)
+//            throw new RuntimeException("B Field must be set before calling FindScatters method");
 
         // Create a new list to contain the mutliple scatters
         // List<ScatterAngle> scatters = new ArrayList<ScatterAngle>();
@@ -101,7 +106,6 @@
                     System.out.printf("%s: intersection position %s\n", this.getClass().getSimpleName(), pos.toString());
 
                 // find the track direction at the plane
-
                 double s = HelixUtils.PathToXPlane(helix, pos.x(), 0., 0).get(0);
 
                 if (_debug)
@@ -118,7 +122,10 @@
                 if (_debug)
                     System.out.printf("%s: material traversed: %f R.L. (%fmm) \n", this.getClass().getSimpleName(), radlen, vol.getMaterialTraversed(dir));
 
-                double p = helix.p(this._bfield);
+//                double p = helix.p(this._bfield);
+                double p = 1.0; // set default momentum to 1.0
+                if (_bfield != 0)
+                    p = helix.p(this._bfield);
                 double msangle = this.msangle(p, radlen);
 
                 ScatterAngle scat = new ScatterAngle(s, msangle);
@@ -129,12 +136,10 @@
                 ScatterPoint scatterPoint = new ScatterPoint(vol.getDetectorElement(), scat);
                 scatters.addPoint(scatterPoint);
 
-            } else {
+            } else
 
                 if (_debug)
                     System.out.printf("\n%s: helix did not intersect this volume \n", this.getClass().getSimpleName());
-
-            }
 
         }
 
@@ -144,20 +149,18 @@
         if (_debug) {
             System.out.printf("\n%s: found %d scatters for this helix:\n", this.getClass().getSimpleName(), scatters.getPoints().size());
             System.out.printf("%s: %10s %10s\n", this.getClass().getSimpleName(), "s (mm)", "theta(rad)");
-            for (ScatterPoint p : scatters.getPoints()) {
+            for (ScatterPoint p : scatters.getPoints())
                 System.out.printf("%s: %10.2f %10f\n", this.getClass().getSimpleName(), p.getScatterAngle().PathLen(), p.getScatterAngle().Angle());
-            }
         }
         return scatters;
     }
 
     public Hep3Vector getHelixIntersection(HelicalTrackFit helix, ScatteringDetectorVolume plane) {
 
-        if (SiStripPlane.class.isInstance(plane)) {
+        if (SiStripPlane.class.isInstance(plane))
             return getHelixIntersection(helix, (SiStripPlane) plane);
-        } else {
+        else
             throw new UnsupportedOperationException("This det volume type is not supported yet.");
-        }
     }
 
     /*
@@ -193,7 +196,6 @@
         // Consider the plane as pure x-plane i.e. no rotations
         // -> this is not very general, as it assumes that strips are (mostly) along y -> FIX
         // THIS!?
-
         // Transformation from tracking to detector frame
         Hep3Vector pos_det = VecOp.mult(VecOp.inverse(CoordinateTransformations.getMatrix()), pos);
         Hep3Vector direction_det = VecOp.mult(VecOp.inverse(CoordinateTransformations.getMatrix()), direction);
@@ -212,7 +214,6 @@
         double delta_w = -1.0 * pos_sensor.z() / direction_sensor.z();
 
         // find the point where it crossed the plane
-
         Hep3Vector pos_int = VecOp.add(pos_sensor, VecOp.mult(delta_w, direction_sensor));
         Hep3Vector pos_int_det = plane.getSensor().getReadoutElectrodes(ChargeCarrier.HOLE).getLocalToGlobal().transformed(pos_int);
         // find the intercept in the tracking frame
@@ -229,14 +230,12 @@
             System.out.printf("%s: Inside result sensor: %s module: %s\n", this.getClass().getSimpleName(), result_inside.toString(), result_inside_module.toString());
 
         boolean isInsideSolid = false;
-        if (result_inside.equals(Inside.INSIDE) || result_inside.equals(Inside.SURFACE)) {
+        if (result_inside.equals(Inside.INSIDE) || result_inside.equals(Inside.SURFACE))
             isInsideSolid = true;
-        }
 
         boolean isInsideSolidModule = false;
-        if (result_inside_module.equals(Inside.INSIDE) || result_inside_module.equals(Inside.SURFACE)) {
+        if (result_inside_module.equals(Inside.INSIDE) || result_inside_module.equals(Inside.SURFACE))
             isInsideSolidModule = true;
-        }
 
         boolean isInside = true;
         if (Math.abs(pos_int.x()) > plane.getMeasuredDimension() / 2.0) {
@@ -254,30 +253,27 @@
         if (!isInside)
             return null;
 
-        if (this._debug) {
+        if (this._debug)
             System.out.printf("%s: found simple intercept at %s \n", this.getClass().getSimpleName(), pos_int_trk.toString());
-        }
 
         // Check if it's inside sensor and module and if it contradicts the manual calculation
         // For now: trust manual calculation and output warning if it's outside BOTH sensor AND module 
-
         if (!isInsideSolid) {
             if (_debug)
                 System.out.printf("%s: manual calculation says inside sensor, inside solid says outside -> contradiction \n", this.getClass().getSimpleName());
             if (isInsideSolidModule) {
                 if (_debug)
                     System.out.printf("%s: this intercept is outside sensor but inside module\n", this.getClass().getSimpleName());
-            } else {
+            } else
                 if (_debug)
                     System.out.printf("%s: warning: this intercept at %s, in sensor frame %s, (sensor origin at %s ) is outside sensor and module!\n", this.getClass().getSimpleName(), pos_int_trk.toString(), pos_int.toString(), plane.origin().toString());
-            }
         }
 
         // TODO Catch special cases where the incidental iteration procedure seem to fail 
         if (helix.p(Math.abs(_bfield)) < 0.5) {
 
             if (this._debug)
-                System.out.printf("%s: momentum is low (p=%f,R=%f,B=%f), skip the iterative calculation\n", this.getClass().getSimpleName(),helix.p(Math.abs(_bfield)),helix.R(),_bfield);
+                System.out.printf("%s: momentum is low (p=%f,R=%f,B=%f), skip the iterative calculation\n", this.getClass().getSimpleName(), helix.p(Math.abs(_bfield)), helix.R(), _bfield);
 
             return pos_int_trk;
         }
@@ -293,36 +289,31 @@
             return pos_int_trk;
         }
 
-        if (this._debug) {
+        if (this._debug)
             System.out.printf("%s: iterative helix intercept point at %s (diff to approx: %s) \n", this.getClass().getSimpleName(), pos_iter_trk.toString(), VecOp.sub(pos_iter_trk, pos_int_trk).toString());
-        }
 
         // find position in sensor frame
         Hep3Vector pos_iter_det = VecOp.mult(VecOp.inverse(CoordinateTransformations.getMatrix()), pos_iter_trk);
         Hep3Vector pos_iter_sensor = plane.getSensor().getGeometry().getGlobalToLocal().transformed(VecOp.mult(VecOp.inverse(CoordinateTransformations.getMatrix()), pos_iter_trk));
 
-        if (this._debug) {
+        if (this._debug)
             System.out.printf("%s: found iterative helix intercept in sensor coordinates at %s\n", this.getClass().getSimpleName(), pos_iter_sensor.toString());
-        }
-        
+
         result_inside = plane.getDetectorElement().getGeometry().getPhysicalVolume().getMotherLogicalVolume().getSolid().inside(pos_iter_sensor);
         result_inside_module = plane.getSensor().getGeometry().getDetectorElement().getParent().getGeometry().inside(pos_iter_det);
 
-        if (this._debug) {
+        if (this._debug)
             System.out.printf("%s: Inside result sensor: %s module: %s\n", this.getClass().getSimpleName(), result_inside.toString(), result_inside_module.toString());
-        }
-        
+
         isInsideSolid = false;
-        
-        if (result_inside.equals(Inside.INSIDE) || result_inside.equals(Inside.SURFACE)) {
+
+        if (result_inside.equals(Inside.INSIDE) || result_inside.equals(Inside.SURFACE))
             isInsideSolid = true;
-        }
 
         isInsideSolidModule = false;
-        
-        if (result_inside_module.equals(Inside.INSIDE) || result_inside_module.equals(Inside.SURFACE)) {
+
+        if (result_inside_module.equals(Inside.INSIDE) || result_inside_module.equals(Inside.SURFACE))
             isInsideSolidModule = true;
-        }
 
         isInside = true;
         if (Math.abs(pos_iter_sensor.x()) > plane.getMeasuredDimension() / 2.0) {
@@ -340,28 +331,22 @@
         // Check if it's inside sensor and module and if it contradicts the manual calculation
         // For now: trust manual calculation and output warning if it's outside BOTH sensor AND
         // module -> FIX THIS!?
-
         if (!isInsideSolid) {
-            if (_debug) {
+            if (_debug)
                 System.out.printf("%s: manual iterative calculation says inside sensor, inside solid says outside -> contradiction \n", this.getClass().getSimpleName());
-            }
             if (isInsideSolidModule) {
-                if (_debug) {
+                if (_debug)
                     System.out.printf("%s: this iterative intercept is outside sensor but inside module\n", this.getClass().getSimpleName());
-                }
-            } else {
-                if (_debug) {
+            } else
+                if (_debug)
                     System.out.printf("%s: warning: this iterative intercept %s, sensor frame %s, (sensor origin %s ) is outside sensor and module!\n", this.getClass().getSimpleName(), pos_iter_trk.toString(), pos_iter_sensor.toString(), plane.origin().toString());
-                }
-            }
         }
 
         if (!isInside)
             return null;
 
-        if (this._debug) {
+        if (this._debug)
             System.out.printf("%s: found intercept at %s \n", this.getClass().getSimpleName(), pos_iter_trk.toString());
-        }
 
         return pos_iter_trk;
     }
@@ -377,7 +362,8 @@
     }
 
     /**
-     * Nested class to encapsulate the scatter angles and which detector element it is related to
+     * Nested class to encapsulate the scatter angles and which detector element
+     * it is related to
      */
     public class ScatterPoint implements Comparable<ScatterPoint> {
 
@@ -405,7 +391,7 @@
 
     /**
      * Nested class to encapsulate a list of scatters
-     * 
+     *
      */
     public class ScatterPoints {
 
@@ -435,11 +421,9 @@
         }
 
         public ScatterPoint getScatterPoint(IDetectorElement detectorElement) {
-            for (ScatterPoint p : _points) {
-                if (p.getDet().equals(detectorElement)) {
+            for (ScatterPoint p : _points)
+                if (p.getDet().equals(detectorElement))
                     return p;
-                }
-            }
             return null;
         }
     }

Modified: java/branches/hps_java_trunk_HPSJAVA-255/tracking/src/main/java/org/hps/recon/tracking/nobfield/StraightTrackFinder.java
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/tracking/src/main/java/org/hps/recon/tracking/nobfield/StraightTrackFinder.java	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/tracking/src/main/java/org/hps/recon/tracking/nobfield/StraightTrackFinder.java	Mon Nov  3 01:04:28 2014
@@ -1,272 +1,257 @@
+/*
+ * SeedTrackFinder.java
+ *
+ * Created on January 22, 2008, 9:39 AM
+ *
+ */
 package org.hps.recon.tracking.nobfield;
 
 import java.util.ArrayList;
+import java.util.HashSet;
 import java.util.List;
-import org.hps.recon.tracking.HitCollectionUtilites;
-import org.hps.recon.tracking.nobfield.TrackCollectionUtilities;
-import org.lcsim.event.EventHeader;
-import org.lcsim.event.Track;
-import org.lcsim.event.TrackerHit;
+import java.util.Set;
+import org.lcsim.event.MCParticle;
 import org.lcsim.fit.helicaltrack.HelicalTrackHit;
-import org.lcsim.fit.line.SlopeInterceptLineFit;
-import org.lcsim.fit.line.SlopeInterceptLineFitter;
-import org.lcsim.geometry.Detector;
-import org.lcsim.util.Driver;
+import org.lcsim.recon.tracking.seedtracker.HitManager;
+import org.lcsim.recon.tracking.seedtracker.SeedCandidate;
+import org.lcsim.recon.tracking.seedtracker.SeedLayer;
+import org.lcsim.recon.tracking.seedtracker.SeedStrategy;
+import org.lcsim.recon.tracking.seedtracker.TrackCheck;
+import org.lcsim.recon.tracking.seedtracker.diagnostic.ISeedTrackerDiagnostics;
 
 /**
- *
- * @author mgraham
+ * Find straight tracks in 0-bfield
+ * 
+ * copied/modified from org.lcsim.recon.tracking.SeedTrackFinder
+ * @author Mathew Graham
+
  */
-public class StraightTrackFinder extends Driver {
-
-    // Debug flag.
-    private boolean debug = true;
-    // Tracks found across all events.
-    int ntracks = 0;
-    // Number of events processed.
-    int nevents = 0;
-    // Cache detector object.
-    Detector detector = null;
-    // Tracking strategies resource path.
-    private String strategyResource = "HPS-Test-4pt1.xml";
-    // Output track collection.
-    private String trackCollectionName = "StraightTracks";
-    // HelicalTrackHit input collection.
-    private String stInputCollectionName = "HelicalTrackHits";
-    // Include MS (done by removing XPlanes from the material manager results)
-    private boolean includeMS = true;
-    // number of repetitive fits on confirmed/extended tracks
-    private int _iterativeConfirmed = 3;
-    // use HPS implementation of material manager
-    private boolean _useHPSMaterialManager = true;
-
-    private TrackChecker checkerTrack = new TrackChecker();
-    private HitOnTrackChecker checkerHOT = new HitOnTrackChecker();
-
-    private SlopeInterceptLineFitter _lfitter = new SlopeInterceptLineFitter();
-
-    public void setDebug(boolean debug) {
-        this.debug = debug;
-    }
-
-    /**
-     * Set the tracking strategy resource.
-     *
-     * @param strategyResource The absolute path to the strategy resource in the
-     * hps-java jar.
-     */
-    public void setStrategyResource(String strategyResource) {
-        this.strategyResource = strategyResource;
-    }
-
-    public void setInputHitCollectionName(String inputHitCollectionName) {
-        this.stInputCollectionName = inputHitCollectionName;
-    }
-
-    public void setTrackCollectionName(String trackCollectionName) {
-        this.trackCollectionName = trackCollectionName;
-    }
-
-    public void setIncludeMS(boolean incMS) {
-        this.includeMS = incMS;
-    }
-
-    /**
-     * Set to enable the use of the HPS material manager implementation
-     *
-     * @param useHPSMaterialManager switch
-     */
-    public void setUseHPSMaterialManager(boolean useHPSMaterialManager) {
-        this._useHPSMaterialManager = useHPSMaterialManager;
-    }
-
-    @Override
-    public void detectorChanged(Detector detector) {
-        // Cache Detector object.
-        this.detector = detector;
-//        initialize();
-        super.detectorChanged(detector);
-    }
-
-    @Override
-    public void process(EventHeader event) {
-        if (!event.hasCollection(HelicalTrackHit.class, stInputCollectionName))
-            return;
-
-        List<HelicalTrackHit> allHits = event.get(HelicalTrackHit.class, stInputCollectionName);
-
-        List<List<HelicalTrackHit>> splitTopBot = HitCollectionUtilites.SplitTopBottomHits(allHits);
-        // will always have top(=0) and bottom(=1) lists (though they may be empty)
-        List<HelicalTrackHit> topHits = splitTopBot.get(0);
-        List<HelicalTrackHit> bottomHits = splitTopBot.get(1);
-        //a simple strategy...eventually implement SeedTracker strategies?
-        int nTotLayers = 6;
-        int nSeed = 3;
-        int nExtra = nTotLayers - nSeed;
-        int[] seedStrategy = {1, 3, 5};
-        int[] extendStrategy = {7, 9, 11};
-        int minHits = 4;
-
-        TrackChecker checkerTrack = new TrackChecker();
-        HitOnTrackChecker checkerHOT = new HitOnTrackChecker();
-
-//        List<StraightTrack> seeds = getSeeds(seedStrategy, topHits);
-        List<StraightTrack> seeds = getSeeds(seedStrategy, allHits);
-        System.out.println("Found " + seeds.size() + " seeds");
-
-        List<StraightTrack> extendedSeeds = new ArrayList<>();
-        for (StraightTrack seed : seeds)
-            extendTrack(extendStrategy, 0, seed, allHits, extendedSeeds);
-//            extendTrack(extendStrategy, 0, seed, topHits, extendedSeeds);
-
-        System.out.println("Prepruning  :Found " + extendedSeeds.size() + " extended seeds");
-
-        //remove tracks with more than m overlaping hits...pick best chi2
-        //...
-        List<StraightTrack> finalTracks = new ArrayList<>();
-        for (StraightTrack track : extendedSeeds) {
-            boolean isbest = TrackCollectionUtilities.pruneTrackList((ArrayList<Track>) (ArrayList) extendedSeeds, track, 1);
-            if (isbest)
-                finalTracks.add(track);
-        }
-
-        System.out.println("Postpruning  :Found " + finalTracks.size() + " extended seeds");
-        event.put(trackCollectionName, finalTracks);
-    }
-
-    public SlopeInterceptLineFit FitToLine(List<HelicalTrackHit> hits, int projection) {
-        SlopeInterceptLineFit _lfit;
-        int npix = hits.size();
-        double[] s = new double[npix];
-        double[] q = new double[npix];
-        double[] dq = new double[npix];
-
-        //  Store the coordinates and errors for the line fit
-        for (int i = 0; i < npix; i++) {
-            HelicalTrackHit hit = hits.get(i);
-            s[i] = hit.z();//probably isn't quite right...track length is not z
-            if (projection == 0) { //do x vs z;
-                q[i] = hit.x();
-                dq[i] = Math.sqrt(hit.getCorrectedCovMatrix().e(0, 0));
-            } else {
-                q[i] = hit.y();
-                dq[i] = Math.sqrt(hit.getCorrectedCovMatrix().e(1, 1));
-            }
-        }
-
-        //  Call the line fitter and check for success
-        boolean success = _lfitter.fit(s, q, dq, npix);
-
-        if (!success)
-            System.out.println("Something is broken in the line fit");
-        //  Save the line fit, chi^2, and DOF
-        _lfit = _lfitter.getFit();
-        return _lfit;
-
-    }
-
-    private StraightTrack makeTrack(List<HelicalTrackHit> hits, SlopeInterceptLineFit xfit, SlopeInterceptLineFit yfit) {
-        StraightTrack track = new StraightTrack();
-        double[] pars = {-99, -99, -99, -99, -99};//this needs to have 5 fields to implement Track
-        pars[0] = xfit.intercept();
-        pars[1] = xfit.slope();
-        pars[2] = yfit.intercept();
-        pars[3] = yfit.slope();
-        track.setTrackParameters(pars);
-        track.setChi2(xfit.chisquared(), yfit.chisquared());
-        track.setNDF(xfit.ndf()+yfit.ndf());
-        for (TrackerHit hit : hits)
-            track.addHit(hit);        
-        // TODO:  set convariance, 
-        return track;
-    }
-
-    private StraightTrack makeTrack(List<HelicalTrackHit> hits) {
-        SlopeInterceptLineFit xfit = FitToLine(hits, 0);
-        SlopeInterceptLineFit yfit = FitToLine(hits, 1);
-        if (debug)
-            System.out.println("xfit = " + xfit.toString());
-        if (debug)
-            System.out.println("yfit = " + yfit.toString());        
-        return makeTrack(hits, xfit, yfit);
-    }
-
-    /*
-     *   Get all seed combinations that make sense (pass checkSeed)
-     *   currently, just assume there are 3 seed layers (don't have to be first 3 though.  
-     */
-    private List<StraightTrack> getSeeds(int[] seedLayers, List<HelicalTrackHit> hits) {
-        List<StraightTrack> seeds = new ArrayList<>();
-        int nseeds = seedLayers.length;
-        if (nseeds == 3)//TODO ... set this up so that this works for arbitrary nseeds...use recursion
-            for (HelicalTrackHit h1 : HitCollectionUtilites.GetSortedHits(hits, seedLayers[0])) {
-                if (debug)
-                    System.out.println(h1.toString());
-                for (HelicalTrackHit h2 : HitCollectionUtilites.GetSortedHits(hits, seedLayers[1])) {
-                    if (debug)
-                        System.out.println(h2.toString());
-                    for (HelicalTrackHit h3 : HitCollectionUtilites.GetSortedHits(hits, seedLayers[2])) {
-                        if (debug)
-                            System.out.println(h3.toString());
-                        //make a 3-hit test track...see if it passes CheckTrack 
-                        List<HelicalTrackHit> testTrack = new ArrayList<HelicalTrackHit>();
-                        testTrack.add(h1);
-                        testTrack.add(h2);
-                        testTrack.add(h3);                       
-                        StraightTrack trk = makeTrack(testTrack);
-                        if (!checkerTrack.checkSeed(trk))
-                            break;
-                        seeds.add(trk);
+public class StraightTrackFinder {
+
+    private HitManager _hitmanager;
+    private StraightTrackFitter _helixfitter;
+    private StraightTrackConfirmerExtender _confirmer;
+    private List<SeedCandidate> _trackseeds;
+    private ISeedTrackerDiagnostics _diag = null;
+    private Set<MCParticle> _seededmcp;
+    private Set<MCParticle> _confirmedmcp;
+    private TrackCheck _trackCheck; // set by SeedTracker
+    private boolean _debug = false;
+   
+
+    /**
+     * Creates a new instance of SeedTrackFinder
+     */
+    public StraightTrackFinder(HitManager hitmanager, StraightTrackFitter helixfitter) {
+
+        //  Save the pointers to the hit manager and helix fitter classes
+        _hitmanager = hitmanager;
+        _helixfitter = helixfitter;
+
+        //  Instantiate the Confirmer/Extender and Seed Candidate merging classes
+        _confirmer = new StraightTrackConfirmerExtender(_hitmanager, _helixfitter);
+
+        //  Create a list of track seeds that have been found
+        _trackseeds = new ArrayList<SeedCandidate>();
+
+        //  Create a set of MC Particles that have been seeded, confirmed
+        _seededmcp = new HashSet<MCParticle>();
+        _confirmedmcp = new HashSet<MCParticle>();
+
+    }
+
+    public void setDiagnostic(ISeedTrackerDiagnostics d) {
+
+        //  Setup the diagnostics for this class and the classes used by this class
+        _diag = d;
+        _confirmer.setDiagnostics(_diag);
+    }
+
+    public boolean FindTracks(SeedStrategy strategy, double bfield) {
+
+        //  Instantiate the fast hit checker
+        //   FastCheck checker = new FastCheck(strategy, bfield, _diag);
+        //   if(_applySectorBinning) checker.setDoSectorBinCheck(_hitmanager.getSectorManager());
+//        SeedSectoring ss = new SeedSectoring(_hitmanager, strategy, bfield, _applySectorBinning);
+        List<SeedLayer> seeds = strategy.getLayers(SeedLayer.SeedType.Seed);
+
+//        List<List<Sector>> sslist = ss.SeedSectors();
+//        if(_debug)
+//            System.out.println(this.getClass().getSimpleName()+": number of SeedSectors="+sslist.size());
+        //  Loop over the valid sector combinations
+        //      for (List<Sector> slist : sslist) {
+            //  Loop over the first seed layer
+        for (HelicalTrackHit hit1 : _hitmanager.getTrackerHits(seeds.get(0)))
+
+            //  Loop over the second seed layer and check that we have a hit pair consistent with our strategy
+            for (HelicalTrackHit hit2 : _hitmanager.getTrackerHits(seeds.get(1))) {
+
+                //  Call _trackCheck if set
+                if (_trackCheck != null) {
+                    SeedCandidate tempseed = new SeedCandidate(strategy, bfield);
+                    tempseed.addHit(hit1);
+                    tempseed.addHit(hit2);
+                    if (!_trackCheck.checkSeed(tempseed))
+                        continue;
+                }
+
+//                    //  Check if the pair of hits is consistent with the current strategy
+//                    if (!checker.TwoPointCircleCheck(hit1, hit2, null)) {
+//                        if (_diag != null) _diag.fireCheckHitPairFailed(hit1, hit2);
+//                        continue;
+//                    }
+                //  Loop over the third seed layer and check that we have a hit triplet consistent with our strategy
+                for (HelicalTrackHit hit3 : _hitmanager.getTrackerHits(seeds.get(2))) {
+                    //  Call _trackCheck if set
+                    if (_trackCheck != null) {
+                        SeedCandidate tempseed2 = new SeedCandidate(strategy, bfield);
+                        tempseed2.addHit(hit1);
+                        tempseed2.addHit(hit3);
+                        if (!_trackCheck.checkSeed(tempseed2))
+                            continue;
+
+                        SeedCandidate tempseed3 = new SeedCandidate(strategy, bfield);
+                        tempseed3.addHit(hit2);
+                        tempseed3.addHit(hit3);
+                        if (!_trackCheck.checkSeed(tempseed3))
+                            continue;
                     }
+
+                    //  Form a seed candidate from the seed hits
+                    SeedCandidate seed = new SeedCandidate(strategy, bfield);
+                    seed.addHit(hit1);
+                    seed.addHit(hit2);
+                    seed.addHit(hit3);
+
+//                        //  Check if the triplet of hits is consistent with the current strategy
+//                        if (!checker.ThreePointHelixCheck(hit1, hit2, hit3)) {
+//
+//                            if (_diag != null) {
+//                                if (seed.isTrueSeed())
+//                                _diag.fireCheckHitTripletFailed(hit1, hit2, hit3);
+//                            }
+//                            continue;
+//                        }
+                        //  Form a seed candidate from the seed hits
+                    //  If it's a true seed, add the MC Particle to those that were seeded
+                    if (_diag != null)
+                        if (seed.isTrueSeed())
+                            _seededmcp.addAll(seed.getMCParticles());
+
+                    if (_debug)
+                        System.out.println(this.getClass().getSimpleName() + ": fit the candidate");
+
+                    //  See if we can fit a helix to this seed candidate
+                    boolean success = _helixfitter.FitCandidate(seed, strategy);
+
+                    if (!success)
+                        continue;
+
+                    if (_debug)
+                        System.out.println(this.getClass().getSimpleName() + ": fit success");
+
+                    //  Save the helix fit
+                    seed.setHelix(_helixfitter.getHelix());
+
+                    // Check the seed - hook for plugging in external constraint
+                    if (_trackCheck != null)
+                        if (!_trackCheck.checkSeed(seed))
+                            continue;
+
+                    //  See if we can confirm this seed candidate
+                    success = _confirmer.Confirm(seed, strategy, bfield);
+                    if (!success)
+                        continue;
+
+                    if (_debug)
+                        System.out.println(this.getClass().getSimpleName() + ": confirmed seed");
+
+                    //  Confirmed a seed - if it's a true seed, add the MC Particle to those that were confirmed
+                    if (_diag != null)
+                        if (seed.isTrueSeed())
+                            _confirmedmcp.addAll(seed.getMCParticles());
+
+                    if (_debug)
+                        System.out.println(this.getClass().getSimpleName() + ": try to extend");
+
+                    //  Try to extend each confirmed seed candidates to make a track candidate
+                    List<SeedCandidate> confirmedlist = _confirmer.getResult();
+                    for (SeedCandidate confirmedseed : confirmedlist)
+
+                        //  See if we can extend this seed candidate
+                        _confirmer.Extend(confirmedseed, strategy, bfield, _trackseeds);
                 }
             }
-        return seeds;
-    }
-
-    /*
-     * recursively extend the seeds through all of the extend layers..
-     * ...I think this should work...
-     */
-    private void extendTrack(int[] extendLayers, int n, StraightTrack origTrack, List<HelicalTrackHit> hits, List<StraightTrack> trackList) {
-        if (n >= extendLayers.length) {
-            if (debug)
-                System.out.println("Done finding this track through all " + n + " extra layers");
-            trackList.add(origTrack);
-            return;
-        }
-
-        boolean cannotExtendThisLayer = true;
-        if (debug)
-            System.out.println("Extending to layer " + extendLayers[n]);
-        for (HelicalTrackHit h : HitCollectionUtilites.GetSortedHits(hits, extendLayers[n])) {
-            //let's see if this hit makes sense to add to original track
-            if (!checkerHOT.checkNewHit(origTrack, h))
-                continue;
-
-            List<TrackerHit> origHits = origTrack.getTrackerHits();
-            //make a new list and cast them as HelicalTrackHits (Track only stores TrackerHits)
-            List<HelicalTrackHit> newHits = new ArrayList<>();
-            for (TrackerHit oh : origHits) {
-                HelicalTrackHit hoh = (HelicalTrackHit) oh;
-                System.out.println(hoh.getPosition()[0]);
-                newHits.add(hoh);
-            }
-            //add the new hit to the list & make new track
-            newHits.add(h);
-            StraightTrack newTrack = makeTrack(newHits);
-            //check the new track after we've added this hit
-            if (!checkerTrack.checkTrack(newTrack))
-                continue;
-            cannotExtendThisLayer = false;
-            //extend again to the next layer
-            extendTrack(extendLayers, n + 1, newTrack, hits, trackList);
-        }
-
-        //didn't find any hits in this layer that match the track...but let's try the next one
-        if (cannotExtendThisLayer)
-            extendTrack(extendLayers, n + 1, origTrack, hits, trackList);
-
-        return;
+
+//        //  Done with track finding for this strategy
+//        if (_diag != null)
+//            _diag.fireFinderDone(_trackseeds, _seededmcp);
+        return _trackseeds.size() > 0;
+    }
+
+    /**
+     * Return the list of track candidates.
+     *
+     * @return track candidates
+     */
+    public List<SeedCandidate> getTrackSeeds() {
+        return _trackseeds;
+    }
+
+    /**
+     * Clear the list of track candidates accumulated from previous calls to
+     * SeedTrackFinder (typically done before starting a new event).
+     */
+    public void clearTrackSeedList() {
+        _trackseeds.clear();
+        _seededmcp.clear();
+        _confirmedmcp.clear();
+    }
+
+    /**
+     * Set the maximum number of fits for a given seed in a confirm or extend
+     * step.
+     *
+     * @param maxfits maximum number of fits
+     */
+    public void setMaxFit(int maxfits) {
+        _confirmer.setMaxFit(maxfits);
+    }
+
+    /**
+     * Return the list of MCParticles that formed valid 3-hit seeds.
+     *
+     * @return list of seeded MCParticles
+     */
+    public Set<MCParticle> getSeededMCParticles() {
+        return _seededmcp;
+    }
+
+    /**
+     * Return the list of confirmed MCParticles.
+     *
+     * @return confirmed MCParticles
+     */
+    public Set<MCParticle> getConfirmedMCParticles() {
+        return _confirmedmcp;
+    }
+
+    /**
+     * Return the StraightTrackConfirmerExtender
+     *
+     * @return confirmer/extender object
+     *
+     */
+    public StraightTrackConfirmerExtender getConfirmer() {
+        return _confirmer;
+    }
+
+    public void setDebug(boolean debug) {
+        System.out.println("Setting " + this.getClass().getSimpleName() + " debug to " + debug);
+        _debug = debug;
+    }
+    public void setTrackCheck (TrackCheck checker){
+        _trackCheck=checker;
     }
 
 }

Modified: java/branches/hps_java_trunk_HPSJAVA-255/tracking/src/main/java/org/hps/svt/alignment/BuildCompact.java
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/tracking/src/main/java/org/hps/svt/alignment/BuildCompact.java	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/tracking/src/main/java/org/hps/svt/alignment/BuildCompact.java	Mon Nov  3 01:04:28 2014
@@ -30,7 +30,6 @@
 import org.apache.commons.cli.Options;
 import org.apache.commons.cli.ParseException;
 import org.apache.commons.cli.PosixParser;
-import org.apache.commons.lang.StringUtils;
 import org.hps.conditions.deprecated.HPSSVTSensorSetup;
 //===> import org.hps.conditions.deprecated.SvtUtils;
 import org.hps.recon.tracking.CoordinateTransformations;
@@ -48,6 +47,7 @@
 import org.lcsim.detector.tracker.silicon.SiSensor;
 import org.lcsim.geometry.Detector;
 import org.lcsim.geometry.GeometryReader;
+import org.lcsim.geometry.compact.converter.MilleParameter;
 import org.lcsim.util.xml.ElementFactory.ElementCreationException;
 
 
@@ -56,7 +56,6 @@
 	private static int runNumber = -1; //1351;
 	private static String detectorName = ""; //"HPS-TestRun-v7";
 	private static ConditionsManager conditionsManager = null;
-	private static double corrScaleFactor = -1.;
 	
 	private static Options createCmdLineOpts() {
 		Options options = new Options();
@@ -147,98 +146,6 @@
 		}		
 		
 	}
-	
-	private static class MilleParameter {
-		private int id;
-		private double value; 
-		private double presigma;
-		private static final Map<Integer,String> dMap;
-		private static final Map<Integer,String> tMap;
-		private static final Map<Integer,String> hMap;
-		static {
-			dMap = new HashMap<Integer,String>();
-			dMap.put(1, "x");dMap.put(2, "y"); dMap.put(3, "z");
-			tMap = new HashMap<Integer,String>();
-			tMap.put(1, "");tMap.put(2, "r");
-			hMap = new HashMap<Integer,String>();
-			hMap.put(1, "t");hMap.put(2, "b");
-			}
-		
-		public MilleParameter(String line) {
-			String[] vals = StringUtils.split(line);// line.split("\\s+");
-			if(vals.length <3) {
-				System.out.println("this line is ill-formatted (" + vals.length + ")");
-				System.out.println(line);
-				System.exit(1);
-			}
-			try {
-			//for(String v : vals) System.out.println("\"" + v + "\"");
-			setId(Integer.parseInt(vals[0]));
-			setValue( corrScaleFactor * Double.parseDouble(vals[1]) );
-			setPresigma(Double.parseDouble(vals[2]));
-			
-			} catch (NumberFormatException e) {
-				System.out.println(vals[0] + " " + vals[1] + " " + vals[2]);
-				throw new RuntimeException("problem parsing string ", e);
-			}
-		}
-		
-		public String getXMLName() {
-			String d = dMap.get(getDim());
-			String t = tMap.get(getType());
-			String h = hMap.get(getHalf());
-			int s = getSensor();
-			return String.format("%s%s%d%s_align", t,d,s,h);
-			
-		}
-
-		private int getDim() {
-			int h = (int) (getHalf() * 1e4);
-			int t = (int) (getType() * 1e3);
-			return (int) Math.floor((id- h -t)/1e2);
-		}
-		
-		private int getSensor() {
-			int h = (int) (getHalf() * 1e4);
-			int t = (int) (getType() * 1e3);
-			int d = (int) (getDim() * 1e2);
-			return (id - h - t -d);
-		}
-
-		public int getType() {
-			int h = (int) (getHalf() * 1e4);
-			return (int) Math.floor((id -h)/1e3);
-		}
-
-		private int getHalf() {
-			return (int)Math.floor(id/1e4);
-		}
-
-		public int getId() {
-			return id;
-		}
-
-		public void setId(int id) {
-			this.id = id;
-		}
-
-		public double getValue() {
-			return value;
-		}
-
-		public void setValue(double value) {
-			this.value = value;
-		}
-
-		public double getPresigma() {
-			return presigma;
-		}
-
-		public void setPresigma(double presigma) {
-			this.presigma = presigma;
-		}
-	}
-
 	
 	public static void main(String[] args) {
 

Modified: java/branches/hps_java_trunk_HPSJAVA-255/tracking/src/test/java/org/hps/recon/tracking/TrackRecoFromScratchTest.java
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/tracking/src/test/java/org/hps/recon/tracking/TrackRecoFromScratchTest.java	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/tracking/src/test/java/org/hps/recon/tracking/TrackRecoFromScratchTest.java	Mon Nov  3 01:04:28 2014
@@ -16,7 +16,7 @@
 public class TrackRecoFromScratchTest extends TestCase
 {
     static final String testURLBase = "http://www.lcsim.org/test/hps-java";
-    static final String testFileName = "radmuon_12.lcio-1-1788.slcio";
+    static final String testFileName = "TrackRecoFromScratchTest_radmuon_12.lcio-1-1788.slcio";
     private final int nEvents = 10;
 
     public void testRecon() throws Exception

Modified: java/branches/hps_java_trunk_HPSJAVA-255/users/pom.xml
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/users/pom.xml	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/users/pom.xml	Mon Nov  3 01:04:28 2014
@@ -7,7 +7,7 @@
         <groupId>org.hps</groupId>
         <artifactId>hps-parent</artifactId>
         <relativePath>../parent/pom.xml</relativePath>
-        <version>3.0.3-SNAPSHOT</version>
+        <version>3.1-SNAPSHOT</version>
     </parent>
     <scm>
         <url>http://java.freehep.org/svn/repos/hps/list/java/trunk/users/</url>

Modified: java/branches/hps_java_trunk_HPSJAVA-255/users/src/main/java/org/hps/users/luca/FEETrigger.java
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/users/src/main/java/org/hps/users/luca/FEETrigger.java	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/users/src/main/java/org/hps/users/luca/FEETrigger.java	Mon Nov  3 01:04:28 2014
@@ -29,8 +29,8 @@
 	
     // The number of cluster over threshold that must occur in a region
 	// before a trigger occurs.
-	private int zone1Prescaling = 1000;
-	private int zone2Prescaling = 100;
+	private int zone1Prescaling = 50;
+	private int zone2Prescaling = 10;
 	
 	/**
 	 * Sets the energy threshold required for a cluster to be counted.
@@ -91,10 +91,60 @@
 					// Zone 1 is -13 < ix < -4 and 14 < ix < 21  MISTAKE!!! it's all reversed!! remember!!!
 					// Zone 2 is -20 < ix < -14 and ix > 20
 					// Zone 3 is -23 <= ix < -18
+                                        //V3
+                                        /*
 					if( ix > 18 || ix < -22) { zone3Count++; }
 					if(ix < 19 && ix  > 12 )  { zone2Count++; }
 					if((ix > 4 && ix < 13) || (ix > -23 && ix < -14)) { zone1Count++; }
-				}
+                                        */
+                                        //V2
+                                        /*
+					if( ix > 18 ) { zone3Count++; }
+					if(ix < 19 && ix  > 12 || ix <-20)  { zone2Count++; }
+					if((ix > 4 && ix < 13) || (ix > -21 && ix < -14)) { zone1Count++; }
+                                        */
+                                        
+                                        //v4/*
+                                        /*
+                                        if( ix > 19 || ix < -22) { zone3Count++; }
+					if(ix < 20 && ix  > 12 || ix <-20 && ix > -23)  { zone2Count++; }
+					if((ix > 4 && ix < 13) || (ix > -21 && ix < -14)) { zone1Count++; }
+                                        */
+                                        //V prova
+                                       /* 
+					if( ix != 50 ) { zone2Count++; }
+					*/
+                                        //V6
+                                        /*
+                                        if( ix > 19 || ix < -22) { zone3Count++; }
+					if(ix < 20 && ix  > 8 || ix <-16 && ix > -23)  { zone2Count++; }
+					if((ix > 4 && ix < 9) || (ix > -17 && ix < -14)) { zone1Count++; }
+                                        */
+                                        //V7
+                                        /*
+                                        if( ix > 19 || ix < -22) { zone3Count++; }
+					if(ix < 20 && ix  > 15 )  { zone2Count++; }
+					if((ix > 5 && ix < 16) || (ix > -23 && ix < -14)) { zone1Count++; }
+                                        */
+                                        //V8
+                                        /*
+                                        if( ix > 19 || ix < -17) { zone3Count++; } //x1
+					if(ix < 20 && ix  > 9 )  { zone2Count++; }//x10
+					if((ix > 5 && ix < 10) || (ix > -18 && ix < -14)) { zone1Count++; }    //x50
+                                        }*/
+                                         //V9
+                                        /*
+                                        if( ix > 19 || ix < -21) { zone3Count++; } //x1
+					if(ix < 20 && ix  > 9 || ix > -22 && ix <-17)  { zone2Count++; }//x10
+					if((ix > 5 && ix < 10) || (ix > -18 && ix < -14)) { zone1Count++; }    //x50
+                                        */ 
+                                        //10
+                                        
+                                        if( ix > 19 || ix < -22) { zone3Count++; } //x1
+					if(ix < 20 && ix  > 9 || ix > -22 && ix <-17)  { zone2Count++; }//x10
+					if((ix > 5 && ix < 10) || (ix > -18 && ix < -14)) { zone1Count++; }    //x50
+                                
+                                }
 			}
 		}
 		

Modified: java/branches/hps_java_trunk_HPSJAVA-255/users/src/main/java/org/hps/users/luca/RawDataReader.java
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/users/src/main/java/org/hps/users/luca/RawDataReader.java	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/users/src/main/java/org/hps/users/luca/RawDataReader.java	Mon Nov  3 01:04:28 2014
@@ -17,6 +17,8 @@
 import org.lcsim.util.Driver;
 import org.lcsim.lcio.LCIOConstants;
 import java.io.PrintWriter;
+import org.lcsim.geometry.IDDecoder;
+import org.lcsim.event.CalorimeterHit;
 
 /**
  *
@@ -28,7 +30,7 @@
     private FileWriter writer2;
     String outputFileName = "raw1.txt";
     String outputFileName2 = "raw2.txt";
-    String rawCollectionName;
+    String rawCollectionName="EcalReadoutHits";
     String ecalReadoutName = "EcalHits";
     String ecalCollectionName = "EcalCorrectedHits";
     double scale = 1.0;
@@ -88,24 +90,170 @@
     
     @Override
     public void process(EventHeader event) {
-        if (event.hasCollection(HPSRawCalorimeterHit.class, rawCollectionName)) {
-            // Get the list of ECal hits.
-            List<HPSRawCalorimeterHit> hits = event.get(HPSRawCalorimeterHit.class, rawCollectionName);
-            for(HPSRawCalorimeterHit hit : hits){
+        
+        if (event.hasCollection(RawCalorimeterHit.class, rawCollectionName)) {
+            // Get the list of ECal hits
+            
+            List<RawCalorimeterHit> hits = event.get(RawCalorimeterHit.class, rawCollectionName);
+            IDDecoder dec = event.getMetaData(hits).getIDDecoder();
+            for(RawCalorimeterHit hit : hits){ 
+                dec.setID(hit.getCellID());
+                int ix = dec.getValue("ix");
+                int iy = dec.getValue("iy");
+                int id=getCrystal(ix,iy);
                 try{
-                 writer.append(hit.getCellID()+" "+hit.getAmplitude());
+                 writer.append(id+" "+hit.getAmplitude() + " \n");
                 }
                 catch(IOException e){
     System.err.println("Error closing utput file for event display.");
 }
-            try{writer2.append(hit.getAnalogHit().getIdentifierFieldValue("ix") + " " + hit.getAnalogHit().getIdentifierFieldValue("iy") + " " + hit.getAnalogHit().getRawEnergy()+" \n");    
-               } 
-            
-            catch(IOException e){
-    System.err.println("Error closing utput file for event display.");
-}
+         
             }
         }
         else{System.out.println("NUOOO \n");}
-    }
-}
+        
+        if(event.hasCollection(CalorimeterHit.class, "EcalHits")){
+        List<CalorimeterHit> hits = event.get(CalorimeterHit.class, "EcalHits");
+        for(CalorimeterHit hit : hits){
+        int id=getCrystal(hit);
+        try{
+            writer2.append(id + " " + hit.getRawEnergy() + "\n");
+        }
+        catch(IOException e){System.err.println("Non riesco a scrivere raw2.");}    
+        }
+        }
+        else{System.out.println("NUOOO hits \n");}
+    }
+    
+    
+    public int getCrystal (CalorimeterHit hit){
+ int x,y,id=0;
+ x= (-1)*hit.getIdentifierFieldValue("ix");
+ y= hit.getIdentifierFieldValue("iy");
+ 
+ if(y==5){
+ if(x<0)
+ {id=x+24;}
+ else id= x+23;
+ }
+ 
+ else if(y==4)
+ {if(x<0){
+  id=x+70;}
+ else id=x+69;}
+ 
+ else if(y==3)
+ {if(x<0){
+  id=x+116;}
+ else id=x+115;}
+ 
+ else if(y==2)
+ {if(x<0){
+  id=x+162;}
+ else id=x+161;}
+ 
+ else if(y==1)
+ {x=-x;
+     if(x>0){
+  id=-x+208;}
+ else if(x==-1){id=208;}
+ else if(x<-1) id=-x+198;}
+ 
+  else if(y==-1)
+ {x=-x;
+     if(x>0){
+  id=-x+245;}
+ else if(x==-1 )id=245;
+ else if(x<-1){id=-x+235;}}
+ 
+ 
+ else if(y==-2)
+ {if(x<0){
+  id=x+282;}
+ else id=x+281;}
+ 
+  else if(y==-3)
+ {if(x<0){
+  id=x+328;}
+ else id=x+327;}
+ 
+ else if(y==-4)
+ {if(x<0){
+  id=x+374;}
+ else id=x+373;}
+ 
+ else if(y==-5)
+ {if(x<0){
+  id=x+420;}
+ else id=x+419;}
+ 
+ return id;
+ 
+ }
+    
+    public int getCrystal (int ix, int iy){
+ 
+ int x,y,id=0;
+ x= (-1)*ix;
+ y= iy;
+ 
+ if(y==5){
+ if(x<0)
+ {id=x+24;}
+ else id= x+23;
+ }
+ 
+ else if(y==4)
+ {if(x<0){
+  id=x+70;}
+ else id=x+69;}
+ 
+ else if(y==3)
+ {if(x<0){
+  id=x+116;}
+ else id=x+115;}
+ 
+ else if(y==2)
+ {if(x<0){
+  id=x+162;}
+ else id=x+161;}
+ 
+ else if(y==1)
+ {x=-x;
+     if(x>0){
+  id=-x+208;}
+ else if(x==-1){id=208;}
+ else if(x<-1) id=-x+198;}
+ 
+  else if(y==-1)
+ {x=-x;
+     if(x>0){
+  id=-x+245;}
+ else if(x==-1 )id=245;
+ else if(x<-1){id=-x+235;}}
+ 
+ 
+ else if(y==-2)
+ {if(x<0){
+  id=x+282;}
+ else id=x+281;}
+ 
+  else if(y==-3)
+ {if(x<0){
+  id=x+328;}
+ else id=x+327;}
+ 
+ else if(y==-4)
+ {if(x<0){
+  id=x+374;}
+ else id=x+373;}
+ 
+ else if(y==-5)
+ {if(x<0){
+  id=x+420;}
+ else id=x+419;}
+ 
+ return id;
+ 
+ }
+}

Modified: java/branches/hps_java_trunk_HPSJAVA-255/users/src/main/java/org/hps/users/mgraham/StraightTrackAnalysis.java
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/users/src/main/java/org/hps/users/mgraham/StraightTrackAnalysis.java	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/users/src/main/java/org/hps/users/mgraham/StraightTrackAnalysis.java	Mon Nov  3 01:04:28 2014
@@ -1,13 +1,18 @@
 package org.hps.users.mgraham;
 
 import hep.aida.IHistogram1D;
+import java.util.HashMap;
 import java.util.List;
-import org.hps.recon.tracking.nobfield.StraightTrack;
+import java.util.Map;
+import org.hps.analysis.examples.TrackAnalysis;
 import org.lcsim.event.EventHeader;
+import org.lcsim.event.LCRelation;
 import org.lcsim.event.RawTrackerHit;
+import org.lcsim.event.RelationalTable;
 import org.lcsim.event.SimTrackerHit;
 import org.lcsim.event.Track;
 import org.lcsim.event.TrackerHit;
+import org.lcsim.event.base.BaseRelationalTable;
 import org.lcsim.geometry.Detector;
 import org.lcsim.util.Driver;
 import org.lcsim.util.aida.AIDA;
@@ -23,6 +28,9 @@
     private String mcSvtHitsName = "TrackerHits";
     private String rawHitsName = "RawTrackerHitMaker_RawTrackerHits";
     private String clustersName = "StripClusterer_SiTrackerHitStrip1D";
+    private final String helicalTrackMCRelationsCollectionName = "HelicalTrackMCRelations";
+    private final String helicalTrackHitRelationsCollectionName = "HelicalTrackHitRelations";
+    private final String rotatedHelicalTrackHitRelationsCollectionName = "RotatedHelicalTrackHitRelations";
     private String hthName = "HelicalTrackHits";
     private String tracksName = "StraightTracks";
 
@@ -72,16 +80,57 @@
         aida.histogram1D("Number of Layers Hit").fill(totLayers);
         List<Track> tracks = event.get(Track.class, tracksName);
         aida.histogram1D("Number of Tracks found").fill(tracks.size());
+
+        //make some maps and relation tables        
+        Map<Track, TrackAnalysis> tkanalMap = new HashMap<Track, TrackAnalysis>();
+        RelationalTable hittomc = new BaseRelationalTable(RelationalTable.Mode.MANY_TO_MANY, RelationalTable.Weighting.UNWEIGHTED);
+        List<LCRelation> mcrelations = event.get(LCRelation.class, helicalTrackMCRelationsCollectionName);
+        for (LCRelation relation : mcrelations)
+            if (relation != null && relation.getFrom() != null && relation.getTo() != null)
+                hittomc.add(relation.getFrom(), relation.getTo());
+
+        System.out.println("Size of hittomc collection " + hittomc.size());
+        RelationalTable mcHittomcP = new BaseRelationalTable(RelationalTable.Mode.MANY_TO_MANY, RelationalTable.Weighting.UNWEIGHTED);
+        //  Get the collections of SimTrackerHits
+        List<List<SimTrackerHit>> simcols = event.get(SimTrackerHit.class);
+        //  Loop over the SimTrackerHits and fill in the relational table
+        for (List<SimTrackerHit> simlist : simcols)
+            for (SimTrackerHit simhit : simlist)
+                if (simhit.getMCParticle() != null)
+                    mcHittomcP.add(simhit, simhit.getMCParticle());
+
+        RelationalTable trktomc = new BaseRelationalTable(RelationalTable.Mode.MANY_TO_MANY, RelationalTable.Weighting.UNWEIGHTED);
+        RelationalTable rawtomc = new BaseRelationalTable(RelationalTable.Mode.MANY_TO_MANY, RelationalTable.Weighting.UNWEIGHTED);
+        if (event.hasCollection(LCRelation.class, "SVTTrueHitRelations")) {
+            List<LCRelation> trueHitRelations = event.get(LCRelation.class, "SVTTrueHitRelations");
+            for (LCRelation relation : trueHitRelations)
+                if (relation != null && relation.getFrom() != null && relation.getTo() != null)
+                    rawtomc.add(relation.getFrom(), relation.getTo());
+        }
+
+        RelationalTable hittostrip = new BaseRelationalTable(RelationalTable.Mode.MANY_TO_MANY, RelationalTable.Weighting.UNWEIGHTED);
+        List<LCRelation> hitrelations = event.get(LCRelation.class, helicalTrackHitRelationsCollectionName);
+        for (LCRelation relation : hitrelations)
+            if (relation != null && relation.getFrom() != null && relation.getTo() != null)
+                hittostrip.add(relation.getFrom(), relation.getTo());
+
+        RelationalTable hittorotated = new BaseRelationalTable(RelationalTable.Mode.ONE_TO_ONE, RelationalTable.Weighting.UNWEIGHTED);
+        List<LCRelation> rotaterelations = event.get(LCRelation.class, rotatedHelicalTrackHitRelationsCollectionName);
+        for (LCRelation relation : rotaterelations)
+            if (relation != null && relation.getFrom() != null && relation.getTo() != null)
+                hittorotated.add(relation.getFrom(), relation.getTo());
+
         for (Track trk : tracks) {
-            StraightTrack stght = (StraightTrack) trk;
-            aida.histogram1D("x0", 50, -2, 2).fill(stght.getTrackParameters()[0]);
-            aida.histogram1D("y0", 50, -2, 2).fill(stght.getTrackParameters()[2]);
-            aida.histogram1D("xz slope", 50, -0.2, 0.25).fill(stght.getTrackParameters()[1]);
-            aida.histogram1D("yz slope", 50, -0.25, 0.25).fill(stght.getTrackParameters()[3]);
-            aida.histogram1D("track chi2 per ndf", 50, 0, 10).fill(stght.getChi2()/stght.getNDF());
-            aida.histogram1D("track nhits", 50, 0, 10).fill(stght.getTrackerHits().size());
+//            StraightTrack stght = (StraightTrack) trk;
+            aida.histogram1D("d0", 50, -2, 2).fill(trk.getTrackParameters()[0]);
+            aida.histogram1D("z0", 50, -2, 2).fill(trk.getTrackParameters()[3]);
+            aida.histogram1D("xy slope", 50, -0.2, 0.25).fill(trk.getTrackParameters()[1]);
+            aida.histogram1D("sz slope", 50, -0.25, 0.25).fill(trk.getTrackParameters()[4]);
+            aida.histogram1D("track chi2 per ndf", 50, 0, 2).fill(trk.getChi2() / trk.getNDF());
+            aida.histogram1D("track nhits", 50, 0, 10).fill(trk.getTrackerHits().size());
+            TrackAnalysis tkanal = new TrackAnalysis(trk, hittomc);
+        }
 
-        }
     }
 
 }

Modified: java/branches/hps_java_trunk_HPSJAVA-255/util/pom.xml
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/util/pom.xml	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/util/pom.xml	Mon Nov  3 01:04:28 2014
@@ -7,7 +7,7 @@
         <groupId>org.hps</groupId>
         <artifactId>hps-parent</artifactId>
         <relativePath>../parent/pom.xml</relativePath>
-        <version>3.0.3-SNAPSHOT</version>
+        <version>3.1-SNAPSHOT</version>
     </parent>
     <scm>
         <url>http://java.freehep.org/svn/repos/hps/list/java/trunk/util/</url>