CCalibratedFileDrivenParameterMapper

Name

CCalibratedFileDrivenParameterMapper -- Unpack DDAS data to raw and calibrated params

Synopsis


#include <CCalibratedFileDrivenParameterMapper.h>

class CCalibratedFileDrivenParameterMapper : public DAQ::DDAS::CParameterMapper
{
    CCalibratedFileDrivenParameterMapper(const char* filename);
    
    
    virtual void mapToParameters(
        const std::vector<DAQ::DDAS::DDASHit>& hits, CEvent& rEvent
    );    
};
            

DESCRIPTION

Provices a parameter mapper for DDAS unpacking. The mapper produces both a raw energy parameter and a calibrated energy for each hit. The mapping is defined by an external configuration file whose path is provided by the filename parameter at construction time.

The configuration file is a text file. Each line can consist of one of the following:

Hit map description lines contain, in order, the following whitespace separated fields:

Hit channel definition

These are three unsigned integer fields that, in order, provide the crate, slot and device channel ids of a DDAS input channel

Resolution

This is an unsigned integer that provides the number of bits of resolution the hit's energy has (usually 16).

Raw Parameter name

This is the name of the parameter into which the raw energy from the pulse processing firmware will be unpacked. If necessary, the code will create a new tree parameter with this name.

Calibration coefficients.

These are three fields. In order these are the constant, the linear, and the quadratic coefficients.

Each field is either a constant double precision floating point number of the name of the treevariable that will hold the coefficient at run time. Note that if needed a tree variable will be created. The variables created are unitless.

Calibrated parameter description

The next five fields describe the calibrated parameter. The first three fields are numeric and are, in order, the low and high limits anticipated for the parameter values and the recommended binning.

The next field is textual and is the parameter's unit of measure (e.g. MeV). If the parameter is unitless you can use the string "".

Finally, the last field is textual and is the name assigned to the calibrated parameter. This name and the previouisl four fields are used to construct a new tree parameter.

EXAMPLE


#
#   Calibrated parameter map file
#

# locn     raw name            const coeff     linear    qua lo hi bins units calibname
0 2 0 crate0.slot2.raw.chan0 c0.s2.ch0.const c0.s2.ch0.lin 0 0 100 100 MeV crate0.slot2
0 2 0 crate0.slot2.raw.chan0 c0.s2.ch0.const c0.s2.ch0.lin c0.s2.ch0.q 0 100 100 MeV crate0.slot2.cal.chan0