The Standard Analyzer
Ole Hansen
Rev 1.1, 09 March 2007
This document refers to version 1.0 or higher of the C++ analyzer.
The "standard analyzer" provides a generic event loop and analysis chain
that will, hopefully, be sufficient for most physics analysis purposes.
The event loop and high-level algorithm are implemented in
the method
THaAnalyzer::Process() of the class
THaAnalyzer.
The standard spectrometer processing algorithm is implemented in
the method
THaSpectrometer::Reconstruct() of
the class THaSpectrometer.
THaAnalyzer::Process( THaRun& run ) carries out the following functions:
- Open the CODA input file associated with the run using
THaRun::Open().
- Open the ROOT output file if not already open. If the file
is already open, but the filename has changed, close the
old file and open a new one.
- If no "Event" object has been set by the user, use
THaEvent by default.
This event contains standard bookkeeping information such as run and event number, event time stamp, beam helicity,
etc.
- Reset()
the Event object.
- Loop over all events in the CODA file.
- Skip events until the a prestart event is found.
Extract the time stamp of the prestart event and call Init( time_stamp ) for every
THaApparatus object defined
in the gHaApps list, every
THaPhysicsModule object defined
in the gHaPhysics list, and every
THaScaler object defined in
the gHaScalers list.
- After initializing the modules (and thus setting up their global variables), load the tests
defined in the definition file
(SetCutFile()).
- After loading the tests, load the output definitions
(THaOutput::Init())
from the output definition file
(SetOdefFile()).
This sets up a TTree in the output file..
- After finding the prestart event and initializing the apparatuses and
scalers, only analyze events in the event range of the run.
Distinguish between physics events and scaler events.
For physics events, do
For scaler events, do
- Close()
the CODA input file.
-
Write() the ROOT output file.
If an apparatus is a
THaSpectrometer,
processing in the Reconstruct() stage is carried out by
THaSpectrometer::Reconstruct() as follows:
- Loop over all
THaTrackingDetectors
and call their CoarseTrack() methods.
- Loop over all
THaNonTrackingDetectors
and call their CoarseProcess() methods.
- Loop over all
THaTrackingDetectors
and call their FineTrack() methods.
- Loop over all
THaNonTrackingDetectors
and call their FineProcess() methods.
- Call TrackCalc(). This method usually calculates
overall track properties such as the absolute momentum and beta
and may also be used to identify the "Golden Track".
- Call FindVertices(). This method usually reconstructs tracks to
the target.
TrackCalc() and FindVertices() have to be implemented by the actual
spectrometer
class (see how to write an apparatus class).
Last modified: Fri Mar 09 11:21:00 EDT 2007
Maintained by Ole Hansen