Print

Print


Commit in hps-java/src/main/java/org/lcsim/hps on MAIN
analysis/ecal/HPSEcalPlotsDriver.java+12-1081.3 -> 1.4
recon/ecal/HPSEcalClusterer.java+1-21.5 -> 1.6
+13-110
2 modified files
minor updates to ecal drivers

hps-java/src/main/java/org/lcsim/hps/analysis/ecal
HPSEcalPlotsDriver.java 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- HPSEcalPlotsDriver.java	25 May 2011 20:55:52 -0000	1.3
+++ HPSEcalPlotsDriver.java	27 May 2011 20:43:03 -0000	1.4
@@ -19,7 +19,6 @@
 import org.lcsim.event.Cluster;
 import org.lcsim.event.EventHeader;
 import org.lcsim.event.MCParticle;
-import org.lcsim.geometry.IDDecoder;
 import org.lcsim.units.SystemOfUnits;
 import org.lcsim.util.Driver;
 import org.lcsim.util.aida.AIDA;
@@ -28,12 +27,8 @@
  * Diagnostic plots for HPS ECal.
  * 
  * @author Jeremy McCormick <[log in to unmask]>
- * @version $Id: HPSEcalPlotsDriver.java,v 1.3 2011/05/25 20:55:52 jeremy Exp $
+ * @version $Id: HPSEcalPlotsDriver.java,v 1.4 2011/05/27 20:43:03 jeremy Exp $
  */
-// TODO ZY plot can use h2d with small bins in Y to avoid weird binning effect
-// TODO ZY of cluster positions (algo from Tim to find pos)
-// TODO ZY of cluster seed
-
 public class HPSEcalPlotsDriver extends Driver 
 {
     String ecalCollectionName = "EcalHits";
@@ -71,15 +66,6 @@
     ICloud1D clusSeedDistPlot;
     ICloud2D leadClusAndPrimaryPlot;
     IHistogram1D clusNHits;
-
-    //ICloud1D hit50MeVPlot;
-    //ICloud1D hit30MeVPlot;
-    
-    //ICloud1D residualAllPlot;
-    //ICloud1D residualPlot;    
-    //ICloud1D residualMaxHitPlot;
-    //ICloud1D residualTop2Plot;
-    //ICloud1D residualTop3Plot;
         
     class MCParticleEComparator implements Comparator<MCParticle>
     {
@@ -121,6 +107,16 @@
         }       
     }
     
+    public void setEcalCollectionName(String ecalCollectionName)
+    {
+        this.ecalCollectionName = ecalCollectionName;
+    }
+    
+    public void setEcalClusterCollectionName(String ecalClusterCollectionName)
+    {
+        this.ecalClusterCollectionName = ecalClusterCollectionName;
+    }    
+    
     public void startOfData()
     {
         timePlot = aida.cloud1D(ecalCollectionName + " : Hit Time");
@@ -153,15 +149,6 @@
         eventEPlot = aida.cloud1D("MCParticle: Total Gen FS Electron E in Event");
         eventEPlot.annotation().addItem("xAxisLabel", "E [GeV]");
         
-        //residualPlot = aida.cloud1D(ecalCollectionName + " : Residual with Highest E Particle [GeV]");
-        //residualPlot.annotation().addItem("xAxisLabel", "E [GeV]");
-        
-        //residualAllPlot = aida.cloud1D(ecalCollectionName + " : Resdual with All Final State Electrons [GeV]");
-        //residualAllPlot.annotation().addItem("xAxisLabel", "E [GeV]");
-        
-        //residualMaxHitPlot = aida.cloud1D(ecalCollectionName + " : Residual of Max Hit and Highest E Electron");
-        //residualMaxHitPlot.annotation().addItem("xAxisLabel", "E [GeV]");
-        
         hitYZPlot = aida.cloud2D(ecalCollectionName + " : Y vs Z");        
         hitYZPlot.annotation().addItem("xAxisLabel", "Y [mm]");
         hitYZPlot.annotation().addItem("yAxisLabel", "Z [mm]");
@@ -170,12 +157,6 @@
         hitXZPlot.annotation().addItem("xAxisLabel", "X [mm]");
         hitXZPlot.annotation().addItem("yAxisLabel", "Z [mm]");
         
-        //residualTop2Plot = aida.cloud1D(ecalCollectionName + " : Residual with Top 2 FS Particle E");
-        //residualTop2Plot.annotation().addItem("xAxisLabel", "E [GeV]");
-        
-        //residualTop3Plot = aida.cloud1D(ecalCollectionName + " : Residual with Top 3 FS Particle E");
-        //residualTop3Plot.annotation().addItem("xAxisLabel", "E [GeV]");              
-        
         fsPlot  = aida.cloud1D("MCParticle: Number of Final State Particles");
         fsPlot.annotation().addItem("xAxisLabel", "Number of FS Particles");
         
@@ -185,12 +166,6 @@
         nclusPlot = aida.histogram1D(ecalClusterCollectionName + " : Number of Clusters", 20, 0, 20);
         nclusPlot.annotation().addItem("xAxisLabel", "Number of Clusters");
         
-        //hit50MeVPlot = aida.cloud1D(ecalCollectionName + " : Hits with E < 50 MeV");
-        //hit50MeVPlot.annotation().addItem("xAxisLabel", "Number of Hits");
-        
-        //hit30MeVPlot = aida.cloud1D(ecalCollectionName + " : Hits with E < 30 MeV");
-        //hit30MeVPlot.annotation().addItem("xAxisLabel", "Number of Hits");
-        
         hitUnder100MeVPlot = aida.cloud1D(ecalCollectionName + " : Hits with E < 100 MeV");
         hitUnder100MeVPlot.annotation().addItem("xAxisLabel", "Number of Hits");
         
@@ -260,10 +235,6 @@
         // n hits
         hitCountPlot.fill(nhits);
         
-        //int naccept = 0;
-                               
-        //int nhits50MeV = 0;
-        //int nhits30MeV = 0;
         int nhits100MeV = 0;
         int nhitsOver100MeV = 0;
         
@@ -283,16 +254,6 @@
                 nhits100MeV++;
             }
             
-            //if (eraw < 0.05)
-            //{
-            //    nhits50MeV++;
-            //}       
-            
-            //if (eraw < 0.03)
-            //{
-            //    nhits30MeV++;
-            //}
-            
             // time
             timePlot.fill(hit.getTime());
             
@@ -323,8 +284,6 @@
         }
         
         hitUnder100MeVPlot.fill(nhits100MeV);
-        //hit50MeVPlot.fill(nhits50MeV);        
-        //hit30MeVPlot.fill(nhits30MeV);
         hitOver100MeVPlot.fill(nhitsOver100MeV);
                                               
         // total E in Cal
@@ -343,28 +302,10 @@
         MCParticle primary = getPrimary(mcparticles);
         double primaryE = primary.getEnergy();
         primaryEPlot.fill(primaryE);
-        
-        // residual using highest E primary
-        //double singleResidual = esum - primaryE;
-        //residualPlot.fill(singleResidual);        
      
         // event energy                         
         double eventE = getPrimaryE(mcparticles);
         eventEPlot.fill(eventE);
-        
-        // event residual
-        //double residual = esum - eventE;
-        //residualAllPlot.fill(residual);
-        
-        // hottest hit residual with highest E particle
-        //residualMaxHitPlot.fill(emax - primaryE);
-        
-        // Residual with two 
-        //double res2 = esum - e2;
-        //residualTop2Plot.fill(res2);
-        
-        //double res3 = esum - e3;
-        //residualTop3Plot.fill(res3);
 
         List<Cluster> clusters = event.get(Cluster.class, ecalClusterCollectionName);
         if (clusters == null)
@@ -391,7 +332,6 @@
         Map<CalorimeterHit,Integer> hitClusMap = new HashMap<CalorimeterHit,Integer>();
                         
         double clusE = 0;
-        Set<CalorimeterHit> naughty = new HashSet<CalorimeterHit>();
         for (Cluster clus : clusters)
         {
             clusNHits.fill(clus.getCalorimeterHits().size());
@@ -407,12 +347,7 @@
                 {
                     int nshared = hitClusMap.get(hit);
                     ++nshared;
-                    
-                    // debug
-                    if (nshared >= 4)
-                        naughty.add(hit);
-                    //
-                    
+                   
                     hitClusMap.put(hit, nshared);
                 }
                 else
@@ -436,27 +371,6 @@
             clusSeedEPlot.fill(seedHit.getRawEnergy());            
         }
         
-        // debug of clusters with too many hits
-        for (CalorimeterHit duggan : naughty)
-        {
-            for (Cluster clus : clusters)
-            {
-                if (clus.getCalorimeterHits().contains(duggan))
-                {
-                    System.out.println("naughty clus w/ " + clus.getCalorimeterHits().size() + " hits and E = " + clus.getEnergy());
-                    for (CalorimeterHit clusHit : clus.getCalorimeterHits())
-                    {
-                        IDDecoder dec = clusHit.getIDDecoder();
-                        dec.setID(clusHit.getCellID());
-                        int ix = dec.getValue("ix");
-                        int iy = dec.getValue("iy");
-                        int side = dec.getValue("side");
-                        System.out.println("  x, y, side, E: " + ix + ", " + iy + ", " + side + ", " + clusHit.getRawEnergy());
-                    }
-                }
-            }
-        }
-        
         // Total E in all clusters.
         clusTotEPlot.fill(clusE);
         
@@ -511,14 +425,4 @@
         }
         return fsParticles;
     }
-    
-    public void setEcalCollectionName(String ecalCollectionName)
-    {
-        this.ecalCollectionName = ecalCollectionName;
-    }
-    
-    public void setEcalClusterCollectionName(String ecalClusterCollectionName)
-    {
-        this.ecalClusterCollectionName = ecalClusterCollectionName;
-    }    
 }

hps-java/src/main/java/org/lcsim/hps/recon/ecal
HPSEcalClusterer.java 1.5 -> 1.6
diff -u -r1.5 -r1.6
--- HPSEcalClusterer.java	25 May 2011 20:55:36 -0000	1.5
+++ HPSEcalClusterer.java	27 May 2011 20:43:03 -0000	1.6
@@ -12,7 +12,6 @@
 import org.lcsim.geometry.Detector;
 import org.lcsim.geometry.IDDecoder;
 import org.lcsim.geometry.subdetector.HPSEcal;
-import org.lcsim.geometry.util.IDEncoder;
 import org.lcsim.recon.cluster.util.BasicCluster;
 import org.lcsim.util.Driver;
 import org.lcsim.util.lcio.LCIOConstants;
@@ -23,7 +22,7 @@
  * Clustering algorithm is from pages 83 and 84 of the HPS Proposal. 
  * 
  * @author Jeremy McCormick <[log in to unmask]>
- * @version $Id: HPSEcalClusterer.java,v 1.5 2011/05/25 20:55:36 jeremy Exp $
+ * @version $Id: HPSEcalClusterer.java,v 1.6 2011/05/27 20:43:03 jeremy Exp $
  */
 public class HPSEcalClusterer extends Driver 
 {
CVSspam 0.2.8