Print

Print


Commit in lcsim/src/org/lcsim/contrib/uiowa/structural on MAIN
MapClusterToListOfMC.java+13added 1.1
MapClusterToMC.java+12added 1.1
MapClusterToTrack.java+12added 1.1
MapExtrapolationInfoToCluster.java+11added 1.1
MapMCToCluster.java+12added 1.1
MapMCToExtrapInfo.java+11added 1.1
MapMCToHelix.java+12added 1.1
MatchHelixToCluster.java+276added 1.1
MiscUtilities.java+47added 1.1
PerfectPFA.java+319added 1.1
SimpleFragmentIdentifier.java+86added 1.1
SwimToECAL.java+182added 1.1
TrackExtrapolationInfo.java+49added 1.1
+1042
13 added files
mass update

lcsim/src/org/lcsim/contrib/uiowa/structural
MapClusterToListOfMC.java added at 1.1
diff -N MapClusterToListOfMC.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ MapClusterToListOfMC.java	16 Dec 2005 21:11:26 -0000	1.1
@@ -0,0 +1,13 @@
+package structural;
+// Problems storing this within the event...
+
+import java.util.List;
+import java.util.Map;
+import java.util.HashMap;
+import org.lcsim.event.MCParticle;
+import org.lcsim.event.Cluster;
+
+public class MapClusterToListOfMC extends HashMap<Cluster, List<MCParticle>>
+{
+
+}

lcsim/src/org/lcsim/contrib/uiowa/structural
MapClusterToMC.java added at 1.1
diff -N MapClusterToMC.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ MapClusterToMC.java	16 Dec 2005 21:11:26 -0000	1.1
@@ -0,0 +1,12 @@
+package structural;
+// Problems storing this within the event...
+
+import java.util.Map;
+import java.util.HashMap;
+import org.lcsim.event.MCParticle;
+import org.lcsim.event.Cluster;
+
+public class MapClusterToMC extends HashMap<Cluster, MCParticle>
+{
+
+}

lcsim/src/org/lcsim/contrib/uiowa/structural
MapClusterToTrack.java added at 1.1
diff -N MapClusterToTrack.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ MapClusterToTrack.java	16 Dec 2005 21:11:26 -0000	1.1
@@ -0,0 +1,12 @@
+package structural;
+// Problems storing this within the event...
+
+import java.util.Map;
+import java.util.HashMap;
+import org.lcsim.event.Cluster;
+import org.lcsim.event.Track;
+
+public class MapClusterToTrack extends HashMap<Cluster, Track>
+{
+    
+}

lcsim/src/org/lcsim/contrib/uiowa/structural
MapExtrapolationInfoToCluster.java added at 1.1
diff -N MapExtrapolationInfoToCluster.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ MapExtrapolationInfoToCluster.java	16 Dec 2005 21:11:26 -0000	1.1
@@ -0,0 +1,11 @@
+package structural;
+// Problems storing this within the event...
+
+import java.util.Map;
+import java.util.HashMap;
+import org.lcsim.event.Cluster;
+
+public class MapExtrapolationInfoToCluster extends HashMap<TrackExtrapolationInfo, Cluster>
+{
+    
+}

lcsim/src/org/lcsim/contrib/uiowa/structural
MapMCToCluster.java added at 1.1
diff -N MapMCToCluster.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ MapMCToCluster.java	16 Dec 2005 21:11:26 -0000	1.1
@@ -0,0 +1,12 @@
+package structural;
+// Problems storing this within the event...
+
+import java.util.Map;
+import java.util.HashMap;
+import org.lcsim.event.MCParticle;
+import org.lcsim.event.Cluster;
+
+public class MapMCToCluster extends HashMap<MCParticle, Cluster>
+{
+
+}

lcsim/src/org/lcsim/contrib/uiowa/structural
MapMCToExtrapInfo.java added at 1.1
diff -N MapMCToExtrapInfo.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ MapMCToExtrapInfo.java	16 Dec 2005 21:11:26 -0000	1.1
@@ -0,0 +1,11 @@
+package structural;
+// Problems storing this within the event...
+
+import java.util.Map;
+import java.util.HashMap;
+import org.lcsim.event.MCParticle;
+
+public class MapMCToExtrapInfo extends HashMap<MCParticle, TrackExtrapolationInfo>
+{
+
+}

lcsim/src/org/lcsim/contrib/uiowa/structural
MapMCToHelix.java added at 1.1
diff -N MapMCToHelix.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ MapMCToHelix.java	16 Dec 2005 21:11:26 -0000	1.1
@@ -0,0 +1,12 @@
+package structural;
+// Problems storing this within the event...
+
+import java.util.Map;
+import java.util.HashMap;
+import org.lcsim.event.MCParticle;
+import org.lcsim.util.swim.HelixSwimmer;
+
+public class MapMCToHelix extends HashMap<MCParticle, HelixSwimmer>
+{
+
+}

lcsim/src/org/lcsim/contrib/uiowa/structural
MatchHelixToCluster.java added at 1.1
diff -N MatchHelixToCluster.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ MatchHelixToCluster.java	16 Dec 2005 21:11:26 -0000	1.1
@@ -0,0 +1,276 @@
+package structural;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.Vector;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Set;
+import java.util.Collections;
+import java.util.Comparator;
+import java.io.IOException; 
+
+import hep.physics.vec.*;
+
+import org.lcsim.event.EventHeader;
+import org.lcsim.util.Driver;
+import org.lcsim.util.swim.HelixSwimmer;
+import org.lcsim.event.MCParticle;
+import org.lcsim.event.Cluster;
+import org.lcsim.event.CalorimeterHit;
+
+import hep.aida.ITree;
+import hep.aida.IAnalysisFactory; 
+import hep.aida.IHistogramFactory; 
+import hep.aida.IHistogram1D; 
+import hep.aida.ICloud1D;
+
+public class MatchHelixToCluster extends Driver
+{
+    /**
+     * Constructor.
+     * @param nameOfHelixList
+     * @param nameOfExtrapolationInfoList
+     * @param nameOfMIPClusterList
+     * @param nameOfClusterList
+     * @param nameOfParticleToClusterMap
+     * @param nameOfClusterToParticleMap
+     */
+    public MatchHelixToCluster(String nameOfExtrapolationInfoList, String nameOfMIPClusterList, String nameOfClusterList, String nameOfParticleToClusterMap, String nameOfClusterToParticleMap) {
+	m_nameOfExtrapolationInfoList = nameOfExtrapolationInfoList;
+	m_nameOfMIPClusterList = nameOfMIPClusterList;
+	m_nameOfClusterList = nameOfClusterList;
+	m_nameOfParticleToClusterMap = nameOfParticleToClusterMap;
+	m_nameOfClusterToParticleMap = nameOfClusterToParticleMap;
+
+	initHistos();
+    }
+
+    public void process(EventHeader event)
+    {
+	// Read in the input lists:
+	List<MapMCToExtrapInfo> inputExtrapInfoMapList = event.get(MapMCToExtrapInfo.class, m_nameOfExtrapolationInfoList);
+	MapMCToExtrapInfo inputExtrapInfoMap = inputExtrapInfoMapList.iterator().next();
+	List<MapClusterToListOfClusters> inputMIPClusterMapList = event.get(MapClusterToListOfClusters.class, m_nameOfMIPClusterList);
+	MapClusterToListOfClusters inputMIPClusterMap = inputMIPClusterMapList.iterator().next();
+	List<Cluster> inputClusterList = event.get(Cluster.class, m_nameOfClusterList);
+	// Output:
+	MapExtrapolationInfoToCluster outputMCToClusterMap = new MapExtrapolationInfoToCluster();
+	MapClusterToListOfExtrapolationInfo outputClusterToListOfMCMap = new MapClusterToListOfExtrapolationInfo();
+	// Extract list of MIPs from the map (and set up reverse map):
+	List<Cluster> inputMIPClusterList = new Vector<Cluster>();
+	Map<Cluster, Cluster> mapFromMIPToParentCluster = new HashMap<Cluster,Cluster>();
+	for (Cluster bigCluster : inputMIPClusterMap.keySet()) {
+	    List<Cluster> associatedMIPs = inputMIPClusterMap.get(bigCluster);
+	    for (Cluster MIP : associatedMIPs) {
+		inputMIPClusterList.add(MIP);
+		mapFromMIPToParentCluster.put(MIP, bigCluster);
+	    }
+	}
+	// Loop over MC particle extrapolations and try to associate them to clusters:
+	Set<MCParticle> particleSet = inputExtrapInfoMap.keySet();
+	for (MCParticle part : particleSet) {
+	    // Find the nearest MIP clusters:
+	    boolean foundMatch = false;
+	    TrackExtrapolationInfo info = inputExtrapInfoMap.get(part);
+	    List<Cluster> nearestMIPs = findNearestClusters(info, inputMIPClusterList);
+	    for (Cluster nearbyMIP : nearestMIPs) {
+		// Obtain geometrical info:
+		CalorimeterHit nearestHit = findNearestHit(info, nearbyMIP);
+		double separation = MiscUtilities.distance(nearestHit, info.getIntercept());
+		double unitDotProduct = findUnitDotProduct(info, nearbyMIP);
+		int firstLayerHit = getLayer(nearestHit);
+		org.lcsim.geometry.Subdetector subdet = nearestHit.getSubdetector();
+		// Make cuts:
+		boolean goodSubDet = (subdet.getName().compareTo("EMBarrel")==0) || (subdet.getName().compareTo("EMEndcap")==0);
+		boolean goodFirstLayer = (firstLayerHit < 5);
+		boolean goodDotProduct = (Math.abs(unitDotProduct) > 0.85);
+		boolean goodSeparation = (separation < 50.0);
+		foundMatch = goodSubDet && goodFirstLayer && goodDotProduct && goodSeparation;
+		if (foundMatch) {
+		    // OK, made a good match
+		    // Look up the parent big cluster:
+		    Cluster parent = mapFromMIPToParentCluster.get(nearbyMIP);
+		    outputMCToClusterMap.put(info, nearbyMIP);
+		    List<TrackExtrapolationInfo> list = outputClusterToListOfMCMap.get(parent);
+		    if (list == null) { 
+			list = new Vector<TrackExtrapolationInfo>();
+			outputClusterToListOfMCMap.put(parent, list);
+		    }
+		    list.add(info);
+		    info.setHit(nearestHit);
+		    break; // don't need to check other MIPs
+		}
+	    }
+	    if (!foundMatch) {
+		// No match yet => try to associate to non-MIP clusters...
+		List<Cluster> nearestClusters = findNearestClusters(info, inputClusterList);
+		for (Cluster nearbyCluster : nearestClusters) {
+		    // Obtain geometrical info:
+		    CalorimeterHit nearestHit = findNearestHit(info, nearbyCluster);
+		    double separation = MiscUtilities.distance(nearestHit, info.getIntercept());
+		    int firstLayerHit = getLayer(nearestHit);
+		    org.lcsim.geometry.Subdetector subdet = nearestHit.getSubdetector();
+		    // Make cuts:
+		    boolean goodSubDet = (subdet.getName().compareTo("EMBarrel")==0) || (subdet.getName().compareTo("EMEndcap")==0);
+		    boolean goodFirstLayer = (firstLayerHit < 5);
+		    boolean goodSeparation = (separation < 30.0);
+		    foundMatch = goodSubDet && goodFirstLayer && goodSeparation;
+		    if (foundMatch) {
+			// OK, made a good match
+			outputMCToClusterMap.put(info, nearbyCluster);
+			List<TrackExtrapolationInfo> list = outputClusterToListOfMCMap.get(nearbyCluster);
+			if (list == null) { 
+			    list = new Vector<TrackExtrapolationInfo>();
+			    outputClusterToListOfMCMap.put(nearbyCluster, list);
+			}
+			list.add(info);
+			info.setHit(nearestHit);
+			break; // don't need to check other clusters
+		    }
+		}
+	    }
+	}
+	// OK, wrap and write out:
+	List<MapExtrapolationInfoToCluster> outputMCToClusterMapList = new Vector<MapExtrapolationInfoToCluster>();
+	List<MapClusterToListOfExtrapolationInfo> outputClusterToListOfMCMapList = new Vector<MapClusterToListOfExtrapolationInfo>();
+	outputMCToClusterMapList.add(outputMCToClusterMap);
+	outputClusterToListOfMCMapList.add(outputClusterToListOfMCMap);
+	event.put(m_nameOfParticleToClusterMap, outputMCToClusterMapList);
+	event.put(m_nameOfClusterToParticleMap, outputClusterToListOfMCMapList);
+
+	// Debug stuff:
+	int countMCParticles = inputExtrapInfoMap.keySet().size();
+	int countMappedTracks = 0;
+	int countMappings = 0;
+	Set<TrackExtrapolationInfo> infoSet = outputMCToClusterMap.keySet();
+	for (TrackExtrapolationInfo info : infoSet) {
+	    if (outputMCToClusterMap.get(info) != null) {
+		countMappedTracks++;
+	    }
+	}
+	Set<Cluster> clusterSet = outputClusterToListOfMCMap.keySet();
+	for (Cluster clus : clusterSet) {
+	    List<TrackExtrapolationInfo> mappedList = outputClusterToListOfMCMap.get(clus);
+	    if (mappedList != null) {
+		countMappings += mappedList.size();
+	    }
+	}
+
+	double effic = ( (double)(countMappings) ) / ( (double)(countMCParticles) );
+	//double purity = ( (double)(countCorrectMappings) ) / ( (double)(countMappings) );
+	//double efficMIPs = ( (double)(countMatchesMIPs) ) / ( (double)(countMCParticles) );
+	//double purityMIPs = ( (double)(countCorrectMatchesMIPs) ) / ( (double)(countMatchesMIPs) );
+	m_trackMatchingEfficiency.fill(effic);
+	//m_trackMatchingPurity.fill(purity);
+
+	System.out.println("DEBUG: "+this.getClass().getName()+": Out of "+countMCParticles+" MC particles, I mapped "+countMappedTracks+" (check: "+countMappings+")");
+    }
+
+    protected CalorimeterHit findNearestHit(TrackExtrapolationInfo info, Cluster clus) {
+	Hep3Vector point = info.getIntercept();
+	CalorimeterHit nearest = null;
+	double minDist = 0;
+	List<CalorimeterHit> hits = clus.getCalorimeterHits();
+	for (CalorimeterHit hit : hits) {
+	    double dist = MiscUtilities.distance(hit, point);
+	    if (dist < minDist || nearest==null) {
+		nearest = hit;
+		minDist = dist;
+	    }
+	}
+	return nearest;
+    }
+
+
+    protected List<Cluster> findNearestClusters(TrackExtrapolationInfo info, List<Cluster> clusterList) {
+	Map<Cluster,Double> mapClusterToDistance = new HashMap<Cluster, Double>();
+	List<Cluster> sortedListOfClusters = new Vector<Cluster>();
+	for (Cluster clus : clusterList) {
+	    double dist = findProximity(info, clus);
+	    mapClusterToDistance.put(clus, new Double(dist));
+	    sortedListOfClusters.add(clus);
+	}
+	Comparator<Cluster> comp = new CompareMapping<Cluster>(mapClusterToDistance);
+	Collections.sort(sortedListOfClusters, comp);
+	return sortedListOfClusters;
+    }
+    protected double findProximity(TrackExtrapolationInfo info, Cluster clus) {
+	Hep3Vector trackPoint = info.getIntercept();
+	return MiscUtilities.distance(clus, trackPoint);
+    }
+    protected double findUnitDotProduct(TrackExtrapolationInfo info, Cluster clus) {
+	Hep3Vector trackMomentum = info.getMomentum();
+	Hep3Vector[] clusterPosAndDir = MiscUtilities.getPositionAndDirection(clus);
+	Hep3Vector clusterDir = clusterPosAndDir[1];
+	double dotProduct = VecOp.dot(trackMomentum, clusterDir);
+	double unitDotProduct = dotProduct / (trackMomentum.magnitude() * clusterDir.magnitude());
+	return unitDotProduct;
+    }
+    protected int getLayer(CalorimeterHit hit) {
+	org.lcsim.geometry.IDDecoder id = hit.getIDDecoder();
+	id.setID(hit.getCellID());
+	int layer = id.getLayer();
+	return layer;
+    }
+
+
+    private class CompareMapping<T> implements Comparator<T> {
+	public CompareMapping(Map<T,Double> map) {
+	    m_map = map;
+	}
+	public int compare(Object o1, Object o2) {
+	    Cluster c1 = (Cluster) o1;
+	    Cluster c2 = (Cluster) o2;
+	    Double D1 = m_map.get(c1);
+	    Double D2 = m_map.get(c2);
+	    if (D1.equals(D2)) {
+		// Equal
+		return 0;
+	    } else if (D1.doubleValue() < D2.doubleValue()) {
+		return -1;
+	    } else {
+		return +1;
+	    }
+	}
+	Map<T,Double> m_map;
+    }
+
+    protected String m_nameOfExtrapolationInfoList;
+    protected String  m_nameOfMIPClusterList;
+    protected String m_nameOfClusterList;
+    protected String m_nameOfParticleToClusterMap;
+    protected String m_nameOfClusterToParticleMap;
+
+    // Histogram stuff
+    ITree m_tree = null;
+    IHistogramFactory m_histoFactory = null;
+    ICloud1D m_trackMatchingEfficiency;
+    ICloud1D m_trackMatchingPurity;
+    ICloud1D m_trackMatchingEfficiencyMIPs;
+    ICloud1D m_trackMatchingPurityMIPs;
+
+    protected void initHistos() {
+	IAnalysisFactory af = IAnalysisFactory.create();
+	try {
+            m_tree = af.createTreeFactory().create("TrackMatchPlots.aida","xml",false,true); 
+	    m_histoFactory = af.createHistogramFactory(m_tree); 
+
+	    m_trackMatchingEfficiency = m_histoFactory.createCloud1D("tracksMatchingEfficiency");
+	    m_trackMatchingPurity = m_histoFactory.createCloud1D("tracksMatchingPurity");
+	    m_trackMatchingEfficiencyMIPs = m_histoFactory.createCloud1D("tracksMatchingEfficiencyMIPs");
+	    m_trackMatchingPurityMIPs = m_histoFactory.createCloud1D("tracksMatchingPurityMIPs");
+	} catch (IOException ioe1) {
+            ioe1.printStackTrace(); 
+        }
+    }
+    public void suspend() {
+	try {
+	    m_tree.commit();
+	} catch(IOException ioe1) {
+            ioe1.printStackTrace(); 
+        }
+	super.suspend();
+    }
+
+}

lcsim/src/org/lcsim/contrib/uiowa/structural
MiscUtilities.java added at 1.1
diff -N MiscUtilities.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ MiscUtilities.java	16 Dec 2005 21:11:26 -0000	1.1
@@ -0,0 +1,47 @@
+// This is rather ugly
+package structural;
+
+import hep.physics.vec.Hep3Vector;
+import org.lcsim.event.Cluster;
+import org.lcsim.event.CalorimeterHit;
+import org.lcsim.event.MCParticle;
+import org.lcsim.event.EventHeader;
+
+class MiscUtilities extends structural.likelihood.MiscUtilities
+{
+    //public MiscUtilities() {}
+    static protected Hep3Vector[] getPositionAndDirection(Cluster clus) {
+	return structural.likelihood.MiscUtilities.getPositionAndDirection(clus);
+    }
+
+    static protected double findDOCAToPoint(Hep3Vector linePoint, Hep3Vector lineDirection, Hep3Vector point) {
+	return structural.likelihood.MiscUtilities.findDOCAToPoint(linePoint, lineDirection, point);
+    }
+
+    static protected double distance(Cluster clus1, Cluster clus2) {
+	return structural.likelihood.MiscUtilities.distance(clus1, clus2);
+    }
+
+    static protected double distance(Cluster clus, Hep3Vector point) {
+	return structural.likelihood.MiscUtilities.distance(clus, point);
+    }
+
+    static protected double distance(CalorimeterHit hit, Hep3Vector point) {
+	return structural.likelihood.MiscUtilities.distance(hit, point);
+    }
+
+    //    static protected double getCorrectedEnergy_sidaug05(Cluster clus, EventHeader event) {
+    //	return structural.likelihood.MiscUtilities.getCorrectedEnergy_sidaug05(clus, event);
+    //    }
+
+    static protected int countHitsInCluster(MCParticle part, Cluster clus){
+	return structural.likelihood.MiscUtilities.countHitsInCluster(part, clus);
+    }
+
+    static protected double correctedEnergyInClusterECAL(MCParticle part, Cluster clus) {
+	return structural.likelihood.MiscUtilities.correctedEnergyInClusterECAL(part, clus);
+    }
+    static protected int countHitsInClusterHCAL(MCParticle part, Cluster clus) {
+	return structural.likelihood.MiscUtilities.countHitsInClusterHCAL(part, clus);
+    }
+}

lcsim/src/org/lcsim/contrib/uiowa/structural
PerfectPFA.java added at 1.1
diff -N PerfectPFA.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ PerfectPFA.java	16 Dec 2005 21:11:26 -0000	1.1
@@ -0,0 +1,319 @@
+package structural; // package org.lcsim.recon.cluster.structural;
+
+import java.util.List;
+import java.util.Vector;
+import java.util.Set;
+import java.util.HashSet;
+import java.io.IOException; 
+
+import hep.physics.vec.*;
+
+import hep.aida.ITree;
+import hep.aida.IAnalysisFactory; 
+import hep.aida.IHistogramFactory; 
+import hep.aida.IHistogram1D; 
+import hep.aida.ICloud1D;
+import hep.aida.ITuple;
+import hep.aida.ITupleFactory;
+
+import org.lcsim.event.EventHeader;
+import org.lcsim.util.Driver;
+import org.lcsim.event.Cluster;
+import org.lcsim.event.MCParticle;
+import org.lcsim.event.CalorimeterHit;
+import org.lcsim.event.SimCalorimeterHit;
+import org.lcsim.recon.cluster.util.BasicCluster;
+import java.util.Map;
+import java.util.HashMap;
+
+import util.EnergyCalibration;
+import util.RonEnergyCalibration;
+import util.OldEnergyCalibration;
+
+/**
+ * A perfect PFA
+ *
+ * @version $Id: PerfectPFA.java,v 1.1 2005/12/16 21:11:26 mcharles Exp $
+ */
+
+public class PerfectPFA extends Driver
+{
+    ITree m_tree = null;
+    IHistogramFactory m_histoFactory = null;
+    ICloud1D m_hTotalEnergyOld;
+    ICloud1D m_hTotalEnergyRawOld;
+
+    ICloud1D m_hTotalEnergyRawRon;
+    ICloud1D m_hTotalEnergyRon;
+    ICloud1D m_hTotalEnergyCheat;
+
+    ICloud1D m_hTotalEnergyPrimaryRon;
+    ICloud1D m_hTotalEnergyPrimaryRonNoNeutrinos;
+    ICloud1D m_hTotalEnergyPrimaryRonAllNeutrinos;
+    ICloud1D m_hTotalEnergyPrimaryCheat;
+    ICloud1D m_hTotalEnergyPrimaryCheatNoNeutrinos;
+    ICloud1D m_hTotalEnergyPrimaryCheatAllNeutrinos;
+    ICloud1D m_hTotalEnergyPrimaryCheatCheat;
+    EventHeader m_event;
+
+    public PerfectPFA()
+    {
+	add (new EventEnergySum("PerfectClusters", "PerfectClusterToHelixMap", "PerfectHelixToClusterMap"));
+
+		IAnalysisFactory af = IAnalysisFactory.create();
+	try {
+            m_tree = af.createTreeFactory().create("PerfectEnergySumHistos.aida","xml",false,true); 
+	    m_histoFactory = af.createHistogramFactory(m_tree); 
+	    m_hTotalEnergyOld = m_histoFactory.createCloud1D("hTotalEnergyOld");
+	    m_hTotalEnergyRawRon = m_histoFactory.createCloud1D("hTotalEnergyRawRon");
+	    m_hTotalEnergyRawOld = m_histoFactory.createCloud1D("hTotalEnergyRawOld");
+	    m_hTotalEnergyRon = m_histoFactory.createCloud1D("hTotalEnergyRon");
+	    m_hTotalEnergyPrimaryRon = m_histoFactory.createCloud1D("hTotalEnergyPrimaryRon");
+	    m_hTotalEnergyPrimaryRonNoNeutrinos = m_histoFactory.createCloud1D("hTotalEnergyPrimaryRonNoNeutrinos");
+	    m_hTotalEnergyPrimaryRonAllNeutrinos = m_histoFactory.createCloud1D("hTotalEnergyPrimaryRonAllNeutrinos");
+	    m_hTotalEnergyCheat = m_histoFactory.createCloud1D("hTotalEnergyCheat");
+	    m_hTotalEnergyPrimaryCheatNoNeutrinos = m_histoFactory.createCloud1D("hTotalEnergyPrimaryCheatNoNeutrinos");
+	    m_hTotalEnergyPrimaryCheatAllNeutrinos = m_histoFactory.createCloud1D("hTotalEnergyPrimaryCheatAllNeutrinos");
+	    m_hTotalEnergyPrimaryCheat = m_histoFactory.createCloud1D("hTotalEnergyPrimaryCheat");
+	    m_hTotalEnergyPrimaryCheatCheat = m_histoFactory.createCloud1D("hTotalEnergyPrimaryCheatCheat");
+	} catch (IOException ioe1) {
+            ioe1.printStackTrace(); 
+        }
+    }
+
+    public void suspend() {
+	try {
+	    m_tree.commit();
+	} catch(IOException ioe1) {
+            ioe1.printStackTrace(); 
+        }
+	super.suspend();
+    }
+
+    public void process(EventHeader event) 
+    {
+	m_event = event;
+
+	List<MCParticle> allMC = event.getMCParticles();
+	List<MCParticle> primaryMC = new Vector<MCParticle>();
+	Map<MCParticle, List<MCParticle>> mapParticleToPrimary = new HashMap<MCParticle, List<MCParticle>>();
+	List<MCParticle> dudSecondaryMC = new Vector<MCParticle>();
+	for (MCParticle part : allMC) {
+	    List<MCParticle> primaries = this.findPrimaries(part);
+	    if (primaries.contains(part)) {
+		primaryMC.add(part);
+	    } else if (primaries.size()==0) {
+		dudSecondaryMC.add(part);
+	    }
+	    mapParticleToPrimary.put(part, primaries);
+	}
+
+	List<CalorimeterHit> EcalBarrHits   = event.get(CalorimeterHit.class, "EcalBarrHits");
+	List<CalorimeterHit> EcalEndcapHits = event.get(CalorimeterHit.class, "EcalEndcapHits");
+	List<CalorimeterHit> HcalBarrHits   = event.get(CalorimeterHit.class, "HcalBarrHits");
+	List<CalorimeterHit> HcalEndcapHits = event.get(CalorimeterHit.class, "HcalEndcapHits");
+
+	Map<MCParticle, BasicCluster> mapParticlesToClusters = new HashMap<MCParticle, BasicCluster>();
+        checkRealisticHits(EcalBarrHits,   mapParticlesToClusters);
+        checkRealisticHits(EcalEndcapHits, mapParticlesToClusters);
+        checkRealisticHits(HcalBarrHits, mapParticlesToClusters);
+        checkRealisticHits(HcalEndcapHits,   mapParticlesToClusters);
+
+	// Now, for each charged MC particle, build a TrackExtrapolationInfo object...
+	Map<TrackExtrapolationInfo, Cluster> mapHelixToCluster = new HashMap<TrackExtrapolationInfo, Cluster>();
+	Map<Cluster, List<TrackExtrapolationInfo>> mapClusterToHelix = new HashMap<Cluster, List<TrackExtrapolationInfo>>();
+	Set<MCParticle> particleSet = mapParticlesToClusters.keySet();
+	for (MCParticle part : particleSet) {
+	    if (Math.abs(part.getCharge()) > 0.5) {
+		// Charged particle
+		BasicCluster clus = mapParticlesToClusters.get(part);
+		TrackExtrapolationInfo info = new TrackExtrapolationInfo(null, part.getMomentum(), part, null);
+		info.setHit(clus.getCalorimeterHits().iterator().next());
+		mapHelixToCluster.put(info, clus);
+		List<TrackExtrapolationInfo> tmpList = mapClusterToHelix.get(clus);
+		if (tmpList == null) {
+		    tmpList = new Vector<TrackExtrapolationInfo>();
+		    mapClusterToHelix.put(clus, tmpList);
+		}
+		tmpList.add(info);
+	    }
+	}
+
+	// Prepare the outputs:
+	List<Cluster> outputClusterList = new Vector<Cluster>(mapParticlesToClusters.values());
+	event.put("PerfectClusters", outputClusterList);
+	Vector<Map<TrackExtrapolationInfo, Cluster>> outputMapHelixToCluster = new Vector<Map<TrackExtrapolationInfo, Cluster>>();
+	outputMapHelixToCluster.add(mapHelixToCluster);
+	event.put("PerfectHelixToClusterMap", outputMapHelixToCluster);
+	Vector<Map<Cluster, List<TrackExtrapolationInfo>>> outputMapClusterToHelix = new Vector<Map<Cluster, List<TrackExtrapolationInfo>>>();
+	outputMapClusterToHelix.add(mapClusterToHelix);
+	event.put("PerfectClusterToHelixMap", outputMapClusterToHelix);
+
+	// Energy plots...
+	double rawEnergySumRon = 0.0;
+	double pfaEnergySumRon = 0.0;
+	double pfaEnergySumRonPrimary = 0.0;
+	double cheatEnergySum = 0.0;
+	double cheatEnergySumPrimary = 0.0;
+
+	// Energy calibrations
+	EnergyCalibration calibRon = new RonEnergyCalibration(m_event);
+	EnergyCalibration calibOld = new OldEnergyCalibration();
+
+	Set<MCParticle> usedPrimaryAll = new HashSet<MCParticle>();
+	Set<MCParticle> usedPrimaryCharged = new HashSet<MCParticle>();
+
+	for (MCParticle part : particleSet) {
+	    BasicCluster clus = mapParticlesToClusters.get(part);
+	    List<MCParticle> primaries = mapParticleToPrimary.get(part);
+	    if (clus != null && clus.getCalorimeterHits().size()>0) {
+		if (Math.abs(part.getCharge()) > 0.5) {
+		    // Charged particle
+		    pfaEnergySumRon += part.getEnergy();
+		    for (MCParticle primary : primaries) {
+			if (!usedPrimaryCharged.contains(primary)) {
+			    pfaEnergySumRonPrimary += primary.getEnergy();
+			    usedPrimaryCharged.add(primary);
+			}
+		    }
+		} else {
+		    // Neutral
+		    pfaEnergySumRon += calibRon.energy(clus); //getClusterEnergy(clus);
+		    pfaEnergySumRonPrimary += calibRon.energy(clus); //getClusterEnergy(clus);
+		}
+		rawEnergySumRon += calibRon.energy(clus); //getClusterEnergy(clus);
+	    }
+	    cheatEnergySum += part.getEnergy();
+	    for (MCParticle primary : primaries) {
+		if (!usedPrimaryAll.contains(primary)) {
+		    cheatEnergySumPrimary += primary.getEnergy();
+		    usedPrimaryAll.add(primary);
+		}
+	    }
+	}
+
+	double cheatcheatEnergySumPrimary = 0.0;
+	Set<MCParticle> usedPrimaryAllCheatCheat = new HashSet<MCParticle>();
+	for (MCParticle part : allMC) {
+	    List<MCParticle> primaries = mapParticleToPrimary.get(part);
+	    for (MCParticle primary : primaries) {
+		if (!usedPrimaryAllCheatCheat.contains(primary)) {
+		    cheatcheatEnergySumPrimary += primary.getEnergy();
+		    usedPrimaryAllCheatCheat.add(primary);
+		}
+	    }
+	}
+
+	// Check neutrinos:
+        double truthNeutrinoEnergySum = 0.0;
+	double truthNeutrinoEnergySumForPrimaryAll = 0.0;
+	double truthNeutrinoEnergySumForPrimaryCharged = 0.0;
+        List<MCParticle> eventMCParticles = event.getMCParticles();
+	for (MCParticle p : eventMCParticles) {
+            int pdg = p.getPDGID();
+            if (pdg==12 || pdg==14 || pdg==16 || pdg==18 || pdg==-12 || pdg==-14 || pdg==-16 || pdg==-18) {
+                truthNeutrinoEnergySum += p.getEnergy();
+	        List<MCParticle> primaries = mapParticleToPrimary.get(p);
+		for (MCParticle primary : primaries) {
+		    if (!usedPrimaryAll.contains(p)) {
+			truthNeutrinoEnergySumForPrimaryAll += p.getEnergy();
+		    }
+		    if (!usedPrimaryCharged.contains(p)) {
+			truthNeutrinoEnergySumForPrimaryCharged += p.getEnergy();
+		    }		
+		}
+            }
+        }
+
+	m_hTotalEnergyRawRon.fill(rawEnergySumRon+truthNeutrinoEnergySum);
+	m_hTotalEnergyRon.fill(pfaEnergySumRon+truthNeutrinoEnergySum);
+	m_hTotalEnergyCheat.fill(cheatEnergySum+truthNeutrinoEnergySum);
+	m_hTotalEnergyPrimaryRon.fill(pfaEnergySumRonPrimary+truthNeutrinoEnergySumForPrimaryCharged);
+	m_hTotalEnergyPrimaryCheat.fill(cheatEnergySumPrimary+truthNeutrinoEnergySumForPrimaryAll);
+
+	m_hTotalEnergyPrimaryRonNoNeutrinos.fill(pfaEnergySumRonPrimary);
+	m_hTotalEnergyPrimaryCheatNoNeutrinos.fill(cheatEnergySumPrimary);
+	m_hTotalEnergyPrimaryRonAllNeutrinos.fill(pfaEnergySumRonPrimary+truthNeutrinoEnergySum);
+	m_hTotalEnergyPrimaryCheatAllNeutrinos.fill(cheatEnergySumPrimary+truthNeutrinoEnergySum);
+ 
+	m_hTotalEnergyPrimaryCheatCheat.fill(cheatcheatEnergySumPrimary);
+
+	//super.process(event);
+    }
+
+    // Look at a list of hits.
+    // For each hit, find the dominant MC particle.
+    // Associate that hit to the MC particle in the map.
+    // No explicit output; implicit output is the updated map.
+   protected void checkRealisticHits(List<CalorimeterHit> hits, Map<MCParticle, BasicCluster> map)
+    {
+	for (CalorimeterHit rawhit : hits) {
+	    if ( ! (rawhit instanceof SimCalorimeterHit) ) {
+		throw new AssertionError("Non-simulated hit!");
+	    } else {
+		SimCalorimeterHit hit = (SimCalorimeterHit) rawhit;
+
+		// Which particles contribute?
+		MCParticle dominantParticle = null;
+		double maxEnergy = 0.0;
+		int nContributingParticles = hit.getMCParticleCount();
+		for (int i=0; i<nContributingParticles; i++) {
+		    MCParticle part = hit.getMCParticle(i);
+		    double energy = hit.getContributedEnergy(i);
+		    if (dominantParticle==null || energy>maxEnergy) {
+			dominantParticle = part;
+			maxEnergy = energy;
+		    }
+		}
+		
+		if (dominantParticle == null) { throw new AssertionError("Null particle!"); }
+		
+		// OK, we found the dominant particle. Is it already in the map?
+		BasicCluster matchingCluster = null;
+		if (map.containsKey(dominantParticle)) {
+		    // Yes
+		    matchingCluster = map.get(dominantParticle);
+		} else {
+		    // No
+		    matchingCluster = new BasicCluster();
+		    map.put(dominantParticle, matchingCluster);
+		}
+		// OK, now add the hit to the mapped cluster:
+		matchingCluster.addHit(hit);
+	    }
+	}
+    }
+
+    //protected double getClusterEnergy(Cluster currentCluster) {
+    //// Use Ron's calibration
+    //return MiscUtilities.getCorrectedEnergy_sidaug05(currentCluster, m_event);
+    //}
+
+    protected boolean checkIfPrimary(MCParticle part) {
+	Hep3Vector orig = part.getOrigin();
+	return (orig.magnitude() < 0.1);
+    }
+
+    protected List<MCParticle> findPrimaries(MCParticle part) {
+	Vector<MCParticle> output = new Vector<MCParticle>();
+	boolean isPrimary = checkIfPrimary(part);
+	if (isPrimary) {
+	    output.add(part);
+	    return output;
+	} else {
+	    List<MCParticle> parents = part.getParents();
+	    if (parents.size()==0) {
+		return output;
+	    } else {
+		for (MCParticle parent : parents) {
+		    List<MCParticle> parentPrimaries = findPrimaries(parent);
+		    if (parentPrimaries.size() != 0) {
+			output.addAll(parentPrimaries);
+		    }
+		}
+		return output;
+	    }
+	}
+    }
+
+}

lcsim/src/org/lcsim/contrib/uiowa/structural
SimpleFragmentIdentifier.java added at 1.1
diff -N SimpleFragmentIdentifier.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ SimpleFragmentIdentifier.java	16 Dec 2005 21:11:26 -0000	1.1
@@ -0,0 +1,86 @@
+package structural;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import hep.physics.vec.BasicHep3Vector;
+import hep.physics.vec.Hep3Vector;
+import hep.physics.vec.VecOp;
+
+import org.lcsim.event.Cluster;
+import org.lcsim.event.EventHeader;
+import org.lcsim.event.CalorimeterHit;
+
+/**
+ * Determine whether a cluster is a fragment or not.
+ *
+ * @version $Id: SimpleFragmentIdentifier.java,v 1.1 2005/12/16 21:11:26 mcharles Exp $
+ */
+
+public class SimpleFragmentIdentifier implements FragmentIdentifier 
+{
+    /**
+     * Constructor.
+     */
+    public SimpleFragmentIdentifier(String nameOfHelixToClusterMap) {
+	m_nameOfHelixToClusterMap = nameOfHelixToClusterMap;
+    }
+
+    /**
+     * Attempt to determine whether the cluster is a fragment.
+     *
+     * @return true if we think it is a fragment, false if not.
+     */
+    public boolean isFragment(Cluster clus, EventHeader event) 
+    {
+	// Is there a track associated with this cluster?
+        boolean hasTrack = false;
+	Map<TrackExtrapolationInfo, Cluster> helixMap = null;
+	{
+	    List<Object> trackMapObjectList = event.get(Object.class, m_nameOfHelixToClusterMap);
+	    Object trackMapObject = trackMapObjectList.iterator().next();
+	    helixMap = (Map<TrackExtrapolationInfo, Cluster>) (trackMapObject);
+	}
+	Set<TrackExtrapolationInfo> helices = helixMap.keySet();
+	for (CalorimeterHit hit : clus.getCalorimeterHits()) {
+	    for (TrackExtrapolationInfo helix : helices) {
+		CalorimeterHit trackHit = helix.getHit();
+		if (trackHit == hit) {
+		    hasTrack = true;
+		    break;
+		}
+	    }
+	    if (hasTrack) {
+		break;
+	    }
+	}
+	
+	// Check # hits
+	int nHits = clus.getCalorimeterHits().size();
+        boolean nHitsGood = (nHits > 10);
+
+	if (nHits<4) {
+	    // If too few hits (1, 2, maybe 3), DOCA is undefined.
+	    // Treat these cases as fragments always (unless there's a track)
+	    if (!hasTrack) {
+		return true; // fragment
+	    } else {
+		return false; // has track => tiny but real cluster
+	    }
+	} else {
+	    // Enough hits to check DOCA
+	    BasicHep3Vector originPoint = new BasicHep3Vector(0,0,0);
+	    Hep3Vector[] linePosAndDir = MiscUtilities.getPositionAndDirection(clus);
+	    double DOCA = MiscUtilities.findDOCAToPoint(linePosAndDir[0], linePosAndDir[1], originPoint);
+	    boolean docaGood = (DOCA < 100.0);
+
+	    // It's a fragment if there's no track AND not enough hits AND doesn't point back to IP:
+	    boolean isFragment = !hasTrack && !nHitsGood && !docaGood;	
+	    //System.out.println("DEBUG: "+this.getClass().getName()+": isFragment="+isFragment+" because hasTrack="+hasTrack+", nHits="+nHits+", doca="+DOCA+" (DOCAgood="+docaGood+")");
+	    return isFragment;
+	}
+    }
+
+    protected String m_nameOfHelixToClusterMap;
+}

lcsim/src/org/lcsim/contrib/uiowa/structural
SwimToECAL.java added at 1.1
diff -N SwimToECAL.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ SwimToECAL.java	16 Dec 2005 21:11:26 -0000	1.1
@@ -0,0 +1,182 @@
+package structural;
+
+import java.util.List;
+import java.util.Set;
+import java.util.Vector;
+
+import hep.physics.vec.*;
+
+import org.lcsim.event.EventHeader;
+import org.lcsim.util.Driver;
+import org.lcsim.util.swim.HelixSwimmer;
+import org.lcsim.event.MCParticle;
+import org.lcsim.geometry.subdetector.CylindricalCalorimeter;
+import org.lcsim.geometry.Detector;
+
+public class SwimToECAL extends Driver
+{
+    /**
+     * Constructor.
+     * @param nameOfHelixList Input: Map MCParticles to HelixSwimmers
+     * @param nameOfExtrapolationInfoList Output: Map MCParticles to TrackExtrapolationInfo
+     */
+    public SwimToECAL(String nameOfHelixList, String nameOfExtrapolationInfoList)
+    {
+	m_nameOfHelixList = nameOfHelixList;
+	m_nameOfExtrapolationInfoList = nameOfExtrapolationInfoList;
+    }
+
+    /**
+     * Handle one event.
+     */
+     public void process(EventHeader event)
+    {
+	initGeometry(event);
+
+	// Input map:
+	List<MapMCToHelix> inputMapList = event.get(MapMCToHelix.class, m_nameOfHelixList);
+	MapMCToHelix inputMap = inputMapList.iterator().next();
+	// Output map:
+	MapMCToExtrapInfo outputMap = new MapMCToExtrapInfo();
+	// Some crosschecks:
+	int countParticlesSwumToBarrel = 0;
+	int countParticlesSwumToEndcap = 0;
+	int countFailedExtrapolations = 0;
+	// Swim:
+	Set<MCParticle> particleSet = inputMap.keySet();
+	for (MCParticle part : particleSet) {
+	    // Look up the helix swimmer:
+	    HelixSwimmer swimmer = inputMap.get(part);
+
+	    // Prepare to swim:
+	    double alpha = Double.NaN; // distance to intercept
+	    // Try swimming to the barrel:
+	    double  alphaBarrel = swimToBarrel(swimmer);
+	    boolean validBarrel = false;
+	    // Try swimming to the endcap:
+	    double  alphaEndcap = swimToEndcap(swimmer);
+	    boolean validEndcap = false;
+	    if (isValidBarrelIntercept(swimmer, alphaBarrel) && checkDecayPoint(part, true, swimmer.getPointAtDistance(alphaBarrel))) {
+		alpha = alphaBarrel;
+		validBarrel = true;
+	    } else if (isValidEndcapIntercept(swimmer, alphaEndcap) && checkDecayPoint(part, false, swimmer.getPointAtDistance(alphaEndcap))) {
+		alpha = alphaEndcap;
+		validEndcap = true;
+	    }
+
+	    if ( ! Double.isNaN(alpha) ) {
+		// Found something.
+		Hep3Vector intercept = swimmer.getPointAtDistance(alpha);
+		// Obtain the unit vector giving the tangent:
+		double delta = 0.1;
+		if (alpha < 0) { delta *= -1.0; }
+		Hep3Vector aLittleFurther = swimmer.getPointAtDistance(alpha+delta);
+		Hep3Vector tangent = VecOp.unit(VecOp.sub(aLittleFurther, intercept));
+		// Scale it to get the momentum:
+		Hep3Vector momentum = part.getMomentum();
+		Hep3Vector momentumAtIntercept = VecOp.mult(momentum.magnitude(), tangent);
+		TrackExtrapolationInfo info = new TrackExtrapolationInfo(intercept, momentumAtIntercept, part, swimmer);
+		outputMap.put(part, info);
+		// Crosschecks:
+		if (validEndcap && !validBarrel) {
+		    countParticlesSwumToEndcap++;
+		} else if (validBarrel && !validEndcap) {
+		    countParticlesSwumToBarrel++;
+		} else if (!validEndcap && !validBarrel) {
+		    throw new AssertionError("alpha is not NaN, but not a valid barrel or endcap intercept");
+		} else {
+		    throw new AssertionError("Confusing intercept! barrel="+validBarrel+", endcap="+validEndcap);
+		}
+	    } else {
+		countFailedExtrapolations++;
+	    }
+	}
+	// Wrap output:
+	List<MapMCToExtrapInfo> outputMapList = new Vector<MapMCToExtrapInfo>();
+	outputMapList.add(outputMap);
+	event.put(m_nameOfExtrapolationInfoList, outputMapList);
+	// Checks:
+	if (countParticlesSwumToBarrel + countParticlesSwumToEndcap + countFailedExtrapolations != particleSet.size()) { 
+	    throw new AssertionError("Problem counting: "+countParticlesSwumToBarrel+" + "+countParticlesSwumToEndcap+" + "+countFailedExtrapolations+" != "+particleSet.size()); 
+	}
+	System.out.println(this.getClass().getName()+": DEBUG: valid extrapolations to barrel="+countParticlesSwumToBarrel+", endcap="+countParticlesSwumToEndcap+"; invalid extrapolations="+countFailedExtrapolations);
+    }
+
+    
+    protected double swimToBarrel(HelixSwimmer swimmer) {
+	// Look for a hit in the first layer of the ECAL barrel
+	return swimmer.getDistanceToRadius(m_ECAL_barrel_r);
+    }
+    protected double swimToEndcap(HelixSwimmer swimmer) {
+	// Look for a hit in the first layer of the ECAL endcap
+	return swimmer.getDistanceToZ(m_ECAL_endcap_z);
+    }
+    protected boolean isValidBarrelIntercept(HelixSwimmer swimmer, double alpha) {
+	// Must have -m_ECAL_barrel_z <= z <= +m_ECAL_barrel_z
+	Hep3Vector intercept = swimmer.getPointAtDistance(alpha);
+	double z = intercept.z();
+	boolean zInRange = (z >= m_ECAL_barrel_zmin && z <= m_ECAL_barrel_zmax);
+	return zInRange;
+    }
+    protected boolean isValidEndcapIntercept(HelixSwimmer swimmer, double alpha) {
+	// Must have m_ECAL_endcap_rmin <= r <= m_ECAL_endcap_rmax
+	Hep3Vector intercept = swimmer.getPointAtDistance(alpha);
+	double r = Math.sqrt(intercept.x()*intercept.x() + intercept.y()*intercept.y());
+	boolean rInRange = (r >= m_ECAL_endcap_rmin && r <= m_ECAL_endcap_rmax);
+	return rInRange;
+    }
+
+    protected boolean checkDecayPoint(MCParticle part, boolean interceptBarrel, Hep3Vector intercept) {
+	MCParticle.SimulatorStatus status = part.getSimulatorStatus();
+	if (status.isDecayedInTracker()) {
+	    // It decayed inside the tracker. Did we notice?
+	    Hep3Vector endPoint = part.getEndPoint();
+	    if (interceptBarrel) {
+		double layer4_r = 98.8 * 10.0; // FIXME: ugly -- should read from file
+		double endpoint_r = Math.sqrt(endPoint.x()*endPoint.x() + endPoint.y()*endPoint.y());
+		return (endpoint_r >= layer4_r);
+	    } else {
+		double layer9_z = 165.0 * 10.0; // FIXME: ugly -- should read from file
+		double endpoint_z = endPoint.z();
+		return (endpoint_z >= layer9_z);
+	    }
+	} else {
+	    // It didn't decay inside tracker => probably OK.
+	    // (Not always, but assume for now...)
+	    return true;
+	}
+    }
+    
+	 
+    protected void initGeometry(EventHeader event) 
+    {
+	if (!m_init) {
+	    Detector det = event.getDetector();
+	    CylindricalCalorimeter emb = ((CylindricalCalorimeter) det.getSubdetectors().get("EMBarrel"));
+	    CylindricalCalorimeter eme = ((CylindricalCalorimeter) det.getSubdetectors().get("EMEndcap"));
+	    m_ECAL_barrel_zmin = emb.getZMin();
+	    m_ECAL_barrel_zmax = emb.getZMax();
+	    m_ECAL_barrel_r = emb.getLayering().getDistanceToLayerSensorMid(0);
+	    m_ECAL_endcap_z = eme.getLayering().getDistanceToLayerSensorMid(0);
+	    m_ECAL_endcap_rmin = eme.getInnerRadius();
+	    m_ECAL_endcap_rmax = eme.getOuterRadius();
+	    m_init = true;
+	    System.out.println(this.getClass().getName()+": Init: m_ECAL_barrel_zmin="+m_ECAL_barrel_zmin);
+	    System.out.println(this.getClass().getName()+": Init: m_ECAL_barrel_zmax="+m_ECAL_barrel_zmax);
+	    System.out.println(this.getClass().getName()+": Init: m_ECAL_barrel_r="+m_ECAL_barrel_r);
+	    System.out.println(this.getClass().getName()+": Init: m_ECAL_endcap_z="+m_ECAL_endcap_z);
+	    System.out.println(this.getClass().getName()+": Init: m_ECAL_endcap_rmin="+m_ECAL_endcap_rmin);
+	    System.out.println(this.getClass().getName()+": Init: m_ECAL_endcap_rmax="+m_ECAL_endcap_rmax);
+	}
+    }
+
+    protected boolean m_init = false;
+    protected double m_ECAL_barrel_zmin;
+    protected double m_ECAL_barrel_zmax;
+    protected double m_ECAL_barrel_r;
+    protected double m_ECAL_endcap_z;
+    protected double m_ECAL_endcap_rmin;
+    protected double m_ECAL_endcap_rmax;
+    protected String m_nameOfHelixList;
+    protected String m_nameOfExtrapolationInfoList;
+}

lcsim/src/org/lcsim/contrib/uiowa/structural
TrackExtrapolationInfo.java added at 1.1
diff -N TrackExtrapolationInfo.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ TrackExtrapolationInfo.java	16 Dec 2005 21:11:26 -0000	1.1
@@ -0,0 +1,49 @@
+package structural;
+
+import hep.physics.vec.*;
+import org.lcsim.event.MCParticle;
+import hep.physics.particle.properties.ParticleType;
+import org.lcsim.util.swim.HelixSwimmer;
+import org.lcsim.event.CalorimeterHit;
+
+/**
+ * A utility class to hold basic information about a track
+ * extrapolation. It stores the intercept point, the
+ * momentum AT THAT POINT, and the extrapolated MC particle.
+ */
+
+public class TrackExtrapolationInfo
+{
+    public TrackExtrapolationInfo(Hep3Vector intercept, Hep3Vector momentum, MCParticle particle, HelixSwimmer swimmer) {
+	m_intercept = intercept;
+	m_momentum = momentum;
+	m_particle = particle;
+	m_swimmer = swimmer;
+    }
+
+    public Hep3Vector getMomentum() {
+	return m_momentum;
+    }
+
+    public Hep3Vector getIntercept() {
+	return m_intercept;
+    }
+
+    public ParticleType getType() {
+	return m_particle.getType(); 
+    }
+
+    public MCParticle getMCParticle() {
+	return m_particle; 
+    }
+
+    Hep3Vector m_intercept;
+    Hep3Vector m_momentum;
+    MCParticle m_particle;
+    HelixSwimmer m_swimmer;
+
+    CalorimeterHit m_hit = null;
+
+    public void setHit(CalorimeterHit hit) { m_hit = hit; }
+    public CalorimeterHit getHit() { return m_hit; }
+}
CVSspam 0.2.8