Commit in SlicDiagnostics/src/org/lcsim/slic/diagnostics on MAIN
GenericHitPlots.java+32-21.35 -> 1.36
JM: Add min and max layer number plots

SlicDiagnostics/src/org/lcsim/slic/diagnostics
GenericHitPlots.java 1.35 -> 1.36
diff -u -r1.35 -r1.36
--- GenericHitPlots.java	1 Apr 2006 00:00:01 -0000	1.35
+++ GenericHitPlots.java	11 Apr 2006 21:53:05 -0000	1.36
@@ -24,7 +24,7 @@
  * creates a set of plots for each layer in the subdetector.
  * 
  * @author jeremym
- * @version $Id: GenericHitPlots.java,v 1.35 2006/04/01 00:00:01 jeremy Exp $
+ * @version $Id: GenericHitPlots.java,v 1.36 2006/04/11 21:53:05 jeremy Exp $
  */
 class GenericHitPlots extends AbstractPlots
 {
@@ -80,9 +80,11 @@
     IHistogram1D _layerAvgTotNHits;
     IHistogram1D _layerCumE;
     IHistogram1D _layerCumNHits;
+    ICloud1D _layerMax;
+    ICloud1D _layerMin;
     ICloud1D _hitDepth;
     ICloud1D _maxTime;
-    ICloud1D _minTime;
+    ICloud1D _minTime;    
 
     Subdetector _detector;
 
@@ -155,6 +157,14 @@
         _layerCumNHits = aida().histogram1D("Layer: Cumulative Number of Hits", _nlayers, 0, _nlayers);
         _layerCumNHits.annotation().addItem("xAxisLabel", "Layer Number");
         _layerCumNHits.annotation().addItem("yAxisLabel", "Fraction of Total Number of Hits");
+        
+        _layerMax = aida().cloud1D("Layer: Max Layer Number");
+        _layerMax.annotation().addItem("xAxisLabel", "Layer Number");
+        _layerMax.annotation().addItem("yAxisLabel", "Number of Events");
+        
+        _layerMin = aida().cloud1D("Layer: Min Layer Number");
+        _layerMin.annotation().addItem("xAxisLabel", "Layer Number");
+        _layerMin.annotation().addItem("yAxisLabel", "Number of Events");
 
         _layerEnergy = aida().histogram1D("Hit: Weighted Energy by Layer Number", _nlayers, 0, _nlayers);
         _layerEnergy.annotation().addItem("xAxisLabel", "Layer Number");
@@ -485,6 +495,8 @@
         double maxR = 0;
         double minTime = 9999.0;
         double maxTime = 0;
+        int maxLayer = 0;
+        int minLayer = 999;
 
         // Loop over hits
         for (GenericHit hit : hits)
@@ -643,6 +655,18 @@
             {
                 maxTime = time;
             }
+            
+            // Update max layer
+            if (layern > maxLayer)
+            {
+                maxLayer = layern;
+            }
+            
+            // Update min layer
+            if (layern < minLayer)
+            {
+                minLayer = layern;
+            }
 
             // Add this time to time sum
             totTime += time;
@@ -653,6 +677,12 @@
             // Increment total number of hits counter
             ++nhits;
         }
+        
+        // Fill max layer
+        _layerMax.fill(maxLayer);
+        
+        // Fill min layer
+        _layerMin.fill(minLayer);
 
         // Fill # hits / E
         _hitOverE.fill(((double) nhits) / eventTotE);
CVSspam 0.2.8