LISTSERV mailing list manager LISTSERV 16.5

Help for HPS-SVN Archives


HPS-SVN Archives

HPS-SVN Archives


HPS-SVN@LISTSERV.SLAC.STANFORD.EDU


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

HPS-SVN Home

HPS-SVN Home

HPS-SVN  October 2014

HPS-SVN October 2014

Subject:

r1339 - in /java/branches/hps_java_trunk_HPSJAVA-255/conditions/src/main/java/org/hps/conditions/svt: SvtDetectorSetup.java SvtT0Shift.java TestRunSvtDetectorSetup.java

From:

[log in to unmask]

Reply-To:

Notification of commits to the hps svn repository <[log in to unmask]>

Date:

Thu, 30 Oct 2014 06:38:19 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (147 lines)

Author: [log in to unmask]
Date: Wed Oct 29 23:38:17 2014
New Revision: 1339

Log:
Update SvtT0Shift so it extends AbstractT0Shift and implements the getT0Shift method.  The detector setup classes were updated to reflect changes made to the t0 shift classes.

Modified:
    java/branches/hps_java_trunk_HPSJAVA-255/conditions/src/main/java/org/hps/conditions/svt/SvtDetectorSetup.java
    java/branches/hps_java_trunk_HPSJAVA-255/conditions/src/main/java/org/hps/conditions/svt/SvtT0Shift.java
    java/branches/hps_java_trunk_HPSJAVA-255/conditions/src/main/java/org/hps/conditions/svt/TestRunSvtDetectorSetup.java

Modified: java/branches/hps_java_trunk_HPSJAVA-255/conditions/src/main/java/org/hps/conditions/svt/SvtDetectorSetup.java
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/conditions/src/main/java/org/hps/conditions/svt/SvtDetectorSetup.java	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/conditions/src/main/java/org/hps/conditions/svt/SvtDetectorSetup.java	Wed Oct 29 23:38:17 2014
@@ -98,7 +98,7 @@
             }
 
             // Set the t0 shift for the sensor.
-            SvtT0Shift sensorT0Shift = t0Shifts.find(daqPair).get(0);
+            SvtT0Shift sensorT0Shift = t0Shifts.getT0Shift(daqPair);
             sensor.setT0Shift(sensorT0Shift.getT0Shift());
         }
     }

Modified: java/branches/hps_java_trunk_HPSJAVA-255/conditions/src/main/java/org/hps/conditions/svt/SvtT0Shift.java
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/conditions/src/main/java/org/hps/conditions/svt/SvtT0Shift.java	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/conditions/src/main/java/org/hps/conditions/svt/SvtT0Shift.java	Wed Oct 29 23:38:17 2014
@@ -12,48 +12,39 @@
  * @author Jeremy McCormick <[log in to unmask]>
  * @author Omar Moreno <[log in to unmask]>
  */
-public final class SvtT0Shift extends AbstractConditionsObject {
+public final class SvtT0Shift extends AbstractSvtT0Shift {
 
-    public static class SvtT0ShiftCollection extends ConditionsObjectCollection<SvtT0Shift> {
+    public static class SvtT0ShiftCollection 
+        extends AbstractSvtT0Shift.AbstractSvtT0ShiftCollection<SvtT0Shift> {
 
-        SvtT0ShiftCollection find(Pair<Integer, Integer> pair) {
-            SvtT0ShiftCollection t0Shifts = new SvtT0ShiftCollection();
+        @Override
+        public SvtT0Shift getT0Shift(Pair<Integer, Integer> pair) {
             int febID = pair.getFirstElement();
             int febHybridID = pair.getSecondElement();
-            for (SvtT0Shift timeShift : getObjects()) {
-                if (timeShift.getFebID() == febID && timeShift.getFebHybridID() == febHybridID) {
-                    try {
-                        t0Shifts.add(timeShift);
-                    } catch (ConditionsObjectException e) {
-                        throw new RuntimeException(e);
-                    }
+            for (SvtT0Shift t0Shift : this.getObjects()) {
+                if (t0Shift.getFebID() == febID && t0Shift.getFebHybridID() == febHybridID) {
+                    return t0Shift;
                 }
             }
-            return t0Shifts;
+            return null;
         }
     }
 
     /**
-     * Get the FPGA number.
-     * @return The FPGA number.
+     * Get the FEB ID.
+     * 
+     * @return The FEB ID.
      */
     int getFebID() {
         return getFieldValue("feb_id");
     }
 
     /**
-     * Get the hybrid number.
-     * @return The hybrid number.
+     * Get the FEB hybrid ID.
+     *
+     * @return The FEB hybrid ID.
      */
     int getFebHybridID() {
         return getFieldValue("feb_hybrid_id");
     }
-
-    /**
-     * Get the time shift.
-     * @return The time shift.
-     */
-    double getT0Shift() {
-        return getFieldValue("t0_shift");
-    }
 }

Modified: java/branches/hps_java_trunk_HPSJAVA-255/conditions/src/main/java/org/hps/conditions/svt/TestRunSvtDetectorSetup.java
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/conditions/src/main/java/org/hps/conditions/svt/TestRunSvtDetectorSetup.java	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/conditions/src/main/java/org/hps/conditions/svt/TestRunSvtDetectorSetup.java	Wed Oct 29 23:38:17 2014
@@ -30,16 +30,12 @@
 	
         // Find sensor objects.
     	List<HpsSiSensor> sensors = subdetector.getDetectorElement().findDescendants(HpsSiSensor.class);
-        System.out.println("Total sensors found: " + sensors.size());
-    	
     	TestRunSvtChannelCollection channelMap = conditions.getChannelMap();
         TestRunSvtDaqMappingCollection daqMap = conditions.getDaqMap();
         SvtT0ShiftCollection t0Shifts = conditions.getT0Shifts();
 		
         // Loop over sensors.
         for(HpsSiSensor sensor : sensors){
-        	
-        	HpsTestRunSiSensor testRunSensor = (HpsTestRunSiSensor) sensor; 
         	
             // Reset possible existing conditions data on sensor.
             sensor.reset();
@@ -51,10 +47,10 @@
             }
            
             // Set the FPGA ID of the sensor
-            testRunSensor.setFpgaID(daqPair.getFirstElement());
+            ((HpsTestRunSiSensor) sensor).setFpgaID(daqPair.getFirstElement());
         
             // Set the hybrid ID of the sensor
-            testRunSensor.setHybridID(daqPair.getSecondElement());
+            ((HpsTestRunSiSensor) sensor).setHybridID(daqPair.getSecondElement());
             
             // Set the orientation of the sensor
             String orientation = daqMap.getOrientation(daqPair);
@@ -74,7 +70,6 @@
             	// Get conditions data for this channel.
                 ChannelConstants constants = conditions.getChannelConstants(channel);
                 int channelNumber = channel.getChannel();
-            
             
                 //
                 // Set conditions data for this channel on the sensor object:
@@ -105,7 +100,7 @@
             }
             
             // Set the t0 shift for the sensor.
-            SvtT0Shift sensorT0Shift = t0Shifts.find(daqPair).get(0);
+            SvtT0Shift sensorT0Shift = t0Shifts.getT0Shift(daqPair);
             sensor.setT0Shift(sensorT0Shift.getT0Shift());
         }
 	}

Top of Message | Previous Page | Permalink

Advanced Options


Options

Log In

Log In

Get Password

Get Password


Search Archives

Search Archives


Subscribe or Unsubscribe

Subscribe or Unsubscribe


Archives

November 2017
August 2017
July 2017
January 2017
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013

ATOM RSS1 RSS2



LISTSERV.SLAC.STANFORD.EDU

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager

Privacy Notice, Security Notice and Terms of Use