lcsim/src/org/lcsim/contrib/onoprien/crux/algorithms
diff -u -r1.1 -r1.2
--- ClusteringDriver.java 2 Apr 2008 22:30:10 -0000 1.1
+++ ClusteringDriver.java 4 Apr 2008 18:29:02 -0000 1.2
@@ -11,10 +11,14 @@
import org.lcsim.contrib.onoprien.crux.infrastructure.*;
/**
- *
+ * Driver that controls clustering of hits in the calorimeter.
+ * <p>
+ * The actual work is done by one or more {@link Clusterer} objects supplied through
+ * calls to {@link #set set(String name, Object... value)} method. This driver fetches
+ * input hit map from the event,
*
* @author D. Onoprienko
- * @version $Id: ClusteringDriver.java,v 1.1 2008/04/02 22:30:10 onoprien Exp $
+ * @version $Id: ClusteringDriver.java,v 1.2 2008/04/04 18:29:02 onoprien Exp $
*/
public class ClusteringDriver extends CruxDriver {
lcsim/src/org/lcsim/contrib/onoprien/crux/tests
diff -u -r1.1 -r1.2
--- TestDriverClustering.java 2 Apr 2008 22:30:11 -0000 1.1
+++ TestDriverClustering.java 4 Apr 2008 18:29:02 -0000 1.2
@@ -21,7 +21,7 @@
*
*
* @author D. Onoprienko
- * @version $Id: TestDriverClustering.java,v 1.1 2008/04/02 22:30:11 onoprien Exp $
+ * @version $Id: TestDriverClustering.java,v 1.2 2008/04/04 18:29:02 onoprien Exp $
*/
public class TestDriverClustering extends CruxDriver {
@@ -60,30 +60,30 @@
hitMapCreator.set("OUTPUT", null, "CalHitMap_All", "MAP");
add(hitMapCreator);
- add(new CruxDriver() {
- public void process(EventHeader event) {
- int nHits = 0;
- List<CalorimeterHit> hits = event.get(CalorimeterHit.class, "EcalBarrDigiHits");
- log("EcalBarrDigiHits " + hits.size()); nHits += hits.size();
- hits = event.get(CalorimeterHit.class, "EcalEndcapDigiHits");
- log("EcalEndcapDigiHits " + hits.size()); nHits += hits.size();
- hits = event.get(CalorimeterHit.class, "HcalBarrDigiHits");
- log("HcalBarrDigiHits " + hits.size()); nHits += hits.size();
- hits = event.get(CalorimeterHit.class, "HcalEndcapDigiHits");
- log("HcalEndcapDigiHits " + hits.size()); nHits += hits.size();
- log("Total = " + nHits);
- CruxHitMap map = (CruxHitMap) event.get("CalHitMap_All");
- log("CalHitMap_All " + map.size());
- }
- });
+// add(new CruxDriver() {
+// public void process(EventHeader event) {
+// int nHits = 0;
+// List<CalorimeterHit> hits = event.get(CalorimeterHit.class, "EcalBarrDigiHits");
+// log("EcalBarrDigiHits " + hits.size()); nHits += hits.size();
+// hits = event.get(CalorimeterHit.class, "EcalEndcapDigiHits");
+// log("EcalEndcapDigiHits " + hits.size()); nHits += hits.size();
+// hits = event.get(CalorimeterHit.class, "HcalBarrDigiHits");
+// log("HcalBarrDigiHits " + hits.size()); nHits += hits.size();
+// hits = event.get(CalorimeterHit.class, "HcalEndcapDigiHits");
+// log("HcalEndcapDigiHits " + hits.size()); nHits += hits.size();
+// log("Total = " + nHits);
+// CruxHitMap map = (CruxHitMap) event.get("CalHitMap_All");
+// log("CalHitMap_All " + map.size());
+// }
+// });
// -- Initial clustering : ------------------------------------------------
ClusteringDriver clusteringDriver = new ClusteringDriver();
clusteringDriver.set("INPUT_HIT_MAP", "CalHitMap_All");
clusteringDriver.set("SPLIT_BY_MODULE");
-// Clusterer clusterer = new NearestNeighborClusterer(1, 1, 1, 1, 0.);
- Clusterer clusterer = new org.lcsim.recon.cluster.cheat.CheatClusterer();
+ Clusterer clusterer = new NearestNeighborClusterer(1, 1, 1, 1, 0.);
+// Clusterer clusterer = new org.lcsim.recon.cluster.cheat.CheatClusterer();
clusteringDriver.set("OUTPUT", null, clusterer, "FirstPassClusters");
add(clusteringDriver);
lcsim/src/org/lcsim/contrib/onoprien/crux/util
diff -u -r1.1 -r1.2
--- ConstList.java 2 Apr 2008 22:30:11 -0000 1.1
+++ ConstList.java 4 Apr 2008 18:29:02 -0000 1.2
@@ -4,9 +4,16 @@
/**
* Immutable list backed by the list supplied to the constructor.
+ * Useful for passing the original list to client code without copying it, when the
+ * client should not be able to modify the list, or when the client expects
+ * <tt>List<E></tt> but the original list is of type <tt>List<<i>Subclass of</i> E></tt>.
+ * <p>
+ * An attempt to modify a list of this type will result in <tt>UnsupportedOperationException</tt>.
+ * The <tt>ConstList</tt> object is backed by the list that was supplied to its constructor,
+ * so changes in the original list are reflected in the <tt>ConstList</tt>.
*
* @author D. Onoprienko
- * @version $Id: ConstList.java,v 1.1 2008/04/02 22:30:11 onoprien Exp $
+ * @version $Id: ConstList.java,v 1.2 2008/04/04 18:29:02 onoprien Exp $
*/
public class ConstList<E> implements List<E> {