Compare commits

...

2 commits

Author SHA1 Message Date
Stephan I. Böttcher
f908aa31d7 irenarc-jfett for Svea 2026-02-05 10:31:38 +01:00
Stephan I. Böttcher
2debb5d65a leia: lost+found 2026-02-05 10:31:07 +01:00
6 changed files with 44 additions and 296 deletions

1
.gitignore vendored
View file

@ -20,3 +20,4 @@ mustang_scripts
nm64/nm64 nm64/nm64
ahepam/seth ahepam/seth
leia/ leia/
irena/d3direna/

View file

@ -76,6 +76,8 @@ ProductId-NMAHEPAM = 0x0c
SerialNo-NMAHEPAM = 14 SerialNo-NMAHEPAM = 14
ProductId-SETH = 0x0c ProductId-SETH = 0x0c
SerialNo-SETH = 15 SerialNo-SETH = 15
ProductId-LEIA = 0x0c
SerialNo-LEIA = 16
#sirena: #sirena:
ProductId-Torsten = 0x04 ProductId-Torsten = 0x04

2
flash_LEIA/SN16.RC Normal file
View file

@ -0,0 +1,2 @@
@v bate_hash = 0x29ef
pres/read/verify

View file

@ -467,7 +467,7 @@ function AHBGO_B() {
isMUONf="isAHBGOmuonB" isMUONf="isAHBGOmuonB"
} }
function jFETT() { function jFETTOLD() {
NC=9 NC=9
O1 = 1; thr[O1] = 45; ch[0] = O1; name[0]="O1" O1 = 1; thr[O1] = 45; ch[0] = O1; name[0]="O1"
O2 = 2; thr[O2] = 45; ch[1] = O2; name[1]="O2" O2 = 2; thr[O2] = 45; ch[1] = O2; name[1]="O2"
@ -492,6 +492,31 @@ function jFETT() {
PP[-1][3] = 0 PP[-1][3] = 0
} }
function jFETT() {
NC=9
O1 = 0; thr[O1] = 45; ch[0] = O1; name[0]="O1"
O2 = 3; thr[O2] = 45; ch[1] = O2; name[1]="O2"
O3 = 5; thr[O3] = 45; ch[2] = O3; name[2]="O3"
B1 = 6; thr[B1] = 45; ch[3] = B1; name[3]="B1"
B2 = 9; thr[B2] = 30; ch[4] = B2; name[4]="B2"
B3 = 11; thr[B3] = 30; ch[5] = B3; name[5]="B3"
N1 = 12; thr[N1] = 30; ch[6] = N1; name[6]="N1"
N2 = 15; thr[N2] = 30; ch[7] = N2; name[7]="N2"
N3 = 17; thr[N3] = 25; ch[8] = N3; name[8]="N3"
BB[O3][0] = -0.0212738 # ± 1.042e-05
BB[O3][1] = 0
BB[O3][2] = 25.3283 # ± 0.07168
BB[O3][3] = 0
BB[-1][0] = -0.0212738 # ± 1.042e-05
BB[-1][1] = 0
BB[-1][2] = 25.3283 # ± 0.07168
BB[-1][3] = 0
PP[-1][0] = -0.0353472 # +/- 5.721e-06
PP[-1][1] = 35.2581 # +/- 0.01238
PP[-1][2] = 0
PP[-1][3] = 0
}
function SOPA() { function SOPA() {
NC=9 NC=9
P1 = 1; thr[P1] = 45; ch[0] = P1; name[0]="P1" P1 = 1; thr[P1] = 45; ch[0] = P1; name[0]="P1"
@ -713,6 +738,10 @@ function ismuonMM() {
function isPHA(i) { function isPHA(i) {
if (!/^EI/) return 0; if (!/^EI/) return 0;
A = $(3*i+6)/mV A = $(3*i+6)/mV
if (A>10)
P = $(3*i+8)/mV/A
else
P = 0
if ($(3*i+7)<2) return 1; if ($(3*i+7)<2) return 1;
return 2 return 2
} }

View file

@ -43,296 +43,6 @@ def shaper2u2(nch=18, ntr=6, **kk):
pulse(range(nch), pulse2u2, **kk) pulse(range(nch), pulse2u2, **kk)
readconfig(nch=nch, ntr=ntr) readconfig(nch=nch, ntr=ntr)
def ADAMPROTO():
shaper2u2()
adcmask(0x003f0)
thres(4, 20*mV, 0x002)
thres(7, 20*mV, 0x004)
thres(8, 20*mV, 0x008)
l2trig(0, any=2, read=0x3ffff)
l2trig(1, any=4, read=0x3ffff)
l2trig(2, any=8, read=0x3ffff)
def LGRDM():
global mV
global A1, A2, A3, B1, B2, C1, C2
A1 = 6
A2 = 9
A3 = 13
B1 = 1
B2 = 10
C1 = 5
C2 = 14
mV=14000
adcmask(0x06662)
l2trig(0, any=1, read=0x06662)
for ch in range(18):
thres(ch, 12*mV)
for ch in (B1, B2, C1, C2,):
thres(ch, 3*mV)
for ch in (A2, A3,):
thres(ch, 9*mV)
for ch in (A1,):
thres(ch, 5*mV)
def TAT(thr=100):
global mV
mV=14000
global X1, C1, O1, X2, C2, O2
X1=9
C1=13
O1=5
X2=6
C2=10
O2=2
shaper2u2()
thres(O1, thr*mV, 0x003)
thres(X1, thr*mV, 0x005)
thres(C1, thr*mV, 0x009)
thres(O2, thr*mV, 0x011)
thres(X2, thr*mV, 0x021)
thres(C2, thr*mV, 0x041)
readmask = 0x02664
l2trig(0, any=2, read=readmask)
l2trig(1, any=4, read=readmask)
l2trig(2, any=8, read=readmask)
l2trig(3, any=16, read=readmask)
l2trig(4, any=32, read=readmask)
l2trig(5, any=64, read=readmask)
windows(2,5,8)
readconfig()
def MD3(thr=100):
global mV
global A1L, A1H, A2H, A2L, B1L, B1H, B2H, B2L, C1L, C1H, C2H, C2L
A1L, A1H, A2H, A2L, B1L, B1H, B2H, B2L, C1L, C1H, C2H, C2L = range(12)
mV=14000
shaper2u2(negate=True)
thres( 0, thr*mV, 1)
thres( 1, thr*mV, 1)
thres( 2, thr*mV, 2)
thres( 3, thr*mV, 2)
thres( 4, thr*mV, 4)
thres( 5, thr*mV, 4)
thres( 6, thr*mV, 8)
thres( 7, thr*mV, 8)
thres( 8, thr*mV,16)
thres( 9, thr*mV,16)
thres(10, thr*mV,32)
thres(11, thr*mV,32)
readmask = 0x00fff
l2trig(0, any=1, read=readmask)
l2trig(1, any=2, read=readmask)
l2trig(2, any=4, read=readmask)
l2trig(3, any=8, read=readmask)
l2trig(4, any=16, read=readmask)
l2trig(5, any=32, read=readmask)
windows(2,5,8)
readconfig()
def TANOS_NAMES():
global AH, AL, BH, BL, C1H, C1L, C2H, C2L, HH, HL
global D1, D2, E1, E2, F1, F2, G1, G2
global LG, HG, SG
global mV
global thr, l1
AH = 16
AL = 15
BH = 10
BL = 9
C1H = 4
C1L = 3
C2H = 7
C2L = 6
HH = 13
HL = 12
D1 = 14
D2 = 0
E1 = 1
E2 = 17
F1 = 11
F2 = 5
G1 = 8
G2 = 2
HG = (AH, BH, C1H, C2H, HH)
LG = (AL, BL, C1L, C2L, HL)
SG = (D1, D2, E1, E2, F1, F2, G1, G2)
mV = 14000
thr=[100]*18
l1=[0]*18
thr[AH ] = 8; l1[AH ] = 0x001
thr[AL ] = 5; l1[AL ] = 0x001
thr[BH ] = 5; l1[BH ] = 0x001
thr[BL ] = 5; l1[BL ] = 0x001
thr[C1H] = 5; l1[C1H] = 0x001
thr[C1L] = 5; l1[C1L] = 0x001
thr[C2H] = 6; l1[C2H] = 0x001
thr[C2L] = 5; l1[C2L] = 0x001
thr[HH ] = 8; l1[HH ] = 0x001
thr[HL ] = 5; l1[HL ] = 0x001
thr[D1 ] = 15; l1[D1 ] = 0x001
thr[D2 ] = 20; l1[D2 ] = 0x001
thr[E1 ] = 13; l1[E1 ] = 0x001
thr[E2 ] = 14; l1[E2 ] = 0x001
thr[F1 ] = 10; l1[F1 ] = 0x001
thr[F2 ] = 15; l1[F2 ] = 0x001
thr[G1 ] = 14; l1[G1 ] = 0x001
thr[G2 ] = 18; l1[G2 ] = 0x001
for c in (AH,HH):
l1[c] |= 0x002
for c in (C1H,C2H):
l1[c] |= 0x004
l1[HH] |= 0x008
for c in LG:
l1[c] |= 0x010
for c in HG:
l1[c] |= 0x020
for c in SG:
l1[c] |= 0x040
def TANOS_cold_thr():
TANOS_NAMES()
for c in range(18): cmd("v Z[%d]=%d" % (c, thr[c]*mV))
cmd("sc/exe 'THRES.RC' 0")
for c in range(18): cmd("echo/info 'thr[%d] %%d', Z[%d]/mV" %(c,c))
def Keep_Alive(interval=60.0, cmd=messages):
try:
while True:
cmd()
sys.stderr.write("Pinging every %g seconds, type Ctrl-C to end\r" % interval)
time.sleep(interval)
except KeyboardInterrupt:
pass
def TANOS():
TANOS_NAMES()
shaper2u2()
readmask = 0x3ffff
adcmask(readmask)
windows(2,4,6,8)
for c in range(18):
thres(c, thr[c]*mV, l1[c])
l2trig(0, any=0x001, read=readmask)
l2trig(1, any=0x010, read=readmask)
l2trig(2, any=0x020, read=readmask)
l2trig(3, any=0x040, read=readmask)
l2trig(4, all=0x002, read=readmask)
l2trig(5, any=0x040, none=0x006, read=readmask)
readconfig()
def Gd4():
global mV
mV=14000
readmask=0x6666
adcmask(readmask)
windows(2,3,4,5)
for c in (0,3,4,7,8,11,12,15,16):
thres(c, 100*mV, mask=0)
for i in range(4):
thres(4*i+1, 100*mV, mask=(1<<i)|(1<<(2*i+4)))
thres(4*i+2, 100*mV, mask=(1<<i)|(1<<(2*i+5)))
l2trig(i, any=1<<i, read=readmask)
l2trig(4, all=1, read=0)
l2trig(5, all=2, read=0)
readconfig()
def TRES():
shaper2u2()
global mV, AH, BH, CH, AL, BL, CL
mV=14000
CL, CH, BL, BH, AL, AH = (9,10,12,13,15,16)
readmask=0x1b600
adcmask(readmask)
windows(2,5,7,10)
for c in range(18):
if c not in (AH, BH, CH, AL, BL, CL):
thres(c, 100*mV, mask=0)
thres(AH, 20*mV, 0x11)
thres(AL, 10*mV, 0x21)
thres(BH, 20*mV, 0x12)
thres(BL, 10*mV, 0x22)
thres(CH, 20*mV, 0x14)
thres(CL, 10*mV, 0x24)
l2trig(0, any=1, read=readmask)
l2trig(1, any=2, read=readmask)
l2trig(2, any=4, read=readmask)
l2trig(3, any=0x10, read=readmask)
l2trig(4, any=0x20, read=readmask)
l2trig(5, all=0x3ff, none=0x3ff, read=0)
readconfig()
def RADBC():
shaper2u2()
global mV, A, B, C, D
mV=14000
A, B, C, D = (1,2,13,14)
readmask=0x06006
adcmask(readmask)
windows(2,5,7,10)
for c in range(18):
if c not in (A, B, C, D):
thres(c, 100*mV, mask=0)
thres(A, 25*mV, 0x1)
thres(B, 20*mV, 0x2)
thres(C, 180*mV, 0x4)
thres(D, 20*mV, 0x8)
l2trig(0, any=1, read=readmask)
l2trig(1, any=2, read=readmask)
l2trig(2, any=4, read=readmask)
l2trig(3, any=8, read=readmask)
l2trig(4, all=0x3ff, none=0x3ff, read=0)
l2trig(5, all=0x3ff, none=0x3ff, read=0)
readconfig()
def AHEPAM_CHERENKOV():
shaper2u2()
pulse((16,17), pulse2u2neg)
global mV, BC, B1, B2, B3, H1, H2, H3, H4, PMT, readmask
mV=14000
BC, B1, B2, B3, H1, H2, H3, H4, PMT = (1, 2, 5, 6, 14, 13, 10, 9, 17)
readmask=0x36666
adcmask(readmask)
windows(2,5,7,10)
for c in range(18):
thres(c, 100*mV, mask=0)
thres(BC, 22*mV, 0x001)
thres(B1, 18*mV, 0x002)
thres(B2, 18*mV, 0x002)
thres(B3, 18*mV, 0x002)
thres(H1, 15*mV, 0x014)
thres(H2, 15*mV, 0x024)
thres(H3, 15*mV, 0x044)
thres(H4, 15*mV, 0x084)
thres(PMT, 5*mV, 0x008)
l2trig(0, any=1, read=readmask)
l2trig(1, any=2, read=readmask)
l2trig(2, any=4, read=readmask)
l2trig(3, any=8, read=readmask)
l2trig(4, any=5, read=readmask)
l2trig(5, any=6, read=readmask)
readconfig()
def AHEPAM_MUONS():
AHEPAM_CHERENKOV()
thres(BC, 45*mV, 0x001)
thres(B1, 45*mV, 0x002)
thres(B2, 45*mV, 0x002)
thres(B3, 45*mV, 0x002)
thres(H1, 30*mV, 0x014)
thres(H2, 30*mV, 0x024)
thres(H3, 30*mV, 0x044)
thres(H4, 30*mV, 0x084)
thres(PMT, 200*mV, 0x008)
l2trig(0, any=5, read=readmask)
l2trig(1, any=6, read=readmask)
l2trig(2, any=0x11, read=readmask)
l2trig(3, any=0x41, read=readmask)
l2trig(4, any=0x12, read=readmask)
l2trig(5, any=8, read=readmask)
nsamples(63,0xc)
readconfig()
def execfile(fn): def execfile(fn):
armlib._exec_file(fn, globals()) armlib._exec_file(fn, globals())
@ -352,7 +62,7 @@ def jFETT(threshold=50):
global mV, O1, O2, O3, B1, B2, B3, N1, N2, N3 global mV, O1, O2, O3, B1, B2, B3, N1, N2, N3
mV=14000 mV=14000
O1, O2, O3, B1, B2, B3, N1, N2, N3 = 1, 2, 4, 7, 8, 10, 13, 14, 16 O1, O2, O3, B1, B2, B3, N1, N2, N3 = 1, 2, 4, 7, 8, 10, 13, 14, 16
readmask = 0x16596 readmask = 0x3ffff
adcmask(readmask) adcmask(readmask)
windows(2,3,4,5) windows(2,3,4,5)
for c in range(18): for c in range(18):
@ -386,7 +96,7 @@ def SOPA(threshold=50):
l2trig(5, all=0x3ff, none=0x3ff, read=0) l2trig(5, all=0x3ff, none=0x3ff, read=0)
readconfig() readconfig()
def jfett_pulser(amplitudes=(0.1, 0.2, 0.4, 0.8, 1.6, 3.2), t=600, tsamples=0, fn=None, ns=32): def jfett_pulser(amplitudes=(0.1, 0.2, 0.4, 0.8, 1.6, 3.2), t=15*60, tsamples=0, fn=None, ns=32):
from time import sleep from time import sleep
make_pulser() make_pulser()
pu.cmd("OUTPUT ON") pu.cmd("OUTPUT ON")
@ -394,7 +104,7 @@ def jfett_pulser(amplitudes=(0.1, 0.2, 0.4, 0.8, 1.6, 3.2), t=600, tsamples=0, f
pu.set_highlevel(amp) pu.set_highlevel(amp)
print(pu.set_highlevel(), file=sys.stderr) print(pu.set_highlevel(), file=sys.stderr)
sleep(0.1) sleep(0.1)
cmd("e/i 'agilent pa %.3f'" % amp) cmd(f"e/i 'agilent pa {amp:.3f}'")
if fn: if fn:
Start(fn % amp) Start(fn % amp)
enable() enable()

View file

@ -601,8 +601,12 @@ class leia_stepper:
val &= mask val &= mask
return self.cmd('M', mask & 0xff, val) return self.cmd('M', mask & 0xff, val)
def step(self, stepper=None, n=0, dir=None, def step(self, stepper=None, n=0, dir=None, cont=False,
reset=False, ms=None, dac=None, limit=None, speed=None): reset=False, ms=None, dac=None, limit=None, speed=None):
if cont:
s = self.cmd('s')
if s:
return self.cmd("012"[stepper], dir)
if limit is not None: if limit is not None:
self.limit(limit) self.limit(limit)
if dac is not None: if dac is not None:
@ -625,5 +629,5 @@ class leia_stepper:
n >>= 1 n >>= 1
dir += 16 dir += 16
return self.cmd("012"[stepper], dir, n) return self.cmd("012"[stepper], dir, n)
self.cmd("012"[stepper], dir)
return self.cmd('S', n) return self.cmd('S', n)
self.cmd("012"[stepper], dir)