function [fr, fa, thr]=roc_from_1_stored_tape(goods,cntg,bads,cntb,keywrd); 
% [fr, fa, thr]=roc_from_1_stored_tape(goods,cntg,bads,cntb,keywrd); 
%
% see /home/cernocky/SPOTTING/STOOLKIT_HONZA/README_HONZA

THR_FROM = 0;  THR_TO = 3; THR_STEP = 0.05; 
thr = THR_FROM:THR_STEP:THR_TO;
len = length(thr);
fa = zeros(1,len); fr = zeros(1,len);

ind = 1;
for t=thr,
  fasum = 0; frsum = 0; 
  % first false alarms
  for ii=1:cntb
    if ~isempty(find(bads{ii} < t))
      fasum=fasum + 1;
    end
  end
  % now false rejects. 
  for ii=1:cntg
    if isempty(find(goods{ii} < t))
      frsum=frsum + 1;
    end
  end
  % store:
  fa(ind) = fasum; fr(ind) = frsum;
  ind = ind+1;
end
%loglog(fa,fr); xlabel('fa'); ylabel('fr'); title(keywrd); 
