myBins = 1e5:250000:2e7;
figure(1)
lowHist = hist(ampsLow,myBins);
bar(myBins,lowHist)
title('Low end of scopescale')
figure(2)
highHist = hist(ampsHigh,myBins);
bar(myBins,highHist)
title('High end of scopescale')
figure(3)
combHist = lowHist*normfac + highHist;
bar(myBins,combHist)
title('Both datas combined')

% numer is the numerator of the average
numer = sum(myBins.*combHist);
% denom is denominator of the average
denom = sum(combHist);

evstats(3) = numer/denom;
% 
% % New avg amp calculation ***********************************
% myBinsAMP = 1e5:1e2:2e7;
% lowHistAMP = hist(ampsLow,myBinsAMP);
% highHistAMP = hist(ampsHigh,myBinsAMP);
% combHistAMP = lowHistAMP*normfac + highHistAMP;
% 
% numerAMP = sum(myBinsAMP.*combHistAMP);
% denomAMP = sum(combHistAMP);
% evstats(4) = numerAMP/denomAMP;


clear numer denom

figure(4)
scatter( [VmaxsLow(:,2);VmaxsHigh(:,2) ] , [ampsLow;ampsHigh] , 1 );
title('Amplification vs Signal Max on Ch. 2')
xlabel('Signal Max on Channel 2')
ylabel('Total Amplification')


% rtBins = 0:.2e-10:4e-9;
% figure(5)
% subplot(2,2,1:2)
% hist([risetimeLow,risetimeHigh],rtBins)
% title('Histogram of rise times of signal on channel 2')
% 
% fwhmBins = 0:50e-12:5e-9;
% subplot(2,2,3:4)
% hist([fwhmsLow,fwhmsHigh],fwhmBins)
% title('Histogram of the FWHM distribution on Channel 2')
% 
% if ( lightsource == 1 )
%     
%     [~,aa,~] = size(timingWavesHigh);
%     [~,bb,~] = size(timingWavesLow);
%     aTimeHigh = zeros(1,aa);
%     aTimeLow = zeros(1,bb);
%     for i = 1:aa
%         [edgeT] = findThresholdsSimple(timingWavesHigh(:,i,2),.25*timingVmaxsHigh(i,2),time);
%         aTimeHigh(1,i) = 55*tinc + edgeT;
%     end
%     for i = 1:bb
%         [edgeT] = findThresholdsSimple(timingWavesLow(:,i,2),.25*timingVmaxsLow(i,2),time);
%         aTimeLow(1,i) = 55*tinc + edgeT;        
%     end
%     atBins = 0:1e-10:10e-9;
%     figure(6)
%     hist([aTimeLow,aTimeHigh],atBins)
%     title('Arrival Time of Pulses')
%     xlabel('Time (seconds)')
%     clear aa bb
% end

