CMS 3D CMS Logo

EcalFenixTcpFgvbEE.cc
Go to the documentation of this file.
4 #include <iostream>
5 
6 //---------------------------------------------------------------
8  indexLut_.resize(maxNrSamples);
9 } //---------------------------------------------------------------
11 //---------------------------------------------------------------
12 void EcalFenixTcpFgvbEE::process(std::vector<std::vector<int>> &bypasslin_out,
13  int nStr,
14  int bitMask,
15  std::vector<int> &output) {
16  // std::vector<int> indexLut(output.size());
17 
18  for (unsigned int i = 0; i < output.size(); i++) {
19  output[i] = 0;
20  indexLut_[i] = 0;
21  }
22 
23  for (unsigned int i = 0; i < output.size(); i++) {
24  for (int istrip = 0; istrip < nStr; istrip++) {
25  int res = (bypasslin_out[istrip])[i];
26  res = (res >> bitMask) & 1; // res is FGVB at this stage
27  indexLut_[i] = indexLut_[i] | (res << istrip);
28  }
29  indexLut_[i] = indexLut_[i] | (nStr << 5);
30 
31  int mask = 1 << indexLut_[i];
32  output[i] = fgee_lut_ & mask;
33  if (output[i] > 0)
34  output[i] = 1;
35  }
36  return;
37 }
38 
39 //-------------------------------------------------------------------
40 
41 void EcalFenixTcpFgvbEE::setParameters(uint32_t towid, const EcalTPGFineGrainTowerEE *ecaltpgFineGrainTowerEE) {
42  const EcalTPGFineGrainTowerEEMap &fgee_map = ecaltpgFineGrainTowerEE->getMap();
43 
44  EcalTPGFineGrainTowerEEMapIterator it = fgee_map.find(towid);
45  if (it != fgee_map.end())
46  fgee_lut_ = (*it).second;
47  else
48  edm::LogWarning("EcalTPG") << " could not find EcalTPGFineGrainTowerEEMap for " << towid;
49 }
std::map< uint32_t, uint32_t >::const_iterator EcalTPGFineGrainTowerEEMapIterator
const std::map< uint32_t, uint32_t > & getMap() const
Definition: Electron.h:6
constexpr uint32_t mask
Definition: gpuClustering.h:26
void setParameters(uint32_t towid, const EcalTPGFineGrainTowerEE *ecaltpgFineGrainTowerEE)
std::map< uint32_t, uint32_t > EcalTPGFineGrainTowerEEMap
EcalFenixTcpFgvbEE(int maxNrSamples)
void process(std::vector< std::vector< int >> &bypasslin_out, int nStr, int bitMask, std::vector< int > &output)
Definition: output.py:1
std::vector< int > indexLut_