Print

Print


Commit in lcsim/src/org/lcsim/contrib/onoprien/crux on MAIN
algorithms/ValidationDriver.java+2-21.1 -> 1.2
algorithms/rosary/Bead.java+18-81.2 -> 1.3
                 /Crack.java+10-41.2 -> 1.3
                 /Dot.java+15-61.2 -> 1.3
                 /Rosary.java+15-41.1 -> 1.2
                 /RosaryClusterer.java+2-21.2 -> 1.3
                 /RosaryNode.java+9-181.2 -> 1.3
                 /RosaryNodeCluster.java+14-171.2 -> 1.3
                 /Track.java+7-41.1 -> 1.2
auxdrivers/RemoveObjectDriver.java+2-21.1 -> 1.2
diagnostics/ClusteringTest.java+4-41.3 -> 1.4
           /TrackingTest.java+5-51.2 -> 1.3
tests/TestDriver.java+3-31.1 -> 1.2
     /TestDriverClustering.java+3-31.2 -> 1.3
     /TestDriverMCTruth.java+6-61.1 -> 1.2
     /TestDriverRosary.java+3-31.2 -> 1.3
tracking/CheatTrackFinderDriver.java+4-41.2 -> 1.3
        /CheatVertexFinderDriver.java+4-41.2 -> 1.3
mctruth/MCTruthCrux.java+129added 1.1
       /MCTruthDriverCrux.java+31added 1.1
       /package-info.java+4added 1.1
       /CruxMCTruth.java-1251.1 removed
       /MCTruthDriver.java-301.1 removed
+290-254
3 added + 2 removed + 18 modified, total 23 files
Refactoring and enhancements to MCTruth

lcsim/src/org/lcsim/contrib/onoprien/crux/algorithms
ValidationDriver.java 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- ValidationDriver.java	2 Apr 2008 22:30:10 -0000	1.1
+++ ValidationDriver.java	4 Nov 2008 02:17:58 -0000	1.2
@@ -12,7 +12,7 @@
 import org.lcsim.contrib.onoprien.crux.infrastructure.CruxParticleList;
 import org.lcsim.contrib.onoprien.crux.infrastructure.CruxParticleMarker;
 import org.lcsim.contrib.onoprien.crux.infrastructure.CruxVertex;
-import org.lcsim.contrib.onoprien.crux.mctruth.CruxMCTruth;
+import org.lcsim.contrib.onoprien.crux.mctruth.MCTruthCrux;
 
 /**
  * Driver that assigns parameters (energy, momentum, particle type) to reconstructed
@@ -39,7 +39,7 @@
  * is called for a vertex after its daughter particles have been validated.
  *
  * @author D. Onoprienko
- * @version $Id: ValidationDriver.java,v 1.1 2008/04/02 22:30:10 onoprien Exp $
+ * @version $Id: ValidationDriver.java,v 1.2 2008/11/04 02:17:58 onoprien Exp $
  */
 public class ValidationDriver extends CruxDriver {
   

lcsim/src/org/lcsim/contrib/onoprien/crux/algorithms/rosary
Bead.java 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- Bead.java	27 Jun 2008 02:55:20 -0000	1.2
+++ Bead.java	4 Nov 2008 02:17:59 -0000	1.3
@@ -9,32 +9,42 @@
 import org.lcsim.contrib.onoprien.crux.infrastructure.*;
 
 /**
- *
+ * Class that represents a clamp-like cluster in a single calorimeter layer.
+ * The exact definition of "clamp-like" depends on {@link DotAndBeadFinder} parameters,
+ * but in general, <tt>Bead</tt> is intended to represent a cluster that is bigger than a
+ * typical trace of a MIP.
  *
  * @author D. Onoprienko
- * @version $Id: Bead.java,v 1.2 2008/06/27 02:55:20 onoprien Exp $
+ * @version $Id: Bead.java,v 1.3 2008/11/04 02:17:59 onoprien Exp $
  */
 public class Bead extends RosaryNodeCluster {
   
 // -- Constructors :  ----------------------------------------------------------
-  
-  
+
   public Bead() {
-    super(RosaryNode.Type.BEAD);
   }
   
   public Bead(CruxCalLayer layer) {
-    super(RosaryNode.Type.BEAD, layer);
+    super(layer);
   }
   
   public Bead(CruxCalLayer layer, Collection<CalorimeterHit> hits) {
-    super(RosaryNode.Type.BEAD, layer, hits);
+    super(layer, hits);
   }
   
   public Bead(CruxCalLayer layer, Cluster cluster) {
     this(layer, cluster.getCalorimeterHits());
   }
-  
+
+
+// -- Getters :  ---------------------------------------------------------------
+  
+  /** Returns the type of this node.*/
+  public Type getType() {
+    return RosaryNode.Type.BEAD;
+  }
+
+
 // -- Private parts :  ---------------------------------------------------------
   
 }

lcsim/src/org/lcsim/contrib/onoprien/crux/algorithms/rosary
Crack.java 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- Crack.java	27 Jun 2008 02:55:20 -0000	1.2
+++ Crack.java	4 Nov 2008 02:17:59 -0000	1.3
@@ -1,24 +1,23 @@
 package org.lcsim.contrib.onoprien.crux.algorithms.rosary;
 
-import org.lcsim.contrib.onoprien.crux.infrastructure.CruxCalLayer;
 import org.lcsim.contrib.onoprien.crux.infrastructure.*;
 
 /**
  * Class to represent a crack in a {@link Rosary} - a layer with no clusters attached.
  *
  * @author D. Onoprienko
- * @version $Id: Crack.java,v 1.2 2008/06/27 02:55:20 onoprien Exp $
+ * @version $Id: Crack.java,v 1.3 2008/11/04 02:17:59 onoprien Exp $
  */
 public class Crack extends RosaryNode {
   
 // -- Constructors :  ----------------------------------------------------------
   
   public Crack() {
-    super(RosaryNode.Type.CRACK);
+    super();
   }
   
   public Crack(CruxCalLayer layer) {
-    super(RosaryNode.Type.CRACK, layer);
+    super(layer);
   }
   
 // -- Default instance :  ------------------------------------------------------
@@ -28,6 +27,13 @@
     return _defInstance;
   }
   
+// -- Getters :  ---------------------------------------------------------------
+  
+  /** Returns the type of this node.*/
+  public Type getType() {
+    return RosaryNode.Type.CRACK;
+  }
+  
 // -- Private parts :  ---------------------------------------------------------
   
   static private Crack _defInstance;

lcsim/src/org/lcsim/contrib/onoprien/crux/algorithms/rosary
Dot.java 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- Dot.java	27 Jun 2008 02:55:20 -0000	1.2
+++ Dot.java	4 Nov 2008 02:17:59 -0000	1.3
@@ -9,34 +9,43 @@
 import org.lcsim.contrib.onoprien.crux.infrastructure.*;
 
 /**
- *
+ * Class that represents a point-like cluster in a single calorimeter layer.
+ * The exact definition of "point-like" depends on {@link DotAndBeadFinder} parameters,
+ * but in general, <tt>Dot</tt> is intended to represent a trace of a MIP.
  *
  * @author D. Onoprienko
- * @version $Id: Dot.java,v 1.2 2008/06/27 02:55:20 onoprien Exp $
+ * @version $Id: Dot.java,v 1.3 2008/11/04 02:17:59 onoprien Exp $
  */
 public class Dot extends RosaryNodeCluster {
   
 // -- Constructors :  ----------------------------------------------------------
   
   public Dot() {
-    super(RosaryNode.Type.DOT);
+    super();
   }
   
   public Dot(CruxCalLayer layer) {
-    super(RosaryNode.Type.DOT, layer);
+    super(layer);
   }
   
   public Dot(CruxCalLayer layer, CalorimeterHit hit) {
-    super(RosaryNode.Type.DOT, layer, hit);
+    super(layer, hit);
   }
   
   public Dot(CruxCalLayer layer, Collection<CalorimeterHit> hits) {
-    super(RosaryNode.Type.DOT, layer, hits);
+    super(layer, hits);
   }
   
   public Dot(CruxCalLayer layer, Cluster cluster) {
     this(layer, cluster.getCalorimeterHits());
   }
+  
+// -- Getters :  ---------------------------------------------------------------
+  
+  /** Returns the type of this node.*/
+  public Type getType() {
+    return RosaryNode.Type.DOT;
+  }
 
 // -- Private parts :  ---------------------------------------------------------
 

lcsim/src/org/lcsim/contrib/onoprien/crux/algorithms/rosary
Rosary.java 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- Rosary.java	22 Apr 2008 18:27:54 -0000	1.1
+++ Rosary.java	4 Nov 2008 02:17:59 -0000	1.2
@@ -11,10 +11,14 @@
 import static org.lcsim.contrib.onoprien.crux.algorithms.rosary.RosaryNode.Type.*;
 
 /**
- *
+ * Class that represents a rosary cluster.
+ * <p>
+ * <tt>Rosary</tt> is a list of {@link RosaryNode}, indexed from head to tail. The reconstructed
+ * particle is assumed to propagate from head to tail of a <tt>Rosary</tt>. 
+ * 
  *
  * @author D. Onoprienko
- * @version $Id: Rosary.java,v 1.1 2008/04/22 18:27:54 onoprien Exp $
+ * @version $Id: Rosary.java,v 1.2 2008/11/04 02:17:59 onoprien Exp $
  */
 public class Rosary extends CruxCluster {
   
@@ -58,6 +62,13 @@
     return rosary;
   }
   
+  static public Rosary seedFromTrack(CruxTrack track) {
+    Rosary rosary = new Rosary();
+    rosary.addNode(new Track(track));
+    rosary._track = track;
+    return rosary;
+  }
+  
   static public Rosary seedFromDot(Dot dot) {
     Rosary rosary = new Rosary();
     rosary.addNode(dot);
@@ -80,8 +91,8 @@
   }
   
   /** 
-   * Returns the first node of one of the specified types in this <tt>Rosary</tt>.
-   * Returns <tt>null</tt> if this <tt>Rosary</tt> does not have nodes of the given types.
+   * Returns the first node in this <tt>Rosary</tt> that belongs to one of the specified types.
+   * Returns <tt>null</tt> if this <tt>Rosary</tt> does not have nodes of these types.
    */
   public RosaryNode getHeadNode(RosaryNode.Type type, RosaryNode.Type... types) {
     ListIterator<RosaryNode> it = _nodes.listIterator();

lcsim/src/org/lcsim/contrib/onoprien/crux/algorithms/rosary
RosaryClusterer.java 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- RosaryClusterer.java	27 Jun 2008 02:55:20 -0000	1.2
+++ RosaryClusterer.java	4 Nov 2008 02:17:59 -0000	1.3
@@ -23,10 +23,10 @@
  *
  *
  * @author D. Onoprienko
- * @version $Id: RosaryClusterer.java,v 1.2 2008/06/27 02:55:20 onoprien Exp $
+ * @version $Id: RosaryClusterer.java,v 1.3 2008/11/04 02:17:59 onoprien Exp $
  */
 public class RosaryClusterer extends CruxDriver implements Clusterer, CruxEventListener {
-  
+
 // -- Constructors and initialization :  ---------------------------------------
   
   public RosaryClusterer() {

lcsim/src/org/lcsim/contrib/onoprien/crux/algorithms/rosary
RosaryNode.java 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- RosaryNode.java	27 Jun 2008 02:55:20 -0000	1.2
+++ RosaryNode.java	4 Nov 2008 02:17:59 -0000	1.3
@@ -6,13 +6,13 @@
 import org.lcsim.contrib.onoprien.crux.infrastructure.*;
 
 /**
- * Class to represent a node in a {@link Rosary} - something that is attached to
- * the {@link Rosary} in a particular layer.
+ * Abstract class that represents a node in a {@link Rosary} - something that can be 
+ * attached to a {@link Rosary} in a particular layer.
  *
  * @author D. Onoprienko
- * @version $Id: RosaryNode.java,v 1.2 2008/06/27 02:55:20 onoprien Exp $
+ * @version $Id: RosaryNode.java,v 1.3 2008/11/04 02:17:59 onoprien Exp $
  */
-public class RosaryNode {
+abstract public class RosaryNode {
   
   /** Types of nodes. */
   public enum Type {CRACK, DOT, BEAD, TRACK}
@@ -23,23 +23,17 @@
     _rosaries = new ArrayList<Rosary>(1);
   }
   
-  public RosaryNode(Type type) {
-    _type = type;
-    _rosaries = new ArrayList<Rosary>(1);
-  }
-  
-  public RosaryNode(Type type, CruxCalLayer layer) {
-    _type = type;
+  public RosaryNode(CruxCalLayer layer) {
     _layer = layer;
     _rosaries = new ArrayList<Rosary>(1);
   }
   
 // -- Getters :  ---------------------------------------------------------------
   
-  public Type getType() {
-    return _type;
-  }
+  /** Returns the type of this node.*/
+  abstract public Type getType();
   
+  /** Returns the layer this node belongs to.*/
   public CruxCalLayer getLayer() {
     return _layer;
   }
@@ -52,14 +46,11 @@
     return _rosaries;
   }
   
-  /**
-   * Returns <tt>true</tt> if this node is attached to at least one <tt>Rosary</tt>.
-   */
+  /** Returns <tt>true</tt> if this node is attached to at least one <tt>Rosary</tt>. */
   public boolean isAttached() {return ! _rosaries.isEmpty();}
   
 // -- Private parts :  ---------------------------------------------------------
   
-  protected Type _type;
   protected CruxCalLayer _layer;
   protected ArrayList<Rosary> _rosaries;
 }

lcsim/src/org/lcsim/contrib/onoprien/crux/algorithms/rosary
RosaryNodeCluster.java 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- RosaryNodeCluster.java	27 Jun 2008 02:55:20 -0000	1.2
+++ RosaryNodeCluster.java	4 Nov 2008 02:17:59 -0000	1.3
@@ -2,21 +2,22 @@
 
 import java.util.*;
 
-import hep.physics.vec.BasicHep3Vector;
 import hep.physics.vec.Hep3Vector;
 import org.lcsim.contrib.onoprien.crux.infrastructure.CruxCalLayer;
 import org.lcsim.event.CalorimeterHit;
 import org.lcsim.event.Cluster;
 
+import org.lcsim.contrib.onoprien.vsegment.transform.ConstHep3Vector;
+
 import org.lcsim.contrib.onoprien.crux.infrastructure.*;
 
 /**
  * Class that represents a rosary node that contains calorimeter hits - either {@link Dot} or {@link Bead}.
  *
  * @author D. Onoprienko
- * @version $Id: RosaryNodeCluster.java,v 1.2 2008/06/27 02:55:20 onoprien Exp $
+ * @version $Id: RosaryNodeCluster.java,v 1.3 2008/11/04 02:17:59 onoprien Exp $
  */
-public class RosaryNodeCluster extends RosaryNode {
+abstract public class RosaryNodeCluster extends RosaryNode {
   
 // -- Constructors :  ----------------------------------------------------------
   
@@ -24,26 +25,22 @@
     super();
   }
   
-  public RosaryNodeCluster(Type type) {
-    super(type);
-  }
-  
-  public RosaryNodeCluster(Type type, CruxCalLayer layer) {
-    super(type, layer);
+  public RosaryNodeCluster(CruxCalLayer layer) {
+    super(layer);
   }
   
-  public RosaryNodeCluster(Type type, CruxCalLayer layer, CalorimeterHit hit) {
-    super(type, layer);
+  public RosaryNodeCluster(CruxCalLayer layer, CalorimeterHit hit) {
+    super(layer);
     _hits.add(hit);
   }
   
-  public RosaryNodeCluster(Type type, CruxCalLayer layer, Collection<CalorimeterHit> hits) {
-    super(type, layer);
+  public RosaryNodeCluster(CruxCalLayer layer, Collection<CalorimeterHit> hits) {
+    super(layer);
     _hits.addAll(hits);
   }
   
-  public RosaryNodeCluster(Type type, CruxCalLayer layer, Cluster cluster) {
-    this(type, layer, cluster.getCalorimeterHits());
+  public RosaryNodeCluster(CruxCalLayer layer, Cluster cluster) {
+    this(layer, cluster.getCalorimeterHits());
   }
   
 // -- Getters :  ---------------------------------------------------------------
@@ -69,12 +66,12 @@
       for (int i=0; i<3; i++) pos[i] += hitPos[i]*s;
     }
     for (int i=0; i<3; i++) pos[i] /= signal;
-    _pos = new BasicHep3Vector(pos);
+    _pos = new ConstHep3Vector(pos);
   }
   
 // -- Private parts :  ---------------------------------------------------------
 
   ArrayList<CalorimeterHit> _hits = new ArrayList<CalorimeterHit>(1);
-  BasicHep3Vector _pos;
+  ConstHep3Vector _pos;
   
 }

lcsim/src/org/lcsim/contrib/onoprien/crux/algorithms/rosary
Track.java 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- Track.java	22 Apr 2008 18:27:54 -0000	1.1
+++ Track.java	4 Nov 2008 02:17:59 -0000	1.2
@@ -3,27 +3,30 @@
 import org.lcsim.contrib.onoprien.crux.infrastructure.*;
 
 /**
- *
+ * Wrapper for a track that can be attached to a {@link Rosary}.
  *
  * @author D. Onoprienko
- * @version $Id: Track.java,v 1.1 2008/04/22 18:27:54 onoprien Exp $
+ * @version $Id: Track.java,v 1.2 2008/11/04 02:17:59 onoprien Exp $
  */
 public class Track extends RosaryNode {
   
 // -- Constructors :  ----------------------------------------------------------
   
   public Track() {
-    super(RosaryNode.Type.TRACK);
   }
   
   public Track(CruxTrack track) {
-    super(RosaryNode.Type.TRACK);
     _track = track;
   }
 
   
 // -- Getters :  ---------------------------------------------------------------
   
+  /** Returns the type of this node.*/
+  public Type getType() {
+    return RosaryNode.Type.TRACK;
+  }
+  
   public CruxTrack getTrack() {
     return _track;
   }

lcsim/src/org/lcsim/contrib/onoprien/crux/auxdrivers
RemoveObjectDriver.java 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- RemoveObjectDriver.java	2 Apr 2008 22:30:10 -0000	1.1
+++ RemoveObjectDriver.java	4 Nov 2008 02:17:59 -0000	1.2
@@ -7,10 +7,10 @@
 import org.lcsim.contrib.onoprien.crux.infrastructure.CruxDriver;
 
 /**
- * Driver that removes objects from the event record.
+ * Driver that removes specified objects from the event record.
  *
  * @author D. Onoprienko
- * @version $Id: RemoveObjectDriver.java,v 1.1 2008/04/02 22:30:10 onoprien Exp $
+ * @version $Id: RemoveObjectDriver.java,v 1.2 2008/11/04 02:17:59 onoprien Exp $
  */
 public class RemoveObjectDriver extends CruxDriver {
   

lcsim/src/org/lcsim/contrib/onoprien/crux/diagnostics
ClusteringTest.java 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- ClusteringTest.java	27 Jun 2008 02:55:20 -0000	1.3
+++ ClusteringTest.java	4 Nov 2008 02:17:59 -0000	1.4
@@ -13,13 +13,13 @@
 import org.lcsim.util.aida.AIDA;
 
 import org.lcsim.contrib.onoprien.crux.infrastructure.*;
-import org.lcsim.contrib.onoprien.crux.mctruth.CruxMCTruth;
+import org.lcsim.contrib.onoprien.crux.mctruth.MCTruthCrux;
 
 /**
  *
  *
  * @author D. Onoprienko
- * @version $Id: ClusteringTest.java,v 1.3 2008/06/27 02:55:20 onoprien Exp $
+ * @version $Id: ClusteringTest.java,v 1.4 2008/11/04 02:17:59 onoprien Exp $
  */
 public class ClusteringTest extends CruxDriver implements CruxEventListener {
   
@@ -164,7 +164,7 @@
     // Cluster purity:
     
     for (CruxCluster cluster : _inClusterList) {
-      List<MCParticle> mcList = CruxMCTruth.getMCParticles(cluster);
+      List<MCParticle> mcList = MCTruthCrux.getMCParticles(cluster);
       CruxCalModule module = cluster.getModule();
       String name = (module == null) ? "Multiple modules" : module.getName();
       _aida.cloud1D("MCParticles per cluster").fill(mcList.size());
@@ -173,7 +173,7 @@
     
     // Cluster multiplicity:
     
-    Map<MCParticle, ArrayList<CruxCluster>> mcToClusterMap = CruxMCTruth.getMCParticleToClusterMap(_inClusterList);
+    Map<MCParticle, ArrayList<CruxCluster>> mcToClusterMap = MCTruthCrux.getMCParticleToClusterMap(_inClusterList);
     for (Map.Entry<MCParticle, ArrayList<CruxCluster>> entry : mcToClusterMap.entrySet()) {
       _aida.cloud1D("Clusters per MCParticle").fill(entry.getValue().size());
       _aida.cloud1D("Clusters per MCParticle: "+entry.getKey().getType().getName()).fill(entry.getValue().size());

lcsim/src/org/lcsim/contrib/onoprien/crux/diagnostics
TrackingTest.java 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- TrackingTest.java	22 Apr 2008 18:27:54 -0000	1.2
+++ TrackingTest.java	4 Nov 2008 02:17:59 -0000	1.3
@@ -8,15 +8,15 @@
 import org.lcsim.contrib.onoprien.crux.infrastructure.CruxDriver;
 import org.lcsim.contrib.onoprien.crux.infrastructure.CruxTrack;
 import org.lcsim.contrib.onoprien.crux.infrastructure.CruxTrackVertex;
-import org.lcsim.contrib.onoprien.crux.mctruth.CruxMCTruth;
-import org.lcsim.contrib.onoprien.crux.mctruth.MCTruthDriver;
+import org.lcsim.contrib.onoprien.crux.mctruth.MCTruthCrux;
+import org.lcsim.contrib.onoprien.crux.mctruth.MCTruthDriverCrux;
 
 /**
  * Driver that runs tests on the collection of reconstructed tracks after 
  * fetching it from the event record.
  *
  * @author D. Onoprienko
- * @version $Id: TrackingTest.java,v 1.2 2008/04/22 18:27:54 onoprien Exp $
+ * @version $Id: TrackingTest.java,v 1.3 2008/11/04 02:17:59 onoprien Exp $
  */
 public class TrackingTest extends CruxDriver {
   
@@ -63,7 +63,7 @@
     super.process(event);
     
     _event = event;
-    _mcTruth = (CruxMCTruth) event.get("CruxMCTruth");
+    _mcTruth = (MCTruthCrux) event.get("CruxMCTruth");
     
     printTree();
     
@@ -117,7 +117,7 @@
 // -- Private parts :  ---------------------------------------------------------
   
   private EventHeader _event;
-  private CruxMCTruth _mcTruth;
+  private MCTruthCrux _mcTruth;
   
   String _trackListName;
 }

lcsim/src/org/lcsim/contrib/onoprien/crux/tests
TestDriver.java 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- TestDriver.java	2 Apr 2008 22:30:11 -0000	1.1
+++ TestDriver.java	4 Nov 2008 02:17:59 -0000	1.2
@@ -14,7 +14,7 @@
 import org.lcsim.contrib.onoprien.crux.infrastructure.CruxDriver;
 import org.lcsim.contrib.onoprien.crux.infrastructure.CruxManager;
 import org.lcsim.contrib.onoprien.crux.infrastructure.CruxParticleList;
-import org.lcsim.contrib.onoprien.crux.mctruth.MCTruthDriver;
+import org.lcsim.contrib.onoprien.crux.mctruth.MCTruthDriverCrux;
 import org.lcsim.contrib.onoprien.crux.tracking.CheatTrackFinderDriver;
 import org.lcsim.contrib.onoprien.crux.tracking.CheatVertexFinderDriver;
 
@@ -22,7 +22,7 @@
  * Main driver for testing PFA code.
  *
  * @author D. Onoprienko
- * @version $Id: TestDriver.java,v 1.1 2008/04/02 22:30:11 onoprien Exp $
+ * @version $Id: TestDriver.java,v 1.2 2008/11/04 02:17:59 onoprien Exp $
  */
 public class TestDriver extends CruxDriver {
   
@@ -35,7 +35,7 @@
     // The effect is: CruxMCTruth object is created and put into the event as "CruxMCTruth".
     // Required by various cheaters and analysis classes.
 
-    add(new MCTruthDriver());
+    add(new MCTruthDriverCrux());
     
 // -- Digitization of hits in calorimeter :  -----------------------------------
 

lcsim/src/org/lcsim/contrib/onoprien/crux/tests
TestDriverClustering.java 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- TestDriverClustering.java	4 Apr 2008 18:29:02 -0000	1.2
+++ TestDriverClustering.java	4 Nov 2008 02:17:59 -0000	1.3
@@ -15,13 +15,13 @@
 import org.lcsim.contrib.onoprien.crux.auxdrivers.HitMapFilterDriver;
 import org.lcsim.contrib.onoprien.crux.diagnostics.ClusteringTest;
 import org.lcsim.contrib.onoprien.crux.infrastructure.*;
-import org.lcsim.contrib.onoprien.crux.mctruth.MCTruthDriver;
+import org.lcsim.contrib.onoprien.crux.mctruth.MCTruthDriverCrux;
 
 /**
  *
  *
  * @author D. Onoprienko
- * @version $Id: TestDriverClustering.java,v 1.2 2008/04/04 18:29:02 onoprien Exp $
+ * @version $Id: TestDriverClustering.java,v 1.3 2008/11/04 02:17:59 onoprien Exp $
  */
 public class TestDriverClustering extends CruxDriver {
   
@@ -32,7 +32,7 @@
     set("LOG_LEVEL", Level.FINEST);
     set("LOG_DEFAULT_LEVEL", Level.FINEST);
 
-    add(new MCTruthDriver());
+    add(new MCTruthDriverCrux());
     
     add(CruxManager.getCruxManager());
     

lcsim/src/org/lcsim/contrib/onoprien/crux/tests
TestDriverMCTruth.java 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- TestDriverMCTruth.java	2 Apr 2008 22:30:11 -0000	1.1
+++ TestDriverMCTruth.java	4 Nov 2008 02:17:59 -0000	1.2
@@ -8,14 +8,14 @@
 import org.lcsim.event.SimTrackerHit;
 
 import org.lcsim.contrib.onoprien.crux.infrastructure.CruxDriver;
-import org.lcsim.contrib.onoprien.crux.mctruth.CruxMCTruth;
-import org.lcsim.contrib.onoprien.crux.mctruth.MCTruthDriver;
+import org.lcsim.contrib.onoprien.crux.mctruth.MCTruthCrux;
+import org.lcsim.contrib.onoprien.crux.mctruth.MCTruthDriverCrux;
 
 /**
  *
  *
  * @author D. Onoprienko
- * @version $Id: TestDriverMCTruth.java,v 1.1 2008/04/02 22:30:11 onoprien Exp $
+ * @version $Id: TestDriverMCTruth.java,v 1.2 2008/11/04 02:17:59 onoprien Exp $
  */
 public class TestDriverMCTruth extends CruxDriver {
   
@@ -25,7 +25,7 @@
     
     set("LOG_DEFAULT_LEVEL", INFO);
     
-    add(new MCTruthDriver());
+    add(new MCTruthDriverCrux());
     
   }
   
@@ -36,7 +36,7 @@
     super.process(event);
     
     _event = event;
-    _mcTruth = (CruxMCTruth) event.get("CruxMCTruth");
+    _mcTruth = (MCTruthCrux) event.get(MCTruthCrux.KEY);
     
     testMCParticleToSimHitMap();
     
@@ -68,6 +68,6 @@
 // -- Private parts :  ---------------------------------------------------------
   
   private EventHeader _event;
-  private CruxMCTruth _mcTruth;
+  private MCTruthCrux _mcTruth;
   
 }

lcsim/src/org/lcsim/contrib/onoprien/crux/tests
TestDriverRosary.java 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- TestDriverRosary.java	27 Jun 2008 02:55:20 -0000	1.2
+++ TestDriverRosary.java	4 Nov 2008 02:17:59 -0000	1.3
@@ -20,7 +20,7 @@
 import org.lcsim.contrib.onoprien.crux.algorithms.rosary.RosaryClusterer;
 import org.lcsim.contrib.onoprien.crux.auxdrivers.HitMapFilterDriver;
 import org.lcsim.contrib.onoprien.crux.infrastructure.*;
-import org.lcsim.contrib.onoprien.crux.mctruth.MCTruthDriver;
+import org.lcsim.contrib.onoprien.crux.mctruth.MCTruthDriverCrux;
 import org.lcsim.contrib.onoprien.crux.tracking.CheatTrackFinderDriver;
 import org.lcsim.contrib.onoprien.crux.tracking.CheatVertexFinderDriver;
 
@@ -28,7 +28,7 @@
  *
  *
  * @author D. Onoprienko
- * @version $Id: TestDriverRosary.java,v 1.2 2008/06/27 02:55:20 onoprien Exp $
+ * @version $Id: TestDriverRosary.java,v 1.3 2008/11/04 02:17:59 onoprien Exp $
  */
 public class TestDriverRosary extends CruxDriver {
   
@@ -38,7 +38,7 @@
     
     set("LOG_LEVEL", Level.FINEST);
 
-    add(new MCTruthDriver());
+    add(new MCTruthDriverCrux());
     add(CruxManager.getCruxManager());
     
     // -- Digitization of hits in calorimeter :  -------------------------------

lcsim/src/org/lcsim/contrib/onoprien/crux/tracking
CheatTrackFinderDriver.java 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- CheatTrackFinderDriver.java	22 Apr 2008 18:27:54 -0000	1.2
+++ CheatTrackFinderDriver.java	4 Nov 2008 02:17:59 -0000	1.3
@@ -8,7 +8,7 @@
 
 import org.lcsim.contrib.onoprien.crux.infrastructure.CruxDriver;
 import org.lcsim.contrib.onoprien.crux.infrastructure.CruxTrack;
-import org.lcsim.contrib.onoprien.crux.mctruth.CruxMCTruth;
+import org.lcsim.contrib.onoprien.crux.mctruth.MCTruthCrux;
 import org.lcsim.contrib.onoprien.crux.util.NoSuchParameterException;
 
 /**
@@ -22,7 +22,7 @@
  * creation of the {@link CruxTrack} object for the given {@link MCParticle}.
  *
  * @author D. Onoprienko
- * @version $Id: CheatTrackFinderDriver.java,v 1.2 2008/04/22 18:27:54 onoprien Exp $
+ * @version $Id: CheatTrackFinderDriver.java,v 1.3 2008/11/04 02:17:59 onoprien Exp $
  */
 public class CheatTrackFinderDriver extends CruxDriver {
   
@@ -75,7 +75,7 @@
     
     super.process(event);
     
-    _mcTruth = (CruxMCTruth) event.get("CruxMCTruth");
+    _mcTruth = (MCTruthCrux) event.get("CruxMCTruth");
     List<MCParticle> mcList = event.getMCParticles();
     
     ArrayList<CruxTrack> trackList = new ArrayList<CruxTrack>(mcList.size());
@@ -141,7 +141,7 @@
   
   protected String _trackListName;
   
-  protected CruxMCTruth _mcTruth;
+  protected MCTruthCrux _mcTruth;
   
   protected int _cutMinLayers = 3;
   protected double _cutPt2 = 0.;

lcsim/src/org/lcsim/contrib/onoprien/crux/tracking
CheatVertexFinderDriver.java 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- CheatVertexFinderDriver.java	22 Apr 2008 18:27:54 -0000	1.2
+++ CheatVertexFinderDriver.java	4 Nov 2008 02:17:59 -0000	1.3
@@ -11,7 +11,7 @@
 import org.lcsim.contrib.onoprien.crux.infrastructure.CruxDriver;
 import org.lcsim.contrib.onoprien.crux.infrastructure.CruxTrack;
 import org.lcsim.contrib.onoprien.crux.infrastructure.CruxTrackVertex;
-import org.lcsim.contrib.onoprien.crux.mctruth.CruxMCTruth;
+import org.lcsim.contrib.onoprien.crux.mctruth.MCTruthCrux;
 import org.lcsim.contrib.onoprien.crux.util.NoSuchParameterException;
 
 /**
@@ -22,7 +22,7 @@
  * or flies by it.
  *
  * @author D. Onoprienko
- * @version $Id: CheatVertexFinderDriver.java,v 1.2 2008/04/22 18:27:54 onoprien Exp $
+ * @version $Id: CheatVertexFinderDriver.java,v 1.3 2008/11/04 02:17:59 onoprien Exp $
  */
 public class CheatVertexFinderDriver extends CruxDriver {
   
@@ -77,7 +77,7 @@
     
     super.process(event);
     
-    _mcTruth = (CruxMCTruth) event.get("CruxMCTruth");
+    _mcTruth = (MCTruthCrux) event.get("CruxMCTruth");
     List<MCParticle> mcList = event.getMCParticles();
     List<CruxTrack> trackList = event.get(CruxTrack.class, _trackListName);
 
@@ -188,5 +188,5 @@
   protected String _vertexListName;
   protected double _mergeDist2 = (1.*SystemOfUnits.micrometer) * (1.*SystemOfUnits.micrometer);
   
-  protected CruxMCTruth _mcTruth;
+  protected MCTruthCrux _mcTruth;
 }

lcsim/src/org/lcsim/contrib/onoprien/crux/mctruth
MCTruthCrux.java added at 1.1
diff -N MCTruthCrux.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ MCTruthCrux.java	4 Nov 2008 02:17:59 -0000	1.1
@@ -0,0 +1,129 @@
+package org.lcsim.contrib.onoprien.crux.mctruth;
+
+import java.util.*;
+
+import org.lcsim.event.CalorimeterHit;
+import org.lcsim.event.EventHeader;
+import org.lcsim.event.MCParticle;
+import org.lcsim.event.SimCalorimeterHit;
+import org.lcsim.event.SimTrackerHit;
+
+import org.lcsim.contrib.onoprien.crux.infrastructure.*;
+
+/**
+ * 
+ * 
+ * 
+ * @author D. Onoprienko
+ * @version $Id: MCTruthCrux.java,v 1.1 2008/11/04 02:17:59 onoprien Exp $
+ */
+public class MCTruthCrux {
+  
+  /** Name under which this object is saved in the event record: "MCTruthCrux". */
+  static public final String KEY = "MCTruthCrux";
+  
+// -- Constructors :  ----------------------------------------------------------
+  
+  public MCTruthCrux(EventHeader event) {
+    _event = event;
+  }
+  
+// -- Getters :  ---------------------------------------------------------------
+  
+  /** 
+   * Returns time-ordered list of <tt>SimTrackerHits</tt> produced by the given <tt>MCParticle</tt>.
+   */
+  public List<SimTrackerHit> getSimTrackerHits(MCParticle mcParticle) {
+    if (_mcToSimHitsMap == null) {
+      _mcToSimHitsMap = new HashMap<MCParticle, ArrayList<SimTrackerHit>>();
+      List<List<SimTrackerHit>> all = _event.get(SimTrackerHit.class);
+      for (List<SimTrackerHit> hitList : all) {
+        for (SimTrackerHit hit : hitList) {
+          MCParticle mc = hit.getMCParticle();
+          ArrayList<SimTrackerHit> mcHits = _mcToSimHitsMap.get(mc);
+          if (mcHits == null) {
+            mcHits = new ArrayList<SimTrackerHit>();
+            _mcToSimHitsMap.put(mc, mcHits);
+          }
+          mcHits.add(hit);
+        }
+      }
+      for (ArrayList<SimTrackerHit> hitList : _mcToSimHitsMap.values()) {
+        Collections.sort(hitList, new Comparator<SimTrackerHit>() {
+          public int compare(SimTrackerHit hit1, SimTrackerHit hit2) {
+            return (int) Math.signum(hit1.getTime()-hit2.getTime());
+          }
+        });
+        hitList.trimToSize();
+      }
+    }
+    List<SimTrackerHit> out = _mcToSimHitsMap.get(mcParticle);
+    if (out == null) out = Collections.emptyList();
+    return out;
+  }
+  
+  /** Returns time-ordered list of digitized ECAL hits to which the given <tt>MCParticle</tt> has contributed. */
+  public List<SimCalorimeterHit> getDigitizedEcalHits(MCParticle mcParticle) {
+    throw new UnsupportedOperationException("FIXME: NOT IMPLEMENTED");
+  }
+  
+  /** Returns time-ordered list of digitized ECAL hits to which the given <tt>MCParticle</tt> has contributed. */
+  public List<SimCalorimeterHit> getDigitizedHcalHits(MCParticle mcParticle) {
+    throw new UnsupportedOperationException("FIXME: NOT IMPLEMENTED");
+  }
+  
+  /** Returns a track associated with the given <tt>MCParticle</tt>. */
+  public CruxTrack getTrack(MCParticle mcParticle) {
+    return (_mcToTrackMap == null) ? null : _mcToTrackMap.get(mcParticle);
+  }
+  
+// -- Modifiers :  -------------------------------------------------------------
+  
+  /** Builds a mapping of <tt>MCParticles</tt> to <tt>CruxTracks</tt>. */
+  public void addTracks(List<CruxTrack> trackList) {
+    _mcToTrackMap = new HashMap<MCParticle,CruxTrack>(((int)(trackList.size()/0.75f))+1, 0.75f);
+    for (CruxTrack track : trackList) {
+      MCParticle mc = track.getMCParticle();
+      if (mc != null) _mcToTrackMap.put(mc, track);
+    }
+  }
+  
+// -- Static utility methods :  ------------------------------------------------
+  
+  static public List<MCParticle> getMCParticles(CruxCluster cluster) {
+    HashSet<MCParticle> mcSet = new HashSet<MCParticle>();
+    List<CalorimeterHit> hitList = cluster.getCalorimeterHits();
+    for (CalorimeterHit cHit : hitList) {
+      SimCalorimeterHit hit = (SimCalorimeterHit) cHit;
+      int nPart = hit.getMCParticleCount();
+      for (int i=0; i<nPart; i++) {
+        mcSet.add(hit.getMCParticle(i));
+      }
+    }
+    return new ArrayList<MCParticle>(mcSet);
+  }
+  
+  static public HashMap<MCParticle, ArrayList<CruxCluster>> getMCParticleToClusterMap(Collection<CruxCluster> clusterList) {
+    HashMap<MCParticle, ArrayList<CruxCluster>> map = new HashMap<MCParticle, ArrayList<CruxCluster>>();
+    for (CruxCluster cluster : clusterList) {
+      for (MCParticle mc : getMCParticles(cluster)) {
+        ArrayList<CruxCluster> clusters = map.get(mc);
+        if (clusters == null) {
+          clusters = new ArrayList<CruxCluster>();
+          map.put(mc, clusters);
+        }
+        clusters.add(cluster);
+      }
+    }
+    for (ArrayList<CruxCluster> cList : map.values()) cList.trimToSize();
+    return map;
+  }
+  
+// -- Private parts :  ---------------------------------------------------------
+  
+  private EventHeader _event;
+  
+  private HashMap<MCParticle, ArrayList<SimTrackerHit>> _mcToSimHitsMap;
+  private HashMap<MCParticle,CruxTrack> _mcToTrackMap;
+  
+}

lcsim/src/org/lcsim/contrib/onoprien/crux/mctruth
MCTruthDriverCrux.java added at 1.1
diff -N MCTruthDriverCrux.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ MCTruthDriverCrux.java	4 Nov 2008 02:17:59 -0000	1.1
@@ -0,0 +1,31 @@
+package org.lcsim.contrib.onoprien.crux.mctruth;
+
+import org.lcsim.event.EventHeader;
+import org.lcsim.util.Driver;
+
+/**
+ * Driver that compiles a list of MCParticles linked to hits, vertexes, and jets.
+ * 
+ * 
+ * @author D. Onoprienko
+ * @version $Id: MCTruthDriverCrux.java,v 1.1 2008/11/04 02:17:59 onoprien Exp $
+ */
+public class MCTruthDriverCrux extends Driver {
+  
+// -- Constructors :  ----------------------------------------------------------
+  
+  public MCTruthDriverCrux() {
+  }
+  
+// -- Processing event :  ------------------------------------------------------
+  
+  public void process(EventHeader event) {
+    
+    MCTruthCrux mcTruth = new MCTruthCrux(event);
+    
+    event.put(MCTruthCrux.KEY, mcTruth);
+  }
+  
+// -- Private parts :  ---------------------------------------------------------
+  
+}

lcsim/src/org/lcsim/contrib/onoprien/crux/mctruth
package-info.java added at 1.1
diff -N package-info.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ package-info.java	4 Nov 2008 02:17:59 -0000	1.1
@@ -0,0 +1,4 @@
+/**
+ * Classes providing access to Monte Carlo truth information within Crux PFA.
+ */
+package org.lcsim.contrib.onoprien.crux.mctruth;

lcsim/src/org/lcsim/contrib/onoprien/crux/mctruth
CruxMCTruth.java removed after 1.1
diff -N CruxMCTruth.java
--- CruxMCTruth.java	2 Apr 2008 22:30:11 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,125 +0,0 @@
-package org.lcsim.contrib.onoprien.crux.mctruth;
-
-import java.util.*;
-
-import org.lcsim.event.CalorimeterHit;
-import org.lcsim.event.EventHeader;
-import org.lcsim.event.MCParticle;
-import org.lcsim.event.SimCalorimeterHit;
-import org.lcsim.event.SimTrackerHit;
-
-import org.lcsim.contrib.onoprien.crux.infrastructure.*;
-
-/**
- *
- *
- * @author D. Onoprienko
- * @version $Id: CruxMCTruth.java,v 1.1 2008/04/02 22:30:11 onoprien Exp $
- */
-public class CruxMCTruth {
-  
-// -- Constructors :  ----------------------------------------------------------
-  
-  public CruxMCTruth(EventHeader event) {
-    _event = event;
-  }
-  
-// -- Getters :  ---------------------------------------------------------------
-  
-  /** 
-   * Returns time-ordered list of <tt>SimTrackerHits</tt> produced by the given <tt>MCParticle</tt>.
-   */
-  public List<SimTrackerHit> getSimTrackerHits(MCParticle mcParticle) {
-    if (_mcToSimHitsMap == null) {
-      _mcToSimHitsMap = new HashMap<MCParticle, ArrayList<SimTrackerHit>>();
-      List<List<SimTrackerHit>> all = _event.get(SimTrackerHit.class);
-      for (List<SimTrackerHit> hitList : all) {
-        for (SimTrackerHit hit : hitList) {
-          MCParticle mc = hit.getMCParticle();
-          ArrayList<SimTrackerHit> mcHits = _mcToSimHitsMap.get(mc);
-          if (mcHits == null) {
-            mcHits = new ArrayList<SimTrackerHit>();
-            _mcToSimHitsMap.put(mc, mcHits);
-          }
-          mcHits.add(hit);
-        }
-      }
-      for (ArrayList<SimTrackerHit> hitList : _mcToSimHitsMap.values()) {
-        Collections.sort(hitList, new Comparator<SimTrackerHit>() {
-          public int compare(SimTrackerHit hit1, SimTrackerHit hit2) {
-            return (int) Math.signum(hit1.getTime()-hit2.getTime());
-          }
-        });
-        hitList.trimToSize();
-      }
-    }
-    List<SimTrackerHit> out = _mcToSimHitsMap.get(mcParticle);
-    if (out == null) out = Collections.emptyList();
-    return out;
-  }
-  
-  /** Returns time-ordered list of digitized ECAL hits to which the given <tt>MCParticle</tt> has contributed. */
-  public List<SimCalorimeterHit> getDigitizedEcalHits(MCParticle mcParticle) {
-    throw new UnsupportedOperationException("FIXME: NOT IMPLEMENTED");
-  }
-  
-  /** Returns time-ordered list of digitized ECAL hits to which the given <tt>MCParticle</tt> has contributed. */
-  public List<SimCalorimeterHit> getDigitizedHcalHits(MCParticle mcParticle) {
-    throw new UnsupportedOperationException("FIXME: NOT IMPLEMENTED");
-  }
-  
-  /** Returns a track associated with the given <tt>MCParticle</tt>. */
-  public CruxTrack getTrack(MCParticle mcParticle) {
-    return (_mcToTrackMap == null) ? null : _mcToTrackMap.get(mcParticle);
-  }
-  
-// -- Modifiers :  -------------------------------------------------------------
-  
-  /** Builds a mapping of <tt>MCParticles</tt> to <tt>CruxTracks</tt>. */
-  public void addTracks(List<CruxTrack> trackList) {
-    _mcToTrackMap = new HashMap<MCParticle,CruxTrack>(((int)(trackList.size()/0.75f))+1, 0.75f);
-    for (CruxTrack track : trackList) {
-      MCParticle mc = track.getMCParticle();
-      if (mc != null) _mcToTrackMap.put(mc, track);
-    }
-  }
-  
-// -- Static utility methods :  ------------------------------------------------
-  
-  static public List<MCParticle> getMCParticles(CruxCluster cluster) {
-    HashSet<MCParticle> mcSet = new HashSet<MCParticle>();
-    List<CalorimeterHit> hitList = cluster.getCalorimeterHits();
-    for (CalorimeterHit cHit : hitList) {
-      SimCalorimeterHit hit = (SimCalorimeterHit) cHit;
-      int nPart = hit.getMCParticleCount();
-      for (int i=0; i<nPart; i++) {
-        mcSet.add(hit.getMCParticle(i));
-      }
-    }
-    return new ArrayList<MCParticle>(mcSet);
-  }
-  
-  static public HashMap<MCParticle, ArrayList<CruxCluster>> getMCParticleToClusterMap(Collection<CruxCluster> clusterList) {
-    HashMap<MCParticle, ArrayList<CruxCluster>> map = new HashMap<MCParticle, ArrayList<CruxCluster>>();
-    for (CruxCluster cluster : clusterList) {
-      for (MCParticle mc : getMCParticles(cluster)) {
-        ArrayList<CruxCluster> clusters = map.get(mc);
-        if (clusters == null) {
-          clusters = new ArrayList<CruxCluster>();
-          map.put(mc, clusters);
-        }
-        clusters.add(cluster);
-      }
-    }
-    for (ArrayList<CruxCluster> cList : map.values()) cList.trimToSize();
-    return map;
-  }
-  
-// -- Private parts :  ---------------------------------------------------------
-  
-  private EventHeader _event;
-  
-  private HashMap<MCParticle, ArrayList<SimTrackerHit>> _mcToSimHitsMap;
-  private HashMap<MCParticle,CruxTrack> _mcToTrackMap;
-  
-}

lcsim/src/org/lcsim/contrib/onoprien/crux/mctruth
MCTruthDriver.java removed after 1.1
diff -N MCTruthDriver.java
--- MCTruthDriver.java	2 Apr 2008 22:30:11 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,30 +0,0 @@
-package org.lcsim.contrib.onoprien.crux.mctruth;
-
-import org.lcsim.event.EventHeader;
-import org.lcsim.util.Driver;
-
-/**
- * Driver that compiles a list of MCParticles linked to hits, vertexes, and jets.
- *
- * @author D. Onoprienko
- * @version $Id: MCTruthDriver.java,v 1.1 2008/04/02 22:30:11 onoprien Exp $
- */
-public class MCTruthDriver extends Driver {
-  
-// -- Constructors :  ----------------------------------------------------------
-  
-  public MCTruthDriver() {
-  }
-  
-// -- Processing event :  ------------------------------------------------------
-  
-  public void process(EventHeader event) {
-    
-    CruxMCTruth mcTruth = new CruxMCTruth(event);
-    
-    event.put("CruxMCTruth", mcTruth);
-  }
-  
-// -- Private parts :  ---------------------------------------------------------
-  
-}
CVSspam 0.2.8