Skip to content
zihlmann edited this page Feb 16, 2022 · 12 revisions

Welcome to the halld_recon wiki!

Basics

halld_recon is a software package based on JANA and written in C++. It contains a collection of libraries that allow the reconstruction of charged particle tracks and neutral particle showers based on either real data provided by the HallD DAQ system in EVIO format, or from Monte Carlo simulations in hddm format. The two main executables are hd_ana and hd_root.

Libraries and plugins

The code is organized into libraries and plugins. The libraries contain the core reconstruction code and are statically linked into most of the halld_recon executables (e.g. hd_root). Each major detector system has its own library, but there are also libraries dedicated to TRACKING, PID, etc... Plugins are pieces of code that tend to be the consumers of the reconstructed data objects. These are primarily used for creating histograms and trees. When running a halld_recon executable, plugins are requested by the user on the command line.

Factories and Processors

Roughly speaking, the Libraries contain mainly factory classes while the Plugins contain mainly processor classes. The best way to think of it is factories do the heavy calculations needed to fully reconstruct the data while processors use the reconstructed data to fill histograms or trees in ROOT files.

Factories

Examples of Factories can be found in src/libraries/ where the code is organized by its main task. For example, handling the data from the forward calorimeter FCAL. A skeleton of a Factory class is created with the script mkfactory_plugin. It will create a header file ".h" and a ".cc" program file. The new Factory class needs to be added to the initialization file AAAA_init.cc where AAAA represents the library name. Each library's source directory has its own AAAA_init.cc file in it.

Plugins

Examples of plugins can be found for example in src/plugins/. A plugin can be created and used anywhere in your file system and does not need to be located inside the halld_recon hierarchy files structure. The skeleton of a regular plugin is created with the script mkplugin. It will also create a header file ".h" and a ".cc" program file as well as the necessary SConstruct file to be used with scons to compile and link the code. Such a plugin is "stand alone" meaning in order to be used it has to be specified on the command line by the user when executing programs like hd_root or hd_anal with the command line parameter -PPLUGINS=ZZZZZ where ZZZZZ is the name of the plugin.

n.b. the stand-alone SConstruct file created will try and install the plugin in the directory $HALLD_RECON_HOME directory unless you define the $HALLD_MY environment variable. If $HALLD_MY is not set and you do not have permission to write to the $HALLD_RECON_HOME directory, then you will get errors at the end of the build

Particle Reconstruction

Particle reconstruction based on raw detector data is performed in several steps for each triggered event. Results from these reconstructions are referred to as "higher level objects" because in addition to the raw detector data information from the detector geometry itself is needed as well as detector calibration parameters and physics concepts of the underlying interaction of the particle with the matter of the detectors.

In a first step particle tracks are reconstructed based on data from the CDC and the FDC, particle showers are reconstructed based on data from the BCAL and FCAL respectively and timing data points are reconstructed from TOF data and StartCounter data. The latter requires information from tracking results.

In a second step the reconstructed charged tracks are matched to showers in the calorimeters resulting in a list of showers that can not be associated with charged tracks and as such are referred to as "neutral showers" caused by photons or neutrons most likely. The code for this second step can be found in the PID library.

Tracking

Shower Reconstruction

BCAL shower reconstruction

FCAL shower reconstruction