Commit in java/trunk/conditions/src/main on MAIN
java/org/hps/conditions/svt/SvtDaqMapping.java+15-421174 -> 1175
                           /SvtDetectorSetup.java+1-171174 -> 1175
resources/org/hps/conditions/config/conditions_dev.xml+32-321174 -> 1175
+48-91
3 modified files
Update SvtDaqMapping to reflect the changes made to the corresponding conditions table.  The table column "hybrid_id" was dropped while another field, "side", was added. This greatly simplified the assignment of FEB ID's and FEB Hybrid ID's to a sensor. 

java/trunk/conditions/src/main/java/org/hps/conditions/svt
SvtDaqMapping.java 1174 -> 1175
--- java/trunk/conditions/src/main/java/org/hps/conditions/svt/SvtDaqMapping.java	2014-10-12 00:02:40 UTC (rev 1174)
+++ java/trunk/conditions/src/main/java/org/hps/conditions/svt/SvtDaqMapping.java	2014-10-13 07:05:37 UTC (rev 1175)
@@ -1,5 +1,7 @@
 package org.hps.conditions.svt;
 
+import org.lcsim.detector.tracker.silicon.HpsSiSensor;
+
 import org.hps.conditions.AbstractConditionsObject;
 import org.hps.conditions.ConditionsObjectCollection;
 import org.hps.util.Pair;
@@ -35,45 +37,16 @@
          * @param moduleNumber The module number (needed to identify layer's 4-6)
          * @return The DAQ pair for the half and layer number or null if does not exist.
          */
-        Pair<Integer, Integer> getDaqPair(String SvtHalf, int layerNumber, int moduleNumber) {
+        Pair<Integer, Integer> getDaqPair(HpsSiSensor sensor) {
         	
+        	String svtHalf = sensor.isTopLayer() ? TOP_HALF : BOTTOM_HALF;
         	for (SvtDaqMapping object : this.getObjects()) {
+        		
+        		if(svtHalf.equals(object.getSvtHalf()) 
+        				&& object.getLayerNumber() == sensor.getLayerNumber()
+        				&& object.getSide().equals(sensor.getSide())) {
                 
-        		if (SvtHalf.equals(object.getSvtHalf()) && object.getLayerNumber() == layerNumber) {
-                
-        			// If the sensor belongs to the first three layers of the SVT
-        			// and the detector layer and SVT half match, no further searching
-        			// is required.
-        			if(layerNumber <= 6){
-                		return new Pair<Integer, Integer>(object.getFebID(), object.getFebHybridID());
-                	} 
-                	
-        			// If the sensor belongs to layers 4-6, then find the matching
-        			// DAQ pair by looking at combinations of FEB hybrid ID's and module
-        			// numbers.  At the moment, it is assumed that odd SVT layers will 
-        			// be connected to even FEB hybrid channels and even SVT layers to odd
-        			// FEB hybrid channels.
-        			// TODO: Changes should be made to HpsSiSensor that will allow this
-        			//		 portion of the matching to be greatly simplified.
-                	if(SvtHalf.equals(TOP_HALF)){
-                		if(layerNumber%2 != 0 
-                				&& ((object.getFebHybridID() == 0 && moduleNumber == 0) 
-                						|| object.getFebHybridID() == 2 && moduleNumber == 2)){
-                			return new Pair<Integer, Integer>(object.getFebID(), object.getFebHybridID());
-                		} else if(layerNumber %2 == 0 &&((object.getFebHybridID() == 1 && moduleNumber == 0)
-                				|| object.getFebHybridID() == 3 && moduleNumber == 2)) { 
-                			return new Pair<Integer, Integer>(object.getFebID(), object.getFebHybridID());
-                		}
-                	} else if(SvtHalf.equals(BOTTOM_HALF)){ 
-                		if(layerNumber%2 != 0 
-                				&& ((object.getFebHybridID() == 0 && moduleNumber == 1) 
-                						|| object.getFebHybridID() == 2 && moduleNumber == 3)){
-                			return new Pair<Integer, Integer>(object.getFebID(), object.getFebHybridID());
-                		} else if(layerNumber %2 == 0 &&((object.getFebHybridID() == 1 && moduleNumber == 1)
-                				|| object.getFebHybridID() == 3 && moduleNumber == 3)) { 
-                			return new Pair<Integer, Integer>(object.getFebID(), object.getFebHybridID());
-                		}
-                	}
+        			return new Pair<Integer, Integer>(object.getFebID(), object.getFebHybridID());
                 } 
             }
             return null;
@@ -125,12 +98,12 @@
                 buff.append("    ");
             	buff.append(object.getFebHybridID());
                 buff.append("    ");
-            	buff.append(object.getHybridID());
-                buff.append("    ");
                 buff.append(object.getSvtHalf());
                 buff.append("    ");
                 buff.append(String.format("%-2d", object.getLayerNumber()));
                 buff.append("    ");
+                buff.append(object.getSide());
+                buff.append("    ");
                 buff.append(object.getOrientation());
                 buff.append("    ");
                 buff.append('\n');
@@ -147,10 +120,6 @@
     	return getFieldValue("feb_hybrid_id");
     }
     
-    public int getHybridID() { 
-    	return getFieldValue("hybrid_id");
-    }
-    
     public String getSvtHalf() {
         return getFieldValue("svt_half");
     }
@@ -158,6 +127,10 @@
     public int getLayerNumber() {
         return getFieldValue("layer");
     }
+    
+    public String getSide(){
+    	return getFieldValue("side");
+    }
 
     public String getOrientation() { 
     	return getFieldValue("orientation");

java/trunk/conditions/src/main/java/org/hps/conditions/svt
SvtDetectorSetup.java 1174 -> 1175
--- java/trunk/conditions/src/main/java/org/hps/conditions/svt/SvtDetectorSetup.java	2014-10-12 00:02:40 UTC (rev 1174)
+++ java/trunk/conditions/src/main/java/org/hps/conditions/svt/SvtDetectorSetup.java	2014-10-13 07:05:37 UTC (rev 1175)
@@ -39,24 +39,8 @@
             // Reset possible existing conditions data on sensor.
             sensor.reset();
 
-            // Get the layer number.  The layer number will range from 1-12;
-            int layerNumber = sensor.getLayerNumber();
-            
-            // Get the module ID number.  The sensors in the first three layers
-            // of the SVT are assigned a module ID = 0 if they are in the top 
-            // volume and 1 if they are on the bottom.  For layers 4-6, the 
-            // assigned module ID is 0 and 2 for top and 1 and 3 for bottom
-            // depending on whether the sensor is on the hole or slot side of
-            // the half-module.
-            int moduleNumber = sensor.getModuleNumber();
-
             // Get DAQ pair (FEB ID, FEB Hybrid ID) corresponding to this sensor
-            Pair<Integer, Integer> daqPair = null;
-            String SvtHalf = SvtDaqMappingCollection.TOP_HALF;
-            if (sensor.isBottomLayer()) {
-                SvtHalf = SvtDaqMappingCollection.BOTTOM_HALF;
-            }
-            daqPair = daqMap.getDaqPair(SvtHalf, layerNumber, moduleNumber);
+            Pair<Integer, Integer> daqPair = daqMap.getDaqPair(sensor);
             if (daqPair == null) {
                 throw new RuntimeException("Failed to find DAQ pair for sensor: " + sensor.getName());
             }

java/trunk/conditions/src/main/resources/org/hps/conditions/config
conditions_dev.xml 1174 -> 1175
--- java/trunk/conditions/src/main/resources/org/hps/conditions/config/conditions_dev.xml	2014-10-12 00:02:40 UTC (rev 1174)
+++ java/trunk/conditions/src/main/resources/org/hps/conditions/config/conditions_dev.xml	2014-10-13 07:05:37 UTC (rev 1175)
@@ -75,10 +75,10 @@
                 <collection class="org.hps.conditions.svt.SvtChannel$SvtChannelCollection"/>
             </classes>
             <fields>
-                <field name="channel_id" />
-                <field name="feb_id" />
+                <field name="channel_id"    />
+                <field name="feb_id"        />
                 <field name="feb_hybrid_id" />
-                <field name="channel" />
+                <field name="channel"       />
             </fields>
         </table>
         
@@ -88,8 +88,8 @@
                 <collection class="org.hps.conditions.svt.SvtConfiguration$SvtConfigurationCollection"/>                
             </classes>
             <fields>
-                <field name="filename"/>
-                <field name="content"/>
+                <field name="filename"  />
+                <field name="content"   />
             </fields>
         
         </table>
@@ -100,9 +100,9 @@
                 <collection class="org.hps.conditions.svt.SvtGain$SvtGainCollection"/>
             </classes>            
             <fields>
-                <field name="svt_channel_id" />
-                <field name="gain" />
-                <field name="offset" />
+                <field name="svt_channel_id"    />
+                <field name="gain"              />
+                <field name="offset"            />
             </fields>
         </table>
         
@@ -112,10 +112,10 @@
                 <collection class="org.hps.conditions.svt.SvtShapeFitParameters$SvtShapeFitParametersCollection"/>
             </classes>
             <fields>
-                <field name="svt_channel_id" />
-                <field name="amplitude" />
-                <field name="t0" />
-                <field name="tp" />
+                <field name="svt_channel_id"    />
+                <field name="amplitude"         />
+                <field name="t0"                />
+                <field name="tp"                />
             </fields>        
         </table>
         
@@ -125,19 +125,19 @@
                 <collection class="org.hps.conditions.svt.SvtCalibration$SvtCalibrationCollection"/>
             </classes>
             <fields>
-                <field name="svt_channel_id" />
-                <field name="pedestal_0" />
-                <field name="pedestal_1" />
-                <field name="pedestal_2" />
-                <field name="pedestal_3" />
-                <field name="pedestal_4" />
-                <field name="pedestal_5" />
-                <field name="noise_0" />
-                <field name="noise_1" />
-                <field name="noise_2" />
-                <field name="noise_3" />
-                <field name="noise_4" />
-                <field name="noise_5" />
+                <field name="svt_channel_id"    />
+                <field name="pedestal_0"        />
+                <field name="pedestal_1"        />
+                <field name="pedestal_2"        />
+                <field name="pedestal_3"        />
+                <field name="pedestal_4"        />
+                <field name="pedestal_5"        />
+                <field name="noise_0"           />
+                <field name="noise_1"           />
+                <field name="noise_2"           />
+                <field name="noise_3"           />
+                <field name="noise_4"           />
+                <field name="noise_5"           />
             </fields>        
         </table>
         
@@ -147,9 +147,9 @@
                 <collection class="org.hps.conditions.svt.SvtT0Shift$SvtT0ShiftCollection"/>
             </classes>
             <fields>
-                <field name="feb_id" />
+                <field name="feb_id"        />
                 <field name="feb_hybrid_id" />
-                <field name="t0_shift" />
+                <field name="t0_shift"      />
             </fields>        
         </table>
         
@@ -170,12 +170,12 @@
 				<collection class="org.hps.conditions.svt.SvtDaqMapping$SvtDaqMappingCollection"/>
             </classes>
             <fields>
-                <field name="feb_id" />
+                <field name="feb_id"        />
                 <field name="feb_hybrid_id" />
-                <field name="hybrid_id" />
-                <field name="svt_half" />
-                <field name="layer" />
-                <field name="orientation" />
+                <field name="svt_half"      />
+                <field name="layer"         />
+                <field name="side"          />
+                <field name="orientation"   />
             </fields>  
         </table>
 
SVNspam 0.1