Print

Print


Commit in SlicDiagnostics on MAIN
TODO+41.3 -> 1.4
src/org/lcsim/slic/diagnostics/CalorimeterHitPlots.java+77-941.28 -> 1.29
                              /CommandLineProcessor.java+3-41.5 -> 1.6
                              /GenericHitPlots.java+135-1021.33 -> 1.34
                              /TrackerHitPlots.java+31-101.9 -> 1.10
+250-210
5 modified files
JM: Added log10 plots of energy and time to GenericHitPlots and CalorimeterHitPlots

SlicDiagnostics
TODO 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- TODO	9 Mar 2006 23:53:22 -0000	1.3
+++ TODO	30 Mar 2006 01:09:43 -0000	1.4
@@ -9,3 +9,7 @@
   -aidatld library
 -graphics
   -automatically write out the AIDA file in a dir tree of graphics
+-clustering
+  -start with cheater clusters
+  -do NN on the cheater clusters
+  -then use shape parameters 1,2,3 of cheater clusters

SlicDiagnostics/src/org/lcsim/slic/diagnostics
CalorimeterHitPlots.java 1.28 -> 1.29
diff -u -r1.28 -r1.29
--- CalorimeterHitPlots.java	21 Mar 2006 19:13:54 -0000	1.28
+++ CalorimeterHitPlots.java	30 Mar 2006 01:09:44 -0000	1.29
@@ -23,11 +23,11 @@
 import org.lcsim.geometry.subdetector.CylindricalEndcapCalorimeter;
 
 /**
- * A set of plots for SimCalorimeterHit collections.
- * NOTE: Most plots on collections of SimCalorimeterHits are done by GenericHitPlots.
- *
+ * A set of plots for SimCalorimeterHit collections. NOTE: Most plots on
+ * collections of SimCalorimeterHits are done by GenericHitPlots.
+ * 
  * @author jeremym
- * @version $Id: CalorimeterHitPlots.java,v 1.28 2006/03/21 19:13:54 jeremy Exp $
+ * @version $Id: CalorimeterHitPlots.java,v 1.29 2006/03/30 01:09:44 jeremy Exp $
  */
 class CalorimeterHitPlots extends AbstractPlots
 {
@@ -35,8 +35,9 @@
     ICloud1D _mcpCountPerHit;
     ICloud1D _mcpPDG;
     ICloud1D _mcpSingleContribPDG;
-    ICloud1D _hitCorrectedEnergy;
-    ICloud2D _hitRawVsCorrectedEnergy;
+    ICloud1D _hitCorrE;
+    ICloud1D _hitCorrElog10;
+    ICloud2D _hitRawVsCorrE;
     ICloud1D _mcpMissing;
 
     // Type of segmentation
@@ -45,7 +46,10 @@
     // SegmentationPlots
     SegmentationPlots _segmentationPlots;
 
-    /** An enumerated type representing the possible readout segmentations for a CalorimeterHit collection. */
+    /**
+     * An enumerated type representing the possible readout segmentations for a
+     * CalorimeterHit collection.
+     */
     enum SegmentationType
     {
         NONE, PRJ_CYL, PRJ_Z, NP_CYL, GRID_XY, GRID_XZ
@@ -64,57 +68,62 @@
         super.definePlots();
 
         _mcpCountPerHit = aida().cloud1D("MCParticle: Number of MCParticle Contributions per Hit");
-        _mcpCountPerHit.annotation().addItem("xAxisLabel","Number of MCParticle Contributions");
-        _mcpCountPerHit.annotation().addItem("yAxisLabel","Number of Hits");
+        _mcpCountPerHit.annotation().addItem("xAxisLabel", "Number of MCParticle Contributions");
+        _mcpCountPerHit.annotation().addItem("yAxisLabel", "Number of Hits");
 
         _mcpPDG = aida().cloud1D("MCParticle: PDGID");
-        _mcpPDG.annotation().addItem("xAxisLabel","PDGID of MCParticle Contribution");
-        _mcpPDG.annotation().addItem("yAxisLabel","Number of Hits");
+        _mcpPDG.annotation().addItem("xAxisLabel", "PDGID of MCParticle Contribution");
+        _mcpPDG.annotation().addItem("yAxisLabel", "Number of Hits");
 
-        _mcpSingleContribPDG     = aida().cloud1D("MCParticle: Single Contribution PDGID");
-        _mcpSingleContribPDG.annotation().addItem("xAxisLabel","PDGID of Single MCParticle Contribution");
-        _mcpSingleContribPDG.annotation().addItem("yAxisLabel","Number of Hits");
-
-        _hitCorrectedEnergy = aida().cloud1D("Hit: Corrected Energy");
-        _hitCorrectedEnergy.annotation().addItem("xAxisLabel","Corrected Energy (GeV)");
-        _hitCorrectedEnergy.annotation().addItem("yAxisLabel","Number of Hits");
-
-        _hitRawVsCorrectedEnergy = aida().cloud2D("Hit: Raw vs Corrected Energy");
-        _hitRawVsCorrectedEnergy.annotation().addItem("xAxisLabel","Raw Energy (GeV)");
-        _hitRawVsCorrectedEnergy.annotation().addItem("yAxisLabel","Corrected Energy (GeV)");
+        _mcpSingleContribPDG = aida().cloud1D("MCParticle: Single Contribution PDGID");
+        _mcpSingleContribPDG.annotation().addItem("xAxisLabel", "PDGID of Single MCParticle Contribution");
+        _mcpSingleContribPDG.annotation().addItem("yAxisLabel", "Number of Hits");
+
+        _hitCorrE = aida().cloud1D("Hit: Corrected Energy");
+        _hitCorrE.annotation().addItem("xAxisLabel", "Corrected Energy (GeV)");
+        _hitCorrE.annotation().addItem("yAxisLabel", "Number of Hits");
+        _hitCorrE.annotation().addItem("yAxisScale", "log");
+
+        _hitCorrElog10 = aida().cloud1D("Hit: log10(Corrected Energy)");
+        _hitCorrElog10.annotation().addItem("xAxisLabel", "Corrected Energy (log10(GeV))");
+        _hitCorrElog10.annotation().addItem("yAxisLabel", "Number of Hits");
+
+        _hitRawVsCorrE = aida().cloud2D("Hit: Raw vs Corrected Energy");
+        _hitRawVsCorrE.annotation().addItem("xAxisLabel", "Raw Energy (GeV)");
+        _hitRawVsCorrE.annotation().addItem("yAxisLabel", "Corrected Energy (GeV)");
 
         _mcpMissing = aida().cloud1D("MCParticle: Contribution Missing");
-        _mcpMissing.annotation().addItem("xAxisLabel","Number of Hits Missing an MCParticle Contribution per Event");
-        _mcpMissing.annotation().addItem("yAxisLabel","Number of Events");
+        _mcpMissing.annotation().addItem("xAxisLabel", "Number of Hits Missing an MCParticle Contribution per Event");
+        _mcpMissing.annotation().addItem("yAxisLabel", "Number of Events");
     }
 
     /** Set the segmentation type based on the LCMetaData. */
     private void setSegmentationType(LCMetaData meta)
     {
         IDDecoder decoder = meta.getIDDecoder();
-        SegmentationBase segmentation = (SegmentationBase)decoder;
+        SegmentationBase segmentation = (SegmentationBase) decoder;
         Subdetector detector = decoder.getSubdetector();
 
-        if ( segmentation != null && detector != null )
+        if (segmentation != null && detector != null)
         {
-            if ( segmentation instanceof ProjectiveCylinder )
+            if (segmentation instanceof ProjectiveCylinder)
             {
                 _segmentationType = SegmentationType.PRJ_CYL;
             }
 
-            if ( segmentation instanceof ProjectiveZPlane )
+            if (segmentation instanceof ProjectiveZPlane)
             {
                 _segmentationType = SegmentationType.PRJ_Z;
             }
 
-            if ( segmentation instanceof NonprojectiveCylinder )
+            if (segmentation instanceof NonprojectiveCylinder)
             {
                 _segmentationType = SegmentationType.NP_CYL;
             }
 
-            if ( segmentation instanceof GridXYZ )
+            if (segmentation instanceof GridXYZ)
             {
-                if ( detector instanceof AbstractTestBeam || detector instanceof CylindricalEndcapCalorimeter )
+                if (detector instanceof AbstractTestBeam || detector instanceof CylindricalEndcapCalorimeter)
                 {
                     _segmentationType = SegmentationType.GRID_XY;
                 }
@@ -124,19 +133,19 @@
 
     private void setupSegmentationPlots()
     {
-        if ( _segmentationType == SegmentationType.PRJ_CYL || _segmentationType == SegmentationType.PRJ_Z )
+        if (_segmentationType == SegmentationType.PRJ_CYL || _segmentationType == SegmentationType.PRJ_Z)
         {
             _segmentationPlots = new ProjectivePlots(this);
         }
-        else if ( _segmentationType == SegmentationType.NP_CYL )
+        else if (_segmentationType == SegmentationType.NP_CYL)
         {
             _segmentationPlots = new NonprojectiveCylinderPlots(this);
         }
-        else if ( _segmentationType == SegmentationType.GRID_XY )
+        else if (_segmentationType == SegmentationType.GRID_XY)
         {
             _segmentationPlots = new GridXYPlots(this);
         }
-        else if ( _segmentationType == SegmentationType.GRID_XZ )
+        else if (_segmentationType == SegmentationType.GRID_XZ)
         {
             _segmentationPlots = new GridXZPlots(this);
         }
@@ -145,7 +154,7 @@
     protected void fill(EventHeader event)
     {
         super.fill(event);
-        fill(event.get(SimCalorimeterHit.class, getCollectionName() ));
+        fill(event.get(SimCalorimeterHit.class, getCollectionName()));
     }
 
     private void fill(List<SimCalorimeterHit> hits)
@@ -161,41 +170,44 @@
             haveSF = false;
         }
 
-        if ( hits.size() > 0 )
+        if (hits.size() > 0)
         {
-            CalorimeterIDDecoder segmentation = (CalorimeterIDDecoder)getEventHeader().getMetaData(hits).getIDDecoder();
+            CalorimeterIDDecoder segmentation = (CalorimeterIDDecoder) getEventHeader().getMetaData(hits)
+                    .getIDDecoder();
             int mcpMissingCount = 0;
-            for ( SimCalorimeterHit hit : hits)
+            for (SimCalorimeterHit hit : hits)
             {
                 segmentation.setID(hit.getCellID());
 
                 // Count number of hits missing an MCParticle contribution
-                if ( hit.getMCParticleCount() ==  0 )
+                if (hit.getMCParticleCount() == 0)
                 {
                     mcpMissingCount += 1;
                 }
 
                 // Plot the segmentation plots
-                if ( _segmentationPlots != null )
+                if (_segmentationPlots != null)
                 {
                     _segmentationPlots.fill(segmentation);
                 }
 
-
                 if (haveSF)
                 {
-                    // Plot corrected E                    
-                    _hitCorrectedEnergy.fill(hit.getCorrectedEnergy());
+                    // Plot corrected E
+                    _hitCorrE.fill(hit.getCorrectedEnergy());
+
+                    // Plot log10(corrected E)
+                    _hitCorrElog10.fill(log10(hit.getCorrectedEnergy()));
 
                     // Plot raw vs corrected E
-                    _hitRawVsCorrectedEnergy.fill(hit.getRawEnergy(), hit.getCorrectedEnergy());
+                    _hitRawVsCorrE.fill(hit.getRawEnergy(), hit.getCorrectedEnergy());
                 }
 
                 // MCParticle Plots
                 int nmcp = hit.getMCParticleCount();
                 _mcpCountPerHit.fill(nmcp);
 
-                for ( int i=0; i < nmcp; i++)
+                for (int i = 0; i < nmcp; i++)
                 {
                     MCParticle mcp = hit.getMCParticle(i);
                     int pdg = mcp.getPDGID();
@@ -219,10 +231,12 @@
     public abstract class SegmentationPlots
     {
         protected CalorimeterHitPlots plots;
+
         SegmentationPlots(CalorimeterHitPlots plots)
         {
             this.plots = plots;
         }
+
         abstract public void fill(CalorimeterIDDecoder segmentation);
     }
 
@@ -238,22 +252,15 @@
             cd();
 
             // Plot phi vs phi bin
-            aida().cloud2D("Hit: Phi vs Phi Bin").fill(
-                    segmentation.getPhi(),
-                    (double)segmentation.getValue("phi")
-                    );
+            aida().cloud2D("Hit: Phi vs Phi Bin").fill(segmentation.getPhi(), (double) segmentation.getValue("phi"));
 
             // Plot theta vs theta bin
-            aida().cloud2D("Hit: Theta vs Theta Bin").fill(
-                    segmentation.getTheta(),
-                    (double)segmentation.getValue("theta")
-                    );
+            aida().cloud2D("Hit: Theta vs Theta Bin").fill(segmentation.getTheta(),
+                    (double) segmentation.getValue("theta"));
 
             // Plot phi bin vs theta bin
-            aida().cloud2D("Hit: Phi Bin vs Theta Bin").fill(
-                    (double)segmentation.getValue("phi"),
-                    (double)segmentation.getValue("theta")
-                    );
+            aida().cloud2D("Hit: Phi Bin vs Theta Bin").fill((double) segmentation.getValue("phi"),
+                    (double) segmentation.getValue("theta"));
         }
     }
 
@@ -268,22 +275,14 @@
         {
 
             // Plot phi vs phi bin
-            aida().cloud2D("Hit: Phi vs Phi Bin").fill(
-                    segmentation.getPhi(),
-                    (double)segmentation.getValue("phi")
-                    );
+            aida().cloud2D("Hit: Phi vs Phi Bin").fill(segmentation.getPhi(), (double) segmentation.getValue("phi"));
 
             // Plot Z vs Z bin
-            aida().cloud2D("Hit: Z vs Z Bin").fill(
-                    segmentation.getZ(),
-                    (double)segmentation.getValue("z")
-                    );
+            aida().cloud2D("Hit: Z vs Z Bin").fill(segmentation.getZ(), (double) segmentation.getValue("z"));
 
             // Plot phi bin vs Z bin
-            aida().cloud2D("Hit: Phi Bin vs Z Bin").fill(
-                    (double)segmentation.getValue("phi"),
-                    (double)segmentation.getValue("z")
-                    );
+            aida().cloud2D("Hit: Phi Bin vs Z Bin").fill((double) segmentation.getValue("phi"),
+                    (double) segmentation.getValue("z"));
         }
     }
 
@@ -297,22 +296,14 @@
         public void fill(CalorimeterIDDecoder segmentation)
         {
             // Plot X vs X bin
-            aida().cloud2D("Hit: X vs X Bin").fill(
-                    segmentation.getX(),
-                    (double)segmentation.getValue("x")
-                    );
+            aida().cloud2D("Hit: X vs X Bin").fill(segmentation.getX(), (double) segmentation.getValue("x"));
 
             // Plot Y vs Y bin
-            aida().cloud2D("Hit: Y vs Y Bin").fill(
-                    segmentation.getZ(),
-                    (double)segmentation.getValue("y")
-                    );
+            aida().cloud2D("Hit: Y vs Y Bin").fill(segmentation.getZ(), (double) segmentation.getValue("y"));
 
             // Plot X bin vs Y bin
-            aida().cloud2D("Hit: X Bin vs Y Bin").fill(
-                    (double)segmentation.getValue("x"),
-                    (double)segmentation.getValue("y")
-                    );
+            aida().cloud2D("Hit: X Bin vs Y Bin").fill((double) segmentation.getValue("x"),
+                    (double) segmentation.getValue("y"));
         }
     }
 
@@ -326,22 +317,14 @@
         public void fill(CalorimeterIDDecoder segmentation)
         {
             // Plot X vs X bin
-            aida().cloud2D("Hit: X vs X Bin").fill(
-                    segmentation.getX(),
-                    (double)segmentation.getValue("x")
-                    );
+            aida().cloud2D("Hit: X vs X Bin").fill(segmentation.getX(), (double) segmentation.getValue("x"));
 
             // Plot Z vs Z bin
-            aida().cloud2D("Hit: Z vs Z Bin").fill(
-                    segmentation.getZ(),
-                    (double)segmentation.getValue("z")
-                    );
+            aida().cloud2D("Hit: Z vs Z Bin").fill(segmentation.getZ(), (double) segmentation.getValue("z"));
 
             // Plot X bin vs Z bin
-            aida().cloud2D("Hit: X Bin vs Z Bin").fill(
-                    (double)segmentation.getValue("x"),
-                    (double)segmentation.getValue("z")
-                    );
+            aida().cloud2D("Hit: X Bin vs Z Bin").fill((double) segmentation.getValue("x"),
+                    (double) segmentation.getValue("z"));
         }
     }
 }

SlicDiagnostics/src/org/lcsim/slic/diagnostics
CommandLineProcessor.java 1.5 -> 1.6
diff -u -r1.5 -r1.6
--- CommandLineProcessor.java	16 Mar 2006 02:34:01 -0000	1.5
+++ CommandLineProcessor.java	30 Mar 2006 01:09:44 -0000	1.6
@@ -28,7 +28,7 @@
  * Main.
  * 
  * @author Jeremy McCormick
- * @version $Id: CommandLineProcessor.java,v 1.5 2006/03/16 02:34:01 jeremy Exp $
+ * @version $Id: CommandLineProcessor.java,v 1.6 2006/03/30 01:09:44 jeremy Exp $
  */
 public class CommandLineProcessor
 {
@@ -269,11 +269,10 @@
         }
 
         // There should be some files to process at this point, or the command
-        // line
-        // arguments did not find any input files.
+        // line arguments did not find any input files.
         if (_infiles.size() == 0)
         {
-            System.err.println("No input files were found from command line arguments.");
+            System.err.println("ERROR: No input files were found from command line arguments.");
             printUsage(true);
         }
 

SlicDiagnostics/src/org/lcsim/slic/diagnostics
GenericHitPlots.java 1.33 -> 1.34
diff -u -r1.33 -r1.34
--- GenericHitPlots.java	16 Mar 2006 02:36:26 -0000	1.33
+++ GenericHitPlots.java	30 Mar 2006 01:09:44 -0000	1.34
@@ -1,6 +1,8 @@
 package org.lcsim.slic.diagnostics;
 
 import static java.lang.Math.log10;
+import static java.lang.Math.cbrt;
+
 import hep.aida.ICloud1D;
 import hep.aida.ICloud2D;
 import hep.aida.IHistogram1D;
@@ -17,17 +19,18 @@
 import org.lcsim.geometry.layer.Layer;
 
 /**
- * A set of diagnostic plots on lists of GenericHits. These include
- * statistics on position, energy, time, and segmentation bin values.
- * GenericHitPlots also creates a set of plots for each layer in the 
- * subdetector.
+ * A set of diagnostic plots on lists of GenericHits. These include statistics
+ * on position, energy, time, and segmentation bin values. GenericHitPlots also
+ * creates a set of plots for each layer in the subdetector.
  * 
  * @author jeremym
- * @version $Id: GenericHitPlots.java,v 1.33 2006/03/16 02:36:26 jeremy Exp $
+ * @version $Id: GenericHitPlots.java,v 1.34 2006/03/30 01:09:44 jeremy Exp $
  */
 class GenericHitPlots extends AbstractPlots
 {
     ICloud1D _energy;
+    ICloud1D _energycbrt;
+    ICloud1D _energylog10;
     ICloud1D _energyEvent;
     ICloud1D _hitAvgEnergy;
     ICloud1D _hitMinE;
@@ -40,6 +43,7 @@
     IHistogram1D _layer;
     ICloud1D _hitCount;
     ICloud1D _time;
+    ICloud1D _timelog10;
     ICloud1D _timeAvg;
     ICloud2D _timeVsSphR;
     ICloud2D _thetaPhi;
@@ -79,7 +83,7 @@
     ICloud1D _hitDepth;
     ICloud1D _maxTime;
     ICloud1D _minTime;
-    
+
     Subdetector _detector;
 
     protected void definePlots()
@@ -87,28 +91,38 @@
         super.definePlots();
 
         _energy = aida().cloud1D("Hit: Energy");
-        //_energy.annotation().addItem("xAxisLabel", "Energy (log10(GeV))");
         _energy.annotation().addItem("xAxisLabel", "Energy (GeV)");
         _energy.annotation().addItem("yAxisLabel", "Number of Hits");
+        _energy.annotation().addItem("yAxisScale", "log");
+
+        _energylog10 = aida().cloud1D("Hit: log10(Energy)");
+        _energylog10.annotation().addItem("xAxisLabel", "Energy (GeV)");
+        _energylog10.annotation().addItem("yAxisLabel", "Number of Hits");
+
+        _energycbrt = aida().cloud1D("Hit: cube_root(Energy)");
+        _energycbrt.annotation().addItem("xAxisLabel", "Energy (cube_root(GeV))");
+        _energycbrt.annotation().addItem("yAxisLabel", "Number of Hits");
 
         _hitAvgEnergy = aida().cloud1D("Hit: Average Energy by Event");
         _hitAvgEnergy.annotation().addItem("xAxisLabel", "Hit Average Energy (GeV)");
-        _hitAvgEnergy.annotation().addItem("yAxisLabel", "Number of Events");
-                
+        _hitAvgEnergy.annotation().addItem("yAxisLabel", "Number of Events");        
+
         _time = aida().cloud1D("Hit: Time");
-        //_time.annotation().addItem("xAxisLabel", "Time (log10(seconds))");
         _time.annotation().addItem("xAxisLabel", "Time (nanoseconds)");
         _time.annotation().addItem("yAxisLabel", "Number of Hits");
+        _time.annotation().addItem("yAxisScale", "log");
 
-        _timeAvg = aida().cloud1D("Hit: Time Average");
-        //_timeAvg.annotation().addItem("xAxisLabel", "Average Time (log10(seconds))");
-        _timeAvg.annotation().addItem("xAxisLabel", "Average Time (nanoseconds)");
+        _timelog10 = aida().cloud1D("Hit: log10(Time)");
+        _timelog10.annotation().addItem("xAxisLabel", "Time (log10(nanoseconds))");
+        _timelog10.annotation().addItem("yAxisLabel", "Number of Hits");        
+
+        _timeAvg = aida().cloud1D("Hit: log10(Time Average)");
+        _timeAvg.annotation().addItem("xAxisLabel", "Average Time (log10(nanoseconds))");
         _timeAvg.annotation().addItem("yAxisLabel", "Number of Events");
 
         _timeVsSphR = aida().cloud2D("Hit: Time vs Spherical R");
-        //_timeVsSphR.annotation().addItem("xAxisLabel", "Time ( log10(seconds))");
-        _timeVsSphR.annotation().addItem("xAxisLabel", "Time (nanoseconds)");
-        _timeVsSphR.annotation().addItem("yAxisLabel", "Spherical Radius (mm)");
+        _timeVsSphR.annotation().addItem("xAxisLabel", "Spherical Radius (mm)");
+        _timeVsSphR.annotation().addItem("yAxisLabel", "Time (nanoseconds)");
 
         _thetaPhi = aida().cloud2D("Hit: Theta vs Phi");
         _thetaPhi.annotation().addItem("xAxisLabel", "Theta (radians)");
@@ -133,26 +147,26 @@
         _layer = aida().histogram1D("Hit: Count by Layer Number", _nlayers, 0, _nlayers);
         _layer.annotation().addItem("xAxisLabel", "Layer Number");
         _layer.annotation().addItem("yAxisLabel", "Hit Count");
-        
-        _layerCumE = aida().histogram1D("Layer: Cumulative Energy", _nlayers, 0, _nlayers);        
+
+        _layerCumE = aida().histogram1D("Layer: Cumulative Energy", _nlayers, 0, _nlayers);
         _layerCumE.annotation().addItem("xAxisLabel", "Layer Number");
         _layerCumE.annotation().addItem("yAxisLabel", "Fraction of Total Energy");
-        
-        _layerCumNHits = aida().histogram1D("Layer: Cumulative Number of Hits", _nlayers, 0, _nlayers);        
+
+        _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");
 
         _layerEnergy = aida().histogram1D("Hit: Weighted Energy by Layer Number", _nlayers, 0, _nlayers);
         _layerEnergy.annotation().addItem("xAxisLabel", "Layer Number");
         _layerEnergy.annotation().addItem("yAxisLabel", "Weighted Energy (GeV)");
-                
+
         _energyEvent = aida().cloud1D("Event: Total Energy");
         _energyEvent.annotation().addItem("xAxisLabel", "Event Energy (GeV)");
         _energyEvent.annotation().addItem("yAxisLabel", "Number of Events");
-        
+
         _hitOverE = aida().cloud1D("Event: Number of Hits over Energy");
         _hitOverE.annotation().addItem("xAxisLabel", "# Hits / E (GeV)");
-        _hitOverE.annotation().addItem("yAxisLabel", "Number of Events");        
+        _hitOverE.annotation().addItem("yAxisLabel", "Number of Events");
 
         _hitCount = aida().cloud1D("Event: Total Hit Count");
         _hitCount.annotation().addItem("xAxisLabel", "Number of Hits in Event");
@@ -225,7 +239,7 @@
         _layerPercentHits = aida().histogram2D("Layer: Fraction of Hit Count", _nlayers, 0, _nlayers, 100, 0, 1.0);
         _layerPercentHits.annotation().addItem("xAxisLabel", "Layer Number");
         _layerPercentHits.annotation().addItem("yAxisLabel", "Fraction of Number of Hits");
-                
+
         _layerAvgHitE = aida().histogram1D("Layer: Average Hit Energy", _nlayers, 0, _nlayers);
         _layerAvgHitE.annotation().addItem("xAxisLabel", "Layer Number");
         _layerAvgHitE.annotation().addItem("yAxisLabel", "Average Hit Energy (GeV)");
@@ -248,7 +262,7 @@
 
         _layerMinE = aida().cloud1D("Layer: Min Edep");
         _layerMinE.annotation().addItem("xAxisLabel", "Min Energy in a Single Layer");
-        _layerMinE.annotation().addItem("yAxisLabel", "Number of Events");        
+        _layerMinE.annotation().addItem("yAxisLabel", "Number of Events");
 
         _layerMaxNHits = aida().cloud1D("Layer: Max Number of Hits");
         _layerMaxNHits.annotation().addItem("xAxisLabel", "Max Number of Hits in a Single Layer");
@@ -261,7 +275,7 @@
         _layerMaxEOverTot = aida().cloud1D("Layer: Max Energy in a Single Layer Over Total Energy");
         _layerMaxEOverTot.annotation().addItem("xAxisLabel", "Max Energy in a Single Layer over Total Energy");
         _layerMaxEOverTot.annotation().addItem("yAxisLabel", "Number of Events");
-        
+
         _layerMinEOverTot = aida().cloud1D("Layer: Min Energy Over Total Energy");
         _layerMinEOverTot.annotation().addItem("xAxisLabel", "Min Single Layer Energy over Total Energy");
         _layerMinEOverTot.annotation().addItem("yAxisLabel", "Number of Events");
@@ -281,15 +295,15 @@
         _layerAvgTotNHits = aida().histogram1D("Layer: Average Total # Hits", _nlayers, 0, _nlayers);
         _layerAvgTotNHits.annotation().addItem("xAxisLabel", "Layer Number");
         _layerAvgTotNHits.annotation().addItem("yAxisLabel", "Average Total Number of Hits for All Events");
-        
+
         _hitDepth = aida().cloud1D("Hit: Depth into Sensitive Layer");
         _hitDepth.annotation().addItem("xAxisLabel", "Depth into Sensor (mm)");
-        _hitDepth.annotation().addItem("yAxisLabel", "Number of Hits");               
-        
+        _hitDepth.annotation().addItem("yAxisLabel", "Number of Hits");
+
         _minTime = aida().cloud1D("Hit: Min Time");
         _minTime.annotation().addItem("xAxisLabel", "Time (nanoseconds)");
         _minTime.annotation().addItem("yAxisLabel", "Number of Events");
-        
+
         _maxTime = aida().cloud1D("Hit: Max Time");
         _maxTime.annotation().addItem("xAxisLabel", "Time (nanoseconds)");
         _maxTime.annotation().addItem("yAxisLabel", "Number of Events");
@@ -297,23 +311,23 @@
 
     private void makeLayers()
     {
-        Layered l = (Layered)_detector;
+        Layered l = (Layered) _detector;
         for (int i = 0; i < _nlayers; i++)
         {
             LayerInfo info = new LayerInfo(i);
-            
+
             Layer layer = l.getLayering().getLayer(i);
             int sens = layer.findIndexOfFirstSensitiveSlice();
             double sensThick = layer.getSlice(sens).getThickness();
             double tosens = layer.getThicknessToSensitive();
-            double offset = l.getLayering().getDistanceToLayer(i);                       
+            double offset = l.getLayering().getDistanceToLayer(i);
             double ir = offset + tosens;
-            double or = ir + sensThick;          
-            
+            double or = ir + sensThick;
+
             info.setSensorInnerRadius(ir);
             info.setSensorOuterRadius(or);
-                        
-            _layers.put(i, info);            
+
+            _layers.put(i, info);
 
             String layerName = info.getTitleName();
             String dirName = info.getDirName();
@@ -353,19 +367,26 @@
             plot.annotation().addItem("yAxisLabel", "Number of Events");
 
             plot = aida().cloud1D(layerName + ": Hit Energy");
-            //plot.annotation().addItem("xAxisLabel", "Hit Energy (log10(GeV))");
             plot.annotation().addItem("xAxisLabel", "Hit Energy (GeV)");
             plot.annotation().addItem("yAxisLabel", "Number of Hits");
+            plot.annotation().addItem("yAxisScale", "log");
+
+            plot = aida().cloud1D(layerName + ": log10(Hit Energy)");
+            plot.annotation().addItem("xAxisLabel", "Hit Energy (log10(GeV))");
+            plot.annotation().addItem("yAxisLabel", "Number of Hits");            
 
             plot = aida().cloud1D(layerName + ": Hit Time");
-            //plot.annotation().addItem("xAxisLabel", "Time (log10(seconds))");
             plot.annotation().addItem("xAxisLabel", "Time (nanoseconds)");
             plot.annotation().addItem("yAxisLabel", "Number of Hits");
-            
+
+            plot = aida().cloud1D(layerName + ": log10(Hit Time)");
+            plot.annotation().addItem("xAxisLabel", "Time (log10(nanosecondsseconds))");
+            plot.annotation().addItem("yAxisLabel", "Number of Hits");
+
             plot = aida().cloud1D(layerName + ": Cumulative Energy");
             plot.annotation().addItem("xAxisLabel", "Fraction of Total Energy");
             plot.annotation().addItem("yAxisLabel", "Number of Events");
-            
+
             plot = aida().cloud1D(layerName + ": Cumulative Number of Hits");
             plot.annotation().addItem("xAxisLabel", "Fraction of Total Number of Hits");
             plot.annotation().addItem("yAxisLabel", "Number of Events");
@@ -373,7 +394,7 @@
             ICloud2D plot1;
             plot1 = aida().cloud2D(layerName + ": Hit XY");
             plot1.annotation().addItem("xAxisLabel", "X (mm)");
-            plot1.annotation().addItem("yAxisLabel", "Y (mm)");                       
+            plot1.annotation().addItem("yAxisLabel", "Y (mm)");
         }
     }
 
@@ -425,9 +446,9 @@
         definePlots();
     }
 
-    /** 
-     * Set the list of GenericHits to be processed.  
-     * NOTE: GenericHitPlotsDriver uses this method to set the list.
+    /**
+     * Set the list of GenericHits to be processed. NOTE: GenericHitPlotsDriver
+     * uses this method to set the list.
      */
     protected void setGenericHitList(List<GenericHit> hits)
     {
@@ -464,7 +485,7 @@
         double maxR = 0;
         double minTime = 9999.0;
         double maxTime = 0;
-                
+
         // Loop over hits
         for (GenericHit hit : hits)
         {
@@ -473,6 +494,8 @@
             double y = hit.getY();
             double z = hit.getZ();
             double energy = hit.getEnergy();
+            double elog10 = log10(energy);
+            double ecbrt = cbrt(energy);
             double time = hit.getTime();
             double timelog10 = log10(hit.getTime());
             double theta = hit.getTheta();
@@ -480,24 +503,31 @@
             int layern = hit.getLayer();
             double cylR = hit.getCylindricalRadius();
             double sphR = hit.getSphericalRadius();
-                                    
+
             // Lookup the LayerInfo from this hit's layer number
             LayerInfo layerInfo = _layers.get(layern);
-            
+
             // Fill hit depth
             _hitDepth.fill(cylR - layerInfo.getSensorInnerRadius());
-                        
+
             // Fill hit energy
-            //_energy.fill(log10(energy));
             _energy.fill(energy);
 
+            // Fill cube root of energy
+            _energycbrt.fill(ecbrt);
+
+            // Fill log(energy)
+            _energylog10.fill(elog10);
+
             // Fill hit time
-            //_time.fill(timelog10);
             _time.fill(time);
 
+            // Fill log time
+            _timelog10.fill(timelog10);
+
             // Fill time vs spherical R
-            //_timeVsSphR.fill(timelog10, sphR);
-            _timeVsSphR.fill(time, sphR);
+            // _timeVsSphR.fill(timelog10, sphR);
+            _timeVsSphR.fill(sphR, time);
 
             // Fill hit theta vs. phi
             _thetaPhi.fill(theta, phi);
@@ -511,9 +541,9 @@
             // Fill Z vs. Y
             _zy.fill(z, y);
 
-            // Fill hit Z vs. cylindrical radius 
+            // Fill hit Z vs. cylindrical radius
             _rz.fill(z, cylR);
-            
+
             // Fill hit layer
             _layer.fill(layern);
 
@@ -529,16 +559,20 @@
             String layerName = layerInfo.getTitleName();
 
             // Fill layer hit energy
-            //aida().cloud1D(layerName + ": Hit Energy").fill(log10(energy));
             aida().cloud1D(layerName + ": Hit Energy").fill(energy);
 
+            // Fill log10 layer energy
+            aida().cloud1D(layerName + ": log10(Hit Energy)").fill(log10(energy));
+
             // Fill layer hit XY
             aida().cloud2D(layerName + ": Hit XY").fill(x, y);
 
             // Fill layer time
-            //aida().cloud1D(layerName + ": Hit Time").fill(log10(time));
             aida().cloud1D(layerName + ": Hit Time").fill(time);
 
+            // Fill log10 layer time
+            aida().cloud1D(layerName + ": log10(Hit Time)").fill(log10(time));
+
             // Leave layer dir
             cd();
 
@@ -598,19 +632,19 @@
             {
                 minE = energy;
             }
-            
+
             // Update min time
             if (time < minTime)
             {
                 minTime = time;
             }
-            
+
             // Update max time
             if (time > maxTime)
             {
                 maxTime = time;
             }
-            
+
             // Add this time to time sum
             totTime += time;
 
@@ -620,10 +654,10 @@
             // Increment total number of hits counter
             ++nhits;
         }
-        
+
         // Fill # hits / E
-        _hitOverE.fill(((double)nhits) / eventTotE);
-        
+        _hitOverE.fill(((double) nhits) / eventTotE);
+
         // Fill min and max XYZ
         _hitMaxX.fill(maxX);
         _hitMinX.fill(minX);
@@ -640,9 +674,8 @@
         // Fill max edep over total
         _hitMaxEOverTotE.fill(maxE / eventTotE);
 
-        // Fill average time
-        //_timeAvg.fill(log10(totTime));
-        double avgTime = totTime / nhits;
+        // Fill log10 average time
+        double avgTime = log10(totTime / nhits);
         _timeAvg.fill(avgTime);
 
         // Fill event energy
@@ -652,7 +685,7 @@
         _hitCount.fill(nhits);
 
         double hitAvgE = eventTotE / nhits;
-        
+
         // Fill avg energy per hit
         _hitAvgEnergy.fill(hitAvgE);
 
@@ -668,50 +701,50 @@
         // Fill hit count vs total energy
         _hitVsTotE.fill(eventTotE, nhits);
 
-        // Min layer E 
+        // Min layer E
         double minLayerE = 9999.0;
-        
-        // Max layer E 
+
+        // Max layer E
         double maxLayerE = 0.0;
 
         // Min layer N hits
         int minLayerNHits = 99999999;
-        
+
         // Max layer N hits
         int maxLayerNHits = 0;
-        
+
         // Cumulative layer N hits
         int cumn = 0;
-        
+
         // Cumulative layer E
         double cume = 0;
 
         // Loop over the layers after hits are processed
         for (LayerInfo layerInfo : _layers.values())
-        {            
+        {
             // Layer info into local vars
             String layerName = layerInfo.getTitleName();
             int layerNumber = layerInfo.getLayerNumber();
-            double layerE = layerInfo.getEnergy(); 
+            double layerE = layerInfo.getEnergy();
             int layerNHits = layerInfo.getNHits();
-            
+
             // Set percentage of total energy
             layerInfo.setPercentTotalEnergy(eventTotE);
-            
+
             // Set percentage of total n hits
             layerInfo.setPercentNHits(nhits);
-            
+
             // Compute average hit energy
             double layerAvgHitEdep = layerE / layerNHits;
-            
+
             // Increment cum N hits by this layer's hits
             cumn += layerNHits;
-            double fn = ((double)cumn) / ((double)nhits);
-            
+            double fn = ((double) cumn) / ((double) nhits);
+
             // Increment cum E by this layer's E
             cume += layerE;
             double fe = cume / eventTotE;
-                        
+
             // Update max E
             if (layerE > maxLayerE)
             {
@@ -735,18 +768,18 @@
             {
                 minLayerNHits = layerNHits;
             }
-            
-            // Fill cumulative E per layer                        
-            _layerCumE.fill(layerNumber, fe);            
-            
-            // Fill cumulative N hits per layer                                   
+
+            // Fill cumulative E per layer
+            _layerCumE.fill(layerNumber, fe);
+
+            // Fill cumulative N hits per layer
             _layerCumNHits.fill(layerNumber, fn);
-            
+
             // Fill percentage of total hit count in this layer
             _layerPercentHits.fill(layerNumber, layerInfo.getPercentNHits());
-                        
+
             // Fill fraction of total edep in this layer
-            _layerPercentTotE.fill(layerNumber, layerInfo.getPercentTotalEnergy());           
+            _layerPercentTotE.fill(layerNumber, layerInfo.getPercentTotalEnergy());
 
             // Fill average energy in this layer's hit
             _layerAvgHitE.fill(layerNumber, layerAvgHitEdep);
@@ -757,10 +790,10 @@
 
             // Fill cumulative N hits for this layer
             aida().cloud1D(layerName + ": Cumulative Number of Hits").fill(fn);
-            
+
             // Fill cumulative E for this layer
             aida().cloud1D(layerName + ": Cumulative Energy").fill(fe);
-                        
+
             // Fill layer total E
             aida().cloud1D(layerName + ": Total Energy").fill(layerE);
 
@@ -777,7 +810,7 @@
             aida().cloud1D(layerName + ": Fraction of Total Energy").fill(layerInfo.getPercentTotalEnergy());
             cd();
         }
-        
+
         // Fill max edep in a layer
         _layerMaxE.fill(maxLayerE);
 
@@ -814,10 +847,10 @@
 
         // Fill minLayerNHits / nhits
         _layerMinNHitsOverTot.fill(minLayerNHits / ((double) nhits));
-        
+
         // Fill max time
         _maxTime.fill(maxTime);
-        
+
         // Fill min time
         _minTime.fill(minTime);
 
@@ -841,14 +874,14 @@
     protected void endEvents(int nevents)
     {
         // Compute scale factor
-        double scale = 1 / ((double)nevents);
-       
+        double scale = 1 / ((double) nevents);
+
         // Scale cum E
         _layerCumE.scale(scale);
-        
+
         // Scale cum N hits
         _layerCumNHits.scale(scale);
-        
+
         // Make layer plots
         for (int i = 0; i < _nlayers; i++)
         {
@@ -859,9 +892,9 @@
 
             // Fill average n hits in the layer for nevents
             _layerAvgTotNHits.fill(i, layer.getAverageTotalNHits(nevents));
-                      
-            // Reset LayerInfo objects after all events 
+
+            // Reset LayerInfo objects after all events
             layer.resetEndData();
         }
     }
-}
\ No newline at end of file
+}

SlicDiagnostics/src/org/lcsim/slic/diagnostics
TrackerHitPlots.java 1.9 -> 1.10
diff -u -r1.9 -r1.10
--- TrackerHitPlots.java	13 Feb 2006 22:05:52 -0000	1.9
+++ TrackerHitPlots.java	30 Mar 2006 01:09:44 -0000	1.10
@@ -8,49 +8,70 @@
 
 /**
  * Plots on SimTrackerHit collections.
- * 
+ *
  * @author jeremym
- * @version $Id: TrackerHitPlots.java,v 1.9 2006/02/13 22:05:52 jeremy Exp $
+ * @version $Id: TrackerHitPlots.java,v 1.10 2006/03/30 01:09:44 jeremy Exp $
  */
 class TrackerHitPlots extends AbstractPlots
-{       
+{
     ICloud1D _mcpMissing;
-    
+    ICloud1D _pathlength;
+    ICloud1D _avgPathlength;
+
     public TrackerHitPlots(LCMetaData meta)
     {
         super("TrackerHits", meta);
         definePlots();
     }
-        
+
     protected void definePlots()
     {
         super.definePlots();
-        
+
         _mcpMissing = aida().cloud1D("Missing MCParticle Contribution");
         _mcpMissing.annotation().addItem("xAxisLabel","Number of Tracker Hits missing an MCParticle Contribution");
         _mcpMissing.annotation().addItem("yAxisLabel","Number of Events");
+
+        _pathlength = aida().cloud1D("Path Length");
+        _pathlength.annotation().addItem("xAxisLabel","Path Length (mm)");
+        _pathlength.annotation().addItem("yAxisLabel","Number of Hits");
+
+        _avgPathlength = aida().cloud1D("Average Path Length by Event");
+        _avgPathlength.annotation().addItem("xAxisLabel","Average Path Length (mm)");
+        _avgPathlength.annotation().addItem("yAxisLabel","Number of Events");
     }
-    
+
     protected void fill(EventHeader event)
     {
         super.fill(event);
         fill(event.get(SimTrackerHit.class, getCollectionName()));
     }
-    
+
     private void fill(List<SimTrackerHit> hits)
     {
         int mcpMissingCount = 0;
         if ( hits.size() > 0 )
         {
+
+            double pathLengthTot = 0.;
             for ( SimTrackerHit hit : hits )
             {
                 if ( hit.getMCParticle() == null )
                 {
                     mcpMissingCount += 1;
                 }
+
+                // Fill path length
+                _pathlength.fill(hit.getPathLength());
+
+                pathLengthTot += hit.getPathLength();
             }
-            
+
+            // Fill average path length
+            _avgPathlength.fill(pathLengthTot / ((double)hits.size()));
+
+            // Fill missing particle contribution
             _mcpMissing.fill(mcpMissingCount);
         }
     }
-}
\ No newline at end of file
+}
CVSspam 0.2.8