const.py 1.86 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

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$']
32
"""LaTeX-compatible labels for the six hypothesis likelihoods"""
33
34

N_PARTICLES = len(PARTICLES)
35
"""Number of particles"""
36
37

DETECTORS = ['SVD', 'CDC', 'TOP', 'ARICH', 'ECL', 'KLM']
38
"""The names of the six PID detectors"""
39
40

N_DETECTORS = len(DETECTORS)
41
"""Number of detectors"""
42

43
P_CUTOFFS = [0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4.5]
44
"""Standard momentum bin cutoffs (GeV)"""
45
46

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

THETA_CUTOFFS = np.radians(THETA_CUTOFFS_DEG)
50
"""Standard theta bin cutoffs (radians)"""
51
52
53
54

_make_ranges = lambda l: [(l[i], l[i+1]) for i in range(len(l) - 1)]

P_RANGES = _make_ranges(P_CUTOFFS)
55
"""Standard momentum bin ranges"""
56
57

THETA_RANGES = _make_ranges(THETA_CUTOFFS)
58
"""Standard theta bin ranges"""
59
60