[Clas12_software] simple bankdef dictionary

David Heddle david.heddle at cnu.edu
Tue May 20 10:58:01 EDT 2014


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)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.jlab.org/pipermail/clas12_software/attachments/20140520/63493437/attachment-0002.html>


More information about the Clas12_software mailing list