Print

Print


Author: [log in to unmask]
Date: Mon May  4 02:10:14 2015
New Revision: 2891

Log:
shove SVT monitoring plots into the app, add pedestal shift plots, use fast fitter for hit monitoring

Modified:
    java/trunk/monitoring-drivers/src/main/java/org/hps/monitoring/drivers/svt/SensorOccupancyPlotsDriver.java
    java/trunk/monitoring-drivers/src/main/java/org/hps/monitoring/drivers/svt/SvtClusterPlots.java
    java/trunk/monitoring-drivers/src/main/java/org/hps/monitoring/drivers/svt/SvtHitPlots.java
    java/trunk/steering-files/src/main/resources/org/hps/steering/monitoring/SvtOnlineMonitoring.lcsim
    java/trunk/tracking/src/main/java/org/hps/recon/tracking/ShaperAnalyticFitAlgorithm.java

Modified: java/trunk/monitoring-drivers/src/main/java/org/hps/monitoring/drivers/svt/SensorOccupancyPlotsDriver.java
 =============================================================================
--- java/trunk/monitoring-drivers/src/main/java/org/hps/monitoring/drivers/svt/SensorOccupancyPlotsDriver.java	(original)
+++ java/trunk/monitoring-drivers/src/main/java/org/hps/monitoring/drivers/svt/SensorOccupancyPlotsDriver.java	Mon May  4 02:10:14 2015
@@ -30,6 +30,7 @@
 
 import org.hps.recon.ecal.triggerbank.AbstractIntData;
 import org.hps.recon.ecal.triggerbank.TIData;
+import org.lcsim.util.aida.AIDA;
 
 /**
  * This Driver makes plots of SVT sensor occupancies across a run.
@@ -45,8 +46,8 @@
  
     // Plotting
     private static ITree tree = null;
-    private IAnalysisFactory analysisFactory = IAnalysisFactory.create();
-    private IPlotterFactory plotterFactory = analysisFactory.createPlotterFactory();
+    private IAnalysisFactory analysisFactory = AIDA.defaultInstance().analysisFactory();
+    private IPlotterFactory plotterFactory = analysisFactory.createPlotterFactory("SVT Occupancy");
     private IHistogramFactory histogramFactory = null;
 
     // Histogram maps

Modified: java/trunk/monitoring-drivers/src/main/java/org/hps/monitoring/drivers/svt/SvtClusterPlots.java
 =============================================================================
--- java/trunk/monitoring-drivers/src/main/java/org/hps/monitoring/drivers/svt/SvtClusterPlots.java	(original)
+++ java/trunk/monitoring-drivers/src/main/java/org/hps/monitoring/drivers/svt/SvtClusterPlots.java	Mon May  4 02:10:14 2015
@@ -24,6 +24,7 @@
 import org.lcsim.util.Driver;
 
 import org.hps.recon.tracking.FittedRawTrackerHit;
+import org.lcsim.util.aida.AIDA;
 
 /**
  *  Monitoring driver that looks at the SVT cluster charge.
@@ -41,8 +42,8 @@
    
     // Plotting
     private static ITree tree = null;
-    private IAnalysisFactory analysisFactory = IAnalysisFactory.create();
-	private IPlotterFactory plotterFactory = analysisFactory.createPlotterFactory();
+    private IAnalysisFactory analysisFactory = AIDA.defaultInstance().analysisFactory();
+	private IPlotterFactory plotterFactory = analysisFactory.createPlotterFactory("SVT Clusters");
     private IHistogramFactory histogramFactory = null; 
 	private static Map<String, IPlotter> plotters = new HashMap<String, IPlotter>(); 
    

Modified: java/trunk/monitoring-drivers/src/main/java/org/hps/monitoring/drivers/svt/SvtHitPlots.java
 =============================================================================
--- java/trunk/monitoring-drivers/src/main/java/org/hps/monitoring/drivers/svt/SvtHitPlots.java	(original)
+++ java/trunk/monitoring-drivers/src/main/java/org/hps/monitoring/drivers/svt/SvtHitPlots.java	Mon May  4 02:10:14 2015
@@ -15,102 +15,103 @@
 import java.util.Map;
 
 import org.lcsim.detector.tracker.silicon.HpsSiSensor;
-import org.lcsim.util.Driver; 
+import org.lcsim.util.Driver;
 import org.lcsim.geometry.Detector;
 import org.lcsim.event.EventHeader;
 import org.lcsim.event.RawTrackerHit;
+import org.lcsim.util.aida.AIDA;
 
 /**
- *  Monitoring driver that provides information about the number of SVT hits
- *  per event.
- *   
- *  @author Omar Moreno <[log in to unmask]>
+ * Monitoring driver that provides information about the number of SVT hits per
+ * event.
+ *
+ * @author Omar Moreno <[log in to unmask]>
  */
 public class SvtHitPlots extends Driver {
 
     // TODO: Add documentation
-	
     static {
         hep.aida.jfree.AnalysisFactory.register();
-    } 
+    }
 
     // Plotting
     private static ITree tree = null;
-    private IAnalysisFactory analysisFactory = IAnalysisFactory.create();
-	private IPlotterFactory plotterFactory = analysisFactory.createPlotterFactory();
-    private IHistogramFactory histogramFactory = null; 
-	protected Map<String, IPlotter> plotters = new HashMap<String, IPlotter>(); 
+    private IAnalysisFactory analysisFactory = AIDA.defaultInstance().analysisFactory();
+    private IPlotterFactory plotterFactory = analysisFactory.createPlotterFactory("SVT Hits");
+    private IHistogramFactory histogramFactory = null;
+    protected Map<String, IPlotter> plotters = new HashMap<String, IPlotter>();
 
     // Histogram Maps
     private static Map<String, IHistogram1D> hitsPerSensorPlots = new HashMap<String, IHistogram1D>();
     private static Map<String, int[]> hitsPerSensor = new HashMap<String, int[]>();
     private static Map<String, IHistogram1D> layersHitPlots = new HashMap<String, IHistogram1D>();
-	private static Map<String, IHistogram1D> hitCountPlots = new HashMap<String, IHistogram1D>();
-   
+    private static Map<String, IHistogram1D> hitCountPlots = new HashMap<String, IHistogram1D>();
+    private static Map<String, IHistogram1D> firstSamplePlots = new HashMap<String, IHistogram1D>();
+
     private List<HpsSiSensor> sensors;
-	
+
     private static final String SUBDETECTOR_NAME = "Tracker";
     private String rawTrackerHitCollectionName = "SVTRawTrackerHits";
-   
+
     // Counters
     double eventCount = 0;
-    double totalHitCount = 0; 
-    double totalTopHitCount = 0; 
-    double totalBotHitCount = 0; 
+    double totalHitCount = 0;
+    double totalTopHitCount = 0;
+    double totalBotHitCount = 0;
 
     private int computePlotterRegion(HpsSiSensor sensor) {
 
-		if (sensor.getLayerNumber() < 7) {
-			if (sensor.isTopLayer()) {
-				return 6*(sensor.getLayerNumber() - 1); 
-			} else { 
-				return 6*(sensor.getLayerNumber() - 1) + 1;
-			} 
-		} else { 
-		
-			if (sensor.isTopLayer()) {
-				if (sensor.getSide() == HpsSiSensor.POSITRON_SIDE) {
-					return 6*(sensor.getLayerNumber() - 7) + 2;
-				} else { 
-					return 6*(sensor.getLayerNumber() - 7) + 3;
-				}
-			} else if (sensor.isBottomLayer()) {
-				if (sensor.getSide() == HpsSiSensor.POSITRON_SIDE) {
-					return 6*(sensor.getLayerNumber() - 7) + 4;
-				} else {
-					return 6*(sensor.getLayerNumber() - 7) + 5;
-				}
-			}
-		}
-		return -1; 
-    }
-    
+        if (sensor.getLayerNumber() < 7) {
+            if (sensor.isTopLayer()) {
+                return 6 * (sensor.getLayerNumber() - 1);
+            } else {
+                return 6 * (sensor.getLayerNumber() - 1) + 1;
+            }
+        } else {
+
+            if (sensor.isTopLayer()) {
+                if (sensor.getSide() == HpsSiSensor.POSITRON_SIDE) {
+                    return 6 * (sensor.getLayerNumber() - 7) + 2;
+                } else {
+                    return 6 * (sensor.getLayerNumber() - 7) + 3;
+                }
+            } else if (sensor.isBottomLayer()) {
+                if (sensor.getSide() == HpsSiSensor.POSITRON_SIDE) {
+                    return 6 * (sensor.getLayerNumber() - 7) + 4;
+                } else {
+                    return 6 * (sensor.getLayerNumber() - 7) + 5;
+                }
+            }
+        }
+        return -1;
+    }
+
     /**
-     *  Create a plotter style.
-     * 
+     * Create a plotter style.
+     *
      * @param xAxisTitle : Title of the x axis
      * @param yAxisTitle : Title of the y axis
      * @return plotter style
      */
     // TODO: Move this to a utilities class
-    IPlotterStyle createStyle(String xAxisTitle, String yAxisTitle) { 
-       
+    IPlotterStyle createStyle(String xAxisTitle, String yAxisTitle) {
+
         // Create a default style
         IPlotterStyle style = this.plotterFactory.createPlotterStyle();
-        
+
         // Set the style of the X axis
         style.xAxisStyle().setLabel(xAxisTitle);
         style.xAxisStyle().labelStyle().setFontSize(14);
         style.xAxisStyle().setVisible(true);
-        
+
         // Set the style of the Y axis
         style.yAxisStyle().setLabel(yAxisTitle);
         style.yAxisStyle().labelStyle().setFontSize(14);
         style.yAxisStyle().setVisible(true);
-        
+
         // Turn off the histogram grid 
         style.gridStyle().setVisible(false);
-        
+
         // Set the style of the data
         style.dataStyle().lineStyle().setVisible(false);
         style.dataStyle().outlineStyle().setVisible(false);
@@ -120,200 +121,215 @@
         style.dataStyle().fillStyle().setColor("31, 137, 229, 1");
         style.dataStyle().outlineStyle().setColor("31, 137, 229, 1");
         style.dataStyle().errorBarStyle().setVisible(false);
-        
+
         // Turn off the legend
         style.legendBoxStyle().setVisible(false);
-       
+
         return style;
     }
-    
+
     /**
-     *  Create a plotter style.
-     * 
-     * @param sensor : HpsSiSensor associated with the plot.  This is used to
-     *                 set certain attributes based on the position of the 
-     *                 sensor.
+     * Create a plotter style.
+     *
+     * @param sensor : HpsSiSensor associated with the plot. This is used to set
+     * certain attributes based on the position of the sensor.
      * @param xAxisTitle : Title of the x axis
      * @param yAxisTitle : Title of the y axis
      * @return plotter style
      */
     // TODO: Move this to a utilities class
-    IPlotterStyle createStyle(HpsSiSensor sensor, String xAxisTitle, String yAxisTitle) { 
+    IPlotterStyle createStyle(HpsSiSensor sensor, String xAxisTitle, String yAxisTitle) {
         IPlotterStyle style = this.createStyle(xAxisTitle, yAxisTitle);
-        
-        if (sensor.isTopLayer()) { 
+
+        if (sensor.isTopLayer()) {
             style.dataStyle().fillStyle().setColor("31, 137, 229, 1");
             style.dataStyle().outlineStyle().setColor("31, 137, 229, 1");
-        } else { 
+        } else {
             style.dataStyle().fillStyle().setColor("93, 228, 47, 1");
             style.dataStyle().outlineStyle().setColor("93, 228, 47, 1");
         }
-        
+
         return style;
     }
 
-    private void clearHitMaps() { 
-        for (HpsSiSensor sensor : sensors) {
-            hitsPerSensor.get(sensor.getName())[0] = 0; 
+    private void clearHitMaps() {
+        for (HpsSiSensor sensor : sensors) {
+            hitsPerSensor.get(sensor.getName())[0] = 0;
         }
     }
 
     /**
-     *  Clear all histograms of it's current data.
+     * Clear all histograms of it's current data.
      */
-    private void resetPlots() { 
-      
+    private void resetPlots() {
+
         // Reset all hit maps
         this.clearHitMaps();
-        
+
         // Since all plots are mapped to the name of a sensor, loop 
         // through the sensors, get the corresponding plots and clear them.
-        for (HpsSiSensor sensor : sensors) { 
+        for (HpsSiSensor sensor : sensors) {
             hitsPerSensorPlots.get(sensor.getName()).reset();
         }
-       
+
         for (IHistogram1D histogram : layersHitPlots.values()) {
             histogram.reset();
         }
-        
-        for (IHistogram1D histogram : hitCountPlots.values()) { 
+
+        for (IHistogram1D histogram : hitCountPlots.values()) {
             histogram.reset();
         }
-        
-    }
-    
+
+    }
+
     protected void detectorChanged(Detector detector) {
 
         // Get the HpsSiSensor objects from the geometry
         sensors = detector.getSubdetector(SUBDETECTOR_NAME).getDetectorElement().findDescendants(HpsSiSensor.class);
-   
+
         if (sensors.size() == 0) {
             throw new RuntimeException("No sensors were found in this detector.");
         }
-        
+
         // If the tree already exist, clear all existing plots of any old data
         // they might contain.
-        if (tree != null) { 
+        if (tree != null) {
             this.resetPlots();
-            return; 
-        }
-        
+            return;
+        }
+
         tree = analysisFactory.createTreeFactory().create();
         histogramFactory = analysisFactory.createHistogramFactory(tree);
-        
-        plotters.put("Raw hits per sensor", plotterFactory.create("Raw hits per sensor")); 
-		plotters.get("Raw hits per sensor").createRegions(6,6);
-        
-		for (HpsSiSensor sensor : sensors) {
-		   hitsPerSensorPlots.put(sensor.getName(), 
-		           histogramFactory.createHistogram1D(sensor.getName() + " - Raw Hits", 25, 0, 25)); 
-		   plotters.get("Raw hits per sensor").region(this.computePlotterRegion(sensor))
-		                                      .plot(hitsPerSensorPlots.get(sensor.getName()), this.createStyle(sensor, "Number of Raw Hits", ""));
-		   hitsPerSensor.put(sensor.getName(), new int[1]);
-		}
-
-		plotters.put("Number of layers hit", plotterFactory.create("Number of layers hit"));
-		plotters.get("Number of layers hit").createRegions(1,2);
-
-		layersHitPlots.put("Top",
-		        histogramFactory.createHistogram1D("Top Layers Hit", 12, 0, 12));
-		plotters.get("Number of layers hit").region(0).plot(layersHitPlots.get("Top"), this.createStyle("Number of Top Layers Hit",""));
-		layersHitPlots.put("Bottom",
-		        histogramFactory.createHistogram1D("Bottom Layers Hit", 12, 0, 12));
-		plotters.get("Number of layers hit").region(1).plot(layersHitPlots.get("Bottom"), this.createStyle("Number of Bottom Layers Hit",""));
-	
-		plotters.put("Raw hit counts/Event", plotterFactory.create("Raw hit counts/Event")); 
-		plotters.get("Raw hit counts/Event").createRegions(2, 2);
-
-		hitCountPlots.put("Raw hit counts/Event", 
-		        histogramFactory.createHistogram1D("Raw hit counts", 100, 0, 100));
-		plotters.get("Raw hit counts/Event").region(0).plot(hitCountPlots.get("Raw hit counts/Event"), this.createStyle("Number of Raw Hits", ""));
-		hitCountPlots.put("SVT top raw hit counts/Event", 
-		        histogramFactory.createHistogram1D("SVT top raw hit counts", 100, 0, 100));
-		plotters.get("Raw hit counts/Event").region(1).plot(hitCountPlots.get("SVT top raw hit counts/Event"), this.createStyle("Number of Raw Hits in Top Volume", ""));
-		hitCountPlots.put("SVT bottom raw hit counts/Event", 
-		        histogramFactory.createHistogram1D("SVT bottom raw hit counts", 100, 0, 100));
-		plotters.get("Raw hit counts/Event").region(2).plot(hitCountPlots.get("SVT bottom raw hit counts/Event"), this.createStyle("Number of Raw Bits in the Bottom Volume", ""));
-		
-		for (IPlotter plotter : plotters.values()) { 
-			for (int regionN = 0; regionN < plotter.numberOfRegions(); regionN++) { 
-			    PlotterRegion region = ((PlotterRegion) ((Plotter) plotter).region(regionN));
-			    if (region.getPlottedObjects().size() == 0) continue;
+
+        plotters.put("Raw hits per sensor", plotterFactory.create("Raw hits per sensor"));
+        plotters.get("Raw hits per sensor").createRegions(6, 6);
+
+        for (HpsSiSensor sensor : sensors) {
+            hitsPerSensorPlots.put(sensor.getName(),
+                    histogramFactory.createHistogram1D(sensor.getName() + " - Raw Hits", 25, 0, 25));
+            plotters.get("Raw hits per sensor").region(this.computePlotterRegion(sensor))
+                    .plot(hitsPerSensorPlots.get(sensor.getName()), this.createStyle(sensor, "Number of Raw Hits", ""));
+            hitsPerSensor.put(sensor.getName(), new int[1]);
+        }
+
+        plotters.put("Number of layers hit", plotterFactory.create("Number of layers hit"));
+        plotters.get("Number of layers hit").createRegions(1, 2);
+
+        layersHitPlots.put("Top",
+                histogramFactory.createHistogram1D("Top Layers Hit", 12, 0, 12));
+        plotters.get("Number of layers hit").region(0).plot(layersHitPlots.get("Top"), this.createStyle("Number of Top Layers Hit", ""));
+        layersHitPlots.put("Bottom",
+                histogramFactory.createHistogram1D("Bottom Layers Hit", 12, 0, 12));
+        plotters.get("Number of layers hit").region(1).plot(layersHitPlots.get("Bottom"), this.createStyle("Number of Bottom Layers Hit", ""));
+
+        plotters.put("Raw hit counts/Event", plotterFactory.create("Raw hit counts/Event"));
+        plotters.get("Raw hit counts/Event").createRegions(2, 2);
+
+        hitCountPlots.put("Raw hit counts/Event",
+                histogramFactory.createHistogram1D("Raw hit counts", 100, 0, 100));
+        plotters.get("Raw hit counts/Event").region(0).plot(hitCountPlots.get("Raw hit counts/Event"), this.createStyle("Number of Raw Hits", ""));
+        hitCountPlots.put("SVT top raw hit counts/Event",
+                histogramFactory.createHistogram1D("SVT top raw hit counts", 100, 0, 100));
+        plotters.get("Raw hit counts/Event").region(1).plot(hitCountPlots.get("SVT top raw hit counts/Event"), this.createStyle("Number of Raw Hits in Top Volume", ""));
+        hitCountPlots.put("SVT bottom raw hit counts/Event",
+                histogramFactory.createHistogram1D("SVT bottom raw hit counts", 100, 0, 100));
+        plotters.get("Raw hit counts/Event").region(2).plot(hitCountPlots.get("SVT bottom raw hit counts/Event"), this.createStyle("Number of Raw Bits in the Bottom Volume", ""));
+
+        plotters.put("First sample distributions (pedestal shifts)", plotterFactory.create("First sample distributions (pedestal shifts)"));
+        plotters.get("First sample distributions (pedestal shifts)").createRegions(6, 6);
+        for (HpsSiSensor sensor : sensors) {
+            firstSamplePlots.put(sensor.getName(),
+                    histogramFactory.createHistogram1D(sensor.getName() + " - first sample", 100, -500.0, 2000.0));
+            plotters.get("First sample distributions (pedestal shifts)").region(this.computePlotterRegion(sensor))
+                    .plot(firstSamplePlots.get(sensor.getName()), this.createStyle(sensor, "First sample - pedestal [ADC counts]", ""));
+        }
+
+        for (IPlotter plotter : plotters.values()) {
+            for (int regionN = 0; regionN < plotter.numberOfRegions(); regionN++) {
+                PlotterRegion region = ((PlotterRegion) ((Plotter) plotter).region(regionN));
+                if (region.getPlottedObjects().size() == 0) {
+                    continue;
+                }
                 region.getPanel().addMouseListener(new PopupPlotterListener(region));
-			}
-		    plotter.show();
-		}
-    }
-    
+            }
+            plotter.show();
+        }
+    }
+
     public void process(EventHeader event) {
-        
-    	if (!event.hasCollection(RawTrackerHit.class, rawTrackerHitCollectionName))
-    		return;
-    
-    	eventCount++;
-    	
+
+        if (!event.hasCollection(RawTrackerHit.class, rawTrackerHitCollectionName)) {
+            return;
+        }
+
+        eventCount++;
+
         // Get RawTrackerHit collection from event.
         List<RawTrackerHit> rawHits = event.get(RawTrackerHit.class, rawTrackerHitCollectionName);
-   
+
         this.clearHitMaps();
-        for (RawTrackerHit rawHit : rawHits) { 
+        for (RawTrackerHit rawHit : rawHits) {
             HpsSiSensor sensor = (HpsSiSensor) rawHit.getDetectorElement();
             hitsPerSensor.get(sensor.getName())[0]++;
-        }
-        
+            firstSamplePlots.get(sensor.getName()).fill(rawHit.getADCValues()[0]-sensor.getPedestal(rawHit.getIdentifierFieldValue("strip"), 0));
+        }
+
         int[] topLayersHit = new int[12];
-        int[] botLayersHit = new int[12]; 
+        int[] botLayersHit = new int[12];
         int eventHitCount = 0;
         int topEventHitCount = 0;
         int botEventHitCount = 0;
-        for (HpsSiSensor sensor : sensors) { 
+        for (HpsSiSensor sensor : sensors) {
             int hitCount = hitsPerSensor.get(sensor.getName())[0];
             hitsPerSensorPlots.get(sensor.getName()).fill(hitCount);
-            
+
             eventHitCount += hitCount;
-            
-            if (hitsPerSensor.get(sensor.getName())[0] > 0) { 
-                if (sensor.isTopLayer()) { 
+
+            if (hitsPerSensor.get(sensor.getName())[0] > 0) {
+                if (sensor.isTopLayer()) {
                     topLayersHit[sensor.getLayerNumber() - 1]++;
                     topEventHitCount += hitCount;
-                }
-                else { 
-                    botLayersHit[sensor.getLayerNumber() - 1]++; 
+                } else {
+                    botLayersHit[sensor.getLayerNumber() - 1]++;
                     botEventHitCount += hitCount;
                 }
             }
         }
-      
-        totalHitCount += eventHitCount; 
-        totalTopHitCount += topEventHitCount; 
+
+        totalHitCount += eventHitCount;
+        totalTopHitCount += topEventHitCount;
         totalBotHitCount += botEventHitCount;
-    
+
         hitCountPlots.get("Raw hit counts/Event").fill(eventHitCount);
         hitCountPlots.get("SVT top raw hit counts/Event").fill(topEventHitCount);
         hitCountPlots.get("SVT bottom raw hit counts/Event").fill(botEventHitCount);
-        
-        int totalTopLayersHit = 0; 
-        int totalBotLayersHit = 0; 
-        for(int layerN = 0; layerN < 12; layerN++) { 
-            if (topLayersHit[layerN] > 0) totalTopLayersHit++;
-            if (botLayersHit[layerN] > 0) totalBotLayersHit++;
-        }
-        
+
+        int totalTopLayersHit = 0;
+        int totalBotLayersHit = 0;
+        for (int layerN = 0; layerN < 12; layerN++) {
+            if (topLayersHit[layerN] > 0) {
+                totalTopLayersHit++;
+            }
+            if (botLayersHit[layerN] > 0) {
+                totalBotLayersHit++;
+            }
+        }
+
         layersHitPlots.get("Top").fill(totalTopLayersHit);
         layersHitPlots.get("Bottom").fill(totalBotLayersHit);
-        
-    }
-   
+
+    }
+
     @Override
     protected void endOfData() {
-        
+
         System.out.println("%================================================%");
         System.out.println("%============ SVT Raw Hit Statistics ============%");
         System.out.println("%================================================%\n%");
-        System.out.println("% Total Hits/Event: " + totalHitCount/eventCount);
-        System.out.println("% Total Top SVT Hits/Event: " + totalTopHitCount/eventCount);
-        System.out.println("% Total Bottom SVT Hits/Event: " + totalBotHitCount/eventCount);
+        System.out.println("% Total Hits/Event: " + totalHitCount / eventCount);
+        System.out.println("% Total Top SVT Hits/Event: " + totalTopHitCount / eventCount);
+        System.out.println("% Total Bottom SVT Hits/Event: " + totalBotHitCount / eventCount);
         System.out.println("\n%================================================%");
     }
-    
+
 }

Modified: java/trunk/steering-files/src/main/resources/org/hps/steering/monitoring/SvtOnlineMonitoring.lcsim
 =============================================================================
--- java/trunk/steering-files/src/main/resources/org/hps/steering/monitoring/SvtOnlineMonitoring.lcsim	(original)
+++ java/trunk/steering-files/src/main/resources/org/hps/steering/monitoring/SvtOnlineMonitoring.lcsim	Mon May  4 02:10:14 2015
@@ -24,7 +24,7 @@
         <driver name="SvtHitPlots" type="org.hps.monitoring.drivers.svt.SvtHitPlots" />
         <driver name="SamplesPlots" type="org.hps.monitoring.drivers.svt.SamplesPlots" />
         <driver name="RawTrackerHitFitterDriver" type="org.hps.recon.tracking.RawTrackerHitFitterDriver">
-            <fitAlgorithm>Pileup</fitAlgorithm>
+            <fitAlgorithm>Analytic</fitAlgorithm>
             <useTimestamps>false</useTimestamps>
             <correctT0Shift>false</correctT0Shift>
             <useTruthTime>false</useTruthTime>

Modified: java/trunk/tracking/src/main/java/org/hps/recon/tracking/ShaperAnalyticFitAlgorithm.java
 =============================================================================
--- java/trunk/tracking/src/main/java/org/hps/recon/tracking/ShaperAnalyticFitAlgorithm.java	(original)
+++ java/trunk/tracking/src/main/java/org/hps/recon/tracking/ShaperAnalyticFitAlgorithm.java	Mon May  4 02:10:14 2015
@@ -26,10 +26,10 @@
     @Override
     public Collection<ShapeFitParameters> fitShape(RawTrackerHit rth, PulseShape shape) {
         short[] samples = rth.getADCValues();
-        HpsSiSensor sensor =(HpsSiSensor) rth.getDetectorElement();
+        HpsSiSensor sensor = (HpsSiSensor) rth.getDetectorElement();
         int channel = rth.getIdentifierFieldValue("strip");
         return this.fitShape(channel, samples, sensor);
-    	//===> return this.fitShape(rth.getADCValues(), constants);
+        //===> return this.fitShape(rth.getADCValues(), constants);
     }
 
     public Collection<ShapeFitParameters> fitShape(int channel, short[] samples, HpsSiSensor sensor) {
@@ -60,11 +60,11 @@
         double[] y = new double[length];
         double[] t = new double[length];
 
-        double tp = sensor.getShapeFitParameters(channel)[HpsSiSensor.TP_INDEX];
+        double tp = 2.5*Math.pow(sensor.getShapeFitParameters(channel)[HpsSiSensor.TP_INDEX], 0.25) * Math.pow(sensor.getShapeFitParameters(channel)[HpsSiSensor.TP_INDEX + 1], 0.75);
 
         for (int i = 0; i < length; i++) {
             //===> y[i] = samples[start + i] - constants.getPedestal();
-        	y[i] = samples[start + i] - sensor.getPedestal(channel, i);
+            y[i] = samples[start + i] - sensor.getPedestal(channel, i);
             t[i] = HPSSVTConstants.SAMPLING_INTERVAL * i;
         }
 
@@ -74,8 +74,8 @@
             //===> p[i] = y[i] / constants.getNoise();
             p[i] = y[i] / sensor.getNoise(channel, i);
             //===> a[i] = Math.exp(1 - t[i] / constants.getTp()) / (constants.getTp() * constants.getNoise());
-            
-            a[i] = Math.exp(1 - t[i] /tp)  / (tp * sensor.getNoise(channel, i));
+
+            a[i] = Math.exp(1 - t[i] / tp) / (tp * sensor.getNoise(channel, i));
         }
 
         double pa, aatt, pat, aat, aa;