Print

Print


Commit in lcsim/src/org/lcsim/recon/pfa/identifier on MAIN
LocalHelixExtrapolator.java+34-11.8 -> 1.9
MJC: Add compile-time option to use FCAL in track extrapolation

lcsim/src/org/lcsim/recon/pfa/identifier
LocalHelixExtrapolator.java 1.8 -> 1.9
diff -u -r1.8 -r1.9
--- LocalHelixExtrapolator.java	27 Jul 2008 05:59:52 -0000	1.8
+++ LocalHelixExtrapolator.java	12 Aug 2008 23:43:56 -0000	1.9
@@ -43,14 +43,18 @@
     protected double m_ECAL_barrel_r;
     protected double m_HCAL_barrel_r;
     protected double m_ECAL_endcap_z;
+    protected double m_FCAL_endcap_z;
     protected double m_HCAL_endcap_z;
     protected Vector<Double> m_ECAL_barrel_layering_r;
     protected Vector<Double> m_HCAL_barrel_layering_r;
     protected Vector<Double> m_ECAL_endcap_layering_z;
+    protected Vector<Double> m_FCAL_endcap_layering_z;
     protected Vector<Double> m_HCAL_endcap_layering_z;
     protected double m_ECAL_endcap_rmin;
+    protected double m_FCAL_endcap_rmin;
     protected double m_HCAL_endcap_rmin;
     protected double m_ECAL_endcap_rmax;
+    protected double m_FCAL_endcap_rmax;
     protected double m_HCAL_endcap_rmax;
     protected double[] m_fieldStrength;
     boolean m_barrelValid = false;
@@ -67,6 +71,16 @@
     boolean m_track_dphi_negative = false;
     EventHeader m_event = null;
 
+    boolean _debug = true;
+
+    boolean m_useFCAL = false;
+    boolean m_interceptsFCAL = false;
+
+    /** Allow use of FCAL. */
+    public void useFCAL(boolean use) {
+	m_useFCAL = use;
+    }
+
     /** Process this event, storing geometry info if needed. */
     public void process(EventHeader event) {
 	m_event = event;
@@ -80,6 +94,7 @@
 	CylindricalCalorimeter eme = ((CylindricalCalorimeter) det.getSubdetectors().get("EMEndcap"));
 	CylindricalCalorimeter hdb = ((CylindricalCalorimeter) det.getSubdetectors().get("HADBarrel"));
 	CylindricalCalorimeter hde = ((CylindricalCalorimeter) det.getSubdetectors().get("HADEndcap"));
+	CylindricalCalorimeter fwe = ((CylindricalCalorimeter) det.getSubdetectors().get("ForwardEMEndcap"));
 	m_ECAL_barrel_zmin = emb.getZMin();
 	m_HCAL_barrel_zmin = hdb.getZMin();
 	m_ECAL_barrel_zmax = emb.getZMax();
@@ -87,10 +102,13 @@
 	m_ECAL_barrel_r = emb.getLayering().getDistanceToLayerSensorMid(0);
 	m_HCAL_barrel_r = hdb.getLayering().getDistanceToLayerSensorMid(0);
 	m_ECAL_endcap_z = eme.getLayering().getDistanceToLayerSensorMid(0);
+	m_FCAL_endcap_z = fwe.getLayering().getDistanceToLayerSensorMid(0);
 	m_HCAL_endcap_z = hde.getLayering().getDistanceToLayerSensorMid(0);
 	m_ECAL_endcap_rmin = eme.getInnerRadius();
+	m_FCAL_endcap_rmin = fwe.getInnerRadius();
 	m_HCAL_endcap_rmin = hde.getInnerRadius();
 	m_ECAL_endcap_rmax = eme.getOuterRadius();
+	m_FCAL_endcap_rmax = fwe.getOuterRadius();
 	m_HCAL_endcap_rmax = hde.getOuterRadius();
 	double[] zero = {0, 0, 0};
 	m_fieldStrength = det.getFieldMap().getField(zero);
@@ -104,6 +122,11 @@
 	    double z = eme.getLayering().getDistanceToLayerSensorMid(iLayer);
 	    m_ECAL_endcap_layering_z.add(new Double(z));
 	}
+	m_FCAL_endcap_layering_z = new Vector<Double>();
+	for (int iLayer=0; iLayer<fwe.getLayering().getLayerCount(); iLayer++) {
+	    double z = fwe.getLayering().getDistanceToLayerSensorMid(iLayer);
+	    m_FCAL_endcap_layering_z.add(new Double(z));
+	}
 	m_HCAL_barrel_layering_r = new Vector<Double>();
 	for (int iLayer=0; iLayer<hdb.getLayering().getLayerCount(); iLayer++) {
 	    double r = hdb.getLayering().getDistanceToLayerSensorMid(iLayer);
@@ -207,6 +230,11 @@
 	double found_endcap_polar_r = Math.sqrt(found_endcap_x*found_endcap_x + found_endcap_y*found_endcap_y);
 	double found_endcap_polar_phi = Math.atan2(found_endcap_y, found_endcap_x);
 	m_endcapValid = (found_endcap_polar_r >= m_ECAL_endcap_rmin-m_cutSeparation && found_endcap_polar_r <= m_ECAL_endcap_rmax+m_cutSeparation);
+	boolean m_interceptsFCAL = false;
+	if (m_useFCAL) {
+	    m_endcapValid = m_endcapValid || (found_endcap_polar_r >= m_FCAL_endcap_rmin-m_cutSeparation && found_endcap_polar_r <= m_FCAL_endcap_rmax+m_cutSeparation);
+	    m_interceptsFCAL = (found_endcap_polar_r >= m_FCAL_endcap_rmin-m_cutSeparation && found_endcap_polar_r <= m_FCAL_endcap_rmax);
+	}
 	// Now project along to the barrel (harder!)
 	// We have phi such that (x-x_c)=a*cos(phi), (y-y_c)=a*sin(phi)
 	// Define theta such that x_c = b*cos(theta), y_c = b*sin(theta)
@@ -386,7 +414,6 @@
 
         double phi0 = Math.atan2(y0-m_trackParam_yc, x0-m_trackParam_xc); // in the range -pi through +pi
 
-        boolean _debug = true;
         if(_debug){
             Hep3Vector P = new BasicHep3Vector(tr.getMomentum());
             System.out.println("Center of radius= " + m_trackParam_xc + " " + m_trackParam_yc);                             
@@ -547,6 +574,12 @@
     }
     /** Assumes extrapolation has already been done. */
     public Hep3Vector extendToECALEndcapLayer(int layer) {
+	if (m_useFCAL && m_interceptsFCAL) {
+	    Hep3Vector vec = extendToEndcapLayer(layer, m_FCAL_endcap_layering_z, m_FCAL_endcap_rmin, m_FCAL_endcap_rmax);
+	    if (vec != null) {
+		return vec;
+	    }
+	}
 	return extendToEndcapLayer(layer, m_ECAL_endcap_layering_z, m_ECAL_endcap_rmin, m_ECAL_endcap_rmax);
     }
     /** Assumes extrapolation has already been done. */
CVSspam 0.2.8