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  March 2015

HPS-SVN March 2015

Subject:

r2370 - in /java/trunk/conditions/src/main/java/org/hps/conditions/svt: AbstractSvtDaqMapping.java SvtDaqMapping.java SvtDetectorSetup.java

From:

[log in to unmask]

Reply-To:

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

Date:

Mon, 9 Mar 2015 06:26:50 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (215 lines)

Author: [log in to unmask]
Date: Sun Mar  8 23:26:41 2015
New Revision: 2370

Log:
Add setters for the fields feb_id, feb_hybrid_id, side, svt_half and orientation.

Modified:
    java/trunk/conditions/src/main/java/org/hps/conditions/svt/AbstractSvtDaqMapping.java
    java/trunk/conditions/src/main/java/org/hps/conditions/svt/SvtDaqMapping.java
    java/trunk/conditions/src/main/java/org/hps/conditions/svt/SvtDetectorSetup.java

Modified: java/trunk/conditions/src/main/java/org/hps/conditions/svt/AbstractSvtDaqMapping.java
 =============================================================================
--- java/trunk/conditions/src/main/java/org/hps/conditions/svt/AbstractSvtDaqMapping.java	(original)
+++ java/trunk/conditions/src/main/java/org/hps/conditions/svt/AbstractSvtDaqMapping.java	Sun Mar  8 23:26:41 2015
@@ -14,8 +14,6 @@
  */
 public abstract class AbstractSvtDaqMapping extends AbstractConditionsObject {
 
-    public static abstract class AbstractSvtDaqMappingCollection<T extends AbstractSvtDaqMapping> extends AbstractConditionsObjectCollection<T> {
-
         /**
          * Flag values for top or bottom half.
          */
@@ -27,6 +25,9 @@
          */
         public static final String AXIAL = "A";
         public static final String STEREO = "S";
+
+        public static abstract class AbstractSvtDaqMappingCollection<T extends AbstractSvtDaqMapping> extends AbstractConditionsObjectCollection<T> {
+
 
         /**
          * Get a DAQ pair for the given {@link HpsSiSensor}
@@ -48,18 +49,68 @@
 
     }
 
+    /**
+     *  Get the SVT half (TOP or BOTTOM) that the sensor belongs to.
+     *  
+     *  @return SVT half (TOP or BOTTOM)
+     */
     @Field(names = {"svt_half"})
     public String getSvtHalf() {
         return getFieldValue("svt_half");
     }
 
+    /**
+     *  Get the SVT sensor layer number (1-10 for test run and 1-12 for
+     *  engineering run).
+     *  
+     *  @return SVT sensor layer number
+     */
     @Field(names = {"layer"})
     public int getLayerNumber() {
         return getFieldValue("layer");
     }
 
+    
+    /**
+     *  Get the orientation of an SVT sensor (AXIAL or STEREO).
+     * 
+     *  @param orientation : Orientation of an SVT sensor (AXIAL or STEREO) 
+     */
     @Field(names = {"orientation"})
     public String getOrientation() {
         return getFieldValue("orientation");
     }
+    
+    /**
+     *  Set the SVT half (TOP or BOTTOM) that the sensor belongs to.
+     *  
+     *   @param svtHalf : SVT half (TOP or BOTTOM)
+     */
+    public void setSvtHalf(String svtHalf) { 
+        if (svtHalf != AbstractSvtDaqMapping.TOP_HALF || svtHalf != AbstractSvtDaqMapping.BOTTOM_HALF) 
+            throw new RuntimeException("[ " + this.getClass().getSimpleName() + " ]: Invalid value of SVT half.");
+        this.setFieldValue("svt_half", svtHalf);
+        
+    }
+    
+    /**
+     *  Set the SVT sensor layer number (1-10 for test run and 1-12 for
+     *  engineering run).
+     *  
+     *  @param layer : SVT sensor layer number
+     */
+    public void setLayerNumber(int layer) { 
+        this.setFieldValue("layer", layer);
+    }
+    
+    /**
+     *  Set the orientation of an SVT sensor (AXIAL or STEREO).
+     * 
+     *  @param orientation : Orientation of an SVT sensor (AXIAL or STEREO) 
+     */
+    public void setOrientation(String orientation) { 
+        if (orientation != AbstractSvtDaqMapping.AXIAL || orientation != AbstractSvtDaqMapping.STEREO)
+            throw new RuntimeException("[ " + this.getClass().getSimpleName() + " ]: Invalid orientation of sensor.");
+        this.setFieldValue("orientation", orientation);
+    }
 }

Modified: java/trunk/conditions/src/main/java/org/hps/conditions/svt/SvtDaqMapping.java
 =============================================================================
--- java/trunk/conditions/src/main/java/org/hps/conditions/svt/SvtDaqMapping.java	(original)
+++ java/trunk/conditions/src/main/java/org/hps/conditions/svt/SvtDaqMapping.java	Sun Mar  8 23:26:41 2015
@@ -16,6 +16,12 @@
 @Table(names = {"svt_daq_map"})
 @Converter(multipleCollectionsAction = MultipleCollectionsAction.ERROR)
 public class SvtDaqMapping extends AbstractSvtDaqMapping {
+   
+    /**
+     *  Constants describing the side of a sensor
+     */
+    public static final String ELECTRON = "ELECTRON";
+    public static final String POSITRON = "POSITRON";
 
     public static class SvtDaqMappingCollection extends AbstractSvtDaqMappingCollection<SvtDaqMapping> {
 
@@ -100,18 +106,62 @@
         }
     }
 
+    /**
+     *  Get the Front End Board (FEB) ID.
+     *
+     *  @return The FEB ID
+     */
     @Field(names = {"feb_id"})
     public int getFebID() {
         return getFieldValue("feb_id");
     }
 
+    /**
+     *  Get the Front End Board (FEB) hybrid ID.
+     *  
+     *  @param The FEB hybrid ID
+     */
     @Field(names = {"feb_hybrid_id"})
     public int getFebHybridID() {
         return getFieldValue("feb_hybrid_id");
     }
 
+    /**
+     *  Get the side of the sensor (ELECTRON or POSITRON).
+     *  
+     *  @param sensor side (ELECTRON or POSITRON)
+     */
     @Field(names = {"side"})
     public String getSide() {
         return getFieldValue("side");
     }
+    
+    /**
+     *  Set the Front End Board (FEB) ID.
+     *  
+     *  @param febID : FEB ID
+     */
+    public void setFebID(int febID) { 
+        this.setFieldValue("feb_id", febID);
+    }
+    
+    /**
+     *  Set the Front End Board (FEB) hybrid ID.
+     *  
+     *  @param febHybridID : FEB hybrid ID
+     */
+    public void setFebHybridID(int febHybridID) { 
+        this.setFieldValue("feb_hybrid_id", febHybridID);
+    }
+    
+    /**
+     *  Set the side of the sensor (ELECTRON or POSITRON).
+     *  
+     *  @param side : sensor side (ELECTRON or POSITRON)
+     */
+    public void setSide(String side) {
+        if (side != SvtDaqMapping.ELECTRON || side != SvtDaqMapping.POSITRON) 
+            throw new RuntimeException("[ " + this.getClass().getSimpleName() + " ]: Invalid value for sensor side.");
+        this.setFieldValue("side", side);
+    }
 }

Modified: java/trunk/conditions/src/main/java/org/hps/conditions/svt/SvtDetectorSetup.java
 =============================================================================
--- java/trunk/conditions/src/main/java/org/hps/conditions/svt/SvtDetectorSetup.java	(original)
+++ java/trunk/conditions/src/main/java/org/hps/conditions/svt/SvtDetectorSetup.java	Sun Mar  8 23:26:41 2015
@@ -112,9 +112,9 @@
 
             // Set the orientation of the sensor
             String orientation = daqMap.getOrientation(daqPair);
-            if (orientation != null && orientation.contentEquals(SvtDaqMappingCollection.AXIAL)) {
+            if (orientation != null && orientation.contentEquals(SvtDaqMapping.AXIAL)) {
                 sensor.setAxial(true);
-            } else if (orientation != null && orientation.contains(SvtDaqMappingCollection.STEREO)) {
+            } else if (orientation != null && orientation.contains(SvtDaqMapping.STEREO)) {
                 sensor.setStereo(true);
             }
 
@@ -194,9 +194,9 @@
 
             // Set the orientation of the sensor
             String orientation = daqMap.getOrientation(daqPair);
-            if (orientation != null && orientation.contentEquals(TestRunSvtDaqMappingCollection.AXIAL)) {
+            if (orientation != null && orientation.contentEquals(TestRunSvtDaqMapping.AXIAL)) {
                 sensor.setAxial(true);
-            } else if (orientation != null && orientation.contains(TestRunSvtDaqMappingCollection.STEREO)) {
+            } else if (orientation != null && orientation.contains(TestRunSvtDaqMapping.STEREO)) {
                 sensor.setStereo(true);
             }
 

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