lcsim/src/org/lcsim/util/loop
diff -u -r1.2 -r1.3
--- StdhepConverter.java 7 Dec 2005 19:15:29 -0000 1.2
+++ StdhepConverter.java 8 Dec 2005 00:59:52 -0000 1.3
@@ -21,7 +21,7 @@
* A class that converts MCEvent<-->StdhepEvent.
* This version uses the Ron Cassell algorithm for deciding on parent/child relationships.
* @author Tony Johnson ([log in to unmask])
- * @version $Id: StdhepConverter.java,v 1.2 2005/12/07 19:15:29 tonyj Exp $
+ * @version $Id: StdhepConverter.java,v 1.3 2005/12/08 00:59:52 tonyj Exp $
*/
class StdhepConverter
{
@@ -69,6 +69,7 @@
int idx1 = hepevt.getJMOHEP(i,0) - 1;
int idx2 = hepevt.getJMOHEP(i,1) - 1;
int l = fillIndexVec(vec,idx1,idx2);
+ //System.out.println("parent: "+i+" "+idx1+" "+idx2+" "+l);
for (int j=0; j<l; j++)
{
checkAndAddDaughter(particle,ancestors,vec[j],i);
@@ -80,6 +81,7 @@
int idx1 = hepevt.getJDAHEP(i,0) % 10000 - 1;
int idx2 = hepevt.getJDAHEP(i,1) % 10000 - 1;
int l = fillIndexVec(vec,idx1,idx2);
+ //System.out.println("child: "+i+" "+idx1+" "+idx2+" "+l);
for (int j=0; j<l; j++)
{
checkAndAddDaughter(particle,ancestors,i,vec[j]);
@@ -92,8 +94,9 @@
{
if (parentID == childID) return; // Can't be parent of self
Set<BasicParticle> ancestor = ancestors.get(childID);
- boolean contains = ancestor.add(particle[parentID]);
- if (!contains) particle[parentID].addDaughter(particle[childID]);
+ boolean added = ancestor.add(particle[parentID]);
+ if (added) particle[parentID].addDaughter(particle[childID]);
+ //System.out.println("add "+parentID+" "+childID+" "+added);
}
private int fillIndexVec(int[] vec, int idx1, int idx2)
{