Commit in SlicDiagnostics/src/org/lcsim/slic/diagnostics on MAIN
MCParticlePlots.java+53-11.3 -> 1.4
Added plots for SimulatorStatus codes after update to lcsim by Tony.

SlicDiagnostics/src/org/lcsim/slic/diagnostics
MCParticlePlots.java 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- MCParticlePlots.java	1 Aug 2005 06:33:51 -0000	1.3
+++ MCParticlePlots.java	5 Aug 2005 21:55:38 -0000	1.4
@@ -12,6 +12,7 @@
 
 import org.lcsim.util.aida.AIDA;
 import hep.aida.ICloud1D;
+import hep.aida.IHistogram1D;
 import hep.aida.ITree;
 import org.lcsim.event.MCParticle;
 import hep.physics.particle.properties.ParticlePropertyManager;
@@ -26,8 +27,17 @@
 {
     ParticlePropertyProvider mcpLkp = ParticlePropertyManager.getParticlePropertyProvider();
     
+    public static final double SIMULATION = 1.0;
+    public static final double BACKSCATTER = 2.0;
+    public static final double VERTEX_NOT_ENDPOINT = 3.0;
+    public static final double DECAYED_TRACKER = 4.0;
+    public static final double DECAYED_CALORIMETER = 5.0;
+    public static final double LEFT = 6.0;
+    public static final double STOPPED = 7.0; 
+    
     ICloud1D mcpCount;
     ICloud1D mcpTotalEnergyFinalState;
+    IHistogram1D mcpStatusCodes;
     
     Map<String, Integer> particleCounts = new HashMap<String,Integer>();
     
@@ -50,9 +60,10 @@
     public void definePlots()
     {
         super.definePlots();
+        
         mcpCount = aida.cloud1D("mcp_numPerEvent");
         mcpTotalEnergyFinalState = aida.cloud1D("mcp_finalStateETotPerEvent");
-        tree.cd("..");
+        mcpStatusCodes = aida.histogram1D("mcp_statusCodes", 7, 1.0, 8.0);
     }
     
     public void fill()
@@ -72,6 +83,9 @@
             totE = 0;
             for ( MCParticle particle : particles)
             {
+                /* fill simulator status plot */
+                fill(particle.getSimulatorStatus());
+                
                 /* make plots for each final state particle type */
                 if ( particle.getGeneratorStatus() == MCParticle.FINAL_STATE )
                 {
@@ -131,4 +145,42 @@
             mcpTotalEnergyFinalState.fill(totE);
         }
     }
+    
+    void fill(MCParticle.SimulatorStatus status)
+    {
+        if ( status.isCreatedInSimulation() )
+        {
+            mcpStatusCodes.fill(SIMULATION);
+        }
+        
+        if ( status.isBackscatter() )
+        {
+            mcpStatusCodes.fill(BACKSCATTER);
+        }
+        
+        if ( status.vertexIsNotEndpointOfParent() )
+        {
+            mcpStatusCodes.fill(VERTEX_NOT_ENDPOINT);
+        }
+        
+        if ( status.isDecayedInTracker() )
+        {
+            mcpStatusCodes.fill(DECAYED_TRACKER);
+        }
+        
+        if ( status.isDecayedInCalorimeter() )
+        {
+            mcpStatusCodes.fill(DECAYED_CALORIMETER);
+        }
+        
+        if ( status.hasLeftDetector() )
+        {
+            mcpStatusCodes.fill(LEFT);
+        }
+        
+        if ( status.isStopped() )
+        {
+            mcpStatusCodes.fill(STOPPED);
+        }         
+    }
 }
CVSspam 0.2.8