Print

Print


Commit in SlicDiagnostics/src/org/lcsim/slic/diagnostics on MAIN
GenericHitPlots.java+6-71.34 -> 1.35
MCParticlePlots.java+35-111.24 -> 1.25
MCParticleUtil.java+22-271.2 -> 1.3
+63-45
3 modified files
JM: Added plots of number of hits per particle

SlicDiagnostics/src/org/lcsim/slic/diagnostics
GenericHitPlots.java 1.34 -> 1.35
diff -u -r1.34 -r1.35
--- GenericHitPlots.java	30 Mar 2006 01:09:44 -0000	1.34
+++ GenericHitPlots.java	1 Apr 2006 00:00:01 -0000	1.35
@@ -24,7 +24,7 @@
  * creates a set of plots for each layer in the subdetector.
  * 
  * @author jeremym
- * @version $Id: GenericHitPlots.java,v 1.34 2006/03/30 01:09:44 jeremy Exp $
+ * @version $Id: GenericHitPlots.java,v 1.35 2006/04/01 00:00:01 jeremy Exp $
  */
 class GenericHitPlots extends AbstractPlots
 {
@@ -96,7 +96,7 @@
         _energy.annotation().addItem("yAxisScale", "log");
 
         _energylog10 = aida().cloud1D("Hit: log10(Energy)");
-        _energylog10.annotation().addItem("xAxisLabel", "Energy (GeV)");
+        _energylog10.annotation().addItem("xAxisLabel", "Energy log10(GeV)");
         _energylog10.annotation().addItem("yAxisLabel", "Number of Hits");
 
         _energycbrt = aida().cloud1D("Hit: cube_root(Energy)");
@@ -120,9 +120,9 @@
         _timeAvg.annotation().addItem("xAxisLabel", "Average Time (log10(nanoseconds))");
         _timeAvg.annotation().addItem("yAxisLabel", "Number of Events");
 
-        _timeVsSphR = aida().cloud2D("Hit: Time vs Spherical R");
+        _timeVsSphR = aida().cloud2D("Hit: Spherical R vs log10(Time)");
         _timeVsSphR.annotation().addItem("xAxisLabel", "Spherical Radius (mm)");
-        _timeVsSphR.annotation().addItem("yAxisLabel", "Time (nanoseconds)");
+        _timeVsSphR.annotation().addItem("yAxisLabel", "Time (log10(nanoseconds))");
 
         _thetaPhi = aida().cloud2D("Hit: Theta vs Phi");
         _thetaPhi.annotation().addItem("xAxisLabel", "Theta (radians)");
@@ -525,9 +525,8 @@
             // Fill log time
             _timelog10.fill(timelog10);
 
-            // Fill time vs spherical R
-            // _timeVsSphR.fill(timelog10, sphR);
-            _timeVsSphR.fill(sphR, time);
+            // Fill time vs spherical R 
+            _timeVsSphR.fill(sphR, timelog10);
 
             // Fill hit theta vs. phi
             _thetaPhi.fill(theta, phi);

SlicDiagnostics/src/org/lcsim/slic/diagnostics
MCParticlePlots.java 1.24 -> 1.25
diff -u -r1.24 -r1.25
--- MCParticlePlots.java	21 Mar 2006 19:13:54 -0000	1.24
+++ MCParticlePlots.java	1 Apr 2006 00:00:02 -0000	1.25
@@ -2,25 +2,27 @@
 
 import static java.lang.Math.log10;
 import static java.lang.Math.sqrt;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
 import hep.aida.ICloud1D;
 import hep.aida.ICloud2D;
 import hep.physics.vec.Hep3Vector;
 
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
 import org.lcsim.event.Cluster;
 import org.lcsim.event.EventHeader;
-import org.lcsim.event.EventHeader.LCMetaData;
 import org.lcsim.event.MCParticle;
+import org.lcsim.event.SimCalorimeterHit;
+import org.lcsim.event.SimTrackerHit;
+import org.lcsim.event.EventHeader.LCMetaData;
 import org.lcsim.recon.cluster.cheat.CheatCluster;
 
 /**
  * A set of MCParticle plots, including plots for each particle type by PDGID.
  * 
  * @author jeremym
- * @version $Id: MCParticlePlots.java,v 1.24 2006/03/21 19:13:54 jeremy Exp $
+ * @version $Id: MCParticlePlots.java,v 1.25 2006/04/01 00:00:02 jeremy Exp $
  */
 class MCParticlePlots extends AbstractPlots
 {
@@ -104,7 +106,7 @@
         _prodTime = aida().cloud1D("Production Time");
         _prodTime.annotation().addItem("xAxisLabel", "Production Time (log10(seconds))");
         _prodTime.annotation().addItem("yAxisLabel", "Number of Particles");
-
+                
         for (MCParticleFlag flag : MCParticleFlags.allFlags())
         {
             ICloud1D p = aida().cloud1D("Status: " + flag.toString());
@@ -257,6 +259,14 @@
                 // Plot number of endpoint daughters
                 _endpointDau.fill(nendd);
             }
+            
+            // Make a list of SimTrackerHits
+            List<SimTrackerHit> trackerHits = 
+                MCParticleUtil.findTrackerHits(getEventHeader(), particle);
+            
+            // Make a list of SimCalorimeterHits
+            List<SimCalorimeterHit> calorimeterHits = 
+                MCParticleUtil.findCalorimeterHits(getEventHeader(), particle);
 
             // Get info about this particle type
             MCParticleTypeInfo info = getMCParticleInfo(particle.getPDGID());
@@ -305,7 +315,7 @@
             }
             tree().cd(particleName);
 
-            // Get the RefinedCheatClusters from the recon cheater
+            // Get the RefinedCheatClusters from the recon cheater            
             try
             {
                 List<Cluster> clusters = getEventHeader().get(Cluster.class, "RefinedCheatClusters");
@@ -350,7 +360,13 @@
             }
             catch (Exception e)
             {}
-
+            
+            // Fill number of TrackerHits per particle
+            aida().cloud1D(particleName + ": Number of Tracker Hits per Particle").fill(trackerHits.size());
+
+            // Fill number of CalorimeterHits per particle
+            aida().cloud1D(particleName + ": Number of Calorimeter Hits per Particle").fill(calorimeterHits.size());            
+            
             // Plot particle energy
             aida().cloud1D(particleName + ": Energy").fill(particle.getEnergy());
 
@@ -422,7 +438,7 @@
                             dauE);
                 }
             }
-
+            
             // Go back to main dir
             tree().cd("..");
         }
@@ -618,6 +634,14 @@
                 p1 = aida().cloud1D(particleName + ": dE over E for Event");
                 p1.annotation().addItem("xAxisLabel", "dE / E (GeV)");
                 p1.annotation().addItem("yAxisLabel", "Number of Events");
+                
+                p1 = aida().cloud1D(particleName + ": Number of TrackerHits per Particle");
+                p1.annotation().addItem("xAxisLabel", "Number of Hits per Particle");
+                p1.annotation().addItem("yAxisLabel", "# Entries / bin");
+                
+                p1 = aida().cloud1D(particleName + ": Number of CalorimeterHits per Particle");
+                p1.annotation().addItem("xAxisLabel", "Number of Hits per Particle");
+                p1.annotation().addItem("yAxisLabel", "# Entries / bin");
 
                 ICloud2D p2 = aida().cloud2D(particleName + ": Momentum Theta vs. Phi");
                 p2.annotation().addItem("xAxisLabel", "Momentum theta (radians)");
@@ -650,7 +674,7 @@
                 p2 = aida().cloud2D(particleName + ": : Particle Energy vs Energy of Endpoint Daughters");
                 p2.annotation().addItem("xAxisLabel", "Particle Energy (GeV)");
                 p2.annotation().addItem("yAxisLabel", "Total Energy of End Point Daughters (GeV)");
-
+                               
                 for (MCParticleFlag flag : flagStats.flags())
                 {
                     p1 = aida().cloud1D(particleName + ": Status: " + flag.toString());

SlicDiagnostics/src/org/lcsim/slic/diagnostics
MCParticleUtil.java 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- MCParticleUtil.java	16 Mar 2006 02:35:22 -0000	1.2
+++ MCParticleUtil.java	1 Apr 2006 00:00:02 -0000	1.3
@@ -16,7 +16,7 @@
  * MCParticle utilities. 
  * 
  * @author jeremym
- * @version $Id: MCParticleUtil.java,v 1.2 2006/03/16 02:35:22 jeremy Exp $
+ * @version $Id: MCParticleUtil.java,v 1.3 2006/04/01 00:00:02 jeremy Exp $
  */
 public final class MCParticleUtil
 {
@@ -53,10 +53,25 @@
     {
         return VecOp.phi(particle.getMomentum());
     }
-   
-    /* 
-    // returns a list of all SimCalorimeterHits associated with this particle in the entire event
-    public static List<SimCalorimeterHit> getCalorimeterHits(EventHeader header, MCParticle particle)
+    
+    public static List<SimTrackerHit> findTrackerHits(EventHeader header, MCParticle particle)
+    {
+        List<SimTrackerHit> hitList = new ArrayList<SimTrackerHit>();
+        List<List<SimTrackerHit>> trackerHitColls = header.get(SimTrackerHit.class);
+        for ( List<SimTrackerHit> trackerHits : trackerHitColls)
+        {
+            for ( SimTrackerHit hit : trackerHits )
+            {
+                if ( hit.getMCParticle() == particle )
+                {
+                    hitList.add(hit);
+                }
+            }
+        }
+        return hitList;
+    }
+      
+    public static List<SimCalorimeterHit> findCalorimeterHits(EventHeader header, MCParticle particle)
     {
         List<SimCalorimeterHit> hits = new ArrayList<SimCalorimeterHit>();       
         List<List<SimCalorimeterHit>> colls = header.get(SimCalorimeterHit.class);
@@ -68,34 +83,14 @@
                 int nmc = hit.getMCParticleCount();
                 for (int i = 0; i < nmc; i++)
                 {
-                    // add to list, even if not biggest contributor 
-                    // (vast majority have single particle, anyways)
                     if (hit.getMCParticle(i) == particle)
                     {
                         hits.add(hit);
+                        break;
                     }
                 }
             }
         }
         return hits;
-    }
-    
-    // returns a list of all SimCalorimeterHits associated with this particle in the entire event
-    public static List<SimTrackerHit> getTrackerHits(EventHeader header, MCParticle particle)
-    {
-        List<SimTrackerHit> hits = new ArrayList<SimTrackerHit>();       
-        List<List<SimTrackerHit>> colls = header.get(SimTrackerHit.class);
-        
-        for (List<SimTrackerHit> coll : colls)
-        {
-            for (SimTrackerHit hit : coll)
-            {
-                if (hit.getMCParticle() == particle)
-                {
-                    hits.add(hit);
-                }
-            }
-        }
-        return hits;
-    }*/
+    }    
 }
CVSspam 0.2.8