lcsim/src/org/lcsim/contrib/uiowa/structural/likelihood
diff -u -r1.6 -r1.7
--- MiscUtilities.java 3 Jan 2006 19:34:49 -0000 1.6
+++ MiscUtilities.java 6 Jan 2006 01:00:52 -0000 1.7
@@ -390,13 +390,14 @@
static protected double hitMatchEnergy(MCParticle part, SimCalorimeterHit hit) {
int nContributingParticles = hit.getMCParticleCount();
+ double energySum = 0.0;
for (int i=0; i<nContributingParticles; i++) {
MCParticle hitPart = hit.getMCParticle(i);
- if (part == hitPart) {
- return hit.getContributedEnergy(i);
+ if (part == hitPart || part==null) {
+ energySum += hit.getContributedEnergy(i);
}
}
- return 0.0;
+ return energySum;
}
static protected int countHitsInCluster(MCParticle part, Cluster clus)