forked from foxsi/calsoft
-
Notifications
You must be signed in to change notification settings - Fork 0
/
peaks_4am.pro
executable file
·69 lines (53 loc) · 2.76 KB
/
peaks_4am.pro
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
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
PRO PEAKS_4AM, HISTAM=HISTAM
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
npeak=4
peaks=fltarr(npeak+3, 64, 4, 2)
; n-side
for asic=0, 1 do begin
for ch=0, 63 do begin
;xxfe=histfe(*, ch, asic,0)
;yyfe=histfe(*, ch, asic,1)
xxam=histam(*, ch, asic,0)
yyam=histam(*, ch, asic,1)
peaks(*, ch, asic, 1)=[0.0,0.0,17.611,59.54,0.0,0.0,0.0]
peaks(0, ch, asic, 1)=peaks(1, ch, asic, 1)*2-peaks(2, ch, asic, 1)
peaks(npeak , ch, asic, 1)=peaks(npeak-1, ch, asic, 1)*2-peaks(npeak-2, ch, asic, 1)
peaks(npeak+1, ch, asic, 1)=peaks(npeak , ch, asic, 1)*2-peaks(npeak-1, ch, asic, 1)
peaks(npeak+2, ch, asic, 1)=peaks(npeak+1, ch, asic, 1)*2-peaks(npeak , ch, asic, 1)
peaks(1, ch, asic, 0)=0.0
;peaks(2, ch, asic, 0)=find_peak(xxfe,yyfe, 80,150,3, 8)
peaks(2, ch, asic, 0)=find_peak(xxam,yyam, 75,200,4,16)
peaks(3, ch, asic, 0)=find_peak(xxam,yyam,350,500,2,32)
peaks(0, ch, asic, 0)=peaks(1, ch, asic, 0)*2-peaks(2, ch, asic, 0)
peaks(npeak , ch, asic, 0)=peaks(npeak-1, ch, asic, 0)*2-peaks(npeak-2, ch, asic, 0)
peaks(npeak+1, ch, asic, 0)=peaks(npeak , ch, asic, 0)*2-peaks(npeak-1, ch, asic, 0)
peaks(npeak+2, ch, asic, 0)=peaks(npeak+1, ch, asic, 0)*2-peaks(npeak , ch, asic, 0)
endfor
endfor
; p-side
for asic=2, 3 do begin
for ch=0, 63 do begin
;xxfe=histfe(*, ch, asic,0)
;yyfe=histfe(*, ch, asic,1)
xxam=histam(*, ch, asic,0)
yyam=histam(*, ch, asic,1)
peaks(*, ch, asic, 1)=[0.0,0.0,13.93,17.611,20.9,59.54,0.0]
peaks(0, ch, asic, 1)=peaks(1, ch, asic, 1)*2-peaks(2, ch, asic, 1)
peaks(npeak+2, ch, asic, 1)=peaks(npeak+1, ch, asic, 1)*2-peaks(npeak, ch, asic, 1)
peaks(1, ch, asic, 0)=0.0
;peaks(2, ch, asic, 0)=find_peak(xxfe,yyfe, 40,100,3, 4)
peaks(3, ch, asic, 0)=find_peak(xxam,yyam,170,230,3, 4)
peaks(2, ch, asic, 0)=find_peak(xxam,yyam,100,peaks(3, ch, asic, 0)-30,3, 4)
peaks(4, ch, asic, 0)=find_peak(xxam,yyam,peaks(3, ch, asic, 0)+30,280,2, 8)
peaks(5, ch, asic, 0)=find_peak(xxam,yyam,650,900,2,16)
peaks(0, ch, asic, 0)=peaks(1, ch, asic, 0)*2-peaks(2, ch, asic, 0)
peaks(npeak+2, ch, asic, 0)=peaks(npeak+1, ch, asic, 0)*2-peaks(npeak, ch, asic, 0)
endfor
endfor
save,peaks,file='peaks.sav'
END