lcsim/src/org/lcsim/contrib/uiowa/structural
diff -u -r1.3 -r1.4
--- Remapper.java 14 Oct 2005 17:49:45 -0000 1.3
+++ Remapper.java 19 Oct 2005 18:55:16 -0000 1.4
@@ -11,6 +11,14 @@
import org.lcsim.event.Cluster;
import org.lcsim.event.CalorimeterHit;
+/**
+ * A driver to handle Cluster-Track association after
+ * merging Clusters. This is needed when merging ECAL
+ * and HCAL clusters, for example.
+ *
+ * @version $Id: Remapper.java,v 1.4 2005/10/19 18:55:16 mcharles Exp $
+ */
+
class Remapper extends Driver
{
protected String m_clusterListName;
@@ -18,6 +26,12 @@
protected List<String> m_clusterSubListNames;
protected List<String> m_subMapNames;
+ /**
+ * Constructor
+ *
+ * @param clusterListName Name of the merged list to be read in
+ * @param mapName Name of the map (from merged clusters to track segments) to be written out
+ */
public Remapper(String clusterListName, String mapName) {
m_clusterListName=clusterListName;
m_mapName=mapName;
@@ -25,15 +39,24 @@
m_subMapNames = new Vector<String> ();
}
+ /**
+ * Add another list of clusters and associated track segments.
+ *
+ * @param clusterSubListName Name of the list of clusters to read in
+ * @param subMapName Name of the map (from those clusters to track segments) to read in
+ */
public void addInputClusters(String clusterSubListName, String subMapName) {
m_clusterSubListNames.add(clusterSubListName);
m_subMapNames.add(subMapName);
if (m_clusterSubListNames.size() != m_subMapNames.size()) { throw new AssertionError("Validity check failed"); }
}
+ /**
+ * Create the merged mapping for this event.
+ */
public void process(EventHeader event) {
if (m_clusterSubListNames.size() != m_subMapNames.size()) { throw new AssertionError("Validity check failed"); }
- Map<Cluster, List<Cluster> > mapClustersToTracks = new HashMap<Cluster, List<Cluster> > ();
+ MapClusterToListOfClusters mapClustersToTracks = new MapClusterToListOfClusters();
List<Cluster> bigClusters = event.get(Cluster.class, m_clusterListName);
for (int i=0; i<m_clusterSubListNames.size(); i++) {
String clusterSubListName = m_clusterSubListNames.get(i);
@@ -77,7 +100,7 @@
}
}
// Dummy for writeout
- List<Map<Cluster, List<Cluster>>> dummyList = new Vector<Map<Cluster, List<Cluster> > > ();
+ List<MapClusterToListOfClusters> dummyList = new Vector<MapClusterToListOfClusters> ();
dummyList.add(mapClustersToTracks);
event.put(m_mapName, dummyList);
@@ -99,6 +122,6 @@
}
protected boolean m_debug = false;
- void setDebug(boolean debug) { m_debug = debug; }
+ public void setDebug(boolean debug) { m_debug = debug; }
}