CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
EcalFenixStripFormatEB Class Reference

Formatting for Fenix strip input: 18 bits + 3x 1bit (fgvb, gapflagbit, output from peakfinder) output:16 bits The output corresponds to 1 calodataframe per strip — not really a calodataframe no? More...

#include <EcalFenixStripFormatEB.h>

Public Member Functions

 EcalFenixStripFormatEB ()
 
virtual void process (std::vector< int > &sFGVBout, std::vector< int > &peakout_even, std::vector< int > &filtout_even, std::vector< int > &peakout_odd, std::vector< int > &filtout_odd, std::vector< int > &output)
 
void setParameters (uint32_t &, const EcalTPGSlidingWindow *&, const EcalTPGTPMode *)
 
virtual ~EcalFenixStripFormatEB ()
 

Private Member Functions

int process ()
 
int setInput (int input_even, int inputEvenPeak, int input_odd, int inputOddPeak, int inputsFGVB)
 

Private Attributes

const EcalTPGTPModeecaltpgTPMode_
 
int input_even_
 
int input_odd_
 
int inputEvenPeak_
 
int inputOddPeak_
 
int inputsFGVB_
 
uint32_t shift_
 

Detailed Description

Formatting for Fenix strip input: 18 bits + 3x 1bit (fgvb, gapflagbit, output from peakfinder) output:16 bits The output corresponds to 1 calodataframe per strip — not really a calodataframe no?

Definition at line 19 of file EcalFenixStripFormatEB.h.

Constructor & Destructor Documentation

◆ EcalFenixStripFormatEB()

EcalFenixStripFormatEB::EcalFenixStripFormatEB ( )

Definition at line 6 of file EcalFenixStripFormatEB.cc.

6 : shift_(0) {}

◆ ~EcalFenixStripFormatEB()

EcalFenixStripFormatEB::~EcalFenixStripFormatEB ( )
virtual

Definition at line 8 of file EcalFenixStripFormatEB.cc.

8 {}

Member Function Documentation

◆ process() [1/2]

int EcalFenixStripFormatEB::process ( )
private

Definition at line 20 of file EcalFenixStripFormatEB.cc.

20  {
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 }

References EcalTPGTPMode::DisableEBEvenPeakFinder, ecaltpgTPMode_, EcalTPGTPMode::EnableEBOddFilter, EcalTPGTPMode::EnableEBOddPeakFinder, EcalTPGTPMode::FenixEBStripInfobit2, EcalTPGTPMode::FenixEBStripOutput, input_even_, input_odd_, inputEvenPeak_, inputOddPeak_, inputsFGVB_, convertSQLitetoXML_cfg::output, and shift_.

Referenced by process(), and EcalFenixStrip::process_part2_barrel().

◆ process() [2/2]

void EcalFenixStripFormatEB::process ( std::vector< int > &  sFGVBout,
std::vector< int > &  peakout_even,
std::vector< int > &  filtout_even,
std::vector< int > &  peakout_odd,
std::vector< int > &  filtout_odd,
std::vector< int > &  output 
)
virtual

Definition at line 83 of file EcalFenixStripFormatEB.cc.

88  {
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 }

References mps_fire::i, convertSQLitetoXML_cfg::output, process(), and setInput().

◆ setInput()

int EcalFenixStripFormatEB::setInput ( int  input_even,
int  inputEvenPeak,
int  input_odd,
int  inputOddPeak,
int  inputsFGVB 
)
private

Definition at line 10 of file EcalFenixStripFormatEB.cc.

11  {
12  inputsFGVB_ = inputsFGVB;
13  inputEvenPeak_ = inputEvenPeak;
14  input_even_ = input_even;
15  inputOddPeak_ = inputOddPeak;
16  input_odd_ = input_odd;
17  return 0;
18 }

References input_even_, input_odd_, inputEvenPeak_, inputOddPeak_, and inputsFGVB_.

Referenced by process().

◆ setParameters()

void EcalFenixStripFormatEB::setParameters ( uint32_t &  id,
const EcalTPGSlidingWindow *&  slWin,
const EcalTPGTPMode ecaltptTPMode 
)

Definition at line 101 of file EcalFenixStripFormatEB.cc.

103  {
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 }

References ecaltpgTPMode_, EcalTPGSlidingWindow::getMap(), triggerObjects_cff::id, and shift_.

Referenced by EcalFenixStrip::process_part2_barrel().

Member Data Documentation

◆ ecaltpgTPMode_

const EcalTPGTPMode* EcalFenixStripFormatEB::ecaltpgTPMode_
private

Definition at line 27 of file EcalFenixStripFormatEB.h.

Referenced by process(), and setParameters().

◆ input_even_

int EcalFenixStripFormatEB::input_even_
private

Definition at line 24 of file EcalFenixStripFormatEB.h.

Referenced by process(), and setInput().

◆ input_odd_

int EcalFenixStripFormatEB::input_odd_
private

Definition at line 25 of file EcalFenixStripFormatEB.h.

Referenced by process(), and setInput().

◆ inputEvenPeak_

int EcalFenixStripFormatEB::inputEvenPeak_
private

Definition at line 22 of file EcalFenixStripFormatEB.h.

Referenced by process(), and setInput().

◆ inputOddPeak_

int EcalFenixStripFormatEB::inputOddPeak_
private

Definition at line 23 of file EcalFenixStripFormatEB.h.

Referenced by process(), and setInput().

◆ inputsFGVB_

int EcalFenixStripFormatEB::inputsFGVB_
private

Definition at line 21 of file EcalFenixStripFormatEB.h.

Referenced by process(), and setInput().

◆ shift_

uint32_t EcalFenixStripFormatEB::shift_
private

Definition at line 26 of file EcalFenixStripFormatEB.h.

Referenced by process(), and setParameters().

mps_fire.i
i
Definition: mps_fire.py:428
EcalFenixStripFormatEB::ecaltpgTPMode_
const EcalTPGTPMode * ecaltpgTPMode_
Definition: EcalFenixStripFormatEB.h:27
EcalTPGSlidingWindow::getMap
const std::map< uint32_t, uint32_t > & getMap() const
Definition: EcalTPGSlidingWindow.h:14
EcalFenixStripFormatEB::shift_
uint32_t shift_
Definition: EcalFenixStripFormatEB.h:26
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:72
EcalTPGTPMode::DisableEBEvenPeakFinder
bool DisableEBEvenPeakFinder
Definition: EcalTPGTPMode.h:21
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
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
EcalTPGTPMode::FenixEBStripOutput
uint16_t FenixEBStripOutput
Definition: EcalTPGTPMode.h:23
EcalTPGTPMode::EnableEBOddFilter
bool EnableEBOddFilter
Definition: EcalTPGTPMode.h:17
EcalFenixStripFormatEB::inputOddPeak_
int inputOddPeak_
Definition: EcalFenixStripFormatEB.h:23
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