20 unsigned int module,
int JEThresholdEtSum,
int JEThresholdEtMiss,
const std::map<int, int>* TEMasks,
int slice):
21 m_jetElementThresholdEtSum(JEThresholdEtSum),
22 m_jetElementThresholdEtMiss(JEThresholdEtMiss),
33 if (m_debug) std::cout <<
"Create ModuleEnergy for crate "
34 << crate <<
" module " <<
module << std::endl;
35 if (m_crate <= 1 && m_module <= 15) {
37 m_signY = ( (
module < 8) ? 1 : -1 );
38 m_signX = ( (crate == 0) ? m_signY : -m_signY );
43 for (
unsigned int k :
keys) {
44 xAOD::JetElementMap_t::const_iterator
test=JEContainer->find(
k);
45 if (
test != JEContainer->end()) {
47 double eta =
test->second->eta();
48 int ieta =
int((eta + (eta>0 ? 0.005 : -0.005))/0.1);
50 if (TEMasks == 0 || TEMasks->find(ieta) == TEMasks->end()) {
52 if (
test->second->isSaturated()) {
58 if (
slice < 0) jetElementET =
test->second->et();
59 else jetElementET =
test->second->sliceET(
slice);
61 if (jetElementET > m_jetElementThresholdEtMiss) {
63 double phi =
test->second->phi();
66 getSinCos(eta,phi,cosPhi,sinPhi);
68 unsigned int EnergyX = ((jetElementET*cosPhi) & 0x7ffffc00);
69 unsigned int EnergyY = ((jetElementET*sinPhi) & 0x7ffffc00);
72 if (m_debug) std::cout <<
"JE phi = " << phi <<
", ET = " << jetElementET
73 <<
", Ex = " << (EnergyX>>10) <<
", Ey = " << (EnergyY>>10) << std::endl;
76 if ( jetElementET > m_jetElementThresholdEtSum )
88 if (
saturated || (m_Ex > (1<<m_EtBits)-1)) m_Ex = (1<<m_EtBits)-1;
89 if (
saturated || (m_Ey > (1<<m_EtBits)-1)) m_Ey = (1<<m_EtBits)-1;
90 if (
saturated || (m_Et > (1<<m_EtBits)-1)) m_Et = (1<<m_EtBits)-1;
93 std::cout <<
"Crate " << crate <<
" Module " <<
module <<
94 " sums: " << std::endl;
95 std::cout <<
" Ex = " <<
static_cast<int>(m_Ex)*m_signX << std::endl;
96 std::cout <<
" Ey = " <<
static_cast<int>(m_Ey)*m_signY << std::endl;
97 std::cout <<
" Et = " << m_Et << std::endl;
103 unsigned int et,
unsigned int ex,
105 m_jetElementThresholdEtSum(0),
106 m_jetElementThresholdEtMiss(0),
117 if (m_debug) std::cout <<
"Create ModuleEnergy for crate "
118 << crate <<
" module " <<
module << std::endl;
119 if (m_crate <= 1 && m_module <= 15) {
121 m_signY = ( (
module < 8) ? 1 : -1 );
122 m_signX = ( (crate == 0) ? m_signY : -m_signY );
125 if (m_Ex > (1<<m_EtBits)-1) m_Ex = (1<<m_EtBits)-1;
126 if (m_Ey > (1<<m_EtBits)-1) m_Ey = (1<<m_EtBits)-1;
127 if (m_Et > (1<<m_EtBits)-1) m_Et = (1<<m_EtBits)-1;
130 std::cout <<
"Crate " << crate <<
" Module " <<
module <<
131 " sums: " << std::endl;
132 std::cout <<
" Ex = " <<
static_cast<int>(m_Ex)*m_signX << std::endl;
133 std::cout <<
" Ey = " <<
static_cast<int>(m_Ey)*m_signY << std::endl;
134 std::cout <<
" Et = " << m_Et << std::endl;
175 unsigned int SinCos[8] = {401,1187,1928,2594,3161,3607,3913,4070};
176 unsigned int fwdSinCos[4] = {794,2261,3384,3992};
179 float modPhi = fmod(phi,
M_PI/2.);
182 if (fabs(eta) < 3.2) {
186 sinPhi = SinCos[7-
phiBin];
189 cosPhi = SinCos[7-
phiBin];
197 cosPhi = fwdSinCos[
phiBin];
198 sinPhi = fwdSinCos[3-
phiBin];
201 cosPhi = fwdSinCos[3-
phiBin];
202 sinPhi = fwdSinCos[
phiBin];