CMS 3D CMS Logo

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