How to use your own Driver in LCSim XML

This tutorial will explain how to use a driver that is not in the LCSim main trunk with the XML steering file. It shows how to compile your driver, pack it in a jar file and make it visible in LCSim.


First of all you need a driver. A tutorial on writing a driver for LCSim can be found here.
This driver should be in the src directory of some project directory, i.e. ~/myProject/src/ If your driver is part of a package the path could look like ~/myProject/src/myPackage/


Now you have to compile the driver. The compiled driver should go into the bin directory of your project, i.e. ~/myProject/bin/myPackage/myDriver.class.
Warning, important Before compiling you have to add LCSim to the classpath because your driver will be depending on LCSim.
export CLASSPATH = $CLASSPATH:/PathToLCSim/target/lcsim-*-bin.jar
Now you can compile your driver:
javac -J-Xmx256m -d ~/myProject/bin/ -sourcepath ~/myProject/src/ -classpath $CLASSPATH myPackage/myDriver

Creating a jar archive

LCSim expects your driver to be stored in a jar archive. Go to the directory which holds the compiled code and pack everything.
cd ~/myProject/bin
jar cvf ../myProject.jar ./

Running LCSim with the driver

Before running you have to create a steering XML.
Warning, important Do not forget to add your jar to the list of jars.
<lcsim xmlns:lcsim=""
        <driver name="myDriver" />
        <driver name="myDriver"
                type="myPackage.myDriver" />
Run LCSim:
java -jar /pathToLCSim/target/lcsim-*-bin.jar mySteering.xml
Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r2 - 2010-07-10 - ChristianGrefe
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    CLIC All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2023 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback