Design Overview » History » Version 2
Ole Hansen, 03/05/2018 03:14 PM
h1. Design Overview
17 Nov 2003
The Analyzer makes extensive use of object-oriented techniques, in particular of inheritance and polymorphism. All classes that operate on physics data inherit from a common base class, "@THaAnalysisObject@":http://hallaweb.jlab.org/root/html/THaAnalysisObject.html. Deriving from this base class are three main groups of classes:
* Individual detectors belong to a Detector class hierarchy (base class "@THaDetectorBase@":http://hallaweb.jlab.org/root/html/THaDetectorBase.html).
* Spectrometers (and similar major installations) are abstracted in an Apparatus class hierarchy (base class "@THaApparatus@":http://hallaweb.jlab.org/root/html/THaApparatus.html). Generally, Apparatuses are collections of detectors that are analyzed in a particular way.
* Higher-level physics analysis, such as kinematics calculations, vertex determination, and energy loss corrections, is done in Physics Modules (base class "@THaPhysicsModule@":http://hallaweb.jlab.org/root/html/THaPhysicsModule.html). (Such calculations can also be done in an analysis script, but Physics Modules offer better performance and the ability to define new global variables easily.)
All three types of objects, Apparatuses, Detectors, and Physics Modules, are kept in lists that are processed during replay. In setting up the replay, it is up to the user which objects to place in the lists.
The behavior of existing analysis modules can be modified or extended easily by using class inheritance. In such a case, the only code that needs to be written is the implementation of the new feature. For example, the standard Cherenkov detector class currently only calculates the total sum of ADC amplitudes. For a new type of Cherenkov counter, or to do a more sophisticated analysis of the standard Cherenkov detectors, one might want to calculate separate ADC sums for certain groups of PMTs. To do so, one would write a new class inheriting from the standard Cherenkov class, which could contain as little as one function, performing the additional calculations, and the corresponding data members. New types of detectors and even entire spectrometers, as well as new types of physics calculations, can be added similarly easily, again using class inheritance. No change to and no rebuilding of the core program is necessary to support such new modules.