24 : base_class(
t,
n,
p) {}
31 return StatusCode::SUCCESS;
38 return StatusCode::SUCCESS;
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);
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);
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();
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--) {
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();
152 tempCoord = testKey.
downPhi(tempCoord);
154 tempCoord = testKey.
leftEta(tempCoord);
155 eta = tempCoord.
eta();
167 std::map<int, JetInput*>*
inputs =
new std::map<int, JetInput*>;
197 std::map<int, int> analysed;
198 std::map<int, JetInput*>::const_iterator
input = elements->begin();
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--) {
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);
219 eta = tempCoord.
eta();
232 std::map<int, JetInput*>*
inputs =
new std::map<int, JetInput*>;
255 jetCMXData.resize(4);
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) {
287 int ip = 2*(iFrame&3) + +
iPhi;
289 int ie = 2*(iFrame>>2) +
iEta;
302 unsigned int etL = tob.
ETLarge();
303 unsigned int etS = tob.
ETSmall();
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);
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) {
395 int ip = 2*(iFrame&3) + +
iPhi;
397 int ie = 2*(iFrame>>2) +
iEta;
410 unsigned int etL = tob.
ETLarge();
411 unsigned int etS = tob.
ETSmall();
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();