% Copyright 2015 The MathWorks, Inc.

function rootId = getNormalModeRootId(rootId)

modelcovId = cv('get', rootId, '.modelcov');

modelcovId2 = getNormalModeModelcovId(modelcovId);

if isempty(modelcovId2) || (modelcovId == modelcovId2)
    return
end

rootId2 = cv('get', modelcovId2, '.activeRoot');
if rootId2 == 0
    rootId2 = cv('get', modelcovId2, '.rootTree.child');
end

if rootId2 ~= 0
    rootId = rootId2;
end
