lcsim/src/org/lcsim/contrib/uiowa
diff -u -r1.1 -r1.2
--- HitNearBarrelEndcapBoundaryDecision.java 2 Jun 2008 19:34:08 -0000 1.1
+++ HitNearBarrelEndcapBoundaryDecision.java 2 Jun 2008 19:50:01 -0000 1.2
@@ -5,6 +5,7 @@
import org.lcsim.recon.cluster.util.HitInECALDecision;
import org.lcsim.event.*;
+import org.lcsim.util.*;
import org.lcsim.detector.solids.*;
import org.lcsim.detector.*;
import org.lcsim.geometry.subdetector.*;
@@ -12,11 +13,11 @@
/**
* Determine whether a hit is in the boundary region near the barrel/endcap interface.
*
- * @version $Id: HitNearBarrelEndcapBoundaryDecision.java,v 1.1 2008/06/02 19:34:08 mcharles Exp $
+ * @version $Id: HitNearBarrelEndcapBoundaryDecision.java,v 1.2 2008/06/02 19:50:01 mcharles Exp $
* @author Mat Charles
*/
-public class HitNearBarrelEndcapBoundaryDecision implements DecisionMakerSingle<CalorimeterHit>
+public class HitNearBarrelEndcapBoundaryDecision extends Driver implements DecisionMakerSingle<CalorimeterHit>
{
protected double m_cutEcal = 0.0;
protected double m_cutHcal = 0.0;
@@ -36,13 +37,15 @@
m_barrelLayerRange = barrelLayerRange;
}
- // A couple of pieces of geometry information cannot be figured out on the
- // fly, so we have to know them in advance.
protected double m_ECAL_endcap_zmin;
protected double m_ECAL_endcap_zmax;
protected double m_HCAL_endcap_zmin;
protected double m_HCAL_endcap_zmax;
- protected void initGeometry(EventHeader event) {
+ /**
+ * A couple of pieces of geometry information cannot be figured out on the
+ * fly, so we have to know them in advance.
+ */
+ public void initGeometry(EventHeader event) {
org.lcsim.geometry.Detector det = event.getDetector();
CylindricalCalorimeter endcapECAL = ((CylindricalCalorimeter) det.getSubdetectors().get("EMEndcap"));
CylindricalCalorimeter endcapHCAL = ((CylindricalCalorimeter) det.getSubdetectors().get("HADEndcap"));
@@ -52,6 +55,14 @@
m_HCAL_endcap_zmax = endcapHCAL.getZMax();
}
+ /**
+ * This class needs some geometry information which has to come from event.
+ * You can supply this with initGeometry(), or you can add the class as a
+ * Driver in which case it'll pick it up automatically.
+ */
+ public void process(EventHeader event) {
+ initGeometry(event);
+ }
/**
* Check whether the hit is near the boundary.