lcsim/src/org/lcsim/recon/cluster/util
diff -N HitInMCALDecision.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ HitInMCALDecision.java 13 Oct 2008 06:47:45 -0000 1.1
@@ -0,0 +1,30 @@
+package org.lcsim.recon.cluster.util;
+
+import org.lcsim.event.CalorimeterHit;
+import org.lcsim.util.decision.DecisionMakerSingle;
+
+/**
+ * Require hit to be in the muon system.
+ * Implementation is not beautiful, but at least this way it
+ * only needs fixing in one place...
+ *
+ * @version $Id: HitInMCALDecision.java,v 1.1 2008/10/13 06:47:45 mcharles Exp $
+ */
+
+public class HitInMCALDecision implements DecisionMakerSingle<CalorimeterHit>
+{
+ /** Simple constructor. */
+ public HitInMCALDecision() {}
+
+ /**
+ * Check whether this hit is in muon system.
+ * This implementation checks the string name of
+ * the subdetector, which is not very general or
+ * very efficient.
+ */
+ public boolean valid(CalorimeterHit hit) {
+ org.lcsim.geometry.Subdetector subdet = hit.getSubdetector();
+ String name = subdet.getName();
+ return (name.compareTo("MuonBarrel") == 0 || name.compareTo("MuonEndcap") == 0);
+ }
+}