Author: [log in to unmask]
Date: Thu Jan 15 17:11:33 2015
New Revision: 1942
Log:
Add check that SVT subdetector is present before initializing. Otherwise this config will be skipped.
Modified:
java/trunk/tracking/src/main/java/org/hps/recon/tracking/SvtSensorSetup.java
Modified: java/trunk/tracking/src/main/java/org/hps/recon/tracking/SvtSensorSetup.java
=============================================================================
--- java/trunk/tracking/src/main/java/org/hps/recon/tracking/SvtSensorSetup.java (original)
+++ java/trunk/tracking/src/main/java/org/hps/recon/tracking/SvtSensorSetup.java Thu Jan 15 17:11:33 2015
@@ -135,15 +135,20 @@
*/
public void detectorChanged(Detector detector){
- // Get the collection of all SiSensors from the SVT
- List<SiSensor> sensors
- = detector.getSubdetector(SVT_SUBDETECTOR_NAME).
- getDetectorElement().findDescendants(SiSensor.class);
+ if (detector.getSubdetector(SVT_SUBDETECTOR_NAME) != null) {
+
+ // Get the collection of all SiSensors from the SVT
+ List<SiSensor> sensors
+ = detector.getSubdetector(SVT_SUBDETECTOR_NAME)
+ .getDetectorElement().findDescendants(SiSensor.class);
- // Loop through all of the sensors and configure them
- for(SiSensor sensor : sensors){
- this.setupSensor(sensor);
- }
+ // Loop through all of the sensors and configure them
+ for(SiSensor sensor : sensors){
+ this.setupSensor(sensor);
+ }
+ } else {
+ getLogger().warning("no SVT detector found");
+ }
}
/**
|