function [CellStruct, AllCellsPSTHnormHit] = GetAllCellsPSTHnorm(CellStruct,preStim,postStim, binsize)
% Get PSTHs from RS cells with at least 5 trials

binNum = (postStim + preStim)/binsize;
CellNum = length(CellStruct);

AllCellsPSTHnormHit = zeros(binNum,CellNum);

for i = 1:length(CellStruct)
    if CellStruct(i).CellType == 1 %Only RS cells
        SpikeTimes = CellStruct(i).SpikeTimes;
        
        % Add mix trials
        if length(CellStruct(i).Mixes) ~=0
            Mixes = CellStruct(i).Mixes;
            Mixes(:,3) = 10;
            Microstims = [CellStruct(i).Microstims; Mixes];
        else
            Microstims = [CellStruct(i).Microstims];
        end
        
        
        % Hit trials
        HitIdx = find(Microstims(:,2) <= 1.2 & Microstims (:,2) > 0.1);
        HitTimes = Microstims(HitIdx,1);
        if length(HitTimes) > 4 % at least 5 trials
            [psthNormHit,numTrials, edges] = RasterPSTH (HitTimes, SpikeTimes, preStim, postStim, binsize,'mkplt', false );
            CellStruct(i).psthNorm = psthNormHit;
            CellStruct(i).HitNum = numTrials;
            AllCellsPSTHnormHit(:,i) = psthNormHit;
        end
        
%         % Miss trials
%         MissIdx = find(Microstims(:,2) ==-0.1);
%         MissTimes = Microstims(MissIdx,1);
%         if length(MissTimes) > 4 % at least 5 trials
%         [psthNormMiss,numTrials, edges] = RasterPSTH (MissTimes, SpikeTimes, preStim, postStim, binsize,'mkplt', false );
%         AllCellsPSTHnormMiss(:,i) = psthNormMiss;
%         end
    end
end