24 m_restricted(restricted),
28 if (m_crate > 1)
return;
31 if ((maskXE&0xff) != 0xff || (maskTE&0xff) != 0xff) m_restricted =
true;
40 unsigned int eT[2] = {0,0};
41 unsigned int eX[2] = {0,0};
42 unsigned int eY[2] = {0,0};
44 int moduleInQuad = jem->module() % 8;
45 if (jem->crate() == m_crate) {
46 int quad = ( jem->module() < 8 ? 0 : 1 );
47 if ((maskTE>>moduleInQuad)&1) {
49 if ( jem->et() >= m_jemEtSaturation ) m_overflowT = 1;
51 if ((maskXE>>moduleInQuad)&1) {
52 eX[
quad] += jem->ex();
53 eY[
quad] += jem->ey();
54 if ( jem->ex() >= m_jemEtSaturation ) m_overflowX = 1;
55 if ( jem->ey() >= m_jemEtSaturation ) m_overflowY = 1;
61 unsigned int mask = (1 << m_sumBits) - 1;
65 m_crateEt =
eT[0] +
eT[1];
66 if (m_crateEt >=
mask){
73 m_crateEx = eX[0] - eX[1];
75 m_crateEx = -(
mask + 1);
78 m_crateEy = eY[0] - eY[1];
80 m_crateEy = -(
mask + 1);
85 std::cout <<
"CrateEnergy: crate " << m_crate <<
" results " << std::endl
86 <<
" Et " << m_crateEt <<
" overflow " << m_overflowT << std::endl
87 <<
" Ex " << m_crateEx <<
" overflow " << m_overflowX << std::endl
88 <<
" Ey " << m_crateEy <<
" overflow " << m_overflowY << std::endl;
102 m_restricted(restricted),
106 if (m_crate > 1)
return;
109 if ((maskXE&0xff) != 0xff || (maskTE&0xff) != 0xff) m_restricted =
true;
118 unsigned int eT[2] = {0,0};
119 unsigned int eX[2] = {0,0};
120 unsigned int eY[2] = {0,0};
122 int moduleInQuad = jem->module() % 8;
123 if ((
unsigned int)jem->crate() == m_crate) {
124 int quad = ( jem->module() < 8 ? 0 : 1 );
126 if ((maskTE>>moduleInQuad)&1) {
128 if ( jem->Et() >= m_jemEtSaturation ) m_overflowT = 1;
130 if ((maskXE>>moduleInQuad)&1) {
131 eX[
quad] += jem->Ex();
132 eY[
quad] += jem->Ey();
133 if ( jem->Ex() >= m_jemEtSaturation ) m_overflowX = 1;
134 if ( jem->Ey() >= m_jemEtSaturation ) m_overflowY = 1;
140 unsigned int mask = (1<<m_sumBits) - 1;
145 m_crateEt =
eT[0] +
eT[1];
146 if (m_crateEt >=
mask){
152 m_crateEx = eX[0] - eX[1];
154 m_crateEx = -(
mask + 1);
157 m_crateEy = eY[0] - eY[1];
159 m_crateEy = -(
mask + 1);
163 std::cout <<
"CrateEnergy: crate " << m_crate <<
" results " << std::endl
164 <<
" Et " << m_crateEt <<
" overflow " << m_overflowT << std::endl
165 <<
" Ex " << m_crateEx <<
" overflow " << m_overflowX << std::endl
166 <<
" Ey " << m_crateEy <<
" overflow " << m_overflowY << std::endl;
173 unsigned int eyTC,
unsigned int overflowT,
unsigned int overflowX,
174 unsigned int overflowY,
bool restricted) :
182 m_restricted(restricted),
186 if (m_crate > 1)
return;
188 m_crateEx = decodeTC(exTC);
189 m_crateEy = decodeTC(eyTC);
190 m_overflowT = overflowT;
191 m_overflowX = overflowX;
192 m_overflowY = overflowY;
195 std::cout <<
"CrateEnergy: crate " << m_crate <<
" results " << std::endl
196 <<
" Et " << m_crateEt <<
" overflow " << m_overflowT << std::endl
197 <<
" Ex " << m_crateEx <<
" overflow " << m_overflowX << std::endl
198 <<
" Ey " << m_crateEy <<
" overflow " << m_overflowY << std::endl;