CMS 3D CMS Logo

EcalFenixStripFgvbEE.cc
Go to the documentation of this file.
5 #include <iostream>
6 
8 {
9  identif_=0;
10  flagBadStripMiss_=false;
11 }
12 
14 }
15 
16 void EcalFenixStripFgvbEE::process( std::vector<std::vector<int> > &linout ,std::vector<int> & output)
17 {
18  std::vector<int> indexLut(output.size());
19 
20  for (unsigned int i=0;i<output.size();i++) {
21  output[i]=0;
22  indexLut[i]=0;
23  for (unsigned int ixtal=0;ixtal<linout.size();ixtal++) {
24  int adc=linout[ixtal][i];
25  int res = (((adc & 0xffff) > threshold_fg_) || ((adc & 0x30000) != 0x0)) ? 1 : 0;
26  indexLut[i] = indexLut[i] | (res << ixtal);
27  }
28  int mask = 1<<(indexLut[i]);
29  output[i]= ((lut_fg_ & mask) == 0x0) ? 0 : 1;
30  if(i > 0) output[i-1] = output[i]; // Delay one clock
31  }
32  return;
33 }
34 
35 void EcalFenixStripFgvbEE::setParameters(int identif, uint32_t id,const EcalTPGFineGrainStripEE * ecaltpgFgStripEE)
36 {
37  const EcalTPGFineGrainStripEEMap &fgmap = ecaltpgFgStripEE -> getMap();
38  EcalTPGFineGrainStripEEMapIterator it=fgmap.find(id);
39  if (it!=fgmap.end()){
40  threshold_fg_ = it->second.threshold;
41  lut_fg_ = it->second.lut;
42  }
43  else
44  {
45  if (identif == false){
46  edm::LogWarning("EcalTPG")<<" could not find EcalTPGFineGrainStripEEMap entry for at least one stripId";
47  flagBadStripMiss_ = true;
48  }
49 
50  // Use the FENIX power-up values
51  threshold_fg_ = 65535;
52  lut_fg_ = 0x0;
53  }
54 
55 }
int adc(sample_type sample)
get the ADC sample (12 bits)
std::map< uint32_t, EcalTPGFineGrainStripEE::Item > EcalTPGFineGrainStripEEMap
void setParameters(int identif, uint32_t id, const EcalTPGFineGrainStripEE *)
Definition: Electron.h:6
std::map< uint32_t, EcalTPGFineGrainStripEE::Item >::const_iterator EcalTPGFineGrainStripEEMapIterator
void process(std::vector< std::vector< int > > &lin_out, std::vector< int > &output)