forked from hyperk/Prob3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path__init__.py
129 lines (96 loc) · 5.91 KB
/
__init__.py
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
import ctypes
import os
dll_name = "libThreeProb.so"
dllabspath = os.path.dirname(os.path.abspath(__file__)) + os.path.sep + dll_name
lib = ctypes.cdll.LoadLibrary(dllabspath)
class BargerPropagator(object):
def __init__(self):
lib.BargerPropagator_new.argtypes = []
lib.BargerPropagator_new.restype = ctypes.c_void_p
lib.BargerPropagator_propagate.argtypes = [ctypes.c_void_p,
ctypes.c_int]
lib.BargerPropagator_propagate.restype = ctypes.c_void_p
lib.BargerPropagator_propagateLinear.argtypes = [ctypes.c_void_p,
ctypes.c_int,
ctypes.c_double,
ctypes.c_double]
lib.BargerPropagator_propagateLinear.restype = ctypes.c_void_p
lib.BargerPropagator_GetVacuumProb.argtypes = [ctypes.c_void_p,
ctypes.c_int,
ctypes.c_int,
ctypes.c_double,
ctypes.c_double]
lib.BargerPropagator_GetVacuumProb.restype = ctypes.c_double
lib.BargerPropagator_DefinePath.argtypes = [ctypes.c_void_p,
ctypes.c_double,
ctypes.c_double,
ctypes.c_bool]
lib.BargerPropagator_DefinePath.restype = ctypes.c_void_p
lib.BargerPropagator_SetMNS.argtypes = [ctypes.c_void_p,
ctypes.c_double, ctypes.c_double, ctypes.c_double,
ctypes.c_double, ctypes.c_double, ctypes.c_double,
ctypes.c_double, ctypes.c_bool, ctypes.c_int]
lib.BargerPropagator_SetMNS.restype = ctypes.c_void_p
lib.BargerPropagator_SetDensityConversion.argtypes = [ctypes.c_void_p,
ctypes.c_double]
lib.BargerPropagator_SetDensityConversion.restype = ctypes.c_void_p
lib.BargerPropagator_GetProb.argtypes = [ctypes.c_void_p,
ctypes.c_int, ctypes.c_int]
lib.BargerPropagator_GetProb.restype = ctypes.c_double
lib.BargerPropagator_GetPathLength.argtypes = [ctypes.c_void_p]
lib.BargerPropagator_GetPathLength.restype = ctypes.c_double
lib.BargerPropagator_SetPathLength.argtypes = [ctypes.c_void_p,
ctypes.c_double]
lib.BargerPropagator_SetPathLength.restype = ctypes.c_void_p
lib.BargerPropagator_SetEnergy.argtypes = [ctypes.c_void_p,
ctypes.c_double]
lib.BargerPropagator_SetEnergy.restype = ctypes.c_void_p
lib.BargerPropagator_SetMatterPathLength.argtypes = [ctypes.c_void_p]
lib.BargerPropagator_SetMatterPathLength.restype = ctypes.c_void_p
lib.BargerPropagator_SetAirPathLength.argtypes = [ctypes.c_void_p,
ctypes.c_double]
lib.BargerPropagator_SetAirPathLength.restype = ctypes.c_void_p
lib.BargerPropagator_UseMassEigenstates.argtypes = [ctypes.c_void_p,
ctypes.c_bool]
lib.BargerPropagator_UseMassEigenstates.restype = ctypes.c_void_p
lib.BargerPropagator_SetWarningSuppression.argtypes = [ctypes.c_void_p,
ctypes.c_bool]
lib.BargerPropagator_SetWarningSuppression.restype = ctypes.c_void_p
lib.BargerPropagator_SetOneMassScaleMode.argtypes = [ctypes.c_void_p,
ctypes.c_bool]
lib.BargerPropagator_SetOneMassScaleMode.restype = ctypes.c_void_p
self.obj = lib.BargerPropagator_new()
def propagate(self, nuFlavor):
lib.BargerPropagator_propagate(self.obj, nuFlavor)
def propagateLinear(self, nuFlavor, pathLength, Density):
return lib.BargerPropagator_propagate(self.obj, nuFlavor, pathLength, Density)
def GetVacuumProb(self, Alpha, Beta, Energy, Path):
return lib.BargerPropagator_GetVacuumProb(self.obj, Alpha, Beta, Energy, Path)
def DefinePath(self, cz, ProdHeight, kSetProfile = True):
lib.BargerPropagator_DefinePath(self.obj, cz, ProdHeight, kSetProfile)
def SetMNS(self, x12, x13, x23,
m21, mAtm, delta,
Energy_, kSquared, kNuType):
lib.BargerPropagator_SetMNS(self.obj, x12, x13, x23,
m21, mAtm, delta,
Energy_, kSquared, kNuType)
def SetDensityConversion(self, x):
return lib.BargerPropagator_SetDensityConversion(self.obj, x)
def GetProb(self, nuIn, nuOut):
return lib.BargerPropagator_GetProb(self.obj, nuIn, nuOut)
def GetPathLength(self):
return lib.BargerPropagator_GetPathLength(self.obj)
def SetPathLength(self, x):
return lib.BargerPropagator_SetPathLength(self.obj, x)
def SetEnergy(self, x):
return lib.BargerPropagator_SetEnergy(self.obj, x)
def SetMatterPathLength(self):
return lib.BargerPropagator_SetMatterPathLength(self.obj)
def SetAirPathLength(self, x):
return lib.BargerPropagator_SetAirPathLength(self.obj, x)
def UseMassEigenstates(self, x):
return lib.BargerPropagator_UseMassEigenstates(self.obj, x)
def SetWarningSuppression(self, x):
return lib.BargerPropagator_SetWarningSuppression(self.obj, x)
def SetOneMassScaleMode(self, x):
return lib.BargerPropagator_SetOneMassScaleMode(self.obj, x)