function c = Wtot_test(el)

global K;
global L;
global N;
global M;
global Wtot;
global Cmiss;
global Cfalse;
global path_index;
global el_index;
global MM;
global MM_max;
global missed_cost;

if( nargin == 0)
  el = 1;
end

if( (el < 1) | (el > L))
  error( '1 <= el <= L required');
end


c = sum( Wtot( [1:K]+(path_index(N,el)-1)*K, el_index(N,el)));

p = paths(el);

for i = 1:N
  n = sum(p(i,:) <= MM_max);		% number of measurements used for tracks
  m = MM(i) - n;			% number of false detections
  c = c + Cmiss(n+1,K) + Cfalse(m+1);	% apriori costs
  if( i > 1)				% missed target costs only for i>1
    c = c + m*missed_cost;
  end
end
