Next: Accessing the Children Up: The FARFALLA tree Previous: The FARFALLA tree

Nodes

In FARFALLA, we have several different classes that know about MACRO data. We call these classes eventNode, erpNode, etc. Each of them contain different kinds of data. For example, here are the data members we have for an eventNode:


  short run;                              // Run Number
  short event;                            // Event Number

and here are the data members for an erpNode:



  short boxnum;                 // ERP Box #

  short adc0u;                  // ADC 0 side Unattenuated
  short adc1u;                  // ADC 1 side Unattenuated
  short tdc0h;                  // TDC 0 side high
  short tdc1h;                  // TDC 1 side high
  short adc0a;                  // ADC 0 side attenuated
  short adc1a;                  // ADC 1 side attenuated
  short tdc0l;                  // TDC 0 side low
  short tdc1l;                  // TDC 1 side low

  float energy;                 // ERP Energy
  float time;                   // Time of BOX hit rel. to stop
  float posh;                   // Position in Box from TDC high

However, if we want to place the nodes into a FARFALLA tree, there are certain data members and member functions that every type of node should have. Examples would be the number of children the node has, and a function to return the number of children of a certain type. For this reason, we first created a class called F_Node. The F stands for FARFALLA and is to distinguish this class from other classes which might be called Node in other packages. F_Node contains the common data members and member functions that every node type needs. All the other types of nodes (eventNodes, etc.) inherit from the F_Node class. Therefore, all the functions we have written for managing FARFALLA trees will automatically be available for any new node types you may define.

Each node can have an arbitrarily large number of children. There are several ``types'' of children. There are erpTypes, eventTypes and trackTypes etc.... When an event is read in off of disk in a FARFALLA based program the first thing that is done is to create an eventNode in memory.

Also a pointer to the eventNode in memory is created. We usually call this pointer ev. So if you want to know the run number you can simply refer to:


ev->run;

Now if there were also erp hits in the event the eventNode will have a ``child'' node for each of these erp hits. These children will be erpNodes.

There are also nodes for Wire Tracks and Strip Tracks. So if there were two ERP boxes hit in the event, along with one WireTrack and one Strip Track we might have something that looked like what we saw in figure 1 earlier.



Next: Accessing the Children Up: The FARFALLA tree Previous: The FARFALLA tree


walter@
Wed Aug 10 11:42:05 PDT 1994