Commit in GeomConverter/src/org/lcsim/detector/tracker/silicon on MAIN
SiSensor.java+22-141.14 -> 1.15
JM: Remove debug print.  Minor refactoring of makeStripId() method.

GeomConverter/src/org/lcsim/detector/tracker/silicon
SiSensor.java 1.14 -> 1.15
diff -u -r1.14 -r1.15
--- SiSensor.java	25 Sep 2007 23:42:24 -0000	1.14
+++ SiSensor.java	25 Sep 2007 23:52:54 -0000	1.15
@@ -27,6 +27,8 @@
 import org.lcsim.detector.identifier.IIdentifier;
 import org.lcsim.detector.identifier.IIdentifierDictionary;
 import org.lcsim.detector.identifier.IIdentifierHelper;
+import org.lcsim.detector.identifier.IIdentifierDictionary.FieldNotFoundException;
+import org.lcsim.detector.identifier.IIdentifierDictionary.InvalidIndexException;
 import org.lcsim.detector.solids.Box;
 
 /**
@@ -321,23 +323,29 @@
      */
     public IIdentifier makeStripId( int stripNumber, int sideNumber )
     {
+		// Copy the DetectorElement's identifier, which will leave blank fields
+		// for side and strip.
+    	IExpandedIdentifier id = new ExpandedIdentifier(getExpandedIdentifier());
+    	
+    	// Get the helper and dictionary.
+    	IIdentifierHelper helper = getIdentifierHelper();
+		IIdentifierDictionary dict = helper.getIdentifierDictionary();
+    	
     	try {
-    		IIdentifierHelper helper = getIdentifierHelper();
-    		IIdentifierDictionary dict = helper.getIdentifierDictionary();
-    		
-    		IExpandedIdentifier id = new ExpandedIdentifier(getExpandedIdentifier());
-    		
-    		int sideIndex = dict.getFieldIndex("side");
-    		int stripIndex = dict.getFieldIndex("strip");
-    		
-    		id.setValue(sideIndex, sideNumber);
-    		id.setValue(stripIndex, stripNumber);
-    		   	
-    		System.out.println("stripid: " + id.toString());
-    		
+    		// Fill in the side and strip numbers.
+    		id.setValue(dict.getFieldIndex("side"), sideNumber);
+    		id.setValue(dict.getFieldIndex("strip"), stripNumber);
+    	}
+    	catch (FieldNotFoundException x)
+    	{
+    		throw new RuntimeException(x);
+    	}
+    	
+    	try {
+    		// Pack and return the id.
     		return helper.pack( id );
     	}
-    	catch (Exception x)
+    	catch (InvalidIndexException x)
     	{
     		throw new RuntimeException(x);
     	}
CVSspam 0.2.8