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.

◆ ~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.

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().

20  {
21  int even_output = 0;
22  int odd_output = 0;
23 
24  // Applying sliding window on the strip output after the peak finder
26  even_output = input_even_ >> shift_;
27  } else {
28  if (inputEvenPeak_ == 1)
29  even_output = input_even_ >> shift_;
30  }
31 
33  if (inputOddPeak_ == 1)
34  odd_output = input_odd_ >> shift_;
35  } else {
36  odd_output = input_odd_ >> shift_;
37  }
38 
39  // Truncating the signals to 12 bit after peak finder sliding window
40  if (odd_output > 0XFFF)
41  odd_output = 0XFFF;
42  if (even_output > 0XFFF)
43  even_output = 0XFFF;
44 
45  // Prepare the amplitude output for the strip looking at the TPmode options
46  int output = 0;
47  bool is_odd_larger = false;
48  if (ecaltpgTPMode_->EnableEBOddFilter && odd_output > even_output)
49  is_odd_larger =
50  true; // If running with odd filter enabled, check if odd output is larger regardless of strip formatter output mode
52  case 0: // even filter out
53  output = even_output;
54  break;
55  case 1: // odd filter out
57  output = odd_output;
58  else
59  output = even_output;
60  break;
61  case 2: // larger between odd and even
62  if (ecaltpgTPMode_->EnableEBOddFilter && odd_output > even_output) {
63  output = odd_output;
64  } else
65  output = even_output;
66  break;
67  case 3: // even + odd
69  output = even_output + odd_output;
70  else
71  output = even_output;
72  break;
73  }
74 
75  if (output > 0XFFF)
76  output = 0XFFF; // ok: barrel saturates at 12 bits
77 
78  // Info bits
79  // bit12 is sFGVB, bit13 is for odd>even flagging
80  output |= ((inputsFGVB_ & 0x1) << 12);
81 
82  // if the flagging mode is OFF the bit stays 0, since it is not used for other things
84  output |= ((is_odd_larger & 0x1) << 13);
85  }
86 
87  return output;
88 }
uint16_t FenixEBStripOutput
Definition: EcalTPGTPMode.h:23
uint16_t FenixEBStripInfobit2
Definition: EcalTPGTPMode.h:25
bool DisableEBEvenPeakFinder
Definition: EcalTPGTPMode.h:21
bool EnableEBOddPeakFinder
Definition: EcalTPGTPMode.h:19
const EcalTPGTPMode * ecaltpgTPMode_
Definition: output.py:1
bool EnableEBOddFilter
Definition: EcalTPGTPMode.h:17

◆ 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 90 of file EcalFenixStripFormatEB.cc.

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

95  {
96  if (peakout_even.size() != filtout_even.size() || sFGVBout.size() != filtout_even.size() ||
97  peakout_odd.size() != filtout_odd.size() || filtout_odd.size() != filtout_even.size()) {
98  edm::LogWarning("EcalTPG") << " problem in EcalFenixStripFormatEB: sfgvb_out, peak_out and "
99  "filt_out don't have the same size";
100  }
101  for (unsigned int i = 0; i < filtout_even.size(); i++) {
102  setInput(filtout_even[i], peakout_even[i], filtout_odd[i], peakout_odd[i], sFGVBout[i]);
103  output[i] = process();
104  }
105  return;
106 }
int setInput(int input_even, int inputEvenPeak, int input_odd, int inputOddPeak, int inputsFGVB)
Definition: output.py:1
Log< level::Warning, false > LogWarning

◆ 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.

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

Referenced by process().

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

◆ setParameters()

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

Definition at line 108 of file EcalFenixStripFormatEB.cc.

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

Referenced by EcalFenixStrip::process_part2_barrel().

110  {
111  // TP mode contains options for the formatter (odd/even filters config)
112  ecaltpgTPMode_ = ecaltptTPMode;
113  const EcalTPGSlidingWindowMap &slwinmap = slWin->getMap();
114  EcalTPGSlidingWindowMapIterator it = slwinmap.find(id);
115  if (it != slwinmap.end())
116  shift_ = (*it).second;
117  else
118  edm::LogWarning("EcalTPG") << " could not find EcalTPGSlidingWindowMap entry for " << id;
119 }
const std::map< uint32_t, uint32_t > & getMap() const
std::map< uint32_t, uint32_t > EcalTPGSlidingWindowMap
const EcalTPGTPMode * ecaltpgTPMode_
std::map< uint32_t, uint32_t >::const_iterator EcalTPGSlidingWindowMapIterator

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().