31 return StatusCode::SUCCESS;
38 return StatusCode::SUCCESS;
54 for( it = jes->
begin(); it != jes->
end(); ++it ){
55 double jetElementPhi=(*it)->phi();
56 double jetElementEta=(*it)->eta();
59 jetElementET = (*it)->et();
62 jetElementET = (*it)->sliceET(slice);
65 if (jetElementET == 0)
continue;
67 if (!testKey.
isFCAL(jetElementEta)) {
68 int key = testKey.
jeKey(jetElementPhi,jetElementEta);
69 std::map<int, JetInput*>::iterator test=elements->find( key );
70 if (test == elements->end()){
73 << jetElementPhi <<
" , " << jetElementEta <<
"). Key = " << key);
74 jetInput=
new JetInput(jetElementPhi,jetElementEta, jetElementET, key);
75 elements->insert(std::map<int, JetInput*>::value_type(key,jetInput));
78 ATH_MSG_ERROR(
"JetInput already exists (shouldn't happen!). Coords (" << jetElementEta <<
", " << jetElementPhi <<
"), key = " << key );
83 int jetInputET = (jetElementET>>1);
84 int underflow = jetElementET&0x1;
86 if ((*it)->isSaturated()) {
87 jetInputET = jetElementET;
91 double phiOffset = testKey.
dPhi(jetElementPhi,jetElementEta)/2.;
92 std::vector<double> phiValues;
93 std::vector<int> etValues;
94 phiValues.push_back(jetElementPhi - phiOffset);
95 etValues.push_back(jetInputET+underflow);
96 phiValues.push_back(jetElementPhi + phiOffset);
97 etValues.push_back(jetInputET);
99 for (
size_t iphi = 0; iphi < phiValues.size(); ++iphi) {
100 int key = testKey.
jeKey(phiValues[iphi],jetElementEta);
101 std::map<int, JetInput*>::iterator test=elements->find( key );
103 if (test == elements->end()){
106 << phiValues[iphi] <<
" , " << jetElementEta <<
"). Key = " << key);
107 jetInput=
new JetInput(phiValues[iphi],jetElementEta, etValues[iphi], key);
108 elements->insert(std::map<int, JetInput*>::value_type(key,jetInput));
111 ATH_MSG_ERROR(
"FCAL JetInput already exists (shouldn't happen!). Coords (" << jetElementEta <<
", " << jetElementPhi <<
"), key = " << key );
134 std::map<int, int> analysed;
135 std::map<int, JetInput*>::const_iterator input = elements->begin();
136 for ( ; input != elements->end(); ++input) {
137 double eta = (*input).second->eta();
138 double startPhi = (*input).second->phi();
139 for (
int etaOffset = 0; etaOffset >= -1; etaOffset--) {
141 for (
int phiOffset = 0; phiOffset >= -1; phiOffset--) {
142 int key = testKey.
jeKey(tempCoord);
143 std::map<int, int>::iterator test = analysed.find(key);
144 if (test == analysed.end()) {
145 analysed.insert(std::map<int, int>::value_type(key,1));
146 double tempEta = tempCoord.
eta();
147 double tempPhi = tempCoord.
phi();
149 if (roi->
isRoI()) rois->push_back(roi);
152 tempCoord = testKey.
downPhi(tempCoord);
154 tempCoord = testKey.
leftEta(tempCoord);
167 std::map<int, JetInput*>* inputs =
new std::map<int, JetInput*>;
174 for (std::map<int, JetInput*>::iterator it = inputs->begin(); it != inputs->end(); ++it) {
197 std::map<int, int> analysed;
198 std::map<int, JetInput*>::const_iterator input = elements->begin();
199 for ( ; input != elements->end(); ++input) {
200 double eta = (*input).second->eta();
201 double startPhi = (*input).second->phi();
202 for (
int etaOffset = 0; etaOffset >= -1; etaOffset--) {
204 for (
int phiOffset = 0; phiOffset >= -1; phiOffset--) {
205 int key = testKey.
jeKey(tempCoord);
206 std::map<int, int>::iterator test = analysed.find(key);
207 if (test == analysed.end()) {
208 analysed.insert(std::map<int, int>::value_type(key,1));
209 double tempEta = tempCoord.
eta();
210 double tempPhi = tempCoord.
phi();
216 tempCoord = testKey.
downPhi(tempCoord);
218 tempCoord = testKey.
leftEta(tempCoord);
232 std::map<int, JetInput*>* inputs =
new std::map<int, JetInput*>;
239 for (std::map<int, JetInput*>::iterator it = inputs->begin(); it != inputs->end(); ++it) {
255 jetCMXData.resize(4);
261 float PhiMin = ( crate + ( module>7 ? 2 : 0 ) )*
M_PI/2;
263 for (
int ip = 0; ip < 8; ++ip) PhiCell[ip] = PhiMin + ip*
M_PI/16 +
M_PI/32;
267 if ( module%8 == 0 ) {
273 else if ( module%8 == 7 ) {
280 for (
int ie = 0; ie < 4; ++ie) EtaCell[ie] = (module%8)*0.8 - 3.2 + ie*0.2 + 0.1;
285 for (
int iFrame = 0; iFrame < 8; ++iFrame) {
286 for (
int iPhi = 0; iPhi < 2; ++iPhi) {
287 int ip = 2*(iFrame&3) + + iPhi;
288 for (
int iEta = 0; iEta < 2; ++iEta) {
289 int ie = 2*(iFrame>>2) + iEta;
302 unsigned int etL = tob.
ETLarge();
303 unsigned int etS = tob.
ETSmall();
304 unsigned int lc = (iPhi << 1) + iEta;
308 RoI->
initialize(crate, module, iFrame, lc, etL, etS);
309 rois->push_back(RoI);
311 jetCMXData[0] |= (1 << iFrame);
315 jetCMXData[0] += ( etL << 13 );
316 jetCMXData[0] += ( (etS&7) << 8 );
317 jetCMXData[1] += ( (etS >> 3) & 0x3f );
318 jetCMXData[0] += ( lc << 11 );
321 jetCMXData[1] += ( etL << 13 );
322 jetCMXData[1] += ( (etS&0x1f) << 6 );
323 jetCMXData[2] += ( (etS >> 5) & 0xf );
324 jetCMXData[1] += ( lc << 11 );
327 jetCMXData[2] += ( etL << 13 );
328 jetCMXData[2] += ( (etS&0x7f) << 4 );
329 jetCMXData[3] += ( (etS >> 7) & 3 );
330 jetCMXData[2] += ( lc << 11 );
333 jetCMXData[3] += ( etL << 13 );
334 jetCMXData[3] += ( etS << 2 );
335 jetCMXData[3] += ( lc << 11 );
347 for (
unsigned int word = 0; word < 4; ++word) {
348 unsigned int parity = 1;
349 for (
unsigned int bit = 0; bit < 24; ++bit)
if ( ( (jetCMXData[word]>>bit) & 1) > 0 ) parity++;
351 jetCMXData[word] |= (parity<<23);
363 jetCMXData.resize(4);
369 float PhiMin = ( crate + ( module>7 ? 2 : 0 ) )*
M_PI/2;
371 for (
int ip = 0; ip < 8; ++ip) PhiCell[ip] = PhiMin + ip*
M_PI/16 +
M_PI/32;
375 if ( module%8 == 0 ) {
381 else if ( module%8 == 7 ) {
388 for (
int ie = 0; ie < 4; ++ie) EtaCell[ie] = (module%8)*0.8 - 3.2 + ie*0.2 + 0.1;
393 for (
int iFrame = 0; iFrame < 8; ++iFrame) {
394 for (
int iPhi = 0; iPhi < 2; ++iPhi) {
395 int ip = 2*(iFrame&3) + + iPhi;
396 for (
int iEta = 0; iEta < 2; ++iEta) {
397 int ie = 2*(iFrame>>2) + iEta;
410 unsigned int etL = tob.
ETLarge();
411 unsigned int etS = tob.
ETSmall();
412 unsigned int lc = (iPhi << 1) + iEta;
415 rois->push_back(RoI);
417 jetCMXData[0] |= (1 << iFrame);
421 jetCMXData[0] += ( etL << 13 );
422 jetCMXData[0] += ( (etS&7) << 8 );
423 jetCMXData[1] += ( (etS >> 3) & 0x3f );
424 jetCMXData[0] += ( lc << 11 );
427 jetCMXData[1] += ( etL << 13 );
428 jetCMXData[1] += ( (etS&0x1f) << 6 );
429 jetCMXData[2] += ( (etS >> 5) & 0xf );
430 jetCMXData[1] += ( lc << 11 );
433 jetCMXData[2] += ( etL << 13 );
434 jetCMXData[2] += ( (etS&0x7f) << 4 );
435 jetCMXData[3] += ( (etS >> 7) & 3 );
436 jetCMXData[2] += ( lc << 11 );
439 jetCMXData[3] += ( etL << 13 );
440 jetCMXData[3] += ( etS << 2 );
441 jetCMXData[3] += ( lc << 11 );
453 for (
unsigned int word = 0; word < 4; ++word) {
454 unsigned int parity = 1;
455 for (
unsigned int bit = 0; bit < 24; ++bit)
if ( ( (jetCMXData[word]>>bit) & 1) > 0 ) parity++;
457 jetCMXData[word] |= (parity<<23);
481 float RoIphi =
coord.phi();
482 float RoIeta =
coord.eta();
484 if (RoIeta > 3.1 &&
m_conv.column(roiWord) != 3) RoIeta = 3.1;
Scalar eta() const
pseudorapidity method
#define ATH_CHECK
Evaluate an expression and check for errors.
DataModel_detail::const_iterator< DataVector > const_iterator
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
CoordinateRange class declaration.
Coordinate class declaration.
double phi() const
return phi
double eta() const
return eta
This is an internal class, used in the jet trigger.
int ETSmall()
Returns Small cluster ET.
bool isRoI()
Does this window pass the local ET maximum condition.
int ETLarge()
Returns Large cluster ET.
xAOD::JEMTobRoI * jemTobRoI()
Create JEMTobRoI and return pointers to it.
Coordinate downPhi(const double phi, const double eta)
returns coord of next JE in -ve phi dir.
Coordinate leftEta(const double phi, const double eta)
returns key of JE in -ve eta dir.
double dPhi(const double phi, const double eta) const
return height of JE
virtual unsigned int jeKey(const xAOD::TriggerTower &tower)
returns key of passed tower
bool isFCAL(double eta) const
returns TRUE if this coordinate is in the FCAL
static const double RegionERROREtaCentre
void makePrivateStore()
Create a new (empty) private store for this object.
virtual void initialize(const int crate, const int jem, const int frame, const int location, const int energyLarge, const int energySmall)
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
JetElementContainer_v2 JetElementContainer
Define the latest version of the JetElement container.
JEMTobRoI_v1 JEMTobRoI
Define the latest version of the JEMTobRoI class.
JEMTobRoIContainer_v1 JEMTobRoIContainer
Define the latest version of the JEMTobRoI class.