Print

Print


Commit in hps-java/src/main/java/org/lcsim/hps on MAIN
recon/tracking/SvtUtils.java+2-21.6 -> 1.7
              /EcalTrackMatch.java-11.4 -> 1.5
users/phansson/ecalGainAna.java+61-311.7 -> 1.8
              /ECalGainDriver.java+1-11.10 -> 1.11
evio/TestRunEvioToLcio.java+2-31.21 -> 1.22
    /LCSimTestRunEventBuilder.java+3-41.21 -> 1.22
monitoring/svt/TrackingReconstructionPlots.java+29-271.12 -> 1.13
monitoring/ecal/TriggerPlots.java+38-321.7 -> 1.8
               /EcalEvsX.java+4-31.8 -> 1.9
monitoring/DefaultEtEventProcessor.java+72-791.9 -> 1.10
+212-183
10 modified files
plot drivers and ECal gain code

hps-java/src/main/java/org/lcsim/hps/recon/tracking
SvtUtils.java 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- SvtUtils.java	30 Aug 2012 03:31:13 -0000	1.6
+++ SvtUtils.java	8 Sep 2012 00:17:53 -0000	1.7
@@ -22,7 +22,7 @@
 /**
  * 
  * @author Omar Moreno
- * @version $Id: SvtUtils.java,v 1.6 2012/08/30 03:31:13 omoreno Exp $
+ * @version $Id: SvtUtils.java,v 1.7 2012/09/08 00:17:53 meeg Exp $
  */
 public class SvtUtils {
 
@@ -50,7 +50,7 @@
     private SiSensor[][] sensorArray = new SiSensor[2][12];
     private IIdentifierHelper helper;
     private boolean isSetup = false;
-    boolean debug = true;
+    boolean debug = false;
     String subdetectorName = "Tracker";
     ConditionsManager mgr = ConditionsManager.defaultInstance();
 

hps-java/src/main/java/org/lcsim/hps/recon/tracking
EcalTrackMatch.java 1.4 -> 1.5
diff -u -r1.4 -r1.5
--- EcalTrackMatch.java	4 Sep 2012 23:02:00 -0000	1.4
+++ EcalTrackMatch.java	8 Sep 2012 00:17:53 -0000	1.5
@@ -4,7 +4,6 @@
 import java.util.List;
 import org.lcsim.event.Cluster;
 import org.lcsim.event.Track;
-import org.lcsim.hps.users.omoreno.ExtendTrack;
 
 /**
  *

hps-java/src/main/java/org/lcsim/hps/users/phansson
ecalGainAna.java 1.7 -> 1.8
diff -u -r1.7 -r1.8
--- ecalGainAna.java	31 Aug 2012 01:26:33 -0000	1.7
+++ ecalGainAna.java	8 Sep 2012 00:17:53 -0000	1.8
@@ -34,6 +34,8 @@
         option.addOption("s", false, "Save to file");
         option.addOption("n", true, "Name added to plots");
         option.addOption("m", true, "Minimum weight for calibration");
+        option.addOption("d", true, "Detector used for calibration");
+        option.addOption("g", false, "Use HV groups in calibration");
         return option;
     }
 
@@ -89,6 +91,8 @@
             minCount = Double.valueOf(cmd.getOptionValue("m"));
         }
 
+        boolean useHVGroups = cmd.hasOption("g");
+
         ITree sim = null;
         ITree real = null;
         try {
@@ -125,22 +129,35 @@
 //        IHistogram2D mpePlotReal = (IHistogram2D) real.find("<E over p>");
 //        IHistogram2D spePlotReal = (IHistogram2D) real.find("RMS(E over p)");
 
-        String detectorName = "HPS-TestRun-v2";
+        String detectorName = "HPS-TestRun-v3";
+        if (cmd.hasOption("d")) {
+            detectorName = cmd.getOptionValue("d");
+        }
+
         HPSEcalConditions.detectorChanged(DetectorLocator.findDetector(detectorName), "Ecal");
 
         IHistogramFactory hf = af.createHistogramFactory(null);
 
-        IHistogram2D corrPlotSim = hf.createHistogram2D("Correction factor - simulation", 47, -23.5, 23.5, 11, -5.5, 5.5);
-        IHistogram2D corrPlotReal = hf.createHistogram2D("Correction factor - data", 47, -23.5, 23.5, 11, -5.5, 5.5);
+        IHistogram2D corrPlotSim = hf.createHistogram2D("Weighted E over p - simulation", 47, -23.5, 23.5, 11, -5.5, 5.5);
+        IHistogram2D corrPlotReal = hf.createHistogram2D("Weighted E over p - data", 47, -23.5, 23.5, 11, -5.5, 5.5);
 
         for (int x = -23; x <= 23; x++) {
             for (int y = -5; y <= 5; y++) {
-//                if (weightPlotSim.binHeight(x + 23, y + 5) > minCount) {
-                corrPlotSim.fill(x, y, sumPlotSim.binHeight(x + 23, y + 5) / weightPlotSim.binHeight(x + 23, y + 5));
-//                }
-//                if (weightPlotReal.binHeight(x + 23, y + 5) > minCount) {
-                corrPlotReal.fill(x, y, sumPlotReal.binHeight(x + 23, y + 5) / weightPlotReal.binHeight(x + 23, y + 5));
-//                }
+                double ep;
+                if (weightPlotSim.binHeight(x + 23, y + 5) > minCount / 4.0) {
+                     ep = weightPlotSim.binHeight(x + 23, y + 5) / sumPlotSim.binHeight(x + 23, y + 5);
+                    if (ep > 1.0) {
+                        ep = 1.0;
+                    }
+                    corrPlotSim.fill(x, y, ep);
+                }
+                if (weightPlotReal.binHeight(x + 23, y + 5) > minCount / 4.0) {
+                    ep = weightPlotReal.binHeight(x + 23, y + 5) / sumPlotReal.binHeight(x + 23, y + 5);
+                    if (ep > 1.0) {
+                        ep = 1.0;
+                    }
+                    corrPlotReal.fill(x, y, ep);
+                }
             }
         }
 
@@ -175,11 +192,11 @@
 //        plotter.region(0).style().zAxisStyle().setParameter("scale", "log");
         plotter.region(0).plot(corrPlotSim);
 //        plotter.region(0).setZLimits(0, 10.0);
-plotter.region(0).style().zAxisStyle().setParameter("upperLimit", "10.0");
+        plotter.region(0).style().zAxisStyle().setParameter("upperLimit", "10.0");
         plotter.region(0).setTitle(corrPlotSim.title());
         plotter.region(0).refresh();
-  plotter.region(0).style().zAxisStyle().setParameter("upperLimit", "10.0");
-    try {
+        plotter.region(0).style().zAxisStyle().setParameter("upperLimit", "10.0");
+        try {
             plotter.writeToFile(outName + "_corr_sim.png", "png");
         } catch (IOException e) {
             throw new RuntimeException(e);
@@ -214,6 +231,10 @@
         double[][] weightsHVReal = new double[4][12];
         double[][] sumsHVReal = new double[4][12];
 
+
+        double allWeightsReal = 0;
+        double allWeightsSim = 0;
+
         for (int quad = 1; quad <= 4; ++quad) {
             for (int module = 1; module <= 12; ++module) {
                 pePlotsHVSim[quad - 1][module - 1] = hf.createHistogram1D("E over p quadrant=" + quad + " HV group=" + module, 50, 0, 2);
@@ -228,6 +249,8 @@
                 sumsHVSim[HPSECalUtils.getQuadrant(x, y) - 1][HPSECalUtils.getHVGroup(x, y) - 1] += sumPlotSim.binHeight(x + 23, y + 5);
                 weightsHVReal[HPSECalUtils.getQuadrant(x, y) - 1][HPSECalUtils.getHVGroup(x, y) - 1] += weightPlotReal.binHeight(x + 23, y + 5);
                 sumsHVReal[HPSECalUtils.getQuadrant(x, y) - 1][HPSECalUtils.getHVGroup(x, y) - 1] += sumPlotReal.binHeight(x + 23, y + 5);
+                allWeightsReal += weightPlotReal.binHeight(x + 23, y + 5);
+                allWeightsSim += weightPlotSim.binHeight(x + 23, y + 5);
             }
         }
 
@@ -289,31 +312,38 @@
 
 
         gainStream.format("#x\ty\tgain\n");
-        for (int x = -23; x <= 23; x++) {
-            for (int y = -5; y <= 5; y++) {
-                Double gain = HPSEcalConditions.physicalToGain(HPSEcalConditions.makePhysicalID(x, y));
-                IHistogram1D peSim = pePlotsSim[x + 23][y + 5][0];
-                IHistogram1D peReal = pePlotsReal[x + 23][y + 5][0];
-                IHistogram1D peHVSim = pePlotsHVSim[HPSECalUtils.getQuadrant(x, y) - 1][HPSECalUtils.getHVGroup(x, y) - 1];
-                IHistogram1D peHVReal = pePlotsHVReal[HPSECalUtils.getQuadrant(x, y) - 1][HPSECalUtils.getHVGroup(x, y) - 1];
-                double weightHVReal = weightsHVReal[HPSECalUtils.getQuadrant(x, y) - 1][HPSECalUtils.getHVGroup(x, y) - 1];
-                double sumHVReal = sumsHVReal[HPSECalUtils.getQuadrant(x, y) - 1][HPSECalUtils.getHVGroup(x, y) - 1];
-                double weightHVSim = weightsHVSim[HPSECalUtils.getQuadrant(x, y) - 1][HPSECalUtils.getHVGroup(x, y) - 1];
-                double sumHVSim = sumsHVSim[HPSECalUtils.getQuadrant(x, y) - 1][HPSECalUtils.getHVGroup(x, y) - 1];
-                if (gain != null) {
-                    if (weightPlotSim.binHeight(x + 23, y + 5) > minCount && weightPlotReal.binHeight(x + 23, y + 5) > minCount) {
-                        gain *= (corrPlotReal.binHeight(x + 23, y + 5) / corrPlotSim.binHeight(x + 23, y + 5));
-                    } else if (weightHVReal > minCount && weightHVSim > minCount) {
-//                        gain *= (sumHVReal / weightHVReal) / (sumHVSim / weightHVSim);
-                    }
+        for (int side = 0; side < 2; side++) {
+            for (int x = -23; x <= 23; x++) {
+                for (int iy = 1; iy <= 5; iy++) {
+                    int y = side == 0 ? iy : -iy;
+                    Double gain = HPSEcalConditions.physicalToGain(HPSEcalConditions.makePhysicalID(x, y));
+                    IHistogram1D peSim = pePlotsSim[x + 23][y + 5][0];
+                    IHistogram1D peReal = pePlotsReal[x + 23][y + 5][0];
+                    IHistogram1D peHVSim = pePlotsHVSim[HPSECalUtils.getQuadrant(x, y) - 1][HPSECalUtils.getHVGroup(x, y) - 1];
+                    IHistogram1D peHVReal = pePlotsHVReal[HPSECalUtils.getQuadrant(x, y) - 1][HPSECalUtils.getHVGroup(x, y) - 1];
+                    double weightHVReal = weightsHVReal[HPSECalUtils.getQuadrant(x, y) - 1][HPSECalUtils.getHVGroup(x, y) - 1];
+                    double sumHVReal = sumsHVReal[HPSECalUtils.getQuadrant(x, y) - 1][HPSECalUtils.getHVGroup(x, y) - 1];
+                    double weightHVSim = weightsHVSim[HPSECalUtils.getQuadrant(x, y) - 1][HPSECalUtils.getHVGroup(x, y) - 1];
+                    double sumHVSim = sumsHVSim[HPSECalUtils.getQuadrant(x, y) - 1][HPSECalUtils.getHVGroup(x, y) - 1];
+                    if (gain != null) {
+                        if (weightPlotSim.binHeight(x + 23, y + 5) > minCount && weightPlotReal.binHeight(x + 23, y + 5) > minCount) {
+                            gain *= (corrPlotSim.binHeight(x + 23, y + 5) / corrPlotReal.binHeight(x + 23, y + 5));
+                        } else if (useHVGroups && weightHVReal > 4 * minCount && weightHVSim > 4 * minCount) {
+                            gain *= (weightHVSim / sumHVSim) / (weightHVReal / sumHVReal);
+//                        } else if (weightHVReal / allWeightsReal > 4 * weightHVSim / allWeightsSim) {
+//                            gain /= 1.5;
+//                        } else if (weightHVSim / allWeightsSim > 4 * weightHVReal / allWeightsReal) {
+//                            gain *= 1.5;
+                        }
 //                    if (peSim.allEntries() >= minCount && peReal.allEntries() >= minCount) {
 //                        gain *= (peSim.mean() / peReal.mean());
 //                    } else if (peHVSim.allEntries() >= minCount && peHVReal.allEntries() >= minCount) {
 ////                        gain *= (peHVSim.mean() / peHVReal.mean());
 //                    }
-                    gainStream.format("%d\t%d\t%f\n", x, y, gain);
-                    ecalPlot.fill(x, y, gain);
+                        gainStream.format("%d\t%d\t%f\n", x, y, gain);
+                        ecalPlot.fill(x, y, gain);
 //                    System.out.printf("%d\t%d\t%d\t%f\t%f\n", x, y, pePlotsSim[x + 23][y + 5][0].allEntries(), pePlotsSim[x + 23][y + 5][0].mean(), pePlotsSim[x + 23][y + 5][0].rms());
+                    }
                 }
             }
         }

hps-java/src/main/java/org/lcsim/hps/users/phansson
ECalGainDriver.java 1.10 -> 1.11
diff -u -r1.10 -r1.11
--- ECalGainDriver.java	6 Sep 2012 18:03:10 -0000	1.10
+++ ECalGainDriver.java	8 Sep 2012 00:17:53 -0000	1.11
@@ -329,7 +329,7 @@
             tracks.remove(bestTrk);
             clusters.remove(bestCl);
 
-            if (bestCl != null & bestTrk != null && minDist < 100.0) {
+            if (bestCl != null & bestTrk != null && minDist < 80.0) {
                 if (debug) {
                     int[] pos = getCrystalPair(bestCl);
                     System.out.format("Matched cluster: [%f\t%f\t%f], ix = %d, iy = %d\n", bestCl.getPosition()[2], bestCl.getPosition()[0], bestCl.getPosition()[1], pos[0], pos[1]);

hps-java/src/main/java/org/lcsim/hps/evio
TestRunEvioToLcio.java 1.21 -> 1.22
diff -u -r1.21 -r1.22
--- TestRunEvioToLcio.java	1 Sep 2012 00:15:15 -0000	1.21
+++ TestRunEvioToLcio.java	8 Sep 2012 00:17:54 -0000	1.22
@@ -3,7 +3,6 @@
 import java.io.*;
 
 import java.util.Date;
-import java.util.List;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 import org.apache.commons.cli.CommandLine;
@@ -203,7 +202,7 @@
                         try {
                             reader.parseEvent(evioEvent);
                         } catch (Exception e) {
-                            Logger.getLogger(TestRunEvioToLcio.class.getName()).log(Level.SEVERE, null, e);
+                            Logger.getLogger(TestRunEvioToLcio.class.getName()).log(Level.SEVERE, "Error reading EVIO event", e);
                             continue eventLoop;
                         }
                     }
@@ -257,7 +256,7 @@
                     }
                 } catch (Exception e) {
                     // Catch all event processing errors and continue.
-                    Logger.getLogger(TestRunEvioToLcio.class.getName()).log(Level.SEVERE, null, e);
+                    Logger.getLogger(TestRunEvioToLcio.class.getName()).log(Level.SEVERE, "Error in event processing", e);
                     continue;
                 } finally {
                     if (sleepTime > 0) {

hps-java/src/main/java/org/lcsim/hps/evio
LCSimTestRunEventBuilder.java 1.21 -> 1.22
diff -u -r1.21 -r1.22
--- LCSimTestRunEventBuilder.java	1 Sep 2012 00:15:15 -0000	1.21
+++ LCSimTestRunEventBuilder.java	8 Sep 2012 00:17:54 -0000	1.22
@@ -7,7 +7,6 @@
 import java.util.logging.Logger;
 import org.jlab.coda.jevio.BaseStructure;
 import org.jlab.coda.jevio.EvioEvent;
-import org.jlab.coda.jevio.EvioException;
 import org.lcsim.event.EventHeader;
 import org.lcsim.event.base.BaseLCSimEvent;
 import org.lcsim.geometry.Detector;
@@ -18,7 +17,7 @@
  *
  * @author Sho Uemura <[log in to unmask]>
  * @author Jeremy McCormick <[log in to unmask]>
- * @version $Id: LCSimTestRunEventBuilder.java,v 1.21 2012/09/01 00:15:15 meeg Exp $
+ * @version $Id: LCSimTestRunEventBuilder.java,v 1.22 2012/09/08 00:17:54 meeg Exp $
  */
 public class LCSimTestRunEventBuilder implements LCSimEventBuilder {
 
@@ -101,14 +100,14 @@
         try {
             ecalReader.makeHits(evioEvent, lcsimEvent);
         } catch (Exception e) {
-            Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, null, e);
+            Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, "Error making ECal hits", e);
         }
 
         // Make SVT RawTrackerHits
         try {
             svtReader.makeHits(evioEvent, lcsimEvent);
         } catch (Exception e) {
-            Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, null, e);
+            Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, "Error making SVT hits", e);
         }
 
         return lcsimEvent;

hps-java/src/main/java/org/lcsim/hps/monitoring/svt
TrackingReconstructionPlots.java 1.12 -> 1.13
diff -u -r1.12 -r1.13
--- TrackingReconstructionPlots.java	14 Aug 2012 01:02:07 -0000	1.12
+++ TrackingReconstructionPlots.java	8 Sep 2012 00:17:54 -0000	1.13
@@ -25,7 +25,6 @@
 import org.lcsim.fit.helicaltrack.*;
 import org.lcsim.hps.recon.tracking.*;
 import org.lcsim.hps.recon.tracking.HPSSVTCalibrationConstants.ChannelConstants;
-import org.lcsim.hps.users.omoreno.ExtendTrack;
 
 /**
  *
@@ -81,6 +80,7 @@
     IHistogram1D nTracks;
     HPSShaperFitAlgorithm _shaper = new DumbShaperFit();
 
+    @Override
     protected void detectorChanged(Detector detector) {
         this.detector = detector;
         aida.tree().cd("/");
@@ -603,6 +603,7 @@
         this.trackCollectionName = trackCollectionName;
     }
 
+    @Override
     public void process(EventHeader event) {
         aida.tree().cd("/");
         if (!event.hasCollection(HelicalTrackHit.class, helicalTrackHitCollectionName)) {
@@ -719,9 +720,9 @@
             HelixConverter converter = new HelixConverter(0);
             StraightLineTrack slt = converter.Convert(ht);
 
-            ExtendTrack extend = new ExtendTrack();
+            SvtTrackExtrapolator extend = new SvtTrackExtrapolator();
             extend.setTrack(stEle);
-            Hep3Vector posAtEcal = extend.positionAtEcal();
+            Hep3Vector posAtEcal = extend.getTrackPositionAtEcal();
 
             aida.histogram1D("X (mm) @ Z=-60cm").fill(slt.getYZAtX(zAtConverter)[0]);  //this is y in the tracker frame
             aida.histogram1D("Y (mm) @ Z=-60cm").fill(slt.getYZAtX(zAtConverter)[1]);  //this is z in the tracker frame
@@ -736,11 +737,11 @@
 //            double sECAL = HelixUtils.PathToXPlane(ht, zEcal, 3000, 1).get(0);
 //            Hep3Vector posonhelix = HelixUtils.PointOnHelix(ht, sECAL);//position in tracker coordinates!
 
-            aida.histogram1D("X (mm) @ ECAL").fill(posAtEcal.y());
-            aida.histogram1D("Y (mm) @ ECAL").fill(posAtEcal.z());
+            aida.histogram1D("X (mm) @ ECAL").fill(posAtEcal.x());
+            aida.histogram1D("Y (mm) @ ECAL").fill(posAtEcal.y());
             if (trk.getPX() > 1.0) {
-                aida.histogram1D("X (mm) @ ECAL (Pz>1)").fill(posAtEcal.y());
-                aida.histogram1D("Y (mm) @ ECAL (Pz>1)").fill(posAtEcal.z());
+                aida.histogram1D("X (mm) @ ECAL (Pz>1)").fill(posAtEcal.x());
+                aida.histogram1D("Y (mm) @ ECAL (Pz>1)").fill(posAtEcal.y());
             }
             aida.histogram1D("d0 ").fill(trk.getTrackParameter(ParameterName.d0.ordinal()));
             aida.histogram1D("sinphi ").fill(Math.sin(trk.getTrackParameter(ParameterName.phi0.ordinal())));
@@ -865,33 +866,33 @@
 
                 aida.histogram2D("Energy Vs Momentum").fill(clust.getEnergy(), trk.getPX() * 1000.0);
                 aida.histogram1D("Energy Over Momentum").fill(clust.getEnergy() / (trk.getPX() * 1000.0));
-                aida.histogram1D("deltaX").fill(clust.getPosition()[0] - posAtEcal.y());
-                aida.histogram1D("deltaY").fill(clust.getPosition()[1] - posAtEcal.z());
+                aida.histogram1D("deltaX").fill(clust.getPosition()[0] - posAtEcal.x());
+                aida.histogram1D("deltaY").fill(clust.getPosition()[1] - posAtEcal.y());
 //                if (trk.getPX() > 1.0) {
 //                    aida.histogram1D("deltaX (Pz>1)").fill(clust.getPosition()[0] - posAtEcal.y());
 //                    aida.histogram1D("deltaY (Pz>1)").fill(clust.getPosition()[1] - posAtEcal.z());
 //                }
-                aida.histogram2D("X ECal Vs Track").fill(clust.getPosition()[0], posAtEcal.y());
-                aida.histogram2D("Y ECal Vs Track").fill(clust.getPosition()[1], posAtEcal.z());
+                aida.histogram2D("X ECal Vs Track").fill(clust.getPosition()[0], posAtEcal.x());
+                aida.histogram2D("Y ECal Vs Track").fill(clust.getPosition()[1], posAtEcal.y());
                 if (isTop == 0) {
                     aida.histogram2D("Top Energy Vs Momentum").fill(clust.getEnergy(), trk.getPX() * 1000.0);
 //                    aida.histogram2D("Top Energy Vs Momentum").fill(posAtEcal.y(), trk.getPX() * 1000.0);
                     aida.histogram1D("Top Energy Over Momentum").fill(clust.getEnergy() / (trk.getPX() * 1000.0));
-                    aida.histogram1D("Top deltaX").fill(clust.getPosition()[0] - posAtEcal.y());
-                    aida.histogram1D("Top deltaY").fill(clust.getPosition()[1] - posAtEcal.z());
-                    aida.histogram2D("Top deltaX vs X").fill(clust.getPosition()[0],clust.getPosition()[0] - posAtEcal.y());
-                    aida.histogram2D("Top deltaY vs Y").fill(clust.getPosition()[1],clust.getPosition()[1] - posAtEcal.z());
-                    aida.histogram2D("Top X ECal Vs Track").fill(clust.getPosition()[0], posAtEcal.y());
-                    aida.histogram2D("Top Y ECal Vs Track").fill(clust.getPosition()[1], posAtEcal.z());
+                    aida.histogram1D("Top deltaX").fill(clust.getPosition()[0] - posAtEcal.x());
+                    aida.histogram1D("Top deltaY").fill(clust.getPosition()[1] - posAtEcal.y());
+                    aida.histogram2D("Top deltaX vs X").fill(clust.getPosition()[0],clust.getPosition()[0] - posAtEcal.x());
+                    aida.histogram2D("Top deltaY vs Y").fill(clust.getPosition()[1],clust.getPosition()[1] - posAtEcal.y());
+                    aida.histogram2D("Top X ECal Vs Track").fill(clust.getPosition()[0], posAtEcal.x());
+                    aida.histogram2D("Top Y ECal Vs Track").fill(clust.getPosition()[1], posAtEcal.y());
                 } else {
                     aida.histogram2D("Bottom Energy Vs Momentum").fill(clust.getEnergy(), trk.getPX() * 1000.0);
                     aida.histogram1D("Bottom Energy Over Momentum").fill(clust.getEnergy() / (trk.getPX() * 1000.0));
-                    aida.histogram1D("Bottom deltaX").fill(clust.getPosition()[0] - posAtEcal.y());
-                    aida.histogram1D("Bottom deltaY").fill(clust.getPosition()[1] - posAtEcal.z());
-                    aida.histogram2D("Bottom deltaX vs X").fill(clust.getPosition()[0],clust.getPosition()[0] - posAtEcal.y());
-                    aida.histogram2D("Bottom deltaY vs Y").fill(clust.getPosition()[1],clust.getPosition()[1] - posAtEcal.z());
-                    aida.histogram2D("Bottom X ECal Vs Track").fill(clust.getPosition()[0], posAtEcal.y());
-                    aida.histogram2D("Bottom Y ECal Vs Track").fill(clust.getPosition()[1], posAtEcal.z());
+                    aida.histogram1D("Bottom deltaX").fill(clust.getPosition()[0] - posAtEcal.x());
+                    aida.histogram1D("Bottom deltaY").fill(clust.getPosition()[1] - posAtEcal.y());
+                    aida.histogram2D("Bottom deltaX vs X").fill(clust.getPosition()[0],clust.getPosition()[0] - posAtEcal.x());
+                    aida.histogram2D("Bottom deltaY vs Y").fill(clust.getPosition()[1],clust.getPosition()[1] - posAtEcal.y());
+                    aida.histogram2D("Bottom X ECal Vs Track").fill(clust.getPosition()[0], posAtEcal.x());
+                    aida.histogram2D("Bottom Y ECal Vs Track").fill(clust.getPosition()[1], posAtEcal.y());
                 }
 
             }
@@ -955,13 +956,13 @@
             }
 
 
-            if (side != "") {
+            if (!"".equals(side)) {
                 String s;
                 if (stripCluster.getPosition()[1] >= 0.0)
                     s = "up";
                 else
                     s = "down";
-                if (s != side)
+                if (!s.equals(side))
                     continue;
             }
 
@@ -995,6 +996,7 @@
         return n;
     }
 
+    @Override
     public void endOfData() {
         if (outputPlots != null)
             try {
@@ -1013,8 +1015,8 @@
         for (HPSEcalCluster cluster : clusters) {
             double[] clPos = cluster.getPosition();
             double clEne = cluster.getEnergy();
-//            double dist = Math.sqrt(Math.pow(clPos[0] - posonhelix.y(), 2) + Math.pow(clPos[1] - posonhelix.z(), 2)); //coordinates!!!
-            double dist = Math.sqrt(Math.pow(clPos[1] - posonhelix.z(), 2)); //coordinates!!!
+            double dist = Math.sqrt(Math.pow(clPos[0] - posonhelix.x(), 2) + Math.pow(clPos[1] - posonhelix.y(), 2)); //coordinates!!!
+//            double dist = Math.sqrt(Math.pow(clPos[1] - posonhelix.z(), 2)); //coordinates!!!
             if (dist < minDist && clEne > 50) {
                 closest = cluster;
                 minDist = dist;

hps-java/src/main/java/org/lcsim/hps/monitoring/ecal
TriggerPlots.java 1.7 -> 1.8
diff -u -r1.7 -r1.8
--- TriggerPlots.java	31 Aug 2012 01:23:22 -0000	1.7
+++ TriggerPlots.java	8 Sep 2012 00:17:54 -0000	1.8
@@ -19,7 +19,7 @@
 
 public class TriggerPlots extends Driver implements Resettable, Redrawable {
 
-    int eventRefreshRate = 1;
+    int eventRefreshRate = 10000;
     int eventn = 0;
     AIDAFrame plotterFrame;
     String inputCollection = "EcalCalHits";
@@ -73,9 +73,9 @@
         botTrigTimePlot = aida.histogram1D(detector.getDetectorName() + " : " + inputCollection + " : Trigger Time, Bottom", 32, 0, 32);
         orTrigTimePlot = aida.histogram1D(detector.getDetectorName() + " : " + inputCollection + " : Trigger Time, Or", 32, 0, 32);
 
-        topTimePlot2D = aida.histogram2D(detector.getDetectorName() + " : " + inputCollection + " : Hit Time vs. Trig Time, Top", 101, -4.0, 100 * 4.0, 33, -1, 32);
-        botTimePlot2D = aida.histogram2D(detector.getDetectorName() + " : " + inputCollection + " : Hit Time vs. Trig Time, Bottom", 101, -4.0, 100 * 4.0, 33, -1, 32);
-        orTimePlot2D = aida.histogram2D(detector.getDetectorName() + " : " + inputCollection + " : Hit Time vs. Trig Time, Or", 101, -4.0, 100 * 4.0, 33, -1, 32);
+        topTimePlot2D = aida.histogram2D(detector.getDetectorName() + " : " + inputCollection + " : Hit Time vs. Trig Time, Top", 101, -4.0, 100 * 4.0, 33, -1 * 4.0, 32 * 4.0);
+        botTimePlot2D = aida.histogram2D(detector.getDetectorName() + " : " + inputCollection + " : Hit Time vs. Trig Time, Bottom", 101, -4.0, 100 * 4.0, 33, -1 * 4.0, 32 * 4.0);
+        orTimePlot2D = aida.histogram2D(detector.getDetectorName() + " : " + inputCollection + " : Hit Time vs. Trig Time, Or", 101, -4.0, 100 * 4.0, 33, -1 * 4.0, 32 * 4.0);
 
         // Create the plotter regions.
         plotter.region(0).plot(topHitTimePlot);
@@ -120,9 +120,9 @@
         botClusTimePlot = aida.histogram1D(detector.getDetectorName() + " : " + clusterCollection + " : First Cluster Time, Bottom", 100, 0, 100 * 4.0);
         orClusTimePlot = aida.histogram1D(detector.getDetectorName() + " : " + clusterCollection + " : First Cluster Time, Or", 100, 0, 100 * 4.0);
 
-        topClusTime2D = aida.histogram2D(detector.getDetectorName() + " : " + clusterCollection + " : Cluster Time vs. Trig Time, Top", 101, -4.0, 100 * 4.0, 33, -1, 32);
-        botClusTime2D = aida.histogram2D(detector.getDetectorName() + " : " + clusterCollection + " : Cluster Time vs. Trig Time, Bottom", 101, -4.0, 100 * 4.0, 33, -1, 32);
-        orClusTime2D = aida.histogram2D(detector.getDetectorName() + " : " + clusterCollection + " : Cluster Time vs. Trig Time, Or", 101, -4.0, 100 * 4.0, 33, -1, 32);
+        topClusTime2D = aida.histogram2D(detector.getDetectorName() + " : " + clusterCollection + " : Cluster Time vs. Trig Time, Top", 101, -4.0, 100 * 4.0, 33, -1 * 4.0, 32 * 4.0);
+        botClusTime2D = aida.histogram2D(detector.getDetectorName() + " : " + clusterCollection + " : Cluster Time vs. Trig Time, Bottom", 101, -4.0, 100 * 4.0, 33, -1 * 4.0, 32 * 4.0);
+        orClusTime2D = aida.histogram2D(detector.getDetectorName() + " : " + clusterCollection + " : Cluster Time vs. Trig Time, Or", 101, -4.0, 100 * 4.0, 33, -1 * 4.0, 32 * 4.0);
 
         topClusTimeDiff = aida.histogram1D(detector.getDetectorName() + " : " + clusterCollection + " : Cluster Time - Trig Time, Top", 200, -100 * 4.0, 100 * 4.0);
         botClusTimeDiff = aida.histogram1D(detector.getDetectorName() + " : " + clusterCollection + " : Cluster Time - Trig Time, Bottom", 200, -100 * 4.0, 100 * 4.0);
@@ -182,13 +182,15 @@
         plotter5.style().dataStyle().errorBarStyle().setVisible(false);
         plotter5.createRegions(3, 3);
 
+        double plotEnergyRange = 5 * clusterEnergyCut;
+
         toptrig_cl_ecal_n_tag = aida.histogram1D("toptrig_cl_ecal_n_tag", 7, 0, 7);
-        toptrig_cl_ecal_e_probe = aida.histogram1D("toptrig_cl_ecal_e_probe", 200, 0, 10000);
-        toptrigtag_cl_ecal_e_probe = aida.histogram1D("toptrigtag_cl_ecal_e_probe", 200, 0, 10000);
-        toptrig_cl_ecal_e_tag = aida.histogram1D("toptrig_cl_ecal_e_tag", 200, 0, 10000);
-        toptrig_cl_ecal_e_probe_trig = aida.histogram1D("toptrig_cl_ecal_e_probe_trig", 200, 0, 10000);
-        toptrigtag_cl_ecal_e_probe_trig = aida.histogram1D("toptrigtag_cl_ecal_e_probe_trig", 200, 0, 10000);
-        toptrig_cl_ecal_emax_tag = aida.histogram1D("toptrig_cl_ecal_emax_tag", 200, 0, 10000);
+        toptrig_cl_ecal_e_probe = aida.histogram1D("toptrig_cl_ecal_e_probe", 200, 0, plotEnergyRange);
+        toptrigtag_cl_ecal_e_probe = aida.histogram1D("toptrigtag_cl_ecal_e_probe", 200, 0, plotEnergyRange);
+        toptrig_cl_ecal_e_tag = aida.histogram1D("toptrig_cl_ecal_e_tag", 200, 0, plotEnergyRange);
+        toptrig_cl_ecal_e_probe_trig = aida.histogram1D("toptrig_cl_ecal_e_probe_trig", 200, 0, plotEnergyRange);
+        toptrigtag_cl_ecal_e_probe_trig = aida.histogram1D("toptrigtag_cl_ecal_e_probe_trig", 200, 0, plotEnergyRange);
+        toptrig_cl_ecal_emax_tag = aida.histogram1D("toptrig_cl_ecal_emax_tag", 200, 0, plotEnergyRange);
         plotter5.region(0).plot(toptrig_cl_ecal_n_tag);
         plotter5.region(1).plot(toptrig_cl_ecal_e_probe);
         plotter5.region(2).plot(toptrigtag_cl_ecal_e_probe);
@@ -204,12 +206,12 @@
         plotter6.createRegions(3, 3);
 
         bottrig_cl_ecal_n_tag = aida.histogram1D("bottrig_cl_ecal_n_tag", 7, 0, 7);
-        bottrig_cl_ecal_e_probe = aida.histogram1D("bottrig_cl_ecal_e_probe", 200, 0, 10000);
-        bottrigtag_cl_ecal_e_probe = aida.histogram1D("bottrigtag_cl_ecal_e_probe", 200, 0, 10000);
-        bottrig_cl_ecal_e_tag = aida.histogram1D("bottrig_cl_ecal_e_tag", 200, 0, 10000);
-        bottrig_cl_ecal_e_probe_trig = aida.histogram1D("bottrig_cl_ecal_e_probe_trig", 200, 0, 10000);
-        bottrigtag_cl_ecal_e_probe_trig = aida.histogram1D("bottrigtag_cl_ecal_e_probe_trig", 200, 0, 10000);
-        bottrig_cl_ecal_emax_tag = aida.histogram1D("bottrig_cl_ecal_emax_tag", 200, 0, 10000);
+        bottrig_cl_ecal_e_probe = aida.histogram1D("bottrig_cl_ecal_e_probe", 200, 0, plotEnergyRange);
+        bottrigtag_cl_ecal_e_probe = aida.histogram1D("bottrigtag_cl_ecal_e_probe", 200, 0, plotEnergyRange);
+        bottrig_cl_ecal_e_tag = aida.histogram1D("bottrig_cl_ecal_e_tag", 200, 0, plotEnergyRange);
+        bottrig_cl_ecal_e_probe_trig = aida.histogram1D("bottrig_cl_ecal_e_probe_trig", 200, 0, plotEnergyRange);
+        bottrigtag_cl_ecal_e_probe_trig = aida.histogram1D("bottrigtag_cl_ecal_e_probe_trig", 200, 0, plotEnergyRange);
+        bottrig_cl_ecal_emax_tag = aida.histogram1D("bottrig_cl_ecal_emax_tag", 200, 0, plotEnergyRange);
         plotter6.region(0).plot(bottrig_cl_ecal_n_tag);
         plotter6.region(1).plot(bottrig_cl_ecal_e_probe);
         plotter6.region(2).plot(bottrigtag_cl_ecal_e_probe);
@@ -291,15 +293,15 @@
             }
             if (orTime != Double.POSITIVE_INFINITY) {
                 orHitTimePlot.fill(orTime);
-                orTimePlot2D.fill(orTime, orTrigTime);
+                orTimePlot2D.fill(orTime, 4.0 * orTrigTime);
             }
             if (topTime != Double.POSITIVE_INFINITY) {
                 topHitTimePlot.fill(topTime);
-                topTimePlot2D.fill(topTime, topTrigTime);
+                topTimePlot2D.fill(topTime, 4.0 * topTrigTime);
             }
             if (botTime != Double.POSITIVE_INFINITY) {
                 botHitTimePlot.fill(botTime);
-                botTimePlot2D.fill(botTime, botTrigTime);
+                botTimePlot2D.fill(botTime, 4.0 * botTrigTime);
             }
         }
 
@@ -356,21 +358,21 @@
             }
             if (orTime >= 0 || orTrigTime >= 0) {
                 orClusTimePlot.fill(orTime);
-                orClusTime2D.fill(orTime, orTrigTime);
+                orClusTime2D.fill(orTime, 4.0 * orTrigTime);
                 if (orTime >= 0 || orTrigTime >= 0) {
                     orClusTimeDiff.fill(orTime - orTrigTime * 4.0);
                 }
             }
             if (topTime >= 0 || topTrigTime >= 0) {
                 topClusTimePlot.fill(topTime);
-                topClusTime2D.fill(topTime, topTrigTime);
+                topClusTime2D.fill(topTime, 4.0 * topTrigTime);
                 if (topTime >= 0 || topTrigTime >= 0) {
                     topClusTimeDiff.fill(topTime - topTrigTime * 4.0);
                 }
             }
             if (botTime >= 0 || botTrigTime >= 0) {
                 botClusTimePlot.fill(botTime);
-                botClusTime2D.fill(botTime, botTrigTime);
+                botClusTime2D.fill(botTime, 4.0 * botTrigTime);
                 if (botTime >= 0 || botTrigTime >= 0) {
                     botClusTimeDiff.fill(botTime - botTrigTime * 4.0);
                 }
@@ -455,17 +457,17 @@
                     }
                 } //tag found
             }//topTrigger
-            
+
             if (botTrig != 0) {
 
                 //Find the tag
                 double Etag = -999999.9;
-                HPSEcalCluster cl_tag = null; //highest-E cluster in top half
+                HPSEcalCluster cl_tag = null; //highest-E cluster in bottom half
                 int nTag = 0; //num. clusters in top half
 
                 //Find a probe
                 double Eprobe = -999999.9;
-                HPSEcalCluster cl_probe = null; //highest-E cluster in bottom half
+                HPSEcalCluster cl_probe = null; //highest-E cluster in top half
                 int nProbe = 0; //num. clusters in bottom half
 
                 for (HPSEcalCluster cl : clusters) {
@@ -544,18 +546,22 @@
 
     @Override
     public void redraw() {
-        IHistogram1D heffTop = aida.histogramFactory().divide("turn-on: top tag", toptrig_cl_ecal_e_probe_trig, toptrig_cl_ecal_e_probe);
+        IHistogram1D heffTop = aida.histogramFactory().divide("bottom turn-on: top tag", toptrig_cl_ecal_e_probe_trig, toptrig_cl_ecal_e_probe);
         plotter5.region(7).clear();
+        plotter5.region(7).style().statisticsBoxStyle().setVisible(false);
         plotter5.region(7).plot(heffTop);
-        IHistogram1D heffTop2 = aida.histogramFactory().divide("turn-on: top tag > " + 2.0 * clusterEnergyCut, toptrigtag_cl_ecal_e_probe_trig, toptrigtag_cl_ecal_e_probe);
+        IHistogram1D heffTop2 = aida.histogramFactory().divide("bottom turn-on: top tag > " + 2.0 * clusterEnergyCut, toptrigtag_cl_ecal_e_probe_trig, toptrigtag_cl_ecal_e_probe);
         plotter5.region(8).clear();
+        plotter5.region(8).style().statisticsBoxStyle().setVisible(false);
         plotter5.region(8).plot(heffTop2);
 
-        IHistogram1D heffBot = aida.histogramFactory().divide("turn-on: bottom tag", bottrig_cl_ecal_e_probe_trig, bottrig_cl_ecal_e_probe);
+        IHistogram1D heffBot = aida.histogramFactory().divide("top turn-on: bottom tag", bottrig_cl_ecal_e_probe_trig, bottrig_cl_ecal_e_probe);
         plotter6.region(7).clear();
+        plotter6.region(7).style().statisticsBoxStyle().setVisible(false);
         plotter6.region(7).plot(heffBot);
-        IHistogram1D heffBot2 = aida.histogramFactory().divide("turn-on: bottom tag > " + 2.0 * clusterEnergyCut, bottrigtag_cl_ecal_e_probe_trig, bottrigtag_cl_ecal_e_probe);
+        IHistogram1D heffBot2 = aida.histogramFactory().divide("top turn-on: bottom tag > " + 2.0 * clusterEnergyCut, bottrigtag_cl_ecal_e_probe_trig, bottrigtag_cl_ecal_e_probe);
         plotter6.region(8).clear();
+        plotter6.region(8).style().statisticsBoxStyle().setVisible(false);
         plotter6.region(8).plot(heffBot2);
     }
 

hps-java/src/main/java/org/lcsim/hps/monitoring/ecal
EcalEvsX.java 1.8 -> 1.9
diff -u -r1.8 -r1.9
--- EcalEvsX.java	31 Aug 2012 01:32:09 -0000	1.8
+++ EcalEvsX.java	8 Sep 2012 00:17:54 -0000	1.9
@@ -51,8 +51,8 @@
 
         // Setup plots.
         aida.tree().cd("/");
-//        EvsXPlot = aida.histogram2D(detector.getDetectorName() + " : " + inputCollection + " : E vs X", 50, -350.0, 350.0, 200, -100, 2000);
-        EvsXPlot = aida.histogram2D(detector.getDetectorName() + " : " + inputCollection + " : E vs X", 50, -350.0, 350.0, 100, 0, 2000);
+//        EvsXPlot = aida.histogram2D(detector.getDetectorName() + " : " + inputCollection + " : E vs X", 50, -350.0, 400.0, 100, -2000, 2000);
+        EvsXPlot = aida.histogram2D(detector.getDetectorName() + " : " + inputCollection + " : E vs X", 50, -350.0, 400.0, 100, 0, 2000);
         invMassPlot = aida.histogram1D(detector.getDetectorName() + " : " + inputCollection + " : Photon Pair Mass", 100, 0.0, 250.0);
         clusterPairEnergyPlot = aida.histogram2D(detector.getDetectorName() + " : " + inputCollection + " : Cluster Pair Energies", 1000, -100, 2000, 1000, -100, 2000);
         clusterPairPositionPlot = aida.histogram2D(detector.getDetectorName() + " : " + inputCollection + " : Cluster Pair Positions", 50, -350, 350, 50, -350, 350);
@@ -119,7 +119,8 @@
 //            if (left && right) {
 //            if (goodClusters.size()>1) {
 //                for (Cluster cluster : goodClusters) {
-            for (Cluster cluster : clusters) {
+            for (Cluster cluster : goodClusters) {
+//                EvsXPlot.fill(cluster.getPosition()[0], Math.signum(cluster.getPosition()[1])*cluster.getEnergy());
                 EvsXPlot.fill(cluster.getPosition()[0], cluster.getEnergy());
             }
 //            }

hps-java/src/main/java/org/lcsim/hps/monitoring
DefaultEtEventProcessor.java 1.9 -> 1.10
diff -u -r1.9 -r1.10
--- DefaultEtEventProcessor.java	10 May 2012 23:07:43 -0000	1.9
+++ DefaultEtEventProcessor.java	8 Sep 2012 00:17:54 -0000	1.10
@@ -26,10 +26,10 @@
  * having a direct reference to the actual application.
  * 
  * @author Jeremy McCormick <[log in to unmask]>
- * @version $Id: DefaultEtEventProcessor.java,v 1.9 2012/05/10 23:07:43 jeremy Exp $
+ * @version $Id: DefaultEtEventProcessor.java,v 1.10 2012/09/08 00:17:54 meeg Exp $
  */
-public class DefaultEtEventProcessor implements EtEventProcessor
-{
+public class DefaultEtEventProcessor implements EtEventProcessor {
+
     private int maxEvents;
     private int eventsProcessed;
     private int errorEvents;
@@ -37,13 +37,13 @@
     private JobControlManager jobManager;
     private EtConnection et;
     private List<EtEventListener> listeners = new ArrayList<EtEventListener>();
-    private int status;    
+    private int status;
     private volatile boolean stopProcessing;
     private volatile boolean nextEvents;
     private volatile boolean stopOnError;
     private volatile boolean pauseMode = false;
     private volatile boolean done = false;
-    private volatile boolean blocked = false; 
+    private volatile boolean blocked = false;
     private static Logger logger;
 
     /**
@@ -56,13 +56,13 @@
      * @param logHandler The log handler for redirecting log messages.
      */
     DefaultEtEventProcessor(
-            EtConnection et, 
-            LCSimEventBuilder eventBuilder, 
-            JobControlManager jobManager, 
-            int maxEvents, 
+            EtConnection et,
+            LCSimEventBuilder eventBuilder,
+            JobControlManager jobManager,
+            int maxEvents,
             boolean stopOnError,
             Handler logHandler) {
-        
+
         // Set class parameters.
         this.et = et;
         this.eventBuilder = eventBuilder;
@@ -76,12 +76,12 @@
             logger.setUseParentHandlers(false);
             logger.addHandler(logHandler);
             logger.setLevel(Level.ALL);
-        }   
-        
+        }
+
         // Log an initialization message.
         logger.log(Level.CONFIG, "Event processor initialized successfully.");
     }
-    
+
     /**
      * Enable pause mode to pause between single events.
      * @param p True to pause after each set of events; false to do real-time processing.
@@ -89,70 +89,70 @@
     void setPauseMode(boolean p) {
         this.pauseMode = p;
     }
-        
+
     public void addListener(EtEventListener callme) {
         listeners.add(callme);
     }
-    
+
     public void setMaxEvents(int maxEvents) {
         this.maxEvents = maxEvents;
-        logger.log(Level.INFO, "Set maxEvents to <" + maxEvents + ">.");
+        logger.log(Level.INFO, "Set maxEvents to <{0}>.", maxEvents);
     }
-    
+
     private void begin() {
         for (EtEventListener listener : listeners) {
             listener.begin();
         }
     }
-    
+
     private void startOfEvent() {
         for (EtEventListener listener : listeners) {
             listener.startOfEvent();
         }
     }
-    
+
     private void endOfEvent() {
         for (EtEventListener listener : listeners) {
             listener.endOfEvent();
         }
     }
-    
+
     private void errorOnEvent() {
         ++errorEvents;
         for (EtEventListener listener : listeners) {
             listener.errorOnEvent();
         }
     }
-    
+
     private void finish() {
         logger.log(Level.FINER, "Calling finish() methods of listeners.");
         for (EtEventListener listener : listeners) {
             listener.finish();
         }
     }
-    
+
     public void stop() {
         this.stopProcessing = true;
         logger.log(Level.FINEST, "Received stop request.");
     }
-       
+
     public int getNumberOfEventsProcessed() {
         return eventsProcessed;
     }
-    
+
     public int getNumberOfErrors() {
         return errorEvents;
     }
-    
+
     public int getMaxEvents() {
         return maxEvents;
     }
-    
+
     public void resetNumberOfEventsProcessed() {
         eventsProcessed = 0;
         errorEvents = 0;
     }
-    
+
     public int getStatus() {
         return status;
     }
@@ -172,7 +172,7 @@
 
         // Loop over retrieved EtEvents.
         for (EtEvent mev : mevs) {
-            
+
             // If running in pause mode, then hold here until the "Next Event" button is pressed.
             if (pauseMode && this.status == ConnectionStatus.CONNECTED) {
                 logger.log(Level.FINEST, "Pausing until next events requested.");
@@ -181,26 +181,25 @@
                         logger.log(Level.FINEST, "User requested next set of events.");
                         nextEvents = false;
                         break;
-                    }
-                    else if (stopProcessing) {
+                    } else if (stopProcessing) {
                         logger.log(Level.FINEST, "Stop was requested in inner event processing loop.");
                         break;
                     }
                 }
             }
-            
+
             // Got an external request to stop processing.  Break out of loop.
-            if (stopProcessing)
+            if (stopProcessing) {
                 break;
-            
+            }
+
             // Process a single EtEvent using the default processing chain.
             try {
                 processEtEvent(mev);
-            }
-            // Catch event processing errors, including ET -> EVIO, EVIO -> LCIO, and LCSim Driver execution.
-            catch (EventProcessingException e) {               
+            } // Catch event processing errors, including ET -> EVIO, EVIO -> LCIO, and LCSim Driver execution.
+            catch (EventProcessingException e) {
                 e.getCause().printStackTrace(); // This message shows up in detailed job log.
-                logger.log(Level.WARNING, "Error processing event <" + this.eventsProcessed + ">.");
+                logger.log(Level.WARNING, "Error processing event <{0}>.", this.eventsProcessed);
                 errorOnEvent();
                 if (stopOnError) {
                     this.status = ConnectionStatus.ERROR;
@@ -212,7 +211,7 @@
     }
 
     public void processEtEvent(EtEvent mev) throws EventProcessingException, MaxEventsException {
-        
+
         // Check if max events was reached or exceeded.
         if (maxEvents != -1 && eventsProcessed >= maxEvents) {
             throw new MaxEventsException();
@@ -230,17 +229,17 @@
             // Create EvioEvent from EtEvent.
             try {
                 evioEvent = createEvioEvent(mev);
-                
+                //let event builder check for run information
+                eventBuilder.readEvioEvent(evioEvent);
+
                 // Handlers for non-physics events.
                 if (isPreStartEvent(evioEvent)) {
                     preStartEvent(evioEvent);
-                }
-                else if (isEndEvent(evioEvent)) {
+                } else if (isEndEvent(evioEvent)) {
                     endRun(evioEvent);
                 }
-                
-            }
-            catch (Exception e) {
+
+            } catch (Exception e) {
                 throw new EventProcessingException("Failed to create EVIO event.", e);
             }
 
@@ -250,16 +249,14 @@
         EventHeader lcsimEvent = null;
         try {
             lcsimEvent = eventBuilder.makeLCSimEvent(evioEvent);
-        } 
-        catch (Exception e) {
+        } catch (Exception e) {
             throw new EventProcessingException("Failed to create LCSim event.", e);
         }
 
         // Process the LCSim event.
         try {
             jobManager.processEvent(lcsimEvent);
-        }
-        catch (Exception e) {
+        } catch (Exception e) {
             throw new EventProcessingException("Error processing the LCSim event.", e);
         }
 
@@ -278,26 +275,26 @@
     private static final EvioEvent createEvioEvent(EtEvent etEvent) throws IOException, EvioException, BufferUnderflowException {
         return (new EvioReader(etEvent.getDataBuffer())).parseNextEvent();
     }
-    
+
     /**
      * Run the event processing from the ET connection.
      */
     public void process() {
-                        
+
         // Set current status to connected.
         this.status = ConnectionStatus.CONNECTED;
-        
+
         // Clear any leftover stop request before starting, just in case.
         stopProcessing = false;
-        
+
         // A new job is starting so this flag gets reset.        
         done = false;
-        
+
         // Notify listeners of job start.
         begin();
-        
+
         // Loop until fatal error or stop flag is changed to true.
-        while (true) { 
+        while (true) {
 
             // Got a request to stop processing.
             if (stopProcessing) {
@@ -305,27 +302,23 @@
                 this.status = ConnectionStatus.DISCONNECT_REQUESTED;
                 break;
             }
-            
+
             // Try to process the next set of ET events.
             try {
                 processEtEvents();
-            } 
-            // The ET system timed out in the getEvents() method.
+            } // The ET system timed out in the getEvents() method.
             catch (EtTimeoutException e) {
                 logger.log(Level.WARNING, "ET connection timed out.");
-                this.status = ConnectionStatus.TIMED_OUT; 
-            }
-            // Event processing reached the maximum number of events.
+                this.status = ConnectionStatus.TIMED_OUT;
+            } // Event processing reached the maximum number of events.
             catch (MaxEventsException e) {
-                logger.log(Level.INFO, "Reached max events <" + this.maxEvents + ">.");
-                this.status = ConnectionStatus.DISCONNECTING; 
-            }
-            // Some generic error was thrown.  These are most likely ET system exceptions.
+                logger.log(Level.INFO, "Reached max events <{0}>.", this.maxEvents);
+                this.status = ConnectionStatus.DISCONNECTING;
+            } // Some generic error was thrown.  These are most likely ET system exceptions.
             catch (Exception e) {
                 e.printStackTrace();
                 this.status = ConnectionStatus.ERROR;
-            }
-            // Break out of processing loop if not still in connected state.
+            } // Break out of processing loop if not still in connected state.
             finally {
                 if (this.status != ConnectionStatus.CONNECTED) {
                     break;
@@ -333,16 +326,16 @@
             }
             logger.getHandlers()[0].flush();
         }
-        
+
         logger.log(Level.FINEST, "End of processing loop.  About to cleanup.");
         logger.getHandlers()[0].flush();
-        
+
         // Notify listeners of job end.
         finish();
-        
+
         done = true;
     }
-    
+
     /**
      * Check if this event is a Pre Start Event.
      * @param event
@@ -351,7 +344,7 @@
     private static boolean isPreStartEvent(EvioEvent event) {
         return event.getHeader().getTag() == EventConstants.PRESTART_EVENT_TAG;
     }
-    
+
     /**
      * Check if this event is an End Event.
      * @param event
@@ -360,7 +353,7 @@
     private static boolean isEndEvent(EvioEvent event) {
         return event.getHeader().getTag() == EventConstants.END_EVENT_TAG;
     }
-    
+
     /**
      * Notify listeners of Pre Start event being received by ET system.
      * @param event The EvioEvent for the Pre Start.
@@ -373,7 +366,7 @@
             listener.prestart(seconds, runNumber);
         }
     }
-    
+
     /**
      * Notify listeners of end of run being received by ET system.
      * @param event The EvioEvent for the End Event record, which indicates end of run.
@@ -386,23 +379,23 @@
             listener.endRun(seconds, nevents);
         }
     }
-      
+
     public void pauseMode(boolean p) {
         pauseMode = p;
     }
-    
+
     public void nextEvents() {
         nextEvents = true;
     }
-    
+
     public void setLogLevel(Level level) {
         logger.setLevel(level);
     }
-    
+
     public boolean blocked() {
         return blocked;
     }
-    
+
     public boolean done() {
         return done;
     }
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