The basic class defined in the FARFALLA package is the class F_Node. (Note that we use ``F_'' as a prefix for all FARFALLA classes, types, routines and variables declared globally. This is to avoid possible naming conflicts with other packages and class libraries. The ``F'' of course stands for FARFALLA.) F_Node contains all the data necessary for FARFALLA to keep track of the structure of the trees, as well as some member functions that the programmer may use while creating and manipulating FARFALLA trees.
However, the bare F_Node class is useless to the analysis
programmer because it doesn't contain any user data. Therefore, the
programmer will probably never create a simple F_Node; instead, he
or she will extend the F_Node definition by defining new node
types that contain user data; in C++ this is done by defining a new
class which inherits from the base class F_Node. All the
internal variables FARFALLA needs will automatically be present in the
new class. Also, all the member functions the programmer needs to
manipulate the node on a tree will be present.
Section
describes in detail how to define a new
class.
Note that before the F_Node class is extended, FARFALLA knows nothing about MACRO data. It is just a tree-structured memory management package, ready to handle any kind of data. It is when we define classes inherited from F_Node that we customize FARFALLA for the MACRO experiment. When your site receives the original FARFALLA software distribution, all the basic FARFALLA code which knows nothing about MACRO is separated into its own directory. There is also another directory with a few MACRO class definitions, such as:
Programmers may define new classes which inherit from F_Node and are designed for other MACRO raw or reconstructed data (such as QTP or reconstructed beta-slice tracks). It will be easy for programmers to share class definitions and analysis modules with each other.
In the rest of this document, when we use the word ``node'', we are usually referring to any of the extended classes that inherit from F_Node.
There is one more class defined in FARFALLA which programmers need to know about - the F_NodeType class. Every different type of node defined by programmers must have a unique identifier. We have chosen to use four characters to make this identification. For example, for the four predefined MACRO classes mentioned above, the identifiers are ``Evnt'', ``Erp '', ``Wtrk'' and ``Strk''. Any programmer who defines a new node type will make up a new identifier for it. At that time he or she will also define a variable of type F_NodeType to contain the character string. For example, in the erpNode class definition file there is also the declaration of a F_NodeType variable called erpType. You should use this F_NodeType variable rather than the actual four character string to specify the node type to FARFALLA. (You will see examples of this below.)
Any program that uses FARFALLA in any way must include the header file farfalla.h to get the classes defined to the compiler.