Print

Print


Commit in SlicDiagnostics/src/org/lcsim/slic/diagnostics on MAIN
MCParticlePlots.java+40-161.4 -> 1.5
Added a few more plots to MCParticlePlots.

SlicDiagnostics/src/org/lcsim/slic/diagnostics
MCParticlePlots.java 1.4 -> 1.5
diff -u -r1.4 -r1.5
--- MCParticlePlots.java	5 Aug 2005 21:55:38 -0000	1.4
+++ MCParticlePlots.java	5 Aug 2005 23:31:26 -0000	1.5
@@ -10,13 +10,15 @@
 import java.util.Map;
 import java.util.HashMap;
 
-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.vec.VecOp;
 import hep.physics.particle.properties.ParticlePropertyManager;
 import hep.physics.particle.properties.ParticlePropertyProvider;
+
+import org.lcsim.util.aida.AIDA;
+import org.lcsim.event.MCParticle;
 import org.lcsim.util.Driver;
 
 /**
@@ -27,6 +29,7 @@
 {
     ParticlePropertyProvider mcpLkp = ParticlePropertyManager.getParticlePropertyProvider();
     
+    /* bins for sim status plot */
     public static final double SIMULATION = 1.0;
     public static final double BACKSCATTER = 2.0;
     public static final double VERTEX_NOT_ENDPOINT = 3.0;
@@ -35,9 +38,13 @@
     public static final double LEFT = 6.0;
     public static final double STOPPED = 7.0; 
     
+    /* plots */
     ICloud1D mcpCount;
     ICloud1D mcpTotalEnergyFinalState;
-    IHistogram1D mcpStatusCodes;
+    ICloud1D mcpCosTheta;
+    ICloud1D mcpPhi;
+    IHistogram1D mcpSimStatus;
+    IHistogram1D mcpGenStatus;    
     
     Map<String, Integer> particleCounts = new HashMap<String,Integer>();
     
@@ -61,9 +68,12 @@
     {
         super.definePlots();
         
-        mcpCount = aida.cloud1D("mcp_numPerEvent");
-        mcpTotalEnergyFinalState = aida.cloud1D("mcp_finalStateETotPerEvent");
-        mcpStatusCodes = aida.histogram1D("mcp_statusCodes", 7, 1.0, 8.0);
+        mcpCount = aida.cloud1D("mcp_countByEvent");
+        mcpTotalEnergyFinalState = aida.cloud1D("mcp_finalStateEnergyTotalByEvent");
+        mcpSimStatus = aida.histogram1D("mcp_simStatusCode", 7, 1.0, 8.0);
+        mcpGenStatus = aida.histogram1D("mcp_generatorStatusCode", 4, 0.0, 4.0);
+        mcpCosTheta = aida.cloud1D("mcp_momentumCosTheta");
+        mcpPhi = aida.cloud1D("mcp_momentumPhi");
     }
     
     public void fill()
@@ -86,7 +96,16 @@
                 /* fill simulator status plot */
                 fill(particle.getSimulatorStatus());
                 
-                /* make plots for each final state particle type */
+                /* fill generator status plot */
+                mcpGenStatus.fill(particle.getGeneratorStatus());
+                
+                /* fill cosTheta of momentum plot */
+                mcpCosTheta.fill(VecOp.cosTheta(particle.getMomentum()));
+                
+                /* fill phi of momentum plot */
+                mcpPhi.fill(VecOp.phi(particle.getMomentum()));
+                
+                /* fill plots for each final state particle type */
                 if ( particle.getGeneratorStatus() == MCParticle.FINAL_STATE )
                 {
                     totE += particle.getEnergy();
@@ -113,6 +132,10 @@
                                 HitUtil.getPhi(particle.getMomentum().v())
                                 );
                         
+                        /* particle cosTheta */
+                        aida.cloud1D(particleName + "_momentumCosTheta").fill(
+                                VecOp.cosTheta(particle.getMomentum()));
+                        
                         /* keep track of particle counts */
                         if ( particleCounts.containsKey(particleName) )
                         {
@@ -134,7 +157,7 @@
             for ( String k : particleCounts.keySet() )
             {
                 tree.cd(k);
-                aida.cloud1D(k + "_eventCount").fill(particleCounts.get(k));
+                aida.cloud1D(k + "_countByEvent").fill(particleCounts.get(k));
                 tree.cd("..");
             }
             
@@ -146,41 +169,42 @@
         }
     }
     
-    void fill(MCParticle.SimulatorStatus status)
+    /** Fill the simulator status plot. */
+    private void fill(MCParticle.SimulatorStatus status)
     {
         if ( status.isCreatedInSimulation() )
         {
-            mcpStatusCodes.fill(SIMULATION);
+            mcpSimStatus.fill(SIMULATION);
         }
         
         if ( status.isBackscatter() )
         {
-            mcpStatusCodes.fill(BACKSCATTER);
+            mcpSimStatus.fill(BACKSCATTER);
         }
         
         if ( status.vertexIsNotEndpointOfParent() )
         {
-            mcpStatusCodes.fill(VERTEX_NOT_ENDPOINT);
+            mcpSimStatus.fill(VERTEX_NOT_ENDPOINT);
         }
         
         if ( status.isDecayedInTracker() )
         {
-            mcpStatusCodes.fill(DECAYED_TRACKER);
+            mcpSimStatus.fill(DECAYED_TRACKER);
         }
         
         if ( status.isDecayedInCalorimeter() )
         {
-            mcpStatusCodes.fill(DECAYED_CALORIMETER);
+            mcpSimStatus.fill(DECAYED_CALORIMETER);
         }
         
         if ( status.hasLeftDetector() )
         {
-            mcpStatusCodes.fill(LEFT);
+            mcpSimStatus.fill(LEFT);
         }
         
         if ( status.isStopped() )
         {
-            mcpStatusCodes.fill(STOPPED);
+            mcpSimStatus.fill(STOPPED);
         }         
     }
 }
CVSspam 0.2.8