% PPALLDATA_CDWO4
%
%    PPALLDATA_CDWO4 - Analyse 15/11/06 Pepperpot data with CdWO4 screen

    clear all ; close all ;

%    'E:\pepperpot\15_11_06_CdWO4\Background01.tif'
%    'E:\pepperpot\15_11_06_CdWO4\Ruler_15-11_06A.tif'
%    'E:\pepperpot\15_11_06_CdWO4\Ruler_15-11_06B.tif'

%    ppbgfname = (['E:\pepperpot\15_11_06_CdWO4\Ruler_15-11_06A.tif']) ;
    ppbgfname = (['E:\pepperpot\15_11_06_CdWO4\Ruler_15-11_06A_data.mat']) ;

    midpos = [939 1073] ;
    lpos_14 = [197 1874] ;
    rpos = [1704 1912] ;
    diff = rpos - lpos_14 ;
    diff_16 = (diff./14).*16 ;
    lpos = round(rpos - diff_16) ;
    pplim = 110 ;
    width = 51 ;
    width2 = 27 ;
    zlen = 13 ;
    rotang = ( ( 90 + 11.25 )./360 ).*( 2.*pi ) ;
%    rotang = 0 ;
%    plt = [0 0 0 0 0 1 0 1] ;
    plt = [2 1 0 1 0 1 0 1] ;

    [ppposdat_10ms,ppemitdat_10ms,ppimstdxy_10ms] = ppanalyse(ppbgfname,lpos,rpos,midpos, ...
        'E:\pepperpot\15_11_06_CdWO4\ScintillatorS1test01.tif',pplim,width,zlen,rotang,35e3,plt) ;
    [ppposdat_1ms,ppemitdat_1ms,ppimstdxy_1ms] = ppanalyse(ppbgfname,lpos,rpos,midpos, ...
        'E:\pepperpot\15_11_06_CdWO4\ScintillatorS1test05.tif',pplim,width,zlen,rotang,35e3,plt) ;
    [ppposdat_1ms_2,ppemitdat_1ms_2,ppimstdxy_1ms_2] = ppanalyse(ppbgfname,lpos,rpos,midpos, ...
        'E:\pepperpot\15_11_06_CdWO4\ScintillatorS1test24.tif',pplim,width,zlen,rotang,35e3,plt) ;
    [ppposdat_500us,ppemitdat_500us,ppimstdxy_500us] = ppanalyse(ppbgfname,lpos,rpos,midpos, ...
        'E:\pepperpot\15_11_06_CdWO4\ScintillatorS1test06.tif',pplim,width,zlen,rotang,35e3,plt) ;
    [ppposdat_250us,ppemitdat_250us,ppimstdxy_250us] = ppanalyse(ppbgfname,lpos,rpos,midpos, ...
        'E:\pepperpot\15_11_06_CdWO4\ScintillatorS1test07.tif',pplim,width,zlen,rotang,35e3,plt) ;

    break

    [ppposdat_20ms,ppemitdat_20ms,ppimstdxy_20ms] = ppanalyse(ppbgfname,lpos,rpos,midpos, ...
        'E:\pepperpot\15_11_06_CdWO4\ScintillatorS1test02.tif',pplim,width,zlen,rotang,35e3,plt) ;
    [ppposdat_5ms,ppemitdat_5ms,ppimstdxy_5ms] = ppanalyse(ppbgfname,lpos,rpos,midpos, ...
        'E:\pepperpot\15_11_06_CdWO4\ScintillatorS1test03.tif',pplim,width,zlen,rotang,35e3,plt) ;
    [ppposdat_2_5ms,ppemitdat_2_5ms,ppimstdxy_2_5ms] = ppanalyse(ppbgfname,lpos,rpos,midpos, ...
        'E:\pepperpot\15_11_06_CdWO4\ScintillatorS1test04.tif',pplim,width,zlen,rotang,35e3,plt) ;

    return


