[Feedback][Tutorial Contents][hep.lcd Home]
![]()
It is sometimes useful to run your analysis program outside of the Java Analysis Studio framework, as a batch job or interactively (the latter is useful for some types of debugging as well as performance analysis).
It is easy to run any of the examples in this tutorial as a standalone Java job. To do so you need to add a main method to the class that extends EventAnalyzer (or Driver). The main method has to:
Note that although histograms can still be defined and filled in a standalone job there is currently no way to view them. This capability will be added to a future version of Java Analysis Studio.
The following example shows how to run the cluster finding as a standalone job:
import hep.analysis.*; import hep.lcd.util.driver.*; import hep.lcd.recon.cluster.simple.*; import hep.lcd.io.jas.*; final public class LCDDriver extends Driver { public LCDDriver() { add(new SimpleClusterBuilder()); add(new ClusterAnalyzer()); } public static void main(String[] argv) { try { Job job = new Job("LCDDriver Job"); // Assume the command line argument is the file to read job.setEventSource(new LCDEventSource(argv[0])); job.addEventAnalyzer(new LCDDriver()); job.go(); } catch (Exception x) { x.printStackTrace(); } } }
To run this routine from the command line make sure your CLASSPATH environment variable points to both the jas.jar file and the lcd.jar file and issue the command:
java LCDDriver <data-file>