Author: [log in to unmask] Date: Tue May 5 16:52:08 2015 New Revision: 2914 Log: throw exception on failure Modified: java/trunk/conditions/src/main/java/org/hps/conditions/svt/SvtDetectorSetup.java 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 Tue May 5 16:52:08 2015 @@ -20,9 +20,9 @@ import org.lcsim.geometry.compact.Subdetector; import org.lcsim.util.log.LogUtil; - /** - * This class puts {@link SvtConditions} data onto <code>HpsSiSensor</code> objects. + * This class puts {@link SvtConditions} data onto <code>HpsSiSensor</code> + * objects. * * @author <a href="mailto:[log in to unmask]">Jeremy McCormick</a> * @author <a href="mailto:[log in to unmask]">Omar Moreno</a> @@ -56,6 +56,7 @@ /** * Constructor that takes name of SVT. + * * @param svtName the name of the SVT subdetector */ public SvtDetectorSetup(final String svtName) { @@ -64,6 +65,7 @@ /** * Set the name of the SVT in the detector model. + * * @param svtName the name of the SVt in the detector model. */ public void setSvtName(final String svtName) { @@ -72,6 +74,7 @@ /** * Set whether this class is enabled to be activated on conditions changes. + * * @param enabled <code>true</code> to enable */ public void setEnabled(final boolean enabled) { @@ -80,6 +83,7 @@ /** * Set the log level. + * * @param level the log level */ public void setLogLevel(final Level level) { @@ -88,7 +92,8 @@ } /** - * Hook that activates this class when conditions change (new detector or run number). + * Hook that activates this class when conditions change (new detector or + * run number). * * @param event the conditions event */ @@ -173,7 +178,6 @@ // // Set conditions data for this channel on the sensor object: // - // Check if the channel was flagged as bad if (constants.isBadChannel()) { sensor.setBadChannel(channelNumber); @@ -200,12 +204,16 @@ // Set the t0 shift for the sensor. final SvtT0Shift sensorT0Shift = t0Shifts.getT0Shift(daqPair); + if (sensorT0Shift == null) { + throw new RuntimeException("Failed to find T0 shift for sensor: " + sensor.getName() + ", FEB hybrid ID " + daqPair.getFirstElement() + ", FEB ID " + daqPair.getSecondElement()); + } sensor.setT0Shift(sensorT0Shift.getT0Shift()); } } - + /** * Load conditions from Test Run detector. + * * @param subdetector the SVT subdetector object * @param conditions the Test Run conditions */ @@ -260,7 +268,6 @@ // // Set conditions data for this channel on the sensor object: // - // Check if the channel was flagged as bad if (constants.isBadChannel()) { sensor.setBadChannel(channelNumber);