Print

Print


Commit in SlicDiagnostics/src/org/lcsim/slic/diagnostics on MAIN
MCParticlePlots.java+62-141.17 -> 1.18
JM: Add particle resolution plots based on suggestions from Ron

SlicDiagnostics/src/org/lcsim/slic/diagnostics
MCParticlePlots.java 1.17 -> 1.18
diff -u -r1.17 -r1.18
--- MCParticlePlots.java	9 Feb 2006 01:13:19 -0000	1.17
+++ MCParticlePlots.java	10 Feb 2006 01:03:59 -0000	1.18
@@ -1,23 +1,27 @@
 package org.lcsim.slic.diagnostics;
 
 import static java.lang.Math.log10;
-import hep.aida.ICloud1D;
-import hep.physics.vec.Hep3Vector;
-import hep.physics.vec.VecOp;
+import static java.lang.Math.sqrt;
 
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import hep.aida.ICloud1D;
+import hep.physics.vec.Hep3Vector;
+import hep.physics.vec.VecOp;
+
+import org.lcsim.event.Cluster;
 import org.lcsim.event.EventHeader;
 import org.lcsim.event.MCParticle;
+import org.lcsim.recon.cluster.cheat.CheatCluster;
 
 /**
- * A set of MCParticle plots, including individual particle types such as 
- * gamma, K0L, etc.
+ * A set of MCParticle plots, including individual particle types such as gamma,
+ * K0L, etc.
  * 
  * @author jeremym
- * @version $Id: MCParticlePlots.java,v 1.17 2006/02/09 01:13:19 jeremy Exp $
+ * @version $Id: MCParticlePlots.java,v 1.18 2006/02/10 01:03:59 jeremy Exp $
  */
 class MCParticlePlots extends AbstractPlots
 {
@@ -240,6 +244,9 @@
                 // get info about this particle type
                 MCParticleTypeInfo info = getMCParticleInfo(particle.getPDGID());
 
+                // Get particle name
+                String particleName = info.getName();
+
                 // status flag counts
                 info.incrFlagStats(particle);
 
@@ -255,11 +262,6 @@
                 // vtx to EP distance for gen FS particles
                 if (hasEndpoint && vtxEPdist > 0)
                 {
-                    // System.out.println("origin=" + origin);
-                    // System.out.println("endpoint=" + endpoint);
-                    // System.out.println("vtxEPDist=" + vtxEPdist);
-                    // System.out.println();
-
                     // vtx to EP distance
                     _mcpVtxToEPDist.fill(vtxEPdist);
 
@@ -275,8 +277,6 @@
                     }
                 }
 
-                String particleName = info.getName();
-
                 try
                 {
                     _tree.mkdir(particleName);
@@ -286,8 +286,44 @@
                 }
                 _tree.cd(particleName);
 
+                // Check that the particle information is valid before proceeding with plots.
                 if (particleName != null && !particleName.equals(""))
                 {
+                    // E(measured) vs. E(genenerated) for each particle type
+                    List<Cluster> clusters = getEventHeader().get(Cluster.class, "RefinedCheatClusters");
+                    
+                    for (Cluster cluster : clusters)
+                    {
+                        CheatCluster cheat = (CheatCluster) cluster;
+
+                        if (cheat.getMCParticle() == particle)
+                        {
+                            // CheatCluster energy
+                            double clusterE = cheat.getEnergy();
+                            
+                            // Add to measured energy of this particle type
+                            info.addEventMeasuredEnergy(clusterE);
+
+                            // CheatCluster energy minus MCParticle Energy
+                            double deltaE = clusterE - energy;
+
+                            // Delta over sqrt(E)
+                            double delta1 = deltaE / (sqrt(energy));
+
+                            // Delta over E
+                            double delta2 = deltaE / energy;
+
+                            // Plot dE / sqrt(E_generated)
+                            _aida.cloud1D(particleName + ": dE over sqrt(E_generated) for each particle").fill(delta1);
+
+                            // Plot dE / E_generated
+                            _aida.cloud1D(particleName + ": dE over E_generated for each particle").fill(delta2);
+
+                            // Break, because only a single cluster should exist for each MCParticle.
+                            break;
+                        }
+                    }
+
                     // particle energy
                     _aida.cloud1D(particleName + ": Energy").fill(particle.getEnergy());
 
@@ -364,6 +400,7 @@
             }
         }
 
+        // Do event summary plots of the particle types.
         for (MCParticleTypeInfo info : _mcpMap.values())
         {
             String k = info.getName();
@@ -401,7 +438,18 @@
             {
                 _aida.cloud1D(k + ": Status: " + flag.toString()).fill(pstats.getFlagCount(flag));
             }
-
+            
+            // E(measured) vs. E(genenerated)
+            double deltaE = info.getEventEnergy() - info.getEventMeasuredEnergy();
+            double delta1 = deltaE / sqrt(info.getEventEnergy());
+            double delta2 = deltaE / info.getEventEnergy();
+
+            // Plot dE / sqrt(E_generated) for the event
+            _aida.cloud1D(k + ": dE over sqrt(E_generated) for Event").fill(delta1);
+            
+            // Plot dE / E for the event
+            _aida.cloud1D(k + ": dE over E for Event").fill(delta2);
+            
             // reset the MCParticleTypeInfo
             info.resetTotals();
 
CVSspam 0.2.8