[Clas12_software] simple bankdef dictionary
Gagik Gavalian
gavalian at jlab.org
Tue May 20 11:05:27 EDT 2014
Hi Dave,
We do have a class like that in the clas-io package. I thought all IO related things should be in that one jar.
We can either migrate your classes, if they have more functionality, or add functionality to the ones we have.
Gagik
On May 20, 2014, at 10:58 AM, David Heddle <david.heddle at cnu.edu> wrote:
> As an alternative to the evio dictionary (which may or may no be present) I built a little library (called BankDictionary in svn--at least for a little while) that creates a dictionary from the bankdef xml files. It works off a jar file of the clas12 xml files. You can make that jar yourself or get it from the clasJlib checkout.
>
> The main program in the BankDictionary class serves as an example of how to use it:
>
> // main program for testing
> public static void main(String arg[]) {
> BankDictionary bd = new BankDictionary(); //create a dictionary
> try {
> bd.buildDictionary(); //build the dictionary
> } catch (IOException e) {
> e.printStackTrace();
> }
>
> //use the dictionary
> DictionaryEntry entry = bd.getEntry(400, 5);
> System.out.println("Tag: " + entry.getTag());
> System.out.println("Bank name: " + entry.getBankName());
> System.out.println("Bank info: " + entry.getBankInfo());
> System.out.println("Num: " + entry.getNum());
> System.out.println("Column name: " + entry.getColumnName());
> System.out.println("Data type: " +entry.getType());
> System.out.println("Column info: " + entry.getColumnInfo());
> }
>
> output:
>
> Tag: 400
> Bank name: BST
> Bank info: Simulated BST Hit Information
> Num: 5
> Column name: lx_avg
> Data type: float64
> Column info: Average local x position
>
> So you build the dictionary and then look up entries by tag and num. The returned DictionaryEntry has getters as shown in the print statements.
>
> I assume the evio dictionary is also made from the bankdef xml's, so consistency should be more or less guaranteed.
>
> cheers,
> dph
> --
> David P. Heddle, Ph.D.
> Associate Professor of Physics
> Christopher Newport University
> Newport News, VA 23606
>
> 757.594.8434 (CNU)
> _______________________________________________
> Clas12_software mailing list
> Clas12_software at jlab.org
> https://mailman.jlab.org/mailman/listinfo/clas12_software
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.jlab.org/pipermail/clas12_software/attachments/20140520/7cad9a5e/attachment-0002.html>
More information about the Clas12_software
mailing list