Commit in lcsim/src/org/lcsim/recon/cluster/density on MAIN
MyTools.java+13-21.3 -> 1.4
GL: Add SDNPHOct04 handling

lcsim/src/org/lcsim/recon/cluster/density
MyTools.java 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- MyTools.java	12 Dec 2005 05:27:02 -0000	1.3
+++ MyTools.java	27 Dec 2005 16:33:53 -0000	1.4
@@ -14,8 +14,9 @@
  */
 public class MyTools
 {
-    // 1=sidaug05;  2=sidaug05_tcmt
-    static int detector = 2;
+    // 1=sidaug05;  2=sidaug05_tcmt;  3=sdnphoct04
+    static int detector = 3;
+
 //     // This returns the index of object obj in collection col
 //     public static int indexOf( LCObject obj, LCCollection col )
 //     {
@@ -40,18 +41,21 @@
     public static int getSystem( long cellid ) {
 	if(detector==1)	     return (int)(cellid>>7)&0x3f;
 	else if(detector==2) return (int)(cellid>>7)&0x3f;
+	else if(detector==3) return (int)(cellid>>16)&0x3f;
 	else return 0;
     }
 
     public static int getSystemBarrel( long cellid ) {
 	if(detector==1)	     return (int)((cellid>>7) & 0x1ff);
 	else if(detector==2) return (int)((cellid>>7) & 0x1ff);
+	else if(detector==3) return (int)((cellid>>16) & 0x1ff);
 	else return 0;
     }
 
     public static int getLayer( long cellid ) {
 	if(detector==1)	     return (int)((cellid>>0) & 0x7f);
 	else if(detector==2) return (int)((cellid>>0) & 0x7f);
+	else if(detector==3) return (int)((cellid>>0) & 0xffff);
 	else return 0;
     }
 
@@ -67,6 +71,12 @@
 	    // sign bit
 	    if( thetabin > max/2-1 ) thetabin = thetabin - max;
 	}
+	if(detector==3) {
+	    int max = 1<<16;  // for 16 bits
+	    thetabin = (int)((cellid>>32) & 0xffff);
+	    // sign bit
+	    if( thetabin > max/2-1 ) thetabin = thetabin - max;
+	}
 	return thetabin;
     }
 
@@ -78,6 +88,7 @@
 	    if( phibin > max/2-1 ) phibin = phibin - max;
 	}
 	if(detector==2) phibin = (int)((cellid>>32) & 0xffff);
+	if(detector==3) phibin = (int)((cellid>>48) & 0xffff);
  	return phibin;
     }
 
CVSspam 0.2.8