Print

Print


Commit in lcsim/src/org/lcsim/contrib/uiowa/structural on MAIN
Remapper.java+50added 1.1
Incomplete code to handle the mapping from clusters to MIPs after you run your clusters through another level of merging

lcsim/src/org/lcsim/contrib/uiowa/structural
Remapper.java added at 1.1
diff -N Remapper.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ Remapper.java	1 Oct 2005 01:37:26 -0000	1.1
@@ -0,0 +1,50 @@
+package structural; // package org.lcsim.recon.cluster.structural;
+
+import java.lang.String;
+import java.util.List;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Vector;
+import org.lcsim.event.EventHeader;
+import org.lcsim.util.Driver;
+import org.lcsim.event.Cluster;
+import org.lcsim.event.CalorimeterHit;
+
+class Remapper extends Driver
+{
+    protected String m_clusterListName;
+    protected String m_mapName;
+    protected List<String> m_clusterSubListNames;
+    protected List<String> m_subMapNames;
+    
+    public Remapper(String clusterListName, String mapName) {
+	m_clusterListName=clusterListName;
+	m_mapName=mapName;
+	m_clusterSubListNames = new Vector<String> ();
+	m_subMapNames = new Vector<String> ();
+    }
+
+    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"); }
+    }
+
+    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> > ();
+	for (int i=0; i<m_clusterSubListNames.size(); i++) {
+	    String clusterSubListName = m_clusterSubListNames.get(i);
+	    String subMapName = m_subMapNames.get(i);
+	    List<Cluster> clusters = event.get(Cluster.class, clusterSubListName);
+	    List<MapClusterToListOfClusters> dummyList = event.get(MapClusterToListOfClusters.class, subMapName);
+	    // [...]
+	}
+	// Dummy...
+	List<Map<Cluster, List<Cluster>>> dummyList = new Vector<Map<Cluster, List<Cluster> > > ();
+	dummyList.add(mapClustersToTracks);
+	event.put(m_mapName, dummyList);
+
+    }
+}
+
CVSspam 0.2.8