CMS 3D CMS Logo

EcalFenixStripFormatEE.cc
Go to the documentation of this file.
4 
6 #include <iostream>
7 
8 //-----------------------------------------------------------------------------------------
10 //------------------------------------------------------------------------------------------
11 
13 
14 //-----------------------------------------------------------------------------------------
15 
16 int EcalFenixStripFormatEE::setInput(int input, int inputPeak, int fgvb) {
17  inputPeak_ = inputPeak;
18  input_ = input;
19  fgvb_ = fgvb;
20  return 0;
21 }
22 //-----------------------------------------------------------------------------------------
23 
25  // Bad strip - zero everything
26  if (stripStatus_ != 0)
27  return 0;
28 
29  // Peak not found - only return fgvb
30  if (inputPeak_ == 0)
31  return ((fgvb_ & 0x1) << 12);
32 
33  int output = input_ >> shift_;
34 
35  // barrel saturates at 12 bits, endcap at 10!
36  // Pascal: finally no,endcap has 12 bits as in EB (bug in FENIX!!!!)
37  if (output > 0XFFF)
38  output = 0XFFF;
39  output = output | ((fgvb_ & 0x1) << 12); // Pascal (was 10)
40 
41  return output;
42 }
43 //------------------------------------------------------------------------------------------
44 
45 void EcalFenixStripFormatEE::process(std::vector<int> &fgvbout,
46  std::vector<int> &peakout,
47  std::vector<int> &filtout,
48  std::vector<int> &output) {
49  if (peakout.size() != filtout.size()) {
50  edm::LogWarning("EcalTPG") << " problem in EcalFenixStripFormatEE: peak_out and filt_out don't "
51  "have the same size";
52  std::cout << " Size peak_out" << peakout.size() << ", size filt_out:" << filtout.size() << std::flush << std::endl;
53  }
54  for (unsigned int i = 0; i < filtout.size(); i++) {
55  setInput(filtout[i], peakout[i], fgvbout[i]);
56  output[i] = process();
57  }
58  return;
59 }
60 //-----------------------------------------------------------------------------------------
61 
63  const EcalTPGSlidingWindow *&slWin,
64  const EcalTPGStripStatus *stripStatus) {
65  const EcalTPGSlidingWindowMap &slwinmap = slWin->getMap();
66  EcalTPGSlidingWindowMapIterator it = slwinmap.find(id);
67  if (it != slwinmap.end())
68  shift_ = (*it).second;
69  else
70  edm::LogWarning("EcalTPG") << " could not find EcalTPGSlidingWindowMap entry for " << id;
71 
72  const EcalTPGStripStatusMap &statusMap = stripStatus->getMap();
73  EcalTPGStripStatusMapIterator sit = statusMap.find(id);
74  if (sit != statusMap.end()) {
75  stripStatus_ = (*sit).second;
76  } else {
77  stripStatus_ = 0; // Assume strip OK
78  }
79 }
80 //-----------------------------------------------------------------------------------------
const std::map< uint32_t, uint32_t > & getMap() const
void setParameters(uint32_t id, const EcalTPGSlidingWindow *&, const EcalTPGStripStatus *)
const std::map< uint32_t, uint16_t > & getMap() const
std::map< uint32_t, uint32_t > EcalTPGSlidingWindowMap
int setInput(int input, int inputPeak, int fgvb)
static std::string const input
Definition: EdmProvDump.cc:48
std::map< uint32_t, uint16_t > EcalTPGStripStatusMap
std::map< uint32_t, uint32_t >::const_iterator EcalTPGSlidingWindowMapIterator
std::map< uint32_t, uint16_t >::const_iterator EcalTPGStripStatusMapIterator