function out = fit_steadyE_tB_no_z(X,s,p,m,mask,plotFig,returnPred)

% This uses 'forwardTB.m to compute expected concentrations for erosional
% steady state followed by burial. No sediment cover.
%
% Syntax: out = fit_steadyE_tB_no_z(X,s,p,m,mask,plotFig,returnPred)
% 
% X is [erosion_rate(m/Myr) burial_time(Myr)]
% s,p,m are sample, production rate, muon production rate data structs
% plotFig is output of plotGISPdata.m
% returnPred is 0 or 1 to return misfit or predicted values
%
% 
% Greg Balco -- Berkeley Geochronology Center -- May 2016

if nargin < 7; returnPred = 0; end;
if nargin < 6; plotFig = []; end; 

% Unpack

td.ee = X(1).*1e-4.*2.7; % Erosion rate
tbur = X(2).*1e6;

td.tt = [15e6+tbur tbur]; % time sufficient to reach SS

td.zz = 0; % No cover

pred = forwardTB(td,s,p,m,plotFig);

for a = 1:length(s);
    miss(a) = ((pred.sum(a) - s{a}.N)./s{a}.dN).^2;
end;

if returnPred == 1;
    out = pred;
else
    out = sum(miss(mask)); 
end;

if ~isempty(plotFig);
    axes(plotFig(2));
    for a = 1:length(s);
        xx = [pred.sum(a) pred.sum(a)];
        for b = 1:length(s{a}.td);
            yy = [s{a}.td(b) s{a}.bd(b)];
            if isempty(findobj('tag',['predN' int2str(a) int2str(b)])); 
                plot(xx,yy,'g','tag',['predN' int2str(a) int2str(b)]);
                set(findobj('tag',['predN' int2str(a) int2str(b)]),'LineWidth',2);
            else
                set(findobj('tag',['predN' int2str(a) int2str(b)]),'xdata',xx,'ydata',yy);
            end;
        end;
    end;
    plottb(td.tt,plotFig(3));
end;

drawnow;