CMS 3D CMS Logo

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