Print

Print


Commit in SlicDiagnostics/src/org/lcsim/slic/diagnostics on MAIN
ClusterPlots.java+77added 1.1
ClusterPlotsDriver.java+28added 1.1
+105
2 added files
Adding basic cluster plots.

SlicDiagnostics/src/org/lcsim/slic/diagnostics
ClusterPlots.java added at 1.1
diff -N ClusterPlots.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ClusterPlots.java	5 Jan 2006 03:22:03 -0000	1.1
@@ -0,0 +1,77 @@
+package org.lcsim.slic.diagnostics;
+
+import org.lcsim.event.Cluster;
+import org.lcsim.event.EventHeader;
+import org.lcsim.event.EventHeader.LCMetaData;
+import org.lcsim.util.Driver;
+import org.lcsim.util.aida.AIDA;
+import java.util.List;
+
+/**
+ * @author jeremym
+ * @version $Id: ClusterPlots.java,v 1.1 2006/01/05 03:22:03 jeremy Exp $
+ */
+class ClusterPlots extends AbstractPlots
+{    
+    public ClusterPlots()
+    {
+        super("Clusters", null);
+    }
+    
+    protected void fill(EventHeader event)
+    {
+//
+// Find all the cluster Lists
+//
+        List<List<Cluster>> clusterSets = event.get(Cluster.class);
+//
+// Loop over all the cluster Lists
+//
+        for (List<Cluster> clusters : clusterSets)
+        {
+//
+// Get the ClusterList name
+//
+            String name = getBaseDir() + "/" + event.getMetaData(clusters).getName();
+//            System.out.println("cluster plots name - " + name);
+            
+            try
+            {
+                _tree.mkdirs(name);
+            }
+            catch (Exception e)
+            {}                    
+//
+// Loop over all the clusters in a List
+//
+            _tree.cd(name);
+//            System.out.println("curr dir - " + _tree.pwd() );
+            _aida.cloud1D("Number of Clusters").fill(clusters.size());
+            for (Cluster cluster : clusters)
+            {
+//
+// Histogram the "corrected" energy
+//
+                _aida.cloud1D("Energy").fill(cluster.getEnergy());
+//
+// Histogram the position as R vs Z
+//
+                double[] pos = cluster.getPosition();
+                double R = Math.sqrt(pos[0]*pos[0] + pos[1]*pos[1]);
+                _aida.cloud2D("Position: R vs Z").fill(pos[2],R);
+//
+// Histogram the computed direction
+//
+                _aida.cloud1D("Direction: theta").fill(cluster.getITheta());
+                _aida.cloud1D("Direction: phi").fill(cluster.getIPhi());
+//
+// Histogram the difference in direction and position theta,phi
+//
+                double posphi = Math.atan2(pos[1],pos[0]);
+                _aida.cloud1D("Delta Phi").fill(posphi - cluster.getIPhi());
+                double postheta = Math.PI/2. - Math.atan2(pos[2],R);
+                _aida.cloud1D("Delta Theta").fill(postheta - cluster.getITheta());
+            }
+        }
+    }
+}

SlicDiagnostics/src/org/lcsim/slic/diagnostics
ClusterPlotsDriver.java added at 1.1
diff -N ClusterPlotsDriver.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ClusterPlotsDriver.java	5 Jan 2006 03:22:03 -0000	1.1
@@ -0,0 +1,28 @@
+package org.lcsim.slic.diagnostics;
+
+import hep.aida.ICloud2D;
+import java.util.List;
+import org.lcsim.event.EventHeader;
+import org.lcsim.event.EventHeader.LCMetaData;
+import org.lcsim.event.SimCalorimeterHit;
+import org.lcsim.util.aida.AIDA;
+
+/**
+ * @author jeremym
+ * @version $Id: ClusterPlotsDriver.java,v 1.1 2006/01/05 03:22:03 jeremy Exp $
+ */
+public class ClusterPlotsDriver extends PlotsDriver
+{ 
+    ClusterPlots _plots = new ClusterPlots();
+    
+    ClusterPlotsDriver(SlicDiagnosticsDriver mom)
+    {
+        super(mom);
+    }
+    
+    protected void process(EventHeader event)
+    {
+        super.process(event);
+        _plots.fill(event);
+    }
+}
\ No newline at end of file
CVSspam 0.2.8