# gstlal_inspiral_calc_likelihood, inspiral_lr.py: added feature to print LR component values

There are occasions in which we want to know the values of the LR components; such as investigating reactions. (There is a separate MR (MR 408 that we are working on to upload LR component log files to GraceDB.) The assumption here is that printing out LR component values will be done for single events at a time, instead of running it on multiple coinc files.

This MR adds a feature to print the LR components' values when `--verbose-level "DEBUG"`

is given to `gstlal_inspiral_calc_likelihood`

.
We have chosen to use the `DEBUG`

level since printing the LR components is intended for debugging purposes.
The default for `--verbose-level`

is `"INFO"`

.

The `--verbose`

option is unaffected by this MR.

If one ranking stat file and one trigger data base are given, the file name is `<IFO>-<SVD bin number>-<JOB TYPE>_GSTLAL_LR_COMPONENTS-<gps end time>-1.log`

.
For example, `H1L1V1-0887-noninj_GSTLAL_LR_COMPONENTS-1347742425-1.log`

.
The SVD bin number and job type (noninj or inj) are given in the case there are multiple triggers with the same gps end time.
The gps end time is taken from the coinc inspiral table's gps end time since this would be the event time.
When multiple trigger data bases are given to `gstlal_inspiral_calc_likelihood`

, the file name would be `gstlal_inspiral_calc_likelihood.log`

.

An example of the output when `--verbose-level "DEBUG"`

is given to `gstlal_inspiral_calc_likelihood`

for the MDC 07 retraction event (L1 single) is:

```
LR_components - DEBUG -
If candidate is singles, there is a singles penalties of lnP_singles_penalty = -13.0.
Note that idq terms are subtracted from lnP.
template_id: 1770241
lnP(signal): -3.3412645246100263
lnP(horizon) * 3: 13.009161976664435
lnP(len_temp_ids): 6.902742737158593
lnP(instruments | horizon distances): -1.0234254086747052
lnP(dt, dphi, snr): -5.810106766271239
lnP(population_model): -21.204002573658514
lnP(snr_chisq): 4.784365510171404
lnP(idq): 0.0
dts: {'L1': 0.0}
phases: {'L1': -0.39396942}
snrs: {'L1': 15.15058}
lnP(snr_chisqs): {'L1': 4.784365510171404}
chisqs: {'L1': 1.8425074}
lnP(idqs): {'L1': 0.0}
LR_components - DEBUG -
template_id: 1770241
lnP(noise): -5.440998552148673
lnP(t | noise): 5.781479144256976
lnP(instrument | t, noise): -0.8782320863000754
lnP(snr_chisq): -10.344245610105574
lnP(snr_chisqs): {'L1': -10.344245610105574}
```

The `gstlal_inspiral_calc_likelihood`

of this MR has been tested on a full offline calc_likelihood job, and the time it takes to run the version of `gstlal_inspiral_calc_likelihood`

of this MR and the time it takes to run a version of `gstlal_inspiral_calc_likelihood`

prior to this MR is almost the same (within 0.5 seconds).