CMS 3D CMS Logo

HcalTriggerPrimitiveAlgo.cc
Go to the documentation of this file.
2 
6 
10 
13 
16 
18 
19 #include <iostream>
20 
21 using namespace std;
22 
24  const std::vector<double>& w,
25  int latency,
26  uint32_t FG_threshold,
27  const std::vector<uint32_t>& FG_HF_thresholds,
28  uint32_t ZS_threshold,
29  int numberOfSamples,
36  uint32_t minSignalThreshold,
37  uint32_t PMT_NoiseThreshold)
38  : incoder_(nullptr),
39  outcoder_(nullptr),
40  theThreshold(0),
41  peakfind_(pf),
42  weights_(w),
43  latency_(latency),
44  FG_threshold_(FG_threshold),
45  FG_HF_thresholds_(FG_HF_thresholds),
46  ZS_threshold_(ZS_threshold),
47  numberOfSamples_(numberOfSamples),
48  numberOfPresamples_(numberOfPresamples),
49  numberOfFilterPresamplesHBQIE11_(numberOfFilterPresamplesHBQIE11),
50  numberOfFilterPresamplesHEQIE11_(numberOfFilterPresamplesHEQIE11),
51  numberOfSamplesHF_(numberOfSamplesHF),
52  numberOfPresamplesHF_(numberOfPresamplesHF),
53  useTDCInMinBiasBits_(useTDCInMinBiasBits),
54  minSignalThreshold_(minSignalThreshold),
55  PMT_NoiseThreshold_(PMT_NoiseThreshold),
56  NCTScaleShift(0),
57  RCTScaleShift(0),
58  peak_finder_algorithm_(2),
59  override_parameters_() {
60  //No peak finding setting (for Fastsim)
61  if (!peakfind_) {
62  numberOfSamples_ = 1;
66  }
67  // Switch to integer for comparisons - remove compiler warning
69 }
70 
72 
74  upgrade_hb_ = hb;
75  upgrade_he_ = he;
76  upgrade_hf_ = hf;
77 }
78 
81 
82  if (override_parameters_.exists("ADCThresholdHF")) {
83  override_adc_hf_ = true;
84  override_adc_hf_value_ = override_parameters_.getParameter<uint32_t>("ADCThresholdHF");
85  }
86  if (override_parameters_.exists("TDCMaskHF")) {
87  override_tdc_hf_ = true;
88  override_tdc_hf_value_ = override_parameters_.getParameter<unsigned long long>("TDCMaskHF");
89  }
90 }
91 
93  // TODO: Need to add support for seperate 28, 29 in HE
94  //Hack for 300_pre10, should be removed.
95  if (frame.id().depth() == 5)
96  return;
97 
98  std::vector<HcalTrigTowerDetId> ids = theTrigTowerGeometry->towerIds(frame.id());
99  assert(ids.size() == 1 || ids.size() == 2);
100  IntegerCaloSamples samples1(ids[0], int(frame.size()));
101 
102  samples1.setPresamples(frame.presamples());
103  incoder_->adc2Linear(frame, samples1);
104 
105  std::vector<bool> msb;
106  incoder_->lookupMSB(frame, msb);
107 
108  if (ids.size() == 2) {
109  // make a second trigprim for the other one, and split the energy
110  IntegerCaloSamples samples2(ids[1], samples1.size());
111  for (int i = 0; i < samples1.size(); ++i) {
112  samples1[i] = uint32_t(samples1[i] * 0.5);
113  samples2[i] = samples1[i];
114  }
115  samples2.setPresamples(frame.presamples());
116  addSignal(samples2);
117  addFG(ids[1], msb);
118  }
119  addSignal(samples1);
120  addFG(ids[0], msb);
121 }
122 
124  if (frame.id().depth() == 1 || frame.id().depth() == 2) {
125  std::vector<HcalTrigTowerDetId> ids = theTrigTowerGeometry->towerIds(frame.id());
126  std::vector<HcalTrigTowerDetId>::const_iterator it;
127  for (it = ids.begin(); it != ids.end(); ++it) {
128  HcalTrigTowerDetId trig_tower_id = *it;
129  IntegerCaloSamples samples(trig_tower_id, frame.size());
130  samples.setPresamples(frame.presamples());
132 
133  // Don't add to final collection yet
134  // HF PMT veto sum is calculated in analyzerHF()
135  IntegerCaloSamples zero_samples(trig_tower_id, frame.size());
136  zero_samples.setPresamples(frame.presamples());
137  addSignal(zero_samples);
138 
139  // Pre-LS1 Configuration
140  if (trig_tower_id.version() == 0) {
141  // Mask off depths: fgid is the same for both depths
142  uint32_t fgid = (frame.id().maskDepth());
143 
144  if (theTowerMapFGSum.find(trig_tower_id) == theTowerMapFGSum.end()) {
145  SumFGContainer sumFG;
146  theTowerMapFGSum.insert(std::pair<HcalTrigTowerDetId, SumFGContainer>(trig_tower_id, sumFG));
147  }
148 
149  SumFGContainer& sumFG = theTowerMapFGSum[trig_tower_id];
150  SumFGContainer::iterator sumFGItr;
151  for (sumFGItr = sumFG.begin(); sumFGItr != sumFG.end(); ++sumFGItr) {
152  if (sumFGItr->id() == fgid) {
153  break;
154  }
155  }
156  // If find
157  if (sumFGItr != sumFG.end()) {
158  for (int i = 0; i < samples.size(); ++i) {
159  (*sumFGItr)[i] += samples[i];
160  }
161  } else {
162  //Copy samples (change to fgid)
163  IntegerCaloSamples sumFGSamples(DetId(fgid), samples.size());
164  sumFGSamples.setPresamples(samples.presamples());
165  for (int i = 0; i < samples.size(); ++i) {
166  sumFGSamples[i] = samples[i];
167  }
168  sumFG.push_back(sumFGSamples);
169  }
170 
171  // set veto to true if Long or Short less than threshold
172  if (HF_Veto.find(fgid) == HF_Veto.end()) {
173  vector<bool> vetoBits(samples.size(), false);
174  HF_Veto[fgid] = vetoBits;
175  }
176  for (int i = 0; i < samples.size(); ++i) {
177  if (samples[i] < minSignalThreshold_) {
178  HF_Veto[fgid][i] = true;
179  }
180  }
181  }
182  // HF 1x1
183  else if (trig_tower_id.version() == 1) {
184  uint32_t fgid = (frame.id().maskDepth());
185  HFDetails& details = theHFDetailMap[trig_tower_id][fgid];
186  // Check the frame type to determine long vs short
187  if (frame.id().depth() == 1) { // Long
188  details.long_fiber = samples;
189  details.LongDigi = frame;
190  } else if (frame.id().depth() == 2) { // Short
191  details.short_fiber = samples;
192  details.ShortDigi = frame;
193  } else {
194  // Neither long nor short... So we have no idea what to do
195  edm::LogWarning("HcalTPAlgo") << "Unable to figure out what to do with data frame for " << frame.id();
196  return;
197  }
198  }
199  // Uh oh, we are in a bad/unknown state! Things will start crashing.
200  else {
201  return;
202  }
203  }
204  }
205 }
206 
208  HcalDetId detId = frame.detid();
209  // prevent QIE10 calibration channels from entering TP emulation
210  if (detId.subdet() != HcalForward)
211  return;
212 
213  auto ids = theTrigTowerGeometry->towerIds(frame.id());
214  for (const auto& id : ids) {
215  if (id.version() == 0) {
216  edm::LogError("HcalTPAlgo") << "Encountered QIE10 data frame mapped to TP version 0:" << id;
217  continue;
218  }
219 
220  int nsamples = frame.samples();
221 
222  IntegerCaloSamples samples(id, nsamples);
223  samples.setPresamples(frame.presamples());
225 
226  // Don't add to final collection yet
227  // HF PMT veto sum is calculated in analyzerHF()
228  IntegerCaloSamples zero_samples(id, nsamples);
229  zero_samples.setPresamples(frame.presamples());
230  addSignal(zero_samples);
231 
232  auto fid = HcalDetId(frame.id());
233  auto& details = theHFUpgradeDetailMap[id][fid.maskDepth()];
234  auto& detail = details[fid.depth() - 1];
235  detail.samples = samples;
236  detail.digi = frame;
237  detail.validity.resize(nsamples);
238  detail.passTDC.resize(nsamples);
239  incoder_->lookupMSB(frame, detail.fgbits);
240  for (int idx = 0; idx < nsamples; ++idx) {
241  detail.validity[idx] = validChannel(frame, idx);
242  detail.passTDC[idx] = passTDC(frame, idx);
243  }
244  }
245 }
246 
248  HcalDetId detId(frame.id());
249  // prevent QIE11 calibration channels from entering TP emulation
250  if (detId.subdet() != HcalEndcap && detId.subdet() != HcalBarrel)
251  return;
252 
253  std::vector<HcalTrigTowerDetId> ids = theTrigTowerGeometry->towerIds(detId);
254  assert(ids.size() == 1 || ids.size() == 2);
255  IntegerCaloSamples samples1(ids[0], int(frame.samples()));
256 
257  samples1.setPresamples(frame.presamples());
258  incoder_->adc2Linear(frame, samples1);
259 
260  std::vector<std::bitset<2>> msb(frame.samples(), 0);
261  incoder_->lookupMSB(frame, msb);
262 
263  if (ids.size() == 2) {
264  // make a second trigprim for the other one, and share the energy
265  IntegerCaloSamples samples2(ids[1], samples1.size());
266  for (int i = 0; i < samples1.size(); ++i) {
267  samples1[i] = uint32_t(samples1[i]);
268  samples2[i] = samples1[i];
269  }
270  samples2.setPresamples(frame.presamples());
271  addSignal(samples2);
272  addUpgradeFG(ids[1], detId.depth(), msb);
273  }
274  addSignal(samples1);
275  addUpgradeFG(ids[0], detId.depth(), msb);
276 }
277 
280  SumMap::iterator itr = theSumMap.find(id);
281  if (itr == theSumMap.end()) {
282  theSumMap.insert(std::make_pair(id, samples));
283  } else {
284  // wish CaloSamples had a +=
285  for (int i = 0; i < samples.size(); ++i) {
286  (itr->second)[i] += samples[i];
287  }
288  }
289 }
290 
292  int shrink = weights_.size() - 1;
293  std::vector<bool>& msb = fgMap_[samples.id()];
294  IntegerCaloSamples sum(samples.id(), samples.size());
295 
296  //slide algo window
297  for (int ibin = 0; ibin < int(samples.size()) - shrink; ++ibin) {
298  int algosumvalue = 0;
299  for (unsigned int i = 0; i < weights_.size(); i++) {
300  //add up value * scale factor
301  algosumvalue += int(samples[ibin + i] * weights_[i]);
302  }
303  if (algosumvalue < 0)
304  sum[ibin] = 0; // low-side
305  //high-side
306  //else if (algosumvalue>QIE8_LINEARIZATION_ET) sum[ibin]=QIE8_LINEARIZATION_ET;
307  else
308  sum[ibin] = algosumvalue; //assign value to sum[]
309  }
310 
311  // Align digis and TP
312  int dgPresamples = samples.presamples();
313  int tpPresamples = numberOfPresamples_;
314  int shift = dgPresamples - tpPresamples;
315  int dgSamples = samples.size();
316  int tpSamples = numberOfSamples_;
317  if (peakfind_) {
318  if ((shift < shrink) || (shift + tpSamples + shrink > dgSamples - (peak_finder_algorithm_ - 1))) {
319  edm::LogInfo("HcalTriggerPrimitiveAlgo::analyze")
320  << "TP presample or size from the configuration file is out of the accessible range. Using digi values from "
321  "data instead...";
322  shift = shrink;
323  tpPresamples = dgPresamples - shrink;
324  tpSamples = dgSamples - (peak_finder_algorithm_ - 1) - shrink - shift;
325  }
326  }
327 
328  std::vector<int> finegrain(tpSamples, false);
329 
330  IntegerCaloSamples output(samples.id(), tpSamples);
331  output.setPresamples(tpPresamples);
332 
333  for (int ibin = 0; ibin < tpSamples; ++ibin) {
334  // ibin - index for output TP
335  // idx - index for samples + shift
336  int idx = ibin + shift;
337 
338  //Peak finding
339  if (peakfind_) {
340  bool isPeak = false;
341  switch (peak_finder_algorithm_) {
342  case 1:
343  isPeak = (samples[idx] > samples[idx - 1] && samples[idx] >= samples[idx + 1] && samples[idx] > theThreshold);
344  break;
345  case 2:
346  isPeak = (sum[idx] > sum[idx - 1] && sum[idx] >= sum[idx + 1] && sum[idx] > theThreshold);
347  break;
348  default:
349  break;
350  }
351 
352  if (isPeak) {
353  output[ibin] = std::min<unsigned int>(sum[idx], QIE8_LINEARIZATION_ET);
354  finegrain[ibin] = msb[idx];
355  }
356  // Not a peak
357  else
358  output[ibin] = 0;
359  } else { // No peak finding, just output running sum
360  output[ibin] = std::min<unsigned int>(sum[idx], QIE8_LINEARIZATION_ET);
361  finegrain[ibin] = msb[idx];
362  }
363 
364  // Only Pegged for 1-TS algo.
365  if (peak_finder_algorithm_ == 1) {
368  }
369  }
370  outcoder_->compress(output, finegrain, result);
371 }
372 
375  const HcalFinegrainBit& fg_algo) {
376  HcalDetId detId(samples.id());
377 
378  // Get the |ieta| for current sample
379  int theIeta = detId.ietaAbs();
380 
381  unsigned int dgSamples = samples.size();
382  unsigned int dgPresamples = samples.presamples();
383 
384  unsigned int tpSamples = numberOfSamples_;
385  unsigned int tpPresamples = numberOfPresamples_;
386 
387  unsigned int filterSamples = weightsQIE11_[theIeta].size();
388  unsigned int filterPresamples = theIeta > theTrigTowerGeometry->topology().lastHBRing()
391 
392  unsigned int shift = dgPresamples - tpPresamples;
393 
394  // shrink keeps the FIR filter from going off the end of the 8TS vector
395  unsigned int shrink = filterSamples - 1;
396 
397  auto& msb = fgUpgradeMap_[samples.id()];
398  IntegerCaloSamples sum(samples.id(), samples.size());
399 
400  std::vector<HcalTrigTowerDetId> ids = theTrigTowerGeometry->towerIds(detId);
401  //slide algo window
402  for (unsigned int ibin = 0; ibin < dgSamples - shrink; ++ibin) {
403  int algosumvalue = 0;
404  for (unsigned int i = 0; i < filterSamples; i++) {
405  //add up value * scale factor
406  // In addition, divide by two in the 10 degree phi segmentation region
407  // to mimic 5 degree segmentation for the trigger
408  unsigned int sample = samples[ibin + i];
411 
412  // Usually use a segmentation factor of 1.0 but for ieta >= 21 use 0.5
413  double segmentationFactor = 1.0;
414  if (ids.size() == 2) {
415  segmentationFactor = 0.5;
416  }
417 
418  // Based on the |ieta| of the sample, retrieve the correct region weight
419  double theWeight = weightsQIE11_[theIeta][i];
420 
421  algosumvalue += int(sample * segmentationFactor * theWeight);
422  }
423  if (algosumvalue < 0)
424  sum[ibin] = 0; // low-side
425  //high-side
426  //else if (algosumvalue>QIE11_LINEARIZATION_ET) sum[ibin]=QIE11_LINEARIZATION_ET;
427  else
428  sum[ibin] = algosumvalue; //assign value to sum[]
429  }
430 
431  std::vector<int> finegrain(tpSamples, false);
432 
433  IntegerCaloSamples output(samples.id(), tpSamples);
434  output.setPresamples(tpPresamples);
435 
436  for (unsigned int ibin = 0; ibin < tpSamples; ++ibin) {
437  // ibin - index for output TP
438  // idx - index for samples + shift - filterPresamples
439  int idx = ibin + shift - filterPresamples;
440 
441  // When idx is <= 0 peakfind would compare out-of-bounds of the vector. Avoid this ambiguity
442  if (idx <= 0) {
443  output[ibin] = 0;
444  continue;
445  }
446 
447  bool isPeak = (sum[idx] > sum[idx - 1] && sum[idx] >= sum[idx + 1] && sum[idx] > theThreshold);
448 
449  if (isPeak) {
450  output[ibin] = std::min<unsigned int>(sum[idx], QIE11_MAX_LINEARIZATION_ET);
451  } else {
452  // Not a peak
453  output[ibin] = 0;
454  }
455  // peak-finding is not applied for FG bits
456  finegrain[ibin] = fg_algo.compute(msb[idx]).to_ulong();
457  }
458  outcoder_->compress(output, finegrain, result);
459 }
460 
463  const int hf_lumi_shift) {
464  HcalTrigTowerDetId detId(samples.id());
465 
466  // Align digis and TP
467  int dgPresamples = samples.presamples();
468  int tpPresamples = numberOfPresamplesHF_;
469  int shift = dgPresamples - tpPresamples;
470  int dgSamples = samples.size();
471  int tpSamples = numberOfSamplesHF_;
472  if (shift < 0 || shift + tpSamples > dgSamples) {
473  edm::LogInfo("HcalTriggerPrimitiveAlgo::analyzeHF")
474  << "TP presample or size from the configuration file is out of the accessible range. Using digi values from "
475  "data instead...";
476  tpPresamples = dgPresamples;
477  shift = 0;
478  tpSamples = dgSamples;
479  }
480 
481  std::vector<int> finegrain(tpSamples, false);
482 
483  TowerMapFGSum::const_iterator tower2fg = theTowerMapFGSum.find(detId);
484  assert(tower2fg != theTowerMapFGSum.end());
485 
486  const SumFGContainer& sumFG = tower2fg->second;
487  // Loop over all L+S pairs that mapped from samples.id()
488  // Note: 1 samples.id() = 6 x (L+S) without noZS
489  for (SumFGContainer::const_iterator sumFGItr = sumFG.begin(); sumFGItr != sumFG.end(); ++sumFGItr) {
490  const std::vector<bool>& veto = HF_Veto[sumFGItr->id().rawId()];
491  for (int ibin = 0; ibin < tpSamples; ++ibin) {
492  int idx = ibin + shift;
493  // if not vetod, add L+S to total sum and calculate FG
494  bool vetoed = idx < int(veto.size()) && veto[idx];
495  if (!(vetoed && (*sumFGItr)[idx] > PMT_NoiseThreshold_)) {
496  samples[idx] += (*sumFGItr)[idx];
497  finegrain[ibin] = (finegrain[ibin] || (*sumFGItr)[idx] >= FG_threshold_);
498  }
499  }
500  }
501 
502  IntegerCaloSamples output(samples.id(), tpSamples);
503  output.setPresamples(tpPresamples);
504 
505  for (int ibin = 0; ibin < tpSamples; ++ibin) {
506  int idx = ibin + shift;
507  output[ibin] = samples[idx] >> hf_lumi_shift;
508  static const int MAX_OUTPUT = QIE8_LINEARIZATION_ET; // QIE8_LINEARIZATION_ET = 1023
509  if (output[ibin] > MAX_OUTPUT)
510  output[ibin] = MAX_OUTPUT;
511  }
512  outcoder_->compress(output, finegrain, result);
513 }
514 
517  const int hf_lumi_shift,
518  const HcalFeatureBit* embit) {
519  // Align digis and TP
520  const int SHIFT = samples.presamples() - numberOfPresamplesHF_;
521  assert(SHIFT >= 0);
522  assert((SHIFT + numberOfSamplesHF_) <= samples.size());
523 
524  // Try to find the HFDetails from the map corresponding to our samples
525  const HcalTrigTowerDetId detId(samples.id());
526  HFDetailMap::const_iterator it = theHFDetailMap.find(detId);
527  // Missing values will give an empty digi
528  if (it == theHFDetailMap.end()) {
529  return;
530  }
531 
532  std::vector<std::bitset<2>> finegrain(numberOfSamplesHF_, false);
533 
534  // Set up out output of IntergerCaloSamples
536  output.setPresamples(numberOfPresamplesHF_);
537 
538  for (const auto& item : it->second) {
539  auto& details = item.second;
540  for (int ibin = 0; ibin < numberOfSamplesHF_; ++ibin) {
541  const int IDX = ibin + SHIFT;
542  int long_fiber_val = 0;
543  if (IDX < details.long_fiber.size()) {
544  long_fiber_val = details.long_fiber[IDX];
545  }
546  int short_fiber_val = 0;
547  if (IDX < details.short_fiber.size()) {
548  short_fiber_val = details.short_fiber[IDX];
549  }
550  output[ibin] += (long_fiber_val + short_fiber_val);
551 
552  uint32_t ADCLong = details.LongDigi[ibin].adc();
553  uint32_t ADCShort = details.ShortDigi[ibin].adc();
554 
555  if (details.LongDigi.id().ietaAbs() >= FIRST_FINEGRAIN_TOWER) {
556  finegrain[ibin][1] = (ADCLong > FG_HF_thresholds_[0] || ADCShort > FG_HF_thresholds_[0]);
557 
558  if (embit != nullptr)
559  finegrain[ibin][0] = embit->fineGrainbit(details.ShortDigi, details.LongDigi, ibin);
560  }
561  }
562  }
563 
564  for (int bin = 0; bin < numberOfSamplesHF_; ++bin) {
565  static const unsigned int MAX_OUTPUT = QIE8_LINEARIZATION_ET; // QIE8_LINEARIZATION_ET = 1023
566  output[bin] = min({MAX_OUTPUT, output[bin] >> hf_lumi_shift});
567  }
568 
569  std::vector<int> finegrain_converted;
570  finegrain_converted.reserve(finegrain.size());
571  for (const auto& fg : finegrain)
572  finegrain_converted.push_back(fg.to_ulong());
573  outcoder_->compress(output, finegrain_converted, result);
574 }
575 
576 bool HcalTriggerPrimitiveAlgo::passTDC(const QIE10DataFrame& digi, int ts) const {
578  auto adc_threshold = parameters->getADCThresholdHF();
579  auto tdc_mask = parameters->getTDCMaskHF();
580 
581  if (override_adc_hf_)
582  adc_threshold = override_adc_hf_value_;
583  if (override_tdc_hf_)
584  tdc_mask = override_tdc_hf_value_;
585 
586  if (digi[ts].adc() < adc_threshold)
587  return true;
588 
589  return (1ul << digi[ts].le_tdc()) & tdc_mask;
590 }
591 
593  // channels with invalid data should not contribute to the sum
594  if (digi.linkError() || ts >= digi.samples() || !digi[ts].ok())
595  return false;
596 
597  auto mask = conditions_->getHcalTPChannelParameter(HcalDetId(digi.id()))->getMask();
598  if (mask)
599  return false;
600 
601  return true;
602 }
603 
606  const int hf_lumi_shift,
607  const HcalFeatureBit* embit) {
608  // Align digis and TP
609  const int shift = samples.presamples() - numberOfPresamplesHF_;
610  assert(shift >= 0);
611  assert((shift + numberOfSamplesHF_) <= samples.size());
612  assert(hf_lumi_shift >= 2);
613 
614  // Try to find the HFDetails from the map corresponding to our samples
615  const HcalTrigTowerDetId detId(samples.id());
616  auto it = theHFUpgradeDetailMap.find(detId);
617  // Missing values will give an empty digi
618  if (it == theHFUpgradeDetailMap.end()) {
619  return;
620  }
621 
622  std::vector<std::bitset<2>> finegrain(numberOfSamplesHF_, false);
623 
624  // Set up out output of IntergerCaloSamples
626  output.setPresamples(numberOfPresamplesHF_);
627 
628  for (const auto& item : it->second) {
629  auto& details = item.second;
630  for (int ibin = 0; ibin < numberOfSamplesHF_; ++ibin) {
631  const int idx = ibin + shift;
632 
633  int long_fiber_val = 0;
634  int long_fiber_count = 0;
635  int short_fiber_val = 0;
636  int short_fiber_count = 0;
637 
638  bool saturated = false;
639 
640  for (auto i : {0, 2}) {
641  if (idx < details[i].samples.size() and details[i].validity[idx] and details[i].passTDC[idx]) {
642  long_fiber_val += details[i].samples[idx];
643  saturated = saturated || (details[i].samples[idx] == QIE10_LINEARIZATION_ET);
644  ++long_fiber_count;
645  }
646  }
647  for (auto i : {1, 3}) {
648  if (idx < details[i].samples.size() and details[i].validity[idx] and details[i].passTDC[idx]) {
649  short_fiber_val += details[i].samples[idx];
650  saturated = saturated || (details[i].samples[idx] == QIE10_LINEARIZATION_ET);
651  ++short_fiber_count;
652  }
653  }
654 
655  if (saturated) {
657  } else {
658  // For details of the energy handling, see:
659  // https://cms-docdb.cern.ch/cgi-bin/DocDB/ShowDocument?docid=12306
660  // If both readouts are valid, average of the two energies is taken
661  // division by 2 is compensated by adjusting the total scale shift in the end
662  if (long_fiber_count == 2)
663  long_fiber_val >>= 1;
664  if (short_fiber_count == 2)
665  short_fiber_val >>= 1;
666 
667  auto sum = long_fiber_val + short_fiber_val;
668  // Similar to above, if both channels are valid,
669  // average of the two energies is calculated
670  // division by 2 here is also compensated by adjusting the total scale shift in the end
671  if (long_fiber_count > 0 and short_fiber_count > 0)
672  sum >>= 1;
673 
674  output[ibin] += sum;
675  }
676 
677  for (const auto& detail : details) {
678  if (idx < int(detail.digi.size()) and detail.validity[idx] and
679  HcalDetId(detail.digi.id()).ietaAbs() >= FIRST_FINEGRAIN_TOWER) {
680  if (useTDCInMinBiasBits_ && !detail.passTDC[idx])
681  continue;
682  finegrain[ibin][1] = finegrain[ibin][1] or detail.fgbits[idx][0];
683  // what is commonly called the "second" HF min-bias bit is
684  // actually the 0-th bit, which can also be used instead for the EM bit
685  // (called finegrain[ibin][0] below) in non-HI running
686  finegrain[ibin][0] = finegrain[ibin][0] or detail.fgbits[idx][1];
687  }
688  }
689  // the EM bit is only used if the "second" FG bit is disabled
690  if (embit != nullptr and FG_HF_thresholds_.at(1) != 255) {
691  finegrain[ibin][0] = embit->fineGrainbit(details[1].digi,
692  details[3].digi,
693  details[0].digi,
694  details[2].digi,
695  details[1].validity[idx],
696  details[3].validity[idx],
697  details[0].validity[idx],
698  details[2].validity[idx],
699  idx);
700  }
701  }
702  }
703 
704  for (int bin = 0; bin < numberOfSamplesHF_; ++bin) {
705  output[bin] = min({(unsigned int)QIE10_MAX_LINEARIZATION_ET, output[bin] >> (hf_lumi_shift - 2)});
706  }
707  std::vector<int> finegrain_converted;
708  finegrain_converted.reserve(finegrain.size());
709  for (const auto& fg : finegrain)
710  finegrain_converted.push_back(fg.to_ulong());
711  outcoder_->compress(output, finegrain_converted, result);
712 }
713 
715  for (HcalTrigPrimDigiCollection::iterator tp = result.begin(); tp != result.end(); ++tp) {
716  bool ZS = true;
717  for (int i = 0; i < tp->size(); ++i) {
718  if (tp->sample(i).compressedEt() > ZS_threshold_I_) {
719  ZS = false;
720  break;
721  }
722  }
723  if (ZS)
724  tp->setZSInfo(false, true);
725  else
726  tp->setZSInfo(true, false);
727  }
728 }
729 
731  const HcalElectronicsMap* emap,
733  std::set<uint32_t> FrontEndErrors;
734 
736  const FEDRawData& raw = rawraw->FEDData(i);
737  if (raw.size() < 12)
738  continue;
739  const HcalDCCHeader* dccHeader = (const HcalDCCHeader*)(raw.data());
740  if (!dccHeader)
741  continue;
742  HcalHTRData htr;
743  for (int spigot = 0; spigot < HcalDCCHeader::SPIGOT_COUNT; spigot++) {
744  if (!dccHeader->getSpigotPresent(spigot))
745  continue;
746  dccHeader->getSpigotData(spigot, htr, raw.size());
747  int dccid = dccHeader->getSourceId();
748  int errWord = htr.getErrorsWord() & 0x1FFFF;
749  bool HTRError = (!htr.check() || htr.isHistogramEvent() || (errWord & 0x800) != 0);
750 
751  if (HTRError) {
752  bool valid = false;
753  for (int fchan = 0; fchan < 3 && !valid; fchan++) {
754  for (int fib = 0; fib < 9 && !valid; fib++) {
755  HcalElectronicsId eid(fchan, fib, spigot, dccid - FEDNumbering::MINHCALFEDID);
756  eid.setHTR(htr.readoutVMECrateId(), htr.htrSlot(), htr.htrTopBottom());
757  DetId detId = emap->lookup(eid);
758  if (detId.null())
759  continue;
760  HcalSubdetector subdet = (HcalSubdetector(detId.subdetId()));
761  if (detId.det() != 4 || (subdet != HcalBarrel && subdet != HcalEndcap && subdet != HcalForward))
762  continue;
763  std::vector<HcalTrigTowerDetId> ids = theTrigTowerGeometry->towerIds(detId);
764  for (std::vector<HcalTrigTowerDetId>::const_iterator triggerId = ids.begin(); triggerId != ids.end();
765  ++triggerId) {
766  FrontEndErrors.insert(triggerId->rawId());
767  }
768  //valid = true;
769  }
770  }
771  }
772  }
773  }
774 
775  // Loop over TP collection
776  // Set TP to zero if there is FE Format Error
777  HcalTriggerPrimitiveSample zeroSample(0);
778  for (HcalTrigPrimDigiCollection::iterator tp = result.begin(); tp != result.end(); ++tp) {
779  if (FrontEndErrors.find(tp->id().rawId()) != FrontEndErrors.end()) {
780  for (int i = 0; i < tp->size(); ++i)
781  tp->setSample(i, zeroSample);
782  }
783  }
784 }
785 
786 void HcalTriggerPrimitiveAlgo::addFG(const HcalTrigTowerDetId& id, std::vector<bool>& msb) {
787  FGbitMap::iterator itr = fgMap_.find(id);
788  if (itr != fgMap_.end()) {
789  std::vector<bool>& _msb = itr->second;
790  for (size_t i = 0; i < msb.size(); ++i)
791  _msb[i] = _msb[i] || msb[i];
792  } else
793  fgMap_[id] = msb;
794 }
795 
798  return false;
799  if (id.ietaAbs() > LAST_FINEGRAIN_TOWER)
800  return false;
801  if (id.ietaAbs() == HBHE_OVERLAP_TOWER and not upgrade_hb_)
802  return false;
803  return true;
804 }
805 
807  // This tower (ietaAbs == 16) does not accept upgraded FG bits,
808  // but needs pseudo legacy ones to ensure that the tower is processed
809  // even when the QIE8 depths in front of it do not have energy deposits.
810  if (id.ietaAbs() == HBHE_OVERLAP_TOWER and not upgrade_hb_)
811  return true;
812  return false;
813 }
814 
816  // Depth 7 for TT 26, 27, and 28 is not considered a fine grain depth.
817  // However, the trigger tower for these ieta should still be added to the fgUpgradeMap_
818  // Otherwise, depth 7-only signal will not be analyzed.
819  unsigned int aieta = id.ietaAbs();
820  if (aieta >= FIRST_DEPTH7_TOWER and aieta <= LAST_FINEGRAIN_TOWER and depth > LAST_FINEGRAIN_DEPTH)
821  return true;
822  return false;
823 }
824 
826  int depth,
827  const std::vector<std::bitset<2>>& bits) {
828  if (not validUpgradeFG(id, depth)) {
829  if (needLegacyFG(id)) {
830  std::vector<bool> pseudo(bits.size(), false);
831  addFG(id, pseudo);
832  } else if (needUpgradeID(id, depth)) {
833  // If the tower id is not in the map yet
834  // then for safety's sake add it, otherwise, no need
835  // Likewise, we're here with non-fg depth 7 so the bits are not to be added
836  auto it = fgUpgradeMap_.find(id);
837  if (it == fgUpgradeMap_.end()) {
838  FGUpgradeContainer element;
839  element.resize(bits.size());
840  fgUpgradeMap_.insert(std::make_pair(id, element));
841  }
842  }
843 
844  return;
845  }
846 
847  auto it = fgUpgradeMap_.find(id);
848  if (it == fgUpgradeMap_.end()) {
849  FGUpgradeContainer element;
850  element.resize(bits.size());
851  it = fgUpgradeMap_.insert(std::make_pair(id, element)).first;
852  }
853  for (unsigned int i = 0; i < bits.size(); ++i) {
854  it->second[i][0][depth - 1] = bits[i][0];
855  it->second[i][1][depth - 1] = bits[i][1];
856  }
857 }
858 
860  // Names are just abs(ieta) for HBHE
861  std::vector<std::string> ietaStrs = weightsQIE11.getParameterNames();
862  for (auto& ietaStr : ietaStrs) {
863  // Strip off "ieta" part of key and just use integer value in map
864  auto const& v = weightsQIE11.getParameter<std::vector<double>>(ietaStr);
865  weightsQIE11_[std::stoi(ietaStr.substr(4))] = {{v[0], v[1]}};
866  }
867 }
868 
870  // Simple map of |ieta| in HBHE to weight
871  // Only one weight for SOI-1 TS
872  weightsQIE11_[aieta] = {{weight, 1.0}};
873 }
874 
876  if (algo <= 0 || algo > 2)
877  throw cms::Exception("ERROR: Only algo 1 & 2 are supported.") << std::endl;
879 }
880 
882 
FEDNumbering.h
HcalHTRData::readoutVMECrateId
unsigned int readoutVMECrateId() const
HcalElectronicsId-style VME crate number.
Definition: HcalHTRData.cc:373
HcalTriggerPrimitiveAlgo::numberOfSamplesHF_
int numberOfSamplesHF_
Definition: HcalTriggerPrimitiveAlgo.h:142
BeamSpotPI::parameters
parameters
Definition: BeamSpotPayloadInspectorHelper.h:30
hcaltpdigi_cfi.numberOfSamplesHF
numberOfSamplesHF
Definition: hcaltpdigi_cfi.py:56
HcalTriggerPrimitiveAlgo::addFG
void addFG(const HcalTrigTowerDetId &id, std::vector< bool > &msb)
Definition: HcalTriggerPrimitiveAlgo.cc:786
mps_fire.i
i
Definition: mps_fire.py:428
HcalTrigTowerGeometry::towerIds
std::vector< HcalTrigTowerDetId > towerIds(const HcalDetId &cellId) const
the mapping to and from DetIds
Definition: HcalTrigTowerGeometry.cc:15
MessageLogger.h
HcalTriggerPrimitiveAlgo::weightsQIE11_
std::array< std::array< double, 2 >, 29 > weightsQIE11_
Definition: HcalTriggerPrimitiveAlgo.h:132
HcalHTRData::isHistogramEvent
bool isHistogramEvent() const
Is this event a histogram event? (do not call standard unpack in this case!!!!!)
Definition: HcalHTRData.cc:409
config_102169_raw_cff.latency
latency
Definition: config_102169_raw_cff.py:29
HcalTriggerPrimitiveAlgo::overrideParameters
void overrideParameters(const edm::ParameterSet &ps)
Definition: HcalTriggerPrimitiveAlgo.cc:79
simplePhotonAnalyzer_cfi.sample
sample
Definition: simplePhotonAnalyzer_cfi.py:12
HcalTriggerPrimitiveAlgo::override_adc_hf_value_
uint32_t override_adc_hf_value_
Definition: HcalTriggerPrimitiveAlgo.h:214
HcalTriggerPrimitiveAlgo::HF_Veto
TowerMapVeto HF_Veto
Definition: HcalTriggerPrimitiveAlgo.h:198
QIE10DataFrame::samples
constexpr int samples() const
total number of samples in the digi
Definition: QIE10DataFrame.h:86
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:72
min
T min(T a, T b)
Definition: MathUtil.h:58
HcalTriggerPrimitiveSample
Definition: HcalTriggerPrimitiveSample.h:11
FEDRawDataCollection
Definition: FEDRawDataCollection.h:18
gpuClustering::adc
uint16_t *__restrict__ uint16_t const *__restrict__ adc
Definition: gpuClusterChargeCut.h:20
mps_merge.weight
weight
Definition: mps_merge.py:88
HcalTriggerPrimitiveAlgo::setUpgradeFlags
void setUpgradeFlags(bool hb, bool he, bool hf)
Definition: HcalTriggerPrimitiveAlgo.cc:73
HcalTriggerPrimitiveAlgo::upgrade_he_
bool upgrade_he_
Definition: HcalTriggerPrimitiveAlgo.h:208
QIE10DataFrame::linkError
constexpr bool linkError() const
Definition: QIE10DataFrame.h:101
HcalTriggerPrimitiveAlgo::setWeightsQIE11
void setWeightsQIE11(const edm::ParameterSet &weightsQIE11)
Definition: HcalTriggerPrimitiveAlgo.cc:859
DetId::det
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
HcalTriggerPrimitiveAlgo::FIRST_FINEGRAIN_TOWER
static const int FIRST_FINEGRAIN_TOWER
Definition: HcalTriggerPrimitiveAlgo.h:225
HcalTriggerPrimitiveAlgo::addUpgradeFG
void addUpgradeFG(const HcalTrigTowerDetId &id, int depth, const std::vector< std::bitset< 2 >> &bits)
Definition: HcalTriggerPrimitiveAlgo.cc:825
HcalTriggerPrimitiveAlgo::ZS_threshold_
uint32_t ZS_threshold_
Definition: HcalTriggerPrimitiveAlgo.h:136
HcalTriggerPrimitiveAlgo::numberOfPresamples_
int numberOfPresamples_
Definition: HcalTriggerPrimitiveAlgo.h:139
HcalTriggerPrimitiveAlgo::conditions_
const HcalDbService * conditions_
Definition: HcalTriggerPrimitiveAlgo.h:128
cms::cuda::assert
assert(be >=bs)
edm::SortedCollection
Definition: SortedCollection.h:49
HcalTPChannelParameters.h
HcalTPChannelParameter::getMask
uint32_t getMask() const
get mask for channel validity and self trigger information
Definition: HcalTPChannelParameter.h:10
HcalTriggerPrimitiveAlgo::FGUpgradeContainer
std::vector< HcalFinegrainBit::Tower > FGUpgradeContainer
Definition: HcalTriggerPrimitiveAlgo.h:203
DetId::null
constexpr bool null() const
is this a null id ?
Definition: DetId.h:59
HcalTriggerPrimitiveAlgo::setNCTScaleShift
void setNCTScaleShift(int)
Definition: HcalTriggerPrimitiveAlgo.cc:881
HcalTPGCompressor::compress
void compress(const IntegerCaloSamples &ics, const std::vector< int > &fineGrain, HcalTriggerPrimitiveDigi &digi) const
Definition: HcalTPGCompressor.cc:6
detail
Definition: ConvertingESProducerWithDependenciesT.h:23
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
hcaltpdigi_cfi.numberOfPresamples
numberOfPresamples
Definition: hcaltpdigi_cfi.py:55
HcalBarrel
Definition: HcalAssistant.h:33
findQualityFiles.v
v
Definition: findQualityFiles.py:179
HcalTriggerPrimitiveAlgo::override_tdc_hf_value_
unsigned long long override_tdc_hf_value_
Definition: HcalTriggerPrimitiveAlgo.h:216
HcalHTRData::htrSlot
unsigned int htrSlot() const
HcalElectronicsId-style HTR slot.
Definition: HcalHTRData.cc:365
HcalTriggerPrimitiveAlgo::QIE11_MAX_LINEARIZATION_ET
static const int QIE11_MAX_LINEARIZATION_ET
Definition: HcalTriggerPrimitiveAlgo.h:232
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
IntegerCaloSamples
Definition: IntegerCaloSamples.h:16
HcalDCCHeader::SPIGOT_COUNT
static const int SPIGOT_COUNT
Definition: HcalDCCHeader.h:19
HcalTriggerPrimitiveAlgo::setWeightQIE11
void setWeightQIE11(int aieta, double weight)
Definition: HcalTriggerPrimitiveAlgo.cc:869
FEDRawData::data
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:24
FEDRawData
Definition: FEDRawData.h:19
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
EgammaValidation_cff.samples
samples
Definition: EgammaValidation_cff.py:19
HcalFinegrainBit
Definition: HcalFinegrainBit.h:7
HcalTriggerPrimitiveAlgo::setRCTScaleShift
void setRCTScaleShift(int)
Definition: HcalTriggerPrimitiveAlgo.cc:883
HcalTriggerPrimitiveAlgo::HFDetails
Definition: HcalTriggerPrimitiveAlgo.h:164
DetId
Definition: DetId.h:17
cmsdt::algo
algo
Definition: constants.h:165
hcaltpdigi_cfi.weightsQIE11
weightsQIE11
hardware algo
Definition: hcaltpdigi_cfi.py:19
HcalTriggerPrimitiveAlgo::QIE10_MAX_LINEARIZATION_ET
static const int QIE10_MAX_LINEARIZATION_ET
Definition: HcalTriggerPrimitiveAlgo.h:231
HcalDCCHeader::getSourceId
int getSourceId() const
Definition: HcalDCCHeader.h:32
HcalTriggerPrimitiveAlgo::LAST_FINEGRAIN_TOWER
static const int LAST_FINEGRAIN_TOWER
Definition: HcalTriggerPrimitiveAlgo.h:222
HcalTriggerPrimitiveAlgo::passTDC
bool passTDC(const QIE10DataFrame &digi, int ts) const
Definition: HcalTriggerPrimitiveAlgo.cc:576
photonIsolationHIProducer_cfi.hf
hf
Definition: photonIsolationHIProducer_cfi.py:9
HcalTriggerPrimitiveAlgo::addSignal
void addSignal(const HBHEDataFrame &frame)
adds the signal to the map
Definition: HcalTriggerPrimitiveAlgo.cc:92
HcalTPParameters.h
HcalHTRData::htrTopBottom
unsigned int htrTopBottom() const
HcalElectronicsId-style HTR top/bottom (1=top/0=bottom)
Definition: HcalHTRData.cc:369
w
const double w
Definition: UKUtility.cc:23
HcalTriggerPrimitiveAlgo::numberOfFilterPresamplesHEQIE11_
int numberOfFilterPresamplesHEQIE11_
Definition: HcalTriggerPrimitiveAlgo.h:141
HcalTriggerPrimitiveAlgo::FG_threshold_
uint32_t FG_threshold_
Definition: HcalTriggerPrimitiveAlgo.h:134
HcalTriggerPrimitiveAlgo::QIE10_LINEARIZATION_ET
static const int QIE10_LINEARIZATION_ET
Definition: HcalTriggerPrimitiveAlgo.h:228
HcalElectronicsId
Readout chain identification for Hcal.
Definition: HcalElectronicsId.h:32
hcal_dqm_sourceclient-live_cfg.FG_threshold
FG_threshold
Definition: hcal_dqm_sourceclient-live_cfg.py:104
IntegerCaloSamples.h
details
Definition: helper.h:56
HcalTriggerPrimitiveAlgo::fgUpgradeMap_
FGUpgradeMap fgUpgradeMap_
Definition: HcalTriggerPrimitiveAlgo.h:205
HcalTriggerPrimitiveAlgo::runZS
void runZS(HcalTrigPrimDigiCollection &tp)
Definition: HcalTriggerPrimitiveAlgo.cc:714
HcalTrigTowerDetId::version
int version() const
get the version code for the trigger tower
Definition: HcalTrigTowerDetId.h:60
HcalDbService::getHcalTPParameters
const HcalTPParameters * getHcalTPParameters() const
Definition: HcalDbService.cc:413
HcalTriggerPrimitiveAlgo::~HcalTriggerPrimitiveAlgo
~HcalTriggerPrimitiveAlgo()
Definition: HcalTriggerPrimitiveAlgo.cc:71
LEDCalibrationChannels.depth
depth
Definition: LEDCalibrationChannels.py:65
cmsswSequenceInfo.tp
tp
Definition: cmsswSequenceInfo.py:17
FEDRawDataCollection::FEDData
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
Definition: FEDRawDataCollection.cc:19
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
HcalTriggerPrimitiveAlgo::validUpgradeFG
bool validUpgradeFG(const HcalTrigTowerDetId &id, int depth) const
Definition: HcalTriggerPrimitiveAlgo.cc:796
HcalTriggerPrimitiveAlgo::override_parameters_
edm::ParameterSet override_parameters_
Definition: HcalTriggerPrimitiveAlgo.h:211
HcalTriggerPrimitiveAlgo::numberOfFilterPresamplesHBQIE11_
int numberOfFilterPresamplesHBQIE11_
Definition: HcalTriggerPrimitiveAlgo.h:140
HcalTriggerPrimitiveAlgo::minSignalThreshold_
uint32_t minSignalThreshold_
Definition: HcalTriggerPrimitiveAlgo.h:145
HcalTriggerPrimitiveAlgo::HBHE_OVERLAP_TOWER
static const int HBHE_OVERLAP_TOWER
Definition: HcalTriggerPrimitiveAlgo.h:219
HBHEDataFrame
Definition: HBHEDataFrame.h:14
edm::ParameterSet::exists
bool exists(std::string const &parameterName) const
checks if a parameter exists
Definition: ParameterSet.cc:681
HcalTriggerPrimitiveAlgo::PMT_NoiseThreshold_
uint32_t PMT_NoiseThreshold_
Definition: HcalTriggerPrimitiveAlgo.h:146
HcalTriggerPrimitiveDigi
Definition: HcalTriggerPrimitiveDigi.h:13
edm::ParameterSet
Definition: ParameterSet.h:47
HcalFeatureBit::fineGrainbit
virtual bool fineGrainbit(const QIE10DataFrame &short1, const QIE10DataFrame &short2, const QIE10DataFrame &long1, const QIE10DataFrame &long2, bool validShort1, bool validShort2, bool validLong1, bool validLong2, int idx) const =0
HcalTriggerPrimitiveAlgo::theHFUpgradeDetailMap
HFUpgradeDetailMap theHFUpgradeDetailMap
Definition: HcalTriggerPrimitiveAlgo.h:181
HcalTriggerPrimitiveAlgo::theTrigTowerGeometry
const HcalTrigTowerGeometry * theTrigTowerGeometry
Definition: HcalTriggerPrimitiveAlgo.h:159
hcal_dqm_sourceclient-live_cfg.ZS_threshold
ZS_threshold
Definition: hcal_dqm_sourceclient-live_cfg.py:113
HcalTriggerPrimitiveAlgo::theSumMap
SumMap theSumMap
Definition: HcalTriggerPrimitiveAlgo.h:162
edm::SortedCollection::iterator
std::vector< T >::iterator iterator
Definition: SortedCollection.h:81
HcalTriggerPrimitiveAlgo::peakfind_
bool peakfind_
Definition: HcalTriggerPrimitiveAlgo.h:130
HcalDetId.h
HcalTriggerPrimitiveAlgo::HcalTriggerPrimitiveAlgo
HcalTriggerPrimitiveAlgo(bool pf, const std::vector< double > &w, int latency, uint32_t FG_threshold, const std::vector< uint32_t > &FG_HF_thresholds, uint32_t ZS_threshold, int numberOfSamples, int numberOfPresamples, int numberOfFilterPresamplesHBQIE11, int numberOfFilterPresamplesHEQIE11, int numberOfSamplesHF, int numberOfPresamplesHF, bool useTDCInMinBiasBits, uint32_t minSignalThreshold=0, uint32_t PMT_NoiseThreshold=0)
Definition: HcalTriggerPrimitiveAlgo.cc:23
hcaltpdigi_cff.FG_HF_thresholds
FG_HF_thresholds
Definition: hcaltpdigi_cff.py:26
HcalTriggerPrimitiveAlgo::analyzeHF
void analyzeHF(IntegerCaloSamples &samples, HcalTriggerPrimitiveDigi &result, const int hf_lumi_shift)
Definition: HcalTriggerPrimitiveAlgo.cc:461
HcalTrigTowerGeometry::topology
const HcalTopology & topology() const
Definition: HcalTrigTowerGeometry.h:27
HcalTriggerPrimitiveAlgo::override_adc_hf_
bool override_adc_hf_
Definition: HcalTriggerPrimitiveAlgo.h:213
HcalDetId::subdet
constexpr HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:138
HcaluLUTTPGCoder::lookupMSB
void lookupMSB(const HBHEDataFrame &df, std::vector< bool > &msb) const
Definition: HcaluLUTTPGCoder.cc:589
HcalDetId
Definition: HcalDetId.h:12
createfilelist.int
int
Definition: createfilelist.py:10
HFDataFrame
Definition: HFDataFrame.h:14
hcaltpdigi_cfi.numberOfFilterPresamplesHBQIE11
numberOfFilterPresamplesHBQIE11
Definition: hcaltpdigi_cfi.py:58
runTauDisplay.eid
eid
Definition: runTauDisplay.py:298
HcalTriggerPrimitiveAlgo::analyzeHFQIE10
void analyzeHFQIE10(const IntegerCaloSamples &SAMPLES, HcalTriggerPrimitiveDigi &result, const int HF_LUMI_SHIFT, const HcalFeatureBit *HCALFEM)
Definition: HcalTriggerPrimitiveAlgo.cc:604
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
HcalTriggerPrimitiveAlgo::needLegacyFG
bool needLegacyFG(const HcalTrigTowerDetId &id) const
Definition: HcalTriggerPrimitiveAlgo.cc:806
HcalTriggerPrimitiveAlgo::needUpgradeID
bool needUpgradeID(const HcalTrigTowerDetId &id, int depth) const
Definition: HcalTriggerPrimitiveAlgo.cc:815
HcalFeatureBit
Definition: HcalFeatureBit.h:8
HcalTriggerPrimitiveAlgo::FIRST_DEPTH7_TOWER
static const int FIRST_DEPTH7_TOWER
Definition: HcalTriggerPrimitiveAlgo.h:220
B2GTnPMonitor_cfi.item
item
Definition: B2GTnPMonitor_cfi.py:147
HcalTrigTowerGeometry.h
HcalTriggerPrimitiveAlgo::theHFDetailMap
HFDetailMap theHFDetailMap
Definition: HcalTriggerPrimitiveAlgo.h:171
HcalTriggerPrimitiveAlgo::fgMap_
FGbitMap fgMap_
Definition: HcalTriggerPrimitiveAlgo.h:201
HcalFinegrainBit::compute
std::bitset< 4 > compute(const Tower &) const
Definition: HcalFinegrainBit.cc:5
hcaltpdigi_cfi.numberOfFilterPresamplesHEQIE11
numberOfFilterPresamplesHEQIE11
Definition: hcaltpdigi_cfi.py:59
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
HcalTriggerPrimitiveAlgo::validChannel
bool validChannel(const QIE10DataFrame &digi, int ts) const
Definition: HcalTriggerPrimitiveAlgo.cc:592
HcalElectronicsId.h
HcalTriggerPrimitiveAlgo::NCTScaleShift
int NCTScaleShift
Definition: HcalTriggerPrimitiveAlgo.h:147
HcalTriggerPrimitiveAlgo::RCTScaleShift
int RCTScaleShift
Definition: HcalTriggerPrimitiveAlgo.h:148
hcalSimParameters_cfi.hb
hb
Definition: hcalSimParameters_cfi.py:60
FEDRawData::size
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:45
HcalTriggerPrimitiveAlgo.h
HcalDCCHeader::getSpigotPresent
bool getSpigotPresent(unsigned int nspigot) const
Read the "PRESENT" bit for this spigot.
Definition: HcalDCCHeader.h:106
HcalDCCHeader
Definition: HcalDCCHeader.h:17
HcalTriggerPrimitiveAlgo::theThreshold
double theThreshold
Definition: HcalTriggerPrimitiveAlgo.h:129
newFWLiteAna.bin
bin
Definition: newFWLiteAna.py:161
HcalElectronicsMap
Definition: HcalElectronicsMap.h:31
HcalSubdetector
HcalSubdetector
Definition: HcalAssistant.h:31
HcalTriggerPrimitiveAlgo::LAST_FINEGRAIN_DEPTH
static const int LAST_FINEGRAIN_DEPTH
Definition: HcalTriggerPrimitiveAlgo.h:221
HcalForward
Definition: HcalAssistant.h:36
HcalTriggerPrimitiveAlgo::numberOfPresamplesHF_
int numberOfPresamplesHF_
Definition: HcalTriggerPrimitiveAlgo.h:143
HcalTriggerPrimitiveAlgo::upgrade_hf_
bool upgrade_hf_
Definition: HcalTriggerPrimitiveAlgo.h:209
HcalTriggerPrimitiveAlgo::analyzeQIE11
void analyzeQIE11(IntegerCaloSamples &samples, HcalTriggerPrimitiveDigi &result, const HcalFinegrainBit &fg_algo)
Definition: HcalTriggerPrimitiveAlgo.cc:373
HcalTriggerPrimitiveAlgo::peak_finder_algorithm_
int peak_finder_algorithm_
Definition: HcalTriggerPrimitiveAlgo.h:154
std
Definition: JetResolutionObject.h:76
HcalTriggerPrimitiveAlgo::setPeakFinderAlgorithm
void setPeakFinderAlgorithm(int algo)
Definition: HcalTriggerPrimitiveAlgo.cc:875
HcalElectronicsMap::lookup
const DetId lookup(HcalElectronicsId fId) const
lookup the logical detid associated with the given electronics id
Definition: HcalElectronicsMap.cc:70
edm::shift
static unsigned const int shift
Definition: LuminosityBlockID.cc:7
QIE10DataFrame
Definition: QIE10DataFrame.h:11
hcalSimParameters_cfi.he
he
Definition: hcalSimParameters_cfi.py:79
HcalEndcap
Definition: HcalAssistant.h:34
packedPFCandidateRefMixer_cfi.pf
pf
Definition: packedPFCandidateRefMixer_cfi.py:4
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
amptDefault_cfi.frame
frame
Definition: amptDefault_cfi.py:12
QIE11DataFrame
Definition: QIE11DataFrame.h:11
Exception
Definition: hltDiff.cc:245
HcalTriggerPrimitiveAlgo::outcoder_
const HcalTPGCompressor * outcoder_
Definition: HcalTriggerPrimitiveAlgo.h:127
FEDNumbering::MINHCALFEDID
Definition: FEDNumbering.h:47
HcalTriggerPrimitiveAlgo::ZS_threshold_I_
int ZS_threshold_I_
Definition: HcalTriggerPrimitiveAlgo.h:137
HcalDbService::getHcalTPChannelParameter
const HcalTPChannelParameter * getHcalTPChannelParameter(const HcalGenericDetId &fId, bool throwOnFail=true) const
Definition: HcalDbService.cc:391
HcalTriggerPrimitiveAlgo::override_tdc_hf_
bool override_tdc_hf_
Definition: HcalTriggerPrimitiveAlgo.h:215
hcaltpdigi_cfi.numberOfPresamplesHF
numberOfPresamplesHF
Definition: hcaltpdigi_cfi.py:57
IntegerCaloSamples::setPresamples
void setPresamples(int pre)
set presample information
Definition: IntegerCaloSamples.cc:13
or
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
HcalTriggerPrimitiveAlgo::runFEFormatError
void runFEFormatError(const FEDRawDataCollection *rawraw, const HcalElectronicsMap *emap, HcalTrigPrimDigiCollection &result)
Definition: HcalTriggerPrimitiveAlgo.cc:730
hcaltpdigi_cfi.useTDCInMinBiasBits
useTDCInMinBiasBits
Definition: hcaltpdigi_cfi.py:60
HcalTriggerPrimitiveAlgo::analyze
void analyze(IntegerCaloSamples &samples, HcalTriggerPrimitiveDigi &result)
adds the actual digis
Definition: HcalTriggerPrimitiveAlgo.cc:291
HcalDCCHeader.h
mps_fire.result
result
Definition: mps_fire.py:311
RunInfoPI::valid
Definition: RunInfoPayloadInspectoHelper.h:16
HcalDetId::ietaAbs
constexpr int ietaAbs() const
get the absolute value of the cell ieta
Definition: HcalDetId.h:148
ParameterSet.h
FEDNumbering::MAXHCALFEDID
Definition: FEDNumbering.h:48
HcalTriggerPrimitiveAlgo::theTowerMapFGSum
TowerMapFGSum theTowerMapFGSum
Definition: HcalTriggerPrimitiveAlgo.h:185
HcalTriggerPrimitiveAlgo::useTDCInMinBiasBits_
bool useTDCInMinBiasBits_
Definition: HcalTriggerPrimitiveAlgo.h:144
HcalTriggerPrimitiveAlgo::upgrade_hb_
bool upgrade_hb_
Definition: HcalTriggerPrimitiveAlgo.h:207
HcalTriggerPrimitiveAlgo::FG_HF_thresholds_
std::vector< uint32_t > FG_HF_thresholds_
Definition: HcalTriggerPrimitiveAlgo.h:135
QIE10DataFrame::id
constexpr edm::DataFrame::id_type id() const
Definition: QIE10DataFrame.h:77
HcalHTRData
Definition: HcalHTRData.h:16
PbPb_ZMuSkimMuonDPG_cff.veto
veto
Definition: PbPb_ZMuSkimMuonDPG_cff.py:61
HcalTriggerPrimitiveAlgo::numberOfSamples_
int numberOfSamples_
Definition: HcalTriggerPrimitiveAlgo.h:138
BeamSplash_cfg.version
version
Definition: BeamSplash_cfg.py:45
HcalTriggerPrimitiveAlgo::analyzeHF2016
void analyzeHF2016(const IntegerCaloSamples &SAMPLES, HcalTriggerPrimitiveDigi &result, const int HF_LUMI_SHIFT, const HcalFeatureBit *HCALFEM)
Definition: HcalTriggerPrimitiveAlgo.cc:515
HcalHTRData::getErrorsWord
unsigned int getErrorsWord() const
Get the errors word.
Definition: HcalHTRData.h:162
HcalDCCHeader::getSpigotData
int getSpigotData(int nspigot, HcalHTRData &decodeTool, int validSize) const
Definition: HcalDCCHeader.cc:27
HcalTriggerPrimitiveAlgo::SumFGContainer
std::vector< IntegerCaloSamples > SumFGContainer
Definition: HcalTriggerPrimitiveAlgo.h:183
numberOfSamples
Definition: TotemSampicFrame.h:53
HcaluLUTTPGCoder::adc2Linear
void adc2Linear(const HBHEDataFrame &df, IntegerCaloSamples &ics) const override
Definition: HcaluLUTTPGCoder.cc:537
weight
Definition: weight.py:1
HcalTriggerPrimitiveAlgo::QIE8_LINEARIZATION_ET
static const int QIE8_LINEARIZATION_ET
Definition: HcalTriggerPrimitiveAlgo.h:227
HcalTopology::lastHBRing
int lastHBRing() const
Definition: HcalTopology.h:92
HcalTriggerPrimitiveAlgo::weights_
std::vector< double > weights_
Definition: HcalTriggerPrimitiveAlgo.h:131
HcalTriggerPrimitiveAlgo::incoder_
const HcaluLUTTPGCoder * incoder_
Definition: HcalTriggerPrimitiveAlgo.h:126
HcalTrigTowerDetId
Definition: HcalTrigTowerDetId.h:14
HcalHTRData.h
HcalHTRData::check
bool check() const
Check for a good event Requires a minimum length, matching wordcount and length, not an empty event.
Definition: HcalHTRData.cc:63