Commit in java/branches/hps-java_HPSJAVA-88 on MAIN
analysis/pom.xml+1-11196 -> 1197
conditions/pom.xml+1-11196 -> 1197
conditions/src/main/java/org/hps/conditions/svt/SvtDaqMapping.java+15-421196 -> 1197
                                               /SvtDetectorSetup.java+1-171196 -> 1197
conditions/src/main/resources/org/hps/conditions/config/conditions_dev.xml+32-321196 -> 1197
datacat/pom.xml+2-21196 -> 1197
detector-data/pom.xml+1-11196 -> 1197
distribution/pom.xml+11-21196 -> 1197
ecal-readout-sim/pom.xml+1-11196 -> 1197
ecal-recon/pom.xml+1-11196 -> 1197
ecal-recon/src/main/java/org/hps/recon/ecal/EcalClusterIC.java+143-811196 -> 1197
evio/pom.xml+1-11196 -> 1197
integration-tests/pom.xml+1-11196 -> 1197
monitoring-app/pom.xml+1-11196 -> 1197
monitoring-app/src/main/java/org/hps/monitoring/gui/JobSettingsPanel.java+1-501196 -> 1197
                                                   /MonitoringApplication.java+5-51196 -> 1197
monitoring-app/src/main/java/org/hps/monitoring/plotting/MonitoringAnalysisFactory.java-121196 -> 1197
monitoring-drivers/pom.xml+1-11196 -> 1197
monitoring-drivers/src/main/java/org/hps/monitoring/drivers/example/SimplePlotDriver.java-461196 removed
parent/pom.xml+41196 -> 1197
plugin/pom.xml+1-11196 -> 1197
pom.xml+22-541196 -> 1197
recon/pom.xml+1-11196 -> 1197
record-util/pom.xml+1-11196 -> 1197
steering-files/pom.xml+1-11196 -> 1197
steering-files/src/main/resources/org/hps/steering/monitoring/ExampleMonitoringPlots.lcsim+9-31196 -> 1197
steering-files/src/main/resources/org/hps/steering/recon/SimpleMCRecon.lcsim+37-561196 -> 1197
tracking/pom.xml+1-11196 -> 1197
tracking/src/main/java/org/hps/recon/tracking/gbl/MilleBinary.java+144-11196 -> 1197
users/pom.xml+1-11196 -> 1197
util/pom.xml+1-11196 -> 1197
+442-419
1 removed + 30 modified, total 31 files
Merge trunk changes through r1196 into hps-java_HPSJAVA-88

java/branches/hps-java_HPSJAVA-88/analysis
pom.xml 1196 -> 1197
--- java/branches/hps-java_HPSJAVA-88/analysis/pom.xml	2014-10-15 03:46:04 UTC (rev 1196)
+++ java/branches/hps-java_HPSJAVA-88/analysis/pom.xml	2014-10-15 04:22:57 UTC (rev 1197)
@@ -3,7 +3,7 @@
     <modelVersion>4.0.0</modelVersion>
     <artifactId>hps-analysis</artifactId>
     <name>analysis</name>
-    <description>HPS analysis code</description>
+    <description>common analysis code</description>
     <parent>
         <groupId>org.hps</groupId>
         <artifactId>hps-parent</artifactId>

java/branches/hps-java_HPSJAVA-88/conditions
pom.xml 1196 -> 1197
--- java/branches/hps-java_HPSJAVA-88/conditions/pom.xml	2014-10-15 03:46:04 UTC (rev 1196)
+++ java/branches/hps-java_HPSJAVA-88/conditions/pom.xml	2014-10-15 04:22:57 UTC (rev 1197)
@@ -3,7 +3,7 @@
     <modelVersion>4.0.0</modelVersion>
     <artifactId>hps-conditions</artifactId>
     <name>conditions</name>
-    <description>HPS conditions framework</description>
+    <description>extensions to the org.lcsim conditions framework</description>
     <parent>
         <groupId>org.hps</groupId>
         <artifactId>hps-parent</artifactId>

java/branches/hps-java_HPSJAVA-88/conditions/src/main/java/org/hps/conditions/svt
SvtDaqMapping.java 1196 -> 1197
--- java/branches/hps-java_HPSJAVA-88/conditions/src/main/java/org/hps/conditions/svt/SvtDaqMapping.java	2014-10-15 03:46:04 UTC (rev 1196)
+++ java/branches/hps-java_HPSJAVA-88/conditions/src/main/java/org/hps/conditions/svt/SvtDaqMapping.java	2014-10-15 04:22:57 UTC (rev 1197)
@@ -1,5 +1,7 @@
 package org.hps.conditions.svt;
 
+import org.lcsim.detector.tracker.silicon.HpsSiSensor;
+
 import org.hps.conditions.AbstractConditionsObject;
 import org.hps.conditions.ConditionsObjectCollection;
 import org.hps.util.Pair;
@@ -35,45 +37,16 @@
          * @param moduleNumber The module number (needed to identify layer's 4-6)
          * @return The DAQ pair for the half and layer number or null if does not exist.
          */
-        Pair<Integer, Integer> getDaqPair(String SvtHalf, int layerNumber, int moduleNumber) {
+        Pair<Integer, Integer> getDaqPair(HpsSiSensor sensor) {
         	
+        	String svtHalf = sensor.isTopLayer() ? TOP_HALF : BOTTOM_HALF;
         	for (SvtDaqMapping object : this.getObjects()) {
+        		
+        		if(svtHalf.equals(object.getSvtHalf()) 
+        				&& object.getLayerNumber() == sensor.getLayerNumber()
+        				&& object.getSide().equals(sensor.getSide())) {
                 
-        		if (SvtHalf.equals(object.getSvtHalf()) && object.getLayerNumber() == layerNumber) {
-                
-        			// If the sensor belongs to the first three layers of the SVT
-        			// and the detector layer and SVT half match, no further searching
-        			// is required.
-        			if(layerNumber <= 6){
-                		return new Pair<Integer, Integer>(object.getFebID(), object.getFebHybridID());
-                	} 
-                	
-        			// If the sensor belongs to layers 4-6, then find the matching
-        			// DAQ pair by looking at combinations of FEB hybrid ID's and module
-        			// numbers.  At the moment, it is assumed that odd SVT layers will 
-        			// be connected to even FEB hybrid channels and even SVT layers to odd
-        			// FEB hybrid channels.
-        			// TODO: Changes should be made to HpsSiSensor that will allow this
-        			//		 portion of the matching to be greatly simplified.
-                	if(SvtHalf.equals(TOP_HALF)){
-                		if(layerNumber%2 != 0 
-                				&& ((object.getFebHybridID() == 0 && moduleNumber == 0) 
-                						|| object.getFebHybridID() == 2 && moduleNumber == 2)){
-                			return new Pair<Integer, Integer>(object.getFebID(), object.getFebHybridID());
-                		} else if(layerNumber %2 == 0 &&((object.getFebHybridID() == 1 && moduleNumber == 0)
-                				|| object.getFebHybridID() == 3 && moduleNumber == 2)) { 
-                			return new Pair<Integer, Integer>(object.getFebID(), object.getFebHybridID());
-                		}
-                	} else if(SvtHalf.equals(BOTTOM_HALF)){ 
-                		if(layerNumber%2 != 0 
-                				&& ((object.getFebHybridID() == 0 && moduleNumber == 1) 
-                						|| object.getFebHybridID() == 2 && moduleNumber == 3)){
-                			return new Pair<Integer, Integer>(object.getFebID(), object.getFebHybridID());
-                		} else if(layerNumber %2 == 0 &&((object.getFebHybridID() == 1 && moduleNumber == 1)
-                				|| object.getFebHybridID() == 3 && moduleNumber == 3)) { 
-                			return new Pair<Integer, Integer>(object.getFebID(), object.getFebHybridID());
-                		}
-                	}
+        			return new Pair<Integer, Integer>(object.getFebID(), object.getFebHybridID());
                 } 
             }
             return null;
@@ -125,12 +98,12 @@
                 buff.append("    ");
             	buff.append(object.getFebHybridID());
                 buff.append("    ");
-            	buff.append(object.getHybridID());
-                buff.append("    ");
                 buff.append(object.getSvtHalf());
                 buff.append("    ");
                 buff.append(String.format("%-2d", object.getLayerNumber()));
                 buff.append("    ");
+                buff.append(object.getSide());
+                buff.append("    ");
                 buff.append(object.getOrientation());
                 buff.append("    ");
                 buff.append('\n');
@@ -147,10 +120,6 @@
     	return getFieldValue("feb_hybrid_id");
     }
     
-    public int getHybridID() { 
-    	return getFieldValue("hybrid_id");
-    }
-    
     public String getSvtHalf() {
         return getFieldValue("svt_half");
     }
@@ -158,6 +127,10 @@
     public int getLayerNumber() {
         return getFieldValue("layer");
     }
+    
+    public String getSide(){
+    	return getFieldValue("side");
+    }
 
     public String getOrientation() { 
     	return getFieldValue("orientation");

java/branches/hps-java_HPSJAVA-88/conditions/src/main/java/org/hps/conditions/svt
SvtDetectorSetup.java 1196 -> 1197
--- java/branches/hps-java_HPSJAVA-88/conditions/src/main/java/org/hps/conditions/svt/SvtDetectorSetup.java	2014-10-15 03:46:04 UTC (rev 1196)
+++ java/branches/hps-java_HPSJAVA-88/conditions/src/main/java/org/hps/conditions/svt/SvtDetectorSetup.java	2014-10-15 04:22:57 UTC (rev 1197)
@@ -39,24 +39,8 @@
             // Reset possible existing conditions data on sensor.
             sensor.reset();
 
-            // Get the layer number.  The layer number will range from 1-12;
-            int layerNumber = sensor.getLayerNumber();
-            
-            // Get the module ID number.  The sensors in the first three layers
-            // of the SVT are assigned a module ID = 0 if they are in the top 
-            // volume and 1 if they are on the bottom.  For layers 4-6, the 
-            // assigned module ID is 0 and 2 for top and 1 and 3 for bottom
-            // depending on whether the sensor is on the hole or slot side of
-            // the half-module.
-            int moduleNumber = sensor.getModuleNumber();
-
             // Get DAQ pair (FEB ID, FEB Hybrid ID) corresponding to this sensor
-            Pair<Integer, Integer> daqPair = null;
-            String SvtHalf = SvtDaqMappingCollection.TOP_HALF;
-            if (sensor.isBottomLayer()) {
-                SvtHalf = SvtDaqMappingCollection.BOTTOM_HALF;
-            }
-            daqPair = daqMap.getDaqPair(SvtHalf, layerNumber, moduleNumber);
+            Pair<Integer, Integer> daqPair = daqMap.getDaqPair(sensor);
             if (daqPair == null) {
                 throw new RuntimeException("Failed to find DAQ pair for sensor: " + sensor.getName());
             }

java/branches/hps-java_HPSJAVA-88/conditions/src/main/resources/org/hps/conditions/config
conditions_dev.xml 1196 -> 1197
--- java/branches/hps-java_HPSJAVA-88/conditions/src/main/resources/org/hps/conditions/config/conditions_dev.xml	2014-10-15 03:46:04 UTC (rev 1196)
+++ java/branches/hps-java_HPSJAVA-88/conditions/src/main/resources/org/hps/conditions/config/conditions_dev.xml	2014-10-15 04:22:57 UTC (rev 1197)
@@ -75,10 +75,10 @@
                 <collection class="org.hps.conditions.svt.SvtChannel$SvtChannelCollection"/>
             </classes>
             <fields>
-                <field name="channel_id" />
-                <field name="feb_id" />
+                <field name="channel_id"    />
+                <field name="feb_id"        />
                 <field name="feb_hybrid_id" />
-                <field name="channel" />
+                <field name="channel"       />
             </fields>
         </table>
         
@@ -88,8 +88,8 @@
                 <collection class="org.hps.conditions.svt.SvtConfiguration$SvtConfigurationCollection"/>                
             </classes>
             <fields>
-                <field name="filename"/>
-                <field name="content"/>
+                <field name="filename"  />
+                <field name="content"   />
             </fields>
         
         </table>
@@ -100,9 +100,9 @@
                 <collection class="org.hps.conditions.svt.SvtGain$SvtGainCollection"/>
             </classes>            
             <fields>
-                <field name="svt_channel_id" />
-                <field name="gain" />
-                <field name="offset" />
+                <field name="svt_channel_id"    />
+                <field name="gain"              />
+                <field name="offset"            />
             </fields>
         </table>
         
@@ -112,10 +112,10 @@
                 <collection class="org.hps.conditions.svt.SvtShapeFitParameters$SvtShapeFitParametersCollection"/>
             </classes>
             <fields>
-                <field name="svt_channel_id" />
-                <field name="amplitude" />
-                <field name="t0" />
-                <field name="tp" />
+                <field name="svt_channel_id"    />
+                <field name="amplitude"         />
+                <field name="t0"                />
+                <field name="tp"                />
             </fields>        
         </table>
         
@@ -125,19 +125,19 @@
                 <collection class="org.hps.conditions.svt.SvtCalibration$SvtCalibrationCollection"/>
             </classes>
             <fields>
-                <field name="svt_channel_id" />
-                <field name="pedestal_0" />
-                <field name="pedestal_1" />
-                <field name="pedestal_2" />
-                <field name="pedestal_3" />
-                <field name="pedestal_4" />
-                <field name="pedestal_5" />
-                <field name="noise_0" />
-                <field name="noise_1" />
-                <field name="noise_2" />
-                <field name="noise_3" />
-                <field name="noise_4" />
-                <field name="noise_5" />
+                <field name="svt_channel_id"    />
+                <field name="pedestal_0"        />
+                <field name="pedestal_1"        />
+                <field name="pedestal_2"        />
+                <field name="pedestal_3"        />
+                <field name="pedestal_4"        />
+                <field name="pedestal_5"        />
+                <field name="noise_0"           />
+                <field name="noise_1"           />
+                <field name="noise_2"           />
+                <field name="noise_3"           />
+                <field name="noise_4"           />
+                <field name="noise_5"           />
             </fields>        
         </table>
         
@@ -147,9 +147,9 @@
                 <collection class="org.hps.conditions.svt.SvtT0Shift$SvtT0ShiftCollection"/>
             </classes>
             <fields>
-                <field name="feb_id" />
+                <field name="feb_id"        />
                 <field name="feb_hybrid_id" />
-                <field name="t0_shift" />
+                <field name="t0_shift"      />
             </fields>        
         </table>
         
@@ -170,12 +170,12 @@
 				<collection class="org.hps.conditions.svt.SvtDaqMapping$SvtDaqMappingCollection"/>
             </classes>
             <fields>
-                <field name="feb_id" />
+                <field name="feb_id"        />
                 <field name="feb_hybrid_id" />
-                <field name="hybrid_id" />
-                <field name="svt_half" />
-                <field name="layer" />
-                <field name="orientation" />
+                <field name="svt_half"      />
+                <field name="layer"         />
+                <field name="side"          />
+                <field name="orientation"   />
             </fields>  
         </table>
 

java/branches/hps-java_HPSJAVA-88/datacat
pom.xml 1196 -> 1197
--- java/branches/hps-java_HPSJAVA-88/datacat/pom.xml	2014-10-15 03:46:04 UTC (rev 1196)
+++ java/branches/hps-java_HPSJAVA-88/datacat/pom.xml	2014-10-15 04:22:57 UTC (rev 1197)
@@ -3,12 +3,12 @@
     <modelVersion>4.0.0</modelVersion>
     <artifactId>hps-datacat</artifactId>
     <name>datacat</name>
-    <description>HPS data catalog wrappers and utilities</description>
+    <description>data catalog wrappers and utilities</description>
     <parent>
         <groupId>org.hps</groupId>
         <artifactId>hps-parent</artifactId>
         <relativePath>../parent/pom.xml</relativePath>
-        <version>3.0.2-SNAPSHOT</version>
+        <version>3.0.3-SNAPSHOT</version>
     </parent>    
     <repositories>
         <repository>

java/branches/hps-java_HPSJAVA-88/detector-data
pom.xml 1196 -> 1197
--- java/branches/hps-java_HPSJAVA-88/detector-data/pom.xml	2014-10-15 03:46:04 UTC (rev 1196)
+++ java/branches/hps-java_HPSJAVA-88/detector-data/pom.xml	2014-10-15 04:22:57 UTC (rev 1197)
@@ -3,7 +3,7 @@
     <modelVersion>4.0.0</modelVersion>
     <artifactId>hps-detector-data</artifactId>
     <name>detector-data</name>
-    <description>detector conditions data for the HPS experiment</description>
+    <description>detector conditions data including text based conditions and compact XML files</description>
     <parent>
         <groupId>org.hps</groupId>
         <artifactId>hps-parent</artifactId>

java/branches/hps-java_HPSJAVA-88/distribution
pom.xml 1196 -> 1197
--- java/branches/hps-java_HPSJAVA-88/distribution/pom.xml	2014-10-15 03:46:04 UTC (rev 1196)
+++ java/branches/hps-java_HPSJAVA-88/distribution/pom.xml	2014-10-15 04:22:57 UTC (rev 1197)
@@ -3,7 +3,7 @@
     <modelVersion>4.0.0</modelVersion>
     <artifactId>hps-distribution</artifactId>
     <name>distribution</name>
-    <description>runnable jar distribution and JAS plugin configuration</description>
+    <description>module for creating a standalone runnable bin jar for HPS Java</description>
     <properties>
         <maven.javadoc.skip>true</maven.javadoc.skip>
     </properties>
@@ -18,10 +18,19 @@
         <connection>scm:svn:svn://svn.freehep.org/hps/java/trunk/distribution/</connection>
         <developerConnection>scm:svn:svn://svn.freehep.org/hps/java/trunk/distribution/</developerConnection>
     </scm>
-    <build>       
+    <build>              
         <plugins>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-site-plugin</artifactId>
+                <version>3.1</version>
+                <configuration>
+                    <skip>true</skip>
+                    <skipDeploy>true</skipDeploy>
+                </configuration>
+            </plugin>        
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-shade-plugin</artifactId>
                 <executions>
                     <execution>

java/branches/hps-java_HPSJAVA-88/ecal-readout-sim
pom.xml 1196 -> 1197
--- java/branches/hps-java_HPSJAVA-88/ecal-readout-sim/pom.xml	2014-10-15 03:46:04 UTC (rev 1196)
+++ java/branches/hps-java_HPSJAVA-88/ecal-readout-sim/pom.xml	2014-10-15 04:22:57 UTC (rev 1197)
@@ -3,7 +3,7 @@
     <modelVersion>4.0.0</modelVersion>
     <artifactId>hps-ecal-readout-sim</artifactId>
     <name>ecal-readout-sim</name>
-    <description>HPS ECAL readout simulation</description>
+    <description>MC readout simulation</description>
     <parent>
         <groupId>org.hps</groupId>
         <artifactId>hps-parent</artifactId>

java/branches/hps-java_HPSJAVA-88/ecal-recon
pom.xml 1196 -> 1197
--- java/branches/hps-java_HPSJAVA-88/ecal-recon/pom.xml	2014-10-15 03:46:04 UTC (rev 1196)
+++ java/branches/hps-java_HPSJAVA-88/ecal-recon/pom.xml	2014-10-15 04:22:57 UTC (rev 1197)
@@ -3,7 +3,7 @@
     <modelVersion>4.0.0</modelVersion>
     <artifactId>hps-ecal-recon</artifactId>
     <name>ecal-recon</name>
-    <description>HPS ECAL reconstruction module</description>
+    <description>ECAL reconstruction algorithms</description>
     <parent>
         <groupId>org.hps</groupId>
         <artifactId>hps-parent</artifactId>

java/branches/hps-java_HPSJAVA-88/ecal-recon/src/main/java/org/hps/recon/ecal
EcalClusterIC.java 1196 -> 1197
--- java/branches/hps-java_HPSJAVA-88/ecal-recon/src/main/java/org/hps/recon/ecal/EcalClusterIC.java	2014-10-15 03:46:04 UTC (rev 1196)
+++ java/branches/hps-java_HPSJAVA-88/ecal-recon/src/main/java/org/hps/recon/ecal/EcalClusterIC.java	2014-10-15 04:22:57 UTC (rev 1197)
@@ -80,6 +80,37 @@
     double minTime = 0.0;
     // Maximum time cut window range. Units in ns.
     double timeWindow = 20.0;
+    // Variables for electron energy corrections
+    static final double ELECTRON_ENERGY_A = -0.0027;
+    static final double ELECTRON_ENERGY_B = -0.06;
+    static final double ELECTRON_ENERGY_C = 0.95;
+    // Variables for positron energy corrections
+    static final double POSITRON_ENERGY_A = -0.0096;
+    static final double POSITRON_ENERGY_B = -0.042;
+    static final double POSITRON_ENERGY_C = 0.94;
+    // Variables for photon energy corrections
+    static final double PHOTON_ENERGY_A = 0.0015;
+    static final double PHOTON_ENERGY_B = -0.047;
+    static final double PHOTON_ENERGY_C = 0.94;
+    // Variables for electron position corrections
+    static final double ELECTRON_POS_A = 0.0066;
+	static final double ELECTRON_POS_B = -0.03;
+	static final double ELECTRON_POS_C = 0.028;
+	static final double ELECTRON_POS_D = -0.45;
+	static final double ELECTRON_POS_E = 0.465;
+    // Variables for positron position corrections
+	static final double POSITRON_POS_A = 0.0072;
+	static final double POSITRON_POS_B = -0.031;
+	static final double POSITRON_POS_C = 0.007;
+	static final double POSITRON_POS_D = 0.342;
+	static final double POSITRON_POS_E = 0.108;
+    // Variables for photon position corrections
+	static final double PHOTON_POS_A = 0.005;
+	static final double PHOTON_POS_B = -0.032;
+	static final double PHOTON_POS_C = 0.011;
+	static final double PHOTON_POS_D = -0.037;
+	static final double PHOTON_POS_E = 0.294;
+	
     
        
     public void setClusterCollectionName(String clusterCollectionName) {
@@ -249,15 +280,13 @@
         //Map a crystal to the seed of the cluster of which it is a member.
         HashMap<CalorimeterHit, CalorimeterHit> hitSeedMap = new HashMap<CalorimeterHit, CalorimeterHit>();
         
-      	//Set containing hits immediately around a seed hit.
-      	HashSet<CalorimeterHit> surrSeedSet = new HashSet<CalorimeterHit>();
-        
         // Loop through all calorimeter hits to locate seeds and perform
         // first pass calculations for component and common hits.
-        for (CalorimeterHit hit : hitList) {
+        for (int ii = 0; ii <= hitList.size() - 1; ii ++){
+        	CalorimeterHit hit = hitList.get(ii);
         	// Get the set of all neighboring crystals to the current hit.
             Set<Long> neighbors = neighborMap.get(hit.getCellID());
-            
+
             // Generate a list to store any neighboring hits in.
             ArrayList<CalorimeterHit> neighborHits = new ArrayList<CalorimeterHit>();
             
@@ -278,18 +307,24 @@
             // Loops through all the neighboring hits to determine if
             // the current hit is the local maximum within its set of
             // neighboring hits.
-            seedHitLoop:
-            for(CalorimeterHit neighbor : neighborHits) {
-            	if(!equalEnergies(hit, neighbor)) {
-            		isSeed = false;
-               		break seedHitLoop;
-            	}
-           
-            }
-            
+            	seedHitLoop:
+            		for(CalorimeterHit neighbor : neighborHits) {
+            			if(!equalEnergies(hit, neighbor)) {
+            				isSeed = false;
+            				break seedHitLoop;
+            			}
+            		}
             // If this hit is a seed hit, just map it to itself.
-            if (isSeed) { hitSeedMap.put(hit, hit); }
+            if (isSeed && hit.getCorrectedEnergy() >= seedEnergyThreshold) { hitSeedMap.put(hit, hit); }
             
+            // If this hit is a local maximum but does not pass seed threshold, 
+            // remove from hit list and do not cluster. 
+            else if (isSeed  && hit.getCorrectedEnergy() < seedEnergyThreshold){           	
+            	hitList.remove(ii);
+            	rejectedHitList.add(hit); 
+            	ii --;
+        	}
+            
             // If this hit is not a seed hit, see if it should be
             // attached to any neighboring seed hits.
             else {
@@ -325,7 +360,6 @@
                         // that it has been clustered.
                         else {
                           	hitSeedMap.put(hit, neighborHit);
-                        	surrSeedSet.add(hit);
                         }
                 	}
                 }
@@ -335,8 +369,7 @@
         // Performs second pass calculations for component hits.
         secondaryHitsLoop:
         for (CalorimeterHit secondaryHit : hitList) {
-        	// If the secondary hit is not associated with a seed, then
-        	// the rest of there is nothing further to be done.
+        	// Look for hits that already have an associated seed/clustering.
         	if(!hitSeedMap.containsKey(secondaryHit)) { continue secondaryHitsLoop; }
         	
         	// Get the secondary hit's neighboring crystals.
@@ -353,7 +386,7 @@
             	
             	// If the neighboring crystal exists and is not already
             	// in a cluster, add it to the list of neighboring hits.
-                if (secondaryNeighborHit != null && !hitSeedMap.containsKey(secondaryNeighborHit)) { //!clusteredHitSet.contains(secondaryNeighborHit)) {
+                if (secondaryNeighborHit != null && !hitSeedMap.containsKey(secondaryNeighborHit)) {
                 	secondaryNeighborHits.add(secondaryNeighborHit);
                 }
             }
@@ -363,30 +396,19 @@
             	// If the neighboring hit is of lower energy than the
             	// current secondary hit, then associate the neighboring
             	// hit with the current secondary hit's seed.
-            	
-            	//  if (secondaryNeighborHit.getCorrectedEnergy() < secondaryHit.getCorrectedEnergy()) {
-            	if(!equalEnergies(secondaryNeighborHit, secondaryHit)) {
-                	hitSeedMap.put(secondaryNeighborHit, hitSeedMap.get(secondaryHit));
-                }
+            	if(!equalEnergies(secondaryNeighborHit, secondaryHit)){
+            		hitSeedMap.put(secondaryNeighborHit, hitSeedMap.get(secondaryHit));}
             	else {continue;}
             }
         } // End component hits loop.
 
-        // This is a check to ensure ALL hits are either components or seeds. 
-        for (CalorimeterHit check : hitList){
-        	if(!hitSeedMap.containsKey(check)){
-        		System.out.println("Something is not clustered or component!");
-        		System.out.println("not clustered:"+"\t"+check.getIdentifierFieldValue("ix")+"\t"+
-        		check.getIdentifierFieldValue("iy")+"\t"+check.getCorrectedEnergy());
-        	}
-        }
-        
-                
+      
         // Performs second pass calculations for common hits.
         commonHitsLoop:
         for (CalorimeterHit clusteredHit : hitSeedMap.keySet()) {
+        	        	
         	// Seed hits are never common hits and can be skipped.
-        	if(hitSeedMap.get(clusteredHit) == clusteredHit || surrSeedSet.contains(clusteredHit)) { continue commonHitsLoop; }
+        	if(hitSeedMap.get(clusteredHit) == clusteredHit) { continue commonHitsLoop; }
         	
     		// Get the current clustered hit's neighboring crystals.
             Set<Long> clusteredNeighbors = neighborMap.get(clusteredHit.getCellID());
@@ -401,42 +423,45 @@
             	CalorimeterHit clusteredNeighborHit = hitMap.get(neighbor);
             	
             	// If it exists, add it to the neighboring hit list.
-                if (clusteredNeighborHit != null) {
+
+                if (clusteredNeighborHit != null && hitSeedMap.get(clusteredNeighborHit) != null) {         	
                 	clusteredNeighborHits.add(clusteredNeighborHit);
                 }
             }
             
             // Get the seed hit associated with this clustered hit.
             CalorimeterHit clusteredHitSeed = hitSeedMap.get(clusteredHit);
+
             
             // Loop over the clustered neighbor hits.
             for (CalorimeterHit clusteredNeighborHit : clusteredNeighborHits) {
             	// Check to make sure that the clustered neighbor hit
             	// is not already associated with the current clustered
-            	// hit's seed.
+            	// hit's seed.                    	
             	
-                if (hitSeedMap.get(clusteredNeighborHit) != clusteredHitSeed){
-
-                    //if (clusteredHit.getCorrectedEnergy() < clusteredNeighborHit.getCorrectedEnergy()) {
-                	if(!equalEnergies(clusteredHit, clusteredNeighborHit)){
-                	// Check and see if a list of common seeds
-                    	// for this hit already exists or not.
-                    	List<CalorimeterHit> commonHitList = commonHits.get(clusteredHit);
+                if ((hitSeedMap.get(clusteredNeighborHit) != clusteredHitSeed)){
+                	// Check for lowest energy hit and that comparison hit is not already common. 
+                	// If already common, this boundary is already accounted for. 
+                	if(!equalEnergies(clusteredHit, clusteredNeighborHit)
+                			&& !commonHits.containsKey(clusteredNeighborHit)){
+                		                		     		
+                			// Check and see if a list of common seeds
+                			// for this hit already exists or not.
+                			List<CalorimeterHit> commonHitList = commonHits.get(clusteredHit);
                     	
-                    	// If it does not, make a new one.
-                    	if(commonHitList == null) { commonHitList = new ArrayList<CalorimeterHit>(); }
+                			// If it does not, make a new one.                 	
+                			if(commonHitList == null) { commonHitList = new ArrayList<CalorimeterHit>();}
                     	
-                    	// Add the neighbors to the seeds to set of
-                    	// common seeds.
-                        commonHitList.add(clusteredHitSeed);
-                       	commonHitList.add(hitSeedMap.get(clusteredNeighborHit));
+                			// Add the neighbors to the seeds to set of
+                			// common seeds.
+                			commonHitList.add(clusteredHitSeed);                			
+                			commonHitList.add(hitSeedMap.get(clusteredNeighborHit));
                         
-                        // Put the common seed list back into the set.
-                        commonHits.put(clusteredHit, commonHitList);
-                    }
-                }
-                
-                
+                			// Put the common seed list back into the set.
+                			commonHits.put(clusteredHit, commonHitList); 
+                			
+                	}
+                }             
             }
         } // End common hits loop.
 
@@ -465,7 +490,7 @@
         for (Map.Entry<CalorimeterHit, CalorimeterHit> entry : hitSeedMap.entrySet()) {
             CalorimeterHit eSeed = entry.getValue();
             double eEnergy = seedEnergy.get(eSeed);
-            eEnergy += entry.getKey().getRawEnergy();
+            eEnergy += entry.getKey().getCorrectedEnergy();
             seedEnergy.put(eSeed, eEnergy);
         }
 
@@ -477,8 +502,8 @@
         	CalorimeterHit commonCell = entry1.getKey();
         	CalorimeterHit seedA = entry1.getValue().get(0);
         	CalorimeterHit seedB = entry1.getValue().get(1);    	
-        	double eFractionA = Math.log(seedEnergy.get(seedA))/Math.log((seedEnergy.get(seedA)+seedEnergy.get(seedB)));
-        	double eFractionB = Math.log(seedEnergy.get(seedB))/Math.log((seedEnergy.get(seedA)+seedEnergy.get(seedB)));
+        	double eFractionA = (seedEnergy.get(seedA))/((seedEnergy.get(seedA)+seedEnergy.get(seedB)));
+        	double eFractionB = (seedEnergy.get(seedB))/((seedEnergy.get(seedA)+seedEnergy.get(seedB)));
         	double currEnergyA = seedEnergyTot.get(seedA);
         	double currEnergyB = seedEnergyTot.get(seedB);
         	currEnergyA += eFractionA * commonCell.getCorrectedEnergy();
@@ -500,6 +525,9 @@
                 // Energy correction for initial guess of electron:
                 int pdg = 11;
                 double corrEnergy = enCorrection(pdg, rawEnergy);
+                if(corrEnergy<1){ //this only happens below threshold
+                	corrEnergy = rawEnergy;
+                }
               
                 seedEnergyCorr.put(entryC.getKey(), corrEnergy);    
             }// end of energy corrections
@@ -759,30 +787,45 @@
     	return isSeed;	
     }
     /**
-     * Calculates energy correction based on cluster raw energy and particle type as per HPS Note 2014-001
+     * Calculates energy correction based on cluster raw energy and particle type as per 
+     *<a href="https://misportal.jlab.org/mis/physics/hps_notes/index.cfm?note_year=2014">HPS Note 2014-001</a>
      * @param pdg Particle id as per PDG
      * @param rawEnergy Raw Energy of the cluster (sum of hits with shared hit distribution)
      * @return Corrected Energy
      */    
     public double enCorrection(int pdg, double rawEnergy){
-  	   if (pdg == 11) { // Particle is electron
-  		   double corrEnergy = rawEnergy / (-0.0027 * rawEnergy - 0.06 / (Math.sqrt(rawEnergy)) + 0.95);
-  		  return corrEnergy;}
+  	   if (pdg == 11) { // Particle is electron  		   
+  		   return energyCorrection(rawEnergy, ELECTRON_ENERGY_A, ELECTRON_ENERGY_B, ELECTRON_ENERGY_C);   
+  	   }
   	   else if (pdg == -11) { //Particle is positron
-  		   double corrEnergy = rawEnergy / (-0.0096 * rawEnergy - 0.042 / (Math.sqrt(rawEnergy)) + 0.94);
-  		  return corrEnergy;}
+		   return energyCorrection(rawEnergy, POSITRON_ENERGY_A, POSITRON_ENERGY_B, POSITRON_ENERGY_C);   
+  	   }
   	   else if (pdg == 22) { //Particle is photon
-  		   double corrEnergy = rawEnergy / (0.0015 * rawEnergy - 0.047 / (Math.sqrt(rawEnergy)) + 0.94);
-  		  return corrEnergy;}
+		   return energyCorrection(rawEnergy, PHOTON_ENERGY_A, PHOTON_ENERGY_B, PHOTON_ENERGY_C);   
+  	   }
   	   else { //Unknown 
   		   double corrEnergy = rawEnergy;
-  		  return corrEnergy;}
+  		   return corrEnergy;}
   	   
      }   
     
     /**
+     * Calculates the energy correction to a cluster given the variables from the fit as per
+     * <a href="https://misportal.jlab.org/mis/physics/hps_notes/index.cfm?note_year=2014">HPS Note 2014-001</a>
+     * @param rawEnergy Raw energy of the cluster
+     * @param A,B,C from fitting in note
+     * @return Corrected Energy
+     */   
+    public double energyCorrection(double rawEnergy, double varA, double varB, double varC){
+    	double corrEnergy = rawEnergy / (varA * rawEnergy + varB / (Math.sqrt(rawEnergy)) + varC);
+    	return corrEnergy;
+    }
+       
+    
+    /**
      * Calculates position correction based on cluster raw energy, x calculated position, 
-     * and particle type as per HPS Note 2014-001
+     * and particle type as per 
+     * <a href="https://misportal.jlab.org/mis/physics/hps_notes/index.cfm?note_year=2014">HPS Note 2014-001</a>
      * @param pdg Particle id as per PDG
      * @param xCl Calculated x centroid position of the cluster, uncorrected, at face
      * @param rawEnergy Raw energy of the cluster (sum of hits with shared hit distribution)
@@ -790,23 +833,42 @@
      */
     public double posCorrection(int pdg, double xPos, double rawEnergy){
     	double xCl = xPos/10.0;//convert to mm
-    	if (pdg == 11) { //Particle is electron
-    		double xCorr = xCl-(0.0066/Math.sqrt(rawEnergy)-0.03)*xCl-
-    				(0.028*rawEnergy-0.45/Math.sqrt(rawEnergy)+0.465);
-    		return xCorr*10.0;}
-    	else if (pdg == -11) {// Particle is positron
-    		double xCorr = xCl-(0.0072/Math.sqrt(rawEnergy)-0.031)*xCl-
-    				(0.007*rawEnergy+0.342/Math.sqrt(rawEnergy)+0.108);
-    		return xCorr*10.0;}
-    	else if (pdg == 22) {// Particle is photon
-    		double xCorr = xCl-(0.005/Math.sqrt(rawEnergy)-0.032)*xCl-
-    				(0.011*rawEnergy-0.037/Math.sqrt(rawEnergy)+0.294);
-    		return xCorr*10.0;}
+    	if (pdg == 11) { //Particle is electron    	
+    		double xCorr = positionCorrection(xCl, rawEnergy, ELECTRON_POS_A, ELECTRON_POS_B, ELECTRON_POS_C, ELECTRON_POS_D, ELECTRON_POS_E);
+    		return xCorr*10.0;
+    	}
+    	else if (pdg == -11) {// Particle is positron   	
+    		double xCorr = positionCorrection(xCl, rawEnergy, POSITRON_POS_A, POSITRON_POS_B, POSITRON_POS_C, POSITRON_POS_D, POSITRON_POS_E);
+    		return xCorr*10.0;
+    	}
+    	else if (pdg == 22) {// Particle is photon  	
+    		double xCorr = positionCorrection(xCl, rawEnergy, PHOTON_POS_A, PHOTON_POS_B, PHOTON_POS_C, PHOTON_POS_D, PHOTON_POS_E);
+    		return xCorr*10.0;
+    	}
     	else { //Unknown 
     		double xCorr = xCl;
     		return xCorr*10.0;}
     	}
     
     
+   /**
+    * Calculates the position correction in cm using the raw energy and variables associated with the fit
+    * of the particle as described in  
+    * <a href="https://misportal.jlab.org/mis/physics/hps_notes/index.cfm?note_year=2014">HPS Note 2014-001</a>
+    * @param xCl
+    * @param rawEnergy
+    * @param varA
+    * @param varB
+    * @param varC
+    * @param varD
+    * @param varE
+    * @return
+    */    
+    public double positionCorrection(double xCl, double rawEnergy, double varA, double varB, double varC, double varD, double varE){
+    	double xCorr = xCl-(varA/Math.sqrt(rawEnergy) + varB )*xCl-
+				(varC*rawEnergy + varD/Math.sqrt(rawEnergy) + varE);
+    	return xCorr;
+    }
+   
     	
  }    
\ No newline at end of file

java/branches/hps-java_HPSJAVA-88/evio
pom.xml 1196 -> 1197
--- java/branches/hps-java_HPSJAVA-88/evio/pom.xml	2014-10-15 03:46:04 UTC (rev 1196)
+++ java/branches/hps-java_HPSJAVA-88/evio/pom.xml	2014-10-15 04:22:57 UTC (rev 1197)
@@ -3,7 +3,7 @@
     <modelVersion>4.0.0</modelVersion>
     <artifactId>hps-evio</artifactId>
     <name>evio</name>
-    <description>HPS EVIO utilities package</description>
+    <description>EVIO utilities including EVIO to LCIO event builders</description>
     <parent>
         <groupId>org.hps</groupId>
         <artifactId>hps-parent</artifactId>

java/branches/hps-java_HPSJAVA-88/integration-tests
pom.xml 1196 -> 1197
--- java/branches/hps-java_HPSJAVA-88/integration-tests/pom.xml	2014-10-15 03:46:04 UTC (rev 1196)
+++ java/branches/hps-java_HPSJAVA-88/integration-tests/pom.xml	2014-10-15 04:22:57 UTC (rev 1197)
@@ -2,7 +2,7 @@
     <modelVersion>4.0.0</modelVersion>
     <artifactId>hps-integration-tests</artifactId>
     <name>integration-tests</name>
-    <description>Integration test suite for HPS Java</description>
+    <description>integration test suite</description>
     <parent>
         <groupId>org.hps</groupId>
         <artifactId>hps-parent</artifactId>

java/branches/hps-java_HPSJAVA-88/monitoring-app
pom.xml 1196 -> 1197
--- java/branches/hps-java_HPSJAVA-88/monitoring-app/pom.xml	2014-10-15 03:46:04 UTC (rev 1196)
+++ java/branches/hps-java_HPSJAVA-88/monitoring-app/pom.xml	2014-10-15 04:22:57 UTC (rev 1197)
@@ -2,7 +2,7 @@
     <modelVersion>4.0.0</modelVersion>
     <artifactId>hps-monitoring-app</artifactId>
     <name>monitoring-app</name>
-    <description>HPS online monitoring application</description>
+    <description>online monitoring application</description>
     <parent>
         <groupId>org.hps</groupId>
         <artifactId>hps-parent</artifactId>

java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/gui
JobSettingsPanel.java 1196 -> 1197
--- java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/gui/JobSettingsPanel.java	2014-10-15 03:46:04 UTC (rev 1196)
+++ java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/gui/JobSettingsPanel.java	2014-10-15 04:22:57 UTC (rev 1197)
@@ -357,54 +357,5 @@
                 steeringResourcesComboBox.setSelectedItem(value);
             }                                          
         }
-    }   
-    
-    /**
-     * Setup the event builder from the field setting.
-     * @return True if builder is setup successfully; false if not.
-     */
-    // FIXME: This method should throw an exception if an error occurs.
-    /*
-    void editEventBuilder() {
-        String eventBuilderClassName = eventBuilderField.getText();
-        boolean okay = true;
-        try {
-            // Test that the event builder can be created without throwing any exceptions.
-            Class<?> eventBuilderClass = Class.forName(eventBuilderClassName);
-            eventBuilderClass.newInstance();
-        } catch (Exception e) {
-            throw new RuntimeException("Error setting up event builder.", e);
-        }        
-        catch (ClassNotFoundException e) {
-            JOptionPane.showMessageDialog(this, "The event builder class does not exist.");
-            okay = false;
-        } 
-        catch (InstantiationException e) {
-            JOptionPane.showMessageDialog(this, "Failed to instantiate instance of event builder class.");
-            okay = false;
-        } 
-        catch (IllegalAccessException e) {
-            JOptionPane.showMessageDialog(this, "Couldn't access event builder class.");
-            okay = false;
-        }
-        
-        if (!okay)
-            resetEventBuilder();
-    }    
-
-    /**
-     * Reset the event builder to the default.
-     */
-    /*
-    // FIXME: Handle this with property change listener and use old value if new one is invalid.    
-    private void resetEventBuilder() {
-        SwingUtilities.invokeLater(new Runnable() {
-            public void run() {
-                eventBuilderField.setText(DEFAULT_EVENT_BUILDER_CLASS_NAME);
-            }
-        });
-    }
-    */
-
-    
+    }        
 }
\ No newline at end of file

java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/gui
MonitoringApplication.java 1196 -> 1197
--- java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/gui/MonitoringApplication.java	2014-10-15 03:46:04 UTC (rev 1196)
+++ java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/gui/MonitoringApplication.java	2014-10-15 04:22:57 UTC (rev 1197)
@@ -322,7 +322,7 @@
     
     /**
      * Handle a property change event.
-     * @evt The property change event.
+     * @param evt The property change event.
      */
     @Override
     public void propertyChange(PropertyChangeEvent evt) {
@@ -409,11 +409,12 @@
      */
     private void setupUncaughtExceptionHandler() {
         Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {            
-            public void uncaughtException(Thread thread, Throwable exception) {
-               MonitoringApplication.this.errorHandler.setError(exception)
+            public void uncaughtException(Thread thread, Throwable exception) {                               
+                MonitoringApplication.this.errorHandler.setError(exception)
                    .log()
                    .printStackTrace()
                    .showErrorDialog();
+                // FIXME: This should probably cause a system.exit after the dialog box is closed!
             }
         });
     }
@@ -469,7 +470,6 @@
      */
     private void setupAida() {
         MonitoringAnalysisFactory.register();
-        MonitoringAnalysisFactory.configure();
         MonitoringPlotFactory.setRootPane(this.plotWindow.getPlotPane());
         MonitoringPlotFactory.setPlotterRegionListener(new PlotterRegionListener() {
             @Override
@@ -1763,4 +1763,4 @@
                 config.getWaitTime(), 
                 config.getChunkSize());
     }                      
-}
\ No newline at end of file
+}

java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/plotting
MonitoringAnalysisFactory.java 1196 -> 1197
--- java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/plotting/MonitoringAnalysisFactory.java	2014-10-15 03:46:04 UTC (rev 1196)
+++ java/branches/hps-java_HPSJAVA-88/monitoring-app/src/main/java/org/hps/monitoring/plotting/MonitoringAnalysisFactory.java	2014-10-15 04:22:57 UTC (rev 1197)
@@ -1,10 +1,6 @@
 package org.hps.monitoring.plotting;
 
-import org.jfree.chart.ChartFactory;
-import org.jfree.chart.renderer.xy.XYBarRenderer;
-
 import hep.aida.IPlotterFactory;
-import hep.aida.jfree.chart.DefaultChartTheme;
 import hep.aida.ref.AnalysisFactory;
 
 /**
@@ -28,14 +24,6 @@
     }
     
     /**
-     * Do some JFreeChart related configuration.
-     */
-    public static void configure() {
-        ChartFactory.setChartTheme(new DefaultChartTheme());
-        XYBarRenderer.setDefaultShadowsVisible(false);
-    }
-
-    /**
      * Create a named plotter factory for the monitoring application.
      */
     public IPlotterFactory createPlotterFactory(String name) {

java/branches/hps-java_HPSJAVA-88/monitoring-drivers
pom.xml 1196 -> 1197
--- java/branches/hps-java_HPSJAVA-88/monitoring-drivers/pom.xml	2014-10-15 03:46:04 UTC (rev 1196)
+++ java/branches/hps-java_HPSJAVA-88/monitoring-drivers/pom.xml	2014-10-15 04:22:57 UTC (rev 1197)
@@ -2,7 +2,7 @@
     <modelVersion>4.0.0</modelVersion>
     <artifactId>hps-monitoring-drivers</artifactId>
     <name>monitoring-drivers</name>
-    <description>Drivers for the MonitoringApplication</description>
+    <description>org.lcsim Drivers for using in the monitoring application</description>
     <parent>
         <groupId>org.hps</groupId>
         <artifactId>hps-parent</artifactId>

java/branches/hps-java_HPSJAVA-88/monitoring-drivers/src/main/java/org/hps/monitoring/drivers/example
SimplePlotDriver.java removed after 1196
--- java/branches/hps-java_HPSJAVA-88/monitoring-drivers/src/main/java/org/hps/monitoring/drivers/example/SimplePlotDriver.java	2014-10-15 03:46:04 UTC (rev 1196)
+++ java/branches/hps-java_HPSJAVA-88/monitoring-drivers/src/main/java/org/hps/monitoring/drivers/example/SimplePlotDriver.java	2014-10-15 04:22:57 UTC (rev 1197)
@@ -1,46 +0,0 @@
-package org.hps.monitoring.drivers.example;
-
-import hep.aida.IHistogram1D;
-import hep.aida.IPlotter;
-import hep.aida.IPlotterFactory;
-
-import org.lcsim.event.EventHeader;
-import org.lcsim.event.RawCalorimeterHit;
-import org.lcsim.event.RawTrackerHit;
-import org.lcsim.util.Driver;
-import org.lcsim.util.aida.AIDA;
-
-public class SimplePlotDriver extends Driver {
-    
-    static String ecalCollectionName = "EcalReadoutHits";
-    static String svtCollectionName = "SVTRawTrackerHits";
-    
-    AIDA aida = AIDA.defaultInstance();
-    IHistogram1D svtHitsPlot;
-    IHistogram1D ecalHitsPlot;
-    IHistogram1D ecalEnergyPlot;
-    
-    public void startOfData() {
-        ecalHitsPlot = aida.histogram1D("ECAL Hits per Event", 20, 0., 20.);
-        svtHitsPlot = aida.histogram1D("SVT Hits per Event", 200, 0., 200.);
-        
-        IPlotterFactory plotterFactory = aida.analysisFactory().createPlotterFactory("Monitoring Test Plots");
-        
-        IPlotter plotter = plotterFactory.create("ECAL");
-        plotter.createRegion();
-        plotter.region(0).plot(ecalHitsPlot);
-        plotter.show();
-        
-        plotter = plotterFactory.create("SVT");
-        plotter.createRegion();
-        plotter.region(0).plot(svtHitsPlot);
-        plotter.show();
-    }
-    
-    public void process(EventHeader event) {
-        if (event.hasCollection(RawTrackerHit.class, svtCollectionName))            
-            svtHitsPlot.fill(event.get(RawTrackerHit.class, svtCollectionName).size());
-        if (event.hasCollection(RawCalorimeterHit.class,  ecalCollectionName))
-            ecalHitsPlot.fill(event.get(RawCalorimeterHit.class, ecalCollectionName).size());
-    }
-}
\ No newline at end of file

java/branches/hps-java_HPSJAVA-88/parent
pom.xml 1196 -> 1197
--- java/branches/hps-java_HPSJAVA-88/parent/pom.xml	2014-10-15 03:46:04 UTC (rev 1196)
+++ java/branches/hps-java_HPSJAVA-88/parent/pom.xml	2014-10-15 04:22:57 UTC (rev 1197)
@@ -8,10 +8,12 @@
     <packaging>pom</packaging>
     <version>3.0.3-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.5-SNAPSHOT</lcsimVersion>
+        <skipSite>false</skipSite>
     </properties>
     <scm>
         <url>http://java.freehep.org/svn/repos/hps/list/java/trunk/parent/</url>
@@ -223,6 +225,8 @@
                     <version>3.3</version>
                     <configuration>
                         <chmod>false</chmod>
+                        <skip>${skipSite}</skip>
+                        <skipDeploy>${skipSite}</skipDeploy>
                     </configuration>
                 </plugin>
                 <plugin>

java/branches/hps-java_HPSJAVA-88/plugin
pom.xml 1196 -> 1197
--- java/branches/hps-java_HPSJAVA-88/plugin/pom.xml	2014-10-15 03:46:04 UTC (rev 1196)
+++ java/branches/hps-java_HPSJAVA-88/plugin/pom.xml	2014-10-15 04:22:57 UTC (rev 1197)
@@ -2,7 +2,7 @@
     <modelVersion>4.0.0</modelVersion>
     <artifactId>hps-plugin</artifactId>
     <name>plugin</name>
-    <description>HPS JAS3 Plugin</description>
+    <description>JAS3 Plugin</description>
     <parent>
         <groupId>org.hps</groupId>
         <artifactId>hps-parent</artifactId>

java/branches/hps-java_HPSJAVA-88
pom.xml 1196 -> 1197
--- java/branches/hps-java_HPSJAVA-88/pom.xml	2014-10-15 03:46:04 UTC (rev 1196)
+++ java/branches/hps-java_HPSJAVA-88/pom.xml	2014-10-15 04:22:57 UTC (rev 1197)
@@ -1,5 +1,4 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
     <modelVersion>4.0.0</modelVersion>
     <groupId>org.hps</groupId>
     <artifactId>hps-modules</artifactId>
@@ -7,27 +6,23 @@
     <name>HPS Java Project</name>
     <description>HPS module build</description>
     <url>http://www.lcsim.org/sites/hps/</url>
-
     <parent>
         <groupId>org.hps</groupId>
         <artifactId>hps-parent</artifactId>
         <relativePath>parent/pom.xml</relativePath>
         <version>3.0.3-SNAPSHOT</version>
     </parent>   
-
     <scm>
         <url>svn://svn.freehep.org/hps/java/trunk/</url>
         <connection>scm:svn:svn://svn.freehep.org/hps/java/trunk/</connection>
         <developerConnection>scm:svn:svn://svn.freehep.org/hps/java/trunk/</developerConnection>
     </scm>
-
     <distributionManagement>
         <site>
             <id>lcsim-site</id>
             <url>dav:http://srs.slac.stanford.edu/nexus/content/sites/lcsim-site/hps/</url>
         </site>
     </distributionManagement>
-
     <build>
         <pluginManagement>
             <plugins>
@@ -46,7 +41,6 @@
             </plugins>
         </pluginManagement>
     </build>
-
     <reporting>
         <plugins>
             <plugin>
@@ -122,52 +116,26 @@
             </plugin>
         </plugins>
     </reporting>
-    
-    <profiles>
-        <profile>
-            <id>default</id>
-            <activation>
-                <activeByDefault>true</activeByDefault>
-            </activation>
-            <modules>
-                <module>parent</module>
-                <module>util</module>
-                <module>detector-data</module>
-                <module>conditions</module>
-                <module>ecal-readout-sim</module>
-                <module>ecal-recon</module>
-                <module>evio</module>
-                <module>recon</module>
-                <module>tracking</module>
-                <module>ecal-event-display</module>
-                <module>monitoring-drivers</module>
-                <module>record-util</module>
-                <module>monitoring-app</module>
-                <module>analysis</module>
-                <module>users</module>
-                <module>steering-files</module>
-                <module>distribution</module>
-                <module>plugin</module>
-                <module>integration-tests</module>
-            </modules>
-        </profile>
-        <profile>
-            <id>site</id>
-            <modules>
-                <module>analysis</module>
-                <module>conditions</module>
-                <module>ecal-readout-sim</module>
-                <module>ecal-recon</module>
-                <module>evio</module>
-                <module>monitoring-app</module>
-                <module>monitoring-drivers</module>
-                <module>plugin</module>                                                                              
-                <module>recon</module>
-                <module>tracking</module>
-                <module>users</module>                
-                <module>util</module>
-            </modules>
-        </profile>
-    </profiles>
-
+    <modules>
+        <module>analysis</module>
+        <module>conditions</module>
+        <module>datacat</module>
+        <module>detector-data</module>
+        <module>distribution</module>
+        <module>ecal-event-display</module>
+        <module>ecal-readout-sim</module>
+        <module>ecal-recon</module>
+        <module>evio</module>
+        <module>integration-tests</module>
+        <module>monitoring-app</module>
+        <module>monitoring-drivers</module>
+        <module>parent</module>
+        <module>plugin</module>
+        <module>recon</module>
+        <module>record-util</module>
+        <module>steering-files</module>
+        <module>tracking</module>
+        <module>users</module>
+        <module>util</module>
+    </modules>
 </project>

java/branches/hps-java_HPSJAVA-88/recon
pom.xml 1196 -> 1197
--- java/branches/hps-java_HPSJAVA-88/recon/pom.xml	2014-10-15 03:46:04 UTC (rev 1196)
+++ java/branches/hps-java_HPSJAVA-88/recon/pom.xml	2014-10-15 04:22:57 UTC (rev 1197)
@@ -3,7 +3,7 @@
     <modelVersion>4.0.0</modelVersion>
     <artifactId>hps-recon</artifactId>
     <name>recon</name>
-    <description>HPS recon code</description>
+    <description>reconstruction algorithms</description>
     <parent>
         <groupId>org.hps</groupId>
         <artifactId>hps-parent</artifactId>

java/branches/hps-java_HPSJAVA-88/record-util
pom.xml 1196 -> 1197
--- java/branches/hps-java_HPSJAVA-88/record-util/pom.xml	2014-10-15 03:46:04 UTC (rev 1196)
+++ java/branches/hps-java_HPSJAVA-88/record-util/pom.xml	2014-10-15 04:22:57 UTC (rev 1197)
@@ -2,7 +2,7 @@
     <modelVersion>4.0.0</modelVersion>
     <artifactId>hps-record-util</artifactId>
     <name>record-util</name>
-    <description>Record processing utilities</description>
+    <description>record processing utilities for EVIO, LCIO and ET events</description>
     <parent>
         <groupId>org.hps</groupId>
         <artifactId>hps-parent</artifactId>

java/branches/hps-java_HPSJAVA-88/steering-files
pom.xml 1196 -> 1197
--- java/branches/hps-java_HPSJAVA-88/steering-files/pom.xml	2014-10-15 03:46:04 UTC (rev 1196)
+++ java/branches/hps-java_HPSJAVA-88/steering-files/pom.xml	2014-10-15 04:22:57 UTC (rev 1197)
@@ -3,7 +3,7 @@
     <modelVersion>4.0.0</modelVersion>
     <artifactId>hps-steering-files</artifactId>
     <name>steering-files</name>
-    <description>XML steering files</description>
+    <description>org.lcsim XML steering file resources</description>
     <parent>
         <groupId>org.hps</groupId>
         <artifactId>hps-parent</artifactId>

java/branches/hps-java_HPSJAVA-88/steering-files/src/main/resources/org/hps/steering/monitoring
ExampleMonitoringPlots.lcsim 1196 -> 1197
--- java/branches/hps-java_HPSJAVA-88/steering-files/src/main/resources/org/hps/steering/monitoring/ExampleMonitoringPlots.lcsim	2014-10-15 03:46:04 UTC (rev 1196)
+++ java/branches/hps-java_HPSJAVA-88/steering-files/src/main/resources/org/hps/steering/monitoring/ExampleMonitoringPlots.lcsim	2014-10-15 04:22:57 UTC (rev 1197)
@@ -1,9 +1,15 @@
 <lcsim xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" 
        xs:noNamespaceSchemaLocation="http://www.lcsim.org/schemas/lcsim/1.0/lcsim.xsd">       
     <execute>
-        <driver name="SimplePlotDriver"/>
+        <driver name="EventMarkerDriver"/>
+        <driver name="TestRunReconDriver"/>
+        <driver name="ExamplePlotDriver"/>
     </execute>   
     <drivers>
-        <driver name="SimplePlotDriver" type="org.hps.monitoring.drivers.example.SimplePlotDriver" />
+        <driver name="EventMarkerDriver" type="org.lcsim.job.EventMarkerDriver">
+            <eventInterval>1</eventInterval>
+        </driver>
+        <driver name="TestRunReconDriver" type="org.hps.users.jeremym.TestRunReconDriver"/>
+        <driver name="ExamplePlotDriver" type="org.hps.monitoring.drivers.example.ExamplePlotDriver" />
     </drivers>
-</lcsim>
+</lcsim>
\ No newline at end of file

java/branches/hps-java_HPSJAVA-88/steering-files/src/main/resources/org/hps/steering/recon
SimpleMCRecon.lcsim 1196 -> 1197
--- java/branches/hps-java_HPSJAVA-88/steering-files/src/main/resources/org/hps/steering/recon/SimpleMCRecon.lcsim	2014-10-15 03:46:04 UTC (rev 1196)
+++ java/branches/hps-java_HPSJAVA-88/steering-files/src/main/resources/org/hps/steering/recon/SimpleMCRecon.lcsim	2014-10-15 04:22:57 UTC (rev 1197)
@@ -1,79 +1,60 @@
-<!--
-    This steering file shows a simple example of running reconstruction on MC data without 
-    first processing the data through the readout simulation.  It also includes a recon
-    filter that will prevent empty events from being written to the output LCIO file.
-    
-    This is a toy example only and should NOT be used for production purposes.
-    
-    author: Jeremy McCormick <[log in to unmask]>       
--->
-<lcsim xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" 
-       xs:noNamespaceSchemaLocation="http://www.lcsim.org/schemas/lcsim/1.0/lcsim.xsd">      
+<lcsim xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
+       xs:noNamespaceSchemaLocation="http://www.lcsim.org/schemas/lcsim/1.0/lcsim.xsd">
+    <control>
+        <printInputFiles>true</printInputFiles>
+        <printDriversDetailed>true</printDriversDetailed>
+    </control>
     <execute>
         <driver name="EventMarkerDriver"/>
-        <driver name="CalibrationDriver"/>        
+        <driver name="CalibrationDriver"/>
         <driver name="TrackerDigiDriver"/>
         <driver name="HelicalTrackHitDriver"/>
-        <driver name="TrackerReconDriver"/>     
-<!--        
-        <driver name="EcalReadout"/>
-        <driver name="EcalConverter"/>
-        <driver name="EcalClusterer"/> 
--->           
-        <driver name="EcalClusterer"/>        
-        <driver name="ReconParticleDriver"/>
-        <driver name="SimpleEventFilterDriver"/>        
+        <driver name="TrackerReconDriver"/>
+        <driver name="EcalRawConverter" />
+        <driver name="EcalClusterer" />
+        <driver name="ReconParticle" />
+        <driver name="TrackDataDriver" />
+        <driver name="GBLDriver"/>
         <driver name="LCIOWriter"/>
-    </execute>    
+    </execute>
     <drivers>
         <driver name="CalibrationDriver" type="org.hps.conditions.deprecated.CalibrationDriver"/>
         <driver name="EventMarkerDriver" type="org.lcsim.job.EventMarkerDriver">
-            <eventInterval>1000</eventInterval>
-        </driver>    
+            <eventInterval>10</eventInterval>
+        </driver>
         <driver name="TrackerDigiDriver" type="org.hps.recon.tracking.SimpleTrackerDigiDriver">
             <debug>false</debug>
-        </driver>              
-        <driver name="HelicalTrackHitDriver"
-                type="org.hps.recon.tracking.HelicalTrackHitDriver">
+        </driver>
+        <driver name="HelicalTrackHitDriver" type="org.hps.recon.tracking.HelicalTrackHitDriver">
             <debug>false</debug>
             <maxSeperation>20.0</maxSeperation>
             <tolerance>1.0</tolerance>
-        </driver>        
+        </driver>
         <driver name="TrackerReconDriver" type="org.hps.recon.tracking.TrackerReconDriver">
             <debug>false</debug>
-            <strategyResource>/org/hps/recon/tracking/strategies/HPS-Test-4pt1.xml</strategyResource>
-        </driver>        
-<!--        
-        <driver name="EcalReadout" type="org.hps.readout.ecal.FADCEcalReadoutDriver">
-            <coincidenceWindow>1</coincidenceWindow>
-            <ecalName>Ecal</ecalName>
-            <ecalCollectionName>EcalHits</ecalCollectionName>
-            <ecalRawCollectionName>EcalRawHits</ecalRawCollectionName>
-            <addNoise>true</addNoise>
+            <strategyResource>/org/hps/recon/tracking/strategies/HPS-Full.xml</strategyResource>
         </driver>
-        <driver name="EcalConverter" type="org.hps.recon.ecal.EcalRawConverterDriver">
-            <rawCollectionName>EcalRawHits</rawCollectionName>
-            <ecalCollectionName>EcalCorrectedHits</ecalCollectionName>
-            <applyBadCrystalMap>false</applyBadCrystalMap>
-            <use2014Gain>true</use2014Gain>
+        <driver name="GBLDriver" type="org.hps.recon.tracking.gbl.GBLOutputDriver">
+            <debug>1</debug>
+            <isMC>false</isMC>
+            <gblFileName></gblFileName>
         </driver>
-        <driver name="EcalClusterer" type="org.hps.recon.ecal.GTPEcalClusterer">
+       <driver name="EcalRawConverter" type="org.hps.recon.ecal.EcalRawConverterDriver">
+            <ecalCollectionName>EcalCalHits</ecalCollectionName>
+            <use2014Gain>false</use2014Gain>
+            <useTimestamps>false</useTimestamps>
+            <useTruthTime>true</useTruthTime>
+        </driver>
+        <driver name="EcalClusterer" type="org.hps.recon.ecal.EcalClusterICBasic">
             <ecalName>Ecal</ecalName>
-            <clusterWindow>1</clusterWindow>
-            <ecalCollectionName>EcalCorrectedHits</ecalCollectionName>
+            <ecalCollectionName>EcalCalHits</ecalCollectionName>
+            <timeCut>false</timeCut>
         </driver>
--->        
-        <driver name="EcalClusterer" type="org.hps.recon.ecal.EcalClusterer">
-            <ecalCollectionName>EcalHits</ecalCollectionName>
-        </driver>
-        <driver name="ReconParticleDriver" type="org.hps.recon.particle.HpsReconParticleDriver"/>
-        <driver name="SimpleEventFilterDriver" type="org.hps.recon.filtering.SimpleEventFilterDriver">
-            <minClusters>1</minClusters>
-            <minTracks>1</minTracks>
-            <minReconParticles>1</minReconParticles>
-        </driver>        
+        <driver name="ReconParticle" type="org.hps.recon.particle.HpsReconParticleDriver"/>
+        <driver name="TrackDataDriver" type="org.hps.recon.tracking.TrackDataDriver" />
         <driver name="LCIOWriter" type="org.lcsim.util.loop.LCIODriver">
             <outputFilePath>${outputFile}</outputFilePath>
-        </driver>                                                                   
+        </driver>
     </drivers>
 </lcsim>
+

java/branches/hps-java_HPSJAVA-88/tracking
pom.xml 1196 -> 1197
--- java/branches/hps-java_HPSJAVA-88/tracking/pom.xml	2014-10-15 03:46:04 UTC (rev 1196)
+++ java/branches/hps-java_HPSJAVA-88/tracking/pom.xml	2014-10-15 04:22:57 UTC (rev 1197)
@@ -3,7 +3,7 @@
     <modelVersion>4.0.0</modelVersion>
     <artifactId>hps-tracking</artifactId>
     <name>tracking</name>
-    <description>HPS tracking reconstruction module</description>
+    <description>tracking reconstruction algorithms</description>
     <parent>
         <groupId>org.hps</groupId>
         <artifactId>hps-parent</artifactId>

java/branches/hps-java_HPSJAVA-88/tracking/src/main/java/org/hps/recon/tracking/gbl
MilleBinary.java 1196 -> 1197
--- java/branches/hps-java_HPSJAVA-88/tracking/src/main/java/org/hps/recon/tracking/gbl/MilleBinary.java	2014-10-15 03:46:04 UTC (rev 1196)
+++ java/branches/hps-java_HPSJAVA-88/tracking/src/main/java/org/hps/recon/tracking/gbl/MilleBinary.java	2014-10-15 04:22:57 UTC (rev 1197)
@@ -1,5 +1,148 @@
 package org.hps.recon.tracking.gbl;
 
-public class MilleBinary {
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.nio.channels.FileChannel;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
+/**
+ * Millepede-II (binary) record.
+ * Containing information for local (track) and global fit.
+ *
+ *         real array              integer array
+ *     0   0.0                     error count (this record)
+ *     1   RMEAS, measured value   0                            -+
+ *     2   local derivative        index of local derivative     |
+ *     3   local derivative        index of local derivative     |
+ *     4    ...                                                  | block
+ *         SIGMA, error (>0)       0                             |
+ *         global derivative       label of global derivative    |
+ *         global derivative       label of global derivative   -+
+ *         RMEAS, measured value   0
+ *         local derivative        index of local derivative
+ *         local derivative        index of local derivative
+ *         ...
+ *         SIGMA, error            0
+ *         global derivative       label of global derivative
+ *         global derivative       label of global derivative
+ *         ...
+ *         global derivative       label of global derivative
+ *
+ * @author Norman A Graf
+ *
+ * @version $Id$
+ * 
+ */
+public class MilleBinary
+{
+    FileChannel _channel;
+    List<Integer> _intBuffer = new ArrayList<Integer>();
+    List<Float> _floatBuffer = new ArrayList<Float>();
+    
+    static String DEFAULT_OUTPUT_FILE_NAME = "millepedeData.bin"; 
+    
+    /**
+     * Default Constructor
+     */
+    public MilleBinary() {
+        try {
+            _channel = new FileOutputStream(DEFAULT_OUTPUT_FILE_NAME).getChannel();
+        } catch (FileNotFoundException ex) {
+            Logger.getLogger(MilleBinary.class.getName()).log(Level.SEVERE, null, ex);
+        }
+        _intBuffer.add(0); // first word is error counter
+        _floatBuffer.add(0f);
+    }
+
+    /**
+     * Fully qualified Constructor
+     * @param outputFileName name of output binary file for millepede II
+     */
+        public MilleBinary(String outputFileName)
+    {
+        try {
+            _channel = new FileOutputStream(outputFileName).getChannel();
+        } catch (FileNotFoundException ex) {
+            Logger.getLogger(MilleBinary.class.getName()).log(Level.SEVERE, null, ex);
+        }
+        _intBuffer.add(0); // first word is error counter
+        _floatBuffer.add(0f);
+    }
+
+    /**
+     * Closes the binary output file
+     */
+    public void close()
+    {
+        try {
+            _channel.close();
+        } catch (IOException ex) {
+            Logger.getLogger(MilleBinary.class.getName()).log(Level.SEVERE, null, ex);
+        }
+    }
+
+    /**
+     * Add data block to (end of) record.
+     * @param aMeas      Value
+     * @param aErr       Error
+     * @param indLocal   List of labels of local parameters
+     * @param derLocal   List of derivatives for local parameters
+     * @param labGlobal  List of labels of global parameters
+     * @param derGlobal  List of derivatives for global parameters
+     */
+        public void addData(float aMeas, float aErr,
+                        List<Integer> indLocal,
+                        List<Double> derLocal,
+                        List<Integer> labGlobal,
+                        List<Double> derGlobal)
+    {
+        _intBuffer.add(0);
+        _floatBuffer.add(aMeas);
+        for (int i = 0; i < indLocal.size(); ++i) {
+            _intBuffer.add(indLocal.get(i));
+            _floatBuffer.add((float) derLocal.get(i).doubleValue());
+        }
+        _intBuffer.add(0);
+        _floatBuffer.add(aErr);
+        for (int i = 0; i < labGlobal.size(); ++i) {
+            if (derGlobal.get(i) != 0) {
+                _intBuffer.add(labGlobal.get(i));
+                _floatBuffer.add((float) derGlobal.get(i).doubleValue());
+            }
+        }
+    }
+
+    /**
+     * Write record to file.
+     */
+        public void writeRecord()
+    {
+        int recordLength = _intBuffer.size() * 2;
+        ByteBuffer b = ByteBuffer.allocate((recordLength + 1) * 2);
+        b.order(ByteOrder.LITTLE_ENDIAN);
+        b.putInt(recordLength);
+        for (Float f : _floatBuffer) {
+            b.putFloat(f);
+        }
+        for (Integer i : _intBuffer) {
+            b.putInt(i);
+        }
+        b.flip();
+        try {
+            _channel.write(b);
+        } catch (IOException ex) {
+            Logger.getLogger(MilleBinary.class.getName()).log(Level.SEVERE, null, ex);
+        }
+        b.clear();
+        _floatBuffer.clear();
+        _intBuffer.clear();
+        _intBuffer.add(0); // first word is error counter
+        _floatBuffer.add(0f);
+    }
 }

java/branches/hps-java_HPSJAVA-88/users
pom.xml 1196 -> 1197
--- java/branches/hps-java_HPSJAVA-88/users/pom.xml	2014-10-15 03:46:04 UTC (rev 1196)
+++ java/branches/hps-java_HPSJAVA-88/users/pom.xml	2014-10-15 04:22:57 UTC (rev 1197)
@@ -2,7 +2,7 @@
     <modelVersion>4.0.0</modelVersion>
     <artifactId>hps-users</artifactId>
     <name>users</name>
-    <description>user code packages</description>
+    <description>miscellaneous user code</description>
     <parent>
         <groupId>org.hps</groupId>
         <artifactId>hps-parent</artifactId>

java/branches/hps-java_HPSJAVA-88/util
pom.xml 1196 -> 1197
--- java/branches/hps-java_HPSJAVA-88/util/pom.xml	2014-10-15 03:46:04 UTC (rev 1196)
+++ java/branches/hps-java_HPSJAVA-88/util/pom.xml	2014-10-15 04:22:57 UTC (rev 1197)
@@ -2,7 +2,7 @@
     <modelVersion>4.0.0</modelVersion>
     <artifactId>hps-util</artifactId>
     <name>util</name>
-    <description>miscellaneous utility classes</description>
+    <description>various utility classes</description>
     <parent>
         <groupId>org.hps</groupId>
         <artifactId>hps-parent</artifactId>
SVNspam 0.1