function TSout=makeOneTraj(inFRET,means,tw)


anf=1;
for i=1:length(inFRET)
     eff=effer(timewindow(inFRET(1,i).counts,tw));
     ende=length(eff)
   
     OutStates(i,1)=find(means>inFRET(1,i).NPvarmeans(1,2),1)-1;
TSout(anf:anf-1+ende,1:2)=[eff,i*ones(ende,1)-1];
anf=anf+ende;
end
for i=1:length(means)-1
FoundStates=find(OutStates(:,1)==i);
for k=1:length(FoundStates)
TSout(TSout(:,2)==FoundStates(k),3)=(i-1)*ones;
end
clear FoundStates
end