CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1GctJetFinderBase.cc
Go to the documentation of this file.
2 
7 
10 
12 
13 //DEFINE STATICS
14 const unsigned int L1GctJetFinderBase::MAX_JETS_OUT = 6;
15 const unsigned int L1GctJetFinderBase::N_EXTRA_REGIONS_ETA00 = 2;
16 const unsigned int L1GctJetFinderBase::COL_OFFSET = L1GctJetFinderParams::NUMBER_ETA_VALUES+N_EXTRA_REGIONS_ETA00;
18 
20 const unsigned int L1GctJetFinderBase::N_COLS = 2;
21 const unsigned int L1GctJetFinderBase::CENTRAL_COL0 = 0;
22 
23 
26  m_id(id),
27  m_neighbourJetFinders(2),
28  m_idInRange(false),
29  m_gotNeighbourPointers(false),
30  m_gotJetFinderParams(false),
31  m_gotJetEtCalLuts(false),
32  m_gotChannelMask(false),
33  m_positiveEtaWheel(id >= (int) (L1CaloRegionDetId::N_PHI/2)), m_minColThisJf(0),
34  m_CenJetSeed(0), m_FwdJetSeed(0), m_TauJetSeed(0), m_EtaBoundry(0),
35  m_jetEtCalLuts(),
36  m_useImprovedTauAlgo(false), m_ignoreTauVetoBitsForIsolation(false), m_tauIsolationThreshold(0),
37  m_HttSumJetThreshold(0), m_HtmSumJetThreshold(0),
38  m_EttMask(), m_EtmMask(), m_HttMask(), m_HtmMask(),
39  m_inputRegions(MAX_REGIONS_IN),
40  m_sentProtoJets(MAX_JETS_OUT), m_rcvdProtoJets(MAX_JETS_OUT), m_keptProtoJets(MAX_JETS_OUT),
41  m_outputJets(MAX_JETS_OUT), m_sortedJets(MAX_JETS_OUT),
42  m_outputHfSums(),
43  m_outputJetsPipe(MAX_JETS_OUT),
44  m_outputEtSumPipe(), m_outputExSumPipe(), m_outputEySumPipe(),
45  m_outputHtSumPipe(), m_outputHxSumPipe(), m_outputHySumPipe()
46 {
47  // Call reset to initialise vectors for input and output
48  this->reset();
49  //Check jetfinder setup
50  if(m_id < 0 || m_id >= static_cast<int>(L1CaloRegionDetId::N_PHI))
51  {
52  if (m_verbose) {
53  edm::LogWarning("L1GctSetupError")
54  << "L1GctJetFinderBase::L1GctJetFinderBase() : Jet Finder ID " << m_id << " has been incorrectly constructed!\n"
55  << "ID number should be between the range of 0 to " << L1CaloRegionDetId::N_PHI-1 << "\n";
56  }
57  } else { m_idInRange = true; }
58 
59 }
60 
62 {
63 }
64 
66 void L1GctJetFinderBase::setNeighbourJetFinders(const std::vector<L1GctJetFinderBase*>& neighbours)
67 {
69  if (neighbours.size()==2) {
70  m_neighbourJetFinders = neighbours;
71  } else {
72  m_gotNeighbourPointers = false;
73  if (m_verbose) {
74  edm::LogWarning("L1GctSetupError")
75  << "L1GctJetFinderBase::setNeighbourJetFinders() : In Jet Finder ID " << m_id
76  << " size of input vector should be 2, but is in fact " << neighbours.size() << "\n";
77  }
78  }
79  if (m_neighbourJetFinders.at(0) == 0) {
80  m_gotNeighbourPointers = false;
81  if (m_verbose) {
82  edm::LogWarning("L1GctSetupError")
83  << "L1GctJetFinderBase::setNeighbourJetFinders() : In Jet Finder ID " << m_id
84  << " first neighbour pointer is set to zero\n";
85  }
86  }
87  if (m_neighbourJetFinders.at(1) == 0) {
88  m_gotNeighbourPointers = false;
89  if (m_verbose) {
90  edm::LogWarning("L1GctSetupError")
91  << "L1GctJetFinderBase::setNeighbourJetFinders() : In Jet Finder ID " << m_id
92  << " second neighbour pointer is set to zero\n";
93  }
94  }
96  edm::LogError("L1GctSetupError") << "Jet Finder ID " << m_id << " has incorrect assignment of neighbour pointers";
97  }
98 }
99 
102 {
103  m_CenJetSeed = jfpars->getCenJetEtSeedGct();
104  m_FwdJetSeed = jfpars->getForJetEtSeedGct();
105  m_TauJetSeed = jfpars->getTauJetEtSeedGct();
110  m_gotJetFinderParams = true;
111 }
112 
115 {
116  m_jetEtCalLuts = jfluts;
118 }
119 
122 {
123  bool matchCheckEttAndEtm = true;
124  if (chmask != 0) {
125  static const unsigned N_ETA = L1GctJetFinderParams::NUMBER_ETA_VALUES;
126  for (unsigned ieta=0; ieta<N_ETA; ++ieta) {
127  unsigned globalEta = (m_positiveEtaWheel ? N_ETA+ieta : N_ETA - (ieta+1) );
128  m_EttMask[ieta] = chmask->totalEtMask(globalEta);
129  m_EtmMask[ieta] = chmask->missingEtMask(globalEta);
130  m_HttMask[ieta] = chmask->totalHtMask(globalEta);
131  m_HtmMask[ieta] = chmask->missingHtMask(globalEta);
132 
133  matchCheckEttAndEtm &= (m_EttMask[ieta] == m_EtmMask[ieta]);
134  }
135  if (!matchCheckEttAndEtm)
136  edm::LogWarning("L1GctSetupError")
137  << "L1GctJetFinderBase::setEnergySumMasks() : In Jet Finder ID " << m_id
138  << " setting eta-dependent masks for Et sums: you cannot have different masks for total and missing Et\n";
139  m_gotChannelMask = true;
140  }
141 }
142 
143 
144 std::ostream& operator << (std::ostream& os, const L1GctJetFinderBase& algo)
145 {
146  using std::endl;
147  os << "ID = " << algo.m_id << endl;
148  os << "Calibration lut pointers stored for " << algo.m_jetEtCalLuts.size() << " eta bins" << endl;
149  for (unsigned ieta=0; ieta<algo.m_jetEtCalLuts.size(); ieta++) {
150  os << "Eta bin " << ieta << ", JetEtCalibrationLut* = " << algo.m_jetEtCalLuts.at(ieta) << endl;
151  }
152  os << "No of input regions " << algo.m_inputRegions.size() << endl;
153 // for(unsigned i=0; i < algo.m_inputRegions.size(); ++i)
154 // {
155 // os << algo.m_inputRegions.at(i);
156 // }
157  os << "No of output jets " << algo.m_outputJets.size() << endl;
158 // for(unsigned i=0; i < algo.m_outputJets.size(); ++i)
159 // {
160 // os << algo.m_outputJets.at(i);
161 // }
162  os << "Output total scalar Et " << algo.m_outputEtSum << endl;
163  os << "Output vector Et x component " << algo.m_outputExSum << endl;
164  os << "Output vector Et y component " << algo.m_outputEySum << endl;
165  os << "Output total scalar Ht " << algo.m_outputHtSum << endl;
166  os << "Output vector Ht x component " << algo.m_outputHxSum << endl;
167  os << "Output vector Ht y component " << algo.m_outputHySum << endl;
168  os << endl;
169 
170  return os;
171 }
172 
173 
175 {
176  m_inputRegions.clear();
177  m_inputRegions.resize(this->maxRegionsIn());
178  m_outputJets.clear();
179  m_outputJets.resize(MAX_JETS_OUT);
180  m_sortedJets.clear();
181  m_sortedJets.resize(MAX_JETS_OUT);
182 
183  m_sentProtoJets.clear();
185  m_rcvdProtoJets.clear();
187  m_keptProtoJets.clear();
189 
190  m_outputEtSum = 0;
191  m_outputExSum = 0;
192  m_outputEySum = 0;
193  m_outputHtSum = 0;
194  m_outputHxSum = 0;
195  m_outputHySum = 0;
196 
198 }
199 
201 {
202  m_outputJetsPipe.reset(numOfBx());
203  m_outputEtSumPipe.reset(numOfBx());
204  m_outputExSumPipe.reset(numOfBx());
205  m_outputEySumPipe.reset(numOfBx());
206  m_outputHtSumPipe.reset(numOfBx());
207  m_outputHxSumPipe.reset(numOfBx());
208  m_outputHySumPipe.reset(numOfBx());
209 }
210 
215 {
218  L1GctRegion tempRgn;
219  tempRgn.setBx(bxAbs());
220  m_inputRegions.assign(this->maxRegionsIn(), tempRgn);
221 
224  m_sentProtoJets.assign(MAX_JETS_OUT, tempRgn);
225  m_rcvdProtoJets.assign(MAX_JETS_OUT, tempRgn);
226  m_keptProtoJets.assign(MAX_JETS_OUT, tempRgn);
227 
229  L1GctJet tempJet;
230  tempJet.setBx(bxAbs());
231  m_outputJets.assign(MAX_JETS_OUT, tempJet);
232 }
233 
234 // This is how the regions from the RCT get into the GCT for processing
236 {
237  static const unsigned NPHI = L1CaloRegionDetId::N_PHI;
238  static const unsigned N_00 = N_EXTRA_REGIONS_ETA00;
239  unsigned crate = region.rctCrate();
240  // Find the column for this region in a global (eta,phi) array
241  // Note the column numbers here are not the same as region->gctPhi()
242  // because the RCT crates are not numbered from phi=0.
243  unsigned colAbsolute = (crate+1)*2 + region.rctPhi();
244  unsigned colRelative = ((colAbsolute+NPHI) - m_minColThisJf) % NPHI;
245  if (colRelative < this->nCols()) {
246  // We are in the right range in phi
247  // Now check we are in the right wheel (positive or negative eta)
248  if ( (crate/N_JF_PER_WHEEL) == (m_id/N_JF_PER_WHEEL) ) {
249  unsigned i = colRelative*COL_OFFSET + N_00 + region.rctEta();
251  } else {
252  // Accept neighbouring regions from the other wheel
253  if (region.rctEta() < N_00) {
254  unsigned i = colRelative*COL_OFFSET + N_00 - (region.rctEta()+1);
256  }
257  }
258  }
259 }
260 
262 std::vector< L1GctInternJetData > L1GctJetFinderBase::getInternalJets() const {
263 
264  std::vector< L1GctInternJetData > result;
265  for (RawJetVector::const_iterator jet=m_outputJetsPipe.contents.begin();
266  jet!=m_outputJetsPipe.contents.end(); jet++) {
267  result.push_back( L1GctInternJetData::fromEmulator(jet->id(),
268  jet->bx(),
269  jet->calibratedEt(m_jetEtCalLuts.at(jet->rctEta())),
270  jet->overFlow(),
271  jet->tauVeto(),
272  jet->hwEta(),
273  jet->hwPhi(),
274  jet->rank(m_jetEtCalLuts.at(jet->rctEta())) ) );
275  }
276  return result;
277 
278 }
279 
281 std::vector< L1GctInternEtSum > L1GctJetFinderBase::getInternalEtSums() const {
282 
283  std::vector< L1GctInternEtSum > result;
284  for (int bx=0; bx<numOfBx(); bx++) {
285  result.push_back( L1GctInternEtSum::fromEmulatorJetTotEt ( m_outputEtSumPipe.contents.at(bx).value(),
286  m_outputEtSumPipe.contents.at(bx).overFlow(),
287  static_cast<int16_t> (bx-bxMin()) ) );
288  result.push_back( L1GctInternEtSum::fromEmulatorJetMissEt( m_outputExSumPipe.contents.at(bx).value(),
289  m_outputExSumPipe.contents.at(bx).overFlow(),
290  static_cast<int16_t> (bx-bxMin()) ) );
291  result.push_back( L1GctInternEtSum::fromEmulatorJetMissEt( m_outputEySumPipe.contents.at(bx).value(),
292  m_outputEySumPipe.contents.at(bx).overFlow(),
293  static_cast<int16_t> (bx-bxMin()) ) );
294  result.push_back( L1GctInternEtSum::fromEmulatorJetTotHt ( m_outputHtSumPipe.contents.at(bx).value(),
295  m_outputHtSumPipe.contents.at(bx).overFlow(),
296  static_cast<int16_t> (bx-bxMin()) ) );
297  }
298  return result;
299 }
300 
301 std::vector< L1GctInternHtMiss > L1GctJetFinderBase::getInternalHtMiss() const {
302 
303  std::vector< L1GctInternHtMiss > result;
304  for (int bx=0; bx<numOfBx(); bx++) {
305  result.push_back( L1GctInternHtMiss::emulatorJetMissHt( m_outputHxSumPipe.contents.at(bx).value(),
306  m_outputHySumPipe.contents.at(bx).value(),
307  m_outputHxSumPipe.contents.at(bx).overFlow(),
308  static_cast<int16_t> (bx-bxMin()) ) );
309  }
310  return result;
311 
312 }
313 
314 
315 // PROTECTED METHODS BELOW
318 {
319  switch (ft) {
320  case TOP :
321  m_rcvdProtoJets = m_neighbourJetFinders.at(0)->getSentProtoJets(); break;
322  case BOT :
323  m_rcvdProtoJets = m_neighbourJetFinders.at(1)->getSentProtoJets(); break;
324  case TOPBOT :
325  // Copy half the jets from each neighbour
326  static const unsigned int MAX_TOPBOT_JETS = MAX_JETS_OUT/2;
327  unsigned j=0;
329  temp = m_neighbourJetFinders.at(0)->getSentProtoJets();
330  for ( ; j<MAX_TOPBOT_JETS; ++j) {
331  m_rcvdProtoJets.at(j) = temp.at(j);
332  }
333  temp = m_neighbourJetFinders.at(1)->getSentProtoJets();
334  for ( ; j<MAX_JETS_OUT; ++j) {
335  m_rcvdProtoJets.at(j) = temp.at(j);
336  }
337  break;
338  }
339 }
340 
343 {
344  JetVector tempJets(MAX_JETS_OUT);
345  for (unsigned j=0; j<MAX_JETS_OUT; j++) {
346  tempJets.at(j) = m_outputJets.at(j).jetCand(m_jetEtCalLuts);
347  }
348 
349  // Sort the jets
350  L1GctJetSorter jSorter(tempJets);
351  m_sortedJets = jSorter.getSortedJets();
352 
353  //store jets in "pipeline memory" for checking
355 }
356 
359 {
360 
361  // Refactored energy sums code - find scalar and vector sums
362  // of Et and Ht instead of strip stums
363  doEtSums();
364  doHtSums();
365 
366  //calculate the Hf tower Et sums and tower-over-threshold counts
368 
369  return;
370 }
371 
372 // Calculates scalar and vector sum of Et over input regions
374  unsigned et0 = 0;
375  unsigned et1 = 0;
376  bool of = false;
377 
378  // Add the Et values from regions 2 to 12 for strip 0,
379  // the Et values from regions 15 to 25 for strip 1.
380  unsigned offset = COL_OFFSET * centralCol0();
381  unsigned ieta = 0;
382  for (UShort i=offset+N_EXTRA_REGIONS_ETA00; i < offset+COL_OFFSET; ++i, ++ieta) {
383  if (!m_EttMask[ieta]) {
384  et0 += m_inputRegions.at(i).et();
385  of |= m_inputRegions.at(i).overFlow();
386  et1 += m_inputRegions.at(i+COL_OFFSET).et();
387  of |= m_inputRegions.at(i+COL_OFFSET).overFlow();
388  }
389  }
390 
391  etTotalType etStrip0(et0);
392  etTotalType etStrip1(et1);
393  etStrip0.setOverFlow(etStrip0.overFlow() || of);
394  etStrip1.setOverFlow(etStrip1.overFlow() || of);
395  unsigned xfact0 = (4*m_id + 6) % 36;
396  unsigned xfact1 = (4*m_id + 8) % 36;
397  unsigned yfact0 = (4*m_id + 15) % 36;
398  unsigned yfact1 = (4*m_id + 17) % 36;
399  m_outputEtSum = etStrip0 + etStrip1;
401  m_outputExSum = etComponentForJetFinder<L1GctInternEtSum::kTotEtOrHtNBits,L1GctInternEtSum::kJetMissEtNBits>
402  (etStrip0, xfact0, etStrip1, xfact1);
403  m_outputEySum = etComponentForJetFinder<L1GctInternEtSum::kTotEtOrHtNBits,L1GctInternEtSum::kJetMissEtNBits>
404  (etStrip0, yfact0, etStrip1, yfact1);
405 
408  m_outputEySumPipe.store(m_outputEySum, bxRel());
409 }
410 
411 // Calculates scalar and vector sum of Ht over calibrated jets
413  unsigned htt = 0;
414  unsigned ht0 = 0;
415  unsigned ht1 = 0;
416  bool of = false;
417 
418  for(UShort i=0; i < MAX_JETS_OUT; ++i)
419  {
420  // Only sum Ht for valid jets
421  if (!m_outputJets.at(i).isNullJet()) {
422  unsigned ieta = m_outputJets.at(i).rctEta();
423  unsigned htJet = m_outputJets.at(i).calibratedEt(m_jetEtCalLuts.at(ieta));
424  // Scalar sum of Htt, with associated threshold
425  if (htJet >= m_HttSumJetThreshold && !m_HttMask[ieta]) {
426  htt += htJet;
427  }
428  // Strip sums, for input to Htm calculation, with associated threshold
429  if (htJet >= m_HtmSumJetThreshold && !m_HtmMask[ieta]) {
430  if (m_outputJets.at(i).rctPhi() == 0) {
431  ht0 += htJet;
432  }
433  if (m_outputJets.at(i).rctPhi() == 1) {
434  ht1 += htJet;
435  }
436  of |= m_outputJets.at(i).overFlow();
437  }
438  }
439  }
440 
441  etHadType httTotal(htt);
442  etHadType htStrip0(ht0);
443  etHadType htStrip1(ht1);
444  httTotal.setOverFlow(httTotal.overFlow() || of);
445  if (httTotal.overFlow()) httTotal.setValue(htTotalMaxValue);
446  htStrip0.setOverFlow(htStrip0.overFlow() || of);
447  htStrip1.setOverFlow(htStrip1.overFlow() || of);
448  unsigned xfact0 = (4*m_id + 10) % 36;
449  unsigned xfact1 = (4*m_id + 4) % 36;
450  unsigned yfact0 = (4*m_id + 19) % 36;
451  unsigned yfact1 = (4*m_id + 13) % 36;
452  m_outputHtSum = httTotal;
453  m_outputHxSum = etComponentForJetFinder<L1GctInternEtSum::kTotEtOrHtNBits,L1GctInternHtMiss::kJetMissHtNBits>
454  (htStrip0, xfact0, htStrip1, xfact1);
455  m_outputHySum = etComponentForJetFinder<L1GctInternEtSum::kTotEtOrHtNBits,L1GctInternHtMiss::kJetMissHtNBits>
456  (htStrip0, yfact0, htStrip1, yfact1);
457 
458  // Common overflow for Ht components
459  bool htmOverFlow = m_outputHxSum.overFlow() || m_outputHySum.overFlow();
460  m_outputHxSum.setOverFlow(htmOverFlow);
461  m_outputHySum.setOverFlow(htmOverFlow);
462 
465  m_outputHySumPipe.store(m_outputHySum, bxRel());
466 }
467 
468 
469 // Calculates Hf inner rings Et sum, and counts number of "fineGrain" bits set
471 {
472  static const UShort NUMBER_OF_FRWRD_RINGS = 4;
473  static const UShort NUMBER_OF_INNER_RINGS = 2;
474  std::vector<unsigned> et(NUMBER_OF_INNER_RINGS, 0);
475  std::vector<bool> of(NUMBER_OF_INNER_RINGS, false);
476  std::vector<unsigned> nt(NUMBER_OF_INNER_RINGS, 0);
477 
479  for (UShort i=0; i < NUMBER_OF_FRWRD_RINGS; ++i) {
480  offset--;
481 
482  // Sum HF Et and count jets above threshold over "inner rings"
483  if (i<NUMBER_OF_INNER_RINGS) {
484  et.at(i) += m_inputRegions.at(offset).et();
485  of.at(i) = of.at(i) || m_inputRegions.at(offset).overFlow();
486 
487  et.at(i) += m_inputRegions.at(offset+COL_OFFSET).et();
488  of.at(i) = of.at(i) || m_inputRegions.at(offset+COL_OFFSET).overFlow();
489 
490  if (m_inputRegions.at(offset).fineGrain()) nt.at(i)++;
491  if (m_inputRegions.at(offset+COL_OFFSET).fineGrain()) nt.at(i)++;
492  }
493  }
494  hfTowerSumsType temp(et.at(0), et.at(1), nt.at(0), nt.at(1));
495  temp.etSum0.setOverFlow(temp.etSum0.overFlow() || of.at(0));
496  temp.etSum1.setOverFlow(temp.etSum1.overFlow() || of.at(1));
497  return temp;
498 }
499 
500 
501 // Here is where the rotations are actually done
502 // Procedure suitable for implementation in hardware, using
503 // integer multiplication and bit shifting operations
504 
505 template <int kBitsInput, int kBitsOutput>
508  const L1GctUnsignedInt<kBitsInput>& etStrip1, const unsigned& fact1) {
509 
510  // typedefs and constants
511  typedef L1GctTwosComplement<kBitsOutput> OutputType;
512 
513  // The sin(phi), cos(phi) factors are represented in 15 bits,
514  // as numbers in the range -2^14 to 2^14.
515  // We multiply each input strip Et by the required factor
516  // then shift, to divide by 2^13. This gives an extra bit
517  // of precision on the LSB of the output values.
518  // It's important to avoid systematically biasing the Ex, Ey
519  // component values because this results in an asymmetric
520  // distribution in phi for the final MEt.
521  // The extra LSB is required because one of the factors is 0.5.
522  // Applying this factor without the extra LSB corrects odd values
523  // systematically down by 0.5; or all values by 0.25
524  // on average, giving a shift of -2 units in Ex.
525 
526  static const int internalComponentSize = 15;
527  static const int maxEt = 1<<internalComponentSize;
528 
529  static const int kBitsFactor = internalComponentSize+kBitsInput+1;
530  static const int maxFactor = 1<<kBitsFactor;
531 
532  static const int bitsToShift = internalComponentSize-2;
533  static const int halfInputLsb = 1<<(bitsToShift-1);
534 
535  // These factors correspond to the sine of angles from -90 degrees to
536  // 90 degrees in 10 degree steps, multiplied by 16383 and written
537  // as a <kBitsFactor>-bit 2s-complement number.
538  const int factors[19] = {maxFactor-16383, maxFactor-16134, maxFactor-15395, maxFactor-14188, maxFactor-12550,
539  maxFactor-10531, maxFactor-8192, maxFactor-5603, maxFactor-2845, 0,
540  2845, 5603, 8192, 10531, 12550, 14188, 15395, 16134, 16383};
541 
542  int rotatedValue0, rotatedValue1, myFact;
543  int etComponentSum = 0;
544 
545  if (fact0 >= 36 || fact1 >= 36) {
546  if (m_verbose) {
547  edm::LogError("L1GctProcessingError")
548  << "L1GctJetLeafCard::rotateEtValue() has been called with factor numbers "
549  << fact0 << " and " << fact1 << "; should be less than 36 \n";
550  }
551  } else {
552 
553  // First strip - choose the required multiplication factor
554  if (fact0>18) { myFact = factors[(36-fact0)]; }
555  else { myFact = factors[fact0]; }
556 
557  // Multiply the Et value by the factor.
558  rotatedValue0 = static_cast<int>(etStrip0.value()) * myFact;
559 
560  // Second strip - choose the required multiplication factor
561  if (fact1>18) { myFact = factors[(36-fact1)]; }
562  else { myFact = factors[fact1]; }
563 
564  // Multiply the Et value by the factor.
565  rotatedValue1 = static_cast<int>(etStrip1.value()) * myFact;
566 
567  // Add the two scaled values together, with full resolution including
568  // fractional parts from the sin(phi), cos(phi) scaling.
569  // Adjust the value to avoid truncation errors since these
570  // accumulate and cause problems for the missing Et measurement.
571  // Then discard the 13 LSB and interpret the result as
572  // a 15-bit twos complement integer.
573  etComponentSum = ((rotatedValue0 + rotatedValue1) + halfInputLsb)>>bitsToShift;
574 
575  etComponentSum = etComponentSum & (maxEt-1);
576  if (etComponentSum >= (maxEt/2)) {
577  etComponentSum = etComponentSum - maxEt;
578  }
579  }
580 
581  // Store as a TwosComplement format integer and return
582  OutputType temp(etComponentSum);
583  temp.setOverFlow(temp.overFlow() || etStrip0.overFlow() || etStrip1.overFlow());
584  return temp;
585 }
586 
587 // Declare the specific versions we want to use, to help the linker out
588 // One for the MET components
589 template
591 L1GctJetFinderBase::etComponentForJetFinder<L1GctInternEtSum::kTotEtOrHtNBits,L1GctInternEtSum::kJetMissEtNBits>
592 (const L1GctJetFinderBase::etTotalType&, const unsigned&,
593  const L1GctJetFinderBase::etTotalType&, const unsigned&);
594 
595 // One for the MHT components
596 template
598 L1GctJetFinderBase::etComponentForJetFinder<L1GctInternEtSum::kTotEtOrHtNBits,L1GctInternHtMiss::kJetMissHtNBits>
599 (const L1GctJetFinderBase::etTotalType&, const unsigned&,
600  const L1GctJetFinderBase::etTotalType&, const unsigned&);
bool m_idInRange
Remember whether range check on the input ID was ok.
bool overFlow() const
access overflow
void setOverFlow(bool oflow)
set the overflow bit
void reset()
complete reset of processor
etTotalType m_outputEtSum
output Et strip sums and Ht - refactored
int i
Definition: DBlmapReader.cc:9
static const unsigned int MAX_JETS_OUT
Max of 6 jets found per jetfinder in a 2*11 search area.
std::vector< L1GctJetCand > JetVector
void doEtSums()
Calculates scalar and vector sum of Et over input regions.
void setOverFlow(bool oflow)
set the overflow bit
RegionsVector m_sentProtoJets
List of pre-clustered jets to be sent to neighbour after the first stage of clustering.
htCompInternJfType m_outputHySum
static L1GctInternEtSum fromEmulatorJetTotEt(unsigned totEt, bool overFlow, int16_t bx)
Emulator constructors.
hfTowerSumsType calcHfSums() const
Calculates Et sum and number of towers over threshold in Hf.
unsigned rctEta() const
get local eta index (within RCT crate)
Definition: L1CaloRegion.h:174
unsigned rctCrate() const
get RCT crate ID
Definition: L1CaloRegion.h:165
bool m_verbose
Flag to control output messages.
unsigned getCenJetEtSeedGct() const
unsigned getTauJetEtSeedGct() const
std::vector< L1GctInternHtMiss > getInternalHtMiss() const
bool m_gotChannelMask
Remember whether channel mask have been stored.
Gct version of a calorimeter region, used within GCT emulation.
Definition: L1GctRegion.h:17
void setBx(int16_t bx)
set bx
Pipeline< etCompInternJfType > m_outputExSumPipe
int bxRel() const
virtual void resetPipelines()
bool totalHtMask(unsigned ieta) const
int bxMin() const
Support for multiple beam crossing operation.
void setNeighbourJetFinders(const std::vector< L1GctJetFinderBase * > &neighbours)
Set pointers to neighbours - needed to complete the setup.
bool missingHtMask(unsigned ieta) const
fetchType
different ways of getting the neighbour data
htCompInternJfType m_outputHxSum
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
virtual void setupObjects()
Initialise inputs with null objects for the correct bunch crossing if required.
unsigned getTauIsoEtThresholdGct() const
Pipeline< htCompInternJfType > m_outputHySumPipe
int numOfBx() const
Pipeline< htCompInternJfType > m_outputHxSumPipe
L1GctJetFinderBase(int id)
id is 0-8 for -ve Eta jetfinders, 9-17 for +ve Eta, for increasing Phi.
A Level-1 jet candidate, used within GCT emulation.
Definition: L1GctJet.h:27
void setBx(const int16_t bx)
Definition: L1GctJet.h:51
virtual unsigned centralCol0() const
JetVector getSortedJets() const
Base class to allow implementation of jetFinder algorithms.
static L1GctRegion makeJfInputRegion(const L1CaloRegion &)
Definition: L1GctRegion.cc:7
ABC for a GCT trigger data processing unit.
static L1GctInternEtSum fromEmulatorJetTotHt(unsigned totHt, bool overFlow, int16_t bx)
unsigned value() const
access value as unsigned
unsigned getMHtJetEtThresholdGct() const
L1GctTwosComplement< kBitsOutput > etComponentForJetFinder(const L1GctUnsignedInt< kBitsInput > &etStrip0, const unsigned &fact0, const L1GctUnsignedInt< kBitsInput > &etStrip1, const unsigned &fact1)
Private method for calculating MEt and MHt components.
bool m_gotNeighbourPointers
Remember whether the neighbour pointers have been stored.
std::vector< L1GctInternJetData > getInternalJets() const
get output jets in raw format - to be stored in the event
void doHtSums()
Calculates scalar and vector sum of Ht over calibrated jets.
Definition of signed integer types with overflow.
tuple result
Definition: query.py:137
static L1GctInternHtMiss emulatorJetMissHt(const int htx, const int hty, const bool overFlow, const int16_t bx)
Named ctor for making missing Ht x &amp; y components object from emulator (jetFinder output)...
void sortJets()
Sort the found jets. All jetFinders should call this in process().
std::vector< L1GctInternEtSum > getInternalEtSums() const
get et sums in raw format - to be stored in the event
unsigned rctPhi() const
get local phi index (within RCT crate)
Definition: L1CaloRegion.h:177
void setJetEtCalibrationLuts(const lutPtrVector &jfluts)
Set pointer to calibration Lut - needed to complete the setup.
lutPtrVector m_jetEtCalLuts
Jet Et Conversion LUT pointer.
int j
Definition: DBlmapReader.cc:9
std::vector< L1GctJetFinderBase * > m_neighbourJetFinders
Store neighbour pointers.
Pipeline< etHadType > m_outputHtSumPipe
static const unsigned int N_EXTRA_REGIONS_ETA00
Number of additional regions to process on the &quot;wrong&quot; side of eta=0 (determines COL_OFFSET) ...
unsigned short int UShort
static const unsigned int CENTRAL_COL0
RegionsVector m_keptProtoJets
List of pre-clustered jets retained locally as input to the final clustering.
static const unsigned int MAX_REGIONS_IN
The real jetFinders must define these constants.
static const unsigned int COL_OFFSET
The index offset between columns.
RawJetVector m_outputJets
output jets
void setJetFinderParams(const L1GctJetFinderParams *jfpars)
Set pointer to parameters - needed to complete the setup.
RegionsVector m_inputRegions
static const unsigned NUMBER_ETA_VALUES
Number of eta bins used in correction.
int nt
Definition: AMPTWrapper.h:32
Pipeline< etCompInternJfType > m_outputEySumPipe
m_id("(unknown)")
RawJetPipeline m_outputJetsPipe
Output jets &quot;pipeline memory&quot; for checking.
virtual void resetProcessor()
Separate reset methods for the processor itself and any data stored in pipelines. ...
static L1GctInternJetData fromEmulator(L1CaloRegionDetId rgn, int16_t bx, uint16_t et, bool overFlow, bool tauVeto, uint8_t eta, uint8_t phi, uint16_t rank)
unsigned getCenForJetEtaBoundary() const
void setInputRegion(const L1CaloRegion &region)
Set input data.
virtual unsigned nCols() const
void setEnergySumMasks(const L1GctChannelMask *chmask)
Set masks for energy summing.
std::vector< lutPtr > lutPtrVector
void fetchProtoJetsFromNeighbour(const fetchType ft)
fetch the protoJets from neighbour jetFinder
unsigned getHtJetEtThresholdGct() const
bool totalEtMask(unsigned ieta) const
etCompInternJfType m_outputEySum
void setValue(unsigned value)
Set value from unsigned.
int bxAbs() const
Pipeline< etTotalType > m_outputEtSumPipe
&quot;Pipeline memories&quot; for energy sums
unsigned getForJetEtSeedGct() const
bool m_gotJetFinderParams
Remember whether jetfinder parameters have been stored.
A calorimeter trigger region (sum of 4x4 trigger towers)
Definition: L1CaloRegion.h:22
virtual unsigned maxRegionsIn() const
static L1GctInternEtSum fromEmulatorJetMissEt(int missEtxOrEty, bool overFlow, int16_t bx)
static const unsigned N_PHI
unsigned m_minColThisJf
parameter to determine which Regions belong in our acceptance
volatile std::atomic< bool > shutdown_flag false
bool overFlow() const
access overflow
RegionsVector m_rcvdProtoJets
List of pre-clustered jets received from neighbour before the final stage of clustering.
static const unsigned int N_COLS
std::vector< L1GctRegion > RegionsVector
etCompInternJfType m_outputExSum
bool missingEtMask(unsigned ieta) const
bool m_gotJetEtCalLuts
Remember whether jet Et calibration Lut pointers have been stored.
void doEnergySums()
Fill the Et strip sums and Ht sum. All jetFinders should call this in process().
hfTowerSumsType m_outputHfSums
static const unsigned int N_JF_PER_WHEEL
No of jetFinders per Wheel.