CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EcalFenixStripFgvbEE.cc
Go to the documentation of this file.
5 
7 {
8 }
9 
11 }
12 
13 void EcalFenixStripFgvbEE::process( std::vector<std::vector<int> > &linout ,std::vector<int> & output)
14 {
15  unsigned int maskFgvb[]={1,2,4,8,0x10};
16 
17  // int threshold_fg = (*params_)[6];
18  // int lut_fg = (*params_)[7];
19 
20  int threshold_fg = fgparams_->threshold ;
21  int lut_fg = fgparams_->lut ;
22 
23 
24  std::vector<int> indexLut(output.size());
25 
26  for (unsigned int i=0;i<output.size();i++) {
27  output[i]=0;
28  indexLut[i]=0;
29  for (unsigned int ixtal=0;ixtal<linout.size();ixtal++) {
30  int adc=linout[ixtal][i];
31  int res= (adc>threshold_fg) ? 1 : 0;
32  indexLut[i]=indexLut[i] | (res <<ixtal & maskFgvb[ixtal]);
33  }
34  int mask = 1<<indexLut[i];
35  output[i]= lut_fg & mask;
36  if (output[i]>0) output[i]=1;
37  }
38  return;
39 }
40 
41 void EcalFenixStripFgvbEE::setParameters(uint32_t id,const EcalTPGFineGrainStripEE * ecaltpgFgStripEE)
42 {
43  const EcalTPGFineGrainStripEEMap &fgmap = ecaltpgFgStripEE -> getMap();
44  EcalTPGFineGrainStripEEMapIterator it=fgmap.find(id);
45  if (it!=fgmap.end()) fgparams_=&(*it).second;
46  else edm::LogWarning("EcalTPG")<<" could not find EcalTPGFineGrainStripEEMap entry for "<<id;
47 
48 
49 
50 }
int adc(sample_type sample)
get the ADC sample (12 bits)
int i
Definition: DBlmapReader.cc:9
std::map< uint32_t, EcalTPGFineGrainStripEE::Item > EcalTPGFineGrainStripEEMap
key_type id() const
Definition: EBDataFrame.h:32
const EcalTPGFineGrainStripEE::Item * fgparams_
std::map< uint32_t, EcalTPGFineGrainStripEE::Item >::const_iterator EcalTPGFineGrainStripEEMapIterator
void process(std::vector< std::vector< int > > &lin_out, std::vector< int > &output)
void setParameters(uint32_t id, const EcalTPGFineGrainStripEE *)