848 bool barrel,
bool triggerST,
bool ,
bool dataset,
double& extEta,
849 double& sigmaEta,
double& extPhi,
double& sigmaPhi,
double PT,
850 const double data_Barrel_Param[2][2][2],
851 const double data_Barrel_Sigmas[2][2][2][2],
852 const double data_Endcap_TriggerST_Param[4][12][2][2][2][2],
853 const double data_Endcap_TriggerST_Sigmas[4][12][2][2][2][2],
854 const double data_Endcap_InnerST_Param[4][12][2][2][2],
855 const double data_Endcap_InnerST_PhiSigmas[4][12][2][2][2],
856 const double data_Endcap_InnerST_EtaSigmas[2][2][2][2][2])
864 int sign = (
pt > 0.)? 0 : 1;
865 int ptbi = (fabs(
pt) >= 6.)? 0 : 1;
873 const double (*param)[2][2] = 0;
874 const double (*sigmas)[2][2][2] = 0;
876 param = data_Barrel_Param;
877 sigmas = data_Barrel_Sigmas;
897 float MODULE = (2.*
M_PI)/8.;
898 while(
Phi>MODULE)
Phi -= MODULE;
899 float CELL = MODULE/12.;
904 if (fabs(
eta) >= 1.2 && fabs(
eta) < 1.5) {
907 if (fabs(
eta) >= 1.5 && fabs(
eta) < 2.0) {
910 if (fabs(
eta) >= 2.0) {
916 if (fabs(
eta) >= 1.6) {
928 const double (*param)[12][2][2][2][2] = 0;
929 const double (*sigmas)[12][2][2][2][2] = 0;
931 param = data_Endcap_TriggerST_Param;
932 sigmas = data_Endcap_TriggerST_Sigmas;
936 sigmaEta = sigmas[etab1][phib][
side][
sign][0][0]*(1./fabs(
PT)) + sigmas[etab1][phib][
side][
sign][0][1];
937 sigmaPhi = sigmas[etab1][phib][
side][
sign][1][0]*(1./fabs(
PT)) + sigmas[etab1][phib][
side][
sign][1][1];
941 const double (*param)[12][2][2][2] = 0;
942 const double (*sigmaP)[12][2][2][2] = 0;
943 const double (*sigmaE)[2][2][2][2] = 0;
945 param = data_Endcap_InnerST_Param;
946 sigmaP = data_Endcap_InnerST_PhiSigmas;
947 sigmaE = data_Endcap_InnerST_EtaSigmas;
950 sigmaEta = sigmaE[ptbi][etab2][
side][
sign][0]*(1./fabs(
PT)) + sigmaE[ptbi][etab2][
side][
sign][1];
951 sigmaPhi = sigmaP[ptbi*2+etab2][phib][
side][
sign][0]*(1./fabs(
PT)) + sigmaP[ptbi*2+etab2][phib][
side][
sign][1];
960 if(extPhi>
M_PI) extPhi -= 2.0*
M_PI;
969 double pt,
double zetaId,
double zetaMu,
double eta,
double phi,
970 bool barrel,
bool triggerST,
bool ,
bool dataset,
971 double& extEta,
double& sigmaEta,
double& extPhi,
double& sigmaPhi,
double PT,
972 const double data_Barrel_Param[2][2][2],
973 const double data_Barrel_Sigmas[2][2][2][2],
974 const double data_Endcap_TriggerST_Param[4][12][2][2][2][2],
975 const double data_Endcap_TriggerST_Sigmas[4][12][2][2][2][2],
976 const double data_Endcap_InnerST_Param[4][12][2][2][2],
977 const double data_Endcap_InnerST_PhiSigmas[4][12][2][2][2],
978 const double data_Endcap_InnerST_EtaSigmas[2][2][2][2][2])
986 int sign = (
pt > 0.)? 0 : 1;
987 int ptbi = (fabs(
pt) >= 6.)? 0 : 1;
994 const double (*param)[2][2] = 0;
995 const double (*sigmas)[2][2][2] = 0;
997 param = data_Barrel_Param;
998 sigmas = data_Barrel_Sigmas;
1018 float MODULE = (2.*
M_PI)/8.;
1019 while(
Phi>MODULE)
Phi -= MODULE;
1020 float CELL = MODULE/12.;
1027 if (fabs(
eta) >= 1.2 && fabs(
eta) < 1.5) {
1030 if (fabs(
eta) >= 1.5 && fabs(
eta) < 2.0) {
1033 if (fabs(
eta) >= 2.0) {
1039 if (fabs(
eta) >= 1.6) {
1051 const double (*param)[12][2][2][2][2] = 0;
1052 const double (*sigmas)[12][2][2][2][2] = 0;
1054 param = data_Endcap_TriggerST_Param;
1055 sigmas = data_Endcap_TriggerST_Sigmas;
1059 sigmaEta = sigmas[etab1][phib][
side][
sign][0][0]*(1./fabs(
PT)) + sigmas[etab1][phib][
side][
sign][0][1];
1060 sigmaPhi = sigmas[etab1][phib][
side][
sign][1][0]*(1./fabs(
PT)) + sigmas[etab1][phib][
side][
sign][1][1];
1064 const double (*param)[12][2][2][2] = 0;
1065 const double (*sigmaP)[12][2][2][2] = 0;
1066 const double (*sigmaE)[2][2][2][2] = 0;
1068 param = data_Endcap_InnerST_Param;
1069 sigmaP = data_Endcap_InnerST_PhiSigmas;
1070 sigmaE = data_Endcap_InnerST_EtaSigmas;
1073 sigmaEta = sigmaE[ptbi][etab2][
side][
sign][0]*(1./fabs(
PT)) + sigmaE[ptbi][etab2][
side][
sign][1];
1074 sigmaPhi = sigmaP[ptbi*2+etab2][phib][
side][
sign][0]*(1./fabs(
PT)) + sigmaP[ptbi*2+etab2][phib][
side][
sign][1];
1083 if(extPhi>
M_PI) extPhi -= 2.0*
M_PI;
1091 double radius,
double etaMu,
double phiMu,
double etaId,
1092 double phiId,
bool aligned,
bool dataset,
double winPt,
double weight,
1093 double data_Barrel_Param[2][2][2],
1094 double data_Barrel_Sigmas[2][2][2][2],
1095 double data_Endcap_TriggerST_Param[4][12][2][2][2][2],
1096 double data_Endcap_TriggerST_Sigmas[4][12][2][2][2][2],
1097 double data_Endcap_InnerST_Param[4][12][2][2][2],
1098 double data_Endcap_InnerST_PhiSigmas[4][12][2][2][2],
1099 double data_Endcap_InnerST_EtaSigmas[2][2][2][2][2])
1104 if(fabs(winPt) > 40.) winPt = 40.;
1105 if(fabs(winPt) < 4. ) winPt = 4.;
1107 double etaExtr = 0.;
1108 double sigmaEta = 0.;
1109 double phiExtr = 0.;
1110 double sigmaPhi = 0.;
1114 etaExtr, sigmaEta, phiExtr, sigmaPhi, winPt,
1117 data_Endcap_TriggerST_Param,
1118 data_Endcap_TriggerST_Sigmas,
1119 data_Endcap_InnerST_Param,
1120 data_Endcap_InnerST_PhiSigmas,
1121 data_Endcap_InnerST_EtaSigmas))
1127 if ( etaId * etaExtr >= 0. ) deta = etaExtr - etaId;
1128 else deta = fabs(etaExtr)+ fabs(etaId);
1130 if (phiExtr < 0.) phiExtr += 2.0*
M_PI;
1131 if (phiId < 0.) phiId += 2.0*
M_PI;
1132 dphi = fabs(phiExtr - phiId);
1133 if (dphi>
M_PI) dphi = fabs(dphi-2.0*
M_PI);
1141 if ( std::abs(deta) < WinDeta && std::abs(dphi) < WinDphi)
return true;
1150 double zetaMu,
double etaMu,
double phiMu,
double etaId,
1151 double phiId,
bool aligned,
bool dataset,
double winPt,
double weight,
1152 double data_Barrel_Param[2][2][2],
1153 double data_Barrel_Sigmas[2][2][2][2],
1154 double data_Endcap_TriggerST_Param[4][12][2][2][2][2],
1155 double data_Endcap_TriggerST_Sigmas[4][12][2][2][2][2],
1156 double data_Endcap_InnerST_Param[4][12][2][2][2],
1157 double data_Endcap_InnerST_PhiSigmas[4][12][2][2][2],
1158 double data_Endcap_InnerST_EtaSigmas[2][2][2][2][2])
1163 if(fabs(winPt) > 40.) winPt = 40.;
1164 if(fabs(winPt) < 4. ) winPt = 4.;
1166 double etaLooseExtr = 0.;
1167 double sigmaLooseEta = 0.;
1168 double phiLooseExtr = 0.;
1169 double sigmaLoosePhi = 0.;
1173 etaLooseExtr, sigmaLooseEta, phiLooseExtr, sigmaLoosePhi, winPt,
1176 data_Endcap_TriggerST_Param,
1177 data_Endcap_TriggerST_Sigmas,
1178 data_Endcap_InnerST_Param,
1179 data_Endcap_InnerST_PhiSigmas,
1180 data_Endcap_InnerST_EtaSigmas))
1183 double etaTightExtr = 0.;
1184 double sigmaTightEta = 0.;
1185 double phiTightExtr = 0.;
1186 double sigmaTightPhi = 0.;
1190 etaTightExtr, sigmaTightEta, phiTightExtr, sigmaTightPhi, 0.,
1193 data_Endcap_TriggerST_Param,
1194 data_Endcap_TriggerST_Sigmas,
1195 data_Endcap_InnerST_Param,
1196 data_Endcap_InnerST_PhiSigmas,
1197 data_Endcap_InnerST_EtaSigmas))
1203 double detaTight = 100.;
1204 double dphiTight = 100.;
1210 if ( etaId * etaTightExtr >= 0. ) detaTight = etaTightExtr - etaId;
1211 else detaTight = fabs(etaTightExtr)+ fabs(etaId);
1214 if (phiLooseExtr < 0.) phiLooseExtr += 2.0*
M_PI;
1215 if (phiTightExtr < 0.) phiTightExtr += 2.0*
M_PI;
1216 if (phiId < 0.) phiId += 2.0*
M_PI;
1221 dphiTight = fabs(phiTightExtr - phiId);
1222 if (dphiTight>
M_PI) dphiTight = fabs(dphiTight-2.0*
M_PI);
1229 double WinDetaTight = (
radius<=10.)? 3.7*
weight*sigmaTightEta : 3.0*
weight*sigmaTightEta;
1230 double WinDphiTight = (
radius<=10.)? 3.7*
weight*sigmaTightPhi : 3.0*
weight*sigmaTightPhi;
1233 WinDphiTight *= 2.5;
1239 if(fabs(
pt)>6.) mul = 1.+ (2./34.)*(fabs(
pt)-6.);
1241 if ( fabs(detaTight) < WinDetaTight*mul &&
1242 fabs(dphiTight) < WinDphiTight*mul)
return true;
1245 double mul = 1. + (3./34.)*(fabs(
pt)-6.);
1246 if ( fabs(detaTight) < WinDetaTight*1.1 &&
1247 fabs(dphiTight) < WinDphiTight*mul)
return true;
1249 double mul = 1. + (1./34.)*(fabs(
pt)-6.);
1251 if ( fabs(detaTight) < WinDetaTight*1.2 &&
1252 fabs(dphiTight) < fabs(WinDphiTight)*mul)
return true;
1263 if (MuonZeta==0.)
return eta;
1264 if(fabs(MuonZeta)<2000.) IdZeta/=10.;
1267 double zeta = MuonZeta - IdZeta;
1268 double signZ = zeta/fabs(zeta);
1276 double tuned_pt =
pt;
1280 if(
pt <= -40.) tuned_pt = -40.;
1281 if(
pt >= -4. ) tuned_pt = -4.;
1285 if(
pt >= 40.) tuned_pt = 40.;
1286 if(
pt <= 4. ) tuned_pt = 4.;