73 m_refEta = refCoord.
eta();
74 m_refPhi = refCoord.
phi();
77 setRoICoord(m_refEta, m_refPhi);
93 std::vector<unsigned int> emEt(4);
94 std::vector<unsigned int> cores(9);
95 for (
int etaOffset = -1; etaOffset <= 2; etaOffset++) {
96 double tempEta = m_refEta + etaOffset*0.1;
97 for (
int phiOffset = -1; phiOffset <= 2; phiOffset++) {
98 double tempPhi = m_refPhi + phiOffset*
M_PI/32;
99 int key =
get.ttKey(tempPhi, tempEta);
100 xAOD::CPMTowerMap_t::const_iterator
tt = ttContainer->find(
key);
101 if (
tt != ttContainer->end() && fabs(tempEta) < m_maxEta) {
106 emTT = (
tt->second)->emEnergy();
107 hadTT = (
tt->second)->hadEnergy();
110 emTT = (
tt->second)->emSliceEnergy(
slice);
111 hadTT = (
tt->second)->hadSliceEnergy(
slice);
114 if (etaOffset >= 0 && etaOffset <= 1 && phiOffset >= 0 && phiOffset <= 1) {
115 emEt[phiOffset+2*etaOffset] = emTT;
125 if (etaOffset >= 0) {
126 if (phiOffset >= 0) cores[phiOffset+3*etaOffset] += emTT + hadTT;
127 if (phiOffset < 2) cores[phiOffset+3*etaOffset+1] += emTT + hadTT;
130 if (phiOffset >= 0) cores[phiOffset+3*etaOffset+3] += emTT + hadTT;
131 if (phiOffset < 2) cores[phiOffset+3*etaOffset+4] += emTT + hadTT;
142 m_EMClus = ( (emEt[0] > emEt[3]) ? emEt[0] : emEt[3] )
143 + ( (emEt[1] > emEt[2]) ? emEt[1] : emEt[2] );
146 m_TauClus = m_EMClus + m_HadCore;
169 double dEta = keyLL.dEta(lowerLeft);
170 double dPhi = keyLL.dPhi(lowerLeft);
181 if (m_eta > 2.5) m_eta = 2.5;
182 else if (m_eta < -2.5) m_eta = -2.5;
198 for (
int i = 0;
i < 4;
i++)
if (m_Core < cores[
i]) m_EtMax =
false;
199 for (
int i = 5;
i < 9;
i++)
if (m_Core <= cores[
i]) m_EtMax =
false;
212 if (!m_EtMax)
return;
216 float emEnergyScale{1};
217 unsigned int tobPtMinEM{0};
218 emEnergyScale = m_l1menu->thrExtraInfo().EM().emScale();
219 tobPtMinEM = m_l1menu->thrExtraInfo().EM().ptMinToTopo();
221 unsigned int thresh = tobPtMinEM * emEnergyScale;
223 if (m_EMClus <=
thresh)
return;
230 unsigned int clusMask = ( (1<<m_emLUT_ClusterNBits)-1 )<<m_emLUT_ClusterFirstBit;
231 unsigned int emIsolMask = ( (1<<m_emLUT_EMIsolNBits) -1 )<<m_emLUT_EMIsolFirstBit;
232 unsigned int hadIsolMask = ( (1<<m_emLUT_HadVetoNBits)-1 )<<m_emLUT_HadVetoFirstBit;
235 if (m_EMClus >= clusMask) {
241 int clus = (( (m_EMClus < clusMask) ? (m_EMClus & clusMask) : clusMask ) * 10)/emEnergyScale;
242 int emIsol = (( (m_EMIsol < emIsolMask) ? (m_EMIsol & emIsolMask) : emIsolMask ) * 10)/emEnergyScale;
243 int hadVeto = (( (m_HadCore < hadIsolMask) ? (m_HadCore & hadIsolMask) : hadIsolMask ) * 10)/emEnergyScale;
249 std::vector<int> emisolcuts(5,m_noIsol);
250 std::vector<int> hadisolcuts(5,m_noIsol);
251 for(
size_t bit = 1; bit<=5; ++bit) {
257 int slope = iso.
slope();
258 int mincut = iso.
mincut();
260 if (clus < upperlimit && bit >= 1 && bit <= 5) {
262 int cut =
offset + (slope != 0 ? 10*clus/slope : 0);
263 if (
cut < mincut)
cut = mincut;
264 emisolcuts[bit-1] =
cut;
267 for(
size_t bit = 1; bit<=5; ++bit) {
273 int slope = iso.
slope();
274 int mincut = iso.
mincut();
276 if (clus < upperlimit && bit >= 1 && bit <= 5) {
278 int cut =
offset + (slope != 0 ? 10*clus/slope : 0);
279 if (
cut < mincut)
cut = mincut;
280 hadisolcuts[bit-1] =
cut;
285 for (
unsigned int isol = 0; isol < 5; ++isol) {
286 if (emIsol <= emisolcuts[isol] && hadVeto <= hadisolcuts[isol]) m_EMIsolWord += (1 << isol);
300 if (!m_EtMax)
return;
304 float emEnergyScale{1};
305 unsigned int tobPtMinTau{0};
306 emEnergyScale = m_l1menu->thrExtraInfo().EM().emScale();
307 tobPtMinTau = m_l1menu->thrExtraInfo().TAU().ptMinToTopo();
308 unsigned int thresh = tobPtMinTau * emEnergyScale;
310 if (m_TauClus <=
thresh)
return;
317 unsigned int clusMask = ( (1<<m_tauLUT_ClusterNBits)-1 )<<m_tauLUT_ClusterFirstBit;
318 unsigned int emIsolMask = ( (1<<m_tauLUT_EMIsolNBits) -1 )<<m_tauLUT_EMIsolFirstBit;
321 if (m_TauClus >= clusMask) {
322 m_TauIsolWord = 0x1F;
327 int clus = (( (m_TauClus < clusMask) ? (m_TauClus & clusMask) : clusMask ) * 10)/emEnergyScale;
328 int emIsol = (( (m_EMIsol < emIsolMask) ? (m_EMIsol & emIsolMask) : emIsolMask ) * 10)/emEnergyScale;
331 std::vector<int> emisolcuts(5,m_noIsol);
332 for(
size_t bit = 1; bit<=5; ++bit) {
338 int slope = iso.
slope();
339 int mincut = iso.
mincut();
341 if (clus < upperlimit && bit >= 1 && bit <= 5) {
343 int cut =
offset + (slope != 0 ? 10*clus/slope : 0);
344 if (
cut < mincut)
cut = mincut;
345 emisolcuts[bit-1] =
cut;
350 for (
unsigned int isol = 0; isol < 5; ++isol)
351 if (emIsol <= emisolcuts[isol]) m_TauIsolWord += (1 << isol);
358 bool passed = ( m_EMThresh && m_EtMax );
366 bool passed = ( m_TauThresh && m_EtMax );
380 return ( (m_EMClus < m_maxClus) ? m_EMClus : m_maxClus );
385 return ( (m_TauClus < m_maxClus) ? m_TauClus : m_maxClus );
395 return m_TauIsolWord;
425 int ET = (m_EMClus >> m_emLUT_ClusterFirstBit);
426 if (ET > (1<< m_emLUT_ClusterNBits) - 1) ET = (1<<m_emLUT_ClusterNBits) - 1;
427 return (ET << m_emLUT_ClusterFirstBit);
432 int ET = (m_TauClus >> m_tauLUT_ClusterFirstBit);
433 if (ET > (1<<m_tauLUT_ClusterNBits) - 1) ET = (1<<m_tauLUT_ClusterNBits) - 1;
434 return (ET << m_tauLUT_ClusterFirstBit);
439 int ET = (m_EMIsol >> m_emLUT_EMIsolFirstBit);
440 if (ET > (1<<m_emLUT_EMIsolNBits) - 1) ET = (1<<m_emLUT_EMIsolNBits) - 1;
441 return (ET << m_emLUT_EMIsolFirstBit);
446 int ET = (m_HadCore >> m_emLUT_HadVetoFirstBit);
447 if (ET > (1<<m_emLUT_HadVetoNBits) - 1) ET = (1<<m_emLUT_HadVetoNBits) - 1;
448 return (ET << m_emLUT_HadVetoFirstBit);
453 int ET = (m_EMIsol >> m_tauLUT_EMIsolFirstBit);
454 if (ET > (1<<m_tauLUT_EMIsolNBits) - 1) ET = (1<<m_tauLUT_EMIsolNBits) - 1;
455 return (ET << m_tauLUT_EMIsolFirstBit);
465 return ( (m_phi <=
M_PI) ? m_phi : m_phi - 2.*
M_PI);
507 isol = TauIsolWord();
513 float eta = m_eta - 0.05;
514 float phi = m_phi -
M_PI/64;
515 if (phi < 0) phi += 2*
M_PI;
516 Coordinate
coord(phi, eta);
517 CoordToHardware convertor;
519 int crate = convertor.cpCrate(
coord);
521 int chip = convertor.cpModuleFPGA(
coord);
522 int location = convertor.cpModuleLocalRoI(
coord);