Author: [log in to unmask] Date: Mon Dec 1 13:19:29 2014 New Revision: 1605 Log: Flesh out dummy analysis Driver at bit more so it might actually be useful. Modified: java/trunk/analysis/src/main/java/org/hps/analysis/examples/DummyAnalysisDriver.java Modified: java/trunk/analysis/src/main/java/org/hps/analysis/examples/DummyAnalysisDriver.java ============================================================================= --- java/trunk/analysis/src/main/java/org/hps/analysis/examples/DummyAnalysisDriver.java (original) +++ java/trunk/analysis/src/main/java/org/hps/analysis/examples/DummyAnalysisDriver.java Mon Dec 1 13:19:29 2014 @@ -1,15 +1,64 @@ package org.hps.analysis.examples; import org.lcsim.event.EventHeader; +import org.lcsim.geometry.Detector; import org.lcsim.util.Driver; /** - * This is the stupidest possible Driver that could ever be written. + * This is a skeleton that can be used to create a user analysis Driver in LCSim. * @author Jeremy McCormick <[log in to unmask]> */ public class DummyAnalysisDriver extends Driver { + + /** + * This argument does nothing. + */ + int anArgument = 42; + + /** + * Your Driver should have a public constructor. + */ + public DummyAnalysisDriver() { + getLogger().info("Hello DummyAnalysisDriver!"); + } + + /** + * This is an example set method which can be accessed through LCSim steering file arguments. + * @param anArgument + */ + public void setAnArgument(int anArgument) { + this.anArgument = anArgument; + getLogger().info("anArgument was set to " + anArgument); + } + + /** + * Process a single event. + * Your analysis code should go in here. + * @param event The LCSim event to process. + */ public void process(EventHeader event) { - System.out.println("Hello from the DummyAnalysisDriver! This is event #" + event + " in run # " + event.getRunNumber() + "."); + getLogger().info("This is event #" + event.getEventNumber() + " in run # " + event.getRunNumber() + "."); } - -} + + /** + * Initialization code should go here that doesn't need the conditions system or Detector. + */ + public void startOfData() { + getLogger().info("start of data"); + } + + /** + * Driver setup should go here that needs information from the conditions system or Detector. + * @param detector The LCSim Detector object. + */ + public void detectorChanged(Detector detector) { + getLogger().info("detector changed"); + } + + /** + * End of job calculations or cleanup should go here. + */ + public void endOfData() { + getLogger().info("end of data...goodbye!"); + } +}