java/branches/hps-java_HPSJAVA-88/conditions/src/main/java/org/hps/conditions/svt
--- java/branches/hps-java_HPSJAVA-88/conditions/src/main/java/org/hps/conditions/svt/SvtDetectorSetup.java 2014-09-16 21:29:27 UTC (rev 1029)
+++ java/branches/hps-java_HPSJAVA-88/conditions/src/main/java/org/hps/conditions/svt/SvtDetectorSetup.java 2014-09-16 21:36:59 UTC (rev 1030)
@@ -19,16 +19,16 @@
public final class SvtDetectorSetup {
/**
- * Load conditions data onto a detector object. This method is analogous to
- * {@link org.lcsim.hps.recon.tracking.SvtUtils#setup(Detector)}.
+ * Load conditions data onto a detector object.
+ *
* @param detector The detector object.
* @param conditions The conditions object.
*/
- // FIXME: Change this to use a Subdetector instead of the Detector.
public void load(Detector detector, SvtConditions conditions) {
// Find sensor objects.
- List<HpsSiSensor> sensors = detector.getDetectorElement().findDescendants(HpsSiSensor.class);
+ List<HpsSiSensor> sensors = detector.getSubdetector("Tracker").getDetectorElement().findDescendants(HpsSiSensor.class);
+ //List<HpsSiSensor> sensors = detector.getDetectorElement().findDescendants(HpsSiSensor.class);
SvtChannelCollection channelMap = conditions.getChannelMap();
SvtDaqMappingCollection daqMap = conditions.getDaqMap();
SvtT0ShiftCollection t0Shifts = conditions.getT0Shifts();
java/branches/hps-java_HPSJAVA-88/conditions/src/test/java/org/hps/conditions/svt
--- java/branches/hps-java_HPSJAVA-88/conditions/src/test/java/org/hps/conditions/svt/SvtDetectorSetupTest.java 2014-09-16 21:29:27 UTC (rev 1029)
+++ java/branches/hps-java_HPSJAVA-88/conditions/src/test/java/org/hps/conditions/svt/SvtDetectorSetupTest.java 2014-09-16 21:36:59 UTC (rev 1030)
@@ -15,7 +15,6 @@
*
* @author Jeremy McCormick <[log in to unmask]>
* @author Omar Moreno <[log in to unmask]>
- * @version $Id$
*/
// TODO: Update this test with more meaningful test.
public class SvtDetectorSetupTest extends TestCase {
@@ -23,10 +22,19 @@
//--- Constants ---//
//-----------------//
+ // TODO: Move all of these constants to their own class
// Total number of SVT sensors
public static final int TOTAL_NUMBER_OF_SENSORS = 36;
-
+ // Max FEB ID
+ public static final int MAX_FEB_ID = 9;
+ // Max FEB Hybrid ID
+ public static final int MAX_FEB_HYBRID_ID = 3;
+ // Max channel number
+ public static final int MAX_CHANNEL_NUMBER = 639;
+ // SVT Subdetector name
+ public static final String SVT_SUBDETECTOR_NAME = "Tracker";
+
public void setUp(){
new DevReadOnlyConfiguration().setup().load("HPS-Proposal2014-v7-2pt2", 0);
}
@@ -49,42 +57,49 @@
loader.load(detector, conditions);
// Check sensor data.
- List<HpsSiSensor> sensors = detector.getDetectorElement().findDescendants(HpsSiSensor.class);
+ List<HpsSiSensor> sensors = detector.getSubdetector(SVT_SUBDETECTOR_NAME).getDetectorElement().findDescendants(HpsSiSensor.class);
+ //List<HpsSiSensor> sensors = detector.getDetectorElement().findDescendants(HpsSiSensor.class);
- int nChannels = sensors.get(0).getNumberOfChannels();
- this.printDebug("Total number of channels per sensor: " + nChannels);
+ // Check for correct number of sensors processed.
+ this.printDebug("Total number of sensors found: " + sensors.size());
+ assertTrue(sensors.size() == TOTAL_NUMBER_OF_SENSORS);
// Loop over sensors.
int totalSensors = 0;
for (HpsSiSensor sensor : sensors) {
+ int nChannels = sensor.getNumberOfChannels();
+ assertTrue("The number of channels this sensor has is invalid", nChannels <= MAX_CHANNEL_NUMBER);
+
this.printDebug(sensor.toString());
- totalSensors++;
-
- // Check that hardware information seems reasonable.
+ // Check that the FEB ID as within the appropriate range
+ int febID = sensor.getFebID();
+ assertTrue("FEB ID is invalid. The FEB ID should be less than " + MAX_FEB_ID,
+ febID <= MAX_FEB_ID);
+
int febHybridID = sensor.getFebHybridID();
- int febID = sensor.getFebID();
-
+ assertTrue("FEB Hybrid ID is invalid. The FEB Hybrid ID should be less than " + MAX_FEB_HYBRID_ID,
+ febHybridID <= MAX_FEB_HYBRID_ID);
+
for (int channel = 0; channel < nChannels; channel++) {
//
// Check that channel conditions values are not zero
//
for(int sampleN = 0; sampleN < 6; sampleN++){
- assertTrue("Pedestal is zero.", sensor.getPedestal(channel, sampleN) != 0);
- assertTrue("Noise is zero.", sensor.getNoise(channel, sampleN) != 0);
+ assertTrue("Pedestal sample " + sampleN + " is zero.",
+ sensor.getPedestal(channel, sampleN) != 0);
+ assertTrue("Noise sample " + sampleN + " is zero.",
+ sensor.getNoise(channel, sampleN) != 0);
}
assertTrue("Gain is zero.", sensor.getGain(channel) != 0);
- assertTrue("PulseParameters points to null.", sensor.getShapeFitParameters(channel) != null);
+ assertTrue("Shape fit parameters points to null.",
+ sensor.getShapeFitParameters(channel) != null);
}
}
- // Check for correct number of sensors processed.
- this.printDebug("Total number of sensors found: " + totalSensors);
- //assertTrue(totalSensors == TOTAL_NUMBER_OF_SENSORS);
-
System.out.println("Successfully loaded conditions data onto " + totalSensors + " SVT sensors!");
}
java/branches/hps-java_HPSJAVA-88/integration-tests
--- java/branches/hps-java_HPSJAVA-88/integration-tests/pom.xml 2014-09-16 21:29:27 UTC (rev 1029)
+++ java/branches/hps-java_HPSJAVA-88/integration-tests/pom.xml 2014-09-16 21:36:59 UTC (rev 1030)
@@ -1,30 +1,38 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
<modelVersion>4.0.0</modelVersion>
<artifactId>hps-integration-tests</artifactId>
<name>integration-tests</name>
<description>Integration test suite</description>
-
<parent>
<groupId>org.hps</groupId>
<artifactId>hps-parent</artifactId>
<relativePath>../parent/pom.xml</relativePath>
<version>3.0.3-SNAPSHOT</version>
</parent>
-
<scm>
<url>http://java.freehep.org/svn/repos/hps/list/java/trunk/integration-tests/</url>
<connection>scm:svn:svn://svn.freehep.org/hps/java/trunk/integration-tests/</connection>
<developerConnection>scm:svn:svn://svn.freehep.org/hps/java/trunk/integration-tests/</developerConnection>
</scm>
-
<dependencies>
<dependency>
<groupId>org.hps</groupId>
<artifactId>hps-distribution</artifactId>
</dependency>
</dependencies>
-
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>org/hps/GenerateEcalReadoutSimData.java</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
<profiles>
<profile>
<id>non-slac</id>