Commit in hps-java on MAIN
scripts/et_monitoring_app.sh+2-11.9 -> 1.10
src/main/java/org/lcsim/hps/monitoring/Redrawable.java+11added 1.1
                                      /MonitoringApplication.java+61.39 -> 1.40
src/main/java/org/lcsim/hps/monitoring/svt/SVTHitReconstructionPlots.java+27-311.5 -> 1.6
                                          /SVTHitPulsePlots.java+20-111.7 -> 1.8
src/main/resources/org/lcsim/hps/steering/ECalMonitoring.lcsim+10-81.3 -> 1.4
                                         /TestRunMonitoring.lcsim+23-231.14 -> 1.15
                                         /ECalWindowMonitoring.lcsim-281.3 removed
src/main/java/org/lcsim/hps/monitoring/ecal/EcalPedestalPlots.java+47-591.4 -> 1.5
                                           /EcalEventMonitor.java+35-1311.7 -> 1.8
                                           /EcalEvsX.java+17-141.1 -> 1.2
                                           /EcalMonitoringPlots.java+90-871.2 -> 1.3
src/main/java/org/lcsim/hps/recon/ecal/HPSEcalRawConverterDriver.java-11.5 -> 1.6
+288-394
1 added + 1 removed + 11 modified, total 13 files
tab-ify plots and add some stuff to let us reduce rate of plot redraws?

hps-java/scripts
et_monitoring_app.sh 1.9 -> 1.10
diff -u -r1.9 -r1.10
--- et_monitoring_app.sh	29 Apr 2012 23:20:48 -0000	1.9
+++ et_monitoring_app.sh	6 May 2012 00:01:13 -0000	1.10
@@ -1,7 +1,8 @@
 #!/bin/sh
 
 # Classpath pointing to the hps-java jar.
-classpath=`pwd`/target/hps-java-1.1-SNAPSHOT-bin.jar
+hpsjava=$(cd $(dirname "$0")/..; pwd)
+classpath=$hpsjava/target/hps-java-1.1-SNAPSHOT-bin.jar
 
 # Run it.
 prod="java -Xmx1024m -classpath "$classpath" org.lcsim.hps.monitoring.MonitoringApplication $@"

hps-java/src/main/java/org/lcsim/hps/monitoring
Redrawable.java added at 1.1
diff -N Redrawable.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ Redrawable.java	6 May 2012 00:01:13 -0000	1.1
@@ -0,0 +1,11 @@
+package org.lcsim.hps.monitoring;
+
+/**
+ * Drivers that will be attached to monitoring system should implement 
+ * this if they will only redraw plots every N events, or when redraw() is called.
+ * Setting eventRefreshRate = 0 should disable automatic redrawing.
+ */
+public interface Redrawable {
+    public void redraw();
+    public void setEventRefreshRate(int eventRefreshRate);
+}

hps-java/src/main/java/org/lcsim/hps/monitoring
MonitoringApplication.java 1.39 -> 1.40
diff -u -r1.39 -r1.40
--- MonitoringApplication.java	4 May 2012 21:49:30 -0000	1.39
+++ MonitoringApplication.java	6 May 2012 00:01:13 -0000	1.40
@@ -460,6 +460,8 @@
         options.addOption(new Option("x", true, "Load specified steering file path."));
         options.addOption(new Option("d", true, "Detector to use."));
         options.addOption(new Option("b", true, "Event builder to use."));
+        options.addOption(new Option("s", false, "Set misc. shifter-friendly defaults."));
+
         CommandLineParser parser = new PosixParser();
 
         // Parse command line arguments.
@@ -497,6 +499,10 @@
             app.connectionPanel.loadPropertiesFile(propertiesFile);
         }
 
+        if (cl.hasOption("s")) {
+            app.jobPanel.disconnectOnErrorCheckBox.setSelected(false);
+        }
+
         // Set job parameters.
         app.setJobParameters(new JobParameters(new String[]{defaultDetectorName, defaultSteering, defaultEventBuilder}));
 

hps-java/src/main/java/org/lcsim/hps/monitoring/svt
SVTHitReconstructionPlots.java 1.5 -> 1.6
diff -u -r1.5 -r1.6
--- SVTHitReconstructionPlots.java	3 May 2012 20:50:29 -0000	1.5
+++ SVTHitReconstructionPlots.java	6 May 2012 00:01:13 -0000	1.6
@@ -2,13 +2,12 @@
 
 import hep.aida.*;
 import java.util.ArrayList;
-import java.util.HashSet;
 import java.util.List;
-import java.util.Set;
 import org.lcsim.detector.tracker.silicon.SiSensor;
 import org.lcsim.event.EventHeader;
 import org.lcsim.event.RawTrackerHit;
 import org.lcsim.geometry.Detector;
+import org.lcsim.hps.monitoring.AIDAFrame;
 import org.lcsim.hps.monitoring.Resettable;
 import org.lcsim.hps.recon.tracking.HPSFittedRawTrackerHit;
 import org.lcsim.hps.recon.tracking.HPSSVTCalibrationConstants;
@@ -22,13 +21,13 @@
  */
 public class SVTHitReconstructionPlots extends Driver implements Resettable {
 
+    private AIDAFrame plotterFrame;
     private List<IPlotter> plotters = new ArrayList<IPlotter>();
     private AIDA aida = AIDA.defaultInstance();
     private String rawTrackerHitCollectionName = "SVTRawTrackerHits";
     private String fittedTrackerHitCollectionName = "SVTFittedRawTrackerHits";
     private String trackerHitCollectionName = "StripClusterer_SiTrackerHitStrip1D";
     private String trackerName = "Tracker";
-    private Detector detector = null;
     private int eventCount;
     private List<SiSensor> sensors;
     IPlotter plotter;
@@ -38,7 +37,9 @@
     IPlotter plotter5;
 
     protected void detectorChanged(Detector detector) {
-        this.detector = detector;
+        plotterFrame = new AIDAFrame();
+        plotterFrame.setTitle("HPS SVT Hit Reconstruction Plots");
+
         aida.tree().cd("/");
 
 
@@ -47,6 +48,8 @@
 
         IAnalysisFactory fac = aida.analysisFactory();
         plotter = fac.createPlotterFactory().create("HPS SVT Timing Plots");
+        plotter.setTitle("Timing");
+        plotterFrame.addPlotter(plotter);
         plotters.add(plotter);
         IPlotterStyle style = plotter.style();
         style.dataStyle().fillStyle().setColor("yellow");
@@ -54,6 +57,8 @@
         plotter.createRegions(5, 4);
 
         plotter2 = fac.createPlotterFactory().create("HPS SVT Amplitude Plots");
+        plotter2.setTitle("Amplitude");
+        plotterFrame.addPlotter(plotter2);
         plotters.add(plotter2);
         IPlotterStyle style2 = plotter2.style();
         style2.dataStyle().fillStyle().setColor("yellow");
@@ -62,6 +67,8 @@
 
 
         plotter3 = fac.createPlotterFactory().create("HPS SVT Raw Hit Plots");
+        plotter3.setTitle("Raw Hits");
+        plotterFrame.addPlotter(plotter3);
         plotters.add(plotter3);
         IPlotterStyle style3 = plotter3.style();
         style3.dataStyle().fillStyle().setColor("yellow");
@@ -69,13 +76,17 @@
         plotter3.createRegions(5, 4);
 
         plotter4 = fac.createPlotterFactory().create("HPS SVT Reco Hit Plots");
+        plotter4.setTitle("Reco Hits");
+        plotterFrame.addPlotter(plotter4);
         plotters.add(plotter4);
         IPlotterStyle style4 = plotter4.style();
         style4.dataStyle().fillStyle().setColor("yellow");
         style4.dataStyle().errorBarStyle().setVisible(false);
         plotter4.createRegions(5, 4);
-        
-          plotter5 = fac.createPlotterFactory().create("HPS SVT Cluster Size Plots");
+
+        plotter5 = fac.createPlotterFactory().create("HPS SVT Cluster Size Plots");
+        plotter5.setTitle("Cluster Size");
+        plotterFrame.addPlotter(plotter5);
         plotters.add(plotter5);
         IPlotterStyle style5 = plotter5.style();
         style5.dataStyle().fillStyle().setColor("green");
@@ -98,12 +109,9 @@
             plotter5.region(i).plot(clusterSizePlot);
 
         }
-        plotter.show();
-        plotter2.show();
-        plotter3.show();
-        plotter4.show();
-         plotter5.show();
 
+        plotterFrame.pack();
+        plotterFrame.setVisible(true);
     }
 
     public SVTHitReconstructionPlots() {
@@ -135,7 +143,7 @@
 
         if (!event.hasCollection(HPSFittedRawTrackerHit.class, fittedTrackerHitCollectionName)) {
             System.out.println(fittedTrackerHitCollectionName + " does not exist; skipping event");
-             int ns = sensors.size();
+            int ns = sensors.size();
             for (int i = 0; i < ns; i++) {
                 int nraw = sensors.get(i).getReadout().getHits(RawTrackerHit.class).size();
                 aida.histogram1D(sensors.get(i).getName() + "_raw_hits").fill(nraw);
@@ -166,29 +174,17 @@
             aida.histogram1D(sensorName + "_raw_hits").fill(nraw);
             aida.histogram1D(sensorName + "_reco_hits").fill(nreco);
         }
-        for(SiTrackerHitStrip1D cluster : stripHits){
-            SiSensor sensor=cluster.getSensor();
-             String sensorName = sensor.getName();
-             int clusterSize=cluster.getRawHits().size();
-             aida.histogram1D(sensorName + "_cluster_size").fill(clusterSize);
+        for (SiTrackerHitStrip1D cluster : stripHits) {
+            SiSensor sensor = cluster.getSensor();
+            String sensorName = sensor.getName();
+            int clusterSize = cluster.getRawHits().size();
+            aida.histogram1D(sensorName + "_cluster_size").fill(clusterSize);
         }
-        
+
     }
 
     public void endOfData() {
-        if (plotter != null) {
-            plotter.hide();
-        }
-        if (plotter2 != null) {
-            plotter2.hide();
-        }
-        if (plotter3 != null) {
-            plotter3.hide();
-        }
-        if (plotter4 != null) {
-            plotter4.hide();
-        }
-
+        plotterFrame.dispose();
     }
 
     @Override

hps-java/src/main/java/org/lcsim/hps/monitoring/svt
SVTHitPulsePlots.java 1.7 -> 1.8
diff -u -r1.7 -r1.8
--- SVTHitPulsePlots.java	3 May 2012 13:50:36 -0000	1.7
+++ SVTHitPulsePlots.java	6 May 2012 00:01:13 -0000	1.8
@@ -7,6 +7,7 @@
 import org.lcsim.event.EventHeader;
 import org.lcsim.event.RawTrackerHit;
 import org.lcsim.geometry.Detector;
+import org.lcsim.hps.monitoring.AIDAFrame;
 import org.lcsim.hps.monitoring.Resettable;
 import org.lcsim.hps.recon.tracking.HPSSVTCalibrationConstants;
 import org.lcsim.util.Driver;
@@ -16,20 +17,22 @@
  *
  * @author mgraham
  */
-public class SVTHitPulsePlots extends Driver implements Resettable{
+public class SVTHitPulsePlots extends Driver implements Resettable {
 
+    private AIDAFrame plotterFrame;
     private List<IPlotter> plotters = new ArrayList<IPlotter>();
     private AIDA aida = AIDA.defaultInstance();
     private String rawTrackerHitCollectionName = "RawTrackerHitMaker_RawTrackerHits";
     private String trackerName = "Tracker";
     private int eventCount;
-    private Detector detector = null;
     private IPlotter plotter3;
     private IPlotter plotter2;
     private List<SiSensor> sensors;
 
     protected void detectorChanged(Detector detector) {
-        this.detector = detector;
+        plotterFrame = new AIDAFrame();
+        plotterFrame.setTitle("HPS SVT Pulse Plots");
+
         aida.tree().cd("/");
 
 
@@ -40,15 +43,19 @@
 
 
         plotter3 = fac.createPlotterFactory().create("HPS SVT Pulse Plots:  Raw Hits");
+        plotter3.setTitle("HPS SVT Pulse Plots:  Raw Hits");
+        plotterFrame.addPlotter(plotter3);
         plotters.add(plotter3);
         IPlotterStyle style3 = plotter3.style();
-        style3.statisticsBoxStyle().setVisible(true);
+        style3.statisticsBoxStyle().setVisible(false);
 //        style3.statisticsBoxStyle().setVisibileStatistics(trackerName);
         style3.dataStyle().fillStyle().setColor("black");
         style3.dataStyle().errorBarStyle().setVisible(true);
         plotter3.createRegions(5, 4);
 
         plotter2 = fac.createPlotterFactory().create("HPS SVT Hit vs Channel");
+        plotter2.setTitle("HPS SVT Hit vs Channel");
+        plotterFrame.addPlotter(plotter2);
         plotters.add(plotter2);
         IPlotterStyle style2 = plotter2.style();
         style2.statisticsBoxStyle().setVisible(false);
@@ -66,8 +73,8 @@
             plotter3.region(i).plot(pulsePlot);
             plotter2.region(i).plot(adcVsChanPlot);
         }
-        plotter3.show();
-        plotter2.show();
+        plotterFrame.pack();
+        plotterFrame.setVisible(true);
     }
 
     public SVTHitPulsePlots() {
@@ -87,7 +94,7 @@
             for (RawTrackerHit hrth : rawHits) {
                 fillPlots(hrth);
             }
-        } 
+        }
     }
 
     private void fillPlots(RawTrackerHit hit) {
@@ -96,14 +103,15 @@
         int strip = hit.getIdentifierFieldValue("strip");
         short[] adcVal = hit.getADCValues();
         double ped = HPSSVTCalibrationConstants.getPedestal(sensor, strip);
-        double noise = HPSSVTCalibrationConstants.getNoise(sensor, strip);        
+        double noise = HPSSVTCalibrationConstants.getNoise(sensor, strip);
         for (int i = 0; i < 6; i++) {
             double pedSub = (adcVal[i] - ped);
             aida.histogram2D(sensorName + "_AdcVsChan").fill(pedSub, strip);
             //only plot hits above threshold...
 //            if (pedSub / noise > 3 && hasAdjacentHit(hit) && noise < 70)
-            if (hasAdjacentHit(hit) && noise < 70)
+            if (hasAdjacentHit(hit) && noise < 70) {
                 aida.profile1D(sensorName + "_pulse").fill(24.0 * i, pedSub);
+            }
         }
     }
 
@@ -125,8 +133,9 @@
         for (RawTrackerHit sensorHit : hitsOnSensor) {
             int thisStrip = sensorHit.getIdentifierFieldValue("strip");
 //            System.out.println("hit strip = "+strip+"; other strips = "+thisStrip);
-            if (Math.abs(thisStrip - strip) == 1)
+            if (Math.abs(thisStrip - strip) == 1) {
                 return true;
+            }
         }
 
         return false;
@@ -134,7 +143,7 @@
 
     @Override
     public void reset() {
-           int ns = sensors.size();
+        int ns = sensors.size();
         for (int i = 0; i < ns; i++) {
             aida.histogram2D(sensors.get(i).getName() + "_AdcVsChan").reset();
             aida.profile1D(sensors.get(i).getName() + "_pulse").reset();

hps-java/src/main/resources/org/lcsim/hps/steering
ECalMonitoring.lcsim 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- ECalMonitoring.lcsim	5 May 2012 00:15:12 -0000	1.3
+++ ECalMonitoring.lcsim	6 May 2012 00:01:13 -0000	1.4
@@ -1,3 +1,4 @@
+
 <lcsim xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" 
        xs:noNamespaceSchemaLocation="http://www.lcsim.org/schemas/lcsim/1.0/lcsim.xsd">       
     <control>
@@ -10,10 +11,13 @@
         <driver name="EcalRawConverter"/>
         <driver name="EcalClusterer"/>
         <driver name="EcalPedestalPlots"/>
-        <driver name="EcalDaqPlots"/>
         <driver name="EcalMonitoringPlots"/>
         <driver name="EcalEventMonitor"/>
+<!--
+        <driver name="EcalDaqPlots"/>
+        <driver name="EcalWindowPlots"/>
         <driver name="EcalEvsX"/>
+-->
     </execute>    
     <drivers>
         <driver name="EcalRawConverter" type="org.lcsim.hps.recon.ecal.HPSEcalRawConverterDriver">
@@ -22,27 +26,25 @@
         </driver>
         <driver name="EcalMonitoringPlots" type="org.lcsim.hps.monitoring.ecal.EcalMonitoringPlots"/>
         <driver name="EcalEventMonitor" type="org.lcsim.hps.monitoring.ecal.EcalEventMonitor">
-	    <integralWindow>30</integralWindow>
             <eventRefreshRate>1</eventRefreshRate>
         </driver>
         <driver name="EcalWindowPlots" type="org.lcsim.hps.monitoring.ecal.EcalWindowPlotsXY">
             <subdetectorName>Ecal</subdetectorName>
             <inputCollection>EcalReadoutHits</inputCollection>
-	    <window>100</window>
+            <window>100</window>
         </driver>
         <driver name="EcalPedestalPlots" type="org.lcsim.hps.monitoring.ecal.EcalPedestalPlots">
-            <subdetectorName>Ecal</subdetectorName>
             <inputCollection>EcalReadoutHits</inputCollection>
         </driver>
         <driver name="EventMarkerDriver"
                 type="org.lcsim.job.EventMarkerDriver">
             <eventInterval>1</eventInterval>
         </driver>
-		<driver name="EcalClusterer"
+        <driver name="EcalClusterer"
                 type="org.lcsim.hps.recon.ecal.HPSEcalClusterer">
-			<ecalName>Ecal</ecalName>
-			<ecalCollectionName>EcalCalHits</ecalCollectionName>
-		</driver>
+            <ecalName>Ecal</ecalName>
+            <ecalCollectionName>EcalCalHits</ecalCollectionName>
+        </driver>
         <driver name="EcalEvsX" type="org.lcsim.hps.monitoring.ecal.EcalEvsX">
             <inputCollection>EcalClusters</inputCollection>
         </driver>

hps-java/src/main/resources/org/lcsim/hps/steering
TestRunMonitoring.lcsim 1.14 -> 1.15
diff -u -r1.14 -r1.15
--- TestRunMonitoring.lcsim	5 May 2012 01:50:26 -0000	1.14
+++ TestRunMonitoring.lcsim	6 May 2012 00:01:13 -0000	1.15
@@ -1,3 +1,4 @@
+
 <lcsim xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" 
        xs:noNamespaceSchemaLocation="http://www.lcsim.org/schemas/lcsim/1.0/lcsim.xsd">       
     <control>
@@ -13,62 +14,61 @@
         <driver name="HPSSVTDAQMaps"/>
         <driver name="RawTrackerHitMaker"/>
         <driver name="RawTrackerHitFitterDriver"/>  
-        <driver name="TrackerHitDriver"/> 
-<!--        <driver name="EcalDaqPlots"/>-->
+        <driver name="TrackerHitDriver"/>
+        <driver name="EcalDaqPlots"/>
         <driver name="EcalMonitoringPlots"/>
         <driver name="EcalEventMonitor"/>
         <driver name="SVTOccupancyPlots"/>
-        <driver name="SVTPulsePlots"/> 
-<!--        <driver name="SVTHitRecoPlots"/>   -->
+        <driver name="SVTPulsePlots"/>
+        <driver name="SVTHitRecoPlots"/>
         <driver name="CleanupDriver"/>
 
     </execute>    
     <drivers>
         <driver name="EcalRawConverter" 
                 type="org.lcsim.hps.recon.ecal.HPSEcalRawConverterDriver">
-			<ecalCollectionName>EcalCalHits</ecalCollectionName>
-	</driver>
+            <ecalCollectionName>EcalCalHits</ecalCollectionName>
+        </driver>
         <driver name="EcalClusterer"
                 type="org.lcsim.hps.recon.ecal.HPSEcalClusterer">
-			<ecalName>Ecal</ecalName>
-			<ecalCollectionName>EcalCalHits</ecalCollectionName>
-	</driver>
+            <ecalName>Ecal</ecalName>
+            <ecalCollectionName>EcalCalHits</ecalCollectionName>
+        </driver>
         <driver name="RawTrackerHitFitterDriver"
                 type="org.lcsim.hps.recon.tracking.HPSRawTrackerHitFitterDriver">
-           <fitAlgorithm>Analytic</fitAlgorithm>
+            <fitAlgorithm>Analytic</fitAlgorithm>
         </driver>
-        <driver name="TrackerHitDriver"
-                type="org.lcsim.hps.users.mgraham.DataTrackerHitDriver"/>
+        <driver name="TrackerHitDriver" type="org.lcsim.hps.users.mgraham.DataTrackerHitDriver"/>
         <driver name="EcalDaqPlots" type="org.lcsim.hps.monitoring.ecal.EcalDaqPlots">
         </driver>
         <driver name="CleanupDriver" 
                 type="org.lcsim.recon.tracking.digitization.sisim.config.ReadoutCleanupDriver">
-                <collectionNames>TrackerHits</collectionNames>
-         </driver>
-        <driver name="EcalMonitoringPlots" type="org.lcsim.hps.monitoring.ecal.EcalMonitoringPlots"/>
+            <collectionNames>TrackerHits</collectionNames>
+        </driver>
+        <driver name="EcalMonitoringPlots" type="org.lcsim.hps.monitoring.ecal.EcalMonitoringPlots">
+            <eventRefreshRate>100</eventRefreshRate>
+        </driver>
         <driver name="EcalEventMonitor" type="org.lcsim.hps.monitoring.ecal.EcalEventMonitor">
             <eventRefreshRate>1</eventRefreshRate>
         </driver>
         <driver name="SVTOccupancyPlots" type="org.lcsim.hps.monitoring.svt.SensorOccupancyPlotsDriver">
             <rawTrackerHitCollectionName>SVTRawTrackerHits</rawTrackerHitCollectionName>
-            <eventRefreshRate>1</eventRefreshRate>
-        </driver>
-        <driver name="SVTSetupDriver"
-                type="org.lcsim.hps.recon.tracking.HPSSVTSensorSetup">   
+            <eventRefreshRate>100</eventRefreshRate>
         </driver>
+        <driver name="SVTSetupDriver" type="org.lcsim.hps.recon.tracking.HPSSVTSensorSetup"/>
         <driver name="EventMarkerDriver" type="org.lcsim.job.EventMarkerDriver">
             <eventInterval>1</eventInterval>
         </driver>
         <driver name="SVTPulsePlots"
                 type="org.lcsim.hps.monitoring.svt.SVTHitPulsePlots">
-        <rawTrackerHitCollectionName>SVTRawTrackerHits</rawTrackerHitCollectionName>   
+            <rawTrackerHitCollectionName>SVTRawTrackerHits</rawTrackerHitCollectionName>   
         </driver>    
         <driver name="SVTHitRecoPlots"
                 type="org.lcsim.hps.monitoring.svt.SVTHitReconstructionPlots">
-             <rawTrackerHitCollectionName>SVTRawTrackerHits</rawTrackerHitCollectionName>   
-             <fittedTrackerHitCollectionName>SVTFittedRawTrackerHits</fittedTrackerHitCollectionName>   
+            <rawTrackerHitCollectionName>SVTRawTrackerHits</rawTrackerHitCollectionName>   
+            <fittedTrackerHitCollectionName>SVTFittedRawTrackerHits</fittedTrackerHitCollectionName>   
         </driver>
         <driver name="HPSSVTDAQMaps" type="org.lcsim.hps.recon.tracking.HPSSVTDAQMaps"/>   
-	<driver name="RawTrackerHitMaker" type="org.lcsim.hps.recon.tracking.SVTDataToRawTrackerHitDriver"/>
+        <driver name="RawTrackerHitMaker" type="org.lcsim.hps.recon.tracking.SVTDataToRawTrackerHitDriver"/>
     </drivers>
 </lcsim>

hps-java/src/main/resources/org/lcsim/hps/steering
ECalWindowMonitoring.lcsim removed after 1.3
diff -N ECalWindowMonitoring.lcsim
--- ECalWindowMonitoring.lcsim	29 Apr 2012 23:27:26 -0000	1.3
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,28 +0,0 @@
-<lcsim xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" 
-       xs:noNamespaceSchemaLocation="http://www.lcsim.org/schemas/lcsim/1.0/lcsim.xsd">       
-    <control>
-        <numberOfEvents>-1</numberOfEvents>
-        <printInputFiles>true</printInputFiles>
-        <printDriversDetailed>true</printDriversDetailed>
-    </control>    
-    <execute>
-        <driver name="EventMarkerDriver"/>
-        <driver name="EcalWindowPlots"/>
-        <driver name="EcalPedestalPlots"/>
-    </execute>    
-    <drivers>
-        <driver name="EcalWindowPlots" type="org.lcsim.hps.monitoring.ecal.EcalWindowPlotsXY">
-            <subdetectorName>Ecal</subdetectorName>
-            <inputCollection>EcalReadoutHits</inputCollection>
-	    <window>100</window>
-        </driver>
-        <driver name="EcalPedestalPlots" type="org.lcsim.hps.monitoring.ecal.EcalPedestalPlots">
-            <subdetectorName>Ecal</subdetectorName>
-            <inputCollection>EcalReadoutHits</inputCollection>
-        </driver>
-        <driver name="EventMarkerDriver"
-                type="org.lcsim.job.EventMarkerDriver">
-            <eventInterval>1</eventInterval>
-        </driver>
-    </drivers>
-</lcsim>

hps-java/src/main/java/org/lcsim/hps/monitoring/ecal
EcalPedestalPlots.java 1.4 -> 1.5
diff -u -r1.4 -r1.5
--- EcalPedestalPlots.java	4 May 2012 16:35:44 -0000	1.4
+++ EcalPedestalPlots.java	6 May 2012 00:01:13 -0000	1.5
@@ -8,40 +8,36 @@
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 
-import java.util.ArrayList;
 import java.util.List;
 import javax.swing.*;
 
 import org.lcsim.event.EventHeader;
-import org.lcsim.event.RawCalorimeterHit;
 import org.lcsim.event.RawTrackerHit;
+import org.lcsim.event.base.BaseRawCalorimeterHit;
 import org.lcsim.geometry.Detector;
-import org.lcsim.geometry.IDDecoder;
-import org.lcsim.geometry.compact.Subdetector;
 import org.lcsim.hps.monitoring.AIDAFrame;
+import org.lcsim.hps.monitoring.Redrawable;
 import org.lcsim.hps.monitoring.Resettable;
 import org.lcsim.util.Driver;
 import org.lcsim.util.aida.AIDA;
 
-public class EcalPedestalPlots extends Driver implements Resettable, ActionListener {
+public class EcalPedestalPlots extends Driver implements Resettable, ActionListener, Redrawable {
 
-    private String subdetectorName;
-    private Subdetector subdetector;
     private String inputCollection;
     private IPlotter plotter;
     private AIDA aida = AIDA.defaultInstance();
     private AIDAFrame plotterFrame;
-    private Detector detector;
-    private IDDecoder dec;
-    private List<ICloud1D> plotsList;
     private IHistogram2D meanPlot;
     private IHistogram2D sigmaPlot;
     private ICloud1D[][] plots = new ICloud1D[47][11];
     private JLabel xLabel, yLabel;
     private JComboBox xCombo;
     private JComboBox yCombo;
+    private JButton blankButton;
     private static final Integer[] xList = new Integer[46];
     private static final Integer[] yList = new Integer[10];
+    int eventRefreshRate = 1;
+    int eventn = 0;
 
     public EcalPedestalPlots() {
         int count = 0;
@@ -60,33 +56,15 @@
         }
     }
 
-    public void setSubdetectorName(String subdetectorName) {
-        this.subdetectorName = subdetectorName;
-    }
-
     public void setInputCollection(String inputCollection) {
         this.inputCollection = inputCollection;
     }
 
     public void detectorChanged(Detector detector) {
-
-        this.detector = detector;
-
-        if (subdetectorName == null) {
-            throw new RuntimeException("The subdetectorName parameter was not set.");
-        }
-
         if (inputCollection == null) {
             throw new RuntimeException("The inputCollection parameter was not set.");
         }
 
-        subdetector = detector.getSubdetector(subdetectorName);
-        dec = subdetector.getReadout().getIDDecoder();
-
-        setupPlots();
-    }
-
-    private void setupPlots() {
         // Setup the plotter.
         plotter = aida.analysisFactory().createPlotterFactory().create();
         plotter.setTitle("HPS ECal Pedestal Plots");
@@ -94,7 +72,6 @@
         plotterFrame.addPlotter(plotter);
         plotterFrame.setVisible(true);
 
-        plotsList = new ArrayList<ICloud1D>();
         aida = AIDA.defaultInstance();
         aida.tree().cd("/");
         sigmaPlot = aida.histogram2D(detector.getDetectorName() + " : " + inputCollection + " : Sigma", 47, -23.5, 23.5, 11, -5.5, 5.5);
@@ -105,7 +82,6 @@
                 //System.out.println("creating plot: " + "ECAL: Crate " + j + "; Slot " + i + " in region " + region);
 //                IHistogram1D hist = aida.histogram1D("ECAL: x=" + i + "; y=" + j, 1000, 0, 16);
                 plots[x + 23][y + 5] = aida.cloud1D("ECAL: x=" + x + "; y=" + y);
-                plotsList.add(plots[x + 23][y + 5]);
             }
         }
 
@@ -124,13 +100,9 @@
         yLabel.setLabelFor(yCombo);
         plotterFrame.getControlsPanel().add(yLabel);
         plotterFrame.getControlsPanel().add(yCombo);
-
-        JMenuBar menuBar = plotterFrame.getMenubar();
-        JMenu menu = new JMenu("File");
-        JMenuItem item = new JMenuItem("meeg");
-        menu.add(item);
-        menuBar.add(menu);
-
+        blankButton = new JButton("Hide histogram");
+        plotterFrame.getControlsPanel().add(blankButton);
+        blankButton.addActionListener(this);
 
         plotterFrame.pack();
 
@@ -162,10 +134,11 @@
         if (plotter != null) {
             plotter.hide();
             plotter.destroyRegions();
-            for (ICloud1D plot : plotsList) {
-                plot.reset();
+            for (int x = -23; x <= 23; x++) { // slot
+                for (int y = -5; y <= 5; y++) { // crate                
+                    plots[x + 23][y + 5].reset();
+                }
             }
-            detectorChanged(detector);
         }
     }
 
@@ -173,45 +146,60 @@
         if (event.hasCollection(RawTrackerHit.class, inputCollection)) {
             List<RawTrackerHit> hits = event.get(RawTrackerHit.class, inputCollection);
             for (RawTrackerHit hit : hits) {
-                dec.setID(hit.getCellID());
-                int x = dec.getValue("ix");
-                int y = dec.getValue("iy");
+                int x = hit.getIdentifierFieldValue("ix");
+                int y = hit.getIdentifierFieldValue("iy");
                 for (int i = 0; i < hit.getADCValues().length; i++) {
                     plots[x + 23][y + 5].fill(hit.getADCValues()[i]);
                 }
             }
+            if (eventRefreshRate > 0 && ++eventn % eventRefreshRate == 0) {
+                redraw();
+            }
         }
 
-        if (event.hasCollection(RawCalorimeterHit.class, inputCollection)) {
-            List<RawCalorimeterHit> hits = event.get(RawCalorimeterHit.class, inputCollection);
-            for (RawCalorimeterHit hit : hits) {
-                dec.setID(hit.getCellID());
-                int x = dec.getValue("ix");
-                int y = dec.getValue("iy");
+        if (event.hasCollection(BaseRawCalorimeterHit.class, inputCollection)) {
+            List<BaseRawCalorimeterHit> hits = event.get(BaseRawCalorimeterHit.class, inputCollection);
+            for (BaseRawCalorimeterHit hit : hits) {
+                int x = hit.getIdentifierFieldValue("ix");
+                int y = hit.getIdentifierFieldValue("iy");
                 plots[x + 23][y + 5].fill(hit.getAmplitude());
             }
+            if (eventRefreshRate > 0 && ++eventn % eventRefreshRate == 0) {
+                redraw();
+            }
+        }
+
+    }
+
+    @Override
+    public void actionPerformed(ActionEvent ae) {
+        if (ae.getSource() == blankButton) {
+            plotter.region(2).clear();
+        } else {
+            Integer x, y;
+            x = (Integer) xCombo.getSelectedItem();
+            y = (Integer) yCombo.getSelectedItem();
+            plotter.region(2).clear();
+            plotter.region(2).plot(plots[x + 23][y + 5]);
+            ((PlotterRegion) plotter.region(2)).getPlot().setAllowUserInteraction(false);
+            ((PlotterRegion) plotter.region(2)).getPlot().setAllowPopupMenus(false);
         }
+    }
 
+    @Override
+    public void redraw() {
         sigmaPlot.reset();
         meanPlot.reset();
         for (int x = -23; x <= 23; x++) { // slot
             for (int y = -5; y <= 5; y++) { // crate      
                 sigmaPlot.fill(x, y, plots[x + 23][y + 5].rms());
                 meanPlot.fill(x, y, plots[x + 23][y + 5].mean());
-                //System.out.println("creating plot: " + "ECAL: Crate " + j + "; Slot " + i + " in region " + region);
-//                IHistogram1D hist = aida.histogram1D("ECAL: x=" + i + "; y=" + j, 1000, 0, 16);
             }
         }
     }
 
     @Override
-    public void actionPerformed(ActionEvent ae) {
-        Integer x, y;
-        x = (Integer) xCombo.getSelectedItem();
-        y = (Integer) yCombo.getSelectedItem();
-        plotter.region(2).clear();
-        plotter.region(2).plot(plots[x + 23][y + 5]);
-        ((PlotterRegion) plotter.region(2)).getPlot().setAllowUserInteraction(false);
-        ((PlotterRegion) plotter.region(2)).getPlot().setAllowPopupMenus(false);
+    public void setEventRefreshRate(int eventRefreshRate) {
+        this.eventRefreshRate = eventRefreshRate;
     }
 }

hps-java/src/main/java/org/lcsim/hps/monitoring/ecal
EcalEventMonitor.java 1.7 -> 1.8
diff -u -r1.7 -r1.8
--- EcalEventMonitor.java	4 May 2012 20:29:01 -0000	1.7
+++ EcalEventMonitor.java	6 May 2012 00:01:13 -0000	1.8
@@ -4,58 +4,36 @@
 import hep.aida.IPlotter;
 import hep.aida.IPlotterStyle;
 import hep.aida.ref.plotter.PlotterRegion;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
 import java.awt.event.ItemEvent;
 import java.awt.event.ItemListener;
 
 import java.util.List;
-import javax.swing.JButton;
 import javax.swing.JCheckBox;
 import org.lcsim.event.CalorimeterHit;
 
 import org.lcsim.event.EventHeader;
-import org.lcsim.event.RawCalorimeterHit;
-import org.lcsim.event.RawTrackerHit;
 import org.lcsim.geometry.Detector;
-import org.lcsim.geometry.IDDecoder;
 import org.lcsim.hps.monitoring.AIDAFrame;
 import org.lcsim.hps.recon.ecal.HPSEcalCluster;
-import org.lcsim.hps.recon.ecal.HPSEcalConditions;
 import org.lcsim.util.Driver;
 import org.lcsim.util.aida.AIDA;
 
-public class EcalEventMonitor extends Driver implements ActionListener, ItemListener {
+public class EcalEventMonitor extends Driver implements ItemListener {
 
-    String subdetectorName = "Ecal";
-    String inputCollectionName = "EcalReadoutHits";
+    String inputCollectionName = "EcalCalHits";
     String clusterCollectionName = "EcalClusters";
     AIDA aida = AIDA.defaultInstance();
     IPlotter plotter;
     IHistogram2D hitPlot;
     IHistogram2D clusterPlot;
-    IDDecoder dec;
-    Detector detector;
     int eventRefreshRate = 1;
     int eventn = 0;
-    int integralWindow = 0;
     private AIDAFrame plotterFrame;
-    private boolean singleEvent = false;
-    private JButton nextButton;
     private JCheckBox logScaleBox;
-    private boolean plotNextEvent = true;
 
     public EcalEventMonitor() {
     }
 
-    public void setSingleEvent(boolean singleEvent) {
-        this.singleEvent = singleEvent;
-    }
-
-    public void setIntegralWindow(int integralWindow) {
-        this.integralWindow = integralWindow;
-    }
-
     public void setEventRefreshRate(int eventRefreshRate) {
         this.eventRefreshRate = eventRefreshRate;
     }
@@ -64,23 +42,10 @@
         this.inputCollectionName = inputCollectionName;
     }
 
-    public void setSubdetectorName(String subdetectorName) {
-        this.subdetectorName = subdetectorName;
-    }
-
     protected void detectorChanged(Detector detector) {
-        this.detector = detector;
-
-        if (detector.getSubdetector(subdetectorName) == null) {
-            throw new RuntimeException("There is no subdetector called " + subdetectorName + " in this detector");
-        }
-
-        // Cache the IDDecoder for the ECal.		
-        dec = detector.getSubdetector(subdetectorName).getReadout().getIDDecoder();
-
         // Setup plots.
         aida.tree().cd("/");
-        hitPlot = aida.histogram2D(detector.getDetectorName() + " : " + inputCollectionName + " : Mean ADC Value", 47, -23.5, 23.5, 11, -5.5, 5.5);
+        hitPlot = aida.histogram2D(detector.getDetectorName() + " : " + inputCollectionName + " : Pedestal-Subtracted ADC Value", 47, -23.5, 23.5, 11, -5.5, 5.5);
 
         clusterPlot = aida.histogram2D(detector.getDetectorName() + " : " + clusterCollectionName + " : Energy", 47, -23.5, 23.5, 11, -5.5, 5.5);
 
@@ -96,28 +61,22 @@
         // Create the plotter regions.
         plotter.createRegions(1, 2);
         plotter.style().statisticsBoxStyle().setVisible(false);
-        IPlotterStyle style = plotter.region(0).style();
-        style.setParameter("hist2DStyle", "colorMap");
-        style.dataStyle().fillStyle().setParameter("colorMapScheme", "rainbow");
-        style.zAxisStyle().setParameter("scale", "lin");
+
+        for (int i = 0; i < plotter.numberOfRegions(); i++) {
+            IPlotterStyle style = plotter.region(i).style();
+            style.setParameter("hist2DStyle", "colorMap");
+            style.dataStyle().fillStyle().setParameter("colorMapScheme", "rainbow");
+            style.zAxisStyle().setParameter("scale", "lin");
+        }
+
         plotter.region(0).plot(hitPlot);
         ((PlotterRegion) plotter.region(0)).getPlot().setAllowUserInteraction(false);
         ((PlotterRegion) plotter.region(0)).getPlot().setAllowPopupMenus(false);
 
-        style = plotter.region(1).style();
-        style.setParameter("hist2DStyle", "colorMap");
-        style.dataStyle().fillStyle().setParameter("colorMapScheme", "rainbow");
-        style.zAxisStyle().setParameter("scale", "lin");
         plotter.region(1).plot(clusterPlot);
         ((PlotterRegion) plotter.region(1)).getPlot().setAllowUserInteraction(false);
         ((PlotterRegion) plotter.region(1)).getPlot().setAllowPopupMenus(false);
 
-        if (singleEvent) {
-            nextButton = new JButton("next");
-            nextButton.addActionListener(this);
-            plotterFrame.getControlsPanel().add(nextButton);
-        }
-
         logScaleBox = new JCheckBox("log scale");
         logScaleBox.addItemListener(this);
         plotterFrame.getControlsPanel().add(logScaleBox);
@@ -126,101 +85,46 @@
     }
 
     public void process(EventHeader event) {
-        if (!HPSEcalConditions.pedestalsLoaded()) {
-            HPSEcalConditions.loadPedestals();
-        }
-        if (plotNextEvent) {
-            if (event.hasCollection(RawCalorimeterHit.class, inputCollectionName)) {
-                if (++eventn % eventRefreshRate != 0) {
-                    return;
-                }
-                hitPlot.reset();
-                List<RawCalorimeterHit> hits = event.get(RawCalorimeterHit.class, inputCollectionName);
-                for (RawCalorimeterHit hit : hits) {
-                    dec.setID(hit.getCellID());
-                    int pedestal = integralWindow * HPSEcalConditions.physicalToPedestal(hit.getCellID());
-                    hitPlot.fill(dec.getValue("ix"), dec.getValue("iy"), hit.getAmplitude() - pedestal);
-                }
-                if (singleEvent) {
-                    plotNextEvent = false;
-                }
+        if (event.hasCollection(CalorimeterHit.class, inputCollectionName)) {
+            if (++eventn % eventRefreshRate != 0) {
+                return;
             }
-            if (event.hasCollection(RawTrackerHit.class, inputCollectionName)) {
-                if (++eventn % eventRefreshRate != 0) {
-                    return;
-                }
-                hitPlot.reset();
-                List<RawTrackerHit> hits = event.get(RawTrackerHit.class, inputCollectionName);
-                for (RawTrackerHit hit : hits) {
-                    dec.setID(hit.getCellID());
-                    double mean = 0;
-                    for (int i = 0; i < hit.getADCValues().length; i++) {
-                        mean += hit.getADCValues()[i];
-                    }
-                    mean /= hit.getADCValues().length;
-                    hitPlot.fill(dec.getValue("ix"), dec.getValue("iy"), mean);
-                }
-                if (singleEvent) {
-                    plotNextEvent = false;
-                }
+            hitPlot.reset();
+            List<CalorimeterHit> hits = event.get(CalorimeterHit.class, inputCollectionName);
+            for (CalorimeterHit hit : hits) {
+                hitPlot.fill(hit.getIdentifierFieldValue("ix"), hit.getIdentifierFieldValue("iy"), hit.getRawEnergy());
             }
-            if (event.hasCollection(HPSEcalCluster.class, clusterCollectionName)) {
-                if (++eventn % eventRefreshRate != 0) {
-                    return;
-                }
-                clusterPlot.reset();
-                List<HPSEcalCluster> clusters = event.get(HPSEcalCluster.class, clusterCollectionName);
-                for (HPSEcalCluster cluster : clusters) {
-                    dec.setID(cluster.getSeedHit().getCellID());
-                    CalorimeterHit seedHit = cluster.getSeedHit();
-
-                    clusterPlot.fill(seedHit.getIdentifierFieldValue("ix"), seedHit.getIdentifierFieldValue("iy"), cluster.getEnergy());
-                }
-                if (singleEvent) {
-                    plotNextEvent = false;
-                }
+        }
+        if (event.hasCollection(HPSEcalCluster.class, clusterCollectionName)) {
+            if (++eventn % eventRefreshRate != 0) {
+                return;
+            }
+            clusterPlot.reset();
+            List<HPSEcalCluster> clusters = event.get(HPSEcalCluster.class, clusterCollectionName);
+            for (HPSEcalCluster cluster : clusters) {
+                CalorimeterHit seedHit = cluster.getSeedHit();
+                clusterPlot.fill(seedHit.getIdentifierFieldValue("ix"), seedHit.getIdentifierFieldValue("iy"), cluster.getEnergy());
             }
         }
     }
 
     public void endOfData() {
-        if (plotter != null) {
-            plotter.hide();
-            plotter.destroyRegions();
-        }
-        if (hitPlot != null) {
-            hitPlot.reset();
-        }
-        if (clusterPlot != null) {
-            clusterPlot.reset();
-        }
-
         if (plotterFrame != null) {
             plotterFrame.dispose();
         }
     }
 
     @Override
-    public void actionPerformed(ActionEvent ae) {
-        if (ae.getSource() == nextButton) {
-            plotNextEvent = true;
-        }
-
-    }
-
-    @Override
     public void itemStateChanged(ItemEvent ie) {
         if (ie.getSource() == logScaleBox) {
-            IPlotterStyle style1 = plotter.region(0).style();
-            IPlotterStyle style2 = plotter.region(1).style();
-            if (ie.getStateChange() == ItemEvent.DESELECTED) {
-                style1.zAxisStyle().setParameter("scale", "lin");
-                style2.zAxisStyle().setParameter("scale", "lin");
-            } else {
-                style1.zAxisStyle().setParameter("scale", "log");
-                style2.zAxisStyle().setParameter("scale", "log");
+            for (int i = 0; i < plotter.numberOfRegions(); i++) {
+                IPlotterStyle style = plotter.region(i).style();
+                if (ie.getStateChange() == ItemEvent.DESELECTED) {
+                    style.zAxisStyle().setParameter("scale", "lin");
+                } else {
+                    style.zAxisStyle().setParameter("scale", "log");
+                }
             }
-//            plotter.region(0).plot(hitPlot);
         }
     }
 }
\ No newline at end of file

hps-java/src/main/java/org/lcsim/hps/monitoring/ecal
EcalEvsX.java 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- EcalEvsX.java	5 May 2012 00:15:12 -0000	1.1
+++ EcalEvsX.java	6 May 2012 00:01:13 -0000	1.2
@@ -10,9 +10,7 @@
 
 import org.lcsim.event.EventHeader;
 import org.lcsim.geometry.Detector;
-import org.lcsim.geometry.IDDecoder;
 import org.lcsim.hps.monitoring.Resettable;
-import org.lcsim.hps.recon.ecal.HPSEcalCluster;
 import org.lcsim.util.Driver;
 import org.lcsim.util.aida.AIDA;
 
@@ -23,13 +21,9 @@
     AIDA aida = AIDA.defaultInstance();
     IPlotter plotter;
     ICloud2D EvsXPlot;
-    IDDecoder dec;
     Detector detector;
     int eventn = 0;
 
-    public EcalEvsX() {
-    }
-
     public void setInputCollection(String inputCollection) {
         this.inputCollection = inputCollection;
     }
@@ -46,11 +40,8 @@
             throw new RuntimeException("There is no subdetector called " + subdetectorName + " in this detector");
         }
 
-        // Cache the IDDecoder for the ECal.		
-        dec = detector.getSubdetector(subdetectorName).getReadout().getIDDecoder();
-
         // Setup the plotter.
-        plotter = aida.analysisFactory().createPlotterFactory().create("HPS ECal Monitoring Plots");
+        plotter = aida.analysisFactory().createPlotterFactory().create("HPS ECal E vs X Plot");
 
         // Setup plots.
         aida.tree().cd("/");
@@ -69,10 +60,22 @@
     }
 
     public void process(EventHeader event) {
-        if (event.hasCollection(HPSEcalCluster.class, inputCollection)) {
-            List<HPSEcalCluster> clusters = event.get(HPSEcalCluster.class, inputCollection);
-            for (HPSEcalCluster cluster : clusters) {
-                EvsXPlot.fill(cluster.getPosition()[0], cluster.getEnergy());
+        if (event.hasCollection(Cluster.class, inputCollection)) {
+            List<Cluster> clusters = event.get(Cluster.class, inputCollection);
+            boolean left = false;
+            boolean right = false;
+            for (Cluster cluster : clusters) {
+                if (cluster.getPosition()[0] > 0) {
+                    right = true;
+                }
+                if (cluster.getPosition()[0] < 0) {
+                    left = true;
+                }
+            }
+            if (left && right) {
+                for (Cluster cluster : clusters) {
+                    EvsXPlot.fill(cluster.getPosition()[0], cluster.getEnergy());
+                }
             }
             ++eventn;
         }

hps-java/src/main/java/org/lcsim/hps/monitoring/ecal
EcalMonitoringPlots.java 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- EcalMonitoringPlots.java	30 Apr 2012 18:46:59 -0000	1.2
+++ EcalMonitoringPlots.java	6 May 2012 00:01:13 -0000	1.3
@@ -8,98 +8,101 @@
 import java.util.List;
 
 import org.lcsim.event.EventHeader;
-import org.lcsim.event.RawCalorimeterHit;
 import org.lcsim.event.RawTrackerHit;
+import org.lcsim.event.base.BaseRawCalorimeterHit;
 import org.lcsim.geometry.Detector;
-import org.lcsim.geometry.IDDecoder;
+import org.lcsim.hps.monitoring.Redrawable;
 import org.lcsim.hps.monitoring.Resettable;
 import org.lcsim.util.Driver;
 import org.lcsim.util.aida.AIDA;
 
-public class EcalMonitoringPlots extends Driver implements Resettable {
+public class EcalMonitoringPlots extends Driver implements Resettable, Redrawable {
 
-	String subdetectorName = "Ecal";
-	String inputCollectionName = "EcalReadoutHits";
-	AIDA aida = AIDA.defaultInstance();
-	IPlotter plotter;
-	IHistogram2D hitCountPlot;
-	IDDecoder dec;
-	Detector detector;
-	int eventn = 0;
-
-	public EcalMonitoringPlots() {
-	}
-
-	public void setInputCollectionName(String inputCollectionName) {
-		this.inputCollectionName = inputCollectionName;
-	}
-
-	public void setSubdetectorName(String subdetectorName) {
-		this.subdetectorName = subdetectorName;
-	}
-
-	protected void detectorChanged(Detector detector) {
-
-		this.detector = detector;
-
-		if (detector.getSubdetector(subdetectorName) == null) {
-			throw new RuntimeException("There is no subdetector called " + subdetectorName + " in this detector");
-		}
-
-		// Cache the IDDecoder for the ECal.		
-		dec = detector.getSubdetector(subdetectorName).getReadout().getIDDecoder();
-
-		// Setup the plotter.
-		plotter = aida.analysisFactory().createPlotterFactory().create("HPS ECal Monitoring Plots");
-
-		// Setup plots.
-		aida.tree().cd("/");
-		hitCountPlot = aida.histogram2D(detector.getDetectorName() + " : " + inputCollectionName + " : Hit Count", 47, -23.5, 23.5, 11, -5.5, 5.5);
-
-		// Create the plotter regions.
-		plotter.createRegion();
-		plotter.style().statisticsBoxStyle().setVisible(false);
-		IPlotterStyle style = plotter.region(0).style();
-		style.setParameter("hist2DStyle", "colorMap");
-		style.dataStyle().fillStyle().setParameter("colorMapScheme", "rainbow");
-		plotter.region(0).plot(hitCountPlot);
-		((PlotterRegion) plotter.region(0)).getPlot().setAllowUserInteraction(false);
-		((PlotterRegion) plotter.region(0)).getPlot().setAllowPopupMenus(false);
-		plotter.show();
-	}
-
-	public void process(EventHeader event) {
-		if (event.hasCollection(RawCalorimeterHit.class, inputCollectionName)) {
-			List<RawCalorimeterHit> hits = event.get(RawCalorimeterHit.class, inputCollectionName);
-			for (RawCalorimeterHit hit : hits) {
-				dec.setID(hit.getCellID());
-				hitCountPlot.fill(dec.getValue("ix"), dec.getValue("iy"));
-			}
-			++eventn;
-		}
-		if (event.hasCollection(RawTrackerHit.class, inputCollectionName)) {
-			List<RawTrackerHit> hits = event.get(RawTrackerHit.class, inputCollectionName);
-			for (RawTrackerHit hit : hits) {
-				dec.setID(hit.getCellID());
-				hitCountPlot.fill(dec.getValue("ix"), dec.getValue("iy"));
-			}
-			++eventn;
-		}
-	}
-
-	public void endOfData() {
-		if (plotter != null) {
-			plotter.hide();
-			plotter.destroyRegions();
-		}
-		if (hitCountPlot != null) {
-			hitCountPlot.reset();
-		}
-	}
-
-	public void reset() {
-		plotter.hide();
-		hitCountPlot.reset();
-		detectorChanged(detector);
-	}
+    String inputCollectionName = "EcalReadoutHits";
+    AIDA aida = AIDA.defaultInstance();
+    IPlotter plotter;
+    IHistogram2D hitCountFillPlot;
+    IHistogram2D hitCountDrawPlot;
+    int eventRefreshRate = 1;
+    int eventn = 0;
+
+    public EcalMonitoringPlots() {
+    }
+
+    public void setInputCollectionName(String inputCollectionName) {
+        this.inputCollectionName = inputCollectionName;
+    }
+
+    protected void detectorChanged(Detector detector) {
+        // Setup the plotter.
+        plotter = aida.analysisFactory().createPlotterFactory().create("HPS ECal Monitoring Plots");
+        // Setup plots.
+        aida.tree().cd("/");
+        hitCountDrawPlot = aida.histogram2D(detector.getDetectorName() + " : " + inputCollectionName + " : Hit Count", 47, -23.5, 23.5, 11, -5.5, 5.5);
+        hitCountFillPlot = makeCopy(hitCountDrawPlot);
+
+        // Create the plotter regions.
+        plotter.createRegion();
+        plotter.style().statisticsBoxStyle().setVisible(false);
+        IPlotterStyle style = plotter.region(0).style();
+        style.setParameter("hist2DStyle", "colorMap");
+        style.dataStyle().fillStyle().setParameter("colorMapScheme", "rainbow");
+        plotter.region(0).plot(hitCountDrawPlot);
+        ((PlotterRegion) plotter.region(0)).getPlot().setAllowUserInteraction(false);
+        ((PlotterRegion) plotter.region(0)).getPlot().setAllowPopupMenus(false);
+        plotter.show();
+    }
+
+    public void process(EventHeader event) {
+        if (event.hasCollection(BaseRawCalorimeterHit.class, inputCollectionName)) {
+            List<BaseRawCalorimeterHit> hits = event.get(BaseRawCalorimeterHit.class, inputCollectionName);
+            for (BaseRawCalorimeterHit hit : hits) {
+                hitCountFillPlot.fill(hit.getIdentifierFieldValue("ix"), hit.getIdentifierFieldValue("iy"));
+            }
+            if (eventRefreshRate > 0 && ++eventn % eventRefreshRate == 0) {
+                redraw();
+            }
+        }
+        if (event.hasCollection(RawTrackerHit.class, inputCollectionName)) {
+            List<RawTrackerHit> hits = event.get(RawTrackerHit.class, inputCollectionName);
+            for (RawTrackerHit hit : hits) {
+                hitCountFillPlot.fill(hit.getIdentifierFieldValue("ix"), hit.getIdentifierFieldValue("iy"));
+            }
+            if (eventRefreshRate > 0 && ++eventn % eventRefreshRate == 0) {
+                redraw();
+            }
+        }
+    }
+
+    public void endOfData() {
+        if (plotter != null) {
+            plotter.hide();
+            plotter.destroyRegions();
+        }
+    }
+
+    @Override
+    public void reset() {
+        if (hitCountFillPlot != null) {
+            hitCountFillPlot.reset();
+        }
+        if (hitCountDrawPlot != null) {
+            hitCountDrawPlot.reset();
+        }
+    }
+
+    @Override
+    public void redraw() {
+        hitCountDrawPlot.reset();
+        hitCountDrawPlot.add(hitCountFillPlot);
+    }
+
+    @Override
+    public void setEventRefreshRate(int eventRefreshRate) {
+        this.eventRefreshRate = eventRefreshRate;
+    }
+
+    private IHistogram2D makeCopy(IHistogram2D hist) {
+        return aida.histogram2D(hist.title() + "_copy", hist.xAxis().bins(), hist.xAxis().lowerEdge(), hist.xAxis().upperEdge(), hist.yAxis().bins(), hist.yAxis().lowerEdge(), hist.yAxis().upperEdge());
+    }
 }
\ No newline at end of file

hps-java/src/main/java/org/lcsim/hps/recon/ecal
HPSEcalRawConverterDriver.java 1.5 -> 1.6
diff -u -r1.5 -r1.6
--- HPSEcalRawConverterDriver.java	5 May 2012 00:15:12 -0000	1.5
+++ HPSEcalRawConverterDriver.java	6 May 2012 00:01:13 -0000	1.6
@@ -88,5 +88,4 @@
         int flags = 0;
         event.put(ecalCollectionName, newHits, CalorimeterHit.class, flags, ecalReadoutName);
     }
-
 }
CVSspam 0.2.12


Use REPLY-ALL to reply to list

To unsubscribe from the LCD-CVS list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=LCD-CVS&A=1