CMS 3D CMS Logo

HGCalECONDEmulatorInfo.h
Go to the documentation of this file.
1 #ifndef EventFilter_HGCalRawToDigi_HGCalECONDEmulatorInfo_h
2 #define EventFilter_HGCalRawToDigi_HGCalECONDEmulatorInfo_h
3 
4 #include <bitset>
5 #include <vector>
6 
8 public:
9  HGCalECONDEmulatorInfo() = default;
11  bool obit, bool bbit, bool ebit, bool tbit, bool hbit, bool sbit, std::vector<uint64_t> enabled_channels = {}) {
12  header_bits_[StatusBits::O] = obit;
14  header_bits_[StatusBits::E] = ebit;
17  header_bits_[StatusBits::S] = sbit;
18  for (const auto& ch_en : enabled_channels)
19  pois_.emplace_back(ch_en);
20  }
21 
22  void addChannelsEnable(uint64_t poi) { pois_.emplace_back(poi); }
23  std::vector<bool> channelsEnabled(size_t ch_id) const {
24  std::vector<bool> ch_en;
25  for (const auto& poi : pois_)
26  ch_en.emplace_back(poi.test(ch_id));
27  return ch_en;
28  }
29 
31  HGCROCEventRecoStatus eventRecoStatus() const { return static_cast<HGCROCEventRecoStatus>(bitH() << 1 | bitT()); }
32 
33  bool bitO() const { return header_bits_.test(StatusBits::O); }
34  bool bitB() const { return header_bits_.test(StatusBits::B); }
35  bool bitE() const { return header_bits_.test(StatusBits::E); }
36  bool bitT() const { return header_bits_.test(StatusBits::T); }
37  bool bitH() const { return header_bits_.test(StatusBits::H); }
38  bool bitS() const { return header_bits_.test(StatusBits::S); }
39 
40 private:
41  enum StatusBits { O = 0, B, E, T, H, S };
42  std::bitset<6> header_bits_;
43  std::vector<std::bitset<37> > pois_;
44 };
45 
46 #endif
Definition: APVGainStruct.h:7
std::vector< std::bitset< 37 > > pois_
std::vector< bool > channelsEnabled(size_t ch_id) const
HGCalECONDEmulatorInfo(bool obit, bool bbit, bool ebit, bool tbit, bool hbit, bool sbit, std::vector< uint64_t > enabled_channels={})
HGCalECONDEmulatorInfo()=default
void addChannelsEnable(uint64_t poi)
unsigned long long uint64_t
Definition: Time.h:13
long double T
HGCROCEventRecoStatus eventRecoStatus() const