Commit in lcsim/src/org/lcsim/contrib/uiowa/standalone on MAIN
MainLoop.java+71added 1.1
clean.sh+7added 1.1
compile.sh+7added 1.1
init.sh+10added 1.1
run.sh+28added 1.1
subcompile.sh+28added 1.1
+151
6 added files
Set of scripts to compile and run org.lcsim standalone on a UNIX system

lcsim/src/org/lcsim/contrib/uiowa/standalone
MainLoop.java added at 1.1
diff -N MainLoop.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ MainLoop.java	29 Sep 2005 21:06:29 -0000	1.1
@@ -0,0 +1,71 @@
+// Based on the class written by Jan Strube, adapted by Mat Charles.
+
+package standalone;
+
+import java.io.File;
+import org.lcsim.mc.fast.MCFast;
+import org.lcsim.util.Driver;
+import org.lcsim.util.aida.AIDA;
+import org.lcsim.util.loop.LCIODriver;
+import org.lcsim.util.loop.LCSimLoop;
+
+public class MainLoop extends Driver
+{
+   public MainLoop()
+   {
+   }
+   public static void main(String[] args) throws Exception
+   {
+       if (args.length<3 || args[0].equals("h")) {
+	   //usage();
+	   System.exit(1);
+       } else {
+	   // First arg: Number of events to analyze
+            long numToProcess = Integer.parseInt(args[0]);
+            // Second arg: name of Driver to run
+	    Driver myDriver = MainLoop.makeDriverFromString(args[1]);
+	    LCSimLoop loop = new LCSimLoop();
+	    loop.add(myDriver);
+	    // Third and subsequent args: names of SIO files to analyze
+            for (int i=2; i<args.length; i++) {
+		String filename = args[i];
+		File input = new File(filename);
+		loop.setLCIORecordSource(input);
+		loop.loop(-1);
+	    }
+	    loop.dispose();
+	    //AIDA.defaultInstance().saveAs("exampleAnalysisJava.aida");
+       }
+   }
+
+    public static Driver makeDriverFromString(String name)
+    {
+	// We're given the (string) name of a driver class.
+        // First, make a Class object for that class.
+        // If the named class doesn't exist, this will throw
+        // a ClassNotFoundException:
+	Class newClassObject = null;
+	try {
+	    newClassObject = Class.forName(name);
+	} catch (java.lang.ClassNotFoundException x) {
+	    throw new AssertionError(x);
+	}
+	
+        // Next, create an instance of the class:
+        // This can throw InstantiationException, IllegalAccessException
+	Object newObject = null;
+	try {
+	    newObject = newClassObject.newInstance();
+	} catch (java.lang.InstantiationException x) {
+	    throw new AssertionError(x);
+	} catch (java.lang.IllegalAccessException x ) {
+	    throw new AssertionError(x);
+	}
+
+        // This better be a driver. Cast it:
+        Driver newDriver = (Driver) newObject;
+
+        // OK. Now return it.
+	return newDriver;
+    }
+}

lcsim/src/org/lcsim/contrib/uiowa/standalone
clean.sh added at 1.1
diff -N clean.sh
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ clean.sh	29 Sep 2005 21:06:29 -0000	1.1
@@ -0,0 +1,7 @@
+#! /bin/sh
+
+for iDir in mipfinder  mst  standalone  structural util ; { 
+  for i in $(find $iDir/ -name "*.class") ; {
+     rm $i ;
+  }
+}

lcsim/src/org/lcsim/contrib/uiowa/standalone
compile.sh added at 1.1
diff -N compile.sh
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ compile.sh	29 Sep 2005 21:06:29 -0000	1.1
@@ -0,0 +1,7 @@
+#! /bin/sh
+
+for iDir in  mipfinder  mst  standalone  structural util ; {
+  for i in $(find $iDir/ -name "*.java") ; {
+     ./standalone/subcompile.sh $i || { echo "failed on $i"; exit; } ;
+  }
+}

lcsim/src/org/lcsim/contrib/uiowa/standalone
init.sh added at 1.1
diff -N init.sh
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ init.sh	29 Sep 2005 21:06:29 -0000	1.1
@@ -0,0 +1,10 @@
+#! /bin/sh
+
+SOURCEDIR_JAS3=/afs/slac.stanford.edu/package/jas/release/jas3/jas3-0.8.2
+SOURCEDIR_HOME=$HOME/.JAS3
+
+rm -f .jarlist
+touch .jarlist
+find $SOURCEDIR_JAS3 -name "*.jar" >> .jarlist
+find $SOURCEDIR_HOME -name "*.jar" >> .jarlist
+

lcsim/src/org/lcsim/contrib/uiowa/standalone
run.sh added at 1.1
diff -N run.sh
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ run.sh	29 Sep 2005 21:06:29 -0000	1.1
@@ -0,0 +1,28 @@
+#! /bin/sh
+
+export CLASSPATH=.
+for f in $(cat .jarlist)  ; { export CLASSPATH="$CLASSPATH:$f"; }
+
+#SOURCEDIR=$(cat .sourcedir)
+if [ x$SOURCE = x ]; then
+  SOURCE="/nfs/slac/g/lcd/public_data/ILC/ZPole/sidaug05_np/slcio/slic/pythiaZPoleuds-0-1000_SLIC_v1r9p4_sidaug05_np.slcio"
+  echo "SOURCE not defined -- defaulting to $SOURCE";
+fi;
+
+# Default:
+
+if [ $# == 1 ]; then
+  NUM=$1
+  CLASSNAME=org.lcsim.mc.fast.MCFast
+elif [ $# == 2 ]; then
+  NUM=$1
+  CLASSNAME=$2
+else
+  echo "Can't handle number of args!"
+  exit;
+fi;
+
+echo "SOURCE is '$SOURCE'"
+
+#/afs/slac/package/java/i386_linux26/jdk1.5/bin/java -classpath $CLASSPATH testing.UnitTest
+/afs/slac/package/java/i386_linux26/jdk1.5/bin/java -classpath $CLASSPATH standalone.MainLoop $NUM $CLASSNAME $SOURCE

lcsim/src/org/lcsim/contrib/uiowa/standalone
subcompile.sh added at 1.1
diff -N subcompile.sh
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ subcompile.sh	29 Sep 2005 21:06:29 -0000	1.1
@@ -0,0 +1,28 @@
+#! /bin/sh
+
+export JAS3ROOT=/afs/slac.stanford.edu/package/jas/release/jas3/jas3-0.8.2
+export JAS3EXT=$HOME/.JAS3/extensions
+export EXTDIRS="$JAS3ROOT/lib:$JAS3ROOT/extensions:$HOME/.JAS3/extensions:$HOME/.JAS3/classes"
+
+export CLASSPATH=.
+export CLASSPATH="$CLASSPATH:$EXTDIRS"
+
+for f in $(cat .jarlist)  ; { export CLASSPATH="$CLASSPATH:$f"; }
+
+CURRENTSOURCE=$1
+CURRENTTARGET=$(dirname $CURRENTSOURCE)/$(basename $CURRENTSOURCE .java).class
+
+echo -n "Checking $CURRENTSOURCE... "
+
+if [ -e $CURRENTTARGET ] ; then
+  if [ $CURRENTTARGET -nt $CURRENTSOURCE ] ; then
+    echo "$CURRENTTARGET is up-to-date."
+    exit 0
+  fi
+fi
+
+echo -n " Compiling... "
+#/afs/slac/package/java/i386_linux26/jdk1.5/bin/javac  -Xlint:unchecked -g -classpath $CLASSPATH $CURRENTSOURCE || exit 1
+/afs/slac/package/java/i386_linux26/jdk1.5/bin/javac -g -classpath $CLASSPATH $CURRENTSOURCE || exit 1
+echo "OK"
+exit 0
CVSspam 0.2.8