Print

Print


Commit in lcsim/src/org/lcsim on MAIN
util/lcio/SIOCluster.java+91.9 -> 1.10
recon/postrecon/leptonID/ClusterSubdetectorEnergiesWriter.java+45added 1.1
+54
1 added + 1 modified, total 2 files
Adding a Driver to add subdetectorenergies to the cluster.
They should of course be written when the cluster is created, but slicPandora doesn't do that and the IsolatedLeptonFinder expects a double[]{ecalEnergy, hCalEnergy}
Needed a modification of SIOCluster.
Looks like it writes out the right information.
Still needs to be tested on IsolatedLeptonFinder

lcsim/src/org/lcsim/util/lcio
SIOCluster.java 1.9 -> 1.10
diff -u -r1.9 -r1.10
--- SIOCluster.java	9 Nov 2011 22:50:28 -0000	1.9
+++ SIOCluster.java	15 Oct 2012 16:13:23 -0000	1.10
@@ -203,6 +203,15 @@
         return subdetectorEnergies;
     }
 
+    /**
+     * Set the subdetector energy contributions
+     * @param energies
+     */
+    public void setSubdetectorEnergies(double[] energies)
+    {
+    	subdetectorEnergies = energies;
+    }
+
     public int getType()
     {
         return type;

lcsim/src/org/lcsim/recon/postrecon/leptonID
ClusterSubdetectorEnergiesWriter.java added at 1.1
diff -N ClusterSubdetectorEnergiesWriter.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ClusterSubdetectorEnergiesWriter.java	15 Oct 2012 16:13:23 -0000	1.1
@@ -0,0 +1,45 @@
+package org.lcsim.recon.postrecon.leptonID;
+
+import java.util.List;
+
+import org.lcsim.event.CalorimeterHit;
+import org.lcsim.event.Cluster;
+import org.lcsim.event.EventHeader;
+import org.lcsim.geometry.IDDecoder;
+import org.lcsim.util.Driver;
+import org.lcsim.util.lcio.SIOCluster;
+
+/**
+ * Driver to assign the subdetectorEnergies to the cluster object
+ * Convention:
+ * ecal == 0
+ * hcal == 1
+ * 
+ * That's all that's needed to make the IsolatedLeptonFinder happy
+ * @author jfstrube
+ *
+ */
+public class ClusterSubdetectorEnergiesWriter extends Driver {
+	public ClusterSubdetectorEnergiesWriter() {
+	}
+	public void process(EventHeader event) {
+		List<List<Cluster>> collectionList = event.get(Cluster.class);
+		for (List<Cluster> clusterCollection : collectionList) {
+			for (Cluster cluster : clusterCollection) {
+				double eCalEnergy = 0;
+				double hCalEnergy = 0;
+				List<CalorimeterHit> hitList = cluster.getCalorimeterHits();
+				for (CalorimeterHit hit : hitList) {
+					IDDecoder meta = hit.getIDDecoder();
+					String name = meta.getSubdetector().getName();
+					if (name.startsWith("Ecal")) {
+						eCalEnergy += hit.getCorrectedEnergy();
+					} else if (name.startsWith("Hcal")) {
+						hCalEnergy += hit.getCorrectedEnergy();
+					}
+				}
+				((SIOCluster)cluster).setSubdetectorEnergies(new double[] {eCalEnergy, hCalEnergy});
+			}
+		}
+	}
+}
CVSspam 0.2.12


Use REPLY-ALL to reply to list

To unsubscribe from the LCD-CVS list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=LCD-CVS&A=1