Commit in hps-java/src/main/java/org/lcsim/hps/conditions on MAIN | |||
ConditionsDriver.java | +46 | added 1.1 |
Driver for setting conditions on the detector (untested)
diff -N ConditionsDriver.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ ConditionsDriver.java 16 Oct 2013 23:15:14 -0000 1.1 @@ -0,0 +1,46 @@
+package org.lcsim.hps.conditions; + +import org.lcsim.conditions.ConditionsManager; +import org.lcsim.geometry.Detector; +import org.lcsim.hps.conditions.ecal.EcalConditions; +import org.lcsim.hps.conditions.ecal.EcalConditionsLoader; +import org.lcsim.hps.conditions.svt.SvtConditions; +import org.lcsim.hps.conditions.svt.SvtConditionsLoader; +import org.lcsim.util.Driver; + +/** + * This {@link org.lcsim.util.Driver} loads conditions onto an HPS detector. + * @author Jeremy McCormick <[log in to unmask]> + */ +public class ConditionsDriver extends Driver { + + /** + * This method updates a new detector with SVT and ECal conditions data. + */ + public void detectorChanged(Detector detector) { + loadSvtConditions(detector); + loadEcalConditions(detector); + } + + /** + * Load the SVT conditions onto the Detector. + * @param detector The detector to update. + */ + private void loadSvtConditions(Detector detector) { + ConditionsManager manager = ConditionsManager.defaultInstance(); + SvtConditions conditions = manager.getCachedConditions(SvtConditions.class, null).getCachedData(); + SvtConditionsLoader loader = new SvtConditionsLoader(); + loader.load(detector, conditions); + } + + /** + * Load the ECal conditions onto the Detector. + * @param detector The detector to update. + */ + private void loadEcalConditions(Detector detector) { + ConditionsManager manager = ConditionsManager.defaultInstance(); + EcalConditions conditions = manager.getCachedConditions(EcalConditions.class, null).getCachedData(); + EcalConditionsLoader loader = new EcalConditionsLoader(); + loader.load(detector, conditions); + } +}
Use REPLY-ALL to reply to list
To unsubscribe from the LCD-CVS list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=LCD-CVS&A=1