Print

Print


Hi,

So I think I have a pretty good solution now for this AIDAFrame mess.  

I've added an implementation of PlotterFactory to the lcsim-aida module which should organize plots better than popping up a bunch of separate panels for each Plotter.  Using it does not require any special calls aside from the standard AIDA API and a bit of extra initialization. 

Have a look at this test in lcsim trunk to see how it works:

trunk/aida/src/test/java/org/lcsim/util/aida/TabbedPlotterFactoryTest.java

You can run it like this:

cd trunk/aida
mvn test -Dtest=TabbedPlotterFactoryTest

BTW, the lcsim-aida module is here:

svn://svn.freehep.org/lcdet/projects/lcsim/trunk/aida

The new factory will automatically make a JFrame for each PlotterFactory you instantiate in your Drivers.  Then each Plotter created through that factory will be given its own tab containing all its regions.  Any plots that you want to see in the same set of tabs should be created from the same PlotterFactory object e.g.

IplotterFactory fac = theAnalysisFactory.createPlotterFactory("Plot Set 1");
IplotterFactory fac2 = theAnalysisFactory.createPlotterFactory("Plot Set 2");
[etc.]

You will also need to explicitly call the method show() on IPlotter to have the plots show up, which is different from how AIDAFrame works.  This is by design.  Plots do not show up because batch mode operation is the default.

There are basically two ways to activate this custom PlotterFactory from your code.

1) A static block in one of your Drivers.

static {
LCSimAnalysisFactory.register();
}

Calling that more than once should have no unintended side effects.

Note that doing it that way will override any setting from...

2) Setting a system property when you run Java.

java -Dhep.aida.IanalysisFactory=org.lcsim.util.aida. LCSimAnalysisFactory [...rest of args...]

Either of these should have the same effect of installing the custom AnalysisFactory that implements this behavior.

One trick you can use if you have a bunch of plots showing and then want to turn all of them off without changing your code is activating AIDA's BatchAnalysisFactory, which will have the effect of plotters not showing any graphics even if the show() method is called.  Basically, it uses a headless implementation of Plotter that will not create any GUI panels.

This can be activated with:

java -Dhep.aida.IanalysisFactory=hep.aida.ref.BatchAnalysisFactory [...rest of args...]

I'll give everyone a couple weeks to convert your own Drivers to using this method of organizing plots, and then I will start deleting usage of AIDAFrame myself.  I'm hoping that the class can be completely terminated by the collaboration meeting, at the latest.  If you have any trouble using the new factory, then please let me know.

BTW, if I end up removing AIDAFrame from your Driver, I'm not planning on reorganizing or rewriting your code to use the new factory.  You will still need to do it yourself.

Does this work for everyone?

--Jeremy

########################################################################
Use REPLY-ALL to reply to list

To unsubscribe from the HPS-SOFTWARE list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=HPS-SOFTWARE&A=1