subroutine hec_his_evt_hfill c c fill histos in event loop that are not done for every channel c implicit none c include 'hec_par.inc' ! shared parameters include 'hec_datacard.inc' ! datacard values include 'hec_geo.inc' ! geometry correspondence tables include 'hec_his_sys.inc' ! histo ids, etc. include 'hec_max.inc' ! maximum adc and time values include 'hec_tdc.inc' ! tdc value include 'hec_adc.inc' ! adc value include 'hec_evth.inc' ! event header include 'hec_runh.inc' ! event header include 'hec_trig.inc' ! trigger common include 'hec_hvstat.inc' ! HV status and corrections include 'hec_cal.inc' ! energy calibration common c c local variables c integer id, i_z, nid1 integer k, ic, i, iz integer i_ped, ibin real clus_sum, clus_sum_cal, clus_sum_cal_hv save i_ped real natogev logical first data first /.true./ save first c c set conversion factors from nA to GeV c if(i_part.eq.3)then natogev=0.00367 else natogev=0.00292 endif if(first)then print*,' ' print*,' *** ATTENTION: nAtoGeV conversion factor is ', + natogev print*,' ' first = .false. endif c c histo type 4 -- tdc corrected c if (histo_switch(4) .eq. 1) then c c fill tdc distribution histo c nid1 = 0 id = id_tdcd call hfill(id,tdc_ns, 0., 1.) endif c c histo type 5 -- calibrated c if (histo_switch(5) .eq. 1) then c c fill sigma cut energy histos c id = id_sigma + 1 call hfill(id, sum_sigma(1), 0., 1.) id = id_sigma + 2 call hfill(id, sum_sigma(2), 0., 1.) id = id_sigma + 3 call hfill(id, sum_sigma(3), 0., 1.) id = id_sigma + 4 call hfill(id, sum_sigma(1)*natogev, 0., 1.) id = id_sigma + 5 call hfill(id, sum_sigma(2)*natogev, 0., 1.) id = id_sigma + 6 call hfill(id, sum_sigma(3)*natogev, 0., 1.) c c these histograms exist only if slow control bank found c if(lhvstat)then id = id_sigma + 7 call hfill(id, sum_sigma_hv(1)*natogev, 0., 1.) id = id_sigma + 8 call hfill(id, sum_sigma_hv(2)*natogev, 0., 1.) id = id_sigma + 9 call hfill(id, sum_sigma_hv(3)*natogev, 0., 1.) endif endif c c histo type 6 -- clusters; c if (histo_switch(6) .eq. 1) then do k = 1, his_clus_num clus_sum = 0. clus_sum_cal = 0. clus_sum_cal_hv = 0. do i = 1, his_clus_cell_array(1,his_clus_index(k)) ic = his_clus_cell_array(i+1,his_clus_index(k)) iz = ictoph(ic,3) if (iz .ne. 0) then clus_sum = clus_sum + depthw_adc(iz)*adc_max_ic(ic,1) if(io_cal(1).ge.1.and.ic_has_calib(ic))then clus_sum_cal = clus_sum_cal + + depthw_na(iz)*hec_cal_ic(ic) if(ic_hv_known(ic))then clus_sum_cal_hv = clus_sum_cal_hv + + depthw_na(iz)*hec_cal_ic(ic)*ic_hv_cor(ic) endif endif endif enddo c c fill histograms c call hfill(id_clus+k ,clus_sum, 0., 1.) if(io_cal(1).ge.1)then call hfill(id_clus_cal+k ,clus_sum_cal*natogev, 0., 1.) if(lhvstat)then call hfill(id_clus_cal_hv+k , + clus_sum_cal_hv*natogev, 0., 1.) endif endif enddo endif c c histo type 2 -- geometrical energy distribution c if (histo_switch(2) .eq. 1) then c c fill adc(max)-ped histograms for each depth c do i_z = 1, i_z_used call hfill(id_adc_z + i_z,sig_sum(i_z),0.,1.) enddo endif c c histo type 1 -- ped/noise c if (histo_switch(1) .eq. 1) then c c time evolution for pedestals: first time slice content c for every (10th, 100th) event in 4 different channels c if (irunpd .ge. 4) then if (i_event .le. 1) i_ped=0 if ((tr_ped .le. 0) .or. + (tr_ped .eq. 1 .and. trig_random) .or. + (tr_ped .eq. 2 .and. trig_pretrigger)) then i_ped = i_ped + 1 ibin = 0 if(n_evtmax.le.100)then ibin=i_ped else if(n_evtmax.le.1000)then if(mod(i_ped,10).eq.0)then ibin=i_ped/10 endif else if(n_evtmax.le.10000)then if(mod(i_ped,100).eq.0)then ibin=i_ped/100 endif else if(mod(i_ped,200).eq.0.and.i_ped/200.le.100)then ibin=i_ped/200 endif endif if(ibin .ne. 0)then adc_ped_time_ic1(ibin)=real(i_adc_ic_t(17, 1)) adc_ped_time_ic2(ibin)=real(i_adc_ic_t(37, 1)) adc_ped_time_ic3(ibin)=real(i_adc_ic_t(62, 1)) adc_ped_time_ic4(ibin)=real(i_adc_ic_t(112, 1)) endif endif endif endif c end