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")
51  << " problem in EcalFenixStripFormatEE: peak_out and filt_out don't "
52  "have the same size";
53  std::cout << " Size peak_out" << peakout.size()
54  << ", size filt_out:" << filtout.size() << std::flush
55  << std::endl;
56  }
57  for (unsigned int i = 0; i < filtout.size(); i++) {
58  setInput(filtout[i], peakout[i], fgvbout[i]);
59  output[i] = process();
60  }
61  return;
62 }
63 //-----------------------------------------------------------------------------------------
64 
66  uint32_t id, const EcalTPGSlidingWindow *&slWin,
67  const EcalTPGStripStatus *stripStatus) {
68 
69  const EcalTPGSlidingWindowMap &slwinmap = slWin->getMap();
70  EcalTPGSlidingWindowMapIterator it = slwinmap.find(id);
71  if (it != slwinmap.end())
72  shift_ = (*it).second;
73  else
74  edm::LogWarning("EcalTPG")
75  << " could not find EcalTPGSlidingWindowMap entry for " << id;
76 
77  const EcalTPGStripStatusMap &statusMap = stripStatus->getMap();
78  EcalTPGStripStatusMapIterator sit = statusMap.find(id);
79  if (sit != statusMap.end()) {
80  stripStatus_ = (*sit).second;
81  } else {
82  stripStatus_ = 0; // Assume strip OK
83  }
84 }
85 //-----------------------------------------------------------------------------------------
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