Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "L1Trigger/GlobalMuonTrigger/src/L1MuGMTMIAUPhiPro1LUT.h"
00021
00022
00023
00024
00025
00026
00027
00028
00029 #include "L1Trigger/GlobalMuonTrigger/src/L1MuGMTConfig.h"
00030 #include "CondFormats/L1TObjects/interface/L1MuTriggerScales.h"
00031 #include "CondFormats/L1TObjects/interface/L1MuTriggerPtScale.h"
00032
00033 #include "L1Trigger/GlobalMuonTrigger/src/L1MuGMTPhiLUT.h"
00034
00035 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00036
00037 using namespace std;
00038
00039
00040
00041
00042
00043 void L1MuGMTMIAUPhiPro1LUT::InitParameters() {
00044 m_calo_align = 0.;
00045 }
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085 unsigned L1MuGMTMIAUPhiPro1LUT::TheLookupFunction (int idx, unsigned phi_fine, unsigned eta, unsigned pt, unsigned charge) const {
00086
00087
00088
00089
00090
00091 const L1MuTriggerPtScale* theTriggerPtScale = L1MuGMTConfig::getTriggerPtScale();
00092
00093 int isRPC = idx % 2;
00094 int isFWD = idx / 4;
00095
00096 int isys = isFWD + 2 * isRPC;
00097 int isISO = (idx / 2) % 2;
00098
00099 int ch_idx = (charge == 0) ? 1 : 0;
00100
00101
00102 if (eta>7) eta -= 8;
00103
00104 float dphi = L1MuGMTPhiLUT::dphi (isys, isISO, ch_idx, (int) eta,
00105 theTriggerPtScale->getPtScale()->getLowEdge(pt) );
00106
00107
00108
00109
00110
00111 float calophi = phi_fine * 2.5 / 180. * M_PI - dphi - m_calo_align;
00112
00113 if (charge == 0 && calophi < 0.) {
00114 edm::LogWarning("LUTMismatch")
00115 << "warning: calo offset goes into wrong direction. charge is plus and calophi < 0deg" << endl
00116 << "SYS=" << ( isys==0?"DT":isys==1? "CSC" : isys== 2? "BRPC" : "FRPC" )
00117 << " ISO = " << isISO
00118 << " etabin = " << eta
00119 << " pval = " << theTriggerPtScale->getPtScale()->getLowEdge(pt)
00120
00121 << " charge = " << ( charge==0?"pos":"neg" )
00122 << " phi_fine = " << phi_fine
00123 << " calophi(deg) = " << calophi * 180. / M_PI
00124 << endl;
00125 }
00126 else if (charge == 1 && calophi > 20. / 180. * M_PI) {
00127 edm::LogWarning("LUTMismatch")
00128 << "warning: calo offset goes into wrong direction. charge is minus and calophi > 20deg" << endl
00129 << "SYS=" << ( isys==0?"DT":isys==1? "CSC" : isys== 2? "BRPC" : "FRPC" )
00130 << " ISO = " << isISO
00131 << " etabin = " << eta
00132 << " pval = " << theTriggerPtScale->getPtScale()->getLowEdge(pt)
00133
00134 << " charge = " << ( charge==0?"pos":"neg" )
00135 << " phi_fine = " << phi_fine
00136 << " calophi(deg) = " << calophi * 180. / M_PI
00137 << endl;
00138 }
00139
00140
00141 int cphi_fine = (int) ( ( calophi + 2. * M_PI ) / ( 10. / 180. * M_PI ) );
00142 cphi_fine %= 2;
00143
00144
00145
00146 if (charge == 1)
00147 calophi = 20. / 180 * M_PI - calophi;
00148 calophi += 20. / 180 * M_PI;
00149
00150 if (calophi < 0.) {
00151 edm::LogWarning("LUTMismatch")
00152 << "warning: calo offset goes into wrong direction by more than 20deg !!!! please correct!" << endl;
00153 calophi = 0.;
00154 }
00155 int cphi_ofs = (int) ( calophi / ( 20. / 180. * M_PI) );
00156
00157
00158 if (cphi_ofs > 7) {
00159 edm::LogWarning("LUTMismatch")
00160 << "warning: calo offset is larger than 6 regions !!!! please correct!" << endl;
00161 cphi_ofs = 7;
00162 }
00163
00164 return ( (cphi_fine << 3) + cphi_ofs );
00165 }
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184