% load data
clear
load advirgo1_sd_hp.mat
opt = adVirgo1_sd_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_SB2_P   = getProbeNum(opt, 'XP_SB2_P');
nXP_SB2_Q   = getProbeNum(opt, 'XP_SB2_Q');
nXP_SB3_P   = getProbeNum(opt, 'XP_SB3_P');
nXP_SB3_Q   = getProbeNum(opt, 'XP_SB3_Q');

nYP_SB1_P   = getProbeNum(opt, 'YP_SB1_P');
nYP_SB1_Q   = getProbeNum(opt, 'YP_SB1_Q');
nYP_SB2_P   = getProbeNum(opt, 'YP_SB2_P');
nYP_SB2_Q   = getProbeNum(opt, 'YP_SB2_Q');
nYP_SB3_P   = getProbeNum(opt, 'YP_SB3_P');
nYP_SB3_Q   = getProbeNum(opt, 'YP_SB3_Q');

nSYM_SB1_P   = getProbeNum(opt, 'SYM_SB1_P');
nSYM_SB1_Q   = getProbeNum(opt, 'SYM_SB1_Q');
nSYM_SB2_P   = getProbeNum(opt, 'SYM_SB2_P');
nSYM_SB2_Q   = getProbeNum(opt, 'SYM_SB2_Q');
nSYM_SB3_P   = getProbeNum(opt, 'SYM_SB3_P');
nSYM_SB3_Q   = getProbeNum(opt, 'SYM_SB3_Q');

nASYp_SB1_P   = getProbeNum(opt, 'ASYp_SB1_P');
nASYp_SB1_Q   = getProbeNum(opt, 'ASYp_SB1_Q');
nASYp_SB2_P   = getProbeNum(opt, 'ASYp_SB2_P');
nASYp_SB2_Q   = getProbeNum(opt, 'ASYp_SB2_Q');
nASYp_SB3_P   = getProbeNum(opt, 'ASYp_SB3_P');
nASYp_SB3_Q   = getProbeNum(opt, 'ASYp_SB3_Q');

nPOBS_SB1_P   = getProbeNum(opt, 'POBS_SB1_P');
nPOBS_SB1_Q   = getProbeNum(opt, 'POBS_SB1_Q');
nPOBS_SB2_P   = getProbeNum(opt, 'POBS_SB2_P');
nPOBS_SB2_Q   = getProbeNum(opt, 'POBS_SB2_Q');
nPOBS_SB3_P   = getProbeNum(opt, 'POBS_SB3_P');
nPOBS_SB3_Q   = getProbeNum(opt, 'POBS_SB3_Q');

nPOX_SB1_P   = getProbeNum(opt, 'POX_SB1_P');
nPOX_SB1_Q   = getProbeNum(opt, 'POX_SB1_Q');
nPOX_SB2_P   = getProbeNum(opt, 'POX_SB2_P');
nPOX_SB2_Q   = getProbeNum(opt, 'POX_SB2_Q');
nPOX_SB3_P   = getProbeNum(opt, 'POX_SB3_P');
nPOX_SB3_Q   = getProbeNum(opt, 'POX_SB3_Q');

nPOY_SB1_P   = getProbeNum(opt, 'POY_SB1_P');
nPOY_SB1_Q   = getProbeNum(opt, 'POY_SB1_Q');
nPOY_SB2_P   = getProbeNum(opt, 'POY_SB2_P');
nPOY_SB2_Q   = getProbeNum(opt, 'POY_SB2_Q');
nPOY_SB3_P   = getProbeNum(opt, 'POY_SB3_P');
nPOY_SB3_Q   = getProbeNum(opt, 'POY_SB3_Q');

nASY_DC      = getProbeNum(opt, 'ASY_DC');

% extract transfer functions (in W/um, 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_SB2_P = (0.5*getTF(sigAC1hp, nASYp_SB2_P, nEMX) - 0.5*getTF(sigAC1hp, nASYp_SB2_P, nEMY));
DARM_ASYp_SB2_Q = (0.5*getTF(sigAC1hp, nASYp_SB2_Q, nEMX) - 0.5*getTF(sigAC1hp, nASYp_SB2_Q, nEMY));
DARM_ASYp_SB3_P = (0.5*getTF(sigAC1hp, nASYp_SB3_P, nEMX) - 0.5*getTF(sigAC1hp, nASYp_SB3_P, nEMY));
DARM_ASYp_SB3_Q = (0.5*getTF(sigAC1hp, nASYp_SB3_Q, nEMX) - 0.5*getTF(sigAC1hp, nASYp_SB3_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_SB2_P = (0.5*getTF(sigAC1hp, nSYM_SB2_P, nEMX) - 0.5*getTF(sigAC1hp, nSYM_SB2_P, nEMY));
DARM_SYM_SB2_Q = (0.5*getTF(sigAC1hp, nSYM_SB2_Q, nEMX) - 0.5*getTF(sigAC1hp, nSYM_SB2_Q, nEMY));
DARM_SYM_SB3_P = (0.5*getTF(sigAC1hp, nSYM_SB3_P, nEMX) - 0.5*getTF(sigAC1hp, nSYM_SB3_P, nEMY));
DARM_SYM_SB3_Q = (0.5*getTF(sigAC1hp, nSYM_SB3_Q, nEMX) - 0.5*getTF(sigAC1hp, nSYM_SB3_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_SB2_P = (0.5*getTF(sigAC1hp, nPOBS_SB2_P, nEMX) - 0.5*getTF(sigAC1hp, nPOBS_SB2_P, nEMY));
DARM_POBS_SB2_Q = (0.5*getTF(sigAC1hp, nPOBS_SB2_Q, nEMX) - 0.5*getTF(sigAC1hp, nPOBS_SB2_Q, nEMY));
DARM_POBS_SB3_P = (0.5*getTF(sigAC1hp, nPOBS_SB3_P, nEMX) - 0.5*getTF(sigAC1hp, nPOBS_SB3_P, nEMY));
DARM_POBS_SB3_Q = (0.5*getTF(sigAC1hp, nPOBS_SB3_Q, nEMX) - 0.5*getTF(sigAC1hp, nPOBS_SB3_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_SB2_P = (0.5*getTF(sigAC1hp, nPOX_SB2_P, nEMX) - 0.5*getTF(sigAC1hp, nPOX_SB2_P, nEMY));
DARM_POX_SB2_Q = (0.5*getTF(sigAC1hp, nPOX_SB2_Q, nEMX) - 0.5*getTF(sigAC1hp, nPOX_SB2_Q, nEMY));
DARM_POX_SB3_P = (0.5*getTF(sigAC1hp, nPOX_SB3_P, nEMX) - 0.5*getTF(sigAC1hp, nPOX_SB3_P, nEMY));
DARM_POX_SB3_Q = (0.5*getTF(sigAC1hp, nPOX_SB3_Q, nEMX) - 0.5*getTF(sigAC1hp, nPOX_SB3_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_SB2_P = (0.5*getTF(sigAC1hp, nPOY_SB2_P, nEMX) - 0.5*getTF(sigAC1hp, nPOY_SB2_P, nEMY));
DARM_POY_SB2_Q = (0.5*getTF(sigAC1hp, nPOY_SB2_Q, nEMX) - 0.5*getTF(sigAC1hp, nPOY_SB2_Q, nEMY));
DARM_POY_SB3_P = (0.5*getTF(sigAC1hp, nPOY_SB3_P, nEMX) - 0.5*getTF(sigAC1hp, nPOY_SB3_P, nEMY));
DARM_POY_SB3_Q = (0.5*getTF(sigAC1hp, nPOY_SB3_Q, nEMX) - 0.5*getTF(sigAC1hp, nPOY_SB3_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_SB2_P = (0.5*getTF(sigAC1hp, nXP_SB2_P, nEMX) - 0.5*getTF(sigAC1hp, nXP_SB2_P, nEMY));
DARM_XP_SB2_Q = (0.5*getTF(sigAC1hp, nXP_SB2_Q, nEMX) - 0.5*getTF(sigAC1hp, nXP_SB2_Q, nEMY));
DARM_XP_SB3_P = (0.5*getTF(sigAC1hp, nXP_SB3_P, nEMX) - 0.5*getTF(sigAC1hp, nXP_SB3_P, nEMY));
DARM_XP_SB3_Q = (0.5*getTF(sigAC1hp, nXP_SB3_Q, nEMX) - 0.5*getTF(sigAC1hp, nXP_SB3_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_SB2_P = (0.5*getTF(sigAC1hp, nYP_SB2_P, nEMX) - 0.5*getTF(sigAC1hp, nYP_SB2_P, nEMY));
DARM_YP_SB2_Q = (0.5*getTF(sigAC1hp, nYP_SB2_Q, nEMX) - 0.5*getTF(sigAC1hp, nYP_SB2_Q, nEMY));
DARM_YP_SB3_P = (0.5*getTF(sigAC1hp, nYP_SB3_P, nEMX) - 0.5*getTF(sigAC1hp, nYP_SB3_P, nEMY));
DARM_YP_SB3_Q = (0.5*getTF(sigAC1hp, nYP_SB3_Q, nEMX) - 0.5*getTF(sigAC1hp, nYP_SB3_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_SB2_P = (getTF(sigAC1hp, nASYp_SB2_P, nEMX) + getTF(sigAC1hp, nASYp_SB2_P, nEMY));
CARM_ASYp_SB2_Q = (getTF(sigAC1hp, nASYp_SB2_Q, nEMX) + getTF(sigAC1hp, nASYp_SB2_Q, nEMY));
CARM_ASYp_SB3_P = (getTF(sigAC1hp, nASYp_SB3_P, nEMX) + getTF(sigAC1hp, nASYp_SB3_P, nEMY));
CARM_ASYp_SB3_Q = (getTF(sigAC1hp, nASYp_SB3_Q, nEMX) + getTF(sigAC1hp, nASYp_SB3_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_SB2_P = (getTF(sigAC1hp, nSYM_SB2_P, nEMX) + getTF(sigAC1hp, nSYM_SB2_P, nEMY));
CARM_SYM_SB2_Q = (getTF(sigAC1hp, nSYM_SB2_Q, nEMX) + getTF(sigAC1hp, nSYM_SB2_Q, nEMY));
CARM_SYM_SB3_P = (getTF(sigAC1hp, nSYM_SB3_P, nEMX) + getTF(sigAC1hp, nSYM_SB3_P, nEMY));
CARM_SYM_SB3_Q = (getTF(sigAC1hp, nSYM_SB3_Q, nEMX) + getTF(sigAC1hp, nSYM_SB3_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_SB2_P = (getTF(sigAC1hp, nPOBS_SB2_P, nEMX) + getTF(sigAC1hp, nPOBS_SB2_P, nEMY));
CARM_POBS_SB2_Q = (getTF(sigAC1hp, nPOBS_SB2_Q, nEMX) + getTF(sigAC1hp, nPOBS_SB2_Q, nEMY));
CARM_POBS_SB3_P = (getTF(sigAC1hp, nPOBS_SB3_P, nEMX) + getTF(sigAC1hp, nPOBS_SB3_P, nEMY));
CARM_POBS_SB3_Q = (getTF(sigAC1hp, nPOBS_SB3_Q, nEMX) + getTF(sigAC1hp, nPOBS_SB3_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_SB2_P = (getTF(sigAC1hp, nPOX_SB2_P, nEMX) + getTF(sigAC1hp, nPOX_SB2_P, nEMY));
CARM_POX_SB2_Q = (getTF(sigAC1hp, nPOX_SB2_Q, nEMX) + getTF(sigAC1hp, nPOX_SB2_Q, nEMY));
CARM_POX_SB3_P = (getTF(sigAC1hp, nPOX_SB3_P, nEMX) + getTF(sigAC1hp, nPOX_SB3_P, nEMY));
CARM_POX_SB3_Q = (getTF(sigAC1hp, nPOX_SB3_Q, nEMX) + getTF(sigAC1hp, nPOX_SB3_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_SB2_P = (getTF(sigAC1hp, nPOY_SB2_P, nEMX) + getTF(sigAC1hp, nPOY_SB2_P, nEMY));
CARM_POY_SB2_Q = (getTF(sigAC1hp, nPOY_SB2_Q, nEMX) + getTF(sigAC1hp, nPOY_SB2_Q, nEMY));
CARM_POY_SB3_P = (getTF(sigAC1hp, nPOY_SB3_P, nEMX) + getTF(sigAC1hp, nPOY_SB3_P, nEMY));
CARM_POY_SB3_Q = (getTF(sigAC1hp, nPOY_SB3_Q, nEMX) + getTF(sigAC1hp, nPOY_SB3_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_SB2_P = (getTF(sigAC1hp, nXP_SB2_P, nEMX) + getTF(sigAC1hp, nXP_SB2_P, nEMY));
CARM_XP_SB2_Q = (getTF(sigAC1hp, nXP_SB2_Q, nEMX) + getTF(sigAC1hp, nXP_SB2_Q, nEMY));
CARM_XP_SB3_P = (getTF(sigAC1hp, nXP_SB3_P, nEMX) + getTF(sigAC1hp, nXP_SB3_P, nEMY));
CARM_XP_SB3_Q = (getTF(sigAC1hp, nXP_SB3_Q, nEMX) + getTF(sigAC1hp, nXP_SB3_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_SB2_P = (getTF(sigAC1hp, nYP_SB2_P, nEMX) + getTF(sigAC1hp, nYP_SB2_P, nEMY));
CARM_YP_SB2_Q = (getTF(sigAC1hp, nYP_SB2_Q, nEMX) + getTF(sigAC1hp, nYP_SB2_Q, nEMY));
CARM_YP_SB3_P = (getTF(sigAC1hp, nYP_SB3_P, nEMX) + getTF(sigAC1hp, nYP_SB3_P, nEMY));
CARM_YP_SB3_Q = (getTF(sigAC1hp, nYP_SB3_Q, nEMX) + getTF(sigAC1hp, nYP_SB3_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_SB2_P = (-getTF(sigAC1hp, nASYp_SB2_P, nPRM));
PRCL_ASYp_SB2_Q = (-getTF(sigAC1hp, nASYp_SB2_Q, nPRM));
PRCL_ASYp_SB3_P = (-getTF(sigAC1hp, nASYp_SB3_P, nPRM));
PRCL_ASYp_SB3_Q = (-getTF(sigAC1hp, nASYp_SB3_Q, nPRM));

PRCL_SYM_SB1_P = (-getTF(sigAC1hp, nSYM_SB1_P, nPRM));
PRCL_SYM_SB1_Q = (-getTF(sigAC1hp, nSYM_SB1_Q, nPRM));
PRCL_SYM_SB2_P = (-getTF(sigAC1hp, nSYM_SB2_P, nPRM));
PRCL_SYM_SB2_Q = (-getTF(sigAC1hp, nSYM_SB2_Q, nPRM));
PRCL_SYM_SB3_P = (-getTF(sigAC1hp, nSYM_SB3_P, nPRM));
PRCL_SYM_SB3_Q = (-getTF(sigAC1hp, nSYM_SB3_Q, nPRM));

PRCL_POBS_SB1_P = (-getTF(sigAC1hp, nPOBS_SB1_P, nPRM));
PRCL_POBS_SB1_Q = (-getTF(sigAC1hp, nPOBS_SB1_Q, nPRM));
PRCL_POBS_SB2_P = (-getTF(sigAC1hp, nPOBS_SB2_P, nPRM));
PRCL_POBS_SB2_Q = (-getTF(sigAC1hp, nPOBS_SB2_Q, nPRM));
PRCL_POBS_SB3_P = (-getTF(sigAC1hp, nPOBS_SB3_P, nPRM));
PRCL_POBS_SB3_Q = (-getTF(sigAC1hp, nPOBS_SB3_Q, nPRM));

PRCL_POX_SB1_P = (-getTF(sigAC1hp, nPOX_SB1_P, nPRM));
PRCL_POX_SB1_Q = (-getTF(sigAC1hp, nPOX_SB1_Q, nPRM));
PRCL_POX_SB2_P = (-getTF(sigAC1hp, nPOX_SB2_P, nPRM));
PRCL_POX_SB2_Q = (-getTF(sigAC1hp, nPOX_SB2_Q, nPRM));
PRCL_POX_SB3_P = (-getTF(sigAC1hp, nPOX_SB3_P, nPRM));
PRCL_POX_SB3_Q = (-getTF(sigAC1hp, nPOX_SB3_Q, nPRM));

PRCL_POY_SB1_P = (-getTF(sigAC1hp, nPOY_SB1_P, nPRM));
PRCL_POY_SB1_Q = (-getTF(sigAC1hp, nPOY_SB1_Q, nPRM));
PRCL_POY_SB2_P = (-getTF(sigAC1hp, nPOY_SB2_P, nPRM));
PRCL_POY_SB2_Q = (-getTF(sigAC1hp, nPOY_SB2_Q, nPRM));
PRCL_POY_SB3_P = (-getTF(sigAC1hp, nPOY_SB3_P, nPRM));
PRCL_POY_SB3_Q = (-getTF(sigAC1hp, nPOY_SB3_Q, nPRM));

PRCL_XP_SB1_P = (-getTF(sigAC1hp, nXP_SB1_P, nPRM));
PRCL_XP_SB1_Q = (-getTF(sigAC1hp, nXP_SB1_Q, nPRM));
PRCL_XP_SB2_P = (-getTF(sigAC1hp, nXP_SB2_P, nPRM));
PRCL_XP_SB2_Q = (-getTF(sigAC1hp, nXP_SB2_Q, nPRM));
PRCL_XP_SB3_P = (-getTF(sigAC1hp, nXP_SB3_P, nPRM));
PRCL_XP_SB3_Q = (-getTF(sigAC1hp, nXP_SB3_Q, nPRM));

PRCL_YP_SB1_P = (-getTF(sigAC1hp, nYP_SB1_P, nPRM));
PRCL_YP_SB1_Q = (-getTF(sigAC1hp, nYP_SB1_Q, nPRM));
PRCL_YP_SB2_P = (-getTF(sigAC1hp, nYP_SB2_P, nPRM));
PRCL_YP_SB2_Q = (-getTF(sigAC1hp, nYP_SB2_Q, nPRM));
PRCL_YP_SB3_P = (-getTF(sigAC1hp, nYP_SB3_P, nPRM));
PRCL_YP_SB3_Q = (-getTF(sigAC1hp, nYP_SB3_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_SB2_P = (-0.5*getTF(sigAC1hp, nASYp_SB2_P, nPRM) + 0.5*getTF(sigAC1hp, nASYp_SB2_P, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nASYp_SB2_P, nBS));
MICH_ASYp_SB2_Q = (-0.5*getTF(sigAC1hp, nASYp_SB2_Q, nPRM) + 0.5*getTF(sigAC1hp, nASYp_SB2_Q, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nASYp_SB2_Q, nBS));
MICH_ASYp_SB3_P = (-0.5*getTF(sigAC1hp, nASYp_SB3_P, nPRM) + 0.5*getTF(sigAC1hp, nASYp_SB3_P, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nASYp_SB3_P, nBS));
MICH_ASYp_SB3_Q = (-0.5*getTF(sigAC1hp, nASYp_SB3_Q, nPRM) + 0.5*getTF(sigAC1hp, nASYp_SB3_Q, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nASYp_SB3_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_SB2_P = (-0.5*getTF(sigAC1hp, nSYM_SB2_P, nPRM) + 0.5*getTF(sigAC1hp, nSYM_SB2_P, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nSYM_SB2_P, nBS));
MICH_SYM_SB2_Q = (-0.5*getTF(sigAC1hp, nSYM_SB2_Q, nPRM) + 0.5*getTF(sigAC1hp, nSYM_SB2_Q, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nSYM_SB2_Q, nBS));
MICH_SYM_SB3_P = (-0.5*getTF(sigAC1hp, nSYM_SB3_P, nPRM) + 0.5*getTF(sigAC1hp, nSYM_SB3_P, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nSYM_SB3_P, nBS));
MICH_SYM_SB3_Q = (-0.5*getTF(sigAC1hp, nSYM_SB3_Q, nPRM) + 0.5*getTF(sigAC1hp, nSYM_SB3_Q, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nSYM_SB3_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_SB2_P = (-0.5*getTF(sigAC1hp, nPOBS_SB2_P, nPRM) + 0.5*getTF(sigAC1hp, nPOBS_SB2_P, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nPOBS_SB2_P, nBS));
MICH_POBS_SB2_Q = (-0.5*getTF(sigAC1hp, nPOBS_SB2_Q, nPRM) + 0.5*getTF(sigAC1hp, nPOBS_SB2_Q, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nPOBS_SB2_Q, nBS));
MICH_POBS_SB3_P = (-0.5*getTF(sigAC1hp, nPOBS_SB3_P, nPRM) + 0.5*getTF(sigAC1hp, nPOBS_SB3_P, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nPOBS_SB3_P, nBS));
MICH_POBS_SB3_Q = (-0.5*getTF(sigAC1hp, nPOBS_SB3_Q, nPRM) + 0.5*getTF(sigAC1hp, nPOBS_SB3_Q, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nPOBS_SB3_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_SB2_P = (-0.5*getTF(sigAC1hp, nPOX_SB2_P, nPRM) + 0.5*getTF(sigAC1hp, nPOX_SB2_P, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nPOX_SB2_P, nBS));
MICH_POX_SB2_Q = (-0.5*getTF(sigAC1hp, nPOX_SB2_Q, nPRM) + 0.5*getTF(sigAC1hp, nPOX_SB2_Q, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nPOX_SB2_Q, nBS));
MICH_POX_SB3_P = (-0.5*getTF(sigAC1hp, nPOX_SB3_P, nPRM) + 0.5*getTF(sigAC1hp, nPOX_SB3_P, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nPOX_SB3_P, nBS));
MICH_POX_SB3_Q = (-0.5*getTF(sigAC1hp, nPOX_SB3_Q, nPRM) + 0.5*getTF(sigAC1hp, nPOX_SB3_Q, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nPOX_SB3_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_SB2_P = (-0.5*getTF(sigAC1hp, nPOY_SB2_P, nPRM) + 0.5*getTF(sigAC1hp, nPOY_SB2_P, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nPOY_SB2_P, nBS));
MICH_POY_SB2_Q = (-0.5*getTF(sigAC1hp, nPOY_SB2_Q, nPRM) + 0.5*getTF(sigAC1hp, nPOY_SB2_Q, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nPOY_SB2_Q, nBS));
MICH_POY_SB3_P = (-0.5*getTF(sigAC1hp, nPOY_SB3_P, nPRM) + 0.5*getTF(sigAC1hp, nPOY_SB3_P, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nPOY_SB3_P, nBS));
MICH_POY_SB3_Q = (-0.5*getTF(sigAC1hp, nPOY_SB3_Q, nPRM) + 0.5*getTF(sigAC1hp, nPOY_SB3_Q, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nPOY_SB3_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_SB2_P = (-0.5*getTF(sigAC1hp, nXP_SB2_P, nPRM) + 0.5*getTF(sigAC1hp, nXP_SB2_P, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nXP_SB2_P, nBS));
MICH_XP_SB2_Q = (-0.5*getTF(sigAC1hp, nXP_SB2_Q, nPRM) + 0.5*getTF(sigAC1hp, nXP_SB2_Q, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nXP_SB2_Q, nBS));
MICH_XP_SB3_P = (-0.5*getTF(sigAC1hp, nXP_SB3_P, nPRM) + 0.5*getTF(sigAC1hp, nXP_SB3_P, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nXP_SB3_P, nBS));
MICH_XP_SB3_Q = (-0.5*getTF(sigAC1hp, nXP_SB3_Q, nPRM) + 0.5*getTF(sigAC1hp, nXP_SB3_Q, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nXP_SB3_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_SB2_P = (-0.5*getTF(sigAC1hp, nYP_SB2_P, nPRM) + 0.5*getTF(sigAC1hp, nYP_SB2_P, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nYP_SB2_P, nBS));
MICH_YP_SB2_Q = (-0.5*getTF(sigAC1hp, nYP_SB2_Q, nPRM) + 0.5*getTF(sigAC1hp, nYP_SB2_Q, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nYP_SB2_Q, nBS));
MICH_YP_SB3_P = (-0.5*getTF(sigAC1hp, nYP_SB3_P, nPRM) + 0.5*getTF(sigAC1hp, nYP_SB3_P, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nYP_SB3_P, nBS));
MICH_YP_SB3_Q = (-0.5*getTF(sigAC1hp, nYP_SB3_Q, nPRM) + 0.5*getTF(sigAC1hp, nYP_SB3_Q, nSRM) + 1/sqrt(2)*getTF(sigAC1hp, nYP_SB3_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_SB2_P = (-getTF(sigAC1hp, nASYp_SB2_P, nSRM));
SRCL_ASYp_SB2_Q = (-getTF(sigAC1hp, nASYp_SB2_Q, nSRM));
SRCL_ASYp_SB3_P = (-getTF(sigAC1hp, nASYp_SB3_P, nSRM));
SRCL_ASYp_SB3_Q = (-getTF(sigAC1hp, nASYp_SB3_Q, nSRM));

SRCL_SYM_SB1_P = (-getTF(sigAC1hp, nSYM_SB1_P, nSRM));
SRCL_SYM_SB1_Q = (-getTF(sigAC1hp, nSYM_SB1_Q, nSRM));
SRCL_SYM_SB2_P = (-getTF(sigAC1hp, nSYM_SB2_P, nSRM));
SRCL_SYM_SB2_Q = (-getTF(sigAC1hp, nSYM_SB2_Q, nSRM));
SRCL_SYM_SB3_P = (-getTF(sigAC1hp, nSYM_SB3_P, nSRM));
SRCL_SYM_SB3_Q = (-getTF(sigAC1hp, nSYM_SB3_Q, nSRM));

SRCL_POBS_SB1_P = (-getTF(sigAC1hp, nPOBS_SB1_P, nSRM));
SRCL_POBS_SB1_Q = (-getTF(sigAC1hp, nPOBS_SB1_Q, nSRM));
SRCL_POBS_SB2_P = (-getTF(sigAC1hp, nPOBS_SB2_P, nSRM));
SRCL_POBS_SB2_Q = (-getTF(sigAC1hp, nPOBS_SB2_Q, nSRM));
SRCL_POBS_SB3_P = (-getTF(sigAC1hp, nPOBS_SB3_P, nSRM));
SRCL_POBS_SB3_Q = (-getTF(sigAC1hp, nPOBS_SB3_Q, nSRM));

SRCL_POX_SB1_P = (-getTF(sigAC1hp, nPOX_SB1_P, nSRM));
SRCL_POX_SB1_Q = (-getTF(sigAC1hp, nPOX_SB1_Q, nSRM));
SRCL_POX_SB2_P = (-getTF(sigAC1hp, nPOX_SB2_P, nSRM));
SRCL_POX_SB2_Q = (-getTF(sigAC1hp, nPOX_SB2_Q, nSRM));
SRCL_POX_SB3_P = (-getTF(sigAC1hp, nPOX_SB3_P, nSRM));
SRCL_POX_SB3_Q = (-getTF(sigAC1hp, nPOX_SB3_Q, nSRM));

SRCL_POY_SB1_P = (-getTF(sigAC1hp, nPOY_SB1_P, nSRM));
SRCL_POY_SB1_Q = (-getTF(sigAC1hp, nPOY_SB1_Q, nSRM));
SRCL_POY_SB2_P = (-getTF(sigAC1hp, nPOY_SB2_P, nSRM));
SRCL_POY_SB2_Q = (-getTF(sigAC1hp, nPOY_SB2_Q, nSRM));
SRCL_POY_SB3_P = (-getTF(sigAC1hp, nPOY_SB3_P, nSRM));
SRCL_POY_SB3_Q = (-getTF(sigAC1hp, nPOY_SB3_Q, nSRM));

SRCL_XP_SB1_P = (-getTF(sigAC1hp, nXP_SB1_P, nSRM));
SRCL_XP_SB1_Q = (-getTF(sigAC1hp, nXP_SB1_Q, nSRM));
SRCL_XP_SB2_P = (-getTF(sigAC1hp, nXP_SB2_P, nSRM));
SRCL_XP_SB2_Q = (-getTF(sigAC1hp, nXP_SB2_Q, nSRM));
SRCL_XP_SB3_P = (-getTF(sigAC1hp, nXP_SB3_P, nSRM));
SRCL_XP_SB3_Q = (-getTF(sigAC1hp, nXP_SB3_Q, nSRM));

SRCL_YP_SB1_P = (-getTF(sigAC1hp, nYP_SB1_P, nSRM));
SRCL_YP_SB1_Q = (-getTF(sigAC1hp, nYP_SB1_Q, nSRM));
SRCL_YP_SB2_P = (-getTF(sigAC1hp, nYP_SB2_P, nSRM));
SRCL_YP_SB2_Q = (-getTF(sigAC1hp, nYP_SB2_Q, nSRM));
SRCL_YP_SB3_P = (-getTF(sigAC1hp, nYP_SB3_P, nSRM));
SRCL_YP_SB3_Q = (-getTF(sigAC1hp, nYP_SB3_Q, nSRM));

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

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


