*********************** Run dplot on work disk *********************** 1. Copy all the source file in adaq@jlabh2.jlab.org:/home/adaq/dplot/stable to some directory in work disk. 2. Copy adaq@jlabh2.jlab.org:/home/adaq/DD.tar to the work disk, then expand it by typing 'tar -xvf DD.tar '. 3. Specify the directory of DD in the 'Makefile' by redefining DDROOT. 4. Specify the directory of CODA in your .login file by adding --------------------------- echo "setting up CODA 1.4" setenv CODA /apps/coda/1.4.1 setenv CODA_BIN $CODA/$OSTYPE/bin setenv CODA_LIB $CODA/$OSTYPE/lib set path = ($CODA_BIN $path) ----------------------------- Attention: in the .login file to adaq, CODA 1.4.2 will be installed The code can be run with bother version 1.4 and 2.0 of CODA. 5. Then login to the jlabh1 machine and type command 'make'. ************************ Add new detector name A1 ************************ 1. decoder.h Give DET_NUMs to the new detector by adding -------------------------------------------- integer*2 A1TH_DNUM, A1AH_DNUM parameter ( A1TH_DNUM = 92, A1AH_DNUM = 93 ) parameter ( SCALER_DNUM = 94 ) -------------------------------------------- The detector number of the scaler should keep the last one. Add one to the number of detector type. --------------------------------------------------------------- parameter ( NUMDET_TYPES = 12 ) ! includes scaler detector type --------------------------------------------------------------- Define pointers into the global data structure ----------------------------------------------------------------- integer*2 VDC_PTR, SCINT_PTR, AERO_PTR, GAS_PTR, SHWR_PTR,A1_PTR parameter ( A1_PTR = HSHWR_RECORDS*HSHWR_MAXWORD+HSHWR_PTR) ----------------------------------------------------------------- 2. rawdata.h Define the size of raw data structure, ... ------------------------------------------------------------------------ integer*2 A1_MAXWORD, GAS_MAXWORD parameter ( A1_MAXWORD = 30 ) ! maximum number of data words for a plane integer*2 A1_RECORDS, GAS_RECORDS parameter ( A1_RECORDS = 4 ) parameter ( NUM_STRUCTS = VDC_RECORDS*VDC_MAXWORD 2 + SCINT_RECORDS*SCINT_MAXWORD + AERO_RECORDS*AERO_MAXWORD 3 + GAS_RECORDS*GAS_MAXWORD + SHWR_RECORDS*SHWR_MAXWORD 4 + FPP_RECORDS*FPP_MAXWORD + SPARE_RECORDS*SPARE_MAXWORD 5 + TRGGR_RECORDS*TRGGR_MAXWORD + SHMULT_RECORDS*SHMULT_MAXWORD 6 + HSHWR_RECORDS*HSHWR_MAXWORD 7 + A1_RECORDS*A1_MAXWORD) parameter ( NUM_DETS = VDC_RECORDS + SCINT_RECORDS 2 + AERO_RECORDS + GAS_RECORDS + SHWR_RECORDS 3 + FPP_RECORDS + TRGGR_RECORDS + SPARE_RECORDS 4 + SHMULT_RECORDS + HSHWR_RECORDS + 1 ! includes the scaler 5 + A1_RECORDS) record /raw_unit/ a1tdc_h(A1_MAXWORD) ! time in h-arm Aerogel record /raw_unit/ a1adc_h(A1_MAXWORD) ! PH in h-arm Aerogel structure /word_counters/ union map integer*2 vdcu1e, vdcv1e, 2 vdcu2e, vdcv2e, vdcu1h, ... 9 spare6, spare7, spare8, 1 spare9, spare10, 2 shmult1, shmult2, hshwr, 3 a1tdch, a1adch end map --------------------------------------------------------------------- 3. ini_decoder.f Define pointers et al ------------------------------------------ STR_OFFSET(A1TH_DNUM) = A1_PTR STR_OFFSET(A1AH_DNUM) = A1_PTR +A1_MAXWORD DET_MAXWORD(A1TH_DNUM) = A1_MAXWORD DET_MAXWORD(A1TH_DNUM) = A1_MAXWORD ------------------------------------------ 4. block_data.f Allocate memory for detector names and make assignments, Define parameters for CODA decoder. -------------------------------------------------------------------------- data DET_NAME(A1TH_DNUM) / 'a1tdc_h' / data DET_NAME(A1AH_DNUM) / 'a1adc_h' / data (DET_MAXWIRES(il_decode), il_decode=1,NUMDET_TYPES) c VDC SCINT AEROGEL GAS SHOWER FPP TRGGR SPARE SHMULT HSHWR SCALER A1 2 / 400, 12, 26, 13, 128, 40, 10, 20, 3 16, 100, 24, MAXSCALER/ data (DET_TYPE(1,il_decode), il_decode=1,NUMDET_TYPES) 2 / 1, 9, 19, 23, 27, 29, 77, 79, 89, 91, 92 ,94/ data (DET_TYPE(2,il_decode), il_decode=1,NUMDET_TYPES) 2 / 8, 18, 22, 26, 28, 76, 78, 88, 90, 91, 93,94 / --------------------------------------------------------------------------- 5. detmap.config Specify the correspondance between the detector name and input channel ---------------------------------------------------------------------------- ! DETECTOR WIRE ROC CRATE SLOT CHANNEL ! NAME NUMBER NUMBER NUMBER NUMBER RANGE MODEL a1adc_h 1 2 1 24 32-43 1881 a1adc_h 13 2 1 24 0-11 1881 ---------------------------------------------------------------------------- ***************** Plot adc from A1 ***************** 1. dataplot.c ------------------------------------------------------------------------------ static int ia1=0; ia1 = 1; dplot_ana_(&idebug,&iscint,&ivdc,&ishower,&ig ,&ia1,&ips,&ifpp, &ihshower, &ispec,&ev_type); ------------------------------------------------------------------------------- 2. run_info.h --------------------------------------------------------------- logical*4 escint1_flag, escint2_flag, hscint1_flag,hscint2_flag, ... 9 hshower_flag, cgas_flag,a1_flag,ps_flag common / flags_run / escint1_flag, escint2_flag, hscint1_flag, ... 5 hshower_flag,a1_flag ---------------------------------------------------------------- 3. dplot_ana.f ---------------------------------------------------- subroutine dplot_ana(idebug,iscint,ivdc,ishower,ig, & ia1,ips, ifpp, ihshower, jarm,itrig) integer idebug,iarm,jarm,ishower,ig,ips,ifpp, ihshower,ia1 if(ia1.eq.1) a1_flag = .true. if((iarm.eq.2).and.a1_flag) & call cerenkov_a1 ------------------------------------------------------- 4. plotini_h.f ------------------------------------------------ c c A1: Aerogel #1 cerenkov c do 650 i = 1,24 ctext = 'PMT xx ADC' write(ctext(5:6),'(i2)') i call hbook1(521000+i,ctext,100,300.,1200.,0.) 650 end do -------------------------------------------------- 5. cerenkov_a1.f New subroutine, important lines: --------------------------------------------------- integer a1_nPMT data a1_nPMT / 24 / do 200 i=1,wdctr.a1adch iw = raw.a1adc_h(i).wire if(iw.le.0.or.iw.gt.a1_nPMT) goto 200 pdat(iw) = raw.a1adc_h(i).data 200 end do do 300 i = 1,a1_nPMT call hf1(521000+i,pdat(i),1.) 300 end do ------------------------------------------------- ************************* Display the A1 adc plots ************************* 1. hist_opt --------------------------------------------------- 1 ! Page 63 , Aerogel #1 Cerenkov ADC for hadron arm ---------------------------------------------------- 2. dplot_titles_h.h --------------------------------------------------- c A1 c data ctitle(63) / "A1 ADC" / data page_file(63) / "a1adc.ps" / ---------------------------------------------------- 3. dplot_update_h.f ------------------------------------------------------ parameter (NPAGE=63) parameter (MAXHIST=24) data xzone / 10*2,2,1,1,6*2,1,2 + , 22*2, 2 + ,1,3*2,2,1,3,2*2 ,1,2,2,2, 2,2,1,1,2,4 / data yzone / 10*6,2,3,3, 8*2 + , 22*3, 3 + ,2,3*3,3,1,4,2*3 ,4*2, 5,5,6,6,2,6/ data yscaleopt/2*'LOGY',8*'LINY',47*'LINY', 4*'LOGY' + , 'LINY','LOGY'/ c c Aerogel Cerenkov #1(A1) c c do j = 1,24 idlist(63,j) = 521000+j ! a1 ADC end do ------------------------------------------------------- ******* Dataspy ******* 1. dataspy.c ------------------------------------------------------------------------------ static int ia1=0; ia1 = 0; case 'a': ia1=1; break; if((ispec == 0)||(raw!=1 && iscint!=1 && ivdc !=1 && ishower !=1 && ig !=1 && ia1 !=1&& ips !=1 && ifpp !=1)) goto usage; dplot_ana_(&idebug,&iscint,&ivdc,&ishower,&ig ,&ia1,&ips,&ifpp, &ihshower, &ispec,&ev_type); ------------------------------------------------------------------------------- *************************************************************** Change the display of A1 plot: from 24 plots to 6 compact ones *************************************************************** 1. dplotini_h.f -------------------------------------------------- c c a1: Aerogel #1 cerenkov c do 650 i = 1,6 k=(i-1)*4+1 j = k+3 ctext = 'PMT xx thru yy ' write(ctext(5:6),'(i2)') k write(ctext(13:14),'(i2)') j call hbook1(521000+i,ctext,400,0.,6000.,0.) 650 end do --------------------------------------------------- 2. cerenkov_a1.f --------------------------------------------------- integer i,j,iw real pdat(NBMAX),pdat2(NBMAX) do i = 1,NBMAX pdat(i) = 0. pdat2(i)= 0. end do do 300 i = 1,24 if(mod(i,4).ne.0) then j=(i+4)/4 else j =i/4 endif if(mod(i,4).eq.1) pdat2(j) = pdat(i) if(mod(i,4).eq.2) pdat2(j) = pdat(i) + 1500 if(mod(i,4).eq.3) pdat2(j) = pdat(i) + 3000 if(mod(i,4).eq.0) pdat2(j) = pdat(i) + 4500 call hf1(521000+j,pdat2(j),1.) 300 end do ------------------------------------------------------ 3. dplot_update_h.f --------------------------------------------------------- data xzone / 10*2,2,1,1,6*2,1,2 + , 22*2, 2 + ,1,3*2,2,1,3,2*2 ,1,2,2,2, 2,2,1,1,2,1 / do j = 1,6 idlist(63,j) = 521000+j ! a1 ADC end do --------------------------------------------------------- ***** Dhist ***** 1. dhist: there is no online data, we need to specify the file name. ------------------------------------------------------------------------- nice -6 dplot -H -S adaqs2 -u 500 -r 10 -z 999998 -f /w/cache501/halla/e9 9007/raw/e99007_2019.dat.0 --------------------------------------------------------------------------- 2. dopth: -------------------------------------------------------------------------- wish -f /tmp_mnt/w/work301/e94104/lyzhu/dplot/tcl/dplot_h.tcl > /dev/null & --------------------------------------------------------------------------- 3. dplot_h.tcl: specify the directory for hist_opt and hist_opt_check -------------------------------------------------- set elec_dir /tmp_mnt/w/work301/e94104/lyzhu/dplot -------------------------------------------------- *************** Make reference ************** The tcl files need to be copied from adaq@adaqh2.jlab.org:~/tcl 1. dplot_h.tcl: ------------------------------------------------------------------ set tcl_dir /tmp_mnt/w/work301/e94104/lyzhu/dplot/tcl button .bot.ref -text "Make ref histograms" -fg black bind .bot.ref {exec wish -f $tcl_dir/make_ref.tcl &} pack .bot.quit .bot.ref -side top set pidout [exec nice -n 19 wish -f $tcl_dir/loop.tcl $elec_chfile $elec_dir $wname "$swlist" $bodypid & ] ------------------------------------------------------------------- 2. make_ref.tcl ------------------------------------------------ set elec_dir /tmp_mnt/w/work301/e94104/lyzhu/dplot set tcl_dir /tmp_mnt/w/work301/e94104/lyzhu/dplot/tcl set hadron $elec_dir set thisfile $tcl_dir/make_ref.tc ----------------------------------------------- ***************************** Change the hist id for a1adc ***************************** Using paw to look at dplot_ref.his, I found 521000 is the id for FPP Straw Number Plane RV5. 600000 is the id for FPP Hits per Plane FU1. So it is better to change to id from 521000+i to some other number, like 433000+i The files: dplotini_h.f, cerenkov_a1.f, dplot_update_h.f were changed correspondently.