fort/file 20 kdev51.ps meta 20 -111 ve/cre ibur(12) ve/cre irun(12) ve/cre ispi(12) ve/cre ispf(12) ve/cre inoi(12) ve/cre n100(12) ve/cre irms(12) ve/cre irms1(12) ve/cre icc(1) ve/cre cont2(231,500) ve/cre ccont2(231,500) ve/cre cont3(231,50) ve/cre ccont3(231,50) ve/cre kstore(500000) i ve/cre hstore(500000) r ve/cre scal(1) ve/cre imx5(1) ve/cre imn5(1) ve/cre vhskew(1) ve/cre vhkur(1) ve/cre ifreq(1) ve/cre vhskew1(1) ve/cre vhkur1(1) ve/cre vfrms(1) ve/cre vcrem(1) do k =1,8 vec/inp icc [k] application comis quit c234567 subroutine spillstat4 common/pawc/hmemor(1000000) dimension cont(8000),aamp(2000),ccont(1000) c dimension cont2(231,50),ccont2(231,50) dimension rs(2000),nhsta(1) character*6 aa character*60 sfile c double precision smean5,rms5,rms52 vector ibur,irun,ispi,inoi,ispf,n100,irms,irms1 vector icc,scal,imx5,imn5,vhskew,vhkur,ifreq vector vhskew1,vhkur1,vfrms,vcrem vector cont2 vector ccont2 vector cont3 vector ccont3 vector kstore,hstore c call hlimit(2000000) call hbook1(30110,' spill 5ms ',1000,1000.,6000.,0.) ! full range call hbook1(31110,' hits for spill 5ms ',1000,1000.,6000.,0.) ! full range call hminim(30110,1.0) call hminim(31110,1.0) call hbook1(32110,' hits / spill 5ms ',1000,1000.,6000.,0.) ! full range call hbook1(33110,' spill / hits 5ms ',1000,1000.,6000.,0.) ! full range call hbook1(110,' spill 5ms ',1000,1000.,6000.,0.) ! full range call hbook1(1110,' hits forspill 5ms ',1000,1000.,6000.,0.) ! full range call hmaxim(110,1000.) call hmaxim(33110,2.5) call hbook1(101,' spill 1ms ',4000,1500.,5500.,0.) call hbook1(102,' spill 5ms ',800,1500.,5500.,0.) call hbook1(103,' spill 25ms ',160,1500.,5500.,0.) call hbook1(104,' spill .5 ms ',1000,1500.,2000.,0.) call hbook1(200,' mean 1 ms ',50,50.,150.,0.) call hbook1(201,' sd/sqrt(mean) 1 ms ',60,1.,4.,0.) call hbook1(202,' skewness 1 ms ',50,-1.,1.,0.) call hbook1(203,' kurtosis 1 ms ',40,1.,5.,0.) call hbook1(204,' lf noise ',25,0.,0.5,0.) call hbook1(205,' 100 Hz noise ',25,0.,0.25,0.) call hbook1(206,' total noise ',30,0.,0.6,0.) call hbook1(207,' high spill % ',25,0.,25.,0.) call hbook1(307,' high folded spill % ',50,0.,50.,0.) call hbook2(301,' sd/sqrt(mean) vs skewness ', 1 60,1.,4.,50,-1.,1.,0.) call hbook2(302,' sd/sqrt(mean) vs kurtosis ', 1 60,1.,4.,40,1.,5.,0.) call hbook2(303,' skewness vs kurtosis ', 1 50,-1.,1.,40,1.,5.,0.) call hbook2(304,' sd/sqrt(mean) vs lf noise ', 1 60,1.,4.,25,0.,0.5,0.) call hbook2(305,' sd/sqrt(mean) vs 100 Hz', 1 60,1.,4.,25,0.,0.25,0.) call hbook2(306,' sd/sqrt(mean) vs total noise', 1 60,1.,4.,30,0.,0.6,0.) call hbook1(800,' spill - folded ',231,0.,924.,0.) ! for sps time det call hbook1(8000,' freq ',250,0.,250.,0.) call hbook1(9000,' RMS ',50,0.,1000.,0.) call hbook1(9100,' First Difference 1 ms ',50,-100.,150.,0.) call hbook1(9200,' correlelogram',2000,0.,1000.,0.) call hbook2(10000,' corrected folded spill, spill ', 1 231,0.,924.,500,1100.,6100.,0.) call hbook1(11000,' Corrected folded time', 1 231,0.,924.,0.) call hbook1(12000,' Uncorrected folded time', 1 231,0.,924.,0.) call hbook1(12100,' first diff.Uncorrected folded time', 1 231,0.,924.,0.) call hbook1(12300,' 2ndt diff.Uncorrected folded time', 1 231,0.,924.,0.) call hbook1(12200,' fisrt diff.Uncorrected folded time distr.', 1 150,-500.,1000.,0.) call hbook1(7000,' hits ',125,0.,250.,0.) call hbook1(7100,' hits 2.0 - 5.0 ',125,0.,250.,0.) call hbook2(20000,' spill, hits ', 1 500,1100.,6100.,50,0.,250.,0.) call hbook2(21000,' folded spill, hits ', 1 231,0.,924.,50,0.,250.,0.) if(icc(1).eq.1)sfile = 'elis_2022-2567-0336-ian02.txt' if(icc(1).eq.2)sfile = 'elis_2022-2066-1129-ian02.txt' if(icc(1).eq.3)sfile = 'elis_2022-2288-1360-ian02.txt' if(icc(1).eq.4)sfile = 'elis_2022-2567-1146-ian02.txt' if(icc(1).eq.5)sfile = 'elis_2023-3165-0035-ian02.txt' if(icc(1).eq.6)sfile = 'elis_2023-3165-0049-ian02.txt' if(icc(1).eq.7)sfile = 'elis_2023-3165-0056-ian02.txt' if(icc(1).eq.8)sfile = 'elis_2023-3229-0170-ian02.txt' open(unit=19,file=sfile,status='unknown') * if(icc(1).eq.2) * 1 open(unit=19,file='elis-12567-0337.txt',status='unknown') ! golden file * if(icc(1).eq.3) * 1 open(unit=19,file='elis-12567-0338.txt',status='unknown') ! golden file * if(icc(1).eq.4) * 1 open(unit=19,file='elis-12567-0339.txt',status='unknown') ! golden file * if(icc(1).eq.5) * 1 open(unit=19,file='elis-12567-0340.txt',status='unknown') ! golden file * if(icc(1).eq.6) * 1 open(unit=19,file='elis-12567-1146.txt',status='unknown') ! golden file * if(icc(1).eq.7) * 1 open(unit=19,file='elis-2465-0170.txt',status='unknown') ! dataplot31.kumac * if(icc(1).eq.8) * 1 open(unit=19,file='elis-2566-1230.txt',status='unknown') ! dataplot32.kumac * if(icc(1).eq.9) * 1 open(unit=19,file='elis-2066-1129.txt',status='unknown') ! dataplot33.kumac * if(icc(1).eq.10) * 1 open(unit=19,file='elis-12288-1360.txt',status='unknown') ! gold 22 * if(icc(1).eq.11) * 1 open(unit=19,file='elis-13019-0133.txt',status='unknown') ! new 23 * if(icc(1).eq.12) * 1 open(unit=19,file='elis-13046-0011.txt',status='unknown') ! new 23 read(19,5510,END=999)aa,nrun,nbur *5510 format(a6,2i8) 5510 format(a6,2i9) write(*,*)' ' write(*,*)' run burst ',nrun,nbur ii = icc(1) ibur(1) = nbur irun(1) = nrun nnn =0 nn = 500000 ! max input - see arrays do k =1,nn read(19,5513,END=999)aa,kk,kid,kcode,kstamp,nhsta(1) * if(nhsta(1).gt.100.)go to 444 nnn = nnn+1 5513 format(a6,2i9,2z10,i8) kstore(nnn) = kstamp ! for ffb determination hstore(nnn) = nhsta(1) ! store hits for folded plots fm = float(kstamp)/40000d0 ! ms call hfill(110,fm,0.,1.) ! full spill 5 ms call hfill(30110,fm,0.,1.) ! full spill 5 ms temp = nhsta(1) call hfill(31110,fm,0.,temp) ! full spill 5 ms hits sum call hfill(101,fm,0.,1.) call hfill(102,fm,0.,1.) call hfill(103,fm,0.,1.) call hfill(104,fm,0.,1.) temp = nhsta(1) call hfill(7000,temp,0.,1.) ! hits if(fm.gt.2000..and.fm.lt.5000.)then call hfill(7100,temp,0.,1.) ! hits endif c call hfill(20000,temp,fm,1.) ! hits vs spill call hfill(20000,fm,temp,1.) ! spill vs hits c-------------------------------- go to 444 c folded data ffb = 923.9926 ! fold time approx tempx = mod(float(kstamp),ffb) ! folded spill tempy = float(kstamp)/40000d0 ! ms spill xxx = (tempy -1500.)/1000. corr = 2.4*xxx**3 ctempx = tempx - corr ! corrected folded spill if(ctempx.lt.0.)ctempx = ctempx +924.0 * call hfill(21000,ctempx,temp,1.) ! corrected folded spill vs hits c note that above plot is reordered ( see below) c but an approx sps time is used here. <<<<<<<<<<<<< 800 then set txci 2 endif itx 4000 800 'MAX ' [tempx] set txci 1 if [temp5] < 100 then set txci 2 endif itx 4750 800 'MIN ' [temp5] set txci 1 *itx 6100 900 'excess ' *itx 6300 650 [temp6] ' %' itx 6100 400 'rms 1 ms ' itx 6300 150 [trms1] set plci 7 set lwid 5 dline 1000 6000 600 600 set plci 1 set lwid 1 atitle 'Fig. 2 spill (ms) ' ' Triggers / 5 ms' title ' corrected folded spill ' *opt grid *id = 11000 + [i] *h/pl [id] *atitle ' corrected folded spill ' set hwid 3 title ' folded spill ' id = 12000 opt grid h/pl [id] set plci 7 set lwid 5 *dline 0 924 500 500 set plci 1 set lwid 1 *itx 940 500 'excess ' *itx 960 250 [tempf] ' %' if [trms] > 100 then set txci 2 endif itx 940 00 'rms ' [trms] set txci 1 atitle 'Fig.3 Uncorrected folded spill (1.2 - 2.2 secs) ' ' Triggers' opt grid set hwid 3 *zone 1 2 title ' Spill Frequency Analysis from Periodogram/Autocorrelation (1.5 - 2.5 secs) ' id = 8000 h/pl [id] if [tempn] > 45 then set txci 2 endif *itx 200 2000 [tempn] ' %' itx 260 2500 'noise ' itx 260 000 [tempn] ' %' set txci 1 atitle 'Fig. 4 Frequency (Hz)' ' Amplitude' set hwid 2 title ' Autocorrelation' id = 9200 h/pl [id](001.:450.) if [t100] > 8000 then set txci 2 endif itx 455 0.20 'Max amp ' itx 455 0 [t100] itx 455 -0.2 [tfreq] ' Hz' set txci 1 atitle 'Fig. 5 Time (ms)' ' Autocorrelation' opt ngrid set hwid 5 igset mtype 1 igset mscf .5 opt stat opt fit go to zzz title ' Spill: counts / 5 ms (1.5 - 5.5 secs). First difference for 1 ms ' zone 2 2 set csiz 0.35 id = 9000 h/fit [id] G set plci 7 set lwid 5 dline 600. 600. 0. 40. set plci 1 set lwid 1 atitle ' events/5 ms ' ' entries' title ' First difference of spill / ms (1.5 - 5.5 secs)' id = 9100 h/fit [id] G atitle ' events / 1 ms difference ' ' entries' igset mtype 20 igset mscf 0.1 opt nstat opt nfit temp = scal(1) zone 1 1 title ' corrected spill ' id = 10000 h/pl [id] itx 350 5900 ' ' [tempr] ' ' [tempb] itx 650 5900 'TIME ' [temp] atitle 'Fig. 5 trigger time modulo(923.99xxxx) (25 ns) ' ' trigger time (ms) ' zzz: opt liny opt nstat opt nfit set fwid 1 set plci 1 opt grid opt tic title ' Hits GTK(1) vs Spill Time, Folded Spill Time ' zone 1 2 igset mtype 20 igset mscf 0.11 igset mscf 0.10 h/pl 20000 dline 2000 2000 0 250 dline 5000 5000 0 250 atitle 'Fig. 6 Spill Time (ms) ' ' Hits ' h/pl 21000 atitle 'Fig. 7 Folded Spill Time (25 ns) ' ' Hits ' igset mtype 20 igset mscf 0.1 opt nstat opt nfit temp = vhskew(1) temp1 = vhkur(1) opt stat set plci 2 set fwid 5 set csiz 0.40 title ' Hits GTK(1) ' zone 2 2 h/fit 7000 G if [temp] > 1 then set txci 2 endif itx 100 10000 ' Skewness ' [temp] itx 100 7500 ' Kurtosis ' [temp1] set txci 1 atitle 'Fig. 8a hits ' 'entries' opt logy h/pl 7000 atitle 'Fig. 8b hits ' 'entries' opt liny temp = vhskew1(1) temp1 = vhkur1(1) h/fit 7100 G itx 100 8000 ' Skewness ' [temp] itx 100 6000 ' Kurtosis ' [temp1] atitle 'Fig 8c hits (2.0 -5.0 secs)' 'entries' opt logy h/pl 7100 atitle 'Fig 8d hits (2.0 -5.0 secs)' 'entries' *-------------------- go to xyz opt liny opt nstat opt nfit set fwid 1 set plci 1 opt grid opt tic title ' Folded Spill Time vs Hits GTK(1)' zone 1 2 igset mtype 20 igset mscf 0.11 igset mscf 0.10 h/pl 20000 dline 2000 2000 0 250 dline 5000 5000 0 250 atitle 'Fig. 7 Spill Time (ms) ' ' Hits ' h/pl 21000 atitle 'Fig. 8 Folded Spill Time (25 ns) ' ' Hits ' xyz: *---------------------------------------- opt ngrid opt ntic opt stat opt fit set csiz 0.3 go to www title ' fist diff. uncorr.folded time ' h/pl 12100 atitle 'Fig. 9 uncorr. folded time ' ' first diff ' h/fit 12200 G temp = vfrms(1) if [temp] > 100 then set txci 2 endif itx 400 5 'RMS ' [temp] set txci 1 atitle 'Fig. 10 first diff folded spill time ' ' events ' opt nstat opt nfit *title ' Second difference ' *h/pl 12300 *atitle ' Folded spill time (25 ns) ' ' Second difference ' www: opt nstat opt nfit zone 1 3 title 'Comparison of GTK(1) hits /5ms with triggers /5 ms ' opt grid opt logy h/pl 31110 atitle 'Fig 11a spill time (ms)' ' hits triggers' set dmod 1 h/pl 30110 s *atitle ' spill time (ms)' ' triggers' opt liny h/pl 32110 atitle 'Fig. 11b spill time (ms)' ' hits / triggers' h/pl 33110 atitle 'Fig. 11c spill time (ms)' ' triggers / hits' opt ngrid enddo quit