subroutine hec_card c c set up hec_adc datacards c see user/datacard.info for the datacards description c implicit none c c datacard values common c include'hec_par.inc' include'hec_datacard.inc' c c ffread common c integer maxffr parameter (maxffr=2000) real ffspac(maxffr) c integer i,ic character*10 title character*4 chisctit c common /cfread/ ffspac data chisctit / 'null' / c c reset the cluster titles c do i=1, nclust_dim call UCTOH(chisctit,his_clus_ititle(i),4,4) enddo c c ffread initialization c open(unit=13,file='hec_adc.datacard',status='OLD') call ffinit(maxffr) call ffset('SIZE', 10) call ffset('LINP', 13) c c define keys and set defaults c call ffkey('rnmode', run_mode, 1, 'mixe') run_mode = 1 c call ffkey('intyp', in_typ, 2, 'mixe') in_typ(1) = 2 in_typ(2) = 51 c call ffkey('npass', n_pass, 1, 'mixe') n_pass = 1 c call ffkey('nevtm', n_evtmax, 1, 'mixe') n_evtmax = 999999 c call ffkey('runpd', irunpd, 1, 'mixe') irunpd = 15 c call ffkey('mkped', mk_ped, 10, 'mixe') mk_ped = 1 nt_ped(1) = 1 nt_ped(2) = 5 sc_ped = 3. tr_ped = 1 io_ped(1) = 0 io_ped(2) = 48 io_ped(3) = 1 io_ped(4) = 49 pr_ped = 0 c call ffkey('mkcub', mk_cub, 6, 'mixe') mk_cub = 1 sc_cub = -1. tm_cub = 8 fl_cub = 0 t1_cub = 7 t2_cub = 9 c call ffkey('mkdig', mk_dig, 3, 'mixe') mk_dig = 1 pr_dig = 0 t0_dig = 0 c call ffkey('mpref', m_pref, 1, 'mixe') m_pref = 1 c call ffkey('iocal', io_cal, 3, 'mixe') io_cal(1) = 0 io_cal(2) = 27 io_cal(3) = 0 c call ffkey('rrunh', run_no_cr, 5, 'mixe') run_no_cr=-1 e_beam_cr=-1. i_part_cr=-1 x_cryo_cr=10001. y_tabl_cr=10001. c call ffkey('beamc ', mk_beam, 5, 'mixe') mk_beam = 0 z_beam = 100001. hpr_beam = 0 io_beam(1) = 31 io_beam(2) = 32 c call ffkey('mkcrl', mk_crl, 2, 'mixe') mk_crl = 0 io_crl = 30 c call ffkey('search', hec_s_dk, 6, 'mixe') hec_s_dk = -1 ! default disable search hec_s_algo(1) = 4. ! algo1: start with 4th timeslice hec_s_algo(2) = 8. ! algo1: stop at 8th timeslice hec_s_algo(3) = 5. ! algo1: compare five timeslices hec_s_algo(4) = 1. ! algo1: apply cut on maximum hec_s_algo(5) = 2. ! algo1: 2 sigma cut c call ffkey('mkntp', mk_ntp, 6,'mixe') mk_ntp = 0 io_ntp = 70 eunits_ntp = 2 tfilter_ntp = 0. nt_user_switch = 0 random_ntp = 0 c call ffkey('mkhis', mk_his, 3, 'mixe') mk_his = 0 io_his = 52 his_srch_flg = 0 c call ffkey('hiscon', histo_switch, 7, 'mixe') histo_switch(1) = 1 histo_switch(2) = 1 histo_switch(3) = 1 histo_switch(4) = 1 histo_switch(5) = 1 histo_switch(6) = 1 histo_switch(7) = 1 c c cluster lists for cell cluster histograms c This one's a little complicated: c We want one datacard for each cluster. So, loop over maximum c number of clusters, intializing a datacard each time. You must know c the starting point of each datacard in memory (usually pass first c variable of datacard, but with a 2-d array you have to figure out c where the place in memory is). So, in this case, the first datacard c starts at position array(1,1), the second starts at array(1,2). This c works because in memory things are mapped like: c (1,1) (2,1) (3,1) (positions 1,2,3) c (1,2) (2,2) (3,2) (positions 4,5,6) c . . . c . . . c c title = 'hisclus ' do i = 1, nclust_dim write(title(8:9),'(i2.2)') i call ffkey(title, his_clus_cell_array(1,i),i_adc_dim+1, + 'mixe') his_clus_cell_array(1,i) = 0 do ic = 1, i_adc_dim his_clus_cell_array(ic+1,i) = 0 enddo enddo c title = 'hisctit ' do i = 1, nclust_dim write(title(8:9),'(i2.2)') i call ffkey(title, his_clus_ititle(i), 1,'mixe') enddo c call ffkey('online', auto_run, 5, 'mixe') auto_run = 0 auto_rnnum = 1111 cr_tdc_wac_c = 1436 cr_tdc_wac_epi = 1436 cr_tdc_wac_mu = 1436 c end