lcsim/src/org/lcsim/event/base
diff -u -r1.11 -r1.12
--- BaseReconstructedParticle.java 18 Sep 2007 03:48:01 -0000 1.11
+++ BaseReconstructedParticle.java 14 Apr 2011 05:02:26 -0000 1.12
@@ -17,7 +17,7 @@
/**
* Default implementation of ReconstructedParticle
* @author Norman Graf
- * @version $Id: BaseReconstructedParticle.java,v 1.11 2007/09/18 03:48:01 tonyj Exp $
+ * @version $Id: BaseReconstructedParticle.java,v 1.12 2011/04/14 05:02:26 grefe Exp $
* Change setParticleIdUsed to check that ParticleID is in the ParticleID list,
* and if not add it.
* Ron Cassell
@@ -288,7 +288,13 @@
String className = getClass().getName();
int lastDot = className.lastIndexOf('.');
if(lastDot!=-1)className = className.substring(lastDot+1);
- StringBuffer sb = new StringBuffer(className+": Type: "+_type+" pdgID: "+_particleIdUsed.getPDG()+" \n");
+ String pidUsed = "";
+ try {
+ pidUsed = String.valueOf(_particleIdUsed.getPDG());
+ } catch (NullPointerException e) {
+ pidUsed = "no particle ID defined";
+ }
+ StringBuffer sb = new StringBuffer(className+": Type: "+_type+" pdgID: "+pidUsed+" \n");
sb.append("E: "+getEnergy());
return sb.toString();
}