aboutsummaryrefslogtreecommitdiff
path: root/src/likelihood.h
blob: 111eac92ee288f71f6d8199f4af4ecc9ecee7f71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef LIKELIHOOD_H
#define LIKELIHOOD_H

#include "event.h"
#include <stddef.h> /* for size_t */

/* Maximum number of PE to consider if the PMT was hit. */
#define MAX_PE 100
/* Maximum number of PE to consider if the PMT wasn't hit.
 *
 * Note: This must be less than MAX_PE. */
#define MAX_PE_NO_HIT 10

/* To speed things up we quit calculating the probability of a hit when the
 * ratio between the current probability and the maximum probability is less
 * than 10**(-MIN_RATIO). So if MIN_RATIO is -10, that means that we ignore
 * probabilities which are 10 million times less likely than the most probable
 * value for n. */
#define MIN_RATIO -10

/* Roughly equal to the fraction of light which is reflected at each PMT.
 *
 * Note: The proper thing to do here would be to separately integrate over the
 * track to calculate the amount of reflected light using the data from the
 * PMTR bank. However, this would make the likelihood function almost twice as
 * long, so we just assume a constant fraction of the light is reflected now. */
#define CHARGE_FRACTION 0.3

/* Dark rate of the PMTs (Hz).
 *
 * From pmt_response.dat in SNOMAN. */
#define DARK_RATE 1000.0
/* Single PE transit time spread (ns).
 *
 * From pmt_response.dat in SNOMAN. */
#define PMT_TTS 1.61
/* Event window (ns) */
#define GTVALID 400.0
#define BETA_MIN 0.8

double nll_muon(event *ev, double T0, double *pos, double *dir, double t0, double *z1, double *z2, size_t n, double epsrel, int fast);

#endif