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, int bitMask,
14  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  }
21 
22  for (unsigned int i = 0; i < output.size(); i++) {
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_[i] = indexLut_[i] | (res << istrip);
27  }
28  indexLut_[i] = indexLut_[i] | (nStr << 5);
29 
30  int mask = 1 << indexLut_[i];
31  output[i] = fgee_lut_ & mask;
32  if (output[i] > 0)
33  output[i] = 1;
34  }
35  return;
36 }
37 
38 //-------------------------------------------------------------------
39 
41  uint32_t towid, const EcalTPGFineGrainTowerEE *ecaltpgFineGrainTowerEE) {
42 
43  const EcalTPGFineGrainTowerEEMap &fgee_map =
44  ecaltpgFineGrainTowerEE->getMap();
45 
46  EcalTPGFineGrainTowerEEMapIterator it = fgee_map.find(towid);
47  if (it != fgee_map.end())
48  fgee_lut_ = (*it).second;
49  else
50  edm::LogWarning("EcalTPG")
51  << " could not find EcalTPGFineGrainTowerEEMap for " << towid;
52 }
std::map< uint32_t, uint32_t >::const_iterator EcalTPGFineGrainTowerEEMapIterator
Definition: Electron.h:6
void setParameters(uint32_t towid, const EcalTPGFineGrainTowerEE *ecaltpgFineGrainTowerEE)
const std::map< uint32_t, uint32_t > & getMap() const
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)
std::vector< int > indexLut_