Print

Print


Commit in lcsim/src/org/lcsim/recon/pfa/structural on MAIN
PreShowerMIPReassignmentAlgorithm.java+29-131.5 -> 1.6
SetUpPFA.java+11.9 -> 1.10
LayerBasedMIPGeometryHandler.java+6-61.6 -> 1.7
ReclusterDTreeDriver.java+8-71.29 -> 1.30
+44-26
4 modified files
Use Vlayer where appropriate, get cal info from CalorimeterInformation class

lcsim/src/org/lcsim/recon/pfa/structural
PreShowerMIPReassignmentAlgorithm.java 1.5 -> 1.6
diff -u -r1.5 -r1.6
--- PreShowerMIPReassignmentAlgorithm.java	22 Oct 2008 17:53:43 -0000	1.5
+++ PreShowerMIPReassignmentAlgorithm.java	8 Mar 2010 19:39:09 -0000	1.6
@@ -8,6 +8,8 @@
 import org.lcsim.geometry.Subdetector;
 import org.lcsim.recon.pfa.identifier.*;
 import org.lcsim.recon.cluster.util.BasicCluster;
+import org.lcsim.recon.util.CalorimeterInformation;
+import org.lcsim.geometry.Calorimeter.CalorimeterType;
 
 public class PreShowerMIPReassignmentAlgorithm implements ReassignClustersAlgorithm {
 
@@ -18,6 +20,12 @@
     protected String m_mapTrackToMipName;
     protected Map<Track, Hep3Vector> m_cachePoint;
     protected Map<Track, Hep3Vector> m_cacheTangent;
+    protected CalorimeterInformation ci;
+    protected Subdetector emb;
+    protected Subdetector eme;
+    protected Subdetector hadb;
+    protected Subdetector hade;
+    protected Subdetector mue;
 
     public PreShowerMIPReassignmentAlgorithm(EventHeader event, double limit, String mapTrackToMip) {
 	m_event = event;
@@ -30,6 +38,15 @@
     }
 
     public Double computeFigureOfMerit(Track tr, Cluster clus) {
+        if(ci == null)
+        {
+            ci = CalorimeterInformation.instance();
+            emb = ci.getSubdetector(CalorimeterType.EM_BARREL);
+            eme = ci.getSubdetector(CalorimeterType.EM_ENDCAP);
+            hadb = ci.getSubdetector(CalorimeterType.HAD_BARREL);
+            hade = ci.getSubdetector(CalorimeterType.HAD_ENDCAP);
+            mue = ci.getSubdetector(CalorimeterType.MUON_ENDCAP);
+        }
 	// Handle possibility of multiple-track-tracks
 	if (tr.getTracks().size() != 0) {
 	    // There's more than one daughter -- is this a known case?
@@ -144,9 +161,9 @@
 	outputPoint.setV(outermostPosition.x(), outermostPosition.y(), outermostPosition.z());
 
 	// Check layer index:
-	int lastLayer = getLayer(outermostHitsInEachSubdetector.get(outermostSubdet).get(0));
+	int lastLayer = getVLayer(outermostHitsInEachSubdetector.get(outermostSubdet).get(0));
 	for (CalorimeterHit hit : outermostHitsInEachSubdetector.get(outermostSubdet)) {
-	    if (getLayer(hit) != lastLayer) { throw new AssertionError("Book-keeping error: layer mis-match"); }
+	    if (getVLayer(hit) != lastLayer) { throw new AssertionError("Book-keeping error: layer mis-match"); }
 	    if (hit.getSubdetector() != outermostSubdet) { throw new AssertionError("Book-keeping error"); }
 	}
 
@@ -182,29 +199,28 @@
 	}
 
 	// To do the extrapolation, we need to know if we're looking at a barrel or an endcap subdetector.
-	String calName = outermostSubdet.getName();
-	if (calName.compareTo("HADBarrel")==0) {
+	if (outermostSubdet == hadb) {
 	    trackPointInLayer_N = m_result.extendToHCALBarrelLayer(layerN);
 	    trackPointInLayer_NminusOne = m_result.extendToHCALBarrelLayer(layerN-1);
-	} else if (calName.compareTo("HADEndcap")==0) {
+	} else if (outermostSubdet == hade) {
 	    trackPointInLayer_N = m_result.extendToHCALEndcapLayer(layerN);
 	    trackPointInLayer_NminusOne = m_result.extendToHCALEndcapLayer(layerN-1);
-	} else if (calName.compareTo("EMBarrel")==0) {
+	} else if (outermostSubdet == emb) {
 	    trackPointInLayer_N = m_result.extendToECALBarrelLayer(layerN);
 	    trackPointInLayer_NminusOne = m_result.extendToECALBarrelLayer(layerN-1);
-	} else if (calName.compareTo("EMEndcap")==0) {
+	} else if (outermostSubdet == eme) {
 	    trackPointInLayer_N = m_result.extendToECALEndcapLayer(layerN);
 	    trackPointInLayer_NminusOne = m_result.extendToECALEndcapLayer(layerN-1);
-	} else if (calName.compareTo("MuonEndcap")==0) {
+	} else if (outermostSubdet == mue) {
 	    trackPointInLayer_N = m_result.extendToMCALEndcapLayer(layerN);
 	    trackPointInLayer_NminusOne = m_result.extendToMCALEndcapLayer(layerN-1);
 	} else {
-	    throw new AssertionError("Calorimeter component "+calName+" not recognized!");
+	    throw new AssertionError("Calorimeter component "+outermostSubdet.getName()+" not recognized!");
 	}
 
 	if (trackPointInLayer_N == null || trackPointInLayer_NminusOne==null) {
 	    System.out.println("ERROR: Extrapolation failure when computing tangent for lastLayer="+lastLayer+" and subdet="+outermostSubdet.getClass().getName());
-	    System.out.println("Tried to extrapolate to layer "+layerN+" and layer "+(layerN-1)+" of "+calName);
+	    System.out.println("Tried to extrapolate to layer "+layerN+" and layer "+(layerN-1)+" of "+outermostSubdet.getName());
 	    if (trackPointInLayer_N == null) {
 		System.out.println("  -- point in layer "+layerN+" was NULL!");
 	    } else {
@@ -249,7 +265,7 @@
 	    int layerMax = -1;
 	    List<CalorimeterHit> hitsInMaxLayer = new Vector<CalorimeterHit>();
 	    for (CalorimeterHit hit : hits) {
-		int layer = getLayer(hit);
+		int layer = getVLayer(hit);
 		if (layer > layerMax) {
 		    layerMax = layer;
 		    hitsInMaxLayer.clear();
@@ -297,10 +313,10 @@
 	return meanPosition;
     }
 
-    protected int getLayer(CalorimeterHit hit) {
+    protected int getVLayer(CalorimeterHit hit) {
         org.lcsim.geometry.IDDecoder id = hit.getIDDecoder();
         id.setID(hit.getCellID());
-        int layer = id.getLayer();
+        int layer = id.getVLayer();
         return layer;
     }
 

lcsim/src/org/lcsim/recon/pfa/structural
SetUpPFA.java 1.9 -> 1.10
diff -u -r1.9 -r1.10
--- SetUpPFA.java	4 Feb 2010 17:45:32 -0000	1.9
+++ SetUpPFA.java	8 Mar 2010 19:39:09 -0000	1.10
@@ -109,6 +109,7 @@
             reclusTree.addTrackToClusterMap("MapMipClusterTracksToClusterSeeds");
             reclusTree.addTrackToClusterMap("MapGenClusterTracksToClusterSeeds");
             reclusTree.addTrackToClusterMap("MapAmbigClusterTracksToClusterSeeds");
+//            reclusTree.setDebug(true);
             add(reclusTree);
         }
         super.process(event);

lcsim/src/org/lcsim/recon/pfa/structural
LayerBasedMIPGeometryHandler.java 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- LayerBasedMIPGeometryHandler.java	4 Feb 2010 17:45:32 -0000	1.6
+++ LayerBasedMIPGeometryHandler.java	8 Mar 2010 19:39:09 -0000	1.7
@@ -23,7 +23,7 @@
  * from the IP, then finding the hits in the outermost layer
  * of that subdetector.
  *
- * @version $Id: LayerBasedMIPGeometryHandler.java,v 1.6 2010/02/04 17:45:32 cassell Exp $
+ * @version $Id: LayerBasedMIPGeometryHandler.java,v 1.7 2010/03/08 19:39:09 cassell Exp $
  */
 
 public class LayerBasedMIPGeometryHandler extends MIPGeometryHandler {
@@ -74,9 +74,9 @@
 	outputPoint.setV(outermostPosition.x(), outermostPosition.y(), outermostPosition.z());
 
 	// Check layer index:
-	int lastLayer = getLayer(outermostHitsInEachSubdetector.get(outermostSubdet).get(0));
+	int lastLayer = getVLayer(outermostHitsInEachSubdetector.get(outermostSubdet).get(0));
 	for (CalorimeterHit hit : outermostHitsInEachSubdetector.get(outermostSubdet)) {
-	    if (getLayer(hit) != lastLayer) { throw new AssertionError("Book-keeping error: layer mis-match"); }
+	    if (getVLayer(hit) != lastLayer) { throw new AssertionError("Book-keeping error: layer mis-match"); }
 	    if (hit.getSubdetector() != outermostSubdet) { throw new AssertionError("Book-keeping error"); }
 	}
 
@@ -188,7 +188,7 @@
 	    int layerMax = -1;
 	    List<CalorimeterHit> hitsInMaxLayer = new Vector<CalorimeterHit>();
 	    for (CalorimeterHit hit : hits) {
-		int layer = getLayer(hit);
+		int layer = getVLayer(hit);
 		if (layer > layerMax) {
 		    layerMax = layer;
 		    hitsInMaxLayer.clear();
@@ -236,10 +236,10 @@
 	return meanPosition;
     }
 
-    protected int getLayer(CalorimeterHit hit) {
+    protected int getVLayer(CalorimeterHit hit) {
         org.lcsim.geometry.IDDecoder id = hit.getIDDecoder();
         id.setID(hit.getCellID());
-        int layer = id.getLayer();
+        int layer = id.getVLayer();
         return layer;
     }
 }

lcsim/src/org/lcsim/recon/pfa/structural
ReclusterDTreeDriver.java 1.29 -> 1.30
diff -u -r1.29 -r1.30
--- ReclusterDTreeDriver.java	4 Feb 2010 17:45:32 -0000	1.29
+++ ReclusterDTreeDriver.java	8 Mar 2010 19:39:09 -0000	1.30
@@ -25,7 +25,7 @@
   * in this package, which uses the implementation in
   * org.lcsim.recon.cluster.directedtree developed by NIU).
   *
-  * @version $Id: ReclusterDTreeDriver.java,v 1.29 2010/02/04 17:45:32 cassell Exp $
+  * @version $Id: ReclusterDTreeDriver.java,v 1.30 2010/03/08 19:39:09 cassell Exp $
   * @author Mat Charles <[log in to unmask]>
   */
 
@@ -2322,11 +2322,16 @@
 	double backZ = ci.getZMax(CalorimeterType.HAD_BARREL);
 	double innerRadius = ci.getRMin(CalorimeterType.HAD_BARREL);
 	double tanTheta = innerRadius/backZ;
-
+        double gridZ = 0.;
 	org.lcsim.geometry.IDDecoder id = ci.getIDDecoder(CalorimeterType.HAD_BARREL);
 	if (id instanceof org.lcsim.geometry.segmentation.NonprojectiveCylinder) {
 	    org.lcsim.geometry.segmentation.NonprojectiveCylinder segmentation = (org.lcsim.geometry.segmentation.NonprojectiveCylinder) id;
-	    double gridZ = segmentation.getGridSizeZ();
+	    gridZ = segmentation.getGridSizeZ();
+        }
+        else
+        {
+            gridZ = 10.;
+        }
 	    // We want to include at least (nLayersToCheck) layers.
 	    // The layer segmentation is (gridZ).
 	    // For a MIP travelling at a polar angle theta, this means
@@ -2342,9 +2347,5 @@
 		}
 	    }
 	    return backCellsFound.size();
-	} else {
-	    System.out.println("Help! Don't know how to handle barrel geometry of class "+id.getClass().getName());
-            return 0;
-	}
     }
 }
CVSspam 0.2.8