CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EcalFenixTcpFgvbEE.cc
Go to the documentation of this file.
4 #include <iostream>
5 
6 //---------------------------------------------------------------
8 {
9  indexLut_.resize(maxNrSamples);
10 }//---------------------------------------------------------------
12 {
13 }
14 //---------------------------------------------------------------
15 void EcalFenixTcpFgvbEE::process(std::vector<std::vector<int> > & bypasslin_out, int nStr,int bitMask,std::vector<int> & output)
16 {
17  // std::vector<int> indexLut(output.size());
18 
19  for (unsigned int i=0;i<output.size();i++) {
20  output[i]=0;
21  indexLut_[i]=0;
22  }
23 
24  for (unsigned int i=0;i<output.size();i++) {
25  for (int istrip=0;istrip<nStr;istrip++) {
26  int res = (bypasslin_out[istrip])[i];
27  res = (res >>bitMask) & 1; //res is FGVB at this stage
28  indexLut_[i]= indexLut_[i] | (res << istrip);
29  }
30  indexLut_[i]= indexLut_[i] | (nStr << 5);
31 
32  int mask = 1<<indexLut_[i];
33  output[i]= fgee_lut_ & mask;
34  if (output[i]>0) output[i]=1;
35  }
36  return;
37 }
38 
39 //-------------------------------------------------------------------
40 
41 void EcalFenixTcpFgvbEE::setParameters(uint32_t towid,const EcalTPGFineGrainTowerEE *ecaltpgFineGrainTowerEE)
42 {
43 
44  const EcalTPGFineGrainTowerEEMap &fgee_map = ecaltpgFineGrainTowerEE -> getMap();
45 
46  EcalTPGFineGrainTowerEEMapIterator it=fgee_map.find(towid);
47  if (it!=fgee_map.end()) fgee_lut_=(*it).second;
48  else edm::LogWarning("EcalTPG")<<" could not find EcalTPGFineGrainTowerEEMap for "<<towid;
49 }
50 
51 
52 
53 
54 
55 
56 
57 
58 
59 
60 
61 
62 
63 
64 
65 
66 
67 
68 
69 
70 
71 
72 
73 
74 
int i
Definition: DBlmapReader.cc:9
std::map< uint32_t, uint32_t >::const_iterator EcalTPGFineGrainTowerEEMapIterator
void process(std::vector< std::vector< int > > &bypasslin_out, int nStr, int bitMask, std::vector< int > &output)
void setParameters(uint32_t towid, const EcalTPGFineGrainTowerEE *ecaltpgFineGrainTowerEE)
std::map< uint32_t, uint32_t > EcalTPGFineGrainTowerEEMap
EcalFenixTcpFgvbEE(int maxNrSamples)
std::vector< int > indexLut_