CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 ( )

Definition at line 6 of file EcalFenixStripFormatEB.cc.

EcalFenixStripFormatEB::~EcalFenixStripFormatEB ( )
virtual

Definition at line 8 of file EcalFenixStripFormatEB.cc.

8 {}

Member Function Documentation

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 
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 }
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_
bool EnableEBOddFilter
Definition: EcalTPGTPMode.h:17
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.

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

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 }
int setInput(int input_even, int inputEvenPeak, int input_odd, int inputOddPeak, int inputsFGVB)
Log< level::Warning, false > LogWarning
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 }
void EcalFenixStripFormatEB::setParameters ( uint32_t &  id,
const EcalTPGSlidingWindow *&  slWin,
const EcalTPGTPMode ecaltptTPMode 
)

Definition at line 101 of file EcalFenixStripFormatEB.cc.

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

Referenced by EcalFenixStrip::process_part2_barrel().

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 }
const std::map< uint32_t, uint32_t > & getMap() const
uint16_t *__restrict__ id
std::map< uint32_t, uint32_t > EcalTPGSlidingWindowMap
const EcalTPGTPMode * ecaltpgTPMode_
std::map< uint32_t, uint32_t >::const_iterator EcalTPGSlidingWindowMapIterator

Member Data Documentation

const EcalTPGTPMode* EcalFenixStripFormatEB::ecaltpgTPMode_
private

Definition at line 27 of file EcalFenixStripFormatEB.h.

Referenced by process(), and setParameters().

int EcalFenixStripFormatEB::input_even_
private

Definition at line 24 of file EcalFenixStripFormatEB.h.

Referenced by process(), and setInput().

int EcalFenixStripFormatEB::input_odd_
private

Definition at line 25 of file EcalFenixStripFormatEB.h.

Referenced by process(), and setInput().

int EcalFenixStripFormatEB::inputEvenPeak_
private

Definition at line 22 of file EcalFenixStripFormatEB.h.

Referenced by process(), and setInput().

int EcalFenixStripFormatEB::inputOddPeak_
private

Definition at line 23 of file EcalFenixStripFormatEB.h.

Referenced by process(), and setInput().

int EcalFenixStripFormatEB::inputsFGVB_
private

Definition at line 21 of file EcalFenixStripFormatEB.h.

Referenced by process(), and setInput().

uint32_t EcalFenixStripFormatEB::shift_
private

Definition at line 26 of file EcalFenixStripFormatEB.h.

Referenced by process(), and setParameters().