Commit in lcsim/src/org/lcsim/recon/cluster/density on MAIN
DirectedTreeClusterer.java+31-321.1 -> 1.2
GL: Updates from old framework

lcsim/src/org/lcsim/recon/cluster/density
DirectedTreeClusterer.java 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- DirectedTreeClusterer.java	7 Dec 2005 18:57:14 -0000	1.1
+++ DirectedTreeClusterer.java	12 Dec 2005 05:24:46 -0000	1.2
@@ -89,18 +89,15 @@
 //	    if(_evtnum==81 && cellid== 1672347904) System.out.println("density="+idens);
 
 	    segm.setID(cellid);
-// 	    System.out.println("makeTree ihit: cellID="+MyTools.printID(cellid)
-// 			       +", layer "+segm.getLayer()
-// 			       +", dens="+idens);
+//  	    System.out.println("makeTree ihit: cellID="+MyTools.printID(cellid)
+//  			       +", layer "+segm.getLayer()
+//  			       +", dens="+idens);
 
             double maxdensDiff = -999999.;
 	    long maxdensID = -999999;
             Vector<Long> nVec = new Vector<Long>();
-            if(idens==0.0) {
-                RootVec.add(ihit);
-// 		System.out.println("Zero density root");
-            }
-            else{
+	    // changed from !=0
+            if(idens>=0.0) {
 	       double[] ipos = ihit.getPosition();
 	       if(_calType=="EM"){
 		 int nLyrOrig = _runPar.getLyrNeighEM();
@@ -110,7 +107,7 @@
 		 int[] lyrCon = _runPar.getLyrContracEM();
 		 int[] zCon = _runPar.getZContracEM();
 		 int[] phiCon = _runPar.getPhiContracEM();
-// 		 System.out.println("Original Window"+" "+nLyrOrig+" "+nZOrig+" "+nPhiOrig);
+//  		 System.out.println("Original Window"+" "+nLyrOrig+" "+nZOrig+" "+nPhiOrig);
 		 if(dRegion==1){
 		     _nLyr = nLyrOrig - lyrCon[0];
 		     _nZ = nZOrig - zCon[0];
@@ -135,7 +132,7 @@
 		 int[] lyrCon = _runPar.getLyrContracHD();
 		 int[] zCon = _runPar.getZContracHD();
 		 int[] phiCon = _runPar.getPhiContracHD();
-// 		 System.out.println("Original Window"+" "+nLyrOrig+" "+nZOrig+" "+nPhiOrig);
+//  		 System.out.println("Original Window"+" "+nLyrOrig+" "+nZOrig+" "+nPhiOrig);
 		 if(dRegion==0){
 		     _nLyr = nLyrOrig;
 		     _nZ = nZOrig;
@@ -159,10 +156,9 @@
 	       }
 
 //                int neigh[] = segm.getNeighbors(cellid,_nLyr,_nZ,_nPhi);
-// 		if(_calType=="HD")
-// 		System.out.println("window in directed tree "+_nLyr+" "+_nZ+" "+_nPhi);
+// 		if(_calType=="HD") System.out.println("window in directed tree "+_nLyr+" "+_nZ+" "+_nPhi);
 		segm.setID(cellid);
-// 		System.out.println("Processing ihit: cellID="+MyTools.printID(cellid));
+//  		System.out.println("Processing ihit: cellID="+MyTools.printID(cellid));
 		long neigh[] = segm.getNeighbourIDs(_nLyr, _nZ, _nPhi);
 
 		//		if(_evtnum==81 && cellid== 1672347904) System.out.println("neighborhood="+" "+_nLyr+" "+_nZ+" "+_nPhi);
@@ -181,12 +177,12 @@
 //???		    if(distance==0) densDiff=0;
 
                     if(densDiff==0.0) nVec.add(jid);
-// 		    System.out.println(" jhit: layer="+(jid&0x7f)
-// 				       +", cellID="+MyTools.printID(jid)
-//                                        +", idens="+idens
-// 				       +", jdens="+jdens
-// 				       +", dist="+distance
-// 				       +", densDiff="+densDiff);
+//  		    System.out.println(" jhit: layer="+(jid&0x7f)
+//  				       +", cellID="+MyTools.printID(jid)
+// 				       +", idens="+idens
+//  				       +", jdens="+jdens
+//  				       +", dist="+distance
+//  				       +", densDiff="+densDiff);
 
                     if(densDiff>maxdensDiff){
                         maxdensDiff = densDiff;
@@ -195,23 +191,22 @@
                     calcD = null;
                 }
 
-//                 if(maxdensDiff<0.0){
-//                     RootVec.add(myhit1);
-// 		    System.out.println("Bonafide root");
-//                 }
+		if(maxdensDiff<0.0){
+		    RootVec.add(ihit);
+//  		    System.out.println("Bonafide root");
+		}
 
                 if(maxdensDiff>0.0){
                   Long key1 = new Long(cellid);
 		  Long key2 = new Long(maxdensID);
 		  _ParentMap.put(key1,key2);
-// 		  System.out.println(" maxdensDiff>0: "
-// 				     +" id="+MyTools.printID(maxdensID)
-// 				     +", parent of "+MyTools.printID(cellid));
+//  		  System.out.println(" maxdensDiff>0: "
+//  				     +" id="+MyTools.printID(maxdensID)
+//  				     +", parent of "+MyTools.printID(cellid));
                 }
 
                 if(maxdensDiff==0.0){
                     Vector<Long> removeItems = new Vector<Long>();
-//                     Long key = new Long(cellid);
                     for(Long jkey : nVec) {
                         Vector<Long> temporary = new Vector<Long>();
                         Long parent = _ParentMap.get(jkey);
@@ -247,10 +242,14 @@
                             }
                         }
                         _ParentMap.put(cellid,parentKey);
-// 			System.out.println("Cell is matched to identical density neighbor");
+//  			System.out.println("Cell is matched to identical density neighbor");
                     }
                 }
 	    }
+            else{
+                RootVec.add(ihit);
+// 		System.out.println("Zero density root");
+            }
         }
 
         Vector<CalorimeterHit> startingPoints = new Vector<CalorimeterHit>();
@@ -324,10 +323,10 @@
     public int emDensityRegion(double dens,int nl,int nz,int np){
 	int region = 0;
 	//	if(nl==6 && nz==3 && np==3){
-	    if(dens<5.) region=1;
-	    if(dens>=5. && dens<25.) region=2;
-	    if(dens>=25.) region=3;
-	    //	}
+	if(dens<5.) region=1;
+	if(dens>=5. && dens<25.) region=2;
+	if(dens>=25.) region=3;
+	//	}
 	return region;
     }
 
CVSspam 0.2.8