CMS 3D CMS Logo

RPCAMCRawToDigi.h
Go to the documentation of this file.
1 #ifndef EventFilter_RPCRawToDigi_RPCAMCRawToDigi_h
2 #define EventFilter_RPCRawToDigi_RPCAMCRawToDigi_h
3 
6 
10 
11 namespace edm {
13  class Event;
14  class EventSetup;
15  class ParameterSet;
16  class Run;
17 } // namespace edm
18 
19 class RPCAMCUnpacker;
20 
22 public:
24  ~RPCAMCRawToDigi() override;
25 
26  static void compute_crc16_64bit(std::uint16_t &crc, std::uint64_t const &word);
27 
29 
30  void beginRun(edm::Run const &run, edm::EventSetup const &setup) override;
31  void produce(edm::Event &event, edm::EventSetup const &setup) override;
32 
33 protected:
34  bool processCDFHeaders(int fed,
35  std::uint64_t const *&word,
36  std::uint64_t const *&word_end,
37  std::uint16_t &crc,
38  RPCAMCLinkCounters &counters) const;
39  bool processCDFTrailers(int fed,
40  unsigned int nwords,
41  std::uint64_t const *&word,
42  std::uint64_t const *&word_end,
43  std::uint16_t &crc,
44  RPCAMCLinkCounters &counters) const;
45  bool processBlocks(int fed,
46  std::uint64_t const *&word,
47  std::uint64_t const *word_end,
48  std::uint16_t &crc,
49  RPCAMCLinkCounters &counters,
50  std::map<RPCAMCLink, rpcamc13::AMCPayload> &amc_payload) const;
51 
52 protected:
54 
55  bool calculate_crc_, fill_counters_;
56 
57  std::unique_ptr<RPCAMCUnpacker> rpc_unpacker_;
58 };
59 
61  std::uint16_t &crc, std::uint64_t const &word) { // overcome constness problem evf::compute_crc_64bit
62  unsigned char const *uchars(reinterpret_cast<unsigned char const *>(&word));
63  for (unsigned char const *uchar = uchars + 7; uchar >= uchars; --uchar) {
64  crc = evf::compute_crc_8bit(crc, *uchar);
65  }
66 }
67 
68 #endif // EventFilter_RPCRawToDigi_RPCAMCRawToDigi_h
static void compute_crc16_64bit(std::uint16_t &crc, std::uint64_t const &word)
edm::EDGetTokenT< FEDRawDataCollection > raw_token_
Definition: config.py:1
uint64_t word
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
unsigned long long uint64_t
Definition: Time.h:13
unsigned short compute_crc_8bit(unsigned short crc, unsigned char data)
Definition: CRC16.h:56
HLT enums.
std::unique_ptr< RPCAMCUnpacker > rpc_unpacker_
Definition: event.py:1
Definition: Run.h:45