1 package org.lcsim.job; 2 3 import java.io.IOException; 4 5 import org.lcsim.util.Driver; 6 import org.lcsim.util.aida.AIDA; 7 8 public class AidaSaveDriver extends Driver { 9 10 String outputFileName = "plots.aida"; 11 boolean verbose = false; 12 13 public AidaSaveDriver() { 14 } 15 16 public void setOutputFileName(String outputFileName) { 17 this.outputFileName = outputFileName; 18 } 19 20 public void setVerbose(boolean verbose) { 21 this.verbose = verbose; 22 } 23 24 public void endOfData() { 25 try { 26 if (verbose) 27 System.out.println("Saving AIDA file to " + outputFileName + " ..."); 28 AIDA.defaultInstance().saveAs(outputFileName); 29 } catch (IOException x) { 30 throw new RuntimeException("Problem saving AIDA file to " + outputFileName + ".", x); 31 } 32 } 33 }