CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EcalFenixStripFormatEB.cc
Go to the documentation of this file.
4 
6  : shift_(0)
7 {
8 }
9 
11  }
12 
13  int EcalFenixStripFormatEB::setInput(int input, int inputPeak, int inputsFGVB)
14  {
15  inputsFGVB_ = inputsFGVB;
16  inputPeak_=inputPeak;
17  input_=input;
18  return 0;
19  }
20 
22  {
23  // buffer_=input_>>shift_; //FIXME: buffer why?
24 
25  if(inputPeak_==0) return ((inputsFGVB_&0x1)<<12);
26  // int output=buffer_;
27  int output=input_>>shift_;
28  if(output>0XFFF) output=0XFFF; //ok: barrel saturates at 12 bits
29  // Add stripFGVB
30  output |= ((inputsFGVB_&0x1)<<12);
31 
32  return output;
33  }
34 
35 void EcalFenixStripFormatEB::process(std::vector<int> &sFGVBout, std::vector<int> &peakout, std::vector<int> &filtout, std::vector<int> & output)
36 {
37  if (peakout.size()!=filtout.size() || sFGVBout.size()!=filtout.size()){
38  edm::LogWarning("EcalTPG")<<" problem in EcalFenixStripFormatEB: sfgvb_out, peak_out and filt_out don't have the same size";
39  }
40  for (unsigned int i =0;i<filtout.size();i++){
41  setInput(filtout[i],peakout[i], sFGVBout[i]);
42 
43  output[i]=process();
44  }
45  return;
46 }
47 
49 {
50 
51  const EcalTPGSlidingWindowMap &slwinmap = slWin -> getMap();
52  EcalTPGSlidingWindowMapIterator it=slwinmap.find(id);
53  if (it!=slwinmap.end()) shift_=(*it).second;
54  else edm::LogWarning("EcalTPG")<<" could not find EcalTPGSlidingWindowMap entry for "<<id;
55 }
int i
Definition: DBlmapReader.cc:9
key_type id() const
Definition: EBDataFrame.h:32
std::map< uint32_t, uint32_t > EcalTPGSlidingWindowMap
int setInput(int input, int inputPeak, int inputsFGVB)
void setParameters(uint32_t &, const EcalTPGSlidingWindow *&)
std::map< uint32_t, uint32_t >::const_iterator EcalTPGSlidingWindowMapIterator