CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
EcalFenixStripFormatEE 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 <EcalFenixStripFormatEE.h>

Public Member Functions

 EcalFenixStripFormatEE ()
 
virtual void process (std::vector< int > &fgvbout, 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 id, const EcalTPGSlidingWindow *&, const EcalTPGStripStatus *, const EcalTPGTPMode *)
 
virtual ~EcalFenixStripFormatEE ()
 

Private Member Functions

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

Private Attributes

const EcalTPGTPModeecaltpgTPMode_
 
int fgvb_
 
int input_even_
 
int input_odd_
 
int inputEvenPeak_
 
int inputOddPeak_
 
uint32_t shift_
 
uint16_t stripStatus_
 

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?

Formatting for Fenix Tcp EE input 10 bits from Ettot 1 bit from fgvb 3 bits TriggerTowerFlag output: 16 bits simple formatting.

Definition at line 20 of file EcalFenixStripFormatEE.h.

Constructor & Destructor Documentation

◆ EcalFenixStripFormatEE()

EcalFenixStripFormatEE::EcalFenixStripFormatEE ( )

Definition at line 10 of file EcalFenixStripFormatEE.cc.

10 : shift_(0) {}

◆ ~EcalFenixStripFormatEE()

EcalFenixStripFormatEE::~EcalFenixStripFormatEE ( )
virtual

Definition at line 13 of file EcalFenixStripFormatEE.cc.

13 {}

Member Function Documentation

◆ process() [1/2]

int EcalFenixStripFormatEE::process ( )
private

Definition at line 27 of file EcalFenixStripFormatEE.cc.

27  {
28  // Bad strip - zero everything
29  if (stripStatus_ != 0)
30  return 0;
31 
32  int even_output = 0;
33  int odd_output = 0;
34 
36  even_output = input_even_ >> shift_;
37  } else {
38  if (inputEvenPeak_ == 1)
39  even_output = input_even_ >> shift_;
40  }
41 
43  if (inputOddPeak_ == 1)
44  odd_output = input_odd_ >> shift_;
45  } else {
46  odd_output = input_odd_ >> shift_;
47  }
48 
49  // Prepare the amplitude output for the strip looking at the TPmode options
50  int output = 0;
51  bool is_odd_larger = false;
52 
53  if (ecaltpgTPMode_->EnableEEOddFilter && (odd_output > even_output))
54  is_odd_larger =
55  true; // If running with odd filter enabled, check if odd output is larger regardless of strip formatter output mode
57  case 0: // even filter out
58  output = even_output;
59  break;
60  case 1: // odd filter out
62  output = odd_output;
63  else
64  output = even_output;
65  break;
66  case 2: // larger between odd and even
67  if (ecaltpgTPMode_->EnableEEOddFilter && (odd_output > even_output)) {
68  output = odd_output;
69  } else
70  output = even_output;
71  break;
72  case 3: // even + odd
74  output = even_output + odd_output;
75  else
76  output = even_output;
77  break;
78  }
79 
80  // barrel saturates at 12 bits, endcap at 10!
81  // Pascal: finally no,endcap has 12 bits as in EB (bug in FENIX!!!!)
82  if (output > 0XFFF)
83  output = 0XFFF;
84 
85  // Info bits
86  // bit12 is sFGVB, bit13 is for odd>even flagging
87  output |= ((fgvb_ & 0x1) << 12);
88 
90  output |= ((is_odd_larger & 0x1) << 13);
91  }
92 
93  return output;
94 }

References EcalTPGTPMode::DisableEEEvenPeakFinder, ecaltpgTPMode_, EcalTPGTPMode::EnableEEOddFilter, EcalTPGTPMode::EnableEEOddPeakFinder, EcalTPGTPMode::FenixEEStripInfobit2, EcalTPGTPMode::FenixEEStripOutput, fgvb_, input_even_, input_odd_, inputEvenPeak_, inputOddPeak_, convertSQLitetoXML_cfg::output, shift_, and stripStatus_.

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

◆ process() [2/2]

void EcalFenixStripFormatEE::process ( std::vector< int > &  fgvbout,
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 97 of file EcalFenixStripFormatEE.cc.

102  {
103  if (peakout_even.size() != filtout_even.size() || fgvbout.size() != filtout_even.size() ||
104  peakout_odd.size() != filtout_odd.size() || filtout_odd.size() != filtout_even.size()) {
105  edm::LogWarning("EcalTPG") << " problem in EcalFenixStripFormatEE: peak_out and filt_out don't "
106  "have the same size";
107  std::cout << " Size peak_out" << peakout_even.size() << ", size filt_out:" << filtout_even.size() << std::flush
108  << std::endl;
109  }
110 
111  for (unsigned int i = 0; i < filtout_even.size(); i++) {
112  setInput(filtout_even[i], peakout_even[i], filtout_odd[i], peakout_odd[i], fgvbout[i]);
113  output[i] = process();
114  }
115  return;
116 }

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

◆ setInput()

int EcalFenixStripFormatEE::setInput ( int  input_even,
int  inputEvenPeak,
int  input_odd,
int  inputOddPeak,
int  fgvb 
)
private

Definition at line 17 of file EcalFenixStripFormatEE.cc.

17  {
18  inputEvenPeak_ = inputEvenPeak;
19  input_even_ = input_even;
20  inputOddPeak_ = inputOddPeak;
21  input_odd_ = input_odd;
22  fgvb_ = fgvb;
23  return 0;
24 }

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

Referenced by process().

◆ setParameters()

void EcalFenixStripFormatEE::setParameters ( uint32_t  id,
const EcalTPGSlidingWindow *&  slWin,
const EcalTPGStripStatus stripStatus,
const EcalTPGTPMode ecaltpgTPMode 
)

Definition at line 119 of file EcalFenixStripFormatEE.cc.

122  {
123  // TP mode contains options for the formatter (odd/even filters config)
124  ecaltpgTPMode_ = ecaltpgTPMode;
125  const EcalTPGSlidingWindowMap &slwinmap = slWin->getMap();
126  EcalTPGSlidingWindowMapIterator it = slwinmap.find(id);
127  if (it != slwinmap.end())
128  shift_ = (*it).second;
129  else
130  edm::LogWarning("EcalTPG") << " could not find EcalTPGSlidingWindowMap entry for " << id;
131 
132  const EcalTPGStripStatusMap &statusMap = stripStatus->getMap();
133  EcalTPGStripStatusMapIterator sit = statusMap.find(id);
134  if (sit != statusMap.end()) {
135  stripStatus_ = (*sit).second;
136  } else {
137  stripStatus_ = 0; // Assume strip OK
138  }
139 }

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

Referenced by EcalFenixStrip::process_part2_endcap().

Member Data Documentation

◆ ecaltpgTPMode_

const EcalTPGTPMode* EcalFenixStripFormatEE::ecaltpgTPMode_
private

Definition at line 29 of file EcalFenixStripFormatEE.h.

Referenced by process(), and setParameters().

◆ fgvb_

int EcalFenixStripFormatEE::fgvb_
private

Definition at line 27 of file EcalFenixStripFormatEE.h.

Referenced by process(), and setInput().

◆ input_even_

int EcalFenixStripFormatEE::input_even_
private

Definition at line 24 of file EcalFenixStripFormatEE.h.

Referenced by process(), and setInput().

◆ input_odd_

int EcalFenixStripFormatEE::input_odd_
private

Definition at line 25 of file EcalFenixStripFormatEE.h.

Referenced by process(), and setInput().

◆ inputEvenPeak_

int EcalFenixStripFormatEE::inputEvenPeak_
private

Definition at line 22 of file EcalFenixStripFormatEE.h.

Referenced by process(), and setInput().

◆ inputOddPeak_

int EcalFenixStripFormatEE::inputOddPeak_
private

Definition at line 23 of file EcalFenixStripFormatEE.h.

Referenced by process(), and setInput().

◆ shift_

uint32_t EcalFenixStripFormatEE::shift_
private

Definition at line 26 of file EcalFenixStripFormatEE.h.

Referenced by process(), and setParameters().

◆ stripStatus_

uint16_t EcalFenixStripFormatEE::stripStatus_
private

Definition at line 28 of file EcalFenixStripFormatEE.h.

Referenced by process(), and setParameters().

EcalTPGStripStatusMap
std::map< uint32_t, uint16_t > EcalTPGStripStatusMap
Definition: EcalTPGStripStatus.h:24
EcalFenixStripFormatEE::inputOddPeak_
int inputOddPeak_
Definition: EcalFenixStripFormatEE.h:23
mps_fire.i
i
Definition: mps_fire.py:428
EcalTPGSlidingWindow::getMap
const std::map< uint32_t, uint32_t > & getMap() const
Definition: EcalTPGSlidingWindow.h:14
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:72
EcalFenixStripFormatEE::input_even_
int input_even_
Definition: EcalFenixStripFormatEE.h:24
gather_cfg.cout
cout
Definition: gather_cfg.py:144
EcalFenixStripFormatEE::process
int process()
Definition: EcalFenixStripFormatEE.cc:27
EcalFenixStripFormatEE::ecaltpgTPMode_
const EcalTPGTPMode * ecaltpgTPMode_
Definition: EcalFenixStripFormatEE.h:29
EcalFenixStripFormatEE::fgvb_
int fgvb_
Definition: EcalFenixStripFormatEE.h:27
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
EcalTPGTPMode::EnableEEOddFilter
bool EnableEEOddFilter
Definition: EcalTPGTPMode.h:18
EcalFenixStripFormatEE::setInput
int setInput(int input_even, int inputEvenPeak, int input_odd, int inputOddPeak, int fgvb)
Definition: EcalFenixStripFormatEE.cc:17
EcalTPGStripStatus::getMap
const std::map< uint32_t, uint16_t > & getMap() const
Definition: EcalTPGStripStatus.h:15
EcalFenixStripFormatEE::inputEvenPeak_
int inputEvenPeak_
Definition: EcalFenixStripFormatEE.h:22
EcalFenixStripFormatEE::input_odd_
int input_odd_
Definition: EcalFenixStripFormatEE.h:25
EcalTPGSlidingWindowMapIterator
std::map< uint32_t, uint32_t >::const_iterator EcalTPGSlidingWindowMapIterator
Definition: EcalTPGSlidingWindow.h:24
EcalTPGTPMode::DisableEEEvenPeakFinder
bool DisableEEEvenPeakFinder
Definition: EcalTPGTPMode.h:22
EcalTPGSlidingWindowMap
std::map< uint32_t, uint32_t > EcalTPGSlidingWindowMap
Definition: EcalTPGSlidingWindow.h:23
EcalTPGTPMode::FenixEEStripOutput
uint16_t FenixEEStripOutput
Definition: EcalTPGTPMode.h:24
EcalTPGStripStatusMapIterator
std::map< uint32_t, uint16_t >::const_iterator EcalTPGStripStatusMapIterator
Definition: EcalTPGStripStatus.h:25
EcalFenixStripFormatEE::stripStatus_
uint16_t stripStatus_
Definition: EcalFenixStripFormatEE.h:28
EcalFenixStripFormatEE::shift_
uint32_t shift_
Definition: EcalFenixStripFormatEE.h:26
EcalTPGTPMode::EnableEEOddPeakFinder
bool EnableEEOddPeakFinder
Definition: EcalTPGTPMode.h:20
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
EcalTPGTPMode::FenixEEStripInfobit2
uint16_t FenixEEStripInfobit2
Definition: EcalTPGTPMode.h:26
edm::Log
Definition: MessageLogger.h:70