SlicDiagnostics/src/org/lcsim/slic/diagnostics
diff -u -r1.2 -r1.3
--- Runner.java 4 Aug 2005 01:39:50 -0000 1.2
+++ Runner.java 17 Aug 2005 03:44:32 -0000 1.3
@@ -37,7 +37,6 @@
public void addFile(String filename)
{
-// System.out.println("slic.diagnostics.Runner - Added file: " + filename);
this.fileNames.add(filename);
}
@@ -90,7 +89,7 @@
/** Run SlicAnalysisDriver on files from list in fileName. */
private void run(List<String> files) throws Exception
{
- slicDiag.setAidaFileName(files.get(0).toString());
+ slicDiag.setAidaFileName(files.get(0).toString().replace(".slcio",""));
for ( String f : files)
{
SlicDiagnostics/src/org/lcsim/slic/diagnostics
diff -u -r1.6 -r1.7
--- SlicDiagnosticsDriver.java 1 Aug 2005 06:34:51 -0000 1.6
+++ SlicDiagnosticsDriver.java 17 Aug 2005 03:44:32 -0000 1.7
@@ -30,6 +30,8 @@
private String fileName = null;
private String defaultFileName = "slicDiagnostics";
+ int evtCnt = 0;
+
public SlicDiagnosticsDriver()
{
super();
@@ -45,10 +47,10 @@
add(new EventSummaryPlotsDriver() );
}
- /** Call child drivers. */
protected void process(EventHeader event)
{
super.process(event);
+ ++evtCnt;
}
protected void startOfData()
@@ -57,17 +59,24 @@
setFilename();
}
- /** Set the filename to argument basename with ".slcio" replaced by ".aida". */
+ protected void endOfData()
+ {
+ super.endOfData();
+ savePlots();
+ message("Processed " + "<" + evtCnt + "> events.");
+ evtCnt = 0;
+ }
+
+ /** Set the filename to argument basename. */
public void setAidaFileName(String path)
{
- fileName = (new File(path)).getName().replace(".slcio",".aida");
+ fileName = (new File(path)).getName() + ".aida";
}
private void setFilename()
{
if ( fileName == null )
{
- /* try setting output filename from JAS app*/
if ( Application.getApplication() != null)
{
SequentialRecordLoop loop = (SequentialRecordLoop) ((Studio) Application.getApplication()).getLookup().lookup(SequentialRecordLoop.class);
@@ -77,7 +86,14 @@
SequentialRecordSource source = loop.getRecordSource();
if ( source != null )
{
- setAidaFileName( source.getSourceName() );
+ String s = source.getSourceName();
+ int slashPos = s.lastIndexOf("/");
+ if (slashPos != -1)
+ {
+ s = s.substring(slashPos);
+ }
+
+ setAidaFileName(s);
}
}
}
@@ -90,18 +106,13 @@
}
}
- protected void endOfData()
- {
- super.endOfData();
- savePlots();
- }
-
private void savePlots()
{
- if ( Application.getApplication() == null)
+ if ( Application.getApplication() == null )
{
try
{
+ message("Saving AIDA file <" + fileName + ">.");
aida.saveAs(fileName);
}
catch (Exception e)
@@ -110,4 +121,9 @@
}
}
}
+
+ private void message(String m)
+ {
+ System.out.println("SlicDiagnosticsDriver - " + m);
+ }
}
\ No newline at end of file