CMS 3D CMS Logo

HGCalRawDataEmulatorInfo.cc
Go to the documentation of this file.
1 /****************************************************************************
2  *
3  * This is a part of HGCAL offline software.
4  * Authors:
5  * Laurent Forthomme, CERN
6  * Pedro Silva, CERN
7  *
8  ****************************************************************************/
9 
11 
12 //-----------------------------------------------
13 // ECON-D emulator info
14 //-----------------------------------------------
15 
17  bool bbit,
18  bool ebit,
19  bool tbit,
20  bool hbit,
21  bool sbit,
22  const std::vector<std::vector<bool> >& enabled_channels) {
23  header_bits_[StatusBits::O] = obit;
25  header_bits_[StatusBits::E] = ebit;
28  header_bits_[StatusBits::S] = sbit;
29  for (const auto& ch_en : enabled_channels)
30  erx_pois_.emplace_back(ch_en);
31 }
32 
34  header_bits_.reset();
35  erx_pois_.clear();
36 }
37 
38 void HGCalECONDEmulatorInfo::addERxChannelsEnable(const std::vector<bool>& erx_channels_poi) {
39  erx_pois_.emplace_back(erx_channels_poi);
40 }
41 
42 std::vector<bool> HGCalECONDEmulatorInfo::channelsEnabled(size_t ch_id) const {
43  std::vector<bool> ch_en;
44  ch_en.reserve(erx_pois_.size());
45  for (const auto& erx_channels_poi : erx_pois_)
46  ch_en.emplace_back(erx_channels_poi.at(ch_id));
47  return ch_en;
48 }
49 
51  return static_cast<HGCROCEventRecoStatus>(bitH() << 1 | bitT());
52 }
53 
54 //-----------------------------------------------
55 // Capture block emulator info
56 //-----------------------------------------------
57 
59  const HGCalECONDEmulatorInfo& econd_info) {
60  econd_info_[econd_id] = econd_info;
61 }
62 
63 //-----------------------------------------------
64 // S-link emulator info
65 //-----------------------------------------------
66 
68  const HGCalCaptureBlockEmulatorInfo& cb_info) {
69  cb_info_[cb_id] = cb_info;
70 }
71 
73  return cb_info_[cb_id];
74 }
std::unordered_map< unsigned int, HGCalECONDEmulatorInfo > econd_info_
Definition: APVGainStruct.h:7
std::vector< std::vector< bool > > erx_pois_
HGCalCaptureBlockEmulatorInfo & captureBlockEmulatedInfo(unsigned int)
std::vector< bool > channelsEnabled(size_t) const
std::unordered_map< unsigned int, HGCalCaptureBlockEmulatorInfo > cb_info_
HGCROCEventRecoStatus eventRecoStatus() const
void addERxChannelsEnable(const std::vector< bool > &)
HGCalECONDEmulatorInfo()=default
void addECONDEmulatedInfo(unsigned int, const HGCalECONDEmulatorInfo &)
Map of ECON-D emulator truth information within a capture block.
void addCaptureBlockEmulatedInfo(unsigned int, const HGCalCaptureBlockEmulatorInfo &)
long double T