Print

Print


Commit in lcsim/src/org/lcsim/recon/pfa/structural on MAIN
FakeDTDriver.java+61added 1.1
Fake a DTDriver to make clusters in the Muon detectors

lcsim/src/org/lcsim/recon/pfa/structural
FakeDTDriver.java added at 1.1
diff -N FakeDTDriver.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ FakeDTDriver.java	19 Mar 2010 20:01:04 -0000	1.1
@@ -0,0 +1,61 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package org.lcsim.recon.pfa.structural;
+import org.lcsim.util.Driver;
+import org.lcsim.recon.cluster.nn.*;
+import org.lcsim.event.Cluster;
+import org.lcsim.event.CalorimeterHit;
+import org.lcsim.util.lcio.LCIOConstants;
+import org.lcsim.event.EventHeader;
+import java.util.List;
+import java.util.Map;
+
+/**
+ *
+ * @author cassell
+ */
+public class FakeDTDriver extends Driver
+{
+    private int _minNcells;
+
+    // the neighborhood in u to search
+    private int _dU;
+    // the neighborhood in v to search
+    private int _dV;
+    // the neighborood in layers to search
+    private int _dLayer;
+    // energy threshold
+    private double _thresh;
+    // Create clusters class
+    private NearestNeighborClusterer _clusterer;
+    private String inmapname;
+    private String clname;
+    public FakeDTDriver(int dU, int dV, int dLayer, int ncells,
+        double threshold)
+    {
+        _dU = dU;
+        _dV = dV;
+        _dLayer = dLayer;
+        _minNcells = ncells;
+        _thresh = threshold;
+        _clusterer = new NearestNeighborClusterer(_dU,_dV,_dLayer,_minNcells,_thresh);
+    }
+    public void setInputHitMap(String name) {
+	inmapname = name;
+    }
+    public void setOutputClusterList(String name) {
+	clname = name;
+    }
+    protected void process(EventHeader event)
+    {
+        Map<Long,CalorimeterHit> hitmap = (Map) event.get(inmapname);
+        List<Cluster> clusters = _clusterer.createClusters(hitmap);
+
+        int flag = 1 << LCIOConstants.CLBIT_HITS;
+        event.put(clname,clusters,Cluster.class,flag);
+    }
+
+}
CVSspam 0.2.8