Return to hist_merge.kumac CVS log | Up to [HallC] / geant_gep |
File: [HallC] / geant_gep / hist_merge.kumac
(download)
Revision: 1.1, Thu Feb 9 21:57:30 2006 UTC (18 years, 7 months ago) by brash Branch: MAIN CVS Tags: HEAD Scripts for histogram merging, and submitting jobs to the JLab Farm. |
cdir //pawc hist/del 0 cont = 1 message This kumac assumes that the hbook files message have the form [ident]_[nrun].hbook message and the merged hbook file has the message form [ident]_[nrunfirst]_[nrunlast].hbook message where [ident] is geant_gep3 , for example. message Also assumes that hbook files in hbook directory while ([cont] .eq. 1) do type = new read type 'A new merged hbook file or appending to an old file (type (old ornew)' cont = 0 if ([type] .ne. 'new' .and. [type] .ne. 'old') then cont = 1 endif endwhile * * ident = geant_gep3 read ident ' What is the identifier in the filename?' * if ([type] .eq. 'new') then nfile = 2 read nfile 'Number of files to merge' read nrun 'Run number of first file' nrun1 = [nrun] nfile = [nfile] - 2 read nrun2 'Run number of next file' ntuple/hmerge [ident]_[nrun1]_[nrun2].hbook [ident]_[nrun2].hbook [ident]_[nrun1].hbook cdir //pawc hist/del 0 nrun_prev = [nrun2] if ( [nfile] .ge. 1) then do i=1,[nfile] read nrun2 'Run number of next file' ntuple/hmerge [ident]_[nrun1]_[nrun2].hbook [ident]_[nrun2].hbook [ident]_[nrun1]_[nrun_prev].hbook remove = 0 read remove 'To delete old merged file from disk type 0' if ([remove] .eq. 0) then sh rm [ident]_[nrun1]_[nrun_prev].hbook endif cdir //pawc hist/del 0 nrun_prev = [nrun2] nrun2 = [nrun_prev] + 1 enddo endif * else * read nrun1 'What is run number of first run in old merged file?' read nrunlast 'What is run number of last run in old merged file?' file_test = [ident]_[nrun1]_[nrunlast].hbook if ($fexist([file_test]) .eq. 1) then nfile = 1 read nfile 'Number of files to add to merge hbook' cdir //pawc hist/del 0 nrun_prev = [nrunlast] message nfile = [nfile] if ( [nfile] .ge. 1) then do i=1,[nfile] read nrun2 'Run number of next file' ntuple/hmerge [ident]_[nrun1]_[nrun2].hbook [ident]_[nrun2].hbook [ident]_[nrun1]_[nrun_prev].hbook remove = 0 read remove 'To delete old merged file from disk type 0' if ([remove] .eq. 0) then sh rm [ident]_[nrun1]_[nrun_prev].hbook endif cdir //pawc hist/del 0 nrun_prev = [nrun2] nrun2 = [nrun_prev] + 1 enddo endif else message [ident]_[nrun1]_[nrunlast].hbook does not exist endif * endif
Analyzer/Replay: Mark Jones, Documents: Stephen Wood |
Powered by ViewCVS 0.9.2-cvsgraph-1.4.0 |