Print

Print


Commit in lcsim/src/org/lcsim/event/base on MAIN
BaseMCParticle.java+15-21.4 -> 1.5
Added a setCharge method for particles that have unknown ParticleType

lcsim/src/org/lcsim/event/base
BaseMCParticle.java 1.4 -> 1.5
diff -u -r1.4 -r1.5
--- BaseMCParticle.java	29 Apr 2011 16:22:33 -0000	1.4
+++ BaseMCParticle.java	30 Apr 2011 04:43:50 -0000	1.5
@@ -3,7 +3,7 @@
  *
  * Created on March 30, 2006, 8:58 AM
  *
- * $Id: BaseMCParticle.java,v 1.4 2011/04/29 16:22:33 grefe Exp $
+ * $Id: BaseMCParticle.java,v 1.5 2011/04/30 04:43:50 grefe Exp $
  */
 
 package org.lcsim.event.base;
@@ -24,8 +24,8 @@
 {
    
     protected Hep3Vector _endPoint = new BasicHep3Vector(0., 0., 0.);
-    
     protected SimulatorStatus _status;
+    protected double charge; 
     
     /**
      * Creates a new instance of BaseMCParticle
@@ -41,6 +41,19 @@
     }
     
     /**
+     * Overrides the charge from the particle type.
+     */
+    // FIXME Should be offered by BasicParticle instead.
+    public void setCharge(double charge) {
+		this.charge = charge;
+	}
+    
+    @Override
+    public double getCharge() {
+    	return Double.isNaN(charge) ? super.getCharge() : charge;
+    }
+    
+    /**
      * If this point has interacted, set its end point.
      * @param p The (x,y,z) end point in mm.
      */
CVSspam 0.2.8