CMS 3D CMS Logo

EcalFenixStripFgvbEE.cc
Go to the documentation of this file.
5 #include <iostream>
6 
8  identif_ = 0;
9  flagBadStripMiss_ = false;
10 }
11 
13 
14 void EcalFenixStripFgvbEE::process(std::vector<std::vector<int>> &linout, std::vector<int> &output) {
15  std::vector<int> indexLut(output.size());
16 
17  for (unsigned int i = 0; i < output.size(); i++) {
18  output[i] = 0;
19  indexLut[i] = 0;
20  for (unsigned int ixtal = 0; ixtal < linout.size(); ixtal++) {
21  int adc = linout[ixtal][i];
22  int res = (((adc & 0xffff) > threshold_fg_) || ((adc & 0x30000) != 0x0)) ? 1 : 0;
23  indexLut[i] = indexLut[i] | (res << ixtal);
24  }
25  int mask = 1 << (indexLut[i]);
26  output[i] = ((lut_fg_ & mask) == 0x0) ? 0 : 1;
27  if (i > 0)
28  output[i - 1] = output[i]; // Delay one clock
29  }
30  return;
31 }
32 
33 void EcalFenixStripFgvbEE::setParameters(int identif, uint32_t id, const EcalTPGFineGrainStripEE *ecaltpgFgStripEE) {
34  const EcalTPGFineGrainStripEEMap &fgmap = ecaltpgFgStripEE->getMap();
35  EcalTPGFineGrainStripEEMapIterator it = fgmap.find(id);
36  if (it != fgmap.end()) {
37  threshold_fg_ = it->second.threshold;
38  lut_fg_ = it->second.lut;
39  } else {
40  if (identif == false) {
41  edm::LogWarning("EcalTPG") << " could not find EcalTPGFineGrainStripEEMap entry for at least "
42  "one stripId";
43  flagBadStripMiss_ = true;
44  }
45 
46  // Use the FENIX power-up values
47  threshold_fg_ = 65535;
48  lut_fg_ = 0x0;
49  }
50 }
std::map< uint32_t, EcalTPGFineGrainStripEE::Item > EcalTPGFineGrainStripEEMap
void process(std::vector< std::vector< int >> &lin_out, std::vector< int > &output)
void setParameters(int identif, uint32_t id, const EcalTPGFineGrainStripEE *)
Definition: Electron.h:6
constexpr uint32_t mask
Definition: gpuClustering.h:26
std::map< uint32_t, EcalTPGFineGrainStripEE::Item >::const_iterator EcalTPGFineGrainStripEEMapIterator
const std::map< uint32_t, Item > & getMap() const
Definition: output.py:1
Log< level::Warning, false > LogWarning
uint16_t *__restrict__ uint16_t const *__restrict__ adc