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 //-----------------------------------------------------------------------------------------
EcalTPGStripStatusMap
std::map< uint32_t, uint16_t > EcalTPGStripStatusMap
Definition: EcalTPGStripStatus.h:24
EcalFenixStripFormatEE::setInput
int setInput(int input, int inputPeak, int fgvb)
Definition: EcalFenixStripFormatEE.cc:16
mps_fire.i
i
Definition: mps_fire.py:428
EcalTPGSlidingWindow::getMap
const std::map< uint32_t, uint32_t > & getMap() const
Definition: EcalTPGSlidingWindow.h:14
input
static const std::string input
Definition: EdmProvDump.cc:48
MessageLogger.h
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:72
gather_cfg.cout
cout
Definition: gather_cfg.py:144
EcalFenixStripFormatEE.h
EcalFenixStripFormatEE::process
int process()
Definition: EcalFenixStripFormatEE.cc:24
EcalFenixStripFormatEE::inputPeak_
int inputPeak_
Definition: EcalFenixStripFormatEE.h:21
EcalFenixStripFormatEE::fgvb_
int fgvb_
Definition: EcalFenixStripFormatEE.h:24
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
EcalTPGStripStatus::getMap
const std::map< uint32_t, uint16_t > & getMap() const
Definition: EcalTPGStripStatus.h:15
EcalTPGSlidingWindow
Definition: EcalTPGSlidingWindow.h:9
EcalTPGSlidingWindowMapIterator
std::map< uint32_t, uint32_t >::const_iterator EcalTPGSlidingWindowMapIterator
Definition: EcalTPGSlidingWindow.h:24
EcalFenixStripFormatEE::EcalFenixStripFormatEE
EcalFenixStripFormatEE()
Definition: EcalFenixStripFormatEE.cc:9
EcalTPGSlidingWindowMap
std::map< uint32_t, uint32_t > EcalTPGSlidingWindowMap
Definition: EcalTPGSlidingWindow.h:23
EcalFenixStripFormatEE::input_
int input_
Definition: EcalFenixStripFormatEE.h:22
EcalTPGStripStatusMapIterator
std::map< uint32_t, uint16_t >::const_iterator EcalTPGStripStatusMapIterator
Definition: EcalTPGStripStatus.h:25
EcalFenixStripFormatEE::~EcalFenixStripFormatEE
virtual ~EcalFenixStripFormatEE()
Definition: EcalFenixStripFormatEE.cc:12
EcalFenixStripFormatEE::stripStatus_
uint16_t stripStatus_
Definition: EcalFenixStripFormatEE.h:25
EcalTPGStripStatus.h
EcalFenixStripFormatEE::shift_
uint32_t shift_
Definition: EcalFenixStripFormatEE.h:23
EcalTPGSlidingWindow.h
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
EcalTPGStripStatus
Definition: EcalTPGStripStatus.h:9
EcalFenixStripFormatEE::setParameters
void setParameters(uint32_t id, const EcalTPGSlidingWindow *&, const EcalTPGStripStatus *)
Definition: EcalFenixStripFormatEE.cc:62
edm::Log
Definition: MessageLogger.h:70