% load data
clear
load advirgo1_dd_hp.mat
opt = adVirgo1_dd_hp;

% get mirror numbers
nIMX = getDriveIndex(opt, 'IMX');
nIMY = getDriveIndex(opt, 'IMY');
nEMX = getDriveIndex(opt, 'EMX');
nEMY = getDriveIndex(opt, 'EMY');
nPRM = getDriveIndex(opt, 'PRM');
nSRM = getDriveIndex(opt, 'SRM');
nBS  = getDriveIndex(opt, 'BS');

% get photo-diodes numbers
nXP_SB1_P   = getProbeNum(opt, 'XP_SB1_P');
nXP_SB1_Q   = getProbeNum(opt, 'XP_SB1_Q');
nXP_2M1_P   = getProbeNum(opt, 'XP_2M1_P');
nXP_2M1_Q   = getProbeNum(opt, 'XP_2M1_Q');
nXP_3P1_P   = getProbeNum(opt, 'XP_3P1_P');
nXP_3P1_Q   = getProbeNum(opt, 'XP_3P1_Q');

nYP_SB1_P   = getProbeNum(opt, 'YP_SB1_P');
nYP_SB1_Q   = getProbeNum(opt, 'YP_SB1_Q');
nYP_2M1_P   = getProbeNum(opt, 'YP_2M1_P');
nYP_2M1_Q   = getProbeNum(opt, 'YP_2M1_Q');
nYP_3P1_P   = getProbeNum(opt, 'YP_3P1_P');
nYP_3P1_Q   = getProbeNum(opt, 'YP_3P1_Q');

nSYM_SB1_P   = getProbeNum(opt, 'SYM_SB1_P');
nSYM_SB1_Q   = getProbeNum(opt, 'SYM_SB1_Q');
nSYM_2M1_P   = getProbeNum(opt, 'SYM_2M1_P');
nSYM_2M1_Q   = getProbeNum(opt, 'SYM_2M1_Q');
nSYM_3P1_P   = getProbeNum(opt, 'SYM_3P1_P');
nSYM_3P1_Q   = getProbeNum(opt, 'SYM_3P1_Q');

nASYp_SB1_P   = getProbeNum(opt, 'ASYp_SB1_P');
nASYp_SB1_Q   = getProbeNum(opt, 'ASYp_SB1_Q');
nASYp_2M1_P   = getProbeNum(opt, 'ASYp_2M1_P');
nASYp_2M1_Q   = getProbeNum(opt, 'ASYp_2M1_Q');
nASYp_3P1_P   = getProbeNum(opt, 'ASYp_3P1_P');
nASYp_3P1_Q   = getProbeNum(opt, 'ASYp_3P1_Q');

nPOBS_SB1_P   = getProbeNum(opt, 'POBS_SB1_P');
nPOBS_SB1_Q   = getProbeNum(opt, 'POBS_SB1_Q');
nPOBS_2M1_P   = getProbeNum(opt, 'POBS_2M1_P');
nPOBS_2M1_Q   = getProbeNum(opt, 'POBS_2M1_Q');
nPOBS_3P1_P   = getProbeNum(opt, 'POBS_3P1_P');
nPOBS_3P1_Q   = getProbeNum(opt, 'POBS_3P1_Q');

nPOX_SB1_P   = getProbeNum(opt, 'POX_SB1_P');
nPOX_SB1_Q   = getProbeNum(opt, 'POX_SB1_Q');
nPOX_2M1_P   = getProbeNum(opt, 'POX_2M1_P');
nPOX_2M1_Q   = getProbeNum(opt, 'POX_2M1_Q');
nPOX_3P1_P   = getProbeNum(opt, 'POX_3P1_P');
nPOX_3P1_Q   = getProbeNum(opt, 'POX_3P1_Q');

nPOY_SB1_P   = getProbeNum(opt, 'POY_SB1_P');
nPOY_SB1_Q   = getProbeNum(opt, 'POY_SB1_Q');
nPOY_2M1_P   = getProbeNum(opt, 'POY_2M1_P');
nPOY_2M1_Q   = getProbeNum(opt, 'POY_2M1_Q');
nPOY_3P1_P   = getProbeNum(opt, 'POY_3P1_P');
nPOY_3P1_Q   = getProbeNum(opt, 'POY_3P1_Q');

nASY_DC      = getProbeNum(opt, 'ASY_DC');

% extract transfer functions (in W/m, normalized to 100 W input)

%%%%% DARM %%%%%
DARM_ASYp_SB1_P = (0.5*getTF(sigAC1hp, nASYp_SB1_P, nEMX) - 0.5*getTF(sigAC1hp, nASYp_SB1_P, nEMY));
DARM_ASYp_SB1_Q = (0.5*getTF(sigAC1hp, nASYp_SB1_Q, nEMX) - 0.5*getTF(sigAC1hp, nASYp_SB1_Q, nEMY));
DARM_ASYp_2M1_P = (0.5*getTF(sigAC1hp, nASYp_2M1_P, nEMX) - 0.5*getTF(sigAC1hp, nASYp_2M1_P, nEMY));
DARM_ASYp_2M1_Q = (0.5*getTF(sigAC1hp, nASYp_2M1_Q, nEMX) - 0.5*getTF(sigAC1hp, nASYp_2M1_Q, nEMY));
DARM_ASYp_3P1_P = (0.5*getTF(sigAC1hp, nASYp_3P1_P, nEMX) - 0.5*getTF(sigAC1hp, nASYp_3P1_P, nEMY));
DARM_ASYp_3P1_Q = (0.5*getTF(sigAC1hp, nASYp_3P1_Q, nEMX) - 0.5*getTF(sigAC1hp, nASYp_3P1_Q, nEMY));

DARM_SYM_SB1_P = (0.5*getTF(sigAC1hp, nSYM_SB1_P, nEMX) - 0.5*getTF(sigAC1hp, nSYM_SB1_P, nEMY));
DARM_SYM_SB1_Q = (0.5*getTF(sigAC1hp, nSYM_SB1_Q, nEMX) - 0.5*getTF(sigAC1hp, nSYM_SB1_Q, nEMY));
DARM_SYM_2M1_P = (0.5*getTF(sigAC1hp, nSYM_2M1_P, nEMX) - 0.5*getTF(sigAC1hp, nSYM_2M1_P, nEMY));
DARM_SYM_2M1_Q = (0.5*getTF(sigAC1hp, nSYM_2M1_Q, nEMX) - 0.5*getTF(sigAC1hp, nSYM_2M1_Q, nEMY));
DARM_SYM_3P1_P = (0.5*getTF(sigAC1hp, nSYM_3P1_P, nEMX) - 0.5*getTF(sigAC1hp, nSYM_3P1_P, nEMY));
DARM_SYM_3P1_Q = (0.5*getTF(sigAC1hp, nSYM_3P1_Q, nEMX) - 0.5*getTF(sigAC1hp, nSYM_3P1_Q, nEMY));

DARM_POBS_SB1_P = (0.5*getTF(sigAC1hp, nPOBS_SB1_P, nEMX) - 0.5*getTF(sigAC1hp, nPOBS_SB1_P, nEMY));
DARM_POBS_SB1_Q = (0.5*getTF(sigAC1hp, nPOBS_SB1_Q, nEMX) - 0.5*getTF(sigAC1hp, nPOBS_SB1_Q, nEMY));
DARM_POBS_2M1_P = (0.5*getTF(sigAC1hp, nPOBS_2M1_P, nEMX) - 0.5*getTF(sigAC1hp, nPOBS_2M1_P, nEMY));
DARM_POBS_2M1_Q = (0.5*getTF(sigAC1hp, nPOBS_2M1_Q, nEMX) - 0.5*getTF(sigAC1hp, nPOBS_2M1_Q, nEMY));
DARM_POBS_3P1_P = (0.5*getTF(sigAC1hp, nPOBS_3P1_P, nEMX) - 0.5*getTF(sigAC1hp, nPOBS_3P1_P, nEMY));
DARM_POBS_3P1_Q = (0.5*getTF(sigAC1hp, nPOBS_3P1_Q, nEMX) - 0.5*getTF(sigAC1hp, nPOBS_3P1_Q, nEMY));

DARM_POX_SB1_P = (0.5*getTF(sigAC1hp, nPOX_SB1_P, nEMX) - 0.5*getTF(sigAC1hp, nPOX_SB1_P, nEMY));
DARM_POX_SB1_Q = (0.5*getTF(sigAC1hp, nPOX_SB1_Q, nEMX) - 0.5*getTF(sigAC1hp, nPOX_SB1_Q, nEMY));
DARM_POX_2M1_P = (0.5*getTF(sigAC1hp, nPOX_2M1_P, nEMX) - 0.5*getTF(sigAC1hp, nPOX_2M1_P, nEMY));
DARM_POX_2M1_Q = (0.5*getTF(sigAC1hp, nPOX_2M1_Q, nEMX) - 0.5*getTF(sigAC1hp, nPOX_2M1_Q, nEMY));
DARM_POX_3P1_P = (0.5*getTF(sigAC1hp, nPOX_3P1_P, nEMX) - 0.5*getTF(sigAC1hp, nPOX_3P1_P, nEMY));
DARM_POX_3P1_Q = (0.5*getTF(sigAC1hp, nPOX_3P1_Q, nEMX) - 0.5*getTF(sigAC1hp, nPOX_3P1_Q, nEMY));

DARM_POY_SB1_P = (0.5*getTF(sigAC1hp, nPOY_SB1_P, nEMX) - 0.5*getTF(sigAC1hp, nPOY_SB1_P, nEMY));
DARM_POY_SB1_Q = (0.5*getTF(sigAC1hp, nPOY_SB1_Q, nEMX) - 0.5*getTF(sigAC1hp, nPOY_SB1_Q, nEMY));
DARM_POY_2M1_P = (0.5*getTF(sigAC1hp, nPOY_2M1_P, nEMX) - 0.5*getTF(sigAC1hp, nPOY_2M1_P, nEMY));
DARM_POY_2M1_Q = (0.5*getTF(sigAC1hp, nPOY_2M1_Q, nEMX) - 0.5*getTF(sigAC1hp, nPOY_2M1_Q, nEMY));
DARM_POY_3P1_P = (0.5*getTF(sigAC1hp, nPOY_3P1_P, nEMX) - 0.5*getTF(sigAC1hp, nPOY_3P1_P, nEMY));
DARM_POY_3P1_Q = (0.5*getTF(sigAC1hp, nPOY_3P1_Q, nEMX) - 0.5*getTF(sigAC1hp, nPOY_3P1_Q, nEMY));

DARM_XP_SB1_P = (0.5*getTF(sigAC1hp, nXP_SB1_P, nEMX) - 0.5*getTF(sigAC1hp, nXP_SB1_P, nEMY));
DARM_XP_SB1_Q = (0.5*getTF(sigAC1hp, nXP_SB1_Q, nEMX) - 0.5*getTF(sigAC1hp, nXP_SB1_Q, nEMY));
DARM_XP_2M1_P = (0.5*getTF(sigAC1hp, nXP_2M1_P, nEMX) - 0.5*getTF(sigAC1hp, nXP_2M1_P, nEMY));
DARM_XP_2M1_Q = (0.5*getTF(sigAC1hp, nXP_2M1_Q, nEMX) - 0.5*getTF(sigAC1hp, nXP_2M1_Q, nEMY));
DARM_XP_3P1_P = (0.5*getTF(sigAC1hp, nXP_3P1_P, nEMX) - 0.5*getTF(sigAC1hp, nXP_3P1_P, nEMY));
DARM_XP_3P1_Q = (0.5*getTF(sigAC1hp, nXP_3P1_Q, nEMX) - 0.5*getTF(sigAC1hp, nXP_3P1_Q, nEMY));

DARM_YP_SB1_P = (0.5*getTF(sigAC1hp, nYP_SB1_P, nEMX) - 0.5*getTF(sigAC1hp, nYP_SB1_P, nEMY));
DARM_YP_SB1_Q = (0.5*getTF(sigAC1hp, nYP_SB1_Q, nEMX) - 0.5*getTF(sigAC1hp, nYP_SB1_Q, nEMY));
DARM_YP_2M1_P = (0.5*getTF(sigAC1hp, nYP_2M1_P, nEMX) - 0.5*getTF(sigAC1hp, nYP_2M1_P, nEMY));
DARM_YP_2M1_Q = (0.5*getTF(sigAC1hp, nYP_2M1_Q, nEMX) - 0.5*getTF(sigAC1hp, nYP_2M1_Q, nEMY));
DARM_YP_3P1_P = (0.5*getTF(sigAC1hp, nYP_3P1_P, nEMX) - 0.5*getTF(sigAC1hp, nYP_3P1_P, nEMY));
DARM_YP_3P1_Q = (0.5*getTF(sigAC1hp, nYP_3P1_Q, nEMX) - 0.5*getTF(sigAC1hp, nYP_3P1_Q, nEMY));

DARM_ASY_DC = (0.5*getTF(sigAC1hp, nASY_DC, nEMX) - 0.5*getTF(sigAC1hp, nASY_DC, nEMY));

%%%%% CARM %%%%%
CARM_ASYp_SB1_P = (getTF(sigAC1hp, nASYp_SB1_P, nEMX) + getTF(sigAC1hp, nASYp_SB1_P, nEMY));
CARM_ASYp_SB1_Q = (getTF(sigAC1hp, nASYp_SB1_Q, nEMX) + getTF(sigAC1hp, nASYp_SB1_Q, nEMY));
CARM_ASYp_2M1_P = (getTF(sigAC1hp, nASYp_2M1_P, nEMX) + getTF(sigAC1hp, nASYp_2M1_P, nEMY));
CARM_ASYp_2M1_Q = (getTF(sigAC1hp, nASYp_2M1_Q, nEMX) + getTF(sigAC1hp, nASYp_2M1_Q, nEMY));
CARM_ASYp_3P1_P = (getTF(sigAC1hp, nASYp_3P1_P, nEMX) + getTF(sigAC1hp, nASYp_3P1_P, nEMY));
CARM_ASYp_3P1_Q = (getTF(sigAC1hp, nASYp_3P1_Q, nEMX) + getTF(sigAC1hp, nASYp_3P1_Q, nEMY));

CARM_SYM_SB1_P = (getTF(sigAC1hp, nSYM_SB1_P, nEMX) + getTF(sigAC1hp, nSYM_SB1_P, nEMY));
CARM_SYM_SB1_Q = (getTF(sigAC1hp, nSYM_SB1_Q, nEMX) + getTF(sigAC1hp, nSYM_SB1_Q, nEMY));
CARM_SYM_2M1_P = (getTF(sigAC1hp, nSYM_2M1_P, nEMX) + getTF(sigAC1hp, nSYM_2M1_P, nEMY));
CARM_SYM_2M1_Q = (getTF(sigAC1hp, nSYM_2M1_Q, nEMX) + getTF(sigAC1hp, nSYM_2M1_Q, nEMY));
CARM_SYM_3P1_P = (getTF(sigAC1hp, nSYM_3P1_P, nEMX) + getTF(sigAC1hp, nSYM_3P1_P, nEMY));
CARM_SYM_3P1_Q = (getTF(sigAC1hp, nSYM_3P1_Q, nEMX) + getTF(sigAC1hp, nSYM_3P1_Q, nEMY));

CARM_POBS_SB1_P = (getTF(sigAC1hp, nPOBS_SB1_P, nEMX) + getTF(sigAC1hp, nPOBS_SB1_P, nEMY));
CARM_POBS_SB1_Q = (getTF(sigAC1hp, nPOBS_SB1_Q, nEMX) + getTF(sigAC1hp, nPOBS_SB1_Q, nEMY));
CARM_POBS_2M1_P = (getTF(sigAC1hp, nPOBS_2M1_P, nEMX) + getTF(sigAC1hp, nPOBS_2M1_P, nEMY));
CARM_POBS_2M1_Q = (getTF(sigAC1hp, nPOBS_2M1_Q, nEMX) + getTF(sigAC1hp, nPOBS_2M1_Q, nEMY));
CARM_POBS_3P1_P = (getTF(sigAC1hp, nPOBS_3P1_P, nEMX) + getTF(sigAC1hp, nPOBS_3P1_P, nEMY));
CARM_POBS_3P1_Q = (getTF(sigAC1hp, nPOBS_3P1_Q, nEMX) + getTF(sigAC1hp, nPOBS_3P1_Q, nEMY));

CARM_POX_SB1_P = (getTF(sigAC1hp, nPOX_SB1_P, nEMX) + getTF(sigAC1hp, nPOX_SB1_P, nEMY));
CARM_POX_SB1_Q = (getTF(sigAC1hp, nPOX_SB1_Q, nEMX) + getTF(sigAC1hp, nPOX_SB1_Q, nEMY));
CARM_POX_2M1_P = (getTF(sigAC1hp, nPOX_2M1_P, nEMX) + getTF(sigAC1hp, nPOX_2M1_P, nEMY));
CARM_POX_2M1_Q = (getTF(sigAC1hp, nPOX_2M1_Q, nEMX) + getTF(sigAC1hp, nPOX_2M1_Q, nEMY));
CARM_POX_3P1_P = (getTF(sigAC1hp, nPOX_3P1_P, nEMX) + getTF(sigAC1hp, nPOX_3P1_P, nEMY));
CARM_POX_3P1_Q = (getTF(sigAC1hp, nPOX_3P1_Q, nEMX) + getTF(sigAC1hp, nPOX_3P1_Q, nEMY));

CARM_POY_SB1_P = (getTF(sigAC1hp, nPOY_SB1_P, nEMX) + getTF(sigAC1hp, nPOY_SB1_P, nEMY));
CARM_POY_SB1_Q = (getTF(sigAC1hp, nPOY_SB1_Q, nEMX) + getTF(sigAC1hp, nPOY_SB1_Q, nEMY));
CARM_POY_2M1_P = (getTF(sigAC1hp, nPOY_2M1_P, nEMX) + getTF(sigAC1hp, nPOY_2M1_P, nEMY));
CARM_POY_2M1_Q = (getTF(sigAC1hp, nPOY_2M1_Q, nEMX) + getTF(sigAC1hp, nPOY_2M1_Q, nEMY));
CARM_POY_3P1_P = (getTF(sigAC1hp, nPOY_3P1_P, nEMX) + getTF(sigAC1hp, nPOY_3P1_P, nEMY));
CARM_POY_3P1_Q = (getTF(sigAC1hp, nPOY_3P1_Q, nEMX) + getTF(sigAC1hp, nPOY_3P1_Q, nEMY));

CARM_XP_SB1_P = (getTF(sigAC1hp, nXP_SB1_P, nEMX) + getTF(sigAC1hp, nXP_SB1_P, nEMY));
CARM_XP_SB1_Q = (getTF(sigAC1hp, nXP_SB1_Q, nEMX) + getTF(sigAC1hp, nXP_SB1_Q, nEMY));
CARM_XP_2M1_P = (getTF(sigAC1hp, nXP_2M1_P, nEMX) + getTF(sigAC1hp, nXP_2M1_P, nEMY));
CARM_XP_2M1_Q = (getTF(sigAC1hp, nXP_2M1_Q, nEMX) + getTF(sigAC1hp, nXP_2M1_Q, nEMY));
CARM_XP_3P1_P = (getTF(sigAC1hp, nXP_3P1_P, nEMX) + getTF(sigAC1hp, nXP_3P1_P, nEMY));
CARM_XP_3P1_Q = (getTF(sigAC1hp, nXP_3P1_Q, nEMX) + getTF(sigAC1hp, nXP_3P1_Q, nEMY));

CARM_YP_SB1_P = (getTF(sigAC1hp, nYP_SB1_P, nEMX) + getTF(sigAC1hp, nYP_SB1_P, nEMY));
CARM_YP_SB1_Q = (getTF(sigAC1hp, nYP_SB1_Q, nEMX) + getTF(sigAC1hp, nYP_SB1_Q, nEMY));
CARM_YP_2M1_P = (getTF(sigAC1hp, nYP_2M1_P, nEMX) + getTF(sigAC1hp, nYP_2M1_P, nEMY));
CARM_YP_2M1_Q = (getTF(sigAC1hp, nYP_2M1_Q, nEMX) + getTF(sigAC1hp, nYP_2M1_Q, nEMY));
CARM_YP_3P1_P = (getTF(sigAC1hp, nYP_3P1_P, nEMX) + getTF(sigAC1hp, nYP_3P1_P, nEMY));
CARM_YP_3P1_Q = (getTF(sigAC1hp, nYP_3P1_Q, nEMX) + getTF(sigAC1hp, nYP_3P1_Q, nEMY));

CARM_ASY_DC = (getTF(sigAC1hp, nASY_DC, nEMX) + getTF(sigAC1hp, nASY_DC, nEMY));

%%%%% PRCL %%%%%
PRCL_ASYp_SB1_P = (-getTF(sigAC1hp, nASYp_SB1_P, nPRM));
PRCL_ASYp_SB1_Q = (-getTF(sigAC1hp, nASYp_SB1_Q, nPRM));
PRCL_ASYp_2M1_P = (-getTF(sigAC1hp, nASYp_2M1_P, nPRM));
PRCL_ASYp_2M1_Q = (-getTF(sigAC1hp, nASYp_2M1_Q, nPRM));
PRCL_ASYp_3P1_P = (-getTF(sigAC1hp, nASYp_3P1_P, nPRM));
PRCL_ASYp_3P1_Q = (-getTF(sigAC1hp, nASYp_3P1_Q, nPRM));

PRCL_SYM_SB1_P = (-getTF(sigAC1hp, nSYM_SB1_P, nPRM));
PRCL_SYM_SB1_Q = (-getTF(sigAC1hp, nSYM_SB1_Q, nPRM));
PRCL_SYM_2M1_P = (-getTF(sigAC1hp, nSYM_2M1_P, nPRM));
PRCL_SYM_2M1_Q = (-getTF(sigAC1hp, nSYM_2M1_Q, nPRM));
PRCL_SYM_3P1_P = (-getTF(sigAC1hp, nSYM_3P1_P, nPRM));
PRCL_SYM_3P1_Q = (-getTF(sigAC1hp, nSYM_3P1_Q, nPRM));

PRCL_POBS_SB1_P = (-getTF(sigAC1hp, nPOBS_SB1_P, nPRM));
PRCL_POBS_SB1_Q = (-getTF(sigAC1hp, nPOBS_SB1_Q, nPRM));
PRCL_POBS_2M1_P = (-getTF(sigAC1hp, nPOBS_2M1_P, nPRM));
PRCL_POBS_2M1_Q = (-getTF(sigAC1hp, nPOBS_2M1_Q, nPRM));
PRCL_POBS_3P1_P = (-getTF(sigAC1hp, nPOBS_3P1_P, nPRM));
PRCL_POBS_3P1_Q = (-getTF(sigAC1hp, nPOBS_3P1_Q, nPRM));

PRCL_POX_SB1_P = (-getTF(sigAC1hp, nPOX_SB1_P, nPRM));
PRCL_POX_SB1_Q = (-getTF(sigAC1hp, nPOX_SB1_Q, nPRM));
PRCL_POX_2M1_P = (-getTF(sigAC1hp, nPOX_2M1_P, nPRM));
PRCL_POX_2M1_Q = (-getTF(sigAC1hp, nPOX_2M1_Q, nPRM));
PRCL_POX_3P1_P = (-getTF(sigAC1hp, nPOX_3P1_P, nPRM));
PRCL_POX_3P1_Q = (-getTF(sigAC1hp, nPOX_3P1_Q, nPRM));

PRCL_POY_SB1_P = (-getTF(sigAC1hp, nPOY_SB1_P, nPRM));
PRCL_POY_SB1_Q = (-getTF(sigAC1hp, nPOY_SB1_Q, nPRM));
PRCL_POY_2M1_P = (-getTF(sigAC1hp, nPOY_2M1_P, nPRM));
PRCL_POY_2M1_Q = (-getTF(sigAC1hp, nPOY_2M1_Q, nPRM));
PRCL_POY_3P1_P = (-getTF(sigAC1hp, nPOY_3P1_P, nPRM));
PRCL_POY_3P1_Q = (-getTF(sigAC1hp, nPOY_3P1_Q, nPRM));

PRCL_XP_SB1_P = (-getTF(sigAC1hp, nXP_SB1_P, nPRM));
PRCL_XP_SB1_Q = (-getTF(sigAC1hp, nXP_SB1_Q, nPRM));
PRCL_XP_2M1_P = (-getTF(sigAC1hp, nXP_2M1_P, nPRM));
PRCL_XP_2M1_Q = (-getTF(sigAC1hp, nXP_2M1_Q, nPRM));
PRCL_XP_3P1_P = (-getTF(sigAC1hp, nXP_3P1_P, nPRM));
PRCL_XP_3P1_Q = (-getTF(sigAC1hp, nXP_3P1_Q, nPRM));

PRCL_YP_SB1_P = (-getTF(sigAC1hp, nYP_SB1_P, nPRM));
PRCL_YP_SB1_Q = (-getTF(sigAC1hp, nYP_SB1_Q, nPRM));
PRCL_YP_2M1_P = (-getTF(sigAC1hp, nYP_2M1_P, nPRM));
PRCL_YP_2M1_Q = (-getTF(sigAC1hp, nYP_2M1_Q, nPRM));
PRCL_YP_3P1_P = (-getTF(sigAC1hp, nYP_3P1_P, nPRM));
PRCL_YP_3P1_Q = (-getTF(sigAC1hp, nYP_3P1_Q, nPRM));

PRCL_ASY_DC = (-getTF(sigAC1hp, nASY_DC, nPRM));

%%%%% MICH %%%%%
MICH_ASYp_SB1_P = (-0.5*getTF(sigAC1hp, nASYp_SB1_P, nPRM) + 0.5*getTF(sigAC1hp, nASYp_SB1_P, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nASYp_SB1_P, nBS));
MICH_ASYp_SB1_Q = (-0.5*getTF(sigAC1hp, nASYp_SB1_Q, nPRM) + 0.5*getTF(sigAC1hp, nASYp_SB1_Q, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nASYp_SB1_Q, nBS));
MICH_ASYp_2M1_P = (-0.5*getTF(sigAC1hp, nASYp_2M1_P, nPRM) + 0.5*getTF(sigAC1hp, nASYp_2M1_P, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nASYp_2M1_P, nBS));
MICH_ASYp_2M1_Q = (-0.5*getTF(sigAC1hp, nASYp_2M1_Q, nPRM) + 0.5*getTF(sigAC1hp, nASYp_2M1_Q, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nASYp_2M1_Q, nBS));
MICH_ASYp_3P1_P = (-0.5*getTF(sigAC1hp, nASYp_3P1_P, nPRM) + 0.5*getTF(sigAC1hp, nASYp_3P1_P, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nASYp_3P1_P, nBS));
MICH_ASYp_3P1_Q = (-0.5*getTF(sigAC1hp, nASYp_3P1_Q, nPRM) + 0.5*getTF(sigAC1hp, nASYp_3P1_Q, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nASYp_3P1_Q, nBS));

MICH_SYM_SB1_P = (-0.5*getTF(sigAC1hp, nSYM_SB1_P, nPRM) + 0.5*getTF(sigAC1hp, nSYM_SB1_P, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nSYM_SB1_P, nBS));
MICH_SYM_SB1_Q = (-0.5*getTF(sigAC1hp, nSYM_SB1_Q, nPRM) + 0.5*getTF(sigAC1hp, nSYM_SB1_Q, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nSYM_SB1_Q, nBS));
MICH_SYM_2M1_P = (-0.5*getTF(sigAC1hp, nSYM_2M1_P, nPRM) + 0.5*getTF(sigAC1hp, nSYM_2M1_P, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nSYM_2M1_P, nBS));
MICH_SYM_2M1_Q = (-0.5*getTF(sigAC1hp, nSYM_2M1_Q, nPRM) + 0.5*getTF(sigAC1hp, nSYM_2M1_Q, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nSYM_2M1_Q, nBS));
MICH_SYM_3P1_P = (-0.5*getTF(sigAC1hp, nSYM_3P1_P, nPRM) + 0.5*getTF(sigAC1hp, nSYM_3P1_P, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nSYM_3P1_P, nBS));
MICH_SYM_3P1_Q = (-0.5*getTF(sigAC1hp, nSYM_3P1_Q, nPRM) + 0.5*getTF(sigAC1hp, nSYM_3P1_Q, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nSYM_3P1_Q, nBS));

MICH_POBS_SB1_P = (-0.5*getTF(sigAC1hp, nPOBS_SB1_P, nPRM) + 0.5*getTF(sigAC1hp, nPOBS_SB1_P, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nPOBS_SB1_P, nBS));
MICH_POBS_SB1_Q = (-0.5*getTF(sigAC1hp, nPOBS_SB1_Q, nPRM) + 0.5*getTF(sigAC1hp, nPOBS_SB1_Q, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nPOBS_SB1_Q, nBS));
MICH_POBS_2M1_P = (-0.5*getTF(sigAC1hp, nPOBS_2M1_P, nPRM) + 0.5*getTF(sigAC1hp, nPOBS_2M1_P, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nPOBS_2M1_P, nBS));
MICH_POBS_2M1_Q = (-0.5*getTF(sigAC1hp, nPOBS_2M1_Q, nPRM) + 0.5*getTF(sigAC1hp, nPOBS_2M1_Q, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nPOBS_2M1_Q, nBS));
MICH_POBS_3P1_P = (-0.5*getTF(sigAC1hp, nPOBS_3P1_P, nPRM) + 0.5*getTF(sigAC1hp, nPOBS_3P1_P, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nPOBS_3P1_P, nBS));
MICH_POBS_3P1_Q = (-0.5*getTF(sigAC1hp, nPOBS_3P1_Q, nPRM) + 0.5*getTF(sigAC1hp, nPOBS_3P1_Q, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nPOBS_3P1_Q, nBS));

MICH_POX_SB1_P = (-0.5*getTF(sigAC1hp, nPOX_SB1_P, nPRM) + 0.5*getTF(sigAC1hp, nPOX_SB1_P, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nPOX_SB1_P, nBS));
MICH_POX_SB1_Q = (-0.5*getTF(sigAC1hp, nPOX_SB1_Q, nPRM) + 0.5*getTF(sigAC1hp, nPOX_SB1_Q, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nPOX_SB1_Q, nBS));
MICH_POX_2M1_P = (-0.5*getTF(sigAC1hp, nPOX_2M1_P, nPRM) + 0.5*getTF(sigAC1hp, nPOX_2M1_P, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nPOX_2M1_P, nBS));
MICH_POX_2M1_Q = (-0.5*getTF(sigAC1hp, nPOX_2M1_Q, nPRM) + 0.5*getTF(sigAC1hp, nPOX_2M1_Q, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nPOX_2M1_Q, nBS));
MICH_POX_3P1_P = (-0.5*getTF(sigAC1hp, nPOX_3P1_P, nPRM) + 0.5*getTF(sigAC1hp, nPOX_3P1_P, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nPOX_3P1_P, nBS));
MICH_POX_3P1_Q = (-0.5*getTF(sigAC1hp, nPOX_3P1_Q, nPRM) + 0.5*getTF(sigAC1hp, nPOX_3P1_Q, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nPOX_3P1_Q, nBS));

MICH_POY_SB1_P = (-0.5*getTF(sigAC1hp, nPOY_SB1_P, nPRM) + 0.5*getTF(sigAC1hp, nPOY_SB1_P, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nPOY_SB1_P, nBS));
MICH_POY_SB1_Q = (-0.5*getTF(sigAC1hp, nPOY_SB1_Q, nPRM) + 0.5*getTF(sigAC1hp, nPOY_SB1_Q, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nPOY_SB1_Q, nBS));
MICH_POY_2M1_P = (-0.5*getTF(sigAC1hp, nPOY_2M1_P, nPRM) + 0.5*getTF(sigAC1hp, nPOY_2M1_P, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nPOY_2M1_P, nBS));
MICH_POY_2M1_Q = (-0.5*getTF(sigAC1hp, nPOY_2M1_Q, nPRM) + 0.5*getTF(sigAC1hp, nPOY_2M1_Q, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nPOY_2M1_Q, nBS));
MICH_POY_3P1_P = (-0.5*getTF(sigAC1hp, nPOY_3P1_P, nPRM) + 0.5*getTF(sigAC1hp, nPOY_3P1_P, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nPOY_3P1_P, nBS));
MICH_POY_3P1_Q = (-0.5*getTF(sigAC1hp, nPOY_3P1_Q, nPRM) + 0.5*getTF(sigAC1hp, nPOY_3P1_Q, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nPOY_3P1_Q, nBS));

MICH_XP_SB1_P = (-0.5*getTF(sigAC1hp, nXP_SB1_P, nPRM) + 0.5*getTF(sigAC1hp, nXP_SB1_P, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nXP_SB1_P, nBS));
MICH_XP_SB1_Q = (-0.5*getTF(sigAC1hp, nXP_SB1_Q, nPRM) + 0.5*getTF(sigAC1hp, nXP_SB1_Q, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nXP_SB1_Q, nBS));
MICH_XP_2M1_P = (-0.5*getTF(sigAC1hp, nXP_2M1_P, nPRM) + 0.5*getTF(sigAC1hp, nXP_2M1_P, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nXP_2M1_P, nBS));
MICH_XP_2M1_Q = (-0.5*getTF(sigAC1hp, nXP_2M1_Q, nPRM) + 0.5*getTF(sigAC1hp, nXP_2M1_Q, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nXP_2M1_Q, nBS));
MICH_XP_3P1_P = (-0.5*getTF(sigAC1hp, nXP_3P1_P, nPRM) + 0.5*getTF(sigAC1hp, nXP_3P1_P, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nXP_3P1_P, nBS));
MICH_XP_3P1_Q = (-0.5*getTF(sigAC1hp, nXP_3P1_Q, nPRM) + 0.5*getTF(sigAC1hp, nXP_3P1_Q, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nXP_3P1_Q, nBS));

MICH_YP_SB1_P = (-0.5*getTF(sigAC1hp, nYP_SB1_P, nPRM) + 0.5*getTF(sigAC1hp, nYP_SB1_P, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nYP_SB1_P, nBS));
MICH_YP_SB1_Q = (-0.5*getTF(sigAC1hp, nYP_SB1_Q, nPRM) + 0.5*getTF(sigAC1hp, nYP_SB1_Q, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nYP_SB1_Q, nBS));
MICH_YP_2M1_P = (-0.5*getTF(sigAC1hp, nYP_2M1_P, nPRM) + 0.5*getTF(sigAC1hp, nYP_2M1_P, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nYP_2M1_P, nBS));
MICH_YP_2M1_Q = (-0.5*getTF(sigAC1hp, nYP_2M1_Q, nPRM) + 0.5*getTF(sigAC1hp, nYP_2M1_Q, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nYP_2M1_Q, nBS));
MICH_YP_3P1_P = (-0.5*getTF(sigAC1hp, nYP_3P1_P, nPRM) + 0.5*getTF(sigAC1hp, nYP_3P1_P, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nYP_3P1_P, nBS));
MICH_YP_3P1_Q = (-0.5*getTF(sigAC1hp, nYP_3P1_Q, nPRM) + 0.5*getTF(sigAC1hp, nYP_3P1_Q, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nYP_3P1_Q, nBS));

MICH_ASY_DC = (-0.5*getTF(sigAC1hp, nASY_DC, nPRM) + 0.5*getTF(sigAC1hp, nASY_DC, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nASY_DC, nBS));

%%%%% SRCL %%%%%
SRCL_ASYp_SB1_P = (-getTF(sigAC1hp, nASYp_SB1_P, nSRM));
SRCL_ASYp_SB1_Q = (-getTF(sigAC1hp, nASYp_SB1_Q, nSRM));
SRCL_ASYp_2M1_P = (-getTF(sigAC1hp, nASYp_2M1_P, nSRM));
SRCL_ASYp_2M1_Q = (-getTF(sigAC1hp, nASYp_2M1_Q, nSRM));
SRCL_ASYp_3P1_P = (-getTF(sigAC1hp, nASYp_3P1_P, nSRM));
SRCL_ASYp_3P1_Q = (-getTF(sigAC1hp, nASYp_3P1_Q, nSRM));

SRCL_SYM_SB1_P = (-getTF(sigAC1hp, nSYM_SB1_P, nSRM));
SRCL_SYM_SB1_Q = (-getTF(sigAC1hp, nSYM_SB1_Q, nSRM));
SRCL_SYM_2M1_P = (-getTF(sigAC1hp, nSYM_2M1_P, nSRM));
SRCL_SYM_2M1_Q = (-getTF(sigAC1hp, nSYM_2M1_Q, nSRM));
SRCL_SYM_3P1_P = (-getTF(sigAC1hp, nSYM_3P1_P, nSRM));
SRCL_SYM_3P1_Q = (-getTF(sigAC1hp, nSYM_3P1_Q, nSRM));

SRCL_POBS_SB1_P = (-getTF(sigAC1hp, nPOBS_SB1_P, nSRM));
SRCL_POBS_SB1_Q = (-getTF(sigAC1hp, nPOBS_SB1_Q, nSRM));
SRCL_POBS_2M1_P = (-getTF(sigAC1hp, nPOBS_2M1_P, nSRM));
SRCL_POBS_2M1_Q = (-getTF(sigAC1hp, nPOBS_2M1_Q, nSRM));
SRCL_POBS_3P1_P = (-getTF(sigAC1hp, nPOBS_3P1_P, nSRM));
SRCL_POBS_3P1_Q = (-getTF(sigAC1hp, nPOBS_3P1_Q, nSRM));

SRCL_POX_SB1_P = (-getTF(sigAC1hp, nPOX_SB1_P, nSRM));
SRCL_POX_SB1_Q = (-getTF(sigAC1hp, nPOX_SB1_Q, nSRM));
SRCL_POX_2M1_P = (-getTF(sigAC1hp, nPOX_2M1_P, nSRM));
SRCL_POX_2M1_Q = (-getTF(sigAC1hp, nPOX_2M1_Q, nSRM));
SRCL_POX_3P1_P = (-getTF(sigAC1hp, nPOX_3P1_P, nSRM));
SRCL_POX_3P1_Q = (-getTF(sigAC1hp, nPOX_3P1_Q, nSRM));

SRCL_POY_SB1_P = (-getTF(sigAC1hp, nPOY_SB1_P, nSRM));
SRCL_POY_SB1_Q = (-getTF(sigAC1hp, nPOY_SB1_Q, nSRM));
SRCL_POY_2M1_P = (-getTF(sigAC1hp, nPOY_2M1_P, nSRM));
SRCL_POY_2M1_Q = (-getTF(sigAC1hp, nPOY_2M1_Q, nSRM));
SRCL_POY_3P1_P = (-getTF(sigAC1hp, nPOY_3P1_P, nSRM));
SRCL_POY_3P1_Q = (-getTF(sigAC1hp, nPOY_3P1_Q, nSRM));

SRCL_XP_SB1_P = (-getTF(sigAC1hp, nXP_SB1_P, nSRM));
SRCL_XP_SB1_Q = (-getTF(sigAC1hp, nXP_SB1_Q, nSRM));
SRCL_XP_2M1_P = (-getTF(sigAC1hp, nXP_2M1_P, nSRM));
SRCL_XP_2M1_Q = (-getTF(sigAC1hp, nXP_2M1_Q, nSRM));
SRCL_XP_3P1_P = (-getTF(sigAC1hp, nXP_3P1_P, nSRM));
SRCL_XP_3P1_Q = (-getTF(sigAC1hp, nXP_3P1_Q, nSRM));

SRCL_YP_SB1_P = (-getTF(sigAC1hp, nYP_SB1_P, nSRM));
SRCL_YP_SB1_Q = (-getTF(sigAC1hp, nYP_SB1_Q, nSRM));
SRCL_YP_2M1_P = (-getTF(sigAC1hp, nYP_2M1_P, nSRM));
SRCL_YP_2M1_Q = (-getTF(sigAC1hp, nYP_2M1_Q, nSRM));
SRCL_YP_3P1_P = (-getTF(sigAC1hp, nYP_3P1_P, nSRM));
SRCL_YP_3P1_Q = (-getTF(sigAC1hp, nYP_3P1_Q, nSRM));

SRCL_ASY_DC = (-getTF(sigAC1hp, nASY_DC, nSRM));

% save results
clear n* fDC1hp sigDC1hp sigAC1hp mMech1hp noiseAC1hp opt
save advirgo1_optmat_dd_hp.mat 


