CMS 3D CMS Logo

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  //std::cout << " EcalFenixStripFormatEB::process() input_ " << input_ << " output after shift " << output << std::endl;
29  if(output>0XFFF) output=0XFFF; //ok: barrel saturates at 12 bits
30  // Add stripFGVB
31  output |= ((inputsFGVB_&0x1)<<12);
32 
33  //std::cout << " EcalFenixStripFormatEB::process() output after adding FGVB " << output << std::endl;
34  return output;
35  }
36 
37 void EcalFenixStripFormatEB::process(std::vector<int> &sFGVBout, std::vector<int> &peakout, std::vector<int> &filtout, std::vector<int> & output)
38 {
39  if (peakout.size()!=filtout.size() || sFGVBout.size()!=filtout.size()){
40  edm::LogWarning("EcalTPG")<<" problem in EcalFenixStripFormatEB: sfgvb_out, peak_out and filt_out don't have the same size";
41  }
42  //std::cout << " EcalFenixStripFormatEB::process(std::vector ... filtout size " << filtout.size() << std::endl;
43  for (unsigned int i =0;i<filtout.size();i++){
44  //std::cout << " Looping over filtout " << filtout[i] << " " << peakout[i] << std::endl;
45  setInput(filtout[i],peakout[i], sFGVBout[i]);
46 
47  output[i]=process();
48  }
49  return;
50 }
51 
53 {
54 
55  const EcalTPGSlidingWindowMap &slwinmap = slWin -> getMap();
56  EcalTPGSlidingWindowMapIterator it=slwinmap.find(id);
57  if (it!=slwinmap.end()) shift_=(*it).second;
58  else edm::LogWarning("EcalTPG")<<" could not find EcalTPGSlidingWindowMap entry for "<<id;
59 }
std::map< uint32_t, uint32_t > EcalTPGSlidingWindowMap
static std::string const input
Definition: EdmProvDump.cc:48
int setInput(int input, int inputPeak, int inputsFGVB)
void setParameters(uint32_t &, const EcalTPGSlidingWindow *&)
std::map< uint32_t, uint32_t >::const_iterator EcalTPGSlidingWindowMapIterator