CMS 3D CMS Logo

EcalFenixStripFormatEB.cc
Go to the documentation of this file.
5 
7 
9 
11  int input_even, int inputEvenPeak, int input_odd, int inputOddPeak, int inputsFGVB) {
12  inputsFGVB_ = inputsFGVB;
13  inputEvenPeak_ = inputEvenPeak;
14  input_even_ = input_even;
15  inputOddPeak_ = inputOddPeak;
16  input_odd_ = input_odd;
17  return 0;
18 }
19 
21  int even_output = 0;
22  int odd_output = 0;
23 
25  even_output = input_even_ >> shift_;
26  } else {
27  if (inputEvenPeak_ == 1)
28  even_output = input_even_ >> shift_;
29  }
30 
32  if (inputOddPeak_ == 1)
33  odd_output = input_odd_ >> shift_;
34  } else {
35  odd_output = input_odd_ >> shift_;
36  }
37 
38  // Prepare the amplitude output for the strip looking at the TPmode options
39  int output = 0;
40  bool is_odd_larger = false;
41  if (ecaltpgTPMode_->EnableEBOddFilter && odd_output > even_output)
42  is_odd_larger =
43  true; // If running with odd filter enabled, check if odd output is larger regardless of strip formatter output mode
45  case 0: // even filter out
46  output = even_output;
47  break;
48  case 1: // odd filter out
50  output = odd_output;
51  else
52  output = even_output;
53  break;
54  case 2: // larger between odd and even
55  if (ecaltpgTPMode_->EnableEBOddFilter && odd_output > even_output) {
56  output = odd_output;
57  } else
58  output = even_output;
59  break;
60  case 3: // even + odd
62  output = even_output + odd_output;
63  else
64  output = even_output;
65  break;
66  }
67 
68  if (output > 0XFFF)
69  output = 0XFFF; // ok: barrel saturates at 12 bits
70 
71  // Info bits
72  // bit12 is sFGVB, bit13 is for odd>even flagging
73  output |= ((inputsFGVB_ & 0x1) << 12);
74 
75  // if the flagging mode is OFF the bit stays 0, since it is not used for other things
77  output |= ((is_odd_larger & 0x1) << 13);
78  }
79 
80  return output;
81 }
82 
83 void EcalFenixStripFormatEB::process(std::vector<int> &sFGVBout,
84  std::vector<int> &peakout_even,
85  std::vector<int> &filtout_even,
86  std::vector<int> &peakout_odd,
87  std::vector<int> &filtout_odd,
88  std::vector<int> &output) {
89  if (peakout_even.size() != filtout_even.size() || sFGVBout.size() != filtout_even.size() ||
90  peakout_odd.size() != filtout_odd.size() || filtout_odd.size() != filtout_even.size()) {
91  edm::LogWarning("EcalTPG") << " problem in EcalFenixStripFormatEB: sfgvb_out, peak_out and "
92  "filt_out don't have the same size";
93  }
94  for (unsigned int i = 0; i < filtout_even.size(); i++) {
95  setInput(filtout_even[i], peakout_even[i], filtout_odd[i], peakout_odd[i], sFGVBout[i]);
96  output[i] = process();
97  }
98  return;
99 }
100 
102  const EcalTPGSlidingWindow *&slWin,
103  const EcalTPGTPMode *ecaltptTPMode) {
104  // TP mode contains options for the formatter (odd/even filters config)
105  ecaltpgTPMode_ = ecaltptTPMode;
106  const EcalTPGSlidingWindowMap &slwinmap = slWin->getMap();
107  EcalTPGSlidingWindowMapIterator it = slwinmap.find(id);
108  if (it != slwinmap.end())
109  shift_ = (*it).second;
110  else
111  edm::LogWarning("EcalTPG") << " could not find EcalTPGSlidingWindowMap entry for " << id;
112 }
EcalFenixStripFormatEB.h
mps_fire.i
i
Definition: mps_fire.py:428
EcalFenixStripFormatEB::ecaltpgTPMode_
const EcalTPGTPMode * ecaltpgTPMode_
Definition: EcalFenixStripFormatEB.h:27
EcalTPGTPMode
Definition: EcalTPGTPMode.h:12
EcalTPGSlidingWindow::getMap
const std::map< uint32_t, uint32_t > & getMap() const
Definition: EcalTPGSlidingWindow.h:14
EcalFenixStripFormatEB::shift_
uint32_t shift_
Definition: EcalFenixStripFormatEB.h:26
MessageLogger.h
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:72
EcalTPGTPMode::DisableEBEvenPeakFinder
bool DisableEBEvenPeakFinder
Definition: EcalTPGTPMode.h:21
EcalFenixStripFormatEB::setParameters
void setParameters(uint32_t &, const EcalTPGSlidingWindow *&, const EcalTPGTPMode *)
Definition: EcalFenixStripFormatEB.cc:101
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
EcalTPGSlidingWindow
Definition: EcalTPGSlidingWindow.h:9
EcalTPGTPMode.h
EcalFenixStripFormatEB::inputsFGVB_
int inputsFGVB_
Definition: EcalFenixStripFormatEB.h:21
EcalTPGSlidingWindowMapIterator
std::map< uint32_t, uint32_t >::const_iterator EcalTPGSlidingWindowMapIterator
Definition: EcalTPGSlidingWindow.h:24
EcalFenixStripFormatEB::setInput
int setInput(int input_even, int inputEvenPeak, int input_odd, int inputOddPeak, int inputsFGVB)
Definition: EcalFenixStripFormatEB.cc:10
EcalFenixStripFormatEB::inputEvenPeak_
int inputEvenPeak_
Definition: EcalFenixStripFormatEB.h:22
EcalFenixStripFormatEB::input_even_
int input_even_
Definition: EcalFenixStripFormatEB.h:24
EcalTPGSlidingWindowMap
std::map< uint32_t, uint32_t > EcalTPGSlidingWindowMap
Definition: EcalTPGSlidingWindow.h:23
EcalFenixStripFormatEB::~EcalFenixStripFormatEB
virtual ~EcalFenixStripFormatEB()
Definition: EcalFenixStripFormatEB.cc:8
EcalTPGTPMode::FenixEBStripOutput
uint16_t FenixEBStripOutput
Definition: EcalTPGTPMode.h:23
EcalFenixStripFormatEB::EcalFenixStripFormatEB
EcalFenixStripFormatEB()
Definition: EcalFenixStripFormatEB.cc:6
EcalTPGTPMode::EnableEBOddFilter
bool EnableEBOddFilter
Definition: EcalTPGTPMode.h:17
EcalFenixStripFormatEB::inputOddPeak_
int inputOddPeak_
Definition: EcalFenixStripFormatEB.h:23
EcalTPGSlidingWindow.h
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
EcalFenixStripFormatEB::input_odd_
int input_odd_
Definition: EcalFenixStripFormatEB.h:25
EcalFenixStripFormatEB::process
int process()
Definition: EcalFenixStripFormatEB.cc:20
EcalTPGTPMode::FenixEBStripInfobit2
uint16_t FenixEBStripInfobit2
Definition: EcalTPGTPMode.h:25
edm::Log
Definition: MessageLogger.h:70
EcalTPGTPMode::EnableEBOddPeakFinder
bool EnableEBOddPeakFinder
Definition: EcalTPGTPMode.h:19