Compare commits

...

2 commits

Author SHA1 Message Date
ava
aec9fdb142 CHANGE BigBGO.py 2023-10-24 12:28:49 +02:00
ava
8c7e33b1cf Change BigBGO.py 2023-10-18 09:09:55 +02:00

View file

@ -90,16 +90,15 @@ def main():
l = line.split()
if not 'EOF' in l:
if l[0] == 'H':
T = adc_to_T(l[8])
if l[0] == 'EI':
if not T=='unknown':
if (not args.xray and not args.muon) or(args.xray and isXray(l)) or (args.muon and ismuon(l)):
if not args.trigger or (args.trigger and CmV(l,ch[3]) >= thr[3]):
for i in range(0,len(ch)):
if args.zero:
data[i].append(CmV(l,ch[i])*u[i])*polynom(0,*pol)/polynom(T,*pol)
else:
data[i].append(CmV(l,ch[i])*u[i])
T = adc_to_T(int(l[8]))
if l[0] == 'EI' and not T=='unknown':
if (not args.xray and not args.muon) or(args.xray and isXray(l)) or (args.muon and ismuon(l)):
if not args.trigger or (args.trigger and CmV(l,ch[3]) >= thr[3]):
for i in range(0,len(ch)):
if args.zero:
data[i].append(CmV(l,ch[i])*u[i])*polynom(0,*pol)/polynom(T,*pol)
else:
data[i].append(CmV(l,ch[i])*u[i])
h = do_hist(data)
if args.plot:
for i in range(0,len(ch)):
@ -118,20 +117,19 @@ def main():
if not 'EOF' in l:
if l[0] == 'H':
T = adc_to_T(int(l[8]))
if l[0] == 'EI':
if not T=='unknown':
if not args.trigger or (args.trigger and CmV(l,ch[3]) >= thr[3]):
if not args.muon or (args.muon and ismuon(l)):
if not args.two:
data[0].append(CmV(l,ch[0])*u[0]+CmV(l,ch[1])*u[1]+CmV(l,ch[2])*u[2])
else:
#data[0].append(CmV(l,ch[1])*u[1]+CmV(l,ch[2])*u[2])
data[0].append(CmV(l,ch[0])*u[0]+CmV(l,ch[1])*u[1])
if l[0] == 'EI' and not T=='unknown':
if not args.trigger or (args.trigger and CmV(l,ch[3]) >= thr[3]):
if not args.muon or (args.muon and ismuon(l)):
if not args.two:
data[0].append(CmV(l,ch[0])*u[0]+CmV(l,ch[1])*u[1]+CmV(l,ch[2])*u[2])
else:
data[0].append(CmV(l,ch[1])*u[1]+CmV(l,ch[2])*u[2])
#data[0].append(CmV(l,ch[0])*u[1]+CmV(l,ch[2])*u[1])
data[1].append(CmV(l,ch[5])*u[5]+CmV(l,ch[6])*u[6])
if args.zero:
data[0][-1] = data[0][-1]*polynom(0,*pol)/polynom(T,*pol)
data[1][-1] = data[1][-1]*polynom(0,*pol)/polynom(T,*pol)
data[1].append(CmV(l,ch[5])*u[5]+CmV(l,ch[6])*u[6])
if args.zero:
data[0][-1] = data[0][-1]*polynom(0,*pol)/polynom(T,*pol)
data[1][-1] = data[1][-1]*polynom(0,*pol)/polynom(T,*pol)
h = do_hist_sum(data)
if args.plot:
@ -197,9 +195,19 @@ def ismuon(l):
if not args.two and CmV(l,B1) >= thr[5] and CmV(l,B2) >= thr[6] and \
CmV(l,A1) >= thr[0] and CmV(l,A2) >= thr[1] and CmV(l,A3) >= thr[2]: return True
if args.two and CmV(l,B1) >= thr[5] and CmV(l,B2) >= thr[6] and \
CmV(l,A1) >= thr[0] and CmV(l,A2) >= thr[1]: return True
(CmV(l,A2) >= thr[1] and CmV(l,A3) >= thr[2]): return True
#CmV(l,A1) >= thr[0] and CmV(l,A2) >= thr[1]: return True
else: return False
# def ismuon(l): #single BGO
# if not args.two and ( (CmV(l,B1) >= thr[5] and CmV(l,B2) >= thr[6]) or \
# (CmV(l,A1) >= thr[0] and CmV(l,A2) >= thr[1] and CmV(l,A3) >= thr[2])): return True
# if args.two and ( (CmV(l,B1) >= thr[5] and CmV(l,B2) >= thr[6]) or \
# #(CmV(l,A1) >= thr[0] and CmV(l,A2) >= thr[1])): return True
# (CmV(l,A2) >= thr[1] and CmV(l,A3) >= thr[2])): return True
# else: return False
def polynom(x, a,b,c,d):
return np.multiply(np.multiply(np.multiply(a,x),x),x)+np.multiply(np.multiply(b,x),x)+np.multiply(c,x)+d