Design Overview » History » Version 1
Ole Hansen, 03/05/2018 10:01 AM
1 | 1 | Ole Hansen | h1. Design Overview |
---|---|---|---|
2 | |||
3 | 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: |
||
4 | |||
5 | * Individual detectors belong to a Detector class hierarchy (base class "@THaDetectorBase@":http://hallaweb.jlab.org/root/html/THaDetectorBase.html). |
||
6 | * 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. |
||
7 | * 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.) |
||
8 | |||
9 | 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. |
||
10 | |||
11 | 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. |