NAME

    gtdrm - Write the energy dispersion matrix

USAGE

    gtdrm cmap outfile irfs evtype expcube bexpmap

DESCRIPTION

    The detector response matrix (DRM) maps the true counts spectrum to the
    measured counts spectrum. It is computed by taking the integrals of the
    energy dispersion across each measured energy bin assuming the true energy
    is the geometric mean of each bin. This is a approximation, the exact
    computation would require the convolution integral of product of the
    spectrum with the effective area and the energy dispersion.

    The individual elements of the DRM are computed in
    Drm::matrix_element(double etrue, double emeas_min, double emeas_max), which
    computes the fraction of counts with etrue that are observed in the energy
    bin between emeas_min and emeas_max.

    This is evaluated with emeas_min, emeas_max corresponding to each of the
    energy bin edges, and with etrue corresponding to the geometric centers of
    the energy bins, and extended to one extra bin on either end of the
    spectrum.

    This means that the Drm is a (n,n+2) matrix, where n is the number of
    measured energy bin (i.e., the number of energy bins in the binned counts
    cube).

PARAMETERS

    cmap [file]
     Source maps (or counts map) file.

    outfile [file]
     Output FITS file name.

    irfs [string]
 	 Instrument response functions. The instrument response (PSF, effective
 	 area, energy resolution) is currently a function of energy,
 	 inclination angle (the angle between the source and the LAT normal)
 	 and photon category. Since the LAT will usually survey the sky, a
 	 source will be observed at different inclination angles. Each count
 	 will therefore be characterized by a different instrument response
 	 function (IRF). The default value is “CALDB”.

    (evtype = INDEF) [integer]
     The event type selection for Pass 8 data. The event type is a subselection
     of the event class. Users can select on range of events based on conversion
     type (front/back), angular reconstruction quality (PSF values), and energy
     reconstruction quality (EDISP values). The default value is INDEF, which
     will not apply a subselection.

    expcube [file]
     FITS file containing live-time as a function of sky position and off-axis
     angle. This file should be generated by gtltcube. See the gtltcube
     documentation for further explanation.

    bexpmap [file]
     Exposure map for binned analysis. The geometry of the map must match
     the geometry of the counts map. Only for binned likelihood analysis.
     Default is "none".

    (chatter = 2) [integer]
     This parameter fixes the output verbosity: no screen output (0), nominal
     screen output (2), maximum verbosity (4). The default value is 2.

    (clobber = yes) [boolean]
     Overwrite or do not overwrite existing output files. This is a hidden
     parameter. The default value is "yes".

    (debug = no) [boolean]
     Activate debugging mode. This is a hidden parameter. The default value is
     "no". When debug is "no", all exceptions that are not caught and handled by
     individual tool-specific code are caught by a top-level exception handler
     that displays information about the exception and then exits. When debug is
     "yes", such exceptions are not caught by the top level code. Instead the
     tool produces a segmentation violation, which is more useful for debugging.
     When debugging mode is enabled, the tool produces more verbose output
     describing any errors or exceptions that are encountered.

    (gui = no) [boolean]
     Graphical user Interface (GUI) mode activated is "yes" is specified. This
     is a hidden parameter. The default value is "no".

    (mode = ql) [string]
     Mode of automatic parameters. This is a hidden parameter. The default
     value is "ql".

EXAMPLES

    Parameters are passed following the FTOOLs model: They could be passed
    answering from a prompt, as a list in a command line, or by editing
    the parameter file.

    To run gtdrm simply type in the command line:

    > gtdrm


    This will prompt for parameter values. Not all parameter are prompted:
    some of them are "hidden". To change one of the "hidden" parameter,
    the user should specify the values in the command line or modify its
    mode by editing the parameter file.

    For example, to prevent overwrite the existing output file, the following
    command line as to be typed:

    > gtdrm clobber=no

    An example of how to run the tool is given below:

    > gtdrm
    Source maps (or counts map) file[] cmap.fits
    Output file[] drm.fits
    Response functions[CALDB] CALDB
    Exposure cube[] expcube.fits
    Binned exposure map[none] bexposure.fits

    That last example could be also run in the command line as follows:

    gtdrm cmap=srcMaps.fits outfile=drm.fits
     irfs=CALDB expcube=expCube.fits bexpmap=bexposure.fits


SEE ALSO

    gtlike
