Provides classes and interfaces that parse hit data from a given input source and extract the necessary information from it to allow a judgement of a given set of DOMs under the test parameters.

This package has two principle functions that work towards the goal of testing DOMs. First, it provides a set of base analyses that can be used by anyone to test their DOMs. Second, it provides a framework for creating new hit analysis classes to test some specific behavior of importance to the writer.


HitAnalysis

HitAnalysis is a public abstract class that provides the base functionality and several convenience methods for people wishing to create new domtests. Creating a HitAnalysis class is accompanied by creating a Judgement class. (Click here for more.) HitAnalysis also proscribes the methods that any HitAnalysis must implement in order to successfully interact with the domtest framework. The implementation of these methods is extremely critical to the ability of the test to function within the framework, and they should not be left empty except under extreme (and unforeseeable) circumstances.

protected HitAnalysis()
This is a do-nothing constructor that allows HitAnalysis to be extended by implementing classes.
protected HitAnalysis(File descriptionFile) throws JAXBException
This constructor accepts a file telling it where it can expect its XML input. The constructor then parses its input file and extracts the information it needs as a java content-tree. A JAXBException is thrown if the input does not conform to the expected input format, or if another error in XML processing occurs.
protected HitAnalysis(DescriptionType description) throws ValidationExeption, JAXBException
This constructor accepts its XML input in the form of a java content-tree. It attempts to validate its input and then treats it as normal XML-derived content. This is the contructor called by the Master when it attempts to walk over a HitAnalysis. Any hit analysis should implement a constructor with this signature, calling super(description). Failure to do so will cause domtest to crash. A ValidationException is thrown if the input does not conform to the expected input format. Other XML errors cause a JAXBException to be thrown.
protected void writeXMLOutput(HitAnalysisOutputType output) throws JAXBException, IOException
A convenience method for returning the results of a hit analysis in a transparent way.
protected IHistogram1D create1DHistogram(String treeAddress,String title, int numBins, double xBegin, double xEnd)
A convenience method for creating 1-d histograms. This method will likely be used in bookMyHistograms(). The treeAddress String indicates the location in the Tree where the histograms are to be booked. This address String can simply be extracted from the book method.*
protected IHistogram2D create2DHistogram(String treeAddress, String title, int nBinsX, double xBegin, double xEnd, int nBinsY, double yBegin, double yEnd)
A convenience method used to create 2-d histograms. Functions very similarly to create1DHistogram().*
protected ITuple createITuple(String treeAddress, String title, String[] columnNames, Class[] columnTypes)
A convenience method for the creation of ITuples. An ITuple is an AIDA object that encapsulates n-tuple functionality. For a description of the treeAddress String, click here. An ITuple is essentially a table with a number of columns that can be determined by the user.*
public abstract List bookMyHistograms(String treeAddress)
A method that must be implemented by any class extending HitAnalysis. This method is called by the Master when it accesses the analyses encoded in its XML instructions. The code for this method should declare and return any histograms required for use in the analysis process. This method should return a List of triplets in the following form:
  1. String name
  2. IHistogram contentObject
  3. Boolean exported
The name and contentObject are used to identify and access the histogram during the analysis process. The name is used as a key in a Hashtable, so storing the key as a class parameter would be a good idea. The Boolean is used at export time to determine whether the individual histogram will be stored to disk.
public abstract List bookMyNTuples(String treeAddress)
A method that must be implemented by any class extending HitAnalysis. This method is called by the Master when it accesses the analyses encoded in its XML instructions. The code for this method should declare and return any n-tuples required for use in the analysis process. This method should return a List of triplets in the following form:
  1. String name
  2. ITuple contentObject
  3. Boolean exported
The name and contentObject are used to identify and access the n-tuple during the analysis process. The name is used as a key in a Hashtable, so storing the key as a class parameter would be a good idea. The Boolean is used at export time to determine whether the individual n-tuple will be stored to disk.
public abstract List bookMyVariables(String treeAddress)
A method that must be implemented by any class extending HitAnalysis. This method is called by the Master when it accesses the analyses encoded in its XML instructions. The code for this method should declare and return any Variable objects required for use in the analysis process. A Variable is a analysis.hit object that contains all the information needed in an analysis variable. It details error, value and units. For more information, see Variable. This method should return a List of pairs in the following form:
  1. IHistogram contentObject
  2. Boolean exported
The contentObject is used to access the variable during the analysis process. The name is extracted from the Variable object itself, and is used as a key in a Hashtable, so storing the key as a class parameter would be a good idea. The Boolean is used at export time to determine whether the individual variable will be stored to disk.
public abstract IntervalProcessor createIntervalProcessor() throws IOException
An IntervalProcessor is an object used to sort time intervals in a data file into their proper location in the tree. The IntervalProcessor is largely transparent at the analysis level, needing only to be instantiated and returned. For more information, see domtest.IntervalProcessor.
public abstract void createTree() throws NodeException, HierarchyException
This method is called by the Master to instruct the analysis class to build its Tree object. This method should instantiate a TreeFactory object and instruct it to growTree().
public abstract void defineTreeHierarchy()
This is an action that must be taken by a HitAnalysis in order for it to function properly. Although this information could easily be declared at construction, the abstract method is present in order to guarantee that the action takes place. Failure to properly define a tree hierarchy will cause the domtest structure to crash.
public abstract void exportXML() throws JAXBException, IOException
This method is called by the Master at the end of its input cycle to instruct a hit analysis to return its output to the filesystem in XML format. This method should implement some of the convenience methods found in HitAnalysis and TreeFactory, rather than attempting to produce the XML output independently.
public abstract void finishAnalysis() throws JAXBException
This method is called by the Master just prior to instructing the hit analysis to return its results to XML format. This method should parse the Tree and perform any clean-up or finalization that is needed before the information stored in the Tree is sent to judgement.
public abstract void processRecord(Record record) throws HitAnalysisException
This method must accept a Record object, find its proper location in the Tree, and extract any pertinent data into the correct LeafNode before returning. This method should be as efficient as possible, as it will be called literally thousands of times during a given analysis. For more information about Record objects, click here.

Record

A Record is a simple data-storage object that passes a tree address and a DomHitRecord in a single package.


Variable

A variable object is designed to store statistical information or other simple data that need not be reflected in a histogram. Variable objects would generally be exported at the end of the analysis and examined by a Judgement class, while histograms and n-tuples may be discarded when the preliminary analysis is complete.


For more information about the functionality of AIDA data classes, visit the AIDA API documentation at http://aida.freehep.org/doc/v3.2.1/api/index.html.