const.py 1.92 KB
Newer Older
1
2
3
4
5
6
7
"""
const.py
Connor Hainje (connor.hainje@pnnl.gov)

Defines various constants that are useful for the PID studies.
"""

8
9
import numpy as np

10
PARTICLES = ["e", "mu", "pi", "K", "p", "d"]
11
"""The abbreviations of the six primary particle hypotheses"""
12
13

PDG_CODES = [11, 13, 211, 321, 2212, 1000010020]
14
"""The PDG codes associated with the six primary particle hypotheses"""
15

16
PDG_TO_PART = dict(zip(PDG_CODES, PARTICLES))
17
"""A map from PDG code to particle abbreviation"""
18

19
PART_TO_PDG = dict(zip(PARTICLES, PDG_CODES))
20
"""A map from particle abbreviation to PDG code"""
21
22

PART_TO_LABEL = dict(zip(PARTICLES, range(len(PARTICLES))))
23
"""A map from particle abbreviation to learning label"""
24
25

PDG_TO_LABEL = dict(zip(PDG_CODES, range(len(PDG_CODES))))
26
"""A map from PDG code to learning label"""
27

28
PART_PLOT_LABELS = [r"$e$", r"$\mu$", r"$\pi$", r"$K$", r"$p$", r"$d$"]
29
"""LaTeX-compatible labels for the six primary particle hypotheses"""
30

31
32
33
34
35
36
37
38
LOGL_PLOT_LABELS = [
    r"$\log \mathcal{L}_e$",
    r"$\log \mathcal{L}_\mu$",
    r"$\log \mathcal{L}_\pi$",
    r"$\log \mathcal{L}_K$",
    r"$\log \mathcal{L}_p$",
    r"$\log \mathcal{L}_d$",
]
39
"""LaTeX-compatible labels for the six hypothesis likelihoods"""
40
41

N_PARTICLES = len(PARTICLES)
42
"""Number of particles"""
43

44
DETECTORS = ["SVD", "CDC", "TOP", "ARICH", "ECL", "KLM"]
45
"""The names of the six PID detectors"""
46
47

N_DETECTORS = len(DETECTORS)
48
"""Number of detectors"""
49

50
P_CUTOFFS = [0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4.5]
51
"""Standard momentum bin cutoffs (GeV)"""
52
53

THETA_CUTOFFS_DEG = np.flip(np.array([150, 133, 115, 96, 77, 60, 40, 28, 17]))
54
55
56
"""Standard theta bin cutoffs (degrees)"""

THETA_CUTOFFS = np.radians(THETA_CUTOFFS_DEG)
57
"""Standard theta bin cutoffs (radians)"""
58

59
60
61
62

def _make_ranges(cutoffs):
    return [(cutoffs[i], cutoffs[i + 1]) for i in range(len(cutoffs) - 1)]

63
64

P_RANGES = _make_ranges(P_CUTOFFS)
65
"""Standard momentum bin ranges"""
66
67

THETA_RANGES = _make_ranges(THETA_CUTOFFS)
68
"""Standard theta bin ranges"""